asset_box 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +60 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +7 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +6 -0
  7. data/Gemfile.lock +35 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +43 -0
  10. data/Rakefile +6 -0
  11. data/asset_box.gemspec +42 -0
  12. data/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  13. data/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +288 -0
  14. data/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  15. data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  16. data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
  17. data/assets/fonts/font-awesome/fa-brands-400.eot +0 -0
  18. data/assets/fonts/font-awesome/fa-brands-400.svg +3717 -0
  19. data/assets/fonts/font-awesome/fa-brands-400.ttf +0 -0
  20. data/assets/fonts/font-awesome/fa-brands-400.woff +0 -0
  21. data/assets/fonts/font-awesome/fa-brands-400.woff2 +0 -0
  22. data/assets/fonts/font-awesome/fa-regular-400.eot +0 -0
  23. data/assets/fonts/font-awesome/fa-regular-400.svg +801 -0
  24. data/assets/fonts/font-awesome/fa-regular-400.ttf +0 -0
  25. data/assets/fonts/font-awesome/fa-regular-400.woff +0 -0
  26. data/assets/fonts/font-awesome/fa-regular-400.woff2 +0 -0
  27. data/assets/fonts/font-awesome/fa-solid-900.eot +0 -0
  28. data/assets/fonts/font-awesome/fa-solid-900.svg +5028 -0
  29. data/assets/fonts/font-awesome/fa-solid-900.ttf +0 -0
  30. data/assets/fonts/font-awesome/fa-solid-900.woff +0 -0
  31. data/assets/fonts/font-awesome/fa-solid-900.woff2 +0 -0
  32. data/assets/images/bootstrap/bg.png +0 -0
  33. data/assets/images/bootstrap/bg_2.png +0 -0
  34. data/assets/images/bootstrap/bg_3.png +0 -0
  35. data/assets/images/bootstrap/bg_4.png +0 -0
  36. data/assets/images/bootstrap/bg_5.png +0 -0
  37. data/assets/images/bootstrap/dark_dots.png +0 -0
  38. data/assets/images/bootstrap/light_dots.png +0 -0
  39. data/assets/images/bootstrap/line.png +0 -0
  40. data/assets/images/bootstrap/line_detail.png +0 -0
  41. data/assets/images/bootstrap/note_dot.png +0 -0
  42. data/assets/images/bootstrap/timer-piece.png +0 -0
  43. data/assets/javascripts/app/bootstrap-datepicker.js +1395 -0
  44. data/assets/javascripts/app/bootstrap-fileupload.min.js +7 -0
  45. data/assets/javascripts/app/bootstrap-modal.js +378 -0
  46. data/assets/javascripts/app/bootstrap-modalmanager.js +423 -0
  47. data/assets/javascripts/app/bootstrap-switch.min.js +22 -0
  48. data/assets/javascripts/app/daterangepicker.js +1635 -0
  49. data/assets/javascripts/app/debounce.js +1492 -0
  50. data/assets/javascripts/app/jquery.appear.js +101 -0
  51. data/assets/javascripts/app/jquery.inputlimiter.1.3.1.min.js +11 -0
  52. data/assets/javascripts/app/jquery.mousewheel.js +84 -0
  53. data/assets/javascripts/app/jquery.serialScroll.min.js +7 -0
  54. data/assets/javascripts/app/moment.min.js +7 -0
  55. data/assets/javascripts/app/perfect-scrollbar.js +584 -0
  56. data/assets/javascripts/app/subview.js +392 -0
  57. data/assets/javascripts/app/velocity.min.js +8 -0
  58. data/assets/javascripts/asset_box.js +16 -0
  59. data/assets/javascripts/bootstrap-sprockets.js +12 -0
  60. data/assets/javascripts/bootstrap.js +2580 -0
  61. data/assets/javascripts/bootstrap.min.js +6 -0
  62. data/assets/javascripts/bootstrap/affix.js +164 -0
  63. data/assets/javascripts/bootstrap/alert.js +95 -0
  64. data/assets/javascripts/bootstrap/button.js +125 -0
  65. data/assets/javascripts/bootstrap/carousel.js +246 -0
  66. data/assets/javascripts/bootstrap/collapse.js +212 -0
  67. data/assets/javascripts/bootstrap/dropdown.js +165 -0
  68. data/assets/javascripts/bootstrap/modal.js +358 -0
  69. data/assets/javascripts/bootstrap/popover.js +123 -0
  70. data/assets/javascripts/bootstrap/scrollspy.js +172 -0
  71. data/assets/javascripts/bootstrap/tab.js +155 -0
  72. data/assets/javascripts/bootstrap/tooltip.js +677 -0
  73. data/assets/javascripts/bootstrap/transition.js +59 -0
  74. data/assets/stylesheets/_asset_box.scss +760 -0
  75. data/assets/stylesheets/_bootstrap-compass.scss +9 -0
  76. data/assets/stylesheets/_bootstrap-mincer.scss +19 -0
  77. data/assets/stylesheets/_bootstrap-sprockets.scss +9 -0
  78. data/assets/stylesheets/_bootstrap.scss +56 -0
  79. data/assets/stylesheets/_bootstrap_login.scss +166 -0
  80. data/assets/stylesheets/_font-awesome-compass.scss +5 -0
  81. data/assets/stylesheets/_font-awesome-sprockets.scss +5 -0
  82. data/assets/stylesheets/_font-awesome.scss +17 -0
  83. data/assets/stylesheets/_font-awesome_v4-shims.scss +6 -0
  84. data/assets/stylesheets/_load_bootstrap.scss +12 -0
  85. data/assets/stylesheets/app/_base.scss +136 -0
  86. data/assets/stylesheets/app/_buttons.scss +1149 -0
  87. data/assets/stylesheets/app/_calendar.scss +343 -0
  88. data/assets/stylesheets/app/_ckeditor.scss +123 -0
  89. data/assets/stylesheets/app/_date-picker.scss +193 -0
  90. data/assets/stylesheets/app/_daterangepicker.scss +269 -0
  91. data/assets/stylesheets/app/_dropdown-menu.scss +137 -0
  92. data/assets/stylesheets/app/_error.scss +84 -0
  93. data/assets/stylesheets/app/_file-upload.scss +16 -0
  94. data/assets/stylesheets/app/_footer.scss +59 -0
  95. data/assets/stylesheets/app/_form-elements.scss +273 -0
  96. data/assets/stylesheets/app/_gallery.scss +205 -0
  97. data/assets/stylesheets/app/_header.scss +158 -0
  98. data/assets/stylesheets/app/_horizontal-menu.scss +169 -0
  99. data/assets/stylesheets/app/_icons.scss +47 -0
  100. data/assets/stylesheets/app/_inputlimiter.scss +34 -0
  101. data/assets/stylesheets/app/_invoice.scss +53 -0
  102. data/assets/stylesheets/app/_lock-screen.scss +72 -0
  103. data/assets/stylesheets/app/_login.scss +105 -0
  104. data/assets/stylesheets/app/_main-container.scss +297 -0
  105. data/assets/stylesheets/app/_messages.scss +311 -0
  106. data/assets/stylesheets/app/_pageslide_left.scss +283 -0
  107. data/assets/stylesheets/app/_pageslide_right.scss +350 -0
  108. data/assets/stylesheets/app/_pagination.scss +254 -0
  109. data/assets/stylesheets/app/_panels.scss +589 -0
  110. data/assets/stylesheets/app/_perfect-scrollbar.scss +111 -0
  111. data/assets/stylesheets/app/_slidingbar.scss +42 -0
  112. data/assets/stylesheets/app/_subview.scss +342 -0
  113. data/assets/stylesheets/app/_tables.scss +68 -0
  114. data/assets/stylesheets/app/_tabs.scss +251 -0
  115. data/assets/stylesheets/app/_tags-input.scss +46 -0
  116. data/assets/stylesheets/app/_theme-style8.scss +308 -0
  117. data/assets/stylesheets/app/_timeline.scss +359 -0
  118. data/assets/stylesheets/app/_user-profile.scss +99 -0
  119. data/assets/stylesheets/app/_utilities.scss +643 -0
  120. data/assets/stylesheets/bootstrap/_alerts.scss +73 -0
  121. data/assets/stylesheets/bootstrap/_badges.scss +68 -0
  122. data/assets/stylesheets/bootstrap/_breadcrumbs.scss +28 -0
  123. data/assets/stylesheets/bootstrap/_button-groups.scss +244 -0
  124. data/assets/stylesheets/bootstrap/_buttons.scss +168 -0
  125. data/assets/stylesheets/bootstrap/_carousel.scss +271 -0
  126. data/assets/stylesheets/bootstrap/_close.scss +37 -0
  127. data/assets/stylesheets/bootstrap/_code.scss +69 -0
  128. data/assets/stylesheets/bootstrap/_component-animations.scss +38 -0
  129. data/assets/stylesheets/bootstrap/_dropdowns.scss +213 -0
  130. data/assets/stylesheets/bootstrap/_forms.scss +607 -0
  131. data/assets/stylesheets/bootstrap/_glyphicons.scss +307 -0
  132. data/assets/stylesheets/bootstrap/_grid.scss +94 -0
  133. data/assets/stylesheets/bootstrap/_input-groups.scss +171 -0
  134. data/assets/stylesheets/bootstrap/_jumbotron.scss +54 -0
  135. data/assets/stylesheets/bootstrap/_labels.scss +66 -0
  136. data/assets/stylesheets/bootstrap/_list-group.scss +128 -0
  137. data/assets/stylesheets/bootstrap/_media.scss +66 -0
  138. data/assets/stylesheets/bootstrap/_mixins.scss +40 -0
  139. data/assets/stylesheets/bootstrap/_modals.scss +150 -0
  140. data/assets/stylesheets/bootstrap/_navbar.scss +656 -0
  141. data/assets/stylesheets/bootstrap/_navs.scss +242 -0
  142. data/assets/stylesheets/bootstrap/_normalize.scss +427 -0
  143. data/assets/stylesheets/bootstrap/_pager.scss +54 -0
  144. data/assets/stylesheets/bootstrap/_pagination.scss +86 -0
  145. data/assets/stylesheets/bootstrap/_panels.scss +271 -0
  146. data/assets/stylesheets/bootstrap/_popovers.scss +126 -0
  147. data/assets/stylesheets/bootstrap/_print.scss +99 -0
  148. data/assets/stylesheets/bootstrap/_progress-bars.scss +87 -0
  149. data/assets/stylesheets/bootstrap/_responsive-embed.scss +35 -0
  150. data/assets/stylesheets/bootstrap/_responsive-utilities.scss +179 -0
  151. data/assets/stylesheets/bootstrap/_scaffolding.scss +161 -0
  152. data/assets/stylesheets/bootstrap/_tables.scss +234 -0
  153. data/assets/stylesheets/bootstrap/_theme.scss +295 -0
  154. data/assets/stylesheets/bootstrap/_thumbnails.scss +38 -0
  155. data/assets/stylesheets/bootstrap/_tooltip.scss +112 -0
  156. data/assets/stylesheets/bootstrap/_type.scss +298 -0
  157. data/assets/stylesheets/bootstrap/_utilities.scss +55 -0
  158. data/assets/stylesheets/bootstrap/_variables.scss +874 -0
  159. data/assets/stylesheets/bootstrap/_wells.scss +29 -0
  160. data/assets/stylesheets/bootstrap/mixins/_alerts.scss +15 -0
  161. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +12 -0
  162. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +18 -0
  163. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +61 -0
  164. data/assets/stylesheets/bootstrap/mixins/_center-block.scss +7 -0
  165. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +22 -0
  166. data/assets/stylesheets/bootstrap/mixins/_forms.scss +88 -0
  167. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +56 -0
  168. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +81 -0
  169. data/assets/stylesheets/bootstrap/mixins/_grid.scss +122 -0
  170. data/assets/stylesheets/bootstrap/mixins/_hide-text.scss +21 -0
  171. data/assets/stylesheets/bootstrap/mixins/_image.scss +28 -0
  172. data/assets/stylesheets/bootstrap/mixins/_labels.scss +12 -0
  173. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +32 -0
  174. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
  175. data/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +9 -0
  176. data/assets/stylesheets/bootstrap/mixins/_opacity.scss +7 -0
  177. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +24 -0
  178. data/assets/stylesheets/bootstrap/mixins/_panels.scss +24 -0
  179. data/assets/stylesheets/bootstrap/mixins/_progress-bar.scss +10 -0
  180. data/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +8 -0
  181. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +18 -0
  182. data/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  183. data/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +17 -0
  184. data/assets/stylesheets/bootstrap/mixins/_size.scss +10 -0
  185. data/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +9 -0
  186. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +28 -0
  187. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +12 -0
  188. data/assets/stylesheets/bootstrap/mixins/_text-overflow.scss +8 -0
  189. data/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +222 -0
  190. data/assets/stylesheets/font-awesome/_animated.scss +20 -0
  191. data/assets/stylesheets/font-awesome/_bordered-pulled.scss +20 -0
  192. data/assets/stylesheets/font-awesome/_core.scss +21 -0
  193. data/assets/stylesheets/font-awesome/_fixed-width.scss +6 -0
  194. data/assets/stylesheets/font-awesome/_icons.scss +1462 -0
  195. data/assets/stylesheets/font-awesome/_larger.scss +23 -0
  196. data/assets/stylesheets/font-awesome/_list.scss +18 -0
  197. data/assets/stylesheets/font-awesome/_mixins.scss +56 -0
  198. data/assets/stylesheets/font-awesome/_path.scss +56 -0
  199. data/assets/stylesheets/font-awesome/_rotated-flipped.scss +24 -0
  200. data/assets/stylesheets/font-awesome/_screen-reader.scss +5 -0
  201. data/assets/stylesheets/font-awesome/_shims.scss +2066 -0
  202. data/assets/stylesheets/font-awesome/_stacked.scss +31 -0
  203. data/assets/stylesheets/font-awesome/_variables.scss +1482 -0
  204. data/bin/console +14 -0
  205. data/bin/setup +8 -0
  206. data/lib/asset_box.rb +89 -0
  207. data/lib/asset_box/rails/engine.rb +22 -0
  208. data/lib/asset_box/rails/helpers.rb +17 -0
  209. data/lib/asset_box/rails/railtie.rb +13 -0
  210. data/lib/asset_box/version.rb +3 -0
  211. metadata +301 -0
@@ -0,0 +1,1492 @@
1
+ var isIE8 = false,
2
+ isIE9 = false,
3
+ inner = $(".main-wrapper > .inner"),
4
+ supportTransition = true,
5
+ closedbar = $(".closedbar"),
6
+ isMobile = false,
7
+ isIEMobile = false,
8
+ $body = $("body"),
9
+ $windowWidth, $windowHeight, subViews = $(".subviews"),
10
+ sideLeft = $('#pageslide-left'),
11
+ sideRight = $('#pageslide-right'),
12
+ mainNavigation = $('.main-navigation'),
13
+ sidebarWidth = sideLeft.outerWidth(true),
14
+ topBar = $(".topbar"),
15
+ mainContainer = $(".main-container"),
16
+ mainContent = $(".main-content"),
17
+ footer = $(".main-wrapper > footer");
18
+ var thisSlider, actualItemWidth, newItemWidth, activeAnimation = false,
19
+ hoverSideBar = false;;
20
+
21
+ // Debounce Function
22
+ (function($, sr) {
23
+ "use strict";
24
+ // debouncing function from John Hann
25
+ // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
26
+ var debounce = function(func, threshold, execAsap) {
27
+ var timeout;
28
+ return function debounced() {
29
+ var obj = this,
30
+ args = arguments;
31
+
32
+ function delayed() {
33
+ if (!execAsap)
34
+ func.apply(obj, args);
35
+ timeout = null;
36
+ };
37
+
38
+ if (timeout)
39
+ clearTimeout(timeout);
40
+ else if (execAsap)
41
+ func.apply(obj, args);
42
+
43
+ timeout = setTimeout(delayed, threshold || 100);
44
+ };
45
+ };
46
+ // smartresize
47
+ jQuery.fn[sr] = function(fn) {
48
+ return fn ? this.on('resize', debounce(fn)) : this.trigger(sr);
49
+ };
50
+
51
+ })(jQuery, 'espressoResize');
52
+
53
+ //Main Function
54
+ var Main = function() {
55
+ "use strict";
56
+ //function to init app
57
+ var runInit = function() {
58
+ // Detection for IE Version
59
+ if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
60
+ var ieversion = new Number(RegExp.$1);
61
+ if (ieversion == 8) {
62
+ isIE8 = true;
63
+ $body.addClass('isIE8');
64
+ } else if (ieversion == 9) {
65
+ isIE9 = true;
66
+ $body.addClass('isIE9');
67
+ }
68
+ }
69
+ // Detection for Mobile Device
70
+ if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
71
+ isMobile = true;
72
+ $body.addClass('isMobile');
73
+ };
74
+ // Detection for CSS Transitions Support
75
+ var thisBody = document.body || document.documentElement,
76
+ thisStyle = thisBody.style;
77
+ supportTransition = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;
78
+ // active perfectScrollbar only in desktop devices
79
+ if ($body.hasClass("isMobile") == false && mainNavigation.length) {
80
+ mainNavigation.perfectScrollbar({
81
+ wheelSpeed: 50,
82
+ minScrollbarLength: 20,
83
+ suppressScrollX: true
84
+ });
85
+ $(".right-wrapper").perfectScrollbar({
86
+ wheelSpeed: 50,
87
+ minScrollbarLength: 20,
88
+ suppressScrollX: true
89
+ });
90
+
91
+ }
92
+ // clones the horizontal menu and inserts it into left sidebar for mobile devices
93
+ if ($("#horizontal-menu").length) {
94
+ if ($(".main-navigation-menu").length) {
95
+ $("#horizontal-menu").find(".nav").clone().removeClass("nav navbar-nav").addClass("main-navigation-menu core-menu").find("li.dropdown").removeClass("dropdown").find("a").removeClass("dropdown-toggle").removeAttr("data-toggle").end().end().find("ul.dropdown-menu").removeClass("dropdown-menu").addClass("sub-menu").end().addClass("hidden-md hidden-lg").insertBefore(".main-navigation-menu");
96
+ } else if ($(".user-profile").length) {
97
+ $("#horizontal-menu").find(".nav").clone().removeClass("nav navbar-nav").addClass("main-navigation-menu core-menu").find("li.dropdown").removeClass("dropdown").find("a").removeClass("dropdown-toggle").removeAttr("data-toggle").end().end().find("ul.dropdown-menu").removeClass("dropdown-menu").addClass("sub-menu").end().addClass("hidden-md hidden-lg").insertAfter(".user-profile");
98
+ } else {
99
+ $("#horizontal-menu").find(".nav").clone().removeClass("nav navbar-nav").addClass("main-navigation-menu core-menu").find("li.dropdown").removeClass("dropdown").find("a").removeClass("dropdown-toggle").removeAttr("data-toggle").end().end().find("ul.dropdown-menu").removeClass("dropdown-menu").addClass("sub-menu").end().addClass("hidden-md hidden-lg").prependTo(".main-navigation");
100
+ }
101
+
102
+ }
103
+
104
+ // set blockUI options
105
+ if ($.blockUI) {
106
+ $.blockUI.defaults.css.border = 'none';
107
+ $.blockUI.defaults.css.padding = '20px 5px';
108
+ $.blockUI.defaults.css.width = '20%';
109
+ $.blockUI.defaults.css.left = '40%';
110
+ $.blockUI.defaults.overlayCSS.backgroundColor = '#DDDDDD';
111
+ }
112
+
113
+ // Add Fade Animation to Dropdown
114
+ $('.dropdown').on('show.bs.dropdown', function(e) {
115
+ $(this).find('.dropdown-menu').first().stop(true, true).fadeIn(300);
116
+ });
117
+ $('.dropdown').on('hide.bs.dropdown', function(e) {
118
+ $(this).find('.dropdown-menu').first().stop(true, true).fadeOut(300);
119
+ });
120
+
121
+ // change closebar height when footer appear
122
+ if ($.fn.appear) {
123
+ if (isMobile == false) {
124
+ footer.appear();
125
+ footer.on("appear", function(event, $all_appeared_elements) {
126
+
127
+ closedbar.css({
128
+ bottom: (footer.outerHeight(true) + 1) + "px"
129
+ });
130
+ });
131
+ footer.on("disappear", function(event, $all_disappeared_elements) {
132
+
133
+ closedbar.css({
134
+ bottom: 1 + "px"
135
+ });
136
+ });
137
+ }
138
+ }
139
+
140
+ };
141
+ //function to get viewport/window size (width and height)
142
+ var viewport = function() {
143
+ var e = window,
144
+ a = 'inner';
145
+ if (!('innerWidth' in window)) {
146
+ a = 'client';
147
+ e = document.documentElement || document.body;
148
+ }
149
+ return {
150
+ width: e[a + 'Width'],
151
+ height: e[a + 'Height']
152
+ };
153
+ };
154
+ //function to close searchbox, pageslide-left and pageslide-right when the user clicks outside of them
155
+ var documentEvents = function() {
156
+ $("html").click(function(e) {
157
+ if (!e.isDefaultPrevented()) {
158
+ if ($('.search-box').is(":visible")) {
159
+ $('.search-box').velocity({
160
+ scale: 0.9,
161
+ opacity: 0
162
+ }, 400, 'easeInBack', function() {
163
+ $(this).hide();
164
+ });
165
+ }
166
+
167
+ if ($body.hasClass("right-sidebar-open") && !hoverSideBar && !isMobile) {
168
+ $(".sb-toggle-right").trigger("click");
169
+ } else if ($body.hasClass("sidebar-mobile-open") && !hoverSideBar && !isMobile) {
170
+ $("header .sb-toggle-left").trigger("click");
171
+ }
172
+ }
173
+ });
174
+ if (isMobile) {
175
+ $("html").swipe({
176
+ swipeLeft: function(event, direction, distance, duration, fingerCount) {
177
+ if ($body.hasClass("sidebar-mobile-open")) {
178
+ $("header .sb-toggle-left").trigger("click");
179
+ }
180
+ },
181
+ swipeRight: function(event, direction, distance, duration, fingerCount) {
182
+ if ($body.hasClass("right-sidebar-open")) {
183
+ $(".sb-toggle-right").trigger("click");
184
+ }
185
+ }
186
+ });
187
+ }
188
+
189
+ };
190
+
191
+ // function to handle SlideBar Toggle
192
+ var runSideBarToggle = function() {
193
+ $(".sb_toggle").click(function() {
194
+ var sb_toggle = $(this);
195
+ $("#slidingbar").slideToggle("fast", function() {
196
+ if (sb_toggle.hasClass('open')) {
197
+ sb_toggle.removeClass('open');
198
+ } else {
199
+ sb_toggle.addClass('open');
200
+ }
201
+ });
202
+ });
203
+ };
204
+ // function to adjust the template elements based on the window size
205
+ var runElementsPosition = function() {
206
+ $windowWidth = viewport().width;
207
+ $windowHeight = viewport().height;
208
+ runContainerHeight();
209
+
210
+ };
211
+
212
+ //function to adapt the Main Content height to the Main Navigation height
213
+ var runContainerHeight = function() {
214
+ if (subViews.is(':visible')) {
215
+ $('.main-container').css({
216
+
217
+ 'max-height': $windowHeight - topBar.outerHeight(true),
218
+ 'min-height': $windowHeight - topBar.outerHeight(true),
219
+
220
+ });
221
+ }
222
+ if ($("#slidingbar-area").is(':visible')) {
223
+ $("#slidingbar-area").css({
224
+ 'max-height': $windowHeight
225
+ });
226
+ }
227
+ if ($windowWidth > 991) {
228
+ mainNavigation.css({
229
+ height: $windowHeight - topBar.outerHeight(true) - $(".slide-tools").outerHeight(true)
230
+ });
231
+ $(".navbar-content").css({
232
+ height: $windowHeight - topBar.outerHeight(true)
233
+ });
234
+ } else {
235
+ mainNavigation.css({
236
+ height: $windowHeight - $(".slide-tools").outerHeight(true)
237
+ });
238
+ $(".navbar-content").css({
239
+ height: $windowHeight
240
+ });
241
+ }
242
+
243
+ $(".right-wrapper").css({
244
+ height: $windowHeight
245
+ });
246
+
247
+ if ($body.hasClass("isMobile") == false && mainNavigation.length) {
248
+ mainNavigation.perfectScrollbar('update');
249
+ $(".right-wrapper").perfectScrollbar('update');
250
+ }
251
+ if ($("#horizontal-menu").length) {
252
+ mainContent.css({
253
+ "min-height": $windowHeight - topBar.outerHeight(true) - $("#horizontal-menu").outerHeight(true) - footer.outerHeight(true)
254
+ });
255
+ } else {
256
+ mainContent.css({
257
+ "min-height": $windowHeight - topBar.outerHeight(true) - footer.outerHeight(true)
258
+ });
259
+ }
260
+
261
+ if (subViews.is(":visible")) {
262
+ subViews.css({
263
+ height: $windowHeight - topBar.outerHeight(true) - $(".toolbar").outerHeight(true)
264
+ });
265
+ }
266
+
267
+ };
268
+ // function to activate the ToDo list, if present
269
+ var runToDoAction = function() {
270
+ if ($(".todo-actions").length) {
271
+ $(".todo-actions > i").click(function() {
272
+ if ($(this).hasClass("fa-square-o") || $(this).hasClass("icon-check-empty")) {
273
+
274
+ $(this).removeClass("fa-square-o").addClass("fa-check-square-o").parent().find("span").css({
275
+ opacity: .25
276
+ }).end().find(".todo-tools").hide().end().parent().find(".desc").css("text-decoration", "line-through");
277
+ } else {
278
+ $(this).removeClass("fa-check-square-o").addClass("fa-square-o").parent().find("span").css({
279
+ opacity: 1
280
+ }).end().find(".todo-tools").show().end().parent().find(".desc").css("text-decoration", "none");
281
+ }
282
+ return !1;
283
+ });
284
+ }
285
+ };
286
+ //capture the user's attention with some animation
287
+ var runAnimatedElements = function() {
288
+ /*
289
+ if($('.messages-count').length) {
290
+ setTimeout(function() {
291
+ $('.messages-count').removeClass('hide');
292
+ $('.messages-count').addClass('animated bounceIn');
293
+ }, 4000);
294
+ }
295
+ */
296
+ if ($('.tooltip-notification').length) {
297
+ setTimeout(function() {
298
+ $('.tooltip-notification').removeClass('hide');
299
+ $('.tooltip-notification').addClass('animated fadeIn');
300
+ }, 5000);
301
+ setTimeout(function() {
302
+ $('.tooltip-notification').velocity({
303
+ opacity: 0
304
+ }, 300, 'ease', function() {
305
+ $(this).removeClass('animated bounceIn').addClass('hide');
306
+ });
307
+ }, 8000);
308
+ }
309
+
310
+ if ($('.notifications-count').length) {
311
+ setTimeout(function() {
312
+ $('.notifications-count').removeClass('hide');
313
+ $('.notifications-count').addClass('animated bounceIn');
314
+ }, 10000);
315
+ }
316
+ };
317
+ //function to run quick chat
318
+ var runQuickChat = function() {
319
+ $("#users").css({
320
+ minHeight: $("#users .users-list").outerHeight()
321
+ });
322
+ $(".users-list .media a").on("click", function(e) {
323
+ $(this).closest(".tab-pane").find(".user-chat").show().end().css({
324
+ right: sideRight.outerWidth()
325
+ });
326
+ $(".right-wrapper").perfectScrollbar('update');
327
+ e.preventDefault();
328
+ });
329
+ $(".user-chat .sidebar-back").on("click", function(e) {
330
+ $(this).closest(".tab-pane").find(".user-chat").hide().end().css({
331
+ right: 0
332
+ });
333
+ $(".right-wrapper").perfectScrollbar('update');
334
+ e.preventDefault();
335
+ });
336
+
337
+ $('#sidebar-tab a').on('shown.bs.tab', function(e) {
338
+
339
+ $(".right-wrapper").perfectScrollbar('update');
340
+ });
341
+ };
342
+ //Search Box Function
343
+ var setSearchMenu = function() {
344
+ $('.menu-search > a').on('click', function(e) {
345
+ if ($('.search-box').is(":hidden")) {
346
+ $('.search-box').css({
347
+ scale: 0.8,
348
+ opacity: 0,
349
+ display: 'block'
350
+ }).velocity({
351
+ scale: 1,
352
+ opacity: 1
353
+ }, 400, 'easeOutBack');
354
+ } else {
355
+ $('.search-box').velocity({
356
+ scale: 0.9,
357
+ opacity: 0
358
+ }, 400, 'easeInBack', function() {
359
+ $(this).hide();
360
+ });
361
+ }
362
+ e.preventDefault();
363
+
364
+ });
365
+ $('.menu-search').on('click', function(e) {
366
+ e.preventDefault();
367
+ });
368
+ };
369
+ //function to activate the Tooltips, if present
370
+ var runTooltips = function() {
371
+ if ($(".tooltips").length) {
372
+ $('.tooltips').tooltip();
373
+ }
374
+ };
375
+ //function to activate the Popovers, if present
376
+ var runPopovers = function() {
377
+ if ($(".popovers").length) {
378
+ $('.popovers').popover();
379
+ }
380
+ };
381
+ // function to allow a button or a link to open a tab
382
+ var runShowTab = function(e) {
383
+ if ($(".show-tab").length) {
384
+ $('.show-tab').on('click', function(e) {
385
+ e.preventDefault();
386
+ var tabToShow = $(this).attr("href");
387
+ if ($(tabToShow).length) {
388
+ $('a[href="' + tabToShow + '"]').tab('show');
389
+ }
390
+ });
391
+ };
392
+ if (getParameterByName('tabId').length) {
393
+ $('a[href="#' + getParameterByName('tabId') + '"]').tab('show');
394
+ }
395
+ };
396
+ // function to enable panel scroll with perfectScrollbar
397
+ var runPanelScroll = function() {
398
+ if ($(".panel-scroll").length && $body.hasClass("isMobile") == false) {
399
+ $('.panel-scroll').perfectScrollbar({
400
+ wheelSpeed: 50,
401
+ minScrollbarLength: 20,
402
+ suppressScrollX: true
403
+ });
404
+ }
405
+ };
406
+ //function to activate the panel tools
407
+ var runModuleTools = function() {
408
+ // fullscreen
409
+ $('body').on('click', '.panel-expand', function(e) {
410
+ e.preventDefault();
411
+ $('.panel-tools > a, .panel-tools .dropdown').hide();
412
+
413
+ if ($('.full-white-backdrop').length == 0) {
414
+ $body.append('<div class="full-white-backdrop"></div>');
415
+ }
416
+ var backdrop = $('.full-white-backdrop');
417
+ var wbox = $(this).parent().parents('.panel');
418
+ wbox.attr('style', '');
419
+ if (wbox.hasClass('panel-full-screen')) {
420
+ //start add by nby for https://redmine.a-it.jp/issues/123534 关闭全画面时回到之前的状态,如果收缩就显示回收缩
421
+ var bodyPanel = jQuery(this).parent().closest(".panel").children(".panel-body");
422
+ var collapse_obj = $(this).parent().children().children(".pull-right").children("li:first").children(".panel-collapse");//找到页面上是展开还是收缩
423
+ if(collapse_obj.hasClass('expand')){
424
+ bodyPanel.hide();
425
+ }
426
+ //end
427
+ backdrop.fadeIn(200, function() {
428
+ //add by shuh 2016-12-01 #121658
429
+ wbox.parents('div.modal-dialog-parent').removeClass('modal-dialog-parent').addClass('modal-dialog modal-lg');
430
+
431
+ $('.panel-tools > .tmp-tool').remove();
432
+ $('.panel-tools > a, .panel-tools .dropdown').show();
433
+ wbox.removeClass('panel-full-screen');
434
+ backdrop.fadeOut(200, function() {
435
+ backdrop.remove();
436
+ $(window).trigger('resize');
437
+ });
438
+ });
439
+ } else {
440
+ //start add by nby for https://redmine.a-it.jp/issues/123534 点击全画面展开项目内容
441
+ var bodyPanel = jQuery(this).parent().closest(".panel").children(".panel-body");
442
+ bodyPanel.show();
443
+ //end
444
+ backdrop.fadeIn(200, function() {
445
+ //add by shuh 2016-12-01 #121658
446
+ wbox.parents('div.modal-dialog').removeClass('modal-dialog modal-lg').addClass('modal-dialog-parent');
447
+
448
+ $('.panel-tools').append("<a class='panel-expand tmp-tool' href='#'><i class='fa fa-compress'></i></a>");
449
+ backdrop.fadeOut(200, function() {
450
+ backdrop.hide();
451
+ });
452
+ wbox.addClass('panel-full-screen').css({
453
+ 'max-height': $windowHeight,
454
+ 'overflow': 'auto'
455
+ });
456
+ $(window).trigger('resize');
457
+ });
458
+ }
459
+ });
460
+ // panel close
461
+ $('body').on('click', '.panel-close', function(e) {
462
+ $(this).parents(".panel").fadeOut();
463
+ e.preventDefault();
464
+ });
465
+ // panel refresh
466
+ $('body').on('click', '.panel-refresh', function(e) {
467
+ var el = $(this).parents(".panel");
468
+ el.block({
469
+ overlayCSS: {
470
+ backgroundColor: '#fff'
471
+ },
472
+ message: '<i class="fa fa-spinner fa-spin"></i>',
473
+ css: {
474
+ border: 'none',
475
+ color: '#333',
476
+ background: 'none'
477
+ }
478
+ });
479
+ window.setTimeout(function() {
480
+ el.unblock();
481
+ }, 1000);
482
+ e.preventDefault();
483
+ });
484
+ // panel collapse
485
+ $('body').on('click', '.panel-collapse', function(e) {
486
+ e.preventDefault();
487
+ var el = $(this);
488
+ var bodyPanel = jQuery(this).parent().closest(".panel").children(".panel-body");
489
+ if ($(this).hasClass("collapses")) {
490
+ bodyPanel.slideUp(200, function() {
491
+ el.addClass("expand").removeClass("collapses").children("span").text("展開").end().children("i").addClass("fa-rotate-180");
492
+ });
493
+ } else {
494
+ bodyPanel.slideDown(200, function() {
495
+ el.addClass("collapses").removeClass("expand").children("span").text("折りたたみ").end().children("i").removeClass("fa-rotate-180");
496
+ });
497
+ }
498
+ });
499
+ };
500
+
501
+ //function to activate the main menu functionality
502
+ var runNavigationMenu = function() {
503
+ if ($("body").hasClass("single-page") == false) {
504
+ $('.main-navigation-menu > li.active').addClass('open');
505
+ $('.main-navigation-menu > li a').on('click', function() {
506
+
507
+ if ($(this).parent().children('ul').hasClass('sub-menu') && ((!$body.hasClass('navigation-small') || $windowWidth < 767) || !$(this).parent().parent().hasClass('main-navigation-menu'))) {
508
+ if (!$(this).parent().hasClass('open')) {
509
+ $(this).parent().addClass('open');
510
+ $(this).parent().parent().children('li.open').not($(this).parent()).not($('.main-navigation-menu > li.active')).removeClass('open').children('ul').slideUp(200);
511
+ $(this).parent().children('ul').slideDown(200, function() {
512
+ if (mainNavigation.height() > $(".main-navigation-menu").outerHeight()) {
513
+
514
+ mainNavigation.scrollTo($(this).parent("li"), 300, {
515
+ onAfter: function() {
516
+ if ($body.hasClass("isMobile") == false) {
517
+ mainNavigation.perfectScrollbar('update');
518
+ }
519
+ }
520
+ });
521
+ } else {
522
+
523
+ mainNavigation.scrollTo($(this).parent("li"), 300, {
524
+ onAfter: function() {
525
+ if ($body.hasClass("isMobile") == false) {
526
+ mainNavigation.perfectScrollbar('update');
527
+ }
528
+ }
529
+ });
530
+ }
531
+ });
532
+ } else {
533
+ if (!$(this).parent().hasClass('active')) {
534
+ $(this).parent().parent().children('li.open').not($('.main-navigation-menu > li.active')).removeClass('open').children('ul').slideUp(200, function() {
535
+ if (mainNavigation.height() > $(".main-navigation-menu").outerHeight()) {
536
+ mainNavigation.scrollTo(0, 300, {
537
+ onAfter: function() {
538
+ if ($body.hasClass("isMobile") == false) {
539
+ mainNavigation.perfectScrollbar('update');
540
+ }
541
+ }
542
+ });
543
+ } else {
544
+ mainNavigation.scrollTo($(this).parent("li").closest("ul").children("li:eq(0)"), 300, {
545
+ onAfter: function() {
546
+ if ($body.hasClass("isMobile") == false) {
547
+ mainNavigation.perfectScrollbar('update');
548
+ }
549
+ }
550
+ });
551
+ }
552
+ });
553
+ } else {
554
+ $(this).parent().parent().children('li.open').removeClass('open').children('ul').slideUp(200, function() {
555
+ if (mainNavigation.height() > $(".main-navigation-menu").outerHeight()) {
556
+ mainNavigation.scrollTo(0, 300, {
557
+ onAfter: function() {
558
+ if ($body.hasClass("isMobile") == false) {
559
+ mainNavigation.perfectScrollbar('update');
560
+ }
561
+ }
562
+ });
563
+ } else {
564
+ mainNavigation.scrollTo($(this).parent("li"), 300, {
565
+ onAfter: function() {
566
+ if ($body.hasClass("isMobile") == false) {
567
+ mainNavigation.perfectScrollbar('update');
568
+ }
569
+ }
570
+ });
571
+ }
572
+ });
573
+ }
574
+ }
575
+ } else {
576
+ $(this).parent().addClass('active');
577
+ }
578
+ });
579
+ } else {
580
+ var url, ajaxContainer = $("#ajax-content");
581
+ var start = $('.main-navigation-menu li.start');
582
+ if (start.length) {
583
+ start.addClass("active");
584
+ if (start.closest('ul').hasClass('sub-menu')) {
585
+ start.closest('ul').parent('li').addClass('active open');
586
+ }
587
+ url = start.children("a").attr("href");
588
+ ajaxLoader(url, ajaxContainer);
589
+ }
590
+ $('.main-navigation-menu > li.active').addClass('open');
591
+ $('.main-navigation-menu > li a').on('click', function(e) {
592
+ e.preventDefault();
593
+ var $this = $(this);
594
+
595
+ if ($this.parent().children('ul').hasClass('sub-menu') && (!$('body').hasClass('navigation-small') || !$this.parent().parent().hasClass('main-navigation-menu'))) {
596
+ if (!$this.parent().hasClass('open')) {
597
+ $this.parent().addClass('open');
598
+ $this.parent().parent().children('li.open').not($this.parent()).not($('.main-navigation-menu > li.active')).removeClass('open').children('ul').slideUp(200);
599
+ $this.parent().children('ul').slideDown(200, function() {
600
+ runContainerHeight();
601
+ });
602
+ } else {
603
+ if (!$this.parent().hasClass('active')) {
604
+ $this.parent().parent().children('li.open').not($('.main-navigation-menu > li.active')).removeClass('open').children('ul').slideUp(200, function() {
605
+ runContainerHeight();
606
+ });
607
+ } else {
608
+ $this.parent().parent().children('li.open').removeClass('open').children('ul').slideUp(200, function() {
609
+ runContainerHeight();
610
+ });
611
+ }
612
+ }
613
+ } else {
614
+
615
+ $('.main-navigation-menu ul.sub-menu li').removeClass('active');
616
+ $this.parent().addClass('active');
617
+ var closestUl = $this.parent('li').closest('ul');
618
+ if (closestUl.hasClass('main-navigation-menu')) {
619
+ $('.main-navigation-menu > li.active').removeClass('active').removeClass('open').children('ul').slideUp(200);
620
+ $this.parents('li').addClass('active');
621
+ } else if (!closestUl.parent('li').hasClass('active') && !closestUl.parent('li').closest('ul').hasClass('sub-menu')) {
622
+ $('.main-navigation-menu > li.active').removeClass('active').removeClass('open').children('ul').slideUp(200);
623
+ $this.parent('li').closest('ul').parent('li').addClass('active');
624
+ } else {
625
+
626
+ if (closestUl.parent('li').closest('ul').hasClass('sub-menu')) {
627
+ if (!closestUl.parents('li.open').hasClass('active')) {
628
+ $('.main-navigation-menu > li.active').removeClass('active').removeClass('open').children('ul').slideUp(200);
629
+ closestUl.parents('li.open').addClass('active');
630
+ }
631
+ }
632
+
633
+ }
634
+ url = $(this).attr("href");
635
+ ajaxLoader(url, ajaxContainer);
636
+ };
637
+ });
638
+ }
639
+ };
640
+ // function to load content with ajax
641
+ var ajaxLoader = function(url, element) {
642
+ element.removeClass("fadeIn shake");
643
+ var backdrop = $('.ajax-white-backdrop');
644
+
645
+ $(".main-container").append('<div class="ajax-white-backdrop"></div>');
646
+ backdrop.show();
647
+
648
+ if ($body.hasClass("sidebar-mobile-open")) {
649
+ var configAnimation, extendOptions, globalOptions = {
650
+ duration: 200,
651
+ easing: "ease",
652
+ mobileHA: true,
653
+ progress: function() {
654
+ activeAnimation = true;
655
+ }
656
+ };
657
+ extendOptions = {
658
+ complete: function() {
659
+ inner.attr('style', '').removeClass("inner-transform");
660
+ // remove inner-transform (hardware acceleration) for restore z-index
661
+ $body.removeClass("sidebar-mobile-open");
662
+ loadPage(url, element);
663
+ activeAnimation = false;
664
+ }
665
+ };
666
+ configAnimation = $.extend({}, extendOptions, globalOptions);
667
+
668
+ inner.velocity({
669
+ translateZ: 0,
670
+ translateX: [-sidebarWidth, 0]
671
+ }, configAnimation);
672
+ } else {
673
+ loadPage(url, element);
674
+ }
675
+
676
+ function loadPage(url, element) {
677
+ $.ajax({
678
+ type: "GET",
679
+ cache: false,
680
+ url: url,
681
+ dataType: "html",
682
+ success: function(data) {
683
+ backdrop.remove();
684
+
685
+ element.html(data).addClass("fadeIn");
686
+
687
+ },
688
+ error: function(xhr, ajaxOptions, thrownError) {
689
+ backdrop.remove();
690
+ element.html('<h4>Could not load the requested content.</h4>').addClass("shake");
691
+
692
+ }
693
+ });
694
+ };
695
+ };
696
+ // function to initiate owlCarousel
697
+ var runESlider = function(options) {
698
+ $(".e-slider").each(function() {
699
+ var slider = $(this);
700
+ var setAutoPlay = !isMobile;
701
+ // AutoPlay False for mobile devices
702
+ var defaults = {
703
+ mouseDrag: false,
704
+ touchDrag: true,
705
+ slideSpeed: 300,
706
+ paginationSpeed: 400,
707
+ singleItem: true,
708
+ navigation: false,
709
+ autoPlay: setAutoPlay
710
+ };
711
+ var config = $.extend({}, defaults, options, slider.data("plugin-options"));
712
+
713
+ // Initialize Slider
714
+ slider.owlCarousel(config);
715
+ });
716
+ };
717
+
718
+ // function to activate Selectpicker, if present
719
+ var runSelecticker = function() {
720
+ if ($.fn.selectpicker) {
721
+ $('.selectpicker').selectpicker();
722
+ }
723
+ };
724
+ // function to activate moment#fromNow
725
+ var runTimeStamp = function() {
726
+ $(".timestamp").each(function() {
727
+ var startOfPeriod = moment($(this).attr("title"));
728
+ $(this).text(moment(startOfPeriod).startOf('hour').fromNow());
729
+ });
730
+ };
731
+ //function to Right and Left PageSlide
732
+ var runToggleSideBars = function() {
733
+ var configAnimation, extendOptions, globalOptions = {
734
+ duration: 150,
735
+ easing: "ease",
736
+ mobileHA: true,
737
+ progress: function() {
738
+ activeAnimation = true;
739
+ }
740
+ };
741
+ $("#pageslide-left, #pageslide-right").on("mouseover", function(e) {
742
+ hoverSideBar = true;
743
+ }).on("mouseleave", function(e) {
744
+ hoverSideBar = false;
745
+ });
746
+ $(".sb-toggle-left, .closedbar").on("click", function(e) {
747
+ if (activeAnimation == false) {
748
+ if ($windowWidth > 991) {
749
+ $body.removeClass("sidebar-mobile-open");
750
+ if ($body.hasClass("sidebar-close")) {
751
+ if ($body.hasClass("layout-boxed") || $body.hasClass("isMobile")) {
752
+ $body.removeClass("sidebar-close");
753
+ closedbar.removeClass("open");
754
+ $(window).trigger('resize');
755
+ } else {
756
+ closedbar.removeClass("open").hide();
757
+ closedbar.css({
758
+ //translateZ: 0,
759
+ left: -closedbar.width()
760
+ });
761
+
762
+ extendOptions = {
763
+ complete: function() {
764
+ $body.removeClass("sidebar-close");
765
+ // $(".main-container, #pageslide-left, #footer .footer-inner, #horizontal-menu .container, .closedbar").attr('style', '');
766
+ $(window).trigger('resize');
767
+ activeAnimation = false;
768
+ }
769
+ };
770
+ configAnimation = $.extend({}, extendOptions, globalOptions);
771
+ $(".main-container, footer .footer-inner, #horizontal-menu .container").velocity({
772
+ //translateZ: 0,
773
+ marginLeft: sidebarWidth
774
+ }, configAnimation);
775
+
776
+ }
777
+
778
+ } else {
779
+ if ($body.hasClass("layout-boxed") || $body.hasClass("isMobile")) {
780
+ $body.addClass("sidebar-close");
781
+ closedbar.addClass("open");
782
+ $(window).trigger('resize');
783
+ } else {
784
+ sideLeft.css({
785
+ zIndex: 0
786
+
787
+ });
788
+ extendOptions = {
789
+ complete: function() {
790
+ closedbar.show().velocity({
791
+ //translateZ: 0,
792
+ left: 0
793
+ }, 100, 'ease', function() {
794
+ activeAnimation = false;
795
+ closedbar.addClass("open");
796
+ $body.addClass("sidebar-close");
797
+ // $(".main-container, footer .footer-inner, #horizontal-menu .container, .closedbar").attr('style', '');
798
+ $("#pageslide-left").css('z-index','');
799
+ $(window).trigger('resize');
800
+ });
801
+ }
802
+ };
803
+ configAnimation = $.extend({}, extendOptions, globalOptions);
804
+ $(".main-container, footer .footer-inner, #horizontal-menu .container").velocity({
805
+ //translateZ: 0,
806
+ marginLeft: 0
807
+ }, configAnimation);
808
+ }
809
+ }
810
+
811
+ } else {
812
+ if ($body.hasClass("sidebar-mobile-open")) {
813
+ if (supportTransition) {
814
+ extendOptions = {
815
+ complete: function() {
816
+ inner.attr('style', '').removeClass("inner-transform");
817
+ // remove inner-transform (hardware acceleration) for restore z-index
818
+ $body.removeClass("sidebar-mobile-open");
819
+ activeAnimation = false;
820
+ }
821
+ };
822
+ configAnimation = $.extend({}, extendOptions, globalOptions);
823
+
824
+ inner.velocity({
825
+ translateZ: 0,
826
+ translateX: [-sidebarWidth, 0]
827
+ }, configAnimation);
828
+ } else {
829
+ $body.removeClass("sidebar-mobile-open");
830
+ }
831
+ } else {
832
+ if (supportTransition) {
833
+ inner.addClass("inner-transform");
834
+ // add inner-transform for hardware acceleration
835
+ extendOptions = {
836
+ complete: function() {
837
+ inner.attr('style', '');
838
+ $body.addClass("sidebar-mobile-open");
839
+ activeAnimation = false;
840
+ }
841
+ };
842
+ configAnimation = $.extend({}, extendOptions, globalOptions);
843
+ inner.velocity({
844
+ translateZ: 0,
845
+ translateX: [sidebarWidth, 0]
846
+ }, configAnimation);
847
+ } else {
848
+ $body.addClass("sidebar-mobile-open");
849
+ }
850
+
851
+ }
852
+ }
853
+ }
854
+ e.preventDefault();
855
+ });
856
+ $(".sb-toggle-right").on("click", function(e) {
857
+ if (activeAnimation == false) {
858
+ if ($windowWidth > 991) {
859
+ $body.removeClass("sidebar-mobile-open");
860
+ }
861
+ if ($body.hasClass("right-sidebar-open")) {
862
+ if (supportTransition) {
863
+ extendOptions = {
864
+ complete: function() {
865
+ inner.attr('style', '').removeClass("inner-transform");
866
+ // remove inner-transform (hardware acceleration) for restore z-index
867
+ $body.removeClass("right-sidebar-open");
868
+ activeAnimation = false;
869
+ }
870
+ };
871
+ configAnimation = $.extend({}, extendOptions, globalOptions);
872
+ inner.velocity({
873
+ translateZ: 0,
874
+ translateX: [sidebarWidth, 0]
875
+ }, configAnimation);
876
+ } else {
877
+ $body.removeClass("right-sidebar-open");
878
+ }
879
+ } else {
880
+ if (supportTransition) {
881
+ inner.addClass("inner-transform");
882
+ // add inner-transform for hardware acceleration
883
+ extendOptions = {
884
+ complete: function() {
885
+ inner.attr('style', '');
886
+ $body.addClass("right-sidebar-open");
887
+ activeAnimation = false;
888
+ }
889
+ };
890
+ configAnimation = $.extend({}, extendOptions, globalOptions);
891
+ inner.velocity({
892
+ translateZ: 0,
893
+ translateX: [-sidebarWidth, 0]
894
+ }, configAnimation);
895
+ } else {
896
+ $body.addClass("right-sidebar-open");
897
+ }
898
+ }
899
+ }
900
+ e.preventDefault();
901
+ });
902
+ };
903
+ // function to activate ClosedBar Button
904
+ var runClosedBarButton = function() {
905
+ var t;
906
+ closedbar.mouseover(function() {
907
+ if ($body.hasClass("layout-boxed") == false && $body.hasClass("isMobile") == false && closedbar.hasClass("open")) {
908
+ t = setTimeout(function() {
909
+ closedbar.velocity({
910
+ left: -closedbar.width()
911
+ }, 100, 'ease');
912
+ sideLeft.css({
913
+ left: -sidebarWidth,
914
+ zIndex: 1021
915
+ }).velocity({
916
+ left: 0
917
+
918
+ }, 200, 'ease');
919
+ }, 800);
920
+ }
921
+
922
+ }).mouseleave(function() {
923
+
924
+ if ($body.hasClass("layout-boxed") == false && $body.hasClass("isMobile") == false) {
925
+ clearTimeout(t);
926
+ }
927
+ });
928
+ sideLeft.mouseleave(function() {
929
+ if ($body.hasClass("sidebar-close") && closedbar.hasClass("open") && $body.hasClass("isMobile") == false) {
930
+ sideLeft.velocity({
931
+ left: -sidebarWidth
932
+
933
+ }, 200, 'ease', function() {
934
+ closedbar.velocity({
935
+ left: 0
936
+ }, 200, 'ease');
937
+ sideLeft.css({
938
+ left: 0,
939
+ zIndex: 0
940
+ });
941
+ });
942
+ }
943
+ });
944
+ };
945
+ // function to activate the Go-Top button
946
+ var runGoTop = function(e) {
947
+ $('.go-top').on('click', function(e) {
948
+ $("html, body").animate({
949
+ scrollTop: 0
950
+ }, "slow");
951
+ e.preventDefault();
952
+ });
953
+ };
954
+ // function to refresh owlCarousel
955
+ var runRefreshSliders = function() {
956
+ $(".e-slider").each(function() {
957
+ var slider = $(this).data('owlCarousel');
958
+ slider.reinit();
959
+ });
960
+ };
961
+ //function to avoid closing the dropdown on click
962
+ var runDropdownEnduring = function() {
963
+ if ($('.dropdown-menu.dropdown-enduring').length) {
964
+ $('.dropdown-menu.dropdown-enduring').click(function(event) {
965
+ event.stopPropagation();
966
+ });
967
+ }
968
+ };
969
+ //function to return the querystring parameter with a given name.
970
+ var getParameterByName = function(name) {
971
+ name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
972
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
973
+ results = regex.exec(location.search);
974
+ return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
975
+ };
976
+ //function to activate the iCheck Plugin
977
+ var runCustomCheck = function() {
978
+ if ($.fn.iCheck) {
979
+ if ($('input[type="checkbox"]').length || $('input[type="radio"]').length) {
980
+ $('input[type="checkbox"].grey, input[type="radio"].grey').iCheck({
981
+ checkboxClass: 'icheckbox_minimal-grey',
982
+ radioClass: 'iradio_minimal-grey',
983
+ increaseArea: '10%' // optional
984
+ });
985
+ $('input[type="checkbox"].red, input[type="radio"].red').iCheck({
986
+ checkboxClass: 'icheckbox_minimal-red',
987
+ radioClass: 'iradio_minimal-red',
988
+ increaseArea: '10%' // optional
989
+ });
990
+ $('input[type="checkbox"].green, input[type="radio"].green').iCheck({
991
+ checkboxClass: 'icheckbox_minimal-green',
992
+ radioClass: 'iradio_minimal-green',
993
+ increaseArea: '10%' // optional
994
+ });
995
+ $('input[type="checkbox"].teal, input[type="radio"].teal').iCheck({
996
+ checkboxClass: 'icheckbox_minimal-aero',
997
+ radioClass: 'iradio_minimal-aero',
998
+ increaseArea: '10%' // optional
999
+ });
1000
+ $('input[type="checkbox"].orange, input[type="radio"].orange').iCheck({
1001
+ checkboxClass: 'icheckbox_minimal-orange',
1002
+ radioClass: 'iradio_minimal-orange',
1003
+ increaseArea: '10%' // optional
1004
+ });
1005
+ $('input[type="checkbox"].purple, input[type="radio"].purple').iCheck({
1006
+ checkboxClass: 'icheckbox_minimal-purple',
1007
+ radioClass: 'iradio_minimal-purple',
1008
+ increaseArea: '10%' // optional
1009
+ });
1010
+ $('input[type="checkbox"].yellow, input[type="radio"].yellow').iCheck({
1011
+ checkboxClass: 'icheckbox_minimal-yellow',
1012
+ radioClass: 'iradio_minimal-yellow',
1013
+ increaseArea: '10%' // optional
1014
+ });
1015
+ $('input[type="checkbox"].square-black, input[type="radio"].square-black').iCheck({
1016
+ checkboxClass: 'icheckbox_square',
1017
+ radioClass: 'iradio_square',
1018
+ increaseArea: '10%' // optional
1019
+ });
1020
+ $('input[type="checkbox"].square-grey, input[type="radio"].square-grey').iCheck({
1021
+ checkboxClass: 'icheckbox_square-grey',
1022
+ radioClass: 'iradio_square-grey',
1023
+ increaseArea: '10%' // optional
1024
+ });
1025
+ $('input[type="checkbox"].square-red, input[type="radio"].square-red').iCheck({
1026
+ checkboxClass: 'icheckbox_square-red',
1027
+ radioClass: 'iradio_square-red',
1028
+ increaseArea: '10%' // optional
1029
+ });
1030
+ $('input[type="checkbox"].square-green, input[type="radio"].square-green').iCheck({
1031
+ checkboxClass: 'icheckbox_square-green',
1032
+ radioClass: 'iradio_square-green',
1033
+ increaseArea: '10%' // optional
1034
+ });
1035
+ $('input[type="checkbox"].square-teal, input[type="radio"].square-teal').iCheck({
1036
+ checkboxClass: 'icheckbox_square-aero',
1037
+ radioClass: 'iradio_square-aero',
1038
+ increaseArea: '10%' // optional
1039
+ });
1040
+ $('input[type="checkbox"].square-orange, input[type="radio"].square-orange').iCheck({
1041
+ checkboxClass: 'icheckbox_square-orange',
1042
+ radioClass: 'iradio_square-orange',
1043
+ increaseArea: '10%' // optional
1044
+ });
1045
+ $('input[type="checkbox"].square-purple, input[type="radio"].square-purple').iCheck({
1046
+ checkboxClass: 'icheckbox_square-purple',
1047
+ radioClass: 'iradio_square-purple',
1048
+ increaseArea: '10%' // optional
1049
+ });
1050
+ $('input[type="checkbox"].square-yellow, input[type="radio"].square-yellow').iCheck({
1051
+ checkboxClass: 'icheckbox_square-yellow',
1052
+ radioClass: 'iradio_square-yellow',
1053
+ increaseArea: '10%' // optional
1054
+ });
1055
+ $('input[type="checkbox"].flat-black, input[type="radio"].flat-black').iCheck({
1056
+ checkboxClass: 'icheckbox_flat',
1057
+ radioClass: 'iradio_flat',
1058
+ increaseArea: '10%' // optional
1059
+ });
1060
+ $('input[type="checkbox"].flat-grey, input[type="radio"].flat-grey').iCheck({
1061
+ checkboxClass: 'icheckbox_flat-grey',
1062
+ radioClass: 'iradio_flat-grey',
1063
+ increaseArea: '10%' // optional
1064
+ });
1065
+ $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({
1066
+ checkboxClass: 'icheckbox_flat-red',
1067
+ radioClass: 'iradio_flat-red',
1068
+ increaseArea: '10%' // optional
1069
+ });
1070
+ $('input[type="checkbox"].flat-green, input[type="radio"].flat-green').iCheck({
1071
+ checkboxClass: 'icheckbox_flat-green',
1072
+ radioClass: 'iradio_flat-green',
1073
+ increaseArea: '10%' // optional
1074
+ });
1075
+ $('input[type="checkbox"].flat-teal, input[type="radio"].flat-teal').iCheck({
1076
+ checkboxClass: 'icheckbox_flat-aero',
1077
+ radioClass: 'iradio_flat-aero',
1078
+ increaseArea: '10%' // optional
1079
+ });
1080
+ $('input[type="checkbox"].flat-orange, input[type="radio"].flat-orange').iCheck({
1081
+ checkboxClass: 'icheckbox_flat-orange',
1082
+ radioClass: 'iradio_flat-orange',
1083
+ increaseArea: '10%' // optional
1084
+ });
1085
+ $('input[type="checkbox"].flat-purple, input[type="radio"].flat-purple').iCheck({
1086
+ checkboxClass: 'icheckbox_flat-purple',
1087
+ radioClass: 'iradio_flat-purple',
1088
+ increaseArea: '10%' // optional
1089
+ });
1090
+ $('input[type="checkbox"].flat-yellow, input[type="radio"].flat-yellow').iCheck({
1091
+ checkboxClass: 'icheckbox_flat-yellow',
1092
+ radioClass: 'iradio_flat-yellow',
1093
+ increaseArea: '10%' // optional
1094
+ });
1095
+ }
1096
+ }
1097
+ };
1098
+ //Set of functions for Style Selector
1099
+ var runStyleSelector = function() {
1100
+ setColorScheme();
1101
+ setLayoutStyle();
1102
+ setHeaderStyle();
1103
+ setSideBarStyle();
1104
+ setFooterStyle();
1105
+ setBoxedBackgrounds();
1106
+ };
1107
+
1108
+ var setColorScheme = function() {
1109
+ $('.icons-color a').on('click', function() {
1110
+ $('.icons-color img').each(function() {
1111
+ $(this).removeClass('active');
1112
+ });
1113
+ $(this).find('img').addClass('active');
1114
+ if ($('#skin_color').attr("rel") == "stylesheet/less") {
1115
+ $('#skin_color').next('style').remove();
1116
+ $('#skin_color').attr("rel", "stylesheet");
1117
+
1118
+ }
1119
+ $('#skin_color').attr("href", "assets/css/themes/theme-" + $(this).attr('id') + ".css");
1120
+ switch ($(this).attr('id')) {
1121
+ case "style3":
1122
+ $(".navbar-brand img").attr("src", "assets/images/logo_dark.png");
1123
+ break;
1124
+ default:
1125
+ $(".navbar-brand img").attr("src", "assets/images/logo.png");
1126
+ break;
1127
+ };
1128
+ });
1129
+ };
1130
+ var setBoxedBackgrounds = function() {
1131
+ $('.boxed-patterns a').on('click', function() {
1132
+ if ($body.hasClass('layout-boxed')) {
1133
+ var classes = $body.attr("class").split(" ").filter(function(item) {
1134
+ return item.indexOf("bg_style_") === -1 ? item : "";
1135
+ });
1136
+ $body.attr("class", classes.join(" "));
1137
+ $('.boxed-patterns img').each(function() {
1138
+ $(this).removeClass('active');
1139
+ });
1140
+ $(this).find('img').addClass('active');
1141
+ $body.addClass($(this).attr('id'));
1142
+ } else {
1143
+ alert('Select boxed layout');
1144
+ }
1145
+ });
1146
+ };
1147
+ var setLayoutStyle = function() {
1148
+ $('select[name="layout"]').change(function() {
1149
+ if ($('select[name="layout"] option:selected').val() == 'boxed') {
1150
+ $body.addClass('layout-boxed');
1151
+ mainContainer.css({
1152
+ marginLeft: ""
1153
+ });
1154
+ $(window).trigger('resize');
1155
+ } else {
1156
+ $body.removeClass('layout-boxed');
1157
+ closedbar.css({
1158
+ transform: ""
1159
+ });
1160
+ $(window).trigger('resize');
1161
+ }
1162
+
1163
+ $(".sb-toggle-right").trigger("click");
1164
+ });
1165
+ };
1166
+ var setHeaderStyle = function() {
1167
+ $('select[name="header"]').change(function() {
1168
+ if ($('select[name="header"] option:selected').val() == 'default')
1169
+ $body.addClass('header-default');
1170
+ else
1171
+ $body.removeClass('header-default');
1172
+ });
1173
+ };
1174
+ var setSideBarStyle = function() {
1175
+ $('select[name="sidebar"]').change(function() {
1176
+ if ($('select[name="sidebar"] option:selected').val() == 'fixed') {
1177
+ sideLeft.removeClass('slide-default');
1178
+
1179
+ if ($body.hasClass("isMobile") == false) {
1180
+ mainNavigation.perfectScrollbar({
1181
+ wheelSpeed: 50,
1182
+ minScrollbarLength: 20,
1183
+ suppressScrollX: true
1184
+ });
1185
+
1186
+ }
1187
+ } else {
1188
+ sideLeft.addClass('slide-default');
1189
+ mainNavigation.perfectScrollbar("destroy");
1190
+ }
1191
+ });
1192
+ };
1193
+ var setFooterStyle = function() {
1194
+ $('select[name="footer"]').change(function() {
1195
+ if ($('select[name="footer"] option:selected').val() == 'fixed') {
1196
+ $body.addClass('footer-fixed');
1197
+ } else {
1198
+ $body.removeClass('footer-fixed');
1199
+ }
1200
+ });
1201
+ };
1202
+ //function to activate ColorPalette
1203
+ var runColorPalette = function() {
1204
+ if ($('.colorpalette').length) {
1205
+ $('.colorpalette').colorPalette().on('selectColor', function(e) {
1206
+ $(this).closest('ul').prev('a').children('i').css('background-color', e.color).end().closest('div').prev('input').val(e.color);
1207
+ runActivateLess();
1208
+ });
1209
+ };
1210
+ };
1211
+
1212
+ // Window Resize Function
1213
+ var runWIndowResize = function(func, threshold, execAsap) {
1214
+ //wait until the user is done resizing the window, then execute
1215
+ $(window).espressoResize(function() {
1216
+ runElementsPosition();
1217
+ setPortfolioPanel();
1218
+ runRefreshSliders();
1219
+ });
1220
+ };
1221
+ //function to select all checkboxes in a Table
1222
+ var runCheckAll = function() {
1223
+ $('input[type="checkbox"].selectall').on('ifChecked', function(event) {
1224
+ $(this).closest("table").find(".foocheck").iCheck('check');
1225
+ }).on('ifUnchecked', function(event) {
1226
+ $(this).closest("table").find(".foocheck").iCheck('uncheck');
1227
+ });
1228
+ };
1229
+ // function to activate Responsive Portfolio Panel
1230
+ var setPortfolioPanel = function() {
1231
+ $(".portfolio-grid .item").each(function() {
1232
+ var portfolioImageW = $(this).closest(".portfolio-grid").outerWidth();
1233
+ var portfolioMaxHeight = parseInt($(this).closest(".portfolio-grid").css("max-height"));
1234
+ if (isNaN(portfolioMaxHeight) == false) {
1235
+ var portfolioImage = $(this).find("img");
1236
+ var img = new Image();
1237
+ img.onload = function() {
1238
+ var thisWidth = portfolioImage.width();
1239
+ var thisHeight = portfolioImage.height();
1240
+ var thisNewWidth = portfolioImageW;
1241
+ var thisNewHeight = thisNewWidth * thisHeight / thisWidth;
1242
+ if (thisNewHeight < portfolioMaxHeight) {
1243
+ thisNewHeight = portfolioMaxHeight;
1244
+ thisNewWidth = thisNewHeight * thisWidth / thisHeight;
1245
+ if (thisNewWidth >= portfolioImageW) {
1246
+ portfolioImage.velocity({
1247
+ width: thisNewWidth,
1248
+ height: thisNewHeight,
1249
+ left: -(thisNewWidth - portfolioImageW) / 2,
1250
+ top: 0
1251
+ });
1252
+ } else {
1253
+ thisNewWidth = portfolioImageW;
1254
+ thisNewHeight = thisNewWidth * thisHeight / thisWidth;
1255
+
1256
+ portfolioImage.velocity({
1257
+ width: thisNewWidth,
1258
+ height: thisNewHeight,
1259
+ top: -(thisNewHeight - portfolioMaxHeight) / 2,
1260
+ left: 0
1261
+ });
1262
+ };
1263
+ } else {
1264
+
1265
+ thisNewWidth = portfolioImageW;
1266
+ thisNewHeight = thisNewWidth * thisHeight / thisWidth;
1267
+
1268
+ portfolioImage.velocity({
1269
+ width: thisNewWidth,
1270
+ height: thisNewHeight,
1271
+ top: -(thisNewHeight - portfolioMaxHeight) / 2,
1272
+ left: 0
1273
+ });
1274
+ }
1275
+
1276
+ };
1277
+ img.src = portfolioImage.attr("src");
1278
+ }
1279
+ });
1280
+ var owlPortfolio = $(".panel-portfolio .e-slider").data('owlCarousel');
1281
+ $(".panel-portfolio .owl-next").off().on("click", function(e) {
1282
+ owlPortfolio.next();
1283
+ e.preventDefault();
1284
+ });
1285
+ $(".panel-portfolio .owl-prev").off().on("click", function(e) {
1286
+ owlPortfolio.prev();
1287
+ e.preventDefault();
1288
+ });
1289
+ };
1290
+
1291
+ //function to save user settings
1292
+ var runSaveSetting = function() {
1293
+ $('.save_style').on('click', function() {
1294
+ var espressoSetting = new Object;
1295
+ if ($body.hasClass('layout-boxed')) {
1296
+ espressoSetting.layoutBoxed = true;
1297
+ $("body[class]").filter(function() {
1298
+ var classNames = this.className.split(/\s+/);
1299
+ for (var i = 0; i < classNames.length; ++i) {
1300
+ if (classNames[i].substr(0, 9) === "bg_style_") {
1301
+ espressoSetting.bgStyle = classNames[i];
1302
+ }
1303
+ }
1304
+
1305
+ });
1306
+ } else {
1307
+ espressoSetting.layoutBoxed = false;
1308
+ };
1309
+ if ($body.hasClass('header-default')) {
1310
+ espressoSetting.headerDefault = true;
1311
+ } else {
1312
+ espressoSetting.headerDefault = false;
1313
+ };
1314
+ if ($body.hasClass('footer-fixed')) {
1315
+ espressoSetting.footerDefault = false;
1316
+ } else {
1317
+ espressoSetting.footerDefault = true;
1318
+ };
1319
+ if (sideLeft.hasClass('slide-default')) {
1320
+ espressoSetting.slideDefault = true;
1321
+ } else {
1322
+ espressoSetting.slideDefault = false;
1323
+ };
1324
+ espressoSetting.skinClass = $('#skin_color').attr('href');
1325
+
1326
+ $.cookie("espresso-setting", JSON.stringify(espressoSetting));
1327
+
1328
+ var el = $('#style_selector_container');
1329
+ el.block({
1330
+ overlayCSS: {
1331
+ backgroundColor: '#000'
1332
+ },
1333
+ message: '<i class="fa fa-spinner fa-spin"></i>',
1334
+ css: {
1335
+ border: 'none',
1336
+ color: '#fff',
1337
+ background: 'none'
1338
+ }
1339
+ });
1340
+ window.setTimeout(function() {
1341
+ el.unblock();
1342
+ }, 1000);
1343
+ });
1344
+ };
1345
+ //function to load user settings
1346
+ var runCustomSetting = function() {
1347
+ if ($.cookie) {
1348
+ if ($.cookie("espresso-setting")) {
1349
+ var loadSetting = jQuery.parseJSON($.cookie("espresso-setting"));
1350
+ if (loadSetting.layoutBoxed) {
1351
+
1352
+ $body.addClass('layout-boxed');
1353
+ $('#style_selector select[name="layout"]').find('option[value="boxed"]').attr('selected', 'true');
1354
+ };
1355
+ if (loadSetting.headerDefault) {
1356
+ $body.addClass('header-default');
1357
+ $('#style_selector select[name="header"]').find('option[value="default"]').attr('selected', 'true');
1358
+ };
1359
+ if (!loadSetting.footerDefault) {
1360
+ $body.addClass('footer-fixed');
1361
+ $('#style_selector select[name="footer"]').find('option[value="fixed"]').attr('selected', 'true');
1362
+ };
1363
+ if (loadSetting.slideDefault) {
1364
+ sideLeft.addClass('slide-default');
1365
+ $('#style_selector select[name="sidebar"]').find('option[value="default"]').attr('selected', 'true');
1366
+ };
1367
+ if ($('#style_selector').length) {
1368
+ $('#skin_color').attr('href', loadSetting.skinClass);
1369
+
1370
+ };
1371
+ $body.addClass(loadSetting.bgStyle);
1372
+ } else {
1373
+ runDefaultSetting();
1374
+ };
1375
+ }
1376
+ };
1377
+
1378
+ //function to clear user settings
1379
+ var runClearSetting = function() {
1380
+ $('.clear_style').on('click', function() {
1381
+ $.removeCookie("espresso-setting");
1382
+ $body.removeClass("layout-boxed header-default footer-fixed");
1383
+ sideLeft.removeClass('slide-default');
1384
+ $body[0].className = $body[0].className.replace(/\bbg_style_.*?\b/g, '');
1385
+ if ($('#skin_color').attr("rel") == "stylesheet/less") {
1386
+ $('#skin_color').next('style').remove();
1387
+ $('#skin_color').attr("rel", "stylesheet");
1388
+
1389
+ }
1390
+
1391
+ $('.icons-color img').first().trigger('click');
1392
+ runDefaultSetting();
1393
+ });
1394
+ };
1395
+ //function to restore user settings
1396
+ var runDefaultSetting = function() {
1397
+ $('#style_selector select[name="layout"]').val('default');
1398
+ $('#style_selector select[name="header"]').val('fixed');
1399
+ $('#style_selector select[name="footer"]').val('default');
1400
+ $('#style_selector select[name="sidebar"]').val('fixed');
1401
+ $('.boxed-patterns img').removeClass('active');
1402
+ };
1403
+ //function to set the User Staus (Online/Offline)
1404
+ var runStatusButton = function() {
1405
+ $(".btn.status").on("click", function(e) {
1406
+ if ($(this).hasClass("offline")) {
1407
+ $(this).removeClass("offline").find("span").text("Online");
1408
+
1409
+ } else {
1410
+ $(this).addClass("offline").find("span").text("Offline");
1411
+ }
1412
+ e.preventDefault();
1413
+ });
1414
+ };
1415
+ //function to animate Progressbar when appear
1416
+ var runAnimateProgressbar = function() {
1417
+ var progressBarDefaultsOptions = {
1418
+ transition_delay: 0
1419
+ };
1420
+ $('.progress .animate-progress-bar').each(function() {
1421
+ var configProgressBar = $.extend({}, progressBarDefaultsOptions, $(this).data("plugin-options"));
1422
+ if ($(this).is(':appeared') || isMobile) {
1423
+ $(this).progressbar(configProgressBar);
1424
+ } else {
1425
+ $(this).appear();
1426
+ $(this).on("appear", function(event, $all_appeared_elements) {
1427
+ $(this).progressbar(configProgressBar);
1428
+ });
1429
+ }
1430
+ });
1431
+ };
1432
+ var runMsViewport = function() {
1433
+ if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
1434
+ var msViewportStyle = document.createElement("style");
1435
+ msViewportStyle.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}"));
1436
+ document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
1437
+ }
1438
+ };
1439
+ return {
1440
+ //main function to initiate template pages
1441
+ runFunc: function(callback) {
1442
+ switch(callback){
1443
+ case 'runCustomCheck':
1444
+ runCustomCheck();break;
1445
+ case 'runPanelScroll':
1446
+ runPanelScroll();break;
1447
+ default:
1448
+ alert('Wrong Function!');
1449
+ }
1450
+ },
1451
+ init: function() {
1452
+ runWIndowResize();
1453
+ runInit();
1454
+ runQuickChat();
1455
+ runToggleSideBars();
1456
+ runStyleSelector();
1457
+ runElementsPosition();
1458
+ runToDoAction();
1459
+ runNavigationMenu();
1460
+ runGoTop();
1461
+ setSearchMenu();
1462
+ runModuleTools();
1463
+ runDropdownEnduring();
1464
+ runTooltips();
1465
+ runESlider();
1466
+ runPopovers();
1467
+ runPanelScroll();
1468
+ runAnimatedElements();
1469
+ runShowTab();
1470
+ runCustomCheck();
1471
+ runColorPalette();
1472
+ runSaveSetting();
1473
+ runCustomSetting();
1474
+ //runStatusButton();
1475
+ runCheckAll();
1476
+ runClearSetting();
1477
+ runClosedBarButton();
1478
+ runAnimateProgressbar();
1479
+ runSelecticker();
1480
+ setPortfolioPanel();
1481
+ runSideBarToggle();
1482
+ runMsViewport();
1483
+ runTimeStamp();
1484
+ documentEvents();
1485
+ }
1486
+ };
1487
+ }();
1488
+
1489
+ $(window).bind("load", function () {
1490
+ // Remove splash screen after load
1491
+ $('.splash').css('display', 'none')
1492
+ });