mice 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +44 -36
- data/lib/mice/version.rb +1 -1
- metadata +2 -67
- data/vendor/assets/fonts/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.svg +0 -414
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/images/ZeroClipboard.swf +0 -0
- data/vendor/assets/javascripts/mice/ZeroClipboard.js +0 -1031
- data/vendor/assets/javascripts/mice/ZeroClipboard.min.js +0 -9
- data/vendor/assets/javascripts/mice/alert.js +0 -92
- data/vendor/assets/javascripts/mice/carousel.js +0 -66
- data/vendor/assets/javascripts/mice/jquery.autocomplete.min.js +0 -29
- data/vendor/assets/javascripts/mice/jquery.autofix_anything.js +0 -83
- data/vendor/assets/javascripts/mice/jquery.email-autocomplete.js +0 -178
- data/vendor/assets/javascripts/mice/jquery.js +0 -9597
- data/vendor/assets/javascripts/mice/jquery.min.js +0 -5
- data/vendor/assets/javascripts/mice/jquery.min.map +0 -1
- data/vendor/assets/javascripts/mice/jquery.onepage-scroll.js +0 -411
- data/vendor/assets/javascripts/mice/message.coffee +0 -104
- data/vendor/assets/javascripts/mice/modal.coffee +0 -237
- data/vendor/assets/javascripts/mice/slider.coffee +0 -20
- data/vendor/assets/javascripts/mice/slider.js +0 -223
- data/vendor/assets/javascripts/mice/tooltip.coffee +0 -338
- data/vendor/assets/javascripts/mice/transition.coffee +0 -36
- data/vendor/assets/javascripts/mice.js +0 -6
- data/vendor/assets/stylesheets/mice/_alerts.scss +0 -70
- data/vendor/assets/stylesheets/mice/_autofix_anything.scss +0 -14
- data/vendor/assets/stylesheets/mice/_breadcrumbs.scss +0 -26
- data/vendor/assets/stylesheets/mice/_buttons.scss +0 -407
- data/vendor/assets/stylesheets/mice/_callouts.scss +0 -71
- data/vendor/assets/stylesheets/mice/_close.scss +0 -35
- data/vendor/assets/stylesheets/mice/_code.scss +0 -63
- data/vendor/assets/stylesheets/mice/_component-animations.scss +0 -11
- data/vendor/assets/stylesheets/mice/_forms.scss +0 -402
- data/vendor/assets/stylesheets/mice/_grid.scss +0 -95
- data/vendor/assets/stylesheets/mice/_icons.scss +0 -564
- data/vendor/assets/stylesheets/mice/_images.scss +0 -250
- data/vendor/assets/stylesheets/mice/_labels.scss +0 -82
- data/vendor/assets/stylesheets/mice/_lists.scss +0 -186
- data/vendor/assets/stylesheets/mice/_media.scss +0 -53
- data/vendor/assets/stylesheets/mice/_menu.scss +0 -42
- data/vendor/assets/stylesheets/mice/_message.scss +0 -78
- data/vendor/assets/stylesheets/mice/_mixins.scss +0 -176
- data/vendor/assets/stylesheets/mice/_modals.scss +0 -160
- data/vendor/assets/stylesheets/mice/_navbar.scss +0 -86
- data/vendor/assets/stylesheets/mice/_normalize.scss +0 -425
- data/vendor/assets/stylesheets/mice/_pagination.scss +0 -171
- data/vendor/assets/stylesheets/mice/_panels.scss +0 -236
- data/vendor/assets/stylesheets/mice/_progress.scss +0 -65
- data/vendor/assets/stylesheets/mice/_scaffolding.scss +0 -101
- data/vendor/assets/stylesheets/mice/_sidebar.scss +0 -37
- data/vendor/assets/stylesheets/mice/_slider.scss +0 -310
- data/vendor/assets/stylesheets/mice/_tables.scss +0 -144
- data/vendor/assets/stylesheets/mice/_tabs.scss +0 -70
- data/vendor/assets/stylesheets/mice/_timeline.scss +0 -157
- data/vendor/assets/stylesheets/mice/_tipsy.scss +0 -36
- data/vendor/assets/stylesheets/mice/_tooltips.scss +0 -124
- data/vendor/assets/stylesheets/mice/_typography.scss +0 -113
- data/vendor/assets/stylesheets/mice/_utilities.scss +0 -48
- data/vendor/assets/stylesheets/mice/_variables.scss +0 -577
- data/vendor/assets/stylesheets/mice-mobile.scss +0 -23
- data/vendor/assets/stylesheets/mice.scss +0 -46
- data/vendor/assets/stylesheets/mobile/bars.scss +0 -76
- data/vendor/assets/stylesheets/mobile/base.scss +0 -52
- data/vendor/assets/stylesheets/mobile/cards.scss +0 -29
- data/vendor/assets/stylesheets/mobile/variables.scss +0 -37
@@ -1,411 +0,0 @@
|
|
1
|
-
/* ===========================================================
|
2
|
-
* jquery-onepage-scroll.js v1.3
|
3
|
-
* ===========================================================
|
4
|
-
* Copyright 2013 Pete Rojwongsuriya.
|
5
|
-
* http://www.thepetedesign.com
|
6
|
-
*
|
7
|
-
* Create an Apple-like website that let user scroll
|
8
|
-
* one page at a time
|
9
|
-
*
|
10
|
-
* Credit: Eike Send for the awesome swipe event
|
11
|
-
* https://github.com/peachananr/onepage-scroll
|
12
|
-
*
|
13
|
-
* License: GPL v3
|
14
|
-
*
|
15
|
-
* ========================================================== */
|
16
|
-
|
17
|
-
!function($){
|
18
|
-
|
19
|
-
var defaults = {
|
20
|
-
sectionContainer: "section",
|
21
|
-
easing: "ease",
|
22
|
-
animationTime: 1000,
|
23
|
-
pagination: true,
|
24
|
-
updateURL: false,
|
25
|
-
keyboard: true,
|
26
|
-
beforeMove: null,
|
27
|
-
afterMove: null,
|
28
|
-
loop: true,
|
29
|
-
responsiveFallback: false,
|
30
|
-
direction : 'vertical'
|
31
|
-
};
|
32
|
-
|
33
|
-
/*------------------------------------------------*/
|
34
|
-
/* Credit: Eike Send for the awesome swipe event */
|
35
|
-
/*------------------------------------------------*/
|
36
|
-
|
37
|
-
$.fn.swipeEvents = function() {
|
38
|
-
return this.each(function() {
|
39
|
-
|
40
|
-
var startX,
|
41
|
-
startY,
|
42
|
-
$this = $(this);
|
43
|
-
|
44
|
-
$this.bind('touchstart', touchstart);
|
45
|
-
|
46
|
-
function touchstart(event) {
|
47
|
-
var touches = event.originalEvent.touches;
|
48
|
-
if (touches && touches.length) {
|
49
|
-
startX = touches[0].pageX;
|
50
|
-
startY = touches[0].pageY;
|
51
|
-
$this.bind('touchmove', touchmove);
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
function touchmove(event) {
|
56
|
-
var touches = event.originalEvent.touches;
|
57
|
-
if (touches && touches.length) {
|
58
|
-
var deltaX = startX - touches[0].pageX;
|
59
|
-
var deltaY = startY - touches[0].pageY;
|
60
|
-
|
61
|
-
if (deltaX >= 50) {
|
62
|
-
$this.trigger("swipeLeft");
|
63
|
-
}
|
64
|
-
if (deltaX <= -50) {
|
65
|
-
$this.trigger("swipeRight");
|
66
|
-
}
|
67
|
-
if (deltaY >= 50) {
|
68
|
-
$this.trigger("swipeUp");
|
69
|
-
}
|
70
|
-
if (deltaY <= -50) {
|
71
|
-
$this.trigger("swipeDown");
|
72
|
-
}
|
73
|
-
if (Math.abs(deltaX) >= 50 || Math.abs(deltaY) >= 50) {
|
74
|
-
$this.unbind('touchmove', touchmove);
|
75
|
-
}
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
});
|
80
|
-
};
|
81
|
-
|
82
|
-
|
83
|
-
$.fn.onepage_scroll = function(options){
|
84
|
-
var settings = $.extend({}, defaults, options),
|
85
|
-
el = $(this),
|
86
|
-
sections = $(settings.sectionContainer)
|
87
|
-
total = sections.length,
|
88
|
-
status = "off",
|
89
|
-
topPos = 0,
|
90
|
-
leftPos = 0,
|
91
|
-
lastAnimation = 0,
|
92
|
-
quietPeriod = 500,
|
93
|
-
paginationList = "";
|
94
|
-
|
95
|
-
$.fn.transformPage = function(settings, pos, index) {
|
96
|
-
if (typeof settings.beforeMove == 'function') settings.beforeMove(index);
|
97
|
-
$(this).css({
|
98
|
-
"-webkit-transform": ( settings.direction == 'horizontal' ) ? "translate3d(" + pos + "%, 0, 0)" : "translate3d(0, " + pos + "%, 0)",
|
99
|
-
"-webkit-transition": "all " + settings.animationTime + "ms " + settings.easing,
|
100
|
-
"-moz-transform": ( settings.direction == 'horizontal' ) ? "translate3d(" + pos + "%, 0, 0)" : "translate3d(0, " + pos + "%, 0)",
|
101
|
-
"-moz-transition": "all " + settings.animationTime + "ms " + settings.easing,
|
102
|
-
"-ms-transform": ( settings.direction == 'horizontal' ) ? "translate3d(" + pos + "%, 0, 0)" : "translate3d(0, " + pos + "%, 0)",
|
103
|
-
"-ms-transition": "all " + settings.animationTime + "ms " + settings.easing,
|
104
|
-
"transform": ( settings.direction == 'horizontal' ) ? "translate3d(" + pos + "%, 0, 0)" : "translate3d(0, " + pos + "%, 0)",
|
105
|
-
"transition": "all " + settings.animationTime + "ms " + settings.easing
|
106
|
-
});
|
107
|
-
$(this).one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(e) {
|
108
|
-
if (typeof settings.afterMove == 'function') settings.afterMove(index);
|
109
|
-
});
|
110
|
-
}
|
111
|
-
|
112
|
-
$.fn.moveDown = function() {
|
113
|
-
var el = $(this)
|
114
|
-
index = $(settings.sectionContainer +".active").data("index");
|
115
|
-
current = $(settings.sectionContainer + "[data-index='" + index + "']");
|
116
|
-
next = $(settings.sectionContainer + "[data-index='" + (index + 1) + "']");
|
117
|
-
if(next.length < 1) {
|
118
|
-
if (settings.loop == true) {
|
119
|
-
pos = 0;
|
120
|
-
next = $(settings.sectionContainer + "[data-index='1']");
|
121
|
-
} else {
|
122
|
-
return
|
123
|
-
}
|
124
|
-
|
125
|
-
}else {
|
126
|
-
pos = (index * 100) * -1;
|
127
|
-
}
|
128
|
-
if (typeof settings.beforeMove == 'function') settings.beforeMove( next.data("index"));
|
129
|
-
current.removeClass("active")
|
130
|
-
next.addClass("active");
|
131
|
-
if(settings.pagination == true) {
|
132
|
-
$(".onepage-pagination li a" + "[data-index='" + index + "']").removeClass("active");
|
133
|
-
$(".onepage-pagination li a" + "[data-index='" + next.data("index") + "']").addClass("active");
|
134
|
-
}
|
135
|
-
|
136
|
-
$("body")[0].className = $("body")[0].className.replace(/\bviewing-page-\d.*?\b/g, '');
|
137
|
-
$("body").addClass("viewing-page-"+next.data("index"))
|
138
|
-
|
139
|
-
if (history.replaceState && settings.updateURL == true) {
|
140
|
-
var href = window.location.href.substr(0,window.location.href.indexOf('#')) + "#" + (index + 1);
|
141
|
-
history.pushState( {}, document.title, href );
|
142
|
-
}
|
143
|
-
el.transformPage(settings, pos, next.data("index"));
|
144
|
-
}
|
145
|
-
|
146
|
-
$.fn.moveUp = function() {
|
147
|
-
var el = $(this)
|
148
|
-
index = $(settings.sectionContainer +".active").data("index");
|
149
|
-
current = $(settings.sectionContainer + "[data-index='" + index + "']");
|
150
|
-
next = $(settings.sectionContainer + "[data-index='" + (index - 1) + "']");
|
151
|
-
|
152
|
-
if(next.length < 1) {
|
153
|
-
if (settings.loop == true) {
|
154
|
-
pos = ((total - 1) * 100) * -1;
|
155
|
-
next = $(settings.sectionContainer + "[data-index='"+total+"']");
|
156
|
-
}
|
157
|
-
else {
|
158
|
-
return
|
159
|
-
}
|
160
|
-
}else {
|
161
|
-
pos = ((next.data("index") - 1) * 100) * -1;
|
162
|
-
}
|
163
|
-
if (typeof settings.beforeMove == 'function') settings.beforeMove(next.data("index"));
|
164
|
-
current.removeClass("active")
|
165
|
-
next.addClass("active")
|
166
|
-
if(settings.pagination == true) {
|
167
|
-
$(".onepage-pagination li a" + "[data-index='" + index + "']").removeClass("active");
|
168
|
-
$(".onepage-pagination li a" + "[data-index='" + next.data("index") + "']").addClass("active");
|
169
|
-
}
|
170
|
-
$("body")[0].className = $("body")[0].className.replace(/\bviewing-page-\d.*?\b/g, '');
|
171
|
-
$("body").addClass("viewing-page-"+next.data("index"))
|
172
|
-
|
173
|
-
if (history.replaceState && settings.updateURL == true) {
|
174
|
-
var href = window.location.href.substr(0,window.location.href.indexOf('#')) + "#" + (index - 1);
|
175
|
-
history.pushState( {}, document.title, href );
|
176
|
-
}
|
177
|
-
el.transformPage(settings, pos, next.data("index"));
|
178
|
-
}
|
179
|
-
|
180
|
-
$.fn.moveTo = function(page_index) {
|
181
|
-
current = $(settings.sectionContainer + ".active")
|
182
|
-
next = $(settings.sectionContainer + "[data-index='" + (page_index) + "']");
|
183
|
-
if(next.length > 0) {
|
184
|
-
if (typeof settings.beforeMove == 'function') settings.beforeMove(next.data("index"));
|
185
|
-
current.removeClass("active")
|
186
|
-
next.addClass("active")
|
187
|
-
$(".onepage-pagination li a" + ".active").removeClass("active");
|
188
|
-
$(".onepage-pagination li a" + "[data-index='" + (page_index) + "']").addClass("active");
|
189
|
-
$("body")[0].className = $("body")[0].className.replace(/\bviewing-page-\d.*?\b/g, '');
|
190
|
-
$("body").addClass("viewing-page-"+next.data("index"))
|
191
|
-
|
192
|
-
pos = ((page_index - 1) * 100) * -1;
|
193
|
-
|
194
|
-
if (history.replaceState && settings.updateURL == true) {
|
195
|
-
var href = window.location.href.substr(0,window.location.href.indexOf('#')) + "#" + (page_index - 1);
|
196
|
-
history.pushState( {}, document.title, href );
|
197
|
-
}
|
198
|
-
el.transformPage(settings, pos, page_index);
|
199
|
-
}
|
200
|
-
}
|
201
|
-
|
202
|
-
function responsive() {
|
203
|
-
//start modification
|
204
|
-
var valForTest = false;
|
205
|
-
var typeOfRF = typeof settings.responsiveFallback
|
206
|
-
|
207
|
-
if(typeOfRF == "number"){
|
208
|
-
valForTest = $(window).width() < settings.responsiveFallback;
|
209
|
-
}
|
210
|
-
if(typeOfRF == "boolean"){
|
211
|
-
valForTest = settings.responsiveFallback;
|
212
|
-
}
|
213
|
-
if(typeOfRF == "function"){
|
214
|
-
valFunction = settings.responsiveFallback();
|
215
|
-
valForTest = valFunction;
|
216
|
-
typeOFv = typeof valForTest;
|
217
|
-
if(typeOFv == "number"){
|
218
|
-
valForTest = $(window).width() < valFunction;
|
219
|
-
}
|
220
|
-
}
|
221
|
-
|
222
|
-
//end modification
|
223
|
-
if (valForTest) {
|
224
|
-
$("body").addClass("disabled-onepage-scroll");
|
225
|
-
$(document).unbind('mousewheel DOMMouseScroll MozMousePixelScroll');
|
226
|
-
el.swipeEvents().unbind("swipeDown swipeUp");
|
227
|
-
} else {
|
228
|
-
if($("body").hasClass("disabled-onepage-scroll")) {
|
229
|
-
$("body").removeClass("disabled-onepage-scroll");
|
230
|
-
$("html, body, .wrapper").animate({ scrollTop: 0 }, "fast");
|
231
|
-
}
|
232
|
-
|
233
|
-
|
234
|
-
el.swipeEvents().bind("swipeDown", function(event){
|
235
|
-
if (!$("body").hasClass("disabled-onepage-scroll")) event.preventDefault();
|
236
|
-
el.moveUp();
|
237
|
-
}).bind("swipeUp", function(event){
|
238
|
-
if (!$("body").hasClass("disabled-onepage-scroll")) event.preventDefault();
|
239
|
-
el.moveDown();
|
240
|
-
});
|
241
|
-
|
242
|
-
$(document).bind('mousewheel DOMMouseScroll MozMousePixelScroll', function(event) {
|
243
|
-
event.preventDefault();
|
244
|
-
var delta = event.originalEvent.wheelDelta || -event.originalEvent.detail;
|
245
|
-
init_scroll(event, delta);
|
246
|
-
});
|
247
|
-
}
|
248
|
-
}
|
249
|
-
|
250
|
-
|
251
|
-
function init_scroll(event, delta) {
|
252
|
-
deltaOfInterest = delta;
|
253
|
-
var timeNow = new Date().getTime();
|
254
|
-
// Cancel scroll if currently animating or within quiet period
|
255
|
-
if(timeNow - lastAnimation < quietPeriod + settings.animationTime) {
|
256
|
-
event.preventDefault();
|
257
|
-
return;
|
258
|
-
}
|
259
|
-
|
260
|
-
if (deltaOfInterest < 0) {
|
261
|
-
el.moveDown()
|
262
|
-
} else {
|
263
|
-
el.moveUp()
|
264
|
-
}
|
265
|
-
lastAnimation = timeNow;
|
266
|
-
}
|
267
|
-
|
268
|
-
// Prepare everything before binding wheel scroll
|
269
|
-
|
270
|
-
el.addClass("onepage-wrapper").css("position","relative");
|
271
|
-
$.each( sections, function(i) {
|
272
|
-
$(this).css({
|
273
|
-
position: "absolute",
|
274
|
-
top: topPos + "%"
|
275
|
-
}).addClass("section").attr("data-index", i+1);
|
276
|
-
|
277
|
-
|
278
|
-
$(this).css({
|
279
|
-
position: "absolute",
|
280
|
-
left: ( settings.direction == 'horizontal' )
|
281
|
-
? leftPos + "%"
|
282
|
-
: 0,
|
283
|
-
top: ( settings.direction == 'vertical' || settings.direction != 'horizontal' )
|
284
|
-
? topPos + "%"
|
285
|
-
: 0
|
286
|
-
});
|
287
|
-
|
288
|
-
if (settings.direction == 'horizontal')
|
289
|
-
leftPos = leftPos + 100;
|
290
|
-
else
|
291
|
-
topPos = topPos + 100;
|
292
|
-
|
293
|
-
|
294
|
-
if(settings.pagination == true) {
|
295
|
-
paginationList += "<li><a data-index='"+(i+1)+"' href='#" + (i+1) + "'></a></li>"
|
296
|
-
}
|
297
|
-
});
|
298
|
-
|
299
|
-
el.swipeEvents().bind("swipeDown", function(event){
|
300
|
-
if (!$("body").hasClass("disabled-onepage-scroll")) event.preventDefault();
|
301
|
-
el.moveUp();
|
302
|
-
}).bind("swipeUp", function(event){
|
303
|
-
if (!$("body").hasClass("disabled-onepage-scroll")) event.preventDefault();
|
304
|
-
el.moveDown();
|
305
|
-
});
|
306
|
-
|
307
|
-
// Create Pagination and Display Them
|
308
|
-
if (settings.pagination == true) {
|
309
|
-
if ($('ul.onepage-pagination').length < 1) $("<ul class='onepage-pagination'></ul>").prependTo("body");
|
310
|
-
|
311
|
-
if( settings.direction == 'horizontal' ) {
|
312
|
-
posLeft = (el.find(".onepage-pagination").width() / 2) * -1;
|
313
|
-
el.find(".onepage-pagination").css("margin-left", posLeft);
|
314
|
-
} else {
|
315
|
-
posTop = (el.find(".onepage-pagination").height() / 2) * -1;
|
316
|
-
el.find(".onepage-pagination").css("margin-top", posTop);
|
317
|
-
}
|
318
|
-
$('ul.onepage-pagination').html(paginationList);
|
319
|
-
}
|
320
|
-
|
321
|
-
if(window.location.hash != "" && window.location.hash != "#1") {
|
322
|
-
init_index = window.location.hash.replace("#", "")
|
323
|
-
|
324
|
-
if (parseInt(init_index) <= total && parseInt(init_index) > 0) {
|
325
|
-
$(settings.sectionContainer + "[data-index='" + init_index + "']").addClass("active")
|
326
|
-
$("body").addClass("viewing-page-"+ init_index)
|
327
|
-
if(settings.pagination == true) $(".onepage-pagination li a" + "[data-index='" + init_index + "']").addClass("active");
|
328
|
-
|
329
|
-
next = $(settings.sectionContainer + "[data-index='" + (init_index) + "']");
|
330
|
-
if(next) {
|
331
|
-
next.addClass("active")
|
332
|
-
if(settings.pagination == true) $(".onepage-pagination li a" + "[data-index='" + (init_index) + "']").addClass("active");
|
333
|
-
$("body")[0].className = $("body")[0].className.replace(/\bviewing-page-\d.*?\b/g, '');
|
334
|
-
$("body").addClass("viewing-page-"+next.data("index"))
|
335
|
-
if (history.replaceState && settings.updateURL == true) {
|
336
|
-
var href = window.location.href.substr(0,window.location.href.indexOf('#')) + "#" + (init_index);
|
337
|
-
history.pushState( {}, document.title, href );
|
338
|
-
}
|
339
|
-
}
|
340
|
-
pos = ((init_index - 1) * 100) * -1;
|
341
|
-
el.transformPage(settings, pos, init_index);
|
342
|
-
} else {
|
343
|
-
$(settings.sectionContainer + "[data-index='1']").addClass("active")
|
344
|
-
$("body").addClass("viewing-page-1")
|
345
|
-
if(settings.pagination == true) $(".onepage-pagination li a" + "[data-index='1']").addClass("active");
|
346
|
-
}
|
347
|
-
}else{
|
348
|
-
$(settings.sectionContainer + "[data-index='1']").addClass("active")
|
349
|
-
$("body").addClass("viewing-page-1")
|
350
|
-
if(settings.pagination == true) $(".onepage-pagination li a" + "[data-index='1']").addClass("active");
|
351
|
-
}
|
352
|
-
|
353
|
-
if(settings.pagination == true) {
|
354
|
-
$(".onepage-pagination li a").click(function (){
|
355
|
-
var page_index = $(this).data("index");
|
356
|
-
el.moveTo(page_index);
|
357
|
-
});
|
358
|
-
}
|
359
|
-
|
360
|
-
|
361
|
-
$(document).bind('mousewheel DOMMouseScroll MozMousePixelScroll', function(event) {
|
362
|
-
event.preventDefault();
|
363
|
-
var delta = event.originalEvent.wheelDelta || -event.originalEvent.detail;
|
364
|
-
if(!$("body").hasClass("disabled-onepage-scroll")) init_scroll(event, delta);
|
365
|
-
});
|
366
|
-
|
367
|
-
|
368
|
-
if(settings.responsiveFallback != false) {
|
369
|
-
$(window).resize(function() {
|
370
|
-
responsive();
|
371
|
-
});
|
372
|
-
|
373
|
-
responsive();
|
374
|
-
}
|
375
|
-
|
376
|
-
if(settings.keyboard == true) {
|
377
|
-
$(document).keydown(function(e) {
|
378
|
-
var tag = e.target.tagName.toLowerCase();
|
379
|
-
|
380
|
-
if (!$("body").hasClass("disabled-onepage-scroll")) {
|
381
|
-
switch(e.which) {
|
382
|
-
case 38:
|
383
|
-
if (tag != 'input' && tag != 'textarea') el.moveUp()
|
384
|
-
break;
|
385
|
-
case 40:
|
386
|
-
if (tag != 'input' && tag != 'textarea') el.moveDown()
|
387
|
-
break;
|
388
|
-
case 33: //pageg up
|
389
|
-
if (tag != 'input' && tag != 'textarea') el.moveUp()
|
390
|
-
break;
|
391
|
-
case 34: //page dwn
|
392
|
-
if (tag != 'input' && tag != 'textarea') el.moveDown()
|
393
|
-
break;
|
394
|
-
case 36: //home
|
395
|
-
el.moveTo(1);
|
396
|
-
break;
|
397
|
-
case 35: //end
|
398
|
-
el.moveTo(total);
|
399
|
-
break;
|
400
|
-
default: return;
|
401
|
-
}
|
402
|
-
}
|
403
|
-
|
404
|
-
});
|
405
|
-
}
|
406
|
-
return false;
|
407
|
-
}
|
408
|
-
|
409
|
-
|
410
|
-
}(window.jQuery);
|
411
|
-
|
@@ -1,104 +0,0 @@
|
|
1
|
-
# Mice: message
|
2
|
-
|
3
|
-
# Inspired by the original essage by 小鱼 sofish
|
4
|
-
# https://github.com/sofish/essage
|
5
|
-
|
6
|
-
# Copyright (c) 2014 Miclle
|
7
|
-
# Licensed under MIT (https://github.com/miclle/mice/blob/master/LICENSE)
|
8
|
-
|
9
|
-
|
10
|
-
'use strict';
|
11
|
-
|
12
|
-
(($) ->
|
13
|
-
|
14
|
-
class Message
|
15
|
-
|
16
|
-
constructor: (element, options) ->
|
17
|
-
@element = element
|
18
|
-
@$element
|
19
|
-
@options
|
20
|
-
@.init(options)
|
21
|
-
|
22
|
-
init: (options) =>
|
23
|
-
@$element = $(@element) if @element
|
24
|
-
@$element.on('click', '.close', => @.hide()) if @$element
|
25
|
-
|
26
|
-
@options = @getOptions(options)
|
27
|
-
|
28
|
-
getOptions: (options) ->
|
29
|
-
if @$element then $.extend({}, $.fn.message.defaults, @$element.data(), options) else $.extend({}, $.fn.message.defaults, options)
|
30
|
-
|
31
|
-
show: (message, duration) ->
|
32
|
-
if message
|
33
|
-
@$element = @$element || $('body').data('miclle-message-global')
|
34
|
-
|
35
|
-
if @$element == `undefined`
|
36
|
-
@$element = $ $.fn.message.defaults.template
|
37
|
-
$('body').append(@$element).data('miclle-message-global', @$element)
|
38
|
-
|
39
|
-
if (typeof message == 'string') then @init( message: message ) else @init(message)
|
40
|
-
|
41
|
-
@$element.slideUp =>
|
42
|
-
@$element.removeClass('top bottom').addClass(@options.placement)
|
43
|
-
|
44
|
-
@$element.removeClass('success info warning danger').addClass(@options.status)
|
45
|
-
|
46
|
-
message = @options.message
|
47
|
-
duration = duration || @options.duration
|
48
|
-
|
49
|
-
@$element.children('.inner').html(message) if message
|
50
|
-
@$element.slideDown => duration and setTimeout (=> @.hide()), duration
|
51
|
-
|
52
|
-
else
|
53
|
-
message = @options.message
|
54
|
-
duration = duration || @options.duration
|
55
|
-
|
56
|
-
@$element.children('.inner').html(message) if message
|
57
|
-
@$element.slideDown => duration and setTimeout (=> @.hide()), duration
|
58
|
-
@
|
59
|
-
|
60
|
-
hold: ->
|
61
|
-
@$element.slideDown()
|
62
|
-
|
63
|
-
hide: ->
|
64
|
-
@$element.slideUp()
|
65
|
-
|
66
|
-
toggle: ->
|
67
|
-
if @$element.is ':hidden' then @show() else @hide()
|
68
|
-
|
69
|
-
destroy: ->
|
70
|
-
@hide().$element.remove()
|
71
|
-
|
72
|
-
$.fn.message = (option) ->
|
73
|
-
@each ->
|
74
|
-
$element = $(@)
|
75
|
-
data = $element.data('mice.message')
|
76
|
-
options = typeof option == 'object' and option
|
77
|
-
|
78
|
-
return if !data and option == 'destroy'
|
79
|
-
|
80
|
-
if !data
|
81
|
-
data = new Message @, options
|
82
|
-
data.show()
|
83
|
-
$element.data 'mice.message', data
|
84
|
-
|
85
|
-
data[option]() if typeof option == 'string'
|
86
|
-
|
87
|
-
|
88
|
-
$.fn.message.Constructor = Message
|
89
|
-
|
90
|
-
$.fn.message.defaults =
|
91
|
-
template: "<div class=\"message\"><div class=\"inner\"></div><span class=\"close\">×</span></div>"
|
92
|
-
message: null
|
93
|
-
placement: 'top'
|
94
|
-
status: ''
|
95
|
-
duration: null
|
96
|
-
|
97
|
-
# export to window
|
98
|
-
window.Message = new Message()
|
99
|
-
|
100
|
-
$ -> $('[data-ride="message"]').message();
|
101
|
-
|
102
|
-
return
|
103
|
-
|
104
|
-
) jQuery
|