jqueryui-requirejs-rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +22 -0
- data/README.md +3 -0
- data/Rakefile +27 -0
- data/app/assets/javascripts/jqueryui/accordion.js +575 -0
- data/app/assets/javascripts/jqueryui/autocomplete.js +613 -0
- data/app/assets/javascripts/jqueryui/button.js +422 -0
- data/app/assets/javascripts/jqueryui/core.js +323 -0
- data/app/assets/javascripts/jqueryui/datepicker-af.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-ar-DZ.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-ar.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-az.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-be.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-bg.js +27 -0
- data/app/assets/javascripts/jqueryui/datepicker-bs.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-ca.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-cs.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-cy-GB.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-da.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-de.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-el.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-en-AU.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-en-GB.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-en-NZ.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-eo.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-es.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-et.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-eu.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-fa.js +62 -0
- data/app/assets/javascripts/jqueryui/datepicker-fi.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-fo.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-fr-CA.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-fr-CH.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-fr.js +28 -0
- data/app/assets/javascripts/jqueryui/datepicker-gl.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-he.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-hi.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-hr.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-hu.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-hy.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-id.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-is.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-it.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-ja.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-ka.js +24 -0
- data/app/assets/javascripts/jqueryui/datepicker-kk.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-km.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-ko.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-ky.js +27 -0
- data/app/assets/javascripts/jqueryui/datepicker-lb.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-lt.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-lv.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-mk.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-ml.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-ms.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-nb.js +25 -0
- data/app/assets/javascripts/jqueryui/datepicker-nl-BE.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-nl.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-nn.js +25 -0
- data/app/assets/javascripts/jqueryui/datepicker-no.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-pl.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-pt-BR.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-pt.js +25 -0
- data/app/assets/javascripts/jqueryui/datepicker-rm.js +24 -0
- data/app/assets/javascripts/jqueryui/datepicker-ro.js +29 -0
- data/app/assets/javascripts/jqueryui/datepicker-ru.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-sk.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-sl.js +27 -0
- data/app/assets/javascripts/jqueryui/datepicker-sq.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-sr-SR.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-sr.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-sv.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-ta.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-th.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-tj.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-tr.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-uk.js +27 -0
- data/app/assets/javascripts/jqueryui/datepicker-vi.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-zh-CN.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-zh-HK.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker-zh-TW.js +26 -0
- data/app/assets/javascripts/jqueryui/datepicker.js +2053 -0
- data/app/assets/javascripts/jqueryui/dialog.js +811 -0
- data/app/assets/javascripts/jqueryui/draggable.js +936 -0
- data/app/assets/javascripts/jqueryui/droppable.js +375 -0
- data/app/assets/javascripts/jqueryui/effect-blind.js +85 -0
- data/app/assets/javascripts/jqueryui/effect-bounce.js +116 -0
- data/app/assets/javascripts/jqueryui/effect-clip.js +70 -0
- data/app/assets/javascripts/jqueryui/effect-drop.js +68 -0
- data/app/assets/javascripts/jqueryui/effect-explode.js +100 -0
- data/app/assets/javascripts/jqueryui/effect-fade.js +33 -0
- data/app/assets/javascripts/jqueryui/effect-fold.js +79 -0
- data/app/assets/javascripts/jqueryui/effect-highlight.js +53 -0
- data/app/assets/javascripts/jqueryui/effect-pulsate.js +66 -0
- data/app/assets/javascripts/jqueryui/effect-scale.js +321 -0
- data/app/assets/javascripts/jqueryui/effect-shake.js +77 -0
- data/app/assets/javascripts/jqueryui/effect-slide.js +67 -0
- data/app/assets/javascripts/jqueryui/effect-transfer.js +50 -0
- data/app/assets/javascripts/jqueryui/effect.js +1292 -0
- data/app/assets/javascripts/jqueryui/menu.js +624 -0
- data/app/assets/javascripts/jqueryui/mouse.js +172 -0
- data/app/assets/javascripts/jqueryui/position.js +500 -0
- data/app/assets/javascripts/jqueryui/progressbar.js +148 -0
- data/app/assets/javascripts/jqueryui/resizable.js +971 -0
- data/app/assets/javascripts/jqueryui/selectable.js +280 -0
- data/app/assets/javascripts/jqueryui/slider.js +675 -0
- data/app/assets/javascripts/jqueryui/sortable.js +1285 -0
- data/app/assets/javascripts/jqueryui/spinner.js +496 -0
- data/app/assets/javascripts/jqueryui/tabs.js +849 -0
- data/app/assets/javascripts/jqueryui/tooltip.js +405 -0
- data/app/assets/javascripts/jqueryui/widget.js +524 -0
- data/lib/jqueryui-requirejs-rails.rb +4 -0
- data/lib/jqueryui-requirejs-rails/engine.rb +4 -0
- data/lib/jqueryui-requirejs-rails/version.rb +3 -0
- metadata +196 -0
@@ -0,0 +1,422 @@
|
|
1
|
+
define(['jquery','./core','./widget'], function (jQuery) {
|
2
|
+
/*!
|
3
|
+
* jQuery UI Button 1.10.2
|
4
|
+
* http://jqueryui.com
|
5
|
+
*
|
6
|
+
* Copyright 2013 jQuery Foundation and other contributors
|
7
|
+
* Released under the MIT license.
|
8
|
+
* http://jquery.org/license
|
9
|
+
*
|
10
|
+
* http://api.jqueryui.com/button/
|
11
|
+
*
|
12
|
+
* Depends:
|
13
|
+
* jquery.ui.core.js
|
14
|
+
* jquery.ui.widget.js
|
15
|
+
*/
|
16
|
+
(function( $, undefined ) {
|
17
|
+
|
18
|
+
var lastActive, startXPos, startYPos, clickDragged,
|
19
|
+
baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
|
20
|
+
stateClasses = "ui-state-hover ui-state-active ",
|
21
|
+
typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
|
22
|
+
formResetHandler = function() {
|
23
|
+
var buttons = $( this ).find( ":ui-button" );
|
24
|
+
setTimeout(function() {
|
25
|
+
buttons.button( "refresh" );
|
26
|
+
}, 1 );
|
27
|
+
},
|
28
|
+
radioGroup = function( radio ) {
|
29
|
+
var name = radio.name,
|
30
|
+
form = radio.form,
|
31
|
+
radios = $( [] );
|
32
|
+
if ( name ) {
|
33
|
+
name = name.replace( /'/g, "\\'" );
|
34
|
+
if ( form ) {
|
35
|
+
radios = $( form ).find( "[name='" + name + "']" );
|
36
|
+
} else {
|
37
|
+
radios = $( "[name='" + name + "']", radio.ownerDocument )
|
38
|
+
.filter(function() {
|
39
|
+
return !this.form;
|
40
|
+
});
|
41
|
+
}
|
42
|
+
}
|
43
|
+
return radios;
|
44
|
+
};
|
45
|
+
|
46
|
+
$.widget( "ui.button", {
|
47
|
+
version: "1.10.2",
|
48
|
+
defaultElement: "<button>",
|
49
|
+
options: {
|
50
|
+
disabled: null,
|
51
|
+
text: true,
|
52
|
+
label: null,
|
53
|
+
icons: {
|
54
|
+
primary: null,
|
55
|
+
secondary: null
|
56
|
+
}
|
57
|
+
},
|
58
|
+
_create: function() {
|
59
|
+
this.element.closest( "form" )
|
60
|
+
.unbind( "reset" + this.eventNamespace )
|
61
|
+
.bind( "reset" + this.eventNamespace, formResetHandler );
|
62
|
+
|
63
|
+
if ( typeof this.options.disabled !== "boolean" ) {
|
64
|
+
this.options.disabled = !!this.element.prop( "disabled" );
|
65
|
+
} else {
|
66
|
+
this.element.prop( "disabled", this.options.disabled );
|
67
|
+
}
|
68
|
+
|
69
|
+
this._determineButtonType();
|
70
|
+
this.hasTitle = !!this.buttonElement.attr( "title" );
|
71
|
+
|
72
|
+
var that = this,
|
73
|
+
options = this.options,
|
74
|
+
toggleButton = this.type === "checkbox" || this.type === "radio",
|
75
|
+
activeClass = !toggleButton ? "ui-state-active" : "",
|
76
|
+
focusClass = "ui-state-focus";
|
77
|
+
|
78
|
+
if ( options.label === null ) {
|
79
|
+
options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
|
80
|
+
}
|
81
|
+
|
82
|
+
this._hoverable( this.buttonElement );
|
83
|
+
|
84
|
+
this.buttonElement
|
85
|
+
.addClass( baseClasses )
|
86
|
+
.attr( "role", "button" )
|
87
|
+
.bind( "mouseenter" + this.eventNamespace, function() {
|
88
|
+
if ( options.disabled ) {
|
89
|
+
return;
|
90
|
+
}
|
91
|
+
if ( this === lastActive ) {
|
92
|
+
$( this ).addClass( "ui-state-active" );
|
93
|
+
}
|
94
|
+
})
|
95
|
+
.bind( "mouseleave" + this.eventNamespace, function() {
|
96
|
+
if ( options.disabled ) {
|
97
|
+
return;
|
98
|
+
}
|
99
|
+
$( this ).removeClass( activeClass );
|
100
|
+
})
|
101
|
+
.bind( "click" + this.eventNamespace, function( event ) {
|
102
|
+
if ( options.disabled ) {
|
103
|
+
event.preventDefault();
|
104
|
+
event.stopImmediatePropagation();
|
105
|
+
}
|
106
|
+
});
|
107
|
+
|
108
|
+
this.element
|
109
|
+
.bind( "focus" + this.eventNamespace, function() {
|
110
|
+
// no need to check disabled, focus won't be triggered anyway
|
111
|
+
that.buttonElement.addClass( focusClass );
|
112
|
+
})
|
113
|
+
.bind( "blur" + this.eventNamespace, function() {
|
114
|
+
that.buttonElement.removeClass( focusClass );
|
115
|
+
});
|
116
|
+
|
117
|
+
if ( toggleButton ) {
|
118
|
+
this.element.bind( "change" + this.eventNamespace, function() {
|
119
|
+
if ( clickDragged ) {
|
120
|
+
return;
|
121
|
+
}
|
122
|
+
that.refresh();
|
123
|
+
});
|
124
|
+
// if mouse moves between mousedown and mouseup (drag) set clickDragged flag
|
125
|
+
// prevents issue where button state changes but checkbox/radio checked state
|
126
|
+
// does not in Firefox (see ticket #6970)
|
127
|
+
this.buttonElement
|
128
|
+
.bind( "mousedown" + this.eventNamespace, function( event ) {
|
129
|
+
if ( options.disabled ) {
|
130
|
+
return;
|
131
|
+
}
|
132
|
+
clickDragged = false;
|
133
|
+
startXPos = event.pageX;
|
134
|
+
startYPos = event.pageY;
|
135
|
+
})
|
136
|
+
.bind( "mouseup" + this.eventNamespace, function( event ) {
|
137
|
+
if ( options.disabled ) {
|
138
|
+
return;
|
139
|
+
}
|
140
|
+
if ( startXPos !== event.pageX || startYPos !== event.pageY ) {
|
141
|
+
clickDragged = true;
|
142
|
+
}
|
143
|
+
});
|
144
|
+
}
|
145
|
+
|
146
|
+
if ( this.type === "checkbox" ) {
|
147
|
+
this.buttonElement.bind( "click" + this.eventNamespace, function() {
|
148
|
+
if ( options.disabled || clickDragged ) {
|
149
|
+
return false;
|
150
|
+
}
|
151
|
+
});
|
152
|
+
} else if ( this.type === "radio" ) {
|
153
|
+
this.buttonElement.bind( "click" + this.eventNamespace, function() {
|
154
|
+
if ( options.disabled || clickDragged ) {
|
155
|
+
return false;
|
156
|
+
}
|
157
|
+
$( this ).addClass( "ui-state-active" );
|
158
|
+
that.buttonElement.attr( "aria-pressed", "true" );
|
159
|
+
|
160
|
+
var radio = that.element[ 0 ];
|
161
|
+
radioGroup( radio )
|
162
|
+
.not( radio )
|
163
|
+
.map(function() {
|
164
|
+
return $( this ).button( "widget" )[ 0 ];
|
165
|
+
})
|
166
|
+
.removeClass( "ui-state-active" )
|
167
|
+
.attr( "aria-pressed", "false" );
|
168
|
+
});
|
169
|
+
} else {
|
170
|
+
this.buttonElement
|
171
|
+
.bind( "mousedown" + this.eventNamespace, function() {
|
172
|
+
if ( options.disabled ) {
|
173
|
+
return false;
|
174
|
+
}
|
175
|
+
$( this ).addClass( "ui-state-active" );
|
176
|
+
lastActive = this;
|
177
|
+
that.document.one( "mouseup", function() {
|
178
|
+
lastActive = null;
|
179
|
+
});
|
180
|
+
})
|
181
|
+
.bind( "mouseup" + this.eventNamespace, function() {
|
182
|
+
if ( options.disabled ) {
|
183
|
+
return false;
|
184
|
+
}
|
185
|
+
$( this ).removeClass( "ui-state-active" );
|
186
|
+
})
|
187
|
+
.bind( "keydown" + this.eventNamespace, function(event) {
|
188
|
+
if ( options.disabled ) {
|
189
|
+
return false;
|
190
|
+
}
|
191
|
+
if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
|
192
|
+
$( this ).addClass( "ui-state-active" );
|
193
|
+
}
|
194
|
+
})
|
195
|
+
// see #8559, we bind to blur here in case the button element loses
|
196
|
+
// focus between keydown and keyup, it would be left in an "active" state
|
197
|
+
.bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
|
198
|
+
$( this ).removeClass( "ui-state-active" );
|
199
|
+
});
|
200
|
+
|
201
|
+
if ( this.buttonElement.is("a") ) {
|
202
|
+
this.buttonElement.keyup(function(event) {
|
203
|
+
if ( event.keyCode === $.ui.keyCode.SPACE ) {
|
204
|
+
// TODO pass through original event correctly (just as 2nd argument doesn't work)
|
205
|
+
$( this ).click();
|
206
|
+
}
|
207
|
+
});
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
// TODO: pull out $.Widget's handling for the disabled option into
|
212
|
+
// $.Widget.prototype._setOptionDisabled so it's easy to proxy and can
|
213
|
+
// be overridden by individual plugins
|
214
|
+
this._setOption( "disabled", options.disabled );
|
215
|
+
this._resetButton();
|
216
|
+
},
|
217
|
+
|
218
|
+
_determineButtonType: function() {
|
219
|
+
var ancestor, labelSelector, checked;
|
220
|
+
|
221
|
+
if ( this.element.is("[type=checkbox]") ) {
|
222
|
+
this.type = "checkbox";
|
223
|
+
} else if ( this.element.is("[type=radio]") ) {
|
224
|
+
this.type = "radio";
|
225
|
+
} else if ( this.element.is("input") ) {
|
226
|
+
this.type = "input";
|
227
|
+
} else {
|
228
|
+
this.type = "button";
|
229
|
+
}
|
230
|
+
|
231
|
+
if ( this.type === "checkbox" || this.type === "radio" ) {
|
232
|
+
// we don't search against the document in case the element
|
233
|
+
// is disconnected from the DOM
|
234
|
+
ancestor = this.element.parents().last();
|
235
|
+
labelSelector = "label[for='" + this.element.attr("id") + "']";
|
236
|
+
this.buttonElement = ancestor.find( labelSelector );
|
237
|
+
if ( !this.buttonElement.length ) {
|
238
|
+
ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
|
239
|
+
this.buttonElement = ancestor.filter( labelSelector );
|
240
|
+
if ( !this.buttonElement.length ) {
|
241
|
+
this.buttonElement = ancestor.find( labelSelector );
|
242
|
+
}
|
243
|
+
}
|
244
|
+
this.element.addClass( "ui-helper-hidden-accessible" );
|
245
|
+
|
246
|
+
checked = this.element.is( ":checked" );
|
247
|
+
if ( checked ) {
|
248
|
+
this.buttonElement.addClass( "ui-state-active" );
|
249
|
+
}
|
250
|
+
this.buttonElement.prop( "aria-pressed", checked );
|
251
|
+
} else {
|
252
|
+
this.buttonElement = this.element;
|
253
|
+
}
|
254
|
+
},
|
255
|
+
|
256
|
+
widget: function() {
|
257
|
+
return this.buttonElement;
|
258
|
+
},
|
259
|
+
|
260
|
+
_destroy: function() {
|
261
|
+
this.element
|
262
|
+
.removeClass( "ui-helper-hidden-accessible" );
|
263
|
+
this.buttonElement
|
264
|
+
.removeClass( baseClasses + " " + stateClasses + " " + typeClasses )
|
265
|
+
.removeAttr( "role" )
|
266
|
+
.removeAttr( "aria-pressed" )
|
267
|
+
.html( this.buttonElement.find(".ui-button-text").html() );
|
268
|
+
|
269
|
+
if ( !this.hasTitle ) {
|
270
|
+
this.buttonElement.removeAttr( "title" );
|
271
|
+
}
|
272
|
+
},
|
273
|
+
|
274
|
+
_setOption: function( key, value ) {
|
275
|
+
this._super( key, value );
|
276
|
+
if ( key === "disabled" ) {
|
277
|
+
if ( value ) {
|
278
|
+
this.element.prop( "disabled", true );
|
279
|
+
} else {
|
280
|
+
this.element.prop( "disabled", false );
|
281
|
+
}
|
282
|
+
return;
|
283
|
+
}
|
284
|
+
this._resetButton();
|
285
|
+
},
|
286
|
+
|
287
|
+
refresh: function() {
|
288
|
+
//See #8237 & #8828
|
289
|
+
var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
|
290
|
+
|
291
|
+
if ( isDisabled !== this.options.disabled ) {
|
292
|
+
this._setOption( "disabled", isDisabled );
|
293
|
+
}
|
294
|
+
if ( this.type === "radio" ) {
|
295
|
+
radioGroup( this.element[0] ).each(function() {
|
296
|
+
if ( $( this ).is( ":checked" ) ) {
|
297
|
+
$( this ).button( "widget" )
|
298
|
+
.addClass( "ui-state-active" )
|
299
|
+
.attr( "aria-pressed", "true" );
|
300
|
+
} else {
|
301
|
+
$( this ).button( "widget" )
|
302
|
+
.removeClass( "ui-state-active" )
|
303
|
+
.attr( "aria-pressed", "false" );
|
304
|
+
}
|
305
|
+
});
|
306
|
+
} else if ( this.type === "checkbox" ) {
|
307
|
+
if ( this.element.is( ":checked" ) ) {
|
308
|
+
this.buttonElement
|
309
|
+
.addClass( "ui-state-active" )
|
310
|
+
.attr( "aria-pressed", "true" );
|
311
|
+
} else {
|
312
|
+
this.buttonElement
|
313
|
+
.removeClass( "ui-state-active" )
|
314
|
+
.attr( "aria-pressed", "false" );
|
315
|
+
}
|
316
|
+
}
|
317
|
+
},
|
318
|
+
|
319
|
+
_resetButton: function() {
|
320
|
+
if ( this.type === "input" ) {
|
321
|
+
if ( this.options.label ) {
|
322
|
+
this.element.val( this.options.label );
|
323
|
+
}
|
324
|
+
return;
|
325
|
+
}
|
326
|
+
var buttonElement = this.buttonElement.removeClass( typeClasses ),
|
327
|
+
buttonText = $( "<span></span>", this.document[0] )
|
328
|
+
.addClass( "ui-button-text" )
|
329
|
+
.html( this.options.label )
|
330
|
+
.appendTo( buttonElement.empty() )
|
331
|
+
.text(),
|
332
|
+
icons = this.options.icons,
|
333
|
+
multipleIcons = icons.primary && icons.secondary,
|
334
|
+
buttonClasses = [];
|
335
|
+
|
336
|
+
if ( icons.primary || icons.secondary ) {
|
337
|
+
if ( this.options.text ) {
|
338
|
+
buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
|
339
|
+
}
|
340
|
+
|
341
|
+
if ( icons.primary ) {
|
342
|
+
buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
|
343
|
+
}
|
344
|
+
|
345
|
+
if ( icons.secondary ) {
|
346
|
+
buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
|
347
|
+
}
|
348
|
+
|
349
|
+
if ( !this.options.text ) {
|
350
|
+
buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
|
351
|
+
|
352
|
+
if ( !this.hasTitle ) {
|
353
|
+
buttonElement.attr( "title", $.trim( buttonText ) );
|
354
|
+
}
|
355
|
+
}
|
356
|
+
} else {
|
357
|
+
buttonClasses.push( "ui-button-text-only" );
|
358
|
+
}
|
359
|
+
buttonElement.addClass( buttonClasses.join( " " ) );
|
360
|
+
}
|
361
|
+
});
|
362
|
+
|
363
|
+
$.widget( "ui.buttonset", {
|
364
|
+
version: "1.10.2",
|
365
|
+
options: {
|
366
|
+
items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
|
367
|
+
},
|
368
|
+
|
369
|
+
_create: function() {
|
370
|
+
this.element.addClass( "ui-buttonset" );
|
371
|
+
},
|
372
|
+
|
373
|
+
_init: function() {
|
374
|
+
this.refresh();
|
375
|
+
},
|
376
|
+
|
377
|
+
_setOption: function( key, value ) {
|
378
|
+
if ( key === "disabled" ) {
|
379
|
+
this.buttons.button( "option", key, value );
|
380
|
+
}
|
381
|
+
|
382
|
+
this._super( key, value );
|
383
|
+
},
|
384
|
+
|
385
|
+
refresh: function() {
|
386
|
+
var rtl = this.element.css( "direction" ) === "rtl";
|
387
|
+
|
388
|
+
this.buttons = this.element.find( this.options.items )
|
389
|
+
.filter( ":ui-button" )
|
390
|
+
.button( "refresh" )
|
391
|
+
.end()
|
392
|
+
.not( ":ui-button" )
|
393
|
+
.button()
|
394
|
+
.end()
|
395
|
+
.map(function() {
|
396
|
+
return $( this ).button( "widget" )[ 0 ];
|
397
|
+
})
|
398
|
+
.removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
|
399
|
+
.filter( ":first" )
|
400
|
+
.addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
|
401
|
+
.end()
|
402
|
+
.filter( ":last" )
|
403
|
+
.addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
|
404
|
+
.end()
|
405
|
+
.end();
|
406
|
+
},
|
407
|
+
|
408
|
+
_destroy: function() {
|
409
|
+
this.element.removeClass( "ui-buttonset" );
|
410
|
+
this.buttons
|
411
|
+
.map(function() {
|
412
|
+
return $( this ).button( "widget" )[ 0 ];
|
413
|
+
})
|
414
|
+
.removeClass( "ui-corner-left ui-corner-right" )
|
415
|
+
.end()
|
416
|
+
.button( "destroy" );
|
417
|
+
}
|
418
|
+
});
|
419
|
+
|
420
|
+
}( jQuery ) );
|
421
|
+
|
422
|
+
});
|
@@ -0,0 +1,323 @@
|
|
1
|
+
define(['jquery'], function (jQuery) {
|
2
|
+
/*!
|
3
|
+
* jQuery UI Core 1.10.2
|
4
|
+
* http://jqueryui.com
|
5
|
+
*
|
6
|
+
* Copyright 2013 jQuery Foundation and other contributors
|
7
|
+
* Released under the MIT license.
|
8
|
+
* http://jquery.org/license
|
9
|
+
*
|
10
|
+
* http://api.jqueryui.com/category/ui-core/
|
11
|
+
*/
|
12
|
+
(function( $, undefined ) {
|
13
|
+
|
14
|
+
var uuid = 0,
|
15
|
+
runiqueId = /^ui-id-\d+$/;
|
16
|
+
|
17
|
+
// $.ui might exist from components with no dependencies, e.g., $.ui.position
|
18
|
+
$.ui = $.ui || {};
|
19
|
+
|
20
|
+
$.extend( $.ui, {
|
21
|
+
version: "1.10.2",
|
22
|
+
|
23
|
+
keyCode: {
|
24
|
+
BACKSPACE: 8,
|
25
|
+
COMMA: 188,
|
26
|
+
DELETE: 46,
|
27
|
+
DOWN: 40,
|
28
|
+
END: 35,
|
29
|
+
ENTER: 13,
|
30
|
+
ESCAPE: 27,
|
31
|
+
HOME: 36,
|
32
|
+
LEFT: 37,
|
33
|
+
NUMPAD_ADD: 107,
|
34
|
+
NUMPAD_DECIMAL: 110,
|
35
|
+
NUMPAD_DIVIDE: 111,
|
36
|
+
NUMPAD_ENTER: 108,
|
37
|
+
NUMPAD_MULTIPLY: 106,
|
38
|
+
NUMPAD_SUBTRACT: 109,
|
39
|
+
PAGE_DOWN: 34,
|
40
|
+
PAGE_UP: 33,
|
41
|
+
PERIOD: 190,
|
42
|
+
RIGHT: 39,
|
43
|
+
SPACE: 32,
|
44
|
+
TAB: 9,
|
45
|
+
UP: 38
|
46
|
+
}
|
47
|
+
});
|
48
|
+
|
49
|
+
// plugins
|
50
|
+
$.fn.extend({
|
51
|
+
focus: (function( orig ) {
|
52
|
+
return function( delay, fn ) {
|
53
|
+
return typeof delay === "number" ?
|
54
|
+
this.each(function() {
|
55
|
+
var elem = this;
|
56
|
+
setTimeout(function() {
|
57
|
+
$( elem ).focus();
|
58
|
+
if ( fn ) {
|
59
|
+
fn.call( elem );
|
60
|
+
}
|
61
|
+
}, delay );
|
62
|
+
}) :
|
63
|
+
orig.apply( this, arguments );
|
64
|
+
};
|
65
|
+
})( $.fn.focus ),
|
66
|
+
|
67
|
+
scrollParent: function() {
|
68
|
+
var scrollParent;
|
69
|
+
if (($.ui.ie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) {
|
70
|
+
scrollParent = this.parents().filter(function() {
|
71
|
+
return (/(relative|absolute|fixed)/).test($.css(this,"position")) && (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
|
72
|
+
}).eq(0);
|
73
|
+
} else {
|
74
|
+
scrollParent = this.parents().filter(function() {
|
75
|
+
return (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
|
76
|
+
}).eq(0);
|
77
|
+
}
|
78
|
+
|
79
|
+
return (/fixed/).test(this.css("position")) || !scrollParent.length ? $(document) : scrollParent;
|
80
|
+
},
|
81
|
+
|
82
|
+
zIndex: function( zIndex ) {
|
83
|
+
if ( zIndex !== undefined ) {
|
84
|
+
return this.css( "zIndex", zIndex );
|
85
|
+
}
|
86
|
+
|
87
|
+
if ( this.length ) {
|
88
|
+
var elem = $( this[ 0 ] ), position, value;
|
89
|
+
while ( elem.length && elem[ 0 ] !== document ) {
|
90
|
+
// Ignore z-index if position is set to a value where z-index is ignored by the browser
|
91
|
+
// This makes behavior of this function consistent across browsers
|
92
|
+
// WebKit always returns auto if the element is positioned
|
93
|
+
position = elem.css( "position" );
|
94
|
+
if ( position === "absolute" || position === "relative" || position === "fixed" ) {
|
95
|
+
// IE returns 0 when zIndex is not specified
|
96
|
+
// other browsers return a string
|
97
|
+
// we ignore the case of nested elements with an explicit value of 0
|
98
|
+
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
|
99
|
+
value = parseInt( elem.css( "zIndex" ), 10 );
|
100
|
+
if ( !isNaN( value ) && value !== 0 ) {
|
101
|
+
return value;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
elem = elem.parent();
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
return 0;
|
109
|
+
},
|
110
|
+
|
111
|
+
uniqueId: function() {
|
112
|
+
return this.each(function() {
|
113
|
+
if ( !this.id ) {
|
114
|
+
this.id = "ui-id-" + (++uuid);
|
115
|
+
}
|
116
|
+
});
|
117
|
+
},
|
118
|
+
|
119
|
+
removeUniqueId: function() {
|
120
|
+
return this.each(function() {
|
121
|
+
if ( runiqueId.test( this.id ) ) {
|
122
|
+
$( this ).removeAttr( "id" );
|
123
|
+
}
|
124
|
+
});
|
125
|
+
}
|
126
|
+
});
|
127
|
+
|
128
|
+
// selectors
|
129
|
+
function focusable( element, isTabIndexNotNaN ) {
|
130
|
+
var map, mapName, img,
|
131
|
+
nodeName = element.nodeName.toLowerCase();
|
132
|
+
if ( "area" === nodeName ) {
|
133
|
+
map = element.parentNode;
|
134
|
+
mapName = map.name;
|
135
|
+
if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
|
136
|
+
return false;
|
137
|
+
}
|
138
|
+
img = $( "img[usemap=#" + mapName + "]" )[0];
|
139
|
+
return !!img && visible( img );
|
140
|
+
}
|
141
|
+
return ( /input|select|textarea|button|object/.test( nodeName ) ?
|
142
|
+
!element.disabled :
|
143
|
+
"a" === nodeName ?
|
144
|
+
element.href || isTabIndexNotNaN :
|
145
|
+
isTabIndexNotNaN) &&
|
146
|
+
// the element and all of its ancestors must be visible
|
147
|
+
visible( element );
|
148
|
+
}
|
149
|
+
|
150
|
+
function visible( element ) {
|
151
|
+
return $.expr.filters.visible( element ) &&
|
152
|
+
!$( element ).parents().addBack().filter(function() {
|
153
|
+
return $.css( this, "visibility" ) === "hidden";
|
154
|
+
}).length;
|
155
|
+
}
|
156
|
+
|
157
|
+
$.extend( $.expr[ ":" ], {
|
158
|
+
data: $.expr.createPseudo ?
|
159
|
+
$.expr.createPseudo(function( dataName ) {
|
160
|
+
return function( elem ) {
|
161
|
+
return !!$.data( elem, dataName );
|
162
|
+
};
|
163
|
+
}) :
|
164
|
+
// support: jQuery <1.8
|
165
|
+
function( elem, i, match ) {
|
166
|
+
return !!$.data( elem, match[ 3 ] );
|
167
|
+
},
|
168
|
+
|
169
|
+
focusable: function( element ) {
|
170
|
+
return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
|
171
|
+
},
|
172
|
+
|
173
|
+
tabbable: function( element ) {
|
174
|
+
var tabIndex = $.attr( element, "tabindex" ),
|
175
|
+
isTabIndexNaN = isNaN( tabIndex );
|
176
|
+
return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
|
177
|
+
}
|
178
|
+
});
|
179
|
+
|
180
|
+
// support: jQuery <1.8
|
181
|
+
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
|
182
|
+
$.each( [ "Width", "Height" ], function( i, name ) {
|
183
|
+
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
|
184
|
+
type = name.toLowerCase(),
|
185
|
+
orig = {
|
186
|
+
innerWidth: $.fn.innerWidth,
|
187
|
+
innerHeight: $.fn.innerHeight,
|
188
|
+
outerWidth: $.fn.outerWidth,
|
189
|
+
outerHeight: $.fn.outerHeight
|
190
|
+
};
|
191
|
+
|
192
|
+
function reduce( elem, size, border, margin ) {
|
193
|
+
$.each( side, function() {
|
194
|
+
size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
|
195
|
+
if ( border ) {
|
196
|
+
size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
|
197
|
+
}
|
198
|
+
if ( margin ) {
|
199
|
+
size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
|
200
|
+
}
|
201
|
+
});
|
202
|
+
return size;
|
203
|
+
}
|
204
|
+
|
205
|
+
$.fn[ "inner" + name ] = function( size ) {
|
206
|
+
if ( size === undefined ) {
|
207
|
+
return orig[ "inner" + name ].call( this );
|
208
|
+
}
|
209
|
+
|
210
|
+
return this.each(function() {
|
211
|
+
$( this ).css( type, reduce( this, size ) + "px" );
|
212
|
+
});
|
213
|
+
};
|
214
|
+
|
215
|
+
$.fn[ "outer" + name] = function( size, margin ) {
|
216
|
+
if ( typeof size !== "number" ) {
|
217
|
+
return orig[ "outer" + name ].call( this, size );
|
218
|
+
}
|
219
|
+
|
220
|
+
return this.each(function() {
|
221
|
+
$( this).css( type, reduce( this, size, true, margin ) + "px" );
|
222
|
+
});
|
223
|
+
};
|
224
|
+
});
|
225
|
+
}
|
226
|
+
|
227
|
+
// support: jQuery <1.8
|
228
|
+
if ( !$.fn.addBack ) {
|
229
|
+
$.fn.addBack = function( selector ) {
|
230
|
+
return this.add( selector == null ?
|
231
|
+
this.prevObject : this.prevObject.filter( selector )
|
232
|
+
);
|
233
|
+
};
|
234
|
+
}
|
235
|
+
|
236
|
+
// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
|
237
|
+
if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
|
238
|
+
$.fn.removeData = (function( removeData ) {
|
239
|
+
return function( key ) {
|
240
|
+
if ( arguments.length ) {
|
241
|
+
return removeData.call( this, $.camelCase( key ) );
|
242
|
+
} else {
|
243
|
+
return removeData.call( this );
|
244
|
+
}
|
245
|
+
};
|
246
|
+
})( $.fn.removeData );
|
247
|
+
}
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
// deprecated
|
254
|
+
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
|
255
|
+
|
256
|
+
$.support.selectstart = "onselectstart" in document.createElement( "div" );
|
257
|
+
$.fn.extend({
|
258
|
+
disableSelection: function() {
|
259
|
+
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
|
260
|
+
".ui-disableSelection", function( event ) {
|
261
|
+
event.preventDefault();
|
262
|
+
});
|
263
|
+
},
|
264
|
+
|
265
|
+
enableSelection: function() {
|
266
|
+
return this.unbind( ".ui-disableSelection" );
|
267
|
+
}
|
268
|
+
});
|
269
|
+
|
270
|
+
$.extend( $.ui, {
|
271
|
+
// $.ui.plugin is deprecated. Use the proxy pattern instead.
|
272
|
+
plugin: {
|
273
|
+
add: function( module, option, set ) {
|
274
|
+
var i,
|
275
|
+
proto = $.ui[ module ].prototype;
|
276
|
+
for ( i in set ) {
|
277
|
+
proto.plugins[ i ] = proto.plugins[ i ] || [];
|
278
|
+
proto.plugins[ i ].push( [ option, set[ i ] ] );
|
279
|
+
}
|
280
|
+
},
|
281
|
+
call: function( instance, name, args ) {
|
282
|
+
var i,
|
283
|
+
set = instance.plugins[ name ];
|
284
|
+
if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
|
285
|
+
return;
|
286
|
+
}
|
287
|
+
|
288
|
+
for ( i = 0; i < set.length; i++ ) {
|
289
|
+
if ( instance.options[ set[ i ][ 0 ] ] ) {
|
290
|
+
set[ i ][ 1 ].apply( instance.element, args );
|
291
|
+
}
|
292
|
+
}
|
293
|
+
}
|
294
|
+
},
|
295
|
+
|
296
|
+
// only used by resizable
|
297
|
+
hasScroll: function( el, a ) {
|
298
|
+
|
299
|
+
//If overflow is hidden, the element might have extra content, but the user wants to hide it
|
300
|
+
if ( $( el ).css( "overflow" ) === "hidden") {
|
301
|
+
return false;
|
302
|
+
}
|
303
|
+
|
304
|
+
var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
|
305
|
+
has = false;
|
306
|
+
|
307
|
+
if ( el[ scroll ] > 0 ) {
|
308
|
+
return true;
|
309
|
+
}
|
310
|
+
|
311
|
+
// TODO: determine which cases actually cause this to happen
|
312
|
+
// if the element doesn't have the scroll set, see if it's possible to
|
313
|
+
// set the scroll
|
314
|
+
el[ scroll ] = 1;
|
315
|
+
has = ( el[ scroll ] > 0 );
|
316
|
+
el[ scroll ] = 0;
|
317
|
+
return has;
|
318
|
+
}
|
319
|
+
});
|
320
|
+
|
321
|
+
})( jQuery );
|
322
|
+
|
323
|
+
});
|