You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Advertise
Best Hosting Service
Categories
- CMS Tools (1)
- Coding (6)
- CSS (13)
- Fonts (16)
- Freelance (16)
- Graphics (880)
- HTML (6)
- Icons (21)
- Illustrator (1)
- Inspiration (45)
- Interviews (8)
- IPhone (1)
- Java Script (4)
- Jquery (1)
- Logos (7)
- Marketing (5)
- Megento (1)
- Mobile Apps Development (2)
- News Letter (1)
- Photoshop (5)
- Resources (3)
- Responsive Design (2)
- Tutorials (4)
- Twitter (6)
- UI Design (1)
- UX Design (3)
- Wallpapers (7)
- Web Design (45)
- WordPress (23)
- Work (9)
Tags
3D
Artworks
brush
clients
Create
CSS
CSS3
design
designs
developers
Download free fonts
Fonts
Free
free fonts
Free Icons
Freelance
freelance websites
Graphics
Icon
Icons
Illustration
Illustrations
Illustrator
Inspiration
Inspirational
Interview
Javascript
Logos
Photo
photos
Photoshop
portfolio
Poster design
Texture
themes
tutorial
tutorials
Twitter
Typography
UI design
Vector
Web Design
Websites
WordPress
Wordpress Themes



Tricks
I’ve added two new buttons to all of the code snippets in the Snippets section of the site. Now a button to add directly to Snippets.app and a button to directly copy to the clipboard join the Coda and Textmate buttons.
Read on for some more details about them, and remember, you can help the Snippets section grow by submitting yours.
Snippets.app button
One-click adding to Snippets.app
Snippets.app supports a URL protocol thingy. That is, once the application installed, browsers on your system know that when a URL is entered that begins with “snippets:” (instead of like http://) that it should launch (or ask you to launch) Snippets.app and do something with that URL.
Their format is:
You’ll only see this once if you check the box.
Since all my code snippets are in <pre> elements, this is how I add the Snippets.app button to each code block (simplified):
Copy to Clipboard
This button is powered by the awesome Zero Clipboard. For a while after Flash 10 came out, copying to clipboard from the web was borked as Flash 10 had some new security restrictions that blocked the previous methods (Yeah, apparently Flash is needed to have this work correctly). Zero Clipboard stepped it up and fixed it somehow.
One-click copying to clipboard
One particular challenge here was with the rollover technique I’m using to display the “tooltip” like text for each button. On the three other buttons, I do a simple thing where I append a span to the anchor link on hover, and remove it on the hover callback:
The span is styled and positioned with CSS.
The problem is, Zero Clipboard works by positioning a completely transparent flash embed over top of the button. This means there is no traditional hover even fired when the mouse goes over this area. Fortunately, Zero Clipboard provides event listeners which you can have fire callback functions for you. See the last two lines:
Those two functions, copyMouseOver and copyMouseOut are used to do the same span-applying-and-removing business the other buttons use. The one tricky-dick thing left is that these functions need to know which parent element to deal with, in the case of multiple snippets on a single page. Fortunately they automatically pass the object to the function which is loaded with info about that element, including the ID, which I use to specify which code snippet button we are talking about:
I wanted to make sure there was a bit of user feedback when a clip was successfully copied to the clipboard, so you’ll notice that the clip itself quickly fades down and back up after a successful copy. Somewhat subtle but I think it’s fairly satisfying.
Coda and TextMate
Not much has changed here. I covered how to add Coda buttons in a previous tutorial. David Walsh covered the TextMate button, which requires some fancy server side action.
Seem to work OK?
Give it a test and let me know… I’ve heard some musings of FAIL on Twitter but all the buttons seem to work OK for me. If you want to do a FAIL report, please attempt to be helpful and explain which button isn’t working, the browser/version/platform, and what actually happens.
Macity Mac Mac Mac
Yeah all the integrations are Mac software. Sorry about that, that’s just how I roll. If there was a PC program that supported a URL protocol thingy, I’d check it out and see what I could do about integrating it. For now, the copy to clipboard thing should be useful still.
Multiple Login Forms with Highlighting
Posted: 23 Feb 2010 05:12 AM PST
This is a little specific… but I figured what the heck maybe it will be useful for someone. I recently had occasion to make multiple different login forms on a single page. With CSS we know we can apply styling to active inputs with :active. That’s useful… and we’ve covered how to do both input and label highlighting before. But now we need go one step up and highlight the current form itself.
continue reading…
Related Posts