j1-template 2024.3.15 → 2024.3.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/assets/data/amplitude.html +7 -7
  3. data/assets/data/panel.html +4 -3
  4. data/assets/theme/j1/adapter/js/amplitude.js +100 -81
  5. data/assets/theme/j1/adapter/js/masonry.js +2 -2
  6. data/assets/theme/j1/adapter/js/videojs.js +212 -0
  7. data/assets/theme/j1/core/css/themes/unolight/bootstrap.css +7 -4
  8. data/assets/theme/j1/core/css/themes/unolight/bootstrap.css.map +1 -1
  9. data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
  10. data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css.map +1 -1
  11. data/assets/theme/j1/core/js/template.js +4 -0
  12. data/assets/theme/j1/core/js/template.min.js +2 -2
  13. data/assets/theme/j1/core/js/template.min.js.map +1 -1
  14. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.css +81 -1
  15. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.min.css +1 -1
  16. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.css +3 -2
  17. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.min.css +1 -1
  18. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.css +19 -4
  19. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.min.css +1 -1
  20. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/artist.svg +78 -0
  21. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/mute.svg +52 -20
  22. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/next.svg +20 -39
  23. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/now-playing.svg +24 -38
  24. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-hide.svg +85 -0
  25. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-music.svg +85 -0
  26. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-show.svg +85 -0
  27. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist.svg +85 -0
  28. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/previous.svg +18 -37
  29. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-backward.svg +33 -30
  30. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-forward.svg +33 -29
  31. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/small/next.svg +55 -14
  32. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/small/previous.svg +56 -14
  33. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/volume.svg +38 -21
  34. data/assets/theme/j1/modules/amplitudejs/js/amplitude.map +20 -20
  35. data/assets/theme/j1/modules/amplitudejs/js/tech/youtube_example.js +211 -0
  36. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +206 -122
  37. data/assets/theme/j1/modules/videojs/assets/icons/custom-icons/next.svg +82 -0
  38. data/assets/theme/j1/modules/videojs/css/font/README.md +151 -0
  39. data/assets/theme/j1/modules/videojs/css/font/VideoJS.svg +150 -0
  40. data/assets/theme/j1/modules/videojs/css/font/video-js-cdn.css +2012 -0
  41. data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.0.css +32 -0
  42. data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.1.css +31 -0
  43. data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.css +31 -0
  44. data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.min.css +21 -0
  45. data/assets/theme/j1/modules/videojs/css/themes/uno.css +14 -3
  46. data/assets/theme/j1/modules/videojs/css/themes/uno.min.css +1 -1
  47. data/assets/theme/j1/modules/videojs/css/videojs.css +1 -0
  48. data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/LICENSE +13 -0
  49. data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/README.md +75 -0
  50. data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/autocaption.js +149 -0
  51. data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/autocaption.min.js +21 -0
  52. data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/README.md +76 -30
  53. data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/hotkeys.js +64 -53
  54. data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/hotkeys.min.js +1 -1
  55. data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/README.md +133 -0
  56. data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/skipbuttons.js +137 -0
  57. data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/skipbuttons.min.js +21 -0
  58. data/assets/theme/j1/modules/videojs/js/plugins/controls/zoom/zoom.js +15 -12
  59. data/assets/theme/j1/modules/videojs/js/plugins/players/yt/youtube.js +43 -16
  60. data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.3/fastfilereaderext.so +0 -0
  61. data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.3/rubyeventmachine.so +0 -0
  62. data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.4/fastfilereaderext.so +0 -0
  63. data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.4/rubyeventmachine.so +0 -0
  64. data/lib/j1/version.rb +1 -1
  65. data/lib/j1_app/j1_auth_manager/config.rb +0 -4
  66. data/lib/starter_web/Gemfile +45 -22
  67. data/lib/starter_web/README.md +5 -5
  68. data/lib/starter_web/_config.yml +4 -6
  69. data/lib/starter_web/_data/modules/amplitude.yml +9 -399
  70. data/lib/starter_web/_data/modules/defaults/gallery.yml +42 -0
  71. data/lib/starter_web/_data/modules/defaults/videojs.yml +107 -0
  72. data/lib/starter_web/_data/modules/gallery.yml +30 -14
  73. data/lib/starter_web/_data/modules/masonry.yml +15 -0
  74. data/lib/starter_web/_data/modules/videojs.yml +57 -0
  75. data/lib/starter_web/_data/resources.yml +9 -27
  76. data/lib/starter_web/_data/templates/feed.xml +1 -1
  77. data/lib/starter_web/_includes/tables/jekyll_variables.asciidoc +1 -0
  78. data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +4 -1
  79. data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +145 -24
  80. data/lib/starter_web/_plugins/asciidoctor/vimeo-block.rb +4 -1
  81. data/lib/starter_web/_plugins/asciidoctor/wistia-block.rb +313 -0
  82. data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +192 -17
  83. data/lib/starter_web/_plugins/index/lunr.rb +1 -1
  84. data/lib/starter_web/package.json +1 -1
  85. data/lib/starter_web/pages/public/amplitude_yt_tester.adoc +20 -7
  86. data/lib/starter_web/pages/public/manuals/integrations/amplitudejs/amplitudejs-api.adoc +1 -1
  87. data/lib/starter_web/pages/public/manuals/integrations/videojs/youtube-api.adoc +1638 -0
  88. data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +5 -6
  89. data/lib/starter_web/pages/public/tools/previewer/preview_videojs.adoc +203 -0
  90. data/lib/starter_web/pages/{tour → public/tour}/play_audio.adoc +3 -10
  91. data/lib/starter_web/pages/{tour → public/tour}/play_video.adoc +49 -40
  92. metadata +61 -41
  93. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/_pause.svg +0 -19
  94. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/_play.svg +0 -18
  95. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/show-playlist.svg +0 -15
  96. data/assets/theme/j1/modules/jqueryScrollbar/LICENSE +0 -20
  97. data/assets/theme/j1/modules/jqueryScrollbar/README.md +0 -28
  98. data/assets/theme/j1/modules/jqueryScrollbar/css/scrollbar.css +0 -939
  99. data/assets/theme/j1/modules/jqueryScrollbar/css/scrollbar.min.css +0 -20
  100. data/assets/theme/j1/modules/jqueryScrollbar/js/scrollbar.js +0 -851
  101. data/assets/theme/j1/modules/jqueryScrollbar/js/scrollbar.min.js +0 -36
  102. data/assets/theme/j1/modules/jqueryScrollbar/sass/scrollbar.scss +0 -806
  103. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.0.js +0 -794
  104. /data/lib/starter_web/pages/{tour → public/tour}/_includes/attributes.asciidoc +0 -0
  105. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/100_gistblock.asciidoc +0 -0
  106. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_bottom_info.asciidoc +0 -0
  107. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_bottom_left_warning.asciidoc +0 -0
  108. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_bottom_right_danger.asciidoc +0 -0
  109. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_central_success.asciidoc +0 -0
  110. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_full_height_left_info.asciidoc +0 -0
  111. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_full_height_right_success.asciidoc +0 -0
  112. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_table_bs_modal_examples.asciidoc +0 -0
  113. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_top_info.asciidoc +0 -0
  114. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_top_left_info.asciidoc +0 -0
  115. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_top_right_success.asciidoc +0 -0
  116. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/419_advanced_modals_demo.asciidoc +0 -0
  117. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/tables/bs_modal_examples.asciidoc +0 -0
  118. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/themes_bootstrap.asciidoc +0 -0
  119. /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/themes_rouge.asciidoc +0 -0
  120. /data/lib/starter_web/pages/{tour → public/tour}/asciidoc_extensions.adoc +0 -0
  121. /data/lib/starter_web/pages/{tour → public/tour}/bootstrap_themes.adoc +0 -0
  122. /data/lib/starter_web/pages/{tour → public/tour}/highlghter_rouge.adoc +0 -0
  123. /data/lib/starter_web/pages/{tour → public/tour}/icon_fonts.adoc +0 -0
  124. /data/lib/starter_web/pages/{tour → public/tour}/modal_extentions.adoc +0 -0
  125. /data/lib/starter_web/pages/{tour → public/tour}/present_images.adoc +0 -0
  126. /data/lib/starter_web/pages/{tour → public/tour}/quicksearch.adoc +0 -0
  127. /data/lib/starter_web/pages/{tour → public/tour}/responsive_tables.adoc +0 -0
  128. /data/lib/starter_web/pages/{tour → public/tour}/typography.adoc +0 -0
@@ -1,851 +0,0 @@
1
- /*
2
- # -----------------------------------------------------------------------------
3
- # ~/assets/theme/j1/modules/jqueryScrollbar/css/scrollbar.js
4
- # jqueryScrollbar Core JS for J1 Template
5
- #
6
- # Product/Info:
7
- # https://jekyll.one
8
- # https://github.com/gromo/jquery.scrollbar
9
- #
10
- # Copyright (C) 2023, 2024 Juergen Adams
11
- # Copyright (C) 2013 Yuriy Khabarov <13real008@gmail.com>
12
- #
13
- # J1 Template is licensed under the MIT License.
14
- # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE
15
- # jQuery Scrollbar is licensed under the MIT License.
16
- # See: https://github.com/gromo/jquery.scrollbar/blob/master/license-mit.txt
17
- # -----------------------------------------------------------------------------
18
- */
19
-
20
- /**
21
- * jQuery CSS Customizable Scrollbar
22
- *
23
- * Copyright 2015, Yuriy Khabarov
24
- * Dual licensed under the MIT or GPL Version 2 licenses.
25
- *
26
- * If you found bug, please contact me via email <13real008@gmail.com>
27
- *
28
- * @author Yuriy Khabarov aka Gromo
29
- * @version 0.2.11
30
- * @url https://github.com/gromo/jquery.scrollbar/
31
- *
32
- */
33
-
34
- ;(function (root, factory) {
35
- 'use strict';
36
- if (typeof define === 'function' && define.amd) {
37
- define(['jquery'], factory);
38
- } else if (typeof exports !== 'undefined') {
39
- module.exports = factory(require('jquery'));
40
- } else {
41
- factory(jQuery);
42
- }
43
- }(this, function ($) {
44
- 'use strict';
45
-
46
- // init flags & variables
47
- var debug = false;
48
-
49
- var browser = {
50
- data: {
51
- index: 0,
52
- name: 'scrollbar'
53
- },
54
- firefox: /firefox/i.test(navigator.userAgent),
55
- macosx: /mac/i.test(navigator.platform),
56
- msedge: /edge\/\d+/i.test(navigator.userAgent),
57
- msie: /(msie|trident)/i.test(navigator.userAgent),
58
- mobile: /android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent),
59
- overlay: null,
60
- scroll: null,
61
- scrolls: [],
62
- webkit: /webkit/i.test(navigator.userAgent) && !/edge\/\d+/i.test(navigator.userAgent)
63
- };
64
-
65
- browser.scrolls.add = function (instance) {
66
- this.remove(instance).push(instance);
67
- };
68
- browser.scrolls.remove = function (instance) {
69
- while ($.inArray(instance, this) >= 0) {
70
- this.splice($.inArray(instance, this), 1);
71
- }
72
- return this;
73
- };
74
-
75
- var defaults = {
76
- autoScrollSize: true, // automatically calculate scrollsize
77
- autoUpdate: true, // update scrollbar if content/container size changed
78
- debug: false, // debug mode
79
- disableBodyScroll: false, // disable body scroll if mouse over container
80
- duration: 200, // scroll animate duration in ms
81
- ignoreMobile: false, // ignore mobile devices
82
- ignoreOverlay: false, // ignore browsers with overlay scrollbars (mobile, MacOS)
83
- isRtl: false, // is RTL
84
- scrollStep: 30, // scroll step for scrollbar arrows
85
- showArrows: false, // add class to show arrows
86
- stepScrolling: true, // when scrolling to scrollbar mousedown position
87
-
88
- scrollx: null, // horizontal scroll element
89
- scrolly: null, // vertical scroll element
90
-
91
- onDestroy: null, // callback function on destroy,
92
- onFallback: null, // callback function if scrollbar is not initialized
93
- onInit: null, // callback function on first initialization
94
- onScroll: null, // callback function on content scrolling
95
- onUpdate: null // callback function on init/resize (before scrollbar size calculation)
96
- };
97
-
98
-
99
- var BaseScrollbar = function (container) {
100
-
101
- if (!browser.scroll) {
102
- browser.overlay = isScrollOverlaysContent();
103
- browser.scroll = getBrowserScrollSize();
104
- updateScrollbars();
105
-
106
- $(window).resize(function () {
107
- var forceUpdate = false;
108
- if (browser.scroll && (browser.scroll.height || browser.scroll.width)) {
109
- var scroll = getBrowserScrollSize();
110
- if (scroll.height !== browser.scroll.height || scroll.width !== browser.scroll.width) {
111
- browser.scroll = scroll;
112
- forceUpdate = true; // handle page zoom
113
- }
114
- }
115
- updateScrollbars(forceUpdate);
116
- });
117
- }
118
-
119
- this.container = container;
120
- this.namespace = '.scrollbar_' + browser.data.index++;
121
- this.options = $.extend({}, defaults, window.jQueryScrollbarOptions || {});
122
- this.scrollTo = null;
123
- this.scrollx = {};
124
- this.scrolly = {};
125
-
126
- container.data(browser.data.name, this);
127
- browser.scrolls.add(this);
128
- };
129
-
130
- BaseScrollbar.prototype = {
131
- destroy: function () {
132
-
133
- if (!this.wrapper) {
134
- return;
135
- }
136
-
137
- this.container.removeData(browser.data.name);
138
- browser.scrolls.remove(this);
139
-
140
- // init variables
141
- var scrollLeft = this.container.scrollLeft();
142
- var scrollTop = this.container.scrollTop();
143
-
144
- this.container.insertBefore(this.wrapper).css({
145
- "height": "",
146
- "margin": "",
147
- "max-height": ""
148
- })
149
- .removeClass('scroll-content scroll-scrollx_visible scroll-scrolly_visible')
150
- .off(this.namespace)
151
- .scrollLeft(scrollLeft)
152
- .scrollTop(scrollTop);
153
-
154
- this.scrollx.scroll.removeClass('scroll-scrollx_visible').find('div').addBack().off(this.namespace);
155
- this.scrolly.scroll.removeClass('scroll-scrolly_visible').find('div').addBack().off(this.namespace);
156
-
157
- this.wrapper.remove();
158
-
159
- $(document).add('body').off(this.namespace);
160
-
161
- if ($.isFunction(this.options.onDestroy)) {
162
- this.options.onDestroy.apply(this, [this.container]);
163
- }
164
- },
165
- init: function (options) {
166
-
167
- // init variables
168
- var S = this,
169
- c = this.container,
170
- cw = this.containerWrapper || c,
171
- namespace = this.namespace,
172
- o = $.extend(this.options, options || {}),
173
- s = {x: this.scrollx, y: this.scrolly},
174
- w = this.wrapper,
175
- cssOptions = {};
176
-
177
- var initScroll = {
178
- scrollLeft: c.scrollLeft(),
179
- scrollTop: c.scrollTop()
180
- };
181
-
182
- // do not init if in ignorable browser
183
- if ((browser.mobile && o.ignoreMobile)
184
- || (browser.overlay && o.ignoreOverlay)
185
- || (browser.macosx && !browser.webkit) // still required to ignore nonWebKit browsers on Mac
186
- ) {
187
- if ($.isFunction(o.onFallback)) {
188
- o.onFallback.apply(this, [c]);
189
- }
190
- return false;
191
- }
192
-
193
- // init scroll container
194
- if (!w) {
195
- this.wrapper = w = $('<div>').addClass('scroll-wrapper').addClass(c.attr('class'))
196
- .css('position', c.css('position') === 'absolute' ? 'absolute' : 'relative')
197
- .insertBefore(c).append(c);
198
-
199
- if (o.isRtl) {
200
- w.addClass('scroll--rtl');
201
- }
202
-
203
- if (c.is('textarea')) {
204
- this.containerWrapper = cw = $('<div>').insertBefore(c).append(c);
205
- w.addClass('scroll-textarea');
206
- }
207
-
208
- cssOptions = {
209
- "height": "auto",
210
- "margin-bottom": browser.scroll.height * -1 + 'px',
211
- "max-height": ""
212
- };
213
- cssOptions[o.isRtl ? 'margin-left' : 'margin-right'] = browser.scroll.width * -1 + 'px';
214
-
215
- cw.addClass('scroll-content').css(cssOptions);
216
-
217
- c.on('scroll' + namespace, function (event) {
218
- var scrollLeft = c.scrollLeft();
219
- var scrollTop = c.scrollTop();
220
- if (o.isRtl) {
221
- // webkit 0:100
222
- // ie/edge 100:0
223
- // firefox -100:0
224
- switch (true) {
225
- case browser.firefox:
226
- scrollLeft = Math.abs(scrollLeft);
227
- case browser.msedge || browser.msie:
228
- scrollLeft = c[0].scrollWidth - c[0].clientWidth - scrollLeft;
229
- break;
230
- }
231
- }
232
- if ($.isFunction(o.onScroll)) {
233
- o.onScroll.call(S, {
234
- maxScroll: s.y.maxScrollOffset,
235
- scroll: scrollTop,
236
- size: s.y.size,
237
- visible: s.y.visible
238
- }, {
239
- maxScroll: s.x.maxScrollOffset,
240
- scroll: scrollLeft,
241
- size: s.x.size,
242
- visible: s.x.visible
243
- });
244
- }
245
- s.x.isVisible && s.x.scroll.bar.css('left', scrollLeft * s.x.kx + 'px');
246
- s.y.isVisible && s.y.scroll.bar.css('top', scrollTop * s.y.kx + 'px');
247
- });
248
-
249
- /* prevent native scrollbars to be visible on #anchor click */
250
- w.on('scroll' + namespace, function () {
251
- w.scrollTop(0).scrollLeft(0);
252
- });
253
-
254
- if (o.disableBodyScroll) {
255
- var handleMouseScroll = function (event) {
256
- isVerticalScroll(event) ?
257
- s.y.isVisible && s.y.mousewheel(event) :
258
- s.x.isVisible && s.x.mousewheel(event);
259
- };
260
- w.on('MozMousePixelScroll' + namespace, handleMouseScroll);
261
- w.on('mousewheel' + namespace, handleMouseScroll);
262
-
263
- if (browser.mobile) {
264
- w.on('touchstart' + namespace, function (event) {
265
- var touch = event.originalEvent.touches && event.originalEvent.touches[0] || event;
266
- var originalTouch = {
267
- pageX: touch.pageX,
268
- pageY: touch.pageY
269
- };
270
- var originalScroll = {
271
- left: c.scrollLeft(),
272
- top: c.scrollTop()
273
- };
274
- $(document).on('touchmove' + namespace, function (event) {
275
- var touch = event.originalEvent.targetTouches && event.originalEvent.targetTouches[0] || event;
276
- c.scrollLeft(originalScroll.left + originalTouch.pageX - touch.pageX);
277
- c.scrollTop(originalScroll.top + originalTouch.pageY - touch.pageY);
278
- event.preventDefault();
279
- });
280
- $(document).on('touchend' + namespace, function () {
281
- $(document).off(namespace);
282
- });
283
- });
284
- }
285
- }
286
- if ($.isFunction(o.onInit)) {
287
- o.onInit.apply(this, [c]);
288
- }
289
- } else {
290
- cssOptions = {
291
- "height": "auto",
292
- "margin-bottom": browser.scroll.height * -1 + 'px',
293
- "max-height": ""
294
- };
295
- cssOptions[o.isRtl ? 'margin-left' : 'margin-right'] = browser.scroll.width * -1 + 'px';
296
- cw.css(cssOptions);
297
- }
298
-
299
- // init scrollbars & recalculate sizes
300
- $.each(s, function (d, scrollx) {
301
-
302
- var scrollCallback = null;
303
- var scrollForward = 1;
304
- var scrollOffset = (d === 'x') ? 'scrollLeft' : 'scrollTop';
305
- var scrollStep = o.scrollStep;
306
- var scrollTo = function () {
307
- var currentOffset = c[scrollOffset]();
308
- c[scrollOffset](currentOffset + scrollStep);
309
- if (scrollForward == 1 && (currentOffset + scrollStep) >= scrollToValue)
310
- currentOffset = c[scrollOffset]();
311
- if (scrollForward == -1 && (currentOffset + scrollStep) <= scrollToValue)
312
- currentOffset = c[scrollOffset]();
313
- if (c[scrollOffset]() == currentOffset && scrollCallback) {
314
- scrollCallback();
315
- }
316
- }
317
- var scrollToValue = 0;
318
-
319
- if (!scrollx.scroll) {
320
-
321
- scrollx.scroll = S._getScroll(o['scroll' + d]).addClass('scroll-' + d);
322
-
323
- if (o.showArrows) {
324
- scrollx.scroll.addClass('scroll-element_arrows_visible');
325
- }
326
-
327
- scrollx.mousewheel = function (event) {
328
-
329
- if (!scrollx.isVisible || (d === 'x' && isVerticalScroll(event))) {
330
- return true;
331
- }
332
- if (d === 'y' && !isVerticalScroll(event)) {
333
- s.x.mousewheel(event);
334
- return true;
335
- }
336
-
337
- var delta = event.originalEvent.wheelDelta * -1 || event.originalEvent.detail;
338
- var maxScrollValue = scrollx.size - scrollx.visible - scrollx.offset;
339
-
340
- // fix new mozilla
341
- if (!delta) {
342
- if (d === 'x' && !!event.originalEvent.deltaX) {
343
- delta = event.originalEvent.deltaX * 40;
344
- } else if (d === 'y' && !!event.originalEvent.deltaY) {
345
- delta = event.originalEvent.deltaY * 40;
346
- }
347
- }
348
-
349
- if ((delta > 0 && scrollToValue < maxScrollValue) || (delta < 0 && scrollToValue > 0)) {
350
- scrollToValue = scrollToValue + delta;
351
- if (scrollToValue < 0)
352
- scrollToValue = 0;
353
- if (scrollToValue > maxScrollValue)
354
- scrollToValue = maxScrollValue;
355
-
356
- S.scrollTo = S.scrollTo || {};
357
- S.scrollTo[scrollOffset] = scrollToValue;
358
- setTimeout(function () {
359
- if (S.scrollTo) {
360
- c.stop().animate(S.scrollTo, 240, 'linear', function () {
361
- scrollToValue = c[scrollOffset]();
362
- });
363
- S.scrollTo = null;
364
- }
365
- }, 1);
366
- }
367
-
368
- event.preventDefault();
369
- return false;
370
- };
371
-
372
- scrollx.scroll
373
- .on('MozMousePixelScroll' + namespace, scrollx.mousewheel)
374
- .on('mousewheel' + namespace, scrollx.mousewheel)
375
- .on('mouseenter' + namespace, function () {
376
- scrollToValue = c[scrollOffset]();
377
- });
378
-
379
- // handle arrows & scroll inner mousedown event
380
- scrollx.scroll.find('.scroll-arrow, .scroll-element_track')
381
- .on('mousedown' + namespace, function (event) {
382
-
383
- if (event.which != 1) // lmb
384
- return true;
385
-
386
- scrollForward = 1;
387
-
388
- var data = {
389
- eventOffset: event[(d === 'x') ? 'pageX' : 'pageY'],
390
- maxScrollValue: scrollx.size - scrollx.visible - scrollx.offset,
391
- scrollbarOffset: scrollx.scroll.bar.offset()[(d === 'x') ? 'left' : 'top'],
392
- scrollbarSize: scrollx.scroll.bar[(d === 'x') ? 'outerWidth' : 'outerHeight']()
393
- };
394
- var timeout = 0, timer = 0;
395
-
396
- if ($(this).hasClass('scroll-arrow')) {
397
- scrollForward = $(this).hasClass("scroll-arrow_more") ? 1 : -1;
398
- scrollStep = o.scrollStep * scrollForward;
399
- scrollToValue = scrollForward > 0 ? data.maxScrollValue : 0;
400
- if (o.isRtl) {
401
- switch(true){
402
- case browser.firefox:
403
- scrollToValue = scrollForward > 0 ? 0: data.maxScrollValue * -1;
404
- break;
405
- case browser.msie || browser.msedge:
406
- break;
407
- }
408
- }
409
- } else {
410
- scrollForward = (data.eventOffset > (data.scrollbarOffset + data.scrollbarSize) ? 1
411
- : (data.eventOffset < data.scrollbarOffset ? -1 : 0));
412
- if(d === 'x' && o.isRtl && (browser.msie || browser.msedge))
413
- scrollForward = scrollForward * -1;
414
- scrollStep = Math.round(scrollx.visible * 0.75) * scrollForward;
415
- scrollToValue = (data.eventOffset - data.scrollbarOffset -
416
- (o.stepScrolling ? (scrollForward == 1 ? data.scrollbarSize : 0)
417
- : Math.round(data.scrollbarSize / 2)));
418
- scrollToValue = c[scrollOffset]() + (scrollToValue / scrollx.kx);
419
- }
420
-
421
- S.scrollTo = S.scrollTo || {};
422
- S.scrollTo[scrollOffset] = o.stepScrolling ? c[scrollOffset]() + scrollStep : scrollToValue;
423
-
424
- if (o.stepScrolling) {
425
- scrollCallback = function () {
426
- scrollToValue = c[scrollOffset]();
427
- clearInterval(timer);
428
- clearTimeout(timeout);
429
- timeout = 0;
430
- timer = 0;
431
- };
432
- timeout = setTimeout(function () {
433
- timer = setInterval(scrollTo, 40);
434
- }, o.duration + 100);
435
- }
436
-
437
- setTimeout(function () {
438
- if (S.scrollTo) {
439
- c.animate(S.scrollTo, o.duration);
440
- S.scrollTo = null;
441
- }
442
- }, 1);
443
-
444
- return S._handleMouseDown(scrollCallback, event);
445
- });
446
-
447
- // handle scrollbar drag'n'drop
448
- scrollx.scroll.bar.on('mousedown' + namespace, function (event) {
449
-
450
- if (event.which != 1) // lmb
451
- return true;
452
-
453
- var eventPosition = event[(d === 'x') ? 'pageX' : 'pageY'];
454
- var initOffset = c[scrollOffset]();
455
-
456
- scrollx.scroll.addClass('scroll-draggable');
457
-
458
- $(document).on('mousemove' + namespace, function (event) {
459
- var diff = parseInt((event[(d === 'x') ? 'pageX' : 'pageY'] - eventPosition) / scrollx.kx, 10);
460
- if (d === 'x' && o.isRtl && (browser.msie || browser.msedge))
461
- diff = diff * -1;
462
- c[scrollOffset](initOffset + diff);
463
- });
464
-
465
- return S._handleMouseDown(function () {
466
- scrollx.scroll.removeClass('scroll-draggable');
467
- scrollToValue = c[scrollOffset]();
468
- }, event);
469
- });
470
- }
471
- });
472
-
473
- // remove classes & reset applied styles
474
- $.each(s, function (d, scrollx) {
475
- var scrollClass = 'scroll-scroll' + d + '_visible';
476
- var scrolly = (d == "x") ? s.y : s.x;
477
-
478
- scrollx.scroll.removeClass(scrollClass);
479
- scrolly.scroll.removeClass(scrollClass);
480
- cw.removeClass(scrollClass);
481
- });
482
-
483
- // calculate init sizes
484
- $.each(s, function (d, scrollx) {
485
- $.extend(scrollx, (d == "x") ? {
486
- offset: parseInt(c.css('left'), 10) || 0,
487
- size: c.prop('scrollWidth'),
488
- visible: w.width()
489
- } : {
490
- offset: parseInt(c.css('top'), 10) || 0,
491
- size: c.prop('scrollHeight'),
492
- visible: w.height()
493
- });
494
- });
495
-
496
- // update scrollbar visibility/dimensions
497
- this._updateScroll('x', this.scrollx);
498
- this._updateScroll('y', this.scrolly);
499
-
500
- if ($.isFunction(o.onUpdate)) {
501
- o.onUpdate.apply(this, [c]);
502
- }
503
-
504
- // calculate scroll size
505
- $.each(s, function (d, scrollx) {
506
-
507
- var cssOffset = (d === 'x') ? 'left' : 'top';
508
- var cssFullSize = (d === 'x') ? 'outerWidth' : 'outerHeight';
509
- var cssSize = (d === 'x') ? 'width' : 'height';
510
- var offset = parseInt(c.css(cssOffset), 10) || 0;
511
-
512
- var AreaSize = scrollx.size;
513
- var AreaVisible = scrollx.visible + offset;
514
-
515
- var scrollSize = scrollx.scroll.size[cssFullSize]() + (parseInt(scrollx.scroll.size.css(cssOffset), 10) || 0);
516
-
517
- if (o.autoScrollSize) {
518
- scrollx.scrollbarSize = parseInt(scrollSize * AreaVisible / AreaSize, 10);
519
- scrollx.scroll.bar.css(cssSize, scrollx.scrollbarSize + 'px');
520
- }
521
-
522
- scrollx.scrollbarSize = scrollx.scroll.bar[cssFullSize]();
523
- scrollx.kx = ((scrollSize - scrollx.scrollbarSize) / (AreaSize - AreaVisible)) || 1;
524
- scrollx.maxScrollOffset = AreaSize - AreaVisible;
525
- });
526
-
527
- c.scrollLeft(initScroll.scrollLeft).scrollTop(initScroll.scrollTop).trigger('scroll');
528
- },
529
- /**
530
- * Get scrollx/scrolly object
531
- *
532
- * @param {Mixed} scroll
533
- * @returns {jQuery} scroll object
534
- */
535
- _getScroll: function (scroll) {
536
- var types = {
537
- advanced: [
538
- '<div class="scroll-element">',
539
- '<div class="scroll-element_corner"></div>',
540
- '<div class="scroll-arrow scroll-arrow_less"></div>',
541
- '<div class="scroll-arrow scroll-arrow_more"></div>',
542
- '<div class="scroll-element_outer">',
543
- '<div class="scroll-element_size"></div>', // required! used for scrollbar size calculation !
544
- '<div class="scroll-element_inner-wrapper">',
545
- '<div class="scroll-element_inner scroll-element_track">', // used for handling scrollbar click
546
- '<div class="scroll-element_inner-bottom"></div>',
547
- '</div>',
548
- '</div>',
549
- '<div class="scroll-bar">', // required
550
- '<div class="scroll-bar_body">',
551
- '<div class="scroll-bar_body-inner"></div>',
552
- '</div>',
553
- '<div class="scroll-bar_bottom"></div>',
554
- '<div class="scroll-bar_center"></div>',
555
- '</div>',
556
- '</div>',
557
- '</div>'
558
- ].join(''),
559
- simple: [
560
- '<div class="scroll-element">',
561
- '<div class="scroll-element_outer">',
562
- '<div class="scroll-element_size"></div>', // required! used for scrollbar size calculation !
563
- '<div class="scroll-element_track"></div>', // used for handling scrollbar click
564
- '<div class="scroll-bar"></div>', // required
565
- '</div>',
566
- '</div>'
567
- ].join('')
568
- };
569
- if (types[scroll]) {
570
- scroll = types[scroll];
571
- }
572
- if (!scroll) {
573
- scroll = types['simple'];
574
- }
575
- if (typeof (scroll) == 'string') {
576
- scroll = $(scroll).appendTo(this.wrapper);
577
- } else {
578
- scroll = $(scroll);
579
- }
580
- $.extend(scroll, {
581
- bar: scroll.find('.scroll-bar'),
582
- size: scroll.find('.scroll-element_size'),
583
- track: scroll.find('.scroll-element_track')
584
- });
585
- return scroll;
586
- },
587
- _handleMouseDown: function (callback, event) {
588
-
589
- var namespace = this.namespace;
590
-
591
- $(document).on('blur' + namespace, function () {
592
- $(document).add('body').off(namespace);
593
- callback && callback();
594
- });
595
- $(document).on('dragstart' + namespace, function (event) {
596
- event.preventDefault();
597
- return false;
598
- });
599
- $(document).on('mouseup' + namespace, function () {
600
- $(document).add('body').off(namespace);
601
- callback && callback();
602
- });
603
- $('body').on('selectstart' + namespace, function (event) {
604
- event.preventDefault();
605
- return false;
606
- });
607
-
608
- event && event.preventDefault();
609
- return false;
610
- },
611
- _updateScroll: function (d, scrollx) {
612
-
613
- var container = this.container,
614
- containerWrapper = this.containerWrapper || container,
615
- scrollClass = 'scroll-scroll' + d + '_visible',
616
- scrolly = (d === 'x') ? this.scrolly : this.scrollx,
617
- offset = parseInt(this.container.css((d === 'x') ? 'left' : 'top'), 10) || 0,
618
- wrapper = this.wrapper;
619
-
620
- var AreaSize = scrollx.size;
621
- var AreaVisible = scrollx.visible + offset;
622
-
623
- scrollx.isVisible = (AreaSize - AreaVisible) > 1; // bug in IE9/11 with 1px diff
624
- if (scrollx.isVisible) {
625
- scrollx.scroll.addClass(scrollClass);
626
- scrolly.scroll.addClass(scrollClass);
627
- containerWrapper.addClass(scrollClass);
628
- } else {
629
- scrollx.scroll.removeClass(scrollClass);
630
- scrolly.scroll.removeClass(scrollClass);
631
- containerWrapper.removeClass(scrollClass);
632
- }
633
-
634
- if (d === 'y') {
635
- if (container.is('textarea') || AreaSize < AreaVisible) {
636
- containerWrapper.css({
637
- "height": (AreaVisible + browser.scroll.height) + 'px',
638
- "max-height": "none"
639
- });
640
- } else {
641
- containerWrapper.css({
642
- //"height": "auto", // do not reset height value: issue with height:100%!
643
- "max-height": (AreaVisible + browser.scroll.height) + 'px'
644
- });
645
- }
646
- }
647
-
648
- if (scrollx.size != container.prop('scrollWidth')
649
- || scrolly.size != container.prop('scrollHeight')
650
- || scrollx.visible != wrapper.width()
651
- || scrolly.visible != wrapper.height()
652
- || scrollx.offset != (parseInt(container.css('left'), 10) || 0)
653
- || scrolly.offset != (parseInt(container.css('top'), 10) || 0)
654
- ) {
655
- $.extend(this.scrollx, {
656
- offset: parseInt(container.css('left'), 10) || 0,
657
- size: container.prop('scrollWidth'),
658
- visible: wrapper.width()
659
- });
660
- $.extend(this.scrolly, {
661
- offset: parseInt(container.css('top'), 10) || 0,
662
- size: this.container.prop('scrollHeight'),
663
- visible: wrapper.height()
664
- });
665
- this._updateScroll(d === 'x' ? 'y' : 'x', scrolly);
666
- }
667
- }
668
- };
669
-
670
- var CustomScrollbar = BaseScrollbar;
671
-
672
- /*
673
- * Extend jQuery as plugin
674
- *
675
- * @param {Mixed} command to execute
676
- * @param {Mixed} arguments as Array
677
- * @return {jQuery}
678
- */
679
- $.fn.scrollbar = function (command, args) {
680
- if (typeof command !== 'string') {
681
- args = command;
682
- command = 'init';
683
- }
684
- if (typeof args === 'undefined') {
685
- args = [];
686
- }
687
- if (!$.isArray(args)) {
688
- args = [args];
689
- }
690
- this.not('body, .scroll-wrapper').each(function () {
691
- var element = $(this),
692
- instance = element.data(browser.data.name);
693
- if (instance || command === 'init') {
694
- if (!instance) {
695
- instance = new CustomScrollbar(element);
696
- }
697
- if (instance[command]) {
698
- instance[command].apply(instance, args);
699
- }
700
- }
701
- });
702
- return this;
703
- };
704
-
705
- /**
706
- * Connect default options to global object
707
- */
708
- $.fn.scrollbar.options = defaults;
709
-
710
-
711
- /**
712
- * Check if scroll content/container size is changed
713
- */
714
-
715
- var updateScrollbars = (function () {
716
- var timer = 0,
717
- timerCounter = 0;
718
-
719
- return function (force) {
720
- var i, container, options, scroll, wrapper, scrollx, scrolly;
721
- for (i = 0; i < browser.scrolls.length; i++) {
722
- scroll = browser.scrolls[i];
723
- container = scroll.container;
724
- options = scroll.options;
725
- wrapper = scroll.wrapper;
726
- scrollx = scroll.scrollx;
727
- scrolly = scroll.scrolly;
728
- if (force || (options.autoUpdate && wrapper && wrapper.is(':visible') &&
729
- (container.prop('scrollWidth') != scrollx.size || container.prop('scrollHeight') != scrolly.size || wrapper.width() != scrollx.visible || wrapper.height() != scrolly.visible))) {
730
- scroll.init();
731
-
732
- if (options.debug) {
733
- window.console && console.log({
734
- scrollHeight: container.prop('scrollHeight') + ':' + scroll.scrolly.size,
735
- scrollWidth: container.prop('scrollWidth') + ':' + scroll.scrollx.size,
736
- visibleHeight: wrapper.height() + ':' + scroll.scrolly.visible,
737
- visibleWidth: wrapper.width() + ':' + scroll.scrollx.visible
738
- }, true);
739
- timerCounter++;
740
- }
741
- }
742
- }
743
- if (debug && timerCounter > 10) {
744
- window.console && console.log('Scroll updates exceed 10');
745
- updateScrollbars = function () {};
746
- } else {
747
- clearTimeout(timer);
748
- timer = setTimeout(updateScrollbars, 300);
749
- }
750
- };
751
- })();
752
-
753
- /* ADDITIONAL FUNCTIONS */
754
- /**
755
- * Get native browser scrollbar size (height/width)
756
- *
757
- * @param {Boolean} actual size or CSS size, default - CSS size
758
- * @returns {Object} with height, width
759
- */
760
- function getBrowserScrollSize(actualSize) {
761
-
762
- if (browser.webkit && !actualSize) {
763
- return {
764
- height: 0,
765
- width: 0
766
- };
767
- }
768
-
769
- if (!browser.data.outer) {
770
- var css = {
771
- "border": "none",
772
- "box-sizing": "content-box",
773
- "height": "200px",
774
- "margin": "0",
775
- "padding": "0",
776
- "width": "200px"
777
- };
778
- browser.data.inner = $("<div>").css($.extend({}, css));
779
- browser.data.outer = $("<div>").css($.extend({
780
- "left": "-1000px",
781
- "overflow": "scroll",
782
- "position": "absolute",
783
- "top": "-1000px"
784
- }, css)).append(browser.data.inner).appendTo("body");
785
- }
786
-
787
- browser.data.outer.scrollLeft(1000).scrollTop(1000);
788
-
789
- return {
790
- height: Math.ceil((browser.data.outer.offset().top - browser.data.inner.offset().top) || 0),
791
- width: Math.ceil((browser.data.outer.offset().left - browser.data.inner.offset().left) || 0)
792
- };
793
- }
794
-
795
- /**
796
- * Check if native browser scrollbars overlay content
797
- *
798
- * @returns {Boolean}
799
- */
800
- function isScrollOverlaysContent() {
801
- var scrollSize = getBrowserScrollSize(true);
802
- return !(scrollSize.height || scrollSize.width);
803
- }
804
-
805
- function isVerticalScroll(event) {
806
- var e = event.originalEvent;
807
- if (e.axis && e.axis === e.HORIZONTAL_AXIS)
808
- return false;
809
- if (e.wheelDeltaX)
810
- return false;
811
- return true;
812
- }
813
-
814
-
815
- /**
816
- * Extend AngularJS as UI directive
817
- * and expose a provider for override default config
818
- *
819
- */
820
- if (window.angular) {
821
- (function (angular) {
822
- angular.module('jQueryScrollbar', [])
823
- .provider('jQueryScrollbar', function () {
824
- var defaultOptions = defaults;
825
- return {
826
- setOptions: function (options) {
827
- angular.extend(defaultOptions, options);
828
- },
829
- $get: function () {
830
- return {
831
- options: angular.copy(defaultOptions)
832
- };
833
- }
834
- };
835
- })
836
- .directive('jqueryScrollbar', ['jQueryScrollbar', '$parse', function (jQueryScrollbar, $parse) {
837
- return {
838
- restrict: "AC",
839
- link: function (scope, element, attrs) {
840
- var model = $parse(attrs.jqueryScrollbar),
841
- options = model(scope);
842
- element.scrollbar(options || jQueryScrollbar.options)
843
- .on('$destroy', function () {
844
- element.scrollbar('destroy');
845
- });
846
- }
847
- };
848
- }]);
849
- })(window.angular);
850
- }
851
- }));