thomaspark / glyphsearch

Search for icons from Font Awesome, Glyphicons, IcoMoon, Ionicons, and Octicons

Home Page:https://glyphsearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Click to copy

fitztrev opened this issue · comments

I know it does the javascript prompt now with the class pre-selected. But would it be possible to make it automatically copy to the clipboard?

And possibly going one step further, giving users the option of which format they would like the snippet in (for example, either fa fa-check or <i class="fa fa-check"></i>). Kind of like flatuicolors.com.

Good idea. For copy/paste, ZeroClipboard looks like the way to go.

Hello guys,

I quickly added ZeroClipboard and got it working, although there is refining needed and there is one issue:

When you hover an icon the zeroclipboard-is-hover class is added but it does not get removed when mouse out occurs. We still need to fix this.

Hey Jenil, thanks for the PR. Are you planning to add the mouseout?

I tried it out and it seems that the Flash objects aren't positioned perfectly over each entry. This might be a solution:
http://stackoverflow.com/questions/13330306/zeroclipboard-glue-on-different-co-ordinates-when-control-change-its-position

We'll also want to do feature detection (e.g., Modernizr) and fall back to the old prompt when Flash isn't available.

Hey Thomas,

I added the feature detection if flash isn't available.

Also, I checked the solution you suggested and it still didn't work. Although for the time being I have added a work around using mouseout.

Awesome! It's working well for me. Just added a few inline comments.

Aside from those, some related issues to note (which we can open separate issues for):

  • add to index
  • on copy, add feedback that fades automatically, so people don't have to click the dialog to dismiss it (like http://flatuicolors.com/).
  • there's a slight flicker on hover due to both .entry:hover and .zeroclipboard-is-hover changing background color. Only one should be in effect any given time, and any flicker/delay can be made less obvious with a more subtle change (like http://flatuicolors.com/) and perhaps a transition.

Great!

I will work on the issues soon. Also I am planning to add the old copy functionality as a fallback if flash isn't available.

Landed in 4c5a7f1.