card-mod-script 0.13.2 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/assets/script/decko/components.js.coffee +3 -0
- data/assets/script/decko/decko.js.coffee +0 -15
- data/assets/script/decko/editor.js.coffee +3 -1
- data/assets/script/decko/filter.js.coffee +14 -7
- data/assets/script/decko/filter_links.js.coffee +2 -2
- data/assets/script/decko/mod.js.coffee +2 -8
- data/assets/script/decko/name_editor.js.coffee +0 -18
- data/assets/script/decko/overlay.js.coffee +0 -3
- data/assets/script/{script_pointer_config.js.coffee → decko/pointer_config.js.coffee} +1 -2
- data/assets/script/{script_pointer_list_editor.js.coffee → decko/pointer_list_editor.js.coffee} +0 -0
- data/assets/script/decko/slot.js.coffee +3 -3
- data/assets/script/decko/slot_ready.js.coffee +1 -0
- data/assets/script/decko/slotter.js.coffee +23 -31
- data/assets/script/decko/type_editor.js.coffee +21 -0
- data/assets/script/decko/upload.js.coffee +12 -5
- data/assets/script/jquery-ui.min.js +13 -0
- data/assets/script/manifest.yml +16 -3
- data/init/early/init_execjs.rb +3 -0
- data/set/abstract/00_script.rb +30 -31
- data/set/abstract/01_asset_script.rb +0 -16
- data/set/abstract/{script_asset_list.rb → script_group.rb} +12 -13
- data/set/all/head_javascript.rb +12 -8
- data/set/right/script.rb +1 -14
- data/set/type/local_script_folder_group.rb +2 -2
- data/set/type/local_script_manifest_group.rb +1 -1
- data/set/type_plus_right/mod/script.rb +56 -0
- data/set/type_plus_right/set/script.rb +7 -0
- data/vendor/jquery_file_upload/LICENSE.txt +11 -12
- data/vendor/jquery_file_upload/README.md +189 -72
- data/vendor/jquery_file_upload/SECURITY.md +227 -0
- data/vendor/jquery_file_upload/VULNERABILITIES.md +118 -0
- data/vendor/jquery_file_upload/cors/postmessage.html +68 -58
- data/vendor/jquery_file_upload/cors/result.html +12 -10
- data/vendor/jquery_file_upload/css/jquery.fileupload-ui.css +24 -13
- data/vendor/jquery_file_upload/css/jquery.fileupload.css +3 -4
- data/vendor/jquery_file_upload/docker-compose.yml +55 -0
- data/vendor/jquery_file_upload/index.html +332 -230
- data/vendor/jquery_file_upload/js/cors/jquery.postmessage-transport.js +109 -109
- data/vendor/jquery_file_upload/js/cors/jquery.xdr-transport.js +81 -73
- data/vendor/jquery_file_upload/js/demo.js +75 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload-audio.js +82 -94
- data/vendor/jquery_file_upload/js/jquery.fileupload-image.js +321 -300
- data/vendor/jquery_file_upload/js/jquery.fileupload-process.js +138 -146
- data/vendor/jquery_file_upload/js/jquery.fileupload-ui.js +737 -692
- data/vendor/jquery_file_upload/js/jquery.fileupload-validate.js +91 -97
- data/vendor/jquery_file_upload/js/jquery.fileupload-video.js +82 -94
- data/vendor/jquery_file_upload/js/jquery.fileupload.js +1569 -1451
- data/vendor/jquery_file_upload/js/jquery.iframe-transport.js +208 -205
- data/vendor/jquery_file_upload/js/vendor/jquery.ui.widget.js +397 -340
- data/vendor/jquery_file_upload/package-lock.json +6853 -0
- data/vendor/jquery_file_upload/package.json +71 -10
- data/vendor/jquery_file_upload/server/gae-python/app.yaml +11 -10
- data/vendor/jquery_file_upload/server/php/Dockerfile +23 -17
- data/vendor/jquery_file_upload/server/php/UploadHandler.php +206 -137
- data/vendor/jquery_file_upload/server/php/php.ini +5 -0
- data/vendor/jquery_file_upload/test/index.html +36 -159
- data/vendor/jquery_file_upload/test/unit.js +989 -0
- data/vendor/jquery_file_upload/test/vendor/chai.js +10854 -0
- data/vendor/jquery_file_upload/test/vendor/mocha.css +325 -0
- data/vendor/jquery_file_upload/test/vendor/mocha.js +18178 -0
- data/vendor/jquery_file_upload/wdio/LICENSE.txt +20 -0
- data/vendor/jquery_file_upload/wdio/assets/black+white-3x2.jpg +0 -0
- data/vendor/jquery_file_upload/wdio/assets/black+white-60x40.gif +0 -0
- data/vendor/jquery_file_upload/wdio/conf/chrome.js +40 -0
- data/vendor/jquery_file_upload/wdio/conf/firefox.js +25 -0
- data/vendor/jquery_file_upload/wdio/hooks/index.js +36 -0
- data/vendor/jquery_file_upload/wdio/test/pages/file-upload.js +79 -0
- data/vendor/jquery_file_upload/wdio/test/specs/01-file-upload.js +25 -0
- data/vendor/jquery_file_upload/wdio/wdio.conf.js +4 -0
- metadata +36 -53
- data/assets/script/jquery-ui.js +0 -10
- data/file/mod_script_script_decko_machine_output/file.js +0 -2710
- data/file/mod_script_script_jquery_machine_output/file.js +0 -12924
- data/lib/javascript/script_html5shiv_printshiv.js +0 -1
- data/set/self/script_html5shiv_printshiv.rb +0 -11
- data/set/self/script_mods.rb +0 -1
- data/set/type/mod_script_assets.rb +0 -21
- data/vendor/jquery_file_upload/CONTRIBUTING.md +0 -15
- data/vendor/jquery_file_upload/angularjs.html +0 -211
- data/vendor/jquery_file_upload/basic-plus.html +0 -226
- data/vendor/jquery_file_upload/basic.html +0 -136
- data/vendor/jquery_file_upload/bower-version-update.js +0 -16
- data/vendor/jquery_file_upload/bower.json +0 -64
- data/vendor/jquery_file_upload/css/jquery-ui-demo-ie8.css +0 -21
- data/vendor/jquery_file_upload/css/jquery-ui-demo.css +0 -67
- data/vendor/jquery_file_upload/css/style.css +0 -15
- data/vendor/jquery_file_upload/jquery-ui.html +0 -252
- data/vendor/jquery_file_upload/js/app.js +0 -101
- data/vendor/jquery_file_upload/js/jquery.fileupload-angular.js +0 -437
- data/vendor/jquery_file_upload/js/jquery.fileupload-jquery-ui.js +0 -161
- data/vendor/jquery_file_upload/js/main.js +0 -75
- data/vendor/jquery_file_upload/server/gae-go/app/main.go +0 -361
- data/vendor/jquery_file_upload/server/gae-go/app.yaml +0 -12
- data/vendor/jquery_file_upload/server/gae-go/static/favicon.ico +0 -0
- data/vendor/jquery_file_upload/server/gae-go/static/robots.txt +0 -2
- data/vendor/jquery_file_upload/server/php/docker-compose.yml +0 -9
- data/vendor/jquery_file_upload/test/test.js +0 -1292
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
/*! jQuery UI - v1.12.1 -
|
|
1
|
+
/*! jQuery UI - v1.12.1+0b7246b6eeadfa9e2696e22f3230f6452f8129dc - 2020-02-20
|
|
2
2
|
* http://jqueryui.com
|
|
3
3
|
* Includes: widget.js
|
|
4
4
|
* Copyright jQuery Foundation and other contributors; Licensed MIT */
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/* global define, require */
|
|
7
|
+
/* eslint-disable no-param-reassign, new-cap, jsdoc/require-jsdoc */
|
|
8
8
|
|
|
9
|
+
(function (factory) {
|
|
10
|
+
'use strict';
|
|
11
|
+
if (typeof define === 'function' && define.amd) {
|
|
9
12
|
// AMD. Register as an anonymous module.
|
|
10
|
-
define([
|
|
13
|
+
define(['jquery'], factory);
|
|
14
|
+
} else if (typeof exports === 'object') {
|
|
15
|
+
// Node/CommonJS
|
|
16
|
+
factory(require('jquery'));
|
|
11
17
|
} else {
|
|
12
|
-
|
|
13
18
|
// Browser globals
|
|
14
|
-
factory(
|
|
19
|
+
factory(window.jQuery);
|
|
15
20
|
}
|
|
16
|
-
}(function(
|
|
21
|
+
})(function ($) {
|
|
22
|
+
('use strict');
|
|
17
23
|
|
|
18
24
|
$.ui = $.ui || {};
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
$.ui.version = '1.12.1';
|
|
22
27
|
|
|
23
28
|
/*!
|
|
24
29
|
* jQuery UI Widget 1.12.1
|
|
@@ -35,105 +40,111 @@
|
|
|
35
40
|
//>>docs: http://api.jqueryui.com/jQuery.widget/
|
|
36
41
|
//>>demos: http://jqueryui.com/widget/
|
|
37
42
|
|
|
43
|
+
// Support: jQuery 1.9.x or older
|
|
44
|
+
// $.expr[ ":" ] is deprecated.
|
|
45
|
+
if (!$.expr.pseudos) {
|
|
46
|
+
$.expr.pseudos = $.expr[':'];
|
|
47
|
+
}
|
|
38
48
|
|
|
49
|
+
// Support: jQuery 1.11.x or older
|
|
50
|
+
// $.unique has been renamed to $.uniqueSort
|
|
51
|
+
if (!$.uniqueSort) {
|
|
52
|
+
$.uniqueSort = $.unique;
|
|
53
|
+
}
|
|
39
54
|
|
|
40
55
|
var widgetUuid = 0;
|
|
56
|
+
var widgetHasOwnProperty = Array.prototype.hasOwnProperty;
|
|
41
57
|
var widgetSlice = Array.prototype.slice;
|
|
42
58
|
|
|
43
|
-
$.cleanData = (
|
|
44
|
-
return function(
|
|
59
|
+
$.cleanData = (function (orig) {
|
|
60
|
+
return function (elems) {
|
|
45
61
|
var events, elem, i;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Http://bugs.jquery.com/ticket/8235
|
|
56
|
-
} catch ( e ) {}
|
|
62
|
+
// eslint-disable-next-line eqeqeq
|
|
63
|
+
for (i = 0; (elem = elems[i]) != null; i++) {
|
|
64
|
+
// Only trigger remove when necessary to save time
|
|
65
|
+
events = $._data(elem, 'events');
|
|
66
|
+
if (events && events.remove) {
|
|
67
|
+
$(elem).triggerHandler('remove');
|
|
68
|
+
}
|
|
57
69
|
}
|
|
58
|
-
orig(
|
|
70
|
+
orig(elems);
|
|
59
71
|
};
|
|
60
|
-
}
|
|
72
|
+
})($.cleanData);
|
|
61
73
|
|
|
62
|
-
$.widget = function(
|
|
74
|
+
$.widget = function (name, base, prototype) {
|
|
63
75
|
var existingConstructor, constructor, basePrototype;
|
|
64
76
|
|
|
65
77
|
// ProxiedPrototype allows the provided prototype to remain unmodified
|
|
66
78
|
// so that it can be used as a mixin for multiple widgets (#8876)
|
|
67
79
|
var proxiedPrototype = {};
|
|
68
80
|
|
|
69
|
-
var namespace = name.split(
|
|
70
|
-
name = name.split(
|
|
71
|
-
var fullName = namespace +
|
|
81
|
+
var namespace = name.split('.')[0];
|
|
82
|
+
name = name.split('.')[1];
|
|
83
|
+
var fullName = namespace + '-' + name;
|
|
72
84
|
|
|
73
|
-
if (
|
|
85
|
+
if (!prototype) {
|
|
74
86
|
prototype = base;
|
|
75
87
|
base = $.Widget;
|
|
76
88
|
}
|
|
77
89
|
|
|
78
|
-
if (
|
|
79
|
-
prototype = $.extend.apply(
|
|
90
|
+
if ($.isArray(prototype)) {
|
|
91
|
+
prototype = $.extend.apply(null, [{}].concat(prototype));
|
|
80
92
|
}
|
|
81
93
|
|
|
82
94
|
// Create selector for plugin
|
|
83
|
-
$.expr[
|
|
84
|
-
return !!$.data(
|
|
95
|
+
$.expr.pseudos[fullName.toLowerCase()] = function (elem) {
|
|
96
|
+
return !!$.data(elem, fullName);
|
|
85
97
|
};
|
|
86
98
|
|
|
87
|
-
$[
|
|
88
|
-
existingConstructor = $[
|
|
89
|
-
constructor = $[
|
|
90
|
-
|
|
99
|
+
$[namespace] = $[namespace] || {};
|
|
100
|
+
existingConstructor = $[namespace][name];
|
|
101
|
+
constructor = $[namespace][name] = function (options, element) {
|
|
91
102
|
// Allow instantiation without "new" keyword
|
|
92
|
-
if (
|
|
93
|
-
return new constructor(
|
|
103
|
+
if (!this._createWidget) {
|
|
104
|
+
return new constructor(options, element);
|
|
94
105
|
}
|
|
95
106
|
|
|
96
107
|
// Allow instantiation without initializing for simple inheritance
|
|
97
108
|
// must use "new" keyword (the code above always passes args)
|
|
98
|
-
if (
|
|
99
|
-
this._createWidget(
|
|
109
|
+
if (arguments.length) {
|
|
110
|
+
this._createWidget(options, element);
|
|
100
111
|
}
|
|
101
112
|
};
|
|
102
113
|
|
|
103
114
|
// Extend with the existing constructor to carry over any static properties
|
|
104
|
-
$.extend(
|
|
115
|
+
$.extend(constructor, existingConstructor, {
|
|
105
116
|
version: prototype.version,
|
|
106
117
|
|
|
107
118
|
// Copy the object used to create the prototype in case we need to
|
|
108
119
|
// redefine the widget later
|
|
109
|
-
_proto: $.extend(
|
|
120
|
+
_proto: $.extend({}, prototype),
|
|
110
121
|
|
|
111
122
|
// Track widgets that inherit from this widget in case this widget is
|
|
112
123
|
// redefined after a widget inherits from it
|
|
113
124
|
_childConstructors: []
|
|
114
|
-
}
|
|
125
|
+
});
|
|
115
126
|
|
|
116
127
|
basePrototype = new base();
|
|
117
128
|
|
|
118
129
|
// We need to make the options hash a property directly on the new instance
|
|
119
130
|
// otherwise we'll modify the options hash on the prototype that we're
|
|
120
131
|
// inheriting from
|
|
121
|
-
basePrototype.options = $.widget.extend(
|
|
122
|
-
$.each(
|
|
123
|
-
if (
|
|
124
|
-
proxiedPrototype[
|
|
132
|
+
basePrototype.options = $.widget.extend({}, basePrototype.options);
|
|
133
|
+
$.each(prototype, function (prop, value) {
|
|
134
|
+
if (!$.isFunction(value)) {
|
|
135
|
+
proxiedPrototype[prop] = value;
|
|
125
136
|
return;
|
|
126
137
|
}
|
|
127
|
-
proxiedPrototype[
|
|
138
|
+
proxiedPrototype[prop] = (function () {
|
|
128
139
|
function _super() {
|
|
129
|
-
return base.prototype[
|
|
140
|
+
return base.prototype[prop].apply(this, arguments);
|
|
130
141
|
}
|
|
131
142
|
|
|
132
|
-
function _superApply(
|
|
133
|
-
return base.prototype[
|
|
143
|
+
function _superApply(args) {
|
|
144
|
+
return base.prototype[prop].apply(this, args);
|
|
134
145
|
}
|
|
135
146
|
|
|
136
|
-
return function() {
|
|
147
|
+
return function () {
|
|
137
148
|
var __super = this._super;
|
|
138
149
|
var __superApply = this._superApply;
|
|
139
150
|
var returnValue;
|
|
@@ -141,77 +152,87 @@
|
|
|
141
152
|
this._super = _super;
|
|
142
153
|
this._superApply = _superApply;
|
|
143
154
|
|
|
144
|
-
returnValue = value.apply(
|
|
155
|
+
returnValue = value.apply(this, arguments);
|
|
145
156
|
|
|
146
157
|
this._super = __super;
|
|
147
158
|
this._superApply = __superApply;
|
|
148
159
|
|
|
149
160
|
return returnValue;
|
|
150
161
|
};
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
constructor.prototype = $.widget.extend(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
})();
|
|
163
|
+
});
|
|
164
|
+
constructor.prototype = $.widget.extend(
|
|
165
|
+
basePrototype,
|
|
166
|
+
{
|
|
167
|
+
// TODO: remove support for widgetEventPrefix
|
|
168
|
+
// always use the name + a colon as the prefix, e.g., draggable:start
|
|
169
|
+
// don't prefix for widgets that aren't DOM-based
|
|
170
|
+
widgetEventPrefix: existingConstructor
|
|
171
|
+
? basePrototype.widgetEventPrefix || name
|
|
172
|
+
: name
|
|
173
|
+
},
|
|
174
|
+
proxiedPrototype,
|
|
175
|
+
{
|
|
176
|
+
constructor: constructor,
|
|
177
|
+
namespace: namespace,
|
|
178
|
+
widgetName: name,
|
|
179
|
+
widgetFullName: fullName
|
|
180
|
+
}
|
|
181
|
+
);
|
|
165
182
|
|
|
166
183
|
// If this widget is being redefined then we need to find all widgets that
|
|
167
184
|
// are inheriting from it and redefine all of them so that they inherit from
|
|
168
185
|
// the new version of this widget. We're essentially trying to replace one
|
|
169
186
|
// level in the prototype chain.
|
|
170
|
-
if (
|
|
171
|
-
$.each(
|
|
187
|
+
if (existingConstructor) {
|
|
188
|
+
$.each(existingConstructor._childConstructors, function (i, child) {
|
|
172
189
|
var childPrototype = child.prototype;
|
|
173
190
|
|
|
174
191
|
// Redefine the child widget using the same prototype that was
|
|
175
192
|
// originally used, but inherit from the new version of the base
|
|
176
|
-
$.widget(
|
|
177
|
-
|
|
178
|
-
|
|
193
|
+
$.widget(
|
|
194
|
+
childPrototype.namespace + '.' + childPrototype.widgetName,
|
|
195
|
+
constructor,
|
|
196
|
+
child._proto
|
|
197
|
+
);
|
|
198
|
+
});
|
|
179
199
|
|
|
180
200
|
// Remove the list of existing child constructors from the old constructor
|
|
181
201
|
// so the old child constructors can be garbage collected
|
|
182
202
|
delete existingConstructor._childConstructors;
|
|
183
203
|
} else {
|
|
184
|
-
base._childConstructors.push(
|
|
204
|
+
base._childConstructors.push(constructor);
|
|
185
205
|
}
|
|
186
206
|
|
|
187
|
-
$.widget.bridge(
|
|
207
|
+
$.widget.bridge(name, constructor);
|
|
188
208
|
|
|
189
209
|
return constructor;
|
|
190
210
|
};
|
|
191
211
|
|
|
192
|
-
$.widget.extend = function(
|
|
193
|
-
var input = widgetSlice.call(
|
|
212
|
+
$.widget.extend = function (target) {
|
|
213
|
+
var input = widgetSlice.call(arguments, 1);
|
|
194
214
|
var inputIndex = 0;
|
|
195
215
|
var inputLength = input.length;
|
|
196
216
|
var key;
|
|
197
217
|
var value;
|
|
198
218
|
|
|
199
|
-
for (
|
|
200
|
-
for (
|
|
201
|
-
value = input[
|
|
202
|
-
if (
|
|
203
|
-
|
|
219
|
+
for (; inputIndex < inputLength; inputIndex++) {
|
|
220
|
+
for (key in input[inputIndex]) {
|
|
221
|
+
value = input[inputIndex][key];
|
|
222
|
+
if (
|
|
223
|
+
widgetHasOwnProperty.call(input[inputIndex], key) &&
|
|
224
|
+
value !== undefined
|
|
225
|
+
) {
|
|
204
226
|
// Clone objects
|
|
205
|
-
if (
|
|
206
|
-
target[
|
|
207
|
-
$.widget.extend(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
$.widget.extend( {}, value );
|
|
227
|
+
if ($.isPlainObject(value)) {
|
|
228
|
+
target[key] = $.isPlainObject(target[key])
|
|
229
|
+
? $.widget.extend({}, target[key], value)
|
|
230
|
+
: // Don't extend strings, arrays, etc. with objects
|
|
231
|
+
$.widget.extend({}, value);
|
|
211
232
|
|
|
212
233
|
// Copy everything else by reference
|
|
213
234
|
} else {
|
|
214
|
-
target[
|
|
235
|
+
target[key] = value;
|
|
215
236
|
}
|
|
216
237
|
}
|
|
217
238
|
}
|
|
@@ -219,81 +240,90 @@
|
|
|
219
240
|
return target;
|
|
220
241
|
};
|
|
221
242
|
|
|
222
|
-
$.widget.bridge = function(
|
|
243
|
+
$.widget.bridge = function (name, object) {
|
|
223
244
|
var fullName = object.prototype.widgetFullName || name;
|
|
224
|
-
$.fn[
|
|
225
|
-
var isMethodCall = typeof options ===
|
|
226
|
-
var args = widgetSlice.call(
|
|
245
|
+
$.fn[name] = function (options) {
|
|
246
|
+
var isMethodCall = typeof options === 'string';
|
|
247
|
+
var args = widgetSlice.call(arguments, 1);
|
|
227
248
|
var returnValue = this;
|
|
228
249
|
|
|
229
|
-
if (
|
|
230
|
-
|
|
250
|
+
if (isMethodCall) {
|
|
231
251
|
// If this is an empty collection, we need to have the instance method
|
|
232
252
|
// return undefined instead of the jQuery instance
|
|
233
|
-
if (
|
|
253
|
+
if (!this.length && options === 'instance') {
|
|
234
254
|
returnValue = undefined;
|
|
235
255
|
} else {
|
|
236
|
-
this.each(
|
|
256
|
+
this.each(function () {
|
|
237
257
|
var methodValue;
|
|
238
|
-
var instance = $.data(
|
|
258
|
+
var instance = $.data(this, fullName);
|
|
239
259
|
|
|
240
|
-
if (
|
|
260
|
+
if (options === 'instance') {
|
|
241
261
|
returnValue = instance;
|
|
242
262
|
return false;
|
|
243
263
|
}
|
|
244
264
|
|
|
245
|
-
if (
|
|
246
|
-
return $.error(
|
|
247
|
-
|
|
248
|
-
|
|
265
|
+
if (!instance) {
|
|
266
|
+
return $.error(
|
|
267
|
+
'cannot call methods on ' +
|
|
268
|
+
name +
|
|
269
|
+
' prior to initialization; ' +
|
|
270
|
+
"attempted to call method '" +
|
|
271
|
+
options +
|
|
272
|
+
"'"
|
|
273
|
+
);
|
|
249
274
|
}
|
|
250
275
|
|
|
251
|
-
if (
|
|
252
|
-
return $.error(
|
|
253
|
-
"
|
|
276
|
+
if (!$.isFunction(instance[options]) || options.charAt(0) === '_') {
|
|
277
|
+
return $.error(
|
|
278
|
+
"no such method '" +
|
|
279
|
+
options +
|
|
280
|
+
"' for " +
|
|
281
|
+
name +
|
|
282
|
+
' widget instance'
|
|
283
|
+
);
|
|
254
284
|
}
|
|
255
285
|
|
|
256
|
-
methodValue = instance[
|
|
286
|
+
methodValue = instance[options].apply(instance, args);
|
|
257
287
|
|
|
258
|
-
if (
|
|
259
|
-
returnValue =
|
|
260
|
-
|
|
261
|
-
|
|
288
|
+
if (methodValue !== instance && methodValue !== undefined) {
|
|
289
|
+
returnValue =
|
|
290
|
+
methodValue && methodValue.jquery
|
|
291
|
+
? returnValue.pushStack(methodValue.get())
|
|
292
|
+
: methodValue;
|
|
262
293
|
return false;
|
|
263
294
|
}
|
|
264
|
-
}
|
|
295
|
+
});
|
|
265
296
|
}
|
|
266
297
|
} else {
|
|
267
|
-
|
|
268
298
|
// Allow multiple hashes to be passed on init
|
|
269
|
-
if (
|
|
270
|
-
options = $.widget.extend.apply(
|
|
299
|
+
if (args.length) {
|
|
300
|
+
options = $.widget.extend.apply(null, [options].concat(args));
|
|
271
301
|
}
|
|
272
302
|
|
|
273
|
-
this.each(
|
|
274
|
-
var instance = $.data(
|
|
275
|
-
if (
|
|
276
|
-
instance.option(
|
|
277
|
-
if (
|
|
303
|
+
this.each(function () {
|
|
304
|
+
var instance = $.data(this, fullName);
|
|
305
|
+
if (instance) {
|
|
306
|
+
instance.option(options || {});
|
|
307
|
+
if (instance._init) {
|
|
278
308
|
instance._init();
|
|
279
309
|
}
|
|
280
310
|
} else {
|
|
281
|
-
$.data(
|
|
311
|
+
$.data(this, fullName, new object(options, this));
|
|
282
312
|
}
|
|
283
|
-
}
|
|
313
|
+
});
|
|
284
314
|
}
|
|
285
315
|
|
|
286
316
|
return returnValue;
|
|
287
317
|
};
|
|
288
318
|
};
|
|
289
319
|
|
|
290
|
-
$.Widget = function(
|
|
320
|
+
$.Widget = function (/* options, element */) {};
|
|
291
321
|
$.Widget._childConstructors = [];
|
|
292
322
|
|
|
293
323
|
$.Widget.prototype = {
|
|
294
|
-
widgetName:
|
|
295
|
-
widgetEventPrefix:
|
|
296
|
-
defaultElement:
|
|
324
|
+
widgetName: 'widget',
|
|
325
|
+
widgetEventPrefix: '',
|
|
326
|
+
defaultElement: '<div>',
|
|
297
327
|
|
|
298
328
|
options: {
|
|
299
329
|
classes: {},
|
|
@@ -303,52 +333,56 @@
|
|
|
303
333
|
create: null
|
|
304
334
|
},
|
|
305
335
|
|
|
306
|
-
_createWidget: function(
|
|
307
|
-
element = $(
|
|
308
|
-
this.element = $(
|
|
336
|
+
_createWidget: function (options, element) {
|
|
337
|
+
element = $(element || this.defaultElement || this)[0];
|
|
338
|
+
this.element = $(element);
|
|
309
339
|
this.uuid = widgetUuid++;
|
|
310
|
-
this.eventNamespace =
|
|
340
|
+
this.eventNamespace = '.' + this.widgetName + this.uuid;
|
|
311
341
|
|
|
312
342
|
this.bindings = $();
|
|
313
343
|
this.hoverable = $();
|
|
314
344
|
this.focusable = $();
|
|
315
345
|
this.classesElementLookup = {};
|
|
316
346
|
|
|
317
|
-
if (
|
|
318
|
-
$.data(
|
|
319
|
-
this._on(
|
|
320
|
-
remove: function(
|
|
321
|
-
if (
|
|
347
|
+
if (element !== this) {
|
|
348
|
+
$.data(element, this.widgetFullName, this);
|
|
349
|
+
this._on(true, this.element, {
|
|
350
|
+
remove: function (event) {
|
|
351
|
+
if (event.target === element) {
|
|
322
352
|
this.destroy();
|
|
323
353
|
}
|
|
324
354
|
}
|
|
325
|
-
}
|
|
326
|
-
this.document = $(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
this.window = $(
|
|
355
|
+
});
|
|
356
|
+
this.document = $(
|
|
357
|
+
element.style
|
|
358
|
+
? // Element within the document
|
|
359
|
+
element.ownerDocument
|
|
360
|
+
: // Element is window or document
|
|
361
|
+
element.document || element
|
|
362
|
+
);
|
|
363
|
+
this.window = $(
|
|
364
|
+
this.document[0].defaultView || this.document[0].parentWindow
|
|
365
|
+
);
|
|
334
366
|
}
|
|
335
367
|
|
|
336
|
-
this.options = $.widget.extend(
|
|
368
|
+
this.options = $.widget.extend(
|
|
369
|
+
{},
|
|
337
370
|
this.options,
|
|
338
371
|
this._getCreateOptions(),
|
|
339
|
-
options
|
|
372
|
+
options
|
|
373
|
+
);
|
|
340
374
|
|
|
341
375
|
this._create();
|
|
342
376
|
|
|
343
|
-
if (
|
|
344
|
-
this._setOptionDisabled(
|
|
377
|
+
if (this.options.disabled) {
|
|
378
|
+
this._setOptionDisabled(this.options.disabled);
|
|
345
379
|
}
|
|
346
380
|
|
|
347
|
-
this._trigger(
|
|
381
|
+
this._trigger('create', null, this._getCreateEventData());
|
|
348
382
|
this._init();
|
|
349
383
|
},
|
|
350
384
|
|
|
351
|
-
_getCreateOptions: function() {
|
|
385
|
+
_getCreateOptions: function () {
|
|
352
386
|
return {};
|
|
353
387
|
},
|
|
354
388
|
|
|
@@ -358,107 +392,103 @@
|
|
|
358
392
|
|
|
359
393
|
_init: $.noop,
|
|
360
394
|
|
|
361
|
-
destroy: function() {
|
|
395
|
+
destroy: function () {
|
|
362
396
|
var that = this;
|
|
363
397
|
|
|
364
398
|
this._destroy();
|
|
365
|
-
$.each(
|
|
366
|
-
that._removeClass(
|
|
367
|
-
}
|
|
399
|
+
$.each(this.classesElementLookup, function (key, value) {
|
|
400
|
+
that._removeClass(value, key);
|
|
401
|
+
});
|
|
368
402
|
|
|
369
403
|
// We can probably remove the unbind calls in 2.0
|
|
370
404
|
// all event bindings should go through this._on()
|
|
371
|
-
this.element
|
|
372
|
-
|
|
373
|
-
.removeData( this.widgetFullName );
|
|
374
|
-
this.widget()
|
|
375
|
-
.off( this.eventNamespace )
|
|
376
|
-
.removeAttr( "aria-disabled" );
|
|
405
|
+
this.element.off(this.eventNamespace).removeData(this.widgetFullName);
|
|
406
|
+
this.widget().off(this.eventNamespace).removeAttr('aria-disabled');
|
|
377
407
|
|
|
378
408
|
// Clean up events and states
|
|
379
|
-
this.bindings.off(
|
|
409
|
+
this.bindings.off(this.eventNamespace);
|
|
380
410
|
},
|
|
381
411
|
|
|
382
412
|
_destroy: $.noop,
|
|
383
413
|
|
|
384
|
-
widget: function() {
|
|
414
|
+
widget: function () {
|
|
385
415
|
return this.element;
|
|
386
416
|
},
|
|
387
417
|
|
|
388
|
-
option: function(
|
|
418
|
+
option: function (key, value) {
|
|
389
419
|
var options = key;
|
|
390
420
|
var parts;
|
|
391
421
|
var curOption;
|
|
392
422
|
var i;
|
|
393
423
|
|
|
394
|
-
if (
|
|
395
|
-
|
|
424
|
+
if (arguments.length === 0) {
|
|
396
425
|
// Don't return a reference to the internal hash
|
|
397
|
-
return $.widget.extend(
|
|
426
|
+
return $.widget.extend({}, this.options);
|
|
398
427
|
}
|
|
399
428
|
|
|
400
|
-
if (
|
|
401
|
-
|
|
429
|
+
if (typeof key === 'string') {
|
|
402
430
|
// Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
|
|
403
431
|
options = {};
|
|
404
|
-
parts = key.split(
|
|
432
|
+
parts = key.split('.');
|
|
405
433
|
key = parts.shift();
|
|
406
|
-
if (
|
|
407
|
-
curOption = options[
|
|
408
|
-
for (
|
|
409
|
-
curOption[
|
|
410
|
-
curOption = curOption[
|
|
434
|
+
if (parts.length) {
|
|
435
|
+
curOption = options[key] = $.widget.extend({}, this.options[key]);
|
|
436
|
+
for (i = 0; i < parts.length - 1; i++) {
|
|
437
|
+
curOption[parts[i]] = curOption[parts[i]] || {};
|
|
438
|
+
curOption = curOption[parts[i]];
|
|
411
439
|
}
|
|
412
440
|
key = parts.pop();
|
|
413
|
-
if (
|
|
414
|
-
return curOption[
|
|
441
|
+
if (arguments.length === 1) {
|
|
442
|
+
return curOption[key] === undefined ? null : curOption[key];
|
|
415
443
|
}
|
|
416
|
-
curOption[
|
|
444
|
+
curOption[key] = value;
|
|
417
445
|
} else {
|
|
418
|
-
if (
|
|
419
|
-
return this.options[
|
|
446
|
+
if (arguments.length === 1) {
|
|
447
|
+
return this.options[key] === undefined ? null : this.options[key];
|
|
420
448
|
}
|
|
421
|
-
options[
|
|
449
|
+
options[key] = value;
|
|
422
450
|
}
|
|
423
451
|
}
|
|
424
452
|
|
|
425
|
-
this._setOptions(
|
|
453
|
+
this._setOptions(options);
|
|
426
454
|
|
|
427
455
|
return this;
|
|
428
456
|
},
|
|
429
457
|
|
|
430
|
-
_setOptions: function(
|
|
458
|
+
_setOptions: function (options) {
|
|
431
459
|
var key;
|
|
432
460
|
|
|
433
|
-
for (
|
|
434
|
-
this._setOption(
|
|
461
|
+
for (key in options) {
|
|
462
|
+
this._setOption(key, options[key]);
|
|
435
463
|
}
|
|
436
464
|
|
|
437
465
|
return this;
|
|
438
466
|
},
|
|
439
467
|
|
|
440
|
-
_setOption: function(
|
|
441
|
-
if (
|
|
442
|
-
this._setOptionClasses(
|
|
468
|
+
_setOption: function (key, value) {
|
|
469
|
+
if (key === 'classes') {
|
|
470
|
+
this._setOptionClasses(value);
|
|
443
471
|
}
|
|
444
472
|
|
|
445
|
-
this.options[
|
|
473
|
+
this.options[key] = value;
|
|
446
474
|
|
|
447
|
-
if (
|
|
448
|
-
this._setOptionDisabled(
|
|
475
|
+
if (key === 'disabled') {
|
|
476
|
+
this._setOptionDisabled(value);
|
|
449
477
|
}
|
|
450
478
|
|
|
451
479
|
return this;
|
|
452
480
|
},
|
|
453
481
|
|
|
454
|
-
_setOptionClasses: function(
|
|
482
|
+
_setOptionClasses: function (value) {
|
|
455
483
|
var classKey, elements, currentElements;
|
|
456
484
|
|
|
457
|
-
for (
|
|
458
|
-
currentElements = this.classesElementLookup[
|
|
459
|
-
if (
|
|
485
|
+
for (classKey in value) {
|
|
486
|
+
currentElements = this.classesElementLookup[classKey];
|
|
487
|
+
if (
|
|
488
|
+
value[classKey] === this.options.classes[classKey] ||
|
|
460
489
|
!currentElements ||
|
|
461
|
-
!currentElements.length
|
|
490
|
+
!currentElements.length
|
|
491
|
+
) {
|
|
462
492
|
continue;
|
|
463
493
|
}
|
|
464
494
|
|
|
@@ -466,283 +496,310 @@
|
|
|
466
496
|
// on the next line is going to destroy the reference to the current elements being
|
|
467
497
|
// tracked. We need to save a copy of this collection so that we can add the new classes
|
|
468
498
|
// below.
|
|
469
|
-
elements = $(
|
|
470
|
-
this._removeClass(
|
|
499
|
+
elements = $(currentElements.get());
|
|
500
|
+
this._removeClass(currentElements, classKey);
|
|
471
501
|
|
|
472
502
|
// We don't use _addClass() here, because that uses this.options.classes
|
|
473
503
|
// for generating the string of classes. We want to use the value passed in from
|
|
474
504
|
// _setOption(), this is the new value of the classes option which was passed to
|
|
475
505
|
// _setOption(). We pass this value directly to _classes().
|
|
476
|
-
elements.addClass(
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
506
|
+
elements.addClass(
|
|
507
|
+
this._classes({
|
|
508
|
+
element: elements,
|
|
509
|
+
keys: classKey,
|
|
510
|
+
classes: value,
|
|
511
|
+
add: true
|
|
512
|
+
})
|
|
513
|
+
);
|
|
482
514
|
}
|
|
483
515
|
},
|
|
484
516
|
|
|
485
|
-
_setOptionDisabled: function(
|
|
486
|
-
this._toggleClass(
|
|
517
|
+
_setOptionDisabled: function (value) {
|
|
518
|
+
this._toggleClass(
|
|
519
|
+
this.widget(),
|
|
520
|
+
this.widgetFullName + '-disabled',
|
|
521
|
+
null,
|
|
522
|
+
!!value
|
|
523
|
+
);
|
|
487
524
|
|
|
488
525
|
// If the widget is becoming disabled, then nothing is interactive
|
|
489
|
-
if (
|
|
490
|
-
this._removeClass(
|
|
491
|
-
this._removeClass(
|
|
526
|
+
if (value) {
|
|
527
|
+
this._removeClass(this.hoverable, null, 'ui-state-hover');
|
|
528
|
+
this._removeClass(this.focusable, null, 'ui-state-focus');
|
|
492
529
|
}
|
|
493
530
|
},
|
|
494
531
|
|
|
495
|
-
enable: function() {
|
|
496
|
-
return this._setOptions(
|
|
532
|
+
enable: function () {
|
|
533
|
+
return this._setOptions({ disabled: false });
|
|
497
534
|
},
|
|
498
535
|
|
|
499
|
-
disable: function() {
|
|
500
|
-
return this._setOptions(
|
|
536
|
+
disable: function () {
|
|
537
|
+
return this._setOptions({ disabled: true });
|
|
501
538
|
},
|
|
502
539
|
|
|
503
|
-
_classes: function(
|
|
540
|
+
_classes: function (options) {
|
|
504
541
|
var full = [];
|
|
505
542
|
var that = this;
|
|
506
543
|
|
|
507
|
-
options = $.extend(
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
544
|
+
options = $.extend(
|
|
545
|
+
{
|
|
546
|
+
element: this.element,
|
|
547
|
+
classes: this.options.classes || {}
|
|
548
|
+
},
|
|
549
|
+
options
|
|
550
|
+
);
|
|
551
|
+
|
|
552
|
+
function bindRemoveEvent() {
|
|
553
|
+
options.element.each(function (_, element) {
|
|
554
|
+
var isTracked = $.map(that.classesElementLookup, function (elements) {
|
|
555
|
+
return elements;
|
|
556
|
+
}).some(function (elements) {
|
|
557
|
+
return elements.is(element);
|
|
558
|
+
});
|
|
559
|
+
|
|
560
|
+
if (!isTracked) {
|
|
561
|
+
that._on($(element), {
|
|
562
|
+
remove: '_untrackClassesElement'
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
}
|
|
511
567
|
|
|
512
|
-
function processClassString(
|
|
568
|
+
function processClassString(classes, checkOption) {
|
|
513
569
|
var current, i;
|
|
514
|
-
for (
|
|
515
|
-
current = that.classesElementLookup[
|
|
516
|
-
if (
|
|
517
|
-
|
|
570
|
+
for (i = 0; i < classes.length; i++) {
|
|
571
|
+
current = that.classesElementLookup[classes[i]] || $();
|
|
572
|
+
if (options.add) {
|
|
573
|
+
bindRemoveEvent();
|
|
574
|
+
current = $(
|
|
575
|
+
$.uniqueSort(current.get().concat(options.element.get()))
|
|
576
|
+
);
|
|
518
577
|
} else {
|
|
519
|
-
current = $(
|
|
578
|
+
current = $(current.not(options.element).get());
|
|
520
579
|
}
|
|
521
|
-
that.classesElementLookup[
|
|
522
|
-
full.push(
|
|
523
|
-
if (
|
|
524
|
-
full.push(
|
|
580
|
+
that.classesElementLookup[classes[i]] = current;
|
|
581
|
+
full.push(classes[i]);
|
|
582
|
+
if (checkOption && options.classes[classes[i]]) {
|
|
583
|
+
full.push(options.classes[classes[i]]);
|
|
525
584
|
}
|
|
526
585
|
}
|
|
527
586
|
}
|
|
528
587
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
} );
|
|
532
|
-
|
|
533
|
-
if ( options.keys ) {
|
|
534
|
-
processClassString( options.keys.match( /\S+/g ) || [], true );
|
|
588
|
+
if (options.keys) {
|
|
589
|
+
processClassString(options.keys.match(/\S+/g) || [], true);
|
|
535
590
|
}
|
|
536
|
-
if (
|
|
537
|
-
processClassString(
|
|
591
|
+
if (options.extra) {
|
|
592
|
+
processClassString(options.extra.match(/\S+/g) || []);
|
|
538
593
|
}
|
|
539
594
|
|
|
540
|
-
return full.join(
|
|
595
|
+
return full.join(' ');
|
|
541
596
|
},
|
|
542
597
|
|
|
543
|
-
_untrackClassesElement: function(
|
|
598
|
+
_untrackClassesElement: function (event) {
|
|
544
599
|
var that = this;
|
|
545
|
-
$.each(
|
|
546
|
-
if (
|
|
547
|
-
that.classesElementLookup[
|
|
600
|
+
$.each(that.classesElementLookup, function (key, value) {
|
|
601
|
+
if ($.inArray(event.target, value) !== -1) {
|
|
602
|
+
that.classesElementLookup[key] = $(value.not(event.target).get());
|
|
548
603
|
}
|
|
549
|
-
}
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
this._off($(event.target));
|
|
550
607
|
},
|
|
551
608
|
|
|
552
|
-
_removeClass: function(
|
|
553
|
-
return this._toggleClass(
|
|
609
|
+
_removeClass: function (element, keys, extra) {
|
|
610
|
+
return this._toggleClass(element, keys, extra, false);
|
|
554
611
|
},
|
|
555
612
|
|
|
556
|
-
_addClass: function(
|
|
557
|
-
return this._toggleClass(
|
|
613
|
+
_addClass: function (element, keys, extra) {
|
|
614
|
+
return this._toggleClass(element, keys, extra, true);
|
|
558
615
|
},
|
|
559
616
|
|
|
560
|
-
_toggleClass: function(
|
|
561
|
-
add =
|
|
562
|
-
var shift =
|
|
617
|
+
_toggleClass: function (element, keys, extra, add) {
|
|
618
|
+
add = typeof add === 'boolean' ? add : extra;
|
|
619
|
+
var shift = typeof element === 'string' || element === null,
|
|
563
620
|
options = {
|
|
564
621
|
extra: shift ? keys : extra,
|
|
565
622
|
keys: shift ? element : keys,
|
|
566
623
|
element: shift ? this.element : element,
|
|
567
624
|
add: add
|
|
568
625
|
};
|
|
569
|
-
options.element.toggleClass(
|
|
626
|
+
options.element.toggleClass(this._classes(options), add);
|
|
570
627
|
return this;
|
|
571
628
|
},
|
|
572
629
|
|
|
573
|
-
_on: function(
|
|
630
|
+
_on: function (suppressDisabledCheck, element, handlers) {
|
|
574
631
|
var delegateElement;
|
|
575
632
|
var instance = this;
|
|
576
633
|
|
|
577
634
|
// No suppressDisabledCheck flag, shuffle arguments
|
|
578
|
-
if (
|
|
635
|
+
if (typeof suppressDisabledCheck !== 'boolean') {
|
|
579
636
|
handlers = element;
|
|
580
637
|
element = suppressDisabledCheck;
|
|
581
638
|
suppressDisabledCheck = false;
|
|
582
639
|
}
|
|
583
640
|
|
|
584
641
|
// No element argument, shuffle and use this.element
|
|
585
|
-
if (
|
|
642
|
+
if (!handlers) {
|
|
586
643
|
handlers = element;
|
|
587
644
|
element = this.element;
|
|
588
645
|
delegateElement = this.widget();
|
|
589
646
|
} else {
|
|
590
|
-
element = delegateElement = $(
|
|
591
|
-
this.bindings = this.bindings.add(
|
|
647
|
+
element = delegateElement = $(element);
|
|
648
|
+
this.bindings = this.bindings.add(element);
|
|
592
649
|
}
|
|
593
650
|
|
|
594
|
-
$.each(
|
|
651
|
+
$.each(handlers, function (event, handler) {
|
|
595
652
|
function handlerProxy() {
|
|
596
|
-
|
|
597
653
|
// Allow widgets to customize the disabled handling
|
|
598
654
|
// - disabled as an array instead of boolean
|
|
599
655
|
// - disabled class as method for disabling individual parts
|
|
600
|
-
if (
|
|
601
|
-
|
|
602
|
-
|
|
656
|
+
if (
|
|
657
|
+
!suppressDisabledCheck &&
|
|
658
|
+
(instance.options.disabled === true ||
|
|
659
|
+
$(this).hasClass('ui-state-disabled'))
|
|
660
|
+
) {
|
|
603
661
|
return;
|
|
604
662
|
}
|
|
605
|
-
return (
|
|
606
|
-
|
|
663
|
+
return (
|
|
664
|
+
typeof handler === 'string' ? instance[handler] : handler
|
|
665
|
+
).apply(instance, arguments);
|
|
607
666
|
}
|
|
608
667
|
|
|
609
668
|
// Copy the guid so direct unbinding works
|
|
610
|
-
if (
|
|
669
|
+
if (typeof handler !== 'string') {
|
|
611
670
|
handlerProxy.guid = handler.guid =
|
|
612
671
|
handler.guid || handlerProxy.guid || $.guid++;
|
|
613
672
|
}
|
|
614
673
|
|
|
615
|
-
var match = event.match(
|
|
616
|
-
var eventName = match[
|
|
617
|
-
var selector = match[
|
|
674
|
+
var match = event.match(/^([\w:-]*)\s*(.*)$/);
|
|
675
|
+
var eventName = match[1] + instance.eventNamespace;
|
|
676
|
+
var selector = match[2];
|
|
618
677
|
|
|
619
|
-
if (
|
|
620
|
-
delegateElement.on(
|
|
678
|
+
if (selector) {
|
|
679
|
+
delegateElement.on(eventName, selector, handlerProxy);
|
|
621
680
|
} else {
|
|
622
|
-
element.on(
|
|
681
|
+
element.on(eventName, handlerProxy);
|
|
623
682
|
}
|
|
624
|
-
}
|
|
683
|
+
});
|
|
625
684
|
},
|
|
626
685
|
|
|
627
|
-
_off: function(
|
|
628
|
-
eventName =
|
|
686
|
+
_off: function (element, eventName) {
|
|
687
|
+
eventName =
|
|
688
|
+
(eventName || '').split(' ').join(this.eventNamespace + ' ') +
|
|
629
689
|
this.eventNamespace;
|
|
630
|
-
element.off(
|
|
690
|
+
element.off(eventName);
|
|
631
691
|
|
|
632
692
|
// Clear the stack to avoid memory leaks (#10056)
|
|
633
|
-
this.bindings = $(
|
|
634
|
-
this.focusable = $(
|
|
635
|
-
this.hoverable = $(
|
|
693
|
+
this.bindings = $(this.bindings.not(element).get());
|
|
694
|
+
this.focusable = $(this.focusable.not(element).get());
|
|
695
|
+
this.hoverable = $(this.hoverable.not(element).get());
|
|
636
696
|
},
|
|
637
697
|
|
|
638
|
-
_delay: function(
|
|
698
|
+
_delay: function (handler, delay) {
|
|
699
|
+
var instance = this;
|
|
639
700
|
function handlerProxy() {
|
|
640
|
-
return (
|
|
641
|
-
|
|
701
|
+
return (
|
|
702
|
+
typeof handler === 'string' ? instance[handler] : handler
|
|
703
|
+
).apply(instance, arguments);
|
|
642
704
|
}
|
|
643
|
-
|
|
644
|
-
return setTimeout( handlerProxy, delay || 0 );
|
|
705
|
+
return setTimeout(handlerProxy, delay || 0);
|
|
645
706
|
},
|
|
646
707
|
|
|
647
|
-
_hoverable: function(
|
|
648
|
-
this.hoverable = this.hoverable.add(
|
|
649
|
-
this._on(
|
|
650
|
-
mouseenter: function(
|
|
651
|
-
this._addClass(
|
|
708
|
+
_hoverable: function (element) {
|
|
709
|
+
this.hoverable = this.hoverable.add(element);
|
|
710
|
+
this._on(element, {
|
|
711
|
+
mouseenter: function (event) {
|
|
712
|
+
this._addClass($(event.currentTarget), null, 'ui-state-hover');
|
|
652
713
|
},
|
|
653
|
-
mouseleave: function(
|
|
654
|
-
this._removeClass(
|
|
714
|
+
mouseleave: function (event) {
|
|
715
|
+
this._removeClass($(event.currentTarget), null, 'ui-state-hover');
|
|
655
716
|
}
|
|
656
|
-
}
|
|
717
|
+
});
|
|
657
718
|
},
|
|
658
719
|
|
|
659
|
-
_focusable: function(
|
|
660
|
-
this.focusable = this.focusable.add(
|
|
661
|
-
this._on(
|
|
662
|
-
focusin: function(
|
|
663
|
-
this._addClass(
|
|
720
|
+
_focusable: function (element) {
|
|
721
|
+
this.focusable = this.focusable.add(element);
|
|
722
|
+
this._on(element, {
|
|
723
|
+
focusin: function (event) {
|
|
724
|
+
this._addClass($(event.currentTarget), null, 'ui-state-focus');
|
|
664
725
|
},
|
|
665
|
-
focusout: function(
|
|
666
|
-
this._removeClass(
|
|
726
|
+
focusout: function (event) {
|
|
727
|
+
this._removeClass($(event.currentTarget), null, 'ui-state-focus');
|
|
667
728
|
}
|
|
668
|
-
}
|
|
729
|
+
});
|
|
669
730
|
},
|
|
670
731
|
|
|
671
|
-
_trigger: function(
|
|
732
|
+
_trigger: function (type, event, data) {
|
|
672
733
|
var prop, orig;
|
|
673
|
-
var callback = this.options[
|
|
734
|
+
var callback = this.options[type];
|
|
674
735
|
|
|
675
736
|
data = data || {};
|
|
676
|
-
event = $.Event(
|
|
677
|
-
event.type = (
|
|
678
|
-
type :
|
|
679
|
-
|
|
737
|
+
event = $.Event(event);
|
|
738
|
+
event.type = (
|
|
739
|
+
type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type
|
|
740
|
+
).toLowerCase();
|
|
680
741
|
|
|
681
742
|
// The original event may come from any element
|
|
682
743
|
// so we need to reset the target on the new event
|
|
683
|
-
event.target = this.element[
|
|
744
|
+
event.target = this.element[0];
|
|
684
745
|
|
|
685
746
|
// Copy original event properties over to the new event
|
|
686
747
|
orig = event.originalEvent;
|
|
687
|
-
if (
|
|
688
|
-
for (
|
|
689
|
-
if (
|
|
690
|
-
event[
|
|
748
|
+
if (orig) {
|
|
749
|
+
for (prop in orig) {
|
|
750
|
+
if (!(prop in event)) {
|
|
751
|
+
event[prop] = orig[prop];
|
|
691
752
|
}
|
|
692
753
|
}
|
|
693
754
|
}
|
|
694
755
|
|
|
695
|
-
this.element.trigger(
|
|
696
|
-
return !(
|
|
697
|
-
|
|
698
|
-
|
|
756
|
+
this.element.trigger(event, data);
|
|
757
|
+
return !(
|
|
758
|
+
($.isFunction(callback) &&
|
|
759
|
+
callback.apply(this.element[0], [event].concat(data)) === false) ||
|
|
760
|
+
event.isDefaultPrevented()
|
|
761
|
+
);
|
|
699
762
|
}
|
|
700
763
|
};
|
|
701
764
|
|
|
702
|
-
$.each(
|
|
703
|
-
$.Widget.prototype[
|
|
704
|
-
if (
|
|
765
|
+
$.each({ show: 'fadeIn', hide: 'fadeOut' }, function (method, defaultEffect) {
|
|
766
|
+
$.Widget.prototype['_' + method] = function (element, options, callback) {
|
|
767
|
+
if (typeof options === 'string') {
|
|
705
768
|
options = { effect: options };
|
|
706
769
|
}
|
|
707
770
|
|
|
708
771
|
var hasOptions;
|
|
709
|
-
var effectName = !options
|
|
710
|
-
method
|
|
711
|
-
options === true || typeof options ===
|
|
712
|
-
defaultEffect
|
|
713
|
-
options.effect || defaultEffect;
|
|
772
|
+
var effectName = !options
|
|
773
|
+
? method
|
|
774
|
+
: options === true || typeof options === 'number'
|
|
775
|
+
? defaultEffect
|
|
776
|
+
: options.effect || defaultEffect;
|
|
714
777
|
|
|
715
778
|
options = options || {};
|
|
716
|
-
if (
|
|
779
|
+
if (typeof options === 'number') {
|
|
717
780
|
options = { duration: options };
|
|
718
781
|
}
|
|
719
782
|
|
|
720
|
-
hasOptions = !$.isEmptyObject(
|
|
783
|
+
hasOptions = !$.isEmptyObject(options);
|
|
721
784
|
options.complete = callback;
|
|
722
785
|
|
|
723
|
-
if (
|
|
724
|
-
element.delay(
|
|
786
|
+
if (options.delay) {
|
|
787
|
+
element.delay(options.delay);
|
|
725
788
|
}
|
|
726
789
|
|
|
727
|
-
if (
|
|
728
|
-
element[
|
|
729
|
-
} else if (
|
|
730
|
-
element[
|
|
790
|
+
if (hasOptions && $.effects && $.effects.effect[effectName]) {
|
|
791
|
+
element[method](options);
|
|
792
|
+
} else if (effectName !== method && element[effectName]) {
|
|
793
|
+
element[effectName](options.duration, options.easing, callback);
|
|
731
794
|
} else {
|
|
732
|
-
element.queue(
|
|
733
|
-
$(
|
|
734
|
-
if (
|
|
735
|
-
callback.call(
|
|
795
|
+
element.queue(function (next) {
|
|
796
|
+
$(this)[method]();
|
|
797
|
+
if (callback) {
|
|
798
|
+
callback.call(element[0]);
|
|
736
799
|
}
|
|
737
800
|
next();
|
|
738
|
-
}
|
|
801
|
+
});
|
|
739
802
|
}
|
|
740
803
|
};
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
var widget = $.widget;
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
}));
|
|
804
|
+
});
|
|
805
|
+
});
|