furatto 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: abec881858edd0b161700f9d960fe1f3890422a4
4
- data.tar.gz: c470ec6a3c53bd91972f8767a40602410916e7f3
3
+ metadata.gz: 9dccb424e7cea73f9ba0283b1e4834ba04b56108
4
+ data.tar.gz: d9436b5b5d5e823b47b7df52024db5504afa20b3
5
5
  SHA512:
6
- metadata.gz: e77f4bbfc2553842d8d48c374f08c98efc633a8f222ca611bc06fae169624dcab01ea0abb407643ffe53a98ffaba57d4cc034cd01f1efbe33907b9b10bcb47e4
7
- data.tar.gz: a2f7123bfced99bd436f34c8bc0dbc23b179ee5e057ea99a60959259f80cbce2135ee9780466ab29c804a3b37362c276c02654277f02d7095353e2e5f143da52
6
+ metadata.gz: 8d861737fb86bc31226908c54f422902cea42511051416d9083806b33844342d7b8ae4da0f04faa1ff22a0ea14b768e87db66b11987a3155a10f839259d44511
7
+ data.tar.gz: 1f163a156d6f2a6da2016dd0bcc3f506d0330b0cf04e8e008fbc6a569b03b4bb7cf87c95a0a687118fcc9d4c2f7caf52cd1e9ec1486de94c1aab442381ba64bd
@@ -1,3 +1,3 @@
1
1
  module Furatto
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -1,1822 +1,9 @@
1
- /*!
2
- * Furatto v3.0.0 (http://icalialabs.github.io/furatto/)
3
- * Copyright 2014-2014 Icalia Labs
4
- * Licensed under MIT (https://github.com/IcaliaLabs/furatto/blob/master/LICENSE)
5
- */
6
-
7
- /*!
8
- * Furatto v3.0.0 (http://icalialabs.github.io/furatto/)
9
- * Copyright 2014-2014 Icalia Labs
10
- * Licensed under MIT (https://github.com/IcaliaLabs/furatto/blob/master/LICENSE)
11
- */
12
- window.Furatto = {
13
- name: 'Furatto',
14
- version: '1.0.0'
15
- };
16
-
17
- $('.alert .close').each(function() {
18
- return $(this).click(function(e) {
19
- e.preventDefault();
20
- return $(this).parent().fadeOut();
21
- });
22
- });
23
-
24
- var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
25
-
26
- (function($, window) {
27
- Furatto.Modal = (function() {
28
- function Modal(el, options) {
29
- this.hideOnDocumentClick = __bind(this.hideOnDocumentClick, this);
30
- this.hideOnEsc = __bind(this.hideOnEsc, this);
31
- this.show = __bind(this.show, this);
32
- this.init = __bind(this.init, this);
33
- this.options = $.extend({}, options);
34
- this.$el = $(el);
35
- this.modal = $(this.$el.data('target'));
36
- this.close = this.modal.find('.modal-close');
37
- this.transition = this.$el.data('transition') || "1";
38
- this.theme = this.$el.data('theme') || "default";
39
- this.modal.addClass("modal-effect-" + this.transition);
40
- this.modal.addClass("" + this.theme);
41
- }
42
-
43
- Modal.prototype.init = function() {
44
- var _this = this;
45
- this.$el.click(this.show);
46
- return this.close.click(function(ev) {
47
- ev.stopPropagation();
48
- return _this.hide();
49
- });
50
- };
51
-
52
- Modal.prototype.show = function(ev) {
53
- if (this.$el.is('div')) {
54
- this.$el.addClass('modal-show');
55
- } else {
56
- this.modal.addClass('modal-show');
57
- }
58
- $('.modal-overlay').addClass('modal-show-overlay');
59
- $('body').bind('keyup', this.hideOnEsc);
60
- return $('body').bind('click', this.hideOnDocumentClick);
61
- };
62
-
63
- Modal.prototype.hideOnEsc = function(event) {
64
- if (event.keyCode === 27) {
65
- return this.hide();
66
- }
67
- };
68
-
69
- Modal.prototype.hideOnDocumentClick = function(event) {
70
- if ($(event.target).is('.modal-overlay')) {
71
- return this.hide();
72
- }
73
- };
74
-
75
- Modal.prototype.hide = function() {
76
- $('.modal-overlay').removeClass('modal-show-overlay');
77
- if (this.$el.is('div')) {
78
- this.$el.removeClass('modal-show');
79
- } else {
80
- this.modal.removeClass('modal-show');
81
- }
82
- $('body').unbind('keyup', this.hideOnEsc);
83
- return $('body').unbind('click', this.hideOnDocumentClick);
84
- };
85
-
86
- return Modal;
87
-
88
- })();
89
- $.fn.modal = function(option) {
90
- return this.each(function() {
91
- var $this, data, options;
92
- $this = $(this);
93
- data = $this.data('modal');
94
- options = $.extend({}, $this.data(), typeof option === 'object' && option);
95
- if (!data) {
96
- $this.data('modal', (data = new Furatto.Modal(this, options)));
97
- }
98
- if (typeof option === 'string') {
99
- return data[option]();
100
- }
101
- });
102
- };
103
- Furatto.Modal.version = "1.0.0";
104
- $(document).ready(function() {
105
- var elementToAppend;
106
- if ($('.off-screen').length > 0) {
107
- elementToAppend = $('.off-screen');
108
- } else {
109
- elementToAppend = $('body');
110
- }
111
- elementToAppend.append('<div class="modal-overlay"></div>');
112
- return $('[data-furatto="modal"]').each(function() {
113
- var modal;
114
- modal = $(this);
115
- return modal.modal('init');
116
- });
117
- });
118
- return $(document).on('click', '[data-furatto="modal"]', function(e) {
119
- var $this;
120
- $this = $(this);
121
- return $this.modal('init');
122
- });
123
- })(window.jQuery, window);
124
-
125
- var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
126
- __slice = [].slice;
127
-
128
- (function($, window, document) {
129
- "use strict";
130
- var pluginName;
131
- pluginName = 'responsiveNavBar';
132
- Furatto.ResponsiveNavBar = (function() {
133
- function ResponsiveNavBar(el, a, options) {
134
- this.el = el;
135
- this.closeNavbar = __bind(this.closeNavbar, this);
136
- this.openNavbar = __bind(this.openNavbar, this);
137
- this.toggleNavbar = __bind(this.toggleNavbar, this);
138
- this._initEvents = __bind(this._initEvents, this);
139
- this.navbarElements = $('.navigation-bar ul:not(.brand-section)');
140
- this.$el = $(this.el);
141
- this._initEvents();
142
- }
143
-
144
- ResponsiveNavBar.prototype._initEvents = function() {
145
- var _this = this;
146
- return $('.navigation-bar .menu-toggle').on('touchstart click', function(e) {
147
- e.preventDefault();
148
- return _this.toggleNavbar();
149
- });
150
- };
151
-
152
- ResponsiveNavBar.prototype.toggleNavbar = function() {
153
- return this.$el.toggleClass('opened');
154
- };
155
-
156
- ResponsiveNavBar.prototype.openNavbar = function() {
157
- return this.$el.addClass('opened');
158
- };
159
-
160
- ResponsiveNavBar.prototype.closeNavbar = function() {
161
- return this.$el.removeClass('opened');
162
- };
163
-
164
- return ResponsiveNavBar;
165
-
166
- })();
167
- $.fn[pluginName] = function(a, options) {
168
- var args, _;
169
- _ = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
170
- return this.each(function() {
171
- var plugin;
172
- plugin = $.data(this, "plugin_" + pluginName);
173
- if (!plugin) {
174
- return $.data(this, "plugin_" + pluginName, new Furatto.ResponsiveNavBar(this, a, options));
175
- } else if ((plugin[_] != null) && $.type(plugin[_]) === 'function') {
176
- return plugin[_].apply(plugin, args);
177
- }
178
- });
179
- };
180
- $('.navigation-bar').responsiveNavBar();
181
- return Furatto.ResponsiveNavBar.version = "1.0.0";
182
- })(jQuery, window, document);
183
-
184
- var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
185
- __slice = [].slice;
186
-
187
- (function($, window, document) {
188
- "use strict";
189
- var closest, defaults, getLevelDepth, hasParent, isFromMobile, pluginName;
190
- pluginName = 'offScreen';
191
- defaults = {
192
- type: 'overlap',
193
- levelSpacing: 40,
194
- backClass: 'navigation-back'
195
- };
196
- getLevelDepth = function(level, id, waypoint, cnt) {
197
- if (cnt == null) {
198
- cnt = 0;
199
- }
200
- if (level.id.indexOf(id) >= 0) {
201
- return cnt;
202
- }
203
- if ($(level).hasClass(waypoint)) {
204
- ++cnt;
205
- }
206
- return level.parentNode && getLevelDepth(level.parentNode, id, waypoint, cnt);
207
- };
208
- hasParent = function(e, id) {
209
- var el;
210
- if (!e) {
211
- return false;
212
- }
213
- el = e.target || e.srcElement || e || false;
214
- while (el && el.id !== id) {
215
- el = el.parentNode || false;
216
- }
217
- return el !== false;
218
- };
219
- closest = function(e, classname) {
220
- if ($(e).hasClass(classname)) {
221
- return e;
222
- }
223
- return e.parentNode && closest(e.parentNode, classname);
224
- };
225
- isFromMobile = function() {
226
- var check;
227
- check = false;
228
- (function(a) {
229
- if (/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) {
230
- return check = true;
231
- }
232
- })(navigator.userAgent || navigator.vendor || window.opera);
233
- return check;
234
- };
235
- Furatto.OffScreen = (function() {
236
- function OffScreen(el, a, options) {
237
- this.el = el;
238
- this.openMenu = __bind(this.openMenu, this);
239
- this._closeMenu = __bind(this._closeMenu, this);
240
- this.resetMenu = __bind(this.resetMenu, this);
241
- this._setupLevelBack = __bind(this._setupLevelBack, this);
242
- this._setupLevelsClosing = __bind(this._setupLevelsClosing, this);
243
- this._hideOnEsc = __bind(this._hideOnEsc, this);
244
- this._setupMenuItems = __bind(this._setupMenuItems, this);
245
- this._bindEvents = __bind(this._bindEvents, this);
246
- this._shouldPreventOffScreenMenuFromOpening = __bind(this._shouldPreventOffScreenMenuFromOpening, this);
247
- this.options = $.extend({}, defaults, options);
248
- this.open = false;
249
- this.level = 0;
250
- this.wrapper = document.getElementById('off-screen');
251
- this.levels = Array.prototype.slice.call(this.el.querySelectorAll('div.off-screen-level'));
252
- this._setLevels();
253
- this.menuItems = Array.prototype.slice.call(this.el.querySelectorAll('li'));
254
- this.levelBack = Array.prototype.slice.call(this.el.querySelectorAll('.navigation-back'));
255
- this.eventType = isFromMobile() ? 'touchstart' : 'click';
256
- $(this.el).addClass("off-screen-" + this.options.type);
257
- this.trigger = $('#trigger');
258
- this._bindEvents();
259
- this._shouldPreventOffScreenMenuFromOpening();
260
- }
261
-
262
- OffScreen.prototype._setLevels = function() {
263
- var level, _i, _len, _ref, _results;
264
- _ref = this.levels;
265
- _results = [];
266
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
267
- level = _ref[_i];
268
- _results.push(level.setAttribute('data-level', getLevelDepth(level, this.el.id, 'off-screen-level')));
269
- }
270
- return _results;
271
- };
272
-
273
- OffScreen.prototype._shouldPreventOffScreenMenuFromOpening = function() {
274
- var _this = this;
275
- if ($(window).width() > 768) {
276
- this.trigger.unbind(this.eventType);
277
- }
278
- return $(window).resize(function() {
279
- if ($(window).width() > 768) {
280
- return _this.trigger.unbind(_this.eventType, _this.resetMenu);
281
- } else {
282
- return _this.trigger.bind(_this.eventType, function(event) {
283
- event.stopPropagation();
284
- event.preventDefault();
285
- if (_this.open) {
286
- return _this.resetMenu();
287
- } else {
288
- _this.openMenu();
289
- return document.addEventListener(_this.eventType, function(event) {
290
- if (_this.open && !hasParent(event.target, _this.el.id)) {
291
- return bodyClickBinding(document);
292
- }
293
- });
294
- }
295
- });
296
- }
297
- });
298
- };
299
-
300
- OffScreen.prototype._bindEvents = function() {
301
- var bodyClickBinding,
302
- _this = this;
303
- bodyClickBinding = function(el) {
304
- _this.resetMenu();
305
- return el.removeEventListener(_this.eventType, bodyClickBinding);
306
- };
307
- this.trigger.bind(this.eventType, function(event) {
308
- event.stopPropagation();
309
- event.preventDefault();
310
- if (_this.open) {
311
- return _this.resetMenu();
312
- } else {
313
- _this.openMenu();
314
- return document.addEventListener(_this.eventType, function(event) {
315
- if (_this.open && !hasParent(event.target, _this.el.id)) {
316
- return bodyClickBinding(document);
317
- }
318
- });
319
- }
320
- });
321
- this._setupMenuItems();
322
- this._setupLevelsClosing();
323
- return this._setupLevelBack();
324
- };
325
-
326
- OffScreen.prototype._setupMenuItems = function() {
327
- var _this = this;
328
- return this.menuItems.forEach(function(el, i) {
329
- var subLevel;
330
- subLevel = el.querySelector('div.off-screen-level');
331
- if (subLevel) {
332
- return el.querySelector('a').addEventListener(_this.eventType, function(event) {
333
- var level;
334
- event.preventDefault();
335
- level = closest(el, 'off-screen-level').getAttribute('data-level');
336
- if (_this.level <= level) {
337
- event.stopPropagation();
338
- $(closest(el, 'off-screen-level')).addClass('off-screen-level-overlay');
339
- return _this.openMenu(subLevel);
340
- }
341
- });
342
- }
343
- });
344
- };
345
-
346
- OffScreen.prototype._hideOnEsc = function(event) {
347
- if (event.keyCode === 27) {
348
- return this.resetMenu();
349
- }
350
- };
351
-
352
- OffScreen.prototype._setupLevelsClosing = function() {
353
- var levelEl, _i, _len, _ref, _results;
354
- _ref = this.levels;
355
- _results = [];
356
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
357
- levelEl = _ref[_i];
358
- _results.push(levelEl.addEventListener(this.eventType, function(event) {
359
- var level;
360
- event.stopPropagation();
361
- level = levelEl.getAttribute('data-level');
362
- if (this.level > level) {
363
- this.level = level;
364
- return this._closeMenu();
365
- }
366
- }));
367
- }
368
- return _results;
369
- };
370
-
371
- OffScreen.prototype._setupLevelBack = function() {
372
- var _this = this;
373
- return this.levelBack.forEach(function(el, i) {
374
- return el.addEventListener(_this.eventType, function(event) {
375
- var level;
376
- event.preventDefault();
377
- level = closest(el, 'off-screen-level').getAttribute('data-level');
378
- if (_this.level <= level) {
379
- event.stopPropagation();
380
- _this.level = closest(el, 'off-screen-level').getAttribute('data-level') - 1;
381
- if (_this.level === 0) {
382
- return _this.resetMenu();
383
- } else {
384
- return _this._closeMenu();
385
- }
386
- }
387
- });
388
- });
389
- };
390
-
391
- OffScreen.prototype.resetMenu = function() {
392
- this._setTransform('translate3d(0,0,0)');
393
- this.level = 0;
394
- $(this.wrapper).removeClass('off-screen-pushed');
395
- this._toggleLevels();
396
- this.open = false;
397
- return $(document).unbind('keyup', this._hideOnEsc);
398
- };
399
-
400
- OffScreen.prototype._closeMenu = function() {
401
- var translateVal;
402
- translateVal = this.options.type === 'overlap' ? this.el.offsetWidth + (this.level - 1) * this.options.levelSpacing : this.el.offsetWidth;
403
- this._setTransform("translate3d(" + translateVal + "px, 0, 0");
404
- return this._toggleLevels();
405
- };
406
-
407
- OffScreen.prototype.openMenu = function(subLevel) {
408
- var level, levelFactor, translateVal, _i, _len, _ref;
409
- ++this.level;
410
- levelFactor = (this.level - 1) * this.options.levelSpacing;
411
- translateVal = this.options.type === 'overlap' ? this.el.offsetWidth + levelFactor : this.el.offsetWidth;
412
- this._setTransform('translate3d(' + translateVal + 'px,0,0)');
413
- if (subLevel) {
414
- this._setTransform('', subLevel);
415
- _ref = this.levels;
416
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
417
- level = _ref[_i];
418
- if (level !== subLevel && !$(level).hasClass('off-screen-level-open')) {
419
- this._setTransform("translate3d(-100%, 0, 0) translate3d(" + (-1 * levelFactor) + "px, 0, 0)", $(level));
420
- }
421
- }
422
- }
423
- if (this.level === 1) {
424
- $(this.wrapper).addClass('off-screen-pushed');
425
- this.open = true;
426
- }
427
- if (subLevel) {
428
- $(subLevel).addClass('off-screen-level-open');
429
- } else {
430
- $(this.levels[0]).addClass('off-screen-level-open');
431
- }
432
- return $(document).bind('keyup', this._hideOnEsc);
433
- };
434
-
435
- OffScreen.prototype._toggleLevels = function() {
436
- var level, _i, _len, _ref, _results;
437
- _ref = this.levels;
438
- _results = [];
439
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
440
- level = _ref[_i];
441
- if (level.getAttribute('data-level') >= this.level + 1) {
442
- $(level).removeClass('off-screen-level-open');
443
- _results.push($(level).removeClass('off-screen-level-overlay'));
444
- } else if (Number(level.getAttribute('data-level') === this.level)) {
445
- _results.push($(level).removeClass('off-screen-level-overlay'));
446
- } else {
447
- _results.push(void 0);
448
- }
449
- }
450
- return _results;
451
- };
452
-
453
- OffScreen.prototype._setTransform = function(value, element) {
454
- if (element == null) {
455
- element = this.wrapper;
456
- }
457
- return $(element).css({
458
- '-webkit-transform': value,
459
- '-moz-transform': value,
460
- '-o-transform': value,
461
- 'transform': value
462
- });
463
- };
464
-
465
- return OffScreen;
466
-
467
- })();
468
- $.fn[pluginName] = function(a, options) {
469
- var args, _;
470
- _ = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
471
- return this.each(function() {
472
- var plugin;
473
- plugin = $.data(this, "plugin_" + pluginName);
474
- if (!plugin) {
475
- return $.data(this, "plugin_" + pluginName, new Furatto.OffScreen(this, a, options));
476
- } else if ((plugin[_] != null) && $.type(plugin[_]) === 'function') {
477
- return plugin[_].apply(plugin, args);
478
- }
479
- });
480
- };
481
- $('.off-screen-navigation').offScreen();
482
- $(document).click(function() {
483
- return $('.off-screen-navigation').offScreen('resetMenu');
484
- });
485
- return Furatto.OffScreen.version = "1.0.0";
486
- })(jQuery, window, document);
487
-
488
- var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
489
- __slice = [].slice;
490
-
491
1
  (function($, window, document) {
492
- "use strict";
493
- var defaults, pluginName;
494
- pluginName = "responsiveTables";
495
- defaults = {
496
- widthToCollapse: 768
497
- };
498
- Furatto.ResponsiveTables = (function() {
499
- function ResponsiveTables(el, a, options) {
500
- this.el = el;
501
- this._setCellHeights = __bind(this._setCellHeights, this);
502
- this._unsplitTable = __bind(this._unsplitTable, this);
503
- this._splitTable = __bind(this._splitTable, this);
504
- this._updateTables = __bind(this._updateTables, this);
505
- this._initResponsiveTables = __bind(this._initResponsiveTables, this);
506
- this.options = $.extend({}, defaults, options);
507
- this.$el = $(this.el);
508
- this.switched = false;
509
- this._initResponsiveTables();
510
- }
2
+ var Furatto;
3
+ return Furatto = (function() {
4
+ function Furatto() {}
511
5
 
512
- ResponsiveTables.prototype._initResponsiveTables = function() {
513
- var _this = this;
514
- $(window).on('load', this._updateTables);
515
- $(window).on('redraw', function() {
516
- _this.switched = false;
517
- return _this._updateTables();
518
- });
519
- return $(window).on('resize', this._updateTables);
520
- };
521
-
522
- ResponsiveTables.prototype._updateTables = function() {
523
- var _this = this;
524
- console.log(this.options.widthToCollapse);
525
- if ($(window).width() <= this.options.widthToCollapse && !this.switched) {
526
- this.switched = true;
527
- this.$el.each(function(i, element) {
528
- return _this._splitTable($(element));
529
- });
530
- return true;
531
- } else if (this.switched && $(window).width() > this.options.widthToCollapse) {
532
- this.switched = false;
533
- return this.$el.each(function(i, element) {
534
- return _this._unsplitTable($(element));
535
- });
536
- }
537
- };
538
-
539
- ResponsiveTables.prototype._splitTable = function(table) {
540
- var tableClone;
541
- table.wrap("<div class='table-wrapper' />");
542
- tableClone = table.clone();
543
- tableClone.find("td:not(:first-child), th:not(:first-child)").css("display", "none");
544
- tableClone.removeClass("responsive");
545
- table.closest(".table-wrapper").append(tableClone);
546
- tableClone.wrap("<div class='pinned' />");
547
- table.wrap("<div class='scrollable' />");
548
- return this._setCellHeights(table, tableClone);
549
- };
550
-
551
- ResponsiveTables.prototype._unsplitTable = function(table) {
552
- table.closest(".table-wrapper").find(".pinned").remove();
553
- table.unwrap();
554
- return table.unwrap();
555
- };
556
-
557
- ResponsiveTables.prototype._setCellHeights = function(table, tableClone) {
558
- var heights, tableRows, tableRowsCopy;
559
- tableRows = table.find('tr');
560
- tableRowsCopy = tableClone.find('tr');
561
- heights = [];
562
- tableRows.each(function(index) {
563
- var self, tableHeadersAndData;
564
- self = $(this);
565
- tableHeadersAndData = self.find('th, td');
566
- return tableHeadersAndData.each(function() {
567
- var height;
568
- height = $(this).outerHeight(true);
569
- heights[index] = heights[index] || 0;
570
- if (height > heights[index]) {
571
- return heights[index] = height;
572
- }
573
- });
574
- });
575
- return tableRowsCopy.each(function(index) {
576
- return $(this).height(heights[index]);
577
- });
578
- };
579
-
580
- return ResponsiveTables;
6
+ return Furatto;
581
7
 
582
8
  })();
583
- $.fn[pluginName] = function(a, options) {
584
- var args, _;
585
- _ = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
586
- return this.each(function() {
587
- var plugin;
588
- plugin = $.data(this, "plugin_" + pluginName);
589
- if (!plugin) {
590
- return $.data(this, "plugin_" + pluginName, new Furatto.ResponsiveTables(this, a, options));
591
- } else if ((plugin[_] != null) && $.type(plugin[_]) === 'function') {
592
- return plugin[_].apply(plugin, args);
593
- }
594
- });
595
- };
596
- Furatto.ResponsiveTables.version = "1.0.0";
597
- return $(document).ready(function() {
598
- return $('table.responsive').responsiveTables();
599
- });
600
9
  })($, window, document);
601
-
602
- var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
603
- __slice = [].slice;
604
-
605
- (function($, window, document) {
606
- "use strict";
607
- var defaults, pluginName;
608
- pluginName = 'suraido';
609
- defaults = {
610
- speed: 500,
611
- delay: 3000,
612
- pause: false,
613
- loop: false,
614
- enableKeys: true,
615
- enableDots: true,
616
- enableArrows: true,
617
- prev: '«',
618
- next: '»',
619
- fluid: true,
620
- starting: false,
621
- completed: false,
622
- easing: 'swing',
623
- autoplay: false,
624
- paginationClass: 'pagination',
625
- paginationItemClass: 'dot',
626
- arrowsClass: 'arrows',
627
- arrowClass: 'arrow'
628
- };
629
- Furatto.Suraido = (function() {
630
- function Suraido(el, options) {
631
- var weakSelf,
632
- _this = this;
633
- this.el = el;
634
- this.prev = __bind(this.prev, this);
635
- this.next = __bind(this.next, this);
636
- this.stop = __bind(this.stop, this);
637
- this.play = __bind(this.play, this);
638
- this.to = __bind(this.to, this);
639
- this._createArrows = __bind(this._createArrows, this);
640
- this._createPagination = __bind(this._createPagination, this);
641
- this._enableBindKeys = __bind(this._enableBindKeys, this);
642
- this._enablesFluidBehavior = __bind(this._enablesFluidBehavior, this);
643
- this._enablesAutoPlay = __bind(this._enablesAutoPlay, this);
644
- this._setsMainElement = __bind(this._setsMainElement, this);
645
- this._setsItems = __bind(this._setsItems, this);
646
- this.$el = $(this.el);
647
- this.options = $.extend({}, defaults, options);
648
- this.itemsWrapper = this.$el.find('>ul');
649
- this.maxSize = {
650
- width: this.$el.outerWidth() | 0,
651
- height: this.$el.outerHeight() | 0
652
- };
653
- weakSelf = this;
654
- this.items = $(this.itemsWrapper).find('>li').each(function(index) {
655
- var $this, height, width;
656
- $this = $(this);
657
- width = $this.outerWidth();
658
- height = $this.outerHeight();
659
- if (width > weakSelf.maxSize.width) {
660
- weakSelf.maxSize.width = width;
661
- }
662
- if (height > weakSelf.maxSize.height) {
663
- return weakSelf.maxSize.height = height;
664
- }
665
- });
666
- this.itemsLength = this.items.length;
667
- this.currentItemIndex = 0;
668
- this.items.find('.caption').css({
669
- width: "" + (100 / this.itemsLength) + "%"
670
- });
671
- this._setsMainElement();
672
- this.itemsWrapper.css({
673
- position: "relative",
674
- left: 0,
675
- width: "" + (this.itemsLength * 100) + "%"
676
- });
677
- this._setsItems();
678
- if (this.options.autoplay) {
679
- this._enablesAutoPlay();
680
- }
681
- if (this.options.enableKeys) {
682
- this._enableBindKeys();
683
- }
684
- this.options.enableDots && this._createPagination();
685
- this.options.enableArrows && this._createArrows();
686
- if (this.options.fluid) {
687
- this._enablesFluidBehavior();
688
- }
689
- if (window.chrome) {
690
- this.items.css('background-size', '100% 100%');
691
- }
692
- if ($.event.special['swipe'] || $.Event('swipe')) {
693
- this.$el.on('swipeleft swiperight swipeLeft swipeRight', function(e) {
694
- if (e.type.toLowerCase() === 'swipeleft') {
695
- return _this.next();
696
- } else {
697
- return _this.prev();
698
- }
699
- });
700
- }
701
- }
702
-
703
- Suraido.prototype._setsItems = function() {
704
- return this.items.css({
705
- float: 'left',
706
- width: "" + (100 / this.itemsLength) + "%"
707
- });
708
- };
709
-
710
- Suraido.prototype._setsMainElement = function() {
711
- return this.$el.css({
712
- width: this.maxSize.width,
713
- height: this.items.first().outerHeight(),
714
- overflow: 'hidden'
715
- });
716
- };
717
-
718
- Suraido.prototype._enablesAutoPlay = function() {
719
- var _this = this;
720
- return setTimeout(function() {
721
- if (_this.options.delay | 0) {
722
- _this.play();
723
- if (_this.options.pause) {
724
- return _this.$el.on('mouseover, mouseout', function(event) {
725
- _this.stop();
726
- return event.type === 'mouseout' && _this.play();
727
- });
728
- }
729
- }
730
- }, this.options.autoPlayDelay | 0);
731
- };
732
-
733
- Suraido.prototype._enablesFluidBehavior = function() {
734
- var _this = this;
735
- return $(window).resize(function() {
736
- _this.resize && clearTimeout(_this.resize);
737
- return _this.resize = setTimeout(function() {
738
- var style, width;
739
- style = {
740
- height: _this.items.eq(_this.currentItemIndex).outerHeight() + 30
741
- };
742
- width = _this.$el.outerWidth();
743
- _this.itemsWrapper.css(style);
744
- style['width'] = "" + (Math.min(Math.round((width / _this.$el.parent().width()) * 100), 100)) + "%";
745
- return _this.$el.css(style, 50);
746
- });
747
- }).resize();
748
- };
749
-
750
- Suraido.prototype._enableBindKeys = function() {
751
- var _this = this;
752
- return $(document).on('keydown', function(event) {
753
- switch (event.which) {
754
- case 37:
755
- return _this.prev();
756
- case 39:
757
- return _this.next();
758
- case 27 || 32:
759
- return _this.stop();
760
- }
761
- });
762
- };
763
-
764
- Suraido.prototype._createPagination = function() {
765
- var html,
766
- _this = this;
767
- html = "<ol class='" + this.options.paginationClass + "'>";
768
- $.each(this.items, function(index) {
769
- return html += "<li class='" + (index === _this.currentItemIndex ? _this.options.paginationItemClass + ' active' : _this.options.paginationItemClass) + "'> " + (++index) + "</li>";
770
- });
771
- html += "</ol>";
772
- return this._bindPagination(this.options.paginationClass, this.options.paginationItemClass, html);
773
- };
774
-
775
- Suraido.prototype._createArrows = function() {
776
- var html;
777
- html = "<div class=\"";
778
- html = html + this.options.arrowsClass + "\">" + html + this.options.arrowClass + " prev\">" + this.options.prev + "</div>" + html + this.options.arrowClass + " next\">" + this.options.next + "</div></div>";
779
- return this._bindPagination(this.options.arrowsClass, this.options.arrowClass, html);
780
- };
781
-
782
- Suraido.prototype._bindPagination = function(className, itemClassName, html) {
783
- var weakSelf;
784
- weakSelf = this;
785
- return this.$el.addClass("has-" + className).append(html).find("." + itemClassName).click(function() {
786
- var $this;
787
- $this = $(this);
788
- if ($this.hasClass(weakSelf.options.paginationItemClass)) {
789
- return weakSelf.stop().to($this.index());
790
- } else if ($this.hasClass('prev')) {
791
- return weakSelf.prev();
792
- } else {
793
- return weakSelf.next();
794
- }
795
- });
796
- };
797
-
798
- Suraido.prototype.to = function(index, callback) {
799
- var easing, obj, speed, target,
800
- _this = this;
801
- if (this.t) {
802
- this.stop();
803
- this.play();
804
- }
805
- target = this.items.eq(index);
806
- $.isFunction(this.options.starting) && !callback && this.options.starting(this.$el, this.items.eq(this.currentItemIndex));
807
- if (!(target.length || index < 0) && this.options.loop === false) {
808
- return;
809
- }
810
- if (index < 0) {
811
- index = this.items.length - 1;
812
- }
813
- speed = callback ? 5 : this.options.speed | 0;
814
- easing = this.options.easing;
815
- obj = {
816
- height: target.outerHeight() + 30
817
- };
818
- if (!this.itemsWrapper.queue('fx').length) {
819
- this.$el.find("." + this.options.paginationItemClass).eq(index).addClass('active').siblings().removeClass('active');
820
- return this.$el.animate(obj, speed, easing) && this.itemsWrapper.animate($.extend({
821
- left: "-" + index + "00%"
822
- }, obj), speed, easing, function(data) {
823
- _this.currentItemIndex = index;
824
- return $.isFunction(_this.options.complete) && !callback && _this.options.complete(_this.el, target);
825
- });
826
- }
827
- };
828
-
829
- Suraido.prototype.play = function() {
830
- var _this = this;
831
- return this.t = setInterval(function() {
832
- return _this.to(_this.currentItemIndex + 1);
833
- }, this.options.delay | 0);
834
- };
835
-
836
- Suraido.prototype.stop = function() {
837
- this.t = clearInterval(this.t);
838
- return this;
839
- };
840
-
841
- Suraido.prototype.next = function() {
842
- if (this.currentItemIndex === (this.itemsLength - 1)) {
843
- return this.stop().to(0);
844
- } else {
845
- return this.stop().to(this.currentItemIndex + 1);
846
- }
847
- };
848
-
849
- Suraido.prototype.prev = function() {
850
- return this.stop().to(this.currentItemIndex - 1);
851
- };
852
-
853
- return Suraido;
854
-
855
- })();
856
- $.fn[pluginName] = function(options) {
857
- var args, sliders, _;
858
- sliders = this.length;
859
- _ = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
860
- return this.each(function(index) {
861
- var instance, key, me, plugin;
862
- me = $(this);
863
- plugin = $.data(this, "plugin_" + pluginName);
864
- if (!plugin) {
865
- key = "suraido" + (sliders > 1 ? '-' + ++index : '');
866
- instance = new Furatto.Suraido(this, options);
867
- return me.data(key, instance).data('key', key);
868
- } else if ((plugin[_] != null) && $.type(plugin[_]) === 'function') {
869
- return plugin[_].apply(plugin, args);
870
- }
871
- });
872
- };
873
- Furatto.Suraido.version = "1.0.0";
874
- return $(document).ready(function() {
875
- return $('[data-suraido]').each(function() {
876
- return $(this).suraido();
877
- });
878
- });
879
- })($, window, document);
880
-
881
- /*
882
- Toolbar.js
883
-
884
- @fileoverview jQuery plugin that creates tooltip style toolbars.
885
- @link http://paulkinzett.github.com/toolbar/
886
- @author Paul Kinzett (http://kinzett.co.nz/)
887
- @version 1.0.4
888
- @requires jQuery 1.7+
889
-
890
- @license jQuery Toolbar Plugin v1.0.4
891
- http://paulkinzett.github.com/toolbar/
892
- Copyright 2013 Paul Kinzett (http://kinzett.co.nz/)
893
- Released under the MIT license.
894
- <https://raw.github.com/paulkinzett/toolbar/master/LICENSE.txt>
895
- */
896
-
897
- if (typeof Object.create !== "function") {
898
- Object.create = function(obj) {
899
- var F;
900
- F = function() {};
901
- F.prototype = obj;
902
- return new F();
903
- };
904
- }
905
-
906
- (function($, window, document, undefined_) {
907
- var ToolBar;
908
- ToolBar = {
909
- init: function(options, elem) {
910
- var self;
911
- self = this;
912
- self.elem = elem;
913
- self.$elem = $(elem);
914
- self.options = $.extend({}, $.fn.toolbar.options, options);
915
- self.toolbar = $("<div class='tool-container gradient ' />").addClass("tool-" + self.options.position).addClass("tool-rounded").addClass(self.options.theme).append("<div class=\"tool-items\" />").append("<div class='arrow " + self.options.theme + "' />").appendTo("body").css("opacity", 0).hide();
916
- self.toolbar_arrow = self.toolbar.find(".arrow");
917
- return self.initializeToolbar();
918
- },
919
- initializeToolbar: function() {
920
- var self;
921
- self = this;
922
- self.populateContent();
923
- self.setTrigger();
924
- return self.toolbarWidth = self.toolbar.width();
925
- },
926
- setTrigger: function() {
927
- var self;
928
- self = this;
929
- self.$elem.on("click", function(event) {
930
- event.preventDefault();
931
- if (self.$elem.hasClass("pressed")) {
932
- return self.hide();
933
- } else {
934
- return self.show();
935
- }
936
- });
937
- if (self.options.hideOnClick) {
938
- $("html").on("click.toolbar", function(event) {
939
- if (event.target !== self.elem && self.$elem.has(event.target).length === 0 && self.toolbar.has(event.target).length === 0 && self.toolbar.is(":visible")) {
940
- return self.hide();
941
- }
942
- });
943
- }
944
- return $(window).resize(function(event) {
945
- event.stopPropagation();
946
- if (self.toolbar.is(":visible")) {
947
- self.toolbarCss = self.getCoordinates(self.options.position, 20);
948
- self.collisionDetection();
949
- self.toolbar.css(self.toolbarCss);
950
- return self.toolbar_arrow.css(self.arrowCss);
951
- }
952
- });
953
- },
954
- populateContent: function() {
955
- var content, location, self;
956
- self = this;
957
- location = self.toolbar.find(".tool-items");
958
- content = $(self.options.content).clone(true).find("a").addClass("tool-item gradient").addClass(self.options.theme);
959
- location.html(content);
960
- return location.find(".tool-item").on("click", function(event) {
961
- event.preventDefault();
962
- return self.$elem.trigger("toolbarItemClick", this);
963
- });
964
- },
965
- calculatePosition: function() {
966
- var self;
967
- self = this;
968
- self.arrowCss = {};
969
- self.toolbarCss = self.getCoordinates(self.options.position, 0);
970
- self.toolbarCss.position = "absolute";
971
- self.toolbarCss.zIndex = self.options.zIndex;
972
- self.collisionDetection();
973
- self.toolbar.css(self.toolbarCss);
974
- return self.toolbar_arrow.css(self.arrowCss);
975
- },
976
- getCoordinates: function(position, adjustment) {
977
- var self;
978
- self = this;
979
- self.coordinates = self.$elem.offset();
980
- if (self.options.adjustment && self.options.adjustment[self.options.position]) {
981
- adjustment = self.options.adjustment[self.options.position];
982
- }
983
- switch (self.options.position) {
984
- case "top":
985
- return {
986
- left: self.coordinates.left - (self.toolbar.width() / 2) + (self.$elem.outerWidth() / 2),
987
- top: self.coordinates.top - self.$elem.height() - adjustment,
988
- right: "auto"
989
- };
990
- case "left":
991
- return {
992
- left: self.coordinates.left - (self.toolbar.width() / 2) - (self.$elem.width() / 2) - adjustment,
993
- top: self.coordinates.top - (self.toolbar.height() / 2) + (self.$elem.outerHeight() / 2),
994
- right: "auto"
995
- };
996
- case "right":
997
- return {
998
- left: self.coordinates.left + (self.toolbar.width() / 2) + (self.$elem.width() / 3) + adjustment,
999
- top: self.coordinates.top - (self.toolbar.height() / 2) + (self.$elem.outerHeight() / 2),
1000
- right: "auto"
1001
- };
1002
- case "bottom":
1003
- return {
1004
- left: self.coordinates.left - (self.toolbar.width() / 2) + (self.$elem.outerWidth() / 2),
1005
- top: self.coordinates.top + self.$elem.height() + adjustment,
1006
- right: "auto"
1007
- };
1008
- }
1009
- },
1010
- collisionDetection: function() {
1011
- var edgeOffset, self;
1012
- self = this;
1013
- edgeOffset = 20;
1014
- if (self.options.position === "top" || self.options.position === "bottom") {
1015
- self.arrowCss = {
1016
- left: "50%",
1017
- right: "50%"
1018
- };
1019
- if (self.toolbarCss.left < edgeOffset) {
1020
- self.toolbarCss.left = edgeOffset;
1021
- return self.arrowCss.left = self.$elem.offset().left + self.$elem.width() / 2 - edgeOffset;
1022
- } else if (($(window).width() - (self.toolbarCss.left + self.toolbarWidth)) < edgeOffset) {
1023
- self.toolbarCss.right = edgeOffset;
1024
- self.toolbarCss.left = "auto";
1025
- self.arrowCss.left = "auto";
1026
- return self.arrowCss.right = ($(window).width() - self.$elem.offset().left) - (self.$elem.width() / 2) - edgeOffset - 5;
1027
- }
1028
- }
1029
- },
1030
- show: function() {
1031
- var animation, self;
1032
- self = this;
1033
- animation = {
1034
- opacity: 1
1035
- };
1036
- self.$elem.addClass("pressed");
1037
- self.calculatePosition();
1038
- switch (self.options.position) {
1039
- case "top":
1040
- animation.top = "-=20";
1041
- break;
1042
- case "left":
1043
- animation.left = "-=20";
1044
- break;
1045
- case "right":
1046
- animation.left = "+=20";
1047
- break;
1048
- case "bottom":
1049
- animation.top = "+=20";
1050
- }
1051
- self.toolbar.show().animate(animation, 200);
1052
- return self.$elem.trigger("toolbarShown");
1053
- },
1054
- hide: function() {
1055
- var animation, self;
1056
- self = this;
1057
- animation = {
1058
- opacity: 0
1059
- };
1060
- self.$elem.removeClass("pressed");
1061
- switch (self.options.position) {
1062
- case "top":
1063
- animation.top = "+=20";
1064
- break;
1065
- case "left":
1066
- animation.left = "+=20";
1067
- break;
1068
- case "right":
1069
- animation.left = "-=20";
1070
- break;
1071
- case "bottom":
1072
- animation.top = "-=20";
1073
- }
1074
- self.toolbar.animate(animation, 200, function() {
1075
- return self.toolbar.hide();
1076
- });
1077
- return self.$elem.trigger("toolbarHidden");
1078
- },
1079
- getToolbarElement: function() {
1080
- return this.toolbar.find(".tool-items");
1081
- }
1082
- };
1083
- $.fn.toolbar = function(options) {
1084
- var method, toolbarObj;
1085
- if ($.isPlainObject(options)) {
1086
- return this.each(function() {
1087
- var toolbarObj;
1088
- toolbarObj = Object.create(ToolBar);
1089
- toolbarObj.init(options, this);
1090
- return $(this).data("toolbarObj", toolbarObj);
1091
- });
1092
- } else if (typeof options === "string" && options.indexOf("_") !== 0) {
1093
- toolbarObj = $(this).data("toolbarObj");
1094
- method = toolbarObj[options];
1095
- return method.apply(toolbarObj, $.makeArray(arguments_).slice(1));
1096
- }
1097
- };
1098
- $.fn.toolbar.options = {
1099
- content: "#myContent",
1100
- position: "top",
1101
- hideOnClick: false,
1102
- zIndex: 120,
1103
- theme: ""
1104
- };
1105
- return $(document).ready(function() {
1106
- return $('[data-furatto="toolbar"]').each(function() {
1107
- return $(this).toolbar({
1108
- content: $(this).data('content'),
1109
- position: $(this).data('position') || 'top',
1110
- hideOnClick: true,
1111
- theme: $(this).data('theme')
1112
- });
1113
- });
1114
- });
1115
- })(jQuery, window, document);
1116
-
1117
- var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
1118
- __slice = [].slice;
1119
-
1120
- (function($, window, document) {
1121
- var defaults, pluginName;
1122
- pluginName = 'tabu';
1123
- defaults = {
1124
- startIndex: 0,
1125
- tabContentClass: 'tabu-content',
1126
- tabContentsClass: 'content'
1127
- };
1128
- Furatto.Tabu = (function() {
1129
- function Tabu(el, options) {
1130
- this.el = el;
1131
- this._toggle = __bind(this._toggle, this);
1132
- this._setActiveElements = __bind(this._setActiveElements, this);
1133
- this._preventsIndexOutofBounds = __bind(this._preventsIndexOutofBounds, this);
1134
- this.$el = $(this.el);
1135
- this.options = $.extend(defaults, options, this.$el.data());
1136
- this.tabItems = this.$el.find('li');
1137
- this.tabItemsLength = this.tabItems.length;
1138
- this.tabContents = this.$el.next("." + this.options.tabContentClass).find(">." + this.options.tabContentsClass);
1139
- this._preventsIndexOutofBounds();
1140
- this._setActiveElements();
1141
- this._toggle();
1142
- }
1143
-
1144
- Tabu.prototype._preventsIndexOutofBounds = function() {
1145
- if (this.options.startIndex >= this.tabItemsLength) {
1146
- return this.options.startIndex = this.tabItemsLength - 1;
1147
- }
1148
- };
1149
-
1150
- Tabu.prototype._setActiveElements = function() {
1151
- $(this.tabItems[this.options.startIndex]).addClass('active');
1152
- return $(this.tabContents[this.options.startIndex]).addClass('active');
1153
- };
1154
-
1155
- Tabu.prototype._toggle = function() {
1156
- var weakSelf;
1157
- weakSelf = this;
1158
- return this.tabItems.on('touchstart click', function(event) {
1159
- var id;
1160
- event.preventDefault();
1161
- weakSelf.tabItems.removeClass('active');
1162
- $(this).addClass('active');
1163
- weakSelf.tabContents.removeClass('active');
1164
- id = $(this).find('a').attr('href');
1165
- return $(id).addClass('active');
1166
- });
1167
- };
1168
-
1169
- return Tabu;
1170
-
1171
- })();
1172
- $.fn[pluginName] = function(options) {
1173
- var args, tabsLength, _;
1174
- tabsLength = this.length;
1175
- _ = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
1176
- return this.each(function(index) {
1177
- var instance, key, me, plugin;
1178
- me = $(this);
1179
- plugin = $.data(this, "plugin_" + pluginName);
1180
- if (!plugin) {
1181
- key = "tabu" + (tabsLength > 1 ? '-' + ++index : '');
1182
- instance = new Furatto.Tabu(this, options);
1183
- return me.data(key, instance).data('key', key);
1184
- } else if ((plugin[_] != null) && $.type(plugin[_]) === 'function') {
1185
- return plugin[_].apply(plugin, args);
1186
- }
1187
- });
1188
- };
1189
- Furatto.Tabu.version = "1.0.0";
1190
- return $(document).ready(function() {
1191
- return $('[data-tabu]').each(function() {
1192
- return $(this).tabu();
1193
- });
1194
- });
1195
- })($, window, document);
1196
-
1197
- /* ===========================================================
1198
- * bootstrap-tooltip.js v2.3.0
1199
- * http://twitter.github.com/bootstrap/javascript.html#tooltips
1200
- * Inspired by the original jQuery.tipsy by Jason Frame
1201
- * ===========================================================
1202
- * Copyright 2012 Twitter, Inc.
1203
- *
1204
- * Licensed under the Apache License, Version 2.0 (the "License");
1205
- * you may not use this file except in compliance with the License.
1206
- * You may obtain a copy of the License at
1207
- *
1208
- * http://www.apache.org/licenses/LICENSE-2.0
1209
- *
1210
- * Unless required by applicable law or agreed to in writing, software
1211
- * distributed under the License is distributed on an "AS IS" BASIS,
1212
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1213
- * See the License for the specific language governing permissions and
1214
- * limitations under the License.
1215
- * ========================================================== */
1216
-
1217
-
1218
- !function ($) {
1219
-
1220
- "use strict"; // jshint ;_;
1221
-
1222
-
1223
- /* TOOLTIP PUBLIC CLASS DEFINITION
1224
- * =============================== */
1225
-
1226
- var Tooltip = function (element, options) {
1227
- this.init('tooltip', element, options)
1228
- }
1229
-
1230
- Tooltip.prototype = {
1231
-
1232
- constructor: Tooltip
1233
-
1234
- , init: function (type, element, options) {
1235
- var eventIn
1236
- , eventOut
1237
- , triggers
1238
- , trigger
1239
- , i
1240
-
1241
- this.type = type
1242
- this.$element = $(element)
1243
- this.options = this.getOptions(options)
1244
- this.enabled = true
1245
-
1246
- triggers = this.options.trigger.split(' ')
1247
-
1248
- for (i = triggers.length; i--;) {
1249
- trigger = triggers[i]
1250
- if (trigger == 'click') {
1251
- this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1252
- } else if (trigger != 'manual') {
1253
- eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
1254
- eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
1255
- this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1256
- this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1257
- }
1258
- }
1259
-
1260
- this.options.selector ?
1261
- (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1262
- this.fixTitle()
1263
- }
1264
-
1265
- , getOptions: function (options) {
1266
- options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
1267
-
1268
- if (options.delay && typeof options.delay == 'number') {
1269
- options.delay = {
1270
- show: options.delay
1271
- , hide: options.delay
1272
- }
1273
- }
1274
-
1275
- return options
1276
- }
1277
-
1278
- , enter: function (e) {
1279
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1280
-
1281
- if (!self.options.delay || !self.options.delay.show) return self.show()
1282
-
1283
- clearTimeout(this.timeout)
1284
- self.hoverState = 'in'
1285
- this.timeout = setTimeout(function() {
1286
- if (self.hoverState == 'in') self.show()
1287
- }, self.options.delay.show)
1288
- }
1289
-
1290
- , leave: function (e) {
1291
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1292
-
1293
- if (this.timeout) clearTimeout(this.timeout)
1294
- if (!self.options.delay || !self.options.delay.hide) return self.hide()
1295
-
1296
- self.hoverState = 'out'
1297
- this.timeout = setTimeout(function() {
1298
- if (self.hoverState == 'out') self.hide()
1299
- }, self.options.delay.hide)
1300
- }
1301
-
1302
- , show: function () {
1303
- var $tip
1304
- , pos
1305
- , actualWidth
1306
- , actualHeight
1307
- , placement
1308
- , tp
1309
- , e = $.Event('show')
1310
-
1311
- if (this.hasContent() && this.enabled) {
1312
- this.$element.trigger(e)
1313
- if (e.isDefaultPrevented()) return
1314
- $tip = this.tip()
1315
- this.setContent()
1316
-
1317
- if (this.options.animation) {
1318
- $tip.addClass('fade')
1319
- }
1320
-
1321
- placement = typeof this.options.placement == 'function' ?
1322
- this.options.placement.call(this, $tip[0], this.$element[0]) :
1323
- this.options.placement
1324
-
1325
- $tip
1326
- .detach()
1327
- .css({ top: 0, left: 0, display: 'block' })
1328
-
1329
- this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1330
-
1331
- pos = this.getPosition()
1332
-
1333
- actualWidth = $tip[0].offsetWidth
1334
- actualHeight = $tip[0].offsetHeight
1335
-
1336
- switch (placement) {
1337
- case 'bottom':
1338
- tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
1339
- break
1340
- case 'top':
1341
- tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
1342
- break
1343
- case 'left':
1344
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
1345
- break
1346
- case 'right':
1347
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
1348
- break
1349
- }
1350
-
1351
- this.applyPlacement(tp, placement)
1352
- this.$element.trigger('shown')
1353
- }
1354
- }
1355
-
1356
- , applyPlacement: function(offset, placement){
1357
- var $tip = this.tip()
1358
- , width = $tip[0].offsetWidth
1359
- , height = $tip[0].offsetHeight
1360
- , actualWidth
1361
- , actualHeight
1362
- , delta
1363
- , replace
1364
-
1365
- $tip
1366
- .offset(offset)
1367
- .addClass(placement)
1368
- .addClass('in')
1369
-
1370
- actualWidth = $tip[0].offsetWidth
1371
- actualHeight = $tip[0].offsetHeight
1372
-
1373
- if (placement == 'top' && actualHeight != height) {
1374
- offset.top = offset.top + height - actualHeight
1375
- replace = true
1376
- }
1377
-
1378
- if (placement == 'bottom' || placement == 'top') {
1379
- delta = 0
1380
-
1381
- if (offset.left < 0){
1382
- delta = offset.left * -2
1383
- offset.left = 0
1384
- $tip.offset(offset)
1385
- actualWidth = $tip[0].offsetWidth
1386
- actualHeight = $tip[0].offsetHeight
1387
- }
1388
-
1389
- this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
1390
- } else {
1391
- this.replaceArrow(actualHeight - height, actualHeight, 'top')
1392
- }
1393
-
1394
- if (replace) $tip.offset(offset)
1395
- }
1396
-
1397
- , replaceArrow: function(delta, dimension, position){
1398
- this
1399
- .arrow()
1400
- .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
1401
- }
1402
-
1403
- , setContent: function () {
1404
- var $tip = this.tip()
1405
- , title = this.getTitle()
1406
-
1407
- $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1408
- $tip.removeClass('fade in top bottom left right')
1409
- }
1410
-
1411
- , hide: function () {
1412
- var that = this
1413
- , $tip = this.tip()
1414
- , e = $.Event('hide')
1415
-
1416
- this.$element.trigger(e)
1417
- if (e.isDefaultPrevented()) return
1418
-
1419
- $tip.removeClass('in')
1420
-
1421
- function removeWithAnimation() {
1422
- var timeout = setTimeout(function () {
1423
- $tip.off($.support.transition.end).detach()
1424
- }, 500)
1425
-
1426
- $tip.one($.support.transition.end, function () {
1427
- clearTimeout(timeout)
1428
- $tip.detach()
1429
- })
1430
- }
1431
-
1432
- $.support.transition && this.$tip.hasClass('fade') ?
1433
- removeWithAnimation() :
1434
- $tip.detach()
1435
-
1436
- this.$element.trigger('hidden')
1437
-
1438
- return this
1439
- }
1440
-
1441
- , fixTitle: function () {
1442
- var $e = this.$element
1443
- if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1444
- $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1445
- }
1446
- }
1447
-
1448
- , hasContent: function () {
1449
- return this.getTitle()
1450
- }
1451
-
1452
- , getPosition: function () {
1453
- var el = this.$element[0]
1454
- return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
1455
- width: el.offsetWidth
1456
- , height: el.offsetHeight
1457
- }, this.$element.offset())
1458
- }
1459
-
1460
- , getTitle: function () {
1461
- var title
1462
- , $e = this.$element
1463
- , o = this.options
1464
-
1465
- title = $e.attr('data-original-title')
1466
- || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1467
-
1468
- return title
1469
- }
1470
-
1471
- , tip: function () {
1472
- return this.$tip = this.$tip || $(this.options.template)
1473
- }
1474
-
1475
- , arrow: function(){
1476
- return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
1477
- }
1478
-
1479
- , validate: function () {
1480
- if (!this.$element[0].parentNode) {
1481
- this.hide()
1482
- this.$element = null
1483
- this.options = null
1484
- }
1485
- }
1486
-
1487
- , enable: function () {
1488
- this.enabled = true
1489
- }
1490
-
1491
- , disable: function () {
1492
- this.enabled = false
1493
- }
1494
-
1495
- , toggleEnabled: function () {
1496
- this.enabled = !this.enabled
1497
- }
1498
-
1499
- , toggle: function (e) {
1500
- var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
1501
- self.tip().hasClass('in') ? self.hide() : self.show()
1502
- }
1503
-
1504
- , destroy: function () {
1505
- this.hide().$element.off('.' + this.type).removeData(this.type)
1506
- }
1507
-
1508
- }
1509
-
1510
-
1511
- /* TOOLTIP PLUGIN DEFINITION
1512
- * ========================= */
1513
-
1514
- var old = $.fn.tooltip
1515
-
1516
- $.fn.tooltip = function ( option ) {
1517
- return this.each(function () {
1518
- var $this = $(this)
1519
- , data = $this.data('tooltip')
1520
- , options = typeof option == 'object' && option
1521
- if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1522
- if (typeof option == 'string') data[option]()
1523
- })
1524
- }
1525
-
1526
- $.fn.tooltip.Constructor = Tooltip
1527
-
1528
- $.fn.tooltip.defaults = {
1529
- animation: true
1530
- , placement: 'top'
1531
- , selector: false
1532
- , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1533
- , trigger: 'hover focus'
1534
- , title: ''
1535
- , delay: 0
1536
- , html: false
1537
- , container: false
1538
- }
1539
-
1540
-
1541
- /* TOOLTIP NO CONFLICT
1542
- * =================== */
1543
-
1544
- $.fn.tooltip.noConflict = function () {
1545
- $.fn.tooltip = old
1546
- return this
1547
- }
1548
-
1549
- $(document).on('ready', function(){
1550
- $("[data-toggle=tooltip]").tooltip();
1551
- });
1552
-
1553
- }(window.jQuery);
1554
-
1555
- /* ============================================================
1556
- * bootstrap-dropdown.js v2.3.2
1557
- * http://twitter.github.com/bootstrap/javascript.html#dropdowns
1558
- * ============================================================
1559
- * Copyright 2012 Twitter, Inc.
1560
- *
1561
- * Licensed under the Apache License, Version 2.0 (the "License");
1562
- * you may not use this file except in compliance with the License.
1563
- * You may obtain a copy of the License at
1564
- *
1565
- * http://www.apache.org/licenses/LICENSE-2.0
1566
- *
1567
- * Unless required by applicable law or agreed to in writing, software
1568
- * distributed under the License is distributed on an "AS IS" BASIS,
1569
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1570
- * See the License for the specific language governing permissions and
1571
- * limitations under the License.
1572
- * ============================================================ */
1573
-
1574
-
1575
- !function ($) {
1576
-
1577
- "use strict"; // jshint ;_;
1578
-
1579
-
1580
- /* DROPDOWN CLASS DEFINITION
1581
- * ========================= */
1582
-
1583
- var toggle = '[data-toggle=dropdown]'
1584
- , Dropdown = function (element) {
1585
- var $el = $(element).on('click.dropdown.data-api', this.toggle)
1586
- $('html').on('click.dropdown.data-api', function () {
1587
- $el.parent().removeClass('open')
1588
- })
1589
- }
1590
-
1591
- Dropdown.prototype = {
1592
-
1593
- constructor: Dropdown
1594
-
1595
- , toggle: function (e) {
1596
- var $this = $(this)
1597
- , $parent
1598
- , isActive
1599
-
1600
- if ($this.is('.disabled, :disabled')) return
1601
-
1602
- $parent = getParent($this)
1603
-
1604
- isActive = $parent.hasClass('open')
1605
-
1606
- clearMenus()
1607
-
1608
- if (!isActive) {
1609
- if ('ontouchstart' in document.documentElement) {
1610
- // if mobile we we use a backdrop because click events don't delegate
1611
- $('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
1612
- }
1613
- $parent.toggleClass('open')
1614
- }
1615
-
1616
- $this.focus()
1617
-
1618
- return false
1619
- }
1620
-
1621
- , keydown: function (e) {
1622
- var $this
1623
- , $items
1624
- , $active
1625
- , $parent
1626
- , isActive
1627
- , index
1628
-
1629
- if (!/(38|40|27)/.test(e.keyCode)) return
1630
-
1631
- $this = $(this)
1632
-
1633
- e.preventDefault()
1634
- e.stopPropagation()
1635
-
1636
- if ($this.is('.disabled, :disabled')) return
1637
-
1638
- $parent = getParent($this)
1639
-
1640
- isActive = $parent.hasClass('open')
1641
-
1642
- if (!isActive || (isActive && e.keyCode == 27)) {
1643
- if (e.which == 27) $parent.find(toggle).focus()
1644
- return $this.click()
1645
- }
1646
-
1647
- $items = $('[role=menu] li:not(.divider):visible a', $parent)
1648
-
1649
- if (!$items.length) return
1650
-
1651
- index = $items.index($items.filter(':focus'))
1652
-
1653
- if (e.keyCode == 38 && index > 0) index-- // up
1654
- if (e.keyCode == 40 && index < $items.length - 1) index++ // down
1655
- if (!~index) index = 0
1656
-
1657
- $items
1658
- .eq(index)
1659
- .focus()
1660
- }
1661
-
1662
- }
1663
-
1664
- function clearMenus() {
1665
- $('.dropdown-backdrop').remove()
1666
- $(toggle).each(function () {
1667
- getParent($(this)).removeClass('open')
1668
- })
1669
- }
1670
-
1671
- function getParent($this) {
1672
- var selector = $this.attr('data-target')
1673
- , $parent
1674
-
1675
- if (!selector) {
1676
- selector = $this.attr('href')
1677
- selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1678
- }
1679
-
1680
- $parent = selector && $(selector)
1681
-
1682
- if (!$parent || !$parent.length) $parent = $this.parent()
1683
-
1684
- return $parent
1685
- }
1686
-
1687
-
1688
- /* DROPDOWN PLUGIN DEFINITION
1689
- * ========================== */
1690
-
1691
- var old = $.fn.dropdown
1692
-
1693
- $.fn.dropdown = function (option) {
1694
- return this.each(function () {
1695
- var $this = $(this)
1696
- , data = $this.data('dropdown')
1697
- if (!data) $this.data('dropdown', (data = new Dropdown(this)))
1698
- if (typeof option == 'string') data[option].call($this)
1699
- })
1700
- }
1701
-
1702
- $.fn.dropdown.Constructor = Dropdown
1703
-
1704
-
1705
- /* DROPDOWN NO CONFLICT
1706
- * ==================== */
1707
-
1708
- $.fn.dropdown.noConflict = function () {
1709
- $.fn.dropdown = old
1710
- return this
1711
- }
1712
-
1713
-
1714
- /* APPLY TO STANDARD DROPDOWN ELEMENTS
1715
- * =================================== */
1716
-
1717
- $(document)
1718
- .on('click.dropdown.data-api', clearMenus)
1719
- .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
1720
- .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
1721
- .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
1722
-
1723
- $(document).ready(function() {
1724
- $('.dropdown-toggle').dropdown();
1725
-
1726
- $('.dropdown input, .dropdown label').click(function(e){
1727
- e.stopPropagation();
1728
- });
1729
- })
1730
-
1731
- $('.with-dropdown').on('touchstart click', function(e) {
1732
- e.preventDefault();
1733
- return $(this).toggleClass('opened');
1734
- });
1735
- return $('.with-dropdown').hover(function() {
1736
- return $(this).addClass('opened');
1737
- }, function() {
1738
- return $(this).removeClass('opened');
1739
- });
1740
-
1741
- }(window.jQuery);
1742
-
1743
- /*!
1744
- * classie - class helper functions
1745
- * from bonzo https://github.com/ded/bonzo
1746
- *
1747
- * classie.has( elem, 'my-class' ) -> true/false
1748
- * classie.add( elem, 'my-new-class' )
1749
- * classie.remove( elem, 'my-unwanted-class' )
1750
- * classie.toggle( elem, 'my-class' )
1751
- */
1752
-
1753
- /*jshint browser: true, strict: true, undef: true */
1754
- /*global define: false */
1755
-
1756
- ( function( window ) {
1757
-
1758
- 'use strict';
1759
-
1760
- // class helper functions from bonzo https://github.com/ded/bonzo
1761
-
1762
- function classReg( className ) {
1763
- return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
1764
- }
1765
-
1766
- // classList support for class management
1767
- // altho to be fair, the api sucks because it won't accept multiple classes at once
1768
- var hasClass, addClass, removeClass;
1769
-
1770
- if ( 'classList' in document.documentElement ) {
1771
- hasClass = function( elem, c ) {
1772
- return elem.classList.contains( c );
1773
- };
1774
- addClass = function( elem, c ) {
1775
- elem.classList.add( c );
1776
- };
1777
- removeClass = function( elem, c ) {
1778
- elem.classList.remove( c );
1779
- };
1780
- }
1781
- else {
1782
- hasClass = function( elem, c ) {
1783
- return classReg( c ).test( elem.className );
1784
- };
1785
- addClass = function( elem, c ) {
1786
- if ( !hasClass( elem, c ) ) {
1787
- elem.className = elem.className + ' ' + c;
1788
- }
1789
- };
1790
- removeClass = function( elem, c ) {
1791
- elem.className = elem.className.replace( classReg( c ), ' ' );
1792
- };
1793
- }
1794
-
1795
- function toggleClass( elem, c ) {
1796
- var fn = hasClass( elem, c ) ? removeClass : addClass;
1797
- fn( elem, c );
1798
- }
1799
-
1800
- var classie = {
1801
- // full names
1802
- hasClass: hasClass,
1803
- addClass: addClass,
1804
- removeClass: removeClass,
1805
- toggleClass: toggleClass,
1806
- // short names
1807
- has: hasClass,
1808
- add: addClass,
1809
- remove: removeClass,
1810
- toggle: toggleClass
1811
- };
1812
-
1813
- // transport
1814
- if ( typeof define === 'function' && define.amd ) {
1815
- // AMD
1816
- define( classie );
1817
- } else {
1818
- // browser global
1819
- window.classie = classie;
1820
- }
1821
-
1822
- })( window );