Import lightbox-fu (d5ba1da82f)
authorLunar <lunar@anargeek.net>
Wed, 30 Jun 2010 13:21:07 +0000 (15:21 +0200)
committerLunar <lunar@anargeek.net>
Wed, 30 Jun 2010 13:21:07 +0000 (15:21 +0200)
public/images/blank.gif [new file with mode: 0644]
public/images/overlay.png [new file with mode: 0644]
public/javascripts/jquery.lightBoxFu.js [new file with mode: 0755]
public/stylesheets/lightbox-fu-ie6.css [new file with mode: 0644]
public/stylesheets/lightbox-fu-ie7.css [new file with mode: 0644]

diff --git a/public/images/blank.gif b/public/images/blank.gif
new file mode 100644 (file)
index 0000000..1d11fa9
Binary files /dev/null and b/public/images/blank.gif differ
diff --git a/public/images/overlay.png b/public/images/overlay.png
new file mode 100644 (file)
index 0000000..1f0b273
Binary files /dev/null and b/public/images/overlay.png differ
diff --git a/public/javascripts/jquery.lightBoxFu.js b/public/javascripts/jquery.lightBoxFu.js
new file mode 100755 (executable)
index 0000000..79a093d
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * lightboxFu
+ *
+ * Copyright (c) 2008 Piotr Sarnacki (drogomir.com)
+ *
+ * Licensed under the MIT license:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *
+ */
+
+(function($) {
+  $.extend($, {lightBoxFu: {}});
+  $.extend($.lightBoxFu, {
+    initialize: function (o) {
+      if($('#lightboxfu').length == 0) {
+               options = {stylesheetsPath: '/stylesheets/', imagesPath: '/images/'};
+               jQuery.extend(options, o);
+        html = '<div id="lightboxfu" style="display: none"><div id="lOverlay"><div id="lWindow"><div id="lInner"></div></div></div></div>';
+               if ($.browser.msie && $.browser.version == '6.0') {
+                       html += '<link rel="stylesheet" type="text/css" href="'+options.stylesheetsPath+'lightbox-fu-ie6.css" />';
+                       $('body').css('background', 'url('+options.imagesPath+'blank.gif) fixed');
+               } else if($.browser.msie && $.browser.version == '7.0') {
+                       html += '<link rel="stylesheet" type="text/css" href="'+options.stylesheetsPath+'lightbox-fu-ie7.css" />';
+               }
+        $('body').append(html);
+               if(!$.browser.msie) {
+                       $('#lOverlay').css('background', 'url('+options.imagesPath+'overlay.png) fixed');
+               }
+        
+       $.lightBoxFu.appendStyle();
+      }
+    },
+    open: function(options) {
+      options = options || {};
+      $('#lInner').html(options.html);
+      $('#lightboxfu').show();
+      var width = options.width || '250';
+      $('#lInner').css({'width': width});
+      
+      if(options.closeOnClick != false) {
+        $('#lOverlay').one('click', $.lightBoxFu.close);
+      }
+    },
+    close: function() {
+      $('#lightboxfu').hide();
+    },
+    appendStyle: function() {
+      if(!$.browser.msie) {
+          $('#lOverlay').css({display: 'table'});
+          $('#lOverlay #lWindow').css({display: 'table-cell'});
+      }
+      $('#lOverlay').css({position: 'fixed', top: 0, left: 0, width: "100%", height: "100%"});
+      $('#lOverlay #lWindow').css({'vertical-align': 'middle'});
+      $('#lOverlay #lInner').css({width: '300px', 'background-color': '#fff', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', 'max-height': '350px', margin: '0 auto', padding: '15px', overflow: 'auto'});
+    }
+  });
+  
+  $.extend($.fn, {
+         lightBoxFu: function(options){
+                 return this.each(function() {
+        $(this).click(function() {
+                       $.lightBoxFu.open(options);
+          return false;
+        });
+      });
+  }});
+})(jQuery);
+
diff --git a/public/stylesheets/lightbox-fu-ie6.css b/public/stylesheets/lightbox-fu-ie6.css
new file mode 100644 (file)
index 0000000..46ed9c4
--- /dev/null
@@ -0,0 +1,43 @@
+#lightboxfu {\r
+  display: none;\r
+}\r
+\r
+#lOverlay {\r
+       background: none;\r
+       -ieh: expression(\r
+               this.parsed ? 0 : (\r
+                       img = document.createElement('div'),\r
+                       img.id = 'ov',\r
+                       this.parentNode.insertBefore(img, this),\r
+                       this.parsed = 1\r
+               )\r
+       )\r
+}\r
+\r
+#lOverlay, #ov {\r
+       position: absolute;\r
+       top: 0;\r
+       left: 0;\r
+       width: expression(document.documentElement.clientWidth + 'px');\r
+       height: expression(document.documentElement.clientHeight + 'px');\r
+       top: expression(\r
+               offset = 0 + parseInt(document.body.currentStyle.paddingTop) + parseInt(document.body.currentStyle.marginTop),\r
+               document.documentElement.scrollTop + offset + 'px'\r
+  );\r
+}\r
+\r
+#ov {\r
+       background-color: #000;\r
+       filter: progid:DXImageTransform.Microsoft.Alpha(opacity=60);\r
+}\r
+\r
+#lOverlay #lWindow {\r
+       position: absolute;\r
+       top: 50%;\r
+}\r
+\r
+#lOverlay #lInner {\r
+       position: relative;\r
+       top: -50%;\r
+       height: expression(this.scrollHeight > 350 ? '350px' : 'auto' );\r
+}\r
diff --git a/public/stylesheets/lightbox-fu-ie7.css b/public/stylesheets/lightbox-fu-ie7.css
new file mode 100644 (file)
index 0000000..e9200d7
--- /dev/null
@@ -0,0 +1,36 @@
+#lightboxfu {\r
+  display: none;\r
+}\r
+\r
+#lOverlay {\r
+       background: none;\r
+       -ieh: expression(\r
+               this.parsed ? 0 : (\r
+                       ov = document.createElement('div'),\r
+                       ov.id = 'ov',\r
+                       this.parentNode.insertBefore(ov, this),\r
+                       this.parsed = 1\r
+               )\r
+       )\r
+}\r
+\r
+#ov {\r
+       position: fixed;\r
+       left: 0;\r
+       top: 0;\r
+       width: 100%;\r
+       height: 100%;\r
+       background-color: #000;\r
+       filter: progid:DXImageTransform.Microsoft.Alpha(opacity=60);\r
+}\r
+\r
+#lOverlay #lWindow {\r
+       position: absolute;\r
+       top: 50%;\r
+}\r
+\r
+#lOverlay #lInner {\r
+       position: relative;\r
+       top: -50%;\r
+       height: expression(this.scrollHeight > 350 ? '350px' : 'auto' );\r
+}\r