Tag: javascript


Moving Greasemonkey Scripts To GitHub

August 18th, 2010 — 10:05pm

Recently I made a few amends to some Greasemonkey scripts I wrote a while back and, since I’ve been using git quite a bit recently, it made sense to me to move my Greasemonkey scripts onto GitHub.

So I did :) And here they are:

Comment » | javascript, web

Greasemonkey Open Selected Links Script

June 1st, 2010 — 10:02pm

I hadn’t done any monkeying around with Greasemonkey for a while until the other day when I came up with this script: http://github.com/ianoxley/open-selected-links

Any links that are present in the selected text will be opened on the mouseup event, except for the Cached and Similar links you get in Google search results.

If you’ve got and suggestions for improvements, let me know in the comments :)

UPDATE

The script has been updated so that you now have to press the Ctrl or Cmd key while selecting the text, in the same way that you would Ctrl / Cmd + click to open a link in a new tab.

Comment » | javascript

JavaScript WebKit Notifications API Demo With Flickr and JSONP

April 24th, 2010 — 10:12pm

I’ve been playing around with the JavaScript Notifications API recently – or to be a bit more specific the WebKit Notifications API – and put together this little demo using Flickr and JSONP:

  1. You search Flickr by entering a tag
  2. The JSONP callback function then displays the first few photos returned using the Notifications API
  3. Each notification is cancelled after 10 seconds (there is no Dismiss button, like there is when you use the API on localhost)

You’ll need to grant notification permissions first to be able to view the notifications – you should see an info bar like the one below the first time you click on Search:

WebKit Notifications API requestPermission screenshot

After that, you should see the notifications stack up in the bottom right-hand corner of your screen:

Screenshot of the notifications

At the time of writing, you’ll need to be using Google Chrome for the demo to work (although I’m pretty sure that support for the Notifications API in Safari is imminent).

And, as an aside, I managed to throw a bit of HTML 5 into the demo as well with some autofocus and placeholder attributes on the <input type="text" /> field, just for good measure :)

Comment » | javascript

A Simple jQuery Print Page Plugin

February 26th, 2010 — 9:25pm

The other day I was after a really simple way to add a print page link to a page to, well, er, print it.  So I came up with my jQuery Print Page plugin and stuck it on GitHub with a demo page: http://github.com/ianoxley/jqueryprintpage

This really is nothing fancy: it’s just a convenient way of adding an <a> tag plus an event-handler to a page to print it. Using it is as simple as, well, using File -> Print. But you can’t style the File menu with CSS so this is much more fun :-)

Comment » | javascript

Lorem Ipsum Bookmarklet

October 16th, 2009 — 8:57pm

I often use a couple of paragraphs of Lipsum when testing forms containing <textarea> tags and have had this bookmarklet I cobbled together sitting on my Bookmarks Toolbar for a while now.

Anyway, I thought it might be fun to hook it up to a HTML 5 form to let you customise how many paragraphs of Lipsum you want each time you click it. So that’s what I went and did:

Lorem Ipsum Bookmarklet Generator

Hopefully it’ll save you a few mouse clicks next time you’re testing some forms.

(Please note that the form used in the generator uses the <input type="range" /> HTML 5 tag which currently works best in the latest version of Opera. YMMV when using other browsers).

Comment » | devtools

jQuery Form Focus Plugin Released

June 9th, 2008 — 9:49pm

I have released the first version of my jQuery Form Focus plugin. This lets you set the initial focus on any form element but is careful not to set the focus if the user has already started filling in the form. To use it you call something like:

$('#username').formFocus();
$('form input:first').formFocus();
$('form#options input[type="checkbox"]:first').formFocus();

Hope you find it useful.

Comment » | javascript

OpenSearch Added to Unobtrusive JavaScript Google Co-op Search

February 5th, 2008 — 9:06pm

I have added OpenSearch to my Google Co-op Search Engine Unobtrusive JavaScript. Now you use the search engine in OpenSearch aware browsers you can add it to the browser’s search box.

Comment » | javascript

Unobtrusive JavaScript

December 19th, 2007 — 9:13pm

I have been playing around with Google Co-op recently and have created Unobtrusive JavaScript: a custom search engine that focuses on unobtrusive JavaScript knowledge and tips from leading JavaScript experts. Please give it a try and let me know what you think.

Comment » | javascript

Back to top