From 389163989ec14b7b371b563f7fd4c701ec6242bb Mon Sep 17 00:00:00 2001 From: Joel Courtney Date: Sun, 11 Jul 2010 23:57:48 +1000 Subject: [PATCH] first commit --- README | 0 flickr-smaller.user.js | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 README create mode 100644 flickr-smaller.user.js diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/flickr-smaller.user.js b/flickr-smaller.user.js new file mode 100644 index 0000000..285ac40 --- /dev/null +++ b/flickr-smaller.user.js @@ -0,0 +1,40 @@ +// ==UserScript== +// @name Flickr Smallerifier +// @namespace http://github.com/jufemaiz/jmc_flickr_gm_flickr-smaller +// @description Toggle the appearance of the map on the new flickr page. +// @include http://*flickr.com/photos/* +// +// ==/UserScript== +// + +var $; + + if (typeof unsafeWindow.jQuery == 'undefined') { + var GM_Head = document.getElementsByTagName('head')[0] || document.documentElement, + GM_JQ = document.createElement('script'); + + // ...then load up the jQuery interface + GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'; + GM_JQ.type = 'text/javascript'; + GM_JQ.async = true; + + GM_Head.insertBefore(GM_JQ, GM_Head.firstChild); + } + GM_wait(); + + // Check if jQuery's loaded + function GM_wait() { + if (typeof unsafeWindow.jQuery == 'undefined') { + window.setTimeout(GM_wait, 100); + } else { + $ = unsafeWindow.jQuery.noConflict(true); + letsJQuery(); + } + } + + // Load 'em up! + function letsJQuery(){ + // Photo element + var image = $('#photo .photo-div img')[0]; + image.attr('src',image.attr('src').replace(/_z\./, "")); + } \ No newline at end of file