Comments (12)
+1 Awesome idea!
What I feel is instead of glyphsearch.com/?f=glyphicons
we should have something like glyphsearch.com/#?f=glyphicons
so that the page doesn't reload when we change the search query in the URL. What do you think @thomaspark?
from glyphsearch.
Hey @thomaspark,
I got up a quick working code on the offline.html
file. Check out jenil@1a9b4ca
from glyphsearch.
Hey @jenil27, not a bad start. Some things I noticed, hope you find it helpful:
- The question mark is missing for searches, but is present as expected when selecting a library.
- The hash mark is not needed.
- When going to a direct url, it often requires a hard reload to get the search loaded properly.
- In Chrome, the query string "blinks". It looks fine in other browsers.
from glyphsearch.
Hi @thomaspark,
- The hash was added so that when I change the URL parameters the page doesn't reload. If I do something like
window.location.search = url;
then the page will be reloaded. - The blink is because the query is processed after page load.
- The question mark was missing was fixed in jenil@30cca3c, this resolves the hard reload issue.
from glyphsearch.
Definitely should go with one or the other, but not both. I prefer ? since # can then still be used for anchor tags. Check out History.js for changing query strings without a reload.
f
and q
are cryptic, what if we went with library
and search
instead?
from glyphsearch.
Ya I agree we'll use more relevant works for the parameters. How about we use this http://spoiledmilk.com/blog/html5-changing-the-browser-url-without-refreshing-page/
from glyphsearch.
We'll probably want to use replaceState
instead of pushState
since our search updates with each character.
from glyphsearch.
Hey @thomaspark
Check out the latest changes at https://github.com/jenil27/glyphsearch/tree/development
from glyphsearch.
Nice start. Some comments:
- As mentioned in my last comment, we want to use
replaceState
rather thanpushState
. Right now, typing in a query pollutes the browser history since it adds an entry with each keystroke. - When loading a page with library and search, only search works. When loading only library or search, neither works.
- Can we avoid the ? in the URL on load?
- Instead of constructing the query string with your own changeURL function, consider using
jQuery.param()
. - Likewise, instead of having your own inline function to parse query string, consider using an external library like purl in combination with
jQuery.param()
. - The loader should be discussed in a separate issue/patch.
from glyphsearch.
Yes will shift to replaceState
and not use pushState
.
I will fix all the above issues and create a PR then. Also I don't think use for a library like purl is needed as parsing it isn't that complex.
from glyphsearch.
Awesome.
purl is available on Bower.
When you're ready to submit a PR, can you rebase and squash to a single commit?
from glyphsearch.
I guess this can now be closed 👍
from glyphsearch.
Related Issues (20)
- fa-share-alt missed
- Update FontAwesome to 4.4
- The copy fallback without flash does not respect the copy selector HOT 1
- Update FontAwesome to 4.5 HOT 1
- Copy as SVG HOT 7
- Search by unicode HOT 15
- no `master` branch? HOT 3
- Cleanup git history of large files (`bower_components`) HOT 8
- Offline fallback HOT 4
- Update FontAwesome to 4.6.1
- Update FontAwesome to 4.7 HOT 1
- Update to Octicons 5.0.1 HOT 1
- Error in icons-foundation.json HOT 1
- Material icons not working HOT 1
- Request - Add Payment font HOT 1
- Font Awesome 5 (Free) is out HOT 1
- Add FeatherIcons HOT 5
- Add Version selection
- Add Line Awesome HOT 1
- Material Icons update HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glyphsearch.