jquerypp-rails 1.0.1.1.rc3 → 1.0.2
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.
- data/README.markdown +28 -31
- data/lib/jquerypp/rails/version.rb +1 -1
- metadata +2 -25
- data/vendor/assets/javascripts/lib/jquery.animate.js +0 -326
- data/vendor/assets/javascripts/lib/jquery.compare.js +0 -75
- data/vendor/assets/javascripts/lib/jquery.cookie.js +0 -118
- data/vendor/assets/javascripts/lib/jquery.dimensions.js +0 -191
- data/vendor/assets/javascripts/lib/jquery.event.default.js +0 -115
- data/vendor/assets/javascripts/lib/jquery.event.destroyed.js +0 -23
- data/vendor/assets/javascripts/lib/jquery.event.drag.js +0 -727
- data/vendor/assets/javascripts/lib/jquery.event.drop.js +0 -457
- data/vendor/assets/javascripts/lib/jquery.event.fastfix.js +0 -95
- data/vendor/assets/javascripts/lib/jquery.event.hover.js +0 -266
- data/vendor/assets/javascripts/lib/jquery.event.key.js +0 -156
- data/vendor/assets/javascripts/lib/jquery.event.livehack.js +0 -174
- data/vendor/assets/javascripts/lib/jquery.event.pause.js +0 -92
- data/vendor/assets/javascripts/lib/jquery.event.resize.js +0 -47
- data/vendor/assets/javascripts/lib/jquery.event.swipe.js +0 -133
- data/vendor/assets/javascripts/lib/jquery.fills.js +0 -249
- data/vendor/assets/javascripts/lib/jquery.form_params.js +0 -167
- data/vendor/assets/javascripts/lib/jquery.lang.json.js +0 -196
- data/vendor/assets/javascripts/lib/jquery.lang.vector.js +0 -214
- data/vendor/assets/javascripts/lib/jquery.range.js +0 -861
- data/vendor/assets/javascripts/lib/jquery.selection.js +0 -232
- data/vendor/assets/javascripts/lib/jquery.styles.js +0 -103
- data/vendor/assets/javascripts/lib/jquery.within.js +0 -94
@@ -1,75 +0,0 @@
|
|
1
|
-
// - jquery.compare.js
|
2
|
-
(function($){
|
3
|
-
|
4
|
-
/**
|
5
|
-
* @function jQuery.fn.compare
|
6
|
-
* @parent jQuery.compare
|
7
|
-
*
|
8
|
-
* Compare two elements and return a bitmask as a number representing the following conditions:
|
9
|
-
*
|
10
|
-
* - `000000` -> __0__: Elements are identical
|
11
|
-
* - `000001` -> __1__: The nodes are in different documents (or one is outside of a document)
|
12
|
-
* - `000010` -> __2__: #bar precedes #foo
|
13
|
-
* - `000100` -> __4__: #foo precedes #bar
|
14
|
-
* - `001000` -> __8__: #bar contains #foo
|
15
|
-
* - `010000` -> __16__: #foo contains #bar
|
16
|
-
*
|
17
|
-
* You can check for any of these conditions using a bitwise AND:
|
18
|
-
*
|
19
|
-
* if( $('#foo').compare($('#bar')) & 2 ) {
|
20
|
-
* console.log("#bar precedes #foo")
|
21
|
-
* }
|
22
|
-
*
|
23
|
-
* @param {HTMLElement|jQuery} element an element or jQuery collection to compare against.
|
24
|
-
* @return {Number} A number representing a bitmask deatiling how the elements are positioned from each other.
|
25
|
-
*/
|
26
|
-
|
27
|
-
// See http://ejohn.org/blog/comparing-document-position/
|
28
|
-
jQuery.fn.compare = function(element){ //usually
|
29
|
-
try{
|
30
|
-
// Firefox 3 throws an error with XUL - we can't use compare then
|
31
|
-
element = element.jquery ? element[0] : element;
|
32
|
-
}catch(e){
|
33
|
-
return null;
|
34
|
-
}
|
35
|
-
|
36
|
-
// make sure we aren't coming from XUL element
|
37
|
-
if (window.HTMLElement) {
|
38
|
-
var s = HTMLElement.prototype.toString.call(element)
|
39
|
-
if (s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]' || s === '[object Window]') {
|
40
|
-
return null;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
if(this[0].compareDocumentPosition){
|
45
|
-
// For browsers that support it, use compareDocumentPosition
|
46
|
-
// https://developer.mozilla.org/en/DOM/Node.compareDocumentPosition
|
47
|
-
return this[0].compareDocumentPosition(element);
|
48
|
-
}
|
49
|
-
|
50
|
-
// this[0] contains element
|
51
|
-
if(this[0] == document && element != document) return 8;
|
52
|
-
|
53
|
-
var number =
|
54
|
-
// this[0] contains element
|
55
|
-
(this[0] !== element && this[0].contains(element) && 16) +
|
56
|
-
// element contains this[0]
|
57
|
-
(this[0] != element && element.contains(this[0]) && 8),
|
58
|
-
docEl = document.documentElement;
|
59
|
-
|
60
|
-
// Use the sourceIndex
|
61
|
-
if(this[0].sourceIndex){
|
62
|
-
// this[0] precedes element
|
63
|
-
number += (this[0].sourceIndex < element.sourceIndex && 4)
|
64
|
-
// element precedes foo[0]
|
65
|
-
number += (this[0].sourceIndex > element.sourceIndex && 2)
|
66
|
-
// The nodes are in different documents
|
67
|
-
number += (this[0].ownerDocument !== element.ownerDocument ||
|
68
|
-
(this[0] != docEl && this[0].sourceIndex <= 0 ) ||
|
69
|
-
(element != docEl && element.sourceIndex <= 0 )) && 1
|
70
|
-
}
|
71
|
-
|
72
|
-
return number;
|
73
|
-
}
|
74
|
-
|
75
|
-
})(jQuery)
|
@@ -1,118 +0,0 @@
|
|
1
|
-
// Dependencies:
|
2
|
-
//
|
3
|
-
// - jquery.cookie.js
|
4
|
-
// - jquery.lang.json.js
|
5
|
-
|
6
|
-
(function() {
|
7
|
-
/**
|
8
|
-
* @function jQuery.cookie
|
9
|
-
* @parent jquerypp
|
10
|
-
* @plugin jquery/dom/cookie
|
11
|
-
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
12
|
-
*
|
13
|
-
* `jQuery.cookie(name, [value], [options])` lets you create, read and remove cookies. It is the
|
14
|
-
* [jQuery cookie plugin](https://github.com/carhartl/jquery-cookie) written by [Klaus Hartl](stilbuero.de)
|
15
|
-
* and dual licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php)
|
16
|
-
* and [GPL](http://www.gnu.org/licenses/gpl.html) licenses.
|
17
|
-
*
|
18
|
-
* ## Examples
|
19
|
-
*
|
20
|
-
* Set the value of a cookie.
|
21
|
-
*
|
22
|
-
* $.cookie('the_cookie', 'the_value');
|
23
|
-
*
|
24
|
-
* Create a cookie with all available options.
|
25
|
-
*
|
26
|
-
* $.cookie('the_cookie', 'the_value', {
|
27
|
-
* expires: 7,
|
28
|
-
* path: '/',
|
29
|
-
* domain: 'jquery.com',
|
30
|
-
* secure: true
|
31
|
-
* });
|
32
|
-
*
|
33
|
-
* Create a session cookie.
|
34
|
-
*
|
35
|
-
* $.cookie('the_cookie', 'the_value');
|
36
|
-
*
|
37
|
-
* Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
|
38
|
-
* used when the cookie was set.
|
39
|
-
*
|
40
|
-
* $.cookie('the_cookie', null);
|
41
|
-
*
|
42
|
-
* Get the value of a cookie.
|
43
|
-
*
|
44
|
-
* $.cookie('the_cookie');
|
45
|
-
*
|
46
|
-
* @param {String} [name] The name of the cookie.
|
47
|
-
* @param {String} [value] The value of the cookie.
|
48
|
-
* @param {Object} [options] An object literal containing key/value pairs to provide optional cookie attributes. Values can be:
|
49
|
-
*
|
50
|
-
* - `expires` - Either an integer specifying the expiration date from now on in days or a Date object. If a negative value is specified (e.g. a date in the past), the cookie will be deleted. If set to null or omitted, the cookie will be a session cookie and will not be retained when the the browser exits.
|
51
|
-
* - `domain` - The domain name
|
52
|
-
* - `path` - The value of the path atribute of the cookie (default: path of page that created the cookie).
|
53
|
-
* - `secure` - If true, the secure attribute of the cookie will be set and the cookie transmission will require a secure protocol (like HTTPS).
|
54
|
-
*
|
55
|
-
* @return {String} the value of the cookie or {undefined} when setting the cookie.
|
56
|
-
*/
|
57
|
-
jQuery.cookie = function(name, value, options) {
|
58
|
-
if (typeof value != 'undefined') {
|
59
|
-
// name and value given, set cookie
|
60
|
-
options = options ||
|
61
|
-
{};
|
62
|
-
if (value === null) {
|
63
|
-
value = '';
|
64
|
-
options.expires = -1;
|
65
|
-
}
|
66
|
-
// convert value to JSON string
|
67
|
-
if (typeof value == 'object' && jQuery.toJSON) {
|
68
|
-
value = jQuery.toJSON(value);
|
69
|
-
}
|
70
|
-
var expires = '';
|
71
|
-
// Set expiry
|
72
|
-
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
73
|
-
var date;
|
74
|
-
if (typeof options.expires == 'number') {
|
75
|
-
date = new Date();
|
76
|
-
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
77
|
-
}
|
78
|
-
else {
|
79
|
-
date = options.expires;
|
80
|
-
}
|
81
|
-
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
82
|
-
}
|
83
|
-
// CAUTION: Needed to parenthesize options.path and options.domain
|
84
|
-
// in the following expressions, otherwise they evaluate to undefined
|
85
|
-
// in the packed version for some reason...
|
86
|
-
var path = options.path ? '; path=' + (options.path) : '';
|
87
|
-
var domain = options.domain ? '; domain=' + (options.domain) : '';
|
88
|
-
var secure = options.secure ? '; secure' : '';
|
89
|
-
// Set the cookie name=value;expires=;path=;domain=;secure-
|
90
|
-
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
91
|
-
}
|
92
|
-
else { // only name given, get cookie
|
93
|
-
var cookieValue = null;
|
94
|
-
if (document.cookie && document.cookie != '') {
|
95
|
-
var cookies = document.cookie.split(';');
|
96
|
-
for (var i = 0; i < cookies.length; i++) {
|
97
|
-
var cookie = jQuery.trim(cookies[i]);
|
98
|
-
// Does this cookie string begin with the name we want?
|
99
|
-
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
100
|
-
// Get the cookie value
|
101
|
-
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
102
|
-
break;
|
103
|
-
}
|
104
|
-
}
|
105
|
-
}
|
106
|
-
// Parse JSON from the cookie into an object
|
107
|
-
if (jQuery.evalJSON && cookieValue && cookieValue.match(/^\s*\{/)) {
|
108
|
-
try {
|
109
|
-
cookieValue = jQuery.evalJSON(cookieValue);
|
110
|
-
}
|
111
|
-
catch (e) {
|
112
|
-
}
|
113
|
-
}
|
114
|
-
return cookieValue;
|
115
|
-
}
|
116
|
-
};
|
117
|
-
|
118
|
-
})(jQuery)
|
@@ -1,191 +0,0 @@
|
|
1
|
-
// Dependencies:
|
2
|
-
//
|
3
|
-
// - jquery.dimensions.js
|
4
|
-
// - jquery.styles.js
|
5
|
-
|
6
|
-
(function($) {
|
7
|
-
|
8
|
-
var
|
9
|
-
//margin is inside border
|
10
|
-
weird = /button|select/i,
|
11
|
-
getBoxes = {},
|
12
|
-
checks = {
|
13
|
-
width: ["Left", "Right"],
|
14
|
-
height: ['Top', 'Bottom'],
|
15
|
-
oldOuterHeight: $.fn.outerHeight,
|
16
|
-
oldOuterWidth: $.fn.outerWidth,
|
17
|
-
oldInnerWidth: $.fn.innerWidth,
|
18
|
-
oldInnerHeight: $.fn.innerHeight
|
19
|
-
};
|
20
|
-
|
21
|
-
$.each({
|
22
|
-
|
23
|
-
/**
|
24
|
-
* @function jQuery.fn.outerWidth
|
25
|
-
* @parent jQuery.dimensions
|
26
|
-
*
|
27
|
-
* `jQuery.fn.outerWidth([value], [includeMargins])` lets you set
|
28
|
-
* the outer width of an object where:
|
29
|
-
*
|
30
|
-
* outerWidth = width + padding + border + (margin)
|
31
|
-
*
|
32
|
-
* And can be used like:
|
33
|
-
*
|
34
|
-
* $("#foo").outerWidth(100); //sets outer width
|
35
|
-
* $("#foo").outerWidth(100, true); // uses margins
|
36
|
-
* $("#foo").outerWidth(); //returns outer width
|
37
|
-
* $("#foo").outerWidth(true); //returns outer width + margins
|
38
|
-
*
|
39
|
-
* When setting the outerWidth, it adjusts the width of the element.
|
40
|
-
* If *includeMargin* is set to `true` margins will also be included.
|
41
|
-
* It is also possible to animate the outer width:
|
42
|
-
*
|
43
|
-
* $('#foo').animate({ outerWidth: 200 });
|
44
|
-
*
|
45
|
-
* @param {Number} [width] The width to set
|
46
|
-
* @param {Boolean} [includeMargin=false] Makes setting the outerWidth adjust
|
47
|
-
* for margins.
|
48
|
-
* @return {jQuery|Number} Returns the outer width or the jQuery wrapped elements
|
49
|
-
* if you are setting the outer width.
|
50
|
-
*/
|
51
|
-
width:
|
52
|
-
/**
|
53
|
-
* @function jQuery.fn.innerWidth
|
54
|
-
* @parent jQuery.dimensions
|
55
|
-
*
|
56
|
-
* `jQuery.fn.innerWidth([value])` lets you set the inner width of an element where
|
57
|
-
*
|
58
|
-
* innerWidth = width + padding
|
59
|
-
*
|
60
|
-
* Use it like:
|
61
|
-
*
|
62
|
-
* $("#foo").innerWidth(100); //sets inner width
|
63
|
-
* $("#foo").outerWidth(); // returns inner width
|
64
|
-
*
|
65
|
-
* Or in an animation like:
|
66
|
-
*
|
67
|
-
* $('#foo').animate({ innerWidth : 200 });
|
68
|
-
*
|
69
|
-
* Setting inner width adjusts the width of the element.
|
70
|
-
*
|
71
|
-
* @param {Number} [width] The inner width to set
|
72
|
-
* @return {jQuery|Number} Returns the inner width or the jQuery wrapped elements
|
73
|
-
* if you are setting the inner width.
|
74
|
-
*/
|
75
|
-
"Width",
|
76
|
-
/**
|
77
|
-
* @function jQuery.fn.outerHeight
|
78
|
-
* @parent jQuery.dimensions
|
79
|
-
*
|
80
|
-
* `jQuery.fn.outerHeight([value], [includeMargins])` lets
|
81
|
-
* you set the outer height of an object where:
|
82
|
-
*
|
83
|
-
* outerHeight = height + padding + border + (margin)
|
84
|
-
*
|
85
|
-
* And can be used like:
|
86
|
-
*
|
87
|
-
* $("#foo").outerHeight(100); //sets outer height
|
88
|
-
* $("#foo").outerHeight(100, true); // uses margins
|
89
|
-
* $("#foo").outerHeight(); //returns outer height
|
90
|
-
* $("#foo").outerHeight(true); //returns outer height + margins
|
91
|
-
*
|
92
|
-
* When setting the outerHeight, it adjusts the height of the element.
|
93
|
-
* If *includeMargin* is set to `true` margins will also be included.
|
94
|
-
* It is also possible to animate the outer heihgt:
|
95
|
-
*
|
96
|
-
* $('#foo').animate({ outerHeight : 200 });
|
97
|
-
*
|
98
|
-
* @param {Number} [height] The height to set
|
99
|
-
* @param {Boolean} [includeMargin=false] Makes setting the outerHeight adjust
|
100
|
-
* for margins.
|
101
|
-
* @return {jQuery|Number} Returns the outer height or the jQuery wrapped elements
|
102
|
-
* if you are setting the outer height.
|
103
|
-
*/
|
104
|
-
height:
|
105
|
-
/**
|
106
|
-
* @function jQuery.fn.innerHeight
|
107
|
-
* @parent jQuery.dimensions
|
108
|
-
*
|
109
|
-
* `jQuery.fn.innerHeight([value])` lets you set the inner height of an element where
|
110
|
-
*
|
111
|
-
* innerHeight = height + padding
|
112
|
-
*
|
113
|
-
* Use it like:
|
114
|
-
*
|
115
|
-
* $("#foo").innerHeight(100); //sets inner height
|
116
|
-
* $("#foo").outerHeight(); // returns inner height
|
117
|
-
*
|
118
|
-
* Or in an animation like:
|
119
|
-
*
|
120
|
-
* $('#foo').animate({ innerHeight : 200 });
|
121
|
-
*
|
122
|
-
* Setting inner height adjusts the height of the element.
|
123
|
-
*
|
124
|
-
* @param {Number} [height] The inner height to set
|
125
|
-
* @return {jQuery|Number} Returns the inner height or the jQuery wrapped elements
|
126
|
-
* if you are setting the inner height.
|
127
|
-
*/
|
128
|
-
// for each 'height' and 'width'
|
129
|
-
"Height" }, function(lower, Upper) {
|
130
|
-
|
131
|
-
//used to get the padding and border for an element in a given direction
|
132
|
-
getBoxes[lower] = function(el, boxes) {
|
133
|
-
var val = 0;
|
134
|
-
if (!weird.test(el.nodeName)) {
|
135
|
-
//make what to check for ....
|
136
|
-
var myChecks = [];
|
137
|
-
$.each(checks[lower], function() {
|
138
|
-
var direction = this;
|
139
|
-
$.each(boxes, function(name, val) {
|
140
|
-
if (val)
|
141
|
-
myChecks.push(name + direction+ (name == 'border' ? "Width" : "") );
|
142
|
-
})
|
143
|
-
})
|
144
|
-
$.each($.styles(el, myChecks), function(name, value) {
|
145
|
-
val += (parseFloat(value) || 0);
|
146
|
-
})
|
147
|
-
}
|
148
|
-
return val;
|
149
|
-
}
|
150
|
-
|
151
|
-
//getter / setter
|
152
|
-
$.fn["outer" + Upper] = function(v, margin) {
|
153
|
-
var first = this[0];
|
154
|
-
if (typeof v == 'number') {
|
155
|
-
// Setting the value
|
156
|
-
first && this[lower](v - getBoxes[lower](first, {padding: true, border: true, margin: margin}))
|
157
|
-
return this;
|
158
|
-
} else {
|
159
|
-
// Return the old value
|
160
|
-
return first ? checks["oldOuter" + Upper].call(this, v) : null;
|
161
|
-
}
|
162
|
-
}
|
163
|
-
$.fn["inner" + Upper] = function(v) {
|
164
|
-
var first = this[0];
|
165
|
-
if (typeof v == 'number') {
|
166
|
-
// Setting the value
|
167
|
-
first&& this[lower](v - getBoxes[lower](first, { padding: true }))
|
168
|
-
return this;
|
169
|
-
} else {
|
170
|
-
// Return the old value
|
171
|
-
return first ? checks["oldInner" + Upper].call(this, v) : null;
|
172
|
-
}
|
173
|
-
}
|
174
|
-
//provides animations
|
175
|
-
var animate = function(boxes){
|
176
|
-
// Return the animation function
|
177
|
-
return function(fx){
|
178
|
-
if (fx.state == 0) {
|
179
|
-
fx.start = $(fx.elem)[lower]();
|
180
|
-
fx.end = fx.end - getBoxes[lower](fx.elem,boxes);
|
181
|
-
}
|
182
|
-
fx.elem.style[lower] = (fx.pos * (fx.end - fx.start) + fx.start) + "px"
|
183
|
-
}
|
184
|
-
}
|
185
|
-
$.fx.step["outer" + Upper] = animate({padding: true, border: true})
|
186
|
-
$.fx.step["outer" + Upper+"Margin"] = animate({padding: true, border: true, margin: true})
|
187
|
-
$.fx.step["inner" + Upper] = animate({padding: true})
|
188
|
-
|
189
|
-
})
|
190
|
-
|
191
|
-
})(jQuery)
|
@@ -1,115 +0,0 @@
|
|
1
|
-
// - jquery.event.default.js
|
2
|
-
(function($){
|
3
|
-
|
4
|
-
/**
|
5
|
-
* @function jQuery.fn.triggerAsync
|
6
|
-
* @parent jQuery.event.pause
|
7
|
-
* @plugin jquery/event/default
|
8
|
-
*
|
9
|
-
* `jQuery.fn.triggerAsync(type, [data], [success], [prevented]` triggers an event and calls success
|
10
|
-
* when the event has finished propagating through the DOM and no other handler
|
11
|
-
* called `event.preventDefault()` or returned `false`.
|
12
|
-
*
|
13
|
-
* $('#panel').triggerAsync('show', function() {
|
14
|
-
* $('#panel').show();
|
15
|
-
* });
|
16
|
-
*
|
17
|
-
* You can also provide a callback that gets called if `event.preventDefault()` was called on the event:
|
18
|
-
*
|
19
|
-
* $('panel').triggerAsync('show', function(){
|
20
|
-
* $('#panel').show();
|
21
|
-
* },function(){
|
22
|
-
* $('#other').addClass('error');
|
23
|
-
* });
|
24
|
-
*
|
25
|
-
* @param {String} type The type of event
|
26
|
-
* @param {Object} data The data for the event
|
27
|
-
* @param {Function} success a callback function which occurs upon success
|
28
|
-
* @param {Function} prevented a callback function which occurs if preventDefault was called
|
29
|
-
*/
|
30
|
-
$.fn.triggerAsync = function(type, data, success, prevented){
|
31
|
-
if(typeof data == 'function'){
|
32
|
-
success = data;
|
33
|
-
data = undefined;
|
34
|
-
}
|
35
|
-
|
36
|
-
if ( this[0] ) {
|
37
|
-
// Create a new jQuery event object and store the original preventDefault
|
38
|
-
var event = $.Event( type ),
|
39
|
-
old = event.preventDefault;
|
40
|
-
|
41
|
-
event.preventDefault = function(){
|
42
|
-
old.apply(this, arguments);
|
43
|
-
// call the prevented callback when event.preventDefault is called
|
44
|
-
prevented && prevented(this)
|
45
|
-
}
|
46
|
-
// Trigger the event with the success callback as the success handler
|
47
|
-
jQuery.event.trigger( {type: type, _success: success}, data, this[0] );
|
48
|
-
} else{
|
49
|
-
// If we have no elements call the success callback right away
|
50
|
-
success.call(this);
|
51
|
-
}
|
52
|
-
return this;
|
53
|
-
}
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
/**
|
58
|
-
* @add jQuery.event.special
|
59
|
-
*/
|
60
|
-
//cache default types for performance
|
61
|
-
var types = {}, rnamespaces= /\.(.*)$/, $event = $.event;
|
62
|
-
/**
|
63
|
-
* @attribute default
|
64
|
-
* @parent specialevents
|
65
|
-
* @plugin jquery/event/default
|
66
|
-
* @download http://jmvcsite.heroku.com/pluginify?plugins[]=jquery/event/default/default.js
|
67
|
-
* @test jquery/event/default/qunit.html
|
68
|
-
*
|
69
|
-
*/
|
70
|
-
$event.special["default"] = {
|
71
|
-
add: function( handleObj ) {
|
72
|
-
//save the type
|
73
|
-
types[handleObj.namespace.replace(rnamespaces,"")] = true;
|
74
|
-
},
|
75
|
-
setup: function() {return true}
|
76
|
-
}
|
77
|
-
|
78
|
-
// overwrite trigger to allow default types
|
79
|
-
var oldTrigger = $event.trigger;
|
80
|
-
|
81
|
-
$event.trigger = function defaultTriggerer( event, data, elem, onlyHandlers){
|
82
|
-
// Event object or event type
|
83
|
-
var type = event.type || event,
|
84
|
-
// Caller can pass in an Event, Object, or just an event type string
|
85
|
-
event = typeof event === "object" ?
|
86
|
-
// jQuery.Event object
|
87
|
-
event[ jQuery.expando ] ? event :
|
88
|
-
// Object literal
|
89
|
-
new jQuery.Event( type, event ) :
|
90
|
-
// Just the event type (string)
|
91
|
-
new jQuery.Event( type),
|
92
|
-
res = oldTrigger.call($.event, event, data, elem, onlyHandlers);
|
93
|
-
|
94
|
-
if(!onlyHandlers && !event.isDefaultPrevented() && event.type.indexOf("default") !== 0) {
|
95
|
-
// Trigger the default. event
|
96
|
-
oldTrigger("default."+event.type, data, elem)
|
97
|
-
if(event._success){
|
98
|
-
event._success(event)
|
99
|
-
}
|
100
|
-
}
|
101
|
-
// code for paused
|
102
|
-
if( event.isPaused && event.isPaused() ){
|
103
|
-
// set back original stuff
|
104
|
-
event.isDefaultPrevented =
|
105
|
-
event.pausedState.isDefaultPrevented;
|
106
|
-
event.isPropagationStopped =
|
107
|
-
event.pausedState.isPropagationStopped;
|
108
|
-
}
|
109
|
-
return res;
|
110
|
-
};
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
})(jQuery)
|