Lightbox Gallery - Version 0.9.1

Version Description

  • Code cleaning.
Download this release

Release Info

Developer Hiroaki Miyashita
Plugin Icon wp plugin Lightbox Gallery
Version 0.9.1
Comparing to
See all releases

Code changes from version 0.9 to 0.9.1

Files changed (4) hide show
  1. js/highslide.js +0 -1889
  2. js/jquery.lightbox.js +0 -492
  3. lightbox-gallery.php +2 -2
  4. readme.txt +4 -1
js/highslide.js DELETED
@@ -1,1889 +0,0 @@
1
- /**
2
- * Name: Highslide JS
3
- * Version: 5.0.0 (2016-05-24)
4
- * Config: default
5
- * Author: Torstein Hønsi
6
- * Support: www.highslide.com/support
7
- * License: MIT
8
- */
9
- if (!hs) { var hs = {
10
- // Language strings
11
- lang : {
12
- cssDirection: 'ltr',
13
- loadingText : 'Loading...',
14
- loadingTitle : 'Click to cancel',
15
- focusTitle : 'Click to bring to front',
16
- fullExpandTitle : 'Expand to actual size (f)',
17
- creditsText : 'Powered by <i>Highslide JS</i>',
18
- creditsTitle : 'Go to the Highslide JS homepage',
19
- restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
20
- },
21
- // See http://highslide.com/ref for examples of settings
22
- graphicsDir : 'highslide/graphics/',
23
- expandCursor : 'zoomin.cur', // null disables
24
- restoreCursor : 'zoomout.cur', // null disables
25
- expandDuration : 250, // milliseconds
26
- restoreDuration : 250,
27
- marginLeft : 15,
28
- marginRight : 15,
29
- marginTop : 15,
30
- marginBottom : 15,
31
- zIndexCounter : 1001, // adjust to other absolutely positioned elements
32
- loadingOpacity : 0.75,
33
- allowMultipleInstances: true,
34
- numberOfImagesToPreload : 5,
35
- outlineWhileAnimating : 2, // 0 = never, 1 = always, 2 = HTML only
36
- outlineStartOffset : 3, // ends at 10
37
- padToMinWidth : false, // pad the popup width to make room for wide caption
38
- fullExpandPosition : 'bottom right',
39
- fullExpandOpacity : 1,
40
- showCredits : true, // you can set this to false if you want
41
- creditsHref : 'http://highslide.com/',
42
- creditsTarget : '_self',
43
- enableKeyListener : true,
44
- openerTagNames : ['a'], // Add more to allow slideshow indexing
45
-
46
- dragByHeading: true,
47
- minWidth: 200,
48
- minHeight: 200,
49
- allowSizeReduction: true, // allow the image to reduce to fit client size. If false, this overrides minWidth and minHeight
50
- outlineType : 'drop-shadow', // set null to disable outlines
51
- // END OF YOUR SETTINGS
52
-
53
-
54
- // declare internal properties
55
- preloadTheseImages : [],
56
- continuePreloading: true,
57
- expanders : [],
58
- overrides : [
59
- 'allowSizeReduction',
60
- 'useBox',
61
- 'outlineType',
62
- 'outlineWhileAnimating',
63
- 'captionId',
64
- 'captionText',
65
- 'captionEval',
66
- 'captionOverlay',
67
- 'headingId',
68
- 'headingText',
69
- 'headingEval',
70
- 'headingOverlay',
71
- 'creditsPosition',
72
- 'dragByHeading',
73
-
74
- 'width',
75
- 'height',
76
-
77
- 'wrapperClassName',
78
- 'minWidth',
79
- 'minHeight',
80
- 'maxWidth',
81
- 'maxHeight',
82
- 'pageOrigin',
83
- 'slideshowGroup',
84
- 'easing',
85
- 'easingClose',
86
- 'fadeInOut',
87
- 'src'
88
- ],
89
- overlays : [],
90
- idCounter : 0,
91
- oPos : {
92
- x: ['leftpanel', 'left', 'center', 'right', 'rightpanel'],
93
- y: ['above', 'top', 'middle', 'bottom', 'below']
94
- },
95
- mouse: {},
96
- headingOverlay: {},
97
- captionOverlay: {},
98
- timers : [],
99
-
100
- pendingOutlines : {},
101
- clones : {},
102
- onReady: [],
103
- uaVersion: document.documentMode || parseFloat((navigator.userAgent.toLowerCase().match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1]),
104
- ie : (document.all && !window.opera),
105
- //ie : navigator && /MSIE [678]/.test(navigator.userAgent), // ie9 compliant?
106
- safari : /Safari/.test(navigator.userAgent),
107
- geckoMac : /Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),
108
-
109
- $ : function (id) {
110
- if (id) return document.getElementById(id);
111
- },
112
-
113
- push : function (arr, val) {
114
- arr[arr.length] = val;
115
- },
116
-
117
- createElement : function (tag, attribs, styles, parent, nopad) {
118
- var el = document.createElement(tag);
119
- if (attribs) hs.extend(el, attribs);
120
- if (nopad) hs.setStyles(el, {padding: 0, border: 'none', margin: 0});
121
- if (styles) hs.setStyles(el, styles);
122
- if (parent) parent.appendChild(el);
123
- return el;
124
- },
125
-
126
- extend : function (el, attribs) {
127
- for (var x in attribs) el[x] = attribs[x];
128
- return el;
129
- },
130
-
131
- setStyles : function (el, styles) {
132
- for (var x in styles) {
133
- if (hs.ieLt9 && x == 'opacity') {
134
- if (styles[x] > 0.99) el.style.removeAttribute('filter');
135
- else el.style.filter = 'alpha(opacity='+ (styles[x] * 100) +')';
136
- }
137
- else el.style[x] = styles[x];
138
- }
139
- },
140
- animate: function(el, prop, opt) {
141
- var start,
142
- end,
143
- unit;
144
- if (typeof opt != 'object' || opt === null) {
145
- var args = arguments;
146
- opt = {
147
- duration: args[2],
148
- easing: args[3],
149
- complete: args[4]
150
- };
151
- }
152
- if (typeof opt.duration != 'number') opt.duration = 250;
153
- opt.easing = Math[opt.easing] || Math.easeInQuad;
154
- opt.curAnim = hs.extend({}, prop);
155
- for (var name in prop) {
156
- var e = new hs.fx(el, opt , name );
157
-
158
- start = parseFloat(hs.css(el, name)) || 0;
159
- end = parseFloat(prop[name]);
160
- unit = name != 'opacity' ? 'px' : '';
161
-
162
- e.custom( start, end, unit );
163
- }
164
- },
165
- css: function(el, prop) {
166
- if (el.style[prop]) {
167
- return el.style[prop];
168
- } else if (document.defaultView) {
169
- return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
170
-
171
- } else {
172
- if (prop == 'opacity') prop = 'filter';
173
- var val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b){ return b.toUpperCase(); })];
174
- if (prop == 'filter')
175
- val = val.replace(/alpha\(opacity=([0-9]+)\)/,
176
- function (a, b) { return b / 100 });
177
- return val === '' ? 1 : val;
178
- }
179
- },
180
-
181
- getPageSize : function () {
182
- var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat'
183
- ? d.documentElement : d.body,
184
- ieLt9 = hs.ie && (hs.uaVersion < 9 || typeof pageXOffset == 'undefined');
185
-
186
- var width = ieLt9 ? iebody.clientWidth :
187
- (d.documentElement.clientWidth || self.innerWidth),
188
- height = ieLt9 ? iebody.clientHeight : self.innerHeight;
189
- hs.page = {
190
- width: width,
191
- height: height,
192
- scrollLeft: ieLt9 ? iebody.scrollLeft : pageXOffset,
193
- scrollTop: ieLt9 ? iebody.scrollTop : pageYOffset
194
- };
195
- return hs.page;
196
- },
197
-
198
- getPosition : function(el) {
199
- var p = { x: el.offsetLeft, y: el.offsetTop };
200
- while (el.offsetParent) {
201
- el = el.offsetParent;
202
- p.x += el.offsetLeft;
203
- p.y += el.offsetTop;
204
- if (el != document.body && el != document.documentElement) {
205
- p.x -= el.scrollLeft;
206
- p.y -= el.scrollTop;
207
- }
208
- }
209
- return p;
210
- },
211
-
212
- expand : function(a, params, custom, type) {
213
- if (!a) a = hs.createElement('a', null, { display: 'none' }, hs.container);
214
- if (typeof a.getParams == 'function') return params;
215
- try {
216
- new hs.Expander(a, params, custom);
217
- return false;
218
- } catch (e) { return true; }
219
- },
220
-
221
-
222
- focusTopmost : function() {
223
- var topZ = 0,
224
- topmostKey = -1,
225
- expanders = hs.expanders,
226
- exp,
227
- zIndex;
228
- for (var i = 0; i < expanders.length; i++) {
229
- exp = expanders[i];
230
- if (exp) {
231
- zIndex = exp.wrapper.style.zIndex;
232
- if (zIndex && zIndex > topZ) {
233
- topZ = zIndex;
234
- topmostKey = i;
235
- }
236
- }
237
- }
238
- if (topmostKey == -1) hs.focusKey = -1;
239
- else expanders[topmostKey].focus();
240
- },
241
-
242
- getParam : function (a, param) {
243
- a.getParams = a.onclick;
244
- var p = a.getParams ? a.getParams() : null;
245
- a.getParams = null;
246
-
247
- return (p && typeof p[param] != 'undefined') ? p[param] :
248
- (typeof hs[param] != 'undefined' ? hs[param] : null);
249
- },
250
-
251
- getSrc : function (a) {
252
- var src = hs.getParam(a, 'src');
253
- if (src) return src;
254
- return a.href;
255
- },
256
-
257
- getNode : function (id) {
258
- var node = hs.$(id), clone = hs.clones[id], a = {};
259
- if (!node && !clone) return null;
260
- if (!clone) {
261
- clone = node.cloneNode(true);
262
- clone.id = '';
263
- hs.clones[id] = clone;
264
- return node;
265
- } else {
266
- return clone.cloneNode(true);
267
- }
268
- },
269
-
270
- discardElement : function(d) {
271
- if (d) hs.garbageBin.appendChild(d);
272
- hs.garbageBin.innerHTML = '';
273
- },
274
- transit : function (adj, exp) {
275
- var last = exp || hs.getExpander();
276
- exp = last;
277
- if (hs.upcoming) return false;
278
- else hs.last = last;
279
- hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
280
- try {
281
- hs.upcoming = adj;
282
- adj.onclick();
283
- } catch (e){
284
- hs.last = hs.upcoming = null;
285
- }
286
- try {
287
- exp.close();
288
- } catch (e) {}
289
- return false;
290
- },
291
-
292
- previousOrNext : function (el, op) {
293
- var exp = hs.getExpander(el);
294
- if (exp) return hs.transit(exp.getAdjacentAnchor(op), exp);
295
- else return false;
296
- },
297
-
298
- previous : function (el) {
299
- return hs.previousOrNext(el, -1);
300
- },
301
-
302
- next : function (el) {
303
- return hs.previousOrNext(el, 1);
304
- },
305
-
306
- keyHandler : function(e) {
307
- if (!e) e = window.event;
308
- if (!e.target) e.target = e.srcElement; // ie
309
- if (typeof e.target.form != 'undefined') return true; // form element has focus
310
- var exp = hs.getExpander();
311
-
312
- var op = null;
313
- switch (e.keyCode) {
314
- case 70: // f
315
- if (exp) exp.doFullExpand();
316
- return true;
317
- case 32: // Space
318
- case 34: // Page Down
319
- case 39: // Arrow right
320
- case 40: // Arrow down
321
- op = 1;
322
- break;
323
- case 8: // Backspace
324
- case 33: // Page Up
325
- case 37: // Arrow left
326
- case 38: // Arrow up
327
- op = -1;
328
- break;
329
- case 27: // Escape
330
- case 13: // Enter
331
- op = 0;
332
- }
333
- if (op !== null) {hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
334
- if (!hs.enableKeyListener) return true;
335
-
336
- if (e.preventDefault) e.preventDefault();
337
- else e.returnValue = false;
338
- if (exp) {
339
- if (op == 0) {
340
- exp.close();
341
- } else {
342
- hs.previousOrNext(exp.key, op);
343
- }
344
- return false;
345
- }
346
- }
347
- return true;
348
- },
349
-
350
-
351
- registerOverlay : function (overlay) {
352
- hs.push(hs.overlays, hs.extend(overlay, { hsId: 'hsId'+ hs.idCounter++ } ));
353
- },
354
-
355
-
356
- getWrapperKey : function (element, expOnly) {
357
- var el, re = /^highslide-wrapper-([0-9]+)$/;
358
- // 1. look in open expanders
359
- el = element;
360
- while (el.parentNode) {
361
- if (el.id && re.test(el.id)) return el.id.replace(re, "$1");
362
- el = el.parentNode;
363
- }
364
- // 2. look in thumbnail
365
- if (!expOnly) {
366
- el = element;
367
- while (el.parentNode) {
368
- if (el.tagName && hs.isHsAnchor(el)) {
369
- for (var key = 0; key < hs.expanders.length; key++) {
370
- var exp = hs.expanders[key];
371
- if (exp && exp.a == el) return key;
372
- }
373
- }
374
- el = el.parentNode;
375
- }
376
- }
377
- return null;
378
- },
379
-
380
- getExpander : function (el, expOnly) {
381
- if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null;
382
- if (typeof el == 'number') return hs.expanders[el] || null;
383
- if (typeof el == 'string') el = hs.$(el);
384
- return hs.expanders[hs.getWrapperKey(el, expOnly)] || null;
385
- },
386
-
387
- isHsAnchor : function (a) {
388
- return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/));
389
- },
390
-
391
- reOrder : function () {
392
- for (var i = 0; i < hs.expanders.length; i++)
393
- if (hs.expanders[i] && hs.expanders[i].isExpanded) hs.focusTopmost();
394
- },
395
-
396
- mouseClickHandler : function(e)
397
- {
398
- if (!e) e = window.event;
399
- if (e.button > 1) return true;
400
- if (!e.target) e.target = e.srcElement;
401
-
402
- var el = e.target;
403
- while (el.parentNode
404
- && !(/highslide-(image|move|html|resize)/.test(el.className)))
405
- {
406
- el = el.parentNode;
407
- }
408
- var exp = hs.getExpander(el);
409
- if (exp && (exp.isClosing || !exp.isExpanded)) return true;
410
-
411
- if (exp && e.type == 'mousedown') {
412
- if (e.target.form) return true;
413
- var match = el.className.match(/highslide-(image|move|resize)/);
414
- if (match) {
415
- hs.dragArgs = {
416
- exp: exp ,
417
- type: match[1],
418
- left: exp.x.pos,
419
- width: exp.x.size,
420
- top: exp.y.pos,
421
- height: exp.y.size,
422
- clickX: e.clientX,
423
- clickY: e.clientY
424
- };
425
-
426
-
427
- hs.addEventListener(document, 'mousemove', hs.dragHandler);
428
- if (e.preventDefault) e.preventDefault(); // FF
429
-
430
- if (/highslide-(image|html)-blur/.test(exp.content.className)) {
431
- exp.focus();
432
- hs.hasFocused = true;
433
- }
434
- return false;
435
- }
436
- } else if (e.type == 'mouseup') {
437
-
438
- hs.removeEventListener(document, 'mousemove', hs.dragHandler);
439
-
440
- if (hs.dragArgs) {
441
- if (hs.styleRestoreCursor && hs.dragArgs.type == 'image')
442
- hs.dragArgs.exp.content.style.cursor = hs.styleRestoreCursor;
443
- var hasDragged = hs.dragArgs.hasDragged;
444
-
445
- if (!hasDragged &&!hs.hasFocused && !/(move|resize)/.test(hs.dragArgs.type)) {
446
- exp.close();
447
- }
448
- else if (hasDragged || (!hasDragged && hs.hasHtmlExpanders)) {
449
- hs.dragArgs.exp.doShowHide('hidden');
450
- }
451
- hs.hasFocused = false;
452
- hs.dragArgs = null;
453
-
454
- } else if (/highslide-image-blur/.test(el.className)) {
455
- el.style.cursor = hs.styleRestoreCursor;
456
- }
457
- }
458
- return false;
459
- },
460
-
461
- dragHandler : function(e)
462
- {
463
- if (!hs.dragArgs) return true;
464
- if (!e) e = window.event;
465
- var a = hs.dragArgs, exp = a.exp;
466
-
467
- a.dX = e.clientX - a.clickX;
468
- a.dY = e.clientY - a.clickY;
469
-
470
- var distance = Math.sqrt(Math.pow(a.dX, 2) + Math.pow(a.dY, 2));
471
- if (!a.hasDragged) a.hasDragged = (a.type != 'image' && distance > 0)
472
- || (distance > (hs.dragSensitivity || 5));
473
-
474
- if (a.hasDragged && e.clientX > 5 && e.clientY > 5) {
475
-
476
- if (a.type == 'resize') exp.resize(a);
477
- else {
478
- exp.moveTo(a.left + a.dX, a.top + a.dY);
479
- if (a.type == 'image') exp.content.style.cursor = 'move';
480
- }
481
- }
482
- return false;
483
- },
484
-
485
- wrapperMouseHandler : function (e) {
486
- try {
487
- if (!e) e = window.event;
488
- var over = /mouseover/i.test(e.type);
489
- if (!e.target) e.target = e.srcElement; // ie
490
- if (!e.relatedTarget) e.relatedTarget =
491
- over ? e.fromElement : e.toElement; // ie
492
- var exp = hs.getExpander(e.target);
493
- if (!exp.isExpanded) return;
494
- if (!exp || !e.relatedTarget || hs.getExpander(e.relatedTarget, true) == exp
495
- || hs.dragArgs) return;
496
- for (var i = 0; i < exp.overlays.length; i++) (function() {
497
- var o = hs.$('hsId'+ exp.overlays[i]);
498
- if (o && o.hideOnMouseOut) {
499
- if (over) hs.setStyles(o, { visibility: 'visible', display: '' });
500
- hs.animate(o, { opacity: over ? o.opacity : 0 }, o.dur);
501
- }
502
- })();
503
- } catch (e) {}
504
- },
505
- addEventListener : function (el, event, func) {
506
- if (el == document && event == 'ready') {
507
- hs.push(hs.onReady, func);
508
- }
509
- try {
510
- el.addEventListener(event, func, false);
511
- } catch (e) {
512
- try {
513
- el.detachEvent('on'+ event, func);
514
- el.attachEvent('on'+ event, func);
515
- } catch (e) {
516
- el['on'+ event] = func;
517
- }
518
- }
519
- },
520
-
521
- removeEventListener : function (el, event, func) {
522
- try {
523
- el.removeEventListener(event, func, false);
524
- } catch (e) {
525
- try {
526
- el.detachEvent('on'+ event, func);
527
- } catch (e) {
528
- el['on'+ event] = null;
529
- }
530
- }
531
- },
532
-
533
- preloadFullImage : function (i) {
534
- if (hs.continuePreloading && hs.preloadTheseImages[i] && hs.preloadTheseImages[i] != 'undefined') {
535
- var img = document.createElement('img');
536
- img.onload = function() {
537
- img = null;
538
- hs.preloadFullImage(i + 1);
539
- };
540
- img.src = hs.preloadTheseImages[i];
541
- }
542
- },
543
- preloadImages : function (number) {
544
- if (number && typeof number != 'object') hs.numberOfImagesToPreload = number;
545
-
546
- var arr = hs.getAnchors();
547
- for (var i = 0; i < arr.images.length && i < hs.numberOfImagesToPreload; i++) {
548
- hs.push(hs.preloadTheseImages, hs.getSrc(arr.images[i]));
549
- }
550
-
551
- // preload outlines
552
- if (hs.outlineType) new hs.Outline(hs.outlineType, function () { hs.preloadFullImage(0)} );
553
- else
554
-
555
- hs.preloadFullImage(0);
556
-
557
- // preload cursor
558
- if (hs.restoreCursor) var cur = hs.createElement('img', { src: hs.graphicsDir + hs.restoreCursor });
559
- },
560
-
561
-
562
- init : function () {
563
- if (!hs.container) {
564
-
565
- hs.ieLt7 = hs.ie && hs.uaVersion < 7;
566
- hs.ieLt9 = hs.ie && hs.uaVersion < 9;
567
-
568
- hs.getPageSize();
569
- for (var x in hs.langDefaults) {
570
- if (typeof hs[x] != 'undefined') hs.lang[x] = hs[x];
571
- else if (typeof hs.lang[x] == 'undefined' && typeof hs.langDefaults[x] != 'undefined')
572
- hs.lang[x] = hs.langDefaults[x];
573
- }
574
-
575
- hs.container = hs.createElement('div', {
576
- className: 'highslide-container'
577
- }, {
578
- position: 'absolute',
579
- left: 0,
580
- top: 0,
581
- width: '100%',
582
- zIndex: hs.zIndexCounter,
583
- direction: 'ltr'
584
- },
585
- document.body,
586
- true
587
- );
588
- hs.loading = hs.createElement('a', {
589
- className: 'highslide-loading',
590
- title: hs.lang.loadingTitle,
591
- innerHTML: hs.lang.loadingText,
592
- href: 'javascript:;'
593
- }, {
594
- position: 'absolute',
595
- top: '-9999px',
596
- opacity: hs.loadingOpacity,
597
- zIndex: 1
598
- }, hs.container
599
- );
600
- hs.garbageBin = hs.createElement('div', null, { display: 'none' }, hs.container);
601
-
602
- // http://www.robertpenner.com/easing/
603
- Math.linearTween = function (t, b, c, d) {
604
- return c*t/d + b;
605
- };
606
- Math.easeInQuad = function (t, b, c, d) {
607
- return c*(t/=d)*t + b;
608
- };
609
-
610
- hs.hideSelects = hs.ieLt7;
611
- hs.hideIframes = ((window.opera && hs.uaVersion < 9) || navigator.vendor == 'KDE'
612
- || (hs.ieLt7 && hs.uaVersion < 5.5));
613
- }
614
- },
615
- ready : function() {
616
- if (hs.isReady) return;
617
- hs.isReady = true;
618
- for (var i = 0; i < hs.onReady.length; i++) hs.onReady[i]();
619
- },
620
-
621
- updateAnchors : function() {
622
- var el, els, all = [], images = [],groups = {}, re;
623
-
624
- for (var i = 0; i < hs.openerTagNames.length; i++) {
625
- els = document.getElementsByTagName(hs.openerTagNames[i]);
626
- for (var j = 0; j < els.length; j++) {
627
- el = els[j];
628
- re = hs.isHsAnchor(el);
629
- if (re) {
630
- hs.push(all, el);
631
- if (re[0] == 'hs.expand') hs.push(images, el);
632
- var g = hs.getParam(el, 'slideshowGroup') || 'none';
633
- if (!groups[g]) groups[g] = [];
634
- hs.push(groups[g], el);
635
- }
636
- }
637
- }
638
- hs.anchors = { all: all, groups: groups, images: images };
639
- return hs.anchors;
640
-
641
- },
642
-
643
- getAnchors : function() {
644
- return hs.anchors || hs.updateAnchors();
645
- },
646
-
647
-
648
- close : function(el) {
649
- var exp = hs.getExpander(el);
650
- if (exp) exp.close();
651
- return false;
652
- }
653
- }; // end hs object
654
- hs.fx = function( elem, options, prop ){
655
- this.options = options;
656
- this.elem = elem;
657
- this.prop = prop;
658
-
659
- if (!options.orig) options.orig = {};
660
- };
661
- hs.fx.prototype = {
662
- update: function(){
663
- (hs.fx.step[this.prop] || hs.fx.step._default)(this);
664
-
665
- if (this.options.step)
666
- this.options.step.call(this.elem, this.now, this);
667
-
668
- },
669
- custom: function(from, to, unit){
670
- this.startTime = (new Date()).getTime();
671
- this.start = from;
672
- this.end = to;
673
- this.unit = unit;// || this.unit || "px";
674
- this.now = this.start;
675
- this.pos = this.state = 0;
676
-
677
- var self = this;
678
- function t(gotoEnd){
679
- return self.step(gotoEnd);
680
- }
681
-
682
- t.elem = this.elem;
683
-
684
- if ( t() && hs.timers.push(t) == 1 ) {
685
- hs.timerId = setInterval(function(){
686
- var timers = hs.timers;
687
-
688
- for ( var i = 0; i < timers.length; i++ )
689
- if ( !timers[i]() )
690
- timers.splice(i--, 1);
691
-
692
- if ( !timers.length ) {
693
- clearInterval(hs.timerId);
694
- }
695
- }, 13);
696
- }
697
- },
698
- step: function(gotoEnd){
699
- var t = (new Date()).getTime();
700
- if ( gotoEnd || t >= this.options.duration + this.startTime ) {
701
- this.now = this.end;
702
- this.pos = this.state = 1;
703
- this.update();
704
-
705
- this.options.curAnim[ this.prop ] = true;
706
-
707
- var done = true;
708
- for ( var i in this.options.curAnim )
709
- if ( this.options.curAnim[i] !== true )
710
- done = false;
711
-
712
- if ( done ) {
713
- if (this.options.complete) this.options.complete.call(this.elem);
714
- }
715
- return false;
716
- } else {
717
- var n = t - this.startTime;
718
- this.state = n / this.options.duration;
719
- this.pos = this.options.easing(n, 0, 1, this.options.duration);
720
- this.now = this.start + ((this.end - this.start) * this.pos);
721
- this.update();
722
- }
723
- return true;
724
- }
725
-
726
- };
727
-
728
- hs.extend( hs.fx, {
729
- step: {
730
-
731
- opacity: function(fx){
732
- hs.setStyles(fx.elem, { opacity: fx.now });
733
- },
734
-
735
- _default: function(fx){
736
- try {
737
- if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
738
- fx.elem.style[ fx.prop ] = fx.now + fx.unit;
739
- else
740
- fx.elem[ fx.prop ] = fx.now;
741
- } catch (e) {}
742
- }
743
- }
744
- });
745
-
746
- hs.Outline = function (outlineType, onLoad) {
747
- this.onLoad = onLoad;
748
- this.outlineType = outlineType;
749
- var v = hs.uaVersion, tr;
750
-
751
- this.hasAlphaImageLoader = hs.ie && hs.uaVersion < 7;
752
- if (!outlineType) {
753
- if (onLoad) onLoad();
754
- return;
755
- }
756
-
757
- hs.init();
758
- this.table = hs.createElement(
759
- 'table', {
760
- cellSpacing: 0
761
- }, {
762
- visibility: 'hidden',
763
- position: 'absolute',
764
- borderCollapse: 'collapse',
765
- width: 0
766
- },
767
- hs.container,
768
- true
769
- );
770
- var tbody = hs.createElement('tbody', null, null, this.table, 1);
771
-
772
- this.td = [];
773
- for (var i = 0; i <= 8; i++) {
774
- if (i % 3 == 0) tr = hs.createElement('tr', null, { height: 'auto' }, tbody, true);
775
- this.td[i] = hs.createElement('td', null, null, tr, true);
776
- var style = i != 4 ? { lineHeight: 0, fontSize: 0} : { position : 'relative' };
777
- hs.setStyles(this.td[i], style);
778
- }
779
- this.td[4].className = outlineType +' highslide-outline';
780
-
781
- this.preloadGraphic();
782
- };
783
-
784
- hs.Outline.prototype = {
785
- preloadGraphic : function () {
786
- var src = hs.graphicsDir + (hs.outlinesDir || "outlines/")+ this.outlineType +".png";
787
-
788
- var appendTo = hs.safari && hs.uaVersion < 525 ? hs.container : null;
789
- this.graphic = hs.createElement('img', null, { position: 'absolute',
790
- top: '-9999px' }, appendTo, true); // for onload trigger
791
-
792
- var pThis = this;
793
- this.graphic.onload = function() { pThis.onGraphicLoad(); };
794
-
795
- this.graphic.src = src;
796
- },
797
-
798
- onGraphicLoad : function () {
799
- var o = this.offset = this.graphic.width / 4,
800
- pos = [[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],
801
- dim = { height: (2*o) +'px', width: (2*o) +'px' };
802
- for (var i = 0; i <= 8; i++) {
803
- if (pos[i]) {
804
- if (this.hasAlphaImageLoader) {
805
- var w = (i == 1 || i == 7) ? '100%' : this.graphic.width +'px';
806
- var div = hs.createElement('div', null, { width: '100%', height: '100%', position: 'relative', overflow: 'hidden'}, this.td[i], true);
807
- hs.createElement ('div', null, {
808
- filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+ this.graphic.src + "')",
809
- position: 'absolute',
810
- width: w,
811
- height: this.graphic.height +'px',
812
- left: (pos[i][0]*o)+'px',
813
- top: (pos[i][1]*o)+'px'
814
- },
815
- div,
816
- true);
817
- } else {
818
- hs.setStyles(this.td[i], { background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'});
819
- }
820
-
821
- if (window.opera && (i == 3 || i ==5))
822
- hs.createElement('div', null, dim, this.td[i], true);
823
-
824
- hs.setStyles (this.td[i], dim);
825
- }
826
- }
827
- this.graphic = null;
828
- if (hs.pendingOutlines[this.outlineType]) hs.pendingOutlines[this.outlineType].destroy();
829
- hs.pendingOutlines[this.outlineType] = this;
830
- if (this.onLoad) this.onLoad();
831
- },
832
-
833
- setPosition : function (pos, offset, vis, dur, easing) {
834
- var exp = this.exp,
835
- stl = exp.wrapper.style,
836
- offset = offset || 0,
837
- pos = pos || {
838
- x: exp.x.pos + offset,
839
- y: exp.y.pos + offset,
840
- w: exp.x.get('wsize') - 2 * offset,
841
- h: exp.y.get('wsize') - 2 * offset
842
- };
843
- if (vis) this.table.style.visibility = (pos.h >= 4 * this.offset)
844
- ? 'visible' : 'hidden';
845
- hs.setStyles(this.table, {
846
- left: (pos.x - this.offset) +'px',
847
- top: (pos.y - this.offset) +'px',
848
- width: (pos.w + 2 * this.offset) +'px'
849
- });
850
-
851
- pos.w -= 2 * this.offset;
852
- pos.h -= 2 * this.offset;
853
- hs.setStyles (this.td[4], {
854
- width: pos.w >= 0 ? pos.w +'px' : 0,
855
- height: pos.h >= 0 ? pos.h +'px' : 0
856
- });
857
- if (this.hasAlphaImageLoader) this.td[3].style.height
858
- = this.td[5].style.height = this.td[4].style.height;
859
-
860
- },
861
-
862
- destroy : function(hide) {
863
- if (hide) this.table.style.visibility = 'hidden';
864
- else hs.discardElement(this.table);
865
- }
866
- };
867
-
868
- hs.Dimension = function(exp, dim) {
869
- this.exp = exp;
870
- this.dim = dim;
871
- this.ucwh = dim == 'x' ? 'Width' : 'Height';
872
- this.wh = this.ucwh.toLowerCase();
873
- this.uclt = dim == 'x' ? 'Left' : 'Top';
874
- this.lt = this.uclt.toLowerCase();
875
- this.ucrb = dim == 'x' ? 'Right' : 'Bottom';
876
- this.rb = this.ucrb.toLowerCase();
877
- this.p1 = this.p2 = 0;
878
- };
879
- hs.Dimension.prototype = {
880
- get : function(key) {
881
- switch (key) {
882
- case 'loadingPos':
883
- return this.tpos + this.tb + (this.t - hs.loading['offset'+ this.ucwh]) / 2;
884
- case 'wsize':
885
- return this.size + 2 * this.cb + this.p1 + this.p2;
886
- case 'fitsize':
887
- return this.clientSize - this.marginMin - this.marginMax;
888
- case 'maxsize':
889
- return this.get('fitsize') - 2 * this.cb - this.p1 - this.p2 ;
890
- case 'opos':
891
- return this.pos - (this.exp.outline ? this.exp.outline.offset : 0);
892
- case 'osize':
893
- return this.get('wsize') + (this.exp.outline ? 2*this.exp.outline.offset : 0);
894
- case 'imgPad':
895
- return this.imgSize ? Math.round((this.size - this.imgSize) / 2) : 0;
896
-
897
- }
898
- },
899
- calcBorders: function() {
900
- // correct for borders
901
- this.cb = (this.exp.content['offset'+ this.ucwh] - this.t) / 2;
902
-
903
- this.marginMax = hs['margin'+ this.ucrb];
904
- },
905
- calcThumb: function() {
906
- this.t = this.exp.el[this.wh] ? parseInt(this.exp.el[this.wh]) :
907
- this.exp.el['offset'+ this.ucwh];
908
- this.tpos = this.exp.tpos[this.dim];
909
- this.tb = (this.exp.el['offset'+ this.ucwh] - this.t) / 2;
910
- if (this.tpos == 0 || this.tpos == -1) {
911
- this.tpos = (hs.page[this.wh] / 2) + hs.page['scroll'+ this.uclt];
912
- };
913
- },
914
- calcExpanded: function() {
915
- var exp = this.exp;
916
- this.justify = 'auto';
917
-
918
-
919
- // size and position
920
- this.pos = this.tpos - this.cb + this.tb;
921
-
922
- if (this.maxHeight && this.dim == 'x')
923
- exp.maxWidth = Math.min(exp.maxWidth || this.full, exp.maxHeight * this.full / exp.y.full);
924
-
925
- this.size = Math.min(this.full, exp['max'+ this.ucwh] || this.full);
926
- this.minSize = exp.allowSizeReduction ?
927
- Math.min(exp['min'+ this.ucwh], this.full) :this.full;
928
- if (exp.isImage && exp.useBox) {
929
- this.size = exp[this.wh];
930
- this.imgSize = this.full;
931
- }
932
- if (this.dim == 'x' && hs.padToMinWidth) this.minSize = exp.minWidth;
933
- this.marginMin = hs['margin'+ this.uclt];
934
- this.scroll = hs.page['scroll'+ this.uclt];
935
- this.clientSize = hs.page[this.wh];
936
- },
937
- setSize: function(i) {
938
- var exp = this.exp;
939
- if (exp.isImage && (exp.useBox || hs.padToMinWidth)) {
940
- this.imgSize = i;
941
- this.size = Math.max(this.size, this.imgSize);
942
- exp.content.style[this.lt] = this.get('imgPad')+'px';
943
- } else
944
- this.size = i;
945
-
946
- exp.content.style[this.wh] = i +'px';
947
- exp.wrapper.style[this.wh] = this.get('wsize') +'px';
948
- if (exp.outline) exp.outline.setPosition();
949
- if (this.dim == 'x' && exp.overlayBox) exp.sizeOverlayBox(true);
950
- },
951
- setPos: function(i) {
952
- this.pos = i;
953
- this.exp.wrapper.style[this.lt] = i +'px';
954
-
955
- if (this.exp.outline) this.exp.outline.setPosition();
956
-
957
- }
958
- };
959
-
960
- hs.Expander = function(a, params, custom, contentType) {
961
- if (document.readyState && hs.ie && !hs.isReady) {
962
- hs.addEventListener(document, 'ready', function() {
963
- new hs.Expander(a, params, custom, contentType);
964
- });
965
- return;
966
- }
967
- this.a = a;
968
- this.custom = custom;
969
- this.contentType = contentType || 'image';
970
- this.isImage = !this.isHtml;
971
-
972
- hs.continuePreloading = false;
973
- this.overlays = [];
974
- hs.init();
975
- var key = this.key = hs.expanders.length;
976
- // override inline parameters
977
- for (var i = 0; i < hs.overrides.length; i++) {
978
- var name = hs.overrides[i];
979
- this[name] = params && typeof params[name] != 'undefined' ?
980
- params[name] : hs[name];
981
- }
982
- if (!this.src) this.src = a.href;
983
-
984
- // get thumb
985
- var el = (params && params.thumbnailId) ? hs.$(params.thumbnailId) : a;
986
- el = this.thumb = el.getElementsByTagName('img')[0] || el;
987
- this.thumbsUserSetId = el.id || a.id;
988
-
989
- // check if already open
990
- for (var i = 0; i < hs.expanders.length; i++) {
991
- if (hs.expanders[i] && hs.expanders[i].a == a) {
992
- hs.expanders[i].focus();
993
- return false;
994
- }
995
- }
996
-
997
- // cancel other
998
- if (!hs.allowSimultaneousLoading) for (var i = 0; i < hs.expanders.length; i++) {
999
- if (hs.expanders[i] && hs.expanders[i].thumb != el && !hs.expanders[i].onLoadStarted) {
1000
- hs.expanders[i].cancelLoading();
1001
- }
1002
- }
1003
- hs.expanders[key] = this;
1004
- if (!hs.allowMultipleInstances && !hs.upcoming) {
1005
- if (hs.expanders[key-1]) hs.expanders[key-1].close();
1006
- if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey])
1007
- hs.expanders[hs.focusKey].close();
1008
- }
1009
-
1010
- // initiate metrics
1011
- this.el = el;
1012
- this.tpos = this.pageOrigin || hs.getPosition(el);
1013
- hs.getPageSize();
1014
- var x = this.x = new hs.Dimension(this, 'x');
1015
- x.calcThumb();
1016
- var y = this.y = new hs.Dimension(this, 'y');
1017
- y.calcThumb();
1018
- this.wrapper = hs.createElement(
1019
- 'div', {
1020
- id: 'highslide-wrapper-'+ this.key,
1021
- className: 'highslide-wrapper '+ this.wrapperClassName
1022
- }, {
1023
- visibility: 'hidden',
1024
- position: 'absolute',
1025
- zIndex: hs.zIndexCounter += 2
1026
- }, null, true );
1027
-
1028
- this.wrapper.onmouseover = this.wrapper.onmouseout = hs.wrapperMouseHandler;
1029
- if (this.contentType == 'image' && this.outlineWhileAnimating == 2)
1030
- this.outlineWhileAnimating = 0;
1031
-
1032
- // get the outline
1033
- if (!this.outlineType) {
1034
- this[this.contentType +'Create']();
1035
-
1036
- } else if (hs.pendingOutlines[this.outlineType]) {
1037
- this.connectOutline();
1038
- this[this.contentType +'Create']();
1039
-
1040
- } else {
1041
- this.showLoading();
1042
- var exp = this;
1043
- new hs.Outline(this.outlineType,
1044
- function () {
1045
- exp.connectOutline();
1046
- exp[exp.contentType +'Create']();
1047
- }
1048
- );
1049
- }
1050
- return true;
1051
- };
1052
-
1053
- hs.Expander.prototype = {
1054
- error : function(e) {
1055
- if (hs.debug) alert ('Line '+ e.lineNumber +': '+ e.message);
1056
- else window.location.href = this.src;
1057
- },
1058
-
1059
- connectOutline : function() {
1060
- var outline = this.outline = hs.pendingOutlines[this.outlineType];
1061
- outline.exp = this;
1062
- outline.table.style.zIndex = this.wrapper.style.zIndex - 1;
1063
- hs.pendingOutlines[this.outlineType] = null;
1064
- },
1065
-
1066
- showLoading : function() {
1067
- if (this.onLoadStarted || this.loading) return;
1068
-
1069
- this.loading = hs.loading;
1070
- var exp = this;
1071
- this.loading.onclick = function() {
1072
- exp.cancelLoading();
1073
- };
1074
- var exp = this,
1075
- l = this.x.get('loadingPos') +'px',
1076
- t = this.y.get('loadingPos') +'px';
1077
- setTimeout(function () {
1078
- if (exp.loading) hs.setStyles(exp.loading, { left: l, top: t, zIndex: hs.zIndexCounter++ })}
1079
- , 100);
1080
- },
1081
-
1082
- imageCreate : function() {
1083
- var exp = this;
1084
-
1085
- var img = document.createElement('img');
1086
- this.content = img;
1087
- img.onload = function () {
1088
- if (hs.expanders[exp.key]) exp.contentLoaded();
1089
- };
1090
- if (hs.blockRightClick) img.oncontextmenu = function() { return false; };
1091
- img.className = 'highslide-image';
1092
- hs.setStyles(img, {
1093
- visibility: 'hidden',
1094
- display: 'block',
1095
- position: 'absolute',
1096
- maxWidth: '9999px',
1097
- zIndex: 3
1098
- });
1099
- img.title = hs.lang.restoreTitle;
1100
- if (hs.safari && hs.uaVersion < 525) hs.container.appendChild(img);
1101
- if (hs.ie && hs.flushImgSize) img.src = null;
1102
- img.src = this.src;
1103
-
1104
- this.showLoading();
1105
- },
1106
-
1107
- contentLoaded : function() {
1108
- try {
1109
- if (!this.content) return;
1110
- this.content.onload = null;
1111
- if (this.onLoadStarted) return;
1112
- else this.onLoadStarted = true;
1113
-
1114
- var x = this.x, y = this.y;
1115
-
1116
- if (this.loading) {
1117
- hs.setStyles(this.loading, { top: '-9999px' });
1118
- this.loading = null;
1119
- }
1120
- x.full = this.content.width;
1121
- y.full = this.content.height;
1122
-
1123
- hs.setStyles(this.content, {
1124
- width: x.t +'px',
1125
- height: y.t +'px'
1126
- });
1127
- this.wrapper.appendChild(this.content);
1128
- hs.container.appendChild(this.wrapper);
1129
-
1130
- x.calcBorders();
1131
- y.calcBorders();
1132
-
1133
- hs.setStyles (this.wrapper, {
1134
- left: (x.tpos + x.tb - x.cb) +'px',
1135
- top: (y.tpos + x.tb - y.cb) +'px'
1136
- });
1137
- this.getOverlays();
1138
-
1139
- var ratio = x.full / y.full;
1140
- x.calcExpanded();
1141
- this.justify(x);
1142
-
1143
- y.calcExpanded();
1144
- this.justify(y);
1145
- if (this.overlayBox) this.sizeOverlayBox(0, 1);
1146
-
1147
-
1148
- if (this.allowSizeReduction) {
1149
- this.correctRatio(ratio);
1150
- if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) {
1151
- this.createFullExpand();
1152
- if (this.overlays.length == 1) this.sizeOverlayBox();
1153
- }
1154
- }
1155
- this.show();
1156
-
1157
- } catch (e) {
1158
- this.error(e);
1159
- }
1160
- },
1161
-
1162
- justify : function (p, moveOnly) {
1163
- var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
1164
-
1165
- var hasMovedMin = false;
1166
-
1167
- var allowReduce = p.exp.allowSizeReduction;
1168
- p.pos = Math.round(p.pos - ((p.get('wsize') - p.t) / 2));
1169
- if (p.pos < p.scroll + p.marginMin) {
1170
- p.pos = p.scroll + p.marginMin;
1171
- hasMovedMin = true;
1172
- }
1173
- if (!moveOnly && p.size < p.minSize) {
1174
- p.size = p.minSize;
1175
- allowReduce = false;
1176
- }
1177
- if (p.pos + p.get('wsize') > p.scroll + p.clientSize - p.marginMax) {
1178
- if (!moveOnly && hasMovedMin && allowReduce) {
1179
- p.size = Math.min(p.size, p.get(dim == 'y' ? 'fitsize' : 'maxsize'));
1180
- } else if (p.get('wsize') < p.get('fitsize')) {
1181
- p.pos = p.scroll + p.clientSize - p.marginMax - p.get('wsize');
1182
- } else { // image larger than viewport
1183
- p.pos = p.scroll + p.marginMin;
1184
- if (!moveOnly && allowReduce) p.size = p.get(dim == 'y' ? 'fitsize' : 'maxsize');
1185
- }
1186
- }
1187
-
1188
- if (!moveOnly && p.size < p.minSize) {
1189
- p.size = p.minSize;
1190
- allowReduce = false;
1191
- }
1192
-
1193
-
1194
-
1195
- if (p.pos < p.marginMin) {
1196
- var tmpMin = p.pos;
1197
- p.pos = p.marginMin;
1198
-
1199
- if (allowReduce && !moveOnly) p.size = p.size - (p.pos - tmpMin);
1200
-
1201
- }
1202
- },
1203
-
1204
- correctRatio : function(ratio) {
1205
- var x = this.x,
1206
- y = this.y,
1207
- changed = false,
1208
- xSize = Math.min(x.full, x.size),
1209
- ySize = Math.min(y.full, y.size),
1210
- useBox = (this.useBox || hs.padToMinWidth);
1211
-
1212
- if (xSize / ySize > ratio) { // width greater
1213
- xSize = ySize * ratio;
1214
- if (xSize < x.minSize) { // below minWidth
1215
- xSize = x.minSize;
1216
- ySize = xSize / ratio;
1217
- }
1218
- changed = true;
1219
-
1220
- } else if (xSize / ySize < ratio) { // height greater
1221
- ySize = xSize / ratio;
1222
- changed = true;
1223
- }
1224
-
1225
- if (hs.padToMinWidth && x.full < x.minSize) {
1226
- x.imgSize = x.full;
1227
- y.size = y.imgSize = y.full;
1228
- } else if (this.useBox) {
1229
- x.imgSize = xSize;
1230
- y.imgSize = ySize;
1231
- } else {
1232
- x.size = xSize;
1233
- y.size = ySize;
1234
- }
1235
- changed = this.fitOverlayBox(this.useBox ? null : ratio, changed);
1236
- if (useBox && y.size < y.imgSize) {
1237
- y.imgSize = y.size;
1238
- x.imgSize = y.size * ratio;
1239
- }
1240
- if (changed || useBox) {
1241
- x.pos = x.tpos - x.cb + x.tb;
1242
- x.minSize = x.size;
1243
- this.justify(x, true);
1244
-
1245
- y.pos = y.tpos - y.cb + y.tb;
1246
- y.minSize = y.size;
1247
- this.justify(y, true);
1248
- if (this.overlayBox) this.sizeOverlayBox();
1249
- }
1250
-
1251
-
1252
- },
1253
- fitOverlayBox : function(ratio, changed) {
1254
- var x = this.x, y = this.y;
1255
- if (this.overlayBox) {
1256
- while (y.size > this.minHeight && x.size > this.minWidth
1257
- && y.get('wsize') > y.get('fitsize')) {
1258
- y.size -= 10;
1259
- if (ratio) x.size = y.size * ratio;
1260
- this.sizeOverlayBox(0, 1);
1261
- changed = true;
1262
- }
1263
- }
1264
- return changed;
1265
- },
1266
-
1267
- show : function () {
1268
- var x = this.x, y = this.y;
1269
- this.doShowHide('hidden');
1270
-
1271
- // Apply size change
1272
- this.changeSize(
1273
- 1, {
1274
- wrapper: {
1275
- width : x.get('wsize'),
1276
- height : y.get('wsize'),
1277
- left: x.pos,
1278
- top: y.pos
1279
- },
1280
- content: {
1281
- left: x.p1 + x.get('imgPad'),
1282
- top: y.p1 + y.get('imgPad'),
1283
- width:x.imgSize ||x.size,
1284
- height:y.imgSize ||y.size
1285
- }
1286
- },
1287
- hs.expandDuration
1288
- );
1289
- },
1290
-
1291
- changeSize : function(up, to, dur) {
1292
-
1293
- if (this.outline && !this.outlineWhileAnimating) {
1294
- if (up) this.outline.setPosition();
1295
- else this.outline.destroy();
1296
- }
1297
-
1298
-
1299
- if (!up) this.destroyOverlays();
1300
-
1301
- var exp = this,
1302
- x = exp.x,
1303
- y = exp.y,
1304
- easing = this.easing;
1305
- if (!up) easing = this.easingClose || easing;
1306
- var after = up ?
1307
- function() {
1308
-
1309
- if (exp.outline) exp.outline.table.style.visibility = "visible";
1310
- setTimeout(function() {
1311
- exp.afterExpand();
1312
- }, 50);
1313
- } :
1314
- function() {
1315
- exp.afterClose();
1316
- };
1317
- if (up) hs.setStyles( this.wrapper, {
1318
- width: x.t +'px',
1319
- height: y.t +'px'
1320
- });
1321
- if (this.fadeInOut) {
1322
- hs.setStyles(this.wrapper, { opacity: up ? 0 : 1 });
1323
- hs.extend(to.wrapper, { opacity: up });
1324
- }
1325
- hs.animate( this.wrapper, to.wrapper, {
1326
- duration: dur,
1327
- easing: easing,
1328
- step: function(val, args) {
1329
- if (exp.outline && exp.outlineWhileAnimating && args.prop == 'top') {
1330
- var fac = up ? args.pos : 1 - args.pos;
1331
- var pos = {
1332
- w: x.t + (x.get('wsize') - x.t) * fac,
1333
- h: y.t + (y.get('wsize') - y.t) * fac,
1334
- x: x.tpos + (x.pos - x.tpos) * fac,
1335
- y: y.tpos + (y.pos - y.tpos) * fac
1336
- };
1337
- exp.outline.setPosition(pos, 0, 1);
1338
- }
1339
- }
1340
- });
1341
- hs.animate( this.content, to.content, dur, easing, after);
1342
- if (up) {
1343
- this.wrapper.style.visibility = 'visible';
1344
- this.content.style.visibility = 'visible';
1345
- this.a.className += ' highslide-active-anchor';
1346
- }
1347
- },
1348
-
1349
-
1350
-
1351
-
1352
- afterExpand : function() {
1353
- this.isExpanded = true;
1354
- this.focus();
1355
- if (hs.upcoming && hs.upcoming == this.a) hs.upcoming = null;
1356
- this.prepareNextOutline();
1357
- var p = hs.page, mX = hs.mouse.x + p.scrollLeft, mY = hs.mouse.y + p.scrollTop;
1358
- this.mouseIsOver = this.x.pos < mX && mX < this.x.pos + this.x.get('wsize')
1359
- && this.y.pos < mY && mY < this.y.pos + this.y.get('wsize');
1360
- if (this.overlayBox) this.showOverlays();
1361
-
1362
- },
1363
-
1364
-
1365
- prepareNextOutline : function() {
1366
- var key = this.key;
1367
- var outlineType = this.outlineType;
1368
- new hs.Outline(outlineType,
1369
- function () { try { hs.expanders[key].preloadNext(); } catch (e) {} });
1370
- },
1371
-
1372
-
1373
- preloadNext : function() {
1374
- var next = this.getAdjacentAnchor(1);
1375
- if (next && next.onclick.toString().match(/hs\.expand/))
1376
- var img = hs.createElement('img', { src: hs.getSrc(next) });
1377
- },
1378
-
1379
-
1380
- getAdjacentAnchor : function(op) {
1381
- var current = this.getAnchorIndex(), as = hs.anchors.groups[this.slideshowGroup || 'none'];
1382
- return (as && as[current + op]) || null;
1383
- },
1384
-
1385
- getAnchorIndex : function() {
1386
- var arr = hs.getAnchors().groups[this.slideshowGroup || 'none'];
1387
- if (arr) for (var i = 0; i < arr.length; i++) {
1388
- if (arr[i] == this.a) return i;
1389
- }
1390
- return null;
1391
- },
1392
-
1393
-
1394
- cancelLoading : function() {
1395
- hs.discardElement (this.wrapper);
1396
- hs.expanders[this.key] = null;
1397
- if (this.loading) hs.loading.style.left = '-9999px';
1398
- },
1399
-
1400
- writeCredits : function () {
1401
- this.credits = hs.createElement('a', {
1402
- href: hs.creditsHref,
1403
- target: hs.creditsTarget,
1404
- className: 'highslide-credits',
1405
- innerHTML: hs.lang.creditsText,
1406
- title: hs.lang.creditsTitle
1407
- });
1408
- this.createOverlay({
1409
- overlayId: this.credits,
1410
- position: this.creditsPosition || 'top left'
1411
- });
1412
- },
1413
-
1414
- getInline : function(types, addOverlay) {
1415
- for (var i = 0; i < types.length; i++) {
1416
- var type = types[i], s = null;
1417
- if (!this[type +'Id'] && this.thumbsUserSetId)
1418
- this[type +'Id'] = type +'-for-'+ this.thumbsUserSetId;
1419
- if (this[type +'Id']) this[type] = hs.getNode(this[type +'Id']);
1420
- if (!this[type] && !this[type +'Text'] && this[type +'Eval']) try {
1421
- s = eval(this[type +'Eval']);
1422
- } catch (e) {}
1423
- if (!this[type] && this[type +'Text']) {
1424
- s = this[type +'Text'];
1425
- }
1426
- if (!this[type] && !s) {
1427
- this[type] = hs.getNode(this.a['_'+ type + 'Id']);
1428
- if (!this[type]) {
1429
- var next = this.a.nextSibling;
1430
- while (next && !hs.isHsAnchor(next)) {
1431
- if ((new RegExp('highslide-'+ type)).test(next.className || null)) {
1432
- if (!next.id) this.a['_'+ type + 'Id'] = next.id = 'hsId'+ hs.idCounter++;
1433
- this[type] = hs.getNode(next.id);
1434
- break;
1435
- }
1436
- next = next.nextSibling;
1437
- }
1438
- }
1439
- }
1440
-
1441
- if (!this[type] && s) this[type] = hs.createElement('div',
1442
- { className: 'highslide-'+ type, innerHTML: s } );
1443
-
1444
- if (addOverlay && this[type]) {
1445
- var o = { position: (type == 'heading') ? 'above' : 'below' };
1446
- for (var x in this[type+'Overlay']) o[x] = this[type+'Overlay'][x];
1447
- o.overlayId = this[type];
1448
- this.createOverlay(o);
1449
- }
1450
- }
1451
- },
1452
-
1453
-
1454
- // on end move and resize
1455
- doShowHide : function(visibility) {
1456
- if (hs.hideSelects) this.showHideElements('SELECT', visibility);
1457
- if (hs.hideIframes) this.showHideElements('IFRAME', visibility);
1458
- if (hs.geckoMac) this.showHideElements('*', visibility);
1459
- },
1460
- showHideElements : function (tagName, visibility) {
1461
- var els = document.getElementsByTagName(tagName);
1462
- var prop = tagName == '*' ? 'overflow' : 'visibility';
1463
- for (var i = 0; i < els.length; i++) {
1464
- if (prop == 'visibility' || (document.defaultView.getComputedStyle(
1465
- els[i], "").getPropertyValue('overflow') == 'auto'
1466
- || els[i].getAttribute('hidden-by') != null)) {
1467
- var hiddenBy = els[i].getAttribute('hidden-by');
1468
- if (visibility == 'visible' && hiddenBy) {
1469
- hiddenBy = hiddenBy.replace('['+ this.key +']', '');
1470
- els[i].setAttribute('hidden-by', hiddenBy);
1471
- if (!hiddenBy) els[i].style[prop] = els[i].origProp;
1472
- } else if (visibility == 'hidden') { // hide if behind
1473
- var elPos = hs.getPosition(els[i]);
1474
- elPos.w = els[i].offsetWidth;
1475
- elPos.h = els[i].offsetHeight;
1476
-
1477
-
1478
- var clearsX = (elPos.x + elPos.w < this.x.get('opos')
1479
- || elPos.x > this.x.get('opos') + this.x.get('osize'));
1480
- var clearsY = (elPos.y + elPos.h < this.y.get('opos')
1481
- || elPos.y > this.y.get('opos') + this.y.get('osize'));
1482
- var wrapperKey = hs.getWrapperKey(els[i]);
1483
- if (!clearsX && !clearsY && wrapperKey != this.key) { // element falls behind image
1484
- if (!hiddenBy) {
1485
- els[i].setAttribute('hidden-by', '['+ this.key +']');
1486
- els[i].origProp = els[i].style[prop];
1487
- els[i].style[prop] = 'hidden';
1488
-
1489
- } else if (hiddenBy.indexOf('['+ this.key +']') == -1) {
1490
- els[i].setAttribute('hidden-by', hiddenBy + '['+ this.key +']');
1491
- }
1492
- } else if ((hiddenBy == '['+ this.key +']' || hs.focusKey == wrapperKey)
1493
- && wrapperKey != this.key) { // on move
1494
- els[i].setAttribute('hidden-by', '');
1495
- els[i].style[prop] = els[i].origProp || '';
1496
- } else if (hiddenBy && hiddenBy.indexOf('['+ this.key +']') > -1) {
1497
- els[i].setAttribute('hidden-by', hiddenBy.replace('['+ this.key +']', ''));
1498
- }
1499
-
1500
- }
1501
- }
1502
- }
1503
- },
1504
-
1505
- focus : function() {
1506
- this.wrapper.style.zIndex = hs.zIndexCounter += 2;
1507
- // blur others
1508
- for (var i = 0; i < hs.expanders.length; i++) {
1509
- if (hs.expanders[i] && i == hs.focusKey) {
1510
- var blurExp = hs.expanders[i];
1511
- blurExp.content.className += ' highslide-'+ blurExp.contentType +'-blur';
1512
- blurExp.content.style.cursor = hs.ieLt7 ? 'hand' : 'pointer';
1513
- blurExp.content.title = hs.lang.focusTitle;
1514
- }
1515
- }
1516
-
1517
- // focus this
1518
- if (this.outline) this.outline.table.style.zIndex
1519
- = this.wrapper.style.zIndex - 1;
1520
- this.content.className = 'highslide-'+ this.contentType;
1521
- this.content.title = hs.lang.restoreTitle;
1522
-
1523
- if (hs.restoreCursor) {
1524
- hs.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ hs.graphicsDir + hs.restoreCursor +'), pointer';
1525
- if (hs.ieLt7 && hs.uaVersion < 6) hs.styleRestoreCursor = 'hand';
1526
- this.content.style.cursor = hs.styleRestoreCursor;
1527
- }
1528
-
1529
- hs.focusKey = this.key;
1530
- hs.addEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
1531
- },
1532
- moveTo: function(x, y) {
1533
- this.x.setPos(x);
1534
- this.y.setPos(y);
1535
- },
1536
- resize : function (e) {
1537
- var w, h, r = e.width / e.height;
1538
- w = Math.max(e.width + e.dX, Math.min(this.minWidth, this.x.full));
1539
- if (this.isImage && Math.abs(w - this.x.full) < 12) w = this.x.full;
1540
- h = w / r;
1541
- if (h < Math.min(this.minHeight, this.y.full)) {
1542
- h = Math.min(this.minHeight, this.y.full);
1543
- if (this.isImage) w = h * r;
1544
- }
1545
- this.resizeTo(w, h);
1546
- },
1547
- resizeTo: function(w, h) {
1548
- this.y.setSize(h);
1549
- this.x.setSize(w);
1550
- this.wrapper.style.height = this.y.get('wsize') +'px';
1551
- },
1552
-
1553
- close : function() {
1554
- if (this.isClosing || !this.isExpanded) return;
1555
- this.isClosing = true;
1556
-
1557
- hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
1558
-
1559
- try {
1560
- this.content.style.cursor = 'default';
1561
- this.changeSize(
1562
- 0, {
1563
- wrapper: {
1564
- width : this.x.t,
1565
- height : this.y.t,
1566
- left: this.x.tpos - this.x.cb + this.x.tb,
1567
- top: this.y.tpos - this.y.cb + this.y.tb
1568
- },
1569
- content: {
1570
- left: 0,
1571
- top: 0,
1572
- width: this.x.t,
1573
- height: this.y.t
1574
- }
1575
- }, hs.restoreDuration
1576
- );
1577
- } catch (e) { this.afterClose(); }
1578
- },
1579
-
1580
- createOverlay : function (o) {
1581
- var el = o.overlayId;
1582
- if (typeof el == 'string') el = hs.getNode(el);
1583
- if (o.html) el = hs.createElement('div', { innerHTML: o.html });
1584
- if (!el || typeof el == 'string') return;
1585
- el.style.display = 'block';
1586
- this.genOverlayBox();
1587
- var width = o.width && /^[0-9]+(px|%)$/.test(o.width) ? o.width : 'auto';
1588
- if (/^(left|right)panel$/.test(o.position) && !/^[0-9]+px$/.test(o.width)) width = '200px';
1589
- var overlay = hs.createElement(
1590
- 'div', {
1591
- id: 'hsId'+ hs.idCounter++,
1592
- hsId: o.hsId
1593
- }, {
1594
- position: 'absolute',
1595
- visibility: 'hidden',
1596
- width: width,
1597
- direction: hs.lang.cssDirection || '',
1598
- opacity: 0
1599
- },this.overlayBox,
1600
- true
1601
- );
1602
-
1603
- overlay.appendChild(el);
1604
- hs.extend(overlay, {
1605
- opacity: 1,
1606
- offsetX: 0,
1607
- offsetY: 0,
1608
- dur: (o.fade === 0 || o.fade === false || (o.fade == 2 && hs.ie)) ? 0 : 250
1609
- });
1610
- hs.extend(overlay, o);
1611
-
1612
-
1613
- if (this.gotOverlays) {
1614
- this.positionOverlay(overlay);
1615
- if (!overlay.hideOnMouseOut || this.mouseIsOver)
1616
- hs.animate(overlay, { opacity: overlay.opacity }, overlay.dur);
1617
- }
1618
- hs.push(this.overlays, hs.idCounter - 1);
1619
- },
1620
- positionOverlay : function(overlay) {
1621
- var p = overlay.position || 'middle center',
1622
- offX = overlay.offsetX,
1623
- offY = overlay.offsetY;
1624
- if (overlay.parentNode != this.overlayBox) this.overlayBox.appendChild(overlay);
1625
- if (/left$/.test(p)) overlay.style.left = offX +'px';
1626
-
1627
- if (/center$/.test(p)) hs.setStyles (overlay, {
1628
- left: '50%',
1629
- marginLeft: (offX - Math.round(overlay.offsetWidth / 2)) +'px'
1630
- });
1631
-
1632
- if (/right$/.test(p)) overlay.style.right = - offX +'px';
1633
-
1634
- if (/^leftpanel$/.test(p)) {
1635
- hs.setStyles(overlay, {
1636
- right: '100%',
1637
- marginRight: this.x.cb +'px',
1638
- top: - this.y.cb +'px',
1639
- bottom: - this.y.cb +'px',
1640
- overflow: 'auto'
1641
- });
1642
- this.x.p1 = overlay.offsetWidth;
1643
-
1644
- } else if (/^rightpanel$/.test(p)) {
1645
- hs.setStyles(overlay, {
1646
- left: '100%',
1647
- marginLeft: this.x.cb +'px',
1648
- top: - this.y.cb +'px',
1649
- bottom: - this.y.cb +'px',
1650
- overflow: 'auto'
1651
- });
1652
- this.x.p2 = overlay.offsetWidth;
1653
- }
1654
-
1655
- if (/^top/.test(p)) overlay.style.top = offY +'px';
1656
- if (/^middle/.test(p)) hs.setStyles (overlay, {
1657
- top: '50%',
1658
- marginTop: (offY - Math.round(overlay.offsetHeight / 2)) +'px'
1659
- });
1660
- if (/^bottom/.test(p)) overlay.style.bottom = - offY +'px';
1661
- if (/^above$/.test(p)) {
1662
- hs.setStyles(overlay, {
1663
- left: (- this.x.p1 - this.x.cb) +'px',
1664
- right: (- this.x.p2 - this.x.cb) +'px',
1665
- bottom: '100%',
1666
- marginBottom: this.y.cb +'px',
1667
- width: 'auto'
1668
- });
1669
- this.y.p1 = overlay.offsetHeight;
1670
-
1671
- } else if (/^below$/.test(p)) {
1672
- hs.setStyles(overlay, {
1673
- position: 'relative',
1674
- left: (- this.x.p1 - this.x.cb) +'px',
1675
- right: (- this.x.p2 - this.x.cb) +'px',
1676
- top: '100%',
1677
- marginTop: this.y.cb +'px',
1678
- width: 'auto'
1679
- });
1680
- this.y.p2 = overlay.offsetHeight;
1681
- overlay.style.position = 'absolute';
1682
- }
1683
- },
1684
-
1685
- getOverlays : function() {
1686
- this.getInline(['heading', 'caption'], true);
1687
- if (this.heading && this.dragByHeading) this.heading.className += ' highslide-move';
1688
- if (hs.showCredits) this.writeCredits();
1689
- for (var i = 0; i < hs.overlays.length; i++) {
1690
- var o = hs.overlays[i], tId = o.thumbnailId, sg = o.slideshowGroup;
1691
- if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
1692
- || (sg && sg === this.slideshowGroup)) {
1693
- this.createOverlay(o);
1694
- }
1695
- }
1696
- var os = [];
1697
- for (var i = 0; i < this.overlays.length; i++) {
1698
- var o = hs.$('hsId'+ this.overlays[i]);
1699
- if (/panel$/.test(o.position)) this.positionOverlay(o);
1700
- else hs.push(os, o);
1701
- }
1702
- for (var i = 0; i < os.length; i++) this.positionOverlay(os[i]);
1703
- this.gotOverlays = true;
1704
- },
1705
- genOverlayBox : function() {
1706
- if (!this.overlayBox) this.overlayBox = hs.createElement (
1707
- 'div', {
1708
- className: this.wrapperClassName
1709
- }, {
1710
- position : 'absolute',
1711
- width: (this.x.size || (this.useBox ? this.width : null)
1712
- || this.x.full) +'px',
1713
- height: (this.y.size || this.y.full) +'px',
1714
- visibility : 'hidden',
1715
- overflow : 'hidden',
1716
- zIndex : hs.ie ? 4 : 'auto'
1717
- },
1718
- hs.container,
1719
- true
1720
- );
1721
- },
1722
- sizeOverlayBox : function(doWrapper, doPanels) {
1723
- var overlayBox = this.overlayBox,
1724
- x = this.x,
1725
- y = this.y;
1726
- hs.setStyles( overlayBox, {
1727
- width: x.size +'px',
1728
- height: y.size +'px'
1729
- });
1730
- if (doWrapper || doPanels) {
1731
- for (var i = 0; i < this.overlays.length; i++) {
1732
- var o = hs.$('hsId'+ this.overlays[i]);
1733
- var ie6 = (hs.ieLt7 || document.compatMode == 'BackCompat');
1734
- if (o && /^(above|below)$/.test(o.position)) {
1735
- if (ie6) {
1736
- o.style.width = (overlayBox.offsetWidth + 2 * x.cb
1737
- + x.p1 + x.p2) +'px';
1738
- }
1739
- y[o.position == 'above' ? 'p1' : 'p2'] = o.offsetHeight;
1740
- }
1741
- if (o && ie6 && /^(left|right)panel$/.test(o.position)) {
1742
- o.style.height = (overlayBox.offsetHeight + 2* y.cb) +'px';
1743
- }
1744
- }
1745
- }
1746
- if (doWrapper) {
1747
- hs.setStyles(this.content, {
1748
- top: y.p1 +'px'
1749
- });
1750
- hs.setStyles(overlayBox, {
1751
- top: (y.p1 + y.cb) +'px'
1752
- });
1753
- }
1754
- },
1755
-
1756
- showOverlays : function() {
1757
- var b = this.overlayBox;
1758
- b.className = '';
1759
- hs.setStyles(b, {
1760
- top: (this.y.p1 + this.y.cb) +'px',
1761
- left: (this.x.p1 + this.x.cb) +'px',
1762
- overflow : 'visible'
1763
- });
1764
- if (hs.safari) b.style.visibility = 'visible';
1765
- this.wrapper.appendChild (b);
1766
- for (var i = 0; i < this.overlays.length; i++) {
1767
- var o = hs.$('hsId'+ this.overlays[i]);
1768
- o.style.zIndex = o.zIndex || 4;
1769
- if (!o.hideOnMouseOut || this.mouseIsOver) {
1770
- o.style.visibility = 'visible';
1771
- hs.setStyles(o, { visibility: 'visible', display: '' });
1772
- hs.animate(o, { opacity: o.opacity }, o.dur);
1773
- }
1774
- }
1775
- },
1776
-
1777
- destroyOverlays : function() {
1778
- if (!this.overlays.length) return;
1779
- hs.discardElement(this.overlayBox);
1780
- },
1781
-
1782
-
1783
-
1784
- createFullExpand : function () {
1785
- this.fullExpandLabel = hs.createElement(
1786
- 'a', {
1787
- href: 'javascript:hs.expanders['+ this.key +'].doFullExpand();',
1788
- title: hs.lang.fullExpandTitle,
1789
- className: 'highslide-full-expand'
1790
- }
1791
- );
1792
-
1793
- this.createOverlay({
1794
- overlayId: this.fullExpandLabel,
1795
- position: hs.fullExpandPosition,
1796
- hideOnMouseOut: true,
1797
- opacity: hs.fullExpandOpacity
1798
- });
1799
- },
1800
-
1801
- doFullExpand : function () {
1802
- try {
1803
- if (this.fullExpandLabel) hs.discardElement(this.fullExpandLabel);
1804
-
1805
- this.focus();
1806
- var xSize = this.x.size,
1807
- ySize = this.y.size;
1808
- this.resizeTo(this.x.full, this.y.full);
1809
-
1810
- var xpos = this.x.pos - (this.x.size - xSize) / 2;
1811
- if (xpos < hs.marginLeft) xpos = hs.marginLeft;
1812
-
1813
- var ypos = this.y.pos - (this.y.size - ySize) / 2;
1814
- if (ypos < hs.marginTop) ypos = hs.marginTop;
1815
-
1816
- this.moveTo(xpos, ypos);
1817
- this.doShowHide('hidden');
1818
-
1819
- } catch (e) {
1820
- this.error(e);
1821
- }
1822
- },
1823
-
1824
-
1825
- afterClose : function () {
1826
- this.a.className = this.a.className.replace('highslide-active-anchor', '');
1827
-
1828
- this.doShowHide('visible');
1829
- if (this.outline && this.outlineWhileAnimating) this.outline.destroy();
1830
- hs.discardElement(this.wrapper);
1831
-
1832
- hs.expanders[this.key] = null;
1833
- hs.reOrder();
1834
- }
1835
-
1836
- };
1837
- hs.langDefaults = hs.lang;
1838
- // history
1839
- var HsExpander = hs.Expander;
1840
- if (hs.ie && window == window.top) {
1841
- (function () {
1842
- try {
1843
- document.documentElement.doScroll('left');
1844
- } catch (e) {
1845
- setTimeout(arguments.callee, 50);
1846
- return;
1847
- }
1848
- hs.ready();
1849
- })();
1850
- }
1851
- hs.addEventListener(document, 'DOMContentLoaded', hs.ready);
1852
- hs.addEventListener(window, 'load', hs.ready);
1853
-
1854
- // set handlers
1855
- hs.addEventListener(document, 'ready', function() {
1856
- if (hs.expandCursor) {
1857
- var style = hs.createElement('style', { type: 'text/css' }, null,
1858
- document.getElementsByTagName('HEAD')[0]),
1859
- backCompat = document.compatMode == 'BackCompat';
1860
-
1861
-
1862
- function addRule(sel, dec) {
1863
- if (hs.ie && (hs.uaVersion < 9 || backCompat)) {
1864
- var last = document.styleSheets[document.styleSheets.length - 1];
1865
- if (typeof(last.addRule) == "object") last.addRule(sel, dec);
1866
- } else {
1867
- style.appendChild(document.createTextNode(sel + " {" + dec + "}"));
1868
- }
1869
- }
1870
- function fix(prop) {
1871
- return 'expression( ( ( ignoreMe = document.documentElement.'+ prop +
1872
- ' ? document.documentElement.'+ prop +' : document.body.'+ prop +' ) ) + \'px\' );';
1873
- }
1874
- if (hs.expandCursor) addRule ('.highslide img',
1875
- 'cursor: url('+ hs.graphicsDir + hs.expandCursor +'), pointer !important;');
1876
- }
1877
- });
1878
- hs.addEventListener(window, 'resize', function() {
1879
- hs.getPageSize();
1880
- });
1881
- hs.addEventListener(document, 'mousemove', function(e) {
1882
- hs.mouse = { x: e.clientX, y: e.clientY };
1883
- });
1884
- hs.addEventListener(document, 'mousedown', hs.mouseClickHandler);
1885
- hs.addEventListener(document, 'mouseup', hs.mouseClickHandler);
1886
-
1887
- hs.addEventListener(document, 'ready', hs.getAnchors);
1888
- hs.addEventListener(window, 'load', hs.preloadImages);
1889
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery.lightbox.js DELETED
@@ -1,492 +0,0 @@
1
- /**
2
- * jQuery lightBox plugin
3
- * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
4
- * and adapted to me for use like a plugin from jQuery.
5
- * @name jquery-lightbox-0.5.js
6
- * @author Leandro Vieira Pinho - http://leandrovieira.com
7
- * @version 0.5
8
- * @date April 11, 2008
9
- * @category jQuery plugin
10
- * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
11
- * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
12
- * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
13
- */
14
-
15
- // Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
16
- (function($) {
17
- /**
18
- * $ is an alias to jQuery object
19
- *
20
- */
21
- $.fn.lightBox = function(settings) {
22
- // Settings to configure the jQuery lightBox plugin how you like
23
- settings = jQuery.extend({
24
- // Configuration related to overlay
25
- overlayBgColor: '#000', // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
26
- overlayOpacity: 0.8, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
27
- // Configuration related to navigation
28
- fixedNavigation: false, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
29
- // Configuration related to images
30
- imageLoading: lightbox_path+'images/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon
31
- imageBtnPrev: lightbox_path+'images/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image
32
- imageBtnNext: lightbox_path+'images/lightbox-btn-next.gif', // (string) Path and the name of the next button image
33
- imageBtnClose: lightbox_path+'images/lightbox-btn-close.gif', // (string) Path and the name of the close btn
34
- imageBlank: lightbox_path+'images/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel)
35
- // Configuration related to container image box
36
- containerBorderSize: 10, // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
37
- containerResizeSpeed: 400, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
38
- // Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
39
- txtImage: 'Image', // (string) Specify text "Image"
40
- txtOf: 'of', // (string) Specify text "of"
41
- // Configuration related to keyboard navigation
42
- keyToClose: 'c', // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
43
- keyToPrev: 'p', // (string) (p = previous) Letter to show the previous image
44
- keyToNext: 'n', // (string) (n = next) Letter to show the next image.
45
- // Don�t alter these variables in any way
46
- imageArray: [],
47
- activeImage: 0,
48
- captionPosition: ''
49
- },settings);
50
- // Caching the jQuery object with all elements matched
51
- var jQueryMatchedObj = this; // This, in this context, refer to jQuery object
52
- /**
53
- * Initializing the plugin calling the start function
54
- *
55
- * @return boolean false
56
- */
57
- function _initialize() {
58
- _start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked
59
- return false; // Avoid the browser following the link
60
- }
61
- /**
62
- * Start the jQuery lightBox plugin
63
- *
64
- * @param object objClicked The object (link) whick the user have clicked
65
- * @param object jQueryMatchedObj The jQuery object with all elements matched
66
- */
67
- function _start(objClicked,jQueryMatchedObj) {
68
- // Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
69
- $('embed, object, select').css({ 'visibility' : 'hidden' });
70
- // Call the function to create the markup structure; style some elements; assign events in some elements.
71
- _set_interface();
72
- // Unset total images in imageArray
73
- settings.imageArray.length = 0;
74
- // Unset image active information
75
- settings.activeImage = 0;
76
- // We have an image set? Or just an image? Let�s see it.
77
- if ( jQueryMatchedObj.length == 1 ) {
78
- if( settings.captionPosition == 'gallery' ) var position = jQuery(objClicked).parent().next().html();
79
- else var position = objClicked.getAttribute('title');
80
- settings.imageArray.push(new Array(objClicked.getAttribute('href'),position));
81
- } else {
82
- // Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references
83
- for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
84
- if( settings.captionPosition != 'gallery' ) {
85
- var position = jQueryMatchedObj[i].getAttribute('title');
86
- settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),position));
87
- } else {
88
- if( i > 1 ) {
89
- if( !(jQueryMatchedObj[i-1].getAttribute('href') != jQueryMatchedObj[i].getAttribute('href') && jQuery(jQueryMatchedObj[i-1]).parent().parent().children().children().attr('href') == jQuery(jQueryMatchedObj[i]).parent().parent().children().children().attr('href'))) {
90
- var position = jQuery(jQueryMatchedObj[i]).parent().next().html();
91
- settings.imageArray.push(new Array(jQuery(jQueryMatchedObj[i]).parent().parent().children().children().attr('href'),position));
92
- }
93
- } else {
94
- var position = jQuery(jQueryMatchedObj[i]).parent().next().html();
95
- settings.imageArray.push(new Array(jQuery(jQueryMatchedObj[i]).parent().parent().children().children().attr('href'),position));
96
- }
97
- }
98
- }
99
- }
100
- while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {
101
- settings.activeImage++;
102
- }
103
- // Call the function that prepares image exibition
104
- _set_image_to_view();
105
-
106
- // Enable keyboard navigation
107
- _enable_keyboard_navigation();
108
- }
109
- /**
110
- * Create the jQuery lightBox plugin interface
111
- *
112
- * The HTML markup will be like that:
113
- <div id="jquery-overlay"></div>
114
- <div id="jquery-lightbox">
115
- <div id="lightbox-container-image-box">
116
- <div id="lightbox-container-image">
117
- <img src="../fotos/XX.jpg" id="lightbox-image">
118
- <div id="lightbox-nav">
119
- <a href="#" id="lightbox-nav-btnPrev"></a>
120
- <a href="#" id="lightbox-nav-btnNext"></a>
121
- </div>
122
- <div id="lightbox-loading">
123
- <a href="#" id="lightbox-loading-link">
124
- <img src="../images/lightbox-ico-loading.gif">
125
- </a>
126
- </div>
127
- </div>
128
- </div>
129
- <div id="lightbox-container-image-data-box">
130
- <div id="lightbox-container-image-data">
131
- <div id="lightbox-image-details">
132
- <span id="lightbox-image-details-caption"></span>
133
- <span id="lightbox-image-details-currentNumber"></span>
134
- </div>
135
- <div id="lightbox-secNav">
136
- <a href="#" id="lightbox-secNav-btnClose">
137
- <img src="../images/lightbox-btn-close.gif">
138
- </a>
139
- </div>
140
- </div>
141
- </div>
142
- </div>
143
- *
144
- */
145
- function _set_interface() {
146
- // Apply the HTML markup into body tag
147
- $('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');
148
- // Get page sizes
149
- var arrPageSizes = ___getPageSize();
150
- // Style overlay and show it
151
- $('#jquery-overlay').css({
152
- backgroundColor: settings.overlayBgColor,
153
- opacity: settings.overlayOpacity,
154
- width: arrPageSizes[0],
155
- height: arrPageSizes[1]
156
- }).fadeIn();
157
- // Get page scroll
158
- var arrPageScroll = ___getPageScroll();
159
- // Calculate top and left offset for the jquery-lightbox div object and show it
160
- $('#jquery-lightbox').css({
161
- top: arrPageScroll[1] + (arrPageSizes[3] / 10),
162
- left: arrPageScroll[0]
163
- }).show();
164
- // Assigning click events in elements to close overlay
165
- $('#jquery-overlay,#jquery-lightbox').click(function() {
166
- _finish();
167
- });
168
- // Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
169
- $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
170
- _finish();
171
- return false;
172
- });
173
- // If window was resized, calculate the new overlay dimensions
174
- $(window).resize(function() {
175
- // Get page sizes
176
- var arrPageSizes = ___getPageSize();
177
- // Style overlay and show it
178
- $('#jquery-overlay').css({
179
- width: arrPageSizes[0],
180
- height: arrPageSizes[1]
181
- });
182
- // Get page scroll
183
- var arrPageScroll = ___getPageScroll();
184
- // Calculate top and left offset for the jquery-lightbox div object and show it
185
- $('#jquery-lightbox').css({
186
- top: arrPageScroll[1] + (arrPageSizes[3] / 10),
187
- left: arrPageScroll[0]
188
- });
189
- });
190
- }
191
- /**
192
- * Prepares image exibition; doing a image�s preloader to calculate it�s size
193
- *
194
- */
195
- function _set_image_to_view() { // show the loading
196
- // Show the loading
197
- $('#lightbox-loading').show();
198
- if ( settings.fixedNavigation ) {
199
- $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
200
- } else {
201
- // Hide some elements
202
- $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
203
- }
204
- // Image preload process
205
- var objImagePreloader = new Image();
206
- objImagePreloader.onload = function() {
207
- $('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);
208
- // Perfomance an effect in the image container resizing it
209
- _resize_container_image_box(objImagePreloader.width,objImagePreloader.height);
210
- // clear onLoad, IE behaves irratically with animated gifs otherwise
211
- objImagePreloader.onload=function(){};
212
- };
213
- objImagePreloader.src = settings.imageArray[settings.activeImage][0];
214
- };
215
- /**
216
- * Perfomance an effect in the image container resizing it
217
- *
218
- * @param integer intImageWidth The image�s width that will be showed
219
- * @param integer intImageHeight The image�s height that will be showed
220
- */
221
- function _resize_container_image_box(intImageWidth,intImageHeight) {
222
- // Get current width and height
223
- var intCurrentWidth = $('#lightbox-container-image-box').width();
224
- var intCurrentHeight = $('#lightbox-container-image-box').height();
225
- // Get the width and height of the selected image plus the padding
226
- var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image�s width and the left and right padding value
227
- var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image�s height and the left and right padding value
228
- // Diferences
229
- var intDiffW = intCurrentWidth - intWidth;
230
- var intDiffH = intCurrentHeight - intHeight;
231
- // Perfomance the effect
232
- $('#lightbox-container-image-box').animate({ width: intWidth },settings.containerResizeSpeed,function() { _show_image(); });
233
- if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {
234
- if ( $.browser.msie ) {
235
- ___pause(250);
236
- } else {
237
- ___pause(100);
238
- }
239
- }
240
- $('#lightbox-container-image-data-box').css({ width: intImageWidth });
241
- $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
242
- };
243
- /**
244
- * Show the prepared image
245
- *
246
- */
247
- function _show_image() {
248
- $('#lightbox-loading').hide();
249
- $('#lightbox-image').fadeIn(function() {
250
- _show_image_data();
251
- _set_navigation();
252
- });
253
- _preload_neighbor_images();
254
- };
255
- /**
256
- * Show the image information
257
- *
258
- */
259
- function _show_image_data() {
260
- $('#lightbox-container-image-data-box').slideDown('fast');
261
- $('#lightbox-image-details-caption').hide();
262
- if ( settings.imageArray[settings.activeImage][1] ) {
263
- $('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
264
- }
265
- // If we have a image set, display 'Image X of X'
266
- if ( settings.imageArray.length > 1 ) {
267
- $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
268
- }
269
- }
270
- /**
271
- * Display the button navigations
272
- *
273
- */
274
- function _set_navigation() {
275
- $('#lightbox-nav').show();
276
-
277
- // Instead to define this configuration in CSS file, we define here. And it�s need to IE. Just.
278
- $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
279
-
280
- // Show the prev button, if not the first image in set
281
- if ( settings.activeImage != 0 ) {
282
- if ( settings.fixedNavigation ) {
283
- $('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })
284
- .unbind()
285
- .bind('click',function() {
286
- settings.activeImage = settings.activeImage - 1;
287
- _set_image_to_view();
288
- return false;
289
- });
290
- } else {
291
- // Show the images button for Next buttons
292
- $('#lightbox-nav-btnPrev').unbind().hover(function() {
293
- $(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });
294
- },function() {
295
- $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
296
- }).show().bind('click',function() {
297
- settings.activeImage = settings.activeImage - 1;
298
- _set_image_to_view();
299
- return false;
300
- });
301
- }
302
- }
303
-
304
- // Show the next button, if not the last image in set
305
- if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {
306
- if ( settings.fixedNavigation ) {
307
- $('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })
308
- .unbind()
309
- .bind('click',function() {
310
- settings.activeImage = settings.activeImage + 1;
311
- _set_image_to_view();
312
- return false;
313
- });
314
- } else {
315
- // Show the images button for Next buttons
316
- $('#lightbox-nav-btnNext').unbind().hover(function() {
317
- $(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });
318
- },function() {
319
- $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
320
- }).show().bind('click',function() {
321
- settings.activeImage = settings.activeImage + 1;
322
- _set_image_to_view();
323
- return false;
324
- });
325
- }
326
- }
327
- // Enable keyboard navigation
328
- //_enable_keyboard_navigation();
329
- }
330
- /**
331
- * Enable a support to keyboard navigation
332
- *
333
- */
334
- function _enable_keyboard_navigation() {
335
- $(document).keydown(function(objEvent) {
336
- _keyboard_action(objEvent);
337
- });
338
- }
339
- /**
340
- * Disable the support to keyboard navigation
341
- *
342
- */
343
- function _disable_keyboard_navigation() {
344
- $(document).unbind('keydown');
345
- }
346
- /**
347
- * Perform the keyboard actions
348
- *
349
- */
350
- function _keyboard_action(objEvent) {
351
- // To ie
352
- if ( objEvent == null ) {
353
- keycode = event.keyCode;
354
- escapeKey = 27;
355
- // To Mozilla
356
- } else {
357
- keycode = objEvent.keyCode;
358
- escapeKey = objEvent.DOM_VK_ESCAPE;
359
- }
360
- // Get the key in lower case form
361
- key = String.fromCharCode(keycode).toLowerCase();
362
- // Verify the keys to close the ligthBox
363
- if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {
364
- _finish();
365
- }
366
- // Verify the key to show the previous image
367
- if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {
368
- // If we�re not showing the first image, call the previous
369
- if ( settings.activeImage != 0 ) {
370
- settings.activeImage = settings.activeImage - 1;
371
- _set_image_to_view();
372
- //_disable_keyboard_navigation();
373
- }
374
- }
375
- // Verify the key to show the next image
376
- if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {
377
- // If we�re not showing the last image, call the next
378
- if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {
379
- settings.activeImage = settings.activeImage + 1;
380
- _set_image_to_view();
381
- //_disable_keyboard_navigation();
382
- }
383
- }
384
- }
385
- /**
386
- * Preload prev and next images being showed
387
- *
388
- */
389
- function _preload_neighbor_images() {
390
- if ( (settings.imageArray.length -1) > settings.activeImage ) {
391
- objNext = new Image();
392
- objNext.src = settings.imageArray[settings.activeImage + 1][0];
393
- }
394
- if ( settings.activeImage > 0 ) {
395
- objPrev = new Image();
396
- objPrev.src = settings.imageArray[settings.activeImage -1][0];
397
- }
398
- }
399
- /**
400
- * Remove jQuery lightBox plugin HTML markup
401
- *
402
- */
403
- function _finish() {
404
- $('#jquery-lightbox').remove();
405
- $('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
406
- // Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
407
- $('embed, object, select').css({ 'visibility' : 'visible' });
408
- _disable_keyboard_navigation();
409
- }
410
- /**
411
- / THIRD FUNCTION
412
- * getPageSize() by quirksmode.com
413
- *
414
- * @return Array Return an array with page width, height and window width, height
415
- */
416
- function ___getPageSize() {
417
- var xScroll, yScroll;
418
- if (window.innerHeight && window.scrollMaxY) {
419
- xScroll = window.innerWidth + window.scrollMaxX;
420
- yScroll = window.innerHeight + window.scrollMaxY;
421
- } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
422
- xScroll = document.body.scrollWidth;
423
- yScroll = document.body.scrollHeight;
424
- } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
425
- xScroll = document.body.offsetWidth;
426
- yScroll = document.body.offsetHeight;
427
- }
428
- var windowWidth, windowHeight;
429
- if (self.innerHeight) { // all except Explorer
430
- if(document.documentElement.clientWidth){
431
- windowWidth = document.documentElement.clientWidth;
432
- } else {
433
- windowWidth = self.innerWidth;
434
- }
435
- windowHeight = self.innerHeight;
436
- } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
437
- windowWidth = document.documentElement.clientWidth;
438
- windowHeight = document.documentElement.clientHeight;
439
- } else if (document.body) { // other Explorers
440
- windowWidth = document.body.clientWidth;
441
- windowHeight = document.body.clientHeight;
442
- }
443
- // for small pages with total height less then height of the viewport
444
- if(yScroll < windowHeight){
445
- pageHeight = windowHeight;
446
- } else {
447
- pageHeight = yScroll;
448
- }
449
- // for small pages with total width less then width of the viewport
450
- if(xScroll < windowWidth){
451
- pageWidth = xScroll;
452
- } else {
453
- pageWidth = windowWidth;
454
- }
455
- arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
456
- return arrayPageSize;
457
- };
458
- /**
459
- / THIRD FUNCTION
460
- * getPageScroll() by quirksmode.com
461
- *
462
- * @return Array Return an array with x,y page scroll values.
463
- */
464
- function ___getPageScroll() {
465
- var xScroll, yScroll;
466
- if (self.pageYOffset) {
467
- yScroll = self.pageYOffset;
468
- xScroll = self.pageXOffset;
469
- } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
470
- yScroll = document.documentElement.scrollTop;
471
- xScroll = document.documentElement.scrollLeft;
472
- } else if (document.body) {// all other Explorers
473
- yScroll = document.body.scrollTop;
474
- xScroll = document.body.scrollLeft;
475
- }
476
- arrayPageScroll = new Array(xScroll,yScroll);
477
- return arrayPageScroll;
478
- };
479
- /**
480
- * Stop the code execution from a escified time in milisecond
481
- *
482
- */
483
- function ___pause(ms) {
484
- var date = new Date();
485
- curDate = null;
486
- do { var curDate = new Date(); }
487
- while ( curDate - date < ms);
488
- };
489
- // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
490
- return this.unbind('click').click(_initialize);
491
- };
492
- })(jQuery); // Call and execute the function immediately passing the jQuery object
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lightbox-gallery.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://wpgogo.com/development/lightbox-gallery.html
5
  Description: The Lightbox Gallery plugin changes the view of galleries to the lightbox.
6
  Author: Hiroaki Miyashita
7
  Author URI: http://wpgogo.com/
8
- Version: 0.9
9
  Text Domain: lightbox-gallery
10
  Domain Path: /
11
  */
@@ -616,7 +616,7 @@ function lightbox_gallery($attr) {
616
  if ( empty($attachments) )
617
  return '';
618
 
619
- $total = count($attachments)-$from;
620
 
621
  if ( !$page ) $page = 1;
622
  $numpages = 1;
5
  Description: The Lightbox Gallery plugin changes the view of galleries to the lightbox.
6
  Author: Hiroaki Miyashita
7
  Author URI: http://wpgogo.com/
8
+ Version: 0.9.1
9
  Text Domain: lightbox-gallery
10
  Domain Path: /
11
  */
616
  if ( empty($attachments) )
617
  return '';
618
 
619
+ $total = count($attachments)-(int)$from;
620
 
621
  if ( !$page ) $page = 1;
622
  $numpages = 1;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wpgogo.com/development/lightbox-gallery.html
4
  Tags: lightbox, gallery, galleries, image, images, album, photo, photos, picture, pictures, jQuery, Highslide, Colorbox
5
  Requires at least: 2.5
6
  Tested up to: 4.9.4
7
- Stable tag: 0.9
8
  License: GPLv2 or later
9
 
10
  The Lightbox Gallery plugin changes the view of galleries to the lightbox.
@@ -146,6 +146,9 @@ You can set the additional settings for Colorbox. See [Colorbox official site](h
146
 
147
  == Changelog ==
148
 
 
 
 
149
  = 0.9 =
150
  * Colorbox settings.
151
  * Colorbox CSS.
4
  Tags: lightbox, gallery, galleries, image, images, album, photo, photos, picture, pictures, jQuery, Highslide, Colorbox
5
  Requires at least: 2.5
6
  Tested up to: 4.9.4
7
+ Stable tag: 0.9.1
8
  License: GPLv2 or later
9
 
10
  The Lightbox Gallery plugin changes the view of galleries to the lightbox.
146
 
147
  == Changelog ==
148
 
149
+ = 0.9.1 =
150
+ * Code cleaning.
151
+
152
  = 0.9 =
153
  * Colorbox settings.
154
  * Colorbox CSS.