jQuery Colorbox - Version 1.2

Version Description

  • fixes bug where colorbox was not working if linked images were used (by the theme) outside of blog posts and pages.
  • adds configuration for Colorbox and picture resizing
Download this release

Release Info

Developer techotronic
Plugin Icon 128x128 jQuery Colorbox
Version 1.2
Comparing to
See all releases

Code changes from version 1.1 to 1.2

jquery-colorbox.php CHANGED
@@ -6,7 +6,7 @@
6
  * Plugin Name: jQuery Colorbox
7
  * Plugin URI: http://www.techotronic.de/index.php/plugins/jquery-colorbox/
8
  * Description: Used to overlay images on the current page. Images in one post are grouped automatically.
9
- * Version: 1.1
10
  * Author: Arne Franken
11
  * Author URI: http://www.techotronic.de
12
  */
@@ -54,7 +54,10 @@ class jQueryColorbox {
54
  $colorboxDefaultTheme = key( $this->colorboxThemes );
55
  $this->colorboxDefaultSettings = array(
56
  'colorboxTheme' => $colorboxDefaultTheme,
57
- 'isAutoColorBox' => False
 
 
 
58
  );
59
 
60
  // Create the settings array by merging the user's settings and the defaults
@@ -115,14 +118,17 @@ class jQueryColorbox {
115
  //gets all "a" elements that have a nested "img"
116
  $("a:has(img)").each(function(index, obj){
117
  //in this context, the first child is always an image if fundamental Wordpress functions are used
118
- $nestedElement = $(obj).children(0);
119
- $groupId = $nestedElement.attr("class").match('colorbox-[0-9]+').toString();
120
  if($nestedElement.is("img")){
121
- //and calls colorbox function on each img.
122
- //elements with the same groupId in the class attribute are grouped
123
- //the title of the img is used as the title for the colorbox.
124
- $(obj).colorbox({rel:$groupId, maxWidth:"95%", maxHeight:"95%", title:$nestedElement.attr("title")});
125
- };
 
 
 
 
126
  });
127
  });
128
  // ]]>
@@ -165,6 +171,54 @@ class jQueryColorbox {
165
  </select>
166
  </td>
167
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  </table>
169
 
170
  <p><?php printf( __('If you would like to make a small (or large) contribution towards future development please consider making a <a href="%1$s" title="%2$s">%2$s</a>.', 'jquery-colorbox'), 'http://www.techotronic.de/index.php/donate/', __('donation','jquery-colorbox') ) ?></p>
6
  * Plugin Name: jQuery Colorbox
7
  * Plugin URI: http://www.techotronic.de/index.php/plugins/jquery-colorbox/
8
  * Description: Used to overlay images on the current page. Images in one post are grouped automatically.
9
+ * Version: 1.2
10
  * Author: Arne Franken
11
  * Author URI: http://www.techotronic.de
12
  */
54
  $colorboxDefaultTheme = key( $this->colorboxThemes );
55
  $this->colorboxDefaultSettings = array(
56
  'colorboxTheme' => $colorboxDefaultTheme,
57
+ 'maxWidth' => 'false',
58
+ 'maxHeight' => 'false',
59
+ 'height' => 'false',
60
+ 'width' => 'false'
61
  );
62
 
63
  // Create the settings array by merging the user's settings and the defaults
118
  //gets all "a" elements that have a nested "img"
119
  $("a:has(img)").each(function(index, obj){
120
  //in this context, the first child is always an image if fundamental Wordpress functions are used
121
+ var $nestedElement = $(obj).children(0);
 
122
  if($nestedElement.is("img")){
123
+ var $groupId = $nestedElement.attr("class").match('colorbox-[0-9]+');
124
+ //only call colorbox if there is a groupId for the image.
125
+ if($groupId){
126
+ //and calls colorbox function on each img.
127
+ //elements with the same groupId in the class attribute are grouped
128
+ //the title of the img is used as the title for the colorbox.
129
+ $(obj).colorbox({rel:$groupId.toString(), <?php echo('maxWidth:' . '"' . $this->colorboxSettings['maxWidth'] . '"' . ','); echo('maxHeight:' . '"' . $this->colorboxSettings['maxHeight'] . '"' . ','); echo('height:' . '"' . $this->colorboxSettings['height'] . '"' . ','); echo('width:' . '"' . $this->colorboxSettings['width'] . '"' . ',') ?> title:$nestedElement.attr("title")});
130
+ }
131
+ }
132
  });
133
  });
134
  // ]]>
171
  </select>
172
  </td>
173
  </tr>
174
+ <tr>
175
+ <td><label for="jquery-colorbox-maxWidth"><?php _e('maxWidth', 'jquery-colorbox'); ?>:</label></td>
176
+ <td><input type="text" name="jquery-colorbox_settings[maxWidth]" id="jquery-colorbox-maxWidth" value="<?php echo $this->colorboxSettings['maxWidth'] ?>" /></td>
177
+ </tr>
178
+ <tr>
179
+ <td></td>
180
+ <td>
181
+ <span class="setting-description">
182
+ <?php _e('Set the maximum width of the picture in the Colorbox in relation to the browser window. The picture is resized to the appropriate size. Set to either "false" (no maximum width for the picture, picture is as wide as the Colorbox) or a percent value, e.g. "95%"', 'jquery-colorbox'); ?>
183
+ </span>
184
+ </td>
185
+ </tr>
186
+ <tr>
187
+ <td><label for="jquery-colorbox-maxHeight"><?php _e('maxHeight', 'jquery-colorbox'); ?>:</label></td>
188
+ <td><input type="text" name="jquery-colorbox_settings[maxHeight]" id="jquery-colorbox-maxHeight" value="<?php echo $this->colorboxSettings['maxHeight'] ?>" /></td>
189
+ </tr>
190
+ <tr>
191
+ <td></td>
192
+ <td>
193
+ <span class="setting-description">
194
+ <?php _e('Set the maximum height of the picture in the Colorbox in relation to the browser window. The picture is resized to the appropriate size. Set to either "false" (no maximum height for the picture, picture is as high as the Colorbox) or a percent value, e.g. "95%"', 'jquery-colorbox'); ?>
195
+ </span>
196
+ </td>
197
+ </tr>
198
+ <tr>
199
+ <td><label for="jquery-colorbox-width"><?php _e('width', 'jquery-colorbox'); ?>:</label></td>
200
+ <td><input type="text" name="jquery-colorbox_settings[width]" id="jquery-colorbox-width" value="<?php echo $this->colorboxSettings['width'] ?>" /></td>
201
+ </tr>
202
+ <tr>
203
+ <td></td>
204
+ <td>
205
+ <span class="setting-description">
206
+ <?php _e('Set the maximum width of the Colorbox itself in relation to the browser window. The picture is NOT resized, if bigger than the colorbox, scrollbars are displayed. Set to either "false" (no maximum width for Colorbox, Colorbox is as big as the picture in it) or a percent value, e.g. "95%"', 'jquery-colorbox'); ?>
207
+ </span>
208
+ </td>
209
+ </tr>
210
+ <tr>
211
+ <td><label for="jquery-colorbox-height"><?php _e('height', 'jquery-colorbox'); ?>:</label></td>
212
+ <td><input type="text" name="jquery-colorbox_settings[height]" id="jquery-colorbox-height" value="<?php echo $this->colorboxSettings['height'] ?>" /></td>
213
+ </tr>
214
+ <tr>
215
+ <td></td>
216
+ <td>
217
+ <span class="setting-description">
218
+ <?php _e('Set the maximum height of the Colorbox itself in relation to the browser window. The picture is NOT resized, if bigger than the colorbox, scrollbars are displayed. Set to either "false" (no maximum height for Colorbox, Colorbox is as big as the picture in it) or a percent value, e.g. "95%"', 'jquery-colorbox'); ?>
219
+ </span>
220
+ </td>
221
+ </tr>
222
  </table>
223
 
224
  <p><?php printf( __('If you would like to make a small (or large) contribution towards future development please consider making a <a href="%1$s" title="%2$s">%2$s</a>.', 'jquery-colorbox'), 'http://www.techotronic.de/index.php/donate/', __('donation','jquery-colorbox') ) ?></p>
localization/jquery-colorbox-de_DE.mo CHANGED
Binary file
localization/jquery-colorbox-de_DE.po CHANGED
@@ -2,9 +2,9 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: jQuery-Colorbox\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2009-12-28 01:23+0100\n"
6
  "PO-Revision-Date: \n"
7
- "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -34,36 +34,68 @@ msgstr ""
34
  msgid "Theme #5"
35
  msgstr ""
36
 
37
- #: jquery-colorbox.php:78
38
  msgid "jQuery Colorbox"
39
  msgstr ""
40
 
41
- #: jquery-colorbox.php:91
42
  msgid "Settings"
43
  msgstr "Einstellungen"
44
 
45
- #: jquery-colorbox.php:145
46
  msgid "jQuery Colorbox Settings"
47
  msgstr "jQuery Colorbox Einstellungen"
48
 
49
- #: jquery-colorbox.php:151
50
  msgid "Select the theme you want to use on your blog."
51
  msgstr "W&auml;hle das Theme aus, das Du auf Deinem Blog benutzen m&ouml;chtest."
52
 
53
- #: jquery-colorbox.php:155
54
  msgid "Theme"
55
  msgstr ""
56
 
57
- #: jquery-colorbox.php:170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  #, php-format
59
  msgid "If you would like to make a small (or large) contribution towards future development please consider making a <a href=\"%1$s\" title=\"%2$s\">%2$s</a>."
60
  msgstr "Wenn Du eine kleine (oder grosse) <a href=\"%1$s\" title=\"%2$s\">%2$s</a> f&uuml;r die Weiterentwicklung m&ouml;chtest, kannst Du das per PayPal tun."
61
 
62
- #: jquery-colorbox.php:170
63
  msgid "donation"
64
  msgstr "Spende"
65
 
66
- #: jquery-colorbox.php:173
67
  msgid "Save Changes"
68
  msgstr "&Auml;nderungen speichern"
69
 
2
  msgstr ""
3
  "Project-Id-Version: jQuery-Colorbox\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-01-11 22:25+0100\n"
6
  "PO-Revision-Date: \n"
7
+ "Last-Translator: Arne Franken <blog@techotronic.de>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
34
  msgid "Theme #5"
35
  msgstr ""
36
 
37
+ #: jquery-colorbox.php:81
38
  msgid "jQuery Colorbox"
39
  msgstr ""
40
 
41
+ #: jquery-colorbox.php:94
42
  msgid "Settings"
43
  msgstr "Einstellungen"
44
 
45
+ #: jquery-colorbox.php:151
46
  msgid "jQuery Colorbox Settings"
47
  msgstr "jQuery Colorbox Einstellungen"
48
 
49
+ #: jquery-colorbox.php:157
50
  msgid "Select the theme you want to use on your blog."
51
  msgstr "W&auml;hle das Theme aus, das Du auf Deinem Blog benutzen m&ouml;chtest."
52
 
53
+ #: jquery-colorbox.php:161
54
  msgid "Theme"
55
  msgstr ""
56
 
57
+ #: jquery-colorbox.php:175
58
+ msgid "maxWidth"
59
+ msgstr ""
60
+
61
+ #: jquery-colorbox.php:182
62
+ msgid "Set the maximum width of the picture in the Colorbox in relation to the browser window. The picture is resized to the appropriate size. Set to either \"false\" (no maximum width for the picture, picture is as wide as the Colorbox) or a percent value, e.g. \"95%\""
63
+ msgstr "Hier l&auml;sst sich die maximale Breite des Bildes in der colorbox in relation zum Browserfenster festlegen. Das Bild wird verkleinert falls n&ouml;tig. Entweder auf \"false\" (keine maximale Breite des Bildes, das Bild ist so breit wie die Colorbox) oder auf einen Prozentwert setzen, z.B. \"95%\""
64
+
65
+ #: jquery-colorbox.php:187
66
+ msgid "maxHeight"
67
+ msgstr ""
68
+
69
+ #: jquery-colorbox.php:194
70
+ msgid "Set the maximum height of the picture in the Colorbox in relation to the browser window. The picture is resized to the appropriate size. Set to either \"false\" (no maximum height for the picture, picture is as high as the Colorbox) or a percent value, e.g. \"95%\""
71
+ msgstr "Hier l&auml;sst sich die maximale H&ouml;he des Bildes in der colorbox in relation zum Browserfenster festlegen. Das Bild wird verkleinert falls n&ouml;tig. Entweder auf \"false\" (keine maximale H&oumlhe des Bildes, das Bild ist so hoch wie die Colorbox) oder auf einen Prozentwert setzen, z.B. \"95%\""
72
+
73
+ #: jquery-colorbox.php:199
74
+ msgid "width"
75
+ msgstr ""
76
+
77
+ #: jquery-colorbox.php:206
78
+ msgid "Set the maximum width of the Colorbox itself in relation to the browser window. The picture is NOT resized, if bigger than the colorbox, scrollbars are displayed. Set to either \"false\" (no maximum width for Colorbox, Colorbox is as big as the picture in it) or a percent value, e.g. \"95%\""
79
+ msgstr "Hier l&auml;sst sich die maximale Breite der Colorbox in relation zum Browserfenster festlegen. Das Bild wird NICHT verkleinert. Wenn das Bild gr&ouml;sser als die Colorbox ist, werden Scrollbalken dargestellt. Entweder auf \"false\" (keine maximale Breite f&uuml;r die Colorbox, die Colorbox wird so gross wie das Bild) oder auf einen Prozentwert setzen, z.B. \"95%\""
80
+
81
+ #: jquery-colorbox.php:211
82
+ msgid "height"
83
+ msgstr ""
84
+
85
+ #: jquery-colorbox.php:218
86
+ msgid "Set the maximum height of the Colorbox itself in relation to the browser window. The picture is NOT resized, if bigger than the colorbox, scrollbars are displayed. Set to either \"false\" (no maximum height for Colorbox, Colorbox is as big as the picture in it) or a percent value, e.g. \"95%\""
87
+ msgstr "Hier l&auml;sst sich die maximale H&ouml;he der Colorbox in relation zum Browserfenster festlegen. Das Bild wird NICHT verkleinert. Wenn das Bild gr&ouml;sser als die Colorbox ist, werden Scrollbalken dargestellt. Entweder auf \"false\" (keine maximale H&ouml;he f&uuml;r die Colorbox, die Colorbox wird so gross wie das Bild) oder auf einen Prozentwert setzen, z.B. \"95%\""
88
+
89
+ #: jquery-colorbox.php:224
90
  #, php-format
91
  msgid "If you would like to make a small (or large) contribution towards future development please consider making a <a href=\"%1$s\" title=\"%2$s\">%2$s</a>."
92
  msgstr "Wenn Du eine kleine (oder grosse) <a href=\"%1$s\" title=\"%2$s\">%2$s</a> f&uuml;r die Weiterentwicklung m&ouml;chtest, kannst Du das per PayPal tun."
93
 
94
+ #: jquery-colorbox.php:224
95
  msgid "donation"
96
  msgstr "Spende"
97
 
98
+ #: jquery-colorbox.php:227
99
  msgid "Save Changes"
100
  msgstr "&Auml;nderungen speichern"
101
 
localization/jquery-colorbox-en_EN.mo CHANGED
Binary file
localization/jquery-colorbox-en_EN.po CHANGED
@@ -2,9 +2,9 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: jQuery-Colorbox\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2009-12-28 01:23+0100\n"
6
  "PO-Revision-Date: \n"
7
- "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -34,36 +34,68 @@ msgstr ""
34
  msgid "Theme #5"
35
  msgstr ""
36
 
37
- #: jquery-colorbox.php:78
38
  msgid "jQuery Colorbox"
39
  msgstr ""
40
 
41
- #: jquery-colorbox.php:91
42
  msgid "Settings"
43
  msgstr ""
44
 
45
- #: jquery-colorbox.php:145
46
  msgid "jQuery Colorbox Settings"
47
  msgstr ""
48
 
49
- #: jquery-colorbox.php:151
50
  msgid "Select the theme you want to use on your blog."
51
  msgstr ""
52
 
53
- #: jquery-colorbox.php:155
54
  msgid "Theme"
55
  msgstr ""
56
 
57
- #: jquery-colorbox.php:170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  #, php-format
59
  msgid "If you would like to make a small (or large) contribution towards future development please consider making a <a href=\"%1$s\" title=\"%2$s\">%2$s</a>."
60
  msgstr ""
61
 
62
- #: jquery-colorbox.php:170
63
  msgid "donation"
64
  msgstr ""
65
 
66
- #: jquery-colorbox.php:173
67
  msgid "Save Changes"
68
  msgstr ""
69
 
2
  msgstr ""
3
  "Project-Id-Version: jQuery-Colorbox\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-01-11 23:23+0100\n"
6
  "PO-Revision-Date: \n"
7
+ "Last-Translator: Arne Franken <blog@techotronic.de>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
34
  msgid "Theme #5"
35
  msgstr ""
36
 
37
+ #: jquery-colorbox.php:81
38
  msgid "jQuery Colorbox"
39
  msgstr ""
40
 
41
+ #: jquery-colorbox.php:94
42
  msgid "Settings"
43
  msgstr ""
44
 
45
+ #: jquery-colorbox.php:151
46
  msgid "jQuery Colorbox Settings"
47
  msgstr ""
48
 
49
+ #: jquery-colorbox.php:157
50
  msgid "Select the theme you want to use on your blog."
51
  msgstr ""
52
 
53
+ #: jquery-colorbox.php:161
54
  msgid "Theme"
55
  msgstr ""
56
 
57
+ #: jquery-colorbox.php:175
58
+ msgid "maxWidth"
59
+ msgstr ""
60
+
61
+ #: jquery-colorbox.php:182
62
+ msgid "Set the maximum width of the picture in the Colorbox in relation to the browser window. The picture is resized to the appropriate size. Set to either \"false\" (no maximum width for the picture, picture is as wide as the Colorbox) or a percent value, e.g. \"95%\""
63
+ msgstr ""
64
+
65
+ #: jquery-colorbox.php:187
66
+ msgid "maxHeight"
67
+ msgstr ""
68
+
69
+ #: jquery-colorbox.php:194
70
+ msgid "Set the maximum height of the picture in the Colorbox in relation to the browser window. The picture is resized to the appropriate size. Set to either \"false\" (no maximum height for the picture, picture is as high as the Colorbox) or a percent value, e.g. \"95%\""
71
+ msgstr ""
72
+
73
+ #: jquery-colorbox.php:199
74
+ msgid "width"
75
+ msgstr ""
76
+
77
+ #: jquery-colorbox.php:206
78
+ msgid "Set the maximum width of the Colorbox itself in relation to the browser window. The picture is NOT resized, if bigger than the colorbox, scrollbars are displayed. Set to either \"false\" (no maximum width for Colorbox, Colorbox is as big as the picture in it) or a percent value, e.g. \"95%\""
79
+ msgstr ""
80
+
81
+ #: jquery-colorbox.php:211
82
+ msgid "height"
83
+ msgstr ""
84
+
85
+ #: jquery-colorbox.php:218
86
+ msgid "Set the maximum height of the Colorbox itself in relation to the browser window. The picture is NOT resized, if bigger than the colorbox, scrollbars are displayed. Set to either \"false\" (no maximum height for Colorbox, Colorbox is as big as the picture in it) or a percent value, e.g. \"95%\""
87
+ msgstr ""
88
+
89
+ #: jquery-colorbox.php:224
90
  #, php-format
91
  msgid "If you would like to make a small (or large) contribution towards future development please consider making a <a href=\"%1$s\" title=\"%2$s\">%2$s</a>."
92
  msgstr ""
93
 
94
+ #: jquery-colorbox.php:224
95
  msgid "donation"
96
  msgstr ""
97
 
98
+ #: jquery-colorbox.php:227
99
  msgid "Save Changes"
100
  msgstr ""
101
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: techotronic
3
  Donate link: http://www.techotronic.de/index.php/donate/
4
  Tags: jquery, colorbox, lightbox, images, gallery, javascript, overlay
5
  Requires at least: 2.8.5
6
- Tested up to: 2.8.6
7
- Stable tag: 1.1
8
 
9
  Automatically adds Colorbox/Lightbox functionality to all images on the blog. Images are grouped by post.
10
 
@@ -12,7 +12,7 @@ Automatically adds Colorbox/Lightbox functionality to all images on the blog. Im
12
 
13
  Yet another Colorbox plugin for Wordpress.
14
 
15
- All images on the blog are displayed in a layer when clicked. Images are grouped as galleries when linked in the same blogpost.
16
 
17
  Includes <a href="http://colorpowered.com/colorbox/">ColorBox</a> 1.3.5 jQuery plugin from Jack Moore. Colorbox is licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>.
18
  jQuery Colorbox uses the jQuery library bundled with Wordpress.
@@ -49,6 +49,10 @@ When rendering content, a special colorbox-class is added to linked images. The
49
 
50
  == Changelog ==
51
 
 
 
 
 
52
  = 1.1 =
53
  * fixes critical bug which would break rendering the blog. Sorry, was not aware that the plugin would be listed before I tagged the files as 1.0 in subversion...
54
 
3
  Donate link: http://www.techotronic.de/index.php/donate/
4
  Tags: jquery, colorbox, lightbox, images, gallery, javascript, overlay
5
  Requires at least: 2.8.5
6
+ Tested up to: 2.9.1
7
+ Stable tag: 1.2
8
 
9
  Automatically adds Colorbox/Lightbox functionality to all images on the blog. Images are grouped by post.
10
 
12
 
13
  Yet another Colorbox plugin for Wordpress.
14
 
15
+ All images in posts and pages are displayed in a layer when clicked. Images are grouped as galleries when linked in the same blog post or page.
16
 
17
  Includes <a href="http://colorpowered.com/colorbox/">ColorBox</a> 1.3.5 jQuery plugin from Jack Moore. Colorbox is licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>.
18
  jQuery Colorbox uses the jQuery library bundled with Wordpress.
49
 
50
  == Changelog ==
51
 
52
+ = 1.2 =
53
+ * fixes bug where colorbox was not working if linked images were used (by the theme) outside of blog posts and pages.
54
+ * adds configuration for Colorbox and picture resizing
55
+
56
  = 1.1 =
57
  * fixes critical bug which would break rendering the blog. Sorry, was not aware that the plugin would be listed before I tagged the files as 1.0 in subversion...
58