zfben_rails_assets 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/example/.sass-cache/686d48c4bb3405df08bdcc662a0722bb96d63df5/test.sassc +0 -0
- data/example/.sass-cache/7a5615116aa96cc45242210dec5b677975f46879/reset.sassc +0 -0
- data/example/app/assets/javascripts/reset.sass +1 -0
- data/example/app/assets/javascripts/test.js +2 -3
- data/example/{vendor/assets/stylesheets/.gitkeep → app/assets/javascripts/zff.js} +0 -0
- data/example/app/assets/stylesheets/test.css +1 -0
- data/example/app/views/test/index.haml +1 -1
- data/{vendor/assets/javascripts/zzf → example/vendor/assets/javascripts/zff/core}/core.js +1 -3
- data/example/vendor/assets/javascripts/zff/core.js +1 -0
- data/{vendor/assets/javascripts/jquery/jquery.js → example/vendor/assets/javascripts/zff/lib/jquery/core.js} +0 -0
- data/{vendor/assets/javascripts/jqGrid.js → example/vendor/assets/javascripts/zff/lib/jquery/grid.js} +0 -0
- data/{vendor/assets/javascripts/jquery/jquery-ui.js → example/vendor/assets/javascripts/zff/lib/jquery/ui.js} +0 -0
- data/{vendor/assets/javascripts/underscore/underscore.js → example/vendor/assets/javascripts/zff/lib/underscore/core.js} +0 -0
- data/{vendor/assets/javascripts/zzf-spec → example/vendor/assets/javascripts/zff/spec}/core.js +4 -4
- data/{vendor/assets/javascripts/qunit → example/vendor/assets/javascripts/zff/spec}/qunit.js +0 -0
- data/example/vendor/assets/javascripts/zff/spec.js +2 -0
- data/example/vendor/assets/javascripts/zff.js +0 -0
- data/{vendor/assets/stylesheets → example/vendor/assets/stylesheets/zff/lib}/qunit.css +0 -0
- data/example/vendor/assets/stylesheets/zff/reset.sass +1 -0
- data/example/vendor/assets/stylesheets/zff/spec.css +1 -0
- data/lib/zfben_rails_assets/Gemfile +12 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/core/core.js +57 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/core.js +1 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/lib/jquery/core.js +8936 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/lib/jquery/grid.js +467 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/lib/jquery/ui.js +11631 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/lib/underscore/core.js +807 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/spec/core.js +38 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/spec/qunit.js +1448 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/spec.js +2 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff.js +0 -0
- data/lib/zfben_rails_assets/assets/stylesheets/zff/lib/qunit.css +225 -0
- data/lib/zfben_rails_assets/assets/stylesheets/zff/reset.sass +1 -0
- data/lib/zfben_rails_assets/assets/stylesheets/zff/spec.css +1 -0
- data/lib/zfben_rails_assets/config/compass.rb +11 -0
- data/lib/zfben_rails_assets/config/sass.rb +4 -0
- data/lib/zfben_rails_assets/tasks.rb +72 -0
- data/lib/zfben_rails_assets/version.rb +1 -1
- data/lib/zfben_rails_assets.rb +6 -2
- data/zfben_rails_assets.gemspec +0 -2
- metadata +44 -42
- data/vendor/assets/javascripts/jasmine/jasmine-html.js +0 -190
- data/vendor/assets/javascripts/jasmine/jasmine.js +0 -2445
- data/vendor/assets/javascripts/jasmine/mock-ajax.js +0 -114
- data/vendor/assets/javascripts/jasmine/spec-helper.js +0 -19
- data/vendor/assets/javascripts/jasmine.js +0 -4
- data/vendor/assets/javascripts/jquery/jquery-ui.js.1 +0 -843
- data/vendor/assets/javascripts/jquery.js +0 -1
- data/vendor/assets/javascripts/qunit.js +0 -1
- data/vendor/assets/javascripts/underscore.js +0 -1
- data/vendor/assets/javascripts/zzf/underscore.js +0 -6
- data/vendor/assets/javascripts/zzf-spec.js +0 -1
- data/vendor/assets/javascripts/zzf.js +0 -1
- data/vendor/assets/stylesheets/jasmine.css +0 -166
@@ -1,843 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* jQuery UI 1.8.13
|
3
|
-
*
|
4
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
5
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
-
* http://jquery.org/license
|
7
|
-
*
|
8
|
-
* http://docs.jquery.com/UI
|
9
|
-
*/
|
10
|
-
(function( $, undefined ) {
|
11
|
-
|
12
|
-
// prevent duplicate loading
|
13
|
-
// this is only a problem because we proxy existing functions
|
14
|
-
// and we don't want to double proxy them
|
15
|
-
$.ui = $.ui || {};
|
16
|
-
if ( $.ui.version ) {
|
17
|
-
return;
|
18
|
-
}
|
19
|
-
|
20
|
-
$.extend( $.ui, {
|
21
|
-
version: "1.8.13",
|
22
|
-
|
23
|
-
keyCode: {
|
24
|
-
ALT: 18,
|
25
|
-
BACKSPACE: 8,
|
26
|
-
CAPS_LOCK: 20,
|
27
|
-
COMMA: 188,
|
28
|
-
COMMAND: 91,
|
29
|
-
COMMAND_LEFT: 91, // COMMAND
|
30
|
-
COMMAND_RIGHT: 93,
|
31
|
-
CONTROL: 17,
|
32
|
-
DELETE: 46,
|
33
|
-
DOWN: 40,
|
34
|
-
END: 35,
|
35
|
-
ENTER: 13,
|
36
|
-
ESCAPE: 27,
|
37
|
-
HOME: 36,
|
38
|
-
INSERT: 45,
|
39
|
-
LEFT: 37,
|
40
|
-
MENU: 93, // COMMAND_RIGHT
|
41
|
-
NUMPAD_ADD: 107,
|
42
|
-
NUMPAD_DECIMAL: 110,
|
43
|
-
NUMPAD_DIVIDE: 111,
|
44
|
-
NUMPAD_ENTER: 108,
|
45
|
-
NUMPAD_MULTIPLY: 106,
|
46
|
-
NUMPAD_SUBTRACT: 109,
|
47
|
-
PAGE_DOWN: 34,
|
48
|
-
PAGE_UP: 33,
|
49
|
-
PERIOD: 190,
|
50
|
-
RIGHT: 39,
|
51
|
-
SHIFT: 16,
|
52
|
-
SPACE: 32,
|
53
|
-
TAB: 9,
|
54
|
-
UP: 38,
|
55
|
-
WINDOWS: 91 // COMMAND
|
56
|
-
}
|
57
|
-
});
|
58
|
-
|
59
|
-
// plugins
|
60
|
-
$.fn.extend({
|
61
|
-
_focus: $.fn.focus,
|
62
|
-
focus: function( delay, fn ) {
|
63
|
-
return typeof delay === "number" ?
|
64
|
-
this.each(function() {
|
65
|
-
var elem = this;
|
66
|
-
setTimeout(function() {
|
67
|
-
$( elem ).focus();
|
68
|
-
if ( fn ) {
|
69
|
-
fn.call( elem );
|
70
|
-
}
|
71
|
-
}, delay );
|
72
|
-
}) :
|
73
|
-
this._focus.apply( this, arguments );
|
74
|
-
},
|
75
|
-
|
76
|
-
scrollParent: function() {
|
77
|
-
var scrollParent;
|
78
|
-
if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
|
79
|
-
scrollParent = this.parents().filter(function() {
|
80
|
-
return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
81
|
-
}).eq(0);
|
82
|
-
} else {
|
83
|
-
scrollParent = this.parents().filter(function() {
|
84
|
-
return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
85
|
-
}).eq(0);
|
86
|
-
}
|
87
|
-
|
88
|
-
return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
|
89
|
-
},
|
90
|
-
|
91
|
-
zIndex: function( zIndex ) {
|
92
|
-
if ( zIndex !== undefined ) {
|
93
|
-
return this.css( "zIndex", zIndex );
|
94
|
-
}
|
95
|
-
|
96
|
-
if ( this.length ) {
|
97
|
-
var elem = $( this[ 0 ] ), position, value;
|
98
|
-
while ( elem.length && elem[ 0 ] !== document ) {
|
99
|
-
// Ignore z-index if position is set to a value where z-index is ignored by the browser
|
100
|
-
// This makes behavior of this function consistent across browsers
|
101
|
-
// WebKit always returns auto if the element is positioned
|
102
|
-
position = elem.css( "position" );
|
103
|
-
if ( position === "absolute" || position === "relative" || position === "fixed" ) {
|
104
|
-
// IE returns 0 when zIndex is not specified
|
105
|
-
// other browsers return a string
|
106
|
-
// we ignore the case of nested elements with an explicit value of 0
|
107
|
-
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
|
108
|
-
value = parseInt( elem.css( "zIndex" ), 10 );
|
109
|
-
if ( !isNaN( value ) && value !== 0 ) {
|
110
|
-
return value;
|
111
|
-
}
|
112
|
-
}
|
113
|
-
elem = elem.parent();
|
114
|
-
}
|
115
|
-
}
|
116
|
-
|
117
|
-
return 0;
|
118
|
-
},
|
119
|
-
|
120
|
-
disableSelection: function() {
|
121
|
-
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
|
122
|
-
".ui-disableSelection", function( event ) {
|
123
|
-
event.preventDefault();
|
124
|
-
});
|
125
|
-
},
|
126
|
-
|
127
|
-
enableSelection: function() {
|
128
|
-
return this.unbind( ".ui-disableSelection" );
|
129
|
-
}
|
130
|
-
});
|
131
|
-
|
132
|
-
$.each( [ "Width", "Height" ], function( i, name ) {
|
133
|
-
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
|
134
|
-
type = name.toLowerCase(),
|
135
|
-
orig = {
|
136
|
-
innerWidth: $.fn.innerWidth,
|
137
|
-
innerHeight: $.fn.innerHeight,
|
138
|
-
outerWidth: $.fn.outerWidth,
|
139
|
-
outerHeight: $.fn.outerHeight
|
140
|
-
};
|
141
|
-
|
142
|
-
function reduce( elem, size, border, margin ) {
|
143
|
-
$.each( side, function() {
|
144
|
-
size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;
|
145
|
-
if ( border ) {
|
146
|
-
size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0;
|
147
|
-
}
|
148
|
-
if ( margin ) {
|
149
|
-
size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0;
|
150
|
-
}
|
151
|
-
});
|
152
|
-
return size;
|
153
|
-
}
|
154
|
-
|
155
|
-
$.fn[ "inner" + name ] = function( size ) {
|
156
|
-
if ( size === undefined ) {
|
157
|
-
return orig[ "inner" + name ].call( this );
|
158
|
-
}
|
159
|
-
|
160
|
-
return this.each(function() {
|
161
|
-
$( this ).css( type, reduce( this, size ) + "px" );
|
162
|
-
});
|
163
|
-
};
|
164
|
-
|
165
|
-
$.fn[ "outer" + name] = function( size, margin ) {
|
166
|
-
if ( typeof size !== "number" ) {
|
167
|
-
return orig[ "outer" + name ].call( this, size );
|
168
|
-
}
|
169
|
-
|
170
|
-
return this.each(function() {
|
171
|
-
$( this).css( type, reduce( this, size, true, margin ) + "px" );
|
172
|
-
});
|
173
|
-
};
|
174
|
-
});
|
175
|
-
|
176
|
-
// selectors
|
177
|
-
function focusable( element, isTabIndexNotNaN ) {
|
178
|
-
var nodeName = element.nodeName.toLowerCase();
|
179
|
-
if ( "area" === nodeName ) {
|
180
|
-
var map = element.parentNode,
|
181
|
-
mapName = map.name,
|
182
|
-
img;
|
183
|
-
if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
|
184
|
-
return false;
|
185
|
-
}
|
186
|
-
img = $( "img[usemap=#" + mapName + "]" )[0];
|
187
|
-
return !!img && visible( img );
|
188
|
-
}
|
189
|
-
return ( /input|select|textarea|button|object/.test( nodeName )
|
190
|
-
? !element.disabled
|
191
|
-
: "a" == nodeName
|
192
|
-
? element.href || isTabIndexNotNaN
|
193
|
-
: isTabIndexNotNaN)
|
194
|
-
// the element and all of its ancestors must be visible
|
195
|
-
&& visible( element );
|
196
|
-
}
|
197
|
-
|
198
|
-
function visible( element ) {
|
199
|
-
return !$( element ).parents().andSelf().filter(function() {
|
200
|
-
return $.curCSS( this, "visibility" ) === "hidden" ||
|
201
|
-
$.expr.filters.hidden( this );
|
202
|
-
}).length;
|
203
|
-
}
|
204
|
-
|
205
|
-
$.extend( $.expr[ ":" ], {
|
206
|
-
data: function( elem, i, match ) {
|
207
|
-
return !!$.data( elem, match[ 3 ] );
|
208
|
-
},
|
209
|
-
|
210
|
-
focusable: function( element ) {
|
211
|
-
return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
|
212
|
-
},
|
213
|
-
|
214
|
-
tabbable: function( element ) {
|
215
|
-
var tabIndex = $.attr( element, "tabindex" ),
|
216
|
-
isTabIndexNaN = isNaN( tabIndex );
|
217
|
-
return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
|
218
|
-
}
|
219
|
-
});
|
220
|
-
|
221
|
-
// support
|
222
|
-
$(function() {
|
223
|
-
var body = document.body,
|
224
|
-
div = body.appendChild( div = document.createElement( "div" ) );
|
225
|
-
|
226
|
-
$.extend( div.style, {
|
227
|
-
minHeight: "100px",
|
228
|
-
height: "auto",
|
229
|
-
padding: 0,
|
230
|
-
borderWidth: 0
|
231
|
-
});
|
232
|
-
|
233
|
-
$.support.minHeight = div.offsetHeight === 100;
|
234
|
-
$.support.selectstart = "onselectstart" in div;
|
235
|
-
|
236
|
-
// set display to none to avoid a layout bug in IE
|
237
|
-
// http://dev.jquery.com/ticket/4014
|
238
|
-
body.removeChild( div ).style.display = "none";
|
239
|
-
});
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
// deprecated
|
246
|
-
$.extend( $.ui, {
|
247
|
-
// $.ui.plugin is deprecated. Use the proxy pattern instead.
|
248
|
-
plugin: {
|
249
|
-
add: function( module, option, set ) {
|
250
|
-
var proto = $.ui[ module ].prototype;
|
251
|
-
for ( var i in set ) {
|
252
|
-
proto.plugins[ i ] = proto.plugins[ i ] || [];
|
253
|
-
proto.plugins[ i ].push( [ option, set[ i ] ] );
|
254
|
-
}
|
255
|
-
},
|
256
|
-
call: function( instance, name, args ) {
|
257
|
-
var set = instance.plugins[ name ];
|
258
|
-
if ( !set || !instance.element[ 0 ].parentNode ) {
|
259
|
-
return;
|
260
|
-
}
|
261
|
-
|
262
|
-
for ( var i = 0; i < set.length; i++ ) {
|
263
|
-
if ( instance.options[ set[ i ][ 0 ] ] ) {
|
264
|
-
set[ i ][ 1 ].apply( instance.element, args );
|
265
|
-
}
|
266
|
-
}
|
267
|
-
}
|
268
|
-
},
|
269
|
-
|
270
|
-
// will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()
|
271
|
-
contains: function( a, b ) {
|
272
|
-
return document.compareDocumentPosition ?
|
273
|
-
a.compareDocumentPosition( b ) & 16 :
|
274
|
-
a !== b && a.contains( b );
|
275
|
-
},
|
276
|
-
|
277
|
-
// only used by resizable
|
278
|
-
hasScroll: function( el, a ) {
|
279
|
-
|
280
|
-
//If overflow is hidden, the element might have extra content, but the user wants to hide it
|
281
|
-
if ( $( el ).css( "overflow" ) === "hidden") {
|
282
|
-
return false;
|
283
|
-
}
|
284
|
-
|
285
|
-
var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
|
286
|
-
has = false;
|
287
|
-
|
288
|
-
if ( el[ scroll ] > 0 ) {
|
289
|
-
return true;
|
290
|
-
}
|
291
|
-
|
292
|
-
// TODO: determine which cases actually cause this to happen
|
293
|
-
// if the element doesn't have the scroll set, see if it's possible to
|
294
|
-
// set the scroll
|
295
|
-
el[ scroll ] = 1;
|
296
|
-
has = ( el[ scroll ] > 0 );
|
297
|
-
el[ scroll ] = 0;
|
298
|
-
return has;
|
299
|
-
},
|
300
|
-
|
301
|
-
// these are odd functions, fix the API or move into individual plugins
|
302
|
-
isOverAxis: function( x, reference, size ) {
|
303
|
-
//Determines when x coordinate is over "b" element axis
|
304
|
-
return ( x > reference ) && ( x < ( reference + size ) );
|
305
|
-
},
|
306
|
-
isOver: function( y, x, top, left, height, width ) {
|
307
|
-
//Determines when x, y coordinates is over "b" element
|
308
|
-
return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
|
309
|
-
}
|
310
|
-
});
|
311
|
-
|
312
|
-
})( jQuery );
|
313
|
-
/*!
|
314
|
-
* jQuery UI Widget 1.8.13
|
315
|
-
*
|
316
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
317
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
318
|
-
* http://jquery.org/license
|
319
|
-
*
|
320
|
-
* http://docs.jquery.com/UI/Widget
|
321
|
-
*/
|
322
|
-
(function( $, undefined ) {
|
323
|
-
|
324
|
-
// jQuery 1.4+
|
325
|
-
if ( $.cleanData ) {
|
326
|
-
var _cleanData = $.cleanData;
|
327
|
-
$.cleanData = function( elems ) {
|
328
|
-
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
329
|
-
$( elem ).triggerHandler( "remove" );
|
330
|
-
}
|
331
|
-
_cleanData( elems );
|
332
|
-
};
|
333
|
-
} else {
|
334
|
-
var _remove = $.fn.remove;
|
335
|
-
$.fn.remove = function( selector, keepData ) {
|
336
|
-
return this.each(function() {
|
337
|
-
if ( !keepData ) {
|
338
|
-
if ( !selector || $.filter( selector, [ this ] ).length ) {
|
339
|
-
$( "*", this ).add( [ this ] ).each(function() {
|
340
|
-
$( this ).triggerHandler( "remove" );
|
341
|
-
});
|
342
|
-
}
|
343
|
-
}
|
344
|
-
return _remove.call( $(this), selector, keepData );
|
345
|
-
});
|
346
|
-
};
|
347
|
-
}
|
348
|
-
|
349
|
-
$.widget = function( name, base, prototype ) {
|
350
|
-
var namespace = name.split( "." )[ 0 ],
|
351
|
-
fullName;
|
352
|
-
name = name.split( "." )[ 1 ];
|
353
|
-
fullName = namespace + "-" + name;
|
354
|
-
|
355
|
-
if ( !prototype ) {
|
356
|
-
prototype = base;
|
357
|
-
base = $.Widget;
|
358
|
-
}
|
359
|
-
|
360
|
-
// create selector for plugin
|
361
|
-
$.expr[ ":" ][ fullName ] = function( elem ) {
|
362
|
-
return !!$.data( elem, name );
|
363
|
-
};
|
364
|
-
|
365
|
-
$[ namespace ] = $[ namespace ] || {};
|
366
|
-
$[ namespace ][ name ] = function( options, element ) {
|
367
|
-
// allow instantiation without initializing for simple inheritance
|
368
|
-
if ( arguments.length ) {
|
369
|
-
this._createWidget( options, element );
|
370
|
-
}
|
371
|
-
};
|
372
|
-
|
373
|
-
var basePrototype = new base();
|
374
|
-
// we need to make the options hash a property directly on the new instance
|
375
|
-
// otherwise we'll modify the options hash on the prototype that we're
|
376
|
-
// inheriting from
|
377
|
-
// $.each( basePrototype, function( key, val ) {
|
378
|
-
// if ( $.isPlainObject(val) ) {
|
379
|
-
// basePrototype[ key ] = $.extend( {}, val );
|
380
|
-
// }
|
381
|
-
// });
|
382
|
-
basePrototype.options = $.extend( true, {}, basePrototype.options );
|
383
|
-
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
|
384
|
-
namespace: namespace,
|
385
|
-
widgetName: name,
|
386
|
-
widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
|
387
|
-
widgetBaseClass: fullName
|
388
|
-
}, prototype );
|
389
|
-
|
390
|
-
$.widget.bridge( name, $[ namespace ][ name ] );
|
391
|
-
};
|
392
|
-
|
393
|
-
$.widget.bridge = function( name, object ) {
|
394
|
-
$.fn[ name ] = function( options ) {
|
395
|
-
var isMethodCall = typeof options === "string",
|
396
|
-
args = Array.prototype.slice.call( arguments, 1 ),
|
397
|
-
returnValue = this;
|
398
|
-
|
399
|
-
// allow multiple hashes to be passed on init
|
400
|
-
options = !isMethodCall && args.length ?
|
401
|
-
$.extend.apply( null, [ true, options ].concat(args) ) :
|
402
|
-
options;
|
403
|
-
|
404
|
-
// prevent calls to internal methods
|
405
|
-
if ( isMethodCall && options.charAt( 0 ) === "_" ) {
|
406
|
-
return returnValue;
|
407
|
-
}
|
408
|
-
|
409
|
-
if ( isMethodCall ) {
|
410
|
-
this.each(function() {
|
411
|
-
var instance = $.data( this, name ),
|
412
|
-
methodValue = instance && $.isFunction( instance[options] ) ?
|
413
|
-
instance[ options ].apply( instance, args ) :
|
414
|
-
instance;
|
415
|
-
// TODO: add this back in 1.9 and use $.error() (see #5972)
|
416
|
-
// if ( !instance ) {
|
417
|
-
// throw "cannot call methods on " + name + " prior to initialization; " +
|
418
|
-
// "attempted to call method '" + options + "'";
|
419
|
-
// }
|
420
|
-
// if ( !$.isFunction( instance[options] ) ) {
|
421
|
-
// throw "no such method '" + options + "' for " + name + " widget instance";
|
422
|
-
// }
|
423
|
-
// var methodValue = instance[ options ].apply( instance, args );
|
424
|
-
if ( methodValue !== instance && methodValue !== undefined ) {
|
425
|
-
returnValue = methodValue;
|
426
|
-
return false;
|
427
|
-
}
|
428
|
-
});
|
429
|
-
} else {
|
430
|
-
this.each(function() {
|
431
|
-
var instance = $.data( this, name );
|
432
|
-
if ( instance ) {
|
433
|
-
instance.option( options || {} )._init();
|
434
|
-
} else {
|
435
|
-
$.data( this, name, new object( options, this ) );
|
436
|
-
}
|
437
|
-
});
|
438
|
-
}
|
439
|
-
|
440
|
-
return returnValue;
|
441
|
-
};
|
442
|
-
};
|
443
|
-
|
444
|
-
$.Widget = function( options, element ) {
|
445
|
-
// allow instantiation without initializing for simple inheritance
|
446
|
-
if ( arguments.length ) {
|
447
|
-
this._createWidget( options, element );
|
448
|
-
}
|
449
|
-
};
|
450
|
-
|
451
|
-
$.Widget.prototype = {
|
452
|
-
widgetName: "widget",
|
453
|
-
widgetEventPrefix: "",
|
454
|
-
options: {
|
455
|
-
disabled: false
|
456
|
-
},
|
457
|
-
_createWidget: function( options, element ) {
|
458
|
-
// $.widget.bridge stores the plugin instance, but we do it anyway
|
459
|
-
// so that it's stored even before the _create function runs
|
460
|
-
$.data( element, this.widgetName, this );
|
461
|
-
this.element = $( element );
|
462
|
-
this.options = $.extend( true, {},
|
463
|
-
this.options,
|
464
|
-
this._getCreateOptions(),
|
465
|
-
options );
|
466
|
-
|
467
|
-
var self = this;
|
468
|
-
this.element.bind( "remove." + this.widgetName, function() {
|
469
|
-
self.destroy();
|
470
|
-
});
|
471
|
-
|
472
|
-
this._create();
|
473
|
-
this._trigger( "create" );
|
474
|
-
this._init();
|
475
|
-
},
|
476
|
-
_getCreateOptions: function() {
|
477
|
-
return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
|
478
|
-
},
|
479
|
-
_create: function() {},
|
480
|
-
_init: function() {},
|
481
|
-
|
482
|
-
destroy: function() {
|
483
|
-
this.element
|
484
|
-
.unbind( "." + this.widgetName )
|
485
|
-
.removeData( this.widgetName );
|
486
|
-
this.widget()
|
487
|
-
.unbind( "." + this.widgetName )
|
488
|
-
.removeAttr( "aria-disabled" )
|
489
|
-
.removeClass(
|
490
|
-
this.widgetBaseClass + "-disabled " +
|
491
|
-
"ui-state-disabled" );
|
492
|
-
},
|
493
|
-
|
494
|
-
widget: function() {
|
495
|
-
return this.element;
|
496
|
-
},
|
497
|
-
|
498
|
-
option: function( key, value ) {
|
499
|
-
var options = key;
|
500
|
-
|
501
|
-
if ( arguments.length === 0 ) {
|
502
|
-
// don't return a reference to the internal hash
|
503
|
-
return $.extend( {}, this.options );
|
504
|
-
}
|
505
|
-
|
506
|
-
if (typeof key === "string" ) {
|
507
|
-
if ( value === undefined ) {
|
508
|
-
return this.options[ key ];
|
509
|
-
}
|
510
|
-
options = {};
|
511
|
-
options[ key ] = value;
|
512
|
-
}
|
513
|
-
|
514
|
-
this._setOptions( options );
|
515
|
-
|
516
|
-
return this;
|
517
|
-
},
|
518
|
-
_setOptions: function( options ) {
|
519
|
-
var self = this;
|
520
|
-
$.each( options, function( key, value ) {
|
521
|
-
self._setOption( key, value );
|
522
|
-
});
|
523
|
-
|
524
|
-
return this;
|
525
|
-
},
|
526
|
-
_setOption: function( key, value ) {
|
527
|
-
this.options[ key ] = value;
|
528
|
-
|
529
|
-
if ( key === "disabled" ) {
|
530
|
-
this.widget()
|
531
|
-
[ value ? "addClass" : "removeClass"](
|
532
|
-
this.widgetBaseClass + "-disabled" + " " +
|
533
|
-
"ui-state-disabled" )
|
534
|
-
.attr( "aria-disabled", value );
|
535
|
-
}
|
536
|
-
|
537
|
-
return this;
|
538
|
-
},
|
539
|
-
|
540
|
-
enable: function() {
|
541
|
-
return this._setOption( "disabled", false );
|
542
|
-
},
|
543
|
-
disable: function() {
|
544
|
-
return this._setOption( "disabled", true );
|
545
|
-
},
|
546
|
-
|
547
|
-
_trigger: function( type, event, data ) {
|
548
|
-
var callback = this.options[ type ];
|
549
|
-
|
550
|
-
event = $.Event( event );
|
551
|
-
event.type = ( type === this.widgetEventPrefix ?
|
552
|
-
type :
|
553
|
-
this.widgetEventPrefix + type ).toLowerCase();
|
554
|
-
data = data || {};
|
555
|
-
|
556
|
-
// copy original event properties over to the new event
|
557
|
-
// this would happen if we could call $.event.fix instead of $.Event
|
558
|
-
// but we don't have a way to force an event to be fixed multiple times
|
559
|
-
if ( event.originalEvent ) {
|
560
|
-
for ( var i = $.event.props.length, prop; i; ) {
|
561
|
-
prop = $.event.props[ --i ];
|
562
|
-
event[ prop ] = event.originalEvent[ prop ];
|
563
|
-
}
|
564
|
-
}
|
565
|
-
|
566
|
-
this.element.trigger( event, data );
|
567
|
-
|
568
|
-
return !( $.isFunction(callback) &&
|
569
|
-
callback.call( this.element[0], event, data ) === false ||
|
570
|
-
event.isDefaultPrevented() );
|
571
|
-
}
|
572
|
-
};
|
573
|
-
|
574
|
-
})( jQuery );
|
575
|
-
/*!
|
576
|
-
* jQuery UI Mouse 1.8.13
|
577
|
-
*
|
578
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
579
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
580
|
-
* http://jquery.org/license
|
581
|
-
*
|
582
|
-
* http://docs.jquery.com/UI/Mouse
|
583
|
-
*
|
584
|
-
* Depends:
|
585
|
-
* jquery.ui.widget.js
|
586
|
-
*/
|
587
|
-
(function( $, undefined ) {
|
588
|
-
|
589
|
-
var mouseHandled = false;
|
590
|
-
$(document).mousedown(function(e) {
|
591
|
-
mouseHandled = false;
|
592
|
-
});
|
593
|
-
|
594
|
-
$.widget("ui.mouse", {
|
595
|
-
options: {
|
596
|
-
cancel: ':input,option',
|
597
|
-
distance: 1,
|
598
|
-
delay: 0
|
599
|
-
},
|
600
|
-
_mouseInit: function() {
|
601
|
-
var self = this;
|
602
|
-
|
603
|
-
this.element
|
604
|
-
.bind('mousedown.'+this.widgetName, function(event) {
|
605
|
-
return self._mouseDown(event);
|
606
|
-
})
|
607
|
-
.bind('click.'+this.widgetName, function(event) {
|
608
|
-
if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) {
|
609
|
-
$.removeData(event.target, self.widgetName + '.preventClickEvent');
|
610
|
-
event.stopImmediatePropagation();
|
611
|
-
return false;
|
612
|
-
}
|
613
|
-
});
|
614
|
-
|
615
|
-
this.started = false;
|
616
|
-
},
|
617
|
-
|
618
|
-
// TODO: make sure destroying one instance of mouse doesn't mess with
|
619
|
-
// other instances of mouse
|
620
|
-
_mouseDestroy: function() {
|
621
|
-
this.element.unbind('.'+this.widgetName);
|
622
|
-
},
|
623
|
-
|
624
|
-
_mouseDown: function(event) {
|
625
|
-
// don't let more than one widget handle mouseStart
|
626
|
-
if(mouseHandled) {return};
|
627
|
-
|
628
|
-
// we may have missed mouseup (out of window)
|
629
|
-
(this._mouseStarted && this._mouseUp(event));
|
630
|
-
|
631
|
-
this._mouseDownEvent = event;
|
632
|
-
|
633
|
-
var self = this,
|
634
|
-
btnIsLeft = (event.which == 1),
|
635
|
-
elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
|
636
|
-
if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
|
637
|
-
return true;
|
638
|
-
}
|
639
|
-
|
640
|
-
this.mouseDelayMet = !this.options.delay;
|
641
|
-
if (!this.mouseDelayMet) {
|
642
|
-
this._mouseDelayTimer = setTimeout(function() {
|
643
|
-
self.mouseDelayMet = true;
|
644
|
-
}, this.options.delay);
|
645
|
-
}
|
646
|
-
|
647
|
-
if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
|
648
|
-
this._mouseStarted = (this._mouseStart(event) !== false);
|
649
|
-
if (!this._mouseStarted) {
|
650
|
-
event.preventDefault();
|
651
|
-
return true;
|
652
|
-
}
|
653
|
-
}
|
654
|
-
|
655
|
-
// Click event may never have fired (Gecko & Opera)
|
656
|
-
if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {
|
657
|
-
$.removeData(event.target, this.widgetName + '.preventClickEvent');
|
658
|
-
}
|
659
|
-
|
660
|
-
// these delegates are required to keep context
|
661
|
-
this._mouseMoveDelegate = function(event) {
|
662
|
-
return self._mouseMove(event);
|
663
|
-
};
|
664
|
-
this._mouseUpDelegate = function(event) {
|
665
|
-
return self._mouseUp(event);
|
666
|
-
};
|
667
|
-
$(document)
|
668
|
-
.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
|
669
|
-
.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
|
670
|
-
|
671
|
-
event.preventDefault();
|
672
|
-
|
673
|
-
mouseHandled = true;
|
674
|
-
return true;
|
675
|
-
},
|
676
|
-
|
677
|
-
_mouseMove: function(event) {
|
678
|
-
// IE mouseup check - mouseup happened when mouse was out of window
|
679
|
-
if ($.browser.msie && !(document.documentMode >= 9) && !event.button) {
|
680
|
-
return this._mouseUp(event);
|
681
|
-
}
|
682
|
-
|
683
|
-
if (this._mouseStarted) {
|
684
|
-
this._mouseDrag(event);
|
685
|
-
return event.preventDefault();
|
686
|
-
}
|
687
|
-
|
688
|
-
if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
|
689
|
-
this._mouseStarted =
|
690
|
-
(this._mouseStart(this._mouseDownEvent, event) !== false);
|
691
|
-
(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
|
692
|
-
}
|
693
|
-
|
694
|
-
return !this._mouseStarted;
|
695
|
-
},
|
696
|
-
|
697
|
-
_mouseUp: function(event) {
|
698
|
-
$(document)
|
699
|
-
.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
|
700
|
-
.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
|
701
|
-
|
702
|
-
if (this._mouseStarted) {
|
703
|
-
this._mouseStarted = false;
|
704
|
-
|
705
|
-
if (event.target == this._mouseDownEvent.target) {
|
706
|
-
$.data(event.target, this.widgetName + '.preventClickEvent', true);
|
707
|
-
}
|
708
|
-
|
709
|
-
this._mouseStop(event);
|
710
|
-
}
|
711
|
-
|
712
|
-
return false;
|
713
|
-
},
|
714
|
-
|
715
|
-
_mouseDistanceMet: function(event) {
|
716
|
-
return (Math.max(
|
717
|
-
Math.abs(this._mouseDownEvent.pageX - event.pageX),
|
718
|
-
Math.abs(this._mouseDownEvent.pageY - event.pageY)
|
719
|
-
) >= this.options.distance
|
720
|
-
);
|
721
|
-
},
|
722
|
-
|
723
|
-
_mouseDelayMet: function(event) {
|
724
|
-
return this.mouseDelayMet;
|
725
|
-
},
|
726
|
-
|
727
|
-
// These are placeholder methods, to be overriden by extending plugin
|
728
|
-
_mouseStart: function(event) {},
|
729
|
-
_mouseDrag: function(event) {},
|
730
|
-
_mouseStop: function(event) {},
|
731
|
-
_mouseCapture: function(event) { return true; }
|
732
|
-
});
|
733
|
-
|
734
|
-
})(jQuery);
|
735
|
-
/*
|
736
|
-
* jQuery UI Draggable 1.8.13
|
737
|
-
*
|
738
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
739
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
740
|
-
* http://jquery.org/license
|
741
|
-
*
|
742
|
-
* http://docs.jquery.com/UI/Draggables
|
743
|
-
*
|
744
|
-
* Depends:
|
745
|
-
* jquery.ui.core.js
|
746
|
-
* jquery.ui.mouse.js
|
747
|
-
* jquery.ui.widget.js
|
748
|
-
*/
|
749
|
-
(function( $, undefined ) {
|
750
|
-
|
751
|
-
$.widget("ui.draggable", $.ui.mouse, {
|
752
|
-
widgetEventPrefix: "drag",
|
753
|
-
options: {
|
754
|
-
addClasses: true,
|
755
|
-
appendTo: "parent",
|
756
|
-
axis: false,
|
757
|
-
connectToSortable: false,
|
758
|
-
containment: false,
|
759
|
-
cursor: "auto",
|
760
|
-
cursorAt: false,
|
761
|
-
grid: false,
|
762
|
-
handle: false,
|
763
|
-
helper: "original",
|
764
|
-
iframeFix: false,
|
765
|
-
opacity: false,
|
766
|
-
refreshPositions: false,
|
767
|
-
revert: false,
|
768
|
-
revertDuration: 500,
|
769
|
-
scope: "default",
|
770
|
-
scroll: true,
|
771
|
-
scrollSensitivity: 20,
|
772
|
-
scrollSpeed: 20,
|
773
|
-
snap: false,
|
774
|
-
snapMode: "both",
|
775
|
-
snapTolerance: 20,
|
776
|
-
stack: false,
|
777
|
-
zIndex: false
|
778
|
-
},
|
779
|
-
_create: function() {
|
780
|
-
|
781
|
-
if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
|
782
|
-
this.element[0].style.position = 'relative';
|
783
|
-
|
784
|
-
(this.options.addClasses && this.element.addClass("ui-draggable"));
|
785
|
-
(this.options.disabled && this.element.addClass("ui-draggable-disabled"));
|
786
|
-
|
787
|
-
this._mouseInit();
|
788
|
-
|
789
|
-
},
|
790
|
-
|
791
|
-
destroy: function() {
|
792
|
-
if(!this.element.data('draggable')) return;
|
793
|
-
this.element
|
794
|
-
.removeData("draggable")
|
795
|
-
.unbind(".draggable")
|
796
|
-
.removeClass("ui-draggable"
|
797
|
-
+ " ui-draggable-dragging"
|
798
|
-
+ " ui-draggable-disabled");
|
799
|
-
this._mouseDestroy();
|
800
|
-
|
801
|
-
return this;
|
802
|
-
},
|
803
|
-
|
804
|
-
_mouseCapture: function(event) {
|
805
|
-
|
806
|
-
var o = this.options;
|
807
|
-
|
808
|
-
// among others, prevent a drag on a resizable-handle
|
809
|
-
if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
|
810
|
-
return false;
|
811
|
-
|
812
|
-
//Quit if we're not on a valid handle
|
813
|
-
this.handle = this._getHandle(event);
|
814
|
-
if (!this.handle)
|
815
|
-
return false;
|
816
|
-
|
817
|
-
$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
|
818
|
-
$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
|
819
|
-
.css({
|
820
|
-
width: this.offsetWidth+"px", height: this.offsetHeight+"px",
|
821
|
-
position: "absolute", opacity: "0.001", zIndex: 1000
|
822
|
-
})
|
823
|
-
.css($(this).offset())
|
824
|
-
.appendTo("body");
|
825
|
-
});
|
826
|
-
|
827
|
-
return true;
|
828
|
-
|
829
|
-
},
|
830
|
-
|
831
|
-
_mouseStart: function(event) {
|
832
|
-
|
833
|
-
var o = this.options;
|
834
|
-
|
835
|
-
//Create and append the visible helper
|
836
|
-
this.helper = this._createHelper(event);
|
837
|
-
|
838
|
-
//Cache the helper size
|
839
|
-
this._cacheHelperProportions();
|
840
|
-
|
841
|
-
//If ddmanager is used for droppables, set the global draggable
|
842
|
-
if($.ui.ddmanager)
|
843
|
-
$.ui.ddmanager.current = this
|