Gallery Bank: WordPress Photo Gallery Plugin - Version 4.0.4

Version Description

  • FIX: Lightbox Caption
  • TWEAK: PLUploader updated to latest release
  • TWEAK: Jquery Validator updated to latest release
  • TWEAK: Jquery Modal updated to latest release
  • FIX: Major Bugs
Download this release

Release Info

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

Code changes from version 4.0.3 to 4.0.4

assets/global/plugins/modal/js/bootstrap-modal.js CHANGED
@@ -1,388 +1,328 @@
1
- /* ===========================================================
2
- * bootstrap-modal.js v2.2.5
3
- * ===========================================================
4
- * Copyright 2012 Jordan Schroter
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- * ========================================================== */
18
 
19
- !function ($) {
 
20
 
21
- "use strict"; // jshint ;_;
 
 
 
 
 
 
 
 
 
22
 
23
- /* MODAL CLASS DEFINITION
24
- * ====================== */
 
 
 
 
 
 
25
 
26
- var Modal = function (element, options) {
27
- this.init(element, options);
28
- };
29
 
30
- Modal.prototype = {
 
31
 
32
- constructor: Modal,
 
 
 
 
33
 
34
- init: function (element, options) {
35
- var that = this;
 
36
 
37
- this.options = options;
 
 
38
 
39
- this.$element = $(element)
40
- .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this));
41
 
42
- this.options.remote && this.$element.find('.modal-body').load(this.options.remote, function () {
43
- var e = $.Event('loaded');
44
- that.$element.trigger(e);
45
- });
46
 
47
- var manager = typeof this.options.manager === 'function' ?
48
- this.options.manager.call(this) : this.options.manager;
49
 
50
- manager = manager.appendModal ?
51
- manager : $(manager).modalmanager().data('modalmanager');
 
52
 
53
- manager.appendModal(this);
54
- },
55
 
56
- toggle: function () {
57
- return this[!this.isShown ? 'show' : 'hide']();
58
- },
59
 
60
- show: function () {
61
- var e = $.Event('show');
62
-
63
- if (this.isShown)
64
- return;
65
-
66
- this.$element.trigger(e);
67
-
68
- if (e.isDefaultPrevented())
69
- return;
70
-
71
- this.escape();
72
-
73
- this.tab();
74
-
75
- this.options.loading && this.loading();
76
- },
77
-
78
- hide: function (e) {
79
- e && e.preventDefault();
80
-
81
- e = $.Event('hide');
82
-
83
- this.$element.trigger(e);
84
-
85
- if (!this.isShown || e.isDefaultPrevented())
86
- return;
87
-
88
- this.isShown = false;
89
-
90
- this.escape();
91
-
92
- this.tab();
93
-
94
- this.isLoading && this.loading();
95
-
96
- $(document).off('focusin.modal');
97
-
98
- this.$element
99
- .removeClass('in')
100
- .removeClass('animated')
101
- .removeClass(this.options.attentionAnimation)
102
- .removeClass('modal-overflow')
103
- .attr('aria-hidden', true);
104
-
105
- $.support.transition && this.$element.hasClass('fade') ?
106
- this.hideWithTransition() :
107
- this.hideModal();
108
- },
109
-
110
- layout: function () {
111
- var prop = this.options.height ? 'height' : 'max-height',
112
- value = this.options.height || this.options.maxHeight;
113
-
114
- if (this.options.width) {
115
- this.$element.css('width', this.options.width);
116
-
117
- var that = this;
118
- this.$element.css('margin-left', function () {
119
- if (/%/ig.test(that.options.width)) {
120
- return -(parseInt(that.options.width) / 2) + '%';
121
- } else {
122
- return -($(this).width() / 2) + 'px';
123
- }
124
- });
125
- } else {
126
- this.$element.css('width', '');
127
- this.$element.css('margin-left', '');
128
- }
129
-
130
- this.$element.find('.modal-body')
131
- .css('overflow', '')
132
- .css(prop, '');
133
-
134
- if (value) {
135
- this.$element.find('.modal-body')
136
- .css('overflow', 'auto')
137
- .css(prop, value);
138
- }
139
-
140
- var modalOverflow = $(window).height() - 10 < this.$element.height();
141
-
142
- if (modalOverflow || this.options.modalOverflow) {
143
- this.$element
144
- .css('margin-top', 0)
145
- .addClass('modal-overflow');
146
- } else {
147
- this.$element
148
- .css('margin-top', 0 - this.$element.height() / 2)
149
- .removeClass('modal-overflow');
150
- }
151
- },
152
-
153
- tab: function () {
154
- var that = this;
155
-
156
- if (this.isShown && this.options.consumeTab) {
157
- this.$element.on('keydown.tabindex.modal', '[data-tabindex]', function (e) {
158
- if (e.keyCode && e.keyCode == 9) {
159
- var elements = [],
160
- tabindex = Number($(this).data('tabindex'));
161
-
162
- that.$element.find('[data-tabindex]:enabled:visible:not([readonly])').each(function (ev) {
163
- elements.push(Number($(this).data('tabindex')));
164
- });
165
- elements.sort(function (a, b) {
166
- return a - b
167
- });
168
-
169
- var arrayPos = $.inArray(tabindex, elements);
170
- if (!e.shiftKey) {
171
- arrayPos < elements.length - 1 ?
172
- that.$element.find('[data-tabindex=' + elements[arrayPos + 1] + ']').focus() :
173
- that.$element.find('[data-tabindex=' + elements[0] + ']').focus();
174
- } else {
175
- arrayPos == 0 ?
176
- that.$element.find('[data-tabindex=' + elements[elements.length - 1] + ']').focus() :
177
- that.$element.find('[data-tabindex=' + elements[arrayPos - 1] + ']').focus();
178
- }
179
-
180
- e.preventDefault();
181
- }
182
- });
183
- } else if (!this.isShown) {
184
- this.$element.off('keydown.tabindex.modal');
185
- }
186
- },
187
-
188
- escape: function () {
189
- var that = this;
190
- if (this.isShown && this.options.keyboard) {
191
- if (!this.$element.attr('tabindex'))
192
- this.$element.attr('tabindex', -1);
193
-
194
- this.$element.on('keyup.dismiss.modal', function (e) {
195
- e.which == 27 && that.hide();
196
- });
197
- } else if (!this.isShown) {
198
- this.$element.off('keyup.dismiss.modal')
199
- }
200
- },
201
-
202
- hideWithTransition: function () {
203
- var that = this,
204
- timeout = setTimeout(function () {
205
- that.$element.off($.support.transition.end);
206
- that.hideModal();
207
- }, 500);
208
-
209
- this.$element.one($.support.transition.end, function () {
210
- clearTimeout(timeout);
211
- that.hideModal();
212
- });
213
- },
214
-
215
- hideModal: function () {
216
- var prop = this.options.height ? 'height' : 'max-height';
217
- var value = this.options.height || this.options.maxHeight;
218
-
219
- if (value) {
220
- this.$element.find('.modal-body')
221
- .css('overflow', '')
222
- .css(prop, '');
223
- }
224
-
225
- this.$element
226
- .hide()
227
- .trigger('hidden');
228
- },
229
-
230
- removeLoading: function () {
231
- this.$loading.remove();
232
- this.$loading = null;
233
- this.isLoading = false;
234
- },
235
-
236
- loading: function (callback) {
237
- callback = callback || function () {};
238
-
239
- var animate = this.$element.hasClass('fade') ? 'fade' : '';
240
-
241
- if (!this.isLoading) {
242
- var doAnimate = $.support.transition && animate;
243
-
244
- this.$loading = $('<div class="loading-mask ' + animate + '">')
245
- .append(this.options.spinner)
246
- .appendTo(this.$element);
247
-
248
- if (doAnimate)
249
- this.$loading[0].offsetWidth; // force reflow
250
-
251
- this.$loading.addClass('in');
252
-
253
- this.isLoading = true;
254
-
255
- doAnimate ?
256
- this.$loading.one($.support.transition.end, callback) :
257
- callback();
258
-
259
- } else if (this.isLoading && this.$loading) {
260
- this.$loading.removeClass('in');
261
-
262
- var that = this;
263
- $.support.transition && this.$element.hasClass('fade') ?
264
- this.$loading.one($.support.transition.end, function () {
265
- that.removeLoading()
266
- }) :
267
- that.removeLoading();
268
-
269
- } else if (callback) {
270
- callback(this.isLoading);
271
- }
272
- },
273
-
274
- focus: function () {
275
- var $focusElem = this.$element.find(this.options.focusOn);
276
-
277
- $focusElem = $focusElem.length ? $focusElem : this.$element;
278
-
279
- $focusElem.focus();
280
- },
281
-
282
- attention: function () {
283
- // NOTE: transitionEnd with keyframes causes odd behaviour
284
-
285
- if (this.options.attentionAnimation) {
286
- this.$element
287
- .removeClass('animated')
288
- .removeClass(this.options.attentionAnimation);
289
-
290
- var that = this;
291
-
292
- setTimeout(function () {
293
- that.$element
294
- .addClass('animated')
295
- .addClass(that.options.attentionAnimation);
296
- }, 0);
297
- }
298
-
299
- this.focus();
300
- },
301
 
302
- destroy: function () {
303
- var e = $.Event('destroy');
304
 
305
- this.$element.trigger(e);
 
 
306
 
307
- if (e.isDefaultPrevented())
308
- return;
 
309
 
310
- this.$element
311
- .off('.modal')
312
- .removeData('modal')
313
- .removeClass('in')
314
- .attr('aria-hidden', true);
315
 
316
- if (this.$parent !== this.$element.parent()) {
317
- this.$element.appendTo(this.$parent);
318
- } else if (!this.$parent.length) {
319
- // modal is not part of the DOM so remove it.
320
- this.$element.remove();
321
- this.$element = null;
322
- }
323
 
324
- this.$element.trigger('destroyed');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
325
  }
326
- };
327
-
328
- /* MODAL PLUGIN DEFINITION
329
- * ======================= */
330
-
331
- $.fn.modal = function (option, args) {
332
- return this.each(function () {
333
- var $this = $(this),
334
- data = $this.data('modal'),
335
- options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option);
336
-
337
- if (!data)
338
- $this.data('modal', (data = new Modal(this, options)));
339
- if (typeof option == 'string')
340
- data[option].apply(data, [].concat(args));
341
- else if (options.show)
342
- data.show()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  })
344
- };
345
-
346
- $.fn.modal.defaults = {
347
- keyboard: true,
348
- backdrop: true,
349
- loading: false,
350
- show: true,
351
- width: null,
352
- height: null,
353
- maxHeight: null,
354
- modalOverflow: false,
355
- consumeTab: true,
356
- focusOn: null,
357
- replace: false,
358
- resize: false,
359
- attentionAnimation: 'shake',
360
- manager: 'body',
361
- spinner: '<div class="loading-spinner" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="bar" style="width: 100%;"></div></div></div>',
362
- backdropTemplate: '<div class="modal-backdrop" />'
363
- };
364
-
365
- $.fn.modal.Constructor = Modal;
366
-
367
- /* MODAL DATA-API
368
- * ============== */
369
-
370
- $(function () {
371
- $(document).off('click.modal').on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
372
- var $this = $(this),
373
- href = $this.attr('href'),
374
- $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))), //strip for ie7
375
- option = $target.data('modal') ? 'toggle' : $.extend({
376
- remote: !/#/.test(href) && href
377
- }, $target.data(), $this.data());
378
-
379
- e.preventDefault();
380
- $target
381
- .modal(option)
382
- .one('hide', function () {
383
- $this.focus();
384
- })
385
- });
386
- });
387
-
388
- }(window.jQuery);
1
+ +function ($) {
2
+ 'use strict';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
+ // MODAL CLASS DEFINITION
5
+ // ======================
6
 
7
+ var Modal = function (element, options) {
8
+ this.options = options
9
+ this.$body = $(document.body)
10
+ this.$element = $(element)
11
+ this.$dialog = this.$element.find('.modal-dialog')
12
+ this.$backdrop = null
13
+ this.isShown = null
14
+ this.originalBodyPad = null
15
+ this.scrollbarWidth = 0
16
+ this.ignoreBackdropClick = false
17
 
18
+ if (this.options.remote) {
19
+ this.$element
20
+ .find('.modal-content')
21
+ .load(this.options.remote, $.proxy(function () {
22
+ this.$element.trigger('loaded.bs.modal')
23
+ }, this))
24
+ }
25
+ }
26
 
27
+ Modal.VERSION = '3.3.6'
 
 
28
 
29
+ Modal.TRANSITION_DURATION = 300
30
+ Modal.BACKDROP_TRANSITION_DURATION = 150
31
 
32
+ Modal.DEFAULTS = {
33
+ backdrop: true,
34
+ keyboard: true,
35
+ show: true
36
+ }
37
 
38
+ Modal.prototype.toggle = function (_relatedTarget) {
39
+ return this.isShown ? this.hide() : this.show(_relatedTarget)
40
+ }
41
 
42
+ Modal.prototype.show = function (_relatedTarget) {
43
+ var that = this
44
+ var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
45
 
46
+ this.$element.trigger(e)
 
47
 
48
+ if (this.isShown || e.isDefaultPrevented()) return
 
 
 
49
 
50
+ this.isShown = true
 
51
 
52
+ this.checkScrollbar()
53
+ this.setScrollbar()
54
+ this.$body.addClass('modal-open')
55
 
56
+ this.escape()
57
+ this.resize()
58
 
59
+ this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
 
 
60
 
61
+ this.$dialog.on('mousedown.dismiss.bs.modal', function () {
62
+ that.$element.one('mouseup.dismiss.bs.modal', function (e) {
63
+ if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
64
+ })
65
+ })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
+ this.backdrop(function () {
68
+ var transition = $.support.transition && that.$element.hasClass('fade')
69
 
70
+ if (!that.$element.parent().length) {
71
+ that.$element.appendTo(that.$body) // don't move modals dom position
72
+ }
73
 
74
+ that.$element
75
+ .show()
76
+ .scrollTop(0)
77
 
78
+ that.adjustDialog()
 
 
 
 
79
 
80
+ if (transition) {
81
+ that.$element[0].offsetWidth // force reflow
82
+ }
 
 
 
 
83
 
84
+ that.$element.addClass('in')
85
+
86
+ that.enforceFocus()
87
+
88
+ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
89
+
90
+ transition ?
91
+ that.$dialog // wait for modal to slide in
92
+ .one('bsTransitionEnd', function () {
93
+ that.$element.trigger('focus').trigger(e)
94
+ })
95
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
96
+ that.$element.trigger('focus').trigger(e)
97
+ })
98
+ }
99
+
100
+ Modal.prototype.hide = function (e) {
101
+ if (e) e.preventDefault()
102
+
103
+ e = $.Event('hide.bs.modal')
104
+
105
+ this.$element.trigger(e)
106
+
107
+ if (!this.isShown || e.isDefaultPrevented()) return
108
+
109
+ this.isShown = false
110
+
111
+ this.escape()
112
+ this.resize()
113
+
114
+ $(document).off('focusin.bs.modal')
115
+
116
+ this.$element
117
+ .removeClass('in')
118
+ .off('click.dismiss.bs.modal')
119
+ .off('mouseup.dismiss.bs.modal')
120
+
121
+ this.$dialog.off('mousedown.dismiss.bs.modal')
122
+
123
+ $.support.transition && this.$element.hasClass('fade') ?
124
+ this.$element
125
+ .one('bsTransitionEnd', $.proxy(this.hideModal, this))
126
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
127
+ this.hideModal()
128
+ }
129
+
130
+ Modal.prototype.enforceFocus = function () {
131
+ $(document)
132
+ .off('focusin.bs.modal') // guard against infinite focus loop
133
+ .on('focusin.bs.modal', $.proxy(function (e) {
134
+ if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
135
+ this.$element.trigger('focus')
136
+ }
137
+ }, this))
138
+ }
139
+
140
+ Modal.prototype.escape = function () {
141
+ if (this.isShown && this.options.keyboard) {
142
+ this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
143
+ e.which == 27 && this.hide()
144
+ }, this))
145
+ } else if (!this.isShown) {
146
+ this.$element.off('keydown.dismiss.bs.modal')
147
+ }
148
+ }
149
+
150
+ Modal.prototype.resize = function () {
151
+ if (this.isShown) {
152
+ $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
153
+ } else {
154
+ $(window).off('resize.bs.modal')
155
+ }
156
+ }
157
+
158
+ Modal.prototype.hideModal = function () {
159
+ var that = this
160
+ this.$element.hide()
161
+ this.backdrop(function () {
162
+ that.$body.removeClass('modal-open')
163
+ that.resetAdjustments()
164
+ that.resetScrollbar()
165
+ that.$element.trigger('hidden.bs.modal')
166
+ })
167
+ }
168
+
169
+ Modal.prototype.removeBackdrop = function () {
170
+ this.$backdrop && this.$backdrop.remove()
171
+ this.$backdrop = null
172
+ }
173
+
174
+ Modal.prototype.backdrop = function (callback) {
175
+ var that = this
176
+ var animate = this.$element.hasClass('fade') ? 'fade' : ''
177
+
178
+ if (this.isShown && this.options.backdrop) {
179
+ var doAnimate = $.support.transition && animate
180
+
181
+ this.$backdrop = $(document.createElement('div'))
182
+ .addClass('modal-backdrop ' + animate)
183
+ .appendTo(this.$body)
184
+
185
+ this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
186
+ if (this.ignoreBackdropClick) {
187
+ this.ignoreBackdropClick = false
188
+ return
189
+ }
190
+ if (e.target !== e.currentTarget) return
191
+ this.options.backdrop == 'static'
192
+ ? this.$element[0].focus()
193
+ : this.hide()
194
+ }, this))
195
+
196
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
197
+
198
+ this.$backdrop.addClass('in')
199
+
200
+ if (!callback) return
201
+
202
+ doAnimate ?
203
+ this.$backdrop
204
+ .one('bsTransitionEnd', callback)
205
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
206
+ callback()
207
+
208
+ } else if (!this.isShown && this.$backdrop) {
209
+ this.$backdrop.removeClass('in')
210
+
211
+ var callbackRemove = function () {
212
+ that.removeBackdrop()
213
+ callback && callback()
214
  }
215
+ $.support.transition && this.$element.hasClass('fade') ?
216
+ this.$backdrop
217
+ .one('bsTransitionEnd', callbackRemove)
218
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
219
+ callbackRemove()
220
+
221
+ } else if (callback) {
222
+ callback()
223
+ }
224
+ }
225
+
226
+ // these following methods are used to handle overflowing modals
227
+
228
+ Modal.prototype.handleUpdate = function () {
229
+ this.adjustDialog()
230
+ }
231
+
232
+ Modal.prototype.adjustDialog = function () {
233
+ var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
234
+
235
+ this.$element.css({
236
+ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
237
+ paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
238
+ })
239
+ }
240
+
241
+ Modal.prototype.resetAdjustments = function () {
242
+ this.$element.css({
243
+ paddingLeft: '',
244
+ paddingRight: ''
245
+ })
246
+ }
247
+
248
+ Modal.prototype.checkScrollbar = function () {
249
+ var fullWindowWidth = window.innerWidth
250
+ if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
251
+ var documentElementRect = document.documentElement.getBoundingClientRect()
252
+ fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
253
+ }
254
+ this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
255
+ this.scrollbarWidth = this.measureScrollbar()
256
+ }
257
+
258
+ Modal.prototype.setScrollbar = function () {
259
+ var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
260
+ this.originalBodyPad = document.body.style.paddingRight || ''
261
+ if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
262
+ }
263
+
264
+ Modal.prototype.resetScrollbar = function () {
265
+ this.$body.css('padding-right', this.originalBodyPad)
266
+ }
267
+
268
+ Modal.prototype.measureScrollbar = function () { // thx walsh
269
+ var scrollDiv = document.createElement('div')
270
+ scrollDiv.className = 'modal-scrollbar-measure'
271
+ this.$body.append(scrollDiv)
272
+ var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
273
+ this.$body[0].removeChild(scrollDiv)
274
+ return scrollbarWidth
275
+ }
276
+
277
+
278
+ // MODAL PLUGIN DEFINITION
279
+ // =======================
280
+
281
+ function Plugin(option, _relatedTarget) {
282
+ return this.each(function () {
283
+ var $this = $(this)
284
+ var data = $this.data('bs.modal')
285
+ var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
286
+
287
+ if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
288
+ if (typeof option == 'string') data[option](_relatedTarget)
289
+ else if (options.show) data.show(_relatedTarget)
290
+ })
291
+ }
292
+
293
+ var old = $.fn.modal
294
+
295
+ $.fn.modal = Plugin
296
+ $.fn.modal.Constructor = Modal
297
+
298
+
299
+ // MODAL NO CONFLICT
300
+ // =================
301
+
302
+ $.fn.modal.noConflict = function () {
303
+ $.fn.modal = old
304
+ return this
305
+ }
306
+
307
+
308
+ // MODAL DATA-API
309
+ // ==============
310
+
311
+ $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
312
+ var $this = $(this)
313
+ var href = $this.attr('href')
314
+ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
315
+ var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
316
+
317
+ if ($this.is('a')) e.preventDefault()
318
+
319
+ $target.one('show.bs.modal', function (showEvent) {
320
+ if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
321
+ $target.one('hidden.bs.modal', function () {
322
+ $this.is(':visible') && $this.trigger('focus')
323
  })
324
+ })
325
+ Plugin.call($target, option, this)
326
+ })
327
+
328
+ }(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/global/plugins/pluploader/css/jquery.ui.plupload.css CHANGED
@@ -3,416 +3,373 @@
3
  ------------------------------------------------------------------- */
4
 
5
  .plupload_wrapper * {
6
- box-sizing: content-box;
7
  }
8
 
9
  .plupload_button {
10
- cursor: pointer;
11
- outline: none;
12
  }
13
 
14
  .plupload_wrapper {
15
- font: normal 11px Verdana, sans-serif;
16
- width: 100%;
17
- min-width: 520px;
18
- line-height: 12px;
19
  }
20
 
21
  .plupload_container {
22
- _height: 300px;
23
- min-height: 300px;
24
- position: relative;
25
  }
26
 
27
- .plupload_filelist_footer {
28
- border-width: 1px 0 0 0
29
- }
30
-
31
- .plupload_file {
32
- border-width: 0 0 1px 0
33
- }
34
-
35
- .plupload_container .plupload_header {
36
- border-width: 0 0 1px 0;
37
- position: relative;
38
- }
39
 
40
- .plupload_delete .ui-icon,
41
  .plupload_done .ui-icon,
42
  .plupload_failed .ui-icon {
43
- cursor: pointer;
44
  }
45
 
46
  .plupload_header_content {
47
- height: 56px;
48
- padding: 0 160px 0 60px;
49
- position: relative;
50
  }
51
 
52
  .plupload_logo {
53
- width: 40px;
54
- height: 40px;
55
- background: url('../img/plupload.png') no-repeat 0 0;
56
- position: absolute;
57
- top: 8px;
58
- left: 8px;
59
  }
60
 
61
  .plupload_header_content_bw .plupload_logo {
62
- background-position: -40px 0;
63
  }
64
 
65
  .plupload_header_title {
66
- font: normal 18px sans-serif;
67
- line-height: 19px;
68
- padding: 6px 0 3px;
69
  }
70
 
71
  .plupload_header_text {
72
- font: normal 12px sans-serif;
73
  }
74
 
75
  .plupload_view_switch {
76
- position: absolute;
77
- right: 16px;
78
- bottom: 8px;
79
- margin: 0;
80
- display: none;
81
  }
82
 
83
  .plupload_view_switch .ui-button {
84
- margin-right: -0.31em;
85
  }
86
 
87
  .plupload_content {
88
- position: absolute;
89
- top: 86px;
90
- bottom: 44px;
91
- left: 0;
92
- right: 0;
93
- overflow-y: auto;
94
- width: 100%;
95
  }
96
 
97
  .plupload_filelist {
98
- border-collapse: collapse;
99
- border-left: none;
100
- border-right: none;
101
- margin: 0;
102
- padding: 0;
103
- width: 100%;
104
- -moz-user-select: none;
105
- -webkit-user-select: none;
106
- user-select: none;
107
  }
108
 
109
  .plupload_filelist_content {
110
- padding: 0;
111
- margin: 0;
112
  }
113
 
114
- .plupload_cell {
115
- padding: 8px 6px;
116
- }
117
 
118
  .plupload_file {
119
- list-style: none;
120
- display: block;
121
- position: relative;
122
- overflow: hidden;
123
- line-height: 12px;
124
  }
125
 
126
  .plupload_file_thumb {
127
- position: relative;
128
- background-image: none;
129
- background-color: #eee;
130
  }
131
 
132
  .plupload_thumb_loading {
133
- background: #eee url(../img/loading.gif) center no-repeat;
134
  }
135
 
136
  .plupload_thumb_loading .plupload_file_dummy,
137
  .plupload_thumb_embedded .plupload_file_dummy {
138
- display: none;
139
  }
140
 
141
  .plupload_file_name {
142
- overflow: hidden;
143
- text-overflow: ellipsis;
144
- white-space: nowrap;
145
  }
146
 
147
  .plupload_filelist_header {
148
- border-top: none;
149
  }
150
 
151
  .plupload_filelist_footer {
152
- position: absolute;
153
- bottom: 0;
154
- left: 0;
155
- right: 0;
156
  }
157
 
158
- .plupload_buttons {
159
- position: relative;
160
  }
161
 
162
-
163
  /* list view */
164
-
165
  .plupload_view_list .plupload_file {
166
- border-left: none;
167
- border-right: none;
168
- border-top: none;
169
- height: 29px;
170
- width: 100% !important;
171
- /* fix IE6 vertical white-space bug */
172
- _float: left;
173
- _clear: left;
174
  }
175
 
176
- .plupload_view_list div.plupload_file_size,
177
  .plupload_view_list div.plupload_file_status,
178
  .plupload_view_list div.plupload_file_action {
179
- padding: 8px 6px;
180
- position: absolute;
181
- top: 0;
182
- right: 0;
183
  }
184
 
185
  .plupload_view_list div.plupload_file_name {
186
- margin-right: 156px;
187
- padding: 8px 6px;
188
- _width: 75%;
189
  }
190
 
191
  .plupload_view_list div.plupload_file_size {
192
- right: 28px;
193
  }
194
 
195
  .plupload_view_list div.plupload_file_status {
196
- right: 82px;
197
  }
198
 
199
  .plupload_view_list .plupload_file_rename {
200
- margin-left: -2px;
201
  }
202
 
203
- .plupload_view_list .plupload_file_size,
204
  .plupload_view_list .plupload_file_status,
205
- .plupload_filelist_footer .plupload_file_size,
206
  .plupload_filelist_footer .plupload_file_status {
207
- text-align: right;
208
- width: 52px;
209
  }
210
 
211
  .plupload_view_list .plupload_file_thumb {
212
- position: absolute;
213
- top: -999px;
214
  }
215
 
216
  .plupload_view_list .plupload_file_progress {
217
- display: none;
218
  }
219
 
220
 
221
  /* thumbs view */
222
-
223
  .plupload_view_thumbs .plupload_content {
224
- top: 57px;
225
  }
226
 
227
  .plupload_view_thumbs .plupload_filelist_header {
228
- display: none;
229
  }
230
 
231
  .plupload_view_thumbs .plupload_file {
232
- padding: 6px;
233
- margin: 10px;
234
- border: 1px solid #fff;
235
- float: left;
236
  }
237
 
238
  .plupload_view_thumbs .plupload_file_thumb,
239
  .plupload_view_thumbs .plupload_file_dummy {
240
- text-align: center;
241
- overflow: hidden;
242
  }
243
 
244
  .plupload_view_thumbs .plupload_file_dummy {
245
- font-size: 21px;
246
- font-weight: bold;
247
- text-transform: lowercase;
248
- overflow: hidden;
249
- border: none;
250
- position: absolute;
251
- top: 0;
252
- left: 0;
253
- width: 100%;
254
- height: 100%;
255
  }
256
 
257
  .plupload_view_thumbs div.plupload_file_action {
258
- position: absolute;
259
- top: 0;
260
- right: 0;
261
  }
262
 
263
  .plupload_view_thumbs div.plupload_file_name {
264
- padding: 0;
265
- font-weight: bold;
266
  }
267
 
268
  .plupload_view_thumbs .plupload_file_rename {
269
- padding: 1px 0;
270
- width: 100% !important;
271
  }
272
 
273
  .plupload_view_thumbs div.plupload_file_size {
274
- font-size: 0.8em;
275
- font-weight: normal;
276
  }
277
 
278
  .plupload_view_thumbs div.plupload_file_status {
279
- position: relative;
280
- height: 3px;
281
- overflow: hidden;
282
- text-indent: -999px;
283
- margin-bottom: 3px;
284
  }
285
 
286
  .plupload_view_thumbs div.plupload_file_progress {
287
- border: none;
288
- height: 100%;
289
  }
290
 
291
  .plupload .ui-sortable-helper,
292
  .plupload .ui-sortable .plupload_file {
293
- cursor: move;
294
- }
295
-
296
- .plupload_file_action {
297
- width: 16px;
298
  }
299
 
 
300
  .plupload_file_name {
301
- overflow: hidden;
302
- padding-left: 10px;
303
  }
304
 
305
  .plupload_file_rename {
306
- border: none;
307
- font: normal 11px Verdana, sans-serif;
308
- padding: 1px 2px;
309
- line-height: 11px;
310
- height: 11px;
311
  }
312
 
313
- .plupload_progress {
314
- width: 60px;
315
- }
316
-
317
- .plupload_progress_container {
318
- padding: 1px;
319
- }
320
 
321
 
322
  /* Floats */
323
 
324
- .plupload_right {
325
- float: right;
326
- }
327
-
328
- .plupload_left {
329
- float: left;
330
- }
331
-
332
- .plupload_clear,
333
- .plupload_clearer {
334
- clear: both;
335
- }
336
-
337
- .plupload_clearer,
338
- .plupload_progress_bar {
339
- display: block;
340
- font-size: 0;
341
- line-height: 0;
342
  }
343
-
344
- .plupload_clearer {
345
- height: 0;
346
- }
347
-
348
 
349
  /* Misc */
350
-
351
- .plupload_hidden {
352
- display: none !important;
353
- }
354
 
355
  .plupload_droptext {
356
- position: absolute;
357
- top: 0;
358
- left: 0;
359
- right: 0;
360
- bottom: 0;
361
- background: transparent;
362
- text-align: center;
363
- vertical-align: middle;
364
- border: 0;
365
- line-height: 160px;
366
- display: none;
367
  }
368
 
369
  .plupload_dropbox .plupload_droptext {
370
- display: block;
371
  }
372
 
373
- .plupload_buttons,
374
- .plupload_upload_status {
375
- float: left
376
- }
377
 
378
  .plupload_message {
379
- position: absolute;
380
- top: -1px;
381
- left: -1px;
382
- height: 100%;
383
- width: 100%;
384
  }
385
 
386
  .plupload_message p {
387
- padding: 0.7em;
388
- margin: 0;
389
  }
390
 
391
  .plupload_message strong {
392
- font-weight: bold;
393
  }
394
 
395
  .plupload_message i {
396
- font-style: italic;
397
  }
398
 
399
  .plupload_message p span.ui-icon {
400
- float: left;
401
- margin-right: 0.3em;
402
  }
403
 
404
  .plupload_header_content .ui-state-error,
405
  .plupload_header_content .ui-state-highlight {
406
- border: none;
407
  }
408
 
409
  .plupload_message_close {
410
- position: absolute;
411
- top: 5px;
412
- right: 5px;
413
- cursor: pointer;
414
  }
415
 
416
  .plupload .ui-sortable-placeholder {
417
- height: 35px;
418
- }
3
  ------------------------------------------------------------------- */
4
 
5
  .plupload_wrapper * {
6
+ box-sizing: content-box;
7
  }
8
 
9
  .plupload_button {
10
+ cursor: pointer;
11
+ outline: none;
12
  }
13
 
14
  .plupload_wrapper {
15
+ font: normal 11px Verdana,sans-serif;
16
+ width: 100%;
17
+ min-width: 520px;
18
+ line-height: 12px;
19
  }
20
 
21
  .plupload_container {
22
+ _height: 300px;
23
+ min-height: 300px;
24
+ position: relative;
25
  }
26
 
27
+ .plupload_filelist_footer {border-width: 1px 0 0 0}
28
+ .plupload_file {border-width: 0 0 1px 0}
29
+ .plupload_container .plupload_header {border-width: 0 0 1px 0; position: relative;}
 
 
 
 
 
 
 
 
 
30
 
31
+ .plupload_delete .ui-icon,
32
  .plupload_done .ui-icon,
33
  .plupload_failed .ui-icon {
34
+ cursor:pointer;
35
  }
36
 
37
  .plupload_header_content {
38
+ height: 56px;
39
+ padding: 0 160px 0 60px;
40
+ position: relative;
41
  }
42
 
43
  .plupload_logo {
44
+ width: 40px;
45
+ height: 40px;
46
+ background: url('../img/plupload.png') no-repeat 0 0;
47
+ position: absolute;
48
+ top: 8px;
49
+ left: 8px;
50
  }
51
 
52
  .plupload_header_content_bw .plupload_logo {
53
+ background-position: -40px 0;
54
  }
55
 
56
  .plupload_header_title {
57
+ font: normal 18px sans-serif;
58
+ line-height: 19px;
59
+ padding: 6px 0 3px;
60
  }
61
 
62
  .plupload_header_text {
63
+ font: normal 12px sans-serif;
64
  }
65
 
66
  .plupload_view_switch {
67
+ position: absolute;
68
+ right: 16px;
69
+ bottom: 8px;
70
+ margin: 0;
71
+ display: none;
72
  }
73
 
74
  .plupload_view_switch .ui-button {
75
+ margin-right: -0.31em;
76
  }
77
 
78
  .plupload_content {
79
+ position: absolute;
80
+ top: 86px;
81
+ bottom: 44px;
82
+ left: 0;
83
+ right: 0;
84
+ overflow-y: auto;
85
+ width: 100%;
86
  }
87
 
88
  .plupload_filelist {
89
+ border-collapse: collapse;
90
+ border-left: none;
91
+ border-right: none;
92
+ margin: 0;
93
+ padding: 0;
94
+ width: 100%;
95
+ -moz-user-select: none;
96
+ -webkit-user-select: none;
97
+ user-select: none;
98
  }
99
 
100
  .plupload_filelist_content {
101
+ padding: 0;
102
+ margin: 0;
103
  }
104
 
105
+ .plupload_cell {padding: 8px 6px;}
 
 
106
 
107
  .plupload_file {
108
+ list-style: none;
109
+ display: block;
110
+ position: relative;
111
+ overflow: hidden;
112
+ line-height: 12px;
113
  }
114
 
115
  .plupload_file_thumb {
116
+ position: relative;
117
+ background-image: none;
118
+ background-color: #eee;
119
  }
120
 
121
  .plupload_thumb_loading {
122
+ background: #eee url(../img/loading.gif) center no-repeat;
123
  }
124
 
125
  .plupload_thumb_loading .plupload_file_dummy,
126
  .plupload_thumb_embedded .plupload_file_dummy {
127
+ display: none;
128
  }
129
 
130
  .plupload_file_name {
131
+ overflow: hidden;
132
+ text-overflow: ellipsis;
133
+ white-space: nowrap;
134
  }
135
 
136
  .plupload_filelist_header {
137
+ border-top: none;
138
  }
139
 
140
  .plupload_filelist_footer {
141
+ position: absolute;
142
+ bottom: 0;
143
+ left: 0;
144
+ right: 0;
145
  }
146
 
147
+ .plupload_buttons {
148
+ position: relative;
149
  }
150
 
 
151
  /* list view */
 
152
  .plupload_view_list .plupload_file {
153
+ border-left: none;
154
+ border-right: none;
155
+ border-top: none;
156
+ height: 29px;
157
+ width: 100% !important;
158
+ /* fix IE6 vertical white-space bug */
159
+ _float: left;
160
+ _clear: left;
161
  }
162
 
163
+ .plupload_view_list div.plupload_file_size,
164
  .plupload_view_list div.plupload_file_status,
165
  .plupload_view_list div.plupload_file_action {
166
+ padding: 8px 6px;
167
+ position: absolute;
168
+ top: 0;
169
+ right: 0;
170
  }
171
 
172
  .plupload_view_list div.plupload_file_name {
173
+ margin-right: 156px;
174
+ padding: 8px 6px;
175
+ _width: 75%;
176
  }
177
 
178
  .plupload_view_list div.plupload_file_size {
179
+ right: 28px;
180
  }
181
 
182
  .plupload_view_list div.plupload_file_status {
183
+ right: 82px;
184
  }
185
 
186
  .plupload_view_list .plupload_file_rename {
187
+ margin-left: -2px;
188
  }
189
 
190
+ .plupload_view_list .plupload_file_size,
191
  .plupload_view_list .plupload_file_status,
192
+ .plupload_filelist_footer .plupload_file_size,
193
  .plupload_filelist_footer .plupload_file_status {
194
+ text-align: right;
195
+ width: 52px;
196
  }
197
 
198
  .plupload_view_list .plupload_file_thumb {
199
+ position: absolute;
200
+ top: -999px;
201
  }
202
 
203
  .plupload_view_list .plupload_file_progress {
204
+ display: none;
205
  }
206
 
207
 
208
  /* thumbs view */
 
209
  .plupload_view_thumbs .plupload_content {
210
+ top: 57px;
211
  }
212
 
213
  .plupload_view_thumbs .plupload_filelist_header {
214
+ display: none;
215
  }
216
 
217
  .plupload_view_thumbs .plupload_file {
218
+ padding: 6px;
219
+ margin: 10px;
220
+ border: 1px solid #fff;
221
+ float: left;
222
  }
223
 
224
  .plupload_view_thumbs .plupload_file_thumb,
225
  .plupload_view_thumbs .plupload_file_dummy {
226
+ text-align: center;
227
+ overflow: hidden;
228
  }
229
 
230
  .plupload_view_thumbs .plupload_file_dummy {
231
+ font-size: 21px;
232
+ font-weight: bold;
233
+ text-transform: lowercase;
234
+ overflow: hidden;
235
+ border: none;
236
+ position: absolute;
237
+ top: 0;
238
+ left: 0;
239
+ width: 100%;
240
+ height: 100%;
241
  }
242
 
243
  .plupload_view_thumbs div.plupload_file_action {
244
+ position: absolute;
245
+ top: 0;
246
+ right: 0;
247
  }
248
 
249
  .plupload_view_thumbs div.plupload_file_name {
250
+ padding: 0;
251
+ font-weight: bold;
252
  }
253
 
254
  .plupload_view_thumbs .plupload_file_rename {
255
+ padding: 1px 0;
256
+ width: 100% !important;
257
  }
258
 
259
  .plupload_view_thumbs div.plupload_file_size {
260
+ font-size: 0.8em;
261
+ font-weight: normal;
262
  }
263
 
264
  .plupload_view_thumbs div.plupload_file_status {
265
+ position: relative;
266
+ height: 3px;
267
+ overflow: hidden;
268
+ text-indent: -999px;
269
+ margin-bottom: 3px;
270
  }
271
 
272
  .plupload_view_thumbs div.plupload_file_progress {
273
+ border: none;
274
+ height: 100%;
275
  }
276
 
277
  .plupload .ui-sortable-helper,
278
  .plupload .ui-sortable .plupload_file {
279
+ cursor:move;
 
 
 
 
280
  }
281
 
282
+ .plupload_file_action {width: 16px;}
283
  .plupload_file_name {
284
+ overflow: hidden;
285
+ padding-left: 10px;
286
  }
287
 
288
  .plupload_file_rename {
289
+ border: none;
290
+ font: normal 11px Verdana, sans-serif;
291
+ padding: 1px 2px;
292
+ line-height: 11px;
293
+ height: 11px;
294
  }
295
 
296
+ .plupload_progress {width: 60px;}
297
+ .plupload_progress_container {padding: 1px;}
 
 
 
 
 
298
 
299
 
300
  /* Floats */
301
 
302
+ .plupload_right {float: right;}
303
+ .plupload_left {float: left;}
304
+ .plupload_clear,.plupload_clearer {clear: both;}
305
+ .plupload_clearer, .plupload_progress_bar {
306
+ display: block;
307
+ font-size: 0;
308
+ line-height: 0;
 
 
 
 
 
 
 
 
 
 
 
309
  }
310
+ .plupload_clearer {height: 0;}
 
 
 
 
311
 
312
  /* Misc */
313
+ .plupload_hidden {display: none !important;}
 
 
 
314
 
315
  .plupload_droptext {
316
+ position: absolute;
317
+ top: 0;
318
+ left: 0;
319
+ right: 0;
320
+ bottom: 0;
321
+ background: transparent;
322
+ text-align: center;
323
+ vertical-align: middle;
324
+ border: 0;
325
+ line-height: 160px;
326
+ display: none;
327
  }
328
 
329
  .plupload_dropbox .plupload_droptext {
330
+ display: block;
331
  }
332
 
333
+ .plupload_buttons, .plupload_upload_status {float: left}
 
 
 
334
 
335
  .plupload_message {
336
+ position: absolute;
337
+ top: -1px;
338
+ left: -1px;
339
+ height: 100%;
340
+ width: 100%;
341
  }
342
 
343
  .plupload_message p {
344
+ padding:0.7em;
345
+ margin:0;
346
  }
347
 
348
  .plupload_message strong {
349
+ font-weight: bold;
350
  }
351
 
352
  .plupload_message i {
353
+ font-style: italic;
354
  }
355
 
356
  .plupload_message p span.ui-icon {
357
+ float: left;
358
+ margin-right: 0.3em;
359
  }
360
 
361
  .plupload_header_content .ui-state-error,
362
  .plupload_header_content .ui-state-highlight {
363
+ border:none;
364
  }
365
 
366
  .plupload_message_close {
367
+ position:absolute;
368
+ top:5px;
369
+ right:5px;
370
+ cursor:pointer;
371
  }
372
 
373
  .plupload .ui-sortable-placeholder {
374
+ height:35px;
375
+ }
assets/global/plugins/pluploader/js/jquery.ui.plupload.js CHANGED
@@ -17,1326 +17,1339 @@
17
  * jquery.ui.sortable.js
18
  */
19
 
20
- /* global jQuery:true */
21
 
22
  /**
23
- jQuery UI based implementation of the Plupload API - multi-runtime file uploading API.
24
-
25
- To use the widget you must include _jQuery_ and _jQuery UI_ bundle (including `ui.core`, `ui.widget`, `ui.button`,
26
- `ui.progressbar` and `ui.sortable`).
27
-
28
- In general the widget is designed the way that you do not usually need to do anything to it after you instantiate it.
29
- But! You still can intervenue, to some extent, in case you need to. Although, due to the fact that widget is based on
30
- _jQuery UI_ widget factory, there are some specifics. See examples below for more details.
31
-
32
- @example
33
- <!-- Instantiating: -->
34
- <div id="uploader">
35
- <p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>
36
- </div>
37
-
38
- <script>
39
- $('#uploader').plupload({
40
- url : '../upload.php',
41
- filters : [
42
- {title : "Image files", extensions : "jpg,gif,png"}
43
- ],
44
- rename: true,
45
- sortable: true,
46
- flash_swf_url : '../../js/moxie.swf',
47
- silverlight_xap_url : '../../js/moxie.xap',
48
- });
49
- </script>
50
-
51
- @example
52
- // Invoking methods:
53
- $('#uploader').plupload(options);
54
-
55
- // Display welcome message in the notification area
56
- $('#uploader').plupload('notify', 'info', "This might be obvious, but you need to click 'Add Files' to add some files.");
57
-
58
- @example
59
- // Subscribing to the events...
60
- // ... on initialization:
61
- $('#uploader').plupload({
62
- ...
63
- viewchanged: function(event, args) {
64
- // stuff ...
65
- }
66
- });
67
- // ... or after initialization
68
- $('#uploader').on("viewchanged", function(event, args) {
69
- // stuff ...
70
- });
71
-
72
- @class UI.Plupload
73
- @constructor
74
- @param {Object} settings For detailed information about each option check documentation.
75
- @param {String} settings.url URL of the server-side upload handler.
76
- @param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled.
77
- @param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message.
78
- @param {Object} [settings.filters={}] Set of file type filters.
79
- @param {Array} [settings.filters.mime_types=[]] List of file types to accept, each one defined by title and list of extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR`
80
- @param {String|Number} [settings.filters.max_file_size=0] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`.
81
- @param {Boolean} [settings.filters.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`.
82
- @param {Number} [settings.filters.max_file_count=0] Limit the number of files that can reside in the queue at the same time (default is 0 - no limit).
83
- @param {String} [settings.flash_swf_url] URL of the Flash swf.
84
- @param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs.
85
- @param {Number|String} [settings.max_file_size] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`.
86
- @param {Number} [settings.max_retries=0] How many times to retry the chunk or file, before triggering Error event.
87
- @param {Boolean} [settings.multipart=true] Whether to send file and additional parameters as Multipart formated message.
88
- @param {Object} [settings.multipart_params] Hash of key/value pairs to send with every file upload.
89
- @param {Boolean} [settings.multi_selection=true] Enable ability to select multiple files at once in file dialog.
90
- @param {Boolean} [settings.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`.
91
- @param {String|Object} [settings.required_features] Either comma-separated list or hash of required features that chosen runtime should absolutely possess.
92
- @param {Object} [settings.resize] Enable resizng of images on client-side. Applies to `image/jpeg` and `image/png` only. `e.g. {width : 200, height : 200, quality : 90, crop: true}`
93
- @param {Number} [settings.resize.width] If image is bigger, it will be resized.
94
- @param {Number} [settings.resize.height] If image is bigger, it will be resized.
95
- @param {Number} [settings.resize.quality=90] Compression quality for jpegs (1-100).
96
- @param {Boolean} [settings.resize.crop=false] Whether to crop images to exact dimensions. By default they will be resized proportionally.
97
- @param {String} [settings.runtimes="html5,flash,silverlight,html4"] Comma separated list of runtimes, that Plupload will try in turn, moving to the next if previous fails.
98
- @param {String} [settings.silverlight_xap_url] URL of the Silverlight xap.
99
- @param {Boolean} [settings.unique_names=false] If true will generate unique filenames for uploaded files.
100
-
101
- @param {Boolean} [settings.autostart=false] Whether to auto start uploading right after file selection.
102
- @param {Boolean} [settings.dragdrop=true] Enable ability to add file to the queue by drag'n'dropping them from the desktop.
103
- @param {Boolean} [settings.rename=false] Enable ability to rename files in the queue.
104
- @param {Boolean} [settings.sortable=false] Enable ability to sort files in the queue, changing their uploading priority.
105
- @param {Object} [settings.buttons] Control the visibility of functional buttons.
106
- @param {Boolean} [settings.buttons.browse=true] Display browse button.
107
- @param {Boolean} [settings.buttons.start=true] Display start button.
108
- @param {Boolean} [settings.buttons.stop=true] Display stop button.
109
- @param {Object} [settings.views] Control various views of the file queue.
110
- @param {Boolean} [settings.views.list=true] Enable list view.
111
- @param {Boolean} [settings.views.thumbs=false] Enable thumbs view.
112
- @param {String} [settings.views.default='list'] Default view.
113
- @param {Boolean} [settings.views.remember=true] Whether to remember the current view (requires jQuery Cookie plugin).
114
- @param {Boolean} [settings.multiple_queues=true] Re-activate the widget after each upload procedure.
115
- */
116
- ;
117
- (function (window, document, plupload, o, $) {
118
-
119
- /**
120
- Dispatched when the widget is initialized and ready.
121
-
122
- @event ready
123
- @param {plupload.Uploader} uploader Uploader instance sending the event.
124
- */
125
-
126
- /**
127
- Dispatched when file dialog is closed.
128
-
129
- @event selected
130
- @param {plupload.Uploader} uploader Uploader instance sending the event.
131
- @param {Array} files Array of selected files represented by plupload.File objects
132
- */
133
-
134
- /**
135
- Dispatched when file dialog is closed.
136
-
137
- @event removed
138
- @param {plupload.Uploader} uploader Uploader instance sending the event.
139
- @param {Array} files Array of removed files represented by plupload.File objects
140
- */
141
-
142
- /**
143
- Dispatched when upload is started.
144
-
145
- @event started
146
- @param {plupload.Uploader} uploader Uploader instance sending the event.
147
- */
148
-
149
- /**
150
- Dispatched when upload is stopped.
151
-
152
- @event stopped
153
- @param {plupload.Uploader} uploader Uploader instance sending the event.
154
- */
155
-
156
- /**
157
- Dispatched during the upload process.
158
-
159
- @event progress
160
- @param {plupload.Uploader} uploader Uploader instance sending the event.
161
- @param {plupload.File} file File that is being uploaded (includes loaded and percent properties among others).
162
- @param {Number} size Total file size in bytes.
163
- @param {Number} loaded Number of bytes uploaded of the files total size.
164
- @param {Number} percent Number of percentage uploaded of the file.
165
- */
166
-
167
- /**
168
- Dispatched when file is uploaded.
169
-
170
- @event uploaded
171
- @param {plupload.Uploader} uploader Uploader instance sending the event.
172
- @param {plupload.File} file File that was uploaded.
173
- @param {Enum} status Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE.
174
- */
175
-
176
- /**
177
- Dispatched when upload of the whole queue is complete.
178
-
179
- @event complete
180
- @param {plupload.Uploader} uploader Uploader instance sending the event.
181
- @param {Array} files Array of uploaded files represented by plupload.File objects
182
- */
183
-
184
- /**
185
- Dispatched when the view is changed, e.g. from `list` to `thumbs` or vice versa.
186
-
187
- @event viewchanged
188
- @param {plupload.Uploader} uploader Uploader instance sending the event.
189
- @param {String} type Current view type.
190
- */
191
-
192
- /**
193
- Dispatched when error of some kind is detected.
194
-
195
- @event error
196
- @param {plupload.Uploader} uploader Uploader instance sending the event.
197
- @param {String} error Error message.
198
- @param {plupload.File} file File that was uploaded.
199
- @param {Enum} status Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE.
200
- */
201
-
202
- var uploaders = {};
203
-
204
- function _(str) {
205
- return plupload.translate(str) || str;
206
- }
207
-
208
- function renderUI(obj) {
209
- obj.id = obj.attr('id');
210
-
211
- obj.html(
212
- '<div class="plupload_wrapper">' +
213
- '<div class="ui-widget-content plupload_container">' +
214
- '<div class="ui-state-default ui-widget-header plupload_header">' +
215
- '<div class="plupload_header_content">' +
216
- '<div class="plupload_logo"> </div>' +
217
- '<div class="plupload_header_title">' + _("Select files") + '</div>' +
218
- '<div class="plupload_header_text">' + _("Add files to the upload queue and click the start button.") + '</div>' +
219
- '<div class="plupload_view_switch">' +
220
- '<input type="radio" id="' + obj.id + '_view_list" name="view_mode_' + obj.id + '" checked="checked" /><label class="plupload_button" for="' + obj.id + '_view_list" data-view="list">' + _('List') + '</label>' +
221
- '<input type="radio" id="' + obj.id + '_view_thumbs" name="view_mode_' + obj.id + '" /><label class="plupload_button" for="' + obj.id + '_view_thumbs" data-view="thumbs">' + _('Thumbnails') + '</label>' +
222
- '</div>' +
223
- '</div>' +
224
- '</div>' +
225
- '<table class="plupload_filelist plupload_filelist_header ui-widget-header">' +
226
- '<tr>' +
227
- '<td class="plupload_cell plupload_file_name">' + _('Filename') + '</td>' +
228
- '<td class="plupload_cell plupload_file_status">' + _('Status') + '</td>' +
229
- '<td class="plupload_cell plupload_file_size">' + _('Size') + '</td>' +
230
- '<td class="plupload_cell plupload_file_action">&nbsp;</td>' +
231
- '</tr>' +
232
- '</table>' +
233
- '<div class="plupload_content">' +
234
- '<div class="plupload_droptext">' + _("Drag files here.") + '</div>' +
235
- '<ul class="plupload_filelist_content"> </ul>' +
236
- '<div class="plupload_clearer">&nbsp;</div>' +
237
- '</div>' +
238
- '<table class="plupload_filelist plupload_filelist_footer ui-widget-header">' +
239
- '<tr>' +
240
- '<td class="plupload_cell plupload_file_name">' +
241
- '<div class="plupload_buttons"><!-- Visible -->' +
242
- '<a class="plupload_button plupload_add">' + _("Add Files") + '</a>&nbsp;' +
243
- '<a class="plupload_button plupload_start">' + _("Start Upload") + '</a>&nbsp;' +
244
- '<a class="plupload_button plupload_stop plupload_hidden">' + _("Stop Upload") + '</a>&nbsp;' +
245
- '</div>' +
246
- '<div class="plupload_started plupload_hidden"><!-- Hidden -->' +
247
- '<div class="plupload_progress plupload_right">' +
248
- '<div class="plupload_progress_container"></div>' +
249
- '</div>' +
250
- '<div class="plupload_cell plupload_upload_status"></div>' +
251
- '<div class="plupload_clearer">&nbsp;</div>' +
252
- '</div>' +
253
- '</td>' +
254
- '<td class="plupload_file_status"><span class="plupload_total_status">0%</span></td>' +
255
- '<td class="plupload_file_size"><span class="plupload_total_file_size">0 kb</span></td>' +
256
- '<td class="plupload_file_action"></td>' +
257
- '</tr>' +
258
- '</table>' +
259
- '</div>' +
260
- '<input class="plupload_count" value="0" type="hidden">' +
261
- '</div>'
262
- );
263
- }
264
-
265
- $.widget("ui.plupload", {
266
-
267
- widgetEventPrefix: '',
268
-
269
- contents_bak: '',
270
-
271
- options: {
272
- browse_button_hover: 'ui-state-hover',
273
- browse_button_active: 'ui-state-active',
274
-
275
- filters: {},
276
-
277
- // widget specific
278
- buttons: {
279
- browse: true,
280
- start: true,
281
- stop: true
282
- },
283
-
284
- views: {
285
- list: true,
286
- thumbs: false,
287
- active: 'list',
288
- remember: true // requires: https://github.com/carhartl/jquery-cookie, otherwise disabled even if set to true
289
- },
290
-
291
- thumb_width: 100,
292
- thumb_height: 60,
293
-
294
- multiple_queues: true, // re-use widget by default
295
- dragdrop: true,
296
- autostart: false,
297
- sortable: false,
298
- rename: false
299
- },
300
-
301
- FILE_COUNT_ERROR: -9001,
302
-
303
- _create: function () {
304
- var id = this.element.attr('id');
305
- if (!id) {
306
- id = plupload.guid();
307
- this.element.attr('id', id);
308
- }
309
- this.id = id;
310
-
311
- // backup the elements initial state
312
- this.contents_bak = this.element.html();
313
- renderUI(this.element);
314
-
315
- // container, just in case
316
- this.container = $('.plupload_container', this.element).attr('id', id + '_container');
317
-
318
- this.content = $('.plupload_content', this.element);
319
-
320
- if ($.fn.resizable) {
321
- this.container.resizable({
322
- handles: 's',
323
- minHeight: 300
324
- });
325
- }
326
-
327
- // list of files, may become sortable
328
- this.filelist = $('.plupload_filelist_content', this.container)
329
- .attr({
330
- id: id + '_filelist',
331
- unselectable: 'on'
332
- });
333
-
334
- // buttons
335
- this.browse_button = $('.plupload_add', this.container).attr('id', id + '_browse');
336
- this.start_button = $('.plupload_start', this.container).attr('id', id + '_start');
337
- this.stop_button = $('.plupload_stop', this.container).attr('id', id + '_stop');
338
- this.thumbs_switcher = $('#' + id + '_view_thumbs');
339
- this.list_switcher = $('#' + id + '_view_list');
340
-
341
- if ($.ui.button) {
342
- this.browse_button.button({
343
- icons: {
344
- primary: 'ui-icon-circle-plus'
345
- },
346
- disabled: true
347
- });
348
-
349
- this.start_button.button({
350
- icons: {
351
- primary: 'ui-icon-circle-arrow-e'
352
- },
353
- disabled: true
354
- });
355
-
356
- this.stop_button.button({
357
- icons: {
358
- primary: 'ui-icon-circle-close'
359
- }
360
- });
361
-
362
- this.list_switcher.button({
363
- text: false,
364
- icons: {
365
- secondary: "ui-icon-grip-dotted-horizontal"
366
- }
367
- });
368
-
369
- this.thumbs_switcher.button({
370
- text: false,
371
- icons: {
372
- secondary: "ui-icon-image"
373
- }
374
- });
375
- }
376
-
377
- // progressbar
378
- this.progressbar = $('.plupload_progress_container', this.container);
379
-
380
- if ($.ui.progressbar) {
381
- this.progressbar.progressbar();
382
- }
383
-
384
- // counter
385
- this.counter = $('.plupload_count', this.element)
386
- .attr({
387
- id: id + '_count',
388
- name: id + '_count'
389
- });
390
-
391
- // initialize uploader instance
392
- this._initUploader();
393
- },
394
-
395
- _initUploader: function () {
396
- var self = this,
397
- id = this.id,
398
- uploader, options = {
399
- container: id + '_buttons',
400
- browse_button: id + '_browse'
401
- };
402
-
403
- $('.plupload_buttons', this.element).attr('id', id + '_buttons');
404
-
405
- if (self.options.dragdrop) {
406
- this.filelist.parent().attr('id', this.id + '_dropbox');
407
- options.drop_element = this.id + '_dropbox';
408
- }
409
-
410
- this.filelist.on('click', function (e) {
411
- if ($(e.target).hasClass('plupload_action_icon')) {
412
- self.removeFile($(e.target).closest('.plupload_file').attr('id'));
413
- e.preventDefault();
414
- }
415
- });
416
-
417
- uploader = this.uploader = uploaders[id] = new plupload.Uploader($.extend(this.options, options));
418
-
419
- // retrieve full normalized set of options
420
- this.options = uploader.getOption();
421
-
422
- if (self.options.views.thumbs) {
423
- uploader.settings.required_features.display_media = true;
424
- }
425
-
426
- // for backward compatibility
427
- if (self.options.max_file_count) {
428
- plupload.extend(uploader.getOption('filters'), {
429
- max_file_count: self.options.max_file_count
430
- });
431
- }
432
-
433
- plupload.addFileFilter('max_file_count', function (maxCount, file, cb) {
434
- if (maxCount <= this.files.length - (this.total.uploaded + this.total.failed)) {
435
- self.browse_button.button('disable');
436
- this.disableBrowse();
437
-
438
- this.trigger('Error', {
439
- code: self.FILE_COUNT_ERROR,
440
- message: _("File count error."),
441
- file: file
442
- });
443
- cb(false);
444
- } else {
445
- cb(true);
446
- }
447
- });
448
-
449
- uploader.bind('Error', function (up, err) {
450
- var message, details = "";
451
-
452
- message = '<strong>' + err.message + '</strong>';
453
-
454
- switch (err.code) {
455
- case plupload.FILE_EXTENSION_ERROR:
456
- details = o.sprintf(_("File: %s"), err.file.name);
457
- break;
458
-
459
- case plupload.FILE_SIZE_ERROR:
460
- details = o.sprintf(_("File: %s, size: %d, max file size: %d"), err.file.name, plupload.formatSize(err.file.size), plupload.formatSize(plupload.parseSize(up.getOption('filters').max_file_size)));
461
- break;
462
-
463
- case plupload.FILE_DUPLICATE_ERROR:
464
- details = o.sprintf(_("%s already present in the queue."), err.file.name);
465
- break;
466
-
467
- case self.FILE_COUNT_ERROR:
468
- details = o.sprintf(_("Upload element accepts only %d file(s) at a time. Extra files were stripped."), up.getOption('filters').max_file_count || 0);
469
- break;
470
-
471
- case plupload.IMAGE_FORMAT_ERROR:
472
- details = _("Image format either wrong or not supported.");
473
- break;
474
-
475
- case plupload.IMAGE_MEMORY_ERROR:
476
- details = _("Runtime ran out of available memory.");
477
- break;
478
-
479
- /* // This needs a review
480
- case plupload.IMAGE_DIMENSIONS_ERROR :
481
- details = o.sprintf(_('Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.'), up.runtime, up.features.maxWidth, up.features.maxHeight);
482
- break; */
483
-
484
- case plupload.HTTP_ERROR:
485
- details = _("Upload URL might be wrong or doesn't exist.");
486
- break;
487
- }
488
-
489
- message += " <br /><i>" + details + "</i>";
490
-
491
- self._trigger('error', null, {
492
- up: up,
493
- error: err
494
- });
495
-
496
- // do not show UI if no runtime can be initialized
497
- if (err.code === plupload.INIT_ERROR) {
498
- setTimeout(function () {
499
- self.destroy();
500
- }, 1);
501
- } else {
502
- self.notify('error', message);
503
- }
504
- });
505
-
506
- uploader.bind('PostInit', function (up) {
507
- // all buttons are optional, so they can be disabled and hidden
508
- if (!self.options.buttons.browse) {
509
- self.browse_button.button('disable').hide();
510
- up.disableBrowse(true);
511
- } else {
512
- self.browse_button.button('enable');
513
- }
514
-
515
- if (!self.options.buttons.start) {
516
- self.start_button.button('disable').hide();
517
- }
518
-
519
- if (!self.options.buttons.stop) {
520
- self.stop_button.button('disable').hide();
521
- }
522
-
523
- if (!self.options.unique_names && self.options.rename) {
524
- self._enableRenaming();
525
- }
526
-
527
- if (self.options.dragdrop && up.features.dragdrop) {
528
- self.filelist.parent().addClass('plupload_dropbox');
529
- }
530
-
531
- self._enableViewSwitcher();
532
-
533
- self.start_button.click(function (e) {
534
- if (!$(this).button('option', 'disabled')) {
535
- self.start();
536
- }
537
- e.preventDefault();
538
- });
539
-
540
- self.stop_button.click(function (e) {
541
- self.stop();
542
- e.preventDefault();
543
- });
544
-
545
- self._trigger('ready', null, {
546
- up: up
547
- });
548
- });
549
-
550
- // uploader internal events must run first
551
- uploader.init();
552
-
553
- uploader.bind('FileFiltered', function (up, file) {
554
- self._addFiles(file);
555
- });
556
-
557
- uploader.bind('FilesAdded', function (up, files) {
558
- self._trigger('selected', null, {
559
- up: up,
560
- files: files
561
- });
562
-
563
- // re-enable sortable
564
- if (self.options.sortable && $.ui.sortable) {
565
- self._enableSortingList();
566
- }
567
-
568
- self._trigger('updatelist', null, {
569
- filelist: self.filelist
570
- });
571
-
572
- if (self.options.autostart) {
573
- // set a little delay to make sure that QueueChanged triggered by the core has time to complete
574
- setTimeout(function () {
575
- self.start();
576
- }, 10);
577
- }
578
- });
579
-
580
- uploader.bind('FilesRemoved', function (up, files) {
581
- // destroy sortable if enabled
582
- if ($.ui.sortable && self.options.sortable) {
583
- $('tbody', self.filelist).sortable('destroy');
584
- }
585
-
586
- $.each(files, function (i, file) {
587
- $('#' + file.id).toggle("highlight", function () {
588
- $(this).remove();
589
- });
590
- });
591
-
592
- if (up.files.length) {
593
- // re-initialize sortable
594
- if (self.options.sortable && $.ui.sortable) {
595
- self._enableSortingList();
596
- }
597
- }
598
-
599
- self._trigger('updatelist', null, {
600
- filelist: self.filelist
601
- });
602
- self._trigger('removed', null, {
603
- up: up,
604
- files: files
605
- });
606
- });
607
-
608
- uploader.bind('QueueChanged', function () {
609
- self._handleState();
610
- });
611
-
612
- uploader.bind('StateChanged', function (up) {
613
- self._handleState();
614
- if (plupload.STARTED === up.state) {
615
- self._trigger('started', null, {
616
- up: this.uploader
617
- });
618
- } else if (plupload.STOPPED === up.state) {
619
- self._trigger('stopped', null, {
620
- up: this.uploader
621
- });
622
- }
623
- });
624
-
625
- uploader.bind('UploadFile', function (up, file) {
626
- self._handleFileStatus(file);
627
- });
628
-
629
- uploader.bind('FileUploaded', function (up, file, result) {
630
- self._handleFileStatus(file);
631
- self._trigger('uploaded', null, {
632
- up: up,
633
- file: file,
634
- result: result
635
- });
636
- });
637
-
638
- uploader.bind('UploadProgress', function (up, file) {
639
- self._handleFileStatus(file);
640
- self._updateTotalProgress();
641
- self._trigger('progress', null, {
642
- up: up,
643
- file: file
644
- });
645
- });
646
-
647
- uploader.bind('UploadComplete', function (up, files) {
648
- self._addFormFields();
649
- self._trigger('complete', null, {
650
- up: up,
651
- files: files
652
- });
653
- });
654
- },
655
-
656
- _setOption: function (key, value) {
657
- var self = this;
658
-
659
- if (key == 'buttons' && typeof (value) == 'object') {
660
- value = $.extend(self.options.buttons, value);
661
-
662
- if (!value.browse) {
663
- self.browse_button.button('disable').hide();
664
- self.uploader.disableBrowse(true);
665
- } else {
666
- self.browse_button.button('enable').show();
667
- self.uploader.disableBrowse(false);
668
- }
669
-
670
- if (!value.start) {
671
- self.start_button.button('disable').hide();
672
- } else {
673
- self.start_button.button('enable').show();
674
- }
675
-
676
- if (!value.stop) {
677
- self.stop_button.button('disable').hide();
678
- } else {
679
- self.start_button.button('enable').show();
680
- }
681
- }
682
-
683
- self.uploader.setOption(key, value);
684
- },
685
-
686
- /**
687
- Start upload. Triggers `start` event.
688
-
689
- @method start
690
- */
691
- start: function () {
692
- this.uploader.start();
693
- },
694
-
695
- /**
696
- Stop upload. Triggers `stop` event.
697
-
698
- @method stop
699
- */
700
- stop: function () {
701
- this.uploader.stop();
702
- },
703
-
704
- /**
705
- Enable browse button.
706
-
707
- @method enable
708
- */
709
- enable: function () {
710
- this.browse_button.button('enable');
711
- this.uploader.disableBrowse(false);
712
- },
713
-
714
- /**
715
- Disable browse button.
716
-
717
- @method disable
718
- */
719
- disable: function () {
720
- this.browse_button.button('disable');
721
- this.uploader.disableBrowse(true);
722
- },
723
-
724
- /**
725
- Retrieve file by its unique id.
726
-
727
- @method getFile
728
- @param {String} id Unique id of the file
729
- @return {plupload.File}
730
- */
731
- getFile: function (id) {
732
- var file;
733
-
734
- if (typeof id === 'number') {
735
- file = this.uploader.files[id];
736
- } else {
737
- file = this.uploader.getFile(id);
738
- }
739
- return file;
740
- },
741
-
742
- /**
743
- Return array of files currently in the queue.
744
-
745
- @method getFiles
746
- @return {Array} Array of files in the queue represented by plupload.File objects
747
- */
748
- getFiles: function () {
749
- return this.uploader.files;
750
- },
751
-
752
- /**
753
- Remove the file from the queue.
754
-
755
- @method removeFile
756
- @param {plupload.File|String} file File to remove, might be specified directly or by its unique id
757
- */
758
- removeFile: function (file) {
759
- if (plupload.typeOf(file) === 'string') {
760
- file = this.getFile(file);
761
- }
762
- this.uploader.removeFile(file);
763
- },
764
-
765
- /**
766
- Clear the file queue.
767
-
768
- @method clearQueue
769
- */
770
- clearQueue: function () {
771
- this.uploader.splice();
772
- },
773
-
774
- /**
775
- Retrieve internal plupload.Uploader object (usually not required).
776
-
777
- @method getUploader
778
- @return {plupload.Uploader}
779
- */
780
- getUploader: function () {
781
- return this.uploader;
782
- },
783
-
784
- /**
785
- Trigger refresh procedure, specifically browse_button re-measure and re-position operations.
786
- Might get handy, when UI Widget is placed within the popup, that is constantly hidden and shown
787
- again - without calling this method after each show operation, dialog trigger might get displaced
788
- and disfunctional.
789
-
790
- @method refresh
791
- */
792
- refresh: function () {
793
- this.uploader.refresh();
794
- },
795
-
796
- /**
797
- Display a message in notification area.
798
-
799
- @method notify
800
- @param {Enum} type Type of the message, either `error` or `info`
801
- @param {String} message The text message to display.
802
- */
803
- notify: function (type, message) {
804
- var popup = $(
805
- '<div class="plupload_message">' +
806
- '<span class="plupload_message_close ui-icon ui-icon-circle-close" title="' + _('Close') + '"></span>' +
807
- '<p><span class="ui-icon"></span>' + message + '</p>' +
808
- '</div>'
809
- );
810
-
811
- popup
812
- .addClass('ui-state-' + (type === 'error' ? 'error' : 'highlight'))
813
- .find('p .ui-icon')
814
- .addClass('ui-icon-' + (type === 'error' ? 'alert' : 'info'))
815
- .end()
816
- .find('.plupload_message_close')
817
- .click(function () {
818
- popup.remove();
819
- })
820
- .end();
821
-
822
- $('.plupload_header', this.container).append(popup);
823
- },
824
-
825
- /**
826
- Destroy the widget, the uploader, free associated resources and bring back original html.
827
-
828
- @method destroy
829
- */
830
- destroy: function () {
831
- // destroy uploader instance
832
- this.uploader.destroy();
833
-
834
- // unbind all button events
835
- $('.plupload_button', this.element).unbind();
836
-
837
- // destroy buttons
838
- if ($.ui.button) {
839
- $('.plupload_add, .plupload_start, .plupload_stop', this.container)
840
- .button('destroy');
841
- }
842
-
843
- // destroy progressbar
844
- if ($.ui.progressbar) {
845
- this.progressbar.progressbar('destroy');
846
- }
847
-
848
- // destroy sortable behavior
849
- if ($.ui.sortable && this.options.sortable) {
850
- $('tbody', this.filelist).sortable('destroy');
851
- }
852
-
853
- // restore the elements initial state
854
- this.element
855
- .empty()
856
- .html(this.contents_bak);
857
- this.contents_bak = '';
858
-
859
- $.Widget.prototype.destroy.apply(this);
860
- },
861
-
862
- _handleState: function () {
863
- var up = this.uploader,
864
- filesPending = up.files.length - (up.total.uploaded + up.total.failed),
865
- maxCount = up.getOption('filters').max_file_count || 0;
866
-
867
- if (plupload.STARTED === up.state) {
868
- $([])
869
- .add(this.stop_button)
870
- .add('.plupload_started')
871
- .removeClass('plupload_hidden');
872
-
873
- this.start_button.button('disable');
874
-
875
- if (!this.options.multiple_queues) {
876
- this.browse_button.button('disable');
877
- up.disableBrowse();
878
- }
879
-
880
- $('.plupload_upload_status', this.element).html(o.sprintf(_('Uploaded %d/%d files'), up.total.uploaded, up.files.length));
881
- $('.plupload_header_content', this.element).addClass('plupload_header_content_bw');
882
- } else if (plupload.STOPPED === up.state) {
883
- $([])
884
- .add(this.stop_button)
885
- .add('.plupload_started')
886
- .addClass('plupload_hidden');
887
-
888
- if (filesPending) {
889
- this.start_button.button('enable');
890
- } else {
891
- this.start_button.button('disable');
892
- }
893
-
894
- if (this.options.multiple_queues) {
895
- $('.plupload_header_content', this.element).removeClass('plupload_header_content_bw');
896
- }
897
-
898
- // if max_file_count defined, only that many files can be queued at once
899
- if (this.options.multiple_queues && maxCount && maxCount > filesPending) {
900
- this.browse_button.button('enable');
901
- up.disableBrowse(false);
902
- }
903
-
904
- this._updateTotalProgress();
905
- }
906
-
907
- if (up.total.queued === 0) {
908
- $('.ui-button-text', this.browse_button).html(_('Add Files'));
909
- } else {
910
- $('.ui-button-text', this.browse_button).html(o.sprintf(_('%d files queued'), up.total.queued));
911
- }
912
-
913
- up.refresh();
914
- },
915
-
916
- _handleFileStatus: function (file) {
917
- var $file = $('#' + file.id),
918
- actionClass, iconClass;
919
-
920
- // since this method might be called asynchronously, file row might not yet be rendered
921
- if (!$file.length) {
922
- return;
923
- }
924
-
925
- switch (file.status) {
926
- case plupload.DONE:
927
- actionClass = 'plupload_done';
928
- iconClass = 'plupload_action_icon ui-icon ui-icon-circle-check';
929
- break;
930
-
931
- case plupload.FAILED:
932
- actionClass = 'ui-state-error plupload_failed';
933
- iconClass = 'plupload_action_icon ui-icon ui-icon-alert';
934
- break;
935
-
936
- case plupload.QUEUED:
937
- actionClass = 'plupload_delete';
938
- iconClass = 'plupload_action_icon ui-icon ui-icon-circle-minus';
939
- break;
940
-
941
- case plupload.UPLOADING:
942
- actionClass = 'ui-state-highlight plupload_uploading';
943
- iconClass = 'plupload_action_icon ui-icon ui-icon-circle-arrow-w';
944
-
945
- // scroll uploading file into the view if its bottom boundary is out of it
946
- var scroller = $('.plupload_scroll', this.container),
947
- scrollTop = scroller.scrollTop(),
948
- scrollerHeight = scroller.height(),
949
- rowOffset = $file.position().top + $file.height();
950
-
951
- if (scrollerHeight < rowOffset) {
952
- scroller.scrollTop(scrollTop + rowOffset - scrollerHeight);
953
- }
954
-
955
- // Set file specific progress
956
- $file
957
- .find('.plupload_file_percent')
958
- .html(file.percent + '%')
959
- .end()
960
- .find('.plupload_file_progress')
961
- .css('width', file.percent + '%')
962
- .end()
963
- .find('.plupload_file_size')
964
- .html(plupload.formatSize(file.size));
965
- break;
966
- }
967
- actionClass += ' ui-state-default plupload_file';
968
-
969
- $file
970
- .attr('class', actionClass)
971
- .find('.plupload_action_icon')
972
- .attr('class', iconClass);
973
- },
974
-
975
- _updateTotalProgress: function () {
976
- var up = this.uploader;
977
-
978
- // Scroll to end of file list
979
- this.filelist[0].scrollTop = this.filelist[0].scrollHeight;
980
-
981
- this.progressbar.progressbar('value', up.total.percent);
982
-
983
- this.element
984
- .find('.plupload_total_status')
985
- .html(up.total.percent + '%')
986
- .end()
987
- .find('.plupload_total_file_size')
988
- .html(plupload.formatSize(up.total.size))
989
- .end()
990
- .find('.plupload_upload_status')
991
- .html(o.sprintf(_('Uploaded %d/%d files'), up.total.uploaded, up.files.length));
992
- },
993
-
994
- _displayThumbs: function () {
995
- var self = this,
996
- tw, th // thumb width/height
997
- , cols, num = 0 // number of simultaneously visible thumbs
998
- ,
999
- thumbs = [] // array of thumbs to preload at any given moment
1000
- ,
1001
- loading = false;
1002
-
1003
- if (!this.options.views.thumbs) {
1004
- return;
1005
- }
1006
-
1007
- function onLast(el, eventName, cb) {
1008
- var timer;
1009
-
1010
- el.on(eventName, function () {
1011
- clearTimeout(timer);
1012
- timer = setTimeout(function () {
1013
- clearTimeout(timer);
1014
- cb();
1015
- }, 300);
1016
- });
1017
- }
1018
-
1019
- // calculate number of simultaneously visible thumbs
1020
- function measure() {
1021
- if (!tw || !th) {
1022
- var wrapper = $('.plupload_file:eq(0)', self.filelist);
1023
- tw = wrapper.outerWidth(true);
1024
- th = wrapper.outerHeight(true);
1025
- }
1026
-
1027
- var aw = self.content.width(),
1028
- ah = self.content.height();
1029
- cols = Math.floor(aw / tw);
1030
- num = cols * (Math.ceil(ah / th) + 1);
1031
- }
1032
-
1033
- function pickThumbsToLoad() {
1034
- // calculate index of virst visible thumb
1035
- var startIdx = Math.floor(self.content.scrollTop() / th) * cols;
1036
- // get potentially visible thumbs that are not yet visible
1037
- thumbs = $('.plupload_file .plupload_file_thumb', self.filelist)
1038
- .slice(startIdx, startIdx + num)
1039
- .filter('.plupload_thumb_toload')
1040
- .get();
1041
- }
1042
-
1043
- function init() {
1044
- function mpl() { // measure, pick, load
1045
- if (self.view_mode !== 'thumbs') {
1046
- return;
1047
- }
1048
- measure();
1049
- pickThumbsToLoad();
1050
- lazyLoad();
1051
- }
1052
-
1053
- if ($.fn.resizable) {
1054
- onLast(self.container, 'resize', mpl);
1055
- }
1056
-
1057
- onLast(self.window, 'resize', mpl);
1058
- onLast(self.content, 'scroll', mpl);
1059
-
1060
- self.element.on('viewchanged selected', mpl);
1061
-
1062
- mpl();
1063
- }
1064
-
1065
- function preloadThumb(file, cb) {
1066
- var img = new o.Image();
1067
-
1068
- img.onload = function () {
1069
- var thumb = $('#' + file.id + ' .plupload_file_thumb', self.filelist);
1070
- this.embed(thumb[0], {
1071
- width: self.options.thumb_width,
1072
- height: self.options.thumb_height,
1073
- crop: true,
1074
- preserveHeaders: false,
1075
- swf_url: o.resolveUrl(self.options.flash_swf_url),
1076
- xap_url: o.resolveUrl(self.options.silverlight_xap_url)
1077
- });
1078
- };
1079
-
1080
- img.bind("embedded error", function (e) {
1081
- $('#' + file.id, self.filelist)
1082
- .find('.plupload_file_thumb')
1083
- .removeClass('plupload_thumb_loading')
1084
- .addClass('plupload_thumb_' + e.type);
1085
- this.destroy();
1086
- setTimeout(cb, 1); // detach, otherwise ui might hang (in SilverLight for example)
1087
- });
1088
-
1089
- $('#' + file.id, self.filelist)
1090
- .find('.plupload_file_thumb')
1091
- .removeClass('plupload_thumb_toload')
1092
- .addClass('plupload_thumb_loading');
1093
- img.load(file.getSource());
1094
- }
1095
-
1096
- function lazyLoad() {
1097
- if (self.view_mode !== 'thumbs' || loading) {
1098
- return;
1099
- }
1100
-
1101
- pickThumbsToLoad();
1102
- if (!thumbs.length) {
1103
- return;
1104
- }
1105
-
1106
- loading = true;
1107
-
1108
- preloadThumb(self.getFile($(thumbs.shift()).closest('.plupload_file').attr('id')), function () {
1109
- loading = false;
1110
- lazyLoad();
1111
- });
1112
- }
1113
-
1114
- // this has to run only once to measure structures and bind listeners
1115
- this.element.on('selected', function onselected() {
1116
- self.element.off('selected', onselected);
1117
- init();
1118
- });
1119
- },
1120
-
1121
- _addFiles: function (files) {
1122
- var self = this,
1123
- file_html, html = '';
1124
-
1125
- file_html = '<li class="plupload_file ui-state-default plupload_delete" id="{id}" style="width:{thumb_width}px;">' +
1126
- '<div class="plupload_file_thumb plupload_thumb_toload" style="width: {thumb_width}px; height: {thumb_height}px;">' +
1127
- '<div class="plupload_file_dummy ui-widget-content" style="line-height: {thumb_height}px;"><span class="ui-state-disabled">{ext} </span></div>' +
1128
- '</div>' +
1129
- '<div class="plupload_file_status">' +
1130
- '<div class="plupload_file_progress ui-widget-header" style="width: 0%"> </div>' +
1131
- '<span class="plupload_file_percent">{percent} </span>' +
1132
- '</div>' +
1133
- '<div class="plupload_file_name" title="{name}">' +
1134
- '<span class="plupload_file_name_wrapper">{name} </span>' +
1135
- '</div>' +
1136
- '<div class="plupload_file_action">' +
1137
- '<div class="plupload_action_icon ui-icon ui-icon-circle-minus"> </div>' +
1138
- '</div>' +
1139
- '<div class="plupload_file_size">{size} </div>' +
1140
- '<div class="plupload_file_fields"> </div>' +
1141
- '</li>';
1142
-
1143
- if (plupload.typeOf(files) !== 'array') {
1144
- files = [files];
1145
- }
1146
-
1147
- $.each(files, function (i, file) {
1148
- var ext = o.Mime.getFileExtension(file.name) || 'none';
1149
-
1150
- html += file_html.replace(/\{(\w+)\}/g, function ($0, $1) {
1151
- switch ($1) {
1152
- case 'thumb_width':
1153
- case 'thumb_height':
1154
- return self.options[$1];
1155
-
1156
- case 'size':
1157
- return plupload.formatSize(file.size);
1158
-
1159
- case 'ext':
1160
- return ext;
1161
-
1162
- default:
1163
- return file[$1] || '';
1164
- }
1165
- });
1166
- });
1167
-
1168
- self.filelist.append(html);
1169
- },
1170
-
1171
- _addFormFields: function () {
1172
- var self = this;
1173
-
1174
- // re-add from fresh
1175
- $('.plupload_file_fields', this.filelist).html('');
1176
-
1177
- plupload.each(this.uploader.files, function (file, count) {
1178
- var fields = '',
1179
- id = self.id + '_' + count;
1180
-
1181
- if (file.target_name) {
1182
- fields += '<input type="hidden" name="' + id + '_tmpname" value="' + plupload.xmlEncode(file.target_name) + '" />';
1183
- }
1184
- fields += '<input type="hidden" name="' + id + '_name" value="' + plupload.xmlEncode(file.name) + '" />';
1185
- fields += '<input type="hidden" name="' + id + '_status" value="' + (file.status === plupload.DONE ? 'done' : 'failed') + '" />';
1186
-
1187
- $('#' + file.id).find('.plupload_file_fields').html(fields);
1188
- });
1189
-
1190
- this.counter.val(this.uploader.files.length);
1191
- },
1192
-
1193
- _viewChanged: function (view) {
1194
- // update or write a new cookie
1195
- if (this.options.views.remember && $.cookie) {
1196
- $.cookie('plupload_ui_view', view, {
1197
- expires: 7,
1198
- path: '/'
1199
- });
1200
- }
1201
-
1202
- // ugly fix for IE6 - make content area stretchable
1203
- if (o.Env.browser === 'IE' && o.Env.version < 7) {
1204
- this.content.attr('style', 'height:expression(document.getElementById("' + this.id + '_container' + '").clientHeight - ' + (view === 'list' ? 132 : 102) + ')');
1205
- }
1206
-
1207
- this.container.removeClass('plupload_view_list plupload_view_thumbs').addClass('plupload_view_' + view);
1208
- this.view_mode = view;
1209
- this._trigger('viewchanged', null, {
1210
- view: view
1211
- });
1212
- },
1213
-
1214
- _enableViewSwitcher: function () {
1215
- var self = this,
1216
- view, switcher = $('.plupload_view_switch', this.container),
1217
- buttons, button;
1218
-
1219
- plupload.each(['list', 'thumbs'], function (view) {
1220
- if (!self.options.views[view]) {
1221
- switcher.find('[for="' + self.id + '_view_' + view + '"], #' + self.id + '_view_' + view).remove();
1222
- }
1223
- });
1224
-
1225
- // check if any visible left
1226
- buttons = switcher.find('.plupload_button');
1227
-
1228
- if (buttons.length === 1) {
1229
- switcher.hide();
1230
- view = buttons.eq(0).data('view');
1231
- this._viewChanged(view);
1232
- } else if ($.ui.button && buttons.length > 1) {
1233
- if (this.options.views.remember && $.cookie) {
1234
- view = $.cookie('plupload_ui_view');
1235
- }
1236
-
1237
- // if wierd case, bail out to default
1238
- if (!~plupload.inArray(view, ['list', 'thumbs'])) {
1239
- view = this.options.views.active;
1240
- }
1241
-
1242
- switcher
1243
- .show()
1244
- .buttonset()
1245
- .find('.ui-button')
1246
- .click(function (e) {
1247
- view = $(this).data('view');
1248
- self._viewChanged(view);
1249
- e.preventDefault(); // avoid auto scrolling to widget in IE and FF (see #850)
1250
- });
1251
-
1252
- // if view not active - happens when switcher wasn't clicked manually
1253
- button = switcher.find('[for="' + self.id + '_view_' + view + '"]');
1254
- if (button.length) {
1255
- button.trigger('click');
1256
- }
1257
- } else {
1258
- switcher.show();
1259
- this._viewChanged(this.options.views.active);
1260
- }
1261
-
1262
- // initialize thumb viewer if requested
1263
- if (this.options.views.thumbs) {
1264
- this._displayThumbs();
1265
- }
1266
- },
1267
-
1268
- _enableRenaming: function () {
1269
- var self = this;
1270
-
1271
- this.filelist.dblclick(function (e) {
1272
- var nameSpan = $(e.target),
1273
- nameInput, file, parts, name, ext = "";
1274
-
1275
- if (!nameSpan.hasClass('plupload_file_name_wrapper')) {
1276
- return;
1277
- }
1278
-
1279
- // Get file name and split out name and extension
1280
- file = self.uploader.getFile(nameSpan.closest('.plupload_file')[0].id);
1281
- name = file.name;
1282
- parts = /^(.+)(\.[^.]+)$/.exec(name);
1283
- if (parts) {
1284
- name = parts[1];
1285
- ext = parts[2];
1286
- }
1287
-
1288
- // Display input element
1289
- nameInput = $('<input class="plupload_file_rename" type="text" />').width(nameSpan.width()).insertAfter(nameSpan.hide());
1290
- nameInput.val(name).blur(function () {
1291
- nameSpan.show().parent().scrollLeft(0).end().next().remove();
1292
- }).keydown(function (e) {
1293
- var nameInput = $(this);
1294
-
1295
- if ($.inArray(e.keyCode, [13, 27]) !== -1) {
1296
- e.preventDefault();
1297
-
1298
- // Rename file and glue extension back on
1299
- if (e.keyCode === 13) {
1300
- file.name = nameInput.val() + ext;
1301
- nameSpan.html(file.name);
1302
- }
1303
- nameInput.blur();
1304
- }
1305
- })[0].focus();
1306
- });
1307
- },
1308
-
1309
- _enableSortingList: function () {
1310
- var self = this;
1311
-
1312
- if ($('.plupload_file', this.filelist).length < 2) {
1313
- return;
1314
- }
1315
-
1316
- // destroy sortable if enabled
1317
- $('tbody', this.filelist).sortable('destroy');
1318
-
1319
- // enable
1320
- this.filelist.sortable({
1321
- items: '.plupload_delete',
1322
-
1323
- cancel: 'object, .plupload_clearer',
1324
-
1325
- stop: function () {
1326
- var files = [];
1327
-
1328
- $.each($(this).sortable('toArray'), function (i, id) {
1329
- files[files.length] = self.uploader.getFile(id);
1330
- });
1331
-
1332
- files.unshift(files.length);
1333
- files.unshift(0);
1334
-
1335
- // re-populate files array
1336
- Array.prototype.splice.apply(self.uploader.files, files);
1337
- }
1338
- });
1339
- }
1340
- });
1341
-
1342
- }(window, document, plupload, mOxie, jQuery));
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  * jquery.ui.sortable.js
18
  */
19
 
20
+ /* global jQuery:true */
21
 
22
  /**
23
+ jQuery UI based implementation of the Plupload API - multi-runtime file uploading API.
24
+
25
+ To use the widget you must include _jQuery_ and _jQuery UI_ bundle (including `ui.core`, `ui.widget`, `ui.button`,
26
+ `ui.progressbar` and `ui.sortable`).
27
+
28
+ In general the widget is designed the way that you do not usually need to do anything to it after you instantiate it.
29
+ But! You still can intervenue, to some extent, in case you need to. Although, due to the fact that widget is based on
30
+ _jQuery UI_ widget factory, there are some specifics. See examples below for more details.
31
+
32
+ @example
33
+ <!-- Instantiating: -->
34
+ <div id="uploader">
35
+ <p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>
36
+ </div>
37
+
38
+ <script>
39
+ $('#uploader').plupload({
40
+ url : '../upload.php',
41
+ filters : [
42
+ {title : "Image files", extensions : "jpg,gif,png"}
43
+ ],
44
+ rename: true,
45
+ sortable: true,
46
+ flash_swf_url : '../../js/Moxie.swf',
47
+ silverlight_xap_url : '../../js/Moxie.xap',
48
+ });
49
+ </script>
50
+
51
+ @example
52
+ // Invoking methods:
53
+ $('#uploader').plupload(options);
54
+
55
+ // Display welcome message in the notification area
56
+ $('#uploader').plupload('notify', 'info', "This might be obvious, but you need to click 'Add Files' to add some files.");
57
+
58
+ @example
59
+ // Subscribing to the events...
60
+ // ... on initialization:
61
+ $('#uploader').plupload({
62
+ ...
63
+ viewchanged: function(event, args) {
64
+ // stuff ...
65
+ }
66
+ });
67
+ // ... or after initialization
68
+ $('#uploader').on("viewchanged", function(event, args) {
69
+ // stuff ...
70
+ });
71
+
72
+ @class UI.Plupload
73
+ @constructor
74
+ @param {Object} settings For detailed information about each option check documentation.
75
+ @param {String} settings.url URL of the server-side upload handler.
76
+ @param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled.
77
+ @param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message.
78
+ @param {Object} [settings.filters={}] Set of file type filters.
79
+ @param {Array} [settings.filters.mime_types=[]] List of file types to accept, each one defined by title and list of extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR`
80
+ @param {String|Number} [settings.filters.max_file_size=0] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`.
81
+ @param {Boolean} [settings.filters.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`.
82
+ @param {Number} [settings.filters.max_file_count=0] Limit the number of files that can reside in the queue at the same time (default is 0 - no limit).
83
+ @param {String} [settings.flash_swf_url] URL of the Flash swf.
84
+ @param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs.
85
+ @param {Number|String} [settings.max_file_size] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`.
86
+ @param {Number} [settings.max_retries=0] How many times to retry the chunk or file, before triggering Error event.
87
+ @param {Boolean} [settings.multipart=true] Whether to send file and additional parameters as Multipart formated message.
88
+ @param {Object} [settings.multipart_params] Hash of key/value pairs to send with every file upload.
89
+ @param {Boolean} [settings.multi_selection=true] Enable ability to select multiple files at once in file dialog.
90
+ @param {Boolean} [settings.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`.
91
+ @param {String|Object} [settings.required_features] Either comma-separated list or hash of required features that chosen runtime should absolutely possess.
92
+ @param {Object} [settings.resize] Enable resizng of images on client-side. Applies to `image/jpeg` and `image/png` only. `e.g. {width : 200, height : 200, quality : 90, crop: true}`
93
+ @param {Number} [settings.resize.width] If image is bigger, it will be resized.
94
+ @param {Number} [settings.resize.height] If image is bigger, it will be resized.
95
+ @param {Number} [settings.resize.quality=90] Compression quality for jpegs (1-100).
96
+ @param {Boolean} [settings.resize.crop=false] Whether to crop images to exact dimensions. By default they will be resized proportionally.
97
+ @param {String} [settings.runtimes="html5,flash,silverlight,html4"] Comma separated list of runtimes, that Plupload will try in turn, moving to the next if previous fails.
98
+ @param {String} [settings.silverlight_xap_url] URL of the Silverlight xap.
99
+ @param {Boolean} [settings.unique_names=false] If true will generate unique filenames for uploaded files.
100
+
101
+ @param {Boolean} [settings.autostart=false] Whether to auto start uploading right after file selection.
102
+ @param {Boolean} [settings.dragdrop=true] Enable ability to add file to the queue by drag'n'dropping them from the desktop.
103
+ @param {Boolean} [settings.rename=false] Enable ability to rename files in the queue.
104
+ @param {Boolean} [settings.sortable=false] Enable ability to sort files in the queue, changing their uploading priority.
105
+ @param {Object} [settings.buttons] Control the visibility of functional buttons.
106
+ @param {Boolean} [settings.buttons.browse=true] Display browse button.
107
+ @param {Boolean} [settings.buttons.start=true] Display start button.
108
+ @param {Boolean} [settings.buttons.stop=true] Display stop button.
109
+ @param {Object} [settings.views] Control various views of the file queue.
110
+ @param {Boolean} [settings.views.list=true] Enable list view.
111
+ @param {Boolean} [settings.views.thumbs=false] Enable thumbs view.
112
+ @param {String} [settings.views.default='list'] Default view.
113
+ @param {Boolean} [settings.views.remember=true] Whether to remember the current view (requires jQuery Cookie plugin).
114
+ @param {Boolean} [settings.multiple_queues=true] Re-activate the widget after each upload procedure.
115
+ */
116
+ ;(function(window, document, plupload, o, $) {
117
+
118
+ /**
119
+ Dispatched when the widget is initialized and ready.
120
+
121
+ @event ready
122
+ @param {plupload.Uploader} uploader Uploader instance sending the event.
123
+ */
124
+
125
+ /**
126
+ Dispatched when file dialog is closed.
127
+
128
+ @event selected
129
+ @param {plupload.Uploader} uploader Uploader instance sending the event.
130
+ @param {Array} files Array of selected files represented by plupload.File objects
131
+ */
132
+
133
+ /**
134
+ Dispatched when file dialog is closed.
135
+
136
+ @event removed
137
+ @param {plupload.Uploader} uploader Uploader instance sending the event.
138
+ @param {Array} files Array of removed files represented by plupload.File objects
139
+ */
140
+
141
+ /**
142
+ Dispatched when upload is started.
143
+
144
+ @event started
145
+ @param {plupload.Uploader} uploader Uploader instance sending the event.
146
+ */
147
+
148
+ /**
149
+ Dispatched when upload is stopped.
150
+
151
+ @event stopped
152
+ @param {plupload.Uploader} uploader Uploader instance sending the event.
153
+ */
154
+
155
+ /**
156
+ Dispatched during the upload process.
157
+
158
+ @event progress
159
+ @param {plupload.Uploader} uploader Uploader instance sending the event.
160
+ @param {plupload.File} file File that is being uploaded (includes loaded and percent properties among others).
161
+ @param {Number} size Total file size in bytes.
162
+ @param {Number} loaded Number of bytes uploaded of the files total size.
163
+ @param {Number} percent Number of percentage uploaded of the file.
164
+ */
165
+
166
+ /**
167
+ Dispatched when file is uploaded.
168
+
169
+ @event uploaded
170
+ @param {plupload.Uploader} uploader Uploader instance sending the event.
171
+ @param {plupload.File} file File that was uploaded.
172
+ @param {Enum} status Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE.
173
+ */
174
+
175
+ /**
176
+ Dispatched when upload of the whole queue is complete.
177
+
178
+ @event complete
179
+ @param {plupload.Uploader} uploader Uploader instance sending the event.
180
+ @param {Array} files Array of uploaded files represented by plupload.File objects
181
+ */
182
+
183
+ /**
184
+ Dispatched when the view is changed, e.g. from `list` to `thumbs` or vice versa.
185
+
186
+ @event viewchanged
187
+ @param {plupload.Uploader} uploader Uploader instance sending the event.
188
+ @param {String} type Current view type.
189
+ */
190
+
191
+ /**
192
+ Dispatched when error of some kind is detected.
193
+
194
+ @event error
195
+ @param {plupload.Uploader} uploader Uploader instance sending the event.
196
+ @param {String} error Error message.
197
+ @param {plupload.File} file File that was uploaded.
198
+ @param {Enum} status Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE.
199
+ */
200
+
201
+ var uploaders = {};
202
+
203
+ function _(str) {
204
+ return plupload.translate(str) || str;
205
+ }
206
+
207
+ function renderUI(obj) {
208
+ obj.id = obj.attr('id');
209
+
210
+ obj.html(
211
+ '<div class="plupload_wrapper">' +
212
+ '<div class="ui-widget-content plupload_container">' +
213
+ '<div class="ui-state-default ui-widget-header plupload_header">' +
214
+ '<div class="plupload_header_content">' +
215
+ '<div class="plupload_logo"> </div>' +
216
+ '<div class="plupload_header_title">' + _("Select files") + '</div>' +
217
+ '<div class="plupload_header_text">' + _("Add files to the upload queue and click the start button.") + '</div>' +
218
+ '<div class="plupload_view_switch">' +
219
+ '<input type="radio" id="'+obj.id+'_view_list" name="view_mode_'+obj.id+'" checked="checked" /><label class="plupload_button" for="'+obj.id+'_view_list" data-view="list">' + _('List') + '</label>' +
220
+ '<input type="radio" id="'+obj.id+'_view_thumbs" name="view_mode_'+obj.id+'" /><label class="plupload_button" for="'+obj.id+'_view_thumbs" data-view="thumbs">' + _('Thumbnails') + '</label>' +
221
+ '</div>' +
222
+ '</div>' +
223
+ '</div>' +
224
+
225
+ '<table class="plupload_filelist plupload_filelist_header ui-widget-header">' +
226
+ '<tr>' +
227
+ '<td class="plupload_cell plupload_file_name">' + _('Filename') + '</td>' +
228
+ '<td class="plupload_cell plupload_file_status">' + _('Status') + '</td>' +
229
+ '<td class="plupload_cell plupload_file_size">' + _('Size') + '</td>' +
230
+ '<td class="plupload_cell plupload_file_action">&nbsp;</td>' +
231
+ '</tr>' +
232
+ '</table>' +
233
+
234
+ '<div class="plupload_content">' +
235
+ '<div class="plupload_droptext">' + _("Drag files here.") + '</div>' +
236
+ '<ul class="plupload_filelist_content"> </ul>' +
237
+ '<div class="plupload_clearer">&nbsp;</div>' +
238
+ '</div>' +
239
+
240
+ '<table class="plupload_filelist plupload_filelist_footer ui-widget-header">' +
241
+ '<tr>' +
242
+ '<td class="plupload_cell plupload_file_name">' +
243
+ '<div class="plupload_buttons"><!-- Visible -->' +
244
+ '<a class="plupload_button plupload_add">' + _("Add Files") + '</a>&nbsp;' +
245
+ '<a class="plupload_button plupload_start">' + _("Start Upload") + '</a>&nbsp;' +
246
+ '<a class="plupload_button plupload_stop plupload_hidden">'+_("Stop Upload") + '</a>&nbsp;' +
247
+ '</div>' +
248
+
249
+ '<div class="plupload_started plupload_hidden"><!-- Hidden -->' +
250
+ '<div class="plupload_progress plupload_right">' +
251
+ '<div class="plupload_progress_container"></div>' +
252
+ '</div>' +
253
+
254
+ '<div class="plupload_cell plupload_upload_status"></div>' +
255
+
256
+ '<div class="plupload_clearer">&nbsp;</div>' +
257
+ '</div>' +
258
+ '</td>' +
259
+ '<td class="plupload_file_status"><span class="plupload_total_status">0%</span></td>' +
260
+ '<td class="plupload_file_size"><span class="plupload_total_file_size">0 kb</span></td>' +
261
+ '<td class="plupload_file_action"></td>' +
262
+ '</tr>' +
263
+ '</table>' +
264
+
265
+ '</div>' +
266
+ '<input class="plupload_count" value="0" type="hidden">' +
267
+ '</div>'
268
+ );
269
+ }
270
+
271
+
272
+ $.widget("ui.plupload", {
273
+
274
+ widgetEventPrefix: '',
275
+
276
+ contents_bak: '',
277
+
278
+ options: {
279
+ browse_button_hover: 'ui-state-hover',
280
+ browse_button_active: 'ui-state-active',
281
+
282
+ filters: {},
283
+
284
+ // widget specific
285
+ buttons: {
286
+ browse: true,
287
+ start: true,
288
+ stop: true
289
+ },
290
+
291
+ views: {
292
+ list: true,
293
+ thumbs: false,
294
+ active: 'list',
295
+ remember: true // requires: https://github.com/carhartl/jquery-cookie, otherwise disabled even if set to true
296
+ },
297
+
298
+ thumb_width: 100,
299
+ thumb_height: 60,
300
+
301
+ multiple_queues: true, // re-use widget by default
302
+ dragdrop : true,
303
+ autostart: false,
304
+ sortable: false,
305
+ rename: false
306
+ },
307
+
308
+ FILE_COUNT_ERROR: -9001,
309
+
310
+ _create: function() {
311
+ var id = this.element.attr('id');
312
+ if (!id) {
313
+ id = plupload.guid();
314
+ this.element.attr('id', id);
315
+ }
316
+ this.id = id;
317
+
318
+ // backup the elements initial state
319
+ this.contents_bak = this.element.html();
320
+ renderUI(this.element);
321
+
322
+ // container, just in case
323
+ this.container = $('.plupload_container', this.element).attr('id', id + '_container');
324
+
325
+ this.content = $('.plupload_content', this.element);
326
+
327
+ if ($.fn.resizable) {
328
+ this.container.resizable({
329
+ handles: 's',
330
+ minHeight: 300
331
+ });
332
+ }
333
+
334
+ // list of files, may become sortable
335
+ this.filelist = $('.plupload_filelist_content', this.container)
336
+ .attr({
337
+ id: id + '_filelist',
338
+ unselectable: 'on'
339
+ });
340
+
341
+
342
+ // buttons
343
+ this.browse_button = $('.plupload_add', this.container).attr('id', id + '_browse');
344
+ this.start_button = $('.plupload_start', this.container).attr('id', id + '_start');
345
+ this.stop_button = $('.plupload_stop', this.container).attr('id', id + '_stop');
346
+ this.thumbs_switcher = $('#' + id + '_view_thumbs');
347
+ this.list_switcher = $('#' + id + '_view_list');
348
+
349
+ if ($.ui.button) {
350
+ this.browse_button.button({
351
+ icons: { primary: 'ui-icon-circle-plus' },
352
+ disabled: true
353
+ });
354
+
355
+ this.start_button.button({
356
+ icons: { primary: 'ui-icon-circle-arrow-e' },
357
+ disabled: true
358
+ });
359
+
360
+ this.stop_button.button({
361
+ icons: { primary: 'ui-icon-circle-close' }
362
+ });
363
+
364
+ this.list_switcher.button({
365
+ text: false,
366
+ icons: { secondary: "ui-icon-grip-dotted-horizontal" }
367
+ });
368
+
369
+ this.thumbs_switcher.button({
370
+ text: false,
371
+ icons: { secondary: "ui-icon-image" }
372
+ });
373
+ }
374
+
375
+ // progressbar
376
+ this.progressbar = $('.plupload_progress_container', this.container);
377
+
378
+ if ($.ui.progressbar) {
379
+ this.progressbar.progressbar();
380
+ }
381
+
382
+ // counter
383
+ this.counter = $('.plupload_count', this.element)
384
+ .attr({
385
+ id: id + '_count',
386
+ name: id + '_count'
387
+ });
388
+
389
+ // initialize uploader instance
390
+ this._initUploader();
391
+ },
392
+
393
+ _initUploader: function() {
394
+ var self = this
395
+ , id = this.id
396
+ , uploader
397
+ , options = {
398
+ container: id + '_buttons',
399
+ browse_button: id + '_browse'
400
+ }
401
+ ;
402
+
403
+ $('.plupload_buttons', this.element).attr('id', id + '_buttons');
404
+
405
+ if (self.options.dragdrop) {
406
+ this.filelist.parent().attr('id', this.id + '_dropbox');
407
+ options.drop_element = this.id + '_dropbox';
408
+ }
409
+
410
+ this.filelist.on('click', function(e) {
411
+ var me = $(e.target), fileContainer;
412
+ if (me.hasClass('plupload_action_icon')) {
413
+ fileContainer = me.closest('.plupload_file');
414
+ if (fileContainer.hasClass('plupload_delete')) {
415
+ self.removeFile(fileContainer.attr('id'));
416
+ e.preventDefault();
417
+ }
418
+ }
419
+ });
420
+
421
+ uploader = this.uploader = uploaders[id] = new plupload.Uploader($.extend(this.options, options));
422
+
423
+ // retrieve full normalized set of options
424
+ this.options = uploader.getOption();
425
+
426
+ if (self.options.views.thumbs) {
427
+ uploader.settings.required_features.display_media = true;
428
+ }
429
+
430
+ // for backward compatibility
431
+ if (self.options.max_file_count) {
432
+ plupload.extend(uploader.getOption('filters'), {
433
+ max_file_count: self.options.max_file_count
434
+ });
435
+ }
436
+
437
+ plupload.addFileFilter('max_file_count', function(maxCount, file, cb) {
438
+ if (maxCount <= this.files.length - (this.total.uploaded + this.total.failed)) {
439
+ self.browse_button.button('disable');
440
+ this.disableBrowse();
441
+
442
+ this.trigger('Error', {
443
+ code : self.FILE_COUNT_ERROR,
444
+ message : _("File count error."),
445
+ file : file
446
+ });
447
+ cb(false);
448
+ } else {
449
+ cb(true);
450
+ }
451
+ });
452
+
453
+
454
+ uploader.bind('Error', function(up, err) {
455
+ var message, details = "";
456
+
457
+ message = '<strong>' + err.message + '</strong>';
458
+
459
+ switch (err.code) {
460
+ case plupload.FILE_EXTENSION_ERROR:
461
+ details = plupload.sprintf(_("File: %s"), err.file.name);
462
+ break;
463
+
464
+ case plupload.FILE_SIZE_ERROR:
465
+ details = plupload.sprintf(_("File: %s, size: %d, max file size: %d"), err.file.name, plupload.formatSize(err.file.size), plupload.formatSize(plupload.parseSize(up.getOption('filters').max_file_size)));
466
+ break;
467
+
468
+ case plupload.FILE_DUPLICATE_ERROR:
469
+ details = plupload.sprintf(_("%s already present in the queue."), err.file.name);
470
+ break;
471
+
472
+ case self.FILE_COUNT_ERROR:
473
+ details = plupload.sprintf(_("Upload element accepts only %d file(s) at a time. Extra files were stripped."), up.getOption('filters').max_file_count || 0);
474
+ break;
475
+
476
+ case plupload.IMAGE_FORMAT_ERROR :
477
+ details = _("Image format either wrong or not supported.");
478
+ break;
479
+
480
+ case plupload.IMAGE_MEMORY_ERROR :
481
+ details = _("Runtime ran out of available memory.");
482
+ break;
483
+
484
+ /* // This needs a review
485
+ case plupload.IMAGE_DIMENSIONS_ERROR :
486
+ details = plupload.sprintf(_('Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.'), up.runtime, up.features.maxWidth, up.features.maxHeight);
487
+ break; */
488
+
489
+ case plupload.HTTP_ERROR:
490
+ details = _("Upload URL might be wrong or doesn't exist.");
491
+ break;
492
+ }
493
+
494
+ message += " <br /><i>" + details + "</i>";
495
+
496
+ self._trigger('error', null, { up: up, error: err } );
497
+
498
+ // do not show UI if no runtime can be initialized
499
+ if (err.code === plupload.INIT_ERROR) {
500
+ setTimeout(function() {
501
+ self.destroy();
502
+ }, 1);
503
+ } else {
504
+ self.notify('error', message);
505
+ }
506
+ });
507
+
508
+
509
+ uploader.bind('PostInit', function(up) {
510
+ // all buttons are optional, so they can be disabled and hidden
511
+ if (!self.options.buttons.browse) {
512
+ self.browse_button.button('disable').hide();
513
+ up.disableBrowse(true);
514
+ } else {
515
+ self.browse_button.button('enable');
516
+ }
517
+
518
+ if (!self.options.buttons.start) {
519
+ self.start_button.button('disable').hide();
520
+ }
521
+
522
+ if (!self.options.buttons.stop) {
523
+ self.stop_button.button('disable').hide();
524
+ }
525
+
526
+ if (!self.options.unique_names && self.options.rename) {
527
+ self._enableRenaming();
528
+ }
529
+
530
+ if (self.options.dragdrop && up.features.dragdrop) {
531
+ self.filelist.parent().addClass('plupload_dropbox');
532
+ }
533
+
534
+ self._enableViewSwitcher();
535
+
536
+ self.start_button.click(function(e) {
537
+ if (!$(this).button('option', 'disabled')) {
538
+ self.start();
539
+ }
540
+ e.preventDefault();
541
+ });
542
+
543
+ self.stop_button.click(function(e) {
544
+ self.stop();
545
+ e.preventDefault();
546
+ });
547
+
548
+ self._trigger('ready', null, { up: up });
549
+ });
550
+
551
+ // uploader internal events must run first
552
+ uploader.init();
553
+
554
+ uploader.bind('FileFiltered', function(up, file) {
555
+ self._addFiles(file);
556
+ });
557
+
558
+ uploader.bind('FilesAdded', function(up, files) {
559
+ self._trigger('selected', null, { up: up, files: files } );
560
+
561
+ // re-enable sortable
562
+ if (self.options.sortable && $.ui.sortable) {
563
+ self._enableSortingList();
564
+ }
565
+
566
+ self._trigger('updatelist', null, { filelist: self.filelist });
567
+
568
+ if (self.options.autostart) {
569
+ // set a little delay to make sure that QueueChanged triggered by the core has time to complete
570
+ setTimeout(function() {
571
+ self.start();
572
+ }, 10);
573
+ }
574
+ });
575
+
576
+ uploader.bind('FilesRemoved', function(up, files) {
577
+ // destroy sortable if enabled
578
+ if ($.ui.sortable && self.options.sortable) {
579
+ $('tbody', self.filelist).sortable('destroy');
580
+ }
581
+
582
+ $.each(files, function(i, file) {
583
+ $('#' + file.id).toggle("highlight", function() {
584
+ $(this).remove();
585
+ });
586
+ });
587
+
588
+ if (up.files.length) {
589
+ // re-initialize sortable
590
+ if (self.options.sortable && $.ui.sortable) {
591
+ self._enableSortingList();
592
+ }
593
+ }
594
+
595
+ self._trigger('updatelist', null, { filelist: self.filelist });
596
+ self._trigger('removed', null, { up: up, files: files } );
597
+ });
598
+
599
+ uploader.bind('QueueChanged', function() {
600
+ self._handleState();
601
+ });
602
+
603
+ uploader.bind('StateChanged', function(up) {
604
+ self._handleState();
605
+ if (plupload.STARTED === up.state) {
606
+ self._trigger('started', null, { up: this.uploader });
607
+ } else if (plupload.STOPPED === up.state) {
608
+ self._trigger('stopped', null, { up: this.uploader });
609
+ }
610
+ });
611
+
612
+ uploader.bind('UploadFile', function(up, file) {
613
+ self._handleFileStatus(file);
614
+ });
615
+
616
+ uploader.bind('FileUploaded', function(up, file, result) {
617
+ self._handleFileStatus(file);
618
+ self._trigger('uploaded', null, { up: up, file: file, result: result } );
619
+ });
620
+
621
+ uploader.bind('UploadProgress', function(up, file) {
622
+ self._handleFileStatus(file);
623
+ self._updateTotalProgress();
624
+ self._trigger('progress', null, { up: up, file: file } );
625
+ });
626
+
627
+ uploader.bind('UploadComplete', function(up, files) {
628
+ self._addFormFields();
629
+ self._trigger('complete', null, { up: up, files: files } );
630
+ });
631
+ },
632
+
633
+
634
+ _setOption: function(key, value) {
635
+ var self = this;
636
+
637
+ if (key == 'buttons' && typeof(value) == 'object') {
638
+ value = $.extend(self.options.buttons, value);
639
+
640
+ if (!value.browse) {
641
+ self.browse_button.button('disable').hide();
642
+ self.uploader.disableBrowse(true);
643
+ } else {
644
+ self.browse_button.button('enable').show();
645
+ self.uploader.disableBrowse(false);
646
+ }
647
+
648
+ if (!value.start) {
649
+ self.start_button.button('disable').hide();
650
+ } else {
651
+ self.start_button.button('enable').show();
652
+ }
653
+
654
+ if (!value.stop) {
655
+ self.stop_button.button('disable').hide();
656
+ } else {
657
+ self.start_button.button('enable').show();
658
+ }
659
+ }
660
+
661
+ self.uploader.setOption(key, value);
662
+ },
663
+
664
+
665
+ /**
666
+ Start upload. Triggers `start` event.
667
+
668
+ @method start
669
+ */
670
+ start: function() {
671
+ this.uploader.start();
672
+ },
673
+
674
+
675
+ /**
676
+ Stop upload. Triggers `stop` event.
677
+
678
+ @method stop
679
+ */
680
+ stop: function() {
681
+ this.uploader.stop();
682
+ },
683
+
684
+
685
+ /**
686
+ Enable browse button.
687
+
688
+ @method enable
689
+ */
690
+ enable: function() {
691
+ this.browse_button.button('enable');
692
+ this.uploader.disableBrowse(false);
693
+ },
694
+
695
+
696
+ /**
697
+ Disable browse button.
698
+
699
+ @method disable
700
+ */
701
+ disable: function() {
702
+ this.browse_button.button('disable');
703
+ this.uploader.disableBrowse(true);
704
+ },
705
+
706
+
707
+ /**
708
+ Retrieve file by its unique id.
709
+
710
+ @method getFile
711
+ @param {String} id Unique id of the file
712
+ @return {plupload.File}
713
+ */
714
+ getFile: function(id) {
715
+ var file;
716
+
717
+ if (typeof id === 'number') {
718
+ file = this.uploader.files[id];
719
+ } else {
720
+ file = this.uploader.getFile(id);
721
+ }
722
+ return file;
723
+ },
724
+
725
+ /**
726
+ Return array of files currently in the queue.
727
+
728
+ @method getFiles
729
+ @return {Array} Array of files in the queue represented by plupload.File objects
730
+ */
731
+ getFiles: function() {
732
+ return this.uploader.files;
733
+ },
734
+
735
+
736
+ /**
737
+ Remove the file from the queue.
738
+
739
+ @method removeFile
740
+ @param {plupload.File|String} file File to remove, might be specified directly or by its unique id
741
+ */
742
+ removeFile: function(file) {
743
+ if (plupload.typeOf(file) === 'string') {
744
+ file = this.getFile(file);
745
+ }
746
+ this.uploader.removeFile(file);
747
+ },
748
+
749
+
750
+ /**
751
+ Clear the file queue.
752
+
753
+ @method clearQueue
754
+ */
755
+ clearQueue: function() {
756
+ this.uploader.splice();
757
+ },
758
+
759
+
760
+ /**
761
+ Retrieve internal plupload.Uploader object (usually not required).
762
+
763
+ @method getUploader
764
+ @return {plupload.Uploader}
765
+ */
766
+ getUploader: function() {
767
+ return this.uploader;
768
+ },
769
+
770
+
771
+ /**
772
+ Trigger refresh procedure, specifically browse_button re-measure and re-position operations.
773
+ Might get handy, when UI Widget is placed within the popup, that is constantly hidden and shown
774
+ again - without calling this method after each show operation, dialog trigger might get displaced
775
+ and disfunctional.
776
+
777
+ @method refresh
778
+ */
779
+ refresh: function() {
780
+ this.uploader.refresh();
781
+ },
782
+
783
+
784
+ /**
785
+ Display a message in notification area.
786
+
787
+ @method notify
788
+ @param {Enum} type Type of the message, either `error` or `info`
789
+ @param {String} message The text message to display.
790
+ */
791
+ notify: function(type, message) {
792
+ var popup = $(
793
+ '<div class="plupload_message">' +
794
+ '<span class="plupload_message_close ui-icon ui-icon-circle-close" title="'+_('Close')+'"></span>' +
795
+ '<p><span class="ui-icon"></span>' + message + '</p>' +
796
+ '</div>'
797
+ );
798
+
799
+ popup
800
+ .addClass('ui-state-' + (type === 'error' ? 'error' : 'highlight'))
801
+ .find('p .ui-icon')
802
+ .addClass('ui-icon-' + (type === 'error' ? 'alert' : 'info'))
803
+ .end()
804
+ .find('.plupload_message_close')
805
+ .click(function() {
806
+ popup.remove();
807
+ })
808
+ .end();
809
+
810
+ $('.plupload_header', this.container).append(popup);
811
+ },
812
+
813
+
814
+ /**
815
+ Destroy the widget, the uploader, free associated resources and bring back original html.
816
+
817
+ @method destroy
818
+ */
819
+ destroy: function() {
820
+ // destroy uploader instance
821
+ this.uploader.destroy();
822
+
823
+ // unbind all button events
824
+ $('.plupload_button', this.element).unbind();
825
+
826
+ // destroy buttons
827
+ if ($.ui.button) {
828
+ $('.plupload_add, .plupload_start, .plupload_stop', this.container)
829
+ .button('destroy');
830
+ }
831
+
832
+ // destroy progressbar
833
+ if ($.ui.progressbar) {
834
+ this.progressbar.progressbar('destroy');
835
+ }
836
+
837
+ // destroy sortable behavior
838
+ if ($.ui.sortable && this.options.sortable) {
839
+ $('tbody', this.filelist).sortable('destroy');
840
+ }
841
+
842
+ // restore the elements initial state
843
+ this.element
844
+ .empty()
845
+ .html(this.contents_bak);
846
+ this.contents_bak = '';
847
+
848
+ $.Widget.prototype.destroy.apply(this);
849
+ },
850
+
851
+
852
+ _handleState: function() {
853
+ var up = this.uploader
854
+ , filesPending = up.files.length - (up.total.uploaded + up.total.failed)
855
+ , maxCount = up.getOption('filters').max_file_count || 0
856
+ ;
857
+
858
+ if (plupload.STARTED === up.state) {
859
+ $([])
860
+ .add(this.stop_button)
861
+ .add('.plupload_started')
862
+ .removeClass('plupload_hidden');
863
+
864
+ this.start_button.button('disable');
865
+
866
+ if (!this.options.multiple_queues) {
867
+ this.browse_button.button('disable');
868
+ up.disableBrowse();
869
+ }
870
+
871
+ $('.plupload_upload_status', this.element).html(plupload.sprintf(_('Uploaded %d/%d files'), up.total.uploaded, up.files.length));
872
+ $('.plupload_header_content', this.element).addClass('plupload_header_content_bw');
873
+ }
874
+ else if (plupload.STOPPED === up.state) {
875
+ $([])
876
+ .add(this.stop_button)
877
+ .add('.plupload_started')
878
+ .addClass('plupload_hidden');
879
+
880
+ if (filesPending) {
881
+ this.start_button.button('enable');
882
+ } else {
883
+ this.start_button.button('disable');
884
+ }
885
+
886
+ if (this.options.multiple_queues) {
887
+ $('.plupload_header_content', this.element).removeClass('plupload_header_content_bw');
888
+ }
889
+
890
+ // if max_file_count defined, only that many files can be queued at once
891
+ if (this.options.multiple_queues && maxCount && maxCount > filesPending) {
892
+ this.browse_button.button('enable');
893
+ up.disableBrowse(false);
894
+ }
895
+
896
+ this._updateTotalProgress();
897
+ }
898
+
899
+ if (up.total.queued === 0) {
900
+ $('.ui-button-text', this.browse_button).html(_('Add Files'));
901
+ } else {
902
+ $('.ui-button-text', this.browse_button).html(plupload.sprintf(_('%d files queued'), up.total.queued));
903
+ }
904
+
905
+ up.refresh();
906
+ },
907
+
908
+
909
+ _handleFileStatus: function(file) {
910
+ var $file = $('#' + file.id), actionClass, iconClass;
911
+
912
+ // since this method might be called asynchronously, file row might not yet be rendered
913
+ if (!$file.length) {
914
+ return;
915
+ }
916
+
917
+ switch (file.status) {
918
+ case plupload.DONE:
919
+ actionClass = 'plupload_done';
920
+ iconClass = 'plupload_action_icon ui-icon ui-icon-circle-check';
921
+ break;
922
+
923
+ case plupload.FAILED:
924
+ actionClass = 'ui-state-error plupload_failed';
925
+ iconClass = 'plupload_action_icon ui-icon ui-icon-alert';
926
+ break;
927
+
928
+ case plupload.QUEUED:
929
+ actionClass = 'plupload_delete';
930
+ iconClass = 'plupload_action_icon ui-icon ui-icon-circle-minus';
931
+ break;
932
+
933
+ case plupload.UPLOADING:
934
+ actionClass = 'ui-state-highlight plupload_uploading';
935
+ iconClass = 'plupload_action_icon ui-icon ui-icon-circle-arrow-w';
936
+
937
+ // scroll uploading file into the view if its bottom boundary is out of it
938
+ var scroller = $('.plupload_scroll', this.container)
939
+ , scrollTop = scroller.scrollTop()
940
+ , scrollerHeight = scroller.height()
941
+ , rowOffset = $file.position().top + $file.height()
942
+ ;
943
+
944
+ if (scrollerHeight < rowOffset) {
945
+ scroller.scrollTop(scrollTop + rowOffset - scrollerHeight);
946
+ }
947
+
948
+ // Set file specific progress
949
+ $file
950
+ .find('.plupload_file_percent')
951
+ .html(file.percent + '%')
952
+ .end()
953
+ .find('.plupload_file_progress')
954
+ .css('width', file.percent + '%')
955
+ .end()
956
+ .find('.plupload_file_size')
957
+ .html(plupload.formatSize(file.size));
958
+ break;
959
+ }
960
+ actionClass += ' ui-state-default plupload_file';
961
+
962
+ $file
963
+ .attr('class', actionClass)
964
+ .find('.plupload_action_icon')
965
+ .attr('class', iconClass);
966
+ },
967
+
968
+
969
+ _updateTotalProgress: function() {
970
+ var up = this.uploader;
971
+
972
+ // Scroll to end of file list
973
+ this.filelist[0].scrollTop = this.filelist[0].scrollHeight;
974
+
975
+ this.progressbar.progressbar('value', up.total.percent);
976
+
977
+ this.element
978
+ .find('.plupload_total_status')
979
+ .html(up.total.percent + '%')
980
+ .end()
981
+ .find('.plupload_total_file_size')
982
+ .html(plupload.formatSize(up.total.size))
983
+ .end()
984
+ .find('.plupload_upload_status')
985
+ .html(plupload.sprintf(_('Uploaded %d/%d files'), up.total.uploaded, up.files.length));
986
+ },
987
+
988
+
989
+ _displayThumbs: function() {
990
+ var self = this
991
+ , tw, th // thumb width/height
992
+ , cols
993
+ , num = 0 // number of simultaneously visible thumbs
994
+ , thumbs = [] // array of thumbs to preload at any given moment
995
+ , loading = false
996
+ ;
997
+
998
+ if (!this.options.views.thumbs) {
999
+ return;
1000
+ }
1001
+
1002
+
1003
+ function onLast(el, eventName, cb) {
1004
+ var timer;
1005
+
1006
+ el.on(eventName, function() {
1007
+ clearTimeout(timer);
1008
+ timer = setTimeout(function() {
1009
+ clearTimeout(timer);
1010
+ cb();
1011
+ }, 300);
1012
+ });
1013
+ }
1014
+
1015
+
1016
+ // calculate number of simultaneously visible thumbs
1017
+ function measure() {
1018
+ if (!tw || !th) {
1019
+ var wrapper = $('.plupload_file:eq(0)', self.filelist);
1020
+ tw = wrapper.outerWidth(true);
1021
+ th = wrapper.outerHeight(true);
1022
+ }
1023
+
1024
+ var aw = self.content.width(), ah = self.content.height();
1025
+ cols = Math.floor(aw / tw);
1026
+ num = cols * (Math.ceil(ah / th) + 1);
1027
+ }
1028
+
1029
+
1030
+ function pickThumbsToLoad() {
1031
+ // calculate index of virst visible thumb
1032
+ var startIdx = Math.floor(self.content.scrollTop() / th) * cols;
1033
+ // get potentially visible thumbs that are not yet visible
1034
+ thumbs = $('.plupload_file .plupload_file_thumb', self.filelist)
1035
+ .slice(startIdx, startIdx + num)
1036
+ .filter('.plupload_thumb_toload')
1037
+ .get();
1038
+ }
1039
+
1040
+
1041
+ function init() {
1042
+ function mpl() { // measure, pick, load
1043
+ if (self.view_mode !== 'thumbs') {
1044
+ return;
1045
+ }
1046
+ measure();
1047
+ pickThumbsToLoad();
1048
+ lazyLoad();
1049
+ }
1050
+
1051
+ if ($.fn.resizable) {
1052
+ onLast(self.container, 'resize', mpl);
1053
+ }
1054
+
1055
+ onLast(self.window, 'resize', mpl);
1056
+ onLast(self.content, 'scroll', mpl);
1057
+
1058
+ self.element.on('viewchanged selected', mpl);
1059
+
1060
+ mpl();
1061
+ }
1062
+
1063
+
1064
+ function preloadThumb(file, cb) {
1065
+ var img = new o.image.Image();
1066
+ var resolveUrl = o.core.utils.Url.resolveUrl;
1067
+
1068
+ img.onload = function() {
1069
+ var thumb = $('#' + file.id + ' .plupload_file_thumb', self.filelist);
1070
+ this.embed(thumb[0], {
1071
+ width: self.options.thumb_width,
1072
+ height: self.options.thumb_height,
1073
+ crop: true,
1074
+ fit: true,
1075
+ preserveHeaders: false,
1076
+ swf_url: resolveUrl(self.options.flash_swf_url),
1077
+ xap_url: resolveUrl(self.options.silverlight_xap_url)
1078
+ });
1079
+ };
1080
+
1081
+ img.bind("embedded error", function(e) {
1082
+ $('#' + file.id, self.filelist)
1083
+ .find('.plupload_file_thumb')
1084
+ .removeClass('plupload_thumb_loading')
1085
+ .addClass('plupload_thumb_' + e.type)
1086
+ ;
1087
+ this.destroy();
1088
+ setTimeout(cb, 1); // detach, otherwise ui might hang (in SilverLight for example)
1089
+ });
1090
+
1091
+ $('#' + file.id, self.filelist)
1092
+ .find('.plupload_file_thumb')
1093
+ .removeClass('plupload_thumb_toload')
1094
+ .addClass('plupload_thumb_loading')
1095
+ ;
1096
+ img.load(file.getSource());
1097
+ }
1098
+
1099
+
1100
+ function lazyLoad() {
1101
+ if (self.view_mode !== 'thumbs' || loading) {
1102
+ return;
1103
+ }
1104
+
1105
+ pickThumbsToLoad();
1106
+ if (!thumbs.length) {
1107
+ return;
1108
+ }
1109
+
1110
+ loading = true;
1111
+
1112
+ preloadThumb(self.getFile($(thumbs.shift()).closest('.plupload_file').attr('id')), function() {
1113
+ loading = false;
1114
+ lazyLoad();
1115
+ });
1116
+ }
1117
+
1118
+ // this has to run only once to measure structures and bind listeners
1119
+ this.element.on('selected', function onselected() {
1120
+ self.element.off('selected', onselected);
1121
+ init();
1122
+ });
1123
+ },
1124
+
1125
+
1126
+ _addFiles: function(files) {
1127
+ var self = this, file_html, html = '';
1128
+
1129
+ file_html = '<li class="plupload_file ui-state-default plupload_delete" id="{id}" style="width:{thumb_width}px;">' +
1130
+ '<div class="plupload_file_thumb plupload_thumb_toload" style="width: {thumb_width}px; height: {thumb_height}px;">' +
1131
+ '<div class="plupload_file_dummy ui-widget-content" style="line-height: {thumb_height}px;"><span class="ui-state-disabled">{ext} </span></div>' +
1132
+ '</div>' +
1133
+ '<div class="plupload_file_status">' +
1134
+ '<div class="plupload_file_progress ui-widget-header" style="width: 0%"> </div>' +
1135
+ '<span class="plupload_file_percent">{percent} </span>' +
1136
+ '</div>' +
1137
+ '<div class="plupload_file_name" title="{name}">' +
1138
+ '<span class="plupload_file_name_wrapper">{name} </span>' +
1139
+ '</div>' +
1140
+ '<div class="plupload_file_action">' +
1141
+ '<div class="plupload_action_icon ui-icon ui-icon-circle-minus"> </div>' +
1142
+ '</div>' +
1143
+ '<div class="plupload_file_size">{size} </div>' +
1144
+ '<div class="plupload_file_fields"> </div>' +
1145
+ '</li>';
1146
+
1147
+ if (plupload.typeOf(files) !== 'array') {
1148
+ files = [files];
1149
+ }
1150
+
1151
+ $.each(files, function(i, file) {
1152
+ var ext = o.core.utils.Mime.getFileExtension(file.name) || 'none';
1153
+
1154
+ html += file_html.replace(/\{(\w+)\}/g, function($0, $1) {
1155
+ switch ($1) {
1156
+ case 'thumb_width':
1157
+ case 'thumb_height':
1158
+ return self.options[$1];
1159
+
1160
+ case 'size':
1161
+ return plupload.formatSize(file.size);
1162
+
1163
+ case 'ext':
1164
+ return ext;
1165
+
1166
+ default:
1167
+ return file[$1] || '';
1168
+ }
1169
+ });
1170
+ });
1171
+
1172
+ self.filelist.append(html);
1173
+ },
1174
+
1175
+
1176
+ _addFormFields: function() {
1177
+ var self = this;
1178
+
1179
+ // re-add from fresh
1180
+ $('.plupload_file_fields', this.filelist).html('');
1181
+
1182
+ plupload.each(this.uploader.files, function(file, count) {
1183
+ var fields = ''
1184
+ , id = self.id + '_' + count
1185
+ ;
1186
+
1187
+ if (file.target_name) {
1188
+ fields += '<input type="hidden" name="' + id + '_tmpname" value="'+plupload.xmlEncode(file.target_name)+'" />';
1189
+ }
1190
+ fields += '<input type="hidden" name="' + id + '_name" value="'+plupload.xmlEncode(file.name)+'" />';
1191
+ fields += '<input type="hidden" name="' + id + '_status" value="' + (file.status === plupload.DONE ? 'done' : 'failed') + '" />';
1192
+
1193
+ $('#' + file.id).find('.plupload_file_fields').html(fields);
1194
+ });
1195
+
1196
+ this.counter.val(this.uploader.files.length);
1197
+ },
1198
+
1199
+
1200
+ _viewChanged: function(view) {
1201
+ // update or write a new cookie
1202
+ if (this.options.views.remember && $.cookie) {
1203
+ $.cookie('plupload_ui_view', view, { expires: 7, path: '/' });
1204
+ }
1205
+
1206
+ // ugly fix for IE6 - make content area stretchable
1207
+ if (plupload.ua.browser === 'IE' && plupload.ua.version < 7) {
1208
+ this.content.attr('style', 'height:expression(document.getElementById("' + this.id + '_container' + '").clientHeight - ' + (view === 'list' ? 132 : 102) + ')');
1209
+ }
1210
+
1211
+ this.container.removeClass('plupload_view_list plupload_view_thumbs').addClass('plupload_view_' + view);
1212
+ this.view_mode = view;
1213
+ this._trigger('viewchanged', null, { view: view });
1214
+ },
1215
+
1216
+
1217
+ _enableViewSwitcher: function() {
1218
+ var self = this
1219
+ , view
1220
+ , switcher = $('.plupload_view_switch', this.container)
1221
+ , buttons
1222
+ , button
1223
+ ;
1224
+
1225
+ plupload.each(['list', 'thumbs'], function(view) {
1226
+ if (!self.options.views[view]) {
1227
+ switcher.find('[for="' + self.id + '_view_' + view + '"], #'+ self.id +'_view_' + view).remove();
1228
+ }
1229
+ });
1230
+
1231
+ // check if any visible left
1232
+ buttons = switcher.find('.plupload_button');
1233
+
1234
+ if (buttons.length === 1) {
1235
+ switcher.hide();
1236
+ view = buttons.eq(0).data('view');
1237
+ this._viewChanged(view);
1238
+ } else if ($.ui.button && buttons.length > 1) {
1239
+ if (this.options.views.remember && $.cookie) {
1240
+ view = $.cookie('plupload_ui_view');
1241
+ }
1242
+
1243
+ // if wierd case, bail out to default
1244
+ if (!~plupload.inArray(view, ['list', 'thumbs'])) {
1245
+ view = this.options.views.active;
1246
+ }
1247
+
1248
+ switcher
1249
+ .show()
1250
+ .buttonset()
1251
+ .find('.ui-button')
1252
+ .click(function(e) {
1253
+ view = $(this).data('view');
1254
+ self._viewChanged(view);
1255
+ e.preventDefault(); // avoid auto scrolling to widget in IE and FF (see #850)
1256
+ });
1257
+
1258
+ // if view not active - happens when switcher wasn't clicked manually
1259
+ button = switcher.find('[for="' + self.id + '_view_'+view+'"]');
1260
+ if (button.length) {
1261
+ button.trigger('click');
1262
+ }
1263
+ } else {
1264
+ switcher.show();
1265
+ this._viewChanged(this.options.views.active);
1266
+ }
1267
+
1268
+ // initialize thumb viewer if requested
1269
+ if (this.options.views.thumbs) {
1270
+ this._displayThumbs();
1271
+ }
1272
+ },
1273
+
1274
+
1275
+ _enableRenaming: function() {
1276
+ var self = this;
1277
+
1278
+ this.filelist.dblclick(function(e) {
1279
+ var nameInput, fileContainer, file, parts, name, ext = "";
1280
+ var nameSpan = $(e.target);
1281
+
1282
+ if (!nameSpan.hasClass('plupload_file_name_wrapper')) {
1283
+ return;
1284
+ }
1285
+
1286
+ fileContainer = nameSpan.closest('.plupload_file');
1287
+ if (!fileContainer.hasClass('plupload_delete')) {
1288
+ return;
1289
+ }
1290
+
1291
+ // Get file name and split out name and extension
1292
+ file = self.uploader.getFile(fileContainer[0].id);
1293
+ name = file.name;
1294
+ parts = /^(.+)(\.[^.]+)$/.exec(name);
1295
+ if (parts) {
1296
+ name = parts[1];
1297
+ ext = parts[2];
1298
+ }
1299
+
1300
+ // Display input element
1301
+ nameInput = $('<input class="plupload_file_rename" type="text" />').width(nameSpan.width()).insertAfter(nameSpan.hide());
1302
+ nameInput.val(name).blur(function() {
1303
+ nameSpan.show().parent().scrollLeft(0).end().next().remove();
1304
+ }).keydown(function(e) {
1305
+ var nameInput = $(this);
1306
+
1307
+ if ($.inArray(e.keyCode, [13, 27]) !== -1) {
1308
+ e.preventDefault();
1309
+
1310
+ // Rename file and glue extension back on
1311
+ if (e.keyCode === 13) {
1312
+ file.name = nameInput.val() + ext;
1313
+ nameSpan.html(file.name);
1314
+ }
1315
+ nameInput.blur();
1316
+ }
1317
+ })[0].focus();
1318
+ });
1319
+ },
1320
+
1321
+
1322
+ _enableSortingList: function() {
1323
+ var self = this;
1324
+
1325
+ if ($('.plupload_file', this.filelist).length < 2) {
1326
+ return;
1327
+ }
1328
+
1329
+ // destroy sortable if enabled
1330
+ $('tbody', this.filelist).sortable('destroy');
1331
+
1332
+ // enable
1333
+ this.filelist.sortable({
1334
+ items: '.plupload_delete',
1335
+
1336
+ cancel: 'object, .plupload_clearer',
1337
+
1338
+ stop: function() {
1339
+ var files = [];
1340
+
1341
+ $.each($(this).sortable('toArray'), function(i, id) {
1342
+ files[files.length] = self.uploader.getFile(id);
1343
+ });
1344
+
1345
+ files.unshift(files.length);
1346
+ files.unshift(0);
1347
+
1348
+ // re-populate files array
1349
+ Array.prototype.splice.apply(self.uploader.files, files);
1350
+ }
1351
+ });
1352
+ }
1353
+ });
1354
+
1355
+ } (window, document, plupload, moxie, jQuery));
assets/global/plugins/pluploader/js/plupload.full.min.js CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
3
- * v1.3.4
4
  *
5
  * Copyright 2013, Moxiecode Systems AB
6
  * Released under GPL License.
@@ -8,3999 +8,15 @@
8
  * License: http://www.plupload.com/license
9
  * Contributing: http://www.plupload.com/contributing
10
  *
11
- * Date: 2015-07-18
12
  */
13
- !function (e, t) {
14
- "use strict";
15
-
16
- function n(e, t) {
17
- for (var n, i = [], r = 0; r < e.length; ++r) {
18
- if (n = s[e[r]] || o(e[r]), !n)
19
- throw "module definition dependecy not found: " + e[r];
20
- i.push(n)
21
- }
22
- t.apply(null, i)
23
- }
24
-
25
- function i(e, i, r) {
26
- if ("string" != typeof e)
27
- throw "invalid module definition, module id must be defined and be a string";
28
- if (i === t)
29
- throw "invalid module definition, dependencies must be specified";
30
- if (r === t)
31
- throw "invalid module definition, definition function must be specified";
32
- n(i, function () {
33
- s[e] = r.apply(null, arguments)
34
- })
35
- }
36
-
37
- function r(e) {
38
- return !!s[e]
39
- }
40
-
41
- function o(t) {
42
- for (var n = e, i = t.split(/[.\/]/), r = 0; r < i.length; ++r) {
43
- if (!n[i[r]])
44
- return;
45
- n = n[i[r]]
46
- }
47
- return n
48
- }
49
-
50
- function a(n) {
51
- for (var i = 0; i < n.length; i++) {
52
- for (var r = e, o = n[i], a = o.split(/[.\/]/), u = 0; u < a.length - 1; ++u)
53
- r[a[u]] === t && (r[a[u]] = {}), r = r[a[u]];
54
- r[a[a.length - 1]] = s[o]
55
- }
56
- }
57
- var s = {},
58
- u = "moxie/core/utils/Basic",
59
- c = "moxie/core/utils/Env",
60
- l = "moxie/core/I18n",
61
- d = "moxie/core/utils/Mime",
62
- h = "moxie/core/utils/Dom",
63
- f = "moxie/core/Exceptions",
64
- p = "moxie/core/EventTarget",
65
- m = "moxie/runtime/Runtime",
66
- g = "moxie/runtime/RuntimeClient",
67
- v = "moxie/file/FileInput",
68
- w = "moxie/core/utils/Encode",
69
- y = "moxie/file/Blob",
70
- E = "moxie/file/File",
71
- _ = "moxie/file/FileDrop",
72
- b = "moxie/file/FileReader",
73
- x = "moxie/core/utils/Url",
74
- R = "moxie/runtime/RuntimeTarget",
75
- A = "moxie/file/FileReaderSync",
76
- I = "moxie/xhr/FormData",
77
- T = "moxie/xhr/XMLHttpRequest",
78
- S = "moxie/runtime/Transporter",
79
- O = "moxie/image/Image",
80
- D = "moxie/runtime/html5/Runtime",
81
- N = "moxie/core/utils/Events",
82
- L = "moxie/runtime/html5/file/FileInput",
83
- C = "moxie/runtime/html5/file/Blob",
84
- M = "moxie/runtime/html5/file/FileDrop",
85
- F = "moxie/runtime/html5/file/FileReader",
86
- P = "moxie/runtime/html5/xhr/XMLHttpRequest",
87
- H = "moxie/runtime/html5/utils/BinaryReader",
88
- B = "moxie/runtime/html5/image/JPEGHeaders",
89
- k = "moxie/runtime/html5/image/ExifParser",
90
- U = "moxie/runtime/html5/image/JPEG",
91
- G = "moxie/runtime/html5/image/PNG",
92
- z = "moxie/runtime/html5/image/ImageInfo",
93
- q = "moxie/runtime/html5/image/MegaPixel",
94
- j = "moxie/runtime/html5/image/Image",
95
- X = "moxie/runtime/flash/Runtime",
96
- V = "moxie/runtime/flash/file/FileInput",
97
- W = "moxie/runtime/flash/file/Blob",
98
- Y = "moxie/runtime/flash/file/FileReader",
99
- $ = "moxie/runtime/flash/file/FileReaderSync",
100
- J = "moxie/runtime/flash/xhr/XMLHttpRequest",
101
- Z = "moxie/runtime/flash/runtime/Transporter",
102
- K = "moxie/runtime/flash/image/Image",
103
- Q = "moxie/runtime/silverlight/Runtime",
104
- ee = "moxie/runtime/silverlight/file/FileInput",
105
- te = "moxie/runtime/silverlight/file/Blob",
106
- ne = "moxie/runtime/silverlight/file/FileDrop",
107
- ie = "moxie/runtime/silverlight/file/FileReader",
108
- re = "moxie/runtime/silverlight/file/FileReaderSync",
109
- oe = "moxie/runtime/silverlight/xhr/XMLHttpRequest",
110
- ae = "moxie/runtime/silverlight/runtime/Transporter",
111
- se = "moxie/runtime/silverlight/image/Image",
112
- ue = "moxie/runtime/html4/Runtime",
113
- ce = "moxie/runtime/html4/file/FileInput",
114
- le = "moxie/runtime/html4/file/FileReader",
115
- de = "moxie/runtime/html4/xhr/XMLHttpRequest",
116
- he = "moxie/runtime/html4/image/Image";
117
- i(u, [], function () {
118
- var e = function (e) {
119
- var t;
120
- return e === t ? "undefined" : null === e ? "null" : e.nodeType ? "node" : {}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()
121
- },
122
- t = function (i) {
123
- var r;
124
- return n(arguments, function (o, s) {
125
- s > 0 && n(o, function (n, o) {
126
- n !== r && (e(i[o]) === e(n) && ~a(e(n), ["array", "object"]) ? t(i[o], n) : i[o] = n)
127
- })
128
- }), i
129
- },
130
- n = function (t, n) {
131
- var i, r, o, a;
132
- if (t)
133
- if ("number" === e(t.length)) {
134
- for (o = 0, i = t.length; i > o; o++)
135
- if (n(t[o], o) === !1)
136
- return
137
- } else if ("object" === e(t))
138
- for (r in t)
139
- if (t.hasOwnProperty(r) && n(t[r], r) === !1)
140
- return
141
- },
142
- i = function (t) {
143
- var n;
144
- if (!t || "object" !== e(t))
145
- return !0;
146
- for (n in t)
147
- return !1;
148
- return !0
149
- },
150
- r = function (t, n) {
151
- function i(r) {
152
- "function" === e(t[r]) && t[r](function (e) {
153
- ++r < o && !e ? i(r) : n(e)
154
- })
155
- }
156
- var r = 0,
157
- o = t.length;
158
- "function" !== e(n) && (n = function () {}), t && t.length || n(), i(r)
159
- },
160
- o = function (e, t) {
161
- var i = 0,
162
- r = e.length,
163
- o = new Array(r);
164
- n(e, function (e, n) {
165
- e(function (e) {
166
- if (e)
167
- return t(e);
168
- var a = [].slice.call(arguments);
169
- a.shift(), o[n] = a, i++, i === r && (o.unshift(null), t.apply(this, o))
170
- })
171
- })
172
- },
173
- a = function (e, t) {
174
- if (t) {
175
- if (Array.prototype.indexOf)
176
- return Array.prototype.indexOf.call(t, e);
177
- for (var n = 0, i = t.length; i > n; n++)
178
- if (t[n] === e)
179
- return n
180
- }
181
- return -1
182
- },
183
- s = function (t, n) {
184
- var i = [];
185
- "array" !== e(t) && (t = [t]), "array" !== e(n) && (n = [n]);
186
- for (var r in t)
187
- -1 === a(t[r], n) && i.push(t[r]);
188
- return i.length ? i : !1
189
- },
190
- u = function (e, t) {
191
- var i = [];
192
- return n(e, function (e) {
193
- -1 !== a(e, t) && i.push(e)
194
- }), i.length ? i : null
195
- },
196
- c = function (e) {
197
- var t, n = [];
198
- for (t = 0; t < e.length; t++)
199
- n[t] = e[t];
200
- return n
201
- },
202
- l = function () {
203
- var e = 0;
204
- return function (t) {
205
- var n = (new Date).getTime().toString(32),
206
- i;
207
- for (i = 0; 5 > i; i++)
208
- n += Math.floor(65535 * Math.random()).toString(32);
209
- return (t || "o_") + n + (e++).toString(32)
210
- }
211
- }(),
212
- d = function (e) {
213
- return e ? String.prototype.trim ? String.prototype.trim.call(e) : e.toString().replace(/^\s*/, "").replace(/\s*$/, "") : e
214
- },
215
- h = function (e) {
216
- if ("string" != typeof e)
217
- return e;
218
- var t = {
219
- t: 1099511627776,
220
- g: 1073741824,
221
- m: 1048576,
222
- k: 1024
223
- },
224
- n;
225
- return e = /^([0-9\.]+)([tmgk]?)$/.exec(e.toLowerCase().replace(/[^0-9\.tmkg]/g, "")), n = e[2], e = +e[1], t.hasOwnProperty(n) && (e *= t[n]), Math.floor(e)
226
- },
227
- f = function (t) {
228
- var n = [].slice.call(arguments, 1);
229
- return t.replace(/%[a-z]/g, function () {
230
- var t = n.shift();
231
- return "undefined" !== e(t) ? t : ""
232
- })
233
- };
234
- return {
235
- guid: l,
236
- typeOf: e,
237
- extend: t,
238
- each: n,
239
- isEmptyObj: i,
240
- inSeries: r,
241
- inParallel: o,
242
- inArray: a,
243
- arrayDiff: s,
244
- arrayIntersect: u,
245
- toArray: c,
246
- trim: d,
247
- sprintf: f,
248
- parseSizeStr: h
249
- }
250
- }), i(c, [u], function (e) {
251
- function t(e, t, n) {
252
- var i = 0,
253
- r = 0,
254
- o = 0,
255
- a = {
256
- dev: -6,
257
- alpha: -5,
258
- a: -5,
259
- beta: -4,
260
- b: -4,
261
- RC: -3,
262
- rc: -3,
263
- "#": -2,
264
- p: 1,
265
- pl: 1
266
- },
267
- s = function (e) {
268
- return e = ("" + e).replace(/[_\-+]/g, "."), e = e.replace(/([^.\d]+)/g, ".$1.").replace(/\.{2,}/g, "."), e.length ? e.split(".") : [-8]
269
- },
270
- u = function (e) {
271
- return e ? isNaN(e) ? a[e] || -7 : parseInt(e, 10) : 0
272
- };
273
- for (e = s(e), t = s(t), r = Math.max(e.length, t.length), i = 0; r > i; i++)
274
- if (e[i] != t[i]) {
275
- if (e[i] = u(e[i]), t[i] = u(t[i]), e[i] < t[i]) {
276
- o = -1;
277
- break
278
- }
279
- if (e[i] > t[i]) {
280
- o = 1;
281
- break
282
- }
283
- }
284
- if (!n)
285
- return o;
286
- switch (n) {
287
- case ">":
288
- case "gt":
289
- return o > 0;
290
- case ">=":
291
- case "ge":
292
- return o >= 0;
293
- case "<=":
294
- case "le":
295
- return 0 >= o;
296
- case "==":
297
- case "=":
298
- case "eq":
299
- return 0 === o;
300
- case "<>":
301
- case "!=":
302
- case "ne":
303
- return 0 !== o;
304
- case "":
305
- case "<":
306
- case "lt":
307
- return 0 > o;
308
- default:
309
- return null
310
- }
311
- }
312
- var n = function (e) {
313
- var t = "",
314
- n = "?",
315
- i = "function",
316
- r = "undefined",
317
- o = "object",
318
- a = "major",
319
- s = "model",
320
- u = "name",
321
- c = "type",
322
- l = "vendor",
323
- d = "version",
324
- h = "architecture",
325
- f = "console",
326
- p = "mobile",
327
- m = "tablet",
328
- g = {
329
- has: function (e, t) {
330
- return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
331
- },
332
- lowerize: function (e) {
333
- return e.toLowerCase()
334
- }
335
- },
336
- v = {
337
- rgx: function () {
338
- for (var t, n = 0, a, s, u, c, l, d, h = arguments; n < h.length; n += 2) {
339
- var f = h[n],
340
- p = h[n + 1];
341
- if (typeof t === r) {
342
- t = {};
343
- for (u in p)
344
- c = p[u], typeof c === o ? t[c[0]] = e : t[c] = e
345
- }
346
- for (a = s = 0; a < f.length; a++)
347
- if (l = f[a].exec(this.getUA())) {
348
- for (u = 0; u < p.length; u++)
349
- d = l[++s], c = p[u], typeof c === o && c.length > 0 ? 2 == c.length ? typeof c[1] == i ? t[c[0]] = c[1].call(this, d) : t[c[0]] = c[1] : 3 == c.length ? typeof c[1] !== i || c[1].exec && c[1].test ? t[c[0]] = d ? d.replace(c[1], c[2]) : e : t[c[0]] = d ? c[1].call(this, d, c[2]) : e : 4 == c.length && (t[c[0]] = d ? c[3].call(this, d.replace(c[1], c[2])) : e) : t[c] = d ? d : e;
350
- break
351
- }
352
- if (l)
353
- break
354
- }
355
- return t
356
- },
357
- str: function (t, i) {
358
- for (var r in i)
359
- if (typeof i[r] === o && i[r].length > 0) {
360
- for (var a = 0; a < i[r].length; a++)
361
- if (g.has(i[r][a], t))
362
- return r === n ? e : r
363
- } else if (g.has(i[r], t))
364
- return r === n ? e : r;
365
- return t
366
- }
367
- },
368
- w = {
369
- browser: {
370
- oldsafari: {
371
- major: {
372
- 1: ["/8", "/1", "/3"],
373
- 2: "/4",
374
- "?": "/"
375
- },
376
- version: {
377
- "1.0": "/8",
378
- 1.2: "/1",
379
- 1.3: "/3",
380
- "2.0": "/412",
381
- "2.0.2": "/416",
382
- "2.0.3": "/417",
383
- "2.0.4": "/419",
384
- "?": "/"
385
- }
386
- }
387
- },
388
- device: {
389
- sprint: {
390
- model: {
391
- "Evo Shift 4G": "7373KT"
392
- },
393
- vendor: {
394
- HTC: "APA",
395
- Sprint: "Sprint"
396
- }
397
- }
398
- },
399
- os: {
400
- windows: {
401
- version: {
402
- ME: "4.90",
403
- "NT 3.11": "NT3.51",
404
- "NT 4.0": "NT4.0",
405
- 2000: "NT 5.0",
406
- XP: ["NT 5.1", "NT 5.2"],
407
- Vista: "NT 6.0",
408
- 7: "NT 6.1",
409
- 8: "NT 6.2",
410
- 8.1: "NT 6.3",
411
- RT: "ARM"
412
- }
413
- }
414
- }
415
- },
416
- y = {
417
- browser: [
418
- [/(opera\smini)\/([\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, /(opera).+version\/([\w\.]+)/i, /(opera)[\/\s]+([\w\.]+)/i],
419
- [u, d],
420
- [/\s(opr)\/([\w\.]+)/i],
421
- [
422
- [u, "Opera"], d
423
- ],
424
- [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i, /(?:ms|\()(ie)\s([\w\.]+)/i, /(rekonq)\/([\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i],
425
- [u, d],
426
- [/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],
427
- [
428
- [u, "IE"], d
429
- ],
430
- [/(edge)\/((\d+)?[\w\.]+)/i],
431
- [u, d],
432
- [/(yabrowser)\/([\w\.]+)/i],
433
- [
434
- [u, "Yandex"], d
435
- ],
436
- [/(comodo_dragon)\/([\w\.]+)/i],
437
- [
438
- [u, /_/g, " "], d
439
- ],
440
- [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i, /(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],
441
- [u, d],
442
- [/(dolfin)\/([\w\.]+)/i],
443
- [
444
- [u, "Dolphin"], d
445
- ],
446
- [/((?:android.+)crmo|crios)\/([\w\.]+)/i],
447
- [
448
- [u, "Chrome"], d
449
- ],
450
- [/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],
451
- [d, [u, "MIUI Browser"]],
452
- [/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],
453
- [d, [u, "Android Browser"]],
454
- [/FBAV\/([\w\.]+);/i],
455
- [d, [u, "Facebook"]],
456
- [/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],
457
- [d, [u, "Mobile Safari"]],
458
- [/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],
459
- [d, u],
460
- [/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],
461
- [u, [d, v.str, w.browser.oldsafari.version]],
462
- [/(konqueror)\/([\w\.]+)/i, /(webkit|khtml)\/([\w\.]+)/i],
463
- [u, d],
464
- [/(navigator|netscape)\/([\w\.-]+)/i],
465
- [
466
- [u, "Netscape"], d
467
- ],
468
- [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i, /(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i, /(links)\s\(([\w\.]+)/i, /(gobrowser)\/?([\w\.]+)*/i, /(ice\s?browser)\/v?([\w\._]+)/i, /(mosaic)[\/\s]([\w\.]+)/i],
469
- [u, d]
470
- ],
471
- engine: [
472
- [/windows.+\sedge\/([\w\.]+)/i],
473
- [d, [u, "EdgeHTML"]],
474
- [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i],
475
- [u, d],
476
- [/rv\:([\w\.]+).*(gecko)/i],
477
- [d, u]
478
- ],
479
- os: [
480
- [/microsoft\s(windows)\s(vista|xp)/i],
481
- [u, d],
482
- [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],
483
- [u, [d, v.str, w.os.windows.version]],
484
- [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
485
- [
486
- [u, "Windows"],
487
- [d, v.str, w.os.windows.version]
488
- ],
489
- [/\((bb)(10);/i],
490
- [
491
- [u, "BlackBerry"], d
492
- ],
493
- [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)[\/\s]([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i, /linux;.+(sailfish);/i],
494
- [u, d],
495
- [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
496
- [
497
- [u, "Symbian"], d
498
- ],
499
- [/\((series40);/i],
500
- [u],
501
- [/mozilla.+\(mobile;.+gecko.+firefox/i],
502
- [
503
- [u, "Firefox OS"], d
504
- ],
505
- [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(mageia|vectorlinux)[;\s]/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i],
506
- [u, d],
507
- [/(cros)\s[\w]+\s([\w\.]+\w)/i],
508
- [
509
- [u, "Chromium OS"], d
510
- ],
511
- [/(sunos)\s?([\w\.]+\d)*/i],
512
- [
513
- [u, "Solaris"], d
514
- ],
515
- [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
516
- [u, d],
517
- [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
518
- [
519
- [u, "iOS"],
520
- [d, /_/g, "."]
521
- ],
522
- [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i, /(macintosh|mac(?=_powerpc)\s)/i],
523
- [
524
- [u, "Mac OS"],
525
- [d, /_/g, "."]
526
- ],
527
- [/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i, /(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i, /(unix)\s?([\w\.]+)*/i],
528
- [u, d]
529
- ]
530
- },
531
- E = function (e) {
532
- var n = e || (window && window.navigator && window.navigator.userAgent ? window.navigator.userAgent : t);
533
- this.getBrowser = function () {
534
- return v.rgx.apply(this, y.browser)
535
- }, this.getEngine = function () {
536
- return v.rgx.apply(this, y.engine)
537
- }, this.getOS = function () {
538
- return v.rgx.apply(this, y.os)
539
- }, this.getResult = function () {
540
- return {
541
- ua: this.getUA(),
542
- browser: this.getBrowser(),
543
- engine: this.getEngine(),
544
- os: this.getOS()
545
- }
546
- }, this.getUA = function () {
547
- return n
548
- }, this.setUA = function (e) {
549
- return n = e, this
550
- }, this.setUA(n)
551
- };
552
- return E
553
- }(),
554
- i = function () {
555
- var t = {
556
- define_property: function () {
557
- return !1
558
- }(),
559
- create_canvas: function () {
560
- var e = document.createElement("canvas");
561
- return !(!e.getContext || !e.getContext("2d"))
562
- }(),
563
- return_response_type: function (t) {
564
- try {
565
- if (-1 !== e.inArray(t, ["", "text", "document"]))
566
- return !0;
567
- if (window.XMLHttpRequest) {
568
- var n = new XMLHttpRequest;
569
- if (n.open("get", "/"), "responseType" in n)
570
- return n.responseType = t, n.responseType !== t ? !1 : !0
571
- }
572
- } catch (i) {
573
- }
574
- return !1
575
- },
576
- use_data_uri: function () {
577
- var e = new Image;
578
- return e.onload = function () {
579
- t.use_data_uri = 1 === e.width && 1 === e.height
580
- }, setTimeout(function () {
581
- e.src = "data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="
582
- }, 1), !1
583
- }(),
584
- use_data_uri_over32kb: function () {
585
- return t.use_data_uri && ("IE" !== o.browser || o.version >= 9)
586
- },
587
- use_data_uri_of: function (e) {
588
- return t.use_data_uri && 33e3 > e || t.use_data_uri_over32kb()
589
- },
590
- use_fileinput: function () {
591
- if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))
592
- return !1;
593
- var e = document.createElement("input");
594
- return e.setAttribute("type", "file"), !e.disabled
595
- }
596
- };
597
- return function (n) {
598
- var i = [].slice.call(arguments);
599
- return i.shift(), "function" === e.typeOf(t[n]) ? t[n].apply(this, i) : !!t[n]
600
- }
601
- }(),
602
- r = (new n).getResult(),
603
- o = {
604
- can: i,
605
- uaParser: n,
606
- browser: r.browser.name,
607
- version: r.browser.version,
608
- os: r.os.name,
609
- osVersion: r.os.version,
610
- verComp: t,
611
- swf_url: "../flash/Moxie.swf",
612
- xap_url: "../silverlight/Moxie.xap",
613
- global_event_dispatcher: "moxie.core.EventTarget.instance.dispatchEvent"
614
- };
615
- return o.OS = o.os, o
616
- }), i(l, [u], function (e) {
617
- var t = {};
618
- return {
619
- addI18n: function (n) {
620
- return e.extend(t, n)
621
- },
622
- translate: function (e) {
623
- return t[e] || e
624
- },
625
- _: function (e) {
626
- return this.translate(e)
627
- },
628
- sprintf: function (t) {
629
- var n = [].slice.call(arguments, 1);
630
- return t.replace(/%[a-z]/g, function () {
631
- var t = n.shift();
632
- return "undefined" !== e.typeOf(t) ? t : ""
633
- })
634
- }
635
- }
636
- }), i(d, [u, l], function (e, t) {
637
- var n = "application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",
638
- i = {
639
- mimes: {},
640
- extensions: {},
641
- addMimeType: function (e) {
642
- var t = e.split(/,/),
643
- n, i, r;
644
- for (n = 0; n < t.length; n += 2) {
645
- for (r = t[n + 1].split(/ /), i = 0; i < r.length; i++)
646
- this.mimes[r[i]] = t[n];
647
- this.extensions[t[n]] = r
648
- }
649
- },
650
- extList2mimes: function (t, n) {
651
- var i = this,
652
- r, o, a, s, u = [];
653
- for (o = 0; o < t.length; o++)
654
- for (r = t[o].extensions.split(/\s*,\s*/), a = 0; a < r.length; a++) {
655
- if ("*" === r[a])
656
- return [];
657
- if (s = i.mimes[r[a]], s && -1 === e.inArray(s, u) && u.push(s), n && /^\w+$/.test(r[a]))
658
- u.push("." + r[a]);
659
- else if (!s)
660
- return []
661
- }
662
- return u
663
- },
664
- mimes2exts: function (t) {
665
- var n = this,
666
- i = [];
667
- return e.each(t, function (t) {
668
- if ("*" === t)
669
- return i = [], !1;
670
- var r = t.match(/^(\w+)\/(\*|\w+)$/);
671
- r && ("*" === r[2] ? e.each(n.extensions, function (e, t) {
672
- new RegExp("^" + r[1] + "/").test(t) && [].push.apply(i, n.extensions[t])
673
- }) : n.extensions[t] && [].push.apply(i, n.extensions[t]))
674
- }), i
675
- },
676
- mimes2extList: function (n) {
677
- var i = [],
678
- r = [];
679
- return "string" === e.typeOf(n) && (n = e.trim(n).split(/\s*,\s*/)), r = this.mimes2exts(n), i.push({
680
- title: t.translate("Files"),
681
- extensions: r.length ? r.join(",") : "*"
682
- }), i.mimes = n, i
683
- },
684
- getFileExtension: function (e) {
685
- var t = e && e.match(/\.([^.]+)$/);
686
- return t ? t[1].toLowerCase() : ""
687
- },
688
- getFileMime: function (e) {
689
- return this.mimes[this.getFileExtension(e)] || ""
690
- }
691
- };
692
- return i.addMimeType(n), i
693
- }), i(h, [c], function (e) {
694
- var t = function (e) {
695
- return "string" != typeof e ? e : document.getElementById(e)
696
- },
697
- n = function (e, t) {
698
- if (!e.className)
699
- return !1;
700
- var n = new RegExp("(^|\\s+)" + t + "(\\s+|$)");
701
- return n.test(e.className)
702
- },
703
- i = function (e, t) {
704
- n(e, t) || (e.className = e.className ? e.className.replace(/\s+$/, "") + " " + t : t)
705
- },
706
- r = function (e, t) {
707
- if (e.className) {
708
- var n = new RegExp("(^|\\s+)" + t + "(\\s+|$)");
709
- e.className = e.className.replace(n, function (e, t, n) {
710
- return " " === t && " " === n ? " " : ""
711
- })
712
- }
713
- },
714
- o = function (e, t) {
715
- return e.currentStyle ? e.currentStyle[t] : window.getComputedStyle ? window.getComputedStyle(e, null)[t] : void 0
716
- },
717
- a = function (t, n) {
718
- function i(e) {
719
- var t, n, i = 0,
720
- r = 0;
721
- return e && (n = e.getBoundingClientRect(), t = "CSS1Compat" === s.compatMode ? s.documentElement : s.body, i = n.left + t.scrollLeft, r = n.top + t.scrollTop), {
722
- x: i,
723
- y: r
724
- }
725
- }
726
- var r = 0,
727
- o = 0,
728
- a, s = document,
729
- u, c;
730
- if (t = t, n = n || s.body, t && t.getBoundingClientRect && "IE" === e.browser && (!s.documentMode || s.documentMode < 8))
731
- return u = i(t), c = i(n), {
732
- x: u.x - c.x,
733
- y: u.y - c.y
734
- };
735
- for (a = t; a && a != n && a.nodeType; )
736
- r += a.offsetLeft || 0, o += a.offsetTop || 0, a = a.offsetParent;
737
- for (a = t.parentNode; a && a != n && a.nodeType; )
738
- r -= a.scrollLeft || 0, o -= a.scrollTop || 0, a = a.parentNode;
739
- return {
740
- x: r,
741
- y: o
742
- }
743
- },
744
- s = function (e) {
745
- return {
746
- w: e.offsetWidth || e.clientWidth,
747
- h: e.offsetHeight || e.clientHeight
748
- }
749
- };
750
- return {
751
- get: t,
752
- hasClass: n,
753
- addClass: i,
754
- removeClass: r,
755
- getStyle: o,
756
- getPos: a,
757
- getSize: s
758
- }
759
- }), i(f, [u], function (e) {
760
- function t(e, t) {
761
- var n;
762
- for (n in e)
763
- if (e[n] === t)
764
- return n;
765
- return null
766
- }
767
- return {
768
- RuntimeError: function () {
769
- function n(e) {
770
- this.code = e, this.name = t(i, e), this.message = this.name + ": RuntimeError " + this.code
771
- }
772
- var i = {
773
- NOT_INIT_ERR: 1,
774
- NOT_SUPPORTED_ERR: 9,
775
- JS_ERR: 4
776
- };
777
- return e.extend(n, i), n.prototype = Error.prototype, n
778
- }(),
779
- OperationNotAllowedException: function () {
780
- function t(e) {
781
- this.code = e, this.name = "OperationNotAllowedException"
782
- }
783
- return e.extend(t, {
784
- NOT_ALLOWED_ERR: 1
785
- }), t.prototype = Error.prototype, t
786
- }(),
787
- ImageError: function () {
788
- function n(e) {
789
- this.code = e, this.name = t(i, e), this.message = this.name + ": ImageError " + this.code
790
- }
791
- var i = {
792
- WRONG_FORMAT: 1,
793
- MAX_RESOLUTION_ERR: 2,
794
- INVALID_META_ERR: 3
795
- };
796
- return e.extend(n, i), n.prototype = Error.prototype, n
797
- }(),
798
- FileException: function () {
799
- function n(e) {
800
- this.code = e, this.name = t(i, e), this.message = this.name + ": FileException " + this.code
801
- }
802
- var i = {
803
- NOT_FOUND_ERR: 1,
804
- SECURITY_ERR: 2,
805
- ABORT_ERR: 3,
806
- NOT_READABLE_ERR: 4,
807
- ENCODING_ERR: 5,
808
- NO_MODIFICATION_ALLOWED_ERR: 6,
809
- INVALID_STATE_ERR: 7,
810
- SYNTAX_ERR: 8
811
- };
812
- return e.extend(n, i), n.prototype = Error.prototype, n
813
- }(),
814
- DOMException: function () {
815
- function n(e) {
816
- this.code = e, this.name = t(i, e), this.message = this.name + ": DOMException " + this.code
817
- }
818
- var i = {
819
- INDEX_SIZE_ERR: 1,
820
- DOMSTRING_SIZE_ERR: 2,
821
- HIERARCHY_REQUEST_ERR: 3,
822
- WRONG_DOCUMENT_ERR: 4,
823
- INVALID_CHARACTER_ERR: 5,
824
- NO_DATA_ALLOWED_ERR: 6,
825
- NO_MODIFICATION_ALLOWED_ERR: 7,
826
- NOT_FOUND_ERR: 8,
827
- NOT_SUPPORTED_ERR: 9,
828
- INUSE_ATTRIBUTE_ERR: 10,
829
- INVALID_STATE_ERR: 11,
830
- SYNTAX_ERR: 12,
831
- INVALID_MODIFICATION_ERR: 13,
832
- NAMESPACE_ERR: 14,
833
- INVALID_ACCESS_ERR: 15,
834
- VALIDATION_ERR: 16,
835
- TYPE_MISMATCH_ERR: 17,
836
- SECURITY_ERR: 18,
837
- NETWORK_ERR: 19,
838
- ABORT_ERR: 20,
839
- URL_MISMATCH_ERR: 21,
840
- QUOTA_EXCEEDED_ERR: 22,
841
- TIMEOUT_ERR: 23,
842
- INVALID_NODE_TYPE_ERR: 24,
843
- DATA_CLONE_ERR: 25
844
- };
845
- return e.extend(n, i), n.prototype = Error.prototype, n
846
- }(),
847
- EventException: function () {
848
- function t(e) {
849
- this.code = e, this.name = "EventException"
850
- }
851
- return e.extend(t, {
852
- UNSPECIFIED_EVENT_TYPE_ERR: 0
853
- }), t.prototype = Error.prototype, t
854
- }()
855
- }
856
- }), i(p, [c, f, u], function (e, t, n) {
857
- function i() {
858
- var e = {};
859
- n.extend(this, {
860
- uid: null,
861
- init: function () {
862
- this.uid || (this.uid = n.guid("uid_"))
863
- },
864
- addEventListener: function (t, i, r, o) {
865
- var a = this,
866
- s;
867
- return this.hasOwnProperty("uid") || (this.uid = n.guid("uid_")), t = n.trim(t), /\s/.test(t) ? void n.each(t.split(/\s+/), function (e) {
868
- a.addEventListener(e, i, r, o)
869
- }) : (t = t.toLowerCase(), r = parseInt(r, 10) || 0, s = e[this.uid] && e[this.uid][t] || [], s.push({
870
- fn: i,
871
- priority: r,
872
- scope: o || this
873
- }), e[this.uid] || (e[this.uid] = {}), void(e[this.uid][t] = s))
874
- },
875
- hasEventListener: function (t) {
876
- var n = t ? e[this.uid] && e[this.uid][t] : e[this.uid];
877
- return n ? n : !1
878
- },
879
- removeEventListener: function (t, i) {
880
- t = t.toLowerCase();
881
- var r = e[this.uid] && e[this.uid][t],
882
- o;
883
- if (r) {
884
- if (i) {
885
- for (o = r.length - 1; o >= 0; o--)
886
- if (r[o].fn === i) {
887
- r.splice(o, 1);
888
- break
889
- }
890
- } else
891
- r = [];
892
- r.length || (delete e[this.uid][t], n.isEmptyObj(e[this.uid]) && delete e[this.uid])
893
- }
894
- },
895
- removeAllEventListeners: function () {
896
- e[this.uid] && delete e[this.uid]
897
- },
898
- dispatchEvent: function (i) {
899
- var r, o, a, s, u = {},
900
- c = !0,
901
- l;
902
- if ("string" !== n.typeOf(i)) {
903
- if (s = i, "string" !== n.typeOf(s.type))
904
- throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);
905
- i = s.type, s.total !== l && s.loaded !== l && (u.total = s.total, u.loaded = s.loaded), u.async = s.async || !1
906
- }
907
- if (-1 !== i.indexOf("::") ? !function (e) {
908
- r = e[0], i = e[1]
909
- }(i.split("::")) : r = this.uid, i = i.toLowerCase(), o = e[r] && e[r][i]) {
910
- o.sort(function (e, t) {
911
- return t.priority - e.priority
912
- }), a = [].slice.call(arguments), a.shift(), u.type = i, a.unshift(u);
913
- var d = [];
914
- n.each(o, function (e) {
915
- a[0].target = e.scope, d.push(u.async ? function (t) {
916
- setTimeout(function () {
917
- t(e.fn.apply(e.scope, a) === !1)
918
- }, 1)
919
- } : function (t) {
920
- t(e.fn.apply(e.scope, a) === !1)
921
- })
922
- }), d.length && n.inSeries(d, function (e) {
923
- c = !e
924
- })
925
- }
926
- return c
927
- },
928
- bind: function () {
929
- this.addEventListener.apply(this, arguments)
930
- },
931
- unbind: function () {
932
- this.removeEventListener.apply(this, arguments)
933
- },
934
- unbindAll: function () {
935
- this.removeAllEventListeners.apply(this, arguments)
936
- },
937
- trigger: function () {
938
- return this.dispatchEvent.apply(this, arguments)
939
- },
940
- handleEventProps: function (e) {
941
- var t = this;
942
- this.bind(e.join(" "), function (e) {
943
- var t = "on" + e.type.toLowerCase();
944
- "function" === n.typeOf(this[t]) && this[t].apply(this, arguments)
945
- }), n.each(e, function (e) {
946
- e = "on" + e.toLowerCase(e), "undefined" === n.typeOf(t[e]) && (t[e] = null)
947
- })
948
- }
949
- })
950
- }
951
- return i.instance = new i, i
952
- }), i(m, [c, u, h, p], function (e, t, n, i) {
953
- function r(e, i, o, s, u) {
954
- var c = this,
955
- l, d = t.guid(i + "_"),
956
- h = u || "browser";
957
- e = e || {}, a[d] = this, o = t.extend({
958
- access_binary: !1,
959
- access_image_binary: !1,
960
- display_media: !1,
961
- do_cors: !1,
962
- drag_and_drop: !1,
963
- filter_by_extension: !0,
964
- resize_image: !1,
965
- report_upload_progress: !1,
966
- return_response_headers: !1,
967
- return_response_type: !1,
968
- return_status_code: !0,
969
- send_custom_headers: !1,
970
- select_file: !1,
971
- select_folder: !1,
972
- select_multiple: !0,
973
- send_binary_string: !1,
974
- send_browser_cookies: !0,
975
- send_multipart: !0,
976
- slice_blob: !1,
977
- stream_upload: !1,
978
- summon_file_dialog: !1,
979
- upload_filesize: !0,
980
- use_http_method: !0
981
- }, o), e.preferred_caps && (h = r.getMode(s, e.preferred_caps, h)), l = function () {
982
- var e = {};
983
- return {
984
- exec: function (t, n, i, r) {
985
- return l[n] && (e[t] || (e[t] = {
986
- context: this,
987
- instance: new l[n]
988
- }), e[t].instance[i]) ? e[t].instance[i].apply(this, r) : void 0
989
- },
990
- removeInstance: function (t) {
991
- delete e[t]
992
- },
993
- removeAllInstances: function () {
994
- var n = this;
995
- t.each(e, function (e, i) {
996
- "function" === t.typeOf(e.instance.destroy) && e.instance.destroy.call(e.context), n.removeInstance(i)
997
- })
998
- }
999
- }
1000
- }(), t.extend(this, {
1001
- initialized: !1,
1002
- uid: d,
1003
- type: i,
1004
- mode: r.getMode(s, e.required_caps, h),
1005
- shimid: d + "_container",
1006
- clients: 0,
1007
- options: e,
1008
- can: function (e, n) {
1009
- var i = arguments[2] || o;
1010
- if ("string" === t.typeOf(e) && "undefined" === t.typeOf(n) && (e = r.parseCaps(e)), "object" === t.typeOf(e)) {
1011
- for (var a in e)
1012
- if (!this.can(a, e[a], i))
1013
- return !1;
1014
- return !0
1015
- }
1016
- return "function" === t.typeOf(i[e]) ? i[e].call(this, n) : n === i[e]
1017
- },
1018
- getShimContainer: function () {
1019
- var e, i = n.get(this.shimid);
1020
- return i || (e = this.options.container ? n.get(this.options.container) : document.body, i = document.createElement("div"), i.id = this.shimid, i.className = "moxie-shim moxie-shim-" + this.type, t.extend(i.style, {
1021
- position: "absolute",
1022
- top: "0px",
1023
- left: "0px",
1024
- width: "1px",
1025
- height: "1px",
1026
- overflow: "hidden"
1027
- }), e.appendChild(i), e = null), i
1028
- },
1029
- getShim: function () {
1030
- return l
1031
- },
1032
- shimExec: function (e, t) {
1033
- var n = [].slice.call(arguments, 2);
1034
- return c.getShim().exec.call(this, this.uid, e, t, n)
1035
- },
1036
- exec: function (e, t) {
1037
- var n = [].slice.call(arguments, 2);
1038
- return c[e] && c[e][t] ? c[e][t].apply(this, n) : c.shimExec.apply(this, arguments)
1039
- },
1040
- destroy: function () {
1041
- if (c) {
1042
- var e = n.get(this.shimid);
1043
- e && e.parentNode.removeChild(e), l && l.removeAllInstances(), this.unbindAll(), delete a[this.uid], this.uid = null, d = c = l = e = null
1044
- }
1045
- }
1046
- }), this.mode && e.required_caps && !this.can(e.required_caps) && (this.mode = !1)
1047
- }
1048
- var o = {},
1049
- a = {};
1050
- return r.order = "html5,flash,silverlight,html4", r.getRuntime = function (e) {
1051
- return a[e] ? a[e] : !1
1052
- }, r.addConstructor = function (e, t) {
1053
- t.prototype = i.instance, o[e] = t
1054
- }, r.getConstructor = function (e) {
1055
- return o[e] || null
1056
- }, r.getInfo = function (e) {
1057
- var t = r.getRuntime(e);
1058
- return t ? {
1059
- uid: t.uid,
1060
- type: t.type,
1061
- mode: t.mode,
1062
- can: function () {
1063
- return t.can.apply(t, arguments)
1064
- }
1065
- } : null
1066
- }, r.parseCaps = function (e) {
1067
- var n = {};
1068
- return "string" !== t.typeOf(e) ? e || {} : (t.each(e.split(","), function (e) {
1069
- n[e] = !0
1070
- }), n)
1071
- }, r.can = function (e, t) {
1072
- var n, i = r.getConstructor(e),
1073
- o;
1074
- return i ? (n = new i({
1075
- required_caps: t
1076
- }), o = n.mode, n.destroy(), !!o) : !1
1077
- }, r.thatCan = function (e, t) {
1078
- var n = (t || r.order).split(/\s*,\s*/);
1079
- for (var i in n)
1080
- if (r.can(n[i], e))
1081
- return n[i];
1082
- return null
1083
- }, r.getMode = function (e, n, i) {
1084
- var r = null;
1085
- if ("undefined" === t.typeOf(i) && (i = "browser"), n && !t.isEmptyObj(e)) {
1086
- if (t.each(n, function (n, i) {
1087
- if (e.hasOwnProperty(i)) {
1088
- var o = e[i](n);
1089
- if ("string" == typeof o && (o = [o]), r) {
1090
- if (!(r = t.arrayIntersect(r, o)))
1091
- return r = !1
1092
- } else
1093
- r = o
1094
- }
1095
- }), r)
1096
- return -1 !== t.inArray(i, r) ? i : r[0];
1097
- if (r === !1)
1098
- return !1
1099
- }
1100
- return i
1101
- }, r.capTrue = function () {
1102
- return !0
1103
- }, r.capFalse = function () {
1104
- return !1
1105
- }, r.capTest = function (e) {
1106
- return function () {
1107
- return !!e
1108
- }
1109
- }, r
1110
- }), i(g, [c, f, u, m], function (e, t, n, i) {
1111
- return function r() {
1112
- var e;
1113
- n.extend(this, {
1114
- connectRuntime: function (r) {
1115
- function o(n) {
1116
- var s, u;
1117
- return n.length ? (s = n.shift().toLowerCase(), (u = i.getConstructor(s)) ? (e = new u(r), e.bind("Init", function () {
1118
- e.initialized = !0, setTimeout(function () {
1119
- e.clients++, a.trigger("RuntimeInit", e)
1120
- }, 1)
1121
- }), e.bind("Error", function () {
1122
- e.destroy(), o(n)
1123
- }), e.mode ? void e.init() : void e.trigger("Error")) : void o(n)) : (a.trigger("RuntimeError", new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)), void(e = null))
1124
- }
1125
- var a = this,
1126
- s;
1127
- if ("string" === n.typeOf(r) ? s = r : "string" === n.typeOf(r.ruid) && (s = r.ruid), s) {
1128
- if (e = i.getRuntime(s))
1129
- return e.clients++, e;
1130
- throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)
1131
- }
1132
- o((r.runtime_order || i.order).split(/\s*,\s*/))
1133
- },
1134
- disconnectRuntime: function () {
1135
- e && --e.clients <= 0 && e.destroy(), e = null
1136
- },
1137
- getRuntime: function () {
1138
- return e && e.uid ? e : e = null
1139
- },
1140
- exec: function () {
1141
- return e ? e.exec.apply(this, arguments) : null
1142
- }
1143
- })
1144
- }
1145
- }), i(v, [u, c, d, h, f, p, l, m, g], function (e, t, n, i, r, o, a, s, u) {
1146
- function c(t) {
1147
- var o = this,
1148
- c, d, h;
1149
- if (-1 !== e.inArray(e.typeOf(t), ["string", "node"]) && (t = {
1150
- browse_button: t
1151
- }), d = i.get(t.browse_button), !d)
1152
- throw new r.DOMException(r.DOMException.NOT_FOUND_ERR);
1153
- h = {
1154
- accept: [{
1155
- title: a.translate("All Files"),
1156
- extensions: "*"
1157
- }],
1158
- name: "file",
1159
- multiple: !1,
1160
- required_caps: !1,
1161
- container: d.parentNode || document.body
1162
- }, t = e.extend({}, h, t), "string" == typeof t.required_caps && (t.required_caps = s.parseCaps(t.required_caps)), "string" == typeof t.accept && (t.accept = n.mimes2extList(t.accept)), c = i.get(t.container), c || (c = document.body), "static" === i.getStyle(c, "position") && (c.style.position = "relative"), c = d = null, u.call(o), e.extend(o, {
1163
- uid: e.guid("uid_"),
1164
- ruid: null,
1165
- shimid: null,
1166
- files: null,
1167
- init: function () {
1168
- o.bind("RuntimeInit", function (n, r) {
1169
- o.ruid = r.uid, o.shimid = r.shimid, o.bind("Ready", function () {
1170
- o.trigger("Refresh")
1171
- }, 999), o.bind("Refresh", function () {
1172
- var n, o, a, s;
1173
- a = i.get(t.browse_button), s = i.get(r.shimid), a && (n = i.getPos(a, i.get(t.container)), o = i.getSize(a), s && e.extend(s.style, {
1174
- top: n.y + "px",
1175
- left: n.x + "px",
1176
- width: o.w + "px",
1177
- height: o.h + "px"
1178
- })), s = a = null
1179
- }), r.exec.call(o, "FileInput", "init", t)
1180
- }), o.connectRuntime(e.extend({}, t, {
1181
- required_caps: {
1182
- select_file: !0
1183
- }
1184
- }))
1185
- },
1186
- disable: function (t) {
1187
- var n = this.getRuntime();
1188
- n && n.exec.call(this, "FileInput", "disable", "undefined" === e.typeOf(t) ? !0 : t)
1189
- },
1190
- refresh: function () {
1191
- o.trigger("Refresh")
1192
- },
1193
- destroy: function () {
1194
- var t = this.getRuntime();
1195
- t && (t.exec.call(this, "FileInput", "destroy"), this.disconnectRuntime()), "array" === e.typeOf(this.files) && e.each(this.files, function (e) {
1196
- e.destroy()
1197
- }), this.files = null, this.unbindAll()
1198
- }
1199
- }), this.handleEventProps(l)
1200
- }
1201
- var l = ["ready", "change", "cancel", "mouseenter", "mouseleave", "mousedown", "mouseup"];
1202
- return c.prototype = o.instance, c
1203
- }), i(w, [], function () {
1204
- var e = function (e) {
1205
- return unescape(encodeURIComponent(e))
1206
- },
1207
- t = function (e) {
1208
- return decodeURIComponent(escape(e))
1209
- },
1210
- n = function (e, n) {
1211
- if ("function" == typeof window.atob)
1212
- return n ? t(window.atob(e)) : window.atob(e);
1213
- var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
1214
- r, o, a, s, u, c, l, d, h = 0,
1215
- f = 0,
1216
- p = "",
1217
- m = [];
1218
- if (!e)
1219
- return e;
1220
- e += "";
1221
- do
1222
- s = i.indexOf(e.charAt(h++)), u = i.indexOf(e.charAt(h++)), c = i.indexOf(e.charAt(h++)), l = i.indexOf(e.charAt(h++)), d = s << 18 | u << 12 | c << 6 | l, r = d >> 16 & 255, o = d >> 8 & 255, a = 255 & d, 64 == c ? m[f++] = String.fromCharCode(r) : 64 == l ? m[f++] = String.fromCharCode(r, o) : m[f++] = String.fromCharCode(r, o, a);
1223
- while (h < e.length);
1224
- return p = m.join(""), n ? t(p) : p
1225
- },
1226
- i = function (t, n) {
1227
- if (n && (t = e(t)), "function" == typeof window.btoa)
1228
- return window.btoa(t);
1229
- var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
1230
- r, o, a, s, u, c, l, d, h = 0,
1231
- f = 0,
1232
- p = "",
1233
- m = [];
1234
- if (!t)
1235
- return t;
1236
- do
1237
- r = t.charCodeAt(h++), o = t.charCodeAt(h++), a = t.charCodeAt(h++), d = r << 16 | o << 8 | a, s = d >> 18 & 63, u = d >> 12 & 63, c = d >> 6 & 63, l = 63 & d, m[f++] = i.charAt(s) + i.charAt(u) + i.charAt(c) + i.charAt(l);
1238
- while (h < t.length);
1239
- p = m.join("");
1240
- var g = t.length % 3;
1241
- return (g ? p.slice(0, g - 3) : p) + "===".slice(g || 3)
1242
- };
1243
- return {
1244
- utf8_encode: e,
1245
- utf8_decode: t,
1246
- atob: n,
1247
- btoa: i
1248
- }
1249
- }), i(y, [u, w, g], function (e, t, n) {
1250
- function i(o, a) {
1251
- function s(t, n, o) {
1252
- var a, s = r[this.uid];
1253
- return "string" === e.typeOf(s) && s.length ? (a = new i(null, {
1254
- type: o,
1255
- size: n - t
1256
- }), a.detach(s.substr(t, a.size)), a) : null
1257
- }
1258
- n.call(this), o && this.connectRuntime(o), a ? "string" === e.typeOf(a) && (a = {
1259
- data: a
1260
- }) : a = {}, e.extend(this, {
1261
- uid: a.uid || e.guid("uid_"),
1262
- ruid: o,
1263
- size: a.size || 0,
1264
- type: a.type || "",
1265
- slice: function (e, t, n) {
1266
- return this.isDetached() ? s.apply(this, arguments) : this.getRuntime().exec.call(this, "Blob", "slice", this.getSource(), e, t, n)
1267
- },
1268
- getSource: function () {
1269
- return r[this.uid] ? r[this.uid] : null
1270
- },
1271
- detach: function (e) {
1272
- if (this.ruid && (this.getRuntime().exec.call(this, "Blob", "destroy"), this.disconnectRuntime(), this.ruid = null), e = e || "", "data:" == e.substr(0, 5)) {
1273
- var n = e.indexOf(";base64,");
1274
- this.type = e.substring(5, n), e = t.atob(e.substring(n + 8))
1275
- }
1276
- this.size = e.length, r[this.uid] = e
1277
- },
1278
- isDetached: function () {
1279
- return !this.ruid && "string" === e.typeOf(r[this.uid])
1280
- },
1281
- destroy: function () {
1282
- this.detach(), delete r[this.uid]
1283
- }
1284
- }), a.data ? this.detach(a.data) : r[this.uid] = a
1285
- }
1286
- var r = {};
1287
- return i
1288
- }), i(E, [u, d, y], function (e, t, n) {
1289
- function i(i, r) {
1290
- r || (r = {}), n.apply(this, arguments), this.type || (this.type = t.getFileMime(r.name));
1291
- var o;
1292
- if (r.name)
1293
- o = r.name.replace(/\\/g, "/"), o = o.substr(o.lastIndexOf("/") + 1);
1294
- else if (this.type) {
1295
- var a = this.type.split("/")[0];
1296
- o = e.guid(("" !== a ? a : "file") + "_"), t.extensions[this.type] && (o += "." + t.extensions[this.type][0])
1297
- }
1298
- e.extend(this, {
1299
- name: o || e.guid("file_"),
1300
- relativePath: "",
1301
- lastModifiedDate: r.lastModifiedDate || (new Date).toLocaleString()
1302
- })
1303
- }
1304
- return i.prototype = n.prototype, i
1305
- }), i(_, [l, h, f, u, c, E, g, p, d], function (e, t, n, i, r, o, a, s, u) {
1306
- function c(n) {
1307
- var r = this,
1308
- o;
1309
- "string" == typeof n && (n = {
1310
- drop_zone: n
1311
- }), o = {
1312
- accept: [{
1313
- title: e.translate("All Files"),
1314
- extensions: "*"
1315
- }],
1316
- required_caps: {
1317
- drag_and_drop: !0
1318
- }
1319
- }, n = "object" == typeof n ? i.extend({}, o, n) : o, n.container = t.get(n.drop_zone) || document.body, "static" === t.getStyle(n.container, "position") && (n.container.style.position = "relative"), "string" == typeof n.accept && (n.accept = u.mimes2extList(n.accept)), a.call(r), i.extend(r, {
1320
- uid: i.guid("uid_"),
1321
- ruid: null,
1322
- files: null,
1323
- init: function () {
1324
- r.bind("RuntimeInit", function (e, t) {
1325
- r.ruid = t.uid, t.exec.call(r, "FileDrop", "init", n), r.dispatchEvent("ready")
1326
- }), r.connectRuntime(n)
1327
- },
1328
- destroy: function () {
1329
- var e = this.getRuntime();
1330
- e && (e.exec.call(this, "FileDrop", "destroy"), this.disconnectRuntime()), this.files = null, this.unbindAll()
1331
- }
1332
- }), this.handleEventProps(l)
1333
- }
1334
- var l = ["ready", "dragenter", "dragleave", "drop", "error"];
1335
- return c.prototype = s.instance, c
1336
- }), i(b, [u, w, f, p, y, g], function (e, t, n, i, r, o) {
1337
- function a() {
1338
- function i(e, i) {
1339
- var o = this;
1340
- if (this.trigger("loadstart"), this.readyState === a.LOADING)
1341
- return this.trigger("error", new n.DOMException(n.DOMException.INVALID_STATE_ERR)), void this.trigger("loadend");
1342
- if (!(i instanceof r))
1343
- return this.trigger("error", new n.DOMException(n.DOMException.NOT_FOUND_ERR)), void this.trigger("loadend");
1344
- if (this.result = null, this.readyState = a.LOADING, i.isDetached()) {
1345
- var s = i.getSource();
1346
- switch (e) {
1347
- case "readAsText":
1348
- case "readAsBinaryString":
1349
- this.result = s;
1350
- break;
1351
- case "readAsDataURL":
1352
- this.result = "data:" + i.type + ";base64," + t.btoa(s)
1353
- }
1354
- this.readyState = a.DONE, this.trigger("load"), this.trigger("loadend")
1355
- } else
1356
- this.connectRuntime(i.ruid), this.exec("FileReader", "read", e, i)
1357
- }
1358
- o.call(this), e.extend(this, {
1359
- uid: e.guid("uid_"),
1360
- readyState: a.EMPTY,
1361
- result: null,
1362
- error: null,
1363
- readAsBinaryString: function (e) {
1364
- i.call(this, "readAsBinaryString", e)
1365
- },
1366
- readAsDataURL: function (e) {
1367
- i.call(this, "readAsDataURL", e)
1368
- },
1369
- readAsText: function (e) {
1370
- i.call(this, "readAsText", e);
1371
- },
1372
- abort: function () {
1373
- this.result = null, -1 === e.inArray(this.readyState, [a.EMPTY, a.DONE]) && (this.readyState === a.LOADING && (this.readyState = a.DONE), this.exec("FileReader", "abort"), this.trigger("abort"), this.trigger("loadend"))
1374
- },
1375
- destroy: function () {
1376
- this.abort(), this.exec("FileReader", "destroy"), this.disconnectRuntime(), this.unbindAll()
1377
- }
1378
- }), this.handleEventProps(s), this.bind("Error", function (e, t) {
1379
- this.readyState = a.DONE, this.error = t
1380
- }, 999), this.bind("Load", function (e) {
1381
- this.readyState = a.DONE
1382
- }, 999)
1383
- }
1384
- var s = ["loadstart", "progress", "load", "abort", "error", "loadend"];
1385
- return a.EMPTY = 0, a.LOADING = 1, a.DONE = 2, a.prototype = i.instance, a
1386
- }), i(x, [], function () {
1387
- var e = function (t, n) {
1388
- for (var i = ["source", "scheme", "authority", "userInfo", "user", "pass", "host", "port", "relative", "path", "directory", "file", "query", "fragment"], r = i.length, o = {
1389
- http: 80,
1390
- https: 443
1391
- }, a = {}, s = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/, u = s.exec(t || ""); r--; )
1392
- u[r] && (a[i[r]] = u[r]);
1393
- if (!a.scheme) {
1394
- n && "string" != typeof n || (n = e(n || document.location.href)), a.scheme = n.scheme, a.host = n.host, a.port = n.port;
1395
- var c = "";
1396
- /^[^\/]/.test(a.path) && (c = n.path, c = /\/[^\/]*\.[^\/]*$/.test(c) ? c.replace(/\/[^\/]+$/, "/") : c.replace(/\/?$/, "/")), a.path = c + (a.path || "")
1397
- }
1398
- return a.port || (a.port = o[a.scheme] || 80), a.port = parseInt(a.port, 10), a.path || (a.path = "/"), delete a.source, a
1399
- },
1400
- t = function (t) {
1401
- var n = {
1402
- http: 80,
1403
- https: 443
1404
- },
1405
- i = "object" == typeof t ? t : e(t);
1406
- return i.scheme + "://" + i.host + (i.port !== n[i.scheme] ? ":" + i.port : "") + i.path + (i.query ? i.query : "")
1407
- },
1408
- n = function (t) {
1409
- function n(e) {
1410
- return [e.scheme, e.host, e.port].join("/")
1411
- }
1412
- return "string" == typeof t && (t = e(t)), n(e()) === n(t)
1413
- };
1414
- return {
1415
- parseUrl: e,
1416
- resolveUrl: t,
1417
- hasSameOrigin: n
1418
- }
1419
- }), i(R, [u, g, p], function (e, t, n) {
1420
- function i() {
1421
- this.uid = e.guid("uid_"), t.call(this), this.destroy = function () {
1422
- this.disconnectRuntime(), this.unbindAll()
1423
- }
1424
- }
1425
- return i.prototype = n.instance, i
1426
- }), i(A, [u, g, w], function (e, t, n) {
1427
- return function () {
1428
- function i(e, t) {
1429
- if (!t.isDetached()) {
1430
- var i = this.connectRuntime(t.ruid).exec.call(this, "FileReaderSync", "read", e, t);
1431
- return this.disconnectRuntime(), i
1432
- }
1433
- var r = t.getSource();
1434
- switch (e) {
1435
- case "readAsBinaryString":
1436
- return r;
1437
- case "readAsDataURL":
1438
- return "data:" + t.type + ";base64," + n.btoa(r);
1439
- case "readAsText":
1440
- for (var o = "", a = 0, s = r.length; s > a; a++)
1441
- o += String.fromCharCode(r[a]);
1442
- return o
1443
- }
1444
- }
1445
- t.call(this), e.extend(this, {
1446
- uid: e.guid("uid_"),
1447
- readAsBinaryString: function (e) {
1448
- return i.call(this, "readAsBinaryString", e)
1449
- },
1450
- readAsDataURL: function (e) {
1451
- return i.call(this, "readAsDataURL", e)
1452
- },
1453
- readAsText: function (e) {
1454
- return i.call(this, "readAsText", e)
1455
- }
1456
- })
1457
- }
1458
- }), i(I, [f, u, y], function (e, t, n) {
1459
- function i() {
1460
- var e, i = [];
1461
- t.extend(this, {
1462
- append: function (r, o) {
1463
- var a = this,
1464
- s = t.typeOf(o);
1465
- o instanceof n ? e = {
1466
- name: r,
1467
- value: o
1468
- } : "array" === s ? (r += "[]", t.each(o, function (e) {
1469
- a.append(r, e)
1470
- })) : "object" === s ? t.each(o, function (e, t) {
1471
- a.append(r + "[" + t + "]", e)
1472
- }) : "null" === s || "undefined" === s || "number" === s && isNaN(o) ? a.append(r, "false") : i.push({
1473
- name: r,
1474
- value: o.toString()
1475
- })
1476
- },
1477
- hasBlob: function () {
1478
- return !!this.getBlob()
1479
- },
1480
- getBlob: function () {
1481
- return e && e.value || null
1482
- },
1483
- getBlobName: function () {
1484
- return e && e.name || null
1485
- },
1486
- each: function (n) {
1487
- t.each(i, function (e) {
1488
- n(e.value, e.name)
1489
- }), e && n(e.value, e.name)
1490
- },
1491
- destroy: function () {
1492
- e = null, i = []
1493
- }
1494
- })
1495
- }
1496
- return i
1497
- }), i(T, [u, f, p, w, x, m, R, y, A, I, c, d], function (e, t, n, i, r, o, a, s, u, c, l, d) {
1498
- function h() {
1499
- this.uid = e.guid("uid_")
1500
- }
1501
-
1502
- function f() {
1503
- function n(e, t) {
1504
- return w.hasOwnProperty(e) ? 1 === arguments.length ? l.can("define_property") ? w[e] : v[e] : void(l.can("define_property") ? w[e] = t : v[e] = t) : void 0
1505
- }
1506
-
1507
- function u(t) {
1508
- function i() {
1509
- B && (B.destroy(), B = null), s.dispatchEvent("loadend"), s = null
1510
- }
1511
-
1512
- function r(r) {
1513
- B.bind("LoadStart", function (e) {
1514
- n("readyState", f.LOADING), s.dispatchEvent("readystatechange"), s.dispatchEvent(e), O && s.upload.dispatchEvent(e)
1515
- }), B.bind("Progress", function (e) {
1516
- n("readyState") !== f.LOADING && (n("readyState", f.LOADING), s.dispatchEvent("readystatechange")), s.dispatchEvent(e)
1517
- }), B.bind("UploadProgress", function (e) {
1518
- O && s.upload.dispatchEvent({
1519
- type: "progress",
1520
- lengthComputable: !1,
1521
- total: e.total,
1522
- loaded: e.loaded
1523
- })
1524
- }), B.bind("Load", function (t) {
1525
- n("readyState", f.DONE), n("status", Number(r.exec.call(B, "XMLHttpRequest", "getStatus") || 0)), n("statusText", p[n("status")] || ""), n("response", r.exec.call(B, "XMLHttpRequest", "getResponse", n("responseType"))), ~e.inArray(n("responseType"), ["text", ""]) ? n("responseText", n("response")) : "document" === n("responseType") && n("responseXML", n("response")), k = r.exec.call(B, "XMLHttpRequest", "getAllResponseHeaders"), s.dispatchEvent("readystatechange"), n("status") > 0 ? (O && s.upload.dispatchEvent(t), s.dispatchEvent(t)) : (N = !0, s.dispatchEvent("error")), i()
1526
- }), B.bind("Abort", function (e) {
1527
- s.dispatchEvent(e), i()
1528
- }), B.bind("Error", function (e) {
1529
- N = !0, n("readyState", f.DONE), s.dispatchEvent("readystatechange"), D = !0, s.dispatchEvent(e), i()
1530
- }), r.exec.call(B, "XMLHttpRequest", "send", {
1531
- url: E,
1532
- method: _,
1533
- async: y,
1534
- user: x,
1535
- password: R,
1536
- headers: b,
1537
- mimeType: I,
1538
- encoding: A,
1539
- responseType: s.responseType,
1540
- withCredentials: s.withCredentials,
1541
- options: H
1542
- }, t)
1543
- }
1544
- var s = this;
1545
- C = (new Date).getTime(), B = new a, "string" == typeof H.required_caps && (H.required_caps = o.parseCaps(H.required_caps)), H.required_caps = e.extend({}, H.required_caps, {
1546
- return_response_type: s.responseType
1547
- }), t instanceof c && (H.required_caps.send_multipart = !0), e.isEmptyObj(b) || (H.required_caps.send_custom_headers = !0), L || (H.required_caps.do_cors = !0), H.ruid ? r(B.connectRuntime(H)) : (B.bind("RuntimeInit", function (e, t) {
1548
- r(t)
1549
- }), B.bind("RuntimeError", function (e, t) {
1550
- s.dispatchEvent("RuntimeError", t)
1551
- }), B.connectRuntime(H))
1552
- }
1553
-
1554
- function g() {
1555
- n("responseText", ""), n("responseXML", null), n("response", null), n("status", 0), n("statusText", ""), C = M = null
1556
- }
1557
- var v = this,
1558
- w = {
1559
- timeout: 0,
1560
- readyState: f.UNSENT,
1561
- withCredentials: !1,
1562
- status: 0,
1563
- statusText: "",
1564
- responseType: "",
1565
- responseXML: null,
1566
- responseText: null,
1567
- response: null
1568
- },
1569
- y = !0,
1570
- E, _, b = {},
1571
- x, R, A = null,
1572
- I = null,
1573
- T = !1,
1574
- S = !1,
1575
- O = !1,
1576
- D = !1,
1577
- N = !1,
1578
- L = !1,
1579
- C, M, F = null,
1580
- P = null,
1581
- H = {},
1582
- B, k = "",
1583
- U;
1584
- e.extend(this, w, {
1585
- uid: e.guid("uid_"),
1586
- upload: new h,
1587
- open: function (o, a, s, u, c) {
1588
- var l;
1589
- if (!o || !a)
1590
- throw new t.DOMException(t.DOMException.SYNTAX_ERR);
1591
- if (/[\u0100-\uffff]/.test(o) || i.utf8_encode(o) !== o)
1592
- throw new t.DOMException(t.DOMException.SYNTAX_ERR);
1593
- if (~e.inArray(o.toUpperCase(), ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT", "TRACE", "TRACK"]) && (_ = o.toUpperCase()), ~e.inArray(_, ["CONNECT", "TRACE", "TRACK"]))
1594
- throw new t.DOMException(t.DOMException.SECURITY_ERR);
1595
- if (a = i.utf8_encode(a), l = r.parseUrl(a), L = r.hasSameOrigin(l), E = r.resolveUrl(a), (u || c) && !L)
1596
- throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);
1597
- if (x = u || l.user, R = c || l.pass, y = s || !0, y === !1 && (n("timeout") || n("withCredentials") || "" !== n("responseType")))
1598
- throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);
1599
- T = !y, S = !1, b = {}, g.call(this), n("readyState", f.OPENED), this.dispatchEvent("readystatechange")
1600
- },
1601
- setRequestHeader: function (r, o) {
1602
- var a = ["accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "content-transfer-encoding", "date", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "user-agent", "via"];
1603
- if (n("readyState") !== f.OPENED || S)
1604
- throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
1605
- if (/[\u0100-\uffff]/.test(r) || i.utf8_encode(r) !== r)
1606
- throw new t.DOMException(t.DOMException.SYNTAX_ERR);
1607
- return r = e.trim(r).toLowerCase(), ~e.inArray(r, a) || /^(proxy\-|sec\-)/.test(r) ? !1 : (b[r] ? b[r] += ", " + o : b[r] = o, !0)
1608
- },
1609
- getAllResponseHeaders: function () {
1610
- return k || ""
1611
- },
1612
- getResponseHeader: function (t) {
1613
- return t = t.toLowerCase(), N || ~e.inArray(t, ["set-cookie", "set-cookie2"]) ? null : k && "" !== k && (U || (U = {}, e.each(k.split(/\r\n/), function (t) {
1614
- var n = t.split(/:\s+/);
1615
- 2 === n.length && (n[0] = e.trim(n[0]), U[n[0].toLowerCase()] = {
1616
- header: n[0],
1617
- value : e.trim(n[1])
1618
- })
1619
- })), U.hasOwnProperty(t)) ? U[t].header + ": " + U[t].value : null
1620
- },
1621
- overrideMimeType: function (i) {
1622
- var r, o;
1623
- if (~e.inArray(n("readyState"), [f.LOADING, f.DONE]))
1624
- throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
1625
- if (i = e.trim(i.toLowerCase()), /;/.test(i) && (r = i.match(/^([^;]+)(?:;\scharset\=)?(.*)$/)) && (i = r[1], r[2] && (o = r[2])), !d.mimes[i])
1626
- throw new t.DOMException(t.DOMException.SYNTAX_ERR);
1627
- F = i, P = o
1628
- },
1629
- send: function (n, r) {
1630
- if (H = "string" === e.typeOf(r) ? {
1631
- ruid: r
1632
- } : r ? r : {}, this.readyState !== f.OPENED || S)
1633
- throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
1634
- if (n instanceof s)
1635
- H.ruid = n.ruid, I = n.type || "application/octet-stream";
1636
- else if (n instanceof c) {
1637
- if (n.hasBlob()) {
1638
- var o = n.getBlob();
1639
- H.ruid = o.ruid, I = o.type || "application/octet-stream"
1640
- }
1641
- } else
1642
- "string" == typeof n && (A = "UTF-8", I = "text/plain;charset=UTF-8", n = i.utf8_encode(n));
1643
- this.withCredentials || (this.withCredentials = H.required_caps && H.required_caps.send_browser_cookies && !L), O = !T && this.upload.hasEventListener(), N = !1, D = !n, T || (S = !0), u.call(this, n)
1644
- },
1645
- abort: function () {
1646
- if (N = !0, T = !1, ~e.inArray(n("readyState"), [f.UNSENT, f.OPENED, f.DONE]))
1647
- n("readyState", f.UNSENT);
1648
- else {
1649
- if (n("readyState", f.DONE), S = !1, !B)
1650
- throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
1651
- B.getRuntime().exec.call(B, "XMLHttpRequest", "abort", D), D = !0
1652
- }
1653
- },
1654
- destroy: function () {
1655
- B && ("function" === e.typeOf(B.destroy) && B.destroy(), B = null), this.unbindAll(), this.upload && (this.upload.unbindAll(), this.upload = null)
1656
- }
1657
- }), this.handleEventProps(m.concat(["readystatechange"])), this.upload.handleEventProps(m)
1658
- }
1659
- var p = {
1660
- 100: "Continue",
1661
- 101: "Switching Protocols",
1662
- 102: "Processing",
1663
- 200: "OK",
1664
- 201: "Created",
1665
- 202: "Accepted",
1666
- 203: "Non-Authoritative Information",
1667
- 204: "No Content",
1668
- 205: "Reset Content",
1669
- 206: "Partial Content",
1670
- 207: "Multi-Status",
1671
- 226: "IM Used",
1672
- 300: "Multiple Choices",
1673
- 301: "Moved Permanently",
1674
- 302: "Found",
1675
- 303: "See Other",
1676
- 304: "Not Modified",
1677
- 305: "Use Proxy",
1678
- 306: "Reserved",
1679
- 307: "Temporary Redirect",
1680
- 400: "Bad Request",
1681
- 401: "Unauthorized",
1682
- 402: "Payment Required",
1683
- 403: "Forbidden",
1684
- 404: "Not Found",
1685
- 405: "Method Not Allowed",
1686
- 406: "Not Acceptable",
1687
- 407: "Proxy Authentication Required",
1688
- 408: "Request Timeout",
1689
- 409: "Conflict",
1690
- 410: "Gone",
1691
- 411: "Length Required",
1692
- 412: "Precondition Failed",
1693
- 413: "Request Entity Too Large",
1694
- 414: "Request-URI Too Long",
1695
- 415: "Unsupported Media Type",
1696
- 416: "Requested Range Not Satisfiable",
1697
- 417: "Expectation Failed",
1698
- 422: "Unprocessable Entity",
1699
- 423: "Locked",
1700
- 424: "Failed Dependency",
1701
- 426: "Upgrade Required",
1702
- 500: "Internal Server Error",
1703
- 501: "Not Implemented",
1704
- 502: "Bad Gateway",
1705
- 503: "Service Unavailable",
1706
- 504: "Gateway Timeout",
1707
- 505: "HTTP Version Not Supported",
1708
- 506: "Variant Also Negotiates",
1709
- 507: "Insufficient Storage",
1710
- 510: "Not Extended"
1711
- };
1712
- h.prototype = n.instance;
1713
- var m = ["loadstart", "progress", "abort", "error", "load", "timeout", "loadend"],
1714
- g = 1,
1715
- v = 2;
1716
- return f.UNSENT = 0, f.OPENED = 1, f.HEADERS_RECEIVED = 2, f.LOADING = 3, f.DONE = 4, f.prototype = n.instance, f
1717
- }), i(S, [u, w, g, p], function (e, t, n, i) {
1718
- function r() {
1719
- function i() {
1720
- l = d = 0, c = this.result = null
1721
- }
1722
-
1723
- function o(t, n) {
1724
- var i = this;
1725
- u = n, i.bind("TransportingProgress", function (t) {
1726
- d = t.loaded, l > d && -1 === e.inArray(i.state, [r.IDLE, r.DONE]) && a.call(i)
1727
- }, 999), i.bind("TransportingComplete", function () {
1728
- d = l, i.state = r.DONE, c = null, i.result = u.exec.call(i, "Transporter", "getAsBlob", t || "")
1729
- }, 999), i.state = r.BUSY, i.trigger("TransportingStarted"), a.call(i)
1730
- }
1731
-
1732
- function a() {
1733
- var e = this,
1734
- n, i = l - d;
1735
- h > i && (h = i), n = t.btoa(c.substr(d, h)), u.exec.call(e, "Transporter", "receive", n, l)
1736
- }
1737
- var s, u, c, l, d, h;
1738
- n.call(this), e.extend(this, {
1739
- uid: e.guid("uid_"),
1740
- state: r.IDLE,
1741
- result: null,
1742
- transport: function (t, n, r) {
1743
- var a = this;
1744
- if (r = e.extend({
1745
- chunk_size: 204798
1746
- }, r), (s = r.chunk_size % 3) && (r.chunk_size += 3 - s), h = r.chunk_size, i.call(this), c = t, l = t.length, "string" === e.typeOf(r) || r.ruid)
1747
- o.call(a, n, this.connectRuntime(r));
1748
- else {
1749
- var u = function (e, t) {
1750
- a.unbind("RuntimeInit", u), o.call(a, n, t)
1751
- };
1752
- this.bind("RuntimeInit", u), this.connectRuntime(r)
1753
- }
1754
- },
1755
- abort: function () {
1756
- var e = this;
1757
- e.state = r.IDLE, u && (u.exec.call(e, "Transporter", "clear"), e.trigger("TransportingAborted")), i.call(e)
1758
- },
1759
- destroy: function () {
1760
- this.unbindAll(), u = null, this.disconnectRuntime(), i.call(this)
1761
- }
1762
- })
1763
- }
1764
- return r.IDLE = 0, r.BUSY = 1, r.DONE = 2, r.prototype = i.instance, r
1765
- }), i(O, [u, h, f, A, T, m, g, S, c, p, y, E, w], function (e, t, n, i, r, o, a, s, u, c, l, d, h) {
1766
- function f() {
1767
- function i(e) {
1768
- e || (e = this.exec("Image", "getInfo")), this.size = e.size, this.width = e.width, this.height = e.height, this.type = e.type, this.meta = e.meta, "" === this.name && (this.name = e.name)
1769
- }
1770
-
1771
- function c(t) {
1772
- var i = e.typeOf(t);
1773
- try {
1774
- if (t instanceof f) {
1775
- if (!t.size)
1776
- throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);
1777
- m.apply(this, arguments)
1778
- } else if (t instanceof l) {
1779
- if (!~e.inArray(t.type, ["image/jpeg", "image/png"]))
1780
- throw new n.ImageError(n.ImageError.WRONG_FORMAT);
1781
- g.apply(this, arguments)
1782
- } else if (-1 !== e.inArray(i, ["blob", "file"]))
1783
- c.call(this, new d(null, t), arguments[1]);
1784
- else if ("string" === i)
1785
- "data:" === t.substr(0, 5) ? c.call(this, new l(null, {
1786
- data: t
1787
- }), arguments[1]) : v.apply(this, arguments);
1788
- else {
1789
- if ("node" !== i || "img" !== t.nodeName.toLowerCase())
1790
- throw new n.DOMException(n.DOMException.TYPE_MISMATCH_ERR);
1791
- c.call(this, t.src, arguments[1])
1792
- }
1793
- } catch (r) {
1794
- this.trigger("error", r.code)
1795
- }
1796
- }
1797
-
1798
- function m(t, n) {
1799
- var i = this.connectRuntime(t.ruid);
1800
- this.ruid = i.uid, i.exec.call(this, "Image", "loadFromImage", t, "undefined" === e.typeOf(n) ? !0 : n)
1801
- }
1802
-
1803
- function g(t, n) {
1804
- function i(e) {
1805
- r.ruid = e.uid, e.exec.call(r, "Image", "loadFromBlob", t)
1806
- }
1807
- var r = this;
1808
- r.name = t.name || "", t.isDetached() ? (this.bind("RuntimeInit", function (e, t) {
1809
- i(t)
1810
- }), n && "string" == typeof n.required_caps && (n.required_caps = o.parseCaps(n.required_caps)), this.connectRuntime(e.extend({
1811
- required_caps: {
1812
- access_image_binary: !0,
1813
- resize_image: !0
1814
- }
1815
- }, n))) : i(this.connectRuntime(t.ruid))
1816
- }
1817
-
1818
- function v(e, t) {
1819
- var n = this,
1820
- i;
1821
- i = new r, i.open("get", e), i.responseType = "blob", i.onprogress = function (e) {
1822
- n.trigger(e)
1823
- }, i.onload = function () {
1824
- g.call(n, i.response, !0)
1825
- }, i.onerror = function (e) {
1826
- n.trigger(e)
1827
- }, i.onloadend = function () {
1828
- i.destroy()
1829
- }, i.bind("RuntimeError", function (e, t) {
1830
- n.trigger("RuntimeError", t)
1831
- }), i.send(null, t)
1832
- }
1833
- a.call(this), e.extend(this, {
1834
- uid: e.guid("uid_"),
1835
- ruid: null,
1836
- name: "",
1837
- size: 0,
1838
- width: 0,
1839
- height: 0,
1840
- type: "",
1841
- meta: {},
1842
- clone: function () {
1843
- this.load.apply(this, arguments)
1844
- },
1845
- load: function () {
1846
- c.apply(this, arguments)
1847
- },
1848
- downsize: function (t) {
1849
- var i = {
1850
- width: this.width,
1851
- height: this.height,
1852
- type: this.type || "image/jpeg",
1853
- quality: 90,
1854
- crop: !1,
1855
- preserveHeaders: !0,
1856
- resample: !1
1857
- };
1858
- t = "object" == typeof t ? e.extend(i, t) : e.extend(i, {
1859
- width: arguments[0],
1860
- height: arguments[1],
1861
- crop: arguments[2],
1862
- preserveHeaders: arguments[3]
1863
- });
1864
- try {
1865
- if (!this.size)
1866
- throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);
1867
- if (this.width > f.MAX_RESIZE_WIDTH || this.height > f.MAX_RESIZE_HEIGHT)
1868
- throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);
1869
- this.exec("Image", "downsize", t.width, t.height, t.crop, t.preserveHeaders)
1870
- } catch (r) {
1871
- this.trigger("error", r.code)
1872
- }
1873
- },
1874
- crop: function (e, t, n) {
1875
- this.downsize(e, t, !0, n)
1876
- },
1877
- getAsCanvas: function () {
1878
- if (!u.can("create_canvas"))
1879
- throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);
1880
- var e = this.connectRuntime(this.ruid);
1881
- return e.exec.call(this, "Image", "getAsCanvas")
1882
- },
1883
- getAsBlob: function (e, t) {
1884
- if (!this.size)
1885
- throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);
1886
- return this.exec("Image", "getAsBlob", e || "image/jpeg", t || 90)
1887
- },
1888
- getAsDataURL: function (e, t) {
1889
- if (!this.size)
1890
- throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);
1891
- return this.exec("Image", "getAsDataURL", e || "image/jpeg", t || 90)
1892
- },
1893
- getAsBinaryString: function (e, t) {
1894
- var n = this.getAsDataURL(e, t);
1895
- return h.atob(n.substring(n.indexOf("base64,") + 7))
1896
- },
1897
- embed: function (i, r) {
1898
- function o(t, r) {
1899
- var o = this;
1900
- if (u.can("create_canvas")) {
1901
- var l = o.getAsCanvas();
1902
- if (l)
1903
- return i.appendChild(l), l = null, o.destroy(), void a.trigger("embedded")
1904
- }
1905
- var d = o.getAsDataURL(t, r);
1906
- if (!d)
1907
- throw new n.ImageError(n.ImageError.WRONG_FORMAT);
1908
- if (u.can("use_data_uri_of", d.length))
1909
- i.innerHTML = '<img src="' + d + '" width="' + o.width + '" height="' + o.height + '" />', o.destroy(), a.trigger("embedded");
1910
- else {
1911
- var f = new s;
1912
- f.bind("TransportingComplete", function () {
1913
- c = a.connectRuntime(this.result.ruid), a.bind("Embedded", function () {
1914
- e.extend(c.getShimContainer().style, {
1915
- top: "0px",
1916
- left: "0px",
1917
- width: o.width + "px",
1918
- height: o.height + "px"
1919
- }), c = null
1920
- }, 999), c.exec.call(a, "ImageView", "display", this.result.uid, width, height), o.destroy()
1921
- }), f.transport(h.atob(d.substring(d.indexOf("base64,") + 7)), t, {
1922
- required_caps: {
1923
- display_media: !0
1924
- },
1925
- runtime_order: "flash,silverlight",
1926
- container: i
1927
- })
1928
- }
1929
- }
1930
- var a = this,
1931
- c;
1932
- r = e.extend({
1933
- width: this.width,
1934
- height: this.height,
1935
- type: this.type || "image/jpeg",
1936
- quality: 90
1937
- }, r || {});
1938
- try {
1939
- if (!(i = t.get(i)))
1940
- throw new n.DOMException(n.DOMException.INVALID_NODE_TYPE_ERR);
1941
- if (!this.size)
1942
- throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);
1943
- this.width > f.MAX_RESIZE_WIDTH || this.height > f.MAX_RESIZE_HEIGHT;
1944
- var l = new f;
1945
- return l.bind("Resize", function () {
1946
- o.call(this, r.type, r.quality)
1947
- }), l.bind("Load", function () {
1948
- l.downsize(r)
1949
- }), this.meta.thumb && this.meta.thumb.width >= r.width && this.meta.thumb.height >= r.height ? l.load(this.meta.thumb.data) : l.clone(this, !1), l
1950
- } catch (d) {
1951
- this.trigger("error", d.code)
1952
- }
1953
- },
1954
- destroy: function () {
1955
- this.ruid && (this.getRuntime().exec.call(this, "Image", "destroy"), this.disconnectRuntime()), this.unbindAll()
1956
- }
1957
- }), this.handleEventProps(p), this.bind("Load Resize", function () {
1958
- i.call(this)
1959
- }, 999)
1960
- }
1961
- var p = ["progress", "load", "error", "resize", "embedded"];
1962
- return f.MAX_RESIZE_WIDTH = 8192, f.MAX_RESIZE_HEIGHT = 8192, f.prototype = c.instance, f
1963
- }), i(D, [u, f, m, c], function (e, t, n, i) {
1964
- function r(t) {
1965
- var r = this,
1966
- s = n.capTest,
1967
- u = n.capTrue,
1968
- c = e.extend({
1969
- access_binary: s(window.FileReader || window.File && window.File.getAsDataURL),
1970
- access_image_binary: function () {
1971
- return r.can("access_binary") && !!a.Image
1972
- },
1973
- display_media: s(i.can("create_canvas") || i.can("use_data_uri_over32kb")),
1974
- do_cors: s(window.XMLHttpRequest && "withCredentials" in new XMLHttpRequest),
1975
- drag_and_drop: s(function () {
1976
- var e = document.createElement("div");
1977
- return ("draggable" in e || "ondragstart" in e && "ondrop" in e) && ("IE" !== i.browser || i.verComp(i.version, 9, ">"))
1978
- }()),
1979
- filter_by_extension: s(function () {
1980
- return "Chrome" === i.browser && i.verComp(i.version, 28, ">=") || "IE" === i.browser && i.verComp(i.version, 10, ">=") || "Safari" === i.browser && i.verComp(i.version, 7, ">=")
1981
- }()),
1982
- return_response_headers: u,
1983
- return_response_type: function (e) {
1984
- return "json" === e && window.JSON ? !0 : i.can("return_response_type", e)
1985
- },
1986
- return_status_code: u,
1987
- report_upload_progress: s(window.XMLHttpRequest && (new XMLHttpRequest).upload),
1988
- resize_image: function () {
1989
- return r.can("access_binary") && i.can("create_canvas")
1990
- },
1991
- select_file: function () {
1992
- return i.can("use_fileinput") && window.File
1993
- },
1994
- select_folder: function () {
1995
- return r.can("select_file") && "Chrome" === i.browser && i.verComp(i.version, 21, ">=")
1996
- },
1997
- select_multiple: function () {
1998
- return !(!r.can("select_file") || "Safari" === i.browser && "Windows" === i.os || "iOS" === i.os && i.verComp(i.osVersion, "7.0.0", ">") && i.verComp(i.osVersion, "8.0.0", "<"))
1999
- },
2000
- send_binary_string: s(window.XMLHttpRequest && ((new XMLHttpRequest).sendAsBinary || window.Uint8Array && window.ArrayBuffer)),
2001
- send_custom_headers: s(window.XMLHttpRequest),
2002
- send_multipart: function () {
2003
- return !!(window.XMLHttpRequest && (new XMLHttpRequest).upload && window.FormData) || r.can("send_binary_string")
2004
- },
2005
- slice_blob: s(window.File && (File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice)),
2006
- stream_upload: function () {
2007
- return r.can("slice_blob") && r.can("send_multipart")
2008
- },
2009
- summon_file_dialog: function () {
2010
- return r.can("select_file") && ("Firefox" === i.browser && i.verComp(i.version, 4, ">=") || "Opera" === i.browser && i.verComp(i.version, 12, ">=") || "IE" === i.browser && i.verComp(i.version, 10, ">=") || !!~e.inArray(i.browser, ["Chrome", "Safari"]))
2011
- },
2012
- upload_filesize: u
2013
- }, arguments[2]);
2014
- n.call(this, t, arguments[1] || o, c), e.extend(this, {
2015
- init: function () {
2016
- this.trigger("Init")
2017
- },
2018
- destroy: function (e) {
2019
- return function () {
2020
- e.call(r), e = r = null
2021
- }
2022
- }(this.destroy)
2023
- }), e.extend(this.getShim(), a)
2024
- }
2025
- var o = "html5",
2026
- a = {};
2027
- return n.addConstructor(o, r), a
2028
- }), i(N, [u], function (e) {
2029
- function t() {
2030
- this.returnValue = !1
2031
- }
2032
-
2033
- function n() {
2034
- this.cancelBubble = !0
2035
- }
2036
- var i = {},
2037
- r = "moxie_" + e.guid(),
2038
- o = function (o, a, s, u) {
2039
- var c, l;
2040
- a = a.toLowerCase(), o.addEventListener ? (c = s, o.addEventListener(a, c, !1)) : o.attachEvent && (c = function () {
2041
- var e = window.event;
2042
- e.target || (e.target = e.srcElement), e.preventDefault = t, e.stopPropagation = n, s(e)
2043
- }, o.attachEvent("on" + a, c)), o[r] || (o[r] = e.guid()), i.hasOwnProperty(o[r]) || (i[o[r]] = {}), l = i[o[r]], l.hasOwnProperty(a) || (l[a] = []), l[a].push({
2044
- func: c,
2045
- orig: s,
2046
- key: u
2047
- })
2048
- },
2049
- a = function (t, n, o) {
2050
- var a, s;
2051
- if (n = n.toLowerCase(), t[r] && i[t[r]] && i[t[r]][n]) {
2052
- a = i[t[r]][n];
2053
- for (var u = a.length - 1; u >= 0 && (a[u].orig !== o && a[u].key !== o || (t.removeEventListener ? t.removeEventListener(n, a[u].func, !1) : t.detachEvent && t.detachEvent("on" + n, a[u].func), a[u].orig = null, a[u].func = null, a.splice(u, 1), o === s)); u--)
2054
- ;
2055
- if (a.length || delete i[t[r]][n], e.isEmptyObj(i[t[r]])) {
2056
- delete i[t[r]];
2057
- try {
2058
- delete t[r]
2059
- } catch (c) {
2060
- t[r] = s
2061
- }
2062
- }
2063
- }
2064
- },
2065
- s = function (t, n) {
2066
- t && t[r] && e.each(i[t[r]], function (e, i) {
2067
- a(t, i, n)
2068
- })
2069
- };
2070
- return {
2071
- addEvent: o,
2072
- removeEvent: a,
2073
- removeAllEvents: s
2074
- }
2075
- }), i(L, [D, E, u, h, N, d, c], function (e, t, n, i, r, o, a) {
2076
- function s() {
2077
- var e;
2078
- n.extend(this, {
2079
- init: function (s) {
2080
- var u = this,
2081
- c = u.getRuntime(),
2082
- l, d, h, f, p, m;
2083
- e = s, h = e.accept.mimes || o.extList2mimes(e.accept, c.can("filter_by_extension")), d = c.getShimContainer(), d.innerHTML = '<input id="' + c.uid + '" type="file" style="font-size:999px;opacity:0;"' + (e.multiple && c.can("select_multiple") ? "multiple" : "") + (e.directory && c.can("select_folder") ? "webkitdirectory directory" : "") + (h ? ' accept="' + h.join(",") + '"' : "") + " />", l = i.get(c.uid), n.extend(l.style, {
2084
- position: "absolute",
2085
- top: 0,
2086
- left: 0,
2087
- width: "100%",
2088
- height: "100%"
2089
- }), f = i.get(e.browse_button), c.can("summon_file_dialog") && ("static" === i.getStyle(f, "position") && (f.style.position = "relative"), p = parseInt(i.getStyle(f, "z-index"), 10) || 1, f.style.zIndex = p, d.style.zIndex = p - 1, r.addEvent(f, "click", function (e) {
2090
- var t = i.get(c.uid);
2091
- t && !t.disabled && t.click(), e.preventDefault()
2092
- }, u.uid)), m = c.can("summon_file_dialog") ? f : d, r.addEvent(m, "mouseover", function () {
2093
- u.trigger("mouseenter")
2094
- }, u.uid), r.addEvent(m, "mouseout", function () {
2095
- u.trigger("mouseleave")
2096
- }, u.uid), r.addEvent(m, "mousedown", function () {
2097
- u.trigger("mousedown")
2098
- }, u.uid), r.addEvent(i.get(e.container), "mouseup", function () {
2099
- u.trigger("mouseup")
2100
- }, u.uid), l.onchange = function g(i) {
2101
- if (u.files = [], n.each(this.files, function (n) {
2102
- var i = "";
2103
- return e.directory && "." == n.name ? !0 : (n.webkitRelativePath && (i = "/" + n.webkitRelativePath.replace(/^\//, "")), n = new t(c.uid, n), n.relativePath = i, void u.files.push(n))
2104
- }), "IE" !== a.browser && "IEMobile" !== a.browser)
2105
- this.value = "";
2106
- else {
2107
- var r = this.cloneNode(!0);
2108
- this.parentNode.replaceChild(r, this), r.onchange = g
2109
- }
2110
- u.files.length && u.trigger("change")
2111
- }, u.trigger({
2112
- type: "ready",
2113
- async: !0
2114
- }), d = null
2115
- },
2116
- disable: function (e) {
2117
- var t = this.getRuntime(),
2118
- n;
2119
- (n = i.get(t.uid)) && (n.disabled = !!e)
2120
- },
2121
- destroy: function () {
2122
- var t = this.getRuntime(),
2123
- n = t.getShim(),
2124
- o = t.getShimContainer();
2125
- r.removeAllEvents(o, this.uid), r.removeAllEvents(e && i.get(e.container), this.uid), r.removeAllEvents(e && i.get(e.browse_button), this.uid), o && (o.innerHTML = ""), n.removeInstance(this.uid), e = o = n = null
2126
- }
2127
- })
2128
- }
2129
- return e.FileInput = s
2130
- }), i(C, [D, y], function (e, t) {
2131
- function n() {
2132
- function e(e, t, n) {
2133
- var i;
2134
- if (!window.File.prototype.slice)
2135
- return (i = window.File.prototype.webkitSlice || window.File.prototype.mozSlice) ? i.call(e, t, n) : null;
2136
- try {
2137
- return e.slice(), e.slice(t, n)
2138
- } catch (r) {
2139
- return e.slice(t, n - t)
2140
- }
2141
- }
2142
- this.slice = function () {
2143
- return new t(this.getRuntime().uid, e.apply(this, arguments))
2144
- }
2145
- }
2146
- return e.Blob = n
2147
- }), i(M, [D, E, u, h, N, d], function (e, t, n, i, r, o) {
2148
- function a() {
2149
- function e(e) {
2150
- if (!e.dataTransfer || !e.dataTransfer.types)
2151
- return !1;
2152
- var t = n.toArray(e.dataTransfer.types || []);
2153
- return -1 !== n.inArray("Files", t) || -1 !== n.inArray("public.file-url", t) || -1 !== n.inArray("application/x-moz-file", t)
2154
- }
2155
-
2156
- function a(e, n) {
2157
- if (u(e)) {
2158
- var i = new t(g, e);
2159
- i.relativePath = n || "", f.push(i)
2160
- }
2161
- }
2162
-
2163
- function s(e) {
2164
- for (var t = [], i = 0; i < e.length; i++)
2165
- [].push.apply(t, e[i].extensions.split(/\s*,\s*/));
2166
- return -1 === n.inArray("*", t) ? t : []
2167
- }
2168
-
2169
- function u(e) {
2170
- if (!p.length)
2171
- return !0;
2172
- var t = o.getFileExtension(e.name);
2173
- return !t || -1 !== n.inArray(t, p)
2174
- }
2175
-
2176
- function c(e, t) {
2177
- var i = [];
2178
- n.each(e, function (e) {
2179
- var t = e.webkitGetAsEntry();
2180
- t && (t.isFile ? a(e.getAsFile(), t.fullPath) : i.push(t))
2181
- }), i.length ? l(i, t) : t()
2182
- }
2183
-
2184
- function l(e, t) {
2185
- var i = [];
2186
- n.each(e, function (e) {
2187
- i.push(function (t) {
2188
- d(e, t)
2189
- })
2190
- }), n.inSeries(i, function () {
2191
- t()
2192
- })
2193
- }
2194
-
2195
- function d(e, t) {
2196
- e.isFile ? e.file(function (n) {
2197
- a(n, e.fullPath), t()
2198
- }, function () {
2199
- t()
2200
- }) : e.isDirectory ? h(e, t) : t()
2201
- }
2202
-
2203
- function h(e, t) {
2204
- function n(e) {
2205
- r.readEntries(function (t) {
2206
- t.length ? ([].push.apply(i, t), n(e)) : e()
2207
- }, e)
2208
- }
2209
- var i = [],
2210
- r = e.createReader();
2211
- n(function () {
2212
- l(i, t)
2213
- })
2214
- }
2215
- var f = [],
2216
- p = [],
2217
- m, g;
2218
- n.extend(this, {
2219
- init: function (t) {
2220
- var i = this,
2221
- o;
2222
- m = t, g = i.ruid, p = s(m.accept), o = m.container, r.addEvent(o, "dragover", function (t) {
2223
- e(t) && (t.preventDefault(), t.dataTransfer.dropEffect = "copy")
2224
- }, i.uid), r.addEvent(o, "drop", function (t) {
2225
- e(t) && (t.preventDefault(), f = [], t.dataTransfer.items && t.dataTransfer.items[0].webkitGetAsEntry ? c(t.dataTransfer.items, function () {
2226
- i.files = f, i.trigger("drop")
2227
- }) : (n.each(t.dataTransfer.files, function (e) {
2228
- a(e)
2229
- }), i.files = f, i.trigger("drop")))
2230
- }, i.uid), r.addEvent(o, "dragenter", function (e) {
2231
- i.trigger("dragenter")
2232
- }, i.uid), r.addEvent(o, "dragleave", function (e) {
2233
- i.trigger("dragleave")
2234
- }, i.uid)
2235
- },
2236
- destroy: function () {
2237
- r.removeAllEvents(m && i.get(m.container), this.uid), g = f = p = m = null
2238
- }
2239
- })
2240
- }
2241
- return e.FileDrop = a
2242
- }), i(F, [D, w, u], function (e, t, n) {
2243
- function i() {
2244
- function e(e) {
2245
- return t.atob(e.substring(e.indexOf("base64,") + 7))
2246
- }
2247
- var i, r = !1;
2248
- n.extend(this, {
2249
- read: function (t, o) {
2250
- var a = this;
2251
- a.result = "", i = new window.FileReader, i.addEventListener("progress", function (e) {
2252
- a.trigger(e)
2253
- }), i.addEventListener("load", function (t) {
2254
- a.result = r ? e(i.result) : i.result, a.trigger(t)
2255
- }), i.addEventListener("error", function (e) {
2256
- a.trigger(e, i.error)
2257
- }), i.addEventListener("loadend", function (e) {
2258
- i = null, a.trigger(e)
2259
- }), "function" === n.typeOf(i[t]) ? (r = !1, i[t](o.getSource())) : "readAsBinaryString" === t && (r = !0, i.readAsDataURL(o.getSource()))
2260
- },
2261
- abort: function () {
2262
- i && i.abort()
2263
- },
2264
- destroy: function () {
2265
- i = null
2266
- }
2267
- })
2268
- }
2269
- return e.FileReader = i
2270
- }), i(P, [D, u, d, x, E, y, I, f, c], function (e, t, n, i, r, o, a, s, u) {
2271
- function c() {
2272
- function e(e, t) {
2273
- var n = this,
2274
- i, r;
2275
- i = t.getBlob().getSource(), r = new window.FileReader, r.onload = function () {
2276
- t.append(t.getBlobName(), new o(null, {
2277
- type: i.type,
2278
- data: r.result
2279
- })), h.send.call(n, e, t)
2280
- }, r.readAsBinaryString(i)
2281
- }
2282
-
2283
- function c() {
2284
- return !window.XMLHttpRequest || "IE" === u.browser && u.verComp(u.version, 8, "<") ? function () {
2285
- for (var e = ["Msxml2.XMLHTTP.6.0", "Microsoft.XMLHTTP"], t = 0; t < e.length; t++)
2286
- try {
2287
- return new ActiveXObject(e[t])
2288
- } catch (n) {
2289
- }
2290
- }() : new window.XMLHttpRequest
2291
- }
2292
-
2293
- function l(e) {
2294
- var t = e.responseXML,
2295
- n = e.responseText;
2296
- return "IE" === u.browser && n && t && !t.documentElement && /[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader("Content-Type")) && (t = new window.ActiveXObject("Microsoft.XMLDOM"), t.async = !1, t.validateOnParse = !1, t.loadXML(n)), t && ("IE" === u.browser && 0 !== t.parseError || !t.documentElement || "parsererror" === t.documentElement.tagName) ? null : t
2297
- }
2298
-
2299
- function d(e) {
2300
- var t = "----moxieboundary" + (new Date).getTime(),
2301
- n = "--",
2302
- i = "\r\n",
2303
- r = "",
2304
- a = this.getRuntime();
2305
- if (!a.can("send_binary_string"))
2306
- throw new s.RuntimeError(s.RuntimeError.NOT_SUPPORTED_ERR);
2307
- return f.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + t), e.each(function (e, a) {
2308
- r += e instanceof o ? n + t + i + 'Content-Disposition: form-data; name="' + a + '"; filename="' + unescape(encodeURIComponent(e.name || "blob")) + '"' + i + "Content-Type: " + (e.type || "application/octet-stream") + i + i + e.getSource() + i : n + t + i + 'Content-Disposition: form-data; name="' + a + '"' + i + i + unescape(encodeURIComponent(e)) + i
2309
- }), r += n + t + n + i
2310
- }
2311
- var h = this,
2312
- f, p;
2313
- t.extend(this, {
2314
- send: function (n, r) {
2315
- var s = this,
2316
- l = "Mozilla" === u.browser && u.verComp(u.version, 4, ">=") && u.verComp(u.version, 7, "<"),
2317
- h = "Android Browser" === u.browser,
2318
- m = !1;
2319
- if (p = n.url.replace(/^.+?\/([\w\-\.]+)$/, "$1").toLowerCase(), f = c(), f.open(n.method, n.url, n.async, n.user, n.password), r instanceof o)
2320
- r.isDetached() && (m = !0), r = r.getSource();
2321
- else if (r instanceof a) {
2322
- if (r.hasBlob())
2323
- if (r.getBlob().isDetached())
2324
- r = d.call(s, r), m = !0;
2325
- else if ((l || h) && "blob" === t.typeOf(r.getBlob().getSource()) && window.FileReader)
2326
- return void e.call(s, n, r);
2327
- if (r instanceof a) {
2328
- var g = new window.FormData;
2329
- r.each(function (e, t) {
2330
- e instanceof o ? g.append(t, e.getSource()) : g.append(t, e)
2331
- }), r = g
2332
- }
2333
- }
2334
- f.upload ? (n.withCredentials && (f.withCredentials = !0), f.addEventListener("load", function (e) {
2335
- s.trigger(e)
2336
- }), f.addEventListener("error", function (e) {
2337
- s.trigger(e)
2338
- }), f.addEventListener("progress", function (e) {
2339
- s.trigger(e)
2340
- }), f.upload.addEventListener("progress", function (e) {
2341
- s.trigger({
2342
- type: "UploadProgress",
2343
- loaded: e.loaded,
2344
- total: e.total
2345
- })
2346
- })) : f.onreadystatechange = function v() {
2347
- switch (f.readyState) {
2348
- case 1:
2349
- break;
2350
- case 2:
2351
- break;
2352
- case 3:
2353
- var e, t;
2354
- try {
2355
- i.hasSameOrigin(n.url) && (e = f.getResponseHeader("Content-Length") || 0), f.responseText && (t = f.responseText.length)
2356
- } catch (r) {
2357
- e = t = 0
2358
- }
2359
- s.trigger({
2360
- type: "progress",
2361
- lengthComputable: !!e,
2362
- total: parseInt(e, 10),
2363
- loaded: t
2364
- });
2365
- break;
2366
- case 4:
2367
- f.onreadystatechange = function () {}, s.trigger(0 === f.status ? "error" : "load")
2368
- }
2369
- }, t.isEmptyObj(n.headers) || t.each(n.headers, function (e, t) {
2370
- f.setRequestHeader(t, e)
2371
- }), "" !== n.responseType && "responseType" in f && ("json" !== n.responseType || u.can("return_response_type", "json") ? f.responseType = n.responseType : f.responseType = "text"), m ? f.sendAsBinary ? f.sendAsBinary(r) : !function () {
2372
- for (var e = new Uint8Array(r.length), t = 0; t < r.length; t++)
2373
- e[t] = 255 & r.charCodeAt(t);
2374
- f.send(e.buffer)
2375
- }() : f.send(r), s.trigger("loadstart")
2376
- },
2377
- getStatus: function () {
2378
- try {
2379
- if (f)
2380
- return f.status
2381
- } catch (e) {
2382
- }
2383
- return 0
2384
- },
2385
- getResponse: function (e) {
2386
- var t = this.getRuntime();
2387
- try {
2388
- switch (e) {
2389
- case "blob":
2390
- var i = new r(t.uid, f.response),
2391
- o = f.getResponseHeader("Content-Disposition");
2392
- if (o) {
2393
- var a = o.match(/filename=([\'\"'])([^\1]+)\1/);
2394
- a && (p = a[2])
2395
- }
2396
- return i.name = p, i.type || (i.type = n.getFileMime(p)), i;
2397
- case "json":
2398
- return u.can("return_response_type", "json") ? f.response : 200 === f.status && window.JSON ? JSON.parse(f.responseText) : null;
2399
- case "document":
2400
- return l(f);
2401
- default:
2402
- return "" !== f.responseText ? f.responseText : null
2403
- }
2404
- } catch (s) {
2405
- return null
2406
- }
2407
- },
2408
- getAllResponseHeaders: function () {
2409
- try {
2410
- return f.getAllResponseHeaders()
2411
- } catch (e) {
2412
- }
2413
- return ""
2414
- },
2415
- abort: function () {
2416
- f && f.abort()
2417
- },
2418
- destroy: function () {
2419
- h = p = null
2420
- }
2421
- })
2422
- }
2423
- return e.XMLHttpRequest = c
2424
- }), i(H, [u], function (e) {
2425
- function t(e) {
2426
- e instanceof ArrayBuffer ? n.apply(this, arguments) : i.apply(this, arguments)
2427
- }
2428
-
2429
- function n(t) {
2430
- var n = new DataView(t);
2431
- e.extend(this, {
2432
- readByteAt: function (e) {
2433
- return n.getUint8(e)
2434
- },
2435
- writeByteAt: function (e, t) {
2436
- n.setUint8(e, t)
2437
- },
2438
- SEGMENT: function (e, i, r) {
2439
- switch (arguments.length) {
2440
- case 2:
2441
- return t.slice(e, e + i);
2442
- case 1:
2443
- return t.slice(e);
2444
- case 3:
2445
- if (null === r && (r = new ArrayBuffer), r instanceof ArrayBuffer) {
2446
- var o = new Uint8Array(this.length() - i + r.byteLength);
2447
- e > 0 && o.set(new Uint8Array(t.slice(0, e)), 0), o.set(new Uint8Array(r), e), o.set(new Uint8Array(t.slice(e + i)), e + r.byteLength), this.clear(), t = o.buffer, n = new DataView(t);
2448
- break
2449
- }
2450
- default:
2451
- return t
2452
- }
2453
- },
2454
- length: function () {
2455
- return t ? t.byteLength : 0
2456
- },
2457
- clear: function () {
2458
- n = t = null
2459
- }
2460
- })
2461
- }
2462
-
2463
- function i(t) {
2464
- function n(e, n, i) {
2465
- i = 3 === arguments.length ? i : t.length - n - 1, t = t.substr(0, n) + e + t.substr(i + n)
2466
- }
2467
- e.extend(this, {
2468
- readByteAt: function (e) {
2469
- return t.charCodeAt(e)
2470
- },
2471
- writeByteAt: function (e, t) {
2472
- n(String.fromCharCode(t), e, 1)
2473
- },
2474
- SEGMENT: function (e, i, r) {
2475
- switch (arguments.length) {
2476
- case 1:
2477
- return t.substr(e);
2478
- case 2:
2479
- return t.substr(e, i);
2480
- case 3:
2481
- n(null !== r ? r : "", e, i);
2482
- break;
2483
- default:
2484
- return t
2485
- }
2486
- },
2487
- length: function () {
2488
- return t ? t.length : 0
2489
- },
2490
- clear: function () {
2491
- t = null
2492
- }
2493
- })
2494
- }
2495
- return e.extend(t.prototype, {
2496
- littleEndian: !1,
2497
- read: function (e, t) {
2498
- var n, i, r;
2499
- if (e + t > this.length())
2500
- throw new Error("You are trying to read outside the source boundaries.");
2501
- for (i = this.littleEndian ? 0 : - 8 * (t - 1), r = 0, n = 0; t > r; r++)
2502
- n |= this.readByteAt(e + r) << Math.abs(i + 8 * r);
2503
- return n
2504
- },
2505
- write: function (e, t, n) {
2506
- var i, r, o = "";
2507
- if (e > this.length())
2508
- throw new Error("You are trying to write outside the source boundaries.");
2509
- for (i = this.littleEndian ? 0 : - 8 * (n - 1), r = 0; n > r; r++)
2510
- this.writeByteAt(e + r, t >> Math.abs(i + 8 * r) & 255)
2511
- },
2512
- BYTE: function (e) {
2513
- return this.read(e, 1)
2514
- },
2515
- SHORT: function (e) {
2516
- return this.read(e, 2)
2517
- },
2518
- LONG: function (e) {
2519
- return this.read(e, 4)
2520
- },
2521
- SLONG: function (e) {
2522
- var t = this.read(e, 4);
2523
- return t > 2147483647 ? t - 4294967296 : t
2524
- },
2525
- CHAR: function (e) {
2526
- return String.fromCharCode(this.read(e, 1))
2527
- },
2528
- STRING: function (e, t) {
2529
- return this.asArray("CHAR", e, t).join("")
2530
- },
2531
- asArray: function (e, t, n) {
2532
- for (var i = [], r = 0; n > r; r++)
2533
- i[r] = this[e](t + r);
2534
- return i
2535
- }
2536
- }), t
2537
- }), i(B, [H, f], function (e, t) {
2538
- return function n(i) {
2539
- var r = [],
2540
- o, a, s, u = 0;
2541
- if (o = new e(i), 65496 !== o.SHORT(0))
2542
- throw o.clear(), new t.ImageError(t.ImageError.WRONG_FORMAT);
2543
- for (a = 2; a <= o.length(); )
2544
- if (s = o.SHORT(a), s >= 65488 && 65495 >= s)
2545
- a += 2;
2546
- else {
2547
- if (65498 === s || 65497 === s)
2548
- break;
2549
- u = o.SHORT(a + 2) + 2, s >= 65505 && 65519 >= s && r.push({
2550
- hex: s,
2551
- name: "APP" + (15 & s),
2552
- start: a,
2553
- length: u,
2554
- segment: o.SEGMENT(a, u)
2555
- }), a += u
2556
- }
2557
- return o.clear(), {
2558
- headers: r,
2559
- restore: function (t) {
2560
- var n, i, o;
2561
- for (o = new e(t), a = 65504 == o.SHORT(2) ? 4 + o.SHORT(4) : 2, i = 0, n = r.length; n > i; i++)
2562
- o.SEGMENT(a, 0, r[i].segment), a += r[i].length;
2563
- return t = o.SEGMENT(), o.clear(), t
2564
- },
2565
- strip: function (t) {
2566
- var i, r, o, a;
2567
- for (o = new n(t), r = o.headers, o.purge(), i = new e(t), a = r.length; a--; )
2568
- i.SEGMENT(r[a].start, r[a].length, "");
2569
- return t = i.SEGMENT(), i.clear(), t
2570
- },
2571
- get: function (e) {
2572
- for (var t = [], n = 0, i = r.length; i > n; n++)
2573
- r[n].name === e.toUpperCase() && t.push(r[n].segment);
2574
- return t
2575
- },
2576
- set: function (e, t) {
2577
- var n = [],
2578
- i, o, a;
2579
- for ("string" == typeof t ? n.push(t) : n = t, i = o = 0, a = r.length; a > i && (r[i].name === e.toUpperCase() && (r[i].segment = n[o], r[i].length = n[o].length, o++), !(o >= n.length)); i++)
2580
- ;
2581
- },
2582
- purge: function () {
2583
- this.headers = r = []
2584
- }
2585
- }
2586
- }
2587
- }), i(k, [u, H, f], function (e, n, i) {
2588
- function r(o) {
2589
- function a(n, r) {
2590
- var o = this,
2591
- a, s, u, c, h, f, p, m, g = [],
2592
- v = {},
2593
- w = {
2594
- 1: "BYTE",
2595
- 7: "UNDEFINED",
2596
- 2: "ASCII",
2597
- 3: "SHORT",
2598
- 4: "LONG",
2599
- 5: "RATIONAL",
2600
- 9: "SLONG",
2601
- 10: "SRATIONAL"
2602
- },
2603
- y = {
2604
- BYTE: 1,
2605
- UNDEFINED: 1,
2606
- ASCII: 1,
2607
- SHORT: 2,
2608
- LONG: 4,
2609
- RATIONAL: 8,
2610
- SLONG: 4,
2611
- SRATIONAL: 8
2612
- };
2613
- for (a = o.SHORT(n), s = 0; a > s; s++)
2614
- if (g = [], p = n + 2 + 12 * s, u = r[o.SHORT(p)], u !== t) {
2615
- if (c = w[o.SHORT(p += 2)], h = o.LONG(p += 2), f = y[c], !f)
2616
- throw new i.ImageError(i.ImageError.INVALID_META_ERR);
2617
- if (p += 4, f * h > 4 && (p = o.LONG(p) + d.tiffHeader), p + f * h >= this.length())
2618
- throw new i.ImageError(i.ImageError.INVALID_META_ERR);
2619
- "ASCII" !== c ? (g = o.asArray(c, p, h), m = 1 == h ? g[0] : g, l.hasOwnProperty(u) && "object" != typeof m ? v[u] = l[u][m] : v[u] = m) : v[u] = e.trim(o.STRING(p, h).replace(/\0$/, ""))
2620
- }
2621
- return v
2622
- }
2623
-
2624
- function s(e, t, n) {
2625
- var i, r, o, a = 0;
2626
- if ("string" == typeof t) {
2627
- var s = c[e.toLowerCase()];
2628
- for (var u in s)
2629
- if (s[u] === t) {
2630
- t = u;
2631
- break
2632
- }
2633
- }
2634
- i = d[e.toLowerCase() + "IFD"], r = this.SHORT(i);
2635
- for (var l = 0; r > l; l++)
2636
- if (o = i + 12 * l + 2, this.SHORT(o) == t) {
2637
- a = o + 8;
2638
- break
2639
- }
2640
- if (!a)
2641
- return !1;
2642
- try {
2643
- this.write(a, n, 4)
2644
- } catch (h) {
2645
- return !1
2646
- }
2647
- return !0
2648
- }
2649
- var u, c, l, d, h, f;
2650
- if (n.call(this, o), c = {
2651
- tiff: {
2652
- 274: "Orientation",
2653
- 270: "ImageDescription",
2654
- 271: "Make",
2655
- 272: "Model",
2656
- 305: "Software",
2657
- 34665: "ExifIFDPointer",
2658
- 34853: "GPSInfoIFDPointer"
2659
- },
2660
- exif: {
2661
- 36864: "ExifVersion",
2662
- 40961: "ColorSpace",
2663
- 40962: "PixelXDimension",
2664
- 40963: "PixelYDimension",
2665
- 36867: "DateTimeOriginal",
2666
- 33434: "ExposureTime",
2667
- 33437: "FNumber",
2668
- 34855: "ISOSpeedRatings",
2669
- 37377: "ShutterSpeedValue",
2670
- 37378: "ApertureValue",
2671
- 37383: "MeteringMode",
2672
- 37384: "LightSource",
2673
- 37385: "Flash",
2674
- 37386: "FocalLength",
2675
- 41986: "ExposureMode",
2676
- 41987: "WhiteBalance",
2677
- 41990: "SceneCaptureType",
2678
- 41988: "DigitalZoomRatio",
2679
- 41992: "Contrast",
2680
- 41993: "Saturation",
2681
- 41994: "Sharpness"
2682
- },
2683
- gps: {
2684
- 0: "GPSVersionID",
2685
- 1: "GPSLatitudeRef",
2686
- 2: "GPSLatitude",
2687
- 3: "GPSLongitudeRef",
2688
- 4: "GPSLongitude"
2689
- },
2690
- thumb: {
2691
- 513: "JPEGInterchangeFormat",
2692
- 514: "JPEGInterchangeFormatLength"
2693
- }
2694
- }, l = {
2695
- ColorSpace: {
2696
- 1: "sRGB",
2697
- 0: "Uncalibrated"
2698
- },
2699
- MeteringMode: {
2700
- 0: "Unknown",
2701
- 1: "Average",
2702
- 2: "CenterWeightedAverage",
2703
- 3: "Spot",
2704
- 4: "MultiSpot",
2705
- 5: "Pattern",
2706
- 6: "Partial",
2707
- 255: "Other"
2708
- },
2709
- LightSource: {
2710
- 1: "Daylight",
2711
- 2: "Fliorescent",
2712
- 3: "Tungsten",
2713
- 4: "Flash",
2714
- 9: "Fine weather",
2715
- 10: "Cloudy weather",
2716
- 11: "Shade",
2717
- 12: "Daylight fluorescent (D 5700 - 7100K)",
2718
- 13: "Day white fluorescent (N 4600 -5400K)",
2719
- 14: "Cool white fluorescent (W 3900 - 4500K)",
2720
- 15: "White fluorescent (WW 3200 - 3700K)",
2721
- 17: "Standard light A",
2722
- 18: "Standard light B",
2723
- 19: "Standard light C",
2724
- 20: "D55",
2725
- 21: "D65",
2726
- 22: "D75",
2727
- 23: "D50",
2728
- 24: "ISO studio tungsten",
2729
- 255: "Other"
2730
- },
2731
- Flash: {
2732
- 0: "Flash did not fire",
2733
- 1: "Flash fired",
2734
- 5: "Strobe return light not detected",
2735
- 7: "Strobe return light detected",
2736
- 9: "Flash fired, compulsory flash mode",
2737
- 13: "Flash fired, compulsory flash mode, return light not detected",
2738
- 15: "Flash fired, compulsory flash mode, return light detected",
2739
- 16: "Flash did not fire, compulsory flash mode",
2740
- 24: "Flash did not fire, auto mode",
2741
- 25: "Flash fired, auto mode",
2742
- 29: "Flash fired, auto mode, return light not detected",
2743
- 31: "Flash fired, auto mode, return light detected",
2744
- 32: "No flash function",
2745
- 65: "Flash fired, red-eye reduction mode",
2746
- 69: "Flash fired, red-eye reduction mode, return light not detected",
2747
- 71: "Flash fired, red-eye reduction mode, return light detected",
2748
- 73: "Flash fired, compulsory flash mode, red-eye reduction mode",
2749
- 77: "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",
2750
- 79: "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",
2751
- 89: "Flash fired, auto mode, red-eye reduction mode",
2752
- 93: "Flash fired, auto mode, return light not detected, red-eye reduction mode",
2753
- 95: "Flash fired, auto mode, return light detected, red-eye reduction mode"
2754
- },
2755
- ExposureMode: {
2756
- 0: "Auto exposure",
2757
- 1: "Manual exposure",
2758
- 2: "Auto bracket"
2759
- },
2760
- WhiteBalance: {
2761
- 0: "Auto white balance",
2762
- 1: "Manual white balance"
2763
- },
2764
- SceneCaptureType: {
2765
- 0: "Standard",
2766
- 1: "Landscape",
2767
- 2: "Portrait",
2768
- 3: "Night scene"
2769
- },
2770
- Contrast: {
2771
- 0: "Normal",
2772
- 1: "Soft",
2773
- 2: "Hard"
2774
- },
2775
- Saturation: {
2776
- 0: "Normal",
2777
- 1: "Low saturation",
2778
- 2: "High saturation"
2779
- },
2780
- Sharpness: {
2781
- 0: "Normal",
2782
- 1: "Soft",
2783
- 2: "Hard"
2784
- },
2785
- GPSLatitudeRef: {
2786
- N: "North latitude",
2787
- S: "South latitude"
2788
- },
2789
- GPSLongitudeRef: {
2790
- E: "East longitude",
2791
- W: "West longitude"
2792
- }
2793
- }, d = {
2794
- tiffHeader: 10
2795
- }, h = d.tiffHeader, u = {
2796
- clear: this.clear
2797
- }, e.extend(this, {
2798
- read: function () {
2799
- try {
2800
- return r.prototype.read.apply(this, arguments)
2801
- } catch (e) {
2802
- throw new i.ImageError(i.ImageError.INVALID_META_ERR)
2803
- }
2804
- },
2805
- write: function () {
2806
- try {
2807
- return r.prototype.write.apply(this, arguments)
2808
- } catch (e) {
2809
- throw new i.ImageError(i.ImageError.INVALID_META_ERR)
2810
- }
2811
- },
2812
- UNDEFINED: function () {
2813
- return this.BYTE.apply(this, arguments)
2814
- },
2815
- RATIONAL: function (e) {
2816
- return this.LONG(e) / this.LONG(e + 4)
2817
- },
2818
- SRATIONAL: function (e) {
2819
- return this.SLONG(e) / this.SLONG(e + 4)
2820
- },
2821
- ASCII: function (e) {
2822
- return this.CHAR(e)
2823
- },
2824
- TIFF: function () {
2825
- return f || null
2826
- },
2827
- EXIF: function () {
2828
- var t = null;
2829
- if (d.exifIFD) {
2830
- try {
2831
- t = a.call(this, d.exifIFD, c.exif)
2832
- } catch (n) {
2833
- return null
2834
- }
2835
- if (t.ExifVersion && "array" === e.typeOf(t.ExifVersion)) {
2836
- for (var i = 0, r = ""; i < t.ExifVersion.length; i++)
2837
- r += String.fromCharCode(t.ExifVersion[i]);
2838
- t.ExifVersion = r
2839
- }
2840
- }
2841
- return t
2842
- },
2843
- GPS: function () {
2844
- var t = null;
2845
- if (d.gpsIFD) {
2846
- try {
2847
- t = a.call(this, d.gpsIFD, c.gps)
2848
- } catch (n) {
2849
- return null
2850
- }
2851
- t.GPSVersionID && "array" === e.typeOf(t.GPSVersionID) && (t.GPSVersionID = t.GPSVersionID.join("."))
2852
- }
2853
- return t
2854
- },
2855
- thumb: function () {
2856
- if (d.IFD1)
2857
- try {
2858
- var e = a.call(this, d.IFD1, c.thumb);
2859
- if ("JPEGInterchangeFormat" in e)
2860
- return this.SEGMENT(d.tiffHeader + e.JPEGInterchangeFormat, e.JPEGInterchangeFormatLength)
2861
- } catch (t) {
2862
- }
2863
- return null
2864
- },
2865
- setExif: function (e, t) {
2866
- return "PixelXDimension" !== e && "PixelYDimension" !== e ? !1 : s.call(this, "exif", e, t)
2867
- },
2868
- clear: function () {
2869
- u.clear(), o = c = l = f = d = u = null
2870
- }
2871
- }), 65505 !== this.SHORT(0) || "EXIF\x00" !== this.STRING(4, 5).toUpperCase())
2872
- throw new i.ImageError(i.ImageError.INVALID_META_ERR);
2873
- if (this.littleEndian = 18761 == this.SHORT(h), 42 !== this.SHORT(h += 2))
2874
- throw new i.ImageError(i.ImageError.INVALID_META_ERR);
2875
- d.IFD0 = d.tiffHeader + this.LONG(h += 2), f = a.call(this, d.IFD0, c.tiff), "ExifIFDPointer" in f && (d.exifIFD = d.tiffHeader + f.ExifIFDPointer, delete f.ExifIFDPointer), "GPSInfoIFDPointer" in f && (d.gpsIFD = d.tiffHeader + f.GPSInfoIFDPointer, delete f.GPSInfoIFDPointer), e.isEmptyObj(f) && (f = null);
2876
- var p = this.LONG(d.IFD0 + 12 * this.SHORT(d.IFD0) + 2);
2877
- p && (d.IFD1 = d.tiffHeader + p)
2878
- }
2879
- return r.prototype = n.prototype, r
2880
- }), i(U, [u, f, B, H, k], function (e, t, n, i, r) {
2881
- function o(o) {
2882
- function a(e) {
2883
- var t = 0,
2884
- n, i;
2885
- for (e || (e = c); t <= e.length(); ) {
2886
- if (n = e.SHORT(t += 2), n >= 65472 && 65475 >= n)
2887
- return t += 5, {
2888
- height: e.SHORT(t),
2889
- width: e.SHORT(t += 2)
2890
- };
2891
- i = e.SHORT(t += 2), t += i - 2
2892
- }
2893
- return null
2894
- }
2895
-
2896
- function s() {
2897
- var e = d.thumb(),
2898
- t, n;
2899
- return e && (t = new i(e), n = a(t), t.clear(), n) ? (n.data = e, n) : null
2900
- }
2901
-
2902
- function u() {
2903
- d && l && c && (d.clear(), l.purge(), c.clear(), h = l = d = c = null)
2904
- }
2905
- var c, l, d, h;
2906
- if (c = new i(o), 65496 !== c.SHORT(0))
2907
- throw new t.ImageError(t.ImageError.WRONG_FORMAT);
2908
- l = new n(o);
2909
- try {
2910
- d = new r(l.get("app1")[0])
2911
- } catch (f) {
2912
- }
2913
- h = a.call(this), e.extend(this, {
2914
- type: "image/jpeg",
2915
- size: c.length(),
2916
- width: h && h.width || 0,
2917
- height: h && h.height || 0,
2918
- setExif: function (t, n) {
2919
- return d ? ("object" === e.typeOf(t) ? e.each(t, function (e, t) {
2920
- d.setExif(t, e)
2921
- }) : d.setExif(t, n), void l.set("app1", d.SEGMENT())) : !1
2922
- },
2923
- writeHeaders: function () {
2924
- return l.restore(arguments.length ? arguments[0] : o)
2925
- },
2926
- stripHeaders: function (e) {
2927
- return l.strip(e)
2928
- },
2929
- purge: function () {
2930
- u.call(this)
2931
- }
2932
- }), d && (this.meta = {
2933
- tiff: d.TIFF(),
2934
- exif: d.EXIF(),
2935
- gps: d.GPS(),
2936
- thumb: s()
2937
- })
2938
- }
2939
- return o
2940
- }), i(G, [f, u, H], function (e, t, n) {
2941
- function i(i) {
2942
- function r() {
2943
- var e, t;
2944
- return e = a.call(this, 8), "IHDR" == e.type ? (t = e.start, {
2945
- width: s.LONG(t),
2946
- height: s.LONG(t += 4)
2947
- }) : null
2948
- }
2949
-
2950
- function o() {
2951
- s && (s.clear(), i = l = u = c = s = null)
2952
- }
2953
-
2954
- function a(e) {
2955
- var t, n, i, r;
2956
- return t = s.LONG(e), n = s.STRING(e += 4, 4), i = e += 4, r = s.LONG(e + t), {
2957
- length: t,
2958
- type: n,
2959
- start: i,
2960
- CRC: r
2961
- }
2962
- }
2963
- var s, u, c, l;
2964
- s = new n(i),
2965
- function () {
2966
- var t = 0,
2967
- n = 0,
2968
- i = [35152, 20039, 3338, 6666];
2969
- for (n = 0; n < i.length; n++, t += 2)
2970
- if (i[n] != s.SHORT(t))
2971
- throw new e.ImageError(e.ImageError.WRONG_FORMAT)
2972
- }(), l = r.call(this), t.extend(this, {
2973
- type: "image/png",
2974
- size: s.length(),
2975
- width: l.width,
2976
- height: l.height,
2977
- purge: function () {
2978
- o.call(this)
2979
- }
2980
- }), o.call(this)
2981
- }
2982
- return i
2983
- }), i(z, [u, f, U, G], function (e, t, n, i) {
2984
- return function (r) {
2985
- var o = [n, i],
2986
- a;
2987
- a = function () {
2988
- for (var e = 0; e < o.length; e++)
2989
- try {
2990
- return new o[e](r)
2991
- } catch (n) {
2992
- }
2993
- throw new t.ImageError(t.ImageError.WRONG_FORMAT)
2994
- }(), e.extend(this, {
2995
- type: "",
2996
- size: 0,
2997
- width: 0,
2998
- height: 0,
2999
- setExif: function () {},
3000
- writeHeaders: function (e) {
3001
- return e
3002
- },
3003
- stripHeaders: function (e) {
3004
- return e
3005
- },
3006
- purge: function () {
3007
- r = null
3008
- }
3009
- }), e.extend(this, a), this.purge = function () {
3010
- a.purge(), a = null
3011
- }
3012
- }
3013
- }), i(q, [], function () {
3014
- function e(e, i, r) {
3015
- var o = e.naturalWidth,
3016
- a = e.naturalHeight,
3017
- s = r.width,
3018
- u = r.height,
3019
- c = r.x || 0,
3020
- l = r.y || 0,
3021
- d = i.getContext("2d");
3022
- t(e) && (o /= 2, a /= 2);
3023
- var h = 1024,
3024
- f = document.createElement("canvas");
3025
- f.width = f.height = h;
3026
- for (var p = f.getContext("2d"), m = n(e, o, a), g = 0; a > g; ) {
3027
- for (var v = g + h > a ? a - g : h, w = 0; o > w; ) {
3028
- var y = w + h > o ? o - w : h;
3029
- p.clearRect(0, 0, h, h), p.drawImage(e, -w, -g);
3030
- var E = w * s / o + c << 0,
3031
- _ = Math.ceil(y * s / o),
3032
- b = g * u / a / m + l << 0,
3033
- x = Math.ceil(v * u / a / m);
3034
- d.drawImage(f, 0, 0, y, v, E, b, _, x), w += h
3035
- }
3036
- g += h
3037
- }
3038
- f = p = null
3039
- }
3040
-
3041
- function t(e) {
3042
- var t = e.naturalWidth,
3043
- n = e.naturalHeight;
3044
- if (t * n > 1048576) {
3045
- var i = document.createElement("canvas");
3046
- i.width = i.height = 1;
3047
- var r = i.getContext("2d");
3048
- return r.drawImage(e, -t + 1, 0), 0 === r.getImageData(0, 0, 1, 1).data[3]
3049
- }
3050
- return !1
3051
- }
3052
-
3053
- function n(e, t, n) {
3054
- var i = document.createElement("canvas");
3055
- i.width = 1, i.height = n;
3056
- var r = i.getContext("2d");
3057
- r.drawImage(e, 0, 0);
3058
- for (var o = r.getImageData(0, 0, 1, n).data, a = 0, s = n, u = n; u > a; ) {
3059
- var c = o[4 * (u - 1) + 3];
3060
- 0 === c ? s = u : a = u, u = s + a >> 1
3061
- }
3062
- i = null;
3063
- var l = u / n;
3064
- return 0 === l ? 1 : l
3065
- }
3066
- return {
3067
- isSubsampled: t,
3068
- renderTo: e
3069
- }
3070
- }), i(j, [D, u, f, w, y, E, z, q, d, c], function (e, t, n, i, r, o, a, s, u, c) {
3071
- function l() {
3072
- function e() {
3073
- if (!_ && !y)
3074
- throw new n.ImageError(n.DOMException.INVALID_STATE_ERR);
3075
- return _ || y
3076
- }
3077
-
3078
- function l(e) {
3079
- return i.atob(e.substring(e.indexOf("base64,") + 7))
3080
- }
3081
-
3082
- function d(e, t) {
3083
- return "data:" + (t || "") + ";base64," + i.btoa(e)
3084
- }
3085
-
3086
- function h(e) {
3087
- var t = this;
3088
- y = new Image, y.onerror = function () {
3089
- v.call(this), t.trigger("error", n.ImageError.WRONG_FORMAT)
3090
- }, y.onload = function () {
3091
- t.trigger("load")
3092
- }, y.src = "data:" == e.substr(0, 5) ? e : d(e, x.type)
3093
- }
3094
-
3095
- function f(e, t) {
3096
- var i = this,
3097
- r;
3098
- return window.FileReader ? (r = new FileReader, r.onload = function () {
3099
- t(this.result)
3100
- }, r.onerror = function () {
3101
- i.trigger("error", n.ImageError.WRONG_FORMAT)
3102
- }, r.readAsDataURL(e), void 0) : t(e.getAsDataURL())
3103
- }
3104
-
3105
- function p(n, i, r, o) {
3106
- var a = this,
3107
- s, u, c = 0,
3108
- l = 0,
3109
- d, h, f, p;
3110
- if (A = o, p = this.meta && this.meta.tiff && this.meta.tiff.Orientation || 1, -1 !== t.inArray(p, [5, 6, 7, 8])) {
3111
- var v = n;
3112
- n = i, i = v
3113
- }
3114
- return d = e(), r ? (n = Math.min(n, d.width), i = Math.min(i, d.height), s = Math.max(n / d.width, i / d.height)) : s = Math.min(n / d.width, i / d.height), s > 1 && !r && o ? void this.trigger("Resize") : (_ || (_ = document.createElement("canvas")), h = Math.round(d.width * s), f = Math.round(d.height * s), r ? (_.width = n, _.height = i, h > n && (c = Math.round((h - n) / 2)), f > i && (l = Math.round((f - i) / 2))) : (_.width = h, _.height = f), A || g(_.width, _.height, p), m.call(this, d, _, -c, -l, h, f), this.width = _.width, this.height = _.height, R = !0, void a.trigger("Resize"))
3115
- }
3116
-
3117
- function m(e, t, n, i, r, o) {
3118
- if ("iOS" === c.OS)
3119
- s.renderTo(e, t, {
3120
- width: r,
3121
- height: o,
3122
- x: n,
3123
- y: i
3124
- });
3125
- else {
3126
- var a = t.getContext("2d");
3127
- a.drawImage(e, n, i, r, o)
3128
- }
3129
- }
3130
-
3131
- function g(e, t, n) {
3132
- switch (n) {
3133
- case 5:
3134
- case 6:
3135
- case 7:
3136
- case 8:
3137
- _.width = t, _.height = e;
3138
- break;
3139
- default:
3140
- _.width = e, _.height = t
3141
- }
3142
- var i = _.getContext("2d");
3143
- switch (n) {
3144
- case 2:
3145
- i.translate(e, 0), i.scale(-1, 1);
3146
- break;
3147
- case 3:
3148
- i.translate(e, t), i.rotate(Math.PI);
3149
- break;
3150
- case 4:
3151
- i.translate(0, t), i.scale(1, -1);
3152
- break;
3153
- case 5:
3154
- i.rotate(.5 * Math.PI), i.scale(1, -1);
3155
- break;
3156
- case 6:
3157
- i.rotate(.5 * Math.PI), i.translate(0, -t);
3158
- break;
3159
- case 7:
3160
- i.rotate(.5 * Math.PI), i.translate(e, -t), i.scale(-1, 1);
3161
- break;
3162
- case 8:
3163
- i.rotate(-.5 * Math.PI), i.translate(-e, 0)
3164
- }
3165
- }
3166
-
3167
- function v() {
3168
- E && (E.purge(), E = null), b = y = _ = x = null, R = !1
3169
- }
3170
- var w = this,
3171
- y, E, _, b, x, R = !1,
3172
- A = !0;
3173
- t.extend(this, {
3174
- loadFromBlob: function (e) {
3175
- var t = this,
3176
- i = t.getRuntime(),
3177
- r = arguments.length > 1 ? arguments[1] : !0;
3178
- if (!i.can("access_binary"))
3179
- throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);
3180
- return x = e, e.isDetached() ? (b = e.getSource(), void h.call(this, b)) : void f.call(this, e.getSource(), function (e) {
3181
- r && (b = l(e)), h.call(t, e)
3182
- })
3183
- },
3184
- loadFromImage: function (e, t) {
3185
- this.meta = e.meta, x = new o(null, {
3186
- name: e.name,
3187
- size: e.size,
3188
- type: e.type
3189
- }), h.call(this, t ? b = e.getAsBinaryString() : e.getAsDataURL())
3190
- },
3191
- getInfo: function () {
3192
- var t = this.getRuntime(),
3193
- n;
3194
- return !E && b && t.can("access_image_binary") && (E = new a(b)), n = {
3195
- width: e().width || 0,
3196
- height: e().height || 0,
3197
- type: x.type || u.getFileMime(x.name),
3198
- size: b && b.length || x.size || 0,
3199
- name: x.name || "",
3200
- meta: E && E.meta || this.meta || {}
3201
- }, !n.meta || !n.meta.thumb || n.meta.thumb.data instanceof r || (n.meta.thumb.data = new r(null, {
3202
- type: "image/jpeg",
3203
- data: n.meta.thumb.data
3204
- })), n
3205
- },
3206
- downsize: function () {
3207
- p.apply(this, arguments)
3208
- },
3209
- getAsCanvas: function () {
3210
- return _ && (_.id = this.uid + "_canvas"), _
3211
- },
3212
- getAsBlob: function (e, t) {
3213
- return e !== this.type && p.call(this, this.width, this.height, !1), new o(null, {
3214
- name: x.name || "",
3215
- type: e,
3216
- data: w.getAsBinaryString.call(this, e, t)
3217
- })
3218
- },
3219
- getAsDataURL: function (e) {
3220
- var t = arguments[1] || 90;
3221
- if (!R)
3222
- return y.src;
3223
- if ("image/jpeg" !== e)
3224
- return _.toDataURL("image/png");
3225
- try {
3226
- return _.toDataURL("image/jpeg", t / 100)
3227
- } catch (n) {
3228
- return _.toDataURL("image/jpeg")
3229
- }
3230
- },
3231
- getAsBinaryString: function (e, t) {
3232
- if (!R)
3233
- return b || (b = l(w.getAsDataURL(e, t))), b;
3234
- if ("image/jpeg" !== e)
3235
- b = l(w.getAsDataURL(e, t));
3236
- else {
3237
- var n;
3238
- t || (t = 90);
3239
- try {
3240
- n = _.toDataURL("image/jpeg", t / 100)
3241
- } catch (i) {
3242
- n = _.toDataURL("image/jpeg")
3243
- }
3244
- b = l(n), E && (b = E.stripHeaders(b), A && (E.meta && E.meta.exif && E.setExif({
3245
- PixelXDimension: this.width,
3246
- PixelYDimension: this.height
3247
- }), b = E.writeHeaders(b)), E.purge(), E = null)
3248
- }
3249
- return R = !1, b
3250
- },
3251
- destroy: function () {
3252
- w = null, v.call(this), this.getRuntime().getShim().removeInstance(this.uid)
3253
- }
3254
- })
3255
- }
3256
- return e.Image = l
3257
- }), i(X, [u, c, h, f, m], function (e, t, n, i, r) {
3258
- function o() {
3259
- var e;
3260
- try {
3261
- e = navigator.plugins["Shockwave Flash"], e = e.description
3262
- } catch (t) {
3263
- try {
3264
- e = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")
3265
- } catch (n) {
3266
- e = "0.0"
3267
- }
3268
- }
3269
- return e = e.match(/\d+/g), parseFloat(e[0] + "." + e[1])
3270
- }
3271
-
3272
- function a(e) {
3273
- var i = n.get(e);
3274
- i && "OBJECT" == i.nodeName && ("IE" === t.browser ? (i.style.display = "none", function r() {
3275
- 4 == i.readyState ? s(e) : setTimeout(r, 10)
3276
- }()) : i.parentNode.removeChild(i))
3277
- }
3278
-
3279
- function s(e) {
3280
- var t = n.get(e);
3281
- if (t) {
3282
- for (var i in t)
3283
- "function" == typeof t[i] && (t[i] = null);
3284
- t.parentNode.removeChild(t)
3285
- }
3286
- }
3287
-
3288
- function u(s) {
3289
- var u = this,
3290
- d;
3291
- s = e.extend({
3292
- swf_url: t.swf_url
3293
- }, s), r.call(this, s, c, {
3294
- access_binary: function (e) {
3295
- return e && "browser" === u.mode
3296
- },
3297
- access_image_binary: function (e) {
3298
- return e && "browser" === u.mode
3299
- },
3300
- display_media: r.capTrue,
3301
- do_cors: r.capTrue,
3302
- drag_and_drop: !1,
3303
- report_upload_progress: function () {
3304
- return "client" === u.mode
3305
- },
3306
- resize_image: r.capTrue,
3307
- return_response_headers: !1,
3308
- return_response_type: function (t) {
3309
- return "json" === t && window.JSON ? !0 : !e.arrayDiff(t, ["", "text", "document"]) || "browser" === u.mode
3310
- },
3311
- return_status_code: function (t) {
3312
- return "browser" === u.mode || !e.arrayDiff(t, [200, 404])
3313
- },
3314
- select_file: r.capTrue,
3315
- select_multiple: r.capTrue,
3316
- send_binary_string: function (e) {
3317
- return e && "browser" === u.mode
3318
- },
3319
- send_browser_cookies: function (e) {
3320
- return e && "browser" === u.mode
3321
- },
3322
- send_custom_headers: function (e) {
3323
- return e && "browser" === u.mode
3324
- },
3325
- send_multipart: r.capTrue,
3326
- slice_blob: function (e) {
3327
- return e && "browser" === u.mode
3328
- },
3329
- stream_upload: function (e) {
3330
- return e && "browser" === u.mode
3331
- },
3332
- summon_file_dialog: !1,
3333
- upload_filesize: function (t) {
3334
- return e.parseSizeStr(t) <= 2097152 || "client" === u.mode
3335
- },
3336
- use_http_method: function (t) {
3337
- return !e.arrayDiff(t, ["GET", "POST"])
3338
- }
3339
- }, {
3340
- access_binary: function (e) {
3341
- return e ? "browser" : "client"
3342
- },
3343
- access_image_binary: function (e) {
3344
- return e ? "browser" : "client"
3345
- },
3346
- report_upload_progress: function (e) {
3347
- return e ? "browser" : "client"
3348
- },
3349
- return_response_type: function (t) {
3350
- return e.arrayDiff(t, ["", "text", "json", "document"]) ? "browser" : ["client", "browser"]
3351
- },
3352
- return_status_code: function (t) {
3353
- return e.arrayDiff(t, [200, 404]) ? "browser" : ["client", "browser"]
3354
- },
3355
- send_binary_string: function (e) {
3356
- return e ? "browser" : "client"
3357
- },
3358
- send_browser_cookies: function (e) {
3359
- return e ? "browser" : "client"
3360
- },
3361
- send_custom_headers: function (e) {
3362
- return e ? "browser" : "client"
3363
- },
3364
- stream_upload: function (e) {
3365
- return e ? "client" : "browser"
3366
- },
3367
- upload_filesize: function (t) {
3368
- return e.parseSizeStr(t) >= 2097152 ? "client" : "browser"
3369
- }
3370
- }, "client"), o() < 10 && (this.mode = !1), e.extend(this, {
3371
- getShim: function () {
3372
- return n.get(this.uid)
3373
- },
3374
- shimExec: function (e, t) {
3375
- var n = [].slice.call(arguments, 2);
3376
- return u.getShim().exec(this.uid, e, t, n)
3377
- },
3378
- init: function () {
3379
- var n, r, o;
3380
- o = this.getShimContainer(), e.extend(o.style, {
3381
- position: "absolute",
3382
- top: "-8px",
3383
- left: "-8px",
3384
- width: "9px",
3385
- height: "9px",
3386
- overflow: "hidden"
3387
- }), n = '<object id="' + this.uid + '" type="application/x-shockwave-flash" data="' + s.swf_url + '" ', "IE" === t.browser && (n += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '), n += 'width="100%" height="100%" style="outline:0"><param name="movie" value="' + s.swf_url + '" /><param name="flashvars" value="uid=' + escape(this.uid) + "&target=" + t.global_event_dispatcher + '" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>', "IE" === t.browser ? (r = document.createElement("div"), o.appendChild(r), r.outerHTML = n, r = o = null) : o.innerHTML = n, d = setTimeout(function () {
3388
- u && !u.initialized && u.trigger("Error", new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))
3389
- }, 5e3)
3390
- },
3391
- destroy: function (e) {
3392
- return function () {
3393
- a(u.uid), e.call(u), clearTimeout(d), s = d = e = u = null
3394
- }
3395
- }(this.destroy)
3396
- }, l)
3397
- }
3398
- var c = "flash",
3399
- l = {};
3400
- return r.addConstructor(c, u), l
3401
- }), i(V, [X, E, u], function (e, t, n) {
3402
- var i = {
3403
- init: function (e) {
3404
- var i = this,
3405
- r = this.getRuntime();
3406
- this.bind("Change", function () {
3407
- var e = r.shimExec.call(i, "FileInput", "getFiles");
3408
- i.files = [], n.each(e, function (e) {
3409
- i.files.push(new t(r.uid, e))
3410
- })
3411
- }, 999), this.getRuntime().shimExec.call(this, "FileInput", "init", {
3412
- name: e.name,
3413
- accept: e.accept,
3414
- multiple: e.multiple
3415
- }), this.trigger("ready")
3416
- }
3417
- };
3418
- return e.FileInput = i
3419
- }), i(W, [X, y], function (e, t) {
3420
- var n = {
3421
- slice: function (e, n, i, r) {
3422
- var o = this.getRuntime();
3423
- return 0 > n ? n = Math.max(e.size + n, 0) : n > 0 && (n = Math.min(n, e.size)), 0 > i ? i = Math.max(e.size + i, 0) : i > 0 && (i = Math.min(i, e.size)), e = o.shimExec.call(this, "Blob", "slice", n, i, r || ""), e && (e = new t(o.uid, e)), e
3424
- }
3425
- };
3426
- return e.Blob = n
3427
- }), i(Y, [X, w], function (e, t) {
3428
- function n(e, n) {
3429
- switch (n) {
3430
- case "readAsText":
3431
- return t.atob(e, "utf8");
3432
- case "readAsBinaryString":
3433
- return t.atob(e);
3434
- case "readAsDataURL":
3435
- return e
3436
- }
3437
- return null
3438
- }
3439
- var i = {
3440
- read: function (e, t) {
3441
- var i = this;
3442
- return i.result = "", "readAsDataURL" === e && (i.result = "data:" + (t.type || "") + ";base64,"), i.bind("Progress", function (t, r) {
3443
- r && (i.result += n(r, e))
3444
- }, 999), i.getRuntime().shimExec.call(this, "FileReader", "readAsBase64", t.uid)
3445
- }
3446
- };
3447
- return e.FileReader = i
3448
- }), i($, [X, w], function (e, t) {
3449
- function n(e, n) {
3450
- switch (n) {
3451
- case "readAsText":
3452
- return t.atob(e, "utf8");
3453
- case "readAsBinaryString":
3454
- return t.atob(e);
3455
- case "readAsDataURL":
3456
- return e
3457
- }
3458
- return null
3459
- }
3460
- var i = {
3461
- read: function (e, t) {
3462
- var i, r = this.getRuntime();
3463
- return (i = r.shimExec.call(this, "FileReaderSync", "readAsBase64", t.uid)) ? ("readAsDataURL" === e && (i = "data:" + (t.type || "") + ";base64," + i), n(i, e, t.type)) : null
3464
- }
3465
- };
3466
- return e.FileReaderSync = i
3467
- }), i(J, [X, u, y, E, A, I, S], function (e, t, n, i, r, o, a) {
3468
- var s = {
3469
- send: function (e, i) {
3470
- function r() {
3471
- e.transport = l.mode, l.shimExec.call(c, "XMLHttpRequest", "send", e, i)
3472
- }
3473
-
3474
- function s(e, t) {
3475
- l.shimExec.call(c, "XMLHttpRequest", "appendBlob", e, t.uid), i = null, r()
3476
- }
3477
-
3478
- function u(e, t) {
3479
- var n = new a;
3480
- n.bind("TransportingComplete", function () {
3481
- t(this.result)
3482
- }), n.transport(e.getSource(), e.type, {
3483
- ruid: l.uid
3484
- })
3485
- }
3486
- var c = this,
3487
- l = c.getRuntime();
3488
- if (t.isEmptyObj(e.headers) || t.each(e.headers, function (e, t) {
3489
- l.shimExec.call(c, "XMLHttpRequest", "setRequestHeader", t, e.toString())
3490
- }), i instanceof o) {
3491
- var d;
3492
- if (i.each(function (e, t) {
3493
- e instanceof n ? d = t : l.shimExec.call(c, "XMLHttpRequest", "append", t, e)
3494
- }), i.hasBlob()) {
3495
- var h = i.getBlob();
3496
- h.isDetached() ? u(h, function (e) {
3497
- h.destroy(), s(d, e)
3498
- }) : s(d, h)
3499
- } else
3500
- i = null, r()
3501
- } else
3502
- i instanceof n ? i.isDetached() ? u(i, function (e) {
3503
- i.destroy(), i = e.uid, r()
3504
- }) : (i = i.uid, r()) : r()
3505
- },
3506
- getResponse: function (e) {
3507
- var n, o, a = this.getRuntime();
3508
- if (o = a.shimExec.call(this, "XMLHttpRequest", "getResponseAsBlob")) {
3509
- if (o = new i(a.uid, o), "blob" === e)
3510
- return o;
3511
- try {
3512
- if (n = new r, ~t.inArray(e, ["", "text"]))
3513
- return n.readAsText(o);
3514
- if ("json" === e && window.JSON)
3515
- return JSON.parse(n.readAsText(o))
3516
- } finally {
3517
- o.destroy()
3518
- }
3519
- }
3520
- return null
3521
- },
3522
- abort: function (e) {
3523
- var t = this.getRuntime();
3524
- t.shimExec.call(this, "XMLHttpRequest", "abort"), this.dispatchEvent("readystatechange"), this.dispatchEvent("abort")
3525
- }
3526
- };
3527
- return e.XMLHttpRequest = s
3528
- }), i(Z, [X, y], function (e, t) {
3529
- var n = {
3530
- getAsBlob: function (e) {
3531
- var n = this.getRuntime(),
3532
- i = n.shimExec.call(this, "Transporter", "getAsBlob", e);
3533
- return i ? new t(n.uid, i) : null
3534
- }
3535
- };
3536
- return e.Transporter = n
3537
- }), i(K, [X, u, S, y, A], function (e, t, n, i, r) {
3538
- var o = {
3539
- loadFromBlob: function (e) {
3540
- function t(e) {
3541
- r.shimExec.call(i, "Image", "loadFromBlob", e.uid), i = r = null
3542
- }
3543
- var i = this,
3544
- r = i.getRuntime();
3545
- if (e.isDetached()) {
3546
- var o = new n;
3547
- o.bind("TransportingComplete", function () {
3548
- t(o.result.getSource())
3549
- }), o.transport(e.getSource(), e.type, {
3550
- ruid: r.uid
3551
- })
3552
- } else
3553
- t(e.getSource())
3554
- },
3555
- loadFromImage: function (e) {
3556
- var t = this.getRuntime();
3557
- return t.shimExec.call(this, "Image", "loadFromImage", e.uid)
3558
- },
3559
- getInfo: function () {
3560
- var e = this.getRuntime(),
3561
- t = e.shimExec.call(this, "Image", "getInfo");
3562
- return !t.meta || !t.meta.thumb || t.meta.thumb.data instanceof i || (t.meta.thumb.data = new i(e.uid, t.meta.thumb.data)), t
3563
- },
3564
- getAsBlob: function (e, t) {
3565
- var n = this.getRuntime(),
3566
- r = n.shimExec.call(this, "Image", "getAsBlob", e, t);
3567
- return r ? new i(n.uid, r) : null
3568
- },
3569
- getAsDataURL: function () {
3570
- var e = this.getRuntime(),
3571
- t = e.Image.getAsBlob.apply(this, arguments),
3572
- n;
3573
- return t ? (n = new r, n.readAsDataURL(t)) : null
3574
- }
3575
- };
3576
- return e.Image = o
3577
- }), i(Q, [u, c, h, f, m], function (e, t, n, i, r) {
3578
- function o(e) {
3579
- var t = !1,
3580
- n = null,
3581
- i, r, o, a, s, u = 0;
3582
- try {
3583
- try {
3584
- n = new ActiveXObject("AgControl.AgControl"), n.IsVersionSupported(e) && (t = !0), n = null
3585
- } catch (c) {
3586
- var l = navigator.plugins["Silverlight Plug-In"];
3587
- if (l) {
3588
- for (i = l.description, "1.0.30226.2" === i && (i = "2.0.30226.2"), r = i.split("."); r.length > 3; )
3589
- r.pop();
3590
- for (; r.length < 4; )
3591
- r.push(0);
3592
- for (o = e.split("."); o.length > 4; )
3593
- o.pop();
3594
- do
3595
- a = parseInt(o[u], 10), s = parseInt(r[u], 10), u++;
3596
- while (u < o.length && a === s);
3597
- s >= a && !isNaN(a) && (t = !0)
3598
- }
3599
- }
3600
- } catch (d) {
3601
- t = !1
3602
- }
3603
- return t
3604
- }
3605
-
3606
- function a(a) {
3607
- var c = this,
3608
- l;
3609
- a = e.extend({
3610
- xap_url: t.xap_url
3611
- }, a), r.call(this, a, s, {
3612
- access_binary: r.capTrue,
3613
- access_image_binary: r.capTrue,
3614
- display_media: r.capTrue,
3615
- do_cors: r.capTrue,
3616
- drag_and_drop: !1,
3617
- report_upload_progress: r.capTrue,
3618
- resize_image: r.capTrue,
3619
- return_response_headers: function (e) {
3620
- return e && "client" === c.mode
3621
- },
3622
- return_response_type: function (e) {
3623
- return "json" !== e ? !0 : !!window.JSON
3624
- },
3625
- return_status_code: function (t) {
3626
- return "client" === c.mode || !e.arrayDiff(t, [200, 404])
3627
- },
3628
- select_file: r.capTrue,
3629
- select_multiple: r.capTrue,
3630
- send_binary_string: r.capTrue,
3631
- send_browser_cookies: function (e) {
3632
- return e && "browser" === c.mode
3633
- },
3634
- send_custom_headers: function (e) {
3635
- return e && "client" === c.mode
3636
- },
3637
- send_multipart: r.capTrue,
3638
- slice_blob: r.capTrue,
3639
- stream_upload: !0,
3640
- summon_file_dialog: !1,
3641
- upload_filesize: r.capTrue,
3642
- use_http_method: function (t) {
3643
- return "client" === c.mode || !e.arrayDiff(t, ["GET", "POST"])
3644
- }
3645
- }, {
3646
- return_response_headers: function (e) {
3647
- return e ? "client" : "browser"
3648
- },
3649
- return_status_code: function (t) {
3650
- return e.arrayDiff(t, [200, 404]) ? "client" : ["client", "browser"]
3651
- },
3652
- send_browser_cookies: function (e) {
3653
- return e ? "browser" : "client"
3654
- },
3655
- send_custom_headers: function (e) {
3656
- return e ? "client" : "browser"
3657
- },
3658
- use_http_method: function (t) {
3659
- return e.arrayDiff(t, ["GET", "POST"]) ? "client" : ["client", "browser"]
3660
- }
3661
- }), o("2.0.31005.0") && "Opera" !== t.browser || (this.mode = !1), e.extend(this, {
3662
- getShim: function () {
3663
- return n.get(this.uid).content.Moxie
3664
- },
3665
- shimExec: function (e, t) {
3666
- var n = [].slice.call(arguments, 2);
3667
- return c.getShim().exec(this.uid, e, t, n)
3668
- },
3669
- init: function () {
3670
- var e;
3671
- e = this.getShimContainer(), e.innerHTML = '<object id="' + this.uid + '" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;"><param name="source" value="' + a.xap_url + '"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="enablehtmlaccess" value="true"/><param name="initParams" value="uid=' + this.uid + ",target=" + t.global_event_dispatcher + '"/></object>', l = setTimeout(function () {
3672
- c && !c.initialized && c.trigger("Error", new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))
3673
- }, "Windows" !== t.OS ? 1e4 : 5e3)
3674
- },
3675
- destroy: function (e) {
3676
- return function () {
3677
- e.call(c), clearTimeout(l), a = l = e = c = null
3678
- }
3679
- }(this.destroy)
3680
- }, u)
3681
- }
3682
- var s = "silverlight",
3683
- u = {};
3684
- return r.addConstructor(s, a), u
3685
- }), i(ee, [Q, E, u], function (e, t, n) {
3686
- var i = {
3687
- init: function (e) {
3688
- function i(e) {
3689
- for (var t = "", n = 0; n < e.length; n++)
3690
- t += ("" !== t ? "|" : "") + e[n].title + " | *." + e[n].extensions.replace(/,/g, ";*.");
3691
- return t
3692
- }
3693
- var r = this,
3694
- o = this.getRuntime();
3695
- this.bind("Change", function () {
3696
- var e = o.shimExec.call(r, "FileInput", "getFiles");
3697
- r.files = [], n.each(e, function (e) {
3698
- r.files.push(new t(o.uid, e))
3699
- })
3700
- }, 999), this.getRuntime().shimExec.call(this, "FileInput", "init", i(e.accept), e.name, e.multiple), this.trigger("ready")
3701
- }
3702
- };
3703
- return e.FileInput = i
3704
- }), i(te, [Q, u, W], function (e, t, n) {
3705
- return e.Blob = t.extend({}, n)
3706
- }), i(ne, [Q, h, N], function (e, t, n) {
3707
- var i = {
3708
- init: function () {
3709
- var e = this,
3710
- i = e.getRuntime(),
3711
- r;
3712
- return r = i.getShimContainer(), n.addEvent(r, "dragover", function (e) {
3713
- e.preventDefault(), e.stopPropagation(), e.dataTransfer.dropEffect = "copy"
3714
- }, e.uid), n.addEvent(r, "dragenter", function (e) {
3715
- e.preventDefault();
3716
- var n = t.get(i.uid).dragEnter(e);
3717
- n && e.stopPropagation()
3718
- }, e.uid), n.addEvent(r, "drop", function (e) {
3719
- e.preventDefault();
3720
- var n = t.get(i.uid).dragDrop(e);
3721
- n && e.stopPropagation()
3722
- }, e.uid), i.shimExec.call(this, "FileDrop", "init")
3723
- }
3724
- };
3725
- return e.FileDrop = i
3726
- }), i(ie, [Q, u, Y], function (e, t, n) {
3727
- return e.FileReader = t.extend({}, n)
3728
- }), i(re, [Q, u, $], function (e, t, n) {
3729
- return e.FileReaderSync = t.extend({}, n)
3730
- }), i(oe, [Q, u, J], function (e, t, n) {
3731
- return e.XMLHttpRequest = t.extend({}, n)
3732
- }), i(ae, [Q, u, Z], function (e, t, n) {
3733
- return e.Transporter = t.extend({}, n)
3734
- }), i(se, [Q, u, y, K], function (e, t, n, i) {
3735
- return e.Image = t.extend({}, i, {
3736
- getInfo: function () {
3737
- var e = this.getRuntime(),
3738
- i = ["tiff", "exif", "gps", "thumb"],
3739
- r = {
3740
- meta: {}
3741
- },
3742
- o = e.shimExec.call(this, "Image", "getInfo");
3743
- return o.meta && (t.each(i, function (e) {
3744
- var t = o.meta[e],
3745
- n, i, a, s;
3746
- if (t && t.keys)
3747
- for (r.meta[e] = {}, i = 0, a = t.keys.length; a > i; i++)
3748
- n = t.keys[i], s = t[n], s && (/^(\d|[1-9]\d+)$/.test(s) ? s = parseInt(s, 10) : /^\d*\.\d+$/.test(s) && (s = parseFloat(s)), r.meta[e][n] = s)
3749
- }), !r.meta || !r.meta.thumb || r.meta.thumb.data instanceof n || (r.meta.thumb.data = new n(e.uid, r.meta.thumb.data))), r.width = parseInt(o.width, 10), r.height = parseInt(o.height, 10), r.size = parseInt(o.size, 10), r.type = o.type, r.name = o.name, r
3750
- }
3751
- })
3752
- }), i(ue, [u, f, m, c], function (e, t, n, i) {
3753
- function r(t) {
3754
- var r = this,
3755
- s = n.capTest,
3756
- u = n.capTrue;
3757
- n.call(this, t, o, {
3758
- access_binary: s(window.FileReader || window.File && File.getAsDataURL),
3759
- access_image_binary: !1,
3760
- display_media: s(a.Image && (i.can("create_canvas") || i.can("use_data_uri_over32kb"))),
3761
- do_cors: !1,
3762
- drag_and_drop: !1,
3763
- filter_by_extension: s(function () {
3764
- return "Chrome" === i.browser && i.verComp(i.version, 28, ">=") || "IE" === i.browser && i.verComp(i.version, 10, ">=") || "Safari" === i.browser && i.verComp(i.version, 7, ">=")
3765
- }()),
3766
- resize_image: function () {
3767
- return a.Image && r.can("access_binary") && i.can("create_canvas")
3768
- },
3769
- report_upload_progress: !1,
3770
- return_response_headers: !1,
3771
- return_response_type: function (t) {
3772
- return "json" === t && window.JSON ? !0 : !!~e.inArray(t, ["text", "document", ""])
3773
- },
3774
- return_status_code: function (t) {
3775
- return !e.arrayDiff(t, [200, 404])
3776
- },
3777
- select_file: function () {
3778
- return i.can("use_fileinput")
3779
- },
3780
- select_multiple: !1,
3781
- send_binary_string: !1,
3782
- send_custom_headers: !1,
3783
- send_multipart: !0,
3784
- slice_blob: !1,
3785
- stream_upload: function () {
3786
- return r.can("select_file")
3787
- },
3788
- summon_file_dialog: function () {
3789
- return r.can("select_file") && ("Firefox" === i.browser && i.verComp(i.version, 4, ">=") || "Opera" === i.browser && i.verComp(i.version, 12, ">=") || "IE" === i.browser && i.verComp(i.version, 10, ">=") || !!~e.inArray(i.browser, ["Chrome", "Safari"]))
3790
- },
3791
- upload_filesize: u,
3792
- use_http_method: function (t) {
3793
- return !e.arrayDiff(t, ["GET", "POST"])
3794
- }
3795
- }), e.extend(this, {
3796
- init: function () {
3797
- this.trigger("Init")
3798
- },
3799
- destroy: function (e) {
3800
- return function () {
3801
- e.call(r), e = r = null
3802
- }
3803
- }(this.destroy)
3804
- }), e.extend(this.getShim(), a)
3805
- }
3806
- var o = "html4",
3807
- a = {};
3808
- return n.addConstructor(o, r), a
3809
- }), i(ce, [ue, E, u, h, N, d, c], function (e, t, n, i, r, o, a) {
3810
- function s() {
3811
- function e() {
3812
- var o = this,
3813
- l = o.getRuntime(),
3814
- d, h, f, p, m, g;
3815
- g = n.guid("uid_"), d = l.getShimContainer(), s && (f = i.get(s + "_form"), f && n.extend(f.style, {
3816
- top: "100%"
3817
- })), p = document.createElement("form"), p.setAttribute("id", g + "_form"), p.setAttribute("method", "post"), p.setAttribute("enctype", "multipart/form-data"), p.setAttribute("encoding", "multipart/form-data"), n.extend(p.style, {
3818
- overflow: "hidden",
3819
- position: "absolute",
3820
- top: 0,
3821
- left: 0,
3822
- width: "100%",
3823
- height: "100%"
3824
- }), m = document.createElement("input"), m.setAttribute("id", g), m.setAttribute("type", "file"), m.setAttribute("name", c.name || "Filedata"), m.setAttribute("accept", u.join(",")), n.extend(m.style, {
3825
- fontSize: "999px",
3826
- opacity: 0
3827
- }), p.appendChild(m), d.appendChild(p), n.extend(m.style, {
3828
- position: "absolute",
3829
- top: 0,
3830
- left: 0,
3831
- width: "100%",
3832
- height: "100%"
3833
- }), "IE" === a.browser && a.verComp(a.version, 10, "<") && n.extend(m.style, {
3834
- filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=0)"
3835
- }), m.onchange = function () {
3836
- var n;
3837
- if (this.value) {
3838
- if (this.files) {
3839
- if (n = this.files[0], 0 === n.size)
3840
- return void p.parentNode.removeChild(p)
3841
- } else
3842
- n = {
3843
- name: this.value
3844
- };
3845
- n = new t(l.uid, n), this.onchange = function () {}, e.call(o), o.files = [n], m.setAttribute("id", n.uid), p.setAttribute("id", n.uid + "_form"), o.trigger("change"), m = p = null
3846
- }
3847
- }, l.can("summon_file_dialog") && (h = i.get(c.browse_button), r.removeEvent(h, "click", o.uid), r.addEvent(h, "click", function (e) {
3848
- m && !m.disabled && m.click(), e.preventDefault()
3849
- }, o.uid)), s = g, d = f = h = null
3850
- }
3851
- var s, u = [],
3852
- c;
3853
- n.extend(this, {
3854
- init: function (t) {
3855
- var n = this,
3856
- a = n.getRuntime(),
3857
- s;
3858
- c = t, u = t.accept.mimes || o.extList2mimes(t.accept, a.can("filter_by_extension")), s = a.getShimContainer(),
3859
- function () {
3860
- var e, o, u;
3861
- e = i.get(t.browse_button), a.can("summon_file_dialog") && ("static" === i.getStyle(e, "position") && (e.style.position = "relative"), o = parseInt(i.getStyle(e, "z-index"), 10) || 1, e.style.zIndex = o, s.style.zIndex = o - 1), u = a.can("summon_file_dialog") ? e : s, r.addEvent(u, "mouseover", function () {
3862
- n.trigger("mouseenter")
3863
- }, n.uid), r.addEvent(u, "mouseout", function () {
3864
- n.trigger("mouseleave")
3865
- }, n.uid), r.addEvent(u, "mousedown", function () {
3866
- n.trigger("mousedown")
3867
- }, n.uid), r.addEvent(i.get(t.container), "mouseup", function () {
3868
- n.trigger("mouseup")
3869
- }, n.uid), e = null
3870
- }(), e.call(this), s = null, n.trigger({
3871
- type: "ready",
3872
- async: !0
3873
- })
3874
- },
3875
- disable: function (e) {
3876
- var t;
3877
- (t = i.get(s)) && (t.disabled = !!e)
3878
- },
3879
- destroy: function () {
3880
- var e = this.getRuntime(),
3881
- t = e.getShim(),
3882
- n = e.getShimContainer();
3883
- r.removeAllEvents(n, this.uid), r.removeAllEvents(c && i.get(c.container), this.uid), r.removeAllEvents(c && i.get(c.browse_button), this.uid), n && (n.innerHTML = ""), t.removeInstance(this.uid), s = u = c = n = t = null
3884
- }
3885
- })
3886
- }
3887
- return e.FileInput = s
3888
- }), i(le, [ue, F], function (e, t) {
3889
- return e.FileReader = t
3890
- }), i(de, [ue, u, h, x, f, N, y, I], function (e, t, n, i, r, o, a, s) {
3891
- function u() {
3892
- function e(e) {
3893
- var t = this,
3894
- i, r, a, s, u = !1;
3895
- if (l) {
3896
- if (i = l.id.replace(/_iframe$/, ""), r = n.get(i + "_form")) {
3897
- for (a = r.getElementsByTagName("input"), s = a.length; s--; )
3898
- switch (a[s].getAttribute("type")) {
3899
- case "hidden":
3900
- a[s].parentNode.removeChild(a[s]);
3901
- break;
3902
- case "file":
3903
- u = !0
3904
- }
3905
- a = [], u || r.parentNode.removeChild(r), r = null
3906
- }
3907
- setTimeout(function () {
3908
- o.removeEvent(l, "load", t.uid), l.parentNode && l.parentNode.removeChild(l);
3909
- var n = t.getRuntime().getShimContainer();
3910
- n.children.length || n.parentNode.removeChild(n), n = l = null, e()
3911
- }, 1)
3912
- }
3913
- }
3914
- var u, c, l;
3915
- t.extend(this, {
3916
- send: function (d, h) {
3917
- function f() {
3918
- var n = m.getShimContainer() || document.body,
3919
- r = document.createElement("div");
3920
- r.innerHTML = '<iframe id="' + g + '_iframe" name="' + g + '_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>', l = r.firstChild, n.appendChild(l), o.addEvent(l, "load", function () {
3921
- var n;
3922
- try {
3923
- n = l.contentWindow.document || l.contentDocument || window.frames[l.id].document, /^4(0[0-9]|1[0-7]|2[2346])\s/.test(n.title) ? u = n.title.replace(/^(\d+).*$/, "$1") : (u = 200, c = t.trim(n.body.innerHTML), p.trigger({
3924
- type: "progress",
3925
- loaded: c.length,
3926
- total: c.length
3927
- }), y && p.trigger({
3928
- type: "uploadprogress",
3929
- loaded: y.size || 1025,
3930
- total: y.size || 1025
3931
- }))
3932
- } catch (r) {
3933
- if (!i.hasSameOrigin(d.url))
3934
- return void e.call(p, function () {
3935
- p.trigger("error")
3936
- });
3937
- u = 404
3938
- }
3939
- e.call(p, function () {
3940
- p.trigger("load")
3941
- })
3942
- }, p.uid)
3943
- }
3944
- var p = this,
3945
- m = p.getRuntime(),
3946
- g, v, w, y;
3947
- if (u = c = null, h instanceof s && h.hasBlob()) {
3948
- if (y = h.getBlob(), g = y.uid, w = n.get(g), v = n.get(g + "_form"), !v)
3949
- throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)
3950
- } else
3951
- g = t.guid("uid_"), v = document.createElement("form"), v.setAttribute("id", g + "_form"), v.setAttribute("method", d.method), v.setAttribute("enctype", "multipart/form-data"), v.setAttribute("encoding", "multipart/form-data"), m.getShimContainer().appendChild(v);
3952
- v.setAttribute("target", g + "_iframe"), h instanceof s && h.each(function (e, n) {
3953
- if (e instanceof a)
3954
- w && w.setAttribute("name", n);
3955
- else {
3956
- var i = document.createElement("input");
3957
- t.extend(i, {
3958
- type: "hidden",
3959
- name: n,
3960
- value: e
3961
- }), w ? v.insertBefore(i, w) : v.appendChild(i)
3962
- }
3963
- }), v.setAttribute("action", d.url), f(), v.submit(), p.trigger("loadstart")
3964
- },
3965
- getStatus: function () {
3966
- return u
3967
- },
3968
- getResponse: function (e) {
3969
- if ("json" === e && "string" === t.typeOf(c) && window.JSON)
3970
- try {
3971
- return JSON.parse(c.replace(/^\s*<pre[^>]*>/, "").replace(/<\/pre>\s*$/, ""))
3972
- } catch (n) {
3973
- return null
3974
- }
3975
- return c
3976
- },
3977
- abort: function () {
3978
- var t = this;
3979
- l && l.contentWindow && (l.contentWindow.stop ? l.contentWindow.stop() : l.contentWindow.document.execCommand ? l.contentWindow.document.execCommand("Stop") : l.src = "about:blank"), e.call(this, function () {
3980
- t.dispatchEvent("abort")
3981
- })
3982
- }
3983
- })
3984
- }
3985
- return e.XMLHttpRequest = u
3986
- }), i(he, [ue, j], function (e, t) {
3987
- return e.Image = t
3988
- }), a([u, c, l, d, h, f, p, m, g, v, w, y, E, _, b, x, R, A, I, T, S, O, N])
3989
- }(this);
3990
- ;
3991
- (function (e) {
3992
- "use strict";
3993
- var t = {},
3994
- n = e.moxie.core.utils.Basic.inArray;
3995
- return function r(e) {
3996
- var i, s;
3997
- for (i in e)
3998
- s = typeof e[i], s === "object" && !~n(i, ["Exceptions", "Env", "Mime"]) ? r(e[i]) : s === "function" && (t[i] = e[i])
3999
- }(e.moxie), t.Env = e.moxie.core.utils.Env, t.Mime = e.moxie.core.utils.Mime, t.Exceptions = e.moxie.core.Exceptions, e.mOxie = t, e.o || (e.o = t), t
4000
- })(this);
4001
  /**
4002
  * Plupload - multi-runtime File Uploader
4003
- * v2.1.9
4004
  *
4005
  * Copyright 2013, Moxiecode Systems AB
4006
  * Released under GPL License.
@@ -4008,660 +24,6 @@
4008
  * License: http://www.plupload.com/license
4009
  * Contributing: http://www.plupload.com/contributing
4010
  *
4011
- * Date: 2015-07-21
4012
  */
4013
- ;
4014
- (function (e, t, n) {
4015
- function s(e) {
4016
- function r(e, t, r) {
4017
- var i = {
4018
- chunks: "slice_blob",
4019
- jpgresize: "send_binary_string",
4020
- pngresize: "send_binary_string",
4021
- progress: "report_upload_progress",
4022
- multi_selection: "select_multiple",
4023
- dragdrop: "drag_and_drop",
4024
- drop_element: "drag_and_drop",
4025
- headers: "send_custom_headers",
4026
- urlstream_upload: "send_binary_string",
4027
- canSendBinary: "send_binary",
4028
- triggerDialog: "summon_file_dialog"
4029
- };
4030
- i[e] ? n[i[e]] = t : r || (n[e] = t)
4031
- }
4032
- var t = e.required_features,
4033
- n = {};
4034
- if (typeof t == "string")
4035
- o.each(t.split(/\s*,\s*/), function (e) {
4036
- r(e, !0)
4037
- });
4038
- else if (typeof t == "object")
4039
- o.each(t, function (e, t) {
4040
- r(t, e)
4041
- });
4042
- else if (t === !0) {
4043
- e.chunk_size > 0 && (n.slice_blob = !0);
4044
- if (e.resize.enabled || !e.multipart)
4045
- n.send_binary_string = !0;
4046
- o.each(e, function (e, t) {
4047
- r(t, !!e, !0)
4048
- })
4049
- }
4050
- return n
4051
- }
4052
- var r = e.setTimeout,
4053
- i = {},
4054
- o = {
4055
- VERSION: "2.1.8",
4056
- STOPPED: 1,
4057
- STARTED: 2,
4058
- QUEUED: 1,
4059
- UPLOADING: 2,
4060
- FAILED: 4,
4061
- DONE: 5,
4062
- GENERIC_ERROR: -100,
4063
- HTTP_ERROR: -200,
4064
- IO_ERROR: -300,
4065
- SECURITY_ERROR: -400,
4066
- INIT_ERROR: -500,
4067
- FILE_SIZE_ERROR: -600,
4068
- FILE_EXTENSION_ERROR: -601,
4069
- FILE_DUPLICATE_ERROR: -602,
4070
- IMAGE_FORMAT_ERROR: -700,
4071
- MEMORY_ERROR: -701,
4072
- IMAGE_DIMENSIONS_ERROR: -702,
4073
- mimeTypes: t.mimes,
4074
- ua: t.ua,
4075
- typeOf: t.typeOf,
4076
- extend: t.extend,
4077
- guid: t.guid,
4078
- get: function (n) {
4079
- var r = [],
4080
- i;
4081
- t.typeOf(n) !== "array" && (n = [n]);
4082
- var s = n.length;
4083
- while (s--)
4084
- i = t.get(n[s]), i && r.push(i);
4085
- return r.length ? r : null
4086
- },
4087
- each: t.each,
4088
- getPos: t.getPos,
4089
- getSize: t.getSize,
4090
- xmlEncode: function (e) {
4091
- var t = {
4092
- "<": "lt",
4093
- ">": "gt",
4094
- "&": "amp",
4095
- '"': "quot",
4096
- "'": "#39"
4097
- },
4098
- n = /[<>&\"\']/g;
4099
- return e ? ("" + e).replace(n, function (e) {
4100
- return t[e] ? "&" + t[e] + ";" : e
4101
- }) : e
4102
- },
4103
- toArray: t.toArray,
4104
- inArray: t.inArray,
4105
- addI18n: t.addI18n,
4106
- translate: t.translate,
4107
- isEmptyObj: t.isEmptyObj,
4108
- hasClass: t.hasClass,
4109
- addClass: t.addClass,
4110
- removeClass: t.removeClass,
4111
- getStyle: t.getStyle,
4112
- addEvent: t.addEvent,
4113
- removeEvent: t.removeEvent,
4114
- removeAllEvents: t.removeAllEvents,
4115
- cleanName: function (e) {
4116
- var t, n;
4117
- n = [/[\300-\306]/g, "A", /[\340-\346]/g, "a", /\307/g, "C", /\347/g, "c", /[\310-\313]/g, "E", /[\350-\353]/g, "e", /[\314-\317]/g, "I", /[\354-\357]/g, "i", /\321/g, "N", /\361/g, "n", /[\322-\330]/g, "O", /[\362-\370]/g, "o", /[\331-\334]/g, "U", /[\371-\374]/g, "u"];
4118
- for (t = 0; t < n.length; t += 2)
4119
- e = e.replace(n[t], n[t + 1]);
4120
- return e = e.replace(/\s+/g, "_"), e = e.replace(/[^a-z0-9_\-\.]+/gi, ""), e
4121
- },
4122
- buildUrl: function (e, t) {
4123
- var n = "";
4124
- return o.each(t, function (e, t) {
4125
- n += (n ? "&" : "") + encodeURIComponent(t) + "=" + encodeURIComponent(e)
4126
- }), n && (e += (e.indexOf("?") > 0 ? "&" : "?") + n), e
4127
- },
4128
- formatSize: function (e) {
4129
- function t(e, t) {
4130
- return Math.round(e * Math.pow(10, t)) / Math.pow(10, t)
4131
- }
4132
- if (e === n || /\D/.test(e))
4133
- return o.translate("N/A");
4134
- var r = Math.pow(1024, 4);
4135
- return e > r ? t(e / r, 1) + " " + o.translate("tb") : e > (r /= 1024) ? t(e / r, 1) + " " + o.translate("gb") : e > (r /= 1024) ? t(e / r, 1) + " " + o.translate("mb") : e > 1024 ? Math.round(e / 1024) + " " + o.translate("kb") : e + " " + o.translate("b")
4136
- },
4137
- parseSize: t.parseSizeStr,
4138
- predictRuntime: function (e, n) {
4139
- var r, i;
4140
- return r = new o.Uploader(e), i = t.Runtime.thatCan(r.getOption().required_features, n || e.runtimes), r.destroy(), i
4141
- },
4142
- addFileFilter: function (e, t) {
4143
- i[e] = t
4144
- }
4145
- };
4146
- o.addFileFilter("mime_types", function (e, t, n) {
4147
- e.length && !e.regexp.test(t.name) ? (this.trigger("Error", {
4148
- code: o.FILE_EXTENSION_ERROR,
4149
- message: o.translate("File extension error."),
4150
- file: t
4151
- }), n(!1)) : n(!0)
4152
- }), o.addFileFilter("max_file_size", function (e, t, n) {
4153
- var r;
4154
- e = o.parseSize(e), t.size !== r && e && t.size > e ? (this.trigger("Error", {
4155
- code: o.FILE_SIZE_ERROR,
4156
- message: o.translate("File size error."),
4157
- file: t
4158
- }), n(!1)) : n(!0)
4159
- }), o.addFileFilter("prevent_duplicates", function (e, t, n) {
4160
- if (e) {
4161
- var r = this.files.length;
4162
- while (r--)
4163
- if (t.name === this.files[r].name && t.size === this.files[r].size) {
4164
- this.trigger("Error", {
4165
- code: o.FILE_DUPLICATE_ERROR,
4166
- message: o.translate("Duplicate file error."),
4167
- file: t
4168
- }), n(!1);
4169
- return
4170
- }
4171
- }
4172
- n(!0)
4173
- }), o.Uploader = function (e) {
4174
- function g() {
4175
- var e, t = 0,
4176
- n;
4177
- if (this.state == o.STARTED) {
4178
- for (n = 0; n < f.length; n++)
4179
- !e && f[n].status == o.QUEUED ? (e = f[n], this.trigger("BeforeUpload", e) && (e.status = o.UPLOADING, this.trigger("UploadFile", e))) : t++;
4180
- t == f.length && (this.state !== o.STOPPED && (this.state = o.STOPPED, this.trigger("StateChanged")), this.trigger("UploadComplete", f))
4181
- }
4182
- }
4183
-
4184
- function y(e) {
4185
- e.percent = e.size > 0 ? Math.ceil(e.loaded / e.size * 100) : 100, b()
4186
- }
4187
-
4188
- function b() {
4189
- var e, t;
4190
- d.reset();
4191
- for (e = 0; e < f.length; e++)
4192
- t = f[e], t.size !== n ? (d.size += t.origSize, d.loaded += t.loaded * t.origSize / t.size) : d.size = n, t.status == o.DONE ? d.uploaded++ : t.status == o.FAILED ? d.failed++ : d.queued++;
4193
- d.size === n ? d.percent = f.length > 0 ? Math.ceil(d.uploaded / f.length * 100) : 0 : (d.bytesPerSec = Math.ceil(d.loaded / ((+(new Date) - p || 1) / 1e3)), d.percent = d.size > 0 ? Math.ceil(d.loaded / d.size * 100) : 0)
4194
- }
4195
-
4196
- function w() {
4197
- var e = c[0] || h[0];
4198
- return e ? e.getRuntime().uid : !1
4199
- }
4200
-
4201
- function E(e, n) {
4202
- if (e.ruid) {
4203
- var r = t.Runtime.getInfo(e.ruid);
4204
- if (r)
4205
- return r.can(n)
4206
- }
4207
- return !1
4208
- }
4209
-
4210
- function S() {
4211
- this.bind("FilesAdded FilesRemoved", function (e) {
4212
- e.trigger("QueueChanged"), e.refresh()
4213
- }), this.bind("CancelUpload", O), this.bind("BeforeUpload", C), this.bind("UploadFile", k), this.bind("UploadProgress", L), this.bind("StateChanged", A), this.bind("QueueChanged", b), this.bind("Error", _), this.bind("FileUploaded", M), this.bind("Destroy", D)
4214
- }
4215
-
4216
- function x(e, n) {
4217
- var r = this,
4218
- i = 0,
4219
- s = [],
4220
- u = {
4221
- runtime_order: e.runtimes,
4222
- required_caps: e.required_features,
4223
- preferred_caps: l,
4224
- swf_url: e.flash_swf_url,
4225
- xap_url: e.silverlight_xap_url
4226
- };
4227
- o.each(e.runtimes.split(/\s*,\s*/), function (t) {
4228
- e[t] && (u[t] = e[t])
4229
- }), e.browse_button && o.each(e.browse_button, function (n) {
4230
- s.push(function (s) {
4231
- var a = new t.FileInput(o.extend({}, u, {
4232
- accept: e.filters.mime_types,
4233
- name: e.file_data_name,
4234
- multiple: e.multi_selection,
4235
- container: e.container,
4236
- browse_button: n
4237
- }));
4238
- a.onready = function () {
4239
- var e = t.Runtime.getInfo(this.ruid);
4240
- t.extend(r.features, {
4241
- chunks: e.can("slice_blob"),
4242
- multipart: e.can("send_multipart"),
4243
- multi_selection: e.can("select_multiple")
4244
- }), i++, c.push(this), s()
4245
- }, a.onchange = function () {
4246
- r.addFile(this.files)
4247
- }, a.bind("mouseenter mouseleave mousedown mouseup", function (r) {
4248
- v || (e.browse_button_hover && ("mouseenter" === r.type ? t.addClass(n, e.browse_button_hover) : "mouseleave" === r.type && t.removeClass(n, e.browse_button_hover)), e.browse_button_active && ("mousedown" === r.type ? t.addClass(n, e.browse_button_active) : "mouseup" === r.type && t.removeClass(n, e.browse_button_active)))
4249
- }), a.bind("mousedown", function () {
4250
- r.trigger("Browse")
4251
- }), a.bind("error runtimeerror", function () {
4252
- a = null, s()
4253
- }), a.init()
4254
- })
4255
- }), e.drop_element && o.each(e.drop_element, function (e) {
4256
- s.push(function (n) {
4257
- var s = new t.FileDrop(o.extend({}, u, {
4258
- drop_zone: e
4259
- }));
4260
- s.onready = function () {
4261
- var e = t.Runtime.getInfo(this.ruid);
4262
- r.features.dragdrop = e.can("drag_and_drop"), i++, h.push(this), n()
4263
- }, s.ondrop = function () {
4264
- r.addFile(this.files)
4265
- }, s.bind("error runtimeerror", function () {
4266
- s = null, n()
4267
- }), s.init()
4268
- })
4269
- }), t.inSeries(s, function () {
4270
- typeof n == "function" && n(i)
4271
- })
4272
- }
4273
-
4274
- function T(e, r, i) {
4275
- var s = new t.Image;
4276
- try {
4277
- s.onload = function () {
4278
- if (r.width > this.width && r.height > this.height && r.quality === n && r.preserve_headers && !r.crop)
4279
- return this.destroy(), i(e);
4280
- s.downsize(r.width, r.height, r.crop, r.preserve_headers)
4281
- }, s.onresize = function () {
4282
- i(this.getAsBlob(e.type, r.quality)), this.destroy()
4283
- }, s.onerror = function () {
4284
- i(e)
4285
- }, s.load(e)
4286
- } catch (o) {
4287
- i(e)
4288
- }
4289
- }
4290
-
4291
- function N(e, n, r) {
4292
- function f(e, t, n) {
4293
- var r = a[e];
4294
- switch (e) {
4295
- case "max_file_size":
4296
- e === "max_file_size" && (a.max_file_size = a.filters.max_file_size = t);
4297
- break;
4298
- case "chunk_size":
4299
- if (t = o.parseSize(t))
4300
- a[e] = t, a.send_file_name = !0;
4301
- break;
4302
- case "multipart":
4303
- a[e] = t, t || (a.send_file_name = !0);
4304
- break;
4305
- case "unique_names":
4306
- a[e] = t, t && (a.send_file_name = !0);
4307
- break;
4308
- case "filters":
4309
- o.typeOf(t) === "array" && (t = {
4310
- mime_types: t
4311
- }), n ? o.extend(a.filters, t) : a.filters = t, t.mime_types && (a.filters.mime_types.regexp = function (e) {
4312
- var t = [];
4313
- return o.each(e, function (e) {
4314
- o.each(e.extensions.split(/,/), function (e) {
4315
- /^\s*\*\s*$/.test(e) ? t.push("\\.*") : t.push("\\." + e.replace(new RegExp("[" + "/^$.*+?|()[]{}\\".replace(/./g, "\\$&") + "]", "g"), "\\$&"))
4316
- })
4317
- }), new RegExp("(" + t.join("|") + ")$", "i")
4318
- }(a.filters.mime_types));
4319
- break;
4320
- case "resize":
4321
- n ? o.extend(a.resize, t, {
4322
- enabled: !0
4323
- }) : a.resize = t;
4324
- break;
4325
- case "prevent_duplicates":
4326
- a.prevent_duplicates = a.filters.prevent_duplicates = !!t;
4327
- break;
4328
- case "browse_button":
4329
- case "drop_element":
4330
- t = o.get(t);
4331
- case "container":
4332
- case "runtimes":
4333
- case "multi_selection":
4334
- case "flash_swf_url":
4335
- case "silverlight_xap_url":
4336
- a[e] = t, n || (u = !0);
4337
- break;
4338
- default:
4339
- a[e] = t
4340
- }
4341
- n || i.trigger("OptionChanged", e, t, r)
4342
- }
4343
- var i = this,
4344
- u = !1;
4345
- typeof e == "object" ? o.each(e, function (e, t) {
4346
- f(t, e, r)
4347
- }) : f(e, n, r), r ? (a.required_features = s(o.extend({}, a)), l = s(o.extend({}, a, {
4348
- required_features: !0
4349
- }))) : u && (i.trigger("Destroy"), x.call(i, a, function (e) {
4350
- e ? (i.runtime = t.Runtime.getInfo(w()).type, i.trigger("Init", {
4351
- runtime: i.runtime
4352
- }), i.trigger("PostInit")) : i.trigger("Error", {
4353
- code: o.INIT_ERROR,
4354
- message: o.translate("Init error.")
4355
- })
4356
- }))
4357
- }
4358
-
4359
- function C(e, t) {
4360
- if (e.settings.unique_names) {
4361
- var n = t.name.match(/\.([^.]+)$/),
4362
- r = "part";
4363
- n && (r = n[1]), t.target_name = t.id + "." + r
4364
- }
4365
- }
4366
-
4367
- function k(e, n) {
4368
- function h() {
4369
- u-- > 0 ? r(p, 1e3) : (n.loaded = f, e.trigger("Error", {
4370
- code: o.HTTP_ERROR,
4371
- message: o.translate("HTTP Error."),
4372
- file: n,
4373
- response: m.responseText,
4374
- status: m.status,
4375
- responseHeaders: m.getAllResponseHeaders()
4376
- }))
4377
- }
4378
-
4379
- function p() {
4380
- var d, v, g = {},
4381
- y;
4382
- if (n.status !== o.UPLOADING || e.state === o.STOPPED)
4383
- return;
4384
- e.settings.send_file_name && (g.name = n.target_name || n.name), s && a.chunks && c.size > s ? (y = Math.min(s, c.size - f), d = c.slice(f, f + y)) : (y = c.size, d = c), s && a.chunks && (e.settings.send_chunk_number ? (g.chunk = Math.ceil(f / s), g.chunks = Math.ceil(c.size / s)) : (g.offset = f, g.total = c.size)), m = new t.XMLHttpRequest, m.upload && (m.upload.onprogress = function (t) {
4385
- n.loaded = Math.min(n.size, f + t.loaded), e.trigger("UploadProgress", n)
4386
- }), m.onload = function () {
4387
- if (m.status >= 400) {
4388
- h();
4389
- return
4390
- }
4391
- u = e.settings.max_retries, y < c.size ? (d.destroy(), f += y, n.loaded = Math.min(f, c.size), e.trigger("ChunkUploaded", n, {
4392
- offset: n.loaded,
4393
- total: c.size,
4394
- response: m.responseText,
4395
- status: m.status,
4396
- responseHeaders: m.getAllResponseHeaders()
4397
- }), t.Env.browser === "Android Browser" && e.trigger("UploadProgress", n)) : n.loaded = n.size, d = v = null, !f || f >= c.size ? (n.size != n.origSize && (c.destroy(), c = null), e.trigger("UploadProgress", n), n.status = o.DONE, e.trigger("FileUploaded", n, {
4398
- response: m.responseText,
4399
- status: m.status,
4400
- responseHeaders: m.getAllResponseHeaders()
4401
- })) : r(p, 1)
4402
- }, m.onerror = function () {
4403
- h()
4404
- }, m.onloadend = function () {
4405
- this.destroy(), m = null
4406
- }, e.settings.multipart && a.multipart ? (m.open("post", i, !0), o.each(e.settings.headers, function (e, t) {
4407
- m.setRequestHeader(t, e)
4408
- }), v = new t.FormData, o.each(o.extend(g, e.settings.multipart_params), function (e, t) {
4409
- v.append(t, e)
4410
- }), v.append(e.settings.file_data_name, d), m.send(v, {
4411
- runtime_order: e.settings.runtimes,
4412
- required_caps: e.settings.required_features,
4413
- preferred_caps: l,
4414
- swf_url: e.settings.flash_swf_url,
4415
- xap_url: e.settings.silverlight_xap_url
4416
- })) : (i = o.buildUrl(e.settings.url, o.extend(g, e.settings.multipart_params)), m.open("post", i, !0), m.setRequestHeader("Content-Type", "application/octet-stream"), o.each(e.settings.headers, function (e, t) {
4417
- m.setRequestHeader(t, e)
4418
- }), m.send(d, {
4419
- runtime_order: e.settings.runtimes,
4420
- required_caps: e.settings.required_features,
4421
- preferred_caps: l,
4422
- swf_url: e.settings.flash_swf_url,
4423
- xap_url: e.settings.silverlight_xap_url
4424
- }))
4425
- }
4426
- var i = e.settings.url,
4427
- s = e.settings.chunk_size,
4428
- u = e.settings.max_retries,
4429
- a = e.features,
4430
- f = 0,
4431
- c;
4432
- n.loaded && (f = n.loaded = s ? s * Math.floor(n.loaded / s) : 0), c = n.getSource(), e.settings.resize.enabled && E(c, "send_binary_string") && !!~t.inArray(c.type, ["image/jpeg", "image/png"]) ? T.call(this, c, e.settings.resize, function (e) {
4433
- c = e, n.size = e.size, p()
4434
- }) : p()
4435
- }
4436
-
4437
- function L(e, t) {
4438
- y(t)
4439
- }
4440
-
4441
- function A(e) {
4442
- if (e.state == o.STARTED)
4443
- p = +(new Date);
4444
- else if (e.state == o.STOPPED)
4445
- for (var t = e.files.length - 1; t >= 0; t--)
4446
- e.files[t].status == o.UPLOADING && (e.files[t].status = o.QUEUED, b())
4447
- }
4448
-
4449
- function O() {
4450
- m && m.abort()
4451
- }
4452
-
4453
- function M(e) {
4454
- b(), r(function () {
4455
- g.call(e)
4456
- }, 1)
4457
- }
4458
-
4459
- function _(e, t) {
4460
- t.code === o.INIT_ERROR ? e.destroy() : t.code === o.HTTP_ERROR && (t.file.status = o.FAILED, y(t.file), e.state == o.STARTED && (e.trigger("CancelUpload"), r(function () {
4461
- g.call(e)
4462
- }, 1)))
4463
- }
4464
-
4465
- function D(e) {
4466
- e.stop(), o.each(f, function (e) {
4467
- e.destroy()
4468
- }), f = [], c.length && (o.each(c, function (e) {
4469
- e.destroy()
4470
- }), c = []), h.length && (o.each(h, function (e) {
4471
- e.destroy()
4472
- }), h = []), l = {}, v = !1, p = m = null, d.reset()
4473
- }
4474
- var u = o.guid(),
4475
- a, f = [],
4476
- l = {},
4477
- c = [],
4478
- h = [],
4479
- p, d, v = !1,
4480
- m;
4481
- a = {
4482
- runtimes: t.Runtime.order,
4483
- max_retries: 0,
4484
- chunk_size: 0,
4485
- multipart: !0,
4486
- multi_selection: !0,
4487
- file_data_name: "file",
4488
- flash_swf_url: "js/Moxie.swf",
4489
- silverlight_xap_url: "js/Moxie.xap",
4490
- filters: {
4491
- mime_types: [],
4492
- prevent_duplicates: !1,
4493
- max_file_size: 0
4494
- },
4495
- resize: {
4496
- enabled: !1,
4497
- preserve_headers: !0,
4498
- crop: !1
4499
- },
4500
- send_file_name: !0,
4501
- send_chunk_number: !0
4502
- }, N.call(this, e, null, !0), d = new o.QueueProgress, o.extend(this, {
4503
- id: u,
4504
- uid: u,
4505
- state: o.STOPPED,
4506
- features: {},
4507
- runtime: null,
4508
- files: f,
4509
- settings: a,
4510
- total: d,
4511
- init: function () {
4512
- var e = this;
4513
- typeof a.preinit == "function" ? a.preinit(e) : o.each(a.preinit, function (t, n) {
4514
- e.bind(n, t)
4515
- }), S.call(this);
4516
- if (!a.browse_button || !a.url) {
4517
- this.trigger("Error", {
4518
- code: o.INIT_ERROR,
4519
- message: o.translate("Init error.")
4520
- });
4521
- return
4522
- }
4523
- x.call(this, a, function (n) {
4524
- typeof a.init == "function" ? a.init(e) : o.each(a.init, function (t, n) {
4525
- e.bind(n, t)
4526
- }), n ? (e.runtime = t.Runtime.getInfo(w()).type, e.trigger("Init", {
4527
- runtime: e.runtime
4528
- }), e.trigger("PostInit")) : e.trigger("Error", {
4529
- code: o.INIT_ERROR,
4530
- message: o.translate("Init error.")
4531
- })
4532
- })
4533
- },
4534
- setOption: function (e, t) {
4535
- N.call(this, e, t, !this.runtime)
4536
- },
4537
- getOption: function (e) {
4538
- return e ? a[e] : a
4539
- },
4540
- refresh: function () {
4541
- c.length && o.each(c, function (e) {
4542
- e.trigger("Refresh")
4543
- }), this.trigger("Refresh")
4544
- },
4545
- start: function () {
4546
- this.state != o.STARTED && (this.state = o.STARTED, this.trigger("StateChanged"), g.call(this))
4547
- },
4548
- stop: function () {
4549
- this.state != o.STOPPED && (this.state = o.STOPPED, this.trigger("StateChanged"), this.trigger("CancelUpload"))
4550
- },
4551
- disableBrowse: function () {
4552
- v = arguments[0] !== n ? arguments[0] : !0, c.length && o.each(c, function (e) {
4553
- e.disable(v)
4554
- }), this.trigger("DisableBrowse", v)
4555
- },
4556
- getFile: function (e) {
4557
- var t;
4558
- for (t = f.length - 1; t >= 0; t--)
4559
- if (f[t].id === e)
4560
- return f[t]
4561
- },
4562
- addFile: function (e, n) {
4563
- function c(e, n) {
4564
- var r = [];
4565
- t.each(s.settings.filters, function (t, n) {
4566
- i[n] && r.push(function (r) {
4567
- i[n].call(s, t, e, function (e) {
4568
- r(!e)
4569
- })
4570
- })
4571
- }), t.inSeries(r, n)
4572
- }
4573
-
4574
- function h(e) {
4575
- var i = t.typeOf(e);
4576
- if (e instanceof t.File) {
4577
- if (!e.ruid && !e.isDetached()) {
4578
- if (!l)
4579
- return !1;
4580
- e.ruid = l, e.connectRuntime(l)
4581
- }
4582
- h(new o.File(e))
4583
- } else
4584
- e instanceof t.Blob ? (h(e.getSource()), e.destroy()) : e instanceof o.File ? (n && (e.name = n), u.push(function (t) {
4585
- c(e, function (n) {
4586
- n || (f.push(e), a.push(e), s.trigger("FileFiltered", e)), r(t, 1)
4587
- })
4588
- })) : t.inArray(i, ["file", "blob"]) !== -1 ? h(new t.File(null, e)) : i === "node" && t.typeOf(e.files) === "filelist" ? t.each(e.files, h) : i === "array" && (n = null, t.each(e, h))
4589
- }
4590
- var s = this,
4591
- u = [],
4592
- a = [],
4593
- l;
4594
- l = w(), h(e), u.length && t.inSeries(u, function () {
4595
- a.length && s.trigger("FilesAdded", a)
4596
- })
4597
- },
4598
- removeFile: function (e) {
4599
- var t = typeof e == "string" ? e : e.id;
4600
- for (var n = f.length - 1; n >= 0; n--)
4601
- if (f[n].id === t)
4602
- return this.splice(n, 1)[0]
4603
- },
4604
- splice: function (e, t) {
4605
- var r = f.splice(e === n ? 0 : e, t === n ? f.length : t),
4606
- i = !1;
4607
- return this.state == o.STARTED && (o.each(r, function (e) {
4608
- if (e.status === o.UPLOADING)
4609
- return i = !0, !1
4610
- }), i && this.stop()), this.trigger("FilesRemoved", r), o.each(r, function (e) {
4611
- e.destroy()
4612
- }), i && this.start(), r
4613
- },
4614
- dispatchEvent: function (e) {
4615
- var t, n, r;
4616
- e = e.toLowerCase(), t = this.hasEventListener(e);
4617
- if (t) {
4618
- t.sort(function (e, t) {
4619
- return t.priority - e.priority
4620
- }), n = [].slice.call(arguments), n.shift(), n.unshift(this);
4621
- for (var i = 0; i < t.length; i++)
4622
- if (t[i].fn.apply(t[i].scope, n) === !1)
4623
- return !1
4624
- }
4625
- return !0
4626
- },
4627
- bind: function (e, t, n, r) {
4628
- o.Uploader.prototype.bind.call(this, e, t, r, n)
4629
- },
4630
- destroy: function () {
4631
- this.trigger("Destroy"), a = d = null, this.unbindAll()
4632
- }
4633
- })
4634
- }, o.Uploader.prototype = t.EventTarget.instance, o.File = function () {
4635
- function n(n) {
4636
- o.extend(this, {
4637
- id: o.guid(),
4638
- name: n.name || n.fileName,
4639
- type: n.type || "",
4640
- size: n.size || n.fileSize,
4641
- origSize: n.size || n.fileSize,
4642
- loaded: 0,
4643
- percent: 0,
4644
- status: o.QUEUED,
4645
- lastModifiedDate: n.lastModifiedDate || (new Date).toLocaleString(),
4646
- getNative: function () {
4647
- var e = this.getSource().getSource();
4648
- return t.inArray(t.typeOf(e), ["blob", "file"]) !== -1 ? e : null
4649
- },
4650
- getSource: function () {
4651
- return e[this.id] ? e[this.id] : null
4652
- },
4653
- destroy: function () {
4654
- var t = this.getSource();
4655
- t && (t.destroy(), delete e[this.id])
4656
- }
4657
- }), e[this.id] = n
4658
- }
4659
- var e = {};
4660
- return n
4661
- }(), o.QueueProgress = function () {
4662
- var e = this;
4663
- e.size = 0, e.loaded = 0, e.uploaded = 0, e.failed = 0, e.queued = 0, e.percent = 0, e.bytesPerSec = 0, e.reset = function () {
4664
- e.size = e.loaded = e.uploaded = e.failed = e.queued = e.percent = e.bytesPerSec = 0
4665
- }
4666
- }, e.plupload = o
4667
- })(window, mOxie);
1
  /**
2
  * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
3
+ * v1.5.3
4
  *
5
  * Copyright 2013, Moxiecode Systems AB
6
  * Released under GPL License.
8
  * License: http://www.plupload.com/license
9
  * Contributing: http://www.plupload.com/contributing
10
  *
11
+ * Date: 2017-02-02
12
  */
13
+ !function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r<e.length;++r){if(i=s[e[r]]||o(e[r]),!i)throw"module definition dependecy not found: "+e[r];n.push(i)}t.apply(null,n)}function n(e,n,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(n===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";i(n,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function o(t){for(var i=e,n=t.split(/[.\/]/),r=0;r<n.length;++r){if(!i[n[r]])return;i=i[n[r]]}return i}function a(i){for(var n=0;n<i.length;n++){for(var r=e,o=i[n],a=o.split(/[.\/]/),u=0;u<a.length-1;++u)r[a[u]]===t&&(r[a[u]]={}),r=r[a[u]];r[a[a.length-1]]=s[o]}}var s={};n("moxie/core/utils/Basic",[],function(){function e(e){var t;return e===t?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()}function t(){return a(!1,!1,arguments)}function i(){return a(!0,!1,arguments)}function n(){return a(!1,!0,arguments)}function r(){return a(!0,!0,arguments)}function o(i){switch(e(i)){case"array":return Array.prototype.slice.call(i);case"object":return t({},i)}return i}function a(t,i,n){var r,s=n[0];return u(n,function(n,c){c>0&&u(n,function(n,u){var c=-1!==m(e(n),["array","object"]);return n===r||t&&s[u]===r?!0:(c&&i&&(n=o(n)),e(s[u])===e(n)&&c?a(t,i,[s[u],n]):s[u]=n,void 0)})}),s}function s(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__parent__=t.prototype,e}function u(e,t){var i,n,r,o;if(e){try{i=e.length}catch(a){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function c(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function l(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++r<o&&!e?n(r):i(e)})}var r=0,o=t.length;"function"!==e(i)&&(i=function(){}),t&&t.length||i(),n(r)}function d(e,t){var i=0,n=e.length,r=new Array(n);u(e,function(e,o){e(function(e){if(e)return t(e);var a=[].slice.call(arguments);a.shift(),r[o]=a,i++,i===n&&(r.unshift(null),t.apply(this,r))})})}function m(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return i}return-1}function h(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===m(t[r],i)&&n.push(t[r]);return n.length?n:!1}function f(e,t){var i=[];return u(e,function(e){-1!==m(e,t)&&i.push(e)}),i.length?i:null}function p(e){var t,i=[];for(t=0;t<e.length;t++)i[t]=e[t];return i}function g(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e}function x(e){if("string"!=typeof e)return e;var t,i={t:1099511627776,g:1073741824,m:1048576,k:1024};return e=/^([0-9\.]+)([tmgk]?)$/.exec(e.toLowerCase().replace(/[^0-9\.tmkg]/g,"")),t=e[2],e=+e[1],i.hasOwnProperty(t)&&(e*=i[t]),Math.floor(e)}function v(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e(t)?t:""})}function w(e,t){var i=this;setTimeout(function(){e.call(i)},t||1)}var y=function(){var e=0;return function(t){var i,n=(new Date).getTime().toString(32);for(i=0;5>i;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:y,typeOf:e,extend:t,extendIf:i,extendImmutable:n,extendImmutableIf:r,inherit:s,each:u,isEmptyObj:c,inSeries:l,inParallel:d,inArray:m,arrayDiff:h,arrayIntersect:f,toArray:p,trim:g,sprintf:v,parseSizeStr:x,delay:w}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},i=function(e,i){if("function"==typeof window.atob)return i?t(window.atob(e)):window.atob(e);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!e)return e;e+="";do a=d.indexOf(e.charAt(m++)),s=d.indexOf(e.charAt(m++)),u=d.indexOf(e.charAt(m++)),c=d.indexOf(e.charAt(m++)),l=a<<18|s<<12|u<<6|c,n=255&l>>16,r=255&l>>8,o=255&l,p[h++]=64==u?String.fromCharCode(n):64==c?String.fromCharCode(n,r):String.fromCharCode(n,r,o);while(m<e.length);return f=p.join(""),i?t(f):f},n=function(t,i){if(i&&(t=e(t)),"function"==typeof window.btoa)return window.btoa(t);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!t)return t;do n=t.charCodeAt(m++),r=t.charCodeAt(m++),o=t.charCodeAt(m++),l=n<<16|r<<8|o,a=63&l>>18,s=63&l>>12,u=63&l>>6,c=63&l,p[h++]=d.charAt(a)+d.charAt(s)+d.charAt(u)+d.charAt(c);while(m<t.length);f=p.join("");var g=t.length%3;return(g?f.slice(0,g-3):f)+"===".slice(g||3)};return{utf8_encode:e,utf8_decode:t,atob:i,btoa:n}}),n("moxie/core/utils/Env",["moxie/core/utils/Basic"],function(e){function t(e,t,i){var n=0,r=0,o=0,a={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},s=function(e){return e=(""+e).replace(/[_\-+]/g,"."),e=e.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),e.length?e.split("."):[-8]},u=function(e){return e?isNaN(e)?a[e]||-7:parseInt(e,10):0};for(e=s(e),t=s(t),r=Math.max(e.length,t.length),n=0;r>n;n++)if(e[n]!=t[n]){if(e[n]=u(e[n]),t[n]=u(t[n]),e[n]<t[n]){o=-1;break}if(e[n]>t[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var i=function(e){var t="",i="?",n="function",r="undefined",o="object",a="name",s="version",u={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},c={rgx:function(){for(var t,i,a,s,u,c,l,d=0,m=arguments;d<m.length;d+=2){var h=m[d],f=m[d+1];if(typeof t===r){t={};for(s in f)u=f[s],typeof u===o?t[u[0]]=e:t[u]=e}for(i=a=0;i<h.length;i++)if(c=h[i].exec(this.getUA())){for(s=0;s<f.length;s++)l=c[++a],u=f[s],typeof u===o&&u.length>0?2==u.length?t[u[0]]=typeof u[1]==n?u[1].call(this,l):u[1]:3==u.length?t[u[0]]=typeof u[1]!==n||u[1].exec&&u[1].test?l?l.replace(u[1],u[2]):e:l?u[1].call(this,l,u[2]):e:4==u.length&&(t[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):e):t[u]=l?l:e;break}if(c)break}return t},str:function(t,n){for(var r in n)if(typeof n[r]===o&&n[r].length>0){for(var a=0;a<n[r].length;a++)if(u.has(n[r][a],t))return r===i?e:r}else if(u.has(n[r],t))return r===i?e:r;return t}},l={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",RT:"ARM"}}}},d={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[a,s],[/\s(opr)\/([\w\.]+)/i],[[a,"Opera"],s],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i],[a,s],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[a,"IE"],s],[/(edge)\/((\d+)?[\w\.]+)/i],[a,s],[/(yabrowser)\/([\w\.]+)/i],[[a,"Yandex"],s],[/(comodo_dragon)\/([\w\.]+)/i],[[a,/_/g," "],s],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],[a,s],[/(dolfin)\/([\w\.]+)/i],[[a,"Dolphin"],s],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[a,"Chrome"],s],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[s,[a,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[s,[a,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[s,[a,"Facebook"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[s,[a,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[s,a],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[a,[s,c.str,l.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[a,s],[/(navigator|netscape)\/([\w\.-]+)/i],[[a,"Netscape"],s],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[a,s]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[s,[a,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[a,s],[/rv\:([\w\.]+).*(gecko)/i],[s,a]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[a,s],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[a,[s,c.str,l.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[a,"Windows"],[s,c.str,l.os.windows.version]],[/\((bb)(10);/i],[[a,"BlackBerry"],s],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[a,s],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[a,"Symbian"],s],[/\((series40);/i],[a],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[a,"Firefox OS"],s],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[a,s],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[a,"Chromium OS"],s],[/(sunos)\s?([\w\.]+\d)*/i],[[a,"Solaris"],s],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[a,s],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[a,"iOS"],[s,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[a,"Mac OS"],[s,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[a,s]]},m=function(e){var i=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:t);this.getBrowser=function(){return c.rgx.apply(this,d.browser)},this.getEngine=function(){return c.rgx.apply(this,d.engine)},this.getOS=function(){return c.rgx.apply(this,d.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}},this.getUA=function(){return i},this.setUA=function(e){return i=e,this},this.setUA(i)};return m}(),n=function(){var t={define_property:function(){return!1}(),create_canvas:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),return_response_type:function(t){try{if(-1!==e.inArray(t,["","text","document"]))return!0;if(window.XMLHttpRequest){var i=new XMLHttpRequest;if(i.open("get","/"),"responseType"in i)return i.responseType=t,i.responseType!==t?!1:!0}}catch(n){}return!1},use_data_uri:function(){var e=new Image;return e.onload=function(){t.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return t.use_data_uri&&("IE"!==o.browser||o.version>=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(i){var n=[].slice.call(arguments);return n.shift(),"function"===e.typeOf(t[i])?t[i].apply(this,n):!!t[i]}}(),r=(new i).getResult(),o={can:n,uaParser:i,browser:r.browser.name,version:r.browser.version,os:r.os.name,osVersion:r.os.version,verComp:t,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return o.OS=o.os,o}),n("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:function(){function i(e,i){this.code=e,this.name=t(n,e),this.message=this.name+(i||": RuntimeError "+this.code)}var n={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(i,n),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": ImageError "+this.code}var n={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(i,n),i.prototype=Error.prototype,i}(),FileException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": FileException "+this.code}var n={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(i,n),i.prototype=Error.prototype,i}(),DOMException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": DOMException "+this.code}var n={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(i,n),i.prototype=Error.prototype,i}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),n("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){if(!e.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)},n=function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,i){function n(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===c.compatMode?c.documentElement:c.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}var r,o,a,s=0,u=0,c=document;if(t=t,i=i||c.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!c.documentMode||c.documentMode<8))return o=n(t),a=n(i),{x:o.x-a.x,y:o.y-a.y};for(r=t;r&&r!=i&&r.nodeType;)s+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)s-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;return{x:s,y:u}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:i,addClass:n,removeClass:r,getStyle:o,getPos:a,getSize:s}}),n("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(e,t,i){function n(){this.uid=i.guid()}var r={};return i.extend(n.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(e,t,n,o){var a,s=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),e=i.trim(e),/\s/.test(e)?(i.each(e.split(/\s+/),function(e){s.addEventListener(e,t,n,o)}),void 0):(e=e.toLowerCase(),n=parseInt(n,10)||0,a=r[this.uid]&&r[this.uid][e]||[],a.push({fn:t,priority:n,scope:o||this}),r[this.uid]||(r[this.uid]={}),r[this.uid][e]=a,void 0)},hasEventListener:function(e){var t;return e?(e=e.toLowerCase(),t=r[this.uid]&&r[this.uid][e]):t=r[this.uid],t?t:!1},removeEventListener:function(e,t){var n,o,a=this;if(e=e.toLowerCase(),/\s/.test(e))return i.each(e.split(/\s+/),function(e){a.removeEventListener(e,t)}),void 0;if(n=r[this.uid]&&r[this.uid][e]){if(t){for(o=n.length-1;o>=0;o--)if(n[o].fn===t){n.splice(o,1);break}}else n=[];n.length||(delete r[this.uid][e],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(e){var n,o,a,s,u,c={},l=!0;if("string"!==i.typeOf(e)){if(s=e,"string"!==i.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=s.type,s.total!==u&&s.loaded!==u&&(c.total=s.total,c.loaded=s.loaded),c.async=s.async||!1}if(-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),c.type=e,a.unshift(c);var d=[];i.each(o,function(e){a[0].target=e.scope,c.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&i.inSeries(d,function(e){l=!e})}return l},bindOnce:function(e,t,i,n){var r=this;r.bind.call(this,e,function o(){return r.unbind(e,o),t.apply(this,arguments)},i,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)}),i.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===i.typeOf(t[e])&&(t[e]=null)})}}),n.instance=new n,n}),n("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(e,t,i,n){function r(e,n,o,s,u){var c,l=this,d=t.guid(n+"_"),m=u||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(m=r.getMode(s,e.preferred_caps,m)),c=function(){var e={};return{exec:function(t,i,n,r){return c[i]&&(e[t]||(e[t]={context:this,instance:new c[i]}),e[t].instance[n])?e[t].instance[n].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var i=this;t.each(e,function(e,n){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(n)})}}}(),t.extend(this,{initialized:!1,uid:d,type:n,mode:r.getMode(s,e.required_caps,m),shimid:d+"_container",clients:0,options:e,can:function(e,i){var n=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(i)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],n))return!1;return!0}return"function"===t.typeOf(n[e])?n[e].call(this,i):i===n[e]},getShimContainer:function(){var e,n=i.get(this.shimid);return n||(e=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(n),e=null),n},getShim:function(){return c},shimExec:function(e,t){var i=[].slice.call(arguments,2);return l.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return l[e]&&l[e][t]?l[e][t].apply(this,i):l.shimExec.apply(this,arguments)},destroy:function(){if(l){var e=i.get(this.shimid);e&&e.parentNode.removeChild(e),c&&c.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=l=c=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return a[e]?a[e]:!1},r.addConstructor=function(e,t){t.prototype=n.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var i={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){i[e]=!0}),i)},r.can=function(e,t){var i,n,o=r.getConstructor(e);return o?(i=new o({required_caps:t}),n=i.mode,i.destroy(),!!n):!1},r.thatCan=function(e,t){var i=(t||r.order).split(/\s*,\s*/);for(var n in i)if(r.can(i[n],e))return i[n];return null},r.getMode=function(e,i,n){var r=null;if("undefined"===t.typeOf(n)&&(n="browser"),i&&!t.isEmptyObj(e)){if(t.each(i,function(i,n){if(e.hasOwnProperty(n)){var o=e[n](i);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(n,r)?n:r[0];if(r===!1)return!1}return n},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),n("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(e,t,i,n){return function(){var e;i.extend(this,{connectRuntime:function(r){function o(i){var a,u;return i.length?(a=i.shift().toLowerCase(),(u=n.getConstructor(a))?(e=new u(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,s.ruid=e.uid,s.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(i)}),e.bind("Exception",function(e,i){var n=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,n))}),e.mode?(e.init(),void 0):(e.trigger("Error"),void 0)):(o(i),void 0)):(s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),e=null,void 0)}var a,s=this;if("string"===i.typeOf(r)?a=r:"string"===i.typeOf(r.ruid)&&(a=r.ruid),a){if(e=n.getRuntime(a))return s.ruid=a,e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null},can:function(t){return e?e.can(t):!1}})}}),n("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(e,t,i){function n(o,a){function s(t,i,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new n(null,{type:o,size:i-t}),a.detach(s.substr(t,a.size)),a):null}i.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,i){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var i=e.indexOf(";base64,");this.type=e.substring(5,i),e=t.atob(e.substring(i+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return n}),n("moxie/core/I18n",["moxie/core/utils/Basic"],function(e){var t={};return{addI18n:function(i){return e.extend(t,i)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),n("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(e,t){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",n={mimes:{},extensions:{},addMimeType:function(e){var t,i,n,r=e.split(/,/);for(t=0;t<r.length;t+=2){for(n=r[t+1].split(/ /),i=0;i<n.length;i++)this.mimes[n[i]]=r[t];this.extensions[r[t]]=n}},extList2mimes:function(t,i){var n,r,o,a,s=this,u=[];for(r=0;r<t.length;r++)for(n=t[r].extensions.toLowerCase().split(/\s*,\s*/),o=0;o<n.length;o++){if("*"===n[o])return[];if(a=s.mimes[n[o]],i&&/^\w+$/.test(n[o]))u.push("."+n[o]);else if(a&&-1===e.inArray(a,u))u.push(a);else if(!a)return[]}return u},mimes2exts:function(t){var i=this,n=[];return e.each(t,function(t){if(t=t.toLowerCase(),"*"===t)return n=[],!1;var r=t.match(/^(\w+)\/(\*|\w+)$/);r&&("*"===r[2]?e.each(i.extensions,function(e,t){new RegExp("^"+r[1]+"/").test(t)&&[].push.apply(n,i.extensions[t])}):i.extensions[t]&&[].push.apply(n,i.extensions[t]))}),n},mimes2extList:function(i){var n=[],r=[];return"string"===e.typeOf(i)&&(i=e.trim(i).split(/\s*,\s*/)),r=this.mimes2exts(i),n.push({title:t.translate("Files"),extensions:r.length?r.join(","):"*"}),n.mimes=i,n},getFileExtension:function(e){var t=e&&e.match(/\.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return n.addMimeType(i),n}),n("moxie/file/FileInput",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/I18n","moxie/runtime/Runtime","moxie/runtime/RuntimeClient"],function(e,t,i,n,r,o,a,s,u){function c(t){var o,c,d;if(-1!==e.inArray(e.typeOf(t),["string","node"])&&(t={browse_button:t}),c=n.get(t.browse_button),!c)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR);d={accept:[{title:a.translate("All Files"),extensions:"*"}],multiple:!1,required_caps:!1,container:c.parentNode||document.body},t=e.extend({},d,t),"string"==typeof t.required_caps&&(t.required_caps=s.parseCaps(t.required_caps)),"string"==typeof t.accept&&(t.accept=i.mimes2extList(t.accept)),o=n.get(t.container),o||(o=document.body),"static"===n.getStyle(o,"position")&&(o.style.position="relative"),o=c=null,u.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){var i=this;i.bind("RuntimeInit",function(r,o){i.ruid=o.uid,i.shimid=o.shimid,i.bind("Ready",function(){i.trigger("Refresh")},999),i.bind("Refresh",function(){var i,r,a,s,u;a=n.get(t.browse_button),s=n.get(o.shimid),a&&(i=n.getPos(a,n.get(t.container)),r=n.getSize(a),u=parseInt(n.getStyle(a,"z-index"),10)||0,s&&e.extend(s.style,{top:i.y+"px",left:i.x+"px",width:r.w+"px",height:r.h+"px",zIndex:u+1})),s=a=null}),o.exec.call(i,"FileInput","init",t)}),i.connectRuntime(e.extend({},t,{required_caps:{select_file:!0}}))},getOption:function(e){return t[e]},setOption:function(e,n){if(t.hasOwnProperty(e)){var o=t[e];switch(e){case"accept":"string"==typeof n&&(n=i.mimes2extList(n));break;case"container":case"required_caps":throw new r.FileException(r.FileException.NO_MODIFICATION_ALLOWED_ERR)}t[e]=n,this.exec("FileInput","setOption",e,n),this.trigger("OptionChanged",e,n,o)}},disable:function(t){var i=this.getRuntime();i&&this.exec("FileInput","disable","undefined"===e.typeOf(t)?!0:t)},refresh:function(){this.trigger("Refresh")},destroy:function(){var t=this.getRuntime();t&&(t.exec.call(this,"FileInput","destroy"),this.disconnectRuntime()),"array"===e.typeOf(this.files)&&e.each(this.files,function(e){e.destroy()}),this.files=null,this.unbindAll()}}),this.handleEventProps(l)}var l=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];return c.prototype=o.instance,c}),n("moxie/file/File",["moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/file/Blob"],function(e,t,i){function n(n,r){r||(r={}),i.apply(this,arguments),this.type||(this.type=t.getFileMime(r.name));var o;if(r.name)o=r.name.replace(/\\/g,"/"),o=o.substr(o.lastIndexOf("/")+1);else if(this.type){var a=this.type.split("/")[0];o=e.guid((""!==a?a:"file")+"_"),t.extensions[this.type]&&(o+="."+t.extensions[this.type][0])}e.extend(this,{name:o||e.guid("file_"),relativePath:"",lastModifiedDate:r.lastModifiedDate||(new Date).toLocaleString()})}return n.prototype=i.prototype,n}),n("moxie/file/FileDrop",["moxie/core/I18n","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/core/utils/Env","moxie/file/File","moxie/runtime/RuntimeClient","moxie/core/EventTarget","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u){function c(i){var r,o=this;"string"==typeof i&&(i={drop_zone:i}),r={accept:[{title:e.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},i="object"==typeof i?n.extend({},r,i):r,i.container=t.get(i.drop_zone)||document.body,"static"===t.getStyle(i.container,"position")&&(i.container.style.position="relative"),"string"==typeof i.accept&&(i.accept=u.mimes2extList(i.accept)),a.call(o),n.extend(o,{uid:n.guid("uid_"),ruid:null,files:null,init:function(){o.bind("RuntimeInit",function(e,t){o.ruid=t.uid,t.exec.call(o,"FileDrop","init",i),o.dispatchEvent("ready")}),o.connectRuntime(i)},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime()),this.files=null,this.unbindAll()}}),this.handleEventProps(l)}var l=["ready","dragenter","dragleave","drop","error"];return c.prototype=s.instance,c}),n("moxie/file/FileReader",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/Exceptions","moxie/core/EventTarget","moxie/file/Blob","moxie/runtime/RuntimeClient"],function(e,t,i,n,r,o){function a(){function n(e,n){if(this.trigger("loadstart"),this.readyState===a.LOADING)return this.trigger("error",new i.DOMException(i.DOMException.INVALID_STATE_ERR)),this.trigger("loadend"),void 0;
14
+ if(!(n instanceof r))return this.trigger("error",new i.DOMException(i.DOMException.NOT_FOUND_ERR)),this.trigger("loadend"),void 0;if(this.result=null,this.readyState=a.LOADING,n.isDetached()){var o=n.getSource();switch(e){case"readAsText":case"readAsBinaryString":this.result=o;break;case"readAsDataURL":this.result="data:"+n.type+";base64,"+t.btoa(o)}this.readyState=a.DONE,this.trigger("load"),this.trigger("loadend")}else this.connectRuntime(n.ruid),this.exec("FileReader","read",e,n)}o.call(this),e.extend(this,{uid:e.guid("uid_"),readyState:a.EMPTY,result:null,error:null,readAsBinaryString:function(e){n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){n.call(this,"readAsDataURL",e)},readAsText:function(e){n.call(this,"readAsText",e)},abort:function(){this.result=null,-1===e.inArray(this.readyState,[a.EMPTY,a.DONE])&&(this.readyState===a.LOADING&&(this.readyState=a.DONE),this.exec("FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))},destroy:function(){this.abort(),this.exec("FileReader","destroy"),this.disconnectRuntime(),this.unbindAll()}}),this.handleEventProps(s),this.bind("Error",function(e,t){this.readyState=a.DONE,this.error=t},999),this.bind("Load",function(){this.readyState=a.DONE},999)}var s=["loadstart","progress","load","abort","error","loadend"];return a.EMPTY=0,a.LOADING=1,a.DONE=2,a.prototype=n.instance,a}),n("moxie/core/utils/Url",["moxie/core/utils/Basic"],function(e){var t=function(i,n){var r,o=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],a=o.length,s={http:80,https:443},u={},c=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?(\[[\da-fA-F:]+\]|[^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,l=c.exec(i||""),d=/^\/\/\w/.test(i);switch(e.typeOf(n)){case"undefined":n=t(document.location.href,!1);break;case"string":n=t(n,!1)}for(;a--;)l[a]&&(u[o[a]]=l[a]);if(r=!d&&!u.scheme,(d||r)&&(u.scheme=n.scheme),r){u.host=n.host,u.port=n.port;var m="";/^[^\/]/.test(u.path)&&(m=n.path,m=/\/[^\/]*\.[^\/]*$/.test(m)?m.replace(/\/[^\/]+$/,"/"):m.replace(/\/?$/,"/")),u.path=m+(u.path||"")}return u.port||(u.port=s[u.scheme]||80),u.port=parseInt(u.port,10),u.path||(u.path="/"),delete u.source,u},i=function(e){var i={http:80,https:443},n="object"==typeof e?e:t(e);return n.scheme+"://"+n.host+(n.port!==i[n.scheme]?":"+n.port:"")+n.path+(n.query?n.query:"")},n=function(e){function i(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof e&&(e=t(e)),i(t())===i(e)};return{parseUrl:t,resolveUrl:i,hasSameOrigin:n}}),n("moxie/runtime/RuntimeTarget",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i){function n(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return n.prototype=i.instance,n}),n("moxie/file/FileReaderSync",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/utils/Encode"],function(e,t,i){return function(){function n(e,t){if(!t.isDetached()){var n=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),n}var r=t.getSource();switch(e){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+i.btoa(r);case"readAsText":for(var o="",a=0,s=r.length;s>a;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):n.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(i){t.each(n,function(e){i(e.value,e.name)}),e&&i(e.value,e.name)},destroy:function(){e=null,n=[]}})}return n}),n("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u,c,l,d){function m(){this.uid=e.guid("uid_")}function h(){function i(e,t){return I.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?I[e]:A[e]:(l.can("define_property")?I[e]=t:A[e]=t,void 0):void 0}function u(t){function n(){R&&(R.destroy(),R=null),s.dispatchEvent("loadend"),s=null}function r(r){R.bind("LoadStart",function(e){i("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),L&&s.upload.dispatchEvent(e)}),R.bind("Progress",function(e){i("readyState")!==h.LOADING&&(i("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),R.bind("UploadProgress",function(e){L&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),R.bind("Load",function(t){i("readyState",h.DONE),i("status",Number(r.exec.call(R,"XMLHttpRequest","getStatus")||0)),i("statusText",f[i("status")]||""),i("response",r.exec.call(R,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),U=r.exec.call(R,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),i("status")>0?(L&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(F=!0,s.dispatchEvent("error")),n()}),R.bind("Abort",function(e){s.dispatchEvent(e),n()}),R.bind("Error",function(e){F=!0,i("readyState",h.DONE),s.dispatchEvent("readystatechange"),M=!0,s.dispatchEvent(e),n()}),r.exec.call(R,"XMLHttpRequest","send",{url:x,method:v,async:T,user:w,password:y,headers:S,mimeType:D,encoding:O,responseType:s.responseType,withCredentials:s.withCredentials,options:k},t)}var s=this;E=(new Date).getTime(),R=new a,"string"==typeof k.required_caps&&(k.required_caps=o.parseCaps(k.required_caps)),k.required_caps=e.extend({},k.required_caps,{return_response_type:s.responseType}),t instanceof c&&(k.required_caps.send_multipart=!0),e.isEmptyObj(S)||(k.required_caps.send_custom_headers=!0),B||(k.required_caps.do_cors=!0),k.ruid?r(R.connectRuntime(k)):(R.bind("RuntimeInit",function(e,t){r(t)}),R.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),R.connectRuntime(k))}function g(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),E=b=null}var x,v,w,y,E,b,R,_,A=this,I={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,S={},O=null,D=null,N=!1,C=!1,L=!1,M=!1,F=!1,B=!1,P=null,H=null,k={},U="";e.extend(this,I,{uid:e.guid("uid_"),upload:new m,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||n.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(v=o.toUpperCase()),~e.inArray(v,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=n.utf8_encode(a),l=r.parseUrl(a),B=r.hasSameOrigin(l),x=r.resolveUrl(a),(u||c)&&!B)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(w=u||l.user,y=c||l.pass,T=s||!0,T===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);N=!T,C=!1,S={},g.call(this),i("readyState",h.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(i("readyState")!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||n.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(S[r]?S[r]+=", "+o:S[r]=o,!0)},hasRequestHeader:function(e){return e&&S[e.toLowerCase()]||!1},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),F||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(_||(_={},e.each(U.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=e.trim(i[0]),_[i[0].toLowerCase()]={header:i[0],value:e.trim(i[1])})})),_.hasOwnProperty(t))?_[t].header+": "+_[t].value:null},overrideMimeType:function(n){var r,o;if(~e.inArray(i("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n=e.trim(n.toLowerCase()),/;/.test(n)&&(r=n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(n=r[1],r[2]&&(o=r[2])),!d.mimes[n])throw new t.DOMException(t.DOMException.SYNTAX_ERR);P=n,H=o},send:function(i,r){if(k="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof s)k.ruid=i.ruid,D=i.type||"application/octet-stream";else if(i instanceof c){if(i.hasBlob()){var o=i.getBlob();k.ruid=o.ruid,D=o.type||"application/octet-stream"}}else"string"==typeof i&&(O="UTF-8",D="text/plain;charset=UTF-8",i=n.utf8_encode(i));this.withCredentials||(this.withCredentials=k.required_caps&&k.required_caps.send_browser_cookies&&!B),L=!N&&this.upload.hasEventListener(),F=!1,M=!i,N||(C=!0),u.call(this,i)},abort:function(){if(F=!0,N=!1,~e.inArray(i("readyState"),[h.UNSENT,h.OPENED,h.DONE]))i("readyState",h.UNSENT);else{if(i("readyState",h.DONE),C=!1,!R)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);R.getRuntime().exec.call(R,"XMLHttpRequest","abort",M),M=!0}},destroy:function(){R&&("function"===e.typeOf(R.destroy)&&R.destroy(),R=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(p.concat(["readystatechange"])),this.upload.handleEventProps(p)}var f={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};m.prototype=i.instance;var p=["loadstart","progress","abort","error","load","timeout","loadend"];return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=i.instance,h}),n("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i,n){function r(){function n(){l=d=0,c=this.result=null}function o(t,i){var n=this;u=i,n.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(n.state,[r.IDLE,r.DONE])&&a.call(n)},999),n.bind("TransportingComplete",function(){d=l,n.state=r.DONE,c=null,n.result=u.exec.call(n,"Transporter","getAsBlob",t||"")},999),n.state=r.BUSY,n.trigger("TransportingStarted"),a.call(n)}function a(){var e,i=this,n=l-d;m>n&&(m=n),e=t.btoa(c.substr(d,m)),u.exec.call(i,"Transporter","receive",e,l)}var s,u,c,l,d,m;i.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,i,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),m=r.chunk_size,n.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,i,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,i,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),n.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),n.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=n.instance,r}),n("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(e,t,i,n,r,o,a,s,u,c,l,d,m){function h(){function n(e){try{return e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name),!0}catch(t){return this.trigger("error",t.code),!1}}function c(t){var n=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);p.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===n)"data:"===t.substr(0,5)?c.call(this,new l(null,{data:t}),arguments[1]):x.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function p(t,i){var n=this.connectRuntime(t.ruid);this.ruid=n.uid,n.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(i)?!0:i)}function g(t,i){function n(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=o.parseCaps(i.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):n(this.connectRuntime(t.ruid))}function x(e,t){var i,n=this;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){c.apply(this,arguments)},resize:function(t){var n,r,o=this,a={x:0,y:0,width:o.width,height:o.height},s=e.extendIf({width:o.width,height:o.height,type:o.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t);try{if(!o.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(o.width>h.MAX_RESIZE_WIDTH||o.height>h.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if(n=o.meta&&o.meta.tiff&&o.meta.tiff.Orientation||1,-1!==e.inArray(n,[5,6,7,8])){var u=s.width;s.width=s.height,s.height=u}if(s.crop){switch(r=Math.max(s.width/o.width,s.height/o.height),t.fit?(a.width=Math.min(Math.ceil(s.width/r),o.width),a.height=Math.min(Math.ceil(s.height/r),o.height),r=s.width/a.width):(a.width=Math.min(s.width,o.width),a.height=Math.min(s.height,o.height),r=1),"boolean"==typeof s.crop&&(s.crop="cc"),s.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":a.x=o.width-a.width,a.y=o.height-a.height;break;case"cb":case"center-bottom":a.x=Math.floor((o.width-a.width)/2),a.y=o.height-a.height;break;case"lb":case"left-bottom":a.x=0,a.y=o.height-a.height;break;case"lt":case"left-top":a.x=0,a.y=0;break;case"ct":case"center-top":a.x=Math.floor((o.width-a.width)/2),a.y=0;break;case"rt":case"right-top":a.x=o.width-a.width,a.y=0;break;case"rc":case"right-center":case"right-middle":a.x=o.width-a.width,a.y=Math.floor((o.height-a.height)/2);break;case"lc":case"left-center":case"left-middle":a.x=0,a.y=Math.floor((o.height-a.height)/2);break;case"cc":case"center-center":case"center-middle":default:a.x=Math.floor((o.width-a.width)/2),a.y=Math.floor((o.height-a.height)/2)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0)}else r=Math.min(s.width/o.width,s.height/o.height);this.exec("Image","resize",a,r,s)}catch(c){o.trigger("error",c.code)}},downsize:function(t){var i,n={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?e.extend(n,t):e.extend(n,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]}),this.resize(i)},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return this.exec("Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return m.atob(i.substring(i.indexOf("base64,")+7))},embed:function(n,r){function o(t,r){var o=this;if(u.can("create_canvas")){var l=o.getAsCanvas();if(l)return n.appendChild(l),l=null,o.destroy(),c.trigger("embedded"),void 0}var d=o.getAsDataURL(t,r);if(!d)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",d.length))n.innerHTML='<img src="'+d+'" width="'+o.width+'" height="'+o.height+'" />',o.destroy(),c.trigger("embedded");else{var h=new s;h.bind("TransportingComplete",function(){a=c.connectRuntime(this.result.ruid),c.bind("Embedded",function(){e.extend(a.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),a=null},999),a.exec.call(c,"ImageView","display",this.result.uid,width,height),o.destroy()}),h.transport(m.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:n})}}var a,c=this,l=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},r);try{if(!(n=t.get(n)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT;var d=new h;return d.bind("Resize",function(){o.call(this,l.type,l.quality)}),d.bind("Load",function(){this.downsize(l)}),this.meta.thumb&&this.meta.thumb.width>=l.width&&this.meta.thumb.height>=l.height?d.load(this.meta.thumb.data):d.clone(this,!1),d}catch(f){this.trigger("error",f.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.meta&&this.meta.thumb&&this.meta.thumb.data.destroy(),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){return n.call(this)},999)}var f=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=8192,h.MAX_RESIZE_HEIGHT=8192,h.prototype=c.instance,h}),n("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue,l=e.extend({access_binary:u(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!s.Image},display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:u(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:u(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==n.browser||n.verComp(n.version,9,">"))}()),filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),return_response_headers:c,return_response_type:function(e){return"json"===e&&window.JSON?!0:n.can("return_response_type",e)},return_status_code:c,report_upload_progress:u(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&n.can("create_canvas")},select_file:function(){return n.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===n.browser&&n.verComp(n.version,21,">=")||"Firefox"===n.browser&&n.verComp(n.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===n.browser&&"Windows"===n.os||"iOS"===n.os&&n.verComp(n.osVersion,"7.0.0",">")&&n.verComp(n.osVersion,"8.0.0","<"))},send_binary_string:u(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:u(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:u(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&("Firefox"===n.browser&&n.verComp(n.version,4,">=")||"Opera"===n.browser&&n.verComp(n.version,12,">=")||"IE"===n.browser&&n.verComp(n.version,10,">=")||!!~e.inArray(n.browser,["Chrome","Safari","Edge"]))},upload_filesize:c,use_http_method:c},arguments[2]);i.call(this,t,arguments[1]||a,l),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(e,t,i){var n;if(!window.File.prototype.slice)return(n=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?n.call(e,t,i):null;try{return e.slice(),e.slice(t,i)}catch(r){return e.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=i}),n("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(e){function t(){this.returnValue=!1}function i(){this.cancelBubble=!0}var n={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=i,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),n.hasOwnProperty(o[r])||(n[o[r]]={}),l=n[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,i,o){var a,s;if(i=i.toLowerCase(),t[r]&&n[t[r]]&&n[t[r]][i]){a=n[t[r]][i];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(i,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+i,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete n[t[r]][i],e.isEmptyObj(n[t[r]])){delete n[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,i){t&&t[r]&&e.each(n[t[r]],function(e,n){a(t,n,i)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),n("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){var e,s;i.extend(this,{init:function(u){var c,l,d,m,h,f,p=this,g=p.getRuntime();e=u,d=e.accept.mimes||o.extList2mimes(e.accept,g.can("filter_by_extension")),l=g.getShimContainer(),l.innerHTML='<input id="'+g.uid+'" type="file" style="font-size:999px;opacity:0;"'+(e.multiple&&g.can("select_multiple")?"multiple":"")+(e.directory&&g.can("select_folder")?"webkitdirectory directory":"")+(d?' accept="'+d.join(",")+'"':"")+" />",c=n.get(g.uid),i.extend(c.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=n.get(e.browse_button),s=n.getStyle(m,"z-index")||"auto",g.can("summon_file_dialog")&&("static"===n.getStyle(m,"position")&&(m.style.position="relative"),r.addEvent(m,"click",function(e){var t=n.get(g.uid);t&&!t.disabled&&t.click(),e.preventDefault()},p.uid),p.bind("Refresh",function(){h=parseInt(s,10)||1,n.get(e.browse_button).style.zIndex=h,this.getRuntime().getShimContainer().style.zIndex=h-1})),f=g.can("summon_file_dialog")?m:l,r.addEvent(f,"mouseover",function(){p.trigger("mouseenter")},p.uid),r.addEvent(f,"mouseout",function(){p.trigger("mouseleave")},p.uid),r.addEvent(f,"mousedown",function(){p.trigger("mousedown")},p.uid),r.addEvent(n.get(e.container),"mouseup",function(){p.trigger("mouseup")},p.uid),c.onchange=function x(){if(p.files=[],i.each(this.files,function(i){var n="";return e.directory&&"."==i.name?!0:(i.webkitRelativePath&&(n="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(g.uid,i),i.relativePath=n,p.files.push(i),void 0)}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=x}p.files.length&&p.trigger("change")},p.trigger({type:"ready",async:!0}),l=null},setOption:function(e,t){var i=this.getRuntime(),r=n.get(i.uid);switch(e){case"accept":if(t){var a=t.mimes||o.extList2mimes(t,i.can("filter_by_extension"));r.setAttribute("accept",a.join(","))}else r.removeAttribute("accept");break;case"directory":t&&i.can("select_folder")?(r.setAttribute("directory",""),r.setAttribute("webkitdirectory","")):(r.removeAttribute("directory"),r.removeAttribute("webkitdirectory"));break;case"multiple":t&&i.can("select_multiple")?r.setAttribute("multiple",""):r.removeAttribute("multiple")}},disable:function(e){var t,i=this.getRuntime();(t=n.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var t=this.getRuntime(),i=t.getShim(),o=t.getShimContainer(),a=e&&n.get(e.container),u=e&&n.get(e.browse_button);a&&r.removeAllEvents(a,this.uid),u&&(r.removeAllEvents(u,this.uid),u.style.zIndex=s),o&&(r.removeAllEvents(o,this.uid),o.innerHTML=""),i.removeInstance(this.uid),e=o=a=u=i=null}})}return e.FileInput=s}),n("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,t,i,n,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=i.toArray(e.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function a(e,i){if(u(e)){var n=new t(f,e);n.relativePath=i||"",p.push(n)}}function s(e){for(var t=[],n=0;n<e.length;n++)[].push.apply(t,e[n].extensions.split(/\s*,\s*/));return-1===i.inArray("*",t)?t:[]}function u(e){if(!g.length)return!0;var t=o.getFileExtension(e.name);return!t||-1!==i.inArray(t,g)}function c(e,t){var n=[];i.each(e,function(e){var t=e.webkitGetAsEntry();t&&(t.isFile?a(e.getAsFile(),t.fullPath):n.push(t))}),n.length?l(n,t):t()}function l(e,t){var n=[];i.each(e,function(e){n.push(function(t){d(e,t)})}),i.inSeries(n,function(){t()})}function d(e,t){e.isFile?e.file(function(i){a(i,e.fullPath),t()},function(){t()}):e.isDirectory?m(e,t):t()}function m(e,t){function i(e){r.readEntries(function(t){t.length?([].push.apply(n,t),i(e)):e()},e)}var n=[],r=e.createReader();i(function(){l(n,t)})}var h,f,p=[],g=[];i.extend(this,{init:function(t){var n,o=this;h=t,f=o.ruid,g=s(h.accept),n=h.container,r.addEvent(n,"dragover",function(t){e(t)&&(t.preventDefault(),t.dataTransfer.dropEffect="copy")},o.uid),r.addEvent(n,"drop",function(t){e(t)&&(t.preventDefault(),p=[],t.dataTransfer.items&&t.dataTransfer.items[0].webkitGetAsEntry?c(t.dataTransfer.items,function(){o.files=p,o.trigger("drop")}):(i.each(t.dataTransfer.files,function(e){a(e)}),o.files=p,o.trigger("drop")))},o.uid),r.addEvent(n,"dragenter",function(){o.trigger("dragenter")},o.uid),r.addEvent(n,"dragleave",function(){o.trigger("dragleave")},o.uid)},destroy:function(){r.removeAllEvents(h&&n.get(h.container),this.uid),f=p=g=h=null}})}return e.FileDrop=a}),n("moxie/runtime/html5/file/FileReader",["moxie/runtime/html5/Runtime","moxie/core/utils/Encode","moxie/core/utils/Basic"],function(e,t,i){function n(){function e(e){return t.atob(e.substring(e.indexOf("base64,")+7))}var n,r=!1;i.extend(this,{read:function(t,o){var a=this;a.result="",n=new window.FileReader,n.addEventListener("progress",function(e){a.trigger(e)}),n.addEventListener("load",function(t){a.result=r?e(n.result):n.result,a.trigger(t)}),n.addEventListener("error",function(e){a.trigger(e,n.error)}),n.addEventListener("loadend",function(e){n=null,a.trigger(e)}),"function"===i.typeOf(n[t])?(r=!1,n[t](o.getSource())):"readAsBinaryString"===t&&(r=!0,n.readAsDataURL(o.getSource()))},abort:function(){n&&n.abort()},destroy:function(){n=null}})}return e.FileReader=n}),n("moxie/runtime/html5/xhr/XMLHttpRequest",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/core/utils/Url","moxie/file/File","moxie/file/Blob","moxie/xhr/FormData","moxie/core/Exceptions","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(e,t){var i,n,r=this;i=t.getBlob().getSource(),n=new window.FileReader,n.onload=function(){t.append(t.getBlobName(),new o(null,{type:i.type,data:n.result})),f.send.call(r,e,t)},n.readAsBinaryString(i)}function c(){return!window.XMLHttpRequest||"IE"===u.browser&&u.verComp(u.version,8,"<")?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(i){}}():new window.XMLHttpRequest}function l(e){var t=e.responseXML,i=e.responseText;return"IE"===u.browser&&i&&t&&!t.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader("Content-Type"))&&(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.validateOnParse=!1,t.loadXML(i)),t&&("IE"===u.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName)?null:t}function d(e){var t="----moxieboundary"+(new Date).getTime(),i="--",n="\r\n",r="",a=this.getRuntime();if(!a.can("send_binary_string"))throw new s.RuntimeError(s.RuntimeError.NOT_SUPPORTED_ERR);return m.setRequestHeader("Content-Type","multipart/form-data; boundary="+t),e.each(function(e,a){r+=e instanceof o?i+t+n+'Content-Disposition: form-data; name="'+a+'"; filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+n+"Content-Type: "+(e.type||"application/octet-stream")+n+n+e.getSource()+n:i+t+n+'Content-Disposition: form-data; name="'+a+'"'+n+n+unescape(encodeURIComponent(e))+n}),r+=i+t+i+n}var m,h,f=this;t.extend(this,{send:function(i,r){var s=this,l="Mozilla"===u.browser&&u.verComp(u.version,4,">=")&&u.verComp(u.version,7,"<"),f="Android Browser"===u.browser,p=!1;
15
+ if(h=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),m=c(),m.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(p=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),p=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return e.call(s,i,r),void 0;if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}m.upload?(i.withCredentials&&(m.withCredentials=!0),m.addEventListener("load",function(e){s.trigger(e)}),m.addEventListener("error",function(e){s.trigger(e)}),m.addEventListener("progress",function(e){s.trigger(e)}),m.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):m.onreadystatechange=function(){switch(m.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=m.getResponseHeader("Content-Length")||0),m.responseText&&(t=m.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:m.onreadystatechange=function(){},0===m.status?s.trigger("error"):s.trigger("load")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){m.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in m&&(m.responseType="json"!==i.responseType||u.can("return_response_type","json")?i.responseType:"text"),p?m.sendAsBinary?m.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t<r.length;t++)e[t]=255&r.charCodeAt(t);m.send(e.buffer)}():m.send(r),s.trigger("loadstart")},getStatus:function(){try{if(m)return m.status}catch(e){}return 0},getResponse:function(e){var t=this.getRuntime();try{switch(e){case"blob":var n=new r(t.uid,m.response),o=m.getResponseHeader("Content-Disposition");if(o){var a=o.match(/filename=([\'\"'])([^\1]+)\1/);a&&(h=a[2])}return n.name=h,n.type||(n.type=i.getFileMime(h)),n;case"json":return u.can("return_response_type","json")?m.response:200===m.status&&window.JSON?JSON.parse(m.responseText):null;case"document":return l(m);default:return""!==m.responseText?m.responseText:null}}catch(s){return null}},getAllResponseHeaders:function(){try{return m.getAllResponseHeaders()}catch(e){}return""},abort:function(){m&&m.abort()},destroy:function(){f=h=null}})}return e.XMLHttpRequest=c}),n("moxie/runtime/html5/utils/BinaryReader",["moxie/core/utils/Basic"],function(e){function t(e){e instanceof ArrayBuffer?i.apply(this,arguments):n.apply(this,arguments)}function i(t){var i=new DataView(t);e.extend(this,{readByteAt:function(e){return i.getUint8(e)},writeByteAt:function(e,t){i.setUint8(e,t)},SEGMENT:function(e,n,r){switch(arguments.length){case 2:return t.slice(e,e+n);case 1:return t.slice(e);case 3:if(null===r&&(r=new ArrayBuffer),r instanceof ArrayBuffer){var o=new Uint8Array(this.length()-n+r.byteLength);e>0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<<Math.abs(n+8*r);return i},write:function(e,t,i){var n,r;if(e>this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;i>r;r++)n[r]=this[e](t+r);return n}}),t}),n("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,t){return function i(n){var r,o,a,s=[],u=0;if(r=new e(n),65496!==r.SHORT(0))throw r.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(o=2;o<=r.length();)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;u=r.SHORT(o+2)+2,a>=65505&&65519>=a&&s.push({hex:a,name:"APP"+(15&a),start:o,length:u,segment:r.SEGMENT(o,u)}),o+=u}return r.clear(),{headers:s,restore:function(t){var i,n,r;for(r=new e(t),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,i=s.length;i>n;n++)r.SEGMENT(o,0,s[n].segment),o+=s[n].length;return t=r.SEGMENT(),r.clear(),t},strip:function(t){var n,r,o,a;for(o=new i(t),r=o.headers,o.purge(),n=new e(t),a=r.length;a--;)n.SEGMENT(r[a].start,r[a].length,"");return t=n.SEGMENT(),n.clear(),t},get:function(e){for(var t=[],i=0,n=s.length;n>i;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;r>i&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),n("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,i,n){function r(o){function a(i,r){var o,a,s,u,c,m,h,f,p=this,g=[],x={},v={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},w={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(o=p.SHORT(i),a=0;o>a;a++)if(g=[],h=i+2+12*a,s=r[p.SHORT(h)],s!==t){if(u=v[p.SHORT(h+=2)],c=p.LONG(h+=2),m=w[u],!m)throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(h+=4,m*c>4&&(h=p.LONG(h)+d.tiffHeader),h+m*c>=this.length())throw new n.ImageError(n.ImageError.INVALID_META_ERR);"ASCII"!==u?(g=p.asArray(u,h,c),f=1==c?g[0]:g,x[s]=l.hasOwnProperty(s)&&"object"!=typeof f?l[s][f]:f):x[s]=e.trim(p.STRING(h,c).replace(/\0$/,""))}return x}function s(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=c[e.toLowerCase()];for(var u in s)if(s[u]===t){t=u;break}}n=d[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var l=0;r>l;l++)if(o=n+12*l+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(m){return!1}return!0}var u,c,l,d,m,h;if(i.call(this,o),c={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},m=d.tiffHeader,u={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return h||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,c.exif)}catch(i){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n<t.ExifVersion.length;n++)r+=String.fromCharCode(t.ExifVersion[n]);t.ExifVersion=r}}return t},GPS:function(){var t=null;if(d.gpsIFD){try{t=a.call(this,d.gpsIFD,c.gps)}catch(i){return null}t.GPSVersionID&&"array"===e.typeOf(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join("."))}return t},thumb:function(){if(d.IFD1)try{var e=a.call(this,d.IFD1,c.thumb);if("JPEGInterchangeFormat"in e)return this.SEGMENT(d.tiffHeader+e.JPEGInterchangeFormat,e.JPEGInterchangeFormatLength)}catch(t){}return null},setExif:function(e,t){return"PixelXDimension"!==e&&"PixelYDimension"!==e?!1:s.call(this,"exif",e,t)},clear:function(){u.clear(),o=c=l=h=d=u=null}}),65505!==this.SHORT(0)||"EXIF\0"!==this.STRING(4,5).toUpperCase())throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(this.littleEndian=18761==this.SHORT(m),42!==this.SHORT(m+=2))throw new n.ImageError(n.ImageError.INVALID_META_ERR);d.IFD0=d.tiffHeader+this.LONG(m+=2),h=a.call(this,d.IFD0,c.tiff),"ExifIFDPointer"in h&&(d.exifIFD=d.tiffHeader+h.ExifIFDPointer,delete h.ExifIFDPointer),"GPSInfoIFDPointer"in h&&(d.gpsIFD=d.tiffHeader+h.GPSInfoIFDPointer,delete h.GPSInfoIFDPointer),e.isEmptyObj(h)&&(h=null);var f=this.LONG(d.IFD0+12*this.SHORT(d.IFD0)+2);f&&(d.IFD1=d.tiffHeader+f)}return r.prototype=i.prototype,r}),n("moxie/runtime/html5/image/JPEG",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEGHeaders","moxie/runtime/html5/utils/BinaryReader","moxie/runtime/html5/image/ExifParser"],function(e,t,i,n,r){function o(o){function a(e){var t,i,n=0;for(e||(e=c);n<=e.length();){if(t=e.SHORT(n+=2),t>=65472&&65475>=t)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}function s(){var e,t,i=d.thumb();return i&&(e=new n(i),t=a(e),e.clear(),t)?(t.data=i,t):null}function u(){d&&l&&c&&(d.clear(),l.purge(),c.clear(),m=l=d=c=null)}var c,l,d,m;if(c=new n(o),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new i(o);try{d=new r(l.get("app1")[0])}catch(h){}m=a.call(this),e.extend(this,{type:"image/jpeg",size:c.length(),width:m&&m.width||0,height:m&&m.height||0,setExif:function(t,i){return d?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,i),l.set("app1",d.SEGMENT()),void 0):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):l.restore(o)},stripHeaders:function(e){return l.strip(e)},purge:function(){u.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),n("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(e,t,i){function n(n){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),n=l=u=c=s=null)}function a(e){var t,i,n,r;return t=s.LONG(e),i=s.STRING(e+=4,4),n=e+=4,r=s.LONG(e+t),{length:t,type:i,start:n,CRC:r}}var s,u,c,l;s=new i(n),function(){var t=0,i=0,n=[35152,20039,3338,6666];for(i=0;i<n.length;i++,t+=2)if(n[i]!=s.SHORT(t))throw new e.ImageError(e.ImageError.WRONG_FORMAT)}(),l=r.call(this),t.extend(this,{type:"image/png",size:s.length(),width:l.width,height:l.height,purge:function(){o.call(this)}}),o.call(this)}return n}),n("moxie/runtime/html5/image/ImageInfo",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEG","moxie/runtime/html5/image/PNG"],function(e,t,i,n){return function(r){var o,a=[i,n];o=function(){for(var e=0;e<a.length;e++)try{return new a[e](r)}catch(i){}throw new t.ImageError(t.ImageError.WRONG_FORMAT)}(),e.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){r=null}}),e.extend(this,o),this.purge=function(){o.purge(),o=null}}}),n("moxie/runtime/html5/image/ResizerCanvas",[],function(){function e(i,n){var r=i.width,o=Math.floor(r*n),a=!1;(.5>n||n>2)&&(n=.5>n?.5:2,a=!0);var s=t(i,n);return a?e(s,o/s.width):s}function t(e,t){var i=e.width,n=e.height,r=Math.floor(i*t),o=Math.floor(n*t),a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),e=null,a}return{scale:e}}),n("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(){if(!v&&!g)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return v||g}function c(){var t=e();return"canvas"==t.nodeName.toLowerCase()?t:(v=document.createElement("canvas"),v.width=t.width,v.height=t.height,v.getContext("2d").drawImage(t,0,0),v)}function l(e){return n.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+n.btoa(e)}function m(e){var t=this;g=new Image,g.onerror=function(){p.call(this),t.trigger("error",i.ImageError.WRONG_FORMAT)},g.onload=function(){t.trigger("load")},g.src="data:"==e.substr(0,5)?e:d(e,y.type)}function h(e,t){var n,r=this;return window.FileReader?(n=new FileReader,n.onload=function(){t.call(r,this.result)},n.onerror=function(){r.trigger("error",i.ImageError.WRONG_FORMAT)},n.readAsDataURL(e),void 0):t.call(this,e.getAsDataURL())}function f(e,i){var n=Math.PI/180,r=document.createElement("canvas"),o=r.getContext("2d"),a=e.width,s=e.height;switch(t.inArray(i,[5,6,7,8])>-1?(r.width=s,r.height=a):(r.width=a,r.height=s),i){case 2:o.translate(a,0),o.scale(-1,1);break;case 3:o.translate(a,s),o.rotate(180*n);break;case 4:o.translate(0,s),o.scale(1,-1);break;case 5:o.rotate(90*n),o.scale(1,-1);break;case 6:o.rotate(90*n),o.translate(0,-s);break;case 7:o.rotate(90*n),o.translate(a,-s),o.scale(-1,1);break;case 8:o.rotate(-90*n),o.translate(-a,0)}return o.drawImage(e,0,0,a,s),r}function p(){x&&(x.purge(),x=null),w=g=v=y=null,b=!1}var g,x,v,w,y,E=this,b=!1,R=!0;t.extend(this,{loadFromBlob:function(e){var t=this.getRuntime(),n=arguments.length>1?arguments[1]:!0;if(!t.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return y=e,e.isDetached()?(w=e.getSource(),m.call(this,w),void 0):(h.call(this,e.getSource(),function(e){n&&(w=l(e)),m.call(this,e)}),void 0)},loadFromImage:function(e,t){this.meta=e.meta,y=new o(null,{name:e.name,size:e.size,type:e.type}),m.call(this,t?w=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t,i=this.getRuntime();return!x&&w&&i.can("access_image_binary")&&(x=new a(w)),t={width:e().width||0,height:e().height||0,type:y.type||u.getFileMime(y.name),size:w&&w.length||y.size||0,name:y.name||"",meta:null},R&&(t.meta=x&&x.meta||this.meta||{},!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof r||(t.meta.thumb.data=new r(null,{type:"image/jpeg",data:t.meta.thumb.data}))),t},resize:function(t,i,n){var r=document.createElement("canvas");if(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(e(),t.x,t.y,t.width,t.height,0,0,r.width,r.height),v=s.scale(r,i),R=n.preserveHeaders,!R){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;v=f(v,o)}this.width=v.width,this.height=v.height,b=!0,this.trigger("Resize")},getAsCanvas:function(){return v||(v=c()),v.id=this.uid+"_canvas",v},getAsBlob:function(e,t){return e!==this.type?(b=!0,new o(null,{name:y.name||"",type:e,data:E.getAsDataURL(e,t)})):new o(null,{name:y.name||"",type:e,data:E.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return g.src;if(c(),"image/jpeg"!==e)return v.toDataURL("image/png");try{return v.toDataURL("image/jpeg",t/100)}catch(i){return v.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return w||(w=l(E.getAsDataURL(e,t))),w;if("image/jpeg"!==e)w=l(E.getAsDataURL(e,t));else{var i;t||(t=90),c();try{i=v.toDataURL("image/jpeg",t/100)}catch(n){i=v.toDataURL("image/jpeg")}w=l(i),x&&(w=x.stripHeaders(w),R&&(x.meta&&x.meta.exif&&x.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),w=x.writeHeaders(w)),x.purge(),x=null)}return b=!1,w},destroy:function(){E=null,p.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),n("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function s(e){var n=i.get(e);n&&"OBJECT"==n.nodeName&&("IE"===t.browser?(n.style.display="none",function r(){4==n.readyState?u(e):setTimeout(r,10)}()):n.parentNode.removeChild(n))}function u(e){var t=i.get(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function c(u){var c,m=this;u=e.extend({swf_url:t.swf_url},u),o.call(this,u,l,{access_binary:function(e){return e&&"browser"===m.mode},access_image_binary:function(e){return e&&"browser"===m.mode},display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===m.mode},resize_image:o.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===m.mode},return_status_code:function(t){return"browser"===m.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:function(e){return e&&"browser"===m.mode},send_browser_cookies:function(e){return e&&"browser"===m.mode},send_custom_headers:function(e){return e&&"browser"===m.mode},send_multipart:o.capTrue,slice_blob:function(e){return e&&"browser"===m.mode},stream_upload:function(e){return e&&"browser"===m.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===m.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),a()<11.3&&(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return m.getShim().exec(this.uid,e,t,i)},init:function(){var i,r,o;o=this.getShimContainer(),e.extend(o.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),i='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+u.swf_url+'" ',"IE"===t.browser&&(i+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),i+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+u.swf_url+'" />'+'<param name="flashvars" value="uid='+escape(this.uid)+"&target="+t.global_event_dispatcher+'" />'+'<param name="wmode" value="transparent" />'+'<param name="allowscriptaccess" value="always" />'+"</object>","IE"===t.browser?(r=document.createElement("div"),o.appendChild(r),r.outerHTML=i,r=o=null):o.innerHTML=i,c=setTimeout(function(){m&&!m.initialized&&m.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){s(m.uid),e.call(m),clearTimeout(c),u=c=e=m=null}}(this.destroy)},d)}var l="flash",d={};return o.addConstructor(l,c),d}),n("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={slice:function(e,i,n,r){var o=this.getRuntime();return 0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),e=o.shimExec.call(this,"Blob","slice",i,n,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=i}),n("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(e,t,i){var n={init:function(e){var n=this,r=this.getRuntime();this.bind("Change",function(){var e=r.shimExec.call(n,"FileInput","getFiles");n.files=[],i.each(e,function(e){n.files.push(new t(r.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=n}),n("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n=this;return n.result="","readAsDataURL"===e&&(n.result="data:"+(t.type||"")+";base64,"),n.bind("Progress",function(t,r){r&&(n.result+=i(r,e))},999),n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=n}),n("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n,r=this.getRuntime();return(n=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(n="data:"+(t.type||"")+";base64,"+n),i(n,e,t.type)):null}};return e.FileReaderSync=n}),n("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={getAsBlob:function(e){var i=this.getRuntime(),n=i.shimExec.call(this,"Transporter","getAsBlob",e);return n?new t(i.uid,n):null}};return e.Transporter=i}),n("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,t,i,n,r,o,a,s){var u={send:function(e,n){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,n)}function o(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),n=null,r()}function u(e,t){var i=new s;i.bind("TransportingComplete",function(){t(this.result)}),i.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),n instanceof a){var d;if(n.each(function(e,t){e instanceof i?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),n.hasBlob()){var m=n.getBlob();m.isDetached()?u(m,function(e){m.destroy(),o(d,e)}):o(d,m)}else n=null,r()}else n instanceof i?n.isDetached()?u(n,function(e){n.destroy(),n=e.uid,r()}):(n=n.uid,r()):r()},getResponse:function(e){var i,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new n(a.uid,o),"blob"===e)return o;try{if(i=new r,~t.inArray(e,["","text"]))return i.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(i.readAsText(o))}finally{o.destroy()}}return null},abort:function(){var e=this.getRuntime();e.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=u}),n("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,i,n,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(n,"Image","loadFromBlob",e.uid),n=r=null}var n=this,r=n.getRuntime();if(e.isDetached()){var o=new i;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return t.meta&&t.meta.thumb&&t.meta.thumb.data&&!(e.meta.thumb.data instanceof n)&&(t.meta.thumb.data=new n(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var i=this.getRuntime(),r=i.shimExec.call(this,"Image","getAsBlob",e,t);return r?new n(i.uid,r):null},getAsDataURL:function(){var e,t=this.getRuntime(),i=t.Image.getAsBlob.apply(this,arguments);return i?(e=new r,e.readAsDataURL(i)):null}};return e.Image=o}),n("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(e){var t,i,n,r,o,a=!1,s=null,u=0;try{try{s=new ActiveXObject("AgControl.AgControl"),s.IsVersionSupported(e)&&(a=!0),s=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(t=l.description,"1.0.30226.2"===t&&(t="2.0.30226.2"),i=t.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(n=e.split(".");n.length>4;)n.pop();do r=parseInt(n[u],10),o=parseInt(i[u],10),u++;while(u<n.length&&r===o);o>=r&&!isNaN(r)&&(a=!0)}}}catch(d){a=!1}return a}function s(s){var l,d=this;s=e.extend({xap_url:t.xap_url},s),o.call(this,s,u,{access_binary:o.capTrue,access_image_binary:o.capTrue,display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:o.capTrue,resize_image:o.capTrue,return_response_headers:function(e){return e&&"client"===d.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===d.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:o.capTrue,send_browser_cookies:function(e){return e&&"browser"===d.mode},send_custom_headers:function(e){return e&&"client"===d.mode},send_multipart:o.capTrue,slice_blob:o.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:o.capTrue,use_http_method:function(t){return"client"===d.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),a("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(e,t){var i=[].slice.call(arguments,2);return d.getShim().exec(this.uid,e,t,i)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='<object id="'+this.uid+'" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;">'+'<param name="source" value="'+s.xap_url+'"/>'+'<param name="background" value="Transparent"/>'+'<param name="windowless" value="true"/>'+'<param name="enablehtmlaccess" value="true"/>'+'<param name="initParams" value="uid='+this.uid+",target="+t.global_event_dispatcher+'"/>'+"</object>",l=setTimeout(function(){d&&!d.initialized&&d.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(d),clearTimeout(l),s=l=e=d=null}}(this.destroy)},c)}var u="silverlight",c={};return o.addConstructor(u,s),c}),n("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){return e.Blob=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(e,t,i){function n(e){for(var t="",i=0;i<e.length;i++)t+=(""!==t?"|":"")+e[i].title+" | *."+e[i].extensions.replace(/,/g,";*.");return t}var r={init:function(e){var r=this,o=this.getRuntime();this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],i.each(e,function(e){r.files.push(new t(o.uid,e))})},999),o.shimExec.call(this,"FileInput","init",n(e.accept),e.multiple),this.trigger("ready")},setOption:function(e,t){"accept"==e&&(t=n(t)),this.getRuntime().shimExec.call(this,"FileInput","setOption",e,t)}};return e.FileInput=r}),n("moxie/runtime/silverlight/file/FileDrop",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Dom","moxie/core/utils/Events"],function(e,t,i){var n={init:function(){var e,n=this,r=n.getRuntime();return e=r.getShimContainer(),i.addEvent(e,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},n.uid),i.addEvent(e,"dragenter",function(e){e.preventDefault();var i=t.get(r.uid).dragEnter(e);i&&e.stopPropagation()},n.uid),i.addEvent(e,"drop",function(e){e.preventDefault();var i=t.get(r.uid).dragDrop(e);i&&e.stopPropagation()},n.uid),r.shimExec.call(this,"FileDrop","init")}};return e.FileDrop=n}),n("moxie/runtime/silverlight/file/FileReader",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReader"],function(e,t,i){return e.FileReader=t.extend({},i)
16
+ }),n("moxie/runtime/silverlight/file/FileReaderSync",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReaderSync"],function(e,t,i){return e.FileReaderSync=t.extend({},i)}),n("moxie/runtime/silverlight/runtime/Transporter",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/runtime/Transporter"],function(e,t,i){return e.Transporter=t.extend({},i)}),n("moxie/runtime/silverlight/xhr/XMLHttpRequest",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/xhr/XMLHttpRequest","moxie/runtime/silverlight/file/FileReaderSync","moxie/runtime/silverlight/runtime/Transporter"],function(e,t,i){return e.XMLHttpRequest=t.extend({},i)}),n("moxie/runtime/silverlight/image/Image",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/runtime/flash/image/Image"],function(e,t,i,n){return e.Image=t.extend({},n,{getInfo:function(){var e=this.getRuntime(),n=["tiff","exif","gps","thumb"],r={meta:{}},o=e.shimExec.call(this,"Image","getInfo");return o.meta&&(t.each(n,function(e){var t,i,n,a,s=o.meta[e];if(s&&s.keys)for(r.meta[e]={},i=0,n=s.keys.length;n>i;i++)t=s.keys[i],a=s[t],a&&(/^(\d|[1-9]\d+)$/.test(a)?a=parseInt(a,10):/^\d*\.\d+$/.test(a)&&(a=parseFloat(a)),r.meta[e][t]=a)}),r.meta&&r.meta.thumb&&r.meta.thumb.data&&!(e.meta.thumb.data instanceof i)&&(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue;i.call(this,t,a,{access_binary:u(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return s.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&("Firefox"===n.browser&&n.verComp(n.version,4,">=")||"Opera"===n.browser&&n.verComp(n.version,12,">=")||"IE"===n.browser&&n.verComp(n.version,10,">=")||!!~e.inArray(n.browser,["Chrome","Safari"]))},upload_filesize:c,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html4",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){function e(){var o,c,d,m,h,f,p=this,g=p.getRuntime();f=i.guid("uid_"),o=g.getShimContainer(),s&&(d=n.get(s+"_form"),d&&i.extend(d.style,{top:"100%"})),m=document.createElement("form"),m.setAttribute("id",f+"_form"),m.setAttribute("method","post"),m.setAttribute("enctype","multipart/form-data"),m.setAttribute("encoding","multipart/form-data"),i.extend(m.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=document.createElement("input"),h.setAttribute("id",f),h.setAttribute("type","file"),h.setAttribute("accept",l.join(",")),i.extend(h.style,{fontSize:"999px",opacity:0}),m.appendChild(h),o.appendChild(m),i.extend(h.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&i.extend(h.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),h.onchange=function(){var i;if(this.value){if(this.files){if(i=this.files[0],0===i.size)return m.parentNode.removeChild(m),void 0}else i={name:this.value};i=new t(g.uid,i),this.onchange=function(){},e.call(p),p.files=[i],h.setAttribute("id",i.uid),m.setAttribute("id",i.uid+"_form"),p.trigger("change"),h=m=null}},g.can("summon_file_dialog")&&(c=n.get(u.browse_button),r.removeEvent(c,"click",p.uid),r.addEvent(c,"click",function(e){h&&!h.disabled&&h.click(),e.preventDefault()},p.uid)),s=f,o=d=c=null}var s,u,c,l=[];i.extend(this,{init:function(t){var i,a=this,s=a.getRuntime();u=t,l=t.accept.mimes||o.extList2mimes(t.accept,s.can("filter_by_extension")),i=s.getShimContainer(),function(){var e,o,l;e=n.get(t.browse_button),c=n.getStyle(e,"z-index")||"auto",s.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),a.bind("Refresh",function(){o=parseInt(c,10)||1,n.get(u.browse_button).style.zIndex=o,this.getRuntime().getShimContainer().style.zIndex=o-1})),l=s.can("summon_file_dialog")?e:i,r.addEvent(l,"mouseover",function(){a.trigger("mouseenter")},a.uid),r.addEvent(l,"mouseout",function(){a.trigger("mouseleave")},a.uid),r.addEvent(l,"mousedown",function(){a.trigger("mousedown")},a.uid),r.addEvent(n.get(t.container),"mouseup",function(){a.trigger("mouseup")},a.uid),e=null}(),e.call(this),i=null,a.trigger({type:"ready",async:!0})},setOption:function(e,t){var i,r=this.getRuntime();"accept"==e&&(l=t.mimes||o.extList2mimes(t,r.can("filter_by_extension"))),i=n.get(s),i&&i.setAttribute("accept",l.join(","))},disable:function(e){var t;(t=n.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),o=u&&n.get(u.container),a=u&&n.get(u.browse_button);o&&r.removeAllEvents(o,this.uid),a&&(r.removeAllEvents(a,this.uid),a.style.zIndex=c),i&&(r.removeAllEvents(i,this.uid),i.innerHTML=""),t.removeInstance(this.uid),s=l=u=i=o=a=t=null}})}return e.FileInput=s}),n("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),n("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,t,i,n,r,o,a,s){function u(){function e(e){var t,n,r,a,s=this,u=!1;if(l){if(t=l.id.replace(/_iframe$/,""),n=i.get(t+"_form")){for(r=n.getElementsByTagName("input"),a=r.length;a--;)switch(r[a].getAttribute("type")){case"hidden":r[a].parentNode.removeChild(r[a]);break;case"file":u=!0}r=[],u||n.parentNode.removeChild(n),n=null}setTimeout(function(){o.removeEvent(l,"load",s.uid),l.parentNode&&l.parentNode.removeChild(l);var t=s.getRuntime().getShimContainer();t.children.length||t.parentNode.removeChild(t),t=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,m){function h(){var i=w.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='<iframe id="'+f+'_iframe" name="'+f+'_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>',l=r.firstChild,i.appendChild(l),o.addEvent(l,"load",function(){var i;try{i=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?u=i.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(i.body.innerHTML),v.trigger({type:"progress",loaded:c.length,total:c.length}),x&&v.trigger({type:"uploadprogress",loaded:x.size||1025,total:x.size||1025}))}catch(r){if(!n.hasSameOrigin(d.url))return e.call(v,function(){v.trigger("error")}),void 0;u=404}e.call(v,function(){v.trigger("load")})},v.uid)}var f,p,g,x,v=this,w=v.getRuntime();if(u=c=null,m instanceof s&&m.hasBlob()){if(x=m.getBlob(),f=x.uid,g=i.get(f),p=i.get(f+"_form"),!p)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else f=t.guid("uid_"),p=document.createElement("form"),p.setAttribute("id",f+"_form"),p.setAttribute("method",d.method),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),w.getShimContainer().appendChild(p);p.setAttribute("target",f+"_iframe"),m instanceof s&&m.each(function(e,i){if(e instanceof a)g&&g.setAttribute("name",i);else{var n=document.createElement("input");t.extend(n,{type:"hidden",name:i,value:e}),g?p.insertBefore(n,g):p.appendChild(n)}}),p.setAttribute("action",d.url),h(),p.submit(),v.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*<pre[^>]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Plupload - multi-runtime File Uploader
19
+ * v2.3.1
20
  *
21
  * Copyright 2013, Moxiecode Systems AB
22
  * Released under GPL License.
24
  * License: http://www.plupload.com/license
25
  * Contributing: http://www.plupload.com/contributing
26
  *
27
+ * Date: 2017-02-06
28
  */
29
+ !function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.plupload};"function"==typeof define&&define.amd?define("plupload",["./moxie"],i):"object"==typeof module&&module.exports?module.exports=i(require("./moxie")):e.plupload=i(e.moxie)}(this||window,function(e){!function(e,t,i){function n(e){function t(e,t,i){var r={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};r[e]?n[r[e]]=t:i||(n[e]=t)}var i=e.required_features,n={};return"string"==typeof i?l.each(i.split(/\s*,\s*/),function(e){t(e,!0)}):"object"==typeof i?l.each(i,function(e,i){t(i,e)}):i===!0&&(e.chunk_size&&e.chunk_size>0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart!==!1||(n.send_binary_string=!0),e.http_method&&(n.use_http_method=e.http_method),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,s={},a=t.core.utils,o=t.runtime.Runtime,l={VERSION:"2.3.1",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t<i.length;t+=2)e=e.replace(i[t],i[t+1]);return e=e.replace(/\s+/g,"_"),e=e.replace(/[^a-z0-9_\-\.]+/gi,"")},buildUrl:function(e,t){var i="";return l.each(t,function(e,t){i+=(i?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)}),i&&(e+=(e.indexOf("?")>0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=o.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){s[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),i(!1),void 0;i(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t<x.length;t++)e||x[t].status!=l.QUEUED?i++:(e=x[t],this.trigger("BeforeUpload",e)&&(e.status=l.UPLOADING,this.trigger("UploadFile",e)));i==x.length&&(this.state!==l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged")),this.trigger("UploadComplete",x))}}function u(e){e.percent=e.size>0?Math.ceil(100*(e.loaded/e.size)):100,d()}function d(){var e,t,n,r=0;for(w.reset(),e=0;e<x.length;e++)t=x[e],t.size!==i?(w.size+=t.origSize,n=t.loaded*t.origSize/t.size,(!t.completeTimestamp||t.completeTimestamp>I)&&(r+=n),w.loaded+=n):w.size=i,t.status==l.DONE?w.uploaded++:t.status==l.FAILED?w.failed++:w.queued++;w.size===i?w.percent=x.length>0?Math.ceil(100*(w.uploaded/x.length)):0:(w.bytesPerSec=Math.ceil(r/((+new Date-I||1)/1e3)),w.percent=w.size>0?Math.ceil(100*(w.loaded/w.size)):0)}function c(){var e=U[0]||F[0];return e?e.getRuntime().uid:!1}function f(e,t){if(e.ruid){var i=o.getInfo(e.ruid);if(i)return i.can(t)}return!1}function p(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",y),this.bind("BeforeUpload",_),this.bind("UploadFile",E),this.bind("UploadProgress",v),this.bind("StateChanged",b),this.bind("QueueChanged",d),this.bind("Error",z),this.bind("FileUploaded",R),this.bind("Destroy",O)}function g(e,i){var n=this,r=0,s=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:P,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){s.push(function(s){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,U.push(this),s()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){A||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,s()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){s.push(function(i){var s=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));s.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,F.push(this),i()},s.ondrop=function(){n.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,i()}),s.init()})}),l.inSeries(s,function(){"function"==typeof i&&i(r)})}function h(e,n,r){var s=new t.image.Image;try{s.onload=function(){return n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),r(e)):(s.downsize(n.width,n.height,n.crop,n.preserve_headers),void 0)},s.onresize=function(){r(this.getAsBlob(e.type,n.quality)),this.destroy()},s.onerror=function(){r(e)},s.load(e)}catch(a){r(e)}}function m(e,i,r){function s(e,i,n){var r=S[e];switch(e){case"max_file_size":"max_file_size"===e&&(S.max_file_size=S.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(S[e]=i,S.send_file_name=!0);break;case"multipart":S[e]=i,i||(S.send_file_name=!0);break;case"http_method":S[e]="PUT"===i.toUpperCase()?"PUT":"POST";break;case"unique_names":S[e]=i,i&&(S.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(S.filters,i):S.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),S.filters.mime_types=i.mime_types);break;case"resize":S.resize=i?l.extend({preserve_headers:!0,crop:!1},i):!1;break;case"prevent_duplicates":S.prevent_duplicates=S.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":S[e]=i,n||(u=!0);break;default:S[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){s(t,e,r)}):s(e,i,r),r?(S.required_features=n(l.extend({},S)),P=n(l.extend({},S,{required_features:!0}))):u&&(a.trigger("Destroy"),g.call(a,S,function(e){e?(a.runtime=o.getInfo(c()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function _(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function E(e,i){function n(){c-->0?r(s,1e3):(i.loaded=g,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()}))}function s(){var t,n,r={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(r.name=i.target_name||i.name),d&&p.chunks&&o.size>d?(n=Math.min(d,o.size-g),t=o.slice(g,g+n)):(n=o.size,t=o),d&&p.chunks&&(e.settings.send_chunk_number?(r.chunk=Math.ceil(g/d),r.chunks=Math.ceil(o.size/d)):(r.offset=g,r.total=o.size)),e.trigger("BeforeChunkUpload",i,r,t,g)&&a(r,t,n))}function a(a,d,f){var h;T=new t.xhr.XMLHttpRequest,T.upload&&(T.upload.onprogress=function(t){i.loaded=Math.min(i.size,g+t.loaded),e.trigger("UploadProgress",i)}),T.onload=function(){return T.status>=400?(n(),void 0):(c=e.settings.max_retries,f<o.size?(d.destroy(),g+=f,i.loaded=Math.min(g,o.size),e.trigger("ChunkUploaded",i,{offset:i.loaded,total:o.size,response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()}),"Android Browser"===l.ua.browser&&e.trigger("UploadProgress",i)):i.loaded=i.size,d=h=null,!g||g>=o.size?(i.size!=i.origSize&&(o.destroy(),o=null),e.trigger("UploadProgress",i),i.status=l.DONE,i.completeTimestamp=+new Date,e.trigger("FileUploaded",i,{response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()})):r(s,1),void 0)},T.onerror=function(){n()},T.onloadend=function(){this.destroy(),T=null},e.settings.multipart&&p.multipart?(T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),h=new t.xhr.FormData,l.each(l.extend(a,e.settings.multipart_params),function(e,t){h.append(t,e)}),h.append(e.settings.file_data_name,d),T.send(h,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:P,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(u=l.buildUrl(e.settings.url,l.extend(a,e.settings.multipart_params)),T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),T.hasRequestHeader("Content-Type")||T.setRequestHeader("Content-Type","application/octet-stream"),T.send(d,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:P,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url}))}var o,u=e.settings.url,d=e.settings.chunk_size,c=e.settings.max_retries,p=e.features,g=0;i.loaded&&(g=i.loaded=d?d*Math.floor(i.loaded/d):0),o=i.getSource(),!l.isEmptyObj(e.settings.resize)&&f(o,"send_binary_string")&&-1!==l.inArray(o.type,["image/jpeg","image/png"])?h.call(this,o,e.settings.resize,function(e){o=e,i.size=e.size,s()}):s()}function v(e,t){u(t)}function b(e){if(e.state==l.STARTED)I=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,d())}function y(){T&&T.abort()}function R(e){d(),r(function(){a.call(e)},1)}function z(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,t.file.completeTimestamp=+new Date,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function O(e){e.stop(),l.each(x,function(e){e.destroy()}),x=[],U.length&&(l.each(U,function(e){e.destroy()}),U=[]),F.length&&(l.each(F,function(e){e.destroy()}),F=[]),P={},A=!1,I=T=null,w.reset()}var S,I,w,T,D=l.guid(),x=[],P={},U=[],F=[],A=!1;S={chunk_size:0,file_data_name:"file",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},flash_swf_url:"js/Moxie.swf",http_method:"POST",max_retries:0,multipart:!0,multi_selection:!0,resize:!1,runtimes:o.order,send_file_name:!0,send_chunk_number:!0,silverlight_xap_url:"js/Moxie.xap"},m.call(this,e,null,!0),w=new l.QueueProgress,l.extend(this,{id:D,uid:D,state:l.STOPPED,features:{},runtime:null,files:x,settings:S,total:w,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),p.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):S.browse_button||S.drop_element?(g.call(i,S,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=o.getInfo(c()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}),void 0):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){m.call(this,e,t,!this.runtime)},getOption:function(e){return e?S[e]:S},refresh:function(){U.length&&l.each(U,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){A=arguments[0]!==i?arguments[0]:!0,U.length&&l.each(U,function(e){e.disable(A)}),this.trigger("DisableBrowse",A)},getFile:function(e){var t;for(t=x.length-1;t>=0;t--)if(x[t].id===e)return x[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){s[n]&&i.push(function(i){s[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var s=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!o)return!1;e.ruid=o,e.connectRuntime(o)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),d.push(function(t){n(e,function(i){i||(x.push(e),f.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(s,["file","blob"])?a(new t.file.File(null,e)):"node"===s&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===s&&(i=null,l.each(e,a))}var o,u=this,d=[],f=[];o=c(),a(e),d.length&&l.inSeries(d,function(){f.length&&u.trigger("FilesAdded",f)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=x.length-1;i>=0;i--)if(x[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=x.splice(e===i?0:e,t===i?x.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n<t.length;n++)if(t[n].fn.apply(t[n].scope,i)===!1)return!1}return!0},bind:function(e,t,i,n){l.Uploader.prototype.bind.call(this,e,t,n,i)},destroy:function(){this.trigger("Destroy"),S=w=null,this.unbindAll()}})},l.Uploader.prototype=t.core.EventTarget.instance,l.File=function(){function e(e){l.extend(this,{id:l.guid(),name:e.name||e.fileName,type:e.type||"",size:e.size||e.fileSize,origSize:e.size||e.fileSize,loaded:0,percent:0,status:l.QUEUED,lastModifiedDate:e.lastModifiedDate||(new Date).toLocaleString(),completeTimestamp:0,getNative:function(){var e=this.getSource().getSource();return-1!==l.inArray(l.typeOf(e),["blob","file"])?e:null},getSource:function(){return t[this.id]?t[this.id]:null},destroy:function(){var e=this.getSource();e&&(e.destroy(),delete t[this.id])}}),t[this.id]=e}var t={};return e}(),l.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=l}(this,e)});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/global/plugins/pluploader/moxie.swf CHANGED
Binary file
assets/global/plugins/pluploader/moxie.xap CHANGED
Binary file
assets/global/plugins/validation/jquery.validate.js CHANGED
@@ -1,1366 +1,1574 @@
1
- /*!
2
- * jQuery Validation Plugin
3
- * Copyright (c) 2015 Jörn Zaefferer
4
- */
5
- (function (factory) {
6
- if (typeof define === "function" && define.amd) {
7
- define(["jquery"], factory);
8
- } else if (typeof module === "object" && module.exports) {
9
- module.exports = factory(require("jquery"));
10
- } else {
11
- factory(jQuery);
12
- }
13
- }(function ($) {
14
-
15
- $.extend($.fn, {
16
- validate: function (options) {
17
-
18
- // If nothing is selected, return nothing; can't chain anyway
19
- if (!this.length) {
20
- if (options && options.debug && window.console) {
21
- console.warn("Nothing selected, can't validate, returning nothing.");
22
- }
23
- return;
24
- }
25
-
26
- // Check if a validator for this form was already created
27
- var validator = $.data(this[0], "validator");
28
- if (validator) {
29
- return validator;
30
- }
31
-
32
- // Add novalidate tag if HTML5.
33
- this.attr("novalidate", "novalidate");
34
-
35
- validator = new $.validator(options, this[0]);
36
- $.data(this[0], "validator", validator);
37
-
38
- if (validator.settings.onsubmit) {
39
-
40
- this.on("click.validate", ":submit", function (event) {
41
- if (validator.settings.submitHandler) {
42
- validator.submitButton = event.target;
43
- }
44
-
45
- // Allow suppressing validation by adding a cancel class to the submit button
46
- if ($(this).hasClass("cancel")) {
47
- validator.cancelSubmit = true;
48
- }
49
-
50
- // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button
51
- if ($(this).attr("formnovalidate") !== undefined) {
52
- validator.cancelSubmit = true;
53
- }
54
- });
55
-
56
- // Validate the form on submit
57
- this.on("submit.validate", function (event) {
58
- if (validator.settings.debug) {
59
-
60
- // Prevent form submit to be able to see console output
61
- event.preventDefault();
62
- }
63
-
64
- function handle() {
65
- var hidden, result;
66
- if (validator.settings.submitHandler) {
67
- if (validator.submitButton) {
68
-
69
- // Insert a hidden input as a replacement for the missing submit button
70
- hidden = $("<input type='hidden'/>")
71
- .attr("name", validator.submitButton.name)
72
- .val($(validator.submitButton).val())
73
- .appendTo(validator.currentForm);
74
- }
75
- result = validator.settings.submitHandler.call(validator, validator.currentForm, event);
76
- if (validator.submitButton) {
77
-
78
- // And clean up afterwards; thanks to no-block-scope, hidden can be referenced
79
- hidden.remove();
80
- }
81
- if (result !== undefined) {
82
- return result;
83
- }
84
- return false;
85
- }
86
- return true;
87
- }
88
- if (validator.cancelSubmit) {
89
- validator.cancelSubmit = false;
90
- return handle();
91
- }
92
- if (validator.form()) {
93
- if (validator.pendingRequest) {
94
- validator.formSubmitted = true;
95
- return false;
96
- }
97
- return handle();
98
- } else {
99
- validator.focusInvalid();
100
- return false;
101
- }
102
- });
103
- }
104
-
105
- return validator;
106
- },
107
- valid: function () {
108
- var valid, validator, errorList;
109
-
110
- if ($(this[0]).is("form")) {
111
- valid = this.validate().form();
112
- } else {
113
- errorList = [];
114
- valid = true;
115
- validator = $(this[0].form).validate();
116
- this.each(function () {
117
- valid = validator.element(this) && valid;
118
- if (!valid) {
119
- errorList = errorList.concat(validator.errorList);
120
- }
121
- });
122
- validator.errorList = errorList;
123
- }
124
- return valid;
125
- },
126
- rules: function (command, argument) {
127
-
128
- // If nothing is selected, return nothing; can't chain anyway
129
- if (!this.length) {
130
- return;
131
- }
132
-
133
- var element = this[0],
134
- settings, staticRules, existingRules, data, param, filtered;
135
-
136
- if (command) {
137
- settings = $.data(element.form, "validator").settings;
138
- staticRules = settings.rules;
139
- existingRules = $.validator.staticRules(element);
140
- switch (command) {
141
- case "add":
142
- $.extend(existingRules, $.validator.normalizeRule(argument));
143
-
144
- // Remove messages from rules, but allow them to be set separately
145
- delete existingRules.messages;
146
- staticRules[element.name] = existingRules;
147
- if (argument.messages) {
148
- settings.messages[element.name] = $.extend(settings.messages[element.name], argument.messages);
149
- }
150
- break;
151
- case "remove":
152
- if (!argument) {
153
- delete staticRules[element.name];
154
- return existingRules;
155
- }
156
- filtered = {};
157
- $.each(argument.split(/\s/), function (index, method) {
158
- filtered[method] = existingRules[method];
159
- delete existingRules[method];
160
- if (method === "required") {
161
- $(element).removeAttr("aria-required");
162
- }
163
- });
164
- return filtered;
165
- }
166
- }
167
-
168
- data = $.validator.normalizeRules(
169
- $.extend({},
170
- $.validator.classRules(element),
171
- $.validator.attributeRules(element),
172
- $.validator.dataRules(element),
173
- $.validator.staticRules(element)
174
- ), element);
175
-
176
- // Make sure required is at front
177
- if (data.required) {
178
- param = data.required;
179
- delete data.required;
180
- data = $.extend({
181
- required: param
182
- }, data);
183
- $(element).attr("aria-required", "true");
184
- }
185
-
186
- // Make sure remote is at back
187
- if (data.remote) {
188
- param = data.remote;
189
- delete data.remote;
190
- data = $.extend(data, {
191
- remote: param
192
- });
193
- }
194
-
195
- return data;
196
- }
197
- });
198
-
199
- // Custom selectors
200
- $.extend($.expr[":"], {
201
- blank: function (a) {
202
- return !$.trim("" + $(a).val());
203
- },
204
- filled: function (a) {
205
- var val = $(a).val();
206
- return val !== null && !!$.trim("" + val);
207
- },
208
-
209
- unchecked: function (a) {
210
- return !$(a).prop("checked");
211
- }
212
- });
213
-
214
- // Constructor for validator
215
- $.validator = function (options, form) {
216
- this.settings = $.extend(true, {}, $.validator.defaults, options);
217
- this.currentForm = form;
218
- this.init();
219
- };
220
-
221
- $.validator.format = function (source, params) {
222
- if (arguments.length === 1) {
223
- return function () {
224
- var args = $.makeArray(arguments);
225
- args.unshift(source);
226
- return $.validator.format.apply(this, args);
227
- };
228
- }
229
- if (params === undefined) {
230
- return source;
231
- }
232
- if (arguments.length > 2 && params.constructor !== Array) {
233
- params = $.makeArray(arguments).slice(1);
234
- }
235
- if (params.constructor !== Array) {
236
- params = [params];
237
- }
238
- $.each(params, function (i, n) {
239
- source = source.replace(new RegExp("\\{" + i + "\\}", "g"), function () {
240
- return n;
241
- });
242
- });
243
- return source;
244
- };
245
-
246
- $.extend($.validator, {
247
-
248
- defaults: {
249
- messages: {},
250
- groups: {},
251
- rules: {},
252
- errorClass: "error",
253
- pendingClass: "pending",
254
- validClass: "valid",
255
- errorElement: "label",
256
- focusCleanup: false,
257
- focusInvalid: true,
258
- errorContainer: $([]),
259
- errorLabelContainer: $([]),
260
- onsubmit: true,
261
- ignore: ":hidden",
262
- ignoreTitle: false,
263
- onfocusin: function (element) {
264
- this.lastActive = element;
265
- if (this.settings.focusCleanup) {
266
- if (this.settings.unhighlight) {
267
- this.settings.unhighlight.call(this, element, this.settings.errorClass, this.settings.validClass);
268
- }
269
- this.hideThese(this.errorsFor(element));
270
- }
271
- },
272
- onfocusout: function (element) {
273
- if (!this.checkable(element) && (element.name in this.submitted || !this.optional(element))) {
274
- this.element(element);
275
- }
276
- },
277
- onkeyup: function (element, event) {
278
- var excludedKeys = [
279
- 16, 17, 18, 20, 35, 36, 37,
280
- 38, 39, 40, 45, 144, 225
281
- ];
282
-
283
- if (event.which === 9 && this.elementValue(element) === "" || $.inArray(event.keyCode, excludedKeys) !== -1) {
284
- return;
285
- } else if (element.name in this.submitted || element.name in this.invalid) {
286
- this.element(element);
287
- }
288
- },
289
- onclick: function (element) {
290
-
291
- // Click on selects, radiobuttons and checkboxes
292
- if (element.name in this.submitted) {
293
- this.element(element);
294
-
295
- // Or option elements, check parent select in that case
296
- } else if (element.parentNode.name in this.submitted) {
297
- this.element(element.parentNode);
298
- }
299
- },
300
- highlight: function (element, errorClass, validClass) {
301
- if (element.type === "radio") {
302
- this.findByName(element.name).addClass(errorClass).removeClass(validClass);
303
- } else {
304
- $(element).addClass(errorClass).removeClass(validClass);
305
- }
306
- },
307
- unhighlight: function (element, errorClass, validClass) {
308
- if (element.type === "radio") {
309
- this.findByName(element.name).removeClass(errorClass).addClass(validClass);
310
- } else {
311
- $(element).removeClass(errorClass).addClass(validClass);
312
- }
313
- }
314
- },
315
- setDefaults: function (settings) {
316
- $.extend($.validator.defaults, settings);
317
- },
318
-
319
- messages: {
320
- required: "This field is required.",
321
- remote: "Please fix this field.",
322
- email: "Please enter a valid email address.",
323
- url: "Please enter a valid URL.",
324
- date: "Please enter a valid date.",
325
- dateISO: "Please enter a valid date ( ISO ).",
326
- number: "Please enter a valid number.",
327
- digits: "Please enter only digits.",
328
- equalTo: "Please enter the same value again.",
329
- maxlength: $.validator.format("Please enter no more than {0} characters."),
330
- minlength: $.validator.format("Please enter at least {0} characters."),
331
- rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."),
332
- range: $.validator.format("Please enter a value between {0} and {1}."),
333
- max: $.validator.format("Please enter a value less than or equal to {0}."),
334
- min: $.validator.format("Please enter a value greater than or equal to {0}."),
335
- step: $.validator.format("Please enter a multiple of {0}.")
336
- },
337
-
338
- autoCreateRanges: false,
339
-
340
- prototype: {
341
-
342
- init: function () {
343
- this.labelContainer = $(this.settings.errorLabelContainer);
344
- this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm);
345
- this.containers = $(this.settings.errorContainer).add(this.settings.errorLabelContainer);
346
- this.submitted = {};
347
- this.valueCache = {};
348
- this.pendingRequest = 0;
349
- this.pending = {};
350
- this.invalid = {};
351
- this.reset();
352
-
353
- var groups = (this.groups = {}),
354
- rules;
355
- $.each(this.settings.groups, function (key, value) {
356
- if (typeof value === "string") {
357
- value = value.split(/\s/);
358
- }
359
- $.each(value, function (index, name) {
360
- groups[name] = key;
361
- });
362
- });
363
- rules = this.settings.rules;
364
- $.each(rules, function (key, value) {
365
- rules[key] = $.validator.normalizeRule(value);
366
- });
367
-
368
- function delegate(event) {
369
- var validator = $.data(this.form, "validator"),
370
- eventType = "on" + event.type.replace(/^validate/, ""),
371
- settings = validator.settings;
372
- if (settings[eventType] && !$(this).is(settings.ignore)) {
373
- settings[eventType].call(validator, this, event);
374
- }
375
- }
376
-
377
- $(this.currentForm)
378
- .on("focusin.validate focusout.validate keyup.validate",
379
- ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
380
- "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
381
- "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
382
- "[type='radio'], [type='checkbox'], [contenteditable]", delegate)
383
- .on("click.validate", "select, option, [type='radio'], [type='checkbox']", delegate);
384
-
385
- if (this.settings.invalidHandler) {
386
- $(this.currentForm).on("invalid-form.validate", this.settings.invalidHandler);
387
- }
388
-
389
- // Add aria-required to any Static/Data/Class required fields before first validation
390
- // Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html
391
- $(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required", "true");
392
- },
393
-
394
- form: function () {
395
- this.checkForm();
396
- $.extend(this.submitted, this.errorMap);
397
- this.invalid = $.extend({}, this.errorMap);
398
- if (!this.valid()) {
399
- $(this.currentForm).triggerHandler("invalid-form", [this]);
400
- }
401
- this.showErrors();
402
- return this.valid();
403
- },
404
-
405
- checkForm: function () {
406
- this.prepareForm();
407
- for (var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++) {
408
- this.check(elements[i]);
409
- }
410
- return this.valid();
411
- },
412
- element: function (element) {
413
- var cleanElement = this.clean(element),
414
- checkElement = this.validationTargetFor(cleanElement),
415
- v = this,
416
- result = true,
417
- rs, group;
418
-
419
- if (checkElement === undefined) {
420
- delete this.invalid[cleanElement.name];
421
- } else {
422
- this.prepareElement(checkElement);
423
- this.currentElements = $(checkElement);
424
-
425
- // If this element is grouped, then validate all group elements already
426
- // containing a value
427
- group = this.groups[checkElement.name];
428
- if (group) {
429
- $.each(this.groups, function (name, testgroup) {
430
- if (testgroup === group && name !== checkElement.name) {
431
- cleanElement = v.validationTargetFor(v.clean(v.findByName(name)));
432
- if (cleanElement && cleanElement.name in v.invalid) {
433
- v.currentElements.push(cleanElement);
434
- result = result && v.check(cleanElement);
435
- }
436
- }
437
- });
438
- }
439
-
440
- rs = this.check(checkElement) !== false;
441
- result = result && rs;
442
- if (rs) {
443
- this.invalid[checkElement.name] = false;
444
- } else {
445
- this.invalid[checkElement.name] = true;
446
- }
447
-
448
- if (!this.numberOfInvalids()) {
449
-
450
- // Hide error containers on last error
451
- this.toHide = this.toHide.add(this.containers);
452
- }
453
- this.showErrors();
454
-
455
- // Add aria-invalid status for screen readers
456
- $(element).attr("aria-invalid", !rs);
457
- }
458
-
459
- return result;
460
- },
461
- showErrors: function (errors) {
462
- if (errors) {
463
- var validator = this;
464
-
465
- // Add items to error list and map
466
- $.extend(this.errorMap, errors);
467
- this.errorList = $.map(this.errorMap, function (message, name) {
468
- return {
469
- message: message,
470
- element: validator.findByName(name)[0]
471
- };
472
- });
473
-
474
- // Remove items from success list
475
- this.successList = $.grep(this.successList, function (element) {
476
- return !(element.name in errors);
477
- });
478
- }
479
- if (this.settings.showErrors) {
480
- this.settings.showErrors.call(this, this.errorMap, this.errorList);
481
- } else {
482
- this.defaultShowErrors();
483
- }
484
- },
485
- resetForm: function () {
486
- if ($.fn.resetForm) {
487
- $(this.currentForm).resetForm();
488
- }
489
- this.invalid = {};
490
- this.submitted = {};
491
- this.prepareForm();
492
- this.hideErrors();
493
- var elements = this.elements()
494
- .removeData("previousValue")
495
- .removeAttr("aria-invalid");
496
-
497
- this.resetElements(elements);
498
- },
499
-
500
- resetElements: function (elements) {
501
- var i;
502
-
503
- if (this.settings.unhighlight) {
504
- for (i = 0; elements[i]; i++) {
505
- this.settings.unhighlight.call(this, elements[i],
506
- this.settings.errorClass, "");
507
- this.findByName(elements[i].name).removeClass(this.settings.validClass);
508
- }
509
- } else {
510
- elements
511
- .removeClass(this.settings.errorClass)
512
- .removeClass(this.settings.validClass);
513
- }
514
- },
515
-
516
- numberOfInvalids: function () {
517
- return this.objectLength(this.invalid);
518
- },
519
-
520
- objectLength: function (obj) {
521
- /* jshint unused: false */
522
- var count = 0,
523
- i;
524
- for (i in obj) {
525
- if (obj[i]) {
526
- count++;
527
- }
528
- }
529
- return count;
530
- },
531
-
532
- hideErrors: function () {
533
- this.hideThese(this.toHide);
534
- },
535
-
536
- hideThese: function (errors) {
537
- errors.not(this.containers).text("");
538
- this.addWrapper(errors).hide();
539
- },
540
-
541
- valid: function () {
542
- return this.size() === 0;
543
- },
544
-
545
- size: function () {
546
- return this.errorList.length;
547
- },
548
-
549
- focusInvalid: function () {
550
- if (this.settings.focusInvalid) {
551
- try {
552
- $(this.findLastActive() || this.errorList.length && this.errorList[0].element || [])
553
- .filter(":visible")
554
- .focus()
555
-
556
- // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find
557
- .trigger("focusin");
558
- } catch (e) {
559
- }
560
- }
561
- },
562
-
563
- findLastActive: function () {
564
- var lastActive = this.lastActive;
565
- return lastActive && $.grep(this.errorList, function (n) {
566
- return n.element.name === lastActive.name;
567
- }).length === 1 && lastActive;
568
- },
569
-
570
- elements: function () {
571
- var validator = this,
572
- rulesCache = {};
573
-
574
- // Select all valid inputs inside the form (no submit or reset buttons)
575
- return $(this.currentForm)
576
- .find("input, select, textarea, [contenteditable]")
577
- .not(":submit, :reset, :image, :disabled")
578
- .not(this.settings.ignore)
579
- .filter(function () {
580
- var name = this.name || $(this).attr("name"); // For contenteditable
581
- if (!name && validator.settings.debug && window.console) {
582
- console.error("%o has no name assigned", this);
583
- }
584
-
585
- if (this.hasAttribute("contenteditable")) {
586
- this.form = $(this).closest("form")[0];
587
- }
588
-
589
- // Select only the first element for each name, and only those with rules specified
590
- if (name in rulesCache || !validator.objectLength($(this).rules())) {
591
- return false;
592
- }
593
-
594
- rulesCache[name] = true;
595
- return true;
596
- });
597
- },
598
-
599
- clean: function (selector) {
600
- return $(selector)[0];
601
- },
602
-
603
- errors: function () {
604
- var errorClass = this.settings.errorClass.split(" ").join(".");
605
- return $(this.settings.errorElement + "." + errorClass, this.errorContext);
606
- },
607
-
608
- resetInternals: function () {
609
- this.successList = [];
610
- this.errorList = [];
611
- this.errorMap = {};
612
- this.toShow = $([]);
613
- this.toHide = $([]);
614
- },
615
-
616
- reset: function () {
617
- this.resetInternals();
618
- this.currentElements = $([]);
619
- },
620
-
621
- prepareForm: function () {
622
- this.reset();
623
- this.toHide = this.errors().add(this.containers);
624
- },
625
-
626
- prepareElement: function (element) {
627
- this.reset();
628
- this.toHide = this.errorsFor(element);
629
- },
630
-
631
- elementValue: function (element) {
632
- var $element = $(element),
633
- type = element.type,
634
- val, idx;
635
-
636
- if (type === "radio" || type === "checkbox") {
637
- return this.findByName(element.name).filter(":checked").val();
638
- } else if (type === "number" && typeof element.validity !== "undefined") {
639
- return element.validity.badInput ? "NaN" : $element.val();
640
- }
641
-
642
- if (element.hasAttribute("contenteditable")) {
643
- val = $element.text();
644
- } else {
645
- val = $element.val();
646
- }
647
-
648
- if (type === "file") {
649
-
650
- // Modern browser (chrome & safari)
651
- if (val.substr(0, 12) === "C:\\fakepath\\") {
652
- return val.substr(12);
653
- }
654
-
655
- idx = val.lastIndexOf("/");
656
- if (idx >= 0) {
657
- return val.substr(idx + 1);
658
- }
659
-
660
- // Windows-based path
661
- idx = val.lastIndexOf("\\");
662
- if (idx >= 0) {
663
- return val.substr(idx + 1);
664
- }
665
-
666
- // Just the file name
667
- return val;
668
- }
669
-
670
- if (typeof val === "string") {
671
- return val.replace(/\r/g, "");
672
- }
673
- return val;
674
- },
675
-
676
- check: function (element) {
677
- element = this.validationTargetFor(this.clean(element));
678
-
679
- var rules = $(element).rules(),
680
- rulesCount = $.map(rules, function (n, i) {
681
- return i;
682
- }).length,
683
- dependencyMismatch = false,
684
- val = this.elementValue(element),
685
- result, method, rule;
686
- if (typeof rules.normalizer === "function") {
687
- val = rules.normalizer.call(element, val);
688
-
689
- if (typeof val !== "string") {
690
- throw new TypeError("The normalizer should return a string value.");
691
- }
692
- delete rules.normalizer;
693
- }
694
-
695
- for (method in rules) {
696
- rule = {
697
- method: method,
698
- parameters: rules[method]
699
- };
700
- try {
701
- result = $.validator.methods[method].call(this, val, element, rule.parameters);
702
- if (result === "dependency-mismatch" && rulesCount === 1) {
703
- dependencyMismatch = true;
704
- continue;
705
- }
706
- dependencyMismatch = false;
707
-
708
- if (result === "pending") {
709
- this.toHide = this.toHide.not(this.errorsFor(element));
710
- return;
711
- }
712
-
713
- if (!result) {
714
- this.formatAndAdd(element, rule);
715
- return false;
716
- }
717
- } catch (e) {
718
- if (this.settings.debug && window.console) {
719
- console.log("Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e);
720
- }
721
- if (e instanceof TypeError) {
722
- e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.";
723
- }
724
-
725
- throw e;
726
- }
727
- }
728
- if (dependencyMismatch) {
729
- return;
730
- }
731
- if (this.objectLength(rules)) {
732
- this.successList.push(element);
733
- }
734
- return true;
735
- },
736
-
737
- customDataMessage: function (element, method) {
738
- return $(element).data("msg" + method.charAt(0).toUpperCase() +
739
- method.substring(1).toLowerCase()) || $(element).data("msg");
740
- },
741
-
742
- // Return the custom message for the given element name and validation method
743
- customMessage: function (name, method) {
744
- var m = this.settings.messages[name];
745
- return m && (m.constructor === String ? m : m[method]);
746
- },
747
-
748
- // Return the first defined argument, allowing empty strings
749
- findDefined: function () {
750
- for (var i = 0; i < arguments.length; i++) {
751
- if (arguments[i] !== undefined) {
752
- return arguments[i];
753
- }
754
- }
755
- return undefined;
756
- },
757
-
758
- defaultMessage: function (element, rule) {
759
- var message = this.findDefined(
760
- this.customMessage(element.name, rule.method),
761
- this.customDataMessage(element, rule.method),
762
- // 'title' is never undefined, so handle empty string as undefined
763
- !this.settings.ignoreTitle && element.title || undefined,
764
- $.validator.messages[rule.method],
765
- "<strong>Warning: No message defined for " + element.name + "</strong>"
766
- ),
767
- theregex = /\$?\{(\d+)\}/g;
768
- if (typeof message === "function") {
769
- message = message.call(this, rule.parameters, element);
770
- } else if (theregex.test(message)) {
771
- message = $.validator.format(message.replace(theregex, "{$1}"), rule.parameters);
772
- }
773
-
774
- return message;
775
- },
776
-
777
- formatAndAdd: function (element, rule) {
778
- var message = this.defaultMessage(element, rule);
779
-
780
- this.errorList.push({
781
- message: message,
782
- element: element,
783
- method: rule.method
784
- });
785
-
786
- this.errorMap[element.name] = message;
787
- this.submitted[element.name] = message;
788
- },
789
-
790
- addWrapper: function (toToggle) {
791
- if (this.settings.wrapper) {
792
- toToggle = toToggle.add(toToggle.parent(this.settings.wrapper));
793
- }
794
- return toToggle;
795
- },
796
-
797
- defaultShowErrors: function () {
798
- var i, elements, error;
799
- for (i = 0; this.errorList[i]; i++) {
800
- error = this.errorList[i];
801
- if (this.settings.highlight) {
802
- this.settings.highlight.call(this, error.element, this.settings.errorClass, this.settings.validClass);
803
- }
804
- this.showLabel(error.element, error.message);
805
- }
806
- if (this.errorList.length) {
807
- this.toShow = this.toShow.add(this.containers);
808
- }
809
- if (this.settings.success) {
810
- for (i = 0; this.successList[i]; i++) {
811
- this.showLabel(this.successList[i]);
812
- }
813
- }
814
- if (this.settings.unhighlight) {
815
- for (i = 0, elements = this.validElements(); elements[i]; i++) {
816
- this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, this.settings.validClass);
817
- }
818
- }
819
- this.toHide = this.toHide.not(this.toShow);
820
- this.hideErrors();
821
- this.addWrapper(this.toShow).show();
822
- },
823
-
824
- validElements: function () {
825
- return this.currentElements.not(this.invalidElements());
826
- },
827
-
828
- invalidElements: function () {
829
- return $(this.errorList).map(function () {
830
- return this.element;
831
- });
832
- },
833
-
834
- showLabel: function (element, message) {
835
- var place, group, errorID, v,
836
- error = this.errorsFor(element),
837
- elementID = this.idOrName(element),
838
- describedBy = $(element).attr("aria-describedby");
839
-
840
- if (error.length) {
841
-
842
- // Refresh error/success class
843
- error.removeClass(this.settings.validClass).addClass(this.settings.errorClass);
844
-
845
- // Replace message on existing label
846
- error.html(message);
847
- } else {
848
-
849
- // Create error element
850
- error = $("<" + this.settings.errorElement + ">")
851
- .attr("id", elementID + "-error")
852
- .addClass(this.settings.errorClass)
853
- .html(message || "");
854
-
855
- // Maintain reference to the element to be placed into the DOM
856
- place = error;
857
- if (this.settings.wrapper) {
858
- place = error.hide().show().wrap("<" + this.settings.wrapper + "/>").parent();
859
- }
860
- if (this.labelContainer.length) {
861
- this.labelContainer.append(place);
862
- } else if (this.settings.errorPlacement) {
863
- this.settings.errorPlacement(place, $(element));
864
- } else {
865
- place.insertAfter(element);
866
- }
867
-
868
- if (error.is("label")) {
869
- error.attr("for", elementID);
870
- } else if (error.parents("label[for='" + this.escapeCssMeta(elementID) + "']").length === 0) {
871
- errorID = error.attr("id");
872
- if (!describedBy) {
873
- describedBy = errorID;
874
- } else if (!describedBy.match(new RegExp("\\b" + this.escapeCssMeta(errorID) + "\\b"))) {
875
- describedBy += " " + errorID;
876
- }
877
- $(element).attr("aria-describedby", describedBy);
878
- group = this.groups[element.name];
879
- if (group) {
880
- v = this;
881
- $.each(v.groups, function (name, testgroup) {
882
- if (testgroup === group) {
883
- $("[name='" + v.escapeCssMeta(name) + "']", v.currentForm)
884
- .attr("aria-describedby", error.attr("id"));
885
- }
886
- });
887
- }
888
- }
889
- }
890
- if (!message && this.settings.success) {
891
- error.text("");
892
- if (typeof this.settings.success === "string") {
893
- error.addClass(this.settings.success);
894
- } else {
895
- this.settings.success(error, element);
896
- }
897
- }
898
- this.toShow = this.toShow.add(error);
899
- },
900
-
901
- errorsFor: function (element) {
902
- var name = this.escapeCssMeta(this.idOrName(element)),
903
- describer = $(element).attr("aria-describedby"),
904
- selector = "label[for='" + name + "'], label[for='" + name + "'] *";
905
- if (describer) {
906
- selector = selector + ", #" + this.escapeCssMeta(describer)
907
- .replace(/\s+/g, ", #");
908
- }
909
-
910
- return this
911
- .errors()
912
- .filter(selector);
913
- },
914
- escapeCssMeta: function (string) {
915
- return string.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1");
916
- },
917
-
918
- idOrName: function (element) {
919
- return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name);
920
- },
921
-
922
- validationTargetFor: function (element) {
923
-
924
- if (this.checkable(element)) {
925
- element = this.findByName(element.name);
926
- }
927
- return $(element).not(this.settings.ignore)[0];
928
- },
929
-
930
- checkable: function (element) {
931
- return (/radio|checkbox/i).test(element.type);
932
- },
933
-
934
- findByName: function (name) {
935
- return $(this.currentForm).find("[name='" + this.escapeCssMeta(name) + "']");
936
- },
937
-
938
- getLength: function (value, element) {
939
- switch (element.nodeName.toLowerCase()) {
940
- case "select":
941
- return $("option:selected", element).length;
942
- case "input":
943
- if (this.checkable(element)) {
944
- return this.findByName(element.name).filter(":checked").length;
945
- }
946
- }
947
- return value.length;
948
- },
949
-
950
- depend: function (param, element) {
951
- return this.dependTypes[typeof param] ? this.dependTypes[typeof param](param, element) : true;
952
- },
953
-
954
- dependTypes: {
955
- "boolean": function (param) {
956
- return param;
957
- },
958
- "string": function (param, element) {
959
- return !!$(param, element.form).length;
960
- },
961
- "function": function (param, element) {
962
- return param(element);
963
- }
964
- },
965
-
966
- optional: function (element) {
967
- var val = this.elementValue(element);
968
- return !$.validator.methods.required.call(this, val, element) && "dependency-mismatch";
969
- },
970
-
971
- startRequest: function (element) {
972
- if (!this.pending[element.name]) {
973
- this.pendingRequest++;
974
- $(element).addClass(this.settings.pendingClass);
975
- this.pending[element.name] = true;
976
- }
977
- },
978
- stopRequest: function (element, valid) {
979
- this.pendingRequest--;
980
- if (this.pendingRequest < 0) {
981
- this.pendingRequest = 0;
982
- }
983
- delete this.pending[element.name];
984
- $(element).removeClass(this.settings.pendingClass);
985
- if (valid && this.pendingRequest === 0 && this.formSubmitted && this.form()) {
986
- $(this.currentForm).submit();
987
- this.formSubmitted = false;
988
- } else if (!valid && this.pendingRequest === 0 && this.formSubmitted) {
989
- $(this.currentForm).triggerHandler("invalid-form", [this]);
990
- this.formSubmitted = false;
991
- }
992
- },
993
- previousValue: function (element, method) {
994
- return $.data(element, "previousValue") || $.data(element, "previousValue", {
995
- old: null,
996
- valid: true,
997
- message: this.defaultMessage(element, {
998
- method: method
999
- })
1000
- });
1001
- },
1002
- destroy: function () {
1003
- this.resetForm();
1004
- $(this.currentForm)
1005
- .off(".validate")
1006
- .removeData("validator")
1007
- .find(".validate-equalTo-blur")
1008
- .off(".validate-equalTo")
1009
- .removeClass("validate-equalTo-blur");
1010
- }
1011
- },
1012
- classRuleSettings: {
1013
- required: {
1014
- required: true
1015
- },
1016
- email: {
1017
- email: true
1018
- },
1019
- url: {
1020
- url: true
1021
- },
1022
- date: {
1023
- date: true
1024
- },
1025
- dateISO: {
1026
- dateISO: true
1027
- },
1028
- number: {
1029
- number: true
1030
- },
1031
- digits: {
1032
- digits: true
1033
- },
1034
- creditcard: {
1035
- creditcard: true
1036
- }
1037
- },
1038
-
1039
- addClassRules: function (className, rules) {
1040
- if (className.constructor === String) {
1041
- this.classRuleSettings[className] = rules;
1042
- } else {
1043
- $.extend(this.classRuleSettings, className);
1044
- }
1045
- },
1046
-
1047
- classRules: function (element) {
1048
- var rules = {},
1049
- classes = $(element).attr("class");
1050
-
1051
- if (classes) {
1052
- $.each(classes.split(" "), function () {
1053
- if (this in $.validator.classRuleSettings) {
1054
- $.extend(rules, $.validator.classRuleSettings[this]);
1055
- }
1056
- });
1057
- }
1058
- return rules;
1059
- },
1060
-
1061
- normalizeAttributeRule: function (rules, type, method, value) {
1062
- if (/min|max|step/.test(method) && (type === null || /number|range|text/.test(type))) {
1063
- value = Number(value);
1064
- if (isNaN(value)) {
1065
- value = undefined;
1066
- }
1067
- }
1068
-
1069
- if (value || value === 0) {
1070
- rules[method] = value;
1071
- } else if (type === method && type !== "range") {
1072
- rules[method] = true;
1073
- }
1074
- },
1075
-
1076
- attributeRules: function (element) {
1077
- var rules = {},
1078
- $element = $(element),
1079
- type = element.getAttribute("type"),
1080
- method, value;
1081
-
1082
- for (method in $.validator.methods) {
1083
- if (method === "required") {
1084
- value = element.getAttribute(method);
1085
- if (value === "") {
1086
- value = true;
1087
- }
1088
- value = !!value;
1089
- } else {
1090
- value = $element.attr(method);
1091
- }
1092
- this.normalizeAttributeRule(rules, type, method, value);
1093
- }
1094
- if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) {
1095
- delete rules.maxlength;
1096
- }
1097
-
1098
- return rules;
1099
- },
1100
-
1101
- dataRules: function (element) {
1102
- var rules = {},
1103
- $element = $(element),
1104
- type = element.getAttribute("type"),
1105
- method, value;
1106
-
1107
- for (method in $.validator.methods) {
1108
- value = $element.data("rule" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase());
1109
- this.normalizeAttributeRule(rules, type, method, value);
1110
- }
1111
- return rules;
1112
- },
1113
-
1114
- staticRules: function (element) {
1115
- var rules = {},
1116
- validator = $.data(element.form, "validator");
1117
-
1118
- if (validator.settings.rules) {
1119
- rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {};
1120
- }
1121
- return rules;
1122
- },
1123
-
1124
- normalizeRules: function (rules, element) {
1125
- $.each(rules, function (prop, val) {
1126
- if (val === false) {
1127
- delete rules[prop];
1128
- return;
1129
- }
1130
- if (val.param || val.depends) {
1131
- var keepRule = true;
1132
- switch (typeof val.depends) {
1133
- case "string":
1134
- keepRule = !!$(val.depends, element.form).length;
1135
- break;
1136
- case "function":
1137
- keepRule = val.depends.call(element, element);
1138
- break;
1139
- }
1140
- if (keepRule) {
1141
- rules[prop] = val.param !== undefined ? val.param : true;
1142
- } else {
1143
- $.data(element.form, "validator").resetElements($(element));
1144
- delete rules[prop];
1145
- }
1146
- }
1147
- });
1148
- $.each(rules, function (rule, parameter) {
1149
- rules[rule] = $.isFunction(parameter) && rule !== "normalizer" ? parameter(element) : parameter;
1150
- });
1151
- $.each(["minlength", "maxlength"], function () {
1152
- if (rules[this]) {
1153
- rules[this] = Number(rules[this]);
1154
- }
1155
- });
1156
- $.each(["rangelength", "range"], function () {
1157
- var parts;
1158
- if (rules[this]) {
1159
- if ($.isArray(rules[this])) {
1160
- rules[this] = [Number(rules[this][0]), Number(rules[this][1])];
1161
- } else if (typeof rules[this] === "string") {
1162
- parts = rules[this].replace(/[\[\]]/g, "").split(/[\s,]+/);
1163
- rules[this] = [Number(parts[0]), Number(parts[1])];
1164
- }
1165
- }
1166
- });
1167
- if ($.validator.autoCreateRanges) {
1168
- if (rules.min != null && rules.max != null) {
1169
- rules.range = [rules.min, rules.max];
1170
- delete rules.min;
1171
- delete rules.max;
1172
- }
1173
- if (rules.minlength != null && rules.maxlength != null) {
1174
- rules.rangelength = [rules.minlength, rules.maxlength];
1175
- delete rules.minlength;
1176
- delete rules.maxlength;
1177
- }
1178
- }
1179
- return rules;
1180
- },
1181
- normalizeRule: function (data) {
1182
- if (typeof data === "string") {
1183
- var transformed = {};
1184
- $.each(data.split(/\s/), function () {
1185
- transformed[this] = true;
1186
- });
1187
- data = transformed;
1188
- }
1189
- return data;
1190
- },
1191
- addMethod: function (name, method, message) {
1192
- $.validator.methods[name] = method;
1193
- $.validator.messages[name] = message !== undefined ? message : $.validator.messages[name];
1194
- if (method.length < 3) {
1195
- $.validator.addClassRules(name, $.validator.normalizeRule(name));
1196
- }
1197
- },
1198
- methods: {
1199
- required: function (value, element, param) {
1200
- if (!this.depend(param, element)) {
1201
- return "dependency-mismatch";
1202
- }
1203
- if (element.nodeName.toLowerCase() === "select") {
1204
- var val = $(element).val();
1205
- return val && val.length > 0;
1206
- }
1207
- if (this.checkable(element)) {
1208
- return this.getLength(value, element) > 0;
1209
- }
1210
- return value.length > 0;
1211
- },
1212
- email: function (value, element) {
1213
- return this.optional(element) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);
1214
- },
1215
- url: function (value, element) {
1216
- return this.optional(element) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value);
1217
- },
1218
- date: function (value, element) {
1219
- return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString());
1220
- },
1221
- dateISO: function (value, element) {
1222
- return this.optional(element) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
1223
- },
1224
- number: function (value, element) {
1225
- return this.optional(element) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
1226
- },
1227
- digits: function (value, element) {
1228
- return this.optional(element) || /^\d+$/.test(value);
1229
- },
1230
- minlength: function (value, element, param) {
1231
- var length = $.isArray(value) ? value.length : this.getLength(value, element);
1232
- return this.optional(element) || length >= param;
1233
- },
1234
- maxlength: function (value, element, param) {
1235
- var length = $.isArray(value) ? value.length : this.getLength(value, element);
1236
- return this.optional(element) || length <= param;
1237
- },
1238
- rangelength: function (value, element, param) {
1239
- var length = $.isArray(value) ? value.length : this.getLength(value, element);
1240
- return this.optional(element) || (length >= param[0] && length <= param[1]);
1241
- },
1242
- min: function (value, element, param) {
1243
- return this.optional(element) || value >= param;
1244
- },
1245
- max: function (value, element, param) {
1246
- return this.optional(element) || value <= param;
1247
- },
1248
- range: function (value, element, param) {
1249
- return this.optional(element) || (value >= param[0] && value <= param[1]);
1250
- },
1251
- step: function (value, element, param) {
1252
- var type = $(element).attr("type"),
1253
- errorMessage = "Step attribute on input type " + type + " is not supported.",
1254
- supportedTypes = ["text", "number", "range"],
1255
- re = new RegExp("\\b" + type + "\\b"),
1256
- notSupported = type && !re.test(supportedTypes.join());
1257
- if (notSupported) {
1258
- throw new Error(errorMessage);
1259
- }
1260
- return this.optional(element) || (value % param === 0);
1261
- },
1262
- equalTo: function (value, element, param) {
1263
- var target = $(param);
1264
- if (this.settings.onfocusout && target.not(".validate-equalTo-blur").length) {
1265
- target.addClass("validate-equalTo-blur").on("blur.validate-equalTo", function () {
1266
- $(element).valid();
1267
- });
1268
- }
1269
- return value === target.val();
1270
- },
1271
- remote: function (value, element, param, method) {
1272
- if (this.optional(element)) {
1273
- return "dependency-mismatch";
1274
- }
1275
-
1276
- method = typeof method === "string" && method || "remote";
1277
-
1278
- var previous = this.previousValue(element, method),
1279
- validator, data, optionDataString;
1280
-
1281
- if (!this.settings.messages[element.name]) {
1282
- this.settings.messages[element.name] = {};
1283
- }
1284
- previous.originalMessage = previous.originalMessage || this.settings.messages[element.name][method];
1285
- this.settings.messages[element.name][method] = previous.message;
1286
-
1287
- param = typeof param === "string" && {
1288
- url: param
1289
- } || param;
1290
- optionDataString = $.param($.extend({
1291
- data: value
1292
- }, param.data));
1293
- if (previous.old === optionDataString) {
1294
- return previous.valid;
1295
- }
1296
-
1297
- previous.old = optionDataString;
1298
- validator = this;
1299
- this.startRequest(element);
1300
- data = {};
1301
- data[element.name] = value;
1302
- $.ajax($.extend(true, {
1303
- mode: "abort",
1304
- port: "validate" + element.name,
1305
- dataType: "json",
1306
- data: data,
1307
- context: validator.currentForm,
1308
- success: function (response) {
1309
- var valid = response === true || response === "true",
1310
- errors, message, submitted;
1311
-
1312
- validator.settings.messages[element.name][method] = previous.originalMessage;
1313
- if (valid) {
1314
- submitted = validator.formSubmitted;
1315
- validator.resetInternals();
1316
- validator.toHide = validator.errorsFor(element);
1317
- validator.formSubmitted = submitted;
1318
- validator.successList.push(element);
1319
- validator.invalid[element.name] = false;
1320
- validator.showErrors();
1321
- } else {
1322
- errors = {};
1323
- message = response || validator.defaultMessage(element, {
1324
- method: method,
1325
- parameters: value
1326
- });
1327
- errors[element.name] = previous.message = message;
1328
- validator.invalid[element.name] = true;
1329
- validator.showErrors(errors);
1330
- }
1331
- previous.valid = valid;
1332
- validator.stopRequest(element, valid);
1333
- }
1334
- }, param));
1335
- return "pending";
1336
- }
1337
- }
1338
- });
1339
- var pendingRequests = {},
1340
- ajax;
1341
- if ($.ajaxPrefilter) {
1342
- $.ajaxPrefilter(function (settings, _, xhr) {
1343
- var port = settings.port;
1344
- if (settings.mode === "abort") {
1345
- if (pendingRequests[port]) {
1346
- pendingRequests[port].abort();
1347
- }
1348
- pendingRequests[port] = xhr;
1349
- }
1350
- });
1351
- } else {
1352
- ajax = $.ajax;
1353
- $.ajax = function (settings) {
1354
- var mode = ("mode" in settings ? settings : $.ajaxSettings).mode,
1355
- port = ("port" in settings ? settings : $.ajaxSettings).port;
1356
- if (mode === "abort") {
1357
- if (pendingRequests[port]) {
1358
- pendingRequests[port].abort();
1359
- }
1360
- pendingRequests[port] = ajax.apply(this, arguments);
1361
- return pendingRequests[port];
1362
- }
1363
- return ajax.apply(this, arguments);
1364
- };
1365
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1366
  }));
1
+ /*!
2
+ * jQuery Validation Plugin v1.16.0
3
+ *
4
+ * http://jqueryvalidation.org/
5
+ *
6
+ * Copyright (c) 2016 Jörn Zaefferer
7
+ * Released under the MIT license
8
+ */
9
+ (function( factory ) {
10
+ if ( typeof define === "function" && define.amd ) {
11
+ define( ["jquery"], factory );
12
+ } else if (typeof module === "object" && module.exports) {
13
+ module.exports = factory( require( "jquery" ) );
14
+ } else {
15
+ factory( jQuery );
16
+ }
17
+ }(function( $ ) {
18
+
19
+ $.extend( $.fn, {
20
+
21
+ // http://jqueryvalidation.org/validate/
22
+ validate: function( options ) {
23
+
24
+ // If nothing is selected, return nothing; can't chain anyway
25
+ if ( !this.length ) {
26
+ if ( options && options.debug && window.console ) {
27
+ console.warn( "Nothing selected, can't validate, returning nothing." );
28
+ }
29
+ return;
30
+ }
31
+
32
+ // Check if a validator for this form was already created
33
+ var validator = $.data( this[ 0 ], "validator" );
34
+ if ( validator ) {
35
+ return validator;
36
+ }
37
+
38
+ // Add novalidate tag if HTML5.
39
+ this.attr( "novalidate", "novalidate" );
40
+
41
+ validator = new $.validator( options, this[ 0 ] );
42
+ $.data( this[ 0 ], "validator", validator );
43
+
44
+ if ( validator.settings.onsubmit ) {
45
+
46
+ this.on( "click.validate", ":submit", function( event ) {
47
+ if ( validator.settings.submitHandler ) {
48
+ validator.submitButton = event.target;
49
+ }
50
+
51
+ // Allow suppressing validation by adding a cancel class to the submit button
52
+ if ( $( this ).hasClass( "cancel" ) ) {
53
+ validator.cancelSubmit = true;
54
+ }
55
+
56
+ // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button
57
+ if ( $( this ).attr( "formnovalidate" ) !== undefined ) {
58
+ validator.cancelSubmit = true;
59
+ }
60
+ } );
61
+
62
+ // Validate the form on submit
63
+ this.on( "submit.validate", function( event ) {
64
+ if ( validator.settings.debug ) {
65
+
66
+ // Prevent form submit to be able to see console output
67
+ event.preventDefault();
68
+ }
69
+ function handle() {
70
+ var hidden, result;
71
+ if ( validator.settings.submitHandler ) {
72
+ if ( validator.submitButton ) {
73
+
74
+ // Insert a hidden input as a replacement for the missing submit button
75
+ hidden = $( "<input type='hidden'/>" )
76
+ .attr( "name", validator.submitButton.name )
77
+ .val( $( validator.submitButton ).val() )
78
+ .appendTo( validator.currentForm );
79
+ }
80
+ result = validator.settings.submitHandler.call( validator, validator.currentForm, event );
81
+ if ( validator.submitButton ) {
82
+
83
+ // And clean up afterwards; thanks to no-block-scope, hidden can be referenced
84
+ hidden.remove();
85
+ }
86
+ if ( result !== undefined ) {
87
+ return result;
88
+ }
89
+ return false;
90
+ }
91
+ return true;
92
+ }
93
+
94
+ // Prevent submit for invalid forms or custom submit handlers
95
+ if ( validator.cancelSubmit ) {
96
+ validator.cancelSubmit = false;
97
+ return handle();
98
+ }
99
+ if ( validator.form() ) {
100
+ if ( validator.pendingRequest ) {
101
+ validator.formSubmitted = true;
102
+ return false;
103
+ }
104
+ return handle();
105
+ } else {
106
+ validator.focusInvalid();
107
+ return false;
108
+ }
109
+ } );
110
+ }
111
+
112
+ return validator;
113
+ },
114
+
115
+ // http://jqueryvalidation.org/valid/
116
+ valid: function() {
117
+ var valid, validator, errorList;
118
+
119
+ if ( $( this[ 0 ] ).is( "form" ) ) {
120
+ valid = this.validate().form();
121
+ } else {
122
+ errorList = [];
123
+ valid = true;
124
+ validator = $( this[ 0 ].form ).validate();
125
+ this.each( function() {
126
+ valid = validator.element( this ) && valid;
127
+ if ( !valid ) {
128
+ errorList = errorList.concat( validator.errorList );
129
+ }
130
+ } );
131
+ validator.errorList = errorList;
132
+ }
133
+ return valid;
134
+ },
135
+
136
+ // http://jqueryvalidation.org/rules/
137
+ rules: function( command, argument ) {
138
+ var element = this[ 0 ],
139
+ settings, staticRules, existingRules, data, param, filtered;
140
+
141
+ // If nothing is selected, return empty object; can't chain anyway
142
+ if ( element == null || element.form == null ) {
143
+ return;
144
+ }
145
+
146
+ if ( command ) {
147
+ settings = $.data( element.form, "validator" ).settings;
148
+ staticRules = settings.rules;
149
+ existingRules = $.validator.staticRules( element );
150
+ switch ( command ) {
151
+ case "add":
152
+ $.extend( existingRules, $.validator.normalizeRule( argument ) );
153
+
154
+ // Remove messages from rules, but allow them to be set separately
155
+ delete existingRules.messages;
156
+ staticRules[ element.name ] = existingRules;
157
+ if ( argument.messages ) {
158
+ settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages );
159
+ }
160
+ break;
161
+ case "remove":
162
+ if ( !argument ) {
163
+ delete staticRules[ element.name ];
164
+ return existingRules;
165
+ }
166
+ filtered = {};
167
+ $.each( argument.split( /\s/ ), function( index, method ) {
168
+ filtered[ method ] = existingRules[ method ];
169
+ delete existingRules[ method ];
170
+ if ( method === "required" ) {
171
+ $( element ).removeAttr( "aria-required" );
172
+ }
173
+ } );
174
+ return filtered;
175
+ }
176
+ }
177
+
178
+ data = $.validator.normalizeRules(
179
+ $.extend(
180
+ {},
181
+ $.validator.classRules( element ),
182
+ $.validator.attributeRules( element ),
183
+ $.validator.dataRules( element ),
184
+ $.validator.staticRules( element )
185
+ ), element );
186
+
187
+ // Make sure required is at front
188
+ if ( data.required ) {
189
+ param = data.required;
190
+ delete data.required;
191
+ data = $.extend( { required: param }, data );
192
+ $( element ).attr( "aria-required", "true" );
193
+ }
194
+
195
+ // Make sure remote is at back
196
+ if ( data.remote ) {
197
+ param = data.remote;
198
+ delete data.remote;
199
+ data = $.extend( data, { remote: param } );
200
+ }
201
+
202
+ return data;
203
+ }
204
+ } );
205
+
206
+ // Custom selectors
207
+ $.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support
208
+
209
+ // http://jqueryvalidation.org/blank-selector/
210
+ blank: function( a ) {
211
+ return !$.trim( "" + $( a ).val() );
212
+ },
213
+
214
+ // http://jqueryvalidation.org/filled-selector/
215
+ filled: function( a ) {
216
+ var val = $( a ).val();
217
+ return val !== null && !!$.trim( "" + val );
218
+ },
219
+
220
+ // http://jqueryvalidation.org/unchecked-selector/
221
+ unchecked: function( a ) {
222
+ return !$( a ).prop( "checked" );
223
+ }
224
+ } );
225
+
226
+ // Constructor for validator
227
+ $.validator = function( options, form ) {
228
+ this.settings = $.extend( true, {}, $.validator.defaults, options );
229
+ this.currentForm = form;
230
+ this.init();
231
+ };
232
+
233
+ // http://jqueryvalidation.org/jQuery.validator.format/
234
+ $.validator.format = function( source, params ) {
235
+ if ( arguments.length === 1 ) {
236
+ return function() {
237
+ var args = $.makeArray( arguments );
238
+ args.unshift( source );
239
+ return $.validator.format.apply( this, args );
240
+ };
241
+ }
242
+ if ( params === undefined ) {
243
+ return source;
244
+ }
245
+ if ( arguments.length > 2 && params.constructor !== Array ) {
246
+ params = $.makeArray( arguments ).slice( 1 );
247
+ }
248
+ if ( params.constructor !== Array ) {
249
+ params = [ params ];
250
+ }
251
+ $.each( params, function( i, n ) {
252
+ source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() {
253
+ return n;
254
+ } );
255
+ } );
256
+ return source;
257
+ };
258
+
259
+ $.extend( $.validator, {
260
+
261
+ defaults: {
262
+ messages: {},
263
+ groups: {},
264
+ rules: {},
265
+ errorClass: "error",
266
+ pendingClass: "pending",
267
+ validClass: "valid",
268
+ errorElement: "label",
269
+ focusCleanup: false,
270
+ focusInvalid: true,
271
+ errorContainer: $( [] ),
272
+ errorLabelContainer: $( [] ),
273
+ onsubmit: true,
274
+ ignore: ":hidden",
275
+ ignoreTitle: false,
276
+ onfocusin: function( element ) {
277
+ this.lastActive = element;
278
+
279
+ // Hide error label and remove error class on focus if enabled
280
+ if ( this.settings.focusCleanup ) {
281
+ if ( this.settings.unhighlight ) {
282
+ this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
283
+ }
284
+ this.hideThese( this.errorsFor( element ) );
285
+ }
286
+ },
287
+ onfocusout: function( element ) {
288
+ if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) {
289
+ this.element( element );
290
+ }
291
+ },
292
+ onkeyup: function( element, event ) {
293
+
294
+ // Avoid revalidate the field when pressing one of the following keys
295
+ // Shift => 16
296
+ // Ctrl => 17
297
+ // Alt => 18
298
+ // Caps lock => 20
299
+ // End => 35
300
+ // Home => 36
301
+ // Left arrow => 37
302
+ // Up arrow => 38
303
+ // Right arrow => 39
304
+ // Down arrow => 40
305
+ // Insert => 45
306
+ // Num lock => 144
307
+ // AltGr key => 225
308
+ var excludedKeys = [
309
+ 16, 17, 18, 20, 35, 36, 37,
310
+ 38, 39, 40, 45, 144, 225
311
+ ];
312
+
313
+ if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) {
314
+ return;
315
+ } else if ( element.name in this.submitted || element.name in this.invalid ) {
316
+ this.element( element );
317
+ }
318
+ },
319
+ onclick: function( element ) {
320
+
321
+ // Click on selects, radiobuttons and checkboxes
322
+ if ( element.name in this.submitted ) {
323
+ this.element( element );
324
+
325
+ // Or option elements, check parent select in that case
326
+ } else if ( element.parentNode.name in this.submitted ) {
327
+ this.element( element.parentNode );
328
+ }
329
+ },
330
+ highlight: function( element, errorClass, validClass ) {
331
+ if ( element.type === "radio" ) {
332
+ this.findByName( element.name ).addClass( errorClass ).removeClass( validClass );
333
+ } else {
334
+ $( element ).addClass( errorClass ).removeClass( validClass );
335
+ }
336
+ },
337
+ unhighlight: function( element, errorClass, validClass ) {
338
+ if ( element.type === "radio" ) {
339
+ this.findByName( element.name ).removeClass( errorClass ).addClass( validClass );
340
+ } else {
341
+ $( element ).removeClass( errorClass ).addClass( validClass );
342
+ }
343
+ }
344
+ },
345
+
346
+ // http://jqueryvalidation.org/jQuery.validator.setDefaults/
347
+ setDefaults: function( settings ) {
348
+ $.extend( $.validator.defaults, settings );
349
+ },
350
+
351
+ messages: {
352
+ required: "This field is required.",
353
+ remote: "Please fix this field.",
354
+ email: "Please enter a valid email address.",
355
+ url: "Please enter a valid URL.",
356
+ date: "Please enter a valid date.",
357
+ dateISO: "Please enter a valid date (ISO).",
358
+ number: "Please enter a valid number.",
359
+ digits: "Please enter only digits.",
360
+ equalTo: "Please enter the same value again.",
361
+ maxlength: $.validator.format( "Please enter no more than {0} characters." ),
362
+ minlength: $.validator.format( "Please enter at least {0} characters." ),
363
+ rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ),
364
+ range: $.validator.format( "Please enter a value between {0} and {1}." ),
365
+ max: $.validator.format( "Please enter a value less than or equal to {0}." ),
366
+ min: $.validator.format( "Please enter a value greater than or equal to {0}." ),
367
+ step: $.validator.format( "Please enter a multiple of {0}." )
368
+ },
369
+
370
+ autoCreateRanges: false,
371
+
372
+ prototype: {
373
+
374
+ init: function() {
375
+ this.labelContainer = $( this.settings.errorLabelContainer );
376
+ this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm );
377
+ this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer );
378
+ this.submitted = {};
379
+ this.valueCache = {};
380
+ this.pendingRequest = 0;
381
+ this.pending = {};
382
+ this.invalid = {};
383
+ this.reset();
384
+
385
+ var groups = ( this.groups = {} ),
386
+ rules;
387
+ $.each( this.settings.groups, function( key, value ) {
388
+ if ( typeof value === "string" ) {
389
+ value = value.split( /\s/ );
390
+ }
391
+ $.each( value, function( index, name ) {
392
+ groups[ name ] = key;
393
+ } );
394
+ } );
395
+ rules = this.settings.rules;
396
+ $.each( rules, function( key, value ) {
397
+ rules[ key ] = $.validator.normalizeRule( value );
398
+ } );
399
+
400
+ function delegate( event ) {
401
+
402
+ // Set form expando on contenteditable
403
+ if ( !this.form && this.hasAttribute( "contenteditable" ) ) {
404
+ this.form = $( this ).closest( "form" )[ 0 ];
405
+ }
406
+
407
+ var validator = $.data( this.form, "validator" ),
408
+ eventType = "on" + event.type.replace( /^validate/, "" ),
409
+ settings = validator.settings;
410
+ if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) {
411
+ settings[ eventType ].call( validator, this, event );
412
+ }
413
+ }
414
+
415
+ $( this.currentForm )
416
+ .on( "focusin.validate focusout.validate keyup.validate",
417
+ ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
418
+ "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
419
+ "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
420
+ "[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate )
421
+
422
+ // Support: Chrome, oldIE
423
+ // "select" is provided as event.target when clicking a option
424
+ .on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate );
425
+
426
+ if ( this.settings.invalidHandler ) {
427
+ $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
428
+ }
429
+
430
+ // Add aria-required to any Static/Data/Class required fields before first validation
431
+ // Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html
432
+ $( this.currentForm ).find( "[required], [data-rule-required], .required" ).attr( "aria-required", "true" );
433
+ },
434
+
435
+ // http://jqueryvalidation.org/Validator.form/
436
+ form: function() {
437
+ this.checkForm();
438
+ $.extend( this.submitted, this.errorMap );
439
+ this.invalid = $.extend( {}, this.errorMap );
440
+ if ( !this.valid() ) {
441
+ $( this.currentForm ).triggerHandler( "invalid-form", [ this ] );
442
+ }
443
+ this.showErrors();
444
+ return this.valid();
445
+ },
446
+
447
+ checkForm: function() {
448
+ this.prepareForm();
449
+ for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) {
450
+ this.check( elements[ i ] );
451
+ }
452
+ return this.valid();
453
+ },
454
+
455
+ // http://jqueryvalidation.org/Validator.element/
456
+ element: function( element ) {
457
+ var cleanElement = this.clean( element ),
458
+ checkElement = this.validationTargetFor( cleanElement ),
459
+ v = this,
460
+ result = true,
461
+ rs, group;
462
+
463
+ if ( checkElement === undefined ) {
464
+ delete this.invalid[ cleanElement.name ];
465
+ } else {
466
+ this.prepareElement( checkElement );
467
+ this.currentElements = $( checkElement );
468
+
469
+ // If this element is grouped, then validate all group elements already
470
+ // containing a value
471
+ group = this.groups[ checkElement.name ];
472
+ if ( group ) {
473
+ $.each( this.groups, function( name, testgroup ) {
474
+ if ( testgroup === group && name !== checkElement.name ) {
475
+ cleanElement = v.validationTargetFor( v.clean( v.findByName( name ) ) );
476
+ if ( cleanElement && cleanElement.name in v.invalid ) {
477
+ v.currentElements.push( cleanElement );
478
+ result = v.check( cleanElement ) && result;
479
+ }
480
+ }
481
+ } );
482
+ }
483
+
484
+ rs = this.check( checkElement ) !== false;
485
+ result = result && rs;
486
+ if ( rs ) {
487
+ this.invalid[ checkElement.name ] = false;
488
+ } else {
489
+ this.invalid[ checkElement.name ] = true;
490
+ }
491
+
492
+ if ( !this.numberOfInvalids() ) {
493
+
494
+ // Hide error containers on last error
495
+ this.toHide = this.toHide.add( this.containers );
496
+ }
497
+ this.showErrors();
498
+
499
+ // Add aria-invalid status for screen readers
500
+ $( element ).attr( "aria-invalid", !rs );
501
+ }
502
+
503
+ return result;
504
+ },
505
+
506
+ // http://jqueryvalidation.org/Validator.showErrors/
507
+ showErrors: function( errors ) {
508
+ if ( errors ) {
509
+ var validator = this;
510
+
511
+ // Add items to error list and map
512
+ $.extend( this.errorMap, errors );
513
+ this.errorList = $.map( this.errorMap, function( message, name ) {
514
+ return {
515
+ message: message,
516
+ element: validator.findByName( name )[ 0 ]
517
+ };
518
+ } );
519
+
520
+ // Remove items from success list
521
+ this.successList = $.grep( this.successList, function( element ) {
522
+ return !( element.name in errors );
523
+ } );
524
+ }
525
+ if ( this.settings.showErrors ) {
526
+ this.settings.showErrors.call( this, this.errorMap, this.errorList );
527
+ } else {
528
+ this.defaultShowErrors();
529
+ }
530
+ },
531
+
532
+ // http://jqueryvalidation.org/Validator.resetForm/
533
+ resetForm: function() {
534
+ if ( $.fn.resetForm ) {
535
+ $( this.currentForm ).resetForm();
536
+ }
537
+ this.invalid = {};
538
+ this.submitted = {};
539
+ this.prepareForm();
540
+ this.hideErrors();
541
+ var elements = this.elements()
542
+ .removeData( "previousValue" )
543
+ .removeAttr( "aria-invalid" );
544
+
545
+ this.resetElements( elements );
546
+ },
547
+
548
+ resetElements: function( elements ) {
549
+ var i;
550
+
551
+ if ( this.settings.unhighlight ) {
552
+ for ( i = 0; elements[ i ]; i++ ) {
553
+ this.settings.unhighlight.call( this, elements[ i ],
554
+ this.settings.errorClass, "" );
555
+ this.findByName( elements[ i ].name ).removeClass( this.settings.validClass );
556
+ }
557
+ } else {
558
+ elements
559
+ .removeClass( this.settings.errorClass )
560
+ .removeClass( this.settings.validClass );
561
+ }
562
+ },
563
+
564
+ numberOfInvalids: function() {
565
+ return this.objectLength( this.invalid );
566
+ },
567
+
568
+ objectLength: function( obj ) {
569
+ /* jshint unused: false */
570
+ var count = 0,
571
+ i;
572
+ for ( i in obj ) {
573
+ if ( obj[ i ] ) {
574
+ count++;
575
+ }
576
+ }
577
+ return count;
578
+ },
579
+
580
+ hideErrors: function() {
581
+ this.hideThese( this.toHide );
582
+ },
583
+
584
+ hideThese: function( errors ) {
585
+ errors.not( this.containers ).text( "" );
586
+ this.addWrapper( errors ).hide();
587
+ },
588
+
589
+ valid: function() {
590
+ return this.size() === 0;
591
+ },
592
+
593
+ size: function() {
594
+ return this.errorList.length;
595
+ },
596
+
597
+ focusInvalid: function() {
598
+ if ( this.settings.focusInvalid ) {
599
+ try {
600
+ $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] )
601
+ .filter( ":visible" )
602
+ .focus()
603
+
604
+ // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find
605
+ .trigger( "focusin" );
606
+ } catch ( e ) {
607
+
608
+ // Ignore IE throwing errors when focusing hidden elements
609
+ }
610
+ }
611
+ },
612
+
613
+ findLastActive: function() {
614
+ var lastActive = this.lastActive;
615
+ return lastActive && $.grep( this.errorList, function( n ) {
616
+ return n.element.name === lastActive.name;
617
+ } ).length === 1 && lastActive;
618
+ },
619
+
620
+ elements: function() {
621
+ var validator = this,
622
+ rulesCache = {};
623
+
624
+ // Select all valid inputs inside the form (no submit or reset buttons)
625
+ return $( this.currentForm )
626
+ .find( "input, select, textarea, [contenteditable]" )
627
+ .not( ":submit, :reset, :image, :disabled" )
628
+ .not( this.settings.ignore )
629
+ .filter( function() {
630
+ var name = this.name || $( this ).attr( "name" ); // For contenteditable
631
+ if ( !name && validator.settings.debug && window.console ) {
632
+ console.error( "%o has no name assigned", this );
633
+ }
634
+
635
+ // Set form expando on contenteditable
636
+ if ( this.hasAttribute( "contenteditable" ) ) {
637
+ this.form = $( this ).closest( "form" )[ 0 ];
638
+ }
639
+
640
+ // Select only the first element for each name, and only those with rules specified
641
+ if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) {
642
+ return false;
643
+ }
644
+
645
+ rulesCache[ name ] = true;
646
+ return true;
647
+ } );
648
+ },
649
+
650
+ clean: function( selector ) {
651
+ return $( selector )[ 0 ];
652
+ },
653
+
654
+ errors: function() {
655
+ var errorClass = this.settings.errorClass.split( " " ).join( "." );
656
+ return $( this.settings.errorElement + "." + errorClass, this.errorContext );
657
+ },
658
+
659
+ resetInternals: function() {
660
+ this.successList = [];
661
+ this.errorList = [];
662
+ this.errorMap = {};
663
+ this.toShow = $( [] );
664
+ this.toHide = $( [] );
665
+ },
666
+
667
+ reset: function() {
668
+ this.resetInternals();
669
+ this.currentElements = $( [] );
670
+ },
671
+
672
+ prepareForm: function() {
673
+ this.reset();
674
+ this.toHide = this.errors().add( this.containers );
675
+ },
676
+
677
+ prepareElement: function( element ) {
678
+ this.reset();
679
+ this.toHide = this.errorsFor( element );
680
+ },
681
+
682
+ elementValue: function( element ) {
683
+ var $element = $( element ),
684
+ type = element.type,
685
+ val, idx;
686
+
687
+ if ( type === "radio" || type === "checkbox" ) {
688
+ return this.findByName( element.name ).filter( ":checked" ).val();
689
+ } else if ( type === "number" && typeof element.validity !== "undefined" ) {
690
+ return element.validity.badInput ? "NaN" : $element.val();
691
+ }
692
+
693
+ if ( element.hasAttribute( "contenteditable" ) ) {
694
+ val = $element.text();
695
+ } else {
696
+ val = $element.val();
697
+ }
698
+
699
+ if ( type === "file" ) {
700
+
701
+ // Modern browser (chrome & safari)
702
+ if ( val.substr( 0, 12 ) === "C:\\fakepath\\" ) {
703
+ return val.substr( 12 );
704
+ }
705
+
706
+ // Legacy browsers
707
+ // Unix-based path
708
+ idx = val.lastIndexOf( "/" );
709
+ if ( idx >= 0 ) {
710
+ return val.substr( idx + 1 );
711
+ }
712
+
713
+ // Windows-based path
714
+ idx = val.lastIndexOf( "\\" );
715
+ if ( idx >= 0 ) {
716
+ return val.substr( idx + 1 );
717
+ }
718
+
719
+ // Just the file name
720
+ return val;
721
+ }
722
+
723
+ if ( typeof val === "string" ) {
724
+ return val.replace( /\r/g, "" );
725
+ }
726
+ return val;
727
+ },
728
+
729
+ check: function( element ) {
730
+ element = this.validationTargetFor( this.clean( element ) );
731
+
732
+ var rules = $( element ).rules(),
733
+ rulesCount = $.map( rules, function( n, i ) {
734
+ return i;
735
+ } ).length,
736
+ dependencyMismatch = false,
737
+ val = this.elementValue( element ),
738
+ result, method, rule;
739
+
740
+ // If a normalizer is defined for this element, then
741
+ // call it to retreive the changed value instead
742
+ // of using the real one.
743
+ // Note that `this` in the normalizer is `element`.
744
+ if ( typeof rules.normalizer === "function" ) {
745
+ val = rules.normalizer.call( element, val );
746
+
747
+ if ( typeof val !== "string" ) {
748
+ throw new TypeError( "The normalizer should return a string value." );
749
+ }
750
+
751
+ // Delete the normalizer from rules to avoid treating
752
+ // it as a pre-defined method.
753
+ delete rules.normalizer;
754
+ }
755
+
756
+ for ( method in rules ) {
757
+ rule = { method: method, parameters: rules[ method ] };
758
+ try {
759
+ result = $.validator.methods[ method ].call( this, val, element, rule.parameters );
760
+
761
+ // If a method indicates that the field is optional and therefore valid,
762
+ // don't mark it as valid when there are no other rules
763
+ if ( result === "dependency-mismatch" && rulesCount === 1 ) {
764
+ dependencyMismatch = true;
765
+ continue;
766
+ }
767
+ dependencyMismatch = false;
768
+
769
+ if ( result === "pending" ) {
770
+ this.toHide = this.toHide.not( this.errorsFor( element ) );
771
+ return;
772
+ }
773
+
774
+ if ( !result ) {
775
+ this.formatAndAdd( element, rule );
776
+ return false;
777
+ }
778
+ } catch ( e ) {
779
+ if ( this.settings.debug && window.console ) {
780
+ console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e );
781
+ }
782
+ if ( e instanceof TypeError ) {
783
+ e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.";
784
+ }
785
+
786
+ throw e;
787
+ }
788
+ }
789
+ if ( dependencyMismatch ) {
790
+ return;
791
+ }
792
+ if ( this.objectLength( rules ) ) {
793
+ this.successList.push( element );
794
+ }
795
+ return true;
796
+ },
797
+
798
+ // Return the custom message for the given element and validation method
799
+ // specified in the element's HTML5 data attribute
800
+ // return the generic message if present and no method specific message is present
801
+ customDataMessage: function( element, method ) {
802
+ return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() +
803
+ method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" );
804
+ },
805
+
806
+ // Return the custom message for the given element name and validation method
807
+ customMessage: function( name, method ) {
808
+ var m = this.settings.messages[ name ];
809
+ return m && ( m.constructor === String ? m : m[ method ] );
810
+ },
811
+
812
+ // Return the first defined argument, allowing empty strings
813
+ findDefined: function() {
814
+ for ( var i = 0; i < arguments.length; i++ ) {
815
+ if ( arguments[ i ] !== undefined ) {
816
+ return arguments[ i ];
817
+ }
818
+ }
819
+ return undefined;
820
+ },
821
+
822
+ // The second parameter 'rule' used to be a string, and extended to an object literal
823
+ // of the following form:
824
+ // rule = {
825
+ // method: "method name",
826
+ // parameters: "the given method parameters"
827
+ // }
828
+ //
829
+ // The old behavior still supported, kept to maintain backward compatibility with
830
+ // old code, and will be removed in the next major release.
831
+ defaultMessage: function( element, rule ) {
832
+ if ( typeof rule === "string" ) {
833
+ rule = { method: rule };
834
+ }
835
+
836
+ var message = this.findDefined(
837
+ this.customMessage( element.name, rule.method ),
838
+ this.customDataMessage( element, rule.method ),
839
+
840
+ // 'title' is never undefined, so handle empty string as undefined
841
+ !this.settings.ignoreTitle && element.title || undefined,
842
+ $.validator.messages[ rule.method ],
843
+ "<strong>Warning: No message defined for " + element.name + "</strong>"
844
+ ),
845
+ theregex = /\$?\{(\d+)\}/g;
846
+ if ( typeof message === "function" ) {
847
+ message = message.call( this, rule.parameters, element );
848
+ } else if ( theregex.test( message ) ) {
849
+ message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters );
850
+ }
851
+
852
+ return message;
853
+ },
854
+
855
+ formatAndAdd: function( element, rule ) {
856
+ var message = this.defaultMessage( element, rule );
857
+
858
+ this.errorList.push( {
859
+ message: message,
860
+ element: element,
861
+ method: rule.method
862
+ } );
863
+
864
+ this.errorMap[ element.name ] = message;
865
+ this.submitted[ element.name ] = message;
866
+ },
867
+
868
+ addWrapper: function( toToggle ) {
869
+ if ( this.settings.wrapper ) {
870
+ toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) );
871
+ }
872
+ return toToggle;
873
+ },
874
+
875
+ defaultShowErrors: function() {
876
+ var i, elements, error;
877
+ for ( i = 0; this.errorList[ i ]; i++ ) {
878
+ error = this.errorList[ i ];
879
+ if ( this.settings.highlight ) {
880
+ this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass );
881
+ }
882
+ this.showLabel( error.element, error.message );
883
+ }
884
+ if ( this.errorList.length ) {
885
+ this.toShow = this.toShow.add( this.containers );
886
+ }
887
+ if ( this.settings.success ) {
888
+ for ( i = 0; this.successList[ i ]; i++ ) {
889
+ this.showLabel( this.successList[ i ] );
890
+ }
891
+ }
892
+ if ( this.settings.unhighlight ) {
893
+ for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) {
894
+ this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass );
895
+ }
896
+ }
897
+ this.toHide = this.toHide.not( this.toShow );
898
+ this.hideErrors();
899
+ this.addWrapper( this.toShow ).show();
900
+ },
901
+
902
+ validElements: function() {
903
+ return this.currentElements.not( this.invalidElements() );
904
+ },
905
+
906
+ invalidElements: function() {
907
+ return $( this.errorList ).map( function() {
908
+ return this.element;
909
+ } );
910
+ },
911
+
912
+ showLabel: function( element, message ) {
913
+ var place, group, errorID, v,
914
+ error = this.errorsFor( element ),
915
+ elementID = this.idOrName( element ),
916
+ describedBy = $( element ).attr( "aria-describedby" );
917
+
918
+ if ( error.length ) {
919
+
920
+ // Refresh error/success class
921
+ error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );
922
+
923
+ // Replace message on existing label
924
+ error.html( message );
925
+ } else {
926
+
927
+ // Create error element
928
+ error = $( "<" + this.settings.errorElement + ">" )
929
+ .attr( "id", elementID + "-error" )
930
+ .addClass( this.settings.errorClass )
931
+ .html( message || "" );
932
+
933
+ // Maintain reference to the element to be placed into the DOM
934
+ place = error;
935
+ if ( this.settings.wrapper ) {
936
+
937
+ // Make sure the element is visible, even in IE
938
+ // actually showing the wrapped element is handled elsewhere
939
+ place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent();
940
+ }
941
+ if ( this.labelContainer.length ) {
942
+ this.labelContainer.append( place );
943
+ } else if ( this.settings.errorPlacement ) {
944
+ this.settings.errorPlacement.call( this, place, $( element ) );
945
+ } else {
946
+ place.insertAfter( element );
947
+ }
948
+
949
+ // Link error back to the element
950
+ if ( error.is( "label" ) ) {
951
+
952
+ // If the error is a label, then associate using 'for'
953
+ error.attr( "for", elementID );
954
+
955
+ // If the element is not a child of an associated label, then it's necessary
956
+ // to explicitly apply aria-describedby
957
+ } else if ( error.parents( "label[for='" + this.escapeCssMeta( elementID ) + "']" ).length === 0 ) {
958
+ errorID = error.attr( "id" );
959
+
960
+ // Respect existing non-error aria-describedby
961
+ if ( !describedBy ) {
962
+ describedBy = errorID;
963
+ } else if ( !describedBy.match( new RegExp( "\\b" + this.escapeCssMeta( errorID ) + "\\b" ) ) ) {
964
+
965
+ // Add to end of list if not already present
966
+ describedBy += " " + errorID;
967
+ }
968
+ $( element ).attr( "aria-describedby", describedBy );
969
+
970
+ // If this element is grouped, then assign to all elements in the same group
971
+ group = this.groups[ element.name ];
972
+ if ( group ) {
973
+ v = this;
974
+ $.each( v.groups, function( name, testgroup ) {
975
+ if ( testgroup === group ) {
976
+ $( "[name='" + v.escapeCssMeta( name ) + "']", v.currentForm )
977
+ .attr( "aria-describedby", error.attr( "id" ) );
978
+ }
979
+ } );
980
+ }
981
+ }
982
+ }
983
+ if ( !message && this.settings.success ) {
984
+ error.text( "" );
985
+ if ( typeof this.settings.success === "string" ) {
986
+ error.addClass( this.settings.success );
987
+ } else {
988
+ this.settings.success( error, element );
989
+ }
990
+ }
991
+ this.toShow = this.toShow.add( error );
992
+ },
993
+
994
+ errorsFor: function( element ) {
995
+ var name = this.escapeCssMeta( this.idOrName( element ) ),
996
+ describer = $( element ).attr( "aria-describedby" ),
997
+ selector = "label[for='" + name + "'], label[for='" + name + "'] *";
998
+
999
+ // 'aria-describedby' should directly reference the error element
1000
+ if ( describer ) {
1001
+ selector = selector + ", #" + this.escapeCssMeta( describer )
1002
+ .replace( /\s+/g, ", #" );
1003
+ }
1004
+
1005
+ return this
1006
+ .errors()
1007
+ .filter( selector );
1008
+ },
1009
+
1010
+ // See https://api.jquery.com/category/selectors/, for CSS
1011
+ // meta-characters that should be escaped in order to be used with JQuery
1012
+ // as a literal part of a name/id or any selector.
1013
+ escapeCssMeta: function( string ) {
1014
+ return string.replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" );
1015
+ },
1016
+
1017
+ idOrName: function( element ) {
1018
+ return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name );
1019
+ },
1020
+
1021
+ validationTargetFor: function( element ) {
1022
+
1023
+ // If radio/checkbox, validate first element in group instead
1024
+ if ( this.checkable( element ) ) {
1025
+ element = this.findByName( element.name );
1026
+ }
1027
+
1028
+ // Always apply ignore filter
1029
+ return $( element ).not( this.settings.ignore )[ 0 ];
1030
+ },
1031
+
1032
+ checkable: function( element ) {
1033
+ return ( /radio|checkbox/i ).test( element.type );
1034
+ },
1035
+
1036
+ findByName: function( name ) {
1037
+ return $( this.currentForm ).find( "[name='" + this.escapeCssMeta( name ) + "']" );
1038
+ },
1039
+
1040
+ getLength: function( value, element ) {
1041
+ switch ( element.nodeName.toLowerCase() ) {
1042
+ case "select":
1043
+ return $( "option:selected", element ).length;
1044
+ case "input":
1045
+ if ( this.checkable( element ) ) {
1046
+ return this.findByName( element.name ).filter( ":checked" ).length;
1047
+ }
1048
+ }
1049
+ return value.length;
1050
+ },
1051
+
1052
+ depend: function( param, element ) {
1053
+ return this.dependTypes[ typeof param ] ? this.dependTypes[ typeof param ]( param, element ) : true;
1054
+ },
1055
+
1056
+ dependTypes: {
1057
+ "boolean": function( param ) {
1058
+ return param;
1059
+ },
1060
+ "string": function( param, element ) {
1061
+ return !!$( param, element.form ).length;
1062
+ },
1063
+ "function": function( param, element ) {
1064
+ return param( element );
1065
+ }
1066
+ },
1067
+
1068
+ optional: function( element ) {
1069
+ var val = this.elementValue( element );
1070
+ return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch";
1071
+ },
1072
+
1073
+ startRequest: function( element ) {
1074
+ if ( !this.pending[ element.name ] ) {
1075
+ this.pendingRequest++;
1076
+ $( element ).addClass( this.settings.pendingClass );
1077
+ this.pending[ element.name ] = true;
1078
+ }
1079
+ },
1080
+
1081
+ stopRequest: function( element, valid ) {
1082
+ this.pendingRequest--;
1083
+
1084
+ // Sometimes synchronization fails, make sure pendingRequest is never < 0
1085
+ if ( this.pendingRequest < 0 ) {
1086
+ this.pendingRequest = 0;
1087
+ }
1088
+ delete this.pending[ element.name ];
1089
+ $( element ).removeClass( this.settings.pendingClass );
1090
+ if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
1091
+ $( this.currentForm ).submit();
1092
+ this.formSubmitted = false;
1093
+ } else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) {
1094
+ $( this.currentForm ).triggerHandler( "invalid-form", [ this ] );
1095
+ this.formSubmitted = false;
1096
+ }
1097
+ },
1098
+
1099
+ previousValue: function( element, method ) {
1100
+ method = typeof method === "string" && method || "remote";
1101
+
1102
+ return $.data( element, "previousValue" ) || $.data( element, "previousValue", {
1103
+ old: null,
1104
+ valid: true,
1105
+ message: this.defaultMessage( element, { method: method } )
1106
+ } );
1107
+ },
1108
+
1109
+ // Cleans up all forms and elements, removes validator-specific events
1110
+ destroy: function() {
1111
+ this.resetForm();
1112
+
1113
+ $( this.currentForm )
1114
+ .off( ".validate" )
1115
+ .removeData( "validator" )
1116
+ .find( ".validate-equalTo-blur" )
1117
+ .off( ".validate-equalTo" )
1118
+ .removeClass( "validate-equalTo-blur" );
1119
+ }
1120
+
1121
+ },
1122
+
1123
+ classRuleSettings: {
1124
+ required: { required: true },
1125
+ email: { email: true },
1126
+ url: { url: true },
1127
+ date: { date: true },
1128
+ dateISO: { dateISO: true },
1129
+ number: { number: true },
1130
+ digits: { digits: true },
1131
+ creditcard: { creditcard: true }
1132
+ },
1133
+
1134
+ addClassRules: function( className, rules ) {
1135
+ if ( className.constructor === String ) {
1136
+ this.classRuleSettings[ className ] = rules;
1137
+ } else {
1138
+ $.extend( this.classRuleSettings, className );
1139
+ }
1140
+ },
1141
+
1142
+ classRules: function( element ) {
1143
+ var rules = {},
1144
+ classes = $( element ).attr( "class" );
1145
+
1146
+ if ( classes ) {
1147
+ $.each( classes.split( " " ), function() {
1148
+ if ( this in $.validator.classRuleSettings ) {
1149
+ $.extend( rules, $.validator.classRuleSettings[ this ] );
1150
+ }
1151
+ } );
1152
+ }
1153
+ return rules;
1154
+ },
1155
+
1156
+ normalizeAttributeRule: function( rules, type, method, value ) {
1157
+
1158
+ // Convert the value to a number for number inputs, and for text for backwards compability
1159
+ // allows type="date" and others to be compared as strings
1160
+ if ( /min|max|step/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) {
1161
+ value = Number( value );
1162
+
1163
+ // Support Opera Mini, which returns NaN for undefined minlength
1164
+ if ( isNaN( value ) ) {
1165
+ value = undefined;
1166
+ }
1167
+ }
1168
+
1169
+ if ( value || value === 0 ) {
1170
+ rules[ method ] = value;
1171
+ } else if ( type === method && type !== "range" ) {
1172
+
1173
+ // Exception: the jquery validate 'range' method
1174
+ // does not test for the html5 'range' type
1175
+ rules[ method ] = true;
1176
+ }
1177
+ },
1178
+
1179
+ attributeRules: function( element ) {
1180
+ var rules = {},
1181
+ $element = $( element ),
1182
+ type = element.getAttribute( "type" ),
1183
+ method, value;
1184
+
1185
+ for ( method in $.validator.methods ) {
1186
+
1187
+ // Support for <input required> in both html5 and older browsers
1188
+ if ( method === "required" ) {
1189
+ value = element.getAttribute( method );
1190
+
1191
+ // Some browsers return an empty string for the required attribute
1192
+ // and non-HTML5 browsers might have required="" markup
1193
+ if ( value === "" ) {
1194
+ value = true;
1195
+ }
1196
+
1197
+ // Force non-HTML5 browsers to return bool
1198
+ value = !!value;
1199
+ } else {
1200
+ value = $element.attr( method );
1201
+ }
1202
+
1203
+ this.normalizeAttributeRule( rules, type, method, value );
1204
+ }
1205
+
1206
+ // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs
1207
+ if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) {
1208
+ delete rules.maxlength;
1209
+ }
1210
+
1211
+ return rules;
1212
+ },
1213
+
1214
+ dataRules: function( element ) {
1215
+ var rules = {},
1216
+ $element = $( element ),
1217
+ type = element.getAttribute( "type" ),
1218
+ method, value;
1219
+
1220
+ for ( method in $.validator.methods ) {
1221
+ value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );
1222
+ this.normalizeAttributeRule( rules, type, method, value );
1223
+ }
1224
+ return rules;
1225
+ },
1226
+
1227
+ staticRules: function( element ) {
1228
+ var rules = {},
1229
+ validator = $.data( element.form, "validator" );
1230
+
1231
+ if ( validator.settings.rules ) {
1232
+ rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {};
1233
+ }
1234
+ return rules;
1235
+ },
1236
+
1237
+ normalizeRules: function( rules, element ) {
1238
+
1239
+ // Handle dependency check
1240
+ $.each( rules, function( prop, val ) {
1241
+
1242
+ // Ignore rule when param is explicitly false, eg. required:false
1243
+ if ( val === false ) {
1244
+ delete rules[ prop ];
1245
+ return;
1246
+ }
1247
+ if ( val.param || val.depends ) {
1248
+ var keepRule = true;
1249
+ switch ( typeof val.depends ) {
1250
+ case "string":
1251
+ keepRule = !!$( val.depends, element.form ).length;
1252
+ break;
1253
+ case "function":
1254
+ keepRule = val.depends.call( element, element );
1255
+ break;
1256
+ }
1257
+ if ( keepRule ) {
1258
+ rules[ prop ] = val.param !== undefined ? val.param : true;
1259
+ } else {
1260
+ $.data( element.form, "validator" ).resetElements( $( element ) );
1261
+ delete rules[ prop ];
1262
+ }
1263
+ }
1264
+ } );
1265
+
1266
+ // Evaluate parameters
1267
+ $.each( rules, function( rule, parameter ) {
1268
+ rules[ rule ] = $.isFunction( parameter ) && rule !== "normalizer" ? parameter( element ) : parameter;
1269
+ } );
1270
+
1271
+ // Clean number parameters
1272
+ $.each( [ "minlength", "maxlength" ], function() {
1273
+ if ( rules[ this ] ) {
1274
+ rules[ this ] = Number( rules[ this ] );
1275
+ }
1276
+ } );
1277
+ $.each( [ "rangelength", "range" ], function() {
1278
+ var parts;
1279
+ if ( rules[ this ] ) {
1280
+ if ( $.isArray( rules[ this ] ) ) {
1281
+ rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ];
1282
+ } else if ( typeof rules[ this ] === "string" ) {
1283
+ parts = rules[ this ].replace( /[\[\]]/g, "" ).split( /[\s,]+/ );
1284
+ rules[ this ] = [ Number( parts[ 0 ] ), Number( parts[ 1 ] ) ];
1285
+ }
1286
+ }
1287
+ } );
1288
+
1289
+ if ( $.validator.autoCreateRanges ) {
1290
+
1291
+ // Auto-create ranges
1292
+ if ( rules.min != null && rules.max != null ) {
1293
+ rules.range = [ rules.min, rules.max ];
1294
+ delete rules.min;
1295
+ delete rules.max;
1296
+ }
1297
+ if ( rules.minlength != null && rules.maxlength != null ) {
1298
+ rules.rangelength = [ rules.minlength, rules.maxlength ];
1299
+ delete rules.minlength;
1300
+ delete rules.maxlength;
1301
+ }
1302
+ }
1303
+
1304
+ return rules;
1305
+ },
1306
+
1307
+ // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true}
1308
+ normalizeRule: function( data ) {
1309
+ if ( typeof data === "string" ) {
1310
+ var transformed = {};
1311
+ $.each( data.split( /\s/ ), function() {
1312
+ transformed[ this ] = true;
1313
+ } );
1314
+ data = transformed;
1315
+ }
1316
+ return data;
1317
+ },
1318
+
1319
+ // http://jqueryvalidation.org/jQuery.validator.addMethod/
1320
+ addMethod: function( name, method, message ) {
1321
+ $.validator.methods[ name ] = method;
1322
+ $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ];
1323
+ if ( method.length < 3 ) {
1324
+ $.validator.addClassRules( name, $.validator.normalizeRule( name ) );
1325
+ }
1326
+ },
1327
+
1328
+ // http://jqueryvalidation.org/jQuery.validator.methods/
1329
+ methods: {
1330
+
1331
+ // http://jqueryvalidation.org/required-method/
1332
+ required: function( value, element, param ) {
1333
+
1334
+ // Check if dependency is met
1335
+ if ( !this.depend( param, element ) ) {
1336
+ return "dependency-mismatch";
1337
+ }
1338
+ if ( element.nodeName.toLowerCase() === "select" ) {
1339
+
1340
+ // Could be an array for select-multiple or a string, both are fine this way
1341
+ var val = $( element ).val();
1342
+ return val && val.length > 0;
1343
+ }
1344
+ if ( this.checkable( element ) ) {
1345
+ return this.getLength( value, element ) > 0;
1346
+ }
1347
+ return value.length > 0;
1348
+ },
1349
+
1350
+ // http://jqueryvalidation.org/email-method/
1351
+ email: function( value, element ) {
1352
+
1353
+ // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address
1354
+ // Retrieved 2014-01-14
1355
+ // If you have a problem with this implementation, report a bug against the above spec
1356
+ // Or use custom methods to implement your own email validation
1357
+ return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value );
1358
+ },
1359
+
1360
+ // http://jqueryvalidation.org/url-method/
1361
+ url: function( value, element ) {
1362
+
1363
+ // Copyright (c) 2010-2013 Diego Perini, MIT licensed
1364
+ // https://gist.github.com/dperini/729294
1365
+ // see also https://mathiasbynens.be/demo/url-regex
1366
+ // modified to allow protocol-relative URLs
1367
+ return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
1368
+ },
1369
+
1370
+ // http://jqueryvalidation.org/date-method/
1371
+ date: function( value, element ) {
1372
+ return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
1373
+ },
1374
+
1375
+ // http://jqueryvalidation.org/dateISO-method/
1376
+ dateISO: function( value, element ) {
1377
+ return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value );
1378
+ },
1379
+
1380
+ // http://jqueryvalidation.org/number-method/
1381
+ number: function( value, element ) {
1382
+ return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
1383
+ },
1384
+
1385
+ // http://jqueryvalidation.org/digits-method/
1386
+ digits: function( value, element ) {
1387
+ return this.optional( element ) || /^\d+$/.test( value );
1388
+ },
1389
+
1390
+ // http://jqueryvalidation.org/minlength-method/
1391
+ minlength: function( value, element, param ) {
1392
+ var length = $.isArray( value ) ? value.length : this.getLength( value, element );
1393
+ return this.optional( element ) || length >= param;
1394
+ },
1395
+
1396
+ // http://jqueryvalidation.org/maxlength-method/
1397
+ maxlength: function( value, element, param ) {
1398
+ var length = $.isArray( value ) ? value.length : this.getLength( value, element );
1399
+ return this.optional( element ) || length <= param;
1400
+ },
1401
+
1402
+ // http://jqueryvalidation.org/rangelength-method/
1403
+ rangelength: function( value, element, param ) {
1404
+ var length = $.isArray( value ) ? value.length : this.getLength( value, element );
1405
+ return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );
1406
+ },
1407
+
1408
+ // http://jqueryvalidation.org/min-method/
1409
+ min: function( value, element, param ) {
1410
+ return this.optional( element ) || value >= param;
1411
+ },
1412
+
1413
+ // http://jqueryvalidation.org/max-method/
1414
+ max: function( value, element, param ) {
1415
+ return this.optional( element ) || value <= param;
1416
+ },
1417
+
1418
+ // http://jqueryvalidation.org/range-method/
1419
+ range: function( value, element, param ) {
1420
+ return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] );
1421
+ },
1422
+
1423
+ // http://jqueryvalidation.org/step-method/
1424
+ step: function( value, element, param ) {
1425
+ var type = $( element ).attr( "type" ),
1426
+ errorMessage = "Step attribute on input type " + type + " is not supported.",
1427
+ supportedTypes = [ "text", "number", "range" ],
1428
+ re = new RegExp( "\\b" + type + "\\b" ),
1429
+ notSupported = type && !re.test( supportedTypes.join() ),
1430
+ decimalPlaces = function( num ) {
1431
+ var match = ( "" + num ).match( /(?:\.(\d+))?$/ );
1432
+ if ( !match ) {
1433
+ return 0;
1434
+ }
1435
+
1436
+ // Number of digits right of decimal point.
1437
+ return match[ 1 ] ? match[ 1 ].length : 0;
1438
+ },
1439
+ toInt = function( num ) {
1440
+ return Math.round( num * Math.pow( 10, decimals ) );
1441
+ },
1442
+ valid = true,
1443
+ decimals;
1444
+
1445
+ // Works only for text, number and range input types
1446
+ // TODO find a way to support input types date, datetime, datetime-local, month, time and week
1447
+ if ( notSupported ) {
1448
+ throw new Error( errorMessage );
1449
+ }
1450
+
1451
+ decimals = decimalPlaces( param );
1452
+
1453
+ // Value can't have too many decimals
1454
+ if ( decimalPlaces( value ) > decimals || toInt( value ) % toInt( param ) !== 0 ) {
1455
+ valid = false;
1456
+ }
1457
+
1458
+ return this.optional( element ) || valid;
1459
+ },
1460
+
1461
+ // http://jqueryvalidation.org/equalTo-method/
1462
+ equalTo: function( value, element, param ) {
1463
+
1464
+ // Bind to the blur event of the target in order to revalidate whenever the target field is updated
1465
+ var target = $( param );
1466
+ if ( this.settings.onfocusout && target.not( ".validate-equalTo-blur" ).length ) {
1467
+ target.addClass( "validate-equalTo-blur" ).on( "blur.validate-equalTo", function() {
1468
+ $( element ).valid();
1469
+ } );
1470
+ }
1471
+ return value === target.val();
1472
+ },
1473
+
1474
+ // http://jqueryvalidation.org/remote-method/
1475
+ remote: function( value, element, param, method ) {
1476
+ if ( this.optional( element ) ) {
1477
+ return "dependency-mismatch";
1478
+ }
1479
+
1480
+ method = typeof method === "string" && method || "remote";
1481
+
1482
+ var previous = this.previousValue( element, method ),
1483
+ validator, data, optionDataString;
1484
+
1485
+ if ( !this.settings.messages[ element.name ] ) {
1486
+ this.settings.messages[ element.name ] = {};
1487
+ }
1488
+ previous.originalMessage = previous.originalMessage || this.settings.messages[ element.name ][ method ];
1489
+ this.settings.messages[ element.name ][ method ] = previous.message;
1490
+
1491
+ param = typeof param === "string" && { url: param } || param;
1492
+ optionDataString = $.param( $.extend( { data: value }, param.data ) );
1493
+ if ( previous.old === optionDataString ) {
1494
+ return previous.valid;
1495
+ }
1496
+
1497
+ previous.old = optionDataString;
1498
+ validator = this;
1499
+ this.startRequest( element );
1500
+ data = {};
1501
+ data[ element.name ] = value;
1502
+ $.ajax( $.extend( true, {
1503
+ mode: "abort",
1504
+ port: "validate" + element.name,
1505
+ dataType: "json",
1506
+ data: data,
1507
+ context: validator.currentForm,
1508
+ success: function( response ) {
1509
+ var valid = response === true || response === "true",
1510
+ errors, message, submitted;
1511
+
1512
+ validator.settings.messages[ element.name ][ method ] = previous.originalMessage;
1513
+ if ( valid ) {
1514
+ submitted = validator.formSubmitted;
1515
+ validator.resetInternals();
1516
+ validator.toHide = validator.errorsFor( element );
1517
+ validator.formSubmitted = submitted;
1518
+ validator.successList.push( element );
1519
+ validator.invalid[ element.name ] = false;
1520
+ validator.showErrors();
1521
+ } else {
1522
+ errors = {};
1523
+ message = response || validator.defaultMessage( element, { method: method, parameters: value } );
1524
+ errors[ element.name ] = previous.message = message;
1525
+ validator.invalid[ element.name ] = true;
1526
+ validator.showErrors( errors );
1527
+ }
1528
+ previous.valid = valid;
1529
+ validator.stopRequest( element, valid );
1530
+ }
1531
+ }, param ) );
1532
+ return "pending";
1533
+ }
1534
+ }
1535
+
1536
+ } );
1537
+
1538
+ // Ajax mode: abort
1539
+ // usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
1540
+ // if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
1541
+
1542
+ var pendingRequests = {},
1543
+ ajax;
1544
+
1545
+ // Use a prefilter if available (1.5+)
1546
+ if ( $.ajaxPrefilter ) {
1547
+ $.ajaxPrefilter( function( settings, _, xhr ) {
1548
+ var port = settings.port;
1549
+ if ( settings.mode === "abort" ) {
1550
+ if ( pendingRequests[ port ] ) {
1551
+ pendingRequests[ port ].abort();
1552
+ }
1553
+ pendingRequests[ port ] = xhr;
1554
+ }
1555
+ } );
1556
+ } else {
1557
+
1558
+ // Proxy ajax
1559
+ ajax = $.ajax;
1560
+ $.ajax = function( settings ) {
1561
+ var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
1562
+ port = ( "port" in settings ? settings : $.ajaxSettings ).port;
1563
+ if ( mode === "abort" ) {
1564
+ if ( pendingRequests[ port ] ) {
1565
+ pendingRequests[ port ].abort();
1566
+ }
1567
+ pendingRequests[ port ] = ajax.apply( this, arguments );
1568
+ return pendingRequests[ port ];
1569
+ }
1570
+ return ajax.apply( this, arguments );
1571
+ };
1572
+ }
1573
+ return $;
1574
  }));
gallery-bank.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Gallery Bank is an interactive WordPress gallery plugin, best fit for creative and corporate portfolio websites.
6
  * Author: Tech Banker
7
  * Author URI: http://gallery-bank.tech-banker.com
8
- * Version: 4.0.3
9
  * License: GPLv3
10
  * Text Domain: gallery-bank
11
  * Domain Path: /languages
@@ -89,7 +89,7 @@ if (!defined("tech_banker_stats_url")) {
89
  define("tech_banker_stats_url", "http://stats.tech-banker-services.org");
90
  }
91
  if (!defined("gallery_bank_wizard_version_number")) {
92
- define("gallery_bank_wizard_version_number", "4.0.3");
93
  }
94
 
95
  if (!is_dir(GALLERY_BANK_MAIN_DIR)) {
@@ -348,8 +348,8 @@ if (is_admin()) {
348
  }
349
  }
350
  if (strpos($hook, "gb_add_gallery") !== false) {
351
- wp_enqueue_script("plupload.full.min.js", GALLERY_BANK_PLUGIN_DIR_URL . "assets/global/plugins/pluploader/js/plupload.full.min.js", array("jquery-ui-draggable", "jquery-ui-sortable", "jquery-ui-dialog", "jquery-ui-widget", "jquery-ui-progressbar"), false);
352
- wp_enqueue_script("jquery.ui.plupload.js", GALLERY_BANK_PLUGIN_DIR_URL . "assets/global/plugins/pluploader/js/jquery.ui.plupload.js");
353
  wp_enqueue_style("jquery.ui.plupload.css", GALLERY_BANK_PLUGIN_DIR_URL . "assets/global/plugins/pluploader/css/jquery.ui.plupload.css");
354
  wp_enqueue_style("jquery-ui.css", GALLERY_BANK_PLUGIN_DIR_URL . "assets/global/plugins/pluploader/css/jquery-ui.css");
355
  wp_enqueue_script("bootstrap-hover-dropdown.js", GALLERY_BANK_PLUGIN_DIR_URL . "assets/global/plugins/custom/js/bootstrap-hover-dropdown.js");
@@ -657,17 +657,17 @@ if ($version == "4.0") {
657
 
658
  if (isset($source_type)) {
659
  if (file_exists(GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/common-variables.php")) {
660
- require GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/common-variables.php";
661
  }
662
  switch (esc_attr($source_type)) {
663
  case "gallery" :
664
  if (file_exists(GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/galleries/structure.php")) {
665
- require GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/galleries/structure.php";
666
  }
667
  break;
668
  case "album" :
669
  if (file_exists(GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/albums/structure.php")) {
670
- require GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/albums/structure.php";
671
  }
672
  break;
673
  }
5
  * Description: Gallery Bank is an interactive WordPress gallery plugin, best fit for creative and corporate portfolio websites.
6
  * Author: Tech Banker
7
  * Author URI: http://gallery-bank.tech-banker.com
8
+ * Version: 4.0.4
9
  * License: GPLv3
10
  * Text Domain: gallery-bank
11
  * Domain Path: /languages
89
  define("tech_banker_stats_url", "http://stats.tech-banker-services.org");
90
  }
91
  if (!defined("gallery_bank_wizard_version_number")) {
92
+ define("gallery_bank_wizard_version_number", "4.0.4");
93
  }
94
 
95
  if (!is_dir(GALLERY_BANK_MAIN_DIR)) {
348
  }
349
  }
350
  if (strpos($hook, "gb_add_gallery") !== false) {
351
+ wp_enqueue_script("plupload.full.min.js", GALLERY_BANK_PLUGIN_DIR_URL . "assets/global/plugins/pluploader/js/plupload.full.min.js", array("jquery-ui-draggable", "jquery-ui-sortable", "jquery-ui-dialog", "jquery-ui-widget", "jquery-ui-progressbar"),null,true);
352
+ wp_enqueue_script("jquery.ui.plupload.js", GALLERY_BANK_PLUGIN_DIR_URL . "assets/global/plugins/pluploader/js/jquery.ui.plupload.js",null,null,true);
353
  wp_enqueue_style("jquery.ui.plupload.css", GALLERY_BANK_PLUGIN_DIR_URL . "assets/global/plugins/pluploader/css/jquery.ui.plupload.css");
354
  wp_enqueue_style("jquery-ui.css", GALLERY_BANK_PLUGIN_DIR_URL . "assets/global/plugins/pluploader/css/jquery-ui.css");
355
  wp_enqueue_script("bootstrap-hover-dropdown.js", GALLERY_BANK_PLUGIN_DIR_URL . "assets/global/plugins/custom/js/bootstrap-hover-dropdown.js");
657
 
658
  if (isset($source_type)) {
659
  if (file_exists(GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/common-variables.php")) {
660
+ include GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/common-variables.php";
661
  }
662
  switch (esc_attr($source_type)) {
663
  case "gallery" :
664
  if (file_exists(GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/galleries/structure.php")) {
665
+ include GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/galleries/structure.php";
666
  }
667
  break;
668
  case "album" :
669
  if (file_exists(GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/albums/structure.php")) {
670
+ include GALLERY_BANK_PLUGIN_DIR_PATH . "user-views/includes/albums/structure.php";
671
  }
672
  break;
673
  }
includes/footer.php CHANGED
@@ -821,14 +821,11 @@ if (!is_user_logged_in()) {
821
  ({
822
  runtimes: "html5,html4,flash,silverlight",
823
  url: ajaxurl + "?param=upload_gallery_pics&action=gallery_bank_image_upload&_wp_nonce=<?php echo $upload_local_system_files_nonce; ?>",
 
824
  chunk_size: "2mb",
825
- filters:
826
- {
827
- max_file_size: "100mb",
828
- mime_types: [
829
- {title: "Image files", extensions: "jpg,jpeg,gif,png"}
830
- ]
831
- },
832
  rename: true,
833
  sortable: true,
834
  dragdrop: true,
821
  ({
822
  runtimes: "html5,html4,flash,silverlight",
823
  url: ajaxurl + "?param=upload_gallery_pics&action=gallery_bank_image_upload&_wp_nonce=<?php echo $upload_local_system_files_nonce; ?>",
824
+ max_file_size : "20mb",
825
  chunk_size: "2mb",
826
+ filters : [
827
+ {title : "Image files", extensions : "jpg,jpeg,gif,png"}
828
+ ],
 
 
 
 
829
  rename: true,
830
  sortable: true,
831
  dragdrop: true,
readme.txt CHANGED
@@ -1,187 +1,229 @@
1
- === Photo Gallery - Image Gallery - Photo Albums - All in One WordPress Gallery Plugin ===
2
  Contributors: Gallery-Bank, contact-banker
3
- Tags: album, gallery, gallery plugin, gallery widget, image gallery, masonry gallery, media gallery, photo album, photo gallery, wordpress gallery, wordpress gallery plugin, responsive gallery, photo albums, gallery lightbox, wordpress photo gallery plugin
4
  Requires at least: 3.4
5
  Tested up to: 4.8
6
  Stable Tag: trunk
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
10
- Photo Gallery by Gallery Bank can be used to create a gallery widget, media gallery, image gallery, portfolio gallery and photo albums.
11
 
12
  == Description ==
13
 
14
- = WordPress Photo Gallery Plugin =
15
-
16
- [**WordPress Photo Gallery Plugin by Gallery Bank**](https://gallery-bank.tech-banker.com/) is a WordPress Gallery Plugin designed to create elegant and beautiful **photo gallery** and **albums** along with Images and videos using Grid Albums, List Albums, Individual Albums, Masonry Layouts and Thumbnail Layouts along with Special Effects and Animation Effects.
17
-
18
- **WordPress Photo Gallery Plugin by Gallery Bank** is the only available WordPress Plugin in the market with extra-ordinary features. It is loaded with 200+ features and creates stunning Photo Galleries on any WordPress site.
19
-
20
- **WordPress Photo Gallery Plugin by Gallery Bank** provides a powerful engine for uploading and managing photo galleries of images & videos, with the ability to batch upload, delete, rearrange, sort images.
21
-
22
- Gallery Bank Regularly updates and simplicity of usage along with efficient functionality makes it a perfect choice for your wordpress site to have stunning look. There are also Premium Editions of the plugin with more useful features available.
23
-
24
- > #### **Live Demos - WordPress Photo Gallery Plugin by Gallery Bank**
25
-
26
- * [Gallery Bank Demos](https://gallery-bank.tech-banker.com/frontend-demos/)
27
- * [Image Gallery in Thumbnail Layout](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-thumbnail-layout/)
28
- * [Image Gallery in Thumbnail Layout with Lightboxes](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lightboxes-thumbnail-layout/)
29
- * [Image Gallery in Thumbnail Layout with Pagination](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-pagination-thumbnail-layout/)
30
- * [Image Gallery in Thumbnail Layout with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-thumbnail-layout/)
31
- * [Image Gallery in Thumbnail Layout with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-thumbnail-layout/)
32
- * [Image Gallery in Thumbnail Layout with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-thumbnail-layout/)
33
- * [Image Gallery in Thumbnail Layout with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-thumbnail-layout/)
34
- * [Image Gallery in Thumbnail Layout with Watermark](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-thumbnail-layout/)
35
- * [Image Gallery in Thumbnail Layout with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-thumbnail-layout/)
36
- * [Image Gallery in Thumbnail Layout with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-thumbnail-layout/)
37
- * [Image Gallery in Masonry Layout](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-masonry-layout/)
38
- * [Image Gallery in Masonry Layout with Lightboxes](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lightboxes-masonry-layout/)
39
- * [Image Gallery in Masonry Layout with Pagination](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-pagination-masonry-layout/)
40
- * [Image Gallery in Masonry Layout with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-masonry-layout/)
41
- * [Image Gallery in Masonry Layout with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-masonry-layout/)
42
- * [Image Gallery in Masonry Layout with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-masonry-layout/)
43
- * [Image Gallery in Masonry Layout with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-masonry-layout/)
44
- * [Image Gallery in Masonry Layout with Watermark](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-masonry-layout/)
45
- * [Image Gallery in Masonry Layout with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-masonry-layout/)
46
- * [Image Gallery in Masonry Layout with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-masonry-layout/)
47
- * [Image Gallery in Slide Show Layout](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-slideshow-layout/)
48
- * [Image Gallery in Slide Show Layout with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-slideshow-layout/)
49
- * [Image Gallery in Slide Show Layout with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-slideshow-layout/)
50
- * [Image Gallery in Slide Show Layout with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-slideshow-layout/)
51
- * [Image Gallery in Slide Show Layout with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-slideshow-layout/)
52
- * [Image Gallery in Slide Show Layout with Watermark](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-slideshow-layout/)
53
- * [Image Gallery in Slide Show Layout with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-slideshow-layout/)
54
- * [Image Gallery in Slide Show Layout with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-slideshow-layout/)
55
- * [Image Gallery in Image Browser Layout](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-image-browser-layout/)
56
- * [Image Gallery in Image Browser Layout with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-image-browser-layout/)
57
- * [Image Gallery in Image Browser Layout with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-image-browser-layout/)
58
- * [Image Gallery in Image Browser Layout with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-image-browser-layout/)
59
- * [Image Gallery in Image Browser Layout with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-image-browser-layout/)
60
- * [Image Gallery in Image Browser Layout with Watermark](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-image-browser-layout/)
61
- * [Image Gallery in Image Browser Layout with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-image-browser-layout/)
62
- * [Image Gallery in Image Browser Layout with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-image-browser-layout/)
63
- * [Image Gallery in Justified Grid Layout](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-justified-grid-layout/)
64
- * [Image Gallery in Justified Grid Layout with Lightboxes](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lightboxes-justified-grid-layout/)
65
- * [Image Gallery in Justified Grid Layout with Pagination](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-pagination-justified-grid-layout/)
66
- * [Image Gallery in Justified Grid with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-justified-grid-layout/)
67
- * [Image Gallery in Justified Grid with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-justified-grid-layout/)
68
- * [Image Gallery in Justified Grid with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-justified-grid-layout/)
69
- * [Image Gallery in Justified Grid with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-justified-grid-layout/)
70
- * [Image Gallery in Justified Grid Layout with Watermark](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-justified-grid-layout/)
71
- * [Image Gallery in Justified Grid Layout with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-justified-grid-layout/)
72
- * [Image Gallery in Justified Grid Layout with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-justified-grid-layout/)
73
- * [Image Gallery in Blog Style Layout](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-blog-style-layout/)
74
- * [Image Gallery in Blog Style Layout with Lightboxes](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lightboxes-blog-style-layout/)
75
- * [Image Gallery in Blog Style Layout with Pagination](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-pagination-blog-style-layout/)
76
- * [Image Gallery in Blog Style with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-blog-style-layout/)
77
- * [Image Gallery in Blog Style with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-blog-style-layout/)
78
- * [Image Gallery in Blog Style with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-blog-style-layout/)
79
- * [Image Gallery in Blog Style with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-blog-style-layout/)
80
- * [Image Gallery in Blog Style Layout with Watermark](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-blog-style-layout/)
81
- * [Image Gallery in Blog Style Layout with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-blog-style-layout/)
82
- * [Image Gallery in Blog Style Layout with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-blog-style-layout/)
83
- * [Image Gallery in Compact Album Layout](https://gallery-bank.tech-banker.com/frontend-demos/compact-album-with-title-description-thumbnail-layout/)
84
- * [Image Gallery in Extended Album Layout](https://gallery-bank.tech-banker.com/frontend-demos/extended-album-with-title-description-thumbnail-layout/)
85
-
86
-
87
- **[Upgrade to Pro Version](https://gallery-bank.tech-banker.com/)**
88
-
89
- **[Like & Support Us on Facebook](https://www.facebook.com/TechBanker/)**
90
-
91
- = **Key Features in Gallery Bank Lite Edition** =
92
-
93
- * 100% Responsive Photo Gallery Plugin.
94
- * Create & Manage unlimited amount of image galleries on your wordpress site.
 
 
 
 
 
 
 
 
 
 
95
  * Upload unlimited amount of photos/images in your gallery.
96
- * Images uploaded are stored in a separate directory to avoid mess up with wp-uploads.
97
  * Photo Metadata is fetched from each image and populates to Title, Description, Alt Text Fields too.
98
  * Photo Metadata is retrieved as per IPTC Standard mentioned [here](https://iptc.org/standards/photo-metadata/photo-metadata/)
99
- * Add Gallery Title and Gallery Description to each of your galleries.
100
- * Add Image Title, Image Description, Alt Text to each of your images in your photo gallery.
101
- * Possibility to exclude images from displaying in a particular gallery.
102
- * Add Single Gallery to your page or post using a shortcode.
103
- * Add a caption to each photo in the album.
104
- * Change the size of album cover thumbnails and photos in the album.
105
- * Choose a number of pictures to display in one row in the gallery album.
106
- * View pictures as a slide show and in a full size.
107
- * 3 different Widgets: Display a single album, create a list of album links, display latest/random media
108
- * User-friendly AJAX admin
109
- * Upload different types of media
110
-
111
- = **Key Features in Gallery Bank Premium Editions** =
112
-
113
- Take your media to the next level with [Gallery Bank Premium Editions](https://gallery-bank.tech-banker.com/), which gives you 200+ features such as:
114
-
115
- * Unlimited Albums Creation
116
- * Filmstrip Gallery Format
117
- * Slideshow Gallery
118
- * Special Effects on Images & Albums
119
- * Animation Effects on Images & Albums
120
- * Bulk Deletion of Images
121
- * Fully CSS3 compliant with text shadowing, box shadowing, gradients, etc
122
- * Sorting of Images
123
- * Sorting of Albums
124
- * Social Sharing
125
- * Commenting on Images
126
- * Widgets
127
- * Tags for each Image to make Filerable Gallery Album
128
- * Bulk Deletion of Albums
129
- * Purging Albums and Images
130
- * Restore Factory Settings
131
- * Global Settings
132
- * Thumbnail Settings
133
- * Album Settings
134
- * Lightbox Settings
135
- * Different Lightboxes like FooBox, ColorBox, FancyBox2, Lightbox2, Custom GB Lightbox, Pretty Photo
136
- * Pagination
137
- * Filter Settings
138
- * Roles & Capabilities
139
- * Front End Layout Settings
140
- * See your media on different theme and more.
141
- * Powerfull control panel and Shortcode Manager make getting started super easy
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  * 24/7 Technical Support
143
 
144
- Visit [here](https://gallery-bank.tech-banker.com/) to upgrade to Pro Editions now.
145
 
146
- = Add New Albums using Gallery Bank =
147
 
148
- You can add upto 3 albums with unlimited images in your Gallery Bank. After that you need to upgrade to one of the Premium Editions for unlimited access with different features available according to different packages of Gallery Bank.
149
 
150
- = Editing Albums using Gallery Bank =
151
 
152
- In albums, editing can be done easily. You can edit or add more images/ pictures in your albums. You can change title/description of an album as well as title/description of each image uploaded in a particular album.
153
 
154
- = Sorting of Images in an Album using Gallery Bank =
155
 
156
- Sorting of Images can be done in your albums. With this feature, you can change the order of pictures according to your requirement/choice.
157
 
158
- = Sorting of Albums using Gallery Bank =
159
 
160
- Sorting of Albums can be done in your albums. With this feature, you can re-arrange your order of albums to display on your website.
161
 
162
- = Album Preview using Gallery Bank =
163
 
164
- In album preview you can view the pictures/images on your back-end before implementing the shortcodes on your Pages/Posts.
165
 
166
- = Cover Image using Gallery Bank =
167
 
168
- You can easily set the cover image in your album. This cover image would be used to display on your Pages/Post when using the Album shortcodes.
169
 
170
- = Short Codes using Gallery Bank =
171
 
172
- There is a Shortcode Editor availble in your Page/Post where you want to implement the Gallery Bank Shortcode. You just need to go to your Page/Post where you want to implement it and then above your Text Editor/ WP Editor, there would be a button called Gallery Bank. Once you click on it, you can generate your shortcode easily and quickly.
173
 
174
- = Global Settings using Gallery Bank =
175
 
176
- With Global Settings, you can define different settings for Thumbnails, Albums, Lightboxes, Filters, Pagination and Slideshows.
177
 
178
- = Technical Support =
 
 
 
 
 
 
179
 
180
- If any problem occurs, please contact us at [support@tech-banker.com](mailto:support@tech-banker.com).
 
 
 
 
 
 
 
 
 
 
181
 
182
  == Installation ==
183
 
184
- ### Performing a new installation for Gallery Bank.
185
 
186
  = Minimum requirements. =
187
  * Wordpress 3.1+
@@ -218,250 +260,13 @@ If any problem occurs, please contact us at [support@tech-banker.com](mailto:sup
218
 
219
  == Other Notes ==
220
 
221
- = Minimum requirements for Gallery Bank. =
222
  * Wordpress 3.3+
223
  * PHP 5.x
224
  * MySQL 5.x
225
 
226
  If any problem occurs, please contact us at [support@tech-banker.com](mailto:support@tech-banker.com).
227
 
228
- == Frequently Asked Questions ==
229
-
230
- = How to add New Album in Gallery Bank? =
231
-
232
- In order to Add New Album in your Gallery Bank, locate Gallery Bank Menu on the left side of WordPress Dashboard Menus and then click on Add New Album link.
233
-
234
- Alternatively, you can also Add New Album from your Gallery Bank Dashboard Page.
235
-
236
- There is a button at the top of the Gallery Bank Dashboard Page which says Add New Album.
237
-
238
- First Method:
239
-
240
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/gallery-bank-left-menu.png)
241
-
242
- Alternate Method:
243
-
244
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/gallery-bank-left-menu2.png)
245
-
246
- Once you click on the button from any of the above mentioned methods, this page would open.
247
-
248
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/add-new-album-explanation.png)
249
-
250
-
251
- = How to Edit an Album in Gallery Bank? =
252
-
253
- In order to Edit an Album, you need to go to your Gallery Bank Dashboard Page and then click on Edit Album Button located at the right side of each album which you wish to edit.
254
-
255
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/Edit.png)
256
-
257
- Once you Click on the button, this page will open.
258
-
259
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/Edit_img-938x1024.png)
260
-
261
-
262
- = How to Preview an Album in Gallery Bank? =
263
-
264
- In order to Preview your Album, you need to go to your Gallery Bank Dashboard Page
265
- and then click on Preview Album button at the right side of each album.
266
-
267
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/preview11-1024x408.png)
268
-
269
- Once you click on the button, this page will open
270
-
271
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/preview21-1024x487.png)
272
-
273
-
274
- = How to Delete an Album in Gallery Bank? =
275
-
276
- You can Delete an Album if you wish to. In order to perform this action, you need to go to your Gallery Bank Dashboard Page and then click on Delete Album button at the right side of each album.
277
-
278
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/delete11-1024x409.png)
279
-
280
- Once you click on the button, a confirmation message will appear stating "Are you sure you want to delete this Album?"
281
-
282
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/delete2-1024x406.png)
283
-
284
- Click on "OK" to proceed and your Album would be deleted.
285
-
286
-
287
- = How to set Short code for Masonry Gallery? =
288
-
289
- In order to set Shortcode for Masonry Gallery, you need to follow these steps :
290
- 1) Locate Pages Menu on the left side of WordPress Dashboard Menus and then click on Pages.
291
-
292
- Once you click on the Pages, there will be two options. Click on Add New button to add a new page.
293
-
294
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/add_new_page.png)
295
-
296
- 2) When you click on Add New button, this page will open.
297
-
298
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/masonry2-1024x511.png)
299
-
300
- 3) After clicking on Gallery Bank button, this Popup will open.
301
-
302
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/masonry3-1024x451.png)
303
-
304
- NOTE: You can set Images in Row for Masonry Gallery only if Show Responsive Gallery
305
- option is False in shortcode.
306
-
307
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/masonry4-1024x657.png)
308
-
309
-
310
- = How to set Short code for Thumbnail Gallery? =
311
-
312
- In order to set Shortcode for Thumbnail Gallery, you need to follow these steps :
313
- 1) Locate Pages Menu on the left side of WordPress Dashboard Menus and then click on Pages.
314
-
315
- Once you click on the Pages, there will be two options. Click on Add New button to add a new page.
316
-
317
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/add_new_page.png)
318
-
319
- 2) When you click on Add New button, this page will open.
320
-
321
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/masonry2-1024x511.png)
322
-
323
- 3) After clicking on Gallery Bank button, this Popup will open.
324
-
325
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/thumbnail1-1024x493.png)
326
-
327
- NOTE: You can set Images in Row for Thumbnail Gallery only if Show Responsive Gallery option
328
- is False in shortcode.
329
-
330
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/thmbnail2-1024x450.png)
331
-
332
-
333
- = How to set Short code for Grid Album using Masonry Gallery? =
334
-
335
- In order to set Shortcode for Grid Album with Masonry Gallery, you need to follow these steps :
336
- 1) Locate Pages Menu on the left side of WordPress Dashboard Menus and then click on Pages.
337
-
338
- Once you click on the Pages, there will be two options. Click on Add New button to add a new page.
339
-
340
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/add_new_page.png)
341
-
342
- 2) When you click on Add New button, this page will open.
343
-
344
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/masonry2-1024x511.png)
345
-
346
- 3) After clicking on Gallery Bank button, this Popup will open.
347
-
348
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/grid_masonry1-1024x541.png)
349
-
350
- Note: You can set Images in Row for Masonry Gallery only if Show Responsive Gallery option
351
- is False in shortcode.
352
-
353
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/grid_masonry2-1024x573.png)
354
-
355
-
356
- = How to set Short code for Grid Album using Thumbnail Gallery? =
357
-
358
- In order to set Shortcode for Grid Album with Thumbnail Gallery, you need to follow these steps :
359
- 1) Locate Pages Menu on the left side of WordPress Dashboard Menus and then click on Pages.
360
-
361
- Once you click on the Pages, this page would open. Click on Add New button to add a new page.
362
-
363
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/add_new_page.png)
364
-
365
- 2) When you click on Add New button, this page will open.
366
-
367
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/masonry2-1024x511.png)
368
-
369
- 3) When you click on Gallery Bank button, this Popup will open.
370
-
371
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/grid_thumbnail2-1024x574.png)
372
-
373
- NOTE: You can set Images in Row for Thumbnail Gallery only if Show Responsive Gallery
374
- option is False in shortcode.
375
-
376
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/grid_thumbnail2-1024x574.png)
377
-
378
-
379
- = How to set Short code for List Album using Masonry Gallery? =
380
-
381
- In order to set Shortcode for List Album with Masonry Gallery, you need to follow these steps :
382
- 1) Locate Pages Menu on the left side of WordPress Dashboard Menus and then click on Pages.
383
-
384
- Once you click on the Pages, there will be two options. Click on Add New button to add a new page.
385
-
386
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/add_new_page.png)
387
-
388
- 2) When you click on Add New button, this page will open.
389
-
390
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/masonry2-1024x511.png)
391
-
392
- 3) After clicking on Gallery Bank button, this Popup will open.
393
-
394
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/masonry_list_1.png)
395
-
396
-
397
- = How to set Short code for List Album using Thumbnail Gallery? =
398
-
399
- In order to set Shortcode for List Album with Thumbnail Gallery, you need to follow these steps :
400
- 1) Locate Pages Menu on the left side of WordPress Dashboard Menus and then click on Pages.
401
-
402
- Once you click on the Pages, there will be two options. Click on Add New button to add a new page.
403
-
404
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/add_new_page.png)
405
-
406
- 2) When you click on Add New button, this page will open.
407
-
408
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/masonry2-1024x511.png)
409
-
410
- 3) After clicking on Gallery Bank button, this Popup will open.
411
-
412
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/thumbnail_list_1-1024x467.png)
413
-
414
- NOTE: You can set Images in Row for Thumbnail Gallery only if Show Responsive Gallery option
415
- is False in shortcode.
416
-
417
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/thumbnail_list_2-1024x462.png)
418
-
419
-
420
- = How to set Short code for Individual Album using Masonry Gallery? =
421
-
422
- In order to set Shortcode for Individual Album with Masonry Gallery, you need to follow these steps :
423
- 1) Locate Pages Menu on the left side of WordPress Dashboard Menus and then click on Pages.
424
-
425
- Once you click on the Pages, there will be two options. Click on Add New button to add a new page.
426
-
427
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/add_new_page.png)
428
-
429
- 2) When you click on Add New button, this page will open.
430
-
431
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/masonry2-1024x511.png)
432
-
433
- 3) After clicking on Gallery Bank button, this Popup will open.
434
-
435
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/individual_masonry1-1024x495.png)
436
-
437
- NOTE: You can set Images in Row for Masonry Gallery only if Show Responsive Gallery option
438
- is False in shortcode.
439
-
440
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/individual_masonry_2-1024x559.png)
441
-
442
-
443
- = How to set Short code for Individual Album using Thumbnail Gallery? =
444
-
445
- In order to set Shortcode for Individual Album with Thumbnail Gallery, you need to follow these steps :
446
- 1) Locate Pages Menu on the left side of WordPress Dashboard Menus and then click on Pages.
447
-
448
- Once you click on the Pages, there will be two options. Click on Add New button to add a new page.
449
-
450
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/422x105xadd_new_page1.png.pagespeed.ic.0XLpT7oDfn.png)
451
-
452
- 2) When you click on Add New button, this page will open.
453
-
454
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/800xNxmasonry2-1024x511.png.pagespeed.ic.cYyWvoC3qL.jpg)
455
-
456
- 3) After clicking on Gallery Bank button, this Popup will open.
457
-
458
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/individual-_thumbnail1-1024x512.png)
459
-
460
- NOTE: You can set Images in Row for Thumbnail Gallery only if Show Responsive Gallery option
461
- is False in shortcode.
462
-
463
- [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/individual-_thumbnail2-1024x574.png)
464
-
465
  == Screenshots ==
466
 
467
  1. Manage Galleries
@@ -476,36 +281,36 @@ is False in shortcode.
476
  10. Sort Albums
477
  11. Manage Tags
478
  12. Add Tag
479
- 13. Layout Settings - Thumbnail Gallery Layout - Thumbnails
480
- 14. Layout Settings - Thumbnail Gallery Layout - Gallery Title
481
- 15. Layout Settings - Thumbnail Gallery Layout - Gallery Description
482
- 16. Layout Settings - Thumbnail Gallery Layout - Thumbnail Title
483
- 17. Layout Settings - Thumbnail Gallery Layout - Thumbnail Description
484
- 18. Layout Settings - Masonry Gallery Layout - Thumbnails
485
- 19. Layout Settings - Masonry Gallery Layout - Gallery Title
486
- 20. Layout Settings - Masonry Gallery Layout - Gallery Description
487
- 21. Layout Settings - Masonry Gallery Layout - Thumbnail Title
488
- 22. Layout Settings - Masonry Gallery Layout - Thumbnail Description
489
- 23. Layout Settings - Slideshow Gallery Layout - Thumbnails
490
- 24. Layout Settings - Slideshow Gallery Layout - Gallery Title
491
- 25. Layout Settings - Slideshow Gallery Layout - Gallery Description
492
- 26. Layout Settings - Slideshow Gallery Layout - Thumbnail Title
493
- 27. Layout Settings - Slideshow Gallery Layout - Thumbnail Description
494
- 28. Layout Settings - Image Browser Gallery Layout - Thumbnails
495
- 29. Layout Settings - Image Browser Gallery Layout - Gallery Title
496
- 30. Layout Settings - Image Browser Gallery Layout - Gallery Description
497
- 31. Layout Settings - Image Browser Gallery Layout - Thumbnail Title
498
- 32. Layout Settings - Image Browser Gallery Layout - Thumbnail Description
499
- 33. Layout Settings - Justified Grid Gallery Layout - Thumbnails
500
- 34. Layout Settings - Justified Grid Gallery Layout - Gallery Title
501
- 35. Layout Settings - Justified Grid Gallery Layout - Gallery Description
502
- 36. Layout Settings - Justified Grid Gallery Layout - Thumbnail Title
503
- 37. Layout Settings - Justified Grid Gallery Layout - Thumbnail Description
504
- 38. Layout Settings - Blog Style Gallery Layout - Thumbnails
505
- 39. Layout Settings - Blog Style Gallery Layout - Gallery Title
506
- 40. Layout Settings - Blog Style Gallery Layout - Gallery Description
507
- 41. Layout Settings - Blog Style Gallery Layout - Thumbnail Title
508
- 42. Layout Settings - Blog Style Gallery Layout - Thumbnail Description
509
  43. Layout Settings - Compact Album Layout - Thumbnails
510
  44. Layout Settings - Compact Album Layout - Album Title
511
  45. Layout Settings - Compact Album Layout - Album Description
@@ -544,12 +349,12 @@ is False in shortcode.
544
  78. General Settings - Watermark Settings - Image
545
  79. General Settings - Advertisement - Text
546
  80. General Settings - Advertisement - Image
547
- 81. Shortcodes - Thumbnail Gallery Layout
548
- 82. Shortcodes - Masonry Gallery Layout
549
- 83. Shortcodes - Slideshow Gallery Layout
550
- 84. Shortcodes - Image Browser Gallery Layout
551
- 85. Shortcodes - Justified Grid Gallery Layout
552
- 86. Shortcodes - Blog Style Gallery Layout
553
  87. Other Settings
554
  88. Roles & Capabilities
555
  89. Feature Requests
@@ -557,26 +362,34 @@ is False in shortcode.
557
 
558
  == Changelog ==
559
 
 
 
 
 
 
 
 
 
560
  = 4.0.3 =
561
 
562
- * FIX: Lightbox Bugs Fixed in Image Gallery
563
- * FIX: Code Optimized
564
- * FIX: Obsolete Code Removed
565
- * FIX: Headers Output Bug Fixed
566
 
567
  = 4.0.2 =
568
 
569
- * FIX: Lightbox Bug Fixed in Image Gallery
570
  * TWEAK: New Lightbox Option Added
571
- * FIX: Code Optimized
572
 
573
  = 4.0.1 =
574
 
575
- * FIX: Obsolete Code Removed
576
- * FIX: Major Bugs Fixed
577
- * FIX: Install Script Code Optimized
578
- * FIX: Wizard Page Error Fixed
579
- * FIX: Code Optimized
580
 
581
  = 4.0.0 =
582
 
@@ -591,1205 +404,1081 @@ is False in shortcode.
591
  * TWEAK: Obsolete Code Deleted
592
  * TWEAK: CSS Improved
593
 
 
594
  = 3.1.40 =
595
 
596
- * FIX: Obsolete Code Removed
597
- * FIX: Proper Sanitization, Escaping, Validation of all Post Calls
598
- * FIX: Obsolete Code Removed
599
- * FIX: Code Optimized
600
 
601
  = 3.1.39 =
602
 
603
- * FIX: Obsolete Code Removed
604
- * FIX: Code Optimized
605
 
606
  = 3.1.37 =
607
 
608
- * FIX: Proper Sanitization, Escaping, Validation of all Post Calls
609
- * FIX: Removal of all function_exists, class_exists, typeof from all the files.
610
- * FIX: Uninstall File moved to root folder and changes done as per wordpress guidelines.
611
- * FIX: Error Reporting in file Removed
612
- * FIX: Auto Updates Removed
613
- * FIX: Curl Calls Removed
614
 
615
  = 3.1.36 =
616
 
617
- * Error Reporting Added
618
- * Responsive Layouts Fixed
619
 
620
  = 3.1.35 =
621
 
622
- * Major Bugs Fixed
623
- * Wizard Page Added
624
 
625
  = 3.1.34 =
626
 
627
- * Major Bugs Fixed
628
- * Responsive Layouts Fixed
629
 
630
  = 3.1.33 =
631
 
632
- * Major Bugs Fixed
633
- * Ini Default Values Set
634
- * Compatibility with 4.7.3
635
 
636
  = 3.1.32 =
637
 
638
- * Translation Files Updated
639
- * Translation Constant Bug Fixed
640
 
641
  = 3.1.31 =
642
 
643
- * Obsolete Code removed
644
- * Unused Files removed
645
- * Code Optimized
646
- * Translation File Updated
647
 
648
  = 3.1.30 =
649
 
650
- * Major Bug Fixed Related to Re-generate of Thumbnails on Edit Album
651
 
652
  = 3.1.29 =
653
 
654
- * Major Bug Fixed Related to Function Undefined in Header File.
655
 
656
  = 3.1.28 =
657
 
658
- * Improved Functionality
659
- * Few Bugs Fixed
660
 
661
  = 3.1.27 =
662
 
663
- * Security Patch
664
- * Few Bugs Fixed
665
 
666
  = 3.1.26 =
667
 
668
- * Compatibility with 4.6
669
- * Code Optimized
670
- * Few Bugs Fixed
671
 
672
  = 3.1.25 =
673
 
674
- * Code Optimized
675
- * Few Bugs Fixed
676
 
677
  = 3.1.24 =
678
 
679
- * Tooltip Renamed
680
- * Few Bugs Fixed
681
 
682
  = 3.1.23 =
683
 
684
- * Code Optimized
685
- * Few Bugs Fixed
686
 
687
  = 3.1.22 =
688
 
689
- * Major Cross Site Scripting Security Issue Fix
690
- * Few Bugs Fixed
691
-
692
- = 3.1.21 =
693
-
694
- * Few Bugs Fixed
695
 
696
  = 3.1.20 =
697
 
698
- * Strings Updated
699
- * Few Bugs Fixed
700
- * Pricing Table Changed
701
- * Code Optimized
702
 
703
  = 3.1.19 =
704
 
705
- * Header Section Updated
706
- * Few Bugs Fixed
707
- * Other Services Content Updated
708
- * Pricing Table Changed
709
-
710
- = 3.1.18 =
711
-
712
- * Few Bugs Fixed
713
 
714
  = 3.1.17 =
715
 
716
- * Other Services Content Updated
717
- * Pricing Table Changed
718
 
719
  = 3.1.16 =
720
 
721
- * Few CSS Bugs Fixed
722
- * Pricing Table Changed
723
 
724
  = 3.1.15 =
725
 
726
- * Compatibility with 4.5.3
727
 
728
  = 3.1.14 =
729
 
730
- * Few CSS Bugs Fixed
731
 
732
  = 3.1.13 =
733
 
734
- * Few Bugs Fixed
735
- * Code Optimized
736
-
737
- = 3.1.12 =
738
-
739
- * Few Bugs Fixed
740
- * Code Optimized
741
-
742
- = 3.1.11 =
743
-
744
- * Few Bugs Fixed
745
- * Code Optimized
746
-
747
- = 3.1.10 =
748
-
749
- * Few Bugs Fixed
750
 
751
  = 3.1.9 =
752
 
753
- * Compatibility with 4.5.2
754
 
755
  = 3.1.8 =
756
 
757
- * Few CSS Bugs Fixed
758
 
759
  = 3.1.7 =
760
 
761
- * Compatibility with 4.5.1
762
- * Few CSS Bugs Fixed
763
 
764
  = 3.1.6 =
765
 
766
- * Compatibility with 4.5
767
 
768
  = 3.1.5 =
769
 
770
- * Few CSS Bugs Fixed
771
-
772
- = 3.1.4 =
773
-
774
- * Few Bugs Fixed
775
- * Code Optimized
776
-
777
- = 3.1.3 =
778
-
779
- * Few Bugs Fixed
780
-
781
- = 3.1.2 =
782
-
783
- * Few Bugs Fixed
784
- * Code Optimized
785
 
786
  = 3.1.1 =
787
 
788
- * Database Issues Fixed
789
- * Code Optimized
790
 
791
  = 3.1.0 =
792
 
793
- * Major Version Release
794
- * Code Optimized
795
- * Fixed Major Bugs
796
- * Fixed Lightbox Issues
797
- * Fixed Masonry Gallery Layout Issues
798
- * Removed Font Icons and Replaced with Compatible Icons
799
- * Persian Language Added
800
 
801
  = 3.0.456 =
802
 
803
- * Few Urgent Bugs Fixed.
804
 
805
  = 3.0.455 =
806
 
807
- * Few Minor Bugs Fixed.
808
 
809
  = 3.0.454 =
810
 
811
- * Compatibility with 4.4.2
812
 
813
  = 3.0.453 =
814
 
815
- * Few Urgent Bugs Fixed.
816
 
817
  = 3.0.452 =
818
 
819
- * Few CSS Bugs Fixed.
820
 
821
  = 3.0.451 =
822
 
823
- * Compatibility with 4.4.1
824
 
825
  = 3.0.450 =
826
 
827
- * Few CSS Bugs Fixed.
828
 
829
  = 3.0.449 =
830
 
831
- * Few Urgent Bugs Fixed.
832
 
833
  = 3.0.448 =
834
 
835
- * Few Urgent Bugs Fixed.
836
 
837
  = 3.0.447 =
838
 
839
- * Compatibility with 4.4
840
 
841
  = 3.0.446 =
842
 
843
- * Few CSS Bugs Fixed.
844
 
845
  = 3.0.445 =
846
 
847
- * Few CSS Bugs Fixed.
848
 
849
  = 3.0.444 =
850
 
851
- * Few Urgent Bugs Fixed.
852
 
853
  = 3.0.343 =
854
 
855
- * Few Minor Bugs Fixed.
856
 
857
  = 3.0.442 =
858
 
859
- * Few CSS Bugs Fixed.
860
 
861
  = 3.0.441 =
862
 
863
- * Few Urgent Bugs Fixed.
864
 
865
  = 3.0.340 =
866
 
867
- * Few Minor Bugs Fixed.
868
 
869
  = 3.0.339 =
870
 
871
- * Few Urgent Bugs Fixed.
872
 
873
  = 3.0.338 =
874
 
875
- * Database Engine updated.
876
 
877
  = 3.0.337 =
878
 
879
- * Few Urgent Bugs Fixed.
880
 
881
  = 3.0.336 =
882
 
883
- * Few Minor Bugs Fixed.
884
 
885
  = 3.0.335 =
886
 
887
- * Few Minor Bugs Fixed.
888
 
889
  = 3.0.334 =
890
 
891
- * Album Description Shown under Album Title
892
 
893
  = 3.0.333 =
894
 
895
- * Few Urgent Bugs Fixed.
896
 
897
  = 3.0.332 =
898
 
899
- * Delete Image Bug Fixed.
900
 
901
  = 3.0.331 =
902
 
903
- * Pretty Photo Title & Description Bug Fixed.
904
 
905
  = 3.0.330 =
906
 
907
- * Few 1ecurity Issues Fixed.
908
- * Isotope 2.2.2 Version used.
909
 
910
  = 3.0.229 =
911
 
912
- * Compatibility with 4.3
913
- * Changed variables to avoid confliction with Next Gen and Contact Bank plugins.
914
- * Prettyphoto XSS Security Issue Fixed.
915
 
916
  = 3.0.228 =
917
 
918
- * Few Minor Bugs Fixed
919
 
920
  = 3.0.227 =
921
 
922
- * Compatibility with 4.2.4
923
 
924
  = 3.0.226 =
925
 
926
- * Few Minor Bugs Fixed
927
 
928
  = 3.0.225 =
929
 
930
- * Compatibility with 4.2.3
931
 
932
  = 3.0.224 =
933
 
934
- * Auto Update Bug Fixed
935
 
936
  = 3.0.223 =
937
 
938
- * Few Minor Bugs Fixed
939
 
940
  = 3.0.222 =
941
 
942
- * Few Urgent Bugs Fixed
943
 
944
  = 3.0.221 =
945
 
946
- * Minor bugs fixed.
947
- * Premium Editions Section Updated.
948
 
949
  = 3.0.120 =
950
 
951
- * Major Bugs Fixed Regarding Rss Feeds.
952
 
953
  = 3.0.119 =
954
 
955
- * Few Urgent Bugs Fixed
956
 
957
  = 3.0.118 =
958
 
959
- * Few Languages Updated
960
- * Minor Css Bugs Fixed
961
-
962
- = 3.0.117 =
963
-
964
- * Few Bugs Fixed
965
 
966
  = 3.0.116 =
967
 
968
- * Few Languages Updated
969
- * Minor Css Bugs Fixed
970
 
971
  = 3.0.115 =
972
 
973
- * Added Compatibility with 4.2.2 WordPress.
974
 
975
  = 3.0.114 =
976
 
977
- * Added Compatibility with 4.2.1 WordPress.
978
- * Fixed Few Minor Bugs
979
 
980
  = 3.0.113 =
981
 
982
- * Added Compatibility with 4.2 WordPress.
983
- * Fixed Few Minor Bugs
984
 
985
  = 3.0.112 =
986
 
987
- * Added Compatibility with 4.1.2 WordPress.
988
 
989
  = 3.0.111 =
990
 
991
- * Few Bug fixed.
992
- * Languages Updated.
993
 
994
  = 3.0.10 =
995
 
996
- * Bug fixed related to datatables.
997
 
998
  = 3.0.109 =
999
 
1000
- * Implemented new feature of calculating images size according server configuration.
1001
- * Minor bugs fixed.
1002
 
1003
  = 3.0.108 =
1004
 
1005
- * Minor bugs fixed.
1006
 
1007
  = 3.0.107 =
1008
 
1009
- * Minor bugs fixed.
1010
- * Premium Editions Section Updated.
1011
 
1012
  = 3.0.106 =
1013
 
1014
- * Minor Bugs Fixed.
1015
- * Other Services Section Updated.
1016
- * Premium Editions Section Updated.
1017
 
1018
  = 3.0.105 =
1019
 
1020
- * Demo Gallery added by default.
1021
 
1022
  = 3.0.104 =
1023
 
1024
- * Default Shortcode Layout changed from Masonry to Thumbnails.
1025
 
1026
  = 3.0.103 =
1027
 
1028
- * Added new feature of Feature Request.
1029
- * Shortcode Editor Redesigned.
1030
 
1031
  = 3.0.102 =
1032
 
1033
- * Minor Vulnerability Bug fixed related to shortcode as pointed by Goblin Research.
1034
 
1035
  = 3.0.101 =
1036
 
1037
- * Major bug fixed related to uploader.
1038
 
1039
  = 3.0.100 =
1040
 
1041
- * Implemented New Feature to display selected Albums.
1042
 
1043
  = 3.0.99 =
1044
 
1045
- * Korean Language Updated.
1046
- * Udpated Po & Mo Files for all Languages.
1047
- * Added New Languages
1048
 
1049
  = 3.0.98 =
1050
 
1051
- * Recommendation section updated.
1052
 
1053
  = 3.0.97 =
1054
 
1055
- * Fixed compatibility issue with WP Lightbox 2 Plugin.
1056
 
1057
  = 3.0.96 =
1058
 
1059
- * Fixed compatibility issue with woocommerce plugin.
1060
- * Fixed Layout issues.
1061
- * Fixed whitespacing issue.
1062
- * Unset plugin update scheduler on plugin uninstall.
1063
 
1064
  = 3.0.95 =
1065
 
1066
- * Fixed Major Bug Related to PL Uploader.
1067
- * Fixed Code for Plugins using Versions prior to 4.0
1068
 
1069
  = 3.0.94 =
1070
 
1071
- * Fixed Few Bugs
1072
- * Fixed Menus
1073
- * Implemented New Feature - Automatic Gallery Bank Plugin Update Enable/Disable.
1074
 
1075
  = 3.0.93 =
1076
 
1077
- * Removed unwanted code
1078
- * New Uploader Introduced.
1079
- * New Layout Introduced for uploader.
1080
- * Thumbs View in Uploader.
1081
- * Add, Edit Gallery Layout changed.
1082
- * Updated JS files.
1083
- * Slovenian Language updated.
1084
-
1085
- = 3.0.92 =
1086
-
1087
- * Few Bugs Fixed
1088
 
1089
  = 3.0.91 =
1090
 
1091
- * Recommendation section updated.
1092
- * Japanese Language updated.
1093
 
1094
  = 3.0.90 =
1095
 
1096
- * Major security bug fixed regarding image uploader.
1097
 
1098
  = 3.0.89 =
1099
 
1100
- * Pretty Photo lightbox license updated.
1101
 
1102
  = 3.0.88 =
1103
 
1104
- * Pricing Changed
1105
-
1106
- = 3.0.87 =
1107
-
1108
- * Few Bugs Fixed
1109
 
1110
  = 3.0.86 =
1111
 
1112
- * Added Compatibility with 4.1 WordPress.
1113
- * Fixed Bugs Related to Galleries Display.
1114
 
1115
  = 3.0.85 =
1116
 
1117
- * Changed variables to avoid confliction with other plugins.
1118
 
1119
  = 3.0.84 =
1120
 
1121
- * Minor Bugs Fixed Related to Galleries Display
1122
 
1123
  = 3.0.83 =
1124
 
1125
- * Added Update Message for New Versions.
1126
 
1127
  = 3.0.82 =
1128
 
1129
- * Major Bug Fixed Related to Multisite Wordpress.
1130
 
1131
  = 3.0.81 =
1132
 
1133
- * Multisite Compatibility Added.
1134
- * Added Compatibility with 4.0.1 WordPress
1135
- * Updated Pricing Table
1136
 
1137
  = 3.0.80 =
1138
 
1139
- * Conflict with JetPack discovered & fixed.
1140
- * Optimized Code
1141
 
1142
  = 3.0.79 =
1143
 
1144
- * Udpated Po & Mo Files for all Languages
1145
- * Updated Css Fixes
1146
- * Optimized Code
1147
 
1148
  = 3.0.78 =
1149
 
1150
- * Udpated Po & Mo Files
1151
- * Updated Css Fixes
1152
- * Updated Our Services Section
1153
- * Optimized Code
1154
- * Removed unwanted Files
1155
 
1156
  = 3.0.76 =
1157
 
1158
- * CSS Conflictions Fixed after 3.0.75 update
1159
- * Js Conflictions Fixed
1160
- * Readme.txt Updated
1161
 
1162
  = 3.0.75 =
1163
 
1164
- * Demo Links Updated as per New Website
1165
- * Readme.txt Changed as per New Website
1166
- * Recommended Section Added
1167
- * Other Services Section Added
1168
- * Pricing Section Updated
1169
- * Major Release before 4.0 update
1170
 
1171
 
1172
  = 3.0.75 =
1173
 
1174
- * Masonry Colum Width Bug Fixed
1175
- * Overlapping Masonry Gallery Layout Fixed
1176
 
1177
  = 3.0.74 =
1178
 
1179
- * Banner Updated
1180
 
1181
  = 3.0.73 =
1182
 
1183
- * Banner Updated
1184
 
1185
  = 3.0.72 =
1186
 
1187
- * Danish Language Updated
1188
- * Banner Updated
1189
 
1190
  = 3.0.71 =
1191
 
1192
- * Banner Updated
1193
 
1194
  = 3.0.70 =
1195
 
1196
- * Major Security Bug XSS Vulnerability Fixed related to Album Sorting
1197
 
1198
  = 3.0.69 =
1199
 
1200
- * Updated Existing Language - Romanian
1201
- * Updated Existing Language - Indonesian
1202
- * Roles Bugs Fixed
1203
 
1204
  = 3.0.68 =
1205
 
1206
- * Added New Language - Croatian
1207
- * Added New Language - Norwegian
1208
- * Banner Updated
1209
 
1210
  = 3.0.67 =
1211
 
1212
- * Added New Language - Greek
1213
- * Updated Existing Language - Indonesian
1214
 
1215
  = 3.0.66 =
1216
 
1217
- * Compatibility Test with 4.0
1218
- * Few Bugs Fixed
1219
- * Banner Updated
1220
 
1221
  = 3.0.65 =
1222
 
1223
- * Few Bugs Fixed
1224
- * Banner Updated
1225
 
1226
  = 3.0.64 =
1227
 
1228
- * Few Bugs Fixed
1229
- * Banner Updated
1230
 
1231
  = 3.0.63 =
1232
 
1233
- * Major Security Bug Fixed
1234
 
1235
  = 3.0.62 =
1236
 
1237
- * Few Bugs Fixed
1238
- * Banner Updated
1239
 
1240
  = 3.0.61 =
1241
 
1242
- * Major Security Bug Fixed related to Upload.php file
1243
-
1244
- = 3.0.60 =
1245
-
1246
- * Few Bugs Fixed
1247
 
1248
  = 3.0.59 =
1249
 
1250
- * Chinese Language Updated
1251
-
1252
- = 3.0.58 =
1253
-
1254
- * Few Bugs Fixed
1255
-
1256
- = 3.0.57 =
1257
-
1258
- * Few Bugs Fixed
1259
 
1260
  = 3.0.56 =
1261
 
1262
- * Slovak Language Updated
1263
-
1264
- = 3.0.55 =
1265
-
1266
- * Few Bugs Fixed
1267
 
1268
  = 3.0.54 =
1269
 
1270
- * Few Bugs Fixed
1271
- * Few Possible Security Issues Addressed
1272
 
1273
  = 3.0.53 =
1274
 
1275
- * Language Bug Fixed
1276
 
1277
  = 3.0.52 =
1278
 
1279
- * Danish Language Updated
1280
 
1281
  = 3.0.51 =
1282
 
1283
- * Social Icons Added to Lightbox
1284
 
1285
  = 3.0.50 =
1286
 
1287
- * Few Possible Security Issues Addressed
1288
 
1289
  = 3.0.49 =
1290
 
1291
- * Polish Language Updated
1292
 
1293
  = 3.0.48 =
1294
 
1295
- * Czech Language Updated
1296
 
1297
  = 3.0.47 =
1298
 
1299
- * Advanced Security for Plugin Implemented
1300
 
1301
  = 3.0.46 =
1302
 
1303
- * Hungarian Language Updated
1304
 
1305
  = 3.0.45 =
1306
 
1307
- * Few Bugs Fixed
1308
- * Banner Updated
1309
 
1310
  = 3.0.44 =
1311
 
1312
- * Arabic Language Updated
1313
 
1314
  = 3.0.43 =
1315
 
1316
- * Few Bugs Fixed
1317
- * Banner Updated
1318
 
1319
  = 3.0.42 =
1320
 
1321
- * Thai Language Updated
1322
 
1323
  = 3.0.41 =
1324
 
1325
- * Few Bugs Fixed
1326
- * Banner Updated
1327
 
1328
  = 3.0.40 =
1329
 
1330
- * Bug Fixed with Menu Links shown to Subscriber and other roles.
1331
 
1332
  = 3.0.39 =
1333
 
1334
- * Russian Language Updated
1335
 
1336
  = 3.0.38 =
1337
 
1338
- * Few Bugs Fixed
1339
- * Banner Updated
1340
 
1341
  = 3.0.37 =
1342
 
1343
- * Major Bug Fixed related to Saving of Images
1344
- * Major Bug Fixed related to Editing of existing Albums
1345
 
1346
  = 3.0.36 =
1347
 
1348
- * Bug Fixed related to Saving of Albums
1349
 
1350
  = 3.0.35 =
1351
 
1352
- * Major Security Bug Fixed related to Upload.php file
1353
 
1354
  = 3.0.34 =
1355
 
1356
- * Bugs Fixed Related to Set as Album
1357
 
1358
  = 3.0.33 =
1359
 
1360
- * Few Bugs Fixed
1361
- * Broken Add New Album Link Fixed
1362
 
1363
  = 3.0.32 =
1364
 
1365
- * Major Bug fixed with saving of Data
1366
 
1367
  = 3.0.31 =
1368
 
1369
- * Few Bugs Fixed
1370
- * Unwanted Banners Removed
1371
 
1372
  = 3.0.30 =
1373
 
1374
- * Turkish Language Updated
1375
- * Delete Images Bug Fixed
1376
 
1377
  = 3.0.29 =
1378
 
1379
- * Few Bugs Fixed
1380
- * Added Functionality to support Bulk Images Upload
1381
 
1382
  = 3.0.28 =
1383
 
1384
- * Few Bugs Fixed
1385
- * CK Editor Compatibility Added
1386
 
1387
  = 3.0.27 =
1388
 
1389
- * Few Bugs Fixed
1390
- * Unwanted Banners Removed
1391
 
1392
  = 3.0.26 =
1393
 
1394
- * New Language ADDED - Belarusian
1395
- * Language Updated - Russian
1396
 
1397
  = 3.0.25 =
1398
 
1399
- * Languages Updated
1400
 
1401
  = 3.0.24 =
1402
 
1403
- * Banner Updated
1404
 
1405
  = 3.0.23 =
1406
 
1407
- * Licenses Updated
1408
 
1409
  = 3.0.22 =
1410
 
1411
- * Png Image Bug Fixed
1412
- * Language Updated - Hebrew
1413
 
1414
  = 3.0.21 =
1415
 
1416
- * New Layout Introduced
1417
- * Help Video Added
1418
- * Bugs Fixed with Title & Description
1419
- * Compatibility with 3.9
1420
- * Language Updated - Finnish
1421
 
1422
  = 3.0.20 =
1423
 
1424
- * Bugs Fixed
1425
- * Compatibility with 3.9
1426
 
1427
  = 3.0.19 =
1428
 
1429
- * Language Updated - Finnish
1430
 
1431
  = 3.0.18 =
1432
 
1433
- * New Help Popup Introduced
1434
- * Compatiblity with 3.8.3
1435
 
1436
  = 3.0.17 =
1437
 
1438
- * Language Updated - German
1439
 
1440
  = 3.0.16 =
1441
 
1442
- * Language Updated - Italian
1443
 
1444
  = 3.0.15 =
1445
 
1446
- * New Language Added - Estonian
1447
 
1448
  = 3.0.14 =
1449
 
1450
- * Language Updated - Portuguese
1451
 
1452
  = 3.0.13 =
1453
 
1454
- * Language Updated - French
1455
 
1456
  = 3.0.12 =
1457
 
1458
- * Language Updated - Swedish
1459
 
1460
  = 3.0.11 =
1461
 
1462
- * Few Bugs Fixed
1463
- * Removed Unwated Banners
1464
 
1465
  = 3.0.10 =
1466
 
1467
- * Few Bugs Fixed
1468
- * New Language Added - Ukrainian
1469
-
1470
- = 3.0.9 =
1471
-
1472
- * Few Bugs Fixed
1473
 
1474
  = 3.0.8 =
1475
 
1476
- * Dutch Language Updated
1477
- * Uninstall Hook Removed
1478
 
1479
  = 3.0.7 =
1480
 
1481
- * Updated Languages
1482
- * Bug Fixed Related to Pl Uploader which stops WP Media
1483
 
1484
  = 3.0.6 =
1485
 
1486
- * Updated Languages
1487
- * Fixed Few Bugs Related to Lightbox
1488
- * Request for Translation of New Languages
1489
 
1490
  = 3.0.5 =
1491
 
1492
- * Updated Languages
1493
- * Fixed Few Bugs Related to Lightbox
1494
- * Checked If Permissions are Set to Directory
1495
 
1496
  = 3.0.4 =
1497
 
1498
- * Updated Languages
1499
- * Fixed Few Bugs Related to Thumbnails generation
1500
- * Fixed Copy Images for existing albums to new folder
1501
- * Fixed Problem of loosing images when upgrading to latest versions.
1502
 
1503
  = 3.0.3 =
1504
 
1505
- * Updated Spanish Languages
1506
- * Fixed Few Bugs Related to Thumbnails generation
1507
- * Removed unwanted stuff
1508
 
1509
  = 3.0.2 =
1510
 
1511
- * Updated all Languages
1512
- * Fixed Few Bugs Related to Thumbnails
1513
- * Added Warning Permissions Message for Thumbnails
1514
 
1515
  = 3.0.1 =
1516
 
1517
- * Updated all Languages
1518
- * Fixed Few Bugs Related to Database Upgrade from Previous versions
1519
- * Add New Page to show how to add Shortcodes.
1520
 
1521
  = 3.0.0 =
1522
 
1523
- * Major Release
1524
- * New Feature : Images are now being saved in Gallery Bank itself instead of WP Uploads.
1525
- * New Feature : Thumbs are now created by the system itself rather than any 3rd Party script like Timbthumb etc.
1526
- * New Feature : Improved Performance
1527
- * New Feature : Improved Database to manage Gallery Bank
1528
- * New Feature : Indexing on Tables to grab results quickly
1529
- * New Feature : Highly Optimized Code
1530
- * New Feature : Responsive Layout
1531
- * New Feature : Easily adaptable environment for any device.
1532
- * New Feature : Bulk Upload of Images
1533
- * New Feature : New Short-code Wizard
1534
- * New Feature : Url Redirect to redirect on click of an image.
1535
- * New Feature : Compact Albums
1536
- * New Feature : Extended Albums
1537
- * New Feature : Basic Thumbnail Gallery
1538
- * New Feature : Masonry Gallery
1539
- * New Feature : List Album Format
1540
- * New Feature : Grid Album Format
1541
- * New Feature : Images in Row for displaying number of images per row
1542
- * New Feature : Albums in Row for displaying number of albums per row
1543
- * New Feature : Albums in Row for displaying number of albums per row
1544
- * New Feature : Filmstrip Gallery Format(Premium Versions)
1545
- * New Feature : Slideshow Gallery(Premium Versions)
1546
- * New Feature : Special Effects on Images & Albums(Premium Versions)
1547
- * New Feature : Animation Effects on Images & Albums(Premium Versions)
1548
- * New Feature : Bulk Deletion of Images(Premium Versions)
1549
- * New Feature : Sorting of Images(Premium Versions)
1550
- * New Feature : Sorting of Albums(Premium Versions)
1551
- * New Feature : Social Sharing(Premium Versions)
1552
- * New Feature : Commenting on Images(Premium Versions)
1553
- * New Feature : Widgets(Premium Versions)
1554
- * New Feature : Tags for each Image to make Filerable Gallery Album(Premium Versions)
1555
- * New Feature : Bulk Deletion of Albums(Premium Versions)
1556
- * New Feature : Purging Albums and Images(Premium Versions)
1557
- * New Feature : Restore Factory Settings(Premium Versions)
1558
- * New Feature : Global Settings(Premium Versions)
1559
- * New Feature : Thumbnail Settings(Premium Versions)
1560
- * New Feature : Album Settings(Premium Versions)
1561
- * New Feature : Lightbox Settings(Premium Versions)
1562
- * New Feature : Different Lightboxes like FooBox,ColorBox,FancyBox2,Lightbox2,Custom GB Lightbox,Pretty Photo(Premium Versions)
1563
- * New Feature : Pagination(Premium Versions)
1564
- * New Feature : Filter Settings(Premium Versions)
1565
- * New Feature : Roles & Capabilities(Premium Versions)
1566
- * Bugs Fixed : Wrong images displayed when videos added.
1567
 
1568
  = 2.0.26 =
1569
 
1570
- * Minor Database update before Major Version Release
1571
 
1572
  = 2.0.25 =
1573
 
1574
- * Fixed few issues with Wordpress 3.8.1 compatibility
1575
 
1576
  = 2.0.24 =
1577
 
1578
- * Fixed Bugs Related to Front View
1579
- * Fixed Bugs Related to Front View Albums
1580
- * Fixed Bugs Related to Front View Albums with Images
1581
- * Fixed Bugs Related to Css Display
1582
- * Lightbox Updated
1583
 
1584
  = 2.0.23 =
1585
 
1586
- * Fixed few issues with Wordpress 3.8 compatibility
1587
 
1588
  = 2.0.22 =
1589
 
1590
- * Option Added to Gather Data for Testing Purposes for Better Compatibility
1591
-
1592
- = 2.0.21 =
1593
-
1594
- * Few Bugs Fixed
1595
 
1596
  = 2.0.20 =
1597
 
1598
- * Few Bugs Fixed
1599
- * Fixed Security Issues
1600
- * Fixed Cross Scripting Issues
1601
- * Compatibility with 3.7
1602
 
1603
  = 2.0.19 =
1604
 
1605
- * Few Bugs Fixed
1606
- * Introducing Jquery Masonry
1607
- * Removed Timbthumb
1608
-
1609
- = 2.0.18 =
1610
-
1611
- * Few Bugs Fixed
1612
-
1613
- = 2.0.17 =
1614
-
1615
- * Few Bugs Fixed
1616
 
1617
  = 2.0.16 =
1618
 
1619
- * Languages Updated
1620
 
1621
  = 2.0.15 =
1622
 
1623
- * Fixed Bugs with Saving Albums
1624
 
1625
  = 2.0.14 =
1626
 
1627
- * Introducing Videos in Gallery Bank
1628
- * Fixed Bugs with Thumbnails
1629
- * Fixed Bugs related to Timbthumb
1630
-
1631
- = 2.0.13 =
1632
-
1633
- * Few Bugs Fixed
1634
-
1635
- = 2.0.12 =
1636
-
1637
- * Few Bugs Fixed
1638
 
1639
  = 2.0.11 =
1640
 
1641
- * Fixed Bug Related to Description of Images in Internet Explorer
1642
 
1643
  = 2.0.9 =
1644
 
1645
- * Fixed Bug Related to Menus visible to Users other than Administrator
1646
 
1647
  = 2.0.8 =
1648
 
1649
- * Few Bugs Fixed
1650
- * Languages Updated
1651
 
1652
  = 2.0.7 =
1653
 
1654
- * Plugin Confliction with JetPack Fixed
1655
- * Languages Updated
1656
 
1657
  = 2.0.6 =
1658
 
1659
- * Documentation Updated
1660
- * Languages Updated
1661
- * CSS Conflicts fixed
1662
 
1663
  = 2.0.5 =
1664
 
1665
- * New Functionality Introduced
1666
- * Documentation Added
1667
- * Js Conflicts fixed
1668
 
1669
  = 2.0.4 =
1670
 
1671
- * Plugin Update Conflicts Fixed
1672
- * Browser Conflicts Fixed
1673
- * Js Conflicts fixed
1674
 
1675
  = 2.0.3 =
1676
 
1677
- * Plugin Update Conflicts Fixed
1678
 
1679
  = 2.0.2 =
1680
 
1681
- * CSS Conflicts Fixed
1682
- * Layout Break in sites fixed
1683
- * Thumbnails Issue fixed
1684
- * Languages updated
1685
 
1686
  = 2.0.1 =
1687
 
1688
- * CSS Conflicts Fixed
1689
  * Timbthumb 2.8.11 Updated
1690
 
1691
  = 2.0.0 =
1692
 
1693
- * Introduction of New Version 2.0
1694
- * Introduction of Pagination for Images
1695
- * Bulk Delete of Images in Album
1696
- * General Settings for all Albums
1697
- * Individual Settings for Album
1698
- * New Design & Style
1699
 
1700
  = 1.8.7 =
1701
 
1702
- * Timbthumb Thumbnails Issue fixed.
1703
 
1704
  = 1.8.6 =
1705
 
1706
- * Readme.txt Updated
1707
- * Languages Updated
1708
 
1709
  = 1.8.5 =
1710
 
1711
- * Timbthumb Quality Issues Fixed
1712
- * Formatting Issue Resolved
1713
 
1714
  = 1.8.4 =
1715
 
1716
- * Introduced Sorting of Images in an Album
1717
- * Album Formatting conflict resolved
1718
 
1719
  = 1.8.3 =
1720
 
1721
- * Introduced Timthumb for Thumbnails
1722
- * Title Alignment - Fixed.
1723
- * Thumbnails were disorted - Fixed.
1724
 
1725
  = 1.8.2 =
1726
 
1727
- * Title Name on Front View & Albums were incorrect - Fixed.
1728
- * Title Alignment - Fixed.
1729
- * Thumbnails were disorted -Fixed.
1730
 
1731
  = 1.8.1 =
1732
 
1733
- * Titles were not saved properly
1734
- * Few Bugs solved.
1735
 
1736
  = 1.8.0 =
1737
 
1738
- * Added 7 new Languages.
1739
 
1740
  = 1.7.9 =
1741
 
1742
- * Bugs fixed with Saving Logic.
1743
 
1744
  = 1.7.8 =
1745
 
1746
- * Bugs fixed with Album creation.
1747
 
1748
  = 1.7.5 =
1749
 
1750
- * Possible to upload upto 300 images at 1 instance in a n album
1751
- * Few Bugs fixed.
1752
- * All Languages updated
1753
 
1754
  = 1.7 =
1755
 
1756
- * Introducing Jquery Masonry
1757
- * Uninstall Hook Removed
1758
 
1759
  = 1.6 =
1760
 
1761
- * Bug of Thumbnail Disorted Images fixed
1762
- * Bug of No Album images shown in case of admin not logged in fixed.
1763
- * Uninstall Hook Removed
1764
 
1765
  = 1.5 =
1766
 
1767
- * Album Covers Introduced
1768
- * Css Conflicts Fixed
1769
- * All Translations Updated
1770
 
1771
  = 1.4 =
1772
 
1773
- * Few Bugs Fixed
1774
- * Css Conflicts Fixed
1775
- * Languages Added Russian, Cezch, Hebrew & Serbian
1776
 
1777
  = 1.3 =
1778
 
1779
- * Few Bugs Fixed
1780
- * Css Conflicts Fixed
1781
- * Languages Updated
1782
 
1783
  = 1.2 =
1784
 
1785
- * Few Bugs Fixed in Gallery Bank
1786
- * Lightbox logic changed
1787
- * Thumbnails Fixed
1788
-
1789
- = 1.1 =
1790
-
1791
- * Few Bugs Fixed in Gallery Bank
1792
 
1793
  = 1.0 =
1794
 
1795
- * Initial Version Release
1
+ === Responsive Gallery Plugin - Photo Gallery - Image Gallery - Photo Albums ===
2
  Contributors: Gallery-Bank, contact-banker
3
+ Tags: gallery, portfolio, album, images, photo gallery, photo album, image gallery, wordpress gallery, wordpress gallery plugin, gallery widget, masonry, responsive gallery, media gallery
4
  Requires at least: 3.4
5
  Tested up to: 4.8
6
  Stable Tag: trunk
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
10
+ Photo Gallery Plugin for WordPress can be used to create a gallery widget, image gallery, media gallery album, portfolio gallery and photo album.
11
 
12
  == Description ==
13
 
14
+ = Best WordPress Gallery Plugin & WordPress Portfolio Plugin =
15
+
16
+ * [Gallery Bank](https://gallery-bank.tech-banker.com/)
17
+ * [Detailed Features](http://gallery-bank.tech-banker.com/features/detailed-features/)
18
+ * [Front End Demos](https://gallery-bank.tech-banker.com/frontend-demos/)
19
+ * [Back End Demos](https://gallery-bank.tech-banker.com/backend-demos/)
20
+ * [Documentation](https://gallery-bank.tech-banker.com/documentation/)
21
+ * [Upgrade to Premium Editions](https://gallery-bank.tech-banker.com/pricing/)
22
+
23
+ [**WordPress Photo Gallery Plugin**](https://gallery-bank.tech-banker.com/) is one of the Best WordPress Gallery Plugin designed to create elegant and beautiful **photo gallery** and **photo albums** using **Masonry Gallery Layouts**, **Thumbnail Gallery Layouts**, **Compact Album Layouts** and **Extended Album Layouts** along with Special Effects and Animation Effects.
24
+
25
+ **WordPress Photo Gallery Plugin** is the only available WordPress Gallery Shortcode Plugin in the market with extra-ordinary features. It is loaded with 200+ features and you can create stunning albums, photo gallery, portfolio gallery on any of your WordPress site/blog.
26
+
27
+ **WordPress Photo Gallery Plugin** provides a powerful photo gallery engine for uploading and managing photo albums of images, with the ability to batch upload, delete, rearrange and sort images.
28
+
29
+ It is the best gallery plugin for wordpress is being regularly updated for new features and its simplicity of usage along with efficient functionality makes it a perfect choice among photographers to have a stunning look for their sites.
30
+
31
+ There are also Premium Editions for the gallery plugin for wordpress with much more useful pro features available.
32
+
33
+ Gallery Bank uses [FooBox Lightbox](https://wordpress.org/plugins/foobox-image-lightbox/) as its default gallery Lightbox in Lite Edition as it is licensed under GPL V2 or later.
34
+
35
+ FooBox was the first lightbox to take responsive layout seriously. Not only does it scale images to look better on phones, but it rearranges it�s button controls to look great in both portrait or landscape orientation.
36
+
37
+ > #### **Live Demos - WordPress Photo Gallery Plugin**
38
+
39
+ * [Thumbnail Gallery](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-thumbnail-layout/)
40
+ * [Thumbnail Gallery with WordPress Gallery Lightbox](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lightboxes-thumbnail-layout/)
41
+ * [Thumbnail Gallery with Pagination](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-pagination-thumbnail-layout/)
42
+ * [Thumbnail Gallery with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-thumbnail-layout/)
43
+ * [Thumbnail Gallery with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-thumbnail-layout/)
44
+ * [Thumbnail Gallery with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-thumbnail-layout/)
45
+ * [Thumbnail Gallery with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-thumbnail-layout/)
46
+ * [Thumbnail Gallery with Watermarking](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-thumbnail-layout/)
47
+ * [Thumbnail Gallery with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-thumbnail-layout/)
48
+ * [Thumbnail Gallery with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-thumbnail-layout/)
49
+ * [Masonry Gallery](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-masonry-layout/)
50
+ * [Masonry Gallery with WordPress Gallery Lightbox](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lightboxes-masonry-layout/)
51
+ * [Masonry Gallery with Pagination](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-pagination-masonry-layout/)
52
+ * [Masonry Gallery with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-masonry-layout/)
53
+ * [Masonry Gallery with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-masonry-layout/)
54
+ * [Masonry Gallery with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-masonry-layout/)
55
+ * [Masonry Gallery with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-masonry-layout/)
56
+ * [Masonry Gallery with Watermark](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-masonry-layout/)
57
+ * [Masonry Gallery with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-masonry-layout/)
58
+ * [Masonry Gallery with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-masonry-layout/)
59
+ * [Slide Show Gallery](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-slideshow-layout/)
60
+ * [Slide Show Gallery with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-slideshow-layout/)
61
+ * [Slide Show Gallery with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-slideshow-layout/)
62
+ * [Slide Show Gallery with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-slideshow-layout/)
63
+ * [Slide Show Gallery with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-slideshow-layout/)
64
+ * [Slide Show Gallery with Watermarking](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-slideshow-layout/)
65
+ * [Slide Show Gallery with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-slideshow-layout/)
66
+ * [Slide Show Gallery with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-slideshow-layout/)
67
+ * [Image Browser Gallery](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-image-browser-layout/)
68
+ * [Image Browser Gallery with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-image-browser-layout/)
69
+ * [Image Browser Gallery with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-image-browser-layout/)
70
+ * [Image Browser Gallery with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-image-browser-layout/)
71
+ * [Image Browser Gallery with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-image-browser-layout/)
72
+ * [Image Browser Gallery with Watermarking](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-image-browser-layout/)
73
+ * [Image Browser Gallery with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-image-browser-layout/)
74
+ * [Image Browser Gallery with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-image-browser-layout/)
75
+ * [Justified Grid Gallery](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-justified-grid-layout/)
76
+ * [Justified Grid Gallery with WordPress Gallery Lightbox](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lightboxes-justified-grid-layout/)
77
+ * [Justified Grid Gallery with Pagination](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-pagination-justified-grid-layout/)
78
+ * [Justified Grid with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-justified-grid-layout/)
79
+ * [Justified Grid with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-justified-grid-layout/)
80
+ * [Justified Grid with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-justified-grid-layout/)
81
+ * [Justified Grid with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-justified-grid-layout/)
82
+ * [Justified Grid Gallery with Watermarking](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-justified-grid-layout/)
83
+ * [Justified Grid Gallery with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-justified-grid-layout/)
84
+ * [Justified Grid Gallery with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-justified-grid-layout/)
85
+ * [Blog Style Gallery](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-title-description-blog-style-layout/)
86
+ * [Blog Style Gallery with WordPress Gallery Lightbox](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lightboxes-blog-style-layout/)
87
+ * [Blog Style Gallery with Pagination](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-pagination-blog-style-layout/)
88
+ * [Blog Style Gallery with Lazy Load](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-lazy-load-blog-style-layout/)
89
+ * [Blog Style Gallery with Filters](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-filters-blog-style-layout/)
90
+ * [Blog Style Gallery with Order By](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-order-by-blog-style-layout/)
91
+ * [Blog Style Gallery with Search Box](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-search-box-blog-style-layout/)
92
+ * [Blog Style Gallery with Watermarking](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-watermark-blog-style-layout/)
93
+ * [Blog Style Gallery with Animation Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-animation-blog-style-layout/)
94
+ * [Blog Style Gallery with Special Effects](https://gallery-bank.tech-banker.com/frontend-demos/individual-images-with-special-effects-blog-style-layout/)
95
+ * [Photo Albums using Compact Album Layout](https://gallery-bank.tech-banker.com/frontend-demos/compact-album-with-title-description-thumbnail-layout/)
96
+ * [Photo Albums using Extended Album Layout](https://gallery-bank.tech-banker.com/frontend-demos/extended-album-with-title-description-thumbnail-layout/)
97
+
98
+ **[Upgrade to Premium Editions - Wordpress Gallery Plugin](https://gallery-bank.tech-banker.com/)**
99
+
100
+ = Key Features in Lite Edition =
101
+
102
+ * 100% Responsive.
103
+ * User Friendly Admin Panel to add Galleries.
104
+ * Create & Manage unlimited amount of image galleries on your wordpress site/blog.
105
  * Upload unlimited amount of photos/images in your gallery.
106
+ * Images uploaded are stored in a separate directory to avoid mess up with inbuilt wp-uploads folder.
107
  * Photo Metadata is fetched from each image and populates to Title, Description, Alt Text Fields too.
108
  * Photo Metadata is retrieved as per IPTC Standard mentioned [here](https://iptc.org/standards/photo-metadata/photo-metadata/)
109
+ * Add Gallery Title and Description to each of your photo galleries and albums.
110
+ * Add Image Title, Image Description, Alt Text to each of your images.
111
+ * Possibility to exclude images from displaying in a particular photo gallery.
112
+ * Add single or multiple galleries to your page or post using a shortcode.
113
+ * Supports Masonry Layout and Thumbnail Layouts.
114
+ * Custom CSS Toolbox
115
+ * Configure Thumbnail Dimensions in Global Options
116
+ * Right Click Protection Feature in Global Options
117
+ * Language Direction Feature in Global Options
118
+ * Shortcode Wizard to add gallery shortcodes on your Page/Post.
119
+ * Gallery Widget to let you use your photo albums and galleries on your widget section.
120
+
121
+ Take your media gallery to the next level with [Premium Editions](https://gallery-bank.tech-banker.com/) which gives you 200+ features.
122
+
123
+ = Key Features in Premium Editions =
124
+
125
+ * All Standard Edition Features as mentioned above.
126
+ * Supports Thumbnail, Masonry, Slideshow, Image Browser, Justified Grid, Blog Style, Compact Album, Extended Album.
127
+ * Compact Albums displays in a grid gallery format whereas Extended Albums displays in a List format.
128
+ * Manage Galleries
129
+ * Upload Images using PL Uploader, WP Media Manager, FTP Folder
130
+ * Set Thumbnail as Cover Image.
131
+ * Apply Tags to use as Filters for your filterable portfolio.
132
+ * Edit Images - Crop, Rotate Anti Clockwize, Rotate Clockwize, Flip Images Vertically, Flip Images Horizontally, Restore Images, Watermarking.
133
+ * Edit Images - Effects such as Grayscale, Negative, Removal, Sepia, Slate, Saturate, Brightness, Contrast.
134
+ * Copy Images to other Galleries, Move Images to other Galleries.
135
+ * Sort Galleries - Drag & Drop Images to provide Custom Order/Sequence for displaying as per your needs.
136
+ * Manage Albums - Edit existing Album, Delete Album, Delete All Albums
137
+ * Add Album - Album Title & Description
138
+ * Add Album - Add Existing Galleries to your Album to display on Front End.
139
+ * Sort Galleries - Drag & Drop Images to provide Custom Order/Sequence for displaying as per your needs.
140
+ * Manage Tags - Edit Tags, Delete Tags
141
+ * Add Tags - Tag Name, Description for Filters to be applied later to Galleries, Albums
142
+ * Customize Thumbnail Gallery - Layout Settings for Thumbnails, Gallery Title & Description, Thumbnail Title & Description.
143
+ * Customize Masonry Gallery - Layout Settings for Thumbnails, Gallery Title & Description, Thumbnail Title & Description.
144
+ * Customize Slideshow Gallery - Layout Settings for Thumbnails, Gallery Title & Description, Thumbnail Title & Description.
145
+ * Customize Image Browser Gallery - Layout Settings for Thumbnails, Gallery Title & Description, Thumbnail Title & Description.
146
+ * Customize Justified Grid Gallery - Layout Settings for Thumbnails, Gallery Title & Description, Thumbnail Title & Description.
147
+ * Customize Blog Style Gallery - Layout Settings for Thumbnails, Gallery Title & Description, Thumbnail Title & Description.
148
+ * Customize Compact Album Gallery - Layout Settings for Thumbnails, Gallery Title & Description, Thumbnail Title & Description.
149
+ * Customize Extended Album Gallery - Layout Settings for Thumbnails, Gallery Title & Description, Thumbnail Title & Description.
150
+ * Customize Layouts using Custom CSS.
151
+ * Customize Lightcase Lightbox - General Settings, Image Title, Image Description.
152
+ * Customize Fancy Box Lightbox - General Settings, Image Title, Image Description.
153
+ * Customize Color Box Lightbox - General Settings, Image Title, Image Description.
154
+ * Customize Foo Box Free Edition - General Settings, Image Title, Image Description.
155
+ * Customize Nivo Lightbox - General Settings, Image Title, Image Description.
156
+ * Global Options - Configure Thumbnail Dimensions, Right Click Protection, Language Direction
157
+ * Lazy Load Settings - Customize Lazy Load Settings for loading of Images in Galleries and Albums.
158
+ * Filter Settings - Customize Filter Settings to create Filterable Gallery for your website/blog.
159
+ * Order By Settings - Customize Order By Button.
160
+ * Search Box Settings - Customize Search Button to make your galleries also searchable.
161
+ * Page Navigation Settings - Customize Page Navigation to make your galleries to divide into pages.
162
+ * Watermark Settings - Customize Watermark Settings to make your galleries enabled with watermarking.
163
+ * Advertisement Settings - Customize Advertisement Settings to make your wordpress gallery lightbox loaded with advertisement.
164
+ * WordPress Gallery Shortcode Wizard for Thumbnail Gallery, Masonry Gallery, Slideshow Gallery, Image Browser Gallery, Justified Grid Gallery Gallery, Blog Style Gallery.
165
+ * Roles and Capabilities to let you choose what wordpress roles can edit your galleries.
166
+ * Awesome **grid gallery** layouts using compact album.
167
+ * Awesome **filterable portfolio** using tags in all layouts.
168
  * 24/7 Technical Support
169
 
170
+ Visit [here](https://gallery-bank.tech-banker.com/) to upgrade to Premium Editions now.
171
 
172
+ = Responsive Gallery =
173
 
174
+ It is being designed keeping in mind the optimal viewing experience across a wide range of devices. At the same time it is coded to work also on old browsers! Whether your visitors are on a Mobile, Laptop or Desktop your Gallery will look great on any device.
175
 
176
+ = Unlimited Galleries & Images =
177
 
178
+ You can adds unlimited number of images in a single gallery. As you have created a number of image galleries, you can add as many short-codes on your page as you need.
179
 
180
+ = Layout Settings =
181
 
182
+ Easily Configuration settings for Thumbnails, Album Covers, Different Lightboxes, Slideshow, Pagination etc. for customizing your albums as per your website's look & feel.
183
 
184
+ = Easy Setup & Management =
185
 
186
+ Create stunning, 100% responsive, SEO-friendly **photo gallery** in minutes. It provides easy-to-manage functionality to rename, upload, copy, add and remove images. Gallery Bank uses also WordPress in-built media uploader as a feature to upload images.
187
 
188
+ = Image Gallery =
189
 
190
+ It allows you to add multiple images with multiple effects. Image Gallery option allows you to customize the settings for views of images.
191
 
192
+ = Masonry Gallery =
193
 
194
+ With Gallery Bank, you can implement Masonry Layout. Masonry layouts are a great choice for creating galleries using images with varied dimensions. It works by placing elements in optimal position based on available vertical space.
195
 
196
+ = Lightbox displays image =
197
 
198
+ Lightbox will appear when you click on the image and it will help you show more detail about your pictures with full description and full size of image.
199
 
200
+ == Frequently Asked Questions ==
201
 
202
+ = How to Add Gallery? =
203
 
204
+ * On the Gallery Bank Navigation Panel, select Galleries - Add Gallery.
205
+ * Once you reach the page, you would need to click on "Gallery Title & Description" tab at top of the page.
206
+ * Gallery Title : In this field, you would need to provide "Gallery Title".
207
+ * Gallery Description : In this field, you would need to provide "Gallery Description". It would be displayed when using short-code.
208
+ * In order to upload images to the gallery, you would need to click on "Upload Images" tab at top of the page.
209
+ * You can upload images from your Local System, WP Media Manager or FTP.
210
+ * Once everything is being setup, you would need to click on "Save Changes" button located at bottom of the screen to save the settings.
211
 
212
+ = Are there some restrictions for adding images? =
213
+
214
+ There is no limit for the amount of images. You can add as many images as you want. Plugin has no limitations on upload of images and galleries.
215
+
216
+ = When I upgrade to the commercial version, will I lose all the images, galleries and settings that I have made up in the free version of the Gallery? =
217
+
218
+ Of course Not. In order to completely remove everything from the database, you have to go Other Settings option in the Gallery Bank menu and choose Delete Tables at Uninstall to **enable**.
219
+
220
+ = Do you have any problems with plugin installation or usage? =
221
+
222
+ You can use [WordPress Support Forums](https://wordpress.org/support/plugin/gallery-bank/). They will help you to quickly install a gallery plugin. We are always ready to help everyone.
223
 
224
  == Installation ==
225
 
226
+ ### Performing a new installation
227
 
228
  = Minimum requirements. =
229
  * Wordpress 3.1+
260
 
261
  == Other Notes ==
262
 
263
+ = Minimum requirement =
264
  * Wordpress 3.3+
265
  * PHP 5.x
266
  * MySQL 5.x
267
 
268
  If any problem occurs, please contact us at [support@tech-banker.com](mailto:support@tech-banker.com).
269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  == Screenshots ==
271
 
272
  1. Manage Galleries
281
  10. Sort Albums
282
  11. Manage Tags
283
  12. Add Tag
284
+ 13. Layout Settings - Thumbnail Gallery - Thumbnails
285
+ 14. Layout Settings - Thumbnail Gallery - Gallery Title
286
+ 15. Layout Settings - Thumbnail Gallery - Gallery Description
287
+ 16. Layout Settings - Thumbnail Gallery - Thumbnail Title
288
+ 17. Layout Settings - Thumbnail Gallery - Thumbnail Description
289
+ 18. Layout Settings - Masonry Gallery - Thumbnails
290
+ 19. Layout Settings - Masonry Gallery - Gallery Title
291
+ 20. Layout Settings - Masonry Gallery - Gallery Description
292
+ 21. Layout Settings - Masonry Gallery - Thumbnail Title
293
+ 22. Layout Settings - Masonry Gallery - Thumbnail Description
294
+ 23. Layout Settings - Slideshow Gallery - Thumbnails
295
+ 24. Layout Settings - Slideshow Gallery - Gallery Title
296
+ 25. Layout Settings - Slideshow Gallery - Gallery Description
297
+ 26. Layout Settings - Slideshow Gallery - Thumbnail Title
298
+ 27. Layout Settings - Slideshow Gallery - Thumbnail Description
299
+ 28. Layout Settings - Image Browser Gallery - Thumbnails
300
+ 29. Layout Settings - Image Browser Gallery - Gallery Title
301
+ 30. Layout Settings - Image Browser Gallery - Gallery Description
302
+ 31. Layout Settings - Image Browser Gallery - Thumbnail Title
303
+ 32. Layout Settings - Image Browser Gallery - Thumbnail Description
304
+ 33. Layout Settings - Justified Grid Gallery - Thumbnails
305
+ 34. Layout Settings - Justified Grid Gallery - Gallery Title
306
+ 35. Layout Settings - Justified Grid Gallery - Gallery Description
307
+ 36. Layout Settings - Justified Grid Gallery - Thumbnail Title
308
+ 37. Layout Settings - Justified Grid Gallery - Thumbnail Description
309
+ 38. Layout Settings - Blog Style Gallery - Thumbnails
310
+ 39. Layout Settings - Blog Style Gallery - Gallery Title
311
+ 40. Layout Settings - Blog Style Gallery - Gallery Description
312
+ 41. Layout Settings - Blog Style Gallery - Thumbnail Title
313
+ 42. Layout Settings - Blog Style Gallery - Thumbnail Description
314
  43. Layout Settings - Compact Album Layout - Thumbnails
315
  44. Layout Settings - Compact Album Layout - Album Title
316
  45. Layout Settings - Compact Album Layout - Album Description
349
  78. General Settings - Watermark Settings - Image
350
  79. General Settings - Advertisement - Text
351
  80. General Settings - Advertisement - Image
352
+ 81. Shortcodes - Thumbnail Gallery
353
+ 82. Shortcodes - Masonry Gallery
354
+ 83. Shortcodes - Slideshow Gallery
355
+ 84. Shortcodes - Image Browser Gallery
356
+ 85. Shortcodes - Justified Grid Gallery
357
+ 86. Shortcodes - Blog Style Gallery
358
  87. Other Settings
359
  88. Roles & Capabilities
360
  89. Feature Requests
362
 
363
  == Changelog ==
364
 
365
+ = 4.0.4 =
366
+
367
+ * FIX: Lightbox Caption
368
+ * TWEAK: PLUploader updated to latest release
369
+ * TWEAK: Jquery Validator updated to latest release
370
+ * TWEAK: Jquery Modal updated to latest release
371
+ * FIX: Major Bugs
372
+
373
  = 4.0.3 =
374
 
375
+ * FIX: Lightbox Bugs
376
+ * FIX: Code Optimized
377
+ * FIX: Obsolete Code Removed
378
+ * FIX: Headers Output Bug
379
 
380
  = 4.0.2 =
381
 
382
+ * FIX: Lightbox Bug
383
  * TWEAK: New Lightbox Option Added
384
+ * FIX: Code Optimized
385
 
386
  = 4.0.1 =
387
 
388
+ * FIX: Obsolete Code Removed
389
+ * FIX: Major Bugs
390
+ * FIX: Install Script Code Optimized
391
+ * FIX: Wizard Page Error
392
+ * FIX: Code Optimized
393
 
394
  = 4.0.0 =
395
 
404
  * TWEAK: Obsolete Code Deleted
405
  * TWEAK: CSS Improved
406
 
407
+
408
  = 3.1.40 =
409
 
410
+ * FIX: Obsolete Code Removed
411
+ * FIX: Proper Sanitization, Escaping, Validation of all Post Calls
412
+ * FIX: Obsolete Code Removed
413
+ * FIX: Code Optimized
414
 
415
  = 3.1.39 =
416
 
417
+ * FIX: Obsolete Code Removed
418
+ * FIX: Code Optimized
419
 
420
  = 3.1.37 =
421
 
422
+ * FIX: Proper Sanitization, Escaping, Validation of all Post Calls
423
+ * FIX: Removal of all function_exists, class_exists, typeof from all the files.
424
+ * FIX: Uninstall File moved to root folder and changes done as per wordpress guidelines.
425
+ * FIX: Error Reporting in file Removed
426
+ * FIX: Auto Updates Removed
427
+ * FIX: Curl Calls Removed
428
 
429
  = 3.1.36 =
430
 
431
+ * TWEAK: Error Reporting Added
432
+ * FIX: Responsive Layouts
433
 
434
  = 3.1.35 =
435
 
436
+ * FIX: Major Issue
437
+ * TWEAK: Wizard Page Added
438
 
439
  = 3.1.34 =
440
 
441
+ * FIX: Major Issue
442
+ * FIX: Responsive Layouts
443
 
444
  = 3.1.33 =
445
 
446
+ * FIX: Major Issue
447
+ * TWEAK: INI Default Values Set
448
+ * TWEAK: Compatibility with 4.7.3
449
 
450
  = 3.1.32 =
451
 
452
+ * TRANSLATION: Translation Files Updated
453
+ * TRANSLATION: Translation Constant Bug
454
 
455
  = 3.1.31 =
456
 
457
+ * TWEAK: Obsolete Code removed
458
+ * TWEAK: Unused Files removed
459
+ * TWEAK: Code Optimized
460
+ * TRANSLATION: Translation File Updated
461
 
462
  = 3.1.30 =
463
 
464
+ * FIX: Major Issue Related to Re-generate of Thumbnails on Edit Album
465
 
466
  = 3.1.29 =
467
 
468
+ * FIX: Major Issue Related to Function Undefined in Header File.
469
 
470
  = 3.1.28 =
471
 
472
+ * TWEAK: Improved Functionality
 
473
 
474
  = 3.1.27 =
475
 
476
+ * TWEAK: Security Patch
 
477
 
478
  = 3.1.26 =
479
 
480
+ * TWEAK: Compatibility with 4.6
481
+ * TWEAK: Code Optimized
 
482
 
483
  = 3.1.25 =
484
 
485
+ * TWEAK: Code Optimized
 
486
 
487
  = 3.1.24 =
488
 
489
+ * TWEAK: Tooltip Renamed
 
490
 
491
  = 3.1.23 =
492
 
493
+ * TWEAK: Code Optimized
 
494
 
495
  = 3.1.22 =
496
 
497
+ * FIX: Major Cross Site Scripting Security Issue
 
 
 
 
 
498
 
499
  = 3.1.20 =
500
 
501
+ * TWEAK: Strings Updated
502
+ * TWEAK: Pricing Table Changed
503
+ * TWEAK: Code Optimized
 
504
 
505
  = 3.1.19 =
506
 
507
+ * TWEAK: Header Section Updated
508
+ * TWEAK: Other Services Content Updated
509
+ * TWEAK: Pricing Table Changed
 
 
 
 
 
510
 
511
  = 3.1.17 =
512
 
513
+ * TWEAK: Other Services Content Updated
514
+ * TWEAK: Pricing Table Changed
515
 
516
  = 3.1.16 =
517
 
518
+ * FIX: Few CSS Issues
519
+ * TWEAK: Pricing Table Changed
520
 
521
  = 3.1.15 =
522
 
523
+ * TWEAK: Compatibility with 4.5.3
524
 
525
  = 3.1.14 =
526
 
527
+ * FIX: Few CSS Issues.
528
 
529
  = 3.1.13 =
530
 
531
+ * TWEAK: Code Optimized
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
532
 
533
  = 3.1.9 =
534
 
535
+ * TWEAK: Compatibility with 4.5.2
536
 
537
  = 3.1.8 =
538
 
539
+ * FIX: Few CSS Issues
540
 
541
  = 3.1.7 =
542
 
543
+ * TWEAK: Compatibility with 4.5.1
544
+ * FIX: Few CSS Issues
545
 
546
  = 3.1.6 =
547
 
548
+ * TWEAK: Compatibility with 4.5
549
 
550
  = 3.1.5 =
551
 
552
+ * FIX: Few CSS Issues
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
 
554
  = 3.1.1 =
555
 
556
+ * FIX: Database Issues
557
+ * TWEAK: Code Optimized
558
 
559
  = 3.1.0 =
560
 
561
+ * TWEAK: Major Version Release
562
+ * TWEAK: Code Optimized
563
+ * FIX: Major Bugs
564
+ * FIX: Lightbox Issues
565
+ * FIX: Masonry Gallery Layout Issues
566
+ * TWEAK: Removed Font Icons and Replaced with Compatible Icons
567
+ * TRANSLATION: Persian Language Added
568
 
569
  = 3.0.456 =
570
 
571
+ * FIX: Few Urgent Issues.
572
 
573
  = 3.0.455 =
574
 
575
+ * FIX: Few Minor Issues.
576
 
577
  = 3.0.454 =
578
 
579
+ * TWEAK: Compatibility with 4.4.2
580
 
581
  = 3.0.453 =
582
 
583
+ * FIX: Few Urgent Issues.
584
 
585
  = 3.0.452 =
586
 
587
+ * FIX: Few CSS Issues.
588
 
589
  = 3.0.451 =
590
 
591
+ * TWEAK: Compatibility with 4.4.1
592
 
593
  = 3.0.450 =
594
 
595
+ * FIX: Few CSS Issues.
596
 
597
  = 3.0.449 =
598
 
599
+ * FIX: Few Urgent Issues.
600
 
601
  = 3.0.448 =
602
 
603
+ * FIX: Few Urgent Issues.
604
 
605
  = 3.0.447 =
606
 
607
+ * TWEAK: Compatibility with 4.4
608
 
609
  = 3.0.446 =
610
 
611
+ * FIX: Few CSS Issues.
612
 
613
  = 3.0.445 =
614
 
615
+ * FIX: Few CSS Issues.
616
 
617
  = 3.0.444 =
618
 
619
+ * FIX: Few Urgent Issues.
620
 
621
  = 3.0.343 =
622
 
623
+ * FIX: Few Minor Issues.
624
 
625
  = 3.0.442 =
626
 
627
+ * FIX: Few CSS Issues.
628
 
629
  = 3.0.441 =
630
 
631
+ * FIX: Few Urgent Issues.
632
 
633
  = 3.0.340 =
634
 
635
+ * FIX: Few Minor Issues.
636
 
637
  = 3.0.339 =
638
 
639
+ * FIX: Few Urgent Issues.
640
 
641
  = 3.0.338 =
642
 
643
+ * TWEAK: Database Engine updated.
644
 
645
  = 3.0.337 =
646
 
647
+ * FIX: Few Urgent Issues.
648
 
649
  = 3.0.336 =
650
 
651
+ * FIX: Few Minor Issues.
652
 
653
  = 3.0.335 =
654
 
655
+ * FIX: Few Minor Issue.
656
 
657
  = 3.0.334 =
658
 
659
+ * TWEAK: Album Description Shown under Album Title
660
 
661
  = 3.0.333 =
662
 
663
+ * FIX: Few Urgent Issues.
664
 
665
  = 3.0.332 =
666
 
667
+ * FIX: Delete Image Issue.
668
 
669
  = 3.0.331 =
670
 
671
+ * FIX: Pretty Photo Title & Description Issue.
672
 
673
  = 3.0.330 =
674
 
675
+ * FIX: Few Security Issues.
676
+ * TWEAK: 2.2.2 Version used.
677
 
678
  = 3.0.229 =
679
 
680
+ * TWEAK: Compatibility with 4.3
681
+ * TWEAK: Changed variables to avoid confliction with Next Gen and Contact Bank plugins.
682
+ * FIX: Prettyphoto XSS Security Issue.
683
 
684
  = 3.0.228 =
685
 
686
+ * FIX: Few Minor Issues
687
 
688
  = 3.0.227 =
689
 
690
+ * TWEAK: Compatibility with 4.2.4
691
 
692
  = 3.0.226 =
693
 
694
+ * FIX: Few Minor Issues
695
 
696
  = 3.0.225 =
697
 
698
+ * TWEAK: Compatibility with 4.2.3
699
 
700
  = 3.0.224 =
701
 
702
+ * FIX: Auto Update Issue
703
 
704
  = 3.0.223 =
705
 
706
+ * FIX: Few Minor Issues.
707
 
708
  = 3.0.222 =
709
 
710
+ * FIX: Few Urgent Issues.
711
 
712
  = 3.0.221 =
713
 
714
+ * FIX: Minor Issues.
715
+ * TWEAK: Premium Editions Section Updated.
716
 
717
  = 3.0.120 =
718
 
719
+ * FIX: Major Issue Regarding Rss Feeds.
720
 
721
  = 3.0.119 =
722
 
723
+ * FIX: Few Urgent Issues.
724
 
725
  = 3.0.118 =
726
 
727
+ * TRANSLATION: Few Languages Updated.
728
+ * FIX: Minor CSS Issues.
 
 
 
 
729
 
730
  = 3.0.116 =
731
 
732
+ * TRANSLATION: Few Languages Updated
733
+ * FIX: Minor CSS Issues.
734
 
735
  = 3.0.115 =
736
 
737
+ * TWEAK: Added Compatibility with 4.2.2 WordPress.
738
 
739
  = 3.0.114 =
740
 
741
+ * TWEAK: Added Compatibility with 4.2.1 WordPress.
742
+ * FIX: Few Minor Issues
743
 
744
  = 3.0.113 =
745
 
746
+ * TWEAK: Added Compatibility with 4.2 WordPress.
747
+ * FIX: Few Minor Issues
748
 
749
  = 3.0.112 =
750
 
751
+ * TWEAK: Added Compatibility with 4.1.2 WordPress.
752
 
753
  = 3.0.111 =
754
 
755
+ * FIX: Few Issues.
756
+ * TRANSLATION: Languages Updated.
757
 
758
  = 3.0.10 =
759
 
760
+ * FIX: Issue related to datatables.
761
 
762
  = 3.0.109 =
763
 
764
+ * FEATURE: Implemented new feature of calculating images size according server configuration.
765
+ * FIX: Minor Issues.
766
 
767
  = 3.0.108 =
768
 
769
+ * FIX: Minor Issues.
770
 
771
  = 3.0.107 =
772
 
773
+ * FIX: Minor Issues.
774
+ * TWEAK: Premium Editions Section Updated.
775
 
776
  = 3.0.106 =
777
 
778
+ * FIX: Minor Issues.
779
+ * TWEAK: Other Services Section Updated.
780
+ * TWEAK: Premium Editions Section Updated.
781
 
782
  = 3.0.105 =
783
 
784
+ * TWEAK: Demo Gallery added by default.
785
 
786
  = 3.0.104 =
787
 
788
+ * TWEAK: Default Shortcode Layout changed from Masonry to Thumbnails.
789
 
790
  = 3.0.103 =
791
 
792
+ * FEATURE: Added new feature of Feature Request.
793
+ * TWEAK: Shortcode Editor Redesigned.
794
 
795
  = 3.0.102 =
796
 
797
+ * FIX: Minor Vulnerability Issue related to shortcode as pointed by Goblin Research.
798
 
799
  = 3.0.101 =
800
 
801
+ * FIX: Major Issue related to uploader.
802
 
803
  = 3.0.100 =
804
 
805
+ * TWEAK: Implemented New Feature to display selected Albums.
806
 
807
  = 3.0.99 =
808
 
809
+ * TRANSLATION: Korean Language Updated.
810
+ * TWEAK: Udpated Po & Mo Files for all Languages.
811
+ * TRANSLATION: Added New Languages
812
 
813
  = 3.0.98 =
814
 
815
+ * TWEAK: Recommendation section updated.
816
 
817
  = 3.0.97 =
818
 
819
+ * FIX: compatibility issue with WP Lightbox 2 Plugin.
820
 
821
  = 3.0.96 =
822
 
823
+ * FIX: compatibility issue with woocommerce plugin.
824
+ * FIX: Layout issues.
825
+ * FIX: White spacing issue.
826
+ * TWEAK: Unset plugin update scheduler on plugin uninstall.
827
 
828
  = 3.0.95 =
829
 
830
+ * FIX: Major Issue Related to PL Uploader.
831
+ * FIX: Code for Plugins using Versions prior to 4.0
832
 
833
  = 3.0.94 =
834
 
835
+ * FIX: Few Issues
836
+ * FIX: Menus
837
+ * FEATURE: Implemented New Feature - Automatic Plugin Update Enable/Disable.
838
 
839
  = 3.0.93 =
840
 
841
+ * TWEAK: Removed unwanted code
842
+ * FEATURE: New Uploader Introduced.
843
+ * FEATURE: New Layout Introduced for uploader.
844
+ * TWEAK: Thumbs View in Uploader.
845
+ * TWEAK: Add, Edit Gallery Layout changed.
846
+ * TWEAK: Updated JS files.
847
+ * TRANSLATION: Slovenian Language updated.
 
 
 
 
848
 
849
  = 3.0.91 =
850
 
851
+ * TWEAK: Recommendation section updated.
852
+ * TRANSLATION: Japanese Language updated.
853
 
854
  = 3.0.90 =
855
 
856
+ * FIX: Major security Issue regarding image uploader.
857
 
858
  = 3.0.89 =
859
 
860
+ * TWEAK: Pretty Photo lightbox license updated.
861
 
862
  = 3.0.88 =
863
 
864
+ * TWEAK: Pricing Changed
 
 
 
 
865
 
866
  = 3.0.86 =
867
 
868
+ * TWEAK: Added Compatibility with 4.1 WordPress.
869
+ * FIX: Issue Related to Galleries Display.
870
 
871
  = 3.0.85 =
872
 
873
+ * TWEAK: Changed variables to avoid confliction with other plugins.
874
 
875
  = 3.0.84 =
876
 
877
+ * FIX: Minor Issues Related to Galleries Display
878
 
879
  = 3.0.83 =
880
 
881
+ * TWEAK: Added Update Message for New Versions.
882
 
883
  = 3.0.82 =
884
 
885
+ * TWEAK: Major Issue Related to Multisite Wordpress.
886
 
887
  = 3.0.81 =
888
 
889
+ * TWEAK: Multisite Compatibility Added.
890
+ * TWEAK: Added Compatibility with 4.0.1 WordPress
891
+ * TWEAK: Updated Pricing Table
892
 
893
  = 3.0.80 =
894
 
895
+ * FIX: Conflict with JetPack
896
+ * TWEAK: Optimized Code
897
 
898
  = 3.0.79 =
899
 
900
+ * TWEAK: Udpated Po & Mo Files for all Languages
901
+ * TWEAK: Updated Css
902
+ * TWEAK: Optimized Code
903
 
904
  = 3.0.78 =
905
 
906
+ * TWEAK: Udpated Po & Mo Files
907
+ * TWEAK: Updated Css
908
+ * TWEAK: Updated Our Services Section
909
+ * TWEAK: Optimized Code
910
+ * TWEAK: Removed unwanted Files
911
 
912
  = 3.0.76 =
913
 
914
+ * FIX: CSS Conflictions Issue after 3.0.75 update
915
+ * FIX: Js Conflictions
916
+ * TWEAK: Readme.txt Updated
917
 
918
  = 3.0.75 =
919
 
920
+ * TWEAK: Demo Links Updated as per New Website
921
+ * TWEAK: Readme.txt Changed as per New Website
922
+ * TWEAK: Recommended Section Added
923
+ * TWEAK: Other Services Section Added
924
+ * TWEAK: Pricing Section Updated
925
+ * TWEAK: Major Release before 4.0 update
926
 
927
 
928
  = 3.0.75 =
929
 
930
+ * FIX: Masonry Colum Width Issue
931
+ * FIX: Overlapping Masonry Gallery Layout
932
 
933
  = 3.0.74 =
934
 
935
+ * TWEAK: Banner Updated
936
 
937
  = 3.0.73 =
938
 
939
+ * TWEAK: Banner Updated
940
 
941
  = 3.0.72 =
942
 
943
+ * TRANSLATION: Danish Language Updated
944
+ * TWEAK: Banner Updated
945
 
946
  = 3.0.71 =
947
 
948
+ * TWEAK: Banner Updated
949
 
950
  = 3.0.70 =
951
 
952
+ * FIX: Major Security Issue XSS Vulnerability related to Album Sorting
953
 
954
  = 3.0.69 =
955
 
956
+ * TRANSLATION: Updated Existing Language - Romanian
957
+ * TRANSLATION: Updated Existing Language - Indonesian
958
+ * FIX: Roles Issue
959
 
960
  = 3.0.68 =
961
 
962
+ * TRANSLATION: Added New Language - Croatian
963
+ * TRANSLATION: Added New Language - Norwegian
964
+ * TWEAK: Banner Updated
965
 
966
  = 3.0.67 =
967
 
968
+ * TRANSLATION: Added New Language - Greek
969
+ * TRANSLATION: Updated Existing Language - Indonesian
970
 
971
  = 3.0.66 =
972
 
973
+ * TWEAK: Compatibility Test with 4.0
974
+ * TWEAK: Banner Updated
 
975
 
976
  = 3.0.65 =
977
 
978
+ * TWEAK: Banner Updated
 
979
 
980
  = 3.0.64 =
981
 
982
+ * TWEAK: Banner Updated
 
983
 
984
  = 3.0.63 =
985
 
986
+ * FIX: Major Security Issue.
987
 
988
  = 3.0.62 =
989
 
990
+ * TWEAK: Banner Updated
 
991
 
992
  = 3.0.61 =
993
 
994
+ * FIX: Major Security Issue related to Upload.php file
 
 
 
 
995
 
996
  = 3.0.59 =
997
 
998
+ * TRANSLATION: Chinese Language Updated
 
 
 
 
 
 
 
 
999
 
1000
  = 3.0.56 =
1001
 
1002
+ * TRANSLATION: Slovak Language Updated
 
 
 
 
1003
 
1004
  = 3.0.54 =
1005
 
1006
+ * TWEAK:Few Possible Security Issues Addressed
 
1007
 
1008
  = 3.0.53 =
1009
 
1010
+ * FIX: Language Issues
1011
 
1012
  = 3.0.52 =
1013
 
1014
+ * TRANSLATION: Danish Language Updated
1015
 
1016
  = 3.0.51 =
1017
 
1018
+ * TWEAK: Social Icons Added to Lightbox
1019
 
1020
  = 3.0.50 =
1021
 
1022
+ * TWEAK:Few Possible Security Issues Addressed
1023
 
1024
  = 3.0.49 =
1025
 
1026
+ * TRANSLATION: Polish Language Updated
1027
 
1028
  = 3.0.48 =
1029
 
1030
+ * TRANSLATION: Czech Language Updated
1031
 
1032
  = 3.0.47 =
1033
 
1034
+ * TWEAK: Advanced Security for Plugin Implemented
1035
 
1036
  = 3.0.46 =
1037
 
1038
+ * TRANSLATION: Hungarian Language Updated
1039
 
1040
  = 3.0.45 =
1041
 
1042
+ * TWEAK: Banner Updated
 
1043
 
1044
  = 3.0.44 =
1045
 
1046
+ * TRANSLATION: Arabic Language Updated
1047
 
1048
  = 3.0.43 =
1049
 
1050
+ * TWEAK: Banner Updated
 
1051
 
1052
  = 3.0.42 =
1053
 
1054
+ * TRANSLATION: Thai Language Updated
1055
 
1056
  = 3.0.41 =
1057
 
1058
+ * TWEAK: Banner Updated
 
1059
 
1060
  = 3.0.40 =
1061
 
1062
+ * FIX: Issue with Menu Links shown to Subscriber and other roles.
1063
 
1064
  = 3.0.39 =
1065
 
1066
+ * TRANSLATION: Russian Language Updated
1067
 
1068
  = 3.0.38 =
1069
 
1070
+ * TWEAK: Banner Updated
 
1071
 
1072
  = 3.0.37 =
1073
 
1074
+ * FIX: Major Issue related to Saving of Images
1075
+ * FIX: Major Issue related to Editing of existing Albums
1076
 
1077
  = 3.0.36 =
1078
 
1079
+ * FIX: Issue related to Saving of Albums
1080
 
1081
  = 3.0.35 =
1082
 
1083
+ * FIX: Major Security Issue related to Upload.php file
1084
 
1085
  = 3.0.34 =
1086
 
1087
+ * FIX: Issue Related to Set as Album
1088
 
1089
  = 3.0.33 =
1090
 
1091
+ * FIX: Broken Add New Album Link.
 
1092
 
1093
  = 3.0.32 =
1094
 
1095
+ * FIX: Major Issue with saving of Data
1096
 
1097
  = 3.0.31 =
1098
 
1099
+ * TWEAK: Unwanted Banners Removed
 
1100
 
1101
  = 3.0.30 =
1102
 
1103
+ * TRANSLATION: Turkish Language Updated
1104
+ * FIX: Delete Images Issue
1105
 
1106
  = 3.0.29 =
1107
 
1108
+ * TWEAK: Added Functionality to support Bulk Images Upload
 
1109
 
1110
  = 3.0.28 =
1111
 
1112
+ * TWEAK: CK Editor Compatibility Added
 
1113
 
1114
  = 3.0.27 =
1115
 
1116
+ * TWEAK: Unwanted Banners Removed
 
1117
 
1118
  = 3.0.26 =
1119
 
1120
+ * TRANSLATION: New Language - Belarusian
1121
+ * TRANSLATION: Language Updated - Russian
1122
 
1123
  = 3.0.25 =
1124
 
1125
+ * TRANSLATION: Languages Updated
1126
 
1127
  = 3.0.24 =
1128
 
1129
+ * TWEAK: Banner Updated
1130
 
1131
  = 3.0.23 =
1132
 
1133
+ * TWEAK: Licenses Updated
1134
 
1135
  = 3.0.22 =
1136
 
1137
+ * FIX: Png Image Issue.
1138
+ * TRANSLATION: Language Updated - Hebrew
1139
 
1140
  = 3.0.21 =
1141
 
1142
+ * TWEAK: New Layout Introduced
1143
+ * TWEAK: Help Video Added
1144
+ * FIX: Issue with Title & Description
1145
+ * TWEAK: Compatibility with 3.9
1146
+ * TRANSLATION: Language Updated - Finnish
1147
 
1148
  = 3.0.20 =
1149
 
1150
+ * FIX: Issues
1151
+ * TWEAK: Compatibility with 3.9
1152
 
1153
  = 3.0.19 =
1154
 
1155
+ * TRANSLATION: Language Updated - Finnish
1156
 
1157
  = 3.0.18 =
1158
 
1159
+ * FEATURE: New Help Popup Introduced
1160
+ * TWEAK: Compatiblity with 3.8.3
1161
 
1162
  = 3.0.17 =
1163
 
1164
+ * TRANSLATION: Language Updated - German
1165
 
1166
  = 3.0.16 =
1167
 
1168
+ * TRANSLATION: Language Updated - Italian
1169
 
1170
  = 3.0.15 =
1171
 
1172
+ * TRANSLATION: New Language Added - Estonian
1173
 
1174
  = 3.0.14 =
1175
 
1176
+ * TRANSLATION: Language Updated - Portuguese
1177
 
1178
  = 3.0.13 =
1179
 
1180
+ * TRANSLATION: Language Updated - French
1181
 
1182
  = 3.0.12 =
1183
 
1184
+ * TRANSLATION: Language Updated - Swedish
1185
 
1186
  = 3.0.11 =
1187
 
1188
+ * TWEAK: Removed Unwanted Banners
 
1189
 
1190
  = 3.0.10 =
1191
 
1192
+ * TRANSLATION: New Language Added - Ukrainian
 
 
 
 
 
1193
 
1194
  = 3.0.8 =
1195
 
1196
+ * TRANSLATION: Dutch Language Updated
1197
+ * TWEAK: Uninstall Hook Removed
1198
 
1199
  = 3.0.7 =
1200
 
1201
+ * TRANSLATION: Updated Languages
1202
+ * FIX: Issue Related to Pl Uploader which stops WP Media
1203
 
1204
  = 3.0.6 =
1205
 
1206
+ * TRANSLATION: Updated Languages
1207
+ * FIX: Few Issue Related to Lightbox
1208
+ * TWEAK: Request for Translation of New Languages
1209
 
1210
  = 3.0.5 =
1211
 
1212
+ * TRANSLATION: Updated Languages
1213
+ * FIX: Few Issue Related to Lightbox
1214
+ * TWEAK: Checked If Permissions are Set to Directory
1215
 
1216
  = 3.0.4 =
1217
 
1218
+ * TRANSLATION: Updated Languages
1219
+ * FIX: Few Issue Related to Thumbnails generation
1220
+ * FIX: Copy Images for existing albums to new folder
1221
+ * FIX: Problem of loosing images when upgrading to latest versions.
1222
 
1223
  = 3.0.3 =
1224
 
1225
+ * TRANSLATION: Updated Spanish Languages
1226
+ * FIX: Few Issue Related to Thumbnails generation
1227
+ * TWEAK: Removed unwanted stuff
1228
 
1229
  = 3.0.2 =
1230
 
1231
+ * TRANSLATION: Updated all Languages
1232
+ * FIX: Few Issue Related to Thumbnails
1233
+ * TWEAK: Added Warning Permissions Message for Thumbnails
1234
 
1235
  = 3.0.1 =
1236
 
1237
+ * TRANSLATION: Updated all Languages
1238
+ * FIX: Few Issues Related to Database Upgrade from Previous versions
1239
+ * FEATURE: Add New Page to show how to add Shortcodes.
1240
 
1241
  = 3.0.0 =
1242
 
1243
+ * Major Version Release
1244
+ * FEATURE: Images are now being saved in itself instead of WP Uploads.
1245
+ * FEATURE: Thumbs are now created by the system itself rather than any 3rd Party script like Timbthumb etc.
1246
+ * FEATURE: Improved Performance
1247
+ * FEATURE: Improved Database to manage
1248
+ * FEATURE: Indexing on Tables to grab results quickly
1249
+ * FEATURE: Highly Optimized Code
1250
+ * FEATURE: Responsive Layout
1251
+ * FEATURE: Easily adaptable environment for any device.
1252
+ * FEATURE: Bulk Upload of Images
1253
+ * FEATURE: New Short-code Wizard
1254
+ * FEATURE: Url Redirect to redirect on click of an image.
1255
+ * FEATURE: Compact Albums
1256
+ * FEATURE: Extended Albums
1257
+ * FEATURE: Basic Thumbnail Gallery
1258
+ * FEATURE: Masonry Gallery
1259
+ * FEATURE: List Album Format
1260
+ * FEATURE: Grid Album Format
1261
+ * FEATURE: Images in Row for displaying number of images per row
1262
+ * FEATURE: Albums in Row for displaying number of albums per row
1263
+ * FEATURE: Albums in Row for displaying number of albums per row
1264
+ * FEATURE: Filmstrip Gallery Format(Premium Versions)
1265
+ * FEATURE: Slideshow Gallery(Premium Versions)
1266
+ * FEATURE: Special Effects on Images & Albums(Premium Versions)
1267
+ * FEATURE: Animation Effects on Images & Albums(Premium Versions)
1268
+ * FEATURE: Bulk Deletion of Images(Premium Versions)
1269
+ * FEATURE: Sorting of Images(Premium Versions)
1270
+ * FEATURE: Sorting of Albums(Premium Versions)
1271
+ * FEATURE: Social Sharing(Premium Versions)
1272
+ * FEATURE: Commenting on Images(Premium Versions)
1273
+ * FEATURE: Widgets(Premium Versions)
1274
+ * FEATURE: Tags for each Image to make Filerable Gallery Album(Premium Versions)
1275
+ * FEATURE: Bulk Deletion of Albums(Premium Versions)
1276
+ * FEATURE: Purging Albums and Images(Premium Versions)
1277
+ * FEATURE: Restore Factory Settings(Premium Versions)
1278
+ * FEATURE: Global Settings(Premium Versions)
1279
+ * FEATURE: Thumbnail Settings(Premium Versions)
1280
+ * FEATURE: Album Settings(Premium Versions)
1281
+ * FEATURE: Lightbox Settings(Premium Versions)
1282
+ * FEATURE: Different Lightboxes like FooBox,ColorBox,FancyBox2,Lightbox2,Custom GB Lightbox,Pretty Photo(Premium Versions)
1283
+ * FEATURE: Pagination(Premium Versions)
1284
+ * FEATURE: Filter Settings(Premium Versions)
1285
+ * FEATURE: Roles & Capabilities(Premium Versions)
1286
+ * FIX: Wrong images displayed when videos added.
1287
 
1288
  = 2.0.26 =
1289
 
1290
+ * TWEAK: Minor Database update before Major Version Release
1291
 
1292
  = 2.0.25 =
1293
 
1294
+ * FIX: few issues with Wordpress 3.8.1 compatibility
1295
 
1296
  = 2.0.24 =
1297
 
1298
+ * FIX: Issue Related to Front View
1299
+ * FIX: Issue Related to Front View Albums
1300
+ * FIX: Issue Related to Front View Albums with Images
1301
+ * FIX: Issue Related to Css Display
1302
+ * TWEAK: Lightbox Updated
1303
 
1304
  = 2.0.23 =
1305
 
1306
+ * FIX: Few issues with Wordpress 3.8 compatibility
1307
 
1308
  = 2.0.22 =
1309
 
1310
+ * TWEAK: Option Added to Gather Data for Testing Purposes for Better Compatibility
 
 
 
 
1311
 
1312
  = 2.0.20 =
1313
 
1314
+ * FIX: Security Issues
1315
+ * FIX: Cross Scripting Issues
1316
+ * TWEAK: Compatibility with 3.7
 
1317
 
1318
  = 2.0.19 =
1319
 
1320
+ * TWEAK: Introducing Jquery Masonry
1321
+ * TWEAK: Removed Timbthumb
 
 
 
 
 
 
 
 
 
1322
 
1323
  = 2.0.16 =
1324
 
1325
+ * TRANSLATION: Languages Updated
1326
 
1327
  = 2.0.15 =
1328
 
1329
+ * FIX: issue with Saving Albums
1330
 
1331
  = 2.0.14 =
1332
 
1333
+ * TWEAK:Introducing Videos
1334
+ * FIX: Thumbnails issue
1335
+ * FIX: Timbthumb issue
 
 
 
 
 
 
 
 
1336
 
1337
  = 2.0.11 =
1338
 
1339
+ * FIX: Description of Images in Internet Explorer
1340
 
1341
  = 2.0.9 =
1342
 
1343
+ * FIX: Menus visible to Users other than Administrator
1344
 
1345
  = 2.0.8 =
1346
 
1347
+ * TRANSLATION: Languages Updated
 
1348
 
1349
  = 2.0.7 =
1350
 
1351
+ * FIX: Plugin Confliction with JetPack.
1352
+ * TRANSLATION: Languages Updated
1353
 
1354
  = 2.0.6 =
1355
 
1356
+ * TWEAK: Documentation Updated
1357
+ * TRANSLATION: Languages Updated
1358
+ * FIX: CSS Conflicts.
1359
 
1360
  = 2.0.5 =
1361
 
1362
+ * FEATURE: New Functionality Introduced
1363
+ * TWEAK: Documentation Added
1364
+ * FIX: Js Conflicts
1365
 
1366
  = 2.0.4 =
1367
 
1368
+ * FIX: Plugin Update Conflicts.
1369
+ * FIX: Browser Conflicts.
1370
+ * FIX: Js Conflicts.
1371
 
1372
  = 2.0.3 =
1373
 
1374
+ * FIX: Plugin Update Conflicts.
1375
 
1376
  = 2.0.2 =
1377
 
1378
+ * FIX: CSS Conflicts.
1379
+ * FIX: Layout Break in sites.
1380
+ * FIX: Thumbnails Issue.
1381
+ * TRANSLATION: Languages updated
1382
 
1383
  = 2.0.1 =
1384
 
1385
+ * FIX: CSS Conflicts.
1386
  * Timbthumb 2.8.11 Updated
1387
 
1388
  = 2.0.0 =
1389
 
1390
+ * FEATURE: Introduction of New Version 2.0
1391
+ * TWEAK: Introduction of Pagination for Images
1392
+ * TWEAK: Bulk Delete of Images in Album
1393
+ * TWEAK: General Settings for all Albums
1394
+ * TWEAK: Individual Settings for Album
1395
+ * FEATURE: New Design & Style
1396
 
1397
  = 1.8.7 =
1398
 
1399
+ * FIX: Timbthumb Thumbnails Issue.
1400
 
1401
  = 1.8.6 =
1402
 
1403
+ * TWEAK: Readme.txt Updated
1404
+ * TRANSLATION: Languages Updated
1405
 
1406
  = 1.8.5 =
1407
 
1408
+ * FIX: Timbthumb Quality Issues.
1409
+ * FIX: Formatting Issue Resolved
1410
 
1411
  = 1.8.4 =
1412
 
1413
+ * TWEAK: Introduced Sorting of Images in an Album
1414
+ * FIX: Album Formatting conflict.
1415
 
1416
  = 1.8.3 =
1417
 
1418
+ * TWEAK:Introduced Timthumb for Images
1419
+ * FIX: Title Alignment.
1420
+ * FIX: Images were disorted.
1421
 
1422
  = 1.8.2 =
1423
 
1424
+ * FIX: Title Name on Front View & Albums were incorrect
1425
+ * FIX: Title Alignment.
1426
+ * FIX: Images were disorted.
1427
 
1428
  = 1.8.1 =
1429
 
1430
+ * TWEAK: Titles were not saved properly
1431
+ * FIX: Few issues.
1432
 
1433
  = 1.8.0 =
1434
 
1435
+ * TRANSLATION: Added 7 new Languages.
1436
 
1437
  = 1.7.9 =
1438
 
1439
+ * FIX: Issue with Saving Logic.
1440
 
1441
  = 1.7.8 =
1442
 
1443
+ * FIX: Issue with Album creation.
1444
 
1445
  = 1.7.5 =
1446
 
1447
+ * TWEAK: Possible to upload upto 300 images at 1 instance in an album.
1448
+ * TRANSLATION: All Languages updated
 
1449
 
1450
  = 1.7 =
1451
 
1452
+ * TWEAK:Introducing Jquery Masonry
1453
+ * TWEAK: Uninstall Hook Removed
1454
 
1455
  = 1.6 =
1456
 
1457
+ * FIX: Issue of Thumbnail Disorted Images.
1458
+ * FIX: Issue of No Album images shown in case of admin not logged in.
1459
+ * TWEAK: Uninstall Hook Removed
1460
 
1461
  = 1.5 =
1462
 
1463
+ * TWEAK:Album Covers Introduced
1464
+ * FIX: Css Conflicts
1465
+ * TRANSLATION: All Translations Updated
1466
 
1467
  = 1.4 =
1468
 
1469
+ * FIX: Css Conflicts
1470
+ * TRANSLATION: Languages Added Russian, Cezch, Hebrew & Serbian
 
1471
 
1472
  = 1.3 =
1473
 
1474
+ * FIX: Css Conflicts
1475
+ * TRANSLATION: Languages Updated
 
1476
 
1477
  = 1.2 =
1478
 
1479
+ * TWEAK: Lightbox logic changed
1480
+ * FIX: Thumbnails
 
 
 
 
 
1481
 
1482
  = 1.0 =
1483
 
1484
+ * Initial Version Release
user-views/includes/galleries/scripts-before.php CHANGED
@@ -67,6 +67,10 @@ if (isset($layout_type)) {
67
  switch (lightbox_type)
68
  {
69
  case "foo_box_free_edition":
 
 
 
 
70
  var showCount_settings = <?php echo isset($foobox_meta_data["foo_box_show_count"]) ? $foobox_meta_data["foo_box_show_count"] : true; ?>;
71
  var closeOnOverlayClick = <?php echo isset($foobox_meta_data["foo_box_close_overlay_click"]) ? $foobox_meta_data["foo_box_close_overlay_click"] : true; ?>;
72
  var hideScrollbars = <?php echo isset($foobox_meta_data["foo_box_hide_page_scrollbar"]) ? $foobox_meta_data["foo_box_hide_page_scrollbar"] : true; ?>;
@@ -79,8 +83,12 @@ if (isset($layout_type)) {
79
  closeOnOverlayClick: closeOnOverlayClick,
80
  hideScrollbars: hideScrollbars,
81
  captions:
82
- {
83
- onlyShowOnHover: onlyShowOnHover
 
 
 
 
84
  }
85
  };
86
  $(".foobox").foobox(FOOBOX.o);
@@ -90,6 +98,9 @@ if (isset($layout_type)) {
90
  {
91
  FOOBOX.init();
92
  });
 
 
 
93
  break;
94
  }
95
  }
67
  switch (lightbox_type)
68
  {
69
  case "foo_box_free_edition":
70
+ <?php
71
+ if(!class_exists("fooboxV2"))
72
+ {
73
+ ?>
74
  var showCount_settings = <?php echo isset($foobox_meta_data["foo_box_show_count"]) ? $foobox_meta_data["foo_box_show_count"] : true; ?>;
75
  var closeOnOverlayClick = <?php echo isset($foobox_meta_data["foo_box_close_overlay_click"]) ? $foobox_meta_data["foo_box_close_overlay_click"] : true; ?>;
76
  var hideScrollbars = <?php echo isset($foobox_meta_data["foo_box_hide_page_scrollbar"]) ? $foobox_meta_data["foo_box_hide_page_scrollbar"] : true; ?>;
83
  closeOnOverlayClick: closeOnOverlayClick,
84
  hideScrollbars: hideScrollbars,
85
  captions:
86
+ {
87
+ onlyShowOnHover: onlyShowOnHover,
88
+ overrideTitle:true,
89
+ titleSource:'anchor',
90
+ overrideDesc:true,
91
+ descSource:'anchor'
92
  }
93
  };
94
  $(".foobox").foobox(FOOBOX.o);
98
  {
99
  FOOBOX.init();
100
  });
101
+ <?php
102
+ }
103
+ ?>
104
  break;
105
  }
106
  }