WP Lightbox 2 - Version 2.21

Version Description

  • Image Map
  • Shrink large images to fit smaller screens.
Download this release

Release Info

Developer masdiblogs
Plugin Icon 128x128 WP Lightbox 2
Version 2.21
Comparing to
See all releases

Version 2.21

Files changed (48) hide show
  1. I18n/howtouse.html +44 -0
  2. I18n/wp-lightbox-2.pot +46 -0
  3. about.php +12 -0
  4. readme.txt +95 -0
  5. screenshot-1.png +0 -0
  6. screenshot-2.png +0 -0
  7. screenshot-3.png +0 -0
  8. styles/images/blank.gif +0 -0
  9. styles/images/close.gif +0 -0
  10. styles/images/closelabel.gif +0 -0
  11. styles/images/cs_CZ/blank.gif +0 -0
  12. styles/images/cs_CZ/close.gif +0 -0
  13. styles/images/cs_CZ/closelabel.gif +0 -0
  14. styles/images/cs_CZ/loading.gif +0 -0
  15. styles/images/cs_CZ/next.gif +0 -0
  16. styles/images/cs_CZ/nextlabel.gif +0 -0
  17. styles/images/cs_CZ/prev.gif +0 -0
  18. styles/images/cs_CZ/prevlabel.gif +0 -0
  19. styles/images/he_IL/blank.gif +0 -0
  20. styles/images/he_IL/close.gif +0 -0
  21. styles/images/he_IL/closelabel.gif +0 -0
  22. styles/images/he_IL/loading.gif +0 -0
  23. styles/images/he_IL/next.gif +0 -0
  24. styles/images/he_IL/nextlabel.gif +0 -0
  25. styles/images/he_IL/prev.gif +0 -0
  26. styles/images/he_IL/prevlabel.gif +0 -0
  27. styles/images/loading.gif +0 -0
  28. styles/images/next.gif +0 -0
  29. styles/images/nextlabel.gif +0 -0
  30. styles/images/pl_PL/closelabel.gif +0 -0
  31. styles/images/prev.gif +0 -0
  32. styles/images/prevlabel.gif +0 -0
  33. styles/images/ru_RU/blank.gif +0 -0
  34. styles/images/ru_RU/close.gif +0 -0
  35. styles/images/ru_RU/closelabel.gif +0 -0
  36. styles/images/ru_RU/loading.gif +0 -0
  37. styles/images/ru_RU/next.gif +0 -0
  38. styles/images/ru_RU/nextlabel.gif +0 -0
  39. styles/images/ru_RU/prev.gif +0 -0
  40. styles/images/ru_RU/prevlabel.gif +0 -0
  41. styles/lightbox.css +149 -0
  42. styles/lightbox.min.cs_CZ.css +1 -0
  43. styles/lightbox.min.css +1 -0
  44. styles/lightbox.min.pl_PL.css +2 -0
  45. styles/lightbox.min.ru_RU.css +1 -0
  46. wp-lightbox-2.js +504 -0
  47. wp-lightbox-2.min.js +1 -0
  48. wp-lightbox-2.php +291 -0
I18n/howtouse.html ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2>How to Use:</h2>
2
+ <ol>
3
+ <li>You can use WordPress image galleries and have them grouped and auto-lightboxed: <a href="http://codex.wordpress.org/Gallery_Shortcode"><code>[gallery link="file"]</code></a></li>
4
+ <li>You can also add a <code>rel="lightbox"</code> attribute to any link tag to activate the lightbox. For example:
5
+ <pre><code> &lt;a href=&quot;images/image-1.jpg&quot; rel=&quot;lightbox&quot; title=&quot;my caption&quot;&gt;image #1&lt;/a&gt;</code></pre>
6
+ <em>Optional:</em> Use the <code>title</code> attribute if you want to show a caption.
7
+ </li>
8
+ <li>If you have a set of related images that you would like to group, simply include a group name in the rel attribute. For example:
9
+ <pre><code> &lt;a href=&quot;images/image-1.jpg&quot; rel=&quot;lightbox[roadtrip]&quot;&gt;image #1&lt;/a&gt;
10
+ &lt;a href=&quot;images/image-2.jpg&quot; rel=&quot;lightbox[roadtrip]&quot;&gt;image #2&lt;/a&gt;
11
+ &lt;a href=&quot;images/image-3.jpg&quot; rel=&quot;lightbox[roadtrip]&quot;&gt;image #3&lt;/a&gt;</code></pre>
12
+ No limits to the number of image sets per page or how many images are allowed in each set. Go nuts!</li>
13
+ <li>To <strong>disable</strong> lightboxing of an image link, just set any other rel-attribute: <code>rel="nobox"</code></li>
14
+ </ol>
15
+ <h2>For developers:</h2>
16
+ <ol>
17
+ <li>Always have <code>wp_footer();</code> just before the closing &lt;/body&gt; tag of your theme, or you will break many plugins, which generally use this hook to reference JavaScript files</li>
18
+ <li>Apply lightbox to any content by running <code>jqlb_apply_lightbox($your_content, "any ID");</code> It returns a string with all image links lightboxed, grouped by "any id"</li>
19
+ <li>Many JavaScript optimizers, combiners, minifiers, etc. conflict with <a href="http://codex.wordpress.org/Function_Reference/wp_localize_script2"><code>wp_localize_script()</code></a>, used to configure this plugin and many others.
20
+ <ul style="list-style-type: circle;margin-left: 24px;">
21
+ <li>If you experience problems with jQuery Lightbox, please disable all JavaScript-optimizing plugins. (Optimize Scripts, W3 Total Cache, WP Minify etc)</li>
22
+ <li>If you develop JavaScript optimizers for WordPress, please play nice with the default API...</li>
23
+ </ul>
24
+ </li>
25
+ </ol>
26
+ <h2>Credits</h2><ul style="list-style-type: circle;margin-left: 24px;">
27
+ <li>Based on wp-jquery-lightbox was created by <a href="http://www.ulfben.com">Ulf Benjaminsson</a> (who <a href="http://amzn.com/w/2QB6SQ5XX2U0N">appreciates books</a>). :)</li>
28
+ <li>wp-lightbox-2 borrowed the regexp from <a href="http://stimuli.ca/lightbox/">LightBox-2 by Rupert Morris</a> to apply lightbox-rel without clobbering manual inputs.</li>
29
+ <li><a href="http://onlinewebapplication.com/2011/11/wp-lightbox-2.html">WP Lightbox 2</a> is based on <a href="http://www.huddletogether.com/projects/lightbox2/">Lightbox 2 by Lokesh Dhakar</a></li>
30
+ </ul>
31
+
32
+ <h2>Changes to Lightbox-script:</h2><p style="margin-left: 24px;">
33
+ Takes the WordPress admin bar into consideration.<br />
34
+ Resizing code manages <strong>both</strong> height and width and never destroy aspect ratio.<br />
35
+ Scaling routines now maximize images fully while taking captions into account.<br />
36
+ Added support for browser resizing and orientation changes - allowing images to <em>remain</em> optimally scaled and centered.<br />
37
+ WP Lightbox 2 rely on <code>rel="lightbox"</code> instead of <code>class="lightbox"</code>, since rel is what all the previous *box-scripts used.<br />
38
+ Replaced explicit IMG-urls with divs styled through the CSS. (see: <code>jqlb_loading</code> and <code>jqlb_closelabel</code> divs).<br />
39
+ Can grab titles and captions from the WordPress Media Gallery-output (<a href="http://codex.wordpress.org/Gallery_Shortcode">[gallery]</a>, "insert attachments" etc).<br />
40
+ Grabs image title if the link lacks one<br />
41
+ Honors empty titles.<br />
42
+ Uses WordPress API to localize script (with safe fallbacks).<br />
43
+ </p>
44
+
I18n/wp-lightbox-2.pot ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2010
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: \n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-lightbox-2\n"
7
+ "POT-Creation-Date: 2011-11-27 17:40:12+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: options.php:17
16
+ msgid "WP Lightbox 2 Options"
17
+ msgstr ""
18
+
19
+ #: options.php:22
20
+ msgid "Lightbox Appearance"
21
+ msgstr ""
22
+
23
+ #: options.php:54
24
+ msgid "If in doubt, try the Black theme"
25
+ msgstr ""
26
+
27
+ #: options.php:58
28
+ msgid "Auto-lightbox image links"
29
+ msgstr ""
30
+
31
+ #: options.php:68
32
+ msgid "Let the plugin add necessary html to image links"
33
+ msgstr ""
34
+
35
+ #: options.php:71
36
+ msgid "Shrink large images to fit smaller screens"
37
+ msgstr ""
38
+
39
+ #: options.php:81
40
+ msgid ""
41
+ "Note: <u>Excessively large images</u> waste bandwidth and slow browsing!"
42
+ msgstr ""
43
+
44
+ #: options.php:87
45
+ msgid "Save Changes"
46
+ msgstr ""
about.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style type="text/css">
2
+ #about{ float: right; width:250px; background: #ffc; border: 1px solid #333; padding: 5px; text-align: justify; }
3
+ #about p, li, ol{ font-family:verdana; font-size:11px; }
4
+ #about h3 {text-align:center;}
5
+ .field_info {text-align:right;};
6
+ </style>
7
+ <?php echo "<div id='about'>
8
+ <h3>From the author</h3>
9
+ <p>My name is <a href='http://onlinewebapplication.com/'>Pankaj Jha</a> and I've developed WP Lightbox 2. Nice to meet you! :)<p>
10
+ <p>Feel free to post any issues <a href='http://onlinewebapplication.com/2011/11/wp-lightbox-2.html' target='_blank'>here </a><p>
11
+ </div>";
12
+ ?>
readme.txt ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP Lightbox 2 ===
2
+ Contributors: masdiblogs
3
+ Plugin Site: http://onlinewebapplication.com/
4
+ Donate link: http://onlinewebapplication.com/onlinewebapplication-com-donation/
5
+ Tags: lightbox, WP Lightbox, AJAX, image, photo, picture, JQuery WP Image Plugin, colorbox
6
+ Requires at least: 2.8
7
+ Tested up to: 3.4.1
8
+ Stable tag: 3.0.0
9
+ License: GPLv2 or later
10
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
+
12
+ This plugin used to add the lightbox (overlay) effect to the current page images on your WordPress blog.
13
+ == Description ==
14
+ From 2.1, the default view changed to Colorbox due to the license regulation by the plugin directory. This plugin used to add the lightbox (overlay) effect to the current page images on your WordPress blog. Used to overlay images on the current page. Extension of wp-jquery-lightbox.
15
+
16
+ Just install and sit back. This plugin enable image overlay lighbox effect for all the post images in your wordpress plugin. No configuration required.
17
+
18
+ Feature:
19
+
20
+ 1. Works on all modern browsers.
21
+ 2. Group related images in post and navigate through them with ease.
22
+ 3. Backwards Compatibility.
23
+ 4. No configuration required.
24
+ 5. 5 Inbuilt theme.
25
+ 6. Lightbox display of Gallery.
26
+
27
+ <br />
28
+ [Author Site](http://onlinewebapplication.com)|
29
+ [Plugin Home Page](http://onlinewebapplication.com/2011/11/wp-lightbox-2.html)
30
+ <br />
31
+ <br />
32
+ == Installation ==
33
+
34
+ To do a new installation of the plugin, please follow these steps
35
+
36
+ 1. Download the zipped plugin file to your local machine.
37
+ 2. Unzip the file.
38
+ 3. Upload the `WP-lightbox-2` folder to the `/wp-content/plugins/` directory.
39
+ 4. Activate the plugin through the 'Plugins' menu in WordPress.
40
+ 5. Optionally, go to the Options page and select a new Lightbox colour scheme.
41
+
42
+ <br />
43
+ [How to use WP Lighbox 2](http://onlinewebapplication.com/2012/08/how-to-use-wp-lightbox-2-wordpress-plugin.html)<br />
44
+
45
+ == Frequently Asked Questions ==
46
+
47
+ Question: Why does not plugin is working for me?
48
+
49
+ Answers: Check the following reasons:
50
+ You have changed the plugin folder`s name to something other than wp-lightbox-2.
51
+
52
+ The problem is with your WordPress theme, mangling image display properties. Use another theme, that does not interfere with posted images.
53
+
54
+ You have other plugins that conflict with Lightbox
55
+
56
+ Disable your other plugins and see if that helps. If it does, re-enable each plugin, one at a time to see which one is causing the conflict.
57
+
58
+ Question: It does not work properly in Browser X (Explorer 6, 7, etc)?
59
+
60
+ Answer: Yes it does. The problem is with your WordPress theme, mangling image display properties. Use another theme, or change your theme`s Cascading Style Sheets (CSS).
61
+
62
+ <br />
63
+ You can check more FAQ on plugin website URL :<br />
64
+ [WP Lightbox 2](http://onlinewebapplication.com/2011/11/wp-lightbox-2.html)<br />
65
+
66
+
67
+ == Screenshots ==
68
+
69
+ You can check Screen Shots on plugin website URL :<br />
70
+ [WP Lightbox 2](http://onlinewebapplication.com/2011/11/wp-lightbox-2.html)<br />
71
+
72
+ == Changelog ==
73
+ = 2.21 =
74
+ * Image Map
75
+ * Shrink large images to fit smaller screens.
76
+
77
+ = 2.2 =
78
+ * Bug Fixed [Can't install update](http://wordpress.org/support/topic/plugin-wp-lightbox-2-cant-installa-update).
79
+
80
+ = 2.1 =
81
+ * Default view changed to Colorbox due to the license regulation by the plugin directory.
82
+
83
+ = 2.0 =
84
+ * List versions.
85
+ * Works on all modern browsers.
86
+ * Group related images in post and navigate through them with ease.
87
+ * Backwards Compatibility.
88
+ * No configuration required.
89
+ * 5 Inbuilt theme.
90
+ * Lightbox display of Gallery.
91
+
92
+ == Upgrade Notice ==
93
+
94
+ = 2.1 =
95
+ Default view changed to Colorbox due to the license regulation by the plugin directory.
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
styles/images/blank.gif ADDED
Binary file
styles/images/close.gif ADDED
Binary file
styles/images/closelabel.gif ADDED
Binary file
styles/images/cs_CZ/blank.gif ADDED
Binary file
styles/images/cs_CZ/close.gif ADDED
Binary file
styles/images/cs_CZ/closelabel.gif ADDED
Binary file
styles/images/cs_CZ/loading.gif ADDED
Binary file
styles/images/cs_CZ/next.gif ADDED
Binary file
styles/images/cs_CZ/nextlabel.gif ADDED
Binary file
styles/images/cs_CZ/prev.gif ADDED
Binary file
styles/images/cs_CZ/prevlabel.gif ADDED
Binary file
styles/images/he_IL/blank.gif ADDED
Binary file
styles/images/he_IL/close.gif ADDED
Binary file
styles/images/he_IL/closelabel.gif ADDED
Binary file
styles/images/he_IL/loading.gif ADDED
Binary file
styles/images/he_IL/next.gif ADDED
Binary file
styles/images/he_IL/nextlabel.gif ADDED
Binary file
styles/images/he_IL/prev.gif ADDED
Binary file
styles/images/he_IL/prevlabel.gif ADDED
Binary file
styles/images/loading.gif ADDED
Binary file
styles/images/next.gif ADDED
Binary file
styles/images/nextlabel.gif ADDED
Binary file
styles/images/pl_PL/closelabel.gif ADDED
Binary file
styles/images/prev.gif ADDED
Binary file
styles/images/prevlabel.gif ADDED
Binary file
styles/images/ru_RU/blank.gif ADDED
Binary file
styles/images/ru_RU/close.gif ADDED
Binary file
styles/images/ru_RU/closelabel.gif ADDED
Binary file
styles/images/ru_RU/loading.gif ADDED
Binary file
styles/images/ru_RU/next.gif ADDED
Binary file
styles/images/ru_RU/nextlabel.gif ADDED
Binary file
styles/images/ru_RU/prev.gif ADDED
Binary file
styles/images/ru_RU/prevlabel.gif ADDED
Binary file
styles/lightbox.css ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP jQuery Lightbox
3
+ * Version 1.3.4 - 2011-12-29
4
+ * http://wordpress.org/extend/plugins/wp-jquery-lightbox/
5
+ */
6
+ #lightbox{
7
+ position: absolute;
8
+ left: 0;
9
+ width: 100%;
10
+ z-index: 10100;/*twentyeleven keeps the header at 999...*/
11
+ text-align: center;
12
+ line-height: 0;
13
+ }
14
+
15
+ #jqlb_loading{
16
+ height:32px;
17
+ background-image:url('./images/loading.gif');
18
+ background-repeat:no-repeat;
19
+ background-position:center center;
20
+ }
21
+ #jqlb_closelabel{
22
+ height:22px;
23
+ background-image:url('./images/closelabel.gif');
24
+ background-repeat:no-repeat;
25
+ background-position:center center;
26
+ }
27
+
28
+ #lightbox a img{ border: none; }
29
+
30
+ #outerImageContainer{
31
+ position: relative;
32
+ background-color: #fff;
33
+ width: 250px;
34
+ height: 250px;
35
+ margin: 0 auto;
36
+ }
37
+
38
+ #imageContainer{
39
+ padding: 10px;
40
+ }
41
+
42
+ #loading{
43
+ position: absolute;
44
+ top: 40%;
45
+ left: 0%;
46
+ height: 25%;
47
+ width: 100%;
48
+ text-align: center;
49
+ line-height: 0;
50
+ }
51
+ #hoverNav{
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ height: 100%;
56
+ width: 100%;
57
+ z-index: 10;
58
+ }
59
+ #imageContainer>#hoverNav{ left: 0;}
60
+ #hoverNav a{ outline: none;}
61
+
62
+ #prevLink, #nextLink{
63
+ width: 45%;
64
+ height: 100%;
65
+ background: transparent url('./images/blank.gif') no-repeat; /* Trick IE into showing hover */
66
+ display: block;
67
+ }
68
+ #prevLink { left: 0; float: left;}
69
+ #nextLink { right: 0; float: right;}
70
+ #prevLink:hover, #prevLink:visited:hover { background: url('./images/prev.gif') left 50% no-repeat; }
71
+ #nextLink:hover, #nextLink:visited:hover { background: url('./images/next.gif') right 50% no-repeat; }
72
+
73
+ /*** START : next / previous text links ***/
74
+ #nextLinkText, #prevLinkText{
75
+ color: #FF9834;
76
+ font-weight:bold;
77
+ text-decoration: none;
78
+ }
79
+ #nextLinkText{
80
+ padding-left: 20px;
81
+ }
82
+ #prevLinkText{
83
+ padding-right: 20px;
84
+ }
85
+ #downloadLink{
86
+ margin-left: 10px;
87
+ }
88
+ /*** END : next / previous text links ***/
89
+ /*** START : added padding when navbar is on top ***/
90
+
91
+ .ontop #imageData {
92
+ padding-top: 5px;
93
+ }
94
+
95
+ /*** END : added padding when navbar is on top ***/
96
+
97
+ #imageDataContainer{
98
+ font: 10px Verdana, Helvetica, sans-serif;
99
+ background-color: #fff;
100
+ margin: 0 auto;
101
+ line-height: 1.4em;
102
+ }
103
+
104
+ #imageData{
105
+ padding:0 10px;
106
+ }
107
+ #imageData #imageDetails{ width: 70%; float: left; text-align: left; }
108
+ #imageData #caption{ font-weight: bold; }
109
+ #imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em; }
110
+ #imageData #bottomNavClose{ width: 66px; float: right; padding-bottom: 0.7em; }
111
+ #imageData #helpDisplay {clear: left; float: left; display: block; }
112
+
113
+ #overlay{
114
+ position: absolute;
115
+ top: 0;
116
+ left: 0;
117
+ z-index: 10090;
118
+ width: 100%;
119
+ height: 500px;
120
+ background-color: #000;
121
+ filter:alpha(opacity=60);
122
+ -moz-opacity: 0.6;
123
+ opacity: 0.6;
124
+ display: none;
125
+ }
126
+
127
+
128
+ .clearfix:after {
129
+ content: ".";
130
+ display: block;
131
+ height: 0;
132
+ clear: both;
133
+ visibility: hidden;
134
+ }
135
+
136
+ * html>body .clearfix {
137
+ display: inline-block;
138
+ width: 100%;
139
+ }
140
+
141
+ * html .clearfix {
142
+ /* Hides from IE-mac \*/
143
+ height: 1%;
144
+ /* End hide from IE-mac */
145
+ }
146
+
147
+ #lightboxIframe {
148
+ display: none;
149
+ }
styles/lightbox.min.cs_CZ.css ADDED
@@ -0,0 +1 @@
 
1
+ #lightbox{position:absolute;left:0;width:100%;z-index:10100;text-align:center;line-height:0}#jqlb_loading{height:32px;background-image:url('./images/cs_CZ/loading.gif');background-repeat:no-repeat;background-position:center center}#jqlb_closelabel{height:22px;background-image:url('./images/cs_CZ/closelabel.gif');background-repeat:no-repeat;background-position:center center}#lightbox a img{border:none}#outerImageContainer{position:relative;background-color:#fff;width:250px;height:250px;margin:0 auto}#imageContainer{padding:10px}#loading{position:absolute;top:40%;left:0;height:25%;width:100%;text-align:center;line-height:0}#hoverNav{position:absolute;top:0;left:0;height:100%;width:100%;z-index:10}#imageContainer>#hoverNav{left:0}#hoverNav a{outline:none}#prevLink,#nextLink{width:45%;height:100%;background:transparent url('./images/cs_CZ/blank.gif') no-repeat;display:block}#prevLink{left:0;float:left}#nextLink{right:0;float:right}#prevLink:hover,#prevLink:visited:hover{background:url('./images/cs_CZ/prev.gif') left 50% no-repeat}#nextLink:hover,#nextLink:visited:hover{background:url('./images/cs_CZ/next.gif') right 50% no-repeat}#nextLinkText,#prevLinkText{color:#ff9834;font-weight:bold;text-decoration:none}#nextLinkText{padding-left:20px}#prevLinkText{padding-right:20px}.ontop #imageData{padding-top:5px}#imageDataContainer{font:10px Verdana,Helvetica,sans-serif;background-color:#fff;margin:0 auto;line-height:1.4em}#imageData{padding:0 10px}#imageData #imageDetails{width:70%;float:left;text-align:left}#imageData #caption{font-weight:bold}#imageData #numberDisplay{display:block;clear:left;padding-bottom:1.0em}#imageData #bottomNavClose{width:86px;float:right;padding-bottom:.7em}#imageData #helpDisplay{clear:left;float:left;display:block}#overlay{position:absolute;top:0;left:0;z-index:10090;width:100%;height:500px;background-color:#000;filter:alpha(opacity=60);-moz-opacity:.6;opacity:.6;display:none}.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}* html>body .clearfix{display:inline-block;width:100%}* html .clearfix{/*\*/height:1%;/**/}#lightboxIframe{display:none}
styles/lightbox.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #lightbox{position:absolute;left:0;width:100%;z-index:10100;text-align:center;line-height:0}#jqlb_loading{height:32px;background-image:url('./images/loading.gif');background-repeat:no-repeat;background-position:center center}#jqlb_closelabel{height:22px;background-image:url('./images/closelabel.gif');background-repeat:no-repeat;background-position:center center}#lightbox a img{border:0}#outerImageContainer{position:relative;background-color:#fff;width:250px;height:250px;margin:0 auto}#imageContainer{padding:10px}#loading{position:absolute;top:40%;left:0;height:25%;width:100%;text-align:center;line-height:0}#hoverNav{position:absolute;top:0;left:0;height:100%;width:100%;z-index:10}#imageContainer>#hoverNav{left:0}#hoverNav a{outline:0}#prevLink,#nextLink{width:45%;height:100%;background:transparent url('./images/blank.gif') no-repeat;display:block}#prevLink{left:0;float:left}#nextLink{right:0;float:right}#prevLink:hover,#prevLink:visited:hover{background:url('./images/prev.gif') left 50% no-repeat}#nextLink:hover,#nextLink:visited:hover{background:url('./images/next.gif') right 50% no-repeat}#nextLinkText,#prevLinkText{color:#ff9834;font-weight:bold;text-decoration:none}#nextLinkText{padding-left:20px}#prevLinkText{padding-right:20px}#downloadLink{margin-left:10px}.ontop #imageData{padding-top:5px}#imageDataContainer{font:10px Verdana,Helvetica,sans-serif;background-color:#fff;margin:0 auto;line-height:1.4em}#imageData{padding:0 10px}#imageData #imageDetails{width:70%;float:left;text-align:left}#imageData #caption{font-weight:bold}#imageData #numberDisplay{display:block;clear:left;padding-bottom:1.0em}#imageData #bottomNavClose{width:66px;float:right;padding-bottom:.7em}#imageData #helpDisplay{clear:left;float:left;display:block}#overlay{position:absolute;top:0;left:0;z-index:10090;width:100%;height:500px;background-color:#000;filter:alpha(opacity=60);-moz-opacity:.6;opacity:.6;display:none}.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}* html>body .clearfix{display:inline-block;width:100%}* html .clearfix{/*\*/height:1%;/**/}#lightboxIframe{display:none}
styles/lightbox.min.pl_PL.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ #lightbox{position:absolute;left:0;width:100%;z-index:100;text-align:center;line-height:0}#jqlb_loading{height:32px;background-image:url('./images/loading.gif');background-repeat:no-repeat;background-position:center center}#jqlb_closelabel{height:22px;background-image:url('./images/closelabel.gif');background-repeat:no-repeat;background-position:center center}#lightbox a img{border:none}#outerImageContainer{position:relative;background-color:#fff;width:250px;height:250px;margin:0 auto}#imageContainer{padding:10px}#loading{position:absolute;top:40%;left:0;height:25%;width:100%;text-align:center;line-height:0}#hoverNav{position:absolute;top:0;left:0;height:100%;width:100%;z-index:10}#imageContainer>#hoverNav{left:0}#hoverNav a{outline:none}#prevLink,#nextLink{width:49%;height:100%;background:transparent url('./images/blank.gif') no-repeat;display:block}#prevLink{left:0;float:left}#nextLink{right:0;float:right}#prevLink:hover,#prevLink:visited:hover{background:url('./images/prev.gif') left 50% no-repeat}#nextLink:hover,#nextLink:visited:hover{background:url('./images/next.gif') right 50% no-repeat}#nextLinkText,#prevLinkText{color:#ff9834;font-weight:bold;text-decoration:none}#nextLinkText{padding-left:20px}#prevLinkText{padding-right:20px}#downloadLink{margin-left:10px}.ontop #imageData{padding-top:5px}#imageDataContainer{font:10px Verdana,Helvetica,sans-serif;background-color:#fff;margin:0 auto;line-height:1.4em}#imageData{padding:0 10px}#imageData #imageDetails{width:70%;float:left;text-align:left}#imageData #caption{font-weight:bold}#imageData #numberDisplay{display:block;clear:left;padding-bottom:1.0em}#imageData #bottomNavClose{width:66px;float:right;padding-bottom:.7em}#imageData #helpDisplay{clear:left;float:left;display:block}#overlay{position:absolute;top:0;left:0;z-index:90;width:100%;height:500px;background-color:#000;filter:alpha(opacity=60);-moz-opacity:.6;opacity:.6;display:none}.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}* html>body .clearfix{display:inline-block;width:100%}* html .clearfix{/*\*/height:1%;/**/}#lightboxIframe{display:none}
2
+ #jqlb_closelabel{background-image:url('./images/pl_PL/closelabel.gif');}
styles/lightbox.min.ru_RU.css ADDED
@@ -0,0 +1 @@
 
1
+ #lightbox{position:absolute;left:0;width:100%;z-index:10100;text-align:center;line-height:0}#jqlb_loading{height:32px;background-image:url('./images/ru_RU/loading.gif');background-repeat:no-repeat;background-position:center center}#jqlb_closelabel{height:22px;background-image:url('./images/ru_RU/closelabel.gif');background-repeat:no-repeat;background-position:center center}#lightbox a img{border:none}#outerImageContainer{position:relative;background-color:#fff;width:250px;height:250px;margin:0 auto}#imageContainer{padding:10px}#loading{position:absolute;top:40%;left:0;height:25%;width:100%;text-align:center;line-height:0}#hoverNav{position:absolute;top:0;left:0;height:100%;width:100%;z-index:10}#imageContainer>#hoverNav{left:0}#hoverNav a{outline:none}#prevLink,#nextLink{width:45%;height:100%;background:transparent url('./images/ru_RU/blank.gif') no-repeat;display:block}#prevLink{left:0;float:left}#nextLink{right:0;float:right}#prevLink:hover,#prevLink:visited:hover{background:url('./images/ru_RU/prev.gif') left 50% no-repeat}#nextLink:hover,#nextLink:visited:hover{background:url('./images/ru_RU/next.gif') right 50% no-repeat}#nextLinkText,#prevLinkText{color:#ff9834;font-weight:bold;text-decoration:none}#nextLinkText{padding-left:20px}#prevLinkText{padding-right:20px}.ontop #imageData{padding-top:5px}#imageDataContainer{font:10px Verdana,Helvetica,sans-serif;background-color:#fff;margin:0 auto;line-height:1.4em}#imageData{padding:0 10px}#imageData #imageDetails{width:70%;float:left;text-align:left}#imageData #caption{font-weight:bold}#imageData #numberDisplay{display:block;clear:left;padding-bottom:1.0em}#imageData #bottomNavClose{width:86px;float:right;padding-bottom:.7em}#imageData #helpDisplay{clear:left;float:left;display:block}#overlay{position:absolute;top:0;left:0;z-index:10090;width:100%;height:500px;background-color:#000;filter:alpha(opacity=60);-moz-opacity:.6;opacity:.6;display:none}.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}* html>body .clearfix{display:inline-block;width:100%}* html .clearfix{/*\*/height:1%;/**/}#lightboxIframe{display:none}
wp-lightbox-2.js ADDED
@@ -0,0 +1,504 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Plugin Name: WP Lightbox 2
3
+ * Plugin URI: http://onlinewebapplication.com/2011/11/wp-lightbox-2.html
4
+ * Description: This plugin used to add the lightbox (overlay) effect to the current page images on your WordPress blog.
5
+ * Version: 2.21
6
+ * Author: Pankaj Jha
7
+ * Author URI: http://onlinewebapplication.com/
8
+ * License: GNU General Public License, v2 (or newer)
9
+ * License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ */
11
+ /* Copyright 2011 Pankaj Jha (onlinewebapplication.com)
12
+
13
+ This program is free software; you can redistribute it and/or modify
14
+ it under the terms of the GNU General Public License as published by
15
+ the Free Software Foundation using version 2 of the License.
16
+
17
+ This program is distributed in the hope that it will be useful,
18
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ GNU General Public License for more details.
21
+
22
+ You should have received a copy of the GNU General Public License
23
+ along with this program; if not, write to the Free Software
24
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
+ */
26
+ /**
27
+ * jQuery Lightbox
28
+ * Version 0.5 - 11/29/2007
29
+ * @author Warren Krewenki
30
+ *
31
+ * This package is distributed under the BSD license.
32
+ * For full license information, see LICENSE.TXT
33
+ *
34
+ * Based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
35
+ * Originally written to make use of the Prototype framework, and Script.acalo.us, now altered to use jQuery.
36
+ **/
37
+ /** toyNN: davidtg@comtrya.com: fixed IE7-8 incompatabilities in 1.3.* branch **/
38
+ (function($){
39
+ $.fn.lightbox = function(options) {
40
+ var opts = $.extend({}, $.fn.lightbox.defaults, options);
41
+ function onClick() {
42
+ initialize();
43
+ start(this);
44
+ return false;
45
+ }
46
+ if(parseFloat($().jquery) >= 1.7){
47
+ return $(this).on("click", onClick);
48
+ }else{
49
+ return $(this).live("click", onClick); //deprecated since 1.7
50
+ }
51
+
52
+ function initialize() {
53
+ $(window).bind('orientationchange', resizeListener);
54
+ $(window).bind('resize', resizeListener);
55
+ // if (opts.followScroll) { $(window).bind('scroll', orientListener); }
56
+ $('#overlay').remove();
57
+ $('#lightbox').remove();
58
+ opts.isIE8 = isIE8(); // //http://www.grayston.net/2011/internet-explorer-v8-and-opacity-issues/
59
+ opts.inprogress = false;
60
+ // if jsonData, build the imageArray from data provided in JSON format
61
+ if (opts.jsonData && opts.jsonData.length > 0) {
62
+ var parser = opts.jsonDataParser ? opts.jsonDataParser : $.fn.lightbox.parseJsonData;
63
+ opts.imageArray = [];
64
+ opts.imageArray = parser(opts.jsonData);
65
+ }
66
+ var outerImage = '<div id="outerImageContainer"><div id="imageContainer"><iframe id="lightboxIframe" /><img id="lightboxImage"><div id="hoverNav"><a href="javascript://" title="' + opts.strings.prevLinkTitle + '" id="prevLink"></a><a href="javascript://" id="nextLink" title="' + opts.strings.nextLinkTitle + '"></a></div><div id="loading"><a href="javascript://" id="loadingLink"><div id="jqlb_loading"></div></a></div></div></div>';
67
+ var imageData = '<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav">';
68
+ if (opts.displayHelp) {
69
+ imageData += '<span id="helpDisplay">' + opts.strings.help + '</span>';
70
+ }
71
+ imageData += '<a href="javascript://" id="bottomNavClose" title="' + opts.strings.closeTitle + '"><div id="jqlb_closelabel"></div></a></div></div></div>';
72
+ var string;
73
+ if (opts.navbarOnTop) {
74
+ string = '<div id="overlay"></div><div id="lightbox">' + imageData + outerImage + '</div>';
75
+ $("body").append(string);
76
+ $("#imageDataContainer").addClass('ontop');
77
+ } else {
78
+ string = '<div id="overlay"></div><div id="lightbox">' + outerImage + imageData + '</div>';
79
+ $("body").append(string);
80
+ }
81
+ $("#overlay").click(function () { end(); }).hide();
82
+ $("#lightbox").click(function () { end(); }).hide();
83
+ $("#loadingLink").click(function () { end(); return false; });
84
+ $("#bottomNavClose").click(function () { end(); return false; });
85
+ $('#outerImageContainer').width(opts.widthCurrent).height(opts.heightCurrent);
86
+ $('#imageDataContainer').width(opts.widthCurrent);
87
+ if (!opts.imageClickClose) {
88
+ $("#lightboxImage").click(function () { return false; });
89
+ $("#hoverNav").click(function () { return false; });
90
+ }
91
+ };
92
+ //allow image to reposition & scale if orientation change or resize occurs.
93
+ /*2.21 - Image Map, Shrink large images to fit smaller screens*/
94
+ function resizeListener(e) {
95
+ if (opts.resizeTimeout) {
96
+ clearTimeout(opts.resizeTimeout);
97
+ opts.resizeTimeout = false;
98
+ }
99
+ opts.resizeTimeout = setTimeout(function () { doScale(false); }, 50); //a delay to avoid duplicate event calls.
100
+ }
101
+ function getPageSize(){
102
+ var pgDocHeight = $(document).height();
103
+ if (opts.isIE8 && pgDocHeight > 4096) {
104
+ pgDocHeight = 4096;
105
+ }
106
+ var viewportHeight = $(window).height() - opts.adminBarHeight;
107
+ //$(document).width() returns width of HTML document
108
+ return new Array($(document).width(), pgDocHeight, $(window).width(), viewportHeight, $(document).height());
109
+ };
110
+ //code for IE8 check provided by http://kangax.github.com/cft/
111
+ function isIE8() {
112
+ var isBuggy = false;
113
+ if (document.createElement) {
114
+ var el = document.createElement("div");
115
+ if (el && el.querySelectorAll) {
116
+ el.innerHTML = "<object><param name=\"\"></object>";
117
+ isBuggy = el.querySelectorAll("param").length != 1;
118
+ }
119
+ el = null;
120
+ }
121
+ return isBuggy;
122
+ };
123
+ function getPageScroll() {
124
+ var xScroll = 0; var yScroll = 0;
125
+ if (self.pageYOffset) {
126
+ yScroll = self.pageYOffset;
127
+ xScroll = self.pageXOffset;
128
+ } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
129
+ yScroll = document.documentElement.scrollTop;
130
+ xScroll = document.documentElement.scrollLeft;
131
+ } else if (document.body) {// all other Explorers
132
+ yScroll = document.body.scrollTop;
133
+ xScroll = document.body.scrollLeft;
134
+ }
135
+ if(opts.adminBarHeight && parseInt($('#wpadminbar').css('top'), 10) === 0){
136
+ yScroll += opts.adminBarHeight;
137
+ }
138
+ return new Array(xScroll, yScroll);
139
+ };
140
+
141
+ function start(imageLink) {
142
+ $("select, embed, object").hide();
143
+ var arrayPageSize = getPageSize();
144
+ var arrayPagePos = getPageScroll();
145
+ var newTop = 0;
146
+ $("#overlay").hide().css({width: arrayPageSize[0] + 'px', height: arrayPageSize[1] + 'px', opacity: opts.overlayOpacity}).fadeIn(400);
147
+ if (opts.isIE8 && arrayPageSize[1] == 4096) {
148
+ if (arrayPagePos[1] >= 1000) {
149
+ newTop = arrayPagePos[1] - 1000;
150
+ if ((arrayPageSize[4] - (arrayPagePos[1] + 3096)) < 0) {
151
+ newTop -= (arrayPagePos[1] + 3096) - arrayPageSize[4];
152
+ }
153
+ $("#overlay").css({ top: newTop + 'px' });
154
+ }
155
+ }
156
+ imageNum = 0;
157
+ // if data is not provided by jsonData parameter
158
+ if (!opts.jsonData) {
159
+ opts.imageArray = [];
160
+ // if image is NOT part of a set..
161
+ if (!imageLink.rel || (imageLink.rel == '')) {
162
+ // add single image to Lightbox.imageArray
163
+ var s = '';
164
+ if (imageLink.title) {
165
+ s = imageLink.title;
166
+ } else if ($(this).children(':first-child').attr('title')) {
167
+ s = $(this).children(':first-child').attr('title');
168
+ }
169
+ opts.imageArray.push(new Array(imageLink.href, opts.displayTitle ? s : ''));
170
+ } else {
171
+ // if image is part of a set..
172
+ $("a").each(function () {
173
+ if (this.href && (this.rel == imageLink.rel)) {
174
+ var title = '';
175
+ var caption = '';
176
+ var captionText = '';
177
+ var jqThis = $(this);
178
+ if (this.title) {
179
+ title = this.title;
180
+ } else if (jqThis.children('img:first-child').attr('title')) {
181
+ title = jqThis.children('img:first-child').attr('title'); //grab the title from the image if the link lacks one
182
+ }
183
+ if (jqThis.parent().next('.gallery-caption').html()) {
184
+ var jq = jqThis.parent().next('.gallery-caption');
185
+ caption = jq.html();
186
+ captionText = jq.text();
187
+ } else if (jqThis.next('.wp-caption-text').html()) {
188
+ caption = jqThis.next('.wp-caption-text').html();
189
+ captionText = jqThis.next('.wp-caption-text').text();
190
+ }
191
+ title = $.trim(title);
192
+ captionText = $.trim(captionText);
193
+ if (title.toLowerCase() == captionText.toLowerCase()) {
194
+ title = caption; //to keep linked captions
195
+ caption = ''; //but not duplicate the text
196
+ }
197
+ var s = '';
198
+ if (title != '') {
199
+ s = '<span id="titleText">' + title + '</span>';
200
+ }
201
+ if (caption != '') {
202
+ if (title != ''){
203
+ s += '<br />';
204
+ }
205
+ s += '<span id="captionText">' + caption +'</span>';
206
+ }
207
+ opts.imageArray.push(new Array(this.href, opts.displayTitle ? s : ''));
208
+ }
209
+ });
210
+ }
211
+ }
212
+ if (opts.imageArray.length > 1) {
213
+ for (i = 0; i < opts.imageArray.length; i++) {
214
+ for (j = opts.imageArray.length - 1; j > i; j--) {
215
+ if (opts.imageArray[i][0] == opts.imageArray[j][0]) {
216
+ opts.imageArray.splice(j, 1);
217
+ }
218
+ }
219
+ }
220
+ while (opts.imageArray[imageNum][0] != imageLink.href) { imageNum++; }
221
+ }
222
+ // calculate top and left offset for the lightbox
223
+ setLightBoxPos(arrayPagePos[1], arrayPagePos[0]).show();
224
+ changeImage(imageNum);
225
+ };
226
+
227
+ function setLightBoxPos(newTop, newLeft) {
228
+ if (opts.resizeSpeed > 0) {
229
+ $('#lightbox').animate({ top: newTop }, 250, 'linear');
230
+ return $('#lightbox').animate({ left: newLeft }, 250, 'linear');
231
+ }
232
+ return $('#lightbox').css({ top: newTop + 'px', left: newLeft + 'px' });
233
+ }
234
+
235
+ function changeImage(imageNum) {
236
+ if (opts.inprogress == false) {
237
+ opts.inprogress = true;
238
+ opts.activeImage = imageNum;
239
+ // hide elements during transition
240
+ $('#loading').show();
241
+ $('#lightboxImage').hide();
242
+ $('#hoverNav').hide();
243
+ $('#prevLink').hide();
244
+ $('#nextLink').hide();
245
+ doChangeImage();
246
+ }
247
+ };
248
+
249
+ function doChangeImage() {
250
+ opts.imgPreloader = new Image();
251
+ opts.imgPreloader.onload = function () {
252
+ $('#lightboxImage').attr('src', opts.imageArray[opts.activeImage][0]);
253
+ doScale(); // once image is preloaded, resize image container
254
+ preloadNeighborImages();
255
+ };
256
+ opts.imgPreloader.src = opts.imageArray[opts.activeImage][0];
257
+ };
258
+
259
+ function doScale() {
260
+ if (!opts.imgPreloader) {
261
+ return;
262
+ }
263
+ var newWidth = opts.imgPreloader.width;
264
+ var newHeight = opts.imgPreloader.height;
265
+ var arrayPageSize = getPageSize();
266
+ var noScrollWidth = (arrayPageSize[2] < arrayPageSize[0]) ? arrayPageSize[0] : arrayPageSize[2]; //if viewport is smaller than page, use page width.
267
+ $("#overlay").css({ width: noScrollWidth + 'px', height: arrayPageSize[1] + 'px' });
268
+ var maxHeight = (arrayPageSize[3]) - ($("#imageDataContainer").height() + (2 * opts.borderSize));
269
+ var maxWidth = (arrayPageSize[2]) - (2*opts.borderSize);
270
+ if (opts.fitToScreen){
271
+ var displayHeight = maxHeight-opts.marginSize;
272
+ var displayWidth = maxWidth-opts.marginSize;
273
+ var ratio = 1;
274
+ if (newHeight > displayHeight) {
275
+ ratio = displayHeight / newHeight; //ex. 600/1024 = 0.58
276
+ }
277
+ newWidth = newWidth * ratio;
278
+ newHeight = newHeight * ratio;
279
+ ratio = 1;
280
+ if (newWidth > displayWidth) {
281
+ ratio = displayWidth / newWidth; //ex. 800/1280 == 0.62
282
+ }
283
+ newWidth = Math.round(newWidth * ratio);
284
+ newHeight = Math.round(newHeight * ratio);
285
+ }
286
+ var arrayPageScroll = getPageScroll();
287
+ var centerY = arrayPageScroll[1] + (maxHeight * 0.5);
288
+ var newTop = centerY - newHeight * 0.5;
289
+ var newLeft = arrayPageScroll[0];
290
+ $('#lightboxImage').width(newWidth).height(newHeight);
291
+ resizeImageContainer(newWidth, newHeight, newTop, newLeft);
292
+ }
293
+
294
+ function resizeImageContainer(imgWidth, imgHeight, lightboxTop, lightboxLeft) {
295
+ opts.widthCurrent = $("#outerImageContainer").outerWidth();
296
+ opts.heightCurrent = $("#outerImageContainer").outerHeight();
297
+ var widthNew = Math.max(350, imgWidth + (opts.borderSize * 2));
298
+ var heightNew = (imgHeight + (opts.borderSize * 2));
299
+ // scalars based on change from old to new
300
+ opts.xScale = (widthNew / opts.widthCurrent) * 100;
301
+ opts.yScale = (heightNew / opts.heightCurrent) * 100;
302
+ setLightBoxPos(lightboxTop, lightboxLeft);
303
+ updateDetails(); //toyNN: moved updateDetails() here, seems to work fine.
304
+ $('#imageDataContainer').animate({ width: widthNew }, opts.resizeSpeed, 'linear');
305
+ $('#outerImageContainer').animate({ width: widthNew }, opts.resizeSpeed, 'linear', function () {
306
+ $('#outerImageContainer').animate({ height: heightNew }, opts.resizeSpeed, 'linear', function () {
307
+ showImage();
308
+ });
309
+ });
310
+ updateNav();
311
+ $('#prevLink').height(imgHeight);
312
+ $('#nextLink').height(imgHeight);
313
+ };
314
+
315
+ function showImage() {
316
+ //assumes updateDetails have been called earlier!
317
+ $("#imageData").show();
318
+ $('#caption').show();
319
+ //$('#imageDataContainer').slideDown(400);
320
+ //$("#imageDetails").hide().fadeIn(400);
321
+ $('#loading').hide();
322
+ if (opts.resizeSpeed > 0) {
323
+ $('#lightboxImage').fadeIn("fast");
324
+ } else {
325
+ $('#lightboxImage').show();
326
+ }
327
+ opts.inprogress = false;
328
+ };
329
+
330
+ function preloadNeighborImages() {
331
+ if (opts.loopImages && opts.imageArray.length > 1) {
332
+ preloadNextImage = new Image();
333
+ preloadNextImage.src = opts.imageArray[(opts.activeImage == (opts.imageArray.length - 1)) ? 0 : opts.activeImage + 1][0]
334
+ preloadPrevImage = new Image();
335
+ preloadPrevImage.src = opts.imageArray[(opts.activeImage == 0) ? (opts.imageArray.length - 1) : opts.activeImage - 1][0]
336
+ } else {
337
+ if ((opts.imageArray.length - 1) > opts.activeImage) {
338
+ preloadNextImage = new Image();
339
+ preloadNextImage.src = opts.imageArray[opts.activeImage + 1][0];
340
+ }
341
+ if (opts.activeImage > 0) {
342
+ preloadPrevImage = new Image();
343
+ preloadPrevImage.src = opts.imageArray[opts.activeImage - 1][0];
344
+ }
345
+ }
346
+ };
347
+
348
+
349
+ function updateDetails() {
350
+ $('#numberDisplay').html('');
351
+ $('#caption').html('').hide();
352
+ if (opts.imageArray[opts.activeImage][1]) {
353
+ $('#caption').html(opts.imageArray[opts.activeImage][1]).show();
354
+ }
355
+ var nav_html = '';
356
+ var prev = '';
357
+ var pos = (opts.imageArray.length > 1) ? opts.strings.image + (opts.activeImage + 1) + opts.strings.of + opts.imageArray.length : '';
358
+ var link = (opts.displayDownloadLink) ? '<a href="' + opts.imageArray[opts.activeImage][0] + '" id="downloadLink" target="'+opts.linkTarget+'">' + opts.strings.download + '</a>' : '';
359
+ var next = '';
360
+ if (opts.imageArray.length > 1 && !opts.disableNavbarLinks) { // display previous / next text links
361
+ if ((opts.activeImage) > 0 || opts.loopImages) {
362
+ prev = '<a title="' + opts.strings.prevLinkTitle + '" href="#" id="prevLinkText">' + opts.strings.prevLinkText + "</a>";
363
+ }
364
+ if (((opts.activeImage + 1) < opts.imageArray.length) || opts.loopImages) {
365
+ next += '<a title="' + opts.strings.nextLinkTitle + '" href="#" id="nextLinkText">' + opts.strings.nextLinkText + "</a>";
366
+ }
367
+ }
368
+ nav_html = prev + nav_html + pos + link + next;
369
+ if (nav_html != '') {
370
+ $('#numberDisplay').html(nav_html).show();
371
+ }
372
+ };
373
+
374
+ function updateNav() {
375
+ if (opts.imageArray.length > 1) {
376
+ $('#hoverNav').show();
377
+ // if loopImages is true, always show next and prev image buttons
378
+ if (opts.loopImages) {
379
+ $('#prevLink,#prevLinkText').show().click(function () {
380
+ changeImage((opts.activeImage == 0) ? (opts.imageArray.length - 1) : opts.activeImage - 1); return false;
381
+ });
382
+ $('#nextLink,#nextLinkText').show().click(function () {
383
+ changeImage((opts.activeImage == (opts.imageArray.length - 1)) ? 0 : opts.activeImage + 1); return false;
384
+ });
385
+ } else {
386
+ // if not first image in set, display prev image button
387
+ if (opts.activeImage != 0) {
388
+ $('#prevLink,#prevLinkText').show().click(function () {
389
+ changeImage(opts.activeImage - 1); return false;
390
+ });
391
+ }
392
+ // if not last image in set, display next image button
393
+ if (opts.activeImage != (opts.imageArray.length - 1)) {
394
+ $('#nextLink,#nextLinkText').show().click(function () {
395
+ changeImage(opts.activeImage + 1); return false;
396
+ });
397
+ }
398
+ }
399
+ enableKeyboardNav();
400
+ }
401
+ };
402
+
403
+ function end() {
404
+ disableKeyboardNav();
405
+ $('#lightbox').hide();
406
+ $('#overlay').fadeOut();
407
+ $('select, object, embed').show();
408
+ };
409
+
410
+ function keyboardAction(e) {
411
+ var o = e.data.opts;
412
+ var keycode = e.keyCode;
413
+ var escapeKey = 27;
414
+ var key = String.fromCharCode(keycode).toLowerCase();
415
+ if ((key == 'x') || (key == 'o') || (key == 'c') || (keycode == escapeKey)) { // close lightbox
416
+ end();
417
+ } else if ((key == 'p') || (keycode == 37)) { // display previous image
418
+ if (o.loopImages) {
419
+ disableKeyboardNav();
420
+ changeImage((o.activeImage == 0) ? (o.imageArray.length - 1) : o.activeImage - 1);
421
+ }
422
+ else if (o.activeImage != 0) {
423
+ disableKeyboardNav();
424
+ changeImage(o.activeImage - 1);
425
+ }
426
+ } else if ((key == 'n') || (keycode == 39)) { // display next image
427
+ if (opts.loopImages) {
428
+ disableKeyboardNav();
429
+ changeImage((o.activeImage == (o.imageArray.length - 1)) ? 0 : o.activeImage + 1);
430
+ }
431
+ else if (o.activeImage != (o.imageArray.length - 1)) {
432
+ disableKeyboardNav();
433
+ changeImage(o.activeImage + 1);
434
+ }
435
+ }
436
+ return false;
437
+ };
438
+ function enableKeyboardNav() {
439
+ $(document).bind('keydown', {opts: opts}, keyboardAction);
440
+ };
441
+ function disableKeyboardNav() {
442
+ $(document).unbind('keydown');
443
+ };
444
+ };
445
+ $.fn.lightbox.parseJsonData = function(data) {
446
+ var imageArray = [];
447
+ $.each(data, function () {
448
+ imageArray.push(new Array(this.url, this.title));
449
+ });
450
+ return imageArray;
451
+ };
452
+ $.fn.lightbox.defaults = {
453
+ adminBarHeight:28,
454
+ overlayOpacity: 0.8,
455
+ borderSize: 10,
456
+ imageArray: new Array,
457
+ activeImage: null,
458
+ inprogress: false, //this is an internal state variable. don't touch.
459
+ widthCurrent: 250,
460
+ heightCurrent: 250,
461
+ xScale: 1,
462
+ yScale: 1,
463
+ displayTitle: true,
464
+ disableNavbarLinks: true,
465
+ loopImages: true,
466
+ imageClickClose: true,
467
+ jsonData: null,
468
+ jsonDataParser: null,
469
+ followScroll: false,
470
+ isIE8: false //toyNN:internal value only
471
+ };
472
+ $(document).ready(function($){
473
+ var haveConf = (typeof JQLBSettings == 'object');
474
+ if(haveConf && JQLBSettings.resizeSpeed) {
475
+ JQLBSettings.resizeSpeed = parseInt(JQLBSettings.resizeSpeed);
476
+ }
477
+ if(haveConf && JQLBSettings.marginSize){
478
+ JQLBSettings.marginSize = parseInt(JQLBSettings.marginSize);
479
+ }
480
+ var default_strings = {
481
+ help: ' Browse images with your keyboard: Arrows or P(revious)/N(ext) and X/C/ESC for close.',
482
+ prevLinkTitle: 'previous image',
483
+ nextLinkTitle: 'next image',
484
+ prevLinkText: '&laquo; Previous',
485
+ nextLinkText: 'Next &raquo;',
486
+ closeTitle: 'close image gallery',
487
+ image: 'Image ',
488
+ of: ' of ',
489
+ download: 'Download'
490
+ };
491
+ $('a[rel^="lightbox"]').lightbox({
492
+ adminBarHeight: $('#wpadminbar').height() || 0,
493
+ linkTarget: (haveConf && JQLBSettings.linkTarget.length) ? JQLBSettings.linkTarget : '_self',
494
+ displayHelp: (haveConf && JQLBSettings.help.length) ? true : false,
495
+ marginSize: (haveConf && JQLBSettings.marginSize) ? JQLBSettings.marginSize : 0,
496
+ fitToScreen: (haveConf && JQLBSettings.fitToScreen == '1') ? true : false,
497
+ resizeSpeed: (haveConf && JQLBSettings.resizeSpeed >= 0) ? JQLBSettings.resizeSpeed : 400,
498
+ displayDownloadLink: (haveConf && JQLBSettings.displayDownloadLink == '0') ? false : true,
499
+ navbarOnTop: (haveConf && JQLBSettings.navbarOnTop == '0') ? false : true,
500
+ //followScroll: (haveConf && JQLBSettings.followScroll == '0') ? false : true,
501
+ strings: (haveConf && typeof JQLBSettings.help == 'string') ? JQLBSettings : default_strings
502
+ });
503
+ });
504
+ })(jQuery);
wp-lightbox-2.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(a){a.fn.lightbox=function(k){var u=a.extend({},a.fn.lightbox.defaults,k);function p(){e();o(this);return false}if(parseFloat(a().jquery)>=1.7){return a(this).on("click",p)}else{return a(this).live("click",p)}function e(){a(window).bind("orientationchange",q);a(window).bind("resize",q);a("#overlay").remove();a("#lightbox").remove();u.isIE8=v();u.inprogress=false;if(u.jsonData&&u.jsonData.length>0){var C=u.jsonDataParser?u.jsonDataParser:a.fn.lightbox.parseJsonData;u.imageArray=[];u.imageArray=C(u.jsonData)}var z='<div id="outerImageContainer"><div id="imageContainer"><iframe id="lightboxIframe" /><img id="lightboxImage"><div id="hoverNav"><a href="javascript://" title="'+u.strings.prevLinkTitle+'" id="prevLink"></a><a href="javascript://" id="nextLink" title="'+u.strings.nextLinkTitle+'"></a></div><div id="loading"><a href="javascript://" id="loadingLink"><div id="jqlb_loading"></div></a></div></div></div>';var B='<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav">';if(u.displayHelp){B+='<span id="helpDisplay">'+u.strings.help+"</span>"}B+='<a href="javascript://" id="bottomNavClose" title="'+u.strings.closeTitle+'"><div id="jqlb_closelabel"></div></a></div></div></div>';var A;if(u.navbarOnTop){A='<div id="overlay"></div><div id="lightbox">'+B+z+"</div>";a("body").append(A);a("#imageDataContainer").addClass("ontop")}else{A='<div id="overlay"></div><div id="lightbox">'+z+B+"</div>";a("body").append(A)}a("#overlay").click(function(){h()}).hide();a("#lightbox").click(function(){h()}).hide();a("#loadingLink").click(function(){h();return false});a("#bottomNavClose").click(function(){h();return false});a("#outerImageContainer").width(u.widthCurrent).height(u.heightCurrent);a("#imageDataContainer").width(u.widthCurrent);if(!u.imageClickClose){a("#lightboxImage").click(function(){return false});a("#hoverNav").click(function(){return false})}}function q(z){if(u.resizeTimeout){clearTimeout(u.resizeTimeout);u.resizeTimeout=false}u.resizeTimeout=setTimeout(function(){y(false)},50)}function x(){var A=a(document).height();if(u.isIE8&&A>4096){A=4096}var z=a(window).height()-u.adminBarHeight;return new Array(a(document).width(),A,a(window).width(),z,a(document).height())}function v(){var A=false;if(document.createElement){var z=document.createElement("div");if(z&&z.querySelectorAll){z.innerHTML='<object><param name=""></object>';A=z.querySelectorAll("param").length!=1}z=null}return A}function g(){var A=0;var z=0;if(self.pageYOffset){z=self.pageYOffset;A=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){z=document.documentElement.scrollTop;A=document.documentElement.scrollLeft}else{if(document.body){z=document.body.scrollTop;A=document.body.scrollLeft}}}if(u.adminBarHeight&&parseInt(a("#wpadminbar").css("top"),10)===0){z+=u.adminBarHeight}return new Array(A,z)}function o(D){a("select, embed, object").hide();var B=x();var z=g();var A=0;a("#overlay").hide().css({width:B[0]+"px",height:B[1]+"px",opacity:u.overlayOpacity}).fadeIn(400);if(u.isIE8&&B[1]==4096){if(z[1]>=1000){A=z[1]-1000;if((B[4]-(z[1]+3096))<0){A-=(z[1]+3096)-B[4]}a("#overlay").css({top:A+"px"})}}imageNum=0;if(!u.jsonData){u.imageArray=[];if(!D.rel||(D.rel=="")){var C="";if(D.title){C=D.title}else{if(a(this).children(":first-child").attr("title")){C=a(this).children(":first-child").attr("title")}}u.imageArray.push(new Array(D.href,u.displayTitle?C:""))}else{a("a").each(function(){if(this.href&&(this.rel==D.rel)){var H="";var F="";var J="";var E=a(this);if(this.title){H=this.title}else{if(E.children("img:first-child").attr("title")){H=E.children("img:first-child").attr("title")}}if(E.parent().next(".gallery-caption").html()){var I=E.parent().next(".gallery-caption");F=I.html();J=I.text()}else{if(E.next(".wp-caption-text").html()){F=E.next(".wp-caption-text").html();J=E.next(".wp-caption-text").text()}}H=a.trim(H);J=a.trim(J);if(H.toLowerCase()==J.toLowerCase()){H=F;F=""}var G="";if(H!=""){G='<span id="titleText">'+H+"</span>"}if(F!=""){if(H!=""){G+="<br />"}G+='<span id="captionText">'+F+"</span>"}u.imageArray.push(new Array(this.href,u.displayTitle?G:""))}})}}if(u.imageArray.length>1){for(i=0;i<u.imageArray.length;i++){for(j=u.imageArray.length-1;j>i;j--){if(u.imageArray[i][0]==u.imageArray[j][0]){u.imageArray.splice(j,1)}}}while(u.imageArray[imageNum][0]!=D.href){imageNum++}}m(z[1],z[0]).show();w(imageNum)}function m(z,A){if(u.resizeSpeed>0){a("#lightbox").animate({top:z},250,"linear");return a("#lightbox").animate({left:A},250,"linear")}return a("#lightbox").css({top:z+"px",left:A+"px"})}function w(z){if(u.inprogress==false){u.inprogress=true;u.activeImage=z;a("#loading").show();a("#lightboxImage").hide();a("#hoverNav").hide();a("#prevLink").hide();a("#nextLink").hide();l()}}function l(){u.imgPreloader=new Image();u.imgPreloader.onload=function(){a("#lightboxImage").attr("src",u.imageArray[u.activeImage][0]);y();f()};u.imgPreloader.src=u.imageArray[u.activeImage][0]}function y(){if(!u.imgPreloader){return}var C=u.imgPreloader.width;var z=u.imgPreloader.height;var E=x();var K=(E[2]<E[0])?E[0]:E[2];a("#overlay").css({width:K+"px",height:E[1]+"px"});var I=(E[3])-(a("#imageDataContainer").height()+(2*u.borderSize));var J=(E[2])-(2*u.borderSize);if(u.fitToScreen){var A=I-u.marginSize;var L=J-u.marginSize;var F=1;if(z>A){F=A/z}C=C*F;z=z*F;F=1;if(C>L){F=L/C}C=Math.round(C*F);z=Math.round(z*F)}var D=g();var B=D[1]+(I*0.5);var G=B-z*0.5;var H=D[0];a("#lightboxImage").width(C).height(z);n(C,z,G,H)}function n(C,A,E,D){u.widthCurrent=a("#outerImageContainer").outerWidth();u.heightCurrent=a("#outerImageContainer").outerHeight();var z=Math.max(350,C+(u.borderSize*2));var B=(A+(u.borderSize*2));u.xScale=(z/u.widthCurrent)*100;u.yScale=(B/u.heightCurrent)*100;m(E,D);c();a("#imageDataContainer").animate({width:z},u.resizeSpeed,"linear");a("#outerImageContainer").animate({width:z},u.resizeSpeed,"linear",function(){a("#outerImageContainer").animate({height:B},u.resizeSpeed,"linear",function(){d()})});s();a("#prevLink").height(A);a("#nextLink").height(A)}function d(){a("#imageData").show();a("#caption").show();a("#loading").hide();if(u.resizeSpeed>0){a("#lightboxImage").fadeIn("fast")}else{a("#lightboxImage").show()}u.inprogress=false}function f(){if(u.loopImages&&u.imageArray.length>1){preloadNextImage=new Image();preloadNextImage.src=u.imageArray[(u.activeImage==(u.imageArray.length-1))?0:u.activeImage+1][0];preloadPrevImage=new Image();preloadPrevImage.src=u.imageArray[(u.activeImage==0)?(u.imageArray.length-1):u.activeImage-1][0]}else{if((u.imageArray.length-1)>u.activeImage){preloadNextImage=new Image();preloadNextImage.src=u.imageArray[u.activeImage+1][0]}if(u.activeImage>0){preloadPrevImage=new Image();preloadPrevImage.src=u.imageArray[u.activeImage-1][0]}}}function c(){a("#numberDisplay").html("");a("#caption").html("").hide();if(u.imageArray[u.activeImage][1]){a("#caption").html(u.imageArray[u.activeImage][1]).show()}var C="";var B="";var D=(u.imageArray.length>1)?u.strings.image+(u.activeImage+1)+u.strings.of+u.imageArray.length:"";var A=(u.displayDownloadLink)?'<a href="'+u.imageArray[u.activeImage][0]+'" id="downloadLink" target="'+u.linkTarget+'">'+u.strings.download+"</a>":"";var z="";if(u.imageArray.length>1&&!u.disableNavbarLinks){if((u.activeImage)>0||u.loopImages){B='<a title="'+u.strings.prevLinkTitle+'" href="#" id="prevLinkText">'+u.strings.prevLinkText+"</a>"}if(((u.activeImage+1)<u.imageArray.length)||u.loopImages){z+='<a title="'+u.strings.nextLinkTitle+'" href="#" id="nextLinkText">'+u.strings.nextLinkText+"</a>"}}C=B+C+D+A+z;if(C!=""){a("#numberDisplay").html(C).show()}}function s(){if(u.imageArray.length>1){a("#hoverNav").show();if(u.loopImages){a("#prevLink,#prevLinkText").show().click(function(){w((u.activeImage==0)?(u.imageArray.length-1):u.activeImage-1);return false});a("#nextLink,#nextLinkText").show().click(function(){w((u.activeImage==(u.imageArray.length-1))?0:u.activeImage+1);return false})}else{if(u.activeImage!=0){a("#prevLink,#prevLinkText").show().click(function(){w(u.activeImage-1);return false})}if(u.activeImage!=(u.imageArray.length-1)){a("#nextLink,#nextLinkText").show().click(function(){w(u.activeImage+1);return false})}}b()}}function h(){r();a("#lightbox").hide();a("#overlay").fadeOut();a("select, object, embed").show()}function t(C){var D=C.data.opts;var z=C.keyCode;var A=27;var B=String.fromCharCode(z).toLowerCase();if((B=="x")||(B=="o")||(B=="c")||(z==A)){h()}else{if((B=="p")||(z==37)){if(D.loopImages){r();w((D.activeImage==0)?(D.imageArray.length-1):D.activeImage-1)}else{if(D.activeImage!=0){r();w(D.activeImage-1)}}}else{if((B=="n")||(z==39)){if(u.loopImages){r();w((D.activeImage==(D.imageArray.length-1))?0:D.activeImage+1)}else{if(D.activeImage!=(D.imageArray.length-1)){r();w(D.activeImage+1)}}}}}return false}function b(){a(document).bind("keydown",{opts:u},t)}function r(){a(document).unbind("keydown")}};a.fn.lightbox.parseJsonData=function(c){var b=[];a.each(c,function(){b.push(new Array(this.url,this.title))});return b};a.fn.lightbox.defaults={adminBarHeight:28,overlayOpacity:0.8,borderSize:10,imageArray:new Array,activeImage:null,inprogress:false,widthCurrent:250,heightCurrent:250,xScale:1,yScale:1,displayTitle:true,disableNavbarLinks:true,loopImages:true,imageClickClose:true,jsonData:null,jsonDataParser:null,followScroll:false,isIE8:false};a(document).ready(function(d){var b=(typeof JQLBSettings=="object");if(b&&JQLBSettings.resizeSpeed){JQLBSettings.resizeSpeed=parseInt(JQLBSettings.resizeSpeed)}if(b&&JQLBSettings.marginSize){JQLBSettings.marginSize=parseInt(JQLBSettings.marginSize)}var c={help:" Browse images with your keyboard: Arrows or P(revious)/N(ext) and X/C/ESC for close.",prevLinkTitle:"previous image",nextLinkTitle:"next image",prevLinkText:"&laquo; Previous",nextLinkText:"Next &raquo;",closeTitle:"close image gallery",image:"Image ",of:" of ",download:"Download"};d('a[rel^="lightbox"]').lightbox({adminBarHeight:d("#wpadminbar").height()||0,linkTarget:(b&&JQLBSettings.linkTarget.length)?JQLBSettings.linkTarget:"_self",displayHelp:(b&&JQLBSettings.help.length)?true:false,marginSize:(b&&JQLBSettings.marginSize)?JQLBSettings.marginSize:0,fitToScreen:(b&&JQLBSettings.fitToScreen=="1")?true:false,resizeSpeed:(b&&JQLBSettings.resizeSpeed>=0)?JQLBSettings.resizeSpeed:400,displayDownloadLink:(b&&JQLBSettings.displayDownloadLink=="0")?false:true,navbarOnTop:(b&&JQLBSettings.navbarOnTop=="0")?false:true,strings:(b&&typeof JQLBSettings.help=="string")?JQLBSettings:c})})})(jQuery);
wp-lightbox-2.php ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: WP Lightbox 2
4
+ * Plugin URI: http://onlinewebapplication.com/2011/11/wp-lightbox-2.html
5
+ * Description: This plugin used to add the lightbox (overlay) effect to the current page images on your WordPress blog.
6
+ * Version: 2.21
7
+ * Author: masdiblogs
8
+ * Author URI: http://profiles.wordpress.org/masdiblogs
9
+ * License: GNU General Public License, v2 (or newer)
10
+ * License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
+ */
12
+ /* Copyright 2011 Pankaj Jha (onlinewebapplication.com)
13
+
14
+ This program is free software; you can redistribute it and/or modify
15
+ it under the terms of the GNU General Public License as published by
16
+ the Free Software Foundation using version 2 of the License.
17
+
18
+ This program is distributed in the hope that it will be useful,
19
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ GNU General Public License for more details.
22
+
23
+ You should have received a copy of the GNU General Public License
24
+ along with this program; if not, write to the Free Software
25
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
+ */
27
+
28
+ /*2.21 - Image Map, Shrink large images to fit smaller screens*/
29
+
30
+ add_action( 'plugins_loaded', 'jqlb_init' );
31
+ function jqlb_init() {
32
+ if(!defined('ULFBEN_DONATE_URL')){
33
+ define('ULFBEN_DONATE_URL', 'http://onlinewebapplication.com/');
34
+ }
35
+
36
+ //JQLB_PLUGIN_DIR == plugin_dir_path(__FILE__);
37
+ //JQLB_URL = plugin_dir_url(__FILE__);
38
+ //JQLB_STYLES_URL = plugin_dir_url(__FILE__).'styles/'
39
+ //JQLB_LANGUAGES_DIR = plugin_dir_path(__FILE__) . 'I18n/'
40
+ define('JQLB_SCRIPT', 'wp-lightbox-2.min.js');
41
+ load_plugin_textdomain('jqlb', false, dirname( plugin_basename( __FILE__ ) ) . '/I18n/');
42
+ //load_plugin_textdomain('jqlb', false, plugin_dir_path(__FILE__).'I18n/');
43
+ add_action('admin_init', 'jqlb_register_settings');
44
+ add_action('admin_menu', 'jqlb_register_menu_item');
45
+ add_action('wp_print_styles', 'jqlb_css');
46
+ add_action('wp_print_scripts', 'jqlb_js');
47
+ add_filter('plugin_row_meta', 'jqlb_set_plugin_meta', 2, 10);
48
+ add_filter('the_content', 'jqlb_autoexpand_rel_wlightbox', 99);
49
+ if(get_option('jqlb_comments') == 1){
50
+ remove_filter('pre_comment_content', 'wp_rel_nofollow');
51
+ add_filter('comment_text', 'jqlb_lightbox_comment', 99);
52
+ }
53
+ }
54
+
55
+ function jqlb_set_plugin_meta( $links, $file ) { // Add a link to this plugin's settings page
56
+ static $this_plugin;
57
+ if(!$this_plugin) $this_plugin = plugin_basename(__FILE__);
58
+ if($file == $this_plugin) {
59
+ $settings_link = '<a href="options-general.php?page=jquery-lightbox-options">'.__('Settings', 'jqlb').'</a>';
60
+ array_unshift($links, $settings_link);
61
+ }
62
+ return $links;
63
+ }
64
+ function jqlb_add_admin_footer(){ //shows some plugin info in the footer of the config screen.
65
+ $plugin_data = get_plugin_data(__FILE__);
66
+
67
+ }
68
+ function jqlb_register_settings(){
69
+ register_setting( 'jqlb-settings-group', 'jqlb_automate', 'jqlb_bool_intval');
70
+ register_setting( 'jqlb-settings-group', 'jqlb_comments', 'jqlb_bool_intval');
71
+ register_setting( 'jqlb-settings-group', 'jqlb_resize_on_demand', 'jqlb_bool_intval');
72
+ register_setting( 'jqlb-settings-group', 'jqlb_show_download', 'jqlb_bool_intval');
73
+ register_setting( 'jqlb-settings-group', 'jqlb_navbarOnTop', 'jqlb_bool_intval');
74
+ register_setting( 'jqlb-settings-group', 'jqlb_margin_size', 'floatval');
75
+ register_setting( 'jqlb-settings-group', 'jqlb_resize_speed', 'jqlb_pos_intval');
76
+ register_setting( 'jqlb-settings-group', 'jqlb_help_text');
77
+ register_setting( 'jqlb-settings-group', 'jqlb_link_target');
78
+
79
+ //register_setting( 'jqlb-settings-group', 'jqlb_follow_scroll', 'jqlb_bool_intval');
80
+ add_option('jqlb_help_text', '');
81
+ add_option('jqlb_link_target', '_self');
82
+ add_option('jqlb_automate', 1); //default is to auto-lightbox.
83
+ add_option('jqlb_comments', 1);
84
+ add_option('jqlb_resize_on_demand', 0);
85
+ add_option('jqlb_show_download', 0);
86
+ add_option('jqlb_navbarOnTop', 0);
87
+ add_option('jqlb_resize_speed', 400);
88
+ //add_option('jqlb_follow_scroll', 0);
89
+ }
90
+ function jqlb_register_menu_item() {
91
+ add_options_page('WP Lightbox Options', 'WP Lightbox 2', 'manage_options', 'jquery-lightbox-options', 'jqlb_options_panel');
92
+ }
93
+ function jqlb_get_locale(){
94
+ //$lang_locales and ICL_LANGUAGE_CODE are defined in the WPML plugin (http://wpml.org/)
95
+ global $lang_locales;
96
+ if (defined('ICL_LANGUAGE_CODE') && isset($lang_locales[ICL_LANGUAGE_CODE])){
97
+ $locale = $lang_locales[ICL_LANGUAGE_CODE];
98
+ } else {
99
+ $locale = get_locale();
100
+ }
101
+ return $locale;
102
+ }
103
+ function jqlb_css(){
104
+ if(is_admin() || is_feed()){return;}
105
+ $locale = jqlb_get_locale();
106
+ $fileName = "lightbox.min.{$locale}.css";
107
+ $path = plugin_dir_path(__FILE__)."styles/{$fileName}";
108
+ if(!is_readable($path)){
109
+ $fileName = 'lightbox.min.css';
110
+ }
111
+ wp_enqueue_style('wp-lightbox-2.min.css', plugin_dir_url(__FILE__).'styles/'.$fileName, false, '1.3.4');
112
+ }
113
+ function jqlb_js() {
114
+ if(is_admin() || is_feed()){return;}
115
+ wp_enqueue_script('jquery', '', array(), '1.7.1', true);
116
+ wp_enqueue_script('wp-jquery-lightbox', plugins_url(JQLB_SCRIPT, __FILE__ ), Array('jquery'), '1.3.4.1', true);
117
+ wp_localize_script('wp-jquery-lightbox', 'JQLBSettings', array(
118
+ 'fitToScreen' => get_option('jqlb_resize_on_demand'),
119
+ 'resizeSpeed' => get_option('jqlb_resize_speed'),
120
+ 'displayDownloadLink' => get_option('jqlb_show_download'),
121
+ 'navbarOnTop' => get_option('jqlb_navbarOnTop'),
122
+ 'loopImages' => get_option('jqlb_loopImages'),
123
+ 'resizeCenter' => get_option('jqlb_resizeCenter'),
124
+ 'marginSize' => get_option('jqlb_margin_size'),
125
+ 'linkTarget' => get_option('jqlb_link_target'),
126
+ //'followScroll' => get_option('jqlb_follow_scroll'),
127
+ /* translation */
128
+ 'help' => __(get_option('jqlb_help_text'), 'jqlb'),
129
+ 'prevLinkTitle' => __('previous image', 'jqlb'),
130
+ 'nextLinkTitle' => __('next image', 'jqlb'),
131
+ 'prevLinkText' => __('&laquo; Previous', 'jqlb'),
132
+ 'nextLinkText' => __('Next &raquo;', 'jqlb'),
133
+ 'closeTitle' => __('close image gallery', 'jqlb'),
134
+ 'image' => __('Image ', 'jqlb'),
135
+ 'of' => __(' of ', 'jqlb'),
136
+ 'download' => __('Download', 'jqlb')
137
+ ));
138
+ }
139
+
140
+ function jqlb_lightbox_comment($comment){
141
+ $comment = str_replace('rel=\'external nofollow\'','', $comment);
142
+ $comment = str_replace('rel=\'nofollow\'','', $comment);
143
+ $comment = str_replace('rel="external nofollow"','', $comment);
144
+ $comment = str_replace('rel="nofollow"','', $comment);
145
+ return jqlb_autoexpand_rel_wlightbox($comment);
146
+ }
147
+
148
+ function jqlb_autoexpand_rel_wlightbox($content) {
149
+ if(get_option('jqlb_automate') == 1){
150
+ global $post;
151
+ $id = ($post->ID) ? $post->ID : -1;
152
+ $content = jqlb_do_regexp($content, $id);
153
+ }
154
+ return $content;
155
+ }
156
+ function jqlb_apply_lightbox($content, $id = -1){
157
+ if(!isset($id) || $id === -1){
158
+ $id = time().rand(0, 32768);
159
+ }
160
+ return jqlb_do_regexp($content, $id);
161
+ }
162
+
163
+ /* automatically insert rel="lightbox[nameofpost]" to every image with no manual work.
164
+ if there are already rel="lightbox[something]" attributes, they are not clobbered.
165
+ Michael Tyson, you are a regular expressions god! - http://atastypixel.com */
166
+ function jqlb_do_regexp($content, $id){
167
+ $id = esc_attr($id);
168
+ $pattern = "/(<a(?![^>]*?rel=['\"]lightbox.*)[^>]*?href=['\"][^'\"]+?\.(?:bmp|gif|jpg|jpeg|png)\?{0,1}\S{0,}['\"][^\>]*)>/i";
169
+ $replacement = '$1 rel="lightbox['.$id.']">';
170
+ return preg_replace($pattern, $replacement, $content);
171
+ }
172
+
173
+ function jqlb_bool_intval($v){
174
+ return $v == 1 ? '1' : '0';
175
+ }
176
+
177
+ function jqlb_pos_intval($v){
178
+ return abs(intval($v));
179
+ }
180
+ function jqlb_options_panel(){
181
+ if(!function_exists('current_user_can') || !current_user_can('manage_options')){
182
+ die(__('Cheatin&#8217; uh?', 'jqlb'));
183
+ }
184
+ add_action('in_admin_footer', 'jqlb_add_admin_footer');
185
+ ?>
186
+
187
+ <div class="wrap">
188
+ <h2>WP Lightbox 2</h2>
189
+ <div id="sideblock" style="float:right;width:270px;margin-left:10px;">
190
+ <iframe width=270 height=500 frameborder="0" src="http://demos.onlinewebapplication.com/wp-internal-links/SEOIinternalLinks.html"></iframe>
191
+ </div>
192
+ <?php include_once(plugin_dir_path(__FILE__).'about.php'); ?>
193
+ <form method="post" action="options.php">
194
+ <table>
195
+ <?php settings_fields('jqlb-settings-group'); ?>
196
+ <tr valign="baseline" colspan="2">
197
+ <td colspan="">
198
+ <?php $check = get_option('jqlb_automate') ? ' checked="yes" ' : ''; ?>
199
+ <input type="checkbox" id="jqlb_automate" name="jqlb_automate" value="1" <?php echo $check; ?>/>
200
+ <label for="jqlb_automate" title="<?php _e('Let the plugin add necessary html to image links', 'jqlb') ?>"> <?php _e('Auto-lightbox image links', 'jqlb') ?></label>
201
+ </td>
202
+ </tr>
203
+ <tr valign="baseline" colspan="2">
204
+ <td colspan="2">
205
+ <?php $check = get_option('jqlb_comments') ? ' checked="yes" ' : ''; ?>
206
+ <input type="checkbox" id="jqlb_comments" name="jqlb_comments" value="1" <?php echo $check; ?>/>
207
+ <label for="jqlb_comments" title="<?php _e('Note: this will disable the nofollow-attribute of comment links, that otherwise interfere with the lightbox.', 'jqlb') ?>"> <?php _e('Enable lightbox in comments (disables <a href="http://codex.wordpress.org/Nofollow">the nofollow attribute!</a>)', 'jqlb') ?></label>
208
+ </td>
209
+ </tr>
210
+ <tr valign="baseline" colspan="2">
211
+ <td>
212
+ <?php $check = get_option('jqlb_show_download') ? ' checked="yes" ' : ''; ?>
213
+ <input type="checkbox" id="jqlb_show_download" name="jqlb_show_download" value="1" <?php echo $check; ?> />
214
+ <label for="jqlb_show_download"> <?php _e('Show download link', 'jqlb') ?> </label>
215
+ </td>
216
+ <td>
217
+ <?php $target = get_option('jqlb_link_target'); ?>
218
+ <label for="jqlb_link_target" title="<?php _e('_blank: open the image in a new window or tab
219
+ _self: open the image in the same frame as it was clicked (default)
220
+ _parent: open the image in the parent frameset
221
+ _top: open the image in the full body of the window', 'jqlb') ?>"><?php _e('Target for download link:', 'jqlb'); ?></label>
222
+ <select id="jqlb_link_target" name="jqlb_link_target">
223
+ <option <?php if ('_blank' == $target)echo 'selected="selected"'; ?>>_blank</option>
224
+ <option <?php if ('_self' == $target)echo 'selected="selected"'; ?>>_self</option>
225
+ <option <?php if ('_top' == $target)echo 'selected="selected"'; ?>>_top</option>
226
+ <option <?php if ('_parent' == $target)echo 'selected="selected"'; ?>>_parent</option>
227
+ </select>
228
+ </td>
229
+ </tr>
230
+ <tr valign="baseline" colspan="2">
231
+ <td colspan="2">
232
+ <?php $check = get_option('jqlb_navbarOnTop') ? ' checked="yes" ' : ''; ?>
233
+ <input type="checkbox" id="jqlb_navbarOnTop" name="jqlb_navbarOnTop" value="1" <?php echo $check; ?> />
234
+ <label for="jqlb_navbarOnTop">
235
+ <?php _e('Show image info on top', 'jqlb') ?>
236
+ </label>
237
+ </td>
238
+ </tr>
239
+ <tr valign="baseline" colspan="2">
240
+ <td>
241
+ <?php $check = get_option('jqlb_resize_on_demand') ? ' checked="yes" ' : ''; ?>
242
+ <input type="checkbox" id="jqlb_resize_on_demand" name="jqlb_resize_on_demand" value="1" <?php echo $check; ?> />
243
+ <label for="jqlb_resize_on_demand"><?php _e('Shrink large images to fit smaller screens', 'jqlb') ?></label>
244
+ </td>
245
+ <?php IF($check != ''): ?>
246
+ <td>
247
+ <input type="text" id="jqlb_margin_size" name="jqlb_margin_size" value="<?php echo floatval(get_option('jqlb_margin_size')) ?>" size="3" />
248
+ <label for="jqlb_margin_size" title="<?php _e('Keep a distance between the image and the screen edges.', 'jqlb') ?>"><?php _e('Minimum margin to screen edge (default: 0)', 'jqlb') ?></label>
249
+ </td>
250
+ <?php ENDIF; ?>
251
+ </tr>
252
+ <tr valign="baseline" colspan="2">
253
+ <td colspan="2">
254
+ <input type="text" id="jqlb_resize_speed" name="jqlb_resize_speed" value="<?php echo intval(get_option('jqlb_resize_speed')) ?>" size="3" />
255
+ <label for="jqlb_resize_speed"><?php _e('Animation duration (in milliseconds) ', 'jqlb') ?></label>
256
+ </td>
257
+ </tr>
258
+ <tr valign="baseline" colspan="2">
259
+ <td>
260
+ <input type="text" id="jqlb_help_text" name="jqlb_help_text" value="<?php echo get_option('jqlb_help_text'); ?>" size="30" />
261
+ <label for="jqlb_help_text"><?php _e('Help text (default: none) ', 'jqlb'); ?></label>
262
+ </td>
263
+ </tr>
264
+ </table>
265
+ <p style="font-size:xx-small;font-style:italic;"><?php _e('Browse images with your keyboard: Arrows or P(revious)/N(ext) and X/C/ESC for close.', 'jqlb'); ?></p>
266
+ <p class="submit">
267
+ <input type="submit" name="Submit" value="<?php _e('Save Changes', 'jqlb') ?>" />
268
+ </p>
269
+ </form>
270
+ <?php
271
+ $locale = jqlb_get_locale();
272
+ $diskfile = plugin_dir_path(__FILE__)."I18n/howtouse-{$locale}.html";
273
+ if (!file_exists($diskfile)){
274
+ $diskfile = plugin_dir_path(__FILE__).'I18n/howtouse.html';
275
+ }
276
+ $text = false;
277
+ if(function_exists('file_get_contents')){
278
+ $text = @file_get_contents($diskfile);
279
+ } else {
280
+ $text = @file($diskfile);
281
+ if($text !== false){
282
+ $text = implode("", $text);
283
+ }
284
+ }
285
+ if($text === false){
286
+ $text = '<p>The documentation files are missing! Try <a href="http://wordpress.org/extend/plugins/wp-lightbox-2/">downloading</a> and <a href="http://wordpress.org/extend/plugins/wp-lightbox-2/installation/">re-installing</a> this plugin.</p>';
287
+ }
288
+ echo $text;
289
+ ?>
290
+ </div>
291
+ <?php }?>