Version Description
Fixes for Internet Explorer? Support mixed HTTP/HTTPS. Added Japanese translation.
Download this release
Release Info
Developer | ulfben |
Plugin | WP jQuery Lightbox |
Version | 1.3.3 |
Comparing to | |
See all releases |
Code changes from version 1.3.2 to 1.3.3
- jquery.lightbox.js +490 -485
- jquery.lightbox.min.js +1 -1
- languages/howtouse-en_US.html +1 -1
- languages/howtouse-ja.html +50 -0
- languages/howtouse.html +1 -1
- languages/jqlb-ja.mo +0 -0
- languages/jqlb-ja.po +94 -0
- readme.txt +33 -5
- {images → styles/images}/blank.gif +0 -0
- {images → styles/images}/close.gif +0 -0
- {images → styles/images}/closelabel.gif +0 -0
- {images → styles/images}/cs_CZ/blank.gif +0 -0
- {images → styles/images}/cs_CZ/close.gif +0 -0
- {images → styles/images}/cs_CZ/closelabel.gif +0 -0
- {images → styles/images}/cs_CZ/loading.gif +0 -0
- {images → styles/images}/cs_CZ/next.gif +0 -0
- {images → styles/images}/cs_CZ/nextlabel.gif +0 -0
- {images → styles/images}/cs_CZ/prev.gif +0 -0
- {images → styles/images}/cs_CZ/prevlabel.gif +0 -0
- {images → styles/images}/loading.gif +0 -0
- {images → styles/images}/next.gif +0 -0
- {images → styles/images}/nextlabel.gif +0 -0
- {images → styles/images}/prev.gif +0 -0
- {images → styles/images}/prevlabel.gif +0 -0
- {images → styles/images}/ru_RU/blank.gif +0 -0
- {images → styles/images}/ru_RU/close.gif +0 -0
- {images → styles/images}/ru_RU/closelabel.gif +0 -0
- {images → styles/images}/ru_RU/loading.gif +0 -0
- {images → styles/images}/ru_RU/next.gif +0 -0
- {images → styles/images}/ru_RU/nextlabel.gif +0 -0
- {images → styles/images}/ru_RU/prev.gif +0 -0
- {images → styles/images}/ru_RU/prevlabel.gif +0 -0
- lightbox.css → styles/lightbox.css +0 -0
- lightbox.min.cs_CZ.css → styles/lightbox.min.cs_CZ.css +0 -0
- lightbox.min.css → styles/lightbox.min.css +0 -0
- lightbox.min.ru_RU.css → styles/lightbox.min.ru_RU.css +0 -0
- wp-jquery-lightbox.php +270 -221
jquery.lightbox.js
CHANGED
@@ -1,485 +1,490 @@
|
|
1 |
-
/**
|
2 |
-
* WP jQuery Lightbox
|
3 |
-
* Version 1.3.
|
4 |
-
* @author Ulf Benjaminsson (http://www.ulfben.com)
|
5 |
-
*
|
6 |
-
* This is a modified version of Warren Krevenkis Lightbox-port (see notice below) for use in the WP jQuery Lightbox-
|
7 |
-
* plugin (http://wordpress.org/extend/plugins/wp-jquery-lightbox/)
|
8 |
-
* Modifications include:
|
9 |
-
* . improved the resizing code to respect aspect ratio
|
10 |
-
* . improved scaling routines to maximize images while taking captions into account
|
11 |
-
* . added support for browser resizing and orientation changes
|
12 |
-
* . grabs image caption from WordPress [gallery] or media library output
|
13 |
-
* . using WordPress API to localize script (with safe fallbacks)
|
14 |
-
* . grabs image title if the link lacks one
|
15 |
-
* . using rel attribute instead of class
|
16 |
-
* . auto-lightboxing all links after page load
|
17 |
-
* . replaced explicit IMG-urls with divs, styled through the CSS.
|
18 |
-
* . honors empty captions / titles
|
19 |
-
* . use only title if captions is identical
|
20 |
-
* . added support for disabling all animations
|
21 |
-
* . using no-conflict mode (for good measure)
|
22 |
-
**/
|
23 |
-
/**
|
24 |
-
* jQuery Lightbox
|
25 |
-
* Version 0.5 - 11/29/2007
|
26 |
-
* @author Warren Krewenki
|
27 |
-
*
|
28 |
-
* This package is distributed under the BSD license.
|
29 |
-
* For full license information, see LICENSE.TXT
|
30 |
-
*
|
31 |
-
* Based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
|
32 |
-
* Originally written to make use of the Prototype framework, and Script.acalo.us, now altered to use jQuery.
|
33 |
-
**/
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
}
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
disableNavbarLinks: true,
|
452 |
-
loopImages: true,
|
453 |
-
imageClickClose: true,
|
454 |
-
jsonData: null,
|
455 |
-
jsonDataParser: null,
|
456 |
-
|
457 |
-
|
458 |
-
}
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* WP jQuery Lightbox
|
3 |
+
* Version 1.3.3 - 2011-06-21
|
4 |
+
* @author Ulf Benjaminsson (http://www.ulfben.com)
|
5 |
+
*
|
6 |
+
* This is a modified version of Warren Krevenkis Lightbox-port (see notice below) for use in the WP jQuery Lightbox-
|
7 |
+
* plugin (http://wordpress.org/extend/plugins/wp-jquery-lightbox/)
|
8 |
+
* Modifications include:
|
9 |
+
* . improved the resizing code to respect aspect ratio
|
10 |
+
* . improved scaling routines to maximize images while taking captions into account
|
11 |
+
* . added support for browser resizing and orientation changes
|
12 |
+
* . grabs image caption from WordPress [gallery] or media library output
|
13 |
+
* . using WordPress API to localize script (with safe fallbacks)
|
14 |
+
* . grabs image title if the link lacks one
|
15 |
+
* . using rel attribute instead of class
|
16 |
+
* . auto-lightboxing all links after page load
|
17 |
+
* . replaced explicit IMG-urls with divs, styled through the CSS.
|
18 |
+
* . honors empty captions / titles
|
19 |
+
* . use only title if captions is identical
|
20 |
+
* . added support for disabling all animations
|
21 |
+
* . using no-conflict mode (for good measure)
|
22 |
+
**/
|
23 |
+
/**
|
24 |
+
* jQuery Lightbox
|
25 |
+
* Version 0.5 - 11/29/2007
|
26 |
+
* @author Warren Krewenki
|
27 |
+
*
|
28 |
+
* This package is distributed under the BSD license.
|
29 |
+
* For full license information, see LICENSE.TXT
|
30 |
+
*
|
31 |
+
* Based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
|
32 |
+
* Originally written to make use of the Prototype framework, and Script.acalo.us, now altered to use jQuery.
|
33 |
+
**/
|
34 |
+
|
35 |
+
/** toyNN: davidtg@comtrya.com: fixed IE7-8 incompatabilities in 1.3.* branch **/
|
36 |
+
|
37 |
+
(function($){
|
38 |
+
$.fn.lightbox = function(options) {
|
39 |
+
var opts = $.extend({}, $.fn.lightbox.defaults, options);
|
40 |
+
return $(this).live("click", function () {
|
41 |
+
initialize();
|
42 |
+
start(this);
|
43 |
+
return false;
|
44 |
+
});
|
45 |
+
function initialize() {
|
46 |
+
$(window).bind('orientationchange', resizeListener);
|
47 |
+
$(window).bind('resize', resizeListener);
|
48 |
+
// if (opts.followScroll) { $(window).bind('scroll', orientListener); }
|
49 |
+
$('#overlay').remove();
|
50 |
+
$('#lightbox').remove();
|
51 |
+
opts.isIE8 = isIE8(); // //http://www.grayston.net/2011/internet-explorer-v8-and-opacity-issues/
|
52 |
+
opts.inprogress = false;
|
53 |
+
// if jsonData, build the imageArray from data provided in JSON format
|
54 |
+
if (opts.jsonData && opts.jsonData.length > 0) {
|
55 |
+
var parser = opts.jsonDataParser ? opts.jsonDataParser : $.fn.lightbox.parseJsonData;
|
56 |
+
opts.imageArray = [];
|
57 |
+
opts.imageArray = parser(opts.jsonData);
|
58 |
+
}
|
59 |
+
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>';
|
60 |
+
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">';
|
61 |
+
if (opts.displayHelp) {
|
62 |
+
imageData += '<span id="helpDisplay">' + opts.strings.help + '</span>';
|
63 |
+
}
|
64 |
+
imageData += '<a href="javascript://" id="bottomNavClose" title="' + opts.strings.closeTitle + '"><div id="jqlb_closelabel"></div></a></div></div></div>';
|
65 |
+
var string;
|
66 |
+
if (opts.navbarOnTop) {
|
67 |
+
string = '<div id="overlay"></div><div id="lightbox">' + imageData + outerImage + '</div>';
|
68 |
+
$("body").append(string);
|
69 |
+
$("#imageDataContainer").addClass('ontop');
|
70 |
+
} else {
|
71 |
+
string = '<div id="overlay"></div><div id="lightbox">' + outerImage + imageData + '</div>';
|
72 |
+
$("body").append(string);
|
73 |
+
}
|
74 |
+
$("#overlay").click(function () { end(); }).hide();
|
75 |
+
$("#lightbox").click(function () { end(); }).hide();
|
76 |
+
$("#loadingLink").click(function () { end(); return false; });
|
77 |
+
$("#bottomNavClose").click(function () { end(); return false; });
|
78 |
+
$('#outerImageContainer').width(opts.widthCurrent).height(opts.heightCurrent);
|
79 |
+
$('#imageDataContainer').width(opts.widthCurrent);
|
80 |
+
if (!opts.imageClickClose) {
|
81 |
+
$("#lightboxImage").click(function () { return false; });
|
82 |
+
$("#hoverNav").click(function () { return false; });
|
83 |
+
}
|
84 |
+
};
|
85 |
+
//allow image to reposition & scale if orientation change or resize occurs.
|
86 |
+
function resizeListener(e) {
|
87 |
+
if (opts.resizeTimeout) {
|
88 |
+
clearTimeout(opts.resizeTimeout);
|
89 |
+
opts.resizeTimeout = false;
|
90 |
+
}
|
91 |
+
opts.resizeTimeout = setTimeout(function () { doScale(false); }, 50); //a delay to avoid duplicate event calls.
|
92 |
+
}
|
93 |
+
function getPageSize(){
|
94 |
+
var pgDocHeight;
|
95 |
+
pgDocHeight = $(document).height();
|
96 |
+
if (opts.isIE8 && pgDocHeight > 4096) {
|
97 |
+
pgDocHeight = 4096;
|
98 |
+
}
|
99 |
+
//$(window).width() returns width of browser viewport
|
100 |
+
//$(document).width() returns width of HTML document
|
101 |
+
return new Array($(document).width(), pgDocHeight, $(window).width(), $(window).height(), $(document).height());
|
102 |
+
};
|
103 |
+
//code for IE8 check provided by http://kangax.github.com/cft/
|
104 |
+
function isIE8() {
|
105 |
+
var isBuggy = false;
|
106 |
+
if (document.createElement) {
|
107 |
+
var el = document.createElement("div");
|
108 |
+
if (el && el.querySelectorAll) {
|
109 |
+
el.innerHTML = "<object><param name=\"\"></object>";
|
110 |
+
isBuggy = el.querySelectorAll("param").length != 1;
|
111 |
+
}
|
112 |
+
el = null;
|
113 |
+
}
|
114 |
+
return isBuggy;
|
115 |
+
};
|
116 |
+
function getPageScroll() {
|
117 |
+
var xScroll, yScroll;
|
118 |
+
if (self.pageYOffset) {
|
119 |
+
yScroll = self.pageYOffset;
|
120 |
+
xScroll = self.pageXOffset;
|
121 |
+
} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
|
122 |
+
yScroll = document.documentElement.scrollTop;
|
123 |
+
xScroll = document.documentElement.scrollLeft;
|
124 |
+
} else if (document.body) {// all other Explorers
|
125 |
+
yScroll = document.body.scrollTop;
|
126 |
+
xScroll = document.body.scrollLeft;
|
127 |
+
}
|
128 |
+
return new Array(xScroll, yScroll);
|
129 |
+
};
|
130 |
+
|
131 |
+
function start(imageLink) {
|
132 |
+
$("select, embed, object").hide();
|
133 |
+
var arrayPageSize = getPageSize();
|
134 |
+
var arrayPagePos = getPageScroll();
|
135 |
+
var newTop = 0;
|
136 |
+
$("#overlay").hide().css({width: arrayPageSize[0] + 'px', height: arrayPageSize[1] + 'px', opacity: opts.overlayOpacity}).fadeIn(400);
|
137 |
+
if (opts.isIE8 && arrayPageSize[1] == 4096) {
|
138 |
+
if (arrayPagePos[1] >= 1000) {
|
139 |
+
newTop = arrayPagePos[1] - 1000;
|
140 |
+
if ((arrayPageSize[4] - (arrayPagePos[1] + 3096)) < 0) {
|
141 |
+
newTop -= (arrayPagePos[1] + 3096) - arrayPageSize[4];
|
142 |
+
}
|
143 |
+
$("#overlay").css({ top: newTop + 'px' });
|
144 |
+
}
|
145 |
+
}
|
146 |
+
imageNum = 0;
|
147 |
+
// if data is not provided by jsonData parameter
|
148 |
+
if (!opts.jsonData) {
|
149 |
+
opts.imageArray = [];
|
150 |
+
// if image is NOT part of a set..
|
151 |
+
if (!imageLink.rel || (imageLink.rel == '')) {
|
152 |
+
// add single image to Lightbox.imageArray
|
153 |
+
var s = '';
|
154 |
+
if (imageLink.title) {
|
155 |
+
s = imageLink.title;
|
156 |
+
} else if ($(this).children(':first-child').attr('title')) {
|
157 |
+
s = $(this).children(':first-child').attr('title');
|
158 |
+
}
|
159 |
+
opts.imageArray.push(new Array(imageLink.href, opts.displayTitle ? s : ''));
|
160 |
+
} else {
|
161 |
+
// if image is part of a set..
|
162 |
+
$("a").each(function () {
|
163 |
+
if (this.href && (this.rel == imageLink.rel)) {
|
164 |
+
var title = '';
|
165 |
+
var caption = '';
|
166 |
+
var captionText = '';
|
167 |
+
var jqThis = $(this);
|
168 |
+
if (this.title) {
|
169 |
+
title = this.title;
|
170 |
+
} else if (jqThis.children('img:first-child').attr('title')) {
|
171 |
+
title = jqThis.children('img:first-child').attr('title'); //grab the title from the image if the link lacks one
|
172 |
+
}
|
173 |
+
if (jqThis.parent().next('.gallery-caption').html()) {
|
174 |
+
var jq = jqThis.parent().next('.gallery-caption');
|
175 |
+
caption = jq.html();
|
176 |
+
captionText = jq.text();
|
177 |
+
} else if (jqThis.next('.wp-caption-text').html()) {
|
178 |
+
caption = jqThis.next('.wp-caption-text').html();
|
179 |
+
captionText = jqThis.next('.wp-caption-text').text();
|
180 |
+
}
|
181 |
+
title = $.trim(title);
|
182 |
+
captionText = $.trim(captionText);
|
183 |
+
if (title.toLowerCase() == captionText.toLowerCase()) {
|
184 |
+
title = caption; //to keep linked captions
|
185 |
+
caption = ''; //but not duplicate the text
|
186 |
+
}
|
187 |
+
var s = '';
|
188 |
+
if (title != '' && caption != '') {
|
189 |
+
s = title + '<br />' + caption;
|
190 |
+
} else if (title != '') {
|
191 |
+
s = title;
|
192 |
+
} else if (caption != '') {
|
193 |
+
s = caption;
|
194 |
+
}
|
195 |
+
opts.imageArray.push(new Array(this.href, opts.displayTitle ? s : ''));
|
196 |
+
}
|
197 |
+
});
|
198 |
+
}
|
199 |
+
}
|
200 |
+
if (opts.imageArray.length > 1) {
|
201 |
+
for (i = 0; i < opts.imageArray.length; i++) {
|
202 |
+
for (j = opts.imageArray.length - 1; j > i; j--) {
|
203 |
+
if (opts.imageArray[i][0] == opts.imageArray[j][0]) {
|
204 |
+
opts.imageArray.splice(j, 1);
|
205 |
+
}
|
206 |
+
}
|
207 |
+
}
|
208 |
+
while (opts.imageArray[imageNum][0] != imageLink.href) { imageNum++; }
|
209 |
+
}
|
210 |
+
// calculate top and left offset for the lightbox
|
211 |
+
setLightBoxPos(arrayPagePos[1], arrayPagePos[0]).show();
|
212 |
+
changeImage(imageNum);
|
213 |
+
};
|
214 |
+
|
215 |
+
function setLightBoxPos(newTop, newLeft) {
|
216 |
+
if (opts.resizeSpeed > 0) {
|
217 |
+
$('#lightbox').animate({ top: newTop }, 250, 'linear');
|
218 |
+
return $('#lightbox').animate({ left: newLeft }, 250, 'linear');
|
219 |
+
}
|
220 |
+
return $('#lightbox').css({ top: newTop + 'px', left: newLeft + 'px' });
|
221 |
+
}
|
222 |
+
|
223 |
+
function changeImage(imageNum) {
|
224 |
+
if (opts.inprogress == false) {
|
225 |
+
opts.inprogress = true;
|
226 |
+
opts.activeImage = imageNum;
|
227 |
+
// hide elements during transition
|
228 |
+
$('#loading').show();
|
229 |
+
$('#lightboxImage').hide();
|
230 |
+
$('#hoverNav').hide();
|
231 |
+
$('#prevLink').hide();
|
232 |
+
$('#nextLink').hide();
|
233 |
+
doChangeImage();
|
234 |
+
}
|
235 |
+
};
|
236 |
+
|
237 |
+
function doChangeImage() {
|
238 |
+
opts.imgPreloader = new Image();
|
239 |
+
opts.imgPreloader.onload = function () {
|
240 |
+
$('#lightboxImage').attr('src', opts.imageArray[opts.activeImage][0]);
|
241 |
+
doScale(); // once image is preloaded, resize image container
|
242 |
+
preloadNeighborImages();
|
243 |
+
};
|
244 |
+
opts.imgPreloader.src = opts.imageArray[opts.activeImage][0];
|
245 |
+
};
|
246 |
+
|
247 |
+
function doScale() {
|
248 |
+
if (!opts.imgPreloader) {
|
249 |
+
return;
|
250 |
+
}
|
251 |
+
var newWidth = opts.imgPreloader.width;
|
252 |
+
var newHeight = opts.imgPreloader.height;
|
253 |
+
var arrayPageSize = getPageSize();
|
254 |
+
var noScrollWidth = (arrayPageSize[2] < arrayPageSize[0]) ? arrayPageSize[0] : arrayPageSize[2]; //if viewport is smaller than page, use page width.
|
255 |
+
$("#overlay").css({ width: noScrollWidth + 'px', height: arrayPageSize[1] + 'px' });
|
256 |
+
var maxHeight = (arrayPageSize[3]) - ($("#imageDataContainer").height() + (2 * opts.borderSize));
|
257 |
+
var maxWidth = (arrayPageSize[2]) - (2*opts.borderSize);
|
258 |
+
if (opts.fitToScreen){
|
259 |
+
var displayHeight = maxHeight-opts.marginSize;
|
260 |
+
var displayWidth = maxWidth-opts.marginSize;
|
261 |
+
var ratio = 1;
|
262 |
+
if (newHeight > displayHeight) {
|
263 |
+
ratio = displayHeight / newHeight; //ex. 600/1024 = 0.58
|
264 |
+
}
|
265 |
+
newWidth = newWidth * ratio;
|
266 |
+
newHeight = newHeight * ratio;
|
267 |
+
ratio = 1;
|
268 |
+
if (newWidth > displayWidth) {
|
269 |
+
ratio = displayWidth / newWidth; //ex. 800/1280 == 0.62
|
270 |
+
}
|
271 |
+
newWidth = Math.round(newWidth * ratio);
|
272 |
+
newHeight = Math.round(newHeight * ratio);
|
273 |
+
}
|
274 |
+
var arrayPageScroll = getPageScroll();
|
275 |
+
var centerY = arrayPageScroll[1] + (maxHeight * 0.5);
|
276 |
+
var newTop = centerY - newHeight * 0.5;
|
277 |
+
var newLeft = arrayPageScroll[0];
|
278 |
+
$('#lightboxImage').width(newWidth).height(newHeight);
|
279 |
+
resizeImageContainer(newWidth, newHeight, newTop, newLeft);
|
280 |
+
}
|
281 |
+
|
282 |
+
function resizeImageContainer(imgWidth, imgHeight, lightboxTop, lightboxLeft) {
|
283 |
+
opts.widthCurrent = $("#outerImageContainer").outerWidth();
|
284 |
+
opts.heightCurrent = $("#outerImageContainer").outerHeight();
|
285 |
+
var widthNew = Math.max(350, imgWidth + (opts.borderSize * 2));
|
286 |
+
var heightNew = (imgHeight + (opts.borderSize * 2));
|
287 |
+
// scalars based on change from old to new
|
288 |
+
opts.xScale = (widthNew / opts.widthCurrent) * 100;
|
289 |
+
opts.yScale = (heightNew / opts.heightCurrent) * 100;
|
290 |
+
setLightBoxPos(lightboxTop, lightboxLeft);
|
291 |
+
updateDetails(); //toyNN: moved updateDetails() here, seems to work fine.
|
292 |
+
$('#imageDataContainer').animate({ width: widthNew }, opts.resizeSpeed, 'linear');
|
293 |
+
$('#outerImageContainer').animate({ width: widthNew }, opts.resizeSpeed, 'linear', function () {
|
294 |
+
$('#outerImageContainer').animate({ height: heightNew }, opts.resizeSpeed, 'linear', function () {
|
295 |
+
showImage();
|
296 |
+
});
|
297 |
+
});
|
298 |
+
updateNav();
|
299 |
+
$('#prevLink').height(imgHeight);
|
300 |
+
$('#nextLink').height(imgHeight);
|
301 |
+
};
|
302 |
+
|
303 |
+
function showImage() {
|
304 |
+
//assumes updateDetails have been called earlier!
|
305 |
+
$("#imageData").show();
|
306 |
+
$('#caption').show();
|
307 |
+
//$('#imageDataContainer').slideDown(400);
|
308 |
+
//$("#imageDetails").hide().fadeIn(400);
|
309 |
+
$('#loading').hide();
|
310 |
+
if (opts.resizeSpeed > 0) {
|
311 |
+
$('#lightboxImage').fadeIn("fast");
|
312 |
+
} else {
|
313 |
+
$('#lightboxImage').show();
|
314 |
+
}
|
315 |
+
opts.inprogress = false;
|
316 |
+
};
|
317 |
+
|
318 |
+
function preloadNeighborImages() {
|
319 |
+
if (opts.loopImages && opts.imageArray.length > 1) {
|
320 |
+
preloadNextImage = new Image();
|
321 |
+
preloadNextImage.src = opts.imageArray[(opts.activeImage == (opts.imageArray.length - 1)) ? 0 : opts.activeImage + 1][0]
|
322 |
+
preloadPrevImage = new Image();
|
323 |
+
preloadPrevImage.src = opts.imageArray[(opts.activeImage == 0) ? (opts.imageArray.length - 1) : opts.activeImage - 1][0]
|
324 |
+
} else {
|
325 |
+
if ((opts.imageArray.length - 1) > opts.activeImage) {
|
326 |
+
preloadNextImage = new Image();
|
327 |
+
preloadNextImage.src = opts.imageArray[opts.activeImage + 1][0];
|
328 |
+
}
|
329 |
+
if (opts.activeImage > 0) {
|
330 |
+
preloadPrevImage = new Image();
|
331 |
+
preloadPrevImage.src = opts.imageArray[opts.activeImage - 1][0];
|
332 |
+
}
|
333 |
+
}
|
334 |
+
};
|
335 |
+
|
336 |
+
|
337 |
+
function updateDetails() {
|
338 |
+
$('#numberDisplay').html('');
|
339 |
+
$('#caption').html('').hide();
|
340 |
+
if (opts.imageArray[opts.activeImage][1]) {
|
341 |
+
$('#caption').html(opts.imageArray[opts.activeImage][1]).show();
|
342 |
+
}
|
343 |
+
var nav_html = '';
|
344 |
+
var prev = '';
|
345 |
+
var pos = (opts.imageArray.length > 1) ? opts.strings.image + (opts.activeImage + 1) + opts.strings.of + opts.imageArray.length : '';
|
346 |
+
var link = (opts.displayDownloadLink) ? '<a href="' + opts.imageArray[opts.activeImage][0] + '" id="downloadLink" target="'+opts.linkTarget+'">' + opts.strings.download + '</a>' : '';
|
347 |
+
var next = '';
|
348 |
+
if (opts.imageArray.length > 1 && !opts.disableNavbarLinks) { // display previous / next text links
|
349 |
+
if ((opts.activeImage) > 0 || opts.loopImages) {
|
350 |
+
prev = '<a title="' + opts.strings.prevLinkTitle + '" href="#" id="prevLinkText">' + opts.strings.prevLinkText + "</a>";
|
351 |
+
}
|
352 |
+
if (((opts.activeImage + 1) < opts.imageArray.length) || opts.loopImages) {
|
353 |
+
next += '<a title="' + opts.strings.nextLinkTitle + '" href="#" id="nextLinkText">' + opts.strings.nextLinkText + "</a>";
|
354 |
+
}
|
355 |
+
}
|
356 |
+
nav_html = prev + nav_html + pos + link + next;
|
357 |
+
if (nav_html != '') {
|
358 |
+
$('#numberDisplay').html(nav_html).show();
|
359 |
+
}
|
360 |
+
};
|
361 |
+
|
362 |
+
function updateNav() {
|
363 |
+
if (opts.imageArray.length > 1) {
|
364 |
+
$('#hoverNav').show();
|
365 |
+
// if loopImages is true, always show next and prev image buttons
|
366 |
+
if (opts.loopImages) {
|
367 |
+
$('#prevLink,#prevLinkText').show().click(function () {
|
368 |
+
changeImage((opts.activeImage == 0) ? (opts.imageArray.length - 1) : opts.activeImage - 1); return false;
|
369 |
+
});
|
370 |
+
$('#nextLink,#nextLinkText').show().click(function () {
|
371 |
+
changeImage((opts.activeImage == (opts.imageArray.length - 1)) ? 0 : opts.activeImage + 1); return false;
|
372 |
+
});
|
373 |
+
} else {
|
374 |
+
// if not first image in set, display prev image button
|
375 |
+
if (opts.activeImage != 0) {
|
376 |
+
$('#prevLink,#prevLinkText').show().click(function () {
|
377 |
+
changeImage(opts.activeImage - 1); return false;
|
378 |
+
});
|
379 |
+
}
|
380 |
+
// if not last image in set, display next image button
|
381 |
+
if (opts.activeImage != (opts.imageArray.length - 1)) {
|
382 |
+
$('#nextLink,#nextLinkText').show().click(function () {
|
383 |
+
changeImage(opts.activeImage + 1); return false;
|
384 |
+
});
|
385 |
+
}
|
386 |
+
}
|
387 |
+
enableKeyboardNav();
|
388 |
+
}
|
389 |
+
};
|
390 |
+
|
391 |
+
function end() {
|
392 |
+
disableKeyboardNav();
|
393 |
+
$('#lightbox').hide();
|
394 |
+
$('#overlay').fadeOut();
|
395 |
+
$('select, object, embed').show();
|
396 |
+
};
|
397 |
+
|
398 |
+
function keyboardAction(e) {
|
399 |
+
var o = e.data.opts;
|
400 |
+
var keycode = e.keyCode;
|
401 |
+
var escapeKey = 27;
|
402 |
+
var key = String.fromCharCode(keycode).toLowerCase();
|
403 |
+
if ((key == 'x') || (key == 'o') || (key == 'c') || (keycode == escapeKey)) { // close lightbox
|
404 |
+
end();
|
405 |
+
} else if ((key == 'p') || (keycode == 37)) { // display previous image
|
406 |
+
if (o.loopImages) {
|
407 |
+
disableKeyboardNav();
|
408 |
+
changeImage((o.activeImage == 0) ? (o.imageArray.length - 1) : o.activeImage - 1);
|
409 |
+
}
|
410 |
+
else if (o.activeImage != 0) {
|
411 |
+
disableKeyboardNav();
|
412 |
+
changeImage(o.activeImage - 1);
|
413 |
+
}
|
414 |
+
} else if ((key == 'n') || (keycode == 39)) { // display next image
|
415 |
+
if (opts.loopImages) {
|
416 |
+
disableKeyboardNav();
|
417 |
+
changeImage((o.activeImage == (o.imageArray.length - 1)) ? 0 : o.activeImage + 1);
|
418 |
+
}
|
419 |
+
else if (o.activeImage != (o.imageArray.length - 1)) {
|
420 |
+
disableKeyboardNav();
|
421 |
+
changeImage(o.activeImage + 1);
|
422 |
+
}
|
423 |
+
}
|
424 |
+
return false;
|
425 |
+
};
|
426 |
+
function enableKeyboardNav() {
|
427 |
+
$(document).bind('keydown', {opts: opts}, keyboardAction);
|
428 |
+
};
|
429 |
+
function disableKeyboardNav() {
|
430 |
+
$(document).unbind('keydown');
|
431 |
+
};
|
432 |
+
};
|
433 |
+
$.fn.lightbox.parseJsonData = function(data) {
|
434 |
+
var imageArray = [];
|
435 |
+
$.each(data, function () {
|
436 |
+
imageArray.push(new Array(this.url, this.title));
|
437 |
+
});
|
438 |
+
return imageArray;
|
439 |
+
};
|
440 |
+
$.fn.lightbox.defaults = {
|
441 |
+
overlayOpacity: 0.8,
|
442 |
+
borderSize: 10,
|
443 |
+
imageArray: new Array,
|
444 |
+
activeImage: null,
|
445 |
+
inprogress: false, //this is an internal state variable. don't touch.
|
446 |
+
widthCurrent: 250,
|
447 |
+
heightCurrent: 250,
|
448 |
+
xScale: 1,
|
449 |
+
yScale: 1,
|
450 |
+
displayTitle: true,
|
451 |
+
disableNavbarLinks: true,
|
452 |
+
loopImages: true,
|
453 |
+
imageClickClose: true,
|
454 |
+
jsonData: null,
|
455 |
+
jsonDataParser: null,
|
456 |
+
followScroll: false,
|
457 |
+
isIE8: false //toyNN:internal value only
|
458 |
+
};
|
459 |
+
$(document).ready(function($){
|
460 |
+
var haveConf = (typeof JQLBSettings == 'object');
|
461 |
+
if(haveConf && JQLBSettings.resizeSpeed) {
|
462 |
+
JQLBSettings.resizeSpeed = parseInt(JQLBSettings.resizeSpeed);
|
463 |
+
}
|
464 |
+
if(haveConf && JQLBSettings.marginSize){
|
465 |
+
JQLBSettings.marginSize = parseInt(JQLBSettings.marginSize);
|
466 |
+
}
|
467 |
+
var default_strings = {
|
468 |
+
help: ' Browse images with your keyboard: Arrows or P(revious)/N(ext) and X/C/ESC for close.',
|
469 |
+
prevLinkTitle: 'previous image',
|
470 |
+
nextLinkTitle: 'next image',
|
471 |
+
prevLinkText: '« Previous',
|
472 |
+
nextLinkText: 'Next »',
|
473 |
+
closeTitle: 'close image gallery',
|
474 |
+
image: 'Image ',
|
475 |
+
of: ' of ',
|
476 |
+
download: 'Download'
|
477 |
+
};
|
478 |
+
$('a[rel^="lightbox"]').lightbox({
|
479 |
+
linkTarget: (haveConf && JQLBSettings.linkTarget.length) ? JQLBSettings.linkTarget : '_self',
|
480 |
+
displayHelp: (haveConf && JQLBSettings.help.length) ? true : false,
|
481 |
+
marginSize: (haveConf && JQLBSettings.marginSize) ? JQLBSettings.marginSize : 0,
|
482 |
+
fitToScreen: (haveConf && JQLBSettings.fitToScreen == '1') ? true : false,
|
483 |
+
resizeSpeed: (haveConf && JQLBSettings.resizeSpeed >= 0) ? JQLBSettings.resizeSpeed : 400,
|
484 |
+
displayDownloadLink: (haveConf && JQLBSettings.displayDownloadLink == '0') ? false : true,
|
485 |
+
navbarOnTop: (haveConf && JQLBSettings.navbarOnTop == '0') ? false : true,
|
486 |
+
//followScroll: (haveConf && JQLBSettings.followScroll == '0') ? false : true,
|
487 |
+
strings: (haveConf && typeof JQLBSettings.help == 'string') ? JQLBSettings : default_strings
|
488 |
+
});
|
489 |
+
});
|
490 |
+
})(jQuery);
|
jquery.lightbox.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(a){a.fn.lightbox=function(h){var t=a.extend({},a.fn.lightbox.defaults,h);return a(this).live("click",function(){e();o(this);return false});function e(){a(window).bind("orientationchange",p);a(window).bind("resize",p);a("#overlay").remove();a("#lightbox").remove();t.inprogress=false;if(t.jsonData&&t.jsonData.length>0){var A=t.jsonDataParser?t.jsonDataParser:a.fn.lightbox.parseJsonData;t.imageArray=[];t.imageArray=A(t.jsonData)}var x='<div id="outerImageContainer"><div id="imageContainer"><iframe id="lightboxIframe" /><img id="lightboxImage"><div id="hoverNav"><a href="javascript://" title="'+t.strings.prevLinkTitle+'" id="prevLink"></a><a href="javascript://" id="nextLink" title="'+t.strings.nextLinkTitle+'"></a></div><div id="loading"><a href="javascript://" id="loadingLink"><div id="jqlb_loading"></div></a></div></div></div>';var z='<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav">';if(t.displayHelp){z+='<span id="helpDisplay">'+t.strings.help+"</span>"}z+='<a href="javascript://" id="bottomNavClose" title="'+t.strings.closeTitle+'"><div id="jqlb_closelabel"></div></a></div></div></div>';var y;if(t.navbarOnTop){y='<div id="overlay"></div><div id="lightbox">'+z+x+"</div>";a("body").append(y);a("#imageDataContainer").addClass("ontop")}else{y='<div id="overlay"></div><div id="lightbox">'+x+z+"</div>";a("body").append(y)}a("#overlay").click(function(){l()}).hide();a("#lightbox").click(function(){l()}).hide();a("#loadingLink").click(function(){l();return false});a("#bottomNavClose").click(function(){l();return false});a("#outerImageContainer").width(t.widthCurrent).height(t.heightCurrent);a("#imageDataContainer").width(t.widthCurrent);if(!t.imageClickClose){a("#lightboxImage").click(function(){return false});a("#hoverNav").click(function(){return false})}}function p(x){if(t.resizeTimeout){clearTimeout(t.resizeTimeout);t.resizeTimeout=false}t.resizeTimeout=setTimeout(function(){w(false)},15)}function v(){return new Array(a(document).width(),a(document).height(),a(window).width(),a(window).height())}function g(){var y,x;if(self.pageYOffset){x=self.pageYOffset;y=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){x=document.documentElement.scrollTop;y=document.documentElement.scrollLeft}else{if(document.body){x=document.body.scrollTop;y=document.body.scrollLeft}}}return new Array(y,x)}function o(A){a("select, embed, object").hide();var y=v();a("#overlay").hide().css({width:y[0]+"px",height:y[1]+"px",opacity:t.overlayOpacity}).fadeIn(400);imageNum=0;if(!t.jsonData){t.imageArray=[];if(!A.rel||(A.rel=="")){var z="";if(A.title){z=A.title}else{if(a(this).children(":first-child").attr("title")){z=a(this).children(":first-child").attr("title")}}t.imageArray.push(new Array(A.href,t.displayTitle?z:""))}else{a("a").each(function(){if(this.href&&(this.rel==A.rel)){var E="";var C="";var G="";var B=a(this);if(this.title){E=this.title}else{if(B.children("img:first-child").attr("title")){E=B.children("img:first-child").attr("title")}}if(B.parent().next(".gallery-caption").html()){var F=B.parent().next(".gallery-caption");C=F.html();G=F.text()}else{if(B.next(".wp-caption-text").html()){C=B.next(".wp-caption-text").html();G=B.next(".wp-caption-text").text()}}E=a.trim(E);G=a.trim(G);if(E.toLowerCase()==G.toLowerCase()){E=C;C=""}var D="";if(E!=""&&C!=""){D=E+"<br />"+C}else{if(E!=""){D=E}else{if(C!=""){D=C}}}t.imageArray.push(new Array(this.href,t.displayTitle?D:""))}})}}if(t.imageArray.length>1){for(i=0;i<t.imageArray.length;i++){for(j=t.imageArray.length-1;j>i;j--){if(t.imageArray[i][0]==t.imageArray[j][0]){t.imageArray.splice(j,1)}}}while(t.imageArray[imageNum][0]!=A.href){imageNum++}}var x=g();m(x[1],x[0]).show();u(imageNum)}function u(x){if(t.inprogress==false){t.inprogress=true;t.activeImage=x;a("#loading").show();a("#lightboxImage").hide();a("#hoverNav").hide();a("#prevLink").hide();a("#nextLink").hide();k()}}function k(){t.imgPreloader=new Image();t.imgPreloader.onload=function(){f();a("#lightboxImage").attr("src",t.imageArray[t.activeImage][0]);w()};t.imgPreloader.src=t.imageArray[t.activeImage][0]}function w(y){if(!t.imgPreloader){return}if(y==undefined){y=t.animate}var A=t.imgPreloader.width;var x=t.imgPreloader.height;var B=v();c();var F=B[2]-2*t.borderSize;var G=B[3]-(a("#imageDataContainer").height()+(2*t.borderSize));if(t.fitToScreen){var D=1;if(x>G){D=G/x}A=A*D;x=x*D;D=1;if(A>F){D=F/A}A=parseInt(A*D);x=parseInt(x*D)}var C=g();var z=C[1]+(G*0.5);var E=z-x*0.5;a("#lightboxImage").width(A).height(x);n(A,x,E,y)}function n(B,y,C,A){if(A==undefined){A=t.animate}t.widthCurrent=a("#outerImageContainer").outerWidth();t.heightCurrent=a("#outerImageContainer").outerHeight();var x=Math.max(350,B+(t.borderSize*2));var z=(y+(t.borderSize*2));t.xScale=(x/t.widthCurrent)*100;t.yScale=(z/t.heightCurrent)*100;wDiff=t.widthCurrent-x;hDiff=t.heightCurrent-z;m(C,null,A);if(A&&(hDiff!=0&&wDiff!=0)){a("#imageDataContainer").animate({width:x},t.resizeSpeed,"linear");a("#outerImageContainer").animate({width:x},t.resizeSpeed,"linear",function(){a("#outerImageContainer").animate({height:z},t.resizeSpeed,"linear",function(){d()})})}else{a("#imageDataContainer").width(x);a("#outerImageContainer").width(x);a("#outerImageContainer").height(z);d()}a("#prevLink").height(y);a("#nextLink").height(y)}function m(A,z,y){if(y==undefined){y=t.animate}if(z==undefined||z==null){var x=g();z=x[0]}if(y){a("#lightbox").animate({top:A},250,"linear");return a("#lightbox").animate({left:z},250,"linear")}return a("#lightbox").css({top:A+"px",left:z+"px"})}function l(){q();a("#lightbox").hide();a("#overlay").fadeOut();a("select, object, embed").show()}function f(){if(t.loopImages&&t.imageArray.length>1){preloadNextImage=new Image();preloadNextImage.src=t.imageArray[(t.activeImage==(t.imageArray.length-1))?0:t.activeImage+1][0];preloadPrevImage=new Image();preloadPrevImage.src=t.imageArray[(t.activeImage==0)?(t.imageArray.length-1):t.activeImage-1][0]}else{if((t.imageArray.length-1)>t.activeImage){preloadNextImage=new Image();preloadNextImage.src=t.imageArray[t.activeImage+1][0]}if(t.activeImage>0){preloadPrevImage=new Image();preloadPrevImage.src=t.imageArray[t.activeImage-1][0]}}}function d(){a("#imageData").show();a("#caption").show();a("#loading").hide();if(t.animate){a("#lightboxImage").fadeIn("fast")}else{a("#lightboxImage").show()}t.inprogress=false;var x=v();a("#overlay").css({width:x[0]+"px",height:x[1]+"px"});r()}function c(){a("#numberDisplay").html("");a("#caption").html("").hide();if(t.imageArray[t.activeImage][1]){a("#caption").html(t.imageArray[t.activeImage][1]).show()}var A="";var z="";var B=(t.imageArray.length>1)?t.strings.image+(t.activeImage+1)+t.strings.of+t.imageArray.length:"";var y=(t.displayDownloadLink)?'<a href="'+t.imageArray[t.activeImage][0]+'" id="downloadLink">'+t.strings.download+"</a>":"";var x="";if(t.imageArray.length>1&&!t.disableNavbarLinks){if((t.activeImage)>0||t.loopImages){z='<a title="'+t.strings.prevLinkTitle+'" href="#" id="prevLinkText">'+t.strings.prevLinkText+"</a>"}if(((t.activeImage+1)<t.imageArray.length)||t.loopImages){x+='<a title="'+t.strings.nextLinkTitle+'" href="#" id="nextLinkText">'+t.strings.nextLinkText+"</a>"}}A=z+A+B+y+x;if(A!=""){a("#numberDisplay").html(A).show()}a("#imageData").show();r()}function r(){if(t.imageArray.length>1){a("#hoverNav").show();if(t.loopImages){a("#prevLink,#prevLinkText").show().click(function(){u((t.activeImage==0)?(t.imageArray.length-1):t.activeImage-1);return false});a("#nextLink,#nextLinkText").show().click(function(){u((t.activeImage==(t.imageArray.length-1))?0:t.activeImage+1);return false})}else{if(t.activeImage!=0){a("#prevLink,#prevLinkText").show().click(function(){u(t.activeImage-1);return false})}if(t.activeImage!=(t.imageArray.length-1)){a("#nextLink,#nextLinkText").show().click(function(){u(t.activeImage+1);return false})}}b()}}function s(A){var B=A.data.opts;var x=A.keyCode;var y=27;var z=String.fromCharCode(x).toLowerCase();if((z=="x")||(z=="o")||(z=="c")||(x==y)){l()}else{if((z=="p")||(x==37)){if(B.loopImages){q();u((B.activeImage==0)?(B.imageArray.length-1):B.activeImage-1)}else{if(B.activeImage!=0){q();u(B.activeImage-1)}}}else{if((z=="n")||(x==39)){if(t.loopImages){q();u((B.activeImage==(B.imageArray.length-1))?0:B.activeImage+1)}else{if(B.activeImage!=(B.imageArray.length-1)){q();u(B.activeImage+1)}}}}}}function b(){a(document).bind("keydown",{opts:t},s)}function q(){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={overlayOpacity:0.8,borderSize:10,imageArray:new Array,activeImage:null,inprogress:false,widthCurrent:250,heightCurrent:250,xScale:1,yScale:1,displayTitle:true,navbarOnTop:false,displayHelp:false,disableNavbarLinks:true,loopImages:true,imageClickClose:true,jsonData:null,jsonDataParser:null,followScroll:false}})(jQuery);jQuery(document).ready(function(){if(typeof JQLBSettings=="object"&&JQLBSettings.resizeSpeed){JQLBSettings.resizeSpeed=parseInt(JQLBSettings.resizeSpeed)}var a={help:" \u2190 / P - previous image\u00a0\u00a0\u00a0\u00a0\u2192 / N - next image\u00a0\u00a0\u00a0\u00a0ESC / X - close image gallery",prevLinkTitle:"previous image",nextLinkTitle:"next image",prevLinkText:"« Previous",nextLinkText:"Next »",closeTitle:"close image gallery",image:"Image ",of:" of ",download:"Bajs"};jQuery('a[rel^="lightbox"]').lightbox({fitToScreen:(typeof JQLBSettings=="object"&&JQLBSettings.fitToScreen=="1")?true:false,resizeSpeed:(typeof JQLBSettings=="object"&&JQLBSettings.resizeSpeed>=0)?JQLBSettings.resizeSpeed:400,animate:(typeof JQLBSettings=="object"&&JQLBSettings.resizeSpeed==0)?false:true,displayDownloadLink:(typeof JQLBSettings=="object"&&JQLBSettings.displayDownloadLink=="0")?false:true,strings:(typeof JQLBSettings=="object"&&typeof JQLBSettings.help=="string")?JQLBSettings:a})});
|
1 |
+
(function(a){a.fn.lightbox=function(k){var t=a.extend({},a.fn.lightbox.defaults,k);return a(this).live("click",function(){e();o(this);return false;});function e(){a(window).bind("orientationchange",p);a(window).bind("resize",p);a("#overlay").remove();a("#lightbox").remove();t.isIE8=u();t.inprogress=false;if(t.jsonData&&t.jsonData.length>0){var B=t.jsonDataParser?t.jsonDataParser:a.fn.lightbox.parseJsonData;t.imageArray=[];t.imageArray=B(t.jsonData);}var y='<div id="outerImageContainer"><div id="imageContainer"><iframe id="lightboxIframe" /><img id="lightboxImage"><div id="hoverNav"><a href="javascript://" title="'+t.strings.prevLinkTitle+'" id="prevLink"></a><a href="javascript://" id="nextLink" title="'+t.strings.nextLinkTitle+'"></a></div><div id="loading"><a href="javascript://" id="loadingLink"><div id="jqlb_loading"></div></a></div></div></div>';var A='<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav">';if(t.displayHelp){A+='<span id="helpDisplay">'+t.strings.help+"</span>";}A+='<a href="javascript://" id="bottomNavClose" title="'+t.strings.closeTitle+'"><div id="jqlb_closelabel"></div></a></div></div></div>';var z;if(t.navbarOnTop){z='<div id="overlay"></div><div id="lightbox">'+A+y+"</div>";a("body").append(z);a("#imageDataContainer").addClass("ontop");}else{z='<div id="overlay"></div><div id="lightbox">'+y+A+"</div>";a("body").append(z);}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(t.widthCurrent).height(t.heightCurrent);a("#imageDataContainer").width(t.widthCurrent);if(!t.imageClickClose){a("#lightboxImage").click(function(){return false;});a("#hoverNav").click(function(){return false;});}}function p(y){if(t.resizeTimeout){clearTimeout(t.resizeTimeout);t.resizeTimeout=false;}t.resizeTimeout=setTimeout(function(){x(false);},50);}function w(){var y;y=a(document).height();if(t.isIE8&&y>4096){y=4096;}return new Array(a(document).width(),y,a(window).width(),a(window).height(),a(document).height());}function u(){var z=false;if(document.createElement){var y=document.createElement("div");if(y&&y.querySelectorAll){y.innerHTML='<object><param name=""></object>';z=y.querySelectorAll("param").length!=1;}y=null;}return z;}function g(){var z,y;if(self.pageYOffset){y=self.pageYOffset;z=self.pageXOffset;}else{if(document.documentElement&&document.documentElement.scrollTop){y=document.documentElement.scrollTop;z=document.documentElement.scrollLeft;}else{if(document.body){y=document.body.scrollTop;z=document.body.scrollLeft;}}}return new Array(z,y);}function o(C){a("select, embed, object").hide();var A=w();var y=g();var z=0;a("#overlay").hide().css({width:A[0]+"px",height:A[1]+"px",opacity:t.overlayOpacity}).fadeIn(400);if(t.isIE8&&A[1]==4096){if(y[1]>=1000){z=y[1]-1000;if((A[4]-(y[1]+3096))<0){z-=(y[1]+3096)-A[4];}a("#overlay").css({top:z+"px"});}}imageNum=0;if(!t.jsonData){t.imageArray=[];if(!C.rel||(C.rel=="")){var B="";if(C.title){B=C.title;}else{if(a(this).children(":first-child").attr("title")){B=a(this).children(":first-child").attr("title");}}t.imageArray.push(new Array(C.href,t.displayTitle?B:""));}else{a("a").each(function(){if(this.href&&(this.rel==C.rel)){var G="";var E="";var I="";var D=a(this);if(this.title){G=this.title;}else{if(D.children("img:first-child").attr("title")){G=D.children("img:first-child").attr("title");}}if(D.parent().next(".gallery-caption").html()){var H=D.parent().next(".gallery-caption");E=H.html();I=H.text();}else{if(D.next(".wp-caption-text").html()){E=D.next(".wp-caption-text").html();I=D.next(".wp-caption-text").text();}}G=a.trim(G);I=a.trim(I);if(G.toLowerCase()==I.toLowerCase()){G=E;E="";}var F="";if(G!=""&&E!=""){F=G+"<br />"+E;}else{if(G!=""){F=G;}else{if(E!=""){F=E;}}}t.imageArray.push(new Array(this.href,t.displayTitle?F:""));}});}}if(t.imageArray.length>1){for(i=0;i<t.imageArray.length;i++){for(j=t.imageArray.length-1;j>i;j--){if(t.imageArray[i][0]==t.imageArray[j][0]){t.imageArray.splice(j,1);}}}while(t.imageArray[imageNum][0]!=C.href){imageNum++;}}m(y[1],y[0]).show();v(imageNum);}function m(y,z){if(t.resizeSpeed>0){a("#lightbox").animate({top:y},250,"linear");return a("#lightbox").animate({left:z},250,"linear");}return a("#lightbox").css({top:y+"px",left:z+"px"});}function v(y){if(t.inprogress==false){t.inprogress=true;t.activeImage=y;a("#loading").show();a("#lightboxImage").hide();a("#hoverNav").hide();a("#prevLink").hide();a("#nextLink").hide();l();}}function l(){t.imgPreloader=new Image();t.imgPreloader.onload=function(){a("#lightboxImage").attr("src",t.imageArray[t.activeImage][0]);x();f();};t.imgPreloader.src=t.imageArray[t.activeImage][0];}function x(){if(!t.imgPreloader){return;}var B=t.imgPreloader.width;var y=t.imgPreloader.height;var D=w();var J=(D[2]<D[0])?D[0]:D[2];a("#overlay").css({width:J+"px",height:D[1]+"px"});var H=(D[3])-(a("#imageDataContainer").height()+(2*t.borderSize));var I=(D[2])-(2*t.borderSize);if(t.fitToScreen){var z=H-t.marginSize;var K=I-t.marginSize;var E=1;if(y>z){E=z/y;}B=B*E;y=y*E;E=1;if(B>K){E=K/B;}B=Math.round(B*E);y=Math.round(y*E);}var C=g();var A=C[1]+(H*0.5);var F=A-y*0.5;var G=C[0];a("#lightboxImage").width(B).height(y);n(B,y,F,G);}function n(B,z,D,C){t.widthCurrent=a("#outerImageContainer").outerWidth();t.heightCurrent=a("#outerImageContainer").outerHeight();var y=Math.max(350,B+(t.borderSize*2));var A=(z+(t.borderSize*2));t.xScale=(y/t.widthCurrent)*100;t.yScale=(A/t.heightCurrent)*100;m(D,C);c();a("#imageDataContainer").animate({width:y},t.resizeSpeed,"linear");a("#outerImageContainer").animate({width:y},t.resizeSpeed,"linear",function(){a("#outerImageContainer").animate({height:A},t.resizeSpeed,"linear",function(){d();});});r();a("#prevLink").height(z);a("#nextLink").height(z);}function d(){a("#imageData").show();a("#caption").show();a("#loading").hide();if(t.resizeSpeed>0){a("#lightboxImage").fadeIn("fast");}else{a("#lightboxImage").show();}t.inprogress=false;}function f(){if(t.loopImages&&t.imageArray.length>1){preloadNextImage=new Image();preloadNextImage.src=t.imageArray[(t.activeImage==(t.imageArray.length-1))?0:t.activeImage+1][0];preloadPrevImage=new Image();preloadPrevImage.src=t.imageArray[(t.activeImage==0)?(t.imageArray.length-1):t.activeImage-1][0];}else{if((t.imageArray.length-1)>t.activeImage){preloadNextImage=new Image();preloadNextImage.src=t.imageArray[t.activeImage+1][0];}if(t.activeImage>0){preloadPrevImage=new Image();preloadPrevImage.src=t.imageArray[t.activeImage-1][0];}}}function c(){a("#numberDisplay").html("");a("#caption").html("").hide();if(t.imageArray[t.activeImage][1]){a("#caption").html(t.imageArray[t.activeImage][1]).show();}var B="";var A="";var C=(t.imageArray.length>1)?t.strings.image+(t.activeImage+1)+t.strings.of+t.imageArray.length:"";var z=(t.displayDownloadLink)?'<a href="'+t.imageArray[t.activeImage][0]+'" id="downloadLink" target="'+t.linkTarget+'">'+t.strings.download+"</a>":"";var y="";if(t.imageArray.length>1&&!t.disableNavbarLinks){if((t.activeImage)>0||t.loopImages){A='<a title="'+t.strings.prevLinkTitle+'" href="#" id="prevLinkText">'+t.strings.prevLinkText+"</a>";}if(((t.activeImage+1)<t.imageArray.length)||t.loopImages){y+='<a title="'+t.strings.nextLinkTitle+'" href="#" id="nextLinkText">'+t.strings.nextLinkText+"</a>";}}B=A+B+C+z+y;if(B!=""){a("#numberDisplay").html(B).show();}}function r(){if(t.imageArray.length>1){a("#hoverNav").show();if(t.loopImages){a("#prevLink,#prevLinkText").show().click(function(){v((t.activeImage==0)?(t.imageArray.length-1):t.activeImage-1);return false;});a("#nextLink,#nextLinkText").show().click(function(){v((t.activeImage==(t.imageArray.length-1))?0:t.activeImage+1);return false;});}else{if(t.activeImage!=0){a("#prevLink,#prevLinkText").show().click(function(){v(t.activeImage-1);return false;});}if(t.activeImage!=(t.imageArray.length-1)){a("#nextLink,#nextLinkText").show().click(function(){v(t.activeImage+1);return false;});}}b();}}function h(){q();a("#lightbox").hide();a("#overlay").fadeOut();a("select, object, embed").show();}function s(B){var C=B.data.opts;var y=B.keyCode;var z=27;var A=String.fromCharCode(y).toLowerCase();if((A=="x")||(A=="o")||(A=="c")||(y==z)){h();}else{if((A=="p")||(y==37)){if(C.loopImages){q();v((C.activeImage==0)?(C.imageArray.length-1):C.activeImage-1);}else{if(C.activeImage!=0){q();v(C.activeImage-1);}}}else{if((A=="n")||(y==39)){if(t.loopImages){q();v((C.activeImage==(C.imageArray.length-1))?0:C.activeImage+1);}else{if(C.activeImage!=(C.imageArray.length-1)){q();v(C.activeImage+1);}}}}}return false;}function b(){a(document).bind("keydown",{opts:t},s);}function q(){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={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:"« Previous",nextLinkText:"Next »",closeTitle:"close image gallery",image:"Image ",of:" of ",download:"Download"};d('a[rel^="lightbox"]').lightbox({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);
|
languages/howtouse-en_US.html
CHANGED
@@ -31,6 +31,7 @@
|
|
31 |
<li>Translation support (and german language files) added by <a href="http://sukimashita.com/">Martin S</a></li>
|
32 |
<li>Translation for admin pages (and Russian and Czech languages) added by Denis N. Voituk</li>
|
33 |
<li>Polish localization <a href="http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-polish-localization?replies=1">by Fisiu</a></li>
|
|
|
34 |
</ul>
|
35 |
|
36 |
<h2>Changes to Lightbox-script:</h2><p style="margin-left: 24px;">
|
@@ -42,7 +43,6 @@
|
|
42 |
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 />
|
43 |
Grabs image title if the link lacks one<br />
|
44 |
Honors empty titles.<br />
|
45 |
-
Can disable all animation effects (set speed to 0).<br />
|
46 |
Uses WordPress API to localize script (with safe fallbacks).<br />
|
47 |
</p>
|
48 |
|
31 |
<li>Translation support (and german language files) added by <a href="http://sukimashita.com/">Martin S</a></li>
|
32 |
<li>Translation for admin pages (and Russian and Czech languages) added by Denis N. Voituk</li>
|
33 |
<li>Polish localization <a href="http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-polish-localization?replies=1">by Fisiu</a></li>
|
34 |
+
<li>Japanese localization <a href="http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-japanese-translation?replies=3">by redcocker</a></li>
|
35 |
</ul>
|
36 |
|
37 |
<h2>Changes to Lightbox-script:</h2><p style="margin-left: 24px;">
|
43 |
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 />
|
44 |
Grabs image title if the link lacks one<br />
|
45 |
Honors empty titles.<br />
|
|
|
46 |
Uses WordPress API to localize script (with safe fallbacks).<br />
|
47 |
</p>
|
48 |
|
languages/howtouse-ja.html
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<h2>使い方:</h2>
|
2 |
+
<ol>
|
3 |
+
<li>WordPressイメージギャラリーを用いて、画像をグループ化し、自動的にLightbox効果を有効にする場合の記述法: <a href="http://codex.wordpress.org/Gallery_Shortcode"><code>[gallery link="file"]</code></a></li>
|
4 |
+
<li><code>rel="lightbox"</code>手作業で属性をリンクタグに追加してLightbox効果を有効にすることも可能です。例えば:
|
5 |
+
<pre><code> <a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a></code></pre>
|
6 |
+
<em>オプション:</em> キャプション(説明文)を表示させたいならば、<code>title</code>属性を追加します。
|
7 |
+
</li>
|
8 |
+
<li>複数の画像をグループ化したいならば、rel属性にグループ名を含めます。例えば:
|
9 |
+
<pre><code> <a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
|
10 |
+
<a href="images/image-2.jpg" rel="lightbox[roadtrip]">image #2</a>
|
11 |
+
<a href="images/image-3.jpg" rel="lightbox[roadtrip]">image #3</a></code></pre>
|
12 |
+
1ページあたりイメージセットの数とイメージセット毎に許される画像の数に制限はありません。お好きなだけどうぞ!</li>
|
13 |
+
</ol>
|
14 |
+
<h2>開発者の方へ:</h2>
|
15 |
+
<ol>
|
16 |
+
<li>テーマの</body>タグの直前に<code>wp_footer();</code>を常に配置して下さい。<br />
|
17 |
+
さもないと、このフックを利用してJavaスクリプトを参照している多くのプラグインの処理を中断させる事になるでしょう。</li>
|
18 |
+
<li>コンテンツにLightbox効果を適応するため、<code>jqlb_apply_lightbox($your_content, "any ID");</code>を実行します。<br />
|
19 |
+
この関数は、Lightbox効果が適応され、"any id"によってグループ化されたすべてのイメージリンクを含む文字列を返します。</li>
|
20 |
+
<li>多くのJavaスクリプト最適化ツール、結合ツール、縮小化ツールなどは、このプラグインや他の多くのプラグインが設定のために用いている<a href="http://codex.wordpress.org/Function_Reference/wp_localize_script2"><code>wp_localize_script()</code></a>と競合します。
|
21 |
+
<ul style="list-style-type: circle;margin-left: 24px;">
|
22 |
+
<li>もし、jQuery Lightboxで問題が発生したら、Javaスクリプトを最適化する全てのプラグインを無効にして下さい。(Optimize Scripts、W3 Total Cache、WP Minifyなど)</li>
|
23 |
+
<li>もし、WordPress用にJavaスクリプト最適化ツールを開発するなら、デフォルトのAPIと仲良く共存させて下さい。</li>
|
24 |
+
<li><a href="http://wordpress.org/support/topic/122-worked-13-does-not-work-for-me?replies=19">この問題についての情報をもっと見る</a></li>
|
25 |
+
</ul>
|
26 |
+
</li>
|
27 |
+
</ol>
|
28 |
+
<h2>謝辞</h2><ul style="list-style-type: circle;margin-left: 24px;">
|
29 |
+
<li>wp-jquery-lightboxは、<a href="http://www.ulfben.com">Ulf Benjaminsson</a>氏によって開発されました。(<a href="http://amzn.com/w/2QB6SQ5XX2U0N">作者が高く評価する本</a>). :)</li>
|
30 |
+
<li>wp-jquery-lightboxは、手作業ではなく、自動的にrel属性を追加し、画像にLightbox効果を適応するために<a href="http://stimuli.ca/lightbox/">Rupert Morris氏のLightBox-2</a>から正規表現を拝借しました。</li>
|
31 |
+
<li>wp-jquery-lightboxは、<a href="http://warren.mesozen.com/jquery-lightbox/">Warren Krewenki</a>氏の<a href="http://github.com/krewenki/jquery-lightbox/">jQuery Lightbox</a>を改造して使っています。(下記参照)</li>
|
32 |
+
<li><a href="http://github.com/krewenki/jquery-lightbox/">jQuery Lightbox</a>は、<a href="http://www.huddletogether.com/projects/lightbox2/">Lokesh Dhakar氏のLightbox 2</a>がベースになっています。</li>
|
33 |
+
<li>多言語のサポート(およびドイツ語の言語ファイル)は、<a href="http://sukimashita.com/">Martin S</a>氏によって付け加えられました。</li>
|
34 |
+
<li>設定画面の多言語化(およびロシア語とチェコ語の言語ファイル)は、Denis N. Voituk氏によって付け加えられました。</li>
|
35 |
+
<li>ポーランド語への翻訳は、<a href="http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-polish-localization?replies=1">Fisiu</a>氏によるものです。</li>
|
36 |
+
</ul>
|
37 |
+
|
38 |
+
<h2>Lightboxスクリプトの変更点:</h2><p style="margin-left: 24px;">
|
39 |
+
リサイズのためのコードは、高さと幅の <strong>両方</strong>を操作し、かつ、アスペクト比を維持します。<br />
|
40 |
+
拡大・縮小ルーチンは、キャプションを考慮した上で、画像を最大化します。<br />
|
41 |
+
ブラウザでのリサイズと向きの変更に対応させました。 - 最適なサイズと中心位置は、そのまま<em>保持</em>します。<br />
|
42 |
+
過去にリリースされた同等のスクリプトすべてがrelを使っているので、WP jQuery Lightboxも、<code>class="lightbox"</code>の代わりに、<code>rel="lightbox"</code>によって有効化されるようにしています。<br />
|
43 |
+
明示的なイメージURLは、CSSでレイアウトされたdivで置換されます。(<code>jqlb_loading</code>と<code>jqlb_closelabel</code>のdivタグを参照のこと。)<br />
|
44 |
+
WordPressのメディアギャラリーの出力からタイトルと説明文を取得出来ます。(<a href="http://codex.wordpress.org/Gallery_Shortcode">[gallery]</a>、"insert attachments" など。)<br />
|
45 |
+
リンクにタイトルがないなら、画像のタイトルを取得します。<br />
|
46 |
+
タイトルがない場合もそのまま処理します。<br />
|
47 |
+
すべてのアニメーション効果を無効に出来ます。(アニメーションの継続時間を0にして下さい。)<br />
|
48 |
+
スクリプトの多言語化のためにWordPressのAPIを使用しています。(安全な代替と共に。)<br />
|
49 |
+
</p>
|
50 |
+
|
languages/howtouse.html
CHANGED
@@ -31,6 +31,7 @@
|
|
31 |
<li>Translation support (and german language files) added by <a href="http://sukimashita.com/">Martin S</a></li>
|
32 |
<li>Translation for admin pages (and Russian and Czech languages) added by Denis N. Voituk</li>
|
33 |
<li>Polish localization <a href="http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-polish-localization?replies=1">by Fisiu</a></li>
|
|
|
34 |
</ul>
|
35 |
|
36 |
<h2>Changes to Lightbox-script:</h2><p style="margin-left: 24px;">
|
@@ -42,7 +43,6 @@
|
|
42 |
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 />
|
43 |
Grabs image title if the link lacks one<br />
|
44 |
Honors empty titles.<br />
|
45 |
-
Can disable all animation effects (set speed to 0).<br />
|
46 |
Uses WordPress API to localize script (with safe fallbacks).<br />
|
47 |
</p>
|
48 |
|
31 |
<li>Translation support (and german language files) added by <a href="http://sukimashita.com/">Martin S</a></li>
|
32 |
<li>Translation for admin pages (and Russian and Czech languages) added by Denis N. Voituk</li>
|
33 |
<li>Polish localization <a href="http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-polish-localization?replies=1">by Fisiu</a></li>
|
34 |
+
<li>Japanese localization <a href="http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-japanese-translation?replies=3">by redcocker</a></li>
|
35 |
</ul>
|
36 |
|
37 |
<h2>Changes to Lightbox-script:</h2><p style="margin-left: 24px;">
|
43 |
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 />
|
44 |
Grabs image title if the link lacks one<br />
|
45 |
Honors empty titles.<br />
|
|
|
46 |
Uses WordPress API to localize script (with safe fallbacks).<br />
|
47 |
</p>
|
48 |
|
languages/jqlb-ja.mo
ADDED
Binary file
|
languages/jqlb-ja.po
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WP JQuery Lightbox\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2011-05-17 16:35+0900\n"
|
6 |
+
"PO-Revision-Date: 2011-05-18 15:56+0900\n"
|
7 |
+
"Last-Translator: Redcocker\n"
|
8 |
+
"Language-Team: redcocker <masa153@gmail.com>\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-KeywordsList: __;_e;_c;__ngettext:1,2\n"
|
13 |
+
"X-Poedit-Basepath: .\n"
|
14 |
+
"X-Poedit-Language: Japanese\n"
|
15 |
+
"X-Poedit-Country: JAPAN\n"
|
16 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
17 |
+
"X-Poedit-SearchPath-0: C:\\_work\\svn\\artprima\\trunk\\wp-content\\plugins\\wp-jquery-lightbox\n"
|
18 |
+
|
19 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:42
|
20 |
+
msgid "Settings"
|
21 |
+
msgstr "設定"
|
22 |
+
|
23 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:98
|
24 |
+
msgid " \\u2190 / P - previous image\\u00a0\\u00a0\\u00a0\\u00a0\\u2192 / N - next image\\u00a0\\u00a0\\u00a0\\u00a0ESC / X - close image gallery"
|
25 |
+
msgstr " \\u2190 / P - 前の画像\\u00a0\\u00a0\\u00a0\\u00a0\\u2192 / N - 次の画像\\u00a0\\u00a0\\u00a0\\u00a0ESC / X - ギャラリーを閉じる"
|
26 |
+
|
27 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:99
|
28 |
+
msgid "previous image"
|
29 |
+
msgstr "前の画像"
|
30 |
+
|
31 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:100
|
32 |
+
msgid "next image"
|
33 |
+
msgstr "次の画像"
|
34 |
+
|
35 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:101
|
36 |
+
msgid "« Previous"
|
37 |
+
msgstr "« 前へ"
|
38 |
+
|
39 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:102
|
40 |
+
msgid "Next »"
|
41 |
+
msgstr "次へ »"
|
42 |
+
|
43 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:103
|
44 |
+
msgid "close image gallery"
|
45 |
+
msgstr "ギャラリーを閉じる"
|
46 |
+
|
47 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:104
|
48 |
+
msgid "Image "
|
49 |
+
msgstr "画像 "
|
50 |
+
|
51 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:105
|
52 |
+
msgid " of "
|
53 |
+
msgstr "の"
|
54 |
+
|
55 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:106
|
56 |
+
msgid "Download"
|
57 |
+
msgstr "ダウンロード"
|
58 |
+
|
59 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:152
|
60 |
+
msgid "Cheatin’ uh?"
|
61 |
+
msgstr "間違えましたか?"
|
62 |
+
|
63 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:165
|
64 |
+
msgid "Let the plugin add necessary html to image links"
|
65 |
+
msgstr "必要とするHTMLをイメージリンクに追加させる"
|
66 |
+
|
67 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:165
|
68 |
+
msgid "Auto-lightbox image links"
|
69 |
+
msgstr "自動的に画像(イメージリンク)にLightbox効果を適応する"
|
70 |
+
|
71 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:172
|
72 |
+
msgid "Disables the nofollow-attribute of comment links, that otherwise interfere with the lightbox."
|
73 |
+
msgstr "Lightbox効果を妨げるコメントリンクのnofollow属性は無効になる"
|
74 |
+
|
75 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:172
|
76 |
+
msgid "Enable lightbox in comments (disables <a href=\"http://codex.wordpress.org/Nofollow\">the nofollow attribute!</a>)"
|
77 |
+
msgstr "コメント欄でLightbox効果を有効にする(<a href=\"http://codex.wordpress.org/Nofollow\">nofollow属性</a>は無効になります。)"
|
78 |
+
|
79 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:179
|
80 |
+
msgid "Show download link"
|
81 |
+
msgstr "ダウンロードリンクを表示"
|
82 |
+
|
83 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:186
|
84 |
+
msgid "Shrink large images to fit smaller screens"
|
85 |
+
msgstr "スクリーンサイズに合わせて画像を縮小"
|
86 |
+
|
87 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:192
|
88 |
+
msgid "Animation duration (in milliseconds)"
|
89 |
+
msgstr "アニメーションの継続時間(ミリ秒)"
|
90 |
+
|
91 |
+
#: C:\_work\svn\artprima\trunk\wp-content\plugins\wp-jquery-lightbox/wp-jquery-lightbox.php:197
|
92 |
+
msgid "Save Changes"
|
93 |
+
msgstr "設定を保存"
|
94 |
+
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: ulfben
|
|
3 |
Donate link: http://amzn.com/w/2QB6SQ5XX2U0N
|
4 |
Tags: lightbox, jquery, nodal, image, display, ulfben
|
5 |
Requires at least: 2.9.2
|
6 |
-
Tested up to: 3.1.
|
7 |
-
Stable tag: 1.3.
|
8 |
|
9 |
A drop-in replacement for Lightbox 2 and similar plugins, shedding the bulk of Prototype and Scriptaculous. Improved for mobile devices.
|
10 |
|
@@ -14,19 +14,27 @@ This plugin lets you keep [the awesome Lightbox 2](http://www.huddletogether.com
|
|
14 |
|
15 |
Warren Krewenki [ported Lightbox to jQuery](http://warren.mesozen.com/jquery-lightbox/) and this plugin is mostly a wrapper to his work: providing localization support, an admin panel for configuration, (optional) auto-boxing of your image links and support for [WordPress galleries](http://codex.wordpress.org/Gallery_Shortcode), *including* [media library](http://codex.wordpress.org/Media_Library_SubPanel) titles and captions.
|
16 |
|
17 |
-
This version is also [
|
18 |
|
19 |
* Improved scaling *maximizes* use of screen space
|
20 |
* Live adjustment to the browser window and orientation of your phone
|
21 |
-
* Animations can be disabled entirely
|
22 |
* Optional download link to display images in native app.
|
23 |
|
24 |
See the plugin in action here: [http://game.hgo.se/blog/motion-capture/](http://game.hgo.se/blog/motion-capture/)
|
25 |
|
26 |
-
You can
|
27 |
|
28 |
*If you value [my plugins](http://profiles.wordpress.org/users/ulfben/) please consider [sending me a book](http://amzn.com/w/2QB6SQ5XX2U0N)!*
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
= 1.3.2 (2011-05-16) =
|
31 |
* Added support for auto-lightboxing comments too.
|
32 |
* Added Russian and Czech translations (incl. images). Thanks again Denis!
|
@@ -80,6 +88,15 @@ You can navigate the images with your keyboard: Arrows, P(revious)/N(ext) and X/
|
|
80 |
|
81 |
== Changelog ==
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
= 1.3.2 (2011-05-16) =
|
84 |
* Added support for auto-lightboxing comments too
|
85 |
* Added Russian and Czech translations (incl. images). Thanks again Denis!
|
@@ -122,6 +139,9 @@ You can navigate the images with your keyboard: Arrows, P(revious)/N(ext) and X/
|
|
122 |
|
123 |
== Upgrade Notice ==
|
124 |
|
|
|
|
|
|
|
125 |
= 1.3.2 =
|
126 |
Support for auto-lightboxing comments. Added Polish, Russian and Czech languages.
|
127 |
|
@@ -154,6 +174,14 @@ First release.
|
|
154 |
|
155 |
== Frequently Asked Questions ==
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
= I can see elements of my site through the overlay =
|
158 |
|
159 |
It's a problem of [z-index](http://www.w3schools.com/Css/pr_pos_z-index.asp). Check [the z-index property](http://www.w3schools.com/Css/pr_pos_z-index.asp) for the problematic elements, and force them to be less than 100. (Thanks [dway](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-title-captions-bug-found-solved-and-fix-proposed?replies=20#post-2052340)!)
|
3 |
Donate link: http://amzn.com/w/2QB6SQ5XX2U0N
|
4 |
Tags: lightbox, jquery, nodal, image, display, ulfben
|
5 |
Requires at least: 2.9.2
|
6 |
+
Tested up to: 3.1.3
|
7 |
+
Stable tag: 1.3.3
|
8 |
|
9 |
A drop-in replacement for Lightbox 2 and similar plugins, shedding the bulk of Prototype and Scriptaculous. Improved for mobile devices.
|
10 |
|
14 |
|
15 |
Warren Krewenki [ported Lightbox to jQuery](http://warren.mesozen.com/jquery-lightbox/) and this plugin is mostly a wrapper to his work: providing localization support, an admin panel for configuration, (optional) auto-boxing of your image links and support for [WordPress galleries](http://codex.wordpress.org/Gallery_Shortcode), *including* [media library](http://codex.wordpress.org/Media_Library_SubPanel) titles and captions.
|
16 |
|
17 |
+
This version is also [great for mobile devices](http://wordpress.org/extend/plugins/wp-jquery-lightbox/screenshots/);
|
18 |
|
19 |
* Improved scaling *maximizes* use of screen space
|
20 |
* Live adjustment to the browser window and orientation of your phone
|
|
|
21 |
* Optional download link to display images in native app.
|
22 |
|
23 |
See the plugin in action here: [http://game.hgo.se/blog/motion-capture/](http://game.hgo.se/blog/motion-capture/)
|
24 |
|
25 |
+
You can browse images with your keyboard: Arrows, P(revious)/N(ext) and X/C/ESC for close.
|
26 |
|
27 |
*If you value [my plugins](http://profiles.wordpress.org/users/ulfben/) please consider [sending me a book](http://amzn.com/w/2QB6SQ5XX2U0N)!*
|
28 |
|
29 |
+
= 1.3.3 (2011-06-12) =
|
30 |
+
* Fixes [for Internet Explorer](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-jquery-version-and-ie-issues)? (A million thanks to [David Grayston](http://www.grayston.net/2011/internet-explorer-v8-and-opacity-issues/#more-342)!).
|
31 |
+
* Fix for [mixed HTTP/HTTPS installations](http://wordpress.org/support/topic/mixed-http-and-https-installation-problems).
|
32 |
+
* Added setting for margins to screen edge.
|
33 |
+
* Added setting for target attribute of download link
|
34 |
+
* Added setting to put info & navigation on top.
|
35 |
+
* Added setting for help text.
|
36 |
+
* Added Japanese translation ([Thanks redcocker](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-japanese-translation)).
|
37 |
+
|
38 |
= 1.3.2 (2011-05-16) =
|
39 |
* Added support for auto-lightboxing comments too.
|
40 |
* Added Russian and Czech translations (incl. images). Thanks again Denis!
|
88 |
|
89 |
== Changelog ==
|
90 |
|
91 |
+
= 1.3.3 (2011-06-12) =
|
92 |
+
* Fixes [for Internet Explorer](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-jquery-version-and-ie-issues)? (A million thanks to [David Grayston](http://www.grayston.net/2011/internet-explorer-v8-and-opacity-issues/#more-342)!).
|
93 |
+
* Fix for [mixed HTTP/HTTPS installations](http://wordpress.org/support/topic/mixed-http-and-https-installation-problems).
|
94 |
+
* Added setting to have margins to screen edge.
|
95 |
+
* Added setting for target attribute of download link
|
96 |
+
* Added setting to put info & navigation on top.
|
97 |
+
* Added setting for help text.
|
98 |
+
* Added Japanese translation ([Thanks redcocker](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-japanese-translation)).
|
99 |
+
|
100 |
= 1.3.2 (2011-05-16) =
|
101 |
* Added support for auto-lightboxing comments too
|
102 |
* Added Russian and Czech translations (incl. images). Thanks again Denis!
|
139 |
|
140 |
== Upgrade Notice ==
|
141 |
|
142 |
+
= 1.3.3 =
|
143 |
+
Fixes for Internet Explorer? Support mixed HTTP/HTTPS. Added Japanese translation.
|
144 |
+
|
145 |
= 1.3.2 =
|
146 |
Support for auto-lightboxing comments. Added Polish, Russian and Czech languages.
|
147 |
|
174 |
|
175 |
== Frequently Asked Questions ==
|
176 |
|
177 |
+
= Settings have no effect / lightbox isn't working =
|
178 |
+
|
179 |
+
Many JavaScript optimizers, combiners, minifiers, etc. conflict with [`wp_localize_script`](http://codex.wordpress.org/Function_Reference/wp_localize_script2), used to configure this plugin and many others.
|
180 |
+
|
181 |
+
* If you have problems with jQuery Lightbox; first disable all JavaScript-optimizing plugins. (Optimize Scripts, W3 Total Cache, WP Minify etc)
|
182 |
+
* If you develop JavaScript optimizers for WordPress, please play nice with the default API...
|
183 |
+
* [More info about this issue](http://wordpress.org/support/topic/122-worked-13-does-not-work-for-me?replies=19)
|
184 |
+
|
185 |
= I can see elements of my site through the overlay =
|
186 |
|
187 |
It's a problem of [z-index](http://www.w3schools.com/Css/pr_pos_z-index.asp). Check [the z-index property](http://www.w3schools.com/Css/pr_pos_z-index.asp) for the problematic elements, and force them to be less than 100. (Thanks [dway](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-title-captions-bug-found-solved-and-fix-proposed?replies=20#post-2052340)!)
|
{images → styles/images}/blank.gif
RENAMED
File without changes
|
{images → styles/images}/close.gif
RENAMED
File without changes
|
{images → styles/images}/closelabel.gif
RENAMED
File without changes
|
{images → styles/images}/cs_CZ/blank.gif
RENAMED
File without changes
|
{images → styles/images}/cs_CZ/close.gif
RENAMED
File without changes
|
{images → styles/images}/cs_CZ/closelabel.gif
RENAMED
File without changes
|
{images → styles/images}/cs_CZ/loading.gif
RENAMED
File without changes
|
{images → styles/images}/cs_CZ/next.gif
RENAMED
File without changes
|
{images → styles/images}/cs_CZ/nextlabel.gif
RENAMED
File without changes
|
{images → styles/images}/cs_CZ/prev.gif
RENAMED
File without changes
|
{images → styles/images}/cs_CZ/prevlabel.gif
RENAMED
File without changes
|
{images → styles/images}/loading.gif
RENAMED
File without changes
|
{images → styles/images}/next.gif
RENAMED
File without changes
|
{images → styles/images}/nextlabel.gif
RENAMED
File without changes
|
{images → styles/images}/prev.gif
RENAMED
File without changes
|
{images → styles/images}/prevlabel.gif
RENAMED
File without changes
|
{images → styles/images}/ru_RU/blank.gif
RENAMED
File without changes
|
{images → styles/images}/ru_RU/close.gif
RENAMED
File without changes
|
{images → styles/images}/ru_RU/closelabel.gif
RENAMED
File without changes
|
{images → styles/images}/ru_RU/loading.gif
RENAMED
File without changes
|
{images → styles/images}/ru_RU/next.gif
RENAMED
File without changes
|
{images → styles/images}/ru_RU/nextlabel.gif
RENAMED
File without changes
|
{images → styles/images}/ru_RU/prev.gif
RENAMED
File without changes
|
{images → styles/images}/ru_RU/prevlabel.gif
RENAMED
File without changes
|
lightbox.css → styles/lightbox.css
RENAMED
File without changes
|
lightbox.min.cs_CZ.css → styles/lightbox.min.cs_CZ.css
RENAMED
File without changes
|
lightbox.min.css → styles/lightbox.min.css
RENAMED
File without changes
|
lightbox.min.ru_RU.css → styles/lightbox.min.ru_RU.css
RENAMED
File without changes
|
wp-jquery-lightbox.php
CHANGED
@@ -1,221 +1,270 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: wp-jquery-lightbox
|
4 |
-
Plugin URI: http://wordpress.org/extend/plugins/wp-jquery-lightbox/
|
5 |
-
Description: A drop in replacement for LightBox-2 and similar plugins. Uses jQuery to save you from the JS-library mess in your header. :)
|
6 |
-
Version: 1.3.
|
7 |
-
Author: Ulf Benjaminsson
|
8 |
-
Author URI: http://www.ulfben.com
|
9 |
-
*/
|
10 |
-
add_action( 'plugins_loaded', 'jqlb_init' );
|
11 |
-
function jqlb_init() {
|
12 |
-
if(!defined('WP_CONTENT_URL')){
|
13 |
-
define('WP_CONTENT_URL',
|
14 |
-
}
|
15 |
-
if(!defined('WP_PLUGIN_URL')){
|
16 |
-
define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');
|
17 |
-
}
|
18 |
-
define('JQLB_PLUGIN_DIR', dirname( __FILE__ ) . '/');
|
19 |
-
define('JQLB_DONATE_URL', 'http://www.amazon.com/gp/registry/wishlist/2QB6SQ5XX2U0N/105-3209188-5640446?reveal=unpurchased&filter=all&sort=priority&layout=standard&x=21&y=17');
|
20 |
-
define('JQLB_BASENAME', plugin_basename(__FILE__));
|
21 |
-
define('JQLB_URL', WP_PLUGIN_URL.'/wp-jquery-lightbox/');
|
22 |
-
define('JQLB_SCRIPT_URL', JQLB_URL.'jquery.lightbox.min.js');
|
23 |
-
define('
|
24 |
-
define('JQLB_LANGUAGES_DIR', JQLB_PLUGIN_DIR . 'languages/');
|
25 |
-
load_plugin_textdomain('jqlb', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
|
26 |
-
add_action('admin_init', 'jqlb_register_settings');
|
27 |
-
add_action('admin_menu', 'jqlb_register_menu_item');
|
28 |
-
add_action('wp_print_styles', 'jqlb_css');
|
29 |
-
add_action('wp_print_scripts', 'jqlb_js');
|
30 |
-
add_filter('plugin_row_meta', 'jqlb_set_plugin_meta', 2, 10);
|
31 |
-
add_filter('the_content', 'jqlb_autoexpand_rel_wlightbox', 99);
|
32 |
-
if(get_option('jqlb_comments') == 1){
|
33 |
-
remove_filter('pre_comment_content', 'wp_rel_nofollow');
|
34 |
-
add_filter('comment_text', 'jqlb_lightbox_comment', 99);
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
function jqlb_set_plugin_meta( $links, $file ) { // Add a link to this plugin's settings page
|
39 |
-
static $this_plugin;
|
40 |
-
if(!$this_plugin) $this_plugin = plugin_basename(__FILE__);
|
41 |
-
if($file == $this_plugin) {
|
42 |
-
$settings_link = '<a href="options-general.php?page=jquery-lightbox-options">'.__('Settings', 'jqlb').'</a>';
|
43 |
-
array_unshift($links, $settings_link);
|
44 |
-
}
|
45 |
-
return $links;
|
46 |
-
}
|
47 |
-
function jqlb_add_admin_footer(){ //shows some plugin info in the footer of the config screen.
|
48 |
-
$plugin_data = get_plugin_data(__FILE__);
|
49 |
-
printf('%1$s by %2$s (who <a href="'.JQLB_DONATE_URL.'">appreciates books</a>) :)<br />', $plugin_data['Title'].' '.$plugin_data['Version'], $plugin_data['Author']);
|
50 |
-
}
|
51 |
-
function jqlb_register_settings(){
|
52 |
-
register_setting( 'jqlb-settings-group', 'jqlb_automate', 'jqlb_bool_intval');
|
53 |
-
register_setting( 'jqlb-settings-group', 'jqlb_comments', 'jqlb_bool_intval');
|
54 |
-
register_setting( 'jqlb-settings-group', 'jqlb_resize_on_demand', 'jqlb_bool_intval');
|
55 |
-
register_setting( 'jqlb-settings-group', 'jqlb_show_download', 'jqlb_bool_intval');
|
56 |
-
register_setting( 'jqlb-settings-group', '
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
if(
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
'
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
'
|
103 |
-
'
|
104 |
-
'
|
105 |
-
'
|
106 |
-
'
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
$
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
return $
|
145 |
-
}
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
function
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
<tr valign="baseline">
|
176 |
-
<td>
|
177 |
-
<?php $check = get_option('
|
178 |
-
<input type="checkbox" id="
|
179 |
-
<label for="
|
180 |
-
</td>
|
181 |
-
</tr>
|
182 |
-
<tr valign="baseline">
|
183 |
-
<td>
|
184 |
-
<?php $check = get_option('
|
185 |
-
<input type="checkbox" id="
|
186 |
-
<label for="
|
187 |
-
</td>
|
188 |
-
</tr>
|
189 |
-
<tr valign="baseline">
|
190 |
-
<td>
|
191 |
-
|
192 |
-
<
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: wp-jquery-lightbox
|
4 |
+
Plugin URI: http://wordpress.org/extend/plugins/wp-jquery-lightbox/
|
5 |
+
Description: A drop in replacement for LightBox-2 and similar plugins. Uses jQuery to save you from the JS-library mess in your header. :)
|
6 |
+
Version: 1.3.3
|
7 |
+
Author: Ulf Benjaminsson
|
8 |
+
Author URI: http://www.ulfben.com
|
9 |
+
*/
|
10 |
+
add_action( 'plugins_loaded', 'jqlb_init' );
|
11 |
+
function jqlb_init() {
|
12 |
+
if(!defined('WP_CONTENT_URL')){
|
13 |
+
define('WP_CONTENT_URL', site_url('/wp-content'));
|
14 |
+
}
|
15 |
+
if(!defined('WP_PLUGIN_URL')){
|
16 |
+
define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');
|
17 |
+
}
|
18 |
+
define('JQLB_PLUGIN_DIR', dirname( __FILE__ ) . '/');
|
19 |
+
define('JQLB_DONATE_URL', 'http://www.amazon.com/gp/registry/wishlist/2QB6SQ5XX2U0N/105-3209188-5640446?reveal=unpurchased&filter=all&sort=priority&layout=standard&x=21&y=17');
|
20 |
+
define('JQLB_BASENAME', plugin_basename(__FILE__));
|
21 |
+
define('JQLB_URL', WP_PLUGIN_URL.'/wp-jquery-lightbox/');
|
22 |
+
define('JQLB_SCRIPT_URL', JQLB_URL.'jquery.lightbox.min.js');
|
23 |
+
define('JQLB_STYLES_URL', JQLB_URL.'styles/');
|
24 |
+
define('JQLB_LANGUAGES_DIR', JQLB_PLUGIN_DIR . 'languages/');
|
25 |
+
load_plugin_textdomain('jqlb', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
|
26 |
+
add_action('admin_init', 'jqlb_register_settings');
|
27 |
+
add_action('admin_menu', 'jqlb_register_menu_item');
|
28 |
+
add_action('wp_print_styles', 'jqlb_css');
|
29 |
+
add_action('wp_print_scripts', 'jqlb_js');
|
30 |
+
add_filter('plugin_row_meta', 'jqlb_set_plugin_meta', 2, 10);
|
31 |
+
add_filter('the_content', 'jqlb_autoexpand_rel_wlightbox', 99);
|
32 |
+
if(get_option('jqlb_comments') == 1){
|
33 |
+
remove_filter('pre_comment_content', 'wp_rel_nofollow');
|
34 |
+
add_filter('comment_text', 'jqlb_lightbox_comment', 99);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
function jqlb_set_plugin_meta( $links, $file ) { // Add a link to this plugin's settings page
|
39 |
+
static $this_plugin;
|
40 |
+
if(!$this_plugin) $this_plugin = plugin_basename(__FILE__);
|
41 |
+
if($file == $this_plugin) {
|
42 |
+
$settings_link = '<a href="options-general.php?page=jquery-lightbox-options">'.__('Settings', 'jqlb').'</a>';
|
43 |
+
array_unshift($links, $settings_link);
|
44 |
+
}
|
45 |
+
return $links;
|
46 |
+
}
|
47 |
+
function jqlb_add_admin_footer(){ //shows some plugin info in the footer of the config screen.
|
48 |
+
$plugin_data = get_plugin_data(__FILE__);
|
49 |
+
printf('%1$s by %2$s (who <a href="'.JQLB_DONATE_URL.'">appreciates books</a>) :)<br />', $plugin_data['Title'].' '.$plugin_data['Version'], $plugin_data['Author']);
|
50 |
+
}
|
51 |
+
function jqlb_register_settings(){
|
52 |
+
register_setting( 'jqlb-settings-group', 'jqlb_automate', 'jqlb_bool_intval');
|
53 |
+
register_setting( 'jqlb-settings-group', 'jqlb_comments', 'jqlb_bool_intval');
|
54 |
+
register_setting( 'jqlb-settings-group', 'jqlb_resize_on_demand', 'jqlb_bool_intval');
|
55 |
+
register_setting( 'jqlb-settings-group', 'jqlb_show_download', 'jqlb_bool_intval');
|
56 |
+
register_setting( 'jqlb-settings-group', 'jqlb_navbarOnTop', 'jqlb_bool_intval');
|
57 |
+
register_setting( 'jqlb-settings-group', 'jqlb_margin_size', 'floatval');
|
58 |
+
register_setting( 'jqlb-settings-group', 'jqlb_resize_speed', 'jqlb_pos_intval');
|
59 |
+
register_setting( 'jqlb-settings-group', 'jqlb_help_text');
|
60 |
+
register_setting( 'jqlb-settings-group', 'jqlb_link_target');
|
61 |
+
|
62 |
+
//register_setting( 'jqlb-settings-group', 'jqlb_follow_scroll', 'jqlb_bool_intval');
|
63 |
+
add_option('jqlb_help_text', '');
|
64 |
+
add_option('jqlb_link_target', '_self');
|
65 |
+
add_option('jqlb_automate', 1); //default is to auto-lightbox.
|
66 |
+
add_option('jqlb_comments', 1);
|
67 |
+
add_option('jqlb_resize_on_demand', 0);
|
68 |
+
add_option('jqlb_show_download', 0);
|
69 |
+
add_option('jqlb_navbarOnTop', 0);
|
70 |
+
add_option('jqlb_resize_speed', 400);
|
71 |
+
//add_option('jqlb_follow_scroll', 0);
|
72 |
+
}
|
73 |
+
function jqlb_register_menu_item() {
|
74 |
+
add_options_page('jQuery Lightbox Options', 'jQuery Lightbox', 'manage_options', 'jquery-lightbox-options', 'jqlb_options_panel');
|
75 |
+
}
|
76 |
+
function jqlb_get_locale(){
|
77 |
+
//$lang_locales and ICL_LANGUAGE_CODE are defined in the WPML plugin (http://wpml.org/)
|
78 |
+
global $lang_locales;
|
79 |
+
if (defined('ICL_LANGUAGE_CODE') && isset($lang_locales[ICL_LANGUAGE_CODE])){
|
80 |
+
$locale = $lang_locales[ICL_LANGUAGE_CODE];
|
81 |
+
} else {
|
82 |
+
$locale = get_locale();
|
83 |
+
}
|
84 |
+
return $locale;
|
85 |
+
}
|
86 |
+
function jqlb_css(){
|
87 |
+
if(is_admin() || is_feed()){return;}
|
88 |
+
$locale = jqlb_get_locale();
|
89 |
+
$cssfile = JQLB_STYLES_URL.'lightbox.min.' . $locale . '.css';
|
90 |
+
if(is_readable($cssfile)){
|
91 |
+
wp_enqueue_style('jquery.lightbox.min.css', $cssfile, false, '1.3');
|
92 |
+
}else{
|
93 |
+
$default = 'lightbox.min.css';
|
94 |
+
wp_enqueue_style('jquery.lightbox.min.css', JQLB_STYLES_URL.$default, false, '1.3');
|
95 |
+
}
|
96 |
+
}
|
97 |
+
function jqlb_js() {
|
98 |
+
if(is_admin() || is_feed()){return;}
|
99 |
+
wp_enqueue_script('jquery', '', array(), false, true);
|
100 |
+
wp_enqueue_script('wp-jquery-lightbox', JQLB_SCRIPT_URL, Array('jquery'), '1.3.3', true);
|
101 |
+
wp_localize_script('wp-jquery-lightbox', 'JQLBSettings', array(
|
102 |
+
'fitToScreen' => get_option('jqlb_resize_on_demand'),
|
103 |
+
'resizeSpeed' => get_option('jqlb_resize_speed'),
|
104 |
+
'displayDownloadLink' => get_option('jqlb_show_download'),
|
105 |
+
'navbarOnTop' => get_option('jqlb_navbarOnTop'),
|
106 |
+
'loopImages' => get_option('jqlb_loopImages'),
|
107 |
+
'resizeCenter' => get_option('jqlb_resizeCenter'),
|
108 |
+
'marginSize' => get_option('jqlb_margin_size'),
|
109 |
+
'linkTarget' => get_option('jqlb_link_target'),
|
110 |
+
//'followScroll' => get_option('jqlb_follow_scroll'),
|
111 |
+
/* translation */
|
112 |
+
'help' => __(get_option('jqlb_help_text'), 'jqlb'),
|
113 |
+
'prevLinkTitle' => __('previous image', 'jqlb'),
|
114 |
+
'nextLinkTitle' => __('next image', 'jqlb'),
|
115 |
+
'prevLinkText' => __('« Previous', 'jqlb'),
|
116 |
+
'nextLinkText' => __('Next »', 'jqlb'),
|
117 |
+
'closeTitle' => __('close image gallery', 'jqlb'),
|
118 |
+
'image' => __('Image ', 'jqlb'),
|
119 |
+
'of' => __(' of ', 'jqlb'),
|
120 |
+
'download' => __('Download', 'jqlb')
|
121 |
+
));
|
122 |
+
}
|
123 |
+
|
124 |
+
function jqlb_lightbox_comment($comment){
|
125 |
+
$comment = str_replace('rel=\'external nofollow\'','', $comment);
|
126 |
+
$comment = str_replace('rel=\'nofollow\'','', $comment);
|
127 |
+
$comment = str_replace('rel="external nofollow"','', $comment);
|
128 |
+
$comment = str_replace('rel="nofollow"','', $comment);
|
129 |
+
return jqlb_autoexpand_rel_wlightbox($comment);
|
130 |
+
}
|
131 |
+
|
132 |
+
function jqlb_autoexpand_rel_wlightbox($content) {
|
133 |
+
if(get_option('jqlb_automate') == 1){
|
134 |
+
global $post;
|
135 |
+
$id = ($post->ID) ? $post->ID : -1;
|
136 |
+
$content = jqlb_do_regexp($content, $id);
|
137 |
+
}
|
138 |
+
return $content;
|
139 |
+
}
|
140 |
+
function jqlb_apply_lightbox($content, $id = -1){
|
141 |
+
if(!isset($id) || $id === -1){
|
142 |
+
$id = time().rand(0, 32768);
|
143 |
+
}
|
144 |
+
return jqlb_do_regexp($content, $id);
|
145 |
+
}
|
146 |
+
|
147 |
+
/* automatically insert rel="lightbox[nameofpost]" to every image with no manual work.
|
148 |
+
if there are already rel="lightbox[something]" attributes, they are not clobbered.
|
149 |
+
Michael Tyson, you are a regular expressions god! - http://atastypixel.com */
|
150 |
+
function jqlb_do_regexp($content, $id){
|
151 |
+
$id = esc_attr($id);
|
152 |
+
$pattern = "/(<a(?![^>]*?rel=['\"]lightbox.*)[^>]*?href=['\"][^'\"]+?\.(?:bmp|gif|jpg|jpeg|png)['\"][^\>]*)>/i";
|
153 |
+
$replacement = '$1 rel="lightbox['.$id.']">';
|
154 |
+
return preg_replace($pattern, $replacement, $content);
|
155 |
+
}
|
156 |
+
|
157 |
+
function jqlb_bool_intval($v){
|
158 |
+
return $v == 1 ? '1' : '0';
|
159 |
+
}
|
160 |
+
|
161 |
+
function jqlb_pos_intval($v){
|
162 |
+
return abs(intval($v));
|
163 |
+
}
|
164 |
+
function jqlb_options_panel(){
|
165 |
+
if(!function_exists('current_user_can') || !current_user_can('manage_options')){
|
166 |
+
die(__('Cheatin’ uh?', 'jqlb'));
|
167 |
+
}
|
168 |
+
add_action('in_admin_footer', 'jqlb_add_admin_footer');
|
169 |
+
?>
|
170 |
+
<div class="wrap">
|
171 |
+
<h2>jQuery Lightbox</h2>
|
172 |
+
<form method="post" action="options.php">
|
173 |
+
<table>
|
174 |
+
<?php settings_fields('jqlb-settings-group'); ?>
|
175 |
+
<tr valign="baseline" colspan="2">
|
176 |
+
<td colspan="2">
|
177 |
+
<?php $check = get_option('jqlb_automate') ? ' checked="yes" ' : ''; ?>
|
178 |
+
<input type="checkbox" id="jqlb_automate" name="jqlb_automate" value="1" <?php echo $check; ?>/>
|
179 |
+
<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>
|
180 |
+
</td>
|
181 |
+
</tr>
|
182 |
+
<tr valign="baseline" colspan="2">
|
183 |
+
<td colspan="2">
|
184 |
+
<?php $check = get_option('jqlb_comments') ? ' checked="yes" ' : ''; ?>
|
185 |
+
<input type="checkbox" id="jqlb_comments" name="jqlb_comments" value="1" <?php echo $check; ?>/>
|
186 |
+
<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>
|
187 |
+
</td>
|
188 |
+
</tr>
|
189 |
+
<tr valign="baseline" colspan="2">
|
190 |
+
<td>
|
191 |
+
<?php $check = get_option('jqlb_show_download') ? ' checked="yes" ' : ''; ?>
|
192 |
+
<input type="checkbox" id="jqlb_show_download" name="jqlb_show_download" value="1" <?php echo $check; ?> />
|
193 |
+
<label for="jqlb_show_download"> <?php _e('Show download link', 'jqlb') ?> </label>
|
194 |
+
</td>
|
195 |
+
<td>
|
196 |
+
<?php $target = get_option('jqlb_link_target'); ?>
|
197 |
+
<label for="jqlb_link_target" title="<?php _e('_blank: open the image in a new window or tab
|
198 |
+
_self: open the image in the same frame as it was clicked (default)
|
199 |
+
_parent: open the image in the parent frameset
|
200 |
+
_top: open the image in the full body of the window', 'jqlb') ?>"><?php _e('Target for download link:', 'jqlb'); ?></label>
|
201 |
+
<select id="jqlb_link_target" name="jqlb_link_target">
|
202 |
+
<option <?php if ('_blank' == $target)echo 'selected="selected"'; ?>>_blank</option>
|
203 |
+
<option <?php if ('_self' == $target)echo 'selected="selected"'; ?>>_self</option>
|
204 |
+
<option <?php if ('_top' == $target)echo 'selected="selected"'; ?>>_top</option>
|
205 |
+
<option <?php if ('_parent' == $target)echo 'selected="selected"'; ?>>_parent</option>
|
206 |
+
</select>
|
207 |
+
</td>
|
208 |
+
</tr>
|
209 |
+
<tr valign="baseline" colspan="2">
|
210 |
+
<td colspan="2">
|
211 |
+
<?php $check = get_option('jqlb_navbarOnTop') ? ' checked="yes" ' : ''; ?>
|
212 |
+
<input type="checkbox" id="jqlb_navbarOnTop" name="jqlb_navbarOnTop" value="1" <?php echo $check; ?> />
|
213 |
+
<label for="jqlb_navbarOnTop">
|
214 |
+
<?php _e('Show image info on top', 'jqlb') ?>
|
215 |
+
</label>
|
216 |
+
</td>
|
217 |
+
</tr>
|
218 |
+
<tr valign="baseline" colspan="2">
|
219 |
+
<td>
|
220 |
+
<?php $check = get_option('jqlb_resize_on_demand') ? ' checked="yes" ' : ''; ?>
|
221 |
+
<input type="checkbox" id="jqlb_resize_on_demand" name="jqlb_resize_on_demand" value="1" <?php echo $check; ?> />
|
222 |
+
<label for="jqlb_resize_on_demand"><?php _e('Shrink large images to fit smaller screens', 'jqlb') ?></label>
|
223 |
+
</td>
|
224 |
+
<?php IF($check != ''): ?>
|
225 |
+
<td>
|
226 |
+
<input type="text" id="jqlb_margin_size" name="jqlb_margin_size" value="<?php echo floatval(get_option('jqlb_margin_size')) ?>" size="3" />
|
227 |
+
<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>
|
228 |
+
</td>
|
229 |
+
<?php ENDIF; ?>
|
230 |
+
</tr>
|
231 |
+
<tr valign="baseline" colspan="2">
|
232 |
+
<td colspan="2">
|
233 |
+
<input type="text" id="jqlb_resize_speed" name="jqlb_resize_speed" value="<?php echo intval(get_option('jqlb_resize_speed')) ?>" size="3" />
|
234 |
+
<label for="jqlb_resize_speed"><?php _e('Animation duration (in milliseconds) ', 'jqlb') ?></label>
|
235 |
+
</td>
|
236 |
+
</tr>
|
237 |
+
<tr valign="baseline" colspan="2">
|
238 |
+
<td>
|
239 |
+
<input type="text" id="jqlb_help_text" name="jqlb_help_text" value="<?php echo get_option('jqlb_help_text'); ?>" size="30" />
|
240 |
+
<label for="jqlb_help_text"><?php _e('Help text (default: none) ', 'jqlb'); ?></label>
|
241 |
+
</td>
|
242 |
+
</tr>
|
243 |
+
</table>
|
244 |
+
<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>
|
245 |
+
<p class="submit">
|
246 |
+
<input type="submit" name="Submit" value="<?php _e('Save Changes', 'jqlb') ?>" />
|
247 |
+
</p>
|
248 |
+
</form>
|
249 |
+
<?php
|
250 |
+
$locale = jqlb_get_locale();
|
251 |
+
$diskfile = JQLB_LANGUAGES_DIR . "howtouse-" . $locale . ".html";
|
252 |
+
if (!file_exists($diskfile)){
|
253 |
+
$diskfile = JQLB_LANGUAGES_DIR . "howtouse.html";
|
254 |
+
}
|
255 |
+
$text = false;
|
256 |
+
if(function_exists('file_get_contents')){
|
257 |
+
$text = @file_get_contents($diskfile);
|
258 |
+
} else {
|
259 |
+
$text = @file($diskfile);
|
260 |
+
if($text !== false){
|
261 |
+
$text = implode("", $text);
|
262 |
+
}
|
263 |
+
}
|
264 |
+
if($text === false){
|
265 |
+
$text = '<p>The documentation files are missing! Try <a href="http://wordpress.org/extend/plugins/wp-jquery-lightbox/">downloading</a> and <a href="http://wordpress.org/extend/plugins/wp-jquery-lightbox/installation/">re-installing</a> this plugin.</p>';
|
266 |
+
}
|
267 |
+
echo $text;
|
268 |
+
?>
|
269 |
+
</div>
|
270 |
+
<?php }?>
|