wbase 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +219 -2
- data/app/assets/javascripts/wbase/auth/bootstrap.min.js +7 -0
- data/app/assets/javascripts/wbase/auth/detect.js +7 -0
- data/app/assets/javascripts/wbase/auth/fastclick.js +841 -0
- data/app/assets/javascripts/wbase/auth/jquery.app.js +318 -0
- data/app/assets/javascripts/wbase/auth/jquery.blockUI.js +620 -0
- data/app/assets/javascripts/wbase/auth/jquery.core.js +323 -0
- data/app/assets/javascripts/wbase/auth/jquery.min.js +5 -0
- data/app/assets/javascripts/wbase/auth/jquery.nicescroll.js +113 -0
- data/app/assets/javascripts/wbase/auth/jquery.scrollTo.min.js +7 -0
- data/app/assets/javascripts/wbase/auth/jquery.slimscroll.js +474 -0
- data/app/assets/javascripts/wbase/auth/modernizr.min.js +1 -0
- data/app/assets/javascripts/wbase/auth/pace.min.js +2 -0
- data/app/assets/javascripts/wbase/auth/waves.js +498 -0
- data/app/assets/javascripts/wbase/auth/wow.min.js +2 -0
- data/app/assets/javascripts/wbase/auth.js +12 -0
- data/app/assets/stylesheets/wbase/auth/components.css +2362 -0
- data/app/assets/stylesheets/wbase/auth/core.css +2190 -0
- data/app/assets/stylesheets/wbase/auth/icons.css +12067 -0
- data/app/assets/stylesheets/wbase/auth/pages.css +2039 -0
- data/app/assets/stylesheets/wbase/auth/responsive.css +162 -0
- data/app/assets/stylesheets/wbase/auth/typicons.css +1370 -0
- data/app/assets/stylesheets/wbase/auth/variables.css +0 -0
- data/app/assets/stylesheets/wbase/auth.scss +9 -0
- data/app/controllers/wbase/application_controller.rb +13 -0
- data/app/controllers/wbase/mail_events_controller.rb +21 -0
- data/app/controllers/wbase/password_resets_controller.rb +43 -0
- data/app/controllers/wbase/sessions_controller.rb +35 -0
- data/app/controllers/wbase/static_pages_controller.rb +4 -0
- data/app/controllers/wbase/stripe_webhooks_controller.rb +54 -0
- data/app/controllers/wbase/subscriptions_controller.rb +50 -0
- data/app/controllers/wbase/users_controller.rb +65 -0
- data/app/helpers/wbase/auth_helper.rb +44 -0
- data/app/jobs/wbase/activate_drip_subscriber_job.rb +15 -0
- data/app/jobs/wbase/create_drip_subscriber_job.rb +13 -0
- data/app/jobs/wbase/dripable.rb +22 -0
- data/app/mailers/application_mailer.rb +4 -0
- data/app/mailers/wbase/admin_mailer.rb +35 -0
- data/app/mailers/wbase/password_reset_mailer.rb +20 -0
- data/app/models/wbase/mail_event.rb +21 -0
- data/app/models/wbase/plan.rb +26 -0
- data/app/models/wbase/ssl_verification.rb +21 -0
- data/app/models/wbase/stripe_webhook.rb +22 -0
- data/app/models/wbase/subscription.rb +47 -0
- data/app/models/wbase/userable.rb +85 -0
- data/app/services/wbase/mail_event_batch.rb +22 -0
- data/app/services/wbase/start_subscription.rb +81 -0
- data/app/views/layouts/mailer.html.erb +53 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/layouts/wbase/_common_head.html.erb +46 -0
- data/app/views/layouts/wbase/auth.html.erb +23 -0
- data/app/views/layouts/wbase/landing.html.erb +9 -56
- data/app/views/shared/_errors.html.erb +10 -0
- data/app/views/wbase/admin_mailer/new_subscription.html.erb +33 -0
- data/app/views/wbase/admin_mailer/new_user.html.erb +7 -0
- data/app/views/wbase/password_reset_mailer/reset.html.erb +10 -0
- data/app/views/wbase/password_reset_mailer/reset.text.erb +5 -0
- data/app/views/wbase/password_resets/edit.html.erb +22 -0
- data/app/views/wbase/password_resets/new.html.erb +41 -0
- data/app/views/wbase/sessions/new.html.erb +58 -0
- data/app/views/wbase/static_pages/landing/_pricing.html.erb +6 -2
- data/app/views/wbase/static_pages/start.html.erb +1 -1
- data/app/views/wbase/static_pages/welcome.html.erb +1 -1
- data/app/views/wbase/subscriptions/edit.html.erb +2 -0
- data/app/views/wbase/subscriptions/new.html.erb +91 -0
- data/app/views/wbase/subscriptions/show.html.erb +2 -0
- data/app/views/wbase/users/_affiliate.html.erb +66 -0
- data/app/views/wbase/users/_plan.html.erb +11 -0
- data/app/views/wbase/users/_plans.html.erb +11 -0
- data/app/views/wbase/users/edit.html.erb +2 -0
- data/app/views/wbase/users/new.html.erb +38 -0
- data/app/views/wbase/users/show.html.erb +37 -0
- data/config/initializers/assets.rb +1 -3
- data/config/routes.rb +9 -0
- data/db/migrate/20161127212521_create_wbase_subscriptions.rb +17 -0
- data/db/migrate/20161127212831_create_wbase_plans.rb +15 -0
- data/db/migrate/20161127224117_create_wbase_ssl_verifications.rb +10 -0
- data/db/migrate/20161128022640_create_wbase_mail_events.rb +16 -0
- data/db/migrate/20161128031211_create_wbase_stripe_webhooks.rb +17 -0
- data/lib/wbase/engine.rb +37 -28
- data/lib/wbase/version.rb +1 -1
- data/test/controllers/wbase/mail_events_controller_test.rb +13 -0
- data/test/controllers/wbase/password_resets_controller_test.rb +13 -0
- data/test/controllers/wbase/sessions_controller_test.rb +13 -0
- data/test/controllers/wbase/stripe_webhooks_controller_test.rb +13 -0
- data/test/controllers/wbase/subscriptions_controller_test.rb +13 -0
- data/test/controllers/wbase/users_controller_test.rb +13 -0
- data/test/dummy/config/database.yml +4 -7
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +85 -0
- data/test/dummy/log/development.log +225 -0
- data/test/fixtures/wbase/mail_events.yml +38 -0
- data/test/fixtures/wbase/plans.yml +40 -0
- data/test/fixtures/wbase/stripe_webhooks.yml +41 -0
- data/test/fixtures/wbase/subscriptions.yml +46 -0
- data/test/jobs/wbase/activate_drip_subscriber_job_test.rb +9 -0
- data/test/jobs/wbase/create_drip_subscriber_job_job_test.rb +9 -0
- data/test/mailers/previews/wbase/admin_mailer_preview.rb +11 -0
- data/test/mailers/previews/wbase/password_reset_mailer_preview.rb +11 -0
- data/test/mailers/wbase/admin_mailer_test.rb +14 -0
- data/test/mailers/wbase/password_reset_mailer_test.rb +14 -0
- data/test/models/wbase/mail_event_test.rb +26 -0
- data/test/models/wbase/plan_test.rb +30 -0
- data/test/models/wbase/ssl_verification_test.rb +20 -0
- data/test/models/wbase/stripe_webhook_test.rb +27 -0
- data/test/models/wbase/subscription_test.rb +32 -0
- metadata +121 -12
- data/app/helpers/wbase/application_helper.rb +0 -4
- data/app/helpers/wbase/static_pages_helper.rb +0 -4
- data/app/views/wbase/static_pages/_map.html.erb +0 -17
- data/app/views/wbase/static_pages/_order_stats.html.erb +0 -28
- data/app/views/wbase/static_pages/_pricing.html.erb +0 -89
- data/app/views/wbase/static_pages/_stats.html.erb +0 -28
- data/app/views/wbase/static_pages/_testimonial.html.erb +0 -16
- data/app/views/wbase/static_pages/affiliate.html.erb +0 -54
- data/app/views/wbase/static_pages/faq.html.erb +0 -63
@@ -0,0 +1,474 @@
|
|
1
|
+
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
|
2
|
+
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
3
|
+
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
4
|
+
*
|
5
|
+
* Version: 1.3.8
|
6
|
+
*
|
7
|
+
*/
|
8
|
+
(function($) {
|
9
|
+
|
10
|
+
$.fn.extend({
|
11
|
+
slimScroll: function(options) {
|
12
|
+
|
13
|
+
var defaults = {
|
14
|
+
|
15
|
+
// width in pixels of the visible scroll area
|
16
|
+
width : 'auto',
|
17
|
+
|
18
|
+
// height in pixels of the visible scroll area
|
19
|
+
height : '250px',
|
20
|
+
|
21
|
+
// width in pixels of the scrollbar and rail
|
22
|
+
size : '7px',
|
23
|
+
|
24
|
+
// scrollbar color, accepts any hex/color value
|
25
|
+
color: '#000',
|
26
|
+
|
27
|
+
// scrollbar position - left/right
|
28
|
+
position : 'right',
|
29
|
+
|
30
|
+
// distance in pixels between the side edge and the scrollbar
|
31
|
+
distance : '1px',
|
32
|
+
|
33
|
+
// default scroll position on load - top / bottom / $('selector')
|
34
|
+
start : 'top',
|
35
|
+
|
36
|
+
// sets scrollbar opacity
|
37
|
+
opacity : .4,
|
38
|
+
|
39
|
+
// enables always-on mode for the scrollbar
|
40
|
+
alwaysVisible : false,
|
41
|
+
|
42
|
+
// check if we should hide the scrollbar when user is hovering over
|
43
|
+
disableFadeOut : false,
|
44
|
+
|
45
|
+
// sets visibility of the rail
|
46
|
+
railVisible : false,
|
47
|
+
|
48
|
+
// sets rail color
|
49
|
+
railColor : '#333',
|
50
|
+
|
51
|
+
// sets rail opacity
|
52
|
+
railOpacity : .2,
|
53
|
+
|
54
|
+
// whether we should use jQuery UI Draggable to enable bar dragging
|
55
|
+
railDraggable : true,
|
56
|
+
|
57
|
+
// defautlt CSS class of the slimscroll rail
|
58
|
+
railClass : 'slimScrollRail',
|
59
|
+
|
60
|
+
// defautlt CSS class of the slimscroll bar
|
61
|
+
barClass : 'slimScrollBar',
|
62
|
+
|
63
|
+
// defautlt CSS class of the slimscroll wrapper
|
64
|
+
wrapperClass : 'slimScrollDiv',
|
65
|
+
|
66
|
+
// check if mousewheel should scroll the window if we reach top/bottom
|
67
|
+
allowPageScroll : false,
|
68
|
+
|
69
|
+
// scroll amount applied to each mouse wheel step
|
70
|
+
wheelStep : 20,
|
71
|
+
|
72
|
+
// scroll amount applied when user is using gestures
|
73
|
+
touchScrollStep : 200,
|
74
|
+
|
75
|
+
// sets border radius
|
76
|
+
borderRadius: '7px',
|
77
|
+
|
78
|
+
// sets border radius of the rail
|
79
|
+
railBorderRadius : '7px'
|
80
|
+
};
|
81
|
+
|
82
|
+
var o = $.extend(defaults, options);
|
83
|
+
|
84
|
+
// do it for every element that matches selector
|
85
|
+
this.each(function(){
|
86
|
+
|
87
|
+
var isOverPanel, isOverBar, isDragg, queueHide, touchDif,
|
88
|
+
barHeight, percentScroll, lastScroll,
|
89
|
+
divS = '<div></div>',
|
90
|
+
minBarHeight = 30,
|
91
|
+
releaseScroll = false;
|
92
|
+
|
93
|
+
// used in event handlers and for better minification
|
94
|
+
var me = $(this);
|
95
|
+
|
96
|
+
// ensure we are not binding it again
|
97
|
+
if (me.parent().hasClass(o.wrapperClass))
|
98
|
+
{
|
99
|
+
// start from last bar position
|
100
|
+
var offset = me.scrollTop();
|
101
|
+
|
102
|
+
// find bar and rail
|
103
|
+
bar = me.siblings('.' + o.barClass);
|
104
|
+
rail = me.siblings('.' + o.railClass);
|
105
|
+
|
106
|
+
getBarHeight();
|
107
|
+
|
108
|
+
// check if we should scroll existing instance
|
109
|
+
if ($.isPlainObject(options))
|
110
|
+
{
|
111
|
+
// Pass height: auto to an existing slimscroll object to force a resize after contents have changed
|
112
|
+
if ( 'height' in options && options.height == 'auto' ) {
|
113
|
+
me.parent().css('height', 'auto');
|
114
|
+
me.css('height', 'auto');
|
115
|
+
var height = me.parent().parent().height();
|
116
|
+
me.parent().css('height', height);
|
117
|
+
me.css('height', height);
|
118
|
+
} else if ('height' in options) {
|
119
|
+
var h = options.height;
|
120
|
+
me.parent().css('height', h);
|
121
|
+
me.css('height', h);
|
122
|
+
}
|
123
|
+
|
124
|
+
if ('scrollTo' in options)
|
125
|
+
{
|
126
|
+
// jump to a static point
|
127
|
+
offset = parseInt(o.scrollTo);
|
128
|
+
}
|
129
|
+
else if ('scrollBy' in options)
|
130
|
+
{
|
131
|
+
// jump by value pixels
|
132
|
+
offset += parseInt(o.scrollBy);
|
133
|
+
}
|
134
|
+
else if ('destroy' in options)
|
135
|
+
{
|
136
|
+
// remove slimscroll elements
|
137
|
+
bar.remove();
|
138
|
+
rail.remove();
|
139
|
+
me.unwrap();
|
140
|
+
return;
|
141
|
+
}
|
142
|
+
|
143
|
+
// scroll content by the given offset
|
144
|
+
scrollContent(offset, false, true);
|
145
|
+
}
|
146
|
+
|
147
|
+
return;
|
148
|
+
}
|
149
|
+
else if ($.isPlainObject(options))
|
150
|
+
{
|
151
|
+
if ('destroy' in options)
|
152
|
+
{
|
153
|
+
return;
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
// optionally set height to the parent's height
|
158
|
+
o.height = (o.height == 'auto') ? me.parent().height() : o.height;
|
159
|
+
|
160
|
+
// wrap content
|
161
|
+
var wrapper = $(divS)
|
162
|
+
.addClass(o.wrapperClass)
|
163
|
+
.css({
|
164
|
+
position: 'relative',
|
165
|
+
overflow: 'hidden',
|
166
|
+
width: o.width,
|
167
|
+
height: o.height
|
168
|
+
});
|
169
|
+
|
170
|
+
// update style for the div
|
171
|
+
me.css({
|
172
|
+
overflow: 'hidden',
|
173
|
+
width: o.width,
|
174
|
+
height: o.height
|
175
|
+
});
|
176
|
+
|
177
|
+
// create scrollbar rail
|
178
|
+
var rail = $(divS)
|
179
|
+
.addClass(o.railClass)
|
180
|
+
.css({
|
181
|
+
width: o.size,
|
182
|
+
height: '100%',
|
183
|
+
position: 'absolute',
|
184
|
+
top: 0,
|
185
|
+
display: (o.alwaysVisible && o.railVisible) ? 'block' : 'none',
|
186
|
+
'border-radius': o.railBorderRadius,
|
187
|
+
background: o.railColor,
|
188
|
+
opacity: o.railOpacity,
|
189
|
+
zIndex: 90
|
190
|
+
});
|
191
|
+
|
192
|
+
// create scrollbar
|
193
|
+
var bar = $(divS)
|
194
|
+
.addClass(o.barClass)
|
195
|
+
.css({
|
196
|
+
background: o.color,
|
197
|
+
width: o.size,
|
198
|
+
position: 'absolute',
|
199
|
+
top: 0,
|
200
|
+
opacity: o.opacity,
|
201
|
+
display: o.alwaysVisible ? 'block' : 'none',
|
202
|
+
'border-radius' : o.borderRadius,
|
203
|
+
BorderRadius: o.borderRadius,
|
204
|
+
MozBorderRadius: o.borderRadius,
|
205
|
+
WebkitBorderRadius: o.borderRadius,
|
206
|
+
zIndex: 99
|
207
|
+
});
|
208
|
+
|
209
|
+
// set position
|
210
|
+
var posCss = (o.position == 'right') ? { right: o.distance } : { left: o.distance };
|
211
|
+
rail.css(posCss);
|
212
|
+
bar.css(posCss);
|
213
|
+
|
214
|
+
// wrap it
|
215
|
+
me.wrap(wrapper);
|
216
|
+
|
217
|
+
// append to parent div
|
218
|
+
me.parent().append(bar);
|
219
|
+
me.parent().append(rail);
|
220
|
+
|
221
|
+
// make it draggable and no longer dependent on the jqueryUI
|
222
|
+
if (o.railDraggable){
|
223
|
+
bar.bind("mousedown", function(e) {
|
224
|
+
var $doc = $(document);
|
225
|
+
isDragg = true;
|
226
|
+
t = parseFloat(bar.css('top'));
|
227
|
+
pageY = e.pageY;
|
228
|
+
|
229
|
+
$doc.bind("mousemove.slimscroll", function(e){
|
230
|
+
currTop = t + e.pageY - pageY;
|
231
|
+
bar.css('top', currTop);
|
232
|
+
scrollContent(0, bar.position().top, false);// scroll content
|
233
|
+
});
|
234
|
+
|
235
|
+
$doc.bind("mouseup.slimscroll", function(e) {
|
236
|
+
isDragg = false;hideBar();
|
237
|
+
$doc.unbind('.slimscroll');
|
238
|
+
});
|
239
|
+
return false;
|
240
|
+
}).bind("selectstart.slimscroll", function(e){
|
241
|
+
e.stopPropagation();
|
242
|
+
e.preventDefault();
|
243
|
+
return false;
|
244
|
+
});
|
245
|
+
}
|
246
|
+
|
247
|
+
// on rail over
|
248
|
+
rail.hover(function(){
|
249
|
+
showBar();
|
250
|
+
}, function(){
|
251
|
+
hideBar();
|
252
|
+
});
|
253
|
+
|
254
|
+
// on bar over
|
255
|
+
bar.hover(function(){
|
256
|
+
isOverBar = true;
|
257
|
+
}, function(){
|
258
|
+
isOverBar = false;
|
259
|
+
});
|
260
|
+
|
261
|
+
// show on parent mouseover
|
262
|
+
me.hover(function(){
|
263
|
+
isOverPanel = true;
|
264
|
+
showBar();
|
265
|
+
hideBar();
|
266
|
+
}, function(){
|
267
|
+
isOverPanel = false;
|
268
|
+
hideBar();
|
269
|
+
});
|
270
|
+
|
271
|
+
// support for mobile
|
272
|
+
me.bind('touchstart', function(e,b){
|
273
|
+
if (e.originalEvent.touches.length)
|
274
|
+
{
|
275
|
+
// record where touch started
|
276
|
+
touchDif = e.originalEvent.touches[0].pageY;
|
277
|
+
}
|
278
|
+
});
|
279
|
+
|
280
|
+
me.bind('touchmove', function(e){
|
281
|
+
// prevent scrolling the page if necessary
|
282
|
+
if(!releaseScroll)
|
283
|
+
{
|
284
|
+
e.originalEvent.preventDefault();
|
285
|
+
}
|
286
|
+
if (e.originalEvent.touches.length)
|
287
|
+
{
|
288
|
+
// see how far user swiped
|
289
|
+
var diff = (touchDif - e.originalEvent.touches[0].pageY) / o.touchScrollStep;
|
290
|
+
// scroll content
|
291
|
+
scrollContent(diff, true);
|
292
|
+
touchDif = e.originalEvent.touches[0].pageY;
|
293
|
+
}
|
294
|
+
});
|
295
|
+
|
296
|
+
// set up initial height
|
297
|
+
getBarHeight();
|
298
|
+
|
299
|
+
// check start position
|
300
|
+
if (o.start === 'bottom')
|
301
|
+
{
|
302
|
+
// scroll content to bottom
|
303
|
+
bar.css({ top: me.outerHeight() - bar.outerHeight() });
|
304
|
+
scrollContent(0, true);
|
305
|
+
}
|
306
|
+
else if (o.start !== 'top')
|
307
|
+
{
|
308
|
+
// assume jQuery selector
|
309
|
+
scrollContent($(o.start).position().top, null, true);
|
310
|
+
|
311
|
+
// make sure bar stays hidden
|
312
|
+
if (!o.alwaysVisible) { bar.hide(); }
|
313
|
+
}
|
314
|
+
|
315
|
+
// attach scroll events
|
316
|
+
attachWheel(this);
|
317
|
+
|
318
|
+
function _onWheel(e)
|
319
|
+
{
|
320
|
+
// use mouse wheel only when mouse is over
|
321
|
+
if (!isOverPanel) { return; }
|
322
|
+
|
323
|
+
var e = e || window.event;
|
324
|
+
|
325
|
+
var delta = 0;
|
326
|
+
if (e.wheelDelta) { delta = -e.wheelDelta/120; }
|
327
|
+
if (e.detail) { delta = e.detail / 3; }
|
328
|
+
|
329
|
+
var target = e.target || e.srcTarget || e.srcElement;
|
330
|
+
if ($(target).closest('.' + o.wrapperClass).is(me.parent())) {
|
331
|
+
// scroll content
|
332
|
+
scrollContent(delta, true);
|
333
|
+
}
|
334
|
+
|
335
|
+
// stop window scroll
|
336
|
+
if (e.preventDefault && !releaseScroll) { e.preventDefault(); }
|
337
|
+
if (!releaseScroll) { e.returnValue = false; }
|
338
|
+
}
|
339
|
+
|
340
|
+
function scrollContent(y, isWheel, isJump)
|
341
|
+
{
|
342
|
+
releaseScroll = false;
|
343
|
+
var delta = y;
|
344
|
+
var maxTop = me.outerHeight() - bar.outerHeight();
|
345
|
+
|
346
|
+
if (isWheel)
|
347
|
+
{
|
348
|
+
// move bar with mouse wheel
|
349
|
+
delta = parseInt(bar.css('top')) + y * parseInt(o.wheelStep) / 100 * bar.outerHeight();
|
350
|
+
|
351
|
+
// move bar, make sure it doesn't go out
|
352
|
+
delta = Math.min(Math.max(delta, 0), maxTop);
|
353
|
+
|
354
|
+
// if scrolling down, make sure a fractional change to the
|
355
|
+
// scroll position isn't rounded away when the scrollbar's CSS is set
|
356
|
+
// this flooring of delta would happened automatically when
|
357
|
+
// bar.css is set below, but we floor here for clarity
|
358
|
+
delta = (y > 0) ? Math.ceil(delta) : Math.floor(delta);
|
359
|
+
|
360
|
+
// scroll the scrollbar
|
361
|
+
bar.css({ top: delta + 'px' });
|
362
|
+
}
|
363
|
+
|
364
|
+
// calculate actual scroll amount
|
365
|
+
percentScroll = parseInt(bar.css('top')) / (me.outerHeight() - bar.outerHeight());
|
366
|
+
delta = percentScroll * (me[0].scrollHeight - me.outerHeight());
|
367
|
+
|
368
|
+
if (isJump)
|
369
|
+
{
|
370
|
+
delta = y;
|
371
|
+
var offsetTop = delta / me[0].scrollHeight * me.outerHeight();
|
372
|
+
offsetTop = Math.min(Math.max(offsetTop, 0), maxTop);
|
373
|
+
bar.css({ top: offsetTop + 'px' });
|
374
|
+
}
|
375
|
+
|
376
|
+
// scroll content
|
377
|
+
me.scrollTop(delta);
|
378
|
+
|
379
|
+
// fire scrolling event
|
380
|
+
me.trigger('slimscrolling', ~~delta);
|
381
|
+
|
382
|
+
// ensure bar is visible
|
383
|
+
showBar();
|
384
|
+
|
385
|
+
// trigger hide when scroll is stopped
|
386
|
+
hideBar();
|
387
|
+
}
|
388
|
+
|
389
|
+
function attachWheel(target)
|
390
|
+
{
|
391
|
+
if (window.addEventListener)
|
392
|
+
{
|
393
|
+
target.addEventListener('DOMMouseScroll', _onWheel, false );
|
394
|
+
target.addEventListener('mousewheel', _onWheel, false );
|
395
|
+
}
|
396
|
+
else
|
397
|
+
{
|
398
|
+
document.attachEvent("onmousewheel", _onWheel)
|
399
|
+
}
|
400
|
+
}
|
401
|
+
|
402
|
+
function getBarHeight()
|
403
|
+
{
|
404
|
+
// calculate scrollbar height and make sure it is not too small
|
405
|
+
barHeight = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight);
|
406
|
+
bar.css({ height: barHeight + 'px' });
|
407
|
+
|
408
|
+
// hide scrollbar if content is not long enough
|
409
|
+
var display = barHeight == me.outerHeight() ? 'none' : 'block';
|
410
|
+
bar.css({ display: display });
|
411
|
+
}
|
412
|
+
|
413
|
+
function showBar()
|
414
|
+
{
|
415
|
+
// recalculate bar height
|
416
|
+
getBarHeight();
|
417
|
+
clearTimeout(queueHide);
|
418
|
+
|
419
|
+
// when bar reached top or bottom
|
420
|
+
if (percentScroll == ~~percentScroll)
|
421
|
+
{
|
422
|
+
//release wheel
|
423
|
+
releaseScroll = o.allowPageScroll;
|
424
|
+
|
425
|
+
// publish approporiate event
|
426
|
+
if (lastScroll != percentScroll)
|
427
|
+
{
|
428
|
+
var msg = (~~percentScroll == 0) ? 'top' : 'bottom';
|
429
|
+
me.trigger('slimscroll', msg);
|
430
|
+
}
|
431
|
+
}
|
432
|
+
else
|
433
|
+
{
|
434
|
+
releaseScroll = false;
|
435
|
+
}
|
436
|
+
lastScroll = percentScroll;
|
437
|
+
|
438
|
+
// show only when required
|
439
|
+
if(barHeight >= me.outerHeight()) {
|
440
|
+
//allow window scroll
|
441
|
+
releaseScroll = true;
|
442
|
+
return;
|
443
|
+
}
|
444
|
+
bar.stop(true,true).fadeIn('fast');
|
445
|
+
if (o.railVisible) { rail.stop(true,true).fadeIn('fast'); }
|
446
|
+
}
|
447
|
+
|
448
|
+
function hideBar()
|
449
|
+
{
|
450
|
+
// only hide when options allow it
|
451
|
+
if (!o.alwaysVisible)
|
452
|
+
{
|
453
|
+
queueHide = setTimeout(function(){
|
454
|
+
if (!(o.disableFadeOut && isOverPanel) && !isOverBar && !isDragg)
|
455
|
+
{
|
456
|
+
bar.fadeOut('slow');
|
457
|
+
rail.fadeOut('slow');
|
458
|
+
}
|
459
|
+
}, 1000);
|
460
|
+
}
|
461
|
+
}
|
462
|
+
|
463
|
+
});
|
464
|
+
|
465
|
+
// maintain chainability
|
466
|
+
return this;
|
467
|
+
}
|
468
|
+
});
|
469
|
+
|
470
|
+
$.fn.extend({
|
471
|
+
slimscroll: $.fn.slimScroll
|
472
|
+
});
|
473
|
+
|
474
|
+
})(jQuery);
|
@@ -0,0 +1 @@
|
|
1
|
+
window.Modernizr=function(e,t,n){function r(e){b.cssText=e}function o(e,t){return r(S.join(e+";")+(t||""))}function a(e,t){return typeof e===t}function i(e,t){return!!~(""+e).indexOf(t)}function c(e,t){for(var r in e){var o=e[r];if(!i(o,"-")&&b[o]!==n)return"pfx"==t?o:!0}return!1}function s(e,t,r){for(var o in e){var i=t[e[o]];if(i!==n)return r===!1?e[o]:a(i,"function")?i.bind(r||t):i}return!1}function u(e,t,n){var r=e.charAt(0).toUpperCase()+e.slice(1),o=(e+" "+k.join(r+" ")+r).split(" ");return a(t,"string")||a(t,"undefined")?c(o,t):(o=(e+" "+T.join(r+" ")+r).split(" "),s(o,t,n))}function l(){p.input=function(n){for(var r=0,o=n.length;o>r;r++)j[n[r]]=!!(n[r]in E);return j.list&&(j.list=!(!t.createElement("datalist")||!e.HTMLDataListElement)),j}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),p.inputtypes=function(e){for(var r,o,a,i=0,c=e.length;c>i;i++)E.setAttribute("type",o=e[i]),r="text"!==E.type,r&&(E.value=x,E.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(o)&&E.style.WebkitAppearance!==n?(g.appendChild(E),a=t.defaultView,r=a.getComputedStyle&&"textfield"!==a.getComputedStyle(E,null).WebkitAppearance&&0!==E.offsetHeight,g.removeChild(E)):/^(search|tel)$/.test(o)||(r=/^(url|email)$/.test(o)?E.checkValidity&&E.checkValidity()===!1:E.value!=x)),P[e[i]]=!!r;return P}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d,f,m="2.8.3",p={},h=!0,g=t.documentElement,v="modernizr",y=t.createElement(v),b=y.style,E=t.createElement("input"),x=":)",w={}.toString,S=" -webkit- -moz- -o- -ms- ".split(" "),C="Webkit Moz O ms",k=C.split(" "),T=C.toLowerCase().split(" "),N={svg:"http://www.w3.org/2000/svg"},M={},P={},j={},$=[],D=$.slice,F=function(e,n,r,o){var a,i,c,s,u=t.createElement("div"),l=t.body,d=l||t.createElement("body");if(parseInt(r,10))for(;r--;)c=t.createElement("div"),c.id=o?o[r]:v+(r+1),u.appendChild(c);return a=["­",'<style id="s',v,'">',e,"</style>"].join(""),u.id=v,(l?u:d).innerHTML+=a,d.appendChild(u),l||(d.style.background="",d.style.overflow="hidden",s=g.style.overflow,g.style.overflow="hidden",g.appendChild(d)),i=n(u,e),l?u.parentNode.removeChild(u):(d.parentNode.removeChild(d),g.style.overflow=s),!!i},z=function(t){var n=e.matchMedia||e.msMatchMedia;if(n)return n(t)&&n(t).matches||!1;var r;return F("@media "+t+" { #"+v+" { position: absolute; } }",function(t){r="absolute"==(e.getComputedStyle?getComputedStyle(t,null):t.currentStyle).position}),r},A=function(){function e(e,o){o=o||t.createElement(r[e]||"div"),e="on"+e;var i=e in o;return i||(o.setAttribute||(o=t.createElement("div")),o.setAttribute&&o.removeAttribute&&(o.setAttribute(e,""),i=a(o[e],"function"),a(o[e],"undefined")||(o[e]=n),o.removeAttribute(e))),o=null,i}var r={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return e}(),L={}.hasOwnProperty;f=a(L,"undefined")||a(L.call,"undefined")?function(e,t){return t in e&&a(e.constructor.prototype[t],"undefined")}:function(e,t){return L.call(e,t)},Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError;var n=D.call(arguments,1),r=function(){if(this instanceof r){var o=function(){};o.prototype=t.prototype;var a=new o,i=t.apply(a,n.concat(D.call(arguments)));return Object(i)===i?i:a}return t.apply(e,n.concat(D.call(arguments)))};return r}),M.flexbox=function(){return u("flexWrap")},M.flexboxlegacy=function(){return u("boxDirection")},M.canvas=function(){var e=t.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))},M.canvastext=function(){return!(!p.canvas||!a(t.createElement("canvas").getContext("2d").fillText,"function"))},M.webgl=function(){return!!e.WebGLRenderingContext},M.touch=function(){var n;return"ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch?n=!0:F(["@media (",S.join("touch-enabled),("),v,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(e){n=9===e.offsetTop}),n},M.geolocation=function(){return"geolocation"in navigator},M.postmessage=function(){return!!e.postMessage},M.websqldatabase=function(){return!!e.openDatabase},M.indexedDB=function(){return!!u("indexedDB",e)},M.hashchange=function(){return A("hashchange",e)&&(t.documentMode===n||t.documentMode>7)},M.history=function(){return!(!e.history||!history.pushState)},M.draganddrop=function(){var e=t.createElement("div");return"draggable"in e||"ondragstart"in e&&"ondrop"in e},M.websockets=function(){return"WebSocket"in e||"MozWebSocket"in e},M.rgba=function(){return r("background-color:rgba(150,255,150,.5)"),i(b.backgroundColor,"rgba")},M.hsla=function(){return r("background-color:hsla(120,40%,100%,.5)"),i(b.backgroundColor,"rgba")||i(b.backgroundColor,"hsla")},M.multiplebgs=function(){return r("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(b.background)},M.backgroundsize=function(){return u("backgroundSize")},M.borderimage=function(){return u("borderImage")},M.borderradius=function(){return u("borderRadius")},M.boxshadow=function(){return u("boxShadow")},M.textshadow=function(){return""===t.createElement("div").style.textShadow},M.opacity=function(){return o("opacity:.55"),/^0.55$/.test(b.opacity)},M.cssanimations=function(){return u("animationName")},M.csscolumns=function(){return u("columnCount")},M.cssgradients=function(){var e="background-image:",t="gradient(linear,left top,right bottom,from(#9f9),to(white));",n="linear-gradient(left top,#9f9, white);";return r((e+"-webkit- ".split(" ").join(t+e)+S.join(n+e)).slice(0,-e.length)),i(b.backgroundImage,"gradient")},M.cssreflections=function(){return u("boxReflect")},M.csstransforms=function(){return!!u("transform")},M.csstransforms3d=function(){var e=!!u("perspective");return e&&"webkitPerspective"in g.style&&F("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(t){e=9===t.offsetLeft&&3===t.offsetHeight}),e},M.csstransitions=function(){return u("transition")},M.fontface=function(){var e;return F('@font-face {font-family:"font";src:url("https://")}',function(n,r){var o=t.getElementById("smodernizr"),a=o.sheet||o.styleSheet,i=a?a.cssRules&&a.cssRules[0]?a.cssRules[0].cssText:a.cssText||"":"";e=/src/i.test(i)&&0===i.indexOf(r.split(" ")[0])}),e},M.generatedcontent=function(){var e;return F(["#",v,"{font:0/0 a}#",v,':after{content:"',x,'";visibility:hidden;font:3px/1 a}'].join(""),function(t){e=t.offsetHeight>=3}),e},M.video=function(){var e=t.createElement("video"),n=!1;try{(n=!!e.canPlayType)&&(n=new Boolean(n),n.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),n.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),n.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(r){}return n},M.audio=function(){var e=t.createElement("audio"),n=!1;try{(n=!!e.canPlayType)&&(n=new Boolean(n),n.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),n.mp3=e.canPlayType("audio/mpeg;").replace(/^no$/,""),n.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),n.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(r){}return n},M.localstorage=function(){try{return localStorage.setItem(v,v),localStorage.removeItem(v),!0}catch(e){return!1}},M.sessionstorage=function(){try{return sessionStorage.setItem(v,v),sessionStorage.removeItem(v),!0}catch(e){return!1}},M.webworkers=function(){return!!e.Worker},M.applicationcache=function(){return!!e.applicationCache},M.svg=function(){return!!t.createElementNS&&!!t.createElementNS(N.svg,"svg").createSVGRect},M.inlinesvg=function(){var e=t.createElement("div");return e.innerHTML="<svg/>",(e.firstChild&&e.firstChild.namespaceURI)==N.svg},M.smil=function(){return!!t.createElementNS&&/SVGAnimate/.test(w.call(t.createElementNS(N.svg,"animate")))},M.svgclippaths=function(){return!!t.createElementNS&&/SVGClipPath/.test(w.call(t.createElementNS(N.svg,"clipPath")))};for(var H in M)f(M,H)&&(d=H.toLowerCase(),p[d]=M[H](),$.push((p[d]?"":"no-")+d));return p.input||l(),p.addTest=function(e,t){if("object"==typeof e)for(var r in e)f(e,r)&&p.addTest(r,e[r]);else{if(e=e.toLowerCase(),p[e]!==n)return p;t="function"==typeof t?t():t,"undefined"!=typeof h&&h&&(g.className+=" "+(t?"":"no-")+e),p[e]=t}return p},r(""),y=E=null,function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=y.elements;return"string"==typeof e?e.split(" "):e}function o(e){var t=v[e[h]];return t||(t={},g++,e[h]=g,v[g]=t),t}function a(e,n,r){if(n||(n=t),l)return n.createElement(e);r||(r=o(n));var a;return a=r.cache[e]?r.cache[e].cloneNode():p.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!a.canHaveChildren||m.test(e)||a.tagUrn?a:r.frag.appendChild(a)}function i(e,n){if(e||(e=t),l)return e.createDocumentFragment();n=n||o(e);for(var a=n.frag.cloneNode(),i=0,c=r(),s=c.length;s>i;i++)a.createElement(c[i]);return a}function c(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return y.shivMethods?a(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(y,t.frag)}function s(e){e||(e=t);var r=o(e);return!y.shivCSS||u||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||c(e,r),e}var u,l,d="3.7.0",f=e.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,h="_html5shiv",g=0,v={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",u="hidden"in e,l=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){u=!0,l=!0}}();var y={elements:f.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:d,shivCSS:f.shivCSS!==!1,supportsUnknownElements:l,shivMethods:f.shivMethods!==!1,type:"default",shivDocument:s,createElement:a,createDocumentFragment:i};e.html5=y,s(t)}(this,t),p._version=m,p._prefixes=S,p._domPrefixes=T,p._cssomPrefixes=k,p.mq=z,p.hasEvent=A,p.testProp=function(e){return c([e])},p.testAllProps=u,p.testStyles=F,p.prefixed=function(e,t,n){return t?u(e,t,n):u(e,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(h?" js "+$.join(" "):""),p}(this,this.document);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! pace 1.0.2 */
|
2
|
+
(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X=[].slice,Y={}.hasOwnProperty,Z=function(a,b){function c(){this.constructor=a}for(var d in b)Y.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},$=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};for(u={catchupTime:100,initialRate:.03,minTime:250,ghostTime:100,maxProgressPerFrame:20,easeFactor:1.25,startOnPageLoad:!0,restartOnPushState:!0,restartOnRequestAfter:500,target:"body",elements:{checkInterval:100,selectors:["body"]},eventLag:{minSamples:10,sampleCount:3,lagThreshold:3},ajax:{trackMethods:["GET"],trackWebSockets:!0,ignoreURLs:[]}},C=function(){var a;return null!=(a="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?a:+new Date},E=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,t=window.cancelAnimationFrame||window.mozCancelAnimationFrame,null==E&&(E=function(a){return setTimeout(a,50)},t=function(a){return clearTimeout(a)}),G=function(a){var b,c;return b=C(),(c=function(){var d;return d=C()-b,d>=33?(b=C(),a(d,function(){return E(c)})):setTimeout(c,33-d)})()},F=function(){var a,b,c;return c=arguments[0],b=arguments[1],a=3<=arguments.length?X.call(arguments,2):[],"function"==typeof c[b]?c[b].apply(c,a):c[b]},v=function(){var a,b,c,d,e,f,g;for(b=arguments[0],d=2<=arguments.length?X.call(arguments,1):[],f=0,g=d.length;g>f;f++)if(c=d[f])for(a in c)Y.call(c,a)&&(e=c[a],null!=b[a]&&"object"==typeof b[a]&&null!=e&&"object"==typeof e?v(b[a],e):b[a]=e);return b},q=function(a){var b,c,d,e,f;for(c=b=0,e=0,f=a.length;f>e;e++)d=a[e],c+=Math.abs(d),b++;return c/b},x=function(a,b){var c,d,e;if(null==a&&(a="options"),null==b&&(b=!0),e=document.querySelector("[data-pace-"+a+"]")){if(c=e.getAttribute("data-pace-"+a),!b)return c;try{return JSON.parse(c)}catch(f){return d=f,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",d):void 0}}},g=function(){function a(){}return a.prototype.on=function(a,b,c,d){var e;return null==d&&(d=!1),null==this.bindings&&(this.bindings={}),null==(e=this.bindings)[a]&&(e[a]=[]),this.bindings[a].push({handler:b,ctx:c,once:d})},a.prototype.once=function(a,b,c){return this.on(a,b,c,!0)},a.prototype.off=function(a,b){var c,d,e;if(null!=(null!=(d=this.bindings)?d[a]:void 0)){if(null==b)return delete this.bindings[a];for(c=0,e=[];c<this.bindings[a].length;)e.push(this.bindings[a][c].handler===b?this.bindings[a].splice(c,1):c++);return e}},a.prototype.trigger=function(){var a,b,c,d,e,f,g,h,i;if(c=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],null!=(g=this.bindings)?g[c]:void 0){for(e=0,i=[];e<this.bindings[c].length;)h=this.bindings[c][e],d=h.handler,b=h.ctx,f=h.once,d.apply(null!=b?b:this,a),i.push(f?this.bindings[c].splice(e,1):e++);return i}},a}(),j=window.Pace||{},window.Pace=j,v(j,g.prototype),D=j.options=v({},u,window.paceOptions,x()),U=["ajax","document","eventLag","elements"],Q=0,S=U.length;S>Q;Q++)K=U[Q],D[K]===!0&&(D[K]=u[K]);i=function(a){function b(){return V=b.__super__.constructor.apply(this,arguments)}return Z(b,a),b}(Error),b=function(){function a(){this.progress=0}return a.prototype.getElement=function(){var a;if(null==this.el){if(a=document.querySelector(D.target),!a)throw new i;this.el=document.createElement("div"),this.el.className="pace pace-active",document.body.className=document.body.className.replace(/pace-done/g,""),document.body.className+=" pace-running",this.el.innerHTML='<div class="pace-progress">\n <div class="pace-progress-inner"></div>\n</div>\n<div class="pace-activity"></div>',null!=a.firstChild?a.insertBefore(this.el,a.firstChild):a.appendChild(this.el)}return this.el},a.prototype.finish=function(){var a;return a=this.getElement(),a.className=a.className.replace("pace-active",""),a.className+=" pace-inactive",document.body.className=document.body.className.replace("pace-running",""),document.body.className+=" pace-done"},a.prototype.update=function(a){return this.progress=a,this.render()},a.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(a){i=a}return this.el=void 0},a.prototype.render=function(){var a,b,c,d,e,f,g;if(null==document.querySelector(D.target))return!1;for(a=this.getElement(),d="translate3d("+this.progress+"%, 0, 0)",g=["webkitTransform","msTransform","transform"],e=0,f=g.length;f>e;e++)b=g[e],a.children[0].style[b]=d;return(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(a.children[0].setAttribute("data-progress-text",""+(0|this.progress)+"%"),this.progress>=100?c="99":(c=this.progress<10?"0":"",c+=0|this.progress),a.children[0].setAttribute("data-progress",""+c)),this.lastRenderedProgress=this.progress},a.prototype.done=function(){return this.progress>=100},a}(),h=function(){function a(){this.bindings={}}return a.prototype.trigger=function(a,b){var c,d,e,f,g;if(null!=this.bindings[a]){for(f=this.bindings[a],g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.call(this,b));return g}},a.prototype.on=function(a,b){var c;return null==(c=this.bindings)[a]&&(c[a]=[]),this.bindings[a].push(b)},a}(),P=window.XMLHttpRequest,O=window.XDomainRequest,N=window.WebSocket,w=function(a,b){var c,d,e;e=[];for(d in b.prototype)try{e.push(null==a[d]&&"function"!=typeof b[d]?"function"==typeof Object.defineProperty?Object.defineProperty(a,d,{get:function(){return b.prototype[d]},configurable:!0,enumerable:!0}):a[d]=b.prototype[d]:void 0)}catch(f){c=f}return e},A=[],j.ignore=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],A.unshift("ignore"),c=b.apply(null,a),A.shift(),c},j.track=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],A.unshift("track"),c=b.apply(null,a),A.shift(),c},J=function(a){var b;if(null==a&&(a="GET"),"track"===A[0])return"force";if(!A.length&&D.ajax){if("socket"===a&&D.ajax.trackWebSockets)return!0;if(b=a.toUpperCase(),$.call(D.ajax.trackMethods,b)>=0)return!0}return!1},k=function(a){function b(){var a,c=this;b.__super__.constructor.apply(this,arguments),a=function(a){var b;return b=a.open,a.open=function(d,e){return J(d)&&c.trigger("request",{type:d,url:e,request:a}),b.apply(a,arguments)}},window.XMLHttpRequest=function(b){var c;return c=new P(b),a(c),c};try{w(window.XMLHttpRequest,P)}catch(d){}if(null!=O){window.XDomainRequest=function(){var b;return b=new O,a(b),b};try{w(window.XDomainRequest,O)}catch(d){}}if(null!=N&&D.ajax.trackWebSockets){window.WebSocket=function(a,b){var d;return d=null!=b?new N(a,b):new N(a),J("socket")&&c.trigger("request",{type:"socket",url:a,protocols:b,request:d}),d};try{w(window.WebSocket,N)}catch(d){}}}return Z(b,a),b}(h),R=null,y=function(){return null==R&&(R=new k),R},I=function(a){var b,c,d,e;for(e=D.ajax.ignoreURLs,c=0,d=e.length;d>c;c++)if(b=e[c],"string"==typeof b){if(-1!==a.indexOf(b))return!0}else if(b.test(a))return!0;return!1},y().on("request",function(b){var c,d,e,f,g;return f=b.type,e=b.request,g=b.url,I(g)?void 0:j.running||D.restartOnRequestAfter===!1&&"force"!==J(f)?void 0:(d=arguments,c=D.restartOnRequestAfter||0,"boolean"==typeof c&&(c=0),setTimeout(function(){var b,c,g,h,i,k;if(b="socket"===f?e.readyState<2:0<(h=e.readyState)&&4>h){for(j.restart(),i=j.sources,k=[],c=0,g=i.length;g>c;c++){if(K=i[c],K instanceof a){K.watch.apply(K,d);break}k.push(void 0)}return k}},c))}),a=function(){function a(){var a=this;this.elements=[],y().on("request",function(){return a.watch.apply(a,arguments)})}return a.prototype.watch=function(a){var b,c,d,e;return d=a.type,b=a.request,e=a.url,I(e)?void 0:(c="socket"===d?new n(b):new o(b),this.elements.push(c))},a}(),o=function(){function a(a){var b,c,d,e,f,g,h=this;if(this.progress=0,null!=window.ProgressEvent)for(c=null,a.addEventListener("progress",function(a){return h.progress=a.lengthComputable?100*a.loaded/a.total:h.progress+(100-h.progress)/2},!1),g=["load","abort","timeout","error"],d=0,e=g.length;e>d;d++)b=g[d],a.addEventListener(b,function(){return h.progress=100},!1);else f=a.onreadystatechange,a.onreadystatechange=function(){var b;return 0===(b=a.readyState)||4===b?h.progress=100:3===a.readyState&&(h.progress=50),"function"==typeof f?f.apply(null,arguments):void 0}}return a}(),n=function(){function a(a){var b,c,d,e,f=this;for(this.progress=0,e=["error","open"],c=0,d=e.length;d>c;c++)b=e[c],a.addEventListener(b,function(){return f.progress=100},!1)}return a}(),d=function(){function a(a){var b,c,d,f;for(null==a&&(a={}),this.elements=[],null==a.selectors&&(a.selectors=[]),f=a.selectors,c=0,d=f.length;d>c;c++)b=f[c],this.elements.push(new e(b))}return a}(),e=function(){function a(a){this.selector=a,this.progress=0,this.check()}return a.prototype.check=function(){var a=this;return document.querySelector(this.selector)?this.done():setTimeout(function(){return a.check()},D.elements.checkInterval)},a.prototype.done=function(){return this.progress=100},a}(),c=function(){function a(){var a,b,c=this;this.progress=null!=(b=this.states[document.readyState])?b:100,a=document.onreadystatechange,document.onreadystatechange=function(){return null!=c.states[document.readyState]&&(c.progress=c.states[document.readyState]),"function"==typeof a?a.apply(null,arguments):void 0}}return a.prototype.states={loading:0,interactive:50,complete:100},a}(),f=function(){function a(){var a,b,c,d,e,f=this;this.progress=0,a=0,e=[],d=0,c=C(),b=setInterval(function(){var g;return g=C()-c-50,c=C(),e.push(g),e.length>D.eventLag.sampleCount&&e.shift(),a=q(e),++d>=D.eventLag.minSamples&&a<D.eventLag.lagThreshold?(f.progress=100,clearInterval(b)):f.progress=100*(3/(a+3))},50)}return a}(),m=function(){function a(a){this.source=a,this.last=this.sinceLastUpdate=0,this.rate=D.initialRate,this.catchup=0,this.progress=this.lastProgress=0,null!=this.source&&(this.progress=F(this.source,"progress"))}return a.prototype.tick=function(a,b){var c;return null==b&&(b=F(this.source,"progress")),b>=100&&(this.done=!0),b===this.last?this.sinceLastUpdate+=a:(this.sinceLastUpdate&&(this.rate=(b-this.last)/this.sinceLastUpdate),this.catchup=(b-this.progress)/D.catchupTime,this.sinceLastUpdate=0,this.last=b),b>this.progress&&(this.progress+=this.catchup*a),c=1-Math.pow(this.progress/100,D.easeFactor),this.progress+=c*this.rate*a,this.progress=Math.min(this.lastProgress+D.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},a}(),L=null,H=null,r=null,M=null,p=null,s=null,j.running=!1,z=function(){return D.restartOnPushState?j.restart():void 0},null!=window.history.pushState&&(T=window.history.pushState,window.history.pushState=function(){return z(),T.apply(window.history,arguments)}),null!=window.history.replaceState&&(W=window.history.replaceState,window.history.replaceState=function(){return z(),W.apply(window.history,arguments)}),l={ajax:a,elements:d,document:c,eventLag:f},(B=function(){var a,c,d,e,f,g,h,i;for(j.sources=L=[],g=["ajax","elements","document","eventLag"],c=0,e=g.length;e>c;c++)a=g[c],D[a]!==!1&&L.push(new l[a](D[a]));for(i=null!=(h=D.extraSources)?h:[],d=0,f=i.length;f>d;d++)K=i[d],L.push(new K(D));return j.bar=r=new b,H=[],M=new m})(),j.stop=function(){return j.trigger("stop"),j.running=!1,r.destroy(),s=!0,null!=p&&("function"==typeof t&&t(p),p=null),B()},j.restart=function(){return j.trigger("restart"),j.stop(),j.start()},j.go=function(){var a;return j.running=!0,r.render(),a=C(),s=!1,p=G(function(b,c){var d,e,f,g,h,i,k,l,n,o,p,q,t,u,v,w;for(l=100-r.progress,e=p=0,f=!0,i=q=0,u=L.length;u>q;i=++q)for(K=L[i],o=null!=H[i]?H[i]:H[i]=[],h=null!=(w=K.elements)?w:[K],k=t=0,v=h.length;v>t;k=++t)g=h[k],n=null!=o[k]?o[k]:o[k]=new m(g),f&=n.done,n.done||(e++,p+=n.tick(b));return d=p/e,r.update(M.tick(b,d)),r.done()||f||s?(r.update(100),j.trigger("done"),setTimeout(function(){return r.finish(),j.running=!1,j.trigger("hide")},Math.max(D.ghostTime,Math.max(D.minTime-(C()-a),0)))):c()})},j.start=function(a){v(D,a),j.running=!0;try{r.render()}catch(b){i=b}return document.querySelector(".pace")?(j.trigger("start"),j.go()):setTimeout(j.start,50)},"function"==typeof define&&define.amd?define(["pace"],function(){return j}):"object"==typeof exports?module.exports=j:D.startOnPageLoad&&j.start()}).call(this);
|