kea-rails 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kea-rails/version.rb +1 -1
- data/vendor/assets/components/Keypress/LICENSE +191 -0
- data/vendor/assets/components/Keypress/README.md +78 -0
- data/vendor/assets/components/Keypress/bower.json +28 -0
- data/vendor/assets/components/Keypress/keypress-2.1.0.min.js +33 -0
- data/vendor/assets/components/Keypress/keypress.coffee +921 -0
- data/vendor/assets/components/Keypress/keypress.js +1132 -0
- data/vendor/assets/components/Keypress/package.json +15 -0
- data/vendor/assets/components/attachejs/attache-jquery.js +47 -0
- data/vendor/assets/components/attachejs/attache-knockout.js +56 -0
- data/vendor/assets/components/attachejs/attache.css +10 -0
- data/vendor/assets/components/attachejs/attache.js +589 -0
- data/vendor/assets/components/attachejs/bower.json +36 -0
- data/vendor/assets/components/humane-js/bower.json +8 -0
- data/vendor/assets/components/humane-js/changelog.md +165 -0
- data/vendor/assets/components/humane-js/humane.js +238 -0
- data/vendor/assets/components/humane-js/humane.min.js +11 -0
- data/vendor/assets/components/humane-js/index.html +190 -0
- data/vendor/assets/components/humane-js/package.json +25 -0
- data/vendor/assets/components/humane-js/readme.md +85 -0
- data/vendor/assets/components/humane-js/test/issue23.html +11 -0
- data/vendor/assets/components/humane-js/test/issue36.html +9 -0
- data/vendor/assets/components/humane-js/test/issue38.html +15 -0
- data/vendor/assets/components/humane-js/test/issue49.html +9 -0
- data/vendor/assets/components/humane-js/theme-src/bigbox.styl +65 -0
- data/vendor/assets/components/humane-js/theme-src/boldlight.styl +64 -0
- data/vendor/assets/components/humane-js/theme-src/jackedup.styl +69 -0
- data/vendor/assets/components/humane-js/theme-src/libnotify.styl +61 -0
- data/vendor/assets/components/humane-js/theme-src/original.styl +51 -0
- data/vendor/assets/components/humane-js/themes/bigbox.css +123 -0
- data/vendor/assets/components/humane-js/themes/boldlight.css +122 -0
- data/vendor/assets/components/humane-js/themes/flatty.css +94 -0
- data/vendor/assets/components/humane-js/themes/jackedup.css +123 -0
- data/vendor/assets/components/humane-js/themes/libnotify.css +115 -0
- data/vendor/assets/components/humane-js/themes/original.css +72 -0
- data/vendor/assets/components/knockout-sortable/README.md +129 -0
- data/vendor/assets/components/knockout-sortable/bower.json +15 -0
- data/vendor/assets/components/knockout-sortable/build/knockout-sortable.js +358 -0
- data/vendor/assets/components/knockout-sortable/build/knockout-sortable.min.js +2 -0
- data/vendor/assets/components/uri.js/README.md +437 -0
- data/vendor/assets/components/uri.js/URI.jquery.json +38 -0
- data/vendor/assets/components/uri.js/about-uris.html +156 -0
- data/vendor/assets/components/uri.js/build.html +66 -0
- data/vendor/assets/components/uri.js/build.js +78 -0
- data/vendor/assets/components/uri.js/component.json +15 -0
- data/vendor/assets/components/uri.js/contribute.md +11 -0
- data/vendor/assets/components/uri.js/docs.html +1280 -0
- data/vendor/assets/components/uri.js/index.html +173 -0
- data/vendor/assets/components/uri.js/jquery-1.10.2.min.js +6 -0
- data/vendor/assets/components/uri.js/jquery-1.7.2.min.js +4 -0
- data/vendor/assets/components/uri.js/jquery-1.8.2.min.js +2 -0
- data/vendor/assets/components/uri.js/jquery-1.9.1.min.js +5 -0
- data/vendor/assets/components/uri.js/jquery-uri-plugin.html +203 -0
- data/vendor/assets/components/uri.js/package.json +75 -0
- data/vendor/assets/components/uri.js/prettify/lang-apollo.js +2 -0
- data/vendor/assets/components/uri.js/prettify/lang-clj.js +18 -0
- data/vendor/assets/components/uri.js/prettify/lang-css.js +2 -0
- data/vendor/assets/components/uri.js/prettify/lang-go.js +1 -0
- data/vendor/assets/components/uri.js/prettify/lang-hs.js +2 -0
- data/vendor/assets/components/uri.js/prettify/lang-lisp.js +3 -0
- data/vendor/assets/components/uri.js/prettify/lang-lua.js +2 -0
- data/vendor/assets/components/uri.js/prettify/lang-ml.js +2 -0
- data/vendor/assets/components/uri.js/prettify/lang-n.js +4 -0
- data/vendor/assets/components/uri.js/prettify/lang-proto.js +1 -0
- data/vendor/assets/components/uri.js/prettify/lang-scala.js +2 -0
- data/vendor/assets/components/uri.js/prettify/lang-sql.js +2 -0
- data/vendor/assets/components/uri.js/prettify/lang-tex.js +1 -0
- data/vendor/assets/components/uri.js/prettify/lang-vb.js +2 -0
- data/vendor/assets/components/uri.js/prettify/lang-vhdl.js +3 -0
- data/vendor/assets/components/uri.js/prettify/lang-wiki.js +2 -0
- data/vendor/assets/components/uri.js/prettify/lang-xq.js +3 -0
- data/vendor/assets/components/uri.js/prettify/lang-yaml.js +2 -0
- data/vendor/assets/components/uri.js/prettify/prettify.css +1 -0
- data/vendor/assets/components/uri.js/prettify/prettify.js +28 -0
- data/vendor/assets/components/uri.js/prettify/prettify.sunburst.css +52 -0
- data/vendor/assets/components/uri.js/screen.css +167 -0
- data/vendor/assets/components/uri.js/screen.js +39 -0
- data/vendor/assets/components/uri.js/src/IPv6.js +185 -0
- data/vendor/assets/components/uri.js/src/SecondLevelDomains.js +220 -0
- data/vendor/assets/components/uri.js/src/URI.fragmentQuery.js +103 -0
- data/vendor/assets/components/uri.js/src/URI.fragmentURI.js +96 -0
- data/vendor/assets/components/uri.js/src/URI.js +1938 -0
- data/vendor/assets/components/uri.js/src/URI.min.js +81 -0
- data/vendor/assets/components/uri.js/src/URITemplate.js +494 -0
- data/vendor/assets/components/uri.js/src/jquery.URI.js +232 -0
- data/vendor/assets/components/uri.js/src/jquery.URI.min.js +7 -0
- data/vendor/assets/components/uri.js/src/punycode.js +508 -0
- data/vendor/assets/components/uri.js/test/index.html +26 -0
- data/vendor/assets/components/uri.js/test/pre_libs.js +4 -0
- data/vendor/assets/components/uri.js/test/qunit/qunit-composite.css +13 -0
- data/vendor/assets/components/uri.js/test/qunit/qunit-composite.js +167 -0
- data/vendor/assets/components/uri.js/test/qunit/qunit.css +244 -0
- data/vendor/assets/components/uri.js/test/qunit/qunit.js +2212 -0
- data/vendor/assets/components/uri.js/test/test.URI.html +26 -0
- data/vendor/assets/components/uri.js/test/test.fragmentQuery.html +31 -0
- data/vendor/assets/components/uri.js/test/test.fragmentURI.html +31 -0
- data/vendor/assets/components/uri.js/test/test.jQuery-1.10.html +31 -0
- data/vendor/assets/components/uri.js/test/test.jQuery-1.7.html +31 -0
- data/vendor/assets/components/uri.js/test/test.jQuery-1.8.html +31 -0
- data/vendor/assets/components/uri.js/test/test.jQuery-1.9.html +31 -0
- data/vendor/assets/components/uri.js/test/test.js +1409 -0
- data/vendor/assets/components/uri.js/test/test_fragmentQuery.js +57 -0
- data/vendor/assets/components/uri.js/test/test_fragmentURI.js +59 -0
- data/vendor/assets/components/uri.js/test/test_jim.js +143 -0
- data/vendor/assets/components/uri.js/test/test_jquery.js +138 -0
- data/vendor/assets/components/uri.js/test/test_template.js +385 -0
- data/vendor/assets/components/uri.js/test/urls.js +1236 -0
- data/vendor/assets/components/uri.js/uri-template.html +234 -0
- data/vendor/assets/components/uri.js/utils/SLDs.php +37 -0
- data/vendor/assets/components/uri.js/utils/sld.js +101 -0
- data/vendor/assets/components/veiljs/bower.json +36 -0
- data/vendor/assets/components/veiljs/veil-jquery.js +47 -0
- data/vendor/assets/components/veiljs/veil-knockout.js +55 -0
- data/vendor/assets/components/veiljs/veil.js +465 -0
- data/vendor/assets/javascripts/fuse.js +472 -0
- data/vendor/assets/javascripts/jquery-ui.js +3844 -0
- data/vendor/assets/javascripts/knockout-3.2.0-debug.js +5299 -0
- data/vendor/assets/javascripts/moment.js +1902 -0
- data/vendor/assets/javascripts/pikaday.js +896 -0
- data/vendor/assets/stylesheets/pikaday.css +171 -0
- metadata +120 -1
@@ -0,0 +1,465 @@
|
|
1
|
+
// Expose plugin as an AMD module if AMD loader is present:
|
2
|
+
(function (factory) {
|
3
|
+
'use strict';
|
4
|
+
|
5
|
+
if (typeof define === 'function' && define.amd) {
|
6
|
+
define(['jquery'], factory);
|
7
|
+
} else {
|
8
|
+
window.Veil = factory(jQuery);
|
9
|
+
}
|
10
|
+
|
11
|
+
}(function ($) {
|
12
|
+
'use strict';
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Veil
|
16
|
+
*
|
17
|
+
* @class
|
18
|
+
* @global
|
19
|
+
* @param {Object} [options]
|
20
|
+
* @param {String} [options.overlayClass] - additional CSS class(es) to apply to the overlay markup
|
21
|
+
* @param {Boolean} [options.listenToCustomEvents=false] - listen to 'close.veil' on the overlay element
|
22
|
+
* @param {Boolean} [options.debug=false] - provide debug information and error handling in the console
|
23
|
+
*
|
24
|
+
* @param {Object} [callbacks] - callbacks to be triggered at various lifecycle moments
|
25
|
+
* @param {afterCreateCallback} [callbacks.afterCreate] - called after the overlay markup has been created
|
26
|
+
* @param {afterShowCallback} [callbacks.afterShow] - called each time after the overlay is shown
|
27
|
+
*/
|
28
|
+
function Veil(options, callbacks) {
|
29
|
+
var that = this;
|
30
|
+
|
31
|
+
this.$overlay;
|
32
|
+
|
33
|
+
this.options = $.extend({}, this.defaults, options);
|
34
|
+
|
35
|
+
this.callbacks = {
|
36
|
+
'afterCreate': [],
|
37
|
+
'beforeShow': [],
|
38
|
+
'afterShow': [],
|
39
|
+
'afterHide': []
|
40
|
+
};
|
41
|
+
|
42
|
+
if (typeof callbacks !== 'undefined') {
|
43
|
+
for(var callbackName in callbacks){
|
44
|
+
if (callbacks.hasOwnProperty(callbackName)) {
|
45
|
+
this.addCallback(callbackName, callbacks[callbackName]);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
this.initialize();
|
51
|
+
}
|
52
|
+
|
53
|
+
// Veil "class methods"
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Options affecting all Veil instances
|
57
|
+
*
|
58
|
+
* @memberOf Veil
|
59
|
+
* @static
|
60
|
+
* @public
|
61
|
+
*/
|
62
|
+
Veil.globalOptions = {
|
63
|
+
/**
|
64
|
+
* The markup used to create the backdrop. Set to null to disable the backdrop
|
65
|
+
*/
|
66
|
+
backdropMarkup: "<div class='veil-backdrop'></div>",
|
67
|
+
/**
|
68
|
+
* see README for information
|
69
|
+
*/
|
70
|
+
cssTransitionSupport: true
|
71
|
+
};
|
72
|
+
|
73
|
+
/**
|
74
|
+
* A jQuery object of the backdrop DOM element
|
75
|
+
*
|
76
|
+
* @memberOf Veil
|
77
|
+
* @static
|
78
|
+
* @public
|
79
|
+
*/
|
80
|
+
Veil.$backdrop = null;
|
81
|
+
|
82
|
+
/**
|
83
|
+
* All instances that are currently active on the page
|
84
|
+
*
|
85
|
+
* @memberOf Veil
|
86
|
+
* @static
|
87
|
+
* @private
|
88
|
+
*/
|
89
|
+
Veil.activeInstances = [];
|
90
|
+
|
91
|
+
/**
|
92
|
+
* Activate an overlay instance
|
93
|
+
*
|
94
|
+
* @memberOf Veil
|
95
|
+
* @static
|
96
|
+
* @private
|
97
|
+
* @param {Veil} instance
|
98
|
+
*/
|
99
|
+
Veil.instanceActivates = function instanceActivates(instance) {
|
100
|
+
if (!Veil.backdropExists() && Veil.globalOptions.backdropMarkup !== null) {
|
101
|
+
Veil.$backdrop = $(Veil.globalOptions.backdropMarkup);
|
102
|
+
|
103
|
+
$('body').append(Veil.$backdrop);
|
104
|
+
}
|
105
|
+
|
106
|
+
if (Veil.backdropExists() && !Veil.backdropIsActive()) {
|
107
|
+
Veil.activateElement(Veil.$backdrop);
|
108
|
+
}
|
109
|
+
|
110
|
+
Veil.activeInstances.push(instance);
|
111
|
+
};
|
112
|
+
|
113
|
+
/**
|
114
|
+
* Deactivate an overlay instance
|
115
|
+
*
|
116
|
+
* @memberOf Veil
|
117
|
+
* @static
|
118
|
+
* @private
|
119
|
+
* @param {Veil} instance
|
120
|
+
*/
|
121
|
+
Veil.instanceDeactivates = function instanceDeactivates(instance) {
|
122
|
+
var indexPosition = Veil.activeInstances.indexOf(instance);
|
123
|
+
|
124
|
+
if (indexPosition !== -1) {
|
125
|
+
Veil.activeInstances.splice(indexPosition, 1);
|
126
|
+
}
|
127
|
+
|
128
|
+
if (Veil.activeInstances.length === 0 && Veil.backdropIsActive()) {
|
129
|
+
Veil.deactivateElement(Veil.$backdrop);
|
130
|
+
}
|
131
|
+
};
|
132
|
+
|
133
|
+
/**
|
134
|
+
* Marks a DOM element as active through CSS classes
|
135
|
+
*
|
136
|
+
* @memberOf Veil
|
137
|
+
* @static
|
138
|
+
* @private
|
139
|
+
* @param {jQuery} $element
|
140
|
+
*/
|
141
|
+
Veil.activateElement = function activateElement($element) {
|
142
|
+
$element.addClass('activating');
|
143
|
+
|
144
|
+
// use a timeout to make sure adding and removing .activating is not
|
145
|
+
// coalesced into a single step
|
146
|
+
setTimeout(function(){
|
147
|
+
$element.removeClass('activating').addClass('active');
|
148
|
+
}, 1);
|
149
|
+
};
|
150
|
+
|
151
|
+
/**
|
152
|
+
* Marks a DOM element as not active through CSS classes
|
153
|
+
*
|
154
|
+
* @memberOf Veil
|
155
|
+
* @static
|
156
|
+
* @private
|
157
|
+
* @param {jQuery} $element
|
158
|
+
*/
|
159
|
+
Veil.deactivateElement = function deactivateElement($element) {
|
160
|
+
$element.removeClass('active');
|
161
|
+
|
162
|
+
if (Veil.globalOptions.cssTransitionSupport) {
|
163
|
+
$element.addClass('deactivating');
|
164
|
+
|
165
|
+
$element.one('transitionend webkitTransitionEnd', function() {
|
166
|
+
$element.removeClass('deactivating');
|
167
|
+
});
|
168
|
+
}
|
169
|
+
};
|
170
|
+
|
171
|
+
/**
|
172
|
+
* Does the backdrop markup exist in the DOM?
|
173
|
+
*
|
174
|
+
* .closest('html') lets us test whether the element actually exists in the DOM
|
175
|
+
* or has been removed from it
|
176
|
+
* -> http://stackoverflow.com/a/3086084/100342 (comments)
|
177
|
+
*
|
178
|
+
* @memberOf Veil
|
179
|
+
* @static
|
180
|
+
* @private
|
181
|
+
*/
|
182
|
+
Veil.backdropExists = function backdropExists() {
|
183
|
+
return Veil.$backdrop !== null && Veil.$backdrop.closest('html').length === 1;
|
184
|
+
};
|
185
|
+
|
186
|
+
/**
|
187
|
+
* Is the backdrop currently active?
|
188
|
+
*
|
189
|
+
* @memberOf Veil
|
190
|
+
* @static
|
191
|
+
* @private
|
192
|
+
*/
|
193
|
+
Veil.backdropIsActive = function backdropIsActive() {
|
194
|
+
return Veil.backdropExists() && (Veil.$backdrop.hasClass('activating') || Veil.$backdrop.hasClass('active'));
|
195
|
+
};
|
196
|
+
|
197
|
+
// Veil "instance methods"
|
198
|
+
|
199
|
+
Veil.prototype = (function() {
|
200
|
+
|
201
|
+
var defaults,
|
202
|
+
initialize,
|
203
|
+
show,
|
204
|
+
hide,
|
205
|
+
destroy,
|
206
|
+
overlay,
|
207
|
+
exists,
|
208
|
+
isActive,
|
209
|
+
setContent,
|
210
|
+
addCallback,
|
211
|
+
_createMarkup,
|
212
|
+
_hasCallbackFor,
|
213
|
+
_executeCallbacksFor,
|
214
|
+
_debug;
|
215
|
+
|
216
|
+
defaults = {
|
217
|
+
debug: true
|
218
|
+
};
|
219
|
+
|
220
|
+
initialize = function initialize() {
|
221
|
+
|
222
|
+
};
|
223
|
+
|
224
|
+
/**
|
225
|
+
* Show the overlay. Create the markup first if it does not exist yet
|
226
|
+
*
|
227
|
+
* @memberOf Veil
|
228
|
+
* @instance
|
229
|
+
* @public
|
230
|
+
*/
|
231
|
+
show = function show() {
|
232
|
+
var that = this;
|
233
|
+
|
234
|
+
if ( !this.exists() ) {
|
235
|
+
_createMarkup.call(this);
|
236
|
+
}
|
237
|
+
|
238
|
+
_executeCallbacksFor.call(this, 'beforeShow', this.$overlay);
|
239
|
+
|
240
|
+
Veil.instanceActivates(this);
|
241
|
+
Veil.activateElement(this.$overlay);
|
242
|
+
|
243
|
+
if (this.options.listenToCustomEvents) {
|
244
|
+
this.$overlay.on('hide.veil', function() {
|
245
|
+
that.hide();
|
246
|
+
|
247
|
+
return false;
|
248
|
+
});
|
249
|
+
}
|
250
|
+
|
251
|
+
_executeCallbacksFor.call(this, 'afterShow', this.$overlay);
|
252
|
+
};
|
253
|
+
|
254
|
+
/**
|
255
|
+
* Hide the overlay
|
256
|
+
*
|
257
|
+
* @memberOf Veil
|
258
|
+
* @instance
|
259
|
+
* @public
|
260
|
+
*/
|
261
|
+
hide = function hide() {
|
262
|
+
if (!this.isActive()) {
|
263
|
+
return false;
|
264
|
+
}
|
265
|
+
|
266
|
+
Veil.instanceDeactivates(this);
|
267
|
+
Veil.deactivateElement(this.$overlay);
|
268
|
+
|
269
|
+
if (this.options.listenToCustomEvents) {
|
270
|
+
this.$overlay.off('hide.veil');
|
271
|
+
_executeCallbacksFor.call(this, 'afterHide', this.$overlay);
|
272
|
+
}
|
273
|
+
};
|
274
|
+
|
275
|
+
/**
|
276
|
+
* A jQuery object of the overlay markup in the DOM
|
277
|
+
*
|
278
|
+
* @memberOf Veil
|
279
|
+
* @instance
|
280
|
+
* @public
|
281
|
+
* @returns {jQuery}
|
282
|
+
*/
|
283
|
+
overlay = function overlay() {
|
284
|
+
if ( !this.exists() ) {
|
285
|
+
_createMarkup.call(this);
|
286
|
+
}
|
287
|
+
|
288
|
+
return this.$overlay;
|
289
|
+
};
|
290
|
+
|
291
|
+
/**
|
292
|
+
* Does the overlay markup exist in the DOM?
|
293
|
+
*
|
294
|
+
* @memberOf Veil
|
295
|
+
* @instance
|
296
|
+
* @public
|
297
|
+
* @returns {Boolean}
|
298
|
+
*/
|
299
|
+
exists = function exists() {
|
300
|
+
return typeof this.$overlay !== 'undefined' && this.$overlay !== null && this.$overlay.length === 1;
|
301
|
+
};
|
302
|
+
|
303
|
+
/**
|
304
|
+
* Is this overlay currently active?
|
305
|
+
*
|
306
|
+
* @memberOf Veil
|
307
|
+
* @instance
|
308
|
+
* @public
|
309
|
+
* @returns {Boolean}
|
310
|
+
*/
|
311
|
+
isActive = function isActive() {
|
312
|
+
return this.exists() && (this.$overlay.hasClass('activating') || this.$overlay.hasClass('active'));
|
313
|
+
};
|
314
|
+
|
315
|
+
/**
|
316
|
+
* Modifies the content markup of the overlay
|
317
|
+
*
|
318
|
+
* @memberOf Veil
|
319
|
+
* @instance
|
320
|
+
* @public
|
321
|
+
* @param {String} content
|
322
|
+
*/
|
323
|
+
setContent = function setContent(content) {
|
324
|
+
this.content = content;
|
325
|
+
|
326
|
+
if (this.exists()) {
|
327
|
+
this.$overlay.html(this.content);
|
328
|
+
}
|
329
|
+
};
|
330
|
+
|
331
|
+
/**
|
332
|
+
* Hide the overlay, remove it from DOM and remove event handlers from the anchor element
|
333
|
+
*
|
334
|
+
* @memberOf Veil
|
335
|
+
* @instance
|
336
|
+
* @public
|
337
|
+
*/
|
338
|
+
destroy = function destroy() {
|
339
|
+
if ( !this.exists() ) {
|
340
|
+
return false;
|
341
|
+
}
|
342
|
+
|
343
|
+
Veil.instanceDeactivates(this);
|
344
|
+
|
345
|
+
this.$overlay.remove();
|
346
|
+
this.$overlay = null;
|
347
|
+
};
|
348
|
+
|
349
|
+
/**
|
350
|
+
* Create the popover markup in the DOM
|
351
|
+
*
|
352
|
+
* @memberOf Veil
|
353
|
+
* @instance
|
354
|
+
* @private
|
355
|
+
*/
|
356
|
+
_createMarkup = function _createMarkup() {
|
357
|
+
this.$overlay = $('<div class="veil-overlay"></div>').addClass(this.options.overlayClass);
|
358
|
+
|
359
|
+
this.$overlay.html(this.content);
|
360
|
+
|
361
|
+
$('body').append(this.$overlay);
|
362
|
+
|
363
|
+
_executeCallbacksFor.call(this, 'afterCreate', this.$overlay);
|
364
|
+
};
|
365
|
+
|
366
|
+
/**
|
367
|
+
* Add a callback that is executed at trigger
|
368
|
+
*
|
369
|
+
* @memberOf Veil
|
370
|
+
* @instance
|
371
|
+
* @public
|
372
|
+
* @param {String} trigger - at what point in the lifecycle to trigger the callback
|
373
|
+
* @param {Function} callback
|
374
|
+
*/
|
375
|
+
addCallback = function addCallback(trigger, callback) {
|
376
|
+
if (typeof this.callbacks[trigger] === 'undefined') {
|
377
|
+
_debug.call(this, "Warning: unknown callback %s will never be triggered", trigger);
|
378
|
+
return false;
|
379
|
+
}
|
380
|
+
|
381
|
+
this.callbacks[trigger].push(callback);
|
382
|
+
};
|
383
|
+
|
384
|
+
/**
|
385
|
+
* Tests whether one or more callbacks are available for the given trigger
|
386
|
+
*
|
387
|
+
* @memberOf Veil
|
388
|
+
* @instance
|
389
|
+
* @private
|
390
|
+
* @param {String} trigger
|
391
|
+
* @returns {Boolean}
|
392
|
+
*/
|
393
|
+
_hasCallbackFor = function _hasCallbackFor(trigger) {
|
394
|
+
return typeof this.callbacks[trigger] !== 'undefined' && this.callbacks[trigger].length > 0;
|
395
|
+
};
|
396
|
+
|
397
|
+
/**
|
398
|
+
* Execute all callbacks for a given trigger
|
399
|
+
*
|
400
|
+
* @memberOf Veil
|
401
|
+
* @instance
|
402
|
+
* @private
|
403
|
+
* @param {String} trigger
|
404
|
+
* @param {...mixed} arguments - arguments to be handed to the callbacks
|
405
|
+
*/
|
406
|
+
_executeCallbacksFor = function _executeCallbacksFor(trigger) {
|
407
|
+
var that = this,
|
408
|
+
callbackArguments = Array.prototype.slice.call(arguments);
|
409
|
+
|
410
|
+
// remove the trigger name
|
411
|
+
callbackArguments.shift();
|
412
|
+
|
413
|
+
if (_hasCallbackFor.call(this, trigger)) {
|
414
|
+
this.callbacks[trigger].forEach(function(cb) { cb.apply(that, callbackArguments); });
|
415
|
+
}
|
416
|
+
};
|
417
|
+
|
418
|
+
/**
|
419
|
+
* Write a debug message to console if debugging is enabled
|
420
|
+
*
|
421
|
+
* @memberOf Veil
|
422
|
+
* @instance
|
423
|
+
* @private
|
424
|
+
* @param {...mixed} - all arguments are handed to console.log
|
425
|
+
*/
|
426
|
+
_debug = function _debug() {
|
427
|
+
if (this.options.debug) {
|
428
|
+
console.log.apply( console, Array.prototype.slice.call(arguments) );
|
429
|
+
}
|
430
|
+
};
|
431
|
+
|
432
|
+
return {
|
433
|
+
defaults: defaults,
|
434
|
+
initialize: initialize,
|
435
|
+
show: show,
|
436
|
+
hide: hide,
|
437
|
+
destroy: destroy,
|
438
|
+
overlay: overlay,
|
439
|
+
exists: exists,
|
440
|
+
isActive: isActive,
|
441
|
+
setContent: setContent,
|
442
|
+
addCallback: addCallback
|
443
|
+
};
|
444
|
+
})();
|
445
|
+
|
446
|
+
return Veil;
|
447
|
+
}));
|
448
|
+
|
449
|
+
/**
|
450
|
+
* Callback called after the overlay markup has been created
|
451
|
+
*
|
452
|
+
* @callback afterCreateCallback
|
453
|
+
* @this Veil
|
454
|
+
*
|
455
|
+
* @param {jQuery} overlayElement
|
456
|
+
*/
|
457
|
+
|
458
|
+
/**
|
459
|
+
* Callback called after a overlay has been displayed
|
460
|
+
*
|
461
|
+
* @callback afterShowCallback
|
462
|
+
* @this Veil
|
463
|
+
*
|
464
|
+
* @param {jQuery} overlayElement
|
465
|
+
*/
|