summaryrefslogtreecommitdiff
path: root/lib/plugins/extension/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plugins/extension/script.js')
-rw-r--r--lib/plugins/extension/script.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/plugins/extension/script.js b/lib/plugins/extension/script.js
new file mode 100644
index 000000000..f2a6aae50
--- /dev/null
+++ b/lib/plugins/extension/script.js
@@ -0,0 +1,34 @@
+jQuery(function(){
+
+
+ /**
+ * very simple lightbox
+ * @link http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/super-simple-lightbox-with-css-and-jquery/
+ */
+ jQuery('a.extension_screenshot').click(function(e) {
+ e.preventDefault();
+
+ //Get clicked link href
+ var image_href = jQuery(this).attr("href");
+
+ // create lightbox if needed
+ var $lightbox = jQuery('#plugin__extensionlightbox');
+ if(!$lightbox.length){
+ $lightbox = jQuery('<div id="plugin__extensionlightbox"><p>Click to close</p><div></div></div>')
+ .appendTo(jQuery('body'))
+ .hide()
+ .click(function(){
+ $lightbox.hide();
+ });
+ }
+
+ // fill and show it
+ $lightbox
+ .show()
+ .find('div').html('<img src="' + image_href + '" />');
+
+
+ return false;
+ });
+
+}); \ No newline at end of file