active_administration 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +2 -1
- data/active_administration.gemspec +2 -1
- data/app/assets/javascripts/active_administration/README.md +0 -0
- data/app/assets/javascripts/active_administration/metro-accordion.js +70 -0
- data/app/assets/javascripts/active_administration/metro-button-set.js +88 -0
- data/app/assets/javascripts/active_administration/metro-calendar.js +437 -0
- data/app/assets/javascripts/active_administration/metro-carousel.js +304 -0
- data/app/assets/javascripts/active_administration/metro-core.js +39 -0
- data/app/assets/javascripts/active_administration/metro-countdown.js +200 -0
- data/app/assets/javascripts/active_administration/metro-date-format.js +137 -0
- data/app/assets/javascripts/active_administration/metro-datepicker.js +138 -0
- data/app/assets/javascripts/active_administration/metro-dialog.js +221 -0
- data/app/assets/javascripts/active_administration/metro-drag-tile.js +46 -0
- data/app/assets/javascripts/active_administration/metro-dropdown.js +112 -0
- data/app/assets/javascripts/active_administration/metro-fluentmenu.js +57 -0
- data/app/assets/javascripts/active_administration/metro-global.js +4 -0
- data/app/assets/javascripts/active_administration/metro-hint.js +104 -0
- data/app/assets/javascripts/active_administration/metro-initiator.js +271 -0
- data/app/assets/javascripts/active_administration/metro-input-control.js +318 -0
- data/app/assets/javascripts/active_administration/metro-listview.js +53 -0
- data/app/assets/javascripts/active_administration/metro-live-tile.js +162 -0
- data/app/assets/javascripts/active_administration/metro-loader.js +46 -0
- data/app/assets/javascripts/active_administration/metro-locale.js +132 -0
- data/app/assets/javascripts/active_administration/metro-notify.js +120 -0
- data/app/assets/javascripts/active_administration/metro-panel.js +41 -0
- data/app/assets/javascripts/active_administration/metro-plugin-template.js +21 -0
- data/app/assets/javascripts/active_administration/metro-progressbar.js +97 -0
- data/app/assets/javascripts/active_administration/metro-pull.js +38 -0
- data/app/assets/javascripts/active_administration/metro-rating.js +99 -0
- data/app/assets/javascripts/active_administration/metro-scroll.js +756 -0
- data/app/assets/javascripts/active_administration/metro-slider.js +304 -0
- data/app/assets/javascripts/active_administration/metro-stepper.js +105 -0
- data/app/assets/javascripts/active_administration/metro-streamer.js +214 -0
- data/app/assets/javascripts/active_administration/metro-tab-control.js +96 -0
- data/app/assets/javascripts/active_administration/metro-table.js +74 -0
- data/app/assets/javascripts/active_administration/metro-tile-transform.js +65 -0
- data/app/assets/javascripts/active_administration/metro-times.js +190 -0
- data/app/assets/javascripts/active_administration/metro-touch-handler.js +65 -0
- data/app/assets/javascripts/active_administration/metro-treeview.js +64 -0
- data/app/assets/javascripts/active_administration/metro-wizard.js +148 -0
- data/app/assets/stylesheets/active_administration/accordion.less +64 -0
- data/app/assets/stylesheets/active_administration/balloon.less +88 -0
- data/app/assets/stylesheets/active_administration/breadcrumbs.less +118 -0
- data/app/assets/stylesheets/active_administration/buttons.less +383 -0
- data/app/assets/stylesheets/active_administration/calendar.less +123 -0
- data/app/assets/stylesheets/active_administration/carousel.less +118 -0
- data/app/assets/stylesheets/active_administration/colors.less +589 -0
- data/app/assets/stylesheets/active_administration/countdown.less +57 -0
- data/app/assets/stylesheets/active_administration/dataTables.less +134 -0
- data/app/assets/stylesheets/active_administration/fluent-menu.less +231 -0
- data/app/assets/stylesheets/active_administration/forms.less +414 -0
- data/app/assets/stylesheets/active_administration/funcs.less +178 -0
- data/app/assets/stylesheets/active_administration/grid.less +91 -0
- data/app/assets/stylesheets/active_administration/hint.less +120 -0
- data/app/assets/stylesheets/active_administration/iconFont-content.less +1353 -0
- data/app/assets/stylesheets/active_administration/iconFont.less +47 -0
- data/app/assets/stylesheets/active_administration/icons.less +10 -0
- data/app/assets/stylesheets/active_administration/images.less +75 -0
- data/app/assets/stylesheets/active_administration/layout.less +137 -0
- data/app/assets/stylesheets/active_administration/lists.less +258 -0
- data/app/assets/stylesheets/active_administration/menus.less +469 -0
- data/app/assets/stylesheets/active_administration/metro-bootstrap-responsive.less +300 -0
- data/app/assets/stylesheets/active_administration/metro-bootstrap.less +68 -0
- data/app/assets/stylesheets/active_administration/misc.less +72 -0
- data/app/assets/stylesheets/active_administration/navigation-bar.less +317 -0
- data/app/assets/stylesheets/active_administration/notice.less +52 -0
- data/app/assets/stylesheets/active_administration/notify.less +43 -0
- data/app/assets/stylesheets/active_administration/pagination.less +83 -0
- data/app/assets/stylesheets/active_administration/panels.less +38 -0
- data/app/assets/stylesheets/active_administration/progress-bar.less +25 -0
- data/app/assets/stylesheets/active_administration/rating.less +103 -0
- data/app/assets/stylesheets/active_administration/reset.less +219 -0
- data/app/assets/stylesheets/active_administration/scroll.less +141 -0
- data/app/assets/stylesheets/active_administration/sidebar.less +158 -0
- data/app/assets/stylesheets/active_administration/slider.less +106 -0
- data/app/assets/stylesheets/active_administration/stepper.less +80 -0
- data/app/assets/stylesheets/active_administration/streamer.less +250 -0
- data/app/assets/stylesheets/active_administration/tab-control.less +79 -0
- data/app/assets/stylesheets/active_administration/tables.less +170 -0
- data/app/assets/stylesheets/active_administration/tiles.less +599 -0
- data/app/assets/stylesheets/active_administration/transform.less +23 -0
- data/app/assets/stylesheets/active_administration/treeview.less +96 -0
- data/app/assets/stylesheets/active_administration/typography.less +382 -0
- data/app/assets/stylesheets/active_administration/utils.less +180 -0
- data/app/assets/stylesheets/active_administration/variables.less +250 -0
- data/app/assets/stylesheets/active_administration/window.less +225 -0
- data/app/assets/stylesheets/active_administration/wizard.less +53 -0
- data/lib/active_admin/version.rb +1 -1
- metadata +103 -10
@@ -0,0 +1,318 @@
|
|
1
|
+
(function( $ ) {
|
2
|
+
$.widget("metro.inputControl", {
|
3
|
+
|
4
|
+
version: "1.0.0",
|
5
|
+
|
6
|
+
options: {
|
7
|
+
},
|
8
|
+
|
9
|
+
_create: function(){
|
10
|
+
var that = this,
|
11
|
+
control = this.element;
|
12
|
+
|
13
|
+
if (control.hasClass('text')) {
|
14
|
+
this.initTextInput(control, that);
|
15
|
+
} else if (control.hasClass('password')) {
|
16
|
+
this.initPasswordInput(control, that);
|
17
|
+
} else if (control.hasClass('checkbox') || control.hasClass('radio') || control.hasClass('switch')) {
|
18
|
+
this.initCheckboxInput(control, that);
|
19
|
+
} else if (control.hasClass('file')) {
|
20
|
+
this.initFileInput(control, that);
|
21
|
+
}
|
22
|
+
},
|
23
|
+
|
24
|
+
initCheckboxInput: function(el, that) {
|
25
|
+
},
|
26
|
+
|
27
|
+
initFileInput: function(el, that){
|
28
|
+
var button, input, wrapper;
|
29
|
+
wrapper = $("<input type='text' id='__input_file_wrapper__' readonly style='z-index: 1; cursor: default;'>");
|
30
|
+
button = el.children('.btn-file');
|
31
|
+
input = el.children('input[type="file"]');
|
32
|
+
input.css('z-index', 0);
|
33
|
+
wrapper.insertAfter(input);
|
34
|
+
input.attr('tabindex', '-1');
|
35
|
+
//button.attr('tabindex', '-1');
|
36
|
+
button.attr('type', 'button');
|
37
|
+
|
38
|
+
input.on('change', function(){
|
39
|
+
var val = $(this).val();
|
40
|
+
if (val != '') {
|
41
|
+
wrapper.val(val);
|
42
|
+
}
|
43
|
+
});
|
44
|
+
|
45
|
+
button.on('click', function(){
|
46
|
+
input.trigger('click');
|
47
|
+
});
|
48
|
+
},
|
49
|
+
|
50
|
+
initTextInput: function(el, that){
|
51
|
+
var button = el.children('.btn-clear'),
|
52
|
+
input = el.children('input[type=text]');
|
53
|
+
|
54
|
+
//console.log(button.length);
|
55
|
+
//button = el.children('.btn-clear');
|
56
|
+
|
57
|
+
if (button.length == 0) return;
|
58
|
+
|
59
|
+
button.attr('tabindex', '-1');
|
60
|
+
button.attr('type', 'button');
|
61
|
+
|
62
|
+
button.on('click', function(){
|
63
|
+
input = el.children('input');
|
64
|
+
if (input.prop('readonly')) return;
|
65
|
+
input.val('');
|
66
|
+
input.focus();
|
67
|
+
that._trigger("onClear", null, el);
|
68
|
+
});
|
69
|
+
|
70
|
+
if (!input.attr("disabled")) input.on('click', function(){$(this).focus();});
|
71
|
+
},
|
72
|
+
|
73
|
+
initPasswordInput: function(el, that){
|
74
|
+
var button = el.children('.btn-reveal'),
|
75
|
+
input = el.children('input[type=password]');
|
76
|
+
var wrapper;
|
77
|
+
|
78
|
+
if (button.length == 0) return;
|
79
|
+
|
80
|
+
button.attr('tabindex', '-1');
|
81
|
+
button.attr('type', 'button');
|
82
|
+
|
83
|
+
button.on('mousedown', function(e){
|
84
|
+
input.attr('type', 'text');
|
85
|
+
//e.preventDefault();
|
86
|
+
|
87
|
+
// wrapper = el.find(".__wrapper__").length == 0 ? $('<input type="text" class="__wrapper__" />') : el.find(".__wrapper__");
|
88
|
+
//
|
89
|
+
// input.hide();
|
90
|
+
// wrapper.appendTo(that.element);
|
91
|
+
// wrapper.val(input.val());
|
92
|
+
//
|
93
|
+
// that._trigger("onPasswordShow", null, that.element);
|
94
|
+
});
|
95
|
+
|
96
|
+
button.on('mouseup, mouseleave, blur', function(e){
|
97
|
+
input.attr('type', 'password').focus();
|
98
|
+
//e.preventDefault();
|
99
|
+
|
100
|
+
|
101
|
+
// input.show().focus();
|
102
|
+
// wrapper.remove();
|
103
|
+
//
|
104
|
+
// that._trigger("onPasswordHide", null, that.element);
|
105
|
+
});
|
106
|
+
|
107
|
+
if (!input.attr("disabled")) input.on('click', function(){$(this).focus();});
|
108
|
+
},
|
109
|
+
|
110
|
+
_destroy: function(){
|
111
|
+
|
112
|
+
},
|
113
|
+
|
114
|
+
_setOption: function(key, value){
|
115
|
+
this._super('_setOption', key, value);
|
116
|
+
}
|
117
|
+
});
|
118
|
+
})( jQuery );
|
119
|
+
|
120
|
+
|
121
|
+
(function( $ ) {
|
122
|
+
$.widget("metro.inputTransform", {
|
123
|
+
|
124
|
+
version: "1.0.0",
|
125
|
+
|
126
|
+
options: {
|
127
|
+
transformType: "text"
|
128
|
+
},
|
129
|
+
|
130
|
+
_create: function(){
|
131
|
+
var that = this,
|
132
|
+
element = this.element,
|
133
|
+
inputType;
|
134
|
+
|
135
|
+
|
136
|
+
var checkTransform = element.parent().hasClass("input-control");
|
137
|
+
if (checkTransform) return;
|
138
|
+
|
139
|
+
inputType = element.get(0).tagName.toLowerCase();
|
140
|
+
|
141
|
+
if (inputType == "textarea") {
|
142
|
+
this.options.transformType = "textarea";
|
143
|
+
} else if (inputType == "select") {
|
144
|
+
this.options.transformType = "select";
|
145
|
+
} else {
|
146
|
+
if (element.data('transformType') != undefined) {
|
147
|
+
this.options.transformType = element.data('transformType');
|
148
|
+
} else {
|
149
|
+
this.options.transformType = element.attr("type");
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
var control = undefined;
|
154
|
+
|
155
|
+
switch (this.options.transformType) {
|
156
|
+
case "password": control = this._createInputPassword(); break;
|
157
|
+
case "file": control = this._createInputFile(); break;
|
158
|
+
case "checkbox": control = this._createInputCheckbox(); break;
|
159
|
+
case "radio": control = this._createInputRadio(); break;
|
160
|
+
case "switch": control = this._createInputSwitch(); break;
|
161
|
+
case "select": control = this._createInputSelect(); break;
|
162
|
+
case "textarea": control = this._createInputTextarea(); break;
|
163
|
+
case "search": control = this._createInputSearch(); break;
|
164
|
+
case "email": control = this._createInputEmail(); break;
|
165
|
+
case "tel": control = this._createInputTel(); break;
|
166
|
+
case "number": control = this._createInputNum(); break;
|
167
|
+
default: control = this._createInputText();
|
168
|
+
}
|
169
|
+
|
170
|
+
control.inputControl();
|
171
|
+
},
|
172
|
+
|
173
|
+
_createInputTextarea: function(){
|
174
|
+
var element = this.element;
|
175
|
+
|
176
|
+
var wrapper = $("<div/>").addClass("input-control").addClass("textarea");
|
177
|
+
var clone = element.clone(true);
|
178
|
+
var parent = element.parent();
|
179
|
+
|
180
|
+
clone.appendTo(wrapper);
|
181
|
+
wrapper.insertBefore(element);
|
182
|
+
|
183
|
+
element.remove();
|
184
|
+
|
185
|
+
return wrapper;
|
186
|
+
},
|
187
|
+
|
188
|
+
_createInputSelect: function(){
|
189
|
+
var element = this.element;
|
190
|
+
|
191
|
+
var wrapper = $("<div/>").addClass("input-control").addClass("select");
|
192
|
+
var clone = element.clone(true);
|
193
|
+
var parent = element.parent();
|
194
|
+
|
195
|
+
clone.val(element.val()).appendTo(wrapper);
|
196
|
+
wrapper.insertBefore(element);
|
197
|
+
|
198
|
+
element.remove();
|
199
|
+
|
200
|
+
return wrapper;
|
201
|
+
},
|
202
|
+
|
203
|
+
_createInputSwitch: function(){
|
204
|
+
var element = this.element;
|
205
|
+
|
206
|
+
var wrapper = $("<div/>").addClass("input-control").addClass("switch");
|
207
|
+
var label = $("<label/>");
|
208
|
+
var button = $("<span/>").addClass("check");
|
209
|
+
var clone = element.clone(true);
|
210
|
+
var parent = element.parent();
|
211
|
+
var caption = $("<span/>").addClass("caption").html( element.data('caption') != undefined ? element.data('caption') : "" );
|
212
|
+
|
213
|
+
label.appendTo(wrapper);
|
214
|
+
clone.appendTo(label);
|
215
|
+
button.appendTo(label);
|
216
|
+
caption.appendTo(label);
|
217
|
+
|
218
|
+
wrapper.insertBefore(element);
|
219
|
+
element.remove();
|
220
|
+
|
221
|
+
return wrapper;
|
222
|
+
},
|
223
|
+
|
224
|
+
_createInputCheckbox: function(){
|
225
|
+
var element = this.element;
|
226
|
+
|
227
|
+
var wrapper = $("<div/>").addClass("input-control").addClass("checkbox");
|
228
|
+
var label = $("<label/>");
|
229
|
+
var button = $("<span/>").addClass("check");
|
230
|
+
var clone = element.clone(true);
|
231
|
+
var parent = element.parent();
|
232
|
+
var caption = $("<span/>").addClass("caption").html( element.data('caption') != undefined ? element.data('caption') : "" );
|
233
|
+
|
234
|
+
label.appendTo(wrapper);
|
235
|
+
clone.appendTo(label);
|
236
|
+
button.appendTo(label);
|
237
|
+
caption.appendTo(label);
|
238
|
+
|
239
|
+
wrapper.insertBefore(element);
|
240
|
+
element.remove();
|
241
|
+
|
242
|
+
return wrapper;
|
243
|
+
},
|
244
|
+
|
245
|
+
_createInputRadio: function(){
|
246
|
+
var element = this.element;
|
247
|
+
|
248
|
+
var wrapper = $("<div/>").addClass("input-control").addClass("radio");
|
249
|
+
var label = $("<label/>");
|
250
|
+
var button = $("<span/>").addClass("check");
|
251
|
+
var clone = element.clone(true);
|
252
|
+
var parent = element.parent();
|
253
|
+
var caption = $("<span/>").addClass("caption").html( element.data('caption') != undefined ? element.data('caption') : "" );
|
254
|
+
|
255
|
+
label.appendTo(wrapper);
|
256
|
+
clone.appendTo(label);
|
257
|
+
button.appendTo(label);
|
258
|
+
caption.appendTo(label);
|
259
|
+
|
260
|
+
wrapper.insertBefore(element);
|
261
|
+
element.remove();
|
262
|
+
|
263
|
+
return wrapper;
|
264
|
+
},
|
265
|
+
|
266
|
+
_createInputSearch: function(){
|
267
|
+
return this._createInputVal("text", "btn-search");
|
268
|
+
},
|
269
|
+
|
270
|
+
_createInputNum: function(){
|
271
|
+
return this._createInputVal("number", "btn-clear");
|
272
|
+
},
|
273
|
+
|
274
|
+
_createInputTel: function(){
|
275
|
+
return this._createInputVal("tel", "btn-clear");
|
276
|
+
},
|
277
|
+
|
278
|
+
_createInputEmail: function(){
|
279
|
+
return this._createInputVal("email", "btn-clear");
|
280
|
+
},
|
281
|
+
|
282
|
+
_createInputText: function(){
|
283
|
+
return this._createInputVal("text", "btn-clear");
|
284
|
+
},
|
285
|
+
|
286
|
+
_createInputPassword: function(){
|
287
|
+
return this._createInputVal("password", "btn-reveal");
|
288
|
+
},
|
289
|
+
|
290
|
+
_createInputFile: function(){
|
291
|
+
return this._createInputVal("file", "btn-file");
|
292
|
+
},
|
293
|
+
|
294
|
+
_createInputVal: function(name, buttonName) {
|
295
|
+
var element = this.element;
|
296
|
+
|
297
|
+
var wrapper = $("<div/>").addClass("input-control").addClass(name);
|
298
|
+
var button = $("<button/>").addClass(buttonName);
|
299
|
+
var clone = element.clone(true);
|
300
|
+
var parent = element.parent();
|
301
|
+
|
302
|
+
clone.appendTo(wrapper);
|
303
|
+
button.appendTo(wrapper);
|
304
|
+
|
305
|
+
wrapper.insertBefore(element);
|
306
|
+
element.remove();
|
307
|
+
|
308
|
+
return wrapper;
|
309
|
+
},
|
310
|
+
|
311
|
+
_destroy: function(){},
|
312
|
+
|
313
|
+
_setOption: function(key, value){
|
314
|
+
this._super('_setOption', key, value);
|
315
|
+
}
|
316
|
+
})
|
317
|
+
})( jQuery );
|
318
|
+
|
@@ -0,0 +1,53 @@
|
|
1
|
+
(function( $ ) {
|
2
|
+
$.widget("metro.listview", {
|
3
|
+
|
4
|
+
version: "1.0.0",
|
5
|
+
|
6
|
+
options: {
|
7
|
+
onGroupExpand: function(g){},
|
8
|
+
onGroupCollapse: function(g){},
|
9
|
+
onListClick: function(l){}
|
10
|
+
},
|
11
|
+
|
12
|
+
_create: function(){
|
13
|
+
var that = this, element = this.element;
|
14
|
+
|
15
|
+
element.children('.collapsed').children('.group-content').hide();
|
16
|
+
|
17
|
+
element.find('.group-title').on('click', function(e){
|
18
|
+
var $this = $(this),
|
19
|
+
group = $this.parent('.list-group'),
|
20
|
+
group_content = group.children('.group-content');
|
21
|
+
|
22
|
+
group.toggleClass('collapsed');
|
23
|
+
|
24
|
+
if (group.hasClass('collapsed')) {
|
25
|
+
group_content.slideUp();
|
26
|
+
that.options.onGroupCollapse(group);
|
27
|
+
} else {
|
28
|
+
group_content.slideDown();
|
29
|
+
that.options.onGroupExpand(group);
|
30
|
+
}
|
31
|
+
|
32
|
+
e.preventDefault();
|
33
|
+
});
|
34
|
+
|
35
|
+
element.find('.list').on('click', function(e){
|
36
|
+
element.find('.list').removeClass('active');
|
37
|
+
$(this).toggleClass('active');
|
38
|
+
that.options.onListClick($(this));
|
39
|
+
e.preventDefault();
|
40
|
+
});
|
41
|
+
},
|
42
|
+
|
43
|
+
_destroy: function(){
|
44
|
+
|
45
|
+
},
|
46
|
+
|
47
|
+
_setOption: function(key, value){
|
48
|
+
this._super('_setOption', key, value);
|
49
|
+
}
|
50
|
+
})
|
51
|
+
})( jQuery );
|
52
|
+
|
53
|
+
|
@@ -0,0 +1,162 @@
|
|
1
|
+
(function( $ ) {
|
2
|
+
$.widget("metro.livetile", {
|
3
|
+
|
4
|
+
version: "1.0.0",
|
5
|
+
|
6
|
+
options: {
|
7
|
+
effect: 'slideLeft',
|
8
|
+
period: 4000,
|
9
|
+
duration: 700,
|
10
|
+
easing: 'doubleSqrt'
|
11
|
+
},
|
12
|
+
|
13
|
+
_frames: {},
|
14
|
+
_currentIndex: 0,
|
15
|
+
_interval: 0,
|
16
|
+
_outPosition: 0,
|
17
|
+
_size: {},
|
18
|
+
|
19
|
+
_create: function(){
|
20
|
+
var that = this,
|
21
|
+
element = this.element;
|
22
|
+
|
23
|
+
if (element.data('effect') != undefined) {this.options.effect = element.data('effect');}
|
24
|
+
if (element.data('direction') != undefined) {this.options.direction = element.data('direction');}
|
25
|
+
if (element.data('period') != undefined) {this.options.period = element.data('period');}
|
26
|
+
if (element.data('duration') != undefined) {this.options.duration = element.data('duration');}
|
27
|
+
if (element.data('easing') != undefined) {this.options.easing = element.data('easing');}
|
28
|
+
|
29
|
+
//this._frames = element.children(".tile-content, .event-content");
|
30
|
+
this._frames = element.children("[class*='-content']");
|
31
|
+
//console.log(this._frames);
|
32
|
+
|
33
|
+
if (this._frames.length <= 1) return;
|
34
|
+
|
35
|
+
$.easing.doubleSqrt = function(t) {return Math.sqrt(Math.sqrt(t));};
|
36
|
+
|
37
|
+
this._size = {
|
38
|
+
'width': element.width(),
|
39
|
+
'height': element.height()
|
40
|
+
};
|
41
|
+
|
42
|
+
element.on('mouseenter', function(){
|
43
|
+
that.stop();
|
44
|
+
});
|
45
|
+
|
46
|
+
element.on('mouseleave', function(){
|
47
|
+
that.start();
|
48
|
+
});
|
49
|
+
|
50
|
+
this.start();
|
51
|
+
},
|
52
|
+
|
53
|
+
start: function(){
|
54
|
+
var that = this;
|
55
|
+
this._interval = setInterval(function(){
|
56
|
+
that._animate();
|
57
|
+
}, this.options.period);
|
58
|
+
},
|
59
|
+
|
60
|
+
stop: function(){
|
61
|
+
clearInterval(this._interval);
|
62
|
+
},
|
63
|
+
|
64
|
+
_animate: function(){
|
65
|
+
var currentFrame = this._frames[this._currentIndex], nextFrame;
|
66
|
+
this._currentIndex += 1;
|
67
|
+
if (this._currentIndex >= this._frames.length) this._currentIndex = 0;
|
68
|
+
nextFrame = this._frames[this._currentIndex];
|
69
|
+
|
70
|
+
switch (this.options.effect) {
|
71
|
+
case 'slideLeft': this._effectSlideLeft(currentFrame, nextFrame); break;
|
72
|
+
case 'slideRight': this._effectSlideRight(currentFrame, nextFrame); break;
|
73
|
+
case 'slideDown': this._effectSlideDown(currentFrame, nextFrame); break;
|
74
|
+
case 'slideUpDown': this._effectSlideUpDown(currentFrame, nextFrame); break;
|
75
|
+
case 'slideLeftRight': this._effectSlideLeftRight(currentFrame, nextFrame); break;
|
76
|
+
default: this._effectSlideUp(currentFrame, nextFrame);
|
77
|
+
}
|
78
|
+
},
|
79
|
+
|
80
|
+
_effectSlideLeftRight: function(currentFrame, nextFrame){
|
81
|
+
if (this._currentIndex % 2 == 0)
|
82
|
+
this._effectSlideLeft(currentFrame, nextFrame);
|
83
|
+
else
|
84
|
+
this._effectSlideRight(currentFrame, nextFrame);
|
85
|
+
},
|
86
|
+
|
87
|
+
_effectSlideUpDown: function(currentFrame, nextFrame){
|
88
|
+
if (this._currentIndex % 2 == 0)
|
89
|
+
this._effectSlideUp(currentFrame, nextFrame);
|
90
|
+
else
|
91
|
+
this._effectSlideDown(currentFrame, nextFrame);
|
92
|
+
},
|
93
|
+
|
94
|
+
_effectSlideUp: function(currentFrame, nextFrame){
|
95
|
+
var _out = this._size.height;
|
96
|
+
var options = {
|
97
|
+
'duration': this.options.duration,
|
98
|
+
'easing': this.options.easing
|
99
|
+
};
|
100
|
+
|
101
|
+
$(currentFrame)
|
102
|
+
.animate({top: -_out}, options);
|
103
|
+
$(nextFrame)
|
104
|
+
.css({top: _out})
|
105
|
+
.show()
|
106
|
+
.animate({top: 0}, options);
|
107
|
+
},
|
108
|
+
|
109
|
+
_effectSlideDown: function(currentFrame, nextFrame){
|
110
|
+
var _out = this._size.height;
|
111
|
+
var options = {
|
112
|
+
'duration': this.options.duration,
|
113
|
+
'easing': this.options.easing
|
114
|
+
};
|
115
|
+
|
116
|
+
$(currentFrame)
|
117
|
+
.animate({top: _out}, options);
|
118
|
+
$(nextFrame)
|
119
|
+
.css({top: -_out})
|
120
|
+
.show()
|
121
|
+
.animate({top: 0}, options);
|
122
|
+
},
|
123
|
+
|
124
|
+
_effectSlideLeft: function(currentFrame, nextFrame){
|
125
|
+
var _out = this._size.width;
|
126
|
+
var options = {
|
127
|
+
'duration': this.options.duration,
|
128
|
+
'easing': this.options.easing
|
129
|
+
};
|
130
|
+
|
131
|
+
$(currentFrame)
|
132
|
+
.animate({left: _out * -1}, options);
|
133
|
+
$(nextFrame)
|
134
|
+
.css({left: _out})
|
135
|
+
.show()
|
136
|
+
.animate({left: 0}, options);
|
137
|
+
},
|
138
|
+
|
139
|
+
_effectSlideRight: function(currentFrame, nextFrame){
|
140
|
+
var _out = this._size.width;
|
141
|
+
var options = {
|
142
|
+
'duration': this.options.duration,
|
143
|
+
'easing': this.options.easing
|
144
|
+
};
|
145
|
+
|
146
|
+
$(currentFrame)
|
147
|
+
.animate({left: _out}, options);
|
148
|
+
$(nextFrame)
|
149
|
+
.css({left: -_out})
|
150
|
+
.show()
|
151
|
+
.animate({left: 0}, options);
|
152
|
+
},
|
153
|
+
|
154
|
+
_destroy: function(){},
|
155
|
+
|
156
|
+
_setOption: function(key, value){
|
157
|
+
this._super('_setOption', key, value);
|
158
|
+
}
|
159
|
+
})
|
160
|
+
})( jQuery );
|
161
|
+
|
162
|
+
|