Gallery Bank: WordPress Photo Gallery Plugin - Version 3.0.229

Version Description

  • Compatibility with 4.3
  • Changed variables to avoid confliction with Next Gen and Contact Bank plugins.
  • Prettyphoto XSS Security Issue Fixed.
Download this release

Release Info

Developer contact-banker
Plugin Icon 128x128 Gallery Bank: WordPress Photo Gallery Plugin
Version 3.0.229
Comparing to
See all releases

Code changes from version 3.0.228 to 3.0.229

assets/css/gallery-bank.css CHANGED
@@ -185,94 +185,22 @@ div.gallery-bank-hover-details:hover .gallery-bank-image-details {
185
  opacity: 1;
186
  }
187
 
188
-
189
-
190
  /* # Tooltips & popovers
191
  ================================================== */
192
 
193
- .tooltip {
194
- position: absolute;
195
- z-index: 10300;
196
- display: block;
197
- visibility: visible;
198
- padding: 5px;
199
- font-size: 11px;
200
- opacity: 0;
201
- filter: alpha(opacity=0);
202
- }
203
-
204
- .tooltip.in {
205
- opacity: 0.8;
206
- filter: alpha(opacity=80);
207
- }
208
-
209
- .tooltip.top {
210
- margin-top: -3px;
211
- }
212
-
213
- .tooltip.right {
214
- margin-left: 3px;
215
- }
216
-
217
- .tooltip.bottom {
218
- margin-top: 3px;
219
- }
220
-
221
- .tooltip.left {
222
- margin-left: -3px;
223
- }
224
-
225
- .tooltip-inner {
226
- max-width: 200px;
227
- padding: 3px 8px;
228
- color: #ffffff;
229
- text-align: center;
230
- text-decoration: none;
231
- background-color: #202020;
232
- -webkit-border-radius: 2px;
233
- -moz-border-radius: 2px;
234
- border-radius: 2px;
235
- }
236
-
237
- .tooltip-arrow {
238
- position: absolute;
239
- width: 0;
240
- height: 0;
241
- border-color: transparent;
242
- border-style: solid;
243
- }
244
-
245
- .tooltip.top .tooltip-arrow {
246
- bottom: 0;
247
- left: 50%;
248
- margin-left: -5px;
249
- border-width: 5px 5px 0;
250
- border-top-color: #000000;
251
- }
252
-
253
- .tooltip.right .tooltip-arrow {
254
- top: 50%;
255
- left: 0;
256
- margin-top: -5px;
257
- border-width: 5px 5px 5px 0;
258
- border-right-color: #000000;
259
- }
260
 
261
- .tooltip.left .tooltip-arrow {
262
- top: 50%;
263
- right: 0;
264
- margin-top: -5px;
265
- border-width: 5px 0 5px 5px;
266
- border-left-color: #000000;
267
- }
268
-
269
- .tooltip.bottom .tooltip-arrow {
270
- top: 0;
271
- left: 50%;
272
- margin-left: -5px;
273
- border-width: 0 5px 5px;
274
- border-bottom-color: #000000;
275
- }
276
 
277
  .separator-doubled {
278
  padding: 0;
185
  opacity: 1;
186
  }
187
 
 
 
188
  /* # Tooltips & popovers
189
  ================================================== */
190
 
191
+ .tooltip_tip { position: absolute; z-index: 10300; display: block; visibility: visible; padding: 5px; font-size: 11px; opacity: 0; filter: alpha(opacity=0); }
192
+ .tooltip_tip.in { opacity: 0.8; filter: alpha(opacity=80); }
193
+ .tooltip_tip.top { margin-top: -3px; }
194
+ .tooltip_tip.right { margin-left: 3px; }
195
+ .tooltip_tip.bottom { margin-top: 3px; }
196
+ .tooltip_tip.left { margin-left: -3px; }
197
+ .tooltip_tip-inner { max-width: 200px; padding: 3px 8px; color: #ffffff; text-align: center; text-decoration: none; background-color: #202020; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; }
198
+ .tooltip_tip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; }
199
+ .tooltip_tip.top .tooltip_tip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #000000; }
200
+ .tooltip_tip.right .tooltip_tip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000000; }
201
+ .tooltip_tip.left .tooltip_tip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000000; }
202
+ .tooltip_tip.bottom .tooltip_tip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #000000; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
 
205
  .separator-doubled {
206
  padding: 0;
assets/js/jquery.Tooltip.js CHANGED
@@ -17,226 +17,269 @@
17
  * See the License for the specific language governing permissions and
18
  * limitations under the License.
19
  * ========================================================== */
 
20
 
 
21
 
22
- !function ($) {
23
 
24
- "use strict"; // jshint ;_;
25
-
26
-
27
- /* TOOLTIP PUBLIC CLASS DEFINITION
28
- * =============================== */
29
-
30
- var Tooltip = function (element, options) {
31
- this.init('tooltip', element, options)
32
- }
33
-
34
- Tooltip.prototype = {
35
-
36
- constructor: Tooltip, init: function (type, element, options) {
37
- var eventIn
38
- , eventOut
39
-
40
- this.type = type
41
- this.$element = $(element)
42
- this.options = this.getOptions(options)
43
- this.enabled = true
44
-
45
- if (this.options.trigger == 'click') {
46
- this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
47
- } else if (this.options.trigger != 'manual') {
48
- eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
49
- eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
50
- this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
51
- this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
52
- }
53
-
54
- this.options.selector ?
55
- (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
56
- this.fixTitle()
57
- }, getOptions: function (options) {
58
- options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
59
-
60
- if (options.delay && typeof options.delay == 'number') {
61
- options.delay = {
62
- show: options.delay, hide: options.delay
63
- }
64
- }
65
-
66
- return options
67
- }, enter: function (e) {
68
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
69
-
70
- if (!self.options.delay || !self.options.delay.show) return self.show()
71
-
72
- clearTimeout(this.timeout)
73
- self.hoverState = 'in'
74
- this.timeout = setTimeout(function () {
75
- if (self.hoverState == 'in') self.show()
76
- }, self.options.delay.show)
77
- }, leave: function (e) {
78
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
79
-
80
- if (this.timeout) clearTimeout(this.timeout)
81
- if (!self.options.delay || !self.options.delay.hide) return self.hide()
82
-
83
- self.hoverState = 'out'
84
- this.timeout = setTimeout(function () {
85
- if (self.hoverState == 'out') self.hide()
86
- }, self.options.delay.hide)
87
- }, show: function () {
88
- var $tip
89
- , inside
90
- , pos
91
- , actualWidth
92
- , actualHeight
93
- , placement
94
- , tp
95
-
96
- if (this.hasContent() && this.enabled) {
97
- $tip = this.tip()
98
- this.setContent()
99
-
100
- if (this.options.animation) {
101
- $tip.addClass('fade')
102
- }
103
-
104
- placement = typeof this.options.placement == 'function' ?
105
- this.options.placement.call(this, $tip[0], this.$element[0]) :
106
- this.options.placement
107
-
108
- inside = /in/.test(placement)
109
-
110
- $tip
111
- .detach()
112
- .css({ top: 0, left: 0, display: 'block' })
113
- .insertAfter(this.$element)
114
-
115
- pos = this.getPosition(inside)
116
-
117
- actualWidth = $tip[0].offsetWidth
118
- actualHeight = $tip[0].offsetHeight
119
-
120
- switch (inside ? placement.split(' ')[1] : placement) {
121
- case 'bottom':
122
- tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
123
- break
124
- case 'top':
125
- tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
126
- break
127
- case 'left':
128
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
129
- break
130
- case 'right':
131
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
132
- break
133
- }
134
-
135
- $tip
136
- .offset(tp)
137
- .addClass(placement)
138
- .addClass('in')
139
- }
140
- }, setContent: function () {
141
- var $tip = this.tip()
142
- , title = this.getTitle()
143
-
144
- $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
145
- $tip.removeClass('fade in top bottom left right')
146
- }, hide: function () {
147
- var that = this
148
- , $tip = this.tip()
149
-
150
- $tip.removeClass('in')
151
-
152
- function removeWithAnimation() {
153
- var timeout = setTimeout(function () {
154
- $tip.off($.support.transition.end).detach()
155
- }, 500)
156
-
157
- $tip.one($.support.transition.end, function () {
158
- clearTimeout(timeout)
159
- $tip.detach()
160
- })
161
- }
162
-
163
- $.support.transition && this.$tip.hasClass('fade') ?
164
- removeWithAnimation() :
165
- $tip.detach()
166
-
167
- return this
168
- }, fixTitle: function () {
169
- var $e = this.$element
170
- if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
171
- $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
172
- }
173
- }, hasContent: function () {
174
- return this.getTitle()
175
- }, getPosition: function (inside) {
176
- return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
177
- width: this.$element[0].offsetWidth, height: this.$element[0].offsetHeight
178
- })
179
- }, getTitle: function () {
180
- var title
181
- , $e = this.$element
182
- , o = this.options
183
-
184
- title = $e.attr('data-original-title')
185
- || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
186
-
187
- return title
188
- }, tip: function () {
189
- return this.$tip = this.$tip || $(this.options.template)
190
- }, validate: function () {
191
- if (!this.$element[0].parentNode) {
192
- this.hide()
193
- this.$element = null
194
- this.options = null
195
- }
196
- }, enable: function () {
197
- this.enabled = true
198
- }, disable: function () {
199
- this.enabled = false
200
- }, toggleEnabled: function () {
201
- this.enabled = !this.enabled
202
- }, toggle: function (e) {
203
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
204
- self[self.tip().hasClass('in') ? 'hide' : 'show']()
205
- }, destroy: function () {
206
- this.hide().$element.off('.' + this.type).removeData(this.type)
207
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
 
 
 
209
  }
210
 
 
 
 
211
 
212
- /* TOOLTIP PLUGIN DEFINITION
213
- * ========================= */
214
 
215
- var old = $.fn.tooltip
 
 
 
216
 
217
- $.fn.tooltip = function (option) {
218
- return this.each(function () {
219
- var $this = $(this)
220
- , data = $this.data('tooltip')
221
- , options = typeof option == 'object' && option
222
- if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
223
- if (typeof option == 'string') data[option]()
224
  })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  }
226
 
227
- $.fn.tooltip.Constructor = Tooltip
 
 
228
 
229
- $.fn.tooltip.defaults = {
230
- animation: true, placement: 'top', selector: false, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger: 'hover', title: '', delay: 0, html: false
 
 
 
231
  }
232
 
 
 
 
 
 
 
 
 
 
 
233
 
234
- /* TOOLTIP NO CONFLICT
235
- * =================== */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
 
237
- $.fn.tooltip.noConflict = function () {
238
- $.fn.tooltip = old
239
- return this
240
  }
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  }(window.jQuery);
17
  * See the License for the specific language governing permissions and
18
  * limitations under the License.
19
  * ========================================================== */
20
+ !function ($) {
21
 
22
+ "use strict"; // jshint ;_;
23
 
 
24
 
25
+ /* TOOLTIP PUBLIC CLASS DEFINITION
26
+ * =============================== */
27
+
28
+ var Tooltip_tip = function (element, options) {
29
+ this.init('tooltip_tip', element, options)
30
+ }
31
+
32
+ Tooltip_tip.prototype = {
33
+
34
+ constructor: Tooltip_tip
35
+
36
+ , init: function (type, element, options) {
37
+ var eventIn
38
+ , eventOut
39
+
40
+ this.type = type
41
+ this.$element = $(element)
42
+ this.options = this.getOptions(options)
43
+ this.enabled = true
44
+
45
+ if (this.options.trigger == 'click') {
46
+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
47
+ } else if (this.options.trigger != 'manual') {
48
+ eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
49
+ eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
50
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
51
+ this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
52
+ }
53
+
54
+ this.options.selector ?
55
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
56
+ this.fixTitle()
57
+ }
58
+
59
+ , getOptions: function (options) {
60
+ options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
61
+
62
+ if (options.delay && typeof options.delay == 'number') {
63
+ options.delay = {
64
+ show: options.delay
65
+ , hide: options.delay
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
+ }
68
+
69
+ return options
70
+ }
71
+
72
+ , enter: function (e) {
73
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
74
+
75
+ if (!self.options.delay || !self.options.delay.show) return self.show()
76
+
77
+ clearTimeout(this.timeout)
78
+ self.hoverState = 'in'
79
+ this.timeout = setTimeout(function() {
80
+ if (self.hoverState == 'in') self.show()
81
+ }, self.options.delay.show)
82
+ }
83
+
84
+ , leave: function (e) {
85
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
86
+
87
+ if (this.timeout) clearTimeout(this.timeout)
88
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
89
+
90
+ self.hoverState = 'out'
91
+ this.timeout = setTimeout(function() {
92
+ if (self.hoverState == 'out') self.hide()
93
+ }, self.options.delay.hide)
94
+ }
95
+
96
+ , show: function () {
97
+ var $tip
98
+ , inside
99
+ , pos
100
+ , actualWidth
101
+ , actualHeight
102
+ , placement
103
+ , tp
104
+
105
+ if (this.hasContent() && this.enabled) {
106
+ $tip = this.tip()
107
+ this.setContent()
108
+
109
+ if (this.options.animation) {
110
+ $tip.addClass('fade')
111
+ }
112
+
113
+ placement = typeof this.options.placement == 'function' ?
114
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
115
+ this.options.placement
116
+
117
+ inside = /in/.test(placement)
118
+
119
+ $tip
120
+ .detach()
121
+ .css({ top: 0, left: 0, display: 'block' })
122
+ .insertAfter(this.$element)
123
+
124
+ pos = this.getPosition(inside)
125
+
126
+ actualWidth = $tip[0].offsetWidth
127
+ actualHeight = $tip[0].offsetHeight
128
+
129
+ switch (inside ? placement.split(' ')[1] : placement) {
130
+ case 'bottom':
131
+ tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
132
+ break
133
+ case 'top':
134
+ tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
135
+ break
136
+ case 'left':
137
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
138
+ break
139
+ case 'right':
140
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
141
+ break
142
+ }
143
+
144
+ $tip
145
+ .offset(tp)
146
+ .addClass(placement)
147
+ .addClass('in')
148
+ }
149
+ }
150
+
151
+ , setContent: function () {
152
+ var $tip = this.tip()
153
+ , title = this.getTitle()
154
 
155
+ $tip.find('.tooltip_tip-inner')[this.options.html ? 'html' : 'text'](title)
156
+ $tip.removeClass('fade in top bottom left right')
157
  }
158
 
159
+ , hide: function () {
160
+ var that = this
161
+ , $tip = this.tip()
162
 
163
+ $tip.removeClass('in')
 
164
 
165
+ function removeWithAnimation() {
166
+ var timeout = setTimeout(function () {
167
+ $tip.off($.support.transition.end).detach()
168
+ }, 500)
169
 
170
+ $tip.one($.support.transition.end, function () {
171
+ clearTimeout(timeout)
172
+ $tip.detach()
 
 
 
 
173
  })
174
+ }
175
+
176
+ $.support.transition && this.$tip.hasClass('fade') ?
177
+ removeWithAnimation() :
178
+ $tip.detach()
179
+
180
+ return this
181
+ }
182
+
183
+ , fixTitle: function () {
184
+ var $e = this.$element
185
+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
186
+ $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
187
+ }
188
  }
189
 
190
+ , hasContent: function () {
191
+ return this.getTitle()
192
+ }
193
 
194
+ , getPosition: function (inside) {
195
+ return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
196
+ width: this.$element[0].offsetWidth
197
+ , height: this.$element[0].offsetHeight
198
+ })
199
  }
200
 
201
+ , getTitle: function () {
202
+ var title
203
+ , $e = this.$element
204
+ , o = this.options
205
+
206
+ title = $e.attr('data-original-title')
207
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
208
+
209
+ return title
210
+ }
211
 
212
+ , tip: function () {
213
+ return this.$tip = this.$tip || $(this.options.template)
214
+ }
215
+
216
+ , validate: function () {
217
+ if (!this.$element[0].parentNode) {
218
+ this.hide()
219
+ this.$element = null
220
+ this.options = null
221
+ }
222
+ }
223
+
224
+ , enable: function () {
225
+ this.enabled = true
226
+ }
227
+
228
+ , disable: function () {
229
+ this.enabled = false
230
+ }
231
 
232
+ , toggleEnabled: function () {
233
+ this.enabled = !this.enabled
 
234
  }
235
 
236
+ , toggle: function (e) {
237
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
238
+ self[self.tip().hasClass('in') ? 'hide' : 'show']()
239
+ }
240
+
241
+ , destroy: function () {
242
+ this.hide().$element.off('.' + this.type).removeData(this.type)
243
+ }
244
+
245
+ }
246
+
247
+
248
+ /* TOOLTIP PLUGIN DEFINITION
249
+ * ========================= */
250
+
251
+ var old = $.fn.tooltip_tip
252
+
253
+ $.fn.tooltip_tip = function ( option ) {
254
+ return this.each(function () {
255
+ var $this = $(this)
256
+ , data = $this.data('tooltip_tip')
257
+ , options = typeof option == 'object' && option
258
+ if (!data) $this.data('tooltip_tip', (data = new Tooltip_tip(this, options)))
259
+ if (typeof option == 'string') data[option]()
260
+ })
261
+ }
262
+
263
+ $.fn.tooltip_tip.Constructor = Tooltip_tip
264
+
265
+ $.fn.tooltip_tip.defaults = {
266
+ animation: true
267
+ , placement: 'top'
268
+ , selector: false
269
+ , template: '<div class="tooltip_tip"><div class="tooltip_tip-arrow"></div><div class="tooltip_tip-inner"></div></div>'
270
+ , trigger: 'hover'
271
+ , title: ''
272
+ , delay: 0
273
+ , html: false
274
+ }
275
+
276
+
277
+ /* TOOLTIP NO CONFLICT
278
+ * =================== */
279
+
280
+ $.fn.tooltip_tip.noConflict = function () {
281
+ $.fn.tooltip_tip = old
282
+ return this
283
+ }
284
+
285
  }(window.jQuery);
assets/js/jquery.prettyPhoto.js CHANGED
@@ -1,385 +1,81 @@
1
  /* ------------------------------------------------------------------------
2
- prettyPhoto v3.1.5
3
- © Copyright, Stephane Caron
4
- http://www.no-margin-for-errors.com
5
-
6
-
7
- = ============================ Released under =============================
8
-
9
- GPLV2 license
10
- http://www.gnu.org/licenses/gpl-2.0.html
11
-
12
- You are free to use prettyPhoto in commercial projects as long as the
13
- copyright header is left intact.
14
-
15
- ============================ More information ============================
16
- http://www.no-margin-for-errors.com/projects/prettyPhoto/
17
-
18
-
19
- ============================== Description ===============================
20
-
21
- prettyPhoto is a jQuery based lightbox clone. Not only does it support images,
22
- it also add support for videos, flash, YouTube, iFrame. It's a full blown
23
- media modal box.
24
-
25
- Please refer to http://www.no-margin-for-errors.com/projects/prettyPhoto/
26
- for all the details on how to use.
27
- ------------------------------------------------------------------------- */
28
-
29
- (function (e) {
30
- function t() {
31
- var e = location.href;
32
- hashtag = e.indexOf("#prettyPhoto") !== -1 ? decodeURI(e.substring(e.indexOf("#prettyPhoto") + 1, e.length)) : false;
33
- return hashtag
34
- }
35
-
36
- function n() {
37
- if (typeof theRel == "undefined")
38
- return;
39
- location.hash = theRel + "/" + rel_index + "/"
40
- }
41
-
42
- function r() {
43
- if (location.href.indexOf("#prettyPhoto") !== -1)
44
- location.hash = "prettyPhoto"
45
- }
46
-
47
- function i(e, t) {
48
- e = e.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
49
- var n = "[\\?&]" + e + "=([^&#]*)";
50
- var r = new RegExp(n);
51
- var i = r.exec(t);
52
- return i == null ? "" : i[1]
53
- }
54
-
55
- e.prettyPhoto = {
56
- version: "3.1.5"
57
- };
58
- e.fn.prettyPhoto = function (s) {
59
- function g() {
60
- e(".pp_loaderIcon").hide();
61
- projectedTop = scroll_pos["scrollTop"] + (d / 2 - a["containerHeight"] / 2);
62
- if (projectedTop < 0)
63
- projectedTop = 0;
64
- $ppt.fadeTo(settings.animation_speed, 1);
65
- $pp_pic_holder.find(".pp_content").animate({
66
- height: a["contentHeight"],
67
- width: a["contentWidth"]
68
- }, settings.animation_speed);
69
- $pp_pic_holder.animate({
70
- top: projectedTop,
71
- left: v / 2 - a["containerWidth"] / 2 < 0 ? 0 : v / 2 - a["containerWidth"] / 2,
72
- width: a["containerWidth"]
73
- }, settings.animation_speed, function () {
74
- $pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(a["height"]).width(a["width"]);
75
- $pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);
76
- if (isSet && S(pp_images[set_position]) == "image") {
77
- $pp_pic_holder.find(".pp_hoverContainer").show()
78
- } else {
79
- $pp_pic_holder.find(".pp_hoverContainer").hide()
80
- }
81
- if (settings.allow_expand) {
82
- if (a["resized"]) {
83
- e("a.pp_expand,a.pp_contract").show()
84
- } else {
85
- e("a.pp_expand").hide()
86
- }
87
- }
88
- if (settings.autoplay_slideshow && !m && !f)
89
- e.prettyPhoto.startSlideshow();
90
- settings.changepicturecallback();
91
- f = true
92
- });
93
- C();
94
- s.ajaxcallback()
95
- }
96
-
97
- function y(t) {
98
- $pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility", "hidden");
99
- $pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed, function () {
100
- e(".pp_loaderIcon").show();
101
- t()
102
- })
103
- }
104
-
105
- function b(t) {
106
- t > 1 ? e(".pp_nav").show() : e(".pp_nav").hide()
107
- }
108
-
109
- function w(e, t) {
110
- resized = false;
111
- E(e, t);
112
- imageWidth = e, imageHeight = t;
113
- if ((p > v || h > d) && doresize && settings.allow_resize && !u) {
114
- resized = true, fitting = false;
115
- while (!fitting) {
116
- if (p > v) {
117
- imageWidth = v - 200;
118
- imageHeight = t / e * imageWidth
119
- } else if (h > d) {
120
- imageHeight = d - 200;
121
- imageWidth = e / t * imageHeight
122
- } else {
123
- fitting = true
124
- }
125
- h = imageHeight, p = imageWidth
126
- }
127
- if (p > v || h > d) {
128
- w(p, h)
129
- }
130
- E(imageWidth, imageHeight)
131
- }
132
- return {
133
- width: Math.floor(imageWidth),
134
- height: Math.floor(imageHeight),
135
- containerHeight: Math.floor(h),
136
- containerWidth: Math.floor(p) + settings.horizontal_padding * 2,
137
- contentHeight: Math.floor(l),
138
- contentWidth: Math.floor(c),
139
- resized: resized
140
- }
141
- }
142
-
143
- function E(t, n) {
144
- t = parseFloat(t);
145
- n = parseFloat(n);
146
- $pp_details = $pp_pic_holder.find(".pp_details");
147
- $pp_details.width(t);
148
- detailsHeight = parseFloat($pp_details.css("marginTop")) + parseFloat($pp_details.css("marginBottom"));
149
- $pp_details = $pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({
150
- position: "absolute",
151
- top: -1e4
152
- });
153
- detailsHeight += $pp_details.height();
154
- detailsHeight = detailsHeight <= 34 ? 36 : detailsHeight;
155
- $pp_details.remove();
156
- $pp_title = $pp_pic_holder.find(".ppt");
157
- $pp_title.width(t);
158
- titleHeight = parseFloat($pp_title.css("marginTop")) + parseFloat($pp_title.css("marginBottom"));
159
- $pp_title = $pp_title.clone().appendTo(e("body")).css({
160
- position: "absolute",
161
- top: -1e4
162
- });
163
- titleHeight += $pp_title.height();
164
- $pp_title.remove();
165
- l = n + detailsHeight;
166
- c = t;
167
- h = l + titleHeight + $pp_pic_holder.find(".pp_top").height() + $pp_pic_holder.find(".pp_bottom").height();
168
- p = t
169
- }
170
-
171
- function S(e) {
172
- if (e.match(/youtube\.com\/watch/i) || e.match(/youtu\.be/i)) {
173
- return "youtube"
174
- } else if (e.match(/vimeo\.com/i)) {
175
- return "vimeo"
176
- } else if (e.match(/\b.mov\b/i)) {
177
- return "quicktime"
178
- } else if (e.match(/\b.swf\b/i)) {
179
- return "flash"
180
- } else if (e.match(/\biframe=true\b/i)) {
181
- return "iframe"
182
- } else if (e.match(/\bajax=true\b/i)) {
183
- return "ajax"
184
- } else if (e.match(/\bcustom=true\b/i)) {
185
- return "custom"
186
- } else if (e.substr(0, 1) == "#") {
187
- return "inline"
188
- } else {
189
- return "image"
190
- }
191
- }
192
-
193
- function x() {
194
- if (doresize && typeof $pp_pic_holder != "undefined") {
195
- scroll_pos = T();
196
- contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width();
197
- projectedTop = d / 2 + scroll_pos["scrollTop"] - contentHeight / 2;
198
- if (projectedTop < 0)
199
- projectedTop = 0;
200
- if (contentHeight > d)
201
- return;
202
- $pp_pic_holder.css({
203
- top: projectedTop,
204
- left: v / 2 + scroll_pos["scrollLeft"] - contentwidth / 2
205
- })
206
- }
207
- }
208
-
209
- function T() {
210
- if (self.pageYOffset) {
211
- return {
212
- scrollTop: self.pageYOffset,
213
- scrollLeft: self.pageXOffset
214
- }
215
- } else if (document.documentElement && document.documentElement.scrollTop) {
216
- return {
217
- scrollTop: document.documentElement.scrollTop,
218
- scrollLeft: document.documentElement.scrollLeft
219
- }
220
- } else if (document.body) {
221
- return {
222
- scrollTop: document.body.scrollTop,
223
- scrollLeft: document.body.scrollLeft
224
- }
225
- }
226
- }
227
-
228
- function N() {
229
- d = e(window).height(), v = e(window).width();
230
- if (typeof $pp_overlay != "undefined")
231
- $pp_overlay.height(e(document).height()).width(v)
232
- }
233
-
234
- function C() {
235
- if (isSet && settings.overlay_gallery && S(pp_images[set_position]) == "image") {
236
- itemWidth = 52 + 5;
237
- navWidth = settings.theme == "facebook" || settings.theme == "pp_default" ? 50 : 30;
238
- itemsPerPage = Math.floor((a["containerWidth"] - 100 - navWidth) / itemWidth);
239
- itemsPerPage = itemsPerPage < pp_images.length ? itemsPerPage : pp_images.length;
240
- totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1;
241
- if (totalPage == 0) {
242
- navWidth = 0;
243
- $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide()
244
- } else {
245
- $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show()
246
- }
247
- galleryWidth = itemsPerPage * itemWidth;
248
- fullGalleryWidth = pp_images.length * itemWidth;
249
- $pp_gallery.css("margin-left", -(galleryWidth / 2 + navWidth / 2)).find("div:first").width(galleryWidth + 5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected");
250
- goToPage = Math.floor(set_position / itemsPerPage) < totalPage ? Math.floor(set_position / itemsPerPage) : totalPage;
251
- e.prettyPhoto.changeGalleryPage(goToPage);
252
- $pp_gallery_li.filter(":eq(" + set_position + ")").addClass("selected")
253
- } else {
254
- $pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave")
255
- }
256
- }
257
-
258
- function k(t) {
259
- if (settings.social_tools)
260
- facebook_like_link = settings.social_tools.replace("{location_href}", encodeURIComponent(location.href));
261
- settings.markup = settings.markup.replace("{pp_social}", "");
262
- e("body").append(settings.markup);
263
- $pp_pic_holder = e(".pp_pic_holder"), $ppt = e(".ppt"), $pp_overlay = e("div.pp_overlay");
264
- if (isSet && settings.overlay_gallery) {
265
- currentGalleryPage = 0;
266
- toInject = "";
267
- for (var n = 0; n < pp_images.length; n++) {
268
- if (!pp_images[n].match(/\b(jpg|jpeg|png|gif)\b/gi)) {
269
- classname = "default";
270
- img_src = ""
271
- } else {
272
- classname = "";
273
- img_src = pp_images[n]
274
- }
275
- toInject += "<li class='" + classname + "'><a href='#'><img src='" + img_src + "' width='50' alt='' /></a></li>"
276
- }
277
- toInject = settings.gallery_markup.replace(/{gallery}/g, toInject);
278
- $pp_pic_holder.find("#pp_full_res").after(toInject);
279
- $pp_gallery = e(".pp_pic_holder .pp_gallery"), $pp_gallery_li = $pp_gallery.find("li");
280
- $pp_gallery.find(".pp_arrow_next").click(function () {
281
- e.prettyPhoto.changeGalleryPage("next");
282
- e.prettyPhoto.stopSlideshow();
283
- return false
284
- });
285
- $pp_gallery.find(".pp_arrow_previous").click(function () {
286
- e.prettyPhoto.changeGalleryPage("previous");
287
- e.prettyPhoto.stopSlideshow();
288
- return false
289
- });
290
- $pp_pic_holder.find(".pp_content").hover(function () {
291
- $pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()
292
- }, function () {
293
- $pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()
294
- });
295
- itemWidth = 52 + 5;
296
- $pp_gallery_li.each(function (t) {
297
- e(this).find("a").click(function () {
298
- e.prettyPhoto.changePage(t);
299
- e.prettyPhoto.stopSlideshow();
300
- return false
301
- })
302
- })
303
- }
304
- if (settings.slideshow) {
305
- $pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>');
306
- $pp_pic_holder.find(".pp_nav .pp_play").click(function () {
307
- e.prettyPhoto.startSlideshow();
308
- return false
309
- })
310
- }
311
- $pp_pic_holder.attr("class", "pp_pic_holder " + settings.theme);
312
- $pp_overlay.css({
313
- opacity: 0,
314
- height: e(document).height(),
315
- width: e(window).width()
316
- }).bind("click", function () {
317
- if (!settings.modal)
318
- e.prettyPhoto.close()
319
- });
320
- e("a.pp_close").bind("click", function () {
321
- e.prettyPhoto.close();
322
- return false
323
- });
324
- if (settings.allow_expand) {
325
- e("a.pp_expand").bind("click", function (t) {
326
- if (e(this).hasClass("pp_expand")) {
327
- e(this).removeClass("pp_expand").addClass("pp_contract");
328
- doresize = false
329
- } else {
330
- e(this).removeClass("pp_contract").addClass("pp_expand");
331
- doresize = true
332
- }
333
- y(function () {
334
- e.prettyPhoto.open()
335
- });
336
- return false
337
- })
338
- }
339
- $pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click", function () {
340
- e.prettyPhoto.changePage("previous");
341
- e.prettyPhoto.stopSlideshow();
342
- return false
343
- });
344
- $pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click", function () {
345
- e.prettyPhoto.changePage("next");
346
- e.prettyPhoto.stopSlideshow();
347
- return false
348
- });
349
- x()
350
- }
351
-
352
- s = jQuery.extend({
353
- hook: "rel",
354
- animation_speed: "fast",
355
- ajaxcallback: function () {
356
- },
357
- slideshow: 5e3,
358
- autoplay_slideshow: false,
359
- opacity: .8,
360
- show_title: true,
361
- allow_resize: true,
362
- allow_expand: false,
363
- default_width: 500,
364
- default_height: 344,
365
- counter_separator_label: "/",
366
- theme: "pp_default",
367
- horizontal_padding: 20,
368
- hideflash: false,
369
- wmode: "opaque",
370
- autoplay: true,
371
- modal: false,
372
- deeplinking: false,
373
- overlay_gallery: true,
374
- overlay_gallery_max: 30,
375
- keyboard_shortcuts: true,
376
- changepicturecallback: function () {
377
- },
378
- callback: function () {
379
- },
380
- ie6_fallback: true,
381
- markup: '<div class="pp_pic_holder"> <div class="ppt"></div> <div class="pp_top"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> <div class="pp_content_container"> <div class="pp_left"> <div class="pp_right"> <div class="pp_content"> <div class="pp_loaderIcon"></div> <div class="pp_fade"> <a href="#" class="pp_expand" title="Expand the image">Expand</a> <div class="pp_hoverContainer"> <div class="pp_description"></div> </div> <div id="pp_full_res"></div> <div class="pp_details"> <div class="pp_nav"> <a href="#" class="pp_arrow_previous">Previous</a> <p class="currentTextHolder">0/0</p> <a href="#" class="pp_arrow_next">Next</a> </div> <div class="pp_social">{pp_social}</div> <a class="pp_close" href="#">Close</a> </div> </div> </div> </div> </div> </div> <div class="pp_bottom"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> </div> <div class="pp_overlay"></div>',
382
- gallery_markup: '<div class="pp_gallery"> \
383
  <a href="#" class="pp_arrow_previous">Previous</a> \
384
  <div> \
385
  <ul> \
@@ -388,311 +84,828 @@
388
  </div> \
389
  <a href="#" class="pp_arrow_next">Next</a> \
390
  </div>',
391
- image_markup: '<img id="fullResImage" src="{path}" />',
392
- flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
393
- quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
394
- iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
395
- inline_markup: '<div class="pp_inline">{content}</div>',
396
- custom_markup: "",
397
- social_tools: '<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>' /* html or false to disable */
398
- }, s);
399
- var o = this, u = false, a, f, l, c, h, p, d = e(window).height(), v = e(window).width(), m;
400
- doresize = true, scroll_pos = T();
401
- e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto", function () {
402
- x();
403
- N()
404
- });
405
- if (s.keyboard_shortcuts) {
406
- e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto", function (t) {
407
- if (typeof $pp_pic_holder != "undefined") {
408
- if ($pp_pic_holder.is(":visible")) {
409
- switch (t.keyCode) {
410
- case 37:
411
- e.prettyPhoto.changePage("previous");
412
- t.preventDefault();
413
- break;
414
- case 39:
415
- e.prettyPhoto.changePage("next");
416
- t.preventDefault();
417
- break;
418
- case 27:
419
- if (!settings.modal)
420
- e.prettyPhoto.close();
421
- t.preventDefault();
422
- break
423
- }
424
- }
425
- }
426
- })
427
- }
428
- e.prettyPhoto.initialize = function () {
429
- settings = s;
430
- if (settings.theme == "pp_default")
431
- settings.horizontal_padding = 16;
432
- theRel = e(this).attr(settings.hook);
433
- galleryRegExp = /\[(?:.*)\]/;
434
- isSet = galleryRegExp.exec(theRel) ? true : false;
435
- pp_images = isSet ? jQuery.map(o, function (t, n) {
436
- if (e(t).attr(settings.hook).indexOf(theRel) != -1)
437
- return e(t).attr("href")
438
- }) : e.makeArray(e(this).attr("href"));
439
- pp_titles = isSet ? jQuery.map(o, function (t, n) {
440
- if (e(t).attr(settings.hook).indexOf(theRel) != -1)
441
- return e(t).find("img").attr("alt") ? e(t).find("img").attr("alt") : ""
442
- }) : e.makeArray(e(this).find("img").attr("alt"));
443
- pp_descriptions = isSet ? jQuery.map(o, function (t, n) {
444
- if (e(t).attr(settings.hook).indexOf(theRel) != -1)
445
- return e(t).attr("data-title") ? e(t).attr("data-title") : ""
446
- }) : e.makeArray(e(this).attr("data-title"));
447
- if (pp_images.length > settings.overlay_gallery_max)
448
- settings.overlay_gallery = false;
449
- set_position = jQuery.inArray(e(this).attr("href"), pp_images);
450
- rel_index = isSet ? set_position : e("a[" + settings.hook + "^='" + theRel + "']").index(e(this));
451
- k(this);
452
- if (settings.allow_resize)
453
- e(window).bind("scroll.prettyphoto", function () {
454
- x()
455
- });
456
- e.prettyPhoto.open();
457
- return false
458
- };
459
- e.prettyPhoto.open = function (t) {
460
- if (typeof settings == "undefined") {
461
- settings = s;
462
- pp_images = e.makeArray(arguments[0]);
463
- pp_titles = arguments[1] ? e.makeArray(arguments[1]) : e.makeArray("");
464
- pp_descriptions = arguments[2] ? e.makeArray(arguments[2]) : e.makeArray("");
465
- isSet = pp_images.length > 1 ? true : false;
466
- set_position = arguments[3] ? arguments[3] : 0;
467
- k(t.target)
468
- }
469
- if (settings.hideflash)
470
- e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "hidden");
471
- b(e(pp_images).size());
472
- e(".pp_loaderIcon").show();
473
- if (settings.deeplinking)
474
- n();
475
- if (settings.social_tools) {
476
- facebook_like_link = settings.social_tools.replace("{location_href}", encodeURIComponent(location.href));
477
- $pp_pic_holder.find(".pp_social").html(facebook_like_link)
478
- }
479
- if ($ppt.is(":hidden"))
480
- $ppt.css("opacity", 0).show();
481
- $pp_overlay.show().fadeTo(settings.animation_speed, settings.opacity);
482
- $pp_pic_holder.find(".currentTextHolder").text(set_position + 1 + settings.counter_separator_label + e(pp_images).size());
483
- if (typeof pp_descriptions[set_position] != "undefined" && pp_descriptions[set_position] != "") {
484
- $pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]))
485
- } else {
486
- $pp_pic_holder.find(".pp_description").hide()
487
- }
488
- movie_width = parseFloat(i("width", pp_images[set_position])) ? i("width", pp_images[set_position]) : settings.default_width.toString();
489
- movie_height = parseFloat(i("height", pp_images[set_position])) ? i("height", pp_images[set_position]) : settings.default_height.toString();
490
- u = false;
491
- if (movie_height.indexOf("%") != -1) {
492
- movie_height = parseFloat(e(window).height() * parseFloat(movie_height) / 100 - 150);
493
- u = true
494
- }
495
- if (movie_width.indexOf("%") != -1) {
496
- movie_width = parseFloat(e(window).width() * parseFloat(movie_width) / 100 - 150);
497
- u = true
498
- }
499
- $pp_pic_holder.fadeIn(function () {
500
- settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined" ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html(" ");
501
- imgPreloader = "";
502
- skipInjection = false;
503
- switch (S(pp_images[set_position])) {
504
- case"image":
505
- imgPreloader = new Image;
506
- nextImage = new Image;
507
- if (isSet && set_position < e(pp_images).size() - 1)
508
- nextImage.src = pp_images[set_position + 1];
509
- prevImage = new Image;
510
- if (isSet && pp_images[set_position - 1])
511
- prevImage.src = pp_images[set_position - 1];
512
- $pp_pic_holder.find("#pp_full_res")[0].innerHTML = settings.image_markup.replace(/{path}/g, pp_images[set_position]);
513
- imgPreloader.onload = function () {
514
- a = w(imgPreloader.width, imgPreloader.height);
515
- g()
516
- };
517
- imgPreloader.onerror = function () {
518
- alert("Image cannot be loaded. Make sure the path is correct and image exist.");
519
- e.prettyPhoto.close()
520
- };
521
- imgPreloader.src = pp_images[set_position];
522
- break;
523
- case"youtube":
524
- a = w(movie_width, movie_height);
525
- movie_id = i("v", pp_images[set_position]);
526
- if (movie_id == "") {
527
- movie_id = pp_images[set_position].split("youtu.be/");
528
- movie_id = movie_id[1];
529
- if (movie_id.indexOf("?") > 0)
530
- movie_id = movie_id.substr(0, movie_id.indexOf("?"));
531
- if (movie_id.indexOf("&") > 0)
532
- movie_id = movie_id.substr(0, movie_id.indexOf("&"))
533
- }
534
- movie = "http://www.youtube.com/embed/" + movie_id;
535
- i("rel", pp_images[set_position]) ? movie += "?rel=" + i("rel", pp_images[set_position]) : movie += "?rel=1";
536
- if (settings.autoplay)
537
- movie += "&autoplay=1";
538
- toInject = settings.iframe_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, movie);
539
- break;
540
- case"vimeo":
541
- a = w(movie_width, movie_height);
542
- movie_id = pp_images[set_position];
543
- var t = /http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;
544
- var n = movie_id.match(t);
545
- movie = "http://player.vimeo.com/video/" + n[3] + "?title=0&byline=0&portrait=0";
546
- if (settings.autoplay)
547
- movie += "&autoplay=1;";
548
- vimeo_width = a["width"] + "/embed/?moog_width=" + a["width"];
549
- toInject = settings.iframe_markup.replace(/{width}/g, vimeo_width).replace(/{height}/g, a["height"]).replace(/{path}/g, movie);
550
- break;
551
- case"quicktime":
552
- a = w(movie_width, movie_height);
553
- a["height"] += 15;
554
- a["contentHeight"] += 15;
555
- a["containerHeight"] += 15;
556
- toInject = settings.quicktime_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, pp_images[set_position]).replace(/{autoplay}/g, settings.autoplay);
557
- break;
558
- case"flash":
559
- a = w(movie_width, movie_height);
560
- flash_vars = pp_images[set_position];
561
- flash_vars = flash_vars.substring(pp_images[set_position].indexOf("flashvars") + 10, pp_images[set_position].length);
562
- filename = pp_images[set_position];
563
- filename = filename.substring(0, filename.indexOf("?"));
564
- toInject = settings.flash_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, filename + "?" + flash_vars);
565
- break;
566
- case"iframe":
567
- a = w(movie_width, movie_height);
568
- frame_url = pp_images[set_position];
569
- frame_url = frame_url.substr(0, frame_url.indexOf("iframe") - 1);
570
- toInject = settings.iframe_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{path}/g, frame_url);
571
- break;
572
- case"ajax":
573
- doresize = false;
574
- a = w(movie_width, movie_height);
575
- doresize = true;
576
- skipInjection = true;
577
- e.get(pp_images[set_position], function (e) {
578
- toInject = settings.inline_markup.replace(/{content}/g, e);
579
- $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject;
580
- g()
581
- });
582
- break;
583
- case"custom":
584
- a = w(movie_width, movie_height);
585
- toInject = settings.custom_markup;
586
- break;
587
- case"inline":
588
- myClone = e(pp_images[set_position]).clone().append('<br clear="all" />').css({
589
- width: settings.default_width
590
- }).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo(e("body")).show();
591
- doresize = false;
592
- a = w(e(myClone).width(), e(myClone).height());
593
- doresize = true;
594
- e(myClone).remove();
595
- toInject = settings.inline_markup.replace(/{content}/g, e(pp_images[set_position]).html());
596
- break
597
- }
598
- if (!imgPreloader && !skipInjection) {
599
- $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject;
600
- g()
601
- }
602
- });
603
- return false
604
- };
605
- e.prettyPhoto.changePage = function (t) {
606
- currentGalleryPage = 0;
607
- if (t == "previous") {
608
- set_position--;
609
- if (set_position < 0)
610
- set_position = e(pp_images).size() - 1
611
- } else if (t == "next") {
612
- set_position++;
613
- if (set_position > e(pp_images).size() - 1)
614
- set_position = 0
615
- } else {
616
- set_position = t
617
- }
618
- rel_index = set_position;
619
- if (!doresize)
620
- doresize = true;
621
- if (settings.allow_expand) {
622
- e(".pp_contract").removeClass("pp_contract").addClass("pp_expand")
623
- }
624
- y(function () {
625
- e.prettyPhoto.open()
626
- })
627
- };
628
- e.prettyPhoto.changeGalleryPage = function (e) {
629
- if (e == "next") {
630
- currentGalleryPage++;
631
- if (currentGalleryPage > totalPage)
632
- currentGalleryPage = 0
633
- } else if (e == "previous") {
634
- currentGalleryPage--;
635
- if (currentGalleryPage < 0)
636
- currentGalleryPage = totalPage
637
- } else {
638
- currentGalleryPage = e
639
- }
640
- slide_speed = e == "next" || e == "previous" ? settings.animation_speed : 0;
641
- slide_to = currentGalleryPage * itemsPerPage * itemWidth;
642
- $pp_gallery.find("ul").animate({
643
- left: -slide_to
644
- }, slide_speed)
645
- };
646
- e.prettyPhoto.startSlideshow = function () {
647
- if (typeof m == "undefined") {
648
- $pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function () {
649
- e.prettyPhoto.stopSlideshow();
650
- return false
651
- });
652
- m = setInterval(e.prettyPhoto.startSlideshow, settings.slideshow)
653
- } else {
654
- e.prettyPhoto.changePage("next")
655
- }
656
- };
657
- e.prettyPhoto.stopSlideshow = function () {
658
- $pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function () {
659
- e.prettyPhoto.startSlideshow();
660
- return false
661
- });
662
- clearInterval(m);
663
- m = undefined
664
- };
665
- e.prettyPhoto.close = function () {
666
- if ($pp_overlay.is(":animated"))
667
- return;
668
- e.prettyPhoto.stopSlideshow();
669
- $pp_pic_holder.stop().find("object,embed").css("visibility", "hidden");
670
- e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed, function () {
671
- e(this).remove()
672
- });
673
- $pp_overlay.fadeOut(settings.animation_speed, function () {
674
- if (settings.hideflash)
675
- e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "visible");
676
- e(this).remove();
677
- e(window).unbind("scroll.prettyphoto");
678
- r();
679
- settings.callback();
680
- doresize = true;
681
- f = false;
682
- delete settings
683
- })
684
- };
685
- if (!pp_alreadyInitialized && t()) {
686
- pp_alreadyInitialized = true;
687
- hashIndex = t();
688
- hashRel = hashIndex;
689
- hashIndex = hashIndex.substring(hashIndex.indexOf("/") + 1, hashIndex.length - 1);
690
- hashRel = hashRel.substring(0, hashRel.indexOf("/"));
691
- setTimeout(function () {
692
- e("a[" + s.hook + "^='" + hashRel + "']:eq(" + hashIndex + ")").trigger("click")
693
- }, 50)
694
- }
695
- return this.unbind("click.prettyphoto").bind("click.prettyphoto", e.prettyPhoto.initialize)
696
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
697
  })(jQuery);
698
- var pp_alreadyInitialized = false
 
1
  /* ------------------------------------------------------------------------
2
+ Class: prettyPhoto
3
+ Use: Lightbox clone for jQuery
4
+ Author: Stephane Caron (http://www.no-margin-for-errors.com)
5
+ Version: 3.1.6
6
+ ------------------------------------------------------------------------- */
7
+ (function($) {
8
+ $.prettyPhoto = {version: '3.1.6'};
9
+
10
+ $.fn.prettyPhoto = function(pp_settings) {
11
+ pp_settings = jQuery.extend({
12
+ hook: 'rel', /* the attribute tag to use for prettyPhoto hooks. default: 'rel'. For HTML5, use "data-rel" or similar. */
13
+ animation_speed: 'fast', /* fast/slow/normal */
14
+ ajaxcallback: function() {},
15
+ slideshow: 5000, /* false OR interval time in ms */
16
+ autoplay_slideshow: false, /* true/false */
17
+ opacity: 0.80, /* Value between 0 and 1 */
18
+ show_title: true, /* true/false */
19
+ allow_resize: true, /* Resize the photos bigger than viewport. true/false */
20
+ allow_expand: true, /* Allow the user to expand a resized image. true/false */
21
+ default_width: 500,
22
+ default_height: 344,
23
+ counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
24
+ theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
25
+ horizontal_padding: 20, /* The padding on each side of the picture */
26
+ hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
27
+ wmode: 'opaque', /* Set the flash wmode attribute */
28
+ autoplay: true, /* Automatically start videos: True/False */
29
+ modal: false, /* If set to true, only the close button will close the window */
30
+ deeplinking: true, /* Allow prettyPhoto to update the url to enable deeplinking. */
31
+ overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
32
+ overlay_gallery_max: 30, /* Maximum number of pictures in the overlay gallery */
33
+ keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
34
+ changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
35
+ callback: function(){}, /* Called when prettyPhoto is closed */
36
+ ie6_fallback: true,
37
+ markup: '<div class="pp_pic_holder"> \
38
+ <div class="ppt">&nbsp;</div> \
39
+ <div class="pp_top"> \
40
+ <div class="pp_left"></div> \
41
+ <div class="pp_middle"></div> \
42
+ <div class="pp_right"></div> \
43
+ </div> \
44
+ <div class="pp_content_container"> \
45
+ <div class="pp_left"> \
46
+ <div class="pp_right"> \
47
+ <div class="pp_content"> \
48
+ <div class="pp_loaderIcon"></div> \
49
+ <div class="pp_fade"> \
50
+ <a href="#" class="pp_expand" title="Expand the image">Expand</a> \
51
+ <div class="pp_hoverContainer"> \
52
+ <a class="pp_next" href="#">next</a> \
53
+ <a class="pp_previous" href="#">previous</a> \
54
+ </div> \
55
+ <div id="pp_full_res"></div> \
56
+ <div class="pp_details"> \
57
+ <div class="pp_nav"> \
58
+ <a href="#" class="pp_arrow_previous">Previous</a> \
59
+ <p class="currentTextHolder">0/0</p> \
60
+ <a href="#" class="pp_arrow_next">Next</a> \
61
+ </div> \
62
+ <p class="pp_description"></p> \
63
+ <div class="pp_social">{pp_social}</div> \
64
+ <a class="pp_close" href="#">Close</a> \
65
+ </div> \
66
+ </div> \
67
+ </div> \
68
+ </div> \
69
+ </div> \
70
+ </div> \
71
+ <div class="pp_bottom"> \
72
+ <div class="pp_left"></div> \
73
+ <div class="pp_middle"></div> \
74
+ <div class="pp_right"></div> \
75
+ </div> \
76
+ </div> \
77
+ <div class="pp_overlay"></div>',
78
+ gallery_markup: '<div class="pp_gallery"> \
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  <a href="#" class="pp_arrow_previous">Previous</a> \
80
  <div> \
81
  <ul> \
84
  </div> \
85
  <a href="#" class="pp_arrow_next">Next</a> \
86
  </div>',
87
+ image_markup: '<img id="fullResImage" src="{path}" />',
88
+ flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
89
+ quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
90
+ iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
91
+ inline_markup: '<div class="pp_inline">{content}</div>',
92
+ custom_markup: '',
93
+ social_tools: '<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>' /* html or false to disable */
94
+ }, pp_settings);
95
+
96
+ // Global variables accessible only by prettyPhoto
97
+ var matchedObjects = this, percentBased = false, pp_dimensions, pp_open,
98
+
99
+ // prettyPhoto container specific
100
+ pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth,
101
+
102
+ // Window size
103
+ windowHeight = $(window).height(), windowWidth = $(window).width(),
104
+
105
+ // Global elements
106
+ pp_slideshow;
107
+
108
+ doresize = true, scroll_pos = _get_scroll();
109
+
110
+ // Window/Keyboard events
111
+ $(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){ _center_overlay(); _resize_overlay(); });
112
+
113
+ if(pp_settings.keyboard_shortcuts) {
114
+ $(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){
115
+ if(typeof $pp_pic_holder != 'undefined'){
116
+ if($pp_pic_holder.is(':visible')){
117
+ switch(e.keyCode){
118
+ case 37:
119
+ $.prettyPhoto.changePage('previous');
120
+ e.preventDefault();
121
+ break;
122
+ case 39:
123
+ $.prettyPhoto.changePage('next');
124
+ e.preventDefault();
125
+ break;
126
+ case 27:
127
+ if(!settings.modal)
128
+ $.prettyPhoto.close();
129
+ e.preventDefault();
130
+ break;
131
+ };
132
+ // return false;
133
+ };
134
+ };
135
+ });
136
+ };
137
+
138
+ /**
139
+ * Initialize prettyPhoto.
140
+ */
141
+ $.prettyPhoto.initialize = function() {
142
+
143
+ settings = pp_settings;
144
+
145
+ if(settings.theme == 'pp_default') settings.horizontal_padding = 16;
146
+
147
+ // Find out if the picture is part of a set
148
+ theRel = $(this).attr(settings.hook);
149
+ galleryRegExp = /\[(?:.*)\]/;
150
+ isSet = (galleryRegExp.exec(theRel)) ? true : false;
151
+
152
+ // Put the SRCs, TITLEs, ALTs into an array.
153
+ pp_images = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return $(n).attr('href'); }) : $.makeArray($(this).attr('href'));
154
+ pp_titles = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt') : ""; }) : $.makeArray($(this).find('img').attr('alt'));
155
+ pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return ($(n).attr('title')) ? $(n).attr('title') : ""; }) : $.makeArray($(this).attr('title'));
156
+
157
+ if(pp_images.length > settings.overlay_gallery_max) settings.overlay_gallery = false;
158
+
159
+ set_position = jQuery.inArray($(this).attr('href'), pp_images); // Define where in the array the clicked item is positionned
160
+ rel_index = (isSet) ? set_position : $("a["+settings.hook+"^='"+theRel+"']").index($(this));
161
+
162
+ _build_overlay(this); // Build the overlay {this} being the caller
163
+
164
+ if(settings.allow_resize)
165
+ $(window).bind('scroll.prettyphoto',function(){ _center_overlay(); });
166
+
167
+
168
+ $.prettyPhoto.open();
169
+
170
+ return false;
171
+ }
172
+
173
+
174
+ /**
175
+ * Opens the prettyPhoto modal box.
176
+ * @param image {String,Array} Full path to the image to be open, can also be an array containing full images paths.
177
+ * @param title {String,Array} The title to be displayed with the picture, can also be an array containing all the titles.
178
+ * @param description {String,Array} The description to be displayed with the picture, can also be an array containing all the descriptions.
179
+ */
180
+ $.prettyPhoto.open = function(event) {
181
+ if(typeof settings == "undefined"){ // Means it's an API call, need to manually get the settings and set the variables
182
+ settings = pp_settings;
183
+ pp_images = $.makeArray(arguments[0]);
184
+ pp_titles = (arguments[1]) ? $.makeArray(arguments[1]) : $.makeArray("");
185
+ pp_descriptions = (arguments[2]) ? $.makeArray(arguments[2]) : $.makeArray("");
186
+ isSet = (pp_images.length > 1) ? true : false;
187
+ set_position = (arguments[3])? arguments[3]: 0;
188
+ _build_overlay(event.target); // Build the overlay {this} being the caller
189
+ }
190
+
191
+ if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden'); // Hide the flash
192
+
193
+ _checkPosition($(pp_images).size()); // Hide the next/previous links if on first or last images.
194
+
195
+ $('.pp_loaderIcon').show();
196
+
197
+ if(settings.deeplinking)
198
+ setHashtag();
199
+
200
+ // Rebuild Facebook Like Button with updated href
201
+ if(settings.social_tools){
202
+ facebook_like_link = settings.social_tools.replace('{location_href}', encodeURIComponent(location.href));
203
+ $pp_pic_holder.find('.pp_social').html(facebook_like_link);
204
+ }
205
+
206
+ // Fade the content in
207
+ if($ppt.is(':hidden')) $ppt.css('opacity',0).show();
208
+ $pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);
209
+
210
+ // Display the current position
211
+ $pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).size());
212
+
213
+ // Set the description
214
+ if(typeof pp_descriptions[set_position] != 'undefined' && pp_descriptions[set_position] != ""){
215
+ $pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));
216
+ }else{
217
+ $pp_pic_holder.find('.pp_description').hide();
218
+ }
219
+
220
+ // Get the dimensions
221
+ movie_width = ( parseFloat(getParam('width',pp_images[set_position])) ) ? getParam('width',pp_images[set_position]) : settings.default_width.toString();
222
+ movie_height = ( parseFloat(getParam('height',pp_images[set_position])) ) ? getParam('height',pp_images[set_position]) : settings.default_height.toString();
223
+
224
+ // If the size is % based, calculate according to window dimensions
225
+ percentBased=false;
226
+ if(movie_height.indexOf('%') != -1) { movie_height = parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150); percentBased = true; }
227
+ if(movie_width.indexOf('%') != -1) { movie_width = parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150); percentBased = true; }
228
+
229
+ // Fade the holder
230
+ $pp_pic_holder.fadeIn(function(){
231
+ // Set the title
232
+ (settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined") ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html('&nbsp;');
233
+
234
+ imgPreloader = "";
235
+ skipInjection = false;
236
+
237
+ // Inject the proper content
238
+ switch(_getFileType(pp_images[set_position])){
239
+ case 'image':
240
+ imgPreloader = new Image();
241
+
242
+ // Preload the neighbour images
243
+ nextImage = new Image();
244
+ if(isSet && set_position < $(pp_images).size() -1) nextImage.src = pp_images[set_position + 1];
245
+ prevImage = new Image();
246
+ if(isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1];
247
+
248
+ $pp_pic_holder.find('#pp_full_res')[0].innerHTML = settings.image_markup.replace(/{path}/g,pp_images[set_position]);
249
+
250
+ imgPreloader.onload = function(){
251
+ // Fit item to viewport
252
+ pp_dimensions = _fitToViewport(imgPreloader.width,imgPreloader.height);
253
+
254
+ _showContent();
255
+ };
256
+
257
+ imgPreloader.onerror = function(){
258
+ alert('Image cannot be loaded. Make sure the path is correct and image exist.');
259
+ $.prettyPhoto.close();
260
+ };
261
+
262
+ imgPreloader.src = pp_images[set_position];
263
+ break;
264
+
265
+ case 'youtube':
266
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
267
+
268
+ // Regular youtube link
269
+ movie_id = getParam('v',pp_images[set_position]);
270
+
271
+ // youtu.be link
272
+ if(movie_id == ""){
273
+ movie_id = pp_images[set_position].split('youtu.be/');
274
+ movie_id = movie_id[1];
275
+ if(movie_id.indexOf('?') > 0)
276
+ movie_id = movie_id.substr(0,movie_id.indexOf('?')); // Strip anything after the ?
277
+
278
+ if(movie_id.indexOf('&') > 0)
279
+ movie_id = movie_id.substr(0,movie_id.indexOf('&')); // Strip anything after the &
280
+ }
281
+
282
+ movie = 'http://www.youtube.com/embed/'+movie_id;
283
+ (getParam('rel',pp_images[set_position])) ? movie+="?rel="+getParam('rel',pp_images[set_position]) : movie+="?rel=1";
284
+
285
+ if(settings.autoplay) movie += "&autoplay=1";
286
+
287
+ toInject = settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);
288
+ break;
289
+
290
+ case 'vimeo':
291
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
292
+
293
+ movie_id = pp_images[set_position];
294
+ var regExp = /http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;
295
+ var match = movie_id.match(regExp);
296
+
297
+ movie = 'http://player.vimeo.com/video/'+ match[3] +'?title=0&amp;byline=0&amp;portrait=0';
298
+ if(settings.autoplay) movie += "&autoplay=1;";
299
+
300
+ vimeo_width = pp_dimensions['width'] + '/embed/?moog_width='+ pp_dimensions['width'];
301
+
302
+ toInject = settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie);
303
+ break;
304
+
305
+ case 'quicktime':
306
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
307
+ pp_dimensions['height']+=15; pp_dimensions['contentHeight']+=15; pp_dimensions['containerHeight']+=15; // Add space for the control bar
308
+
309
+ toInject = settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);
310
+ break;
311
+
312
+ case 'flash':
313
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
314
+
315
+ flash_vars = pp_images[set_position];
316
+ flash_vars = flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10,pp_images[set_position].length);
317
+
318
+ filename = pp_images[set_position];
319
+ filename = filename.substring(0,filename.indexOf('?'));
320
+
321
+ toInject = settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);
322
+ break;
323
+
324
+ case 'iframe':
325
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
326
+
327
+ frame_url = pp_images[set_position];
328
+ frame_url = frame_url.substr(0,frame_url.indexOf('iframe')-1);
329
+
330
+ toInject = settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url);
331
+ break;
332
+
333
+ case 'ajax':
334
+ doresize = false; // Make sure the dimensions are not resized.
335
+ pp_dimensions = _fitToViewport(movie_width,movie_height);
336
+ doresize = true; // Reset the dimensions
337
+
338
+ skipInjection = true;
339
+ $.get(pp_images[set_position],function(responseHTML){
340
+ toInject = settings.inline_markup.replace(/{content}/g,responseHTML);
341
+ $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject;
342
+ _showContent();
343
+ });
344
+
345
+ break;
346
+
347
+ case 'custom':
348
+ pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
349
+
350
+ toInject = settings.custom_markup;
351
+ break;
352
+
353
+ case 'inline':
354
+ // to get the item height clone it, apply default width, wrap it in the prettyPhoto containers , then delete
355
+ myClone = $(pp_images[set_position]).clone().append('<br clear="all" />').css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo($('body')).show();
356
+ doresize = false; // Make sure the dimensions are not resized.
357
+ pp_dimensions = _fitToViewport($(myClone).width(),$(myClone).height());
358
+ doresize = true; // Reset the dimensions
359
+ $(myClone).remove();
360
+ toInject = settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());
361
+ break;
362
+ };
363
+
364
+ if(!imgPreloader && !skipInjection){
365
+ $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject;
366
+
367
+ // Show content
368
+ _showContent();
369
+ };
370
+ });
371
+
372
+ return false;
373
+ };
374
+
375
+
376
+ /**
377
+ * Change page in the prettyPhoto modal box
378
+ * @param direction {String} Direction of the paging, previous or next.
379
+ */
380
+ $.prettyPhoto.changePage = function(direction){
381
+ currentGalleryPage = 0;
382
+
383
+ if(direction == 'previous') {
384
+ set_position--;
385
+ if (set_position < 0) set_position = $(pp_images).size()-1;
386
+ }else if(direction == 'next'){
387
+ set_position++;
388
+ if(set_position > $(pp_images).size()-1) set_position = 0;
389
+ }else{
390
+ set_position=direction;
391
+ };
392
+
393
+ rel_index = set_position;
394
+
395
+ if(!doresize) doresize = true; // Allow the resizing of the images
396
+ if(settings.allow_expand) {
397
+ $('.pp_contract').removeClass('pp_contract').addClass('pp_expand');
398
+ }
399
+
400
+ _hideContent(function(){ $.prettyPhoto.open(); });
401
+ };
402
+
403
+
404
+ /**
405
+ * Change gallery page in the prettyPhoto modal box
406
+ * @param direction {String} Direction of the paging, previous or next.
407
+ */
408
+ $.prettyPhoto.changeGalleryPage = function(direction){
409
+ if(direction=='next'){
410
+ currentGalleryPage ++;
411
+
412
+ if(currentGalleryPage > totalPage) currentGalleryPage = 0;
413
+ }else if(direction=='previous'){
414
+ currentGalleryPage --;
415
+
416
+ if(currentGalleryPage < 0) currentGalleryPage = totalPage;
417
+ }else{
418
+ currentGalleryPage = direction;
419
+ };
420
+
421
+ slide_speed = (direction == 'next' || direction == 'previous') ? settings.animation_speed : 0;
422
+
423
+ slide_to = currentGalleryPage * (itemsPerPage * itemWidth);
424
+
425
+ $pp_gallery.find('ul').animate({left:-slide_to},slide_speed);
426
+ };
427
+
428
+
429
+ /**
430
+ * Start the slideshow...
431
+ */
432
+ $.prettyPhoto.startSlideshow = function(){
433
+ if(typeof pp_slideshow == 'undefined'){
434
+ $pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){
435
+ $.prettyPhoto.stopSlideshow();
436
+ return false;
437
+ });
438
+ pp_slideshow = setInterval($.prettyPhoto.startSlideshow,settings.slideshow);
439
+ }else{
440
+ $.prettyPhoto.changePage('next');
441
+ };
442
+ }
443
+
444
+
445
+ /**
446
+ * Stop the slideshow...
447
+ */
448
+ $.prettyPhoto.stopSlideshow = function(){
449
+ $pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){
450
+ $.prettyPhoto.startSlideshow();
451
+ return false;
452
+ });
453
+ clearInterval(pp_slideshow);
454
+ pp_slideshow=undefined;
455
+ }
456
+
457
+
458
+ /**
459
+ * Closes prettyPhoto.
460
+ */
461
+ $.prettyPhoto.close = function(){
462
+ if($pp_overlay.is(":animated")) return;
463
+
464
+ $.prettyPhoto.stopSlideshow();
465
+
466
+ $pp_pic_holder.stop().find('object,embed').css('visibility','hidden');
467
+
468
+ $('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){ $(this).remove(); });
469
+
470
+ $pp_overlay.fadeOut(settings.animation_speed, function(){
471
+
472
+ if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible'); // Show the flash
473
+
474
+ $(this).remove(); // No more need for the prettyPhoto markup
475
+
476
+ $(window).unbind('scroll.prettyphoto');
477
+
478
+ clearHashtag();
479
+
480
+ settings.callback();
481
+
482
+ doresize = true;
483
+
484
+ pp_open = false;
485
+
486
+ delete settings;
487
+ });
488
+ };
489
+
490
+ /**
491
+ * Set the proper sizes on the containers and animate the content in.
492
+ */
493
+ function _showContent(){
494
+ $('.pp_loaderIcon').hide();
495
+
496
+ // Calculate the opened top position of the pic holder
497
+ projectedTop = scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2));
498
+ if(projectedTop < 0) projectedTop = 0;
499
+
500
+ $ppt.fadeTo(settings.animation_speed,1);
501
+
502
+ // Resize the content holder
503
+ $pp_pic_holder.find('.pp_content')
504
+ .animate({
505
+ height:pp_dimensions['contentHeight'],
506
+ width:pp_dimensions['contentWidth']
507
+ },settings.animation_speed);
508
+
509
+ // Resize picture the holder
510
+ $pp_pic_holder.animate({
511
+ 'top': projectedTop,
512
+ 'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0 : (windowWidth/2) - (pp_dimensions['containerWidth']/2),
513
+ width:pp_dimensions['containerWidth']
514
+ },settings.animation_speed,function(){
515
+ $pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);
516
+
517
+ $pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); // Fade the new content
518
+
519
+ // Show the nav
520
+ if(isSet && _getFileType(pp_images[set_position])=="image") { $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); }
521
+
522
+ if(settings.allow_expand) {
523
+ if(pp_dimensions['resized']){ // Fade the resizing link if the image is resized
524
+ $('a.pp_expand,a.pp_contract').show();
525
+ }else{
526
+ $('a.pp_expand').hide();
527
+ }
528
+ }
529
+
530
+ if(settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow();
531
+
532
+ settings.changepicturecallback(); // Callback!
533
+
534
+ pp_open = true;
535
+ });
536
+
537
+ _insert_gallery();
538
+ pp_settings.ajaxcallback();
539
+ };
540
+
541
+ /**
542
+ * Hide the content...DUH!
543
+ */
544
+ function _hideContent(callback){
545
+ // Fade out the current picture
546
+ $pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');
547
+ $pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){
548
+ $('.pp_loaderIcon').show();
549
+
550
+ callback();
551
+ });
552
+ };
553
+
554
+ /**
555
+ * Check the item position in the gallery array, hide or show the navigation links
556
+ * @param setCount {integer} The total number of items in the set
557
+ */
558
+ function _checkPosition(setCount){
559
+ (setCount > 1) ? $('.pp_nav').show() : $('.pp_nav').hide(); // Hide the bottom nav if it's not a set.
560
+ };
561
+
562
+ /**
563
+ * Resize the item dimensions if it's bigger than the viewport
564
+ * @param width {integer} Width of the item to be opened
565
+ * @param height {integer} Height of the item to be opened
566
+ * @return An array containin the "fitted" dimensions
567
+ */
568
+ function _fitToViewport(width,height){
569
+ resized = false;
570
+
571
+ _getDimensions(width,height);
572
+
573
+ // Define them in case there's no resize needed
574
+ imageWidth = width, imageHeight = height;
575
+
576
+ if( ((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) && doresize && settings.allow_resize && !percentBased) {
577
+ resized = true, fitting = false;
578
+
579
+ while (!fitting){
580
+ if((pp_containerWidth > windowWidth)){
581
+ imageWidth = (windowWidth - 200);
582
+ imageHeight = (height/width) * imageWidth;
583
+ }else if((pp_containerHeight > windowHeight)){
584
+ imageHeight = (windowHeight - 200);
585
+ imageWidth = (width/height) * imageHeight;
586
+ }else{
587
+ fitting = true;
588
+ };
589
+
590
+ pp_containerHeight = imageHeight, pp_containerWidth = imageWidth;
591
+ };
592
+
593
+
594
+
595
+ if((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)){
596
+ _fitToViewport(pp_containerWidth,pp_containerHeight)
597
+ };
598
+
599
+ _getDimensions(imageWidth,imageHeight);
600
+ };
601
+
602
+ return {
603
+ width:Math.floor(imageWidth),
604
+ height:Math.floor(imageHeight),
605
+ containerHeight:Math.floor(pp_containerHeight),
606
+ containerWidth:Math.floor(pp_containerWidth) + (settings.horizontal_padding * 2),
607
+ contentHeight:Math.floor(pp_contentHeight),
608
+ contentWidth:Math.floor(pp_contentWidth),
609
+ resized:resized
610
+ };
611
+ };
612
+
613
+ /**
614
+ * Get the containers dimensions according to the item size
615
+ * @param width {integer} Width of the item to be opened
616
+ * @param height {integer} Height of the item to be opened
617
+ */
618
+ function _getDimensions(width,height){
619
+ width = parseFloat(width);
620
+ height = parseFloat(height);
621
+
622
+ // Get the details height, to do so, I need to clone it since it's invisible
623
+ $pp_details = $pp_pic_holder.find('.pp_details');
624
+ $pp_details.width(width);
625
+ detailsHeight = parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom'));
626
+
627
+ $pp_details = $pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({
628
+ 'position':'absolute',
629
+ 'top':-10000
630
+ });
631
+ detailsHeight += $pp_details.height();
632
+ detailsHeight = (detailsHeight <= 34) ? 36 : detailsHeight; // Min-height for the details
633
+ $pp_details.remove();
634
+
635
+ // Get the titles height, to do so, I need to clone it since it's invisible
636
+ $pp_title = $pp_pic_holder.find('.ppt');
637
+ $pp_title.width(width);
638
+ titleHeight = parseFloat($pp_title.css('marginTop')) + parseFloat($pp_title.css('marginBottom'));
639
+ $pp_title = $pp_title.clone().appendTo($('body')).css({
640
+ 'position':'absolute',
641
+ 'top':-10000
642
+ });
643
+ titleHeight += $pp_title.height();
644
+ $pp_title.remove();
645
+
646
+ // Get the container size, to resize the holder to the right dimensions
647
+ pp_contentHeight = height + detailsHeight;
648
+ pp_contentWidth = width;
649
+ pp_containerHeight = pp_contentHeight + titleHeight + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height();
650
+ pp_containerWidth = width;
651
+ }
652
+
653
+ function _getFileType(itemSrc){
654
+ if (itemSrc.match(/youtube\.com\/watch/i) || itemSrc.match(/youtu\.be/i)) {
655
+ return 'youtube';
656
+ }else if (itemSrc.match(/vimeo\.com/i)) {
657
+ return 'vimeo';
658
+ }else if(itemSrc.match(/\b.mov\b/i)){
659
+ return 'quicktime';
660
+ }else if(itemSrc.match(/\b.swf\b/i)){
661
+ return 'flash';
662
+ }else if(itemSrc.match(/\biframe=true\b/i)){
663
+ return 'iframe';
664
+ }else if(itemSrc.match(/\bajax=true\b/i)){
665
+ return 'ajax';
666
+ }else if(itemSrc.match(/\bcustom=true\b/i)){
667
+ return 'custom';
668
+ }else if(itemSrc.substr(0,1) == '#'){
669
+ return 'inline';
670
+ }else{
671
+ return 'image';
672
+ };
673
+ };
674
+
675
+ function _center_overlay(){
676
+ if(doresize && typeof $pp_pic_holder != 'undefined') {
677
+ scroll_pos = _get_scroll();
678
+ contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width();
679
+
680
+ projectedTop = (windowHeight/2) + scroll_pos['scrollTop'] - (contentHeight/2);
681
+ if(projectedTop < 0) projectedTop = 0;
682
+
683
+ if(contentHeight > windowHeight)
684
+ return;
685
+
686
+ $pp_pic_holder.css({
687
+ 'top': projectedTop,
688
+ 'left': (windowWidth/2) + scroll_pos['scrollLeft'] - (contentwidth/2)
689
+ });
690
+ };
691
+ };
692
+
693
+ function _get_scroll(){
694
+ if (self.pageYOffset) {
695
+ return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};
696
+ } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
697
+ return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};
698
+ } else if (document.body) {// all other Explorers
699
+ return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};
700
+ };
701
+ };
702
+
703
+ function _resize_overlay() {
704
+ windowHeight = $(window).height(), windowWidth = $(window).width();
705
+
706
+ if(typeof $pp_overlay != "undefined") $pp_overlay.height($(document).height()).width(windowWidth);
707
+ };
708
+
709
+ function _insert_gallery(){
710
+ if(isSet && settings.overlay_gallery && _getFileType(pp_images[set_position])=="image") {
711
+ itemWidth = 52+5; // 52 beign the thumb width, 5 being the right margin.
712
+ navWidth = (settings.theme == "facebook" || settings.theme == "pp_default") ? 50 : 30; // Define the arrow width depending on the theme
713
+
714
+ itemsPerPage = Math.floor((pp_dimensions['containerWidth'] - 100 - navWidth) / itemWidth);
715
+ itemsPerPage = (itemsPerPage < pp_images.length) ? itemsPerPage : pp_images.length;
716
+ totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1;
717
+
718
+ // Hide the nav in the case there's no need for links
719
+ if(totalPage == 0){
720
+ navWidth = 0; // No nav means no width!
721
+ $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide();
722
+ }else{
723
+ $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show();
724
+ };
725
+
726
+ galleryWidth = itemsPerPage * itemWidth;
727
+ fullGalleryWidth = pp_images.length * itemWidth;
728
+
729
+ // Set the proper width to the gallery items
730
+ $pp_gallery
731
+ .css('margin-left',-((galleryWidth/2) + (navWidth/2)))
732
+ .find('div:first').width(galleryWidth+5)
733
+ .find('ul').width(fullGalleryWidth)
734
+ .find('li.selected').removeClass('selected');
735
+
736
+ goToPage = (Math.floor(set_position/itemsPerPage) < totalPage) ? Math.floor(set_position/itemsPerPage) : totalPage;
737
+
738
+ $.prettyPhoto.changeGalleryPage(goToPage);
739
+
740
+ $pp_gallery_li.filter(':eq('+set_position+')').addClass('selected');
741
+ }else{
742
+ $pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');
743
+ // $pp_gallery.hide();
744
+ }
745
+ }
746
+
747
+ function _build_overlay(caller){
748
+ // Inject Social Tool markup into General markup
749
+ if(settings.social_tools)
750
+ facebook_like_link = settings.social_tools.replace('{location_href}', encodeURIComponent(location.href));
751
+
752
+ settings.markup = settings.markup.replace('{pp_social}','');
753
+
754
+ $('body').append(settings.markup); // Inject the markup
755
+
756
+ $pp_pic_holder = $('.pp_pic_holder') , $ppt = $('.ppt'), $pp_overlay = $('div.pp_overlay'); // Set my global selectors
757
+
758
+ // Inject the inline gallery!
759
+ if(isSet && settings.overlay_gallery) {
760
+ currentGalleryPage = 0;
761
+ toInject = "";
762
+ for (var i=0; i < pp_images.length; i++) {
763
+ if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){
764
+ classname = 'default';
765
+ img_src = '';
766
+ }else{
767
+ classname = '';
768
+ img_src = pp_images[i];
769
+ }
770
+ toInject += "<li class='"+classname+"'><a href='#'><img src='" + img_src + "' width='50' alt='' /></a></li>";
771
+ };
772
+
773
+ toInject = settings.gallery_markup.replace(/{gallery}/g,toInject);
774
+
775
+ $pp_pic_holder.find('#pp_full_res').after(toInject);
776
+
777
+ $pp_gallery = $('.pp_pic_holder .pp_gallery'), $pp_gallery_li = $pp_gallery.find('li'); // Set the gallery selectors
778
+
779
+ $pp_gallery.find('.pp_arrow_next').click(function(){
780
+ $.prettyPhoto.changeGalleryPage('next');
781
+ $.prettyPhoto.stopSlideshow();
782
+ return false;
783
+ });
784
+
785
+ $pp_gallery.find('.pp_arrow_previous').click(function(){
786
+ $.prettyPhoto.changeGalleryPage('previous');
787
+ $.prettyPhoto.stopSlideshow();
788
+ return false;
789
+ });
790
+
791
+ $pp_pic_holder.find('.pp_content').hover(
792
+ function(){
793
+ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();
794
+ },
795
+ function(){
796
+ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();
797
+ });
798
+
799
+ itemWidth = 52+5; // 52 beign the thumb width, 5 being the right margin.
800
+ $pp_gallery_li.each(function(i){
801
+ $(this)
802
+ .find('a')
803
+ .click(function(){
804
+ $.prettyPhoto.changePage(i);
805
+ $.prettyPhoto.stopSlideshow();
806
+ return false;
807
+ });
808
+ });
809
+ };
810
+
811
+
812
+ // Inject the play/pause if it's a slideshow
813
+ if(settings.slideshow){
814
+ $pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
815
+ $pp_pic_holder.find('.pp_nav .pp_play').click(function(){
816
+ $.prettyPhoto.startSlideshow();
817
+ return false;
818
+ });
819
+ }
820
+
821
+ $pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme); // Set the proper theme
822
+
823
+ $pp_overlay
824
+ .css({
825
+ 'opacity':0,
826
+ 'height':$(document).height(),
827
+ 'width':$(window).width()
828
+ })
829
+ .bind('click',function(){
830
+ if(!settings.modal) $.prettyPhoto.close();
831
+ });
832
+
833
+ $('a.pp_close').bind('click',function(){ $.prettyPhoto.close(); return false; });
834
+
835
+
836
+ if(settings.allow_expand) {
837
+ $('a.pp_expand').bind('click',function(e){
838
+ // Expand the image
839
+ if($(this).hasClass('pp_expand')){
840
+ $(this).removeClass('pp_expand').addClass('pp_contract');
841
+ doresize = false;
842
+ }else{
843
+ $(this).removeClass('pp_contract').addClass('pp_expand');
844
+ doresize = true;
845
+ };
846
+
847
+ _hideContent(function(){ $.prettyPhoto.open(); });
848
+
849
+ return false;
850
+ });
851
+ }
852
+
853
+ $pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){
854
+ $.prettyPhoto.changePage('previous');
855
+ $.prettyPhoto.stopSlideshow();
856
+ return false;
857
+ });
858
+
859
+ $pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){
860
+ $.prettyPhoto.changePage('next');
861
+ $.prettyPhoto.stopSlideshow();
862
+ return false;
863
+ });
864
+
865
+ _center_overlay(); // Center it
866
+ };
867
+
868
+ if(!pp_alreadyInitialized && getHashtag()){
869
+ pp_alreadyInitialized = true;
870
+
871
+ // Grab the rel index to trigger the click on the correct element
872
+ hashIndex = getHashtag();
873
+ hashRel = hashIndex;
874
+ hashIndex = hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1);
875
+ hashRel = hashRel.substring(0,hashRel.indexOf('/'));
876
+
877
+ // Little timeout to make sure all the prettyPhoto initialize scripts has been run.
878
+ // Useful in the event the page contain several init scripts.
879
+ setTimeout(function(){ $("a["+pp_settings.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger('click'); },50);
880
+ }
881
+
882
+ return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize); // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
883
+ };
884
+
885
+ function getHashtag(){
886
+ var url = location.href;
887
+ hashtag = (url.indexOf('#prettyPhoto') !== -1) ? decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)) : false;
888
+ if(hashtag){ hashtag = hashtag.replace(/<|>/g,''); }
889
+ return hashtag;
890
+ };
891
+
892
+ function setHashtag(){
893
+ if(typeof theRel == 'undefined') return; // theRel is set on normal calls, it's impossible to deeplink using the API
894
+ location.hash = theRel + '/'+rel_index+'/';
895
+ };
896
+
897
+ function clearHashtag(){
898
+ if ( location.href.indexOf('#prettyPhoto') !== -1 ) location.hash = "prettyPhoto";
899
+ }
900
+
901
+ function getParam(name,url){
902
+ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
903
+ var regexS = "[\\?&]"+name+"=([^&#]*)";
904
+ var regex = new RegExp( regexS );
905
+ var results = regex.exec( url );
906
+ return ( results == null ) ? "" : results[1];
907
+ }
908
+
909
  })(jQuery);
910
+
911
+ var pp_alreadyInitialized = false; // Used for the deep linking to make sure not to call the same function several times.
gallery-bank.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin URI: http://tech-banker.com
5
  Description: Gallery Bank is an easy to use Responsive WordPress Gallery Plugin for photos, videos, galleries and albums.
6
  Author: Tech Banker
7
- Version: 3.0.228
8
  Author URI: http://tech-banker.com
9
  License: GPLv3 or later
10
  */
4
  Plugin URI: http://tech-banker.com
5
  Description: Gallery Bank is an easy to use Responsive WordPress Gallery Plugin for photos, videos, galleries and albums.
6
  Author: Tech Banker
7
+ Version: 3.0.229
8
  Author URI: http://tech-banker.com
9
  License: GPLv3 or later
10
  */
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Gallery Bank - Responsive Photo Galleries & Albums ===
2
  Contributors: Gallery-Bank,contact-banker
3
- Tags: add album, add gallery, add picture, add pictures, admin, AJAX, album, banner rotator, best gallery, best gallery plugin, best image slider, best portfolio, bilder, comments, easy media gallery, fancy gallery, filterable gallery, filterable portfolio, foto, fotoalbum, fotogalerie, free photo gallery, fullscreen gallery, galary, galeri, galerie, galerij, galery, gallary, Galleria, gallerie, galleries, gallery, gallery decription, gallery image, gallery lightbox, Gallery Plugin, gallery shortcode, gallery slider, gelary, gellary, gellery, google, grid gallery, html5 player, html5 video, html5-audio, image, image album, image gallery, image gallery plugin, image lightbox, image rotate, image slider, image slideshow, images, images gallery, jquery, jquery gallery, links, media, media gallery, multiple pictures, nextgen gallery, page, pagination gallery, pagination portfolio, photo, photo album, photo albums, photo gallery, photoalbum, photogallery, photos, photoset, picture, pictures, plugin, plugin for gallery, plugin gallery, portfolio, portfolio gallery, portfolio plugin, Post, posts, responsive gallery, responsive image gallery, responsive slider, responsive slideshow, responsive wordpress photo gallery, seo, seo image, shortcode, sidebar, Simple gallery, slide show, slideshow, thumbnail, twitter, upload images, upload photos, video gallery, view images, view pictures, website gallery, widget, widget gallery, wordpress gallery, wordpress gallery plugin, wordpress photo gallery plugin, wordpress portfolio plugin, wp gallery, wp gallery plugin, wp gallery plugins
4
  Requires at least: 3.4
5
- Tested up to: 4.2.4
6
- Stable tag: 3.0.228
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -500,6 +500,12 @@ is False in shortcode.
500
 
501
  == Changelog ==
502
 
 
 
 
 
 
 
503
  = 3.0.228 =
504
 
505
  * Few Minor Bugs Fixed
1
  === Gallery Bank - Responsive Photo Galleries & Albums ===
2
  Contributors: Gallery-Bank,contact-banker
3
+ Tags: admin, AJAX, album, best gallery, best gallery plugin, comments, easy media gallery, fancy gallery, filterable gallery, filterable portfolio, foto, fotoalbum, fotogalerie, free photo gallery, fullscreen gallery, galeri, galerie, galerij, galleries, gallery, gallery decription, gallery image, gallery lightbox, Gallery Plugin, grid gallery, image gallery, image gallery plugin, image lightbox, image rotate, image slider, links, media, media gallery, multiple pictures, nextgen gallery, page, pagination gallery, pagination portfolio, photo, photo album, photo albums, photo gallery, photoalbum, photogallery, photos, pictures, plugin, plugin for gallery, plugin gallery, portfolio, portfolio gallery, portfolio plugin, Post, posts, responsive gallery, responsive image gallery, responsive slider, responsive slideshow, responsive wordpress photo gallery, simple gallery,thumbnail, video gallery, website gallery, widget, widget gallery, wordpress gallery, wordpress gallery plugin, wordpress photo gallery plugin, wordpress portfolio plugin, wp gallery, wp gallery plugin, wp gallery plugins, gallery bank
4
  Requires at least: 3.4
5
+ Tested up to: 4.3
6
+ Stable tag: 3.0.229
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
500
 
501
  == Changelog ==
502
 
503
+ = 3.0.229 =
504
+
505
+ * Compatibility with 4.3
506
+ * Changed variables to avoid confliction with Next Gen and Contact Bank plugins.
507
+ * Prettyphoto XSS Security Issue Fixed.
508
+
509
  = 3.0.228 =
510
 
511
  * Few Minor Bugs Fixed
views/dashboard.php CHANGED
@@ -440,7 +440,7 @@
440
  </form>
441
 
442
  <script type="text/javascript">
443
- jQuery(".hovertip").tooltip();
444
  jQuery(document).ready(function()
445
  {
446
  jQuery(".imgLiquidFill").imgLiquid({fill:true});
440
  </form>
441
 
442
  <script type="text/javascript">
443
+ jQuery(".hovertip").tooltip_tip();
444
  jQuery(document).ready(function()
445
  {
446
  jQuery(".imgLiquidFill").imgLiquid({fill:true});
views/edit-album.php CHANGED
@@ -431,7 +431,7 @@
431
  </form>
432
  <script type="text/javascript">
433
 
434
- jQuery(".hovertip").tooltip();
435
  var url = "<?php echo plugins_url("/assets/",dirname(__FILE__)) ?>";
436
  var image_width = <?php echo $thumbnails_width; ?>;
437
  var image_height = <?php echo $thumbnails_height; ?>;
@@ -588,7 +588,7 @@
588
  oTable.fnAddData([col1.html(), col2.html(), col3.html(), col4.html(), col5.html(), col6.html(), col7.html()]);
589
 
590
  select_radio();
591
- jQuery(".hovertip").tooltip();
592
  });
593
  });
594
 
431
  </form>
432
  <script type="text/javascript">
433
 
434
+ jQuery(".hovertip").tooltip_tip();
435
  var url = "<?php echo plugins_url("/assets/",dirname(__FILE__)) ?>";
436
  var image_width = <?php echo $thumbnails_width; ?>;
437
  var image_height = <?php echo $thumbnails_height; ?>;
588
  oTable.fnAddData([col1.html(), col2.html(), col3.html(), col4.html(), col5.html(), col6.html(), col7.html()]);
589
 
590
  select_radio();
591
+ jQuery(".hovertip").tooltip_tip();
592
  });
593
  });
594