loremGem 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. checksums.yaml +7 -0
  2. data/.gitattributes +14 -0
  3. data/.gitignore +24 -0
  4. data/.travis.yml +17 -0
  5. data/CHANGELOG.md +37 -0
  6. data/CODE_OF_CONDUCT.md +49 -0
  7. data/Gemfile +12 -0
  8. data/LICENSE Bootstrap +21 -0
  9. data/LICENSE Lorem.txt +21 -0
  10. data/README.md +35 -0
  11. data/Rakefile +80 -0
  12. data/assets/javascript/bootstrap/alert.js +177 -0
  13. data/assets/javascript/bootstrap/button.js +166 -0
  14. data/assets/javascript/bootstrap/carousel.js +507 -0
  15. data/assets/javascript/bootstrap/collapse.js +366 -0
  16. data/assets/javascript/bootstrap/dropdown.js +488 -0
  17. data/assets/javascript/bootstrap/modal.js +584 -0
  18. data/assets/javascript/bootstrap/popover.js +205 -0
  19. data/assets/javascript/bootstrap/scrollspy.js +318 -0
  20. data/assets/javascript/bootstrap/tab.js +250 -0
  21. data/assets/javascript/bootstrap/tooltip.js +673 -0
  22. data/assets/javascript/bootstrap/util.js +131 -0
  23. data/assets/javascript/bootstrap-sprockets.js +11 -0
  24. data/assets/javascript/bootstrap.js +3926 -0
  25. data/assets/javascript/bootstrap.min.js +6 -0
  26. data/assets/javascript/lorem.js +24044 -0
  27. data/assets/stylesheets/_bootstrap-grid.scss +32 -0
  28. data/assets/stylesheets/_bootstrap-reboot.scss +12 -0
  29. data/assets/stylesheets/_bootstrap.scss +42 -0
  30. data/assets/stylesheets/bootstrap/_alert.scss +51 -0
  31. data/assets/stylesheets/bootstrap/_badge.scss +47 -0
  32. data/assets/stylesheets/bootstrap/_breadcrumb.scss +41 -0
  33. data/assets/stylesheets/bootstrap/_button-group.scss +172 -0
  34. data/assets/stylesheets/bootstrap/_buttons.scss +144 -0
  35. data/assets/stylesheets/bootstrap/_card.scss +301 -0
  36. data/assets/stylesheets/bootstrap/_carousel.scss +236 -0
  37. data/assets/stylesheets/bootstrap/_close.scss +34 -0
  38. data/assets/stylesheets/bootstrap/_code.scss +48 -0
  39. data/assets/stylesheets/bootstrap/_custom-forms.scss +421 -0
  40. data/assets/stylesheets/bootstrap/_dropdown.scss +166 -0
  41. data/assets/stylesheets/bootstrap/_forms.scss +335 -0
  42. data/assets/stylesheets/bootstrap/_functions.scss +86 -0
  43. data/assets/stylesheets/bootstrap/_grid.scss +52 -0
  44. data/assets/stylesheets/bootstrap/_images.scss +42 -0
  45. data/assets/stylesheets/bootstrap/_input-group.scss +158 -0
  46. data/assets/stylesheets/bootstrap/_jumbotron.scss +16 -0
  47. data/assets/stylesheets/bootstrap/_list-group.scss +115 -0
  48. data/assets/stylesheets/bootstrap/_media.scss +8 -0
  49. data/assets/stylesheets/bootstrap/_mixins.scss +41 -0
  50. data/assets/stylesheets/bootstrap/_modal.scss +168 -0
  51. data/assets/stylesheets/bootstrap/_nav.scss +118 -0
  52. data/assets/stylesheets/bootstrap/_navbar.scss +299 -0
  53. data/assets/stylesheets/bootstrap/_pagination.scss +78 -0
  54. data/assets/stylesheets/bootstrap/_popover.scss +183 -0
  55. data/assets/stylesheets/bootstrap/_print.scss +141 -0
  56. data/assets/stylesheets/bootstrap/_progress.scss +34 -0
  57. data/assets/stylesheets/bootstrap/_reboot.scss +480 -0
  58. data/assets/stylesheets/bootstrap/_root.scss +19 -0
  59. data/assets/stylesheets/bootstrap/_tables.scss +188 -0
  60. data/assets/stylesheets/bootstrap/_tooltip.scss +115 -0
  61. data/assets/stylesheets/bootstrap/_transitions.scss +22 -0
  62. data/assets/stylesheets/bootstrap/_type.scss +125 -0
  63. data/assets/stylesheets/bootstrap/_utilities.scss +15 -0
  64. data/assets/stylesheets/bootstrap/_variables.scss +929 -0
  65. data/assets/stylesheets/bootstrap/mixins/_alert.scss +13 -0
  66. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +21 -0
  67. data/assets/stylesheets/bootstrap/mixins/_badge.scss +12 -0
  68. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +35 -0
  69. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +5 -0
  70. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +123 -0
  71. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +109 -0
  72. data/assets/stylesheets/bootstrap/mixins/_caret.scss +66 -0
  73. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +7 -0
  74. data/assets/stylesheets/bootstrap/mixins/_float.scss +11 -0
  75. data/assets/stylesheets/bootstrap/mixins/_forms.scss +147 -0
  76. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +45 -0
  77. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +67 -0
  78. data/assets/stylesheets/bootstrap/mixins/_grid.scss +52 -0
  79. data/assets/stylesheets/bootstrap/mixins/_hover.scss +37 -0
  80. data/assets/stylesheets/bootstrap/mixins/_image.scss +36 -0
  81. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +21 -0
  82. data/assets/stylesheets/bootstrap/mixins/_lists.scss +7 -0
  83. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
  84. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +22 -0
  85. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +17 -0
  86. data/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  87. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +33 -0
  88. data/assets/stylesheets/bootstrap/mixins/_size.scss +6 -0
  89. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +30 -0
  90. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +14 -0
  91. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +13 -0
  92. data/assets/stylesheets/bootstrap/mixins/_text-truncate.scss +8 -0
  93. data/assets/stylesheets/bootstrap/mixins/_transition.scss +13 -0
  94. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +7 -0
  95. data/assets/stylesheets/bootstrap/utilities/_align.scss +8 -0
  96. data/assets/stylesheets/bootstrap/utilities/_background.scss +19 -0
  97. data/assets/stylesheets/bootstrap/utilities/_borders.scss +59 -0
  98. data/assets/stylesheets/bootstrap/utilities/_clearfix.scss +3 -0
  99. data/assets/stylesheets/bootstrap/utilities/_display.scss +38 -0
  100. data/assets/stylesheets/bootstrap/utilities/_embed.scss +52 -0
  101. data/assets/stylesheets/bootstrap/utilities/_flex.scss +51 -0
  102. data/assets/stylesheets/bootstrap/utilities/_float.scss +9 -0
  103. data/assets/stylesheets/bootstrap/utilities/_position.scss +37 -0
  104. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +11 -0
  105. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +6 -0
  106. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +12 -0
  107. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +51 -0
  108. data/assets/stylesheets/bootstrap/utilities/_text.scss +58 -0
  109. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +11 -0
  110. data/assets/stylesheets/lorem.css +23980 -0
  111. data/bin/console +14 -0
  112. data/bin/setup +8 -0
  113. data/lib/loremGem/engine.rb +12 -0
  114. data/lib/loremGem/version.rb +4 -0
  115. data/lib/loremGem.rb +74 -0
  116. data/loremGem.gemspec +50 -0
  117. data/tasks/updater/js.rb +68 -0
  118. data/tasks/updater/logger.rb +57 -0
  119. data/tasks/updater/network.rb +103 -0
  120. data/tasks/updater/scss.rb +26 -0
  121. data/tasks/updater.rb +67 -0
  122. data/test/dummy_rails/README.rdoc +3 -0
  123. data/test/dummy_rails/Rakefile +6 -0
  124. data/test/dummy_rails/app/assets/images/.keep +0 -0
  125. data/test/dummy_rails/app/assets/javascripts/application.js +7 -0
  126. data/test/dummy_rails/app/assets/stylesheets/application.sass +4 -0
  127. data/test/dummy_rails/app/controllers/application_controller.rb +5 -0
  128. data/test/dummy_rails/app/controllers/pages_controller.rb +4 -0
  129. data/test/dummy_rails/app/helpers/application_helper.rb +2 -0
  130. data/test/dummy_rails/app/views/layouts/application.html.erb +14 -0
  131. data/test/dummy_rails/app/views/pages/root.html.slim +58 -0
  132. data/test/dummy_rails/config/application.rb +34 -0
  133. data/test/dummy_rails/config/boot.rb +5 -0
  134. data/test/dummy_rails/config/environment.rb +5 -0
  135. data/test/dummy_rails/config/environments/development.rb +23 -0
  136. data/test/dummy_rails/config/environments/production.rb +82 -0
  137. data/test/dummy_rails/config/environments/test.rb +38 -0
  138. data/test/dummy_rails/config/initializers/backtrace_silencers.rb +7 -0
  139. data/test/dummy_rails/config/initializers/filter_parameter_logging.rb +4 -0
  140. data/test/dummy_rails/config/initializers/inflections.rb +16 -0
  141. data/test/dummy_rails/config/initializers/mime_types.rb +5 -0
  142. data/test/dummy_rails/config/initializers/secret_token.rb +18 -0
  143. data/test/dummy_rails/config/initializers/session_store.rb +3 -0
  144. data/test/dummy_rails/config/initializers/wrap_parameters.rb +14 -0
  145. data/test/dummy_rails/config/locales/en.yml +3 -0
  146. data/test/dummy_rails/config/locales/es.yml +3 -0
  147. data/test/dummy_rails/config/routes.rb +3 -0
  148. data/test/dummy_rails/config.ru +4 -0
  149. data/test/dummy_rails/log/.keep +0 -0
  150. data/test/gemfiles/rails_4_2.gemfile +7 -0
  151. data/test/gemfiles/rails_5_0.gemfile +8 -0
  152. data/test/gemfiles/rails_5_1.gemfile +8 -0
  153. data/test/rails_test.rb +24 -0
  154. data/test/support/dummy_rails_integration.rb +29 -0
  155. data/test/support/reporting.rb +27 -0
  156. data/test/test_helper.rb +35 -0
  157. data/test/test_helper_rails.rb +6 -0
  158. metadata +480 -0
@@ -0,0 +1,507 @@
1
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
2
+
3
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+
5
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
+
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
8
+
9
+ /**
10
+ * --------------------------------------------------------------------------
11
+ * Bootstrap (v4.1.1): carousel.js
12
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
13
+ * --------------------------------------------------------------------------
14
+ */
15
+ var Carousel = function ($) {
16
+ /**
17
+ * ------------------------------------------------------------------------
18
+ * Constants
19
+ * ------------------------------------------------------------------------
20
+ */
21
+ var NAME = 'carousel';
22
+ var VERSION = '4.1.1';
23
+ var DATA_KEY = 'bs.carousel';
24
+ var EVENT_KEY = "." + DATA_KEY;
25
+ var DATA_API_KEY = '.data-api';
26
+ var JQUERY_NO_CONFLICT = $.fn[NAME];
27
+ var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
28
+
29
+ var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
30
+
31
+ var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
32
+
33
+ var Default = {
34
+ interval: 5000,
35
+ keyboard: true,
36
+ slide: false,
37
+ pause: 'hover',
38
+ wrap: true
39
+ };
40
+ var DefaultType = {
41
+ interval: '(number|boolean)',
42
+ keyboard: 'boolean',
43
+ slide: '(boolean|string)',
44
+ pause: '(string|boolean)',
45
+ wrap: 'boolean'
46
+ };
47
+ var Direction = {
48
+ NEXT: 'next',
49
+ PREV: 'prev',
50
+ LEFT: 'left',
51
+ RIGHT: 'right'
52
+ };
53
+ var Event = {
54
+ SLIDE: "slide" + EVENT_KEY,
55
+ SLID: "slid" + EVENT_KEY,
56
+ KEYDOWN: "keydown" + EVENT_KEY,
57
+ MOUSEENTER: "mouseenter" + EVENT_KEY,
58
+ MOUSELEAVE: "mouseleave" + EVENT_KEY,
59
+ TOUCHEND: "touchend" + EVENT_KEY,
60
+ LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY,
61
+ CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
62
+ };
63
+ var ClassName = {
64
+ CAROUSEL: 'carousel',
65
+ ACTIVE: 'active',
66
+ SLIDE: 'slide',
67
+ RIGHT: 'carousel-item-right',
68
+ LEFT: 'carousel-item-left',
69
+ NEXT: 'carousel-item-next',
70
+ PREV: 'carousel-item-prev',
71
+ ITEM: 'carousel-item'
72
+ };
73
+ var Selector = {
74
+ ACTIVE: '.active',
75
+ ACTIVE_ITEM: '.active.carousel-item',
76
+ ITEM: '.carousel-item',
77
+ NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
78
+ INDICATORS: '.carousel-indicators',
79
+ DATA_SLIDE: '[data-slide], [data-slide-to]',
80
+ DATA_RIDE: '[data-ride="carousel"]'
81
+ /**
82
+ * ------------------------------------------------------------------------
83
+ * Class Definition
84
+ * ------------------------------------------------------------------------
85
+ */
86
+
87
+ };
88
+
89
+ var Carousel =
90
+ /*#__PURE__*/
91
+ function () {
92
+ function Carousel(element, config) {
93
+ this._items = null;
94
+ this._interval = null;
95
+ this._activeElement = null;
96
+ this._isPaused = false;
97
+ this._isSliding = false;
98
+ this.touchTimeout = null;
99
+ this._config = this._getConfig(config);
100
+ this._element = $(element)[0];
101
+ this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];
102
+
103
+ this._addEventListeners();
104
+ } // Getters
105
+
106
+
107
+ var _proto = Carousel.prototype;
108
+
109
+ // Public
110
+ _proto.next = function next() {
111
+ if (!this._isSliding) {
112
+ this._slide(Direction.NEXT);
113
+ }
114
+ };
115
+
116
+ _proto.nextWhenVisible = function nextWhenVisible() {
117
+ // Don't call next when the page isn't visible
118
+ // or the carousel or its parent isn't visible
119
+ if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
120
+ this.next();
121
+ }
122
+ };
123
+
124
+ _proto.prev = function prev() {
125
+ if (!this._isSliding) {
126
+ this._slide(Direction.PREV);
127
+ }
128
+ };
129
+
130
+ _proto.pause = function pause(event) {
131
+ if (!event) {
132
+ this._isPaused = true;
133
+ }
134
+
135
+ if ($(this._element).find(Selector.NEXT_PREV)[0]) {
136
+ Util.triggerTransitionEnd(this._element);
137
+ this.cycle(true);
138
+ }
139
+
140
+ clearInterval(this._interval);
141
+ this._interval = null;
142
+ };
143
+
144
+ _proto.cycle = function cycle(event) {
145
+ if (!event) {
146
+ this._isPaused = false;
147
+ }
148
+
149
+ if (this._interval) {
150
+ clearInterval(this._interval);
151
+ this._interval = null;
152
+ }
153
+
154
+ if (this._config.interval && !this._isPaused) {
155
+ this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
156
+ }
157
+ };
158
+
159
+ _proto.to = function to(index) {
160
+ var _this = this;
161
+
162
+ this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
163
+
164
+ var activeIndex = this._getItemIndex(this._activeElement);
165
+
166
+ if (index > this._items.length - 1 || index < 0) {
167
+ return;
168
+ }
169
+
170
+ if (this._isSliding) {
171
+ $(this._element).one(Event.SLID, function () {
172
+ return _this.to(index);
173
+ });
174
+ return;
175
+ }
176
+
177
+ if (activeIndex === index) {
178
+ this.pause();
179
+ this.cycle();
180
+ return;
181
+ }
182
+
183
+ var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
184
+
185
+ this._slide(direction, this._items[index]);
186
+ };
187
+
188
+ _proto.dispose = function dispose() {
189
+ $(this._element).off(EVENT_KEY);
190
+ $.removeData(this._element, DATA_KEY);
191
+ this._items = null;
192
+ this._config = null;
193
+ this._element = null;
194
+ this._interval = null;
195
+ this._isPaused = null;
196
+ this._isSliding = null;
197
+ this._activeElement = null;
198
+ this._indicatorsElement = null;
199
+ }; // Private
200
+
201
+
202
+ _proto._getConfig = function _getConfig(config) {
203
+ config = _objectSpread({}, Default, config);
204
+ Util.typeCheckConfig(NAME, config, DefaultType);
205
+ return config;
206
+ };
207
+
208
+ _proto._addEventListeners = function _addEventListeners() {
209
+ var _this2 = this;
210
+
211
+ if (this._config.keyboard) {
212
+ $(this._element).on(Event.KEYDOWN, function (event) {
213
+ return _this2._keydown(event);
214
+ });
215
+ }
216
+
217
+ if (this._config.pause === 'hover') {
218
+ $(this._element).on(Event.MOUSEENTER, function (event) {
219
+ return _this2.pause(event);
220
+ }).on(Event.MOUSELEAVE, function (event) {
221
+ return _this2.cycle(event);
222
+ });
223
+
224
+ if ('ontouchstart' in document.documentElement) {
225
+ // If it's a touch-enabled device, mouseenter/leave are fired as
226
+ // part of the mouse compatibility events on first tap - the carousel
227
+ // would stop cycling until user tapped out of it;
228
+ // here, we listen for touchend, explicitly pause the carousel
229
+ // (as if it's the second time we tap on it, mouseenter compat event
230
+ // is NOT fired) and after a timeout (to allow for mouse compatibility
231
+ // events to fire) we explicitly restart cycling
232
+ $(this._element).on(Event.TOUCHEND, function () {
233
+ _this2.pause();
234
+
235
+ if (_this2.touchTimeout) {
236
+ clearTimeout(_this2.touchTimeout);
237
+ }
238
+
239
+ _this2.touchTimeout = setTimeout(function (event) {
240
+ return _this2.cycle(event);
241
+ }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);
242
+ });
243
+ }
244
+ }
245
+ };
246
+
247
+ _proto._keydown = function _keydown(event) {
248
+ if (/input|textarea/i.test(event.target.tagName)) {
249
+ return;
250
+ }
251
+
252
+ switch (event.which) {
253
+ case ARROW_LEFT_KEYCODE:
254
+ event.preventDefault();
255
+ this.prev();
256
+ break;
257
+
258
+ case ARROW_RIGHT_KEYCODE:
259
+ event.preventDefault();
260
+ this.next();
261
+ break;
262
+
263
+ default:
264
+ }
265
+ };
266
+
267
+ _proto._getItemIndex = function _getItemIndex(element) {
268
+ this._items = $.makeArray($(element).parent().find(Selector.ITEM));
269
+ return this._items.indexOf(element);
270
+ };
271
+
272
+ _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
273
+ var isNextDirection = direction === Direction.NEXT;
274
+ var isPrevDirection = direction === Direction.PREV;
275
+
276
+ var activeIndex = this._getItemIndex(activeElement);
277
+
278
+ var lastItemIndex = this._items.length - 1;
279
+ var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
280
+
281
+ if (isGoingToWrap && !this._config.wrap) {
282
+ return activeElement;
283
+ }
284
+
285
+ var delta = direction === Direction.PREV ? -1 : 1;
286
+ var itemIndex = (activeIndex + delta) % this._items.length;
287
+ return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
288
+ };
289
+
290
+ _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
291
+ var targetIndex = this._getItemIndex(relatedTarget);
292
+
293
+ var fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0]);
294
+
295
+ var slideEvent = $.Event(Event.SLIDE, {
296
+ relatedTarget: relatedTarget,
297
+ direction: eventDirectionName,
298
+ from: fromIndex,
299
+ to: targetIndex
300
+ });
301
+ $(this._element).trigger(slideEvent);
302
+ return slideEvent;
303
+ };
304
+
305
+ _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
306
+ if (this._indicatorsElement) {
307
+ $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
308
+
309
+ var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
310
+
311
+ if (nextIndicator) {
312
+ $(nextIndicator).addClass(ClassName.ACTIVE);
313
+ }
314
+ }
315
+ };
316
+
317
+ _proto._slide = function _slide(direction, element) {
318
+ var _this3 = this;
319
+
320
+ var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
321
+
322
+ var activeElementIndex = this._getItemIndex(activeElement);
323
+
324
+ var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
325
+
326
+ var nextElementIndex = this._getItemIndex(nextElement);
327
+
328
+ var isCycling = Boolean(this._interval);
329
+ var directionalClassName;
330
+ var orderClassName;
331
+ var eventDirectionName;
332
+
333
+ if (direction === Direction.NEXT) {
334
+ directionalClassName = ClassName.LEFT;
335
+ orderClassName = ClassName.NEXT;
336
+ eventDirectionName = Direction.LEFT;
337
+ } else {
338
+ directionalClassName = ClassName.RIGHT;
339
+ orderClassName = ClassName.PREV;
340
+ eventDirectionName = Direction.RIGHT;
341
+ }
342
+
343
+ if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
344
+ this._isSliding = false;
345
+ return;
346
+ }
347
+
348
+ var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
349
+
350
+ if (slideEvent.isDefaultPrevented()) {
351
+ return;
352
+ }
353
+
354
+ if (!activeElement || !nextElement) {
355
+ // Some weirdness is happening, so we bail
356
+ return;
357
+ }
358
+
359
+ this._isSliding = true;
360
+
361
+ if (isCycling) {
362
+ this.pause();
363
+ }
364
+
365
+ this._setActiveIndicatorElement(nextElement);
366
+
367
+ var slidEvent = $.Event(Event.SLID, {
368
+ relatedTarget: nextElement,
369
+ direction: eventDirectionName,
370
+ from: activeElementIndex,
371
+ to: nextElementIndex
372
+ });
373
+
374
+ if ($(this._element).hasClass(ClassName.SLIDE)) {
375
+ $(nextElement).addClass(orderClassName);
376
+ Util.reflow(nextElement);
377
+ $(activeElement).addClass(directionalClassName);
378
+ $(nextElement).addClass(directionalClassName);
379
+ var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
380
+ $(activeElement).one(Util.TRANSITION_END, function () {
381
+ $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
382
+ $(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
383
+ _this3._isSliding = false;
384
+ setTimeout(function () {
385
+ return $(_this3._element).trigger(slidEvent);
386
+ }, 0);
387
+ }).emulateTransitionEnd(transitionDuration);
388
+ } else {
389
+ $(activeElement).removeClass(ClassName.ACTIVE);
390
+ $(nextElement).addClass(ClassName.ACTIVE);
391
+ this._isSliding = false;
392
+ $(this._element).trigger(slidEvent);
393
+ }
394
+
395
+ if (isCycling) {
396
+ this.cycle();
397
+ }
398
+ }; // Static
399
+
400
+
401
+ Carousel._jQueryInterface = function _jQueryInterface(config) {
402
+ return this.each(function () {
403
+ var data = $(this).data(DATA_KEY);
404
+
405
+ var _config = _objectSpread({}, Default, $(this).data());
406
+
407
+ if (typeof config === 'object') {
408
+ _config = _objectSpread({}, _config, config);
409
+ }
410
+
411
+ var action = typeof config === 'string' ? config : _config.slide;
412
+
413
+ if (!data) {
414
+ data = new Carousel(this, _config);
415
+ $(this).data(DATA_KEY, data);
416
+ }
417
+
418
+ if (typeof config === 'number') {
419
+ data.to(config);
420
+ } else if (typeof action === 'string') {
421
+ if (typeof data[action] === 'undefined') {
422
+ throw new TypeError("No method named \"" + action + "\"");
423
+ }
424
+
425
+ data[action]();
426
+ } else if (_config.interval) {
427
+ data.pause();
428
+ data.cycle();
429
+ }
430
+ });
431
+ };
432
+
433
+ Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
434
+ var selector = Util.getSelectorFromElement(this);
435
+
436
+ if (!selector) {
437
+ return;
438
+ }
439
+
440
+ var target = $(selector)[0];
441
+
442
+ if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
443
+ return;
444
+ }
445
+
446
+ var config = _objectSpread({}, $(target).data(), $(this).data());
447
+
448
+ var slideIndex = this.getAttribute('data-slide-to');
449
+
450
+ if (slideIndex) {
451
+ config.interval = false;
452
+ }
453
+
454
+ Carousel._jQueryInterface.call($(target), config);
455
+
456
+ if (slideIndex) {
457
+ $(target).data(DATA_KEY).to(slideIndex);
458
+ }
459
+
460
+ event.preventDefault();
461
+ };
462
+
463
+ _createClass(Carousel, null, [{
464
+ key: "VERSION",
465
+ get: function get() {
466
+ return VERSION;
467
+ }
468
+ }, {
469
+ key: "Default",
470
+ get: function get() {
471
+ return Default;
472
+ }
473
+ }]);
474
+
475
+ return Carousel;
476
+ }();
477
+ /**
478
+ * ------------------------------------------------------------------------
479
+ * Data Api implementation
480
+ * ------------------------------------------------------------------------
481
+ */
482
+
483
+
484
+ $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
485
+ $(window).on(Event.LOAD_DATA_API, function () {
486
+ $(Selector.DATA_RIDE).each(function () {
487
+ var $carousel = $(this);
488
+
489
+ Carousel._jQueryInterface.call($carousel, $carousel.data());
490
+ });
491
+ });
492
+ /**
493
+ * ------------------------------------------------------------------------
494
+ * jQuery
495
+ * ------------------------------------------------------------------------
496
+ */
497
+
498
+ $.fn[NAME] = Carousel._jQueryInterface;
499
+ $.fn[NAME].Constructor = Carousel;
500
+
501
+ $.fn[NAME].noConflict = function () {
502
+ $.fn[NAME] = JQUERY_NO_CONFLICT;
503
+ return Carousel._jQueryInterface;
504
+ };
505
+
506
+ return Carousel;
507
+ }($);