@valtimo/layout 4.15.2-next-main.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/css/app.css +28364 -0
- package/assets/img/1088x336.png +0 -0
- package/assets/img/140x140.png +0 -0
- package/assets/img/342x239.png +0 -0
- package/assets/img/346x106.png +0 -0
- package/assets/img/362x239.png +0 -0
- package/assets/img/404-bg.png +0 -0
- package/assets/img/529x161.png +0 -0
- package/assets/img/avatar-150.png +0 -0
- package/assets/img/avatar.png +0 -0
- package/assets/img/avatar1.png +0 -0
- package/assets/img/avatar2.png +0 -0
- package/assets/img/avatar3.png +0 -0
- package/assets/img/avatar4.png +0 -0
- package/assets/img/avatar5.png +0 -0
- package/assets/img/avatar6.png +0 -0
- package/assets/img/bitbucket.png +0 -0
- package/assets/img/db-icon.png +0 -0
- package/assets/img/dribbble.png +0 -0
- package/assets/img/dropbox.png +0 -0
- package/assets/img/fb-icon.png +0 -0
- package/assets/img/fl-icon.png +0 -0
- package/assets/img/gh-icon.png +0 -0
- package/assets/img/github.png +0 -0
- package/assets/img/gp-icon.png +0 -0
- package/assets/img/in-icon.png +0 -0
- package/assets/img/logo-fav.png +0 -0
- package/assets/img/logo-symbol.png +0 -0
- package/assets/img/logo-white-xx.png +0 -0
- package/assets/img/logo-white.png +0 -0
- package/assets/img/logo-white.svg +1 -0
- package/assets/img/logo-xx.png +0 -0
- package/assets/img/logo.png +0 -0
- package/assets/img/logo.svg +1 -0
- package/assets/img/mail_chimp.png +0 -0
- package/assets/img/pi-icon.png +0 -0
- package/assets/img/slack.png +0 -0
- package/assets/img/slack_logo.png +0 -0
- package/assets/img/tu-icon.png +0 -0
- package/assets/img/tw-icon.png +0 -0
- package/assets/img/user-profile-display.png +0 -0
- package/assets/img/valtimo/favicons/android-chrome-192x192.png +0 -0
- package/assets/img/valtimo/favicons/android-chrome-256x256.png +0 -0
- package/assets/img/valtimo/favicons/apple-touch-icon.png +0 -0
- package/assets/img/valtimo/favicons/browserconfig.xml +25 -0
- package/assets/img/valtimo/favicons/favicon-16x16.png +0 -0
- package/assets/img/valtimo/favicons/favicon-32x32.png +0 -0
- package/assets/img/valtimo/favicons/favicon.ico +0 -0
- package/assets/img/valtimo/favicons/manifest.json +18 -0
- package/assets/img/valtimo/favicons/mstile-150x150.png +0 -0
- package/assets/img/valtimo/favicons/safari-pinned-tab.svg +19 -0
- package/assets/img/yt-icon.png +0 -0
- package/assets/js/app.js +835 -0
- package/assets/lib/jquery.gritter/images/gritter-bg.png +0 -0
- package/assets/lib/roboto/Roboto-Black.eot +0 -0
- package/assets/lib/roboto/Roboto-Black.svg +10968 -0
- package/assets/lib/roboto/Roboto-Black.ttf +0 -0
- package/assets/lib/roboto/Roboto-Black.woff +0 -0
- package/assets/lib/roboto/Roboto-Black.woff2 +0 -0
- package/assets/lib/roboto/Roboto-BlackItalic.eot +0 -0
- package/assets/lib/roboto/Roboto-BlackItalic.svg +11086 -0
- package/assets/lib/roboto/Roboto-BlackItalic.ttf +0 -0
- package/assets/lib/roboto/Roboto-BlackItalic.woff +0 -0
- package/assets/lib/roboto/Roboto-BlackItalic.woff2 +0 -0
- package/assets/lib/roboto/Roboto-Bold.eot +0 -0
- package/assets/lib/roboto/Roboto-Bold.svg +11010 -0
- package/assets/lib/roboto/Roboto-Bold.ttf +0 -0
- package/assets/lib/roboto/Roboto-Bold.woff +0 -0
- package/assets/lib/roboto/Roboto-Bold.woff2 +0 -0
- package/assets/lib/roboto/Roboto-BoldItalic.eot +0 -0
- package/assets/lib/roboto/Roboto-BoldItalic.svg +11096 -0
- package/assets/lib/roboto/Roboto-BoldItalic.ttf +0 -0
- package/assets/lib/roboto/Roboto-BoldItalic.woff +0 -0
- package/assets/lib/roboto/Roboto-BoldItalic.woff2 +0 -0
- package/assets/lib/roboto/Roboto-Light.eot +0 -0
- package/assets/lib/roboto/Roboto-Light.svg +10564 -0
- package/assets/lib/roboto/Roboto-Light.ttf +0 -0
- package/assets/lib/roboto/Roboto-Light.woff +0 -0
- package/assets/lib/roboto/Roboto-Light.woff2 +0 -0
- package/assets/lib/roboto/Roboto-LightItalic.eot +0 -0
- package/assets/lib/roboto/Roboto-LightItalic.svg +10646 -0
- package/assets/lib/roboto/Roboto-LightItalic.ttf +0 -0
- package/assets/lib/roboto/Roboto-LightItalic.woff +0 -0
- package/assets/lib/roboto/Roboto-LightItalic.woff2 +0 -0
- package/assets/lib/roboto/Roboto-Medium.eot +0 -0
- package/assets/lib/roboto/Roboto-Medium.svg +10999 -0
- package/assets/lib/roboto/Roboto-Medium.ttf +0 -0
- package/assets/lib/roboto/Roboto-Medium.woff +0 -0
- package/assets/lib/roboto/Roboto-Medium.woff2 +0 -0
- package/assets/lib/roboto/Roboto-MediumItalic.eot +0 -0
- package/assets/lib/roboto/Roboto-MediumItalic.svg +11100 -0
- package/assets/lib/roboto/Roboto-MediumItalic.ttf +0 -0
- package/assets/lib/roboto/Roboto-MediumItalic.woff +0 -0
- package/assets/lib/roboto/Roboto-MediumItalic.woff2 +0 -0
- package/assets/lib/roboto/Roboto-Regular.eot +0 -0
- package/assets/lib/roboto/Roboto-Regular.svg +10520 -0
- package/assets/lib/roboto/Roboto-Regular.ttf +0 -0
- package/assets/lib/roboto/Roboto-Regular.woff +0 -0
- package/assets/lib/roboto/Roboto-Regular.woff2 +0 -0
- package/assets/lib/roboto/Roboto-RegularItalic.eot +0 -0
- package/assets/lib/roboto/Roboto-RegularItalic.svg +10629 -0
- package/assets/lib/roboto/Roboto-RegularItalic.ttf +0 -0
- package/assets/lib/roboto/Roboto-RegularItalic.woff +0 -0
- package/assets/lib/roboto/Roboto-RegularItalic.woff2 +0 -0
- package/assets/lib/roboto/Roboto-Thin.eot +0 -0
- package/assets/lib/roboto/Roboto-Thin.svg +10617 -0
- package/assets/lib/roboto/Roboto-Thin.ttf +0 -0
- package/assets/lib/roboto/Roboto-Thin.woff +0 -0
- package/assets/lib/roboto/Roboto-Thin.woff2 +0 -0
- package/assets/lib/roboto/Roboto-ThinItalic.eot +0 -0
- package/assets/lib/roboto/Roboto-ThinItalic.svg +10726 -0
- package/assets/lib/roboto/Roboto-ThinItalic.ttf +0 -0
- package/assets/lib/roboto/Roboto-ThinItalic.woff +0 -0
- package/assets/lib/roboto/Roboto-ThinItalic.woff2 +0 -0
- package/bundles/valtimo-layout.umd.js +243 -0
- package/bundles/valtimo-layout.umd.js.map +1 -0
- package/bundles/valtimo-layout.umd.min.js +2 -0
- package/bundles/valtimo-layout.umd.min.js.map +1 -0
- package/esm2015/lib/layout-internal/layout-internal.component.js +55 -0
- package/esm2015/lib/layout-public/layout-public.component.js +30 -0
- package/esm2015/lib/layout.component.js +48 -0
- package/esm2015/lib/layout.module.js +41 -0
- package/esm2015/lib/layout.service.js +36 -0
- package/esm2015/public_api.js +22 -0
- package/esm2015/valtimo-layout.js +7 -0
- package/fesm2015/valtimo-layout.js +222 -0
- package/fesm2015/valtimo-layout.js.map +1 -0
- package/lib/layout-internal/layout-internal.component.d.ts +14 -0
- package/lib/layout-public/layout-public.component.d.ts +5 -0
- package/lib/layout.component.d.ts +12 -0
- package/lib/layout.module.d.ts +2 -0
- package/lib/layout.service.d.ts +6 -0
- package/package.json +70 -0
- package/public_api.d.ts +3 -0
- package/valtimo-layout.d.ts +6 -0
- package/valtimo-layout.metadata.json +1 -0
package/assets/js/app.js
ADDED
|
@@ -0,0 +1,835 @@
|
|
|
1
|
+
var App = (function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
//Basic Config
|
|
5
|
+
var config = {
|
|
6
|
+
assetsPath: 'assets',
|
|
7
|
+
imgPath: 'img',
|
|
8
|
+
jsPath: 'js',
|
|
9
|
+
libsPath: 'lib',
|
|
10
|
+
leftSidebarSlideSpeed: 200,
|
|
11
|
+
leftSidebarToggleSpeed: 300,
|
|
12
|
+
enableLeftSidebar: true,
|
|
13
|
+
enableSwipe: true,
|
|
14
|
+
swipeTreshold: 100,
|
|
15
|
+
scrollTop: true,
|
|
16
|
+
openRightSidebarClass: 'open-right-sidebar',
|
|
17
|
+
openLeftSidebarClass: 'open-left-sidebar',
|
|
18
|
+
disabledLeftSidebarClass: 'be-left-sidebar-disabled',
|
|
19
|
+
offCanvasLeftSidebarClass: 'be-offcanvas-menu',
|
|
20
|
+
offCanvasLeftSidebarMobileClass: 'be-offcanvas-menu-sm',
|
|
21
|
+
topHeaderMenuClass: 'be-top-menu',
|
|
22
|
+
closeRsOnClickOutside: true,
|
|
23
|
+
removeLeftSidebarClass: 'be-nosidebar-left',
|
|
24
|
+
collapsibleSidebarClass: 'be-collapsible-sidebar',
|
|
25
|
+
collapsibleSidebarCollapsedClass: 'be-collapsible-sidebar-collapsed',
|
|
26
|
+
openLeftSidebarOnClick: true,
|
|
27
|
+
transitionClass: 'be-animate',
|
|
28
|
+
openSidebarDelay: 400
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var colors = {};
|
|
32
|
+
var scrollers = {};
|
|
33
|
+
var body,
|
|
34
|
+
wrapper,
|
|
35
|
+
topNavbar,
|
|
36
|
+
leftSidebar,
|
|
37
|
+
rightSidebar,
|
|
38
|
+
asideDiv,
|
|
39
|
+
notificationsDiv,
|
|
40
|
+
toggleLeftSidebarButton,
|
|
41
|
+
openSidebar;
|
|
42
|
+
|
|
43
|
+
//Perfect scrollbar variables
|
|
44
|
+
var ps_be_scroller_notifications,
|
|
45
|
+
ps_left_sidebar,
|
|
46
|
+
ps_be_scroller_left_sidebar,
|
|
47
|
+
ps_sub_menu_scroller,
|
|
48
|
+
ps_chat_scroll,
|
|
49
|
+
ps_todo_scroll,
|
|
50
|
+
ps_settings_scroll,
|
|
51
|
+
ps_messages_scroll,
|
|
52
|
+
ps_aside_scroll;
|
|
53
|
+
|
|
54
|
+
//Get the template css colors into js vars
|
|
55
|
+
function getColor( c ){
|
|
56
|
+
var tmp = $("<div>", { class: c }).appendTo("body");
|
|
57
|
+
var color = tmp.css("background-color");
|
|
58
|
+
tmp.remove();
|
|
59
|
+
|
|
60
|
+
return color;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Refresh scroller
|
|
64
|
+
function updateScroller(ps_object){
|
|
65
|
+
if( typeof ps_object !== 'undefined' ) {
|
|
66
|
+
ps_object.update();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Destroy scroller
|
|
71
|
+
function destroyScroller(ps_object){
|
|
72
|
+
if (ps_object) {
|
|
73
|
+
ps_object.destroy();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Initialize scroller
|
|
78
|
+
function initScroller(domObject) {
|
|
79
|
+
if( typeof domObject[0] !== 'undefined' ) {
|
|
80
|
+
return new PerfectScrollbar(domObject[0], {
|
|
81
|
+
wheelPropagation: false
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//Core private functions
|
|
87
|
+
function leftSidebarInit(){
|
|
88
|
+
|
|
89
|
+
var firstAnchor = $(".sidebar-elements > li > a", leftSidebar);
|
|
90
|
+
var anchor = $(".sidebar-elements li a", leftSidebar);
|
|
91
|
+
var lsc = $(".left-sidebar-scroll", leftSidebar);
|
|
92
|
+
var lsToggle = $(".left-sidebar-toggle", leftSidebar);
|
|
93
|
+
var openLeftSidebarOnClick = config.openLeftSidebarOnClick ? true : false;
|
|
94
|
+
|
|
95
|
+
// Collapsible sidebar toggle functionality
|
|
96
|
+
function toggleSideBar(){
|
|
97
|
+
var button = $(".be-toggle-left-sidebar");
|
|
98
|
+
|
|
99
|
+
button.on("click", function(){
|
|
100
|
+
if( wrapper.hasClass( config.collapsibleSidebarCollapsedClass ) ) {
|
|
101
|
+
wrapper.removeClass( config.collapsibleSidebarCollapsedClass );
|
|
102
|
+
$("li.open", leftSidebar).removeClass("open");
|
|
103
|
+
$("li.active", leftSidebar).parents(".parent").addClass("active open");
|
|
104
|
+
leftSidebar.trigger( "shown.left-sidebar.collapse" );
|
|
105
|
+
if (typeof ps_be_scroller_left_sidebar === "undefined" || !ps_be_scroller_left_sidebar || !ps_be_scroller_left_sidebar.nodeName) {
|
|
106
|
+
ps_be_scroller_left_sidebar = initScroller($(".be-scroller", leftSidebar));
|
|
107
|
+
}
|
|
108
|
+
destroyScroller(ps_be_scroller_left_sidebar);
|
|
109
|
+
// Destroy Perfect Scrollbar collapsed instance
|
|
110
|
+
if (typeof ps_sub_menu_scroller !== "undefined") {
|
|
111
|
+
destroyScroller(ps_sub_menu_scroller);
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
wrapper.addClass( config.collapsibleSidebarCollapsedClass );
|
|
115
|
+
$("li.active", leftSidebar).parents(".parent").removeClass("open");
|
|
116
|
+
$("li.open", leftSidebar).removeClass("open");
|
|
117
|
+
leftSidebar.trigger( "hidden.left-sidebar.collapse" );
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Tooltip sidebar funcionality
|
|
123
|
+
function tooltipSidebar(){
|
|
124
|
+
var menu = $(".sidebar-elements > li > a", leftSidebar);
|
|
125
|
+
|
|
126
|
+
for(var i = 0; i <= menu.length; i++ ){
|
|
127
|
+
var _self = menu[i];
|
|
128
|
+
var title = $("> span", _self).text();
|
|
129
|
+
|
|
130
|
+
$(_self).attr({
|
|
131
|
+
'data-toggle': 'tooltip',
|
|
132
|
+
'data-placement': 'right',
|
|
133
|
+
'title': title
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
$(_self).tooltip({
|
|
137
|
+
trigger: 'manual'
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
menu.on('mouseenter', function(){
|
|
142
|
+
if(!$.isSm() && wrapper.hasClass(config.collapsibleSidebarCollapsedClass)){
|
|
143
|
+
$(this).tooltip('show');
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
menu.on('mouseleave', function(){
|
|
148
|
+
$(this).tooltip('hide');
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Collapsed sidebar submenu title
|
|
153
|
+
function syncSubMenu( item ){
|
|
154
|
+
var elements;
|
|
155
|
+
|
|
156
|
+
if( typeof item !== "undefined" ) {
|
|
157
|
+
elements = item;
|
|
158
|
+
} else {
|
|
159
|
+
elements = $(".sidebar-elements > li", leftSidebar);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
$.each( elements, function(){
|
|
163
|
+
var title = $(this).find("> a span").html();
|
|
164
|
+
var ul = $(this).find("> ul");
|
|
165
|
+
var subEls = $("> li", ul);
|
|
166
|
+
title = $('<li class="title">' + title + '</li>');
|
|
167
|
+
var subContainer = $('<li class="nav-items"><div class="be-scroller"><div class="content"><ul></ul></div></div></li>');
|
|
168
|
+
|
|
169
|
+
if( !ul.find("> li.title").length ){
|
|
170
|
+
ul.prepend( title );
|
|
171
|
+
subEls.appendTo( subContainer.find(".content ul") );
|
|
172
|
+
subContainer.appendTo( ul );
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Return boolean whether the sidebar is collapsed or not
|
|
178
|
+
function isCollapsed(){
|
|
179
|
+
return wrapper.hasClass( config.collapsibleSidebarCollapsedClass );
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Return true if the collapsible left sidebar is enabled
|
|
183
|
+
function isCollapsible(){
|
|
184
|
+
return wrapper.hasClass( config.collapsibleSidebarClass );
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Close submenu function
|
|
188
|
+
function closeSubMenu( subMenu, event ){
|
|
189
|
+
var target = $( event.currentTarget );
|
|
190
|
+
var li = $( subMenu ).parent();
|
|
191
|
+
var openChildren = $( 'li.open', li );
|
|
192
|
+
|
|
193
|
+
var clickOutside = !target.closest( leftSidebar ).length;
|
|
194
|
+
var slideSpeed = config.leftSidebarSlideSpeed;
|
|
195
|
+
var isFirstLevel = target.parents().eq( 1 ).hasClass( 'sidebar-elements' );
|
|
196
|
+
|
|
197
|
+
// If left sidebar is collapsed, is not small device
|
|
198
|
+
// and the trigger element is first level
|
|
199
|
+
// or click outside the left sidebar
|
|
200
|
+
if ( !$.isSm() && isCollapsed() && ( isFirstLevel || clickOutside ) ){
|
|
201
|
+
|
|
202
|
+
li.removeClass( 'open' );
|
|
203
|
+
subMenu.removeClass( 'visible' );
|
|
204
|
+
openChildren.removeClass( 'open' ).removeAttr( 'style' );
|
|
205
|
+
|
|
206
|
+
} else { // If not execute classic slide interaction
|
|
207
|
+
|
|
208
|
+
subMenu.slideUp({ duration: slideSpeed, complete: function(){
|
|
209
|
+
li.removeClass( 'open' );
|
|
210
|
+
$( this ).removeAttr( 'style' );
|
|
211
|
+
|
|
212
|
+
// Close opened child submenus
|
|
213
|
+
openChildren.removeClass( 'open' ).removeAttr( 'style' );
|
|
214
|
+
if( wrapper.hasClass("be-fixed-sidebar") && !$.isSm() ){
|
|
215
|
+
updateScroller(ps_left_sidebar);
|
|
216
|
+
}
|
|
217
|
+
}});
|
|
218
|
+
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Open submenu function
|
|
223
|
+
function openSubMenu( anchor, event ){
|
|
224
|
+
var _el = $( anchor );
|
|
225
|
+
var li = $( _el ).parent();
|
|
226
|
+
var subMenu = $( _el ).next();
|
|
227
|
+
|
|
228
|
+
var slideSpeed = config.leftSidebarSlideSpeed;
|
|
229
|
+
var isFirstLevel = $( event.currentTarget ).parents().eq( 1 ).hasClass( 'sidebar-elements' );
|
|
230
|
+
|
|
231
|
+
// Get the open sub menus
|
|
232
|
+
var openSubMenus = li.siblings( '.open' );
|
|
233
|
+
|
|
234
|
+
// If there are open sub menus close them
|
|
235
|
+
if( openSubMenus ) {
|
|
236
|
+
closeSubMenu( $( '> ul', openSubMenus ), event );
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// If left sidebar is collapsed, is not small device
|
|
240
|
+
// and the trigger element is first level
|
|
241
|
+
if ( !$.isSm() && isCollapsed() && isFirstLevel ){
|
|
242
|
+
li.addClass( 'open' );
|
|
243
|
+
subMenu.addClass( 'visible' );
|
|
244
|
+
|
|
245
|
+
//Renew Perfect Scroller instance
|
|
246
|
+
if (typeof ps_sub_menu_scroller !== "undefined") {
|
|
247
|
+
destroyScroller(ps_sub_menu_scroller);
|
|
248
|
+
}
|
|
249
|
+
if (typeof ps_sub_menu_scroller === "undefined" || !ps_sub_menu_scroller || !ps_sub_menu_scroller.nodeName) {
|
|
250
|
+
ps_sub_menu_scroller = initScroller(li.find('.be-scroller'));
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
$(window).resize(function () {
|
|
254
|
+
waitForFinalEvent(function(){
|
|
255
|
+
if( !$.isXs() ){
|
|
256
|
+
if (typeof ps_sub_menu_scroller !== "undefined") {
|
|
257
|
+
updateScroller(ps_sub_menu_scroller);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}, 500, "am_check_phone_classes");
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
} else { // If not execute classic slide interaction
|
|
264
|
+
|
|
265
|
+
subMenu.slideDown({ duration: slideSpeed, complete: function(){
|
|
266
|
+
li.addClass( 'open' );
|
|
267
|
+
$( this ).removeAttr( 'style' );
|
|
268
|
+
if( wrapper.hasClass("be-fixed-sidebar") && !$.isSm() ){
|
|
269
|
+
updateScroller(ps_left_sidebar);
|
|
270
|
+
}
|
|
271
|
+
}});
|
|
272
|
+
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Execute if collapsible sidebar is enabled
|
|
277
|
+
if ( isCollapsible() ){
|
|
278
|
+
/*Create sub menu elements*/
|
|
279
|
+
syncSubMenu();
|
|
280
|
+
toggleSideBar();
|
|
281
|
+
tooltipSidebar();
|
|
282
|
+
|
|
283
|
+
if( !openLeftSidebarOnClick ){
|
|
284
|
+
|
|
285
|
+
/*Open sub-menu on hover*/
|
|
286
|
+
firstAnchor.on('mouseover',function( event ){
|
|
287
|
+
if( isCollapsed() ) {
|
|
288
|
+
openSubMenu( this, event );
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
/*Open sub-menu on click (fix for touch devices)*/
|
|
293
|
+
firstAnchor.on('touchstart',function( event ){
|
|
294
|
+
var anchor = $( this );
|
|
295
|
+
var li = anchor.parent();
|
|
296
|
+
var subMenu = anchor.next();
|
|
297
|
+
|
|
298
|
+
if( isCollapsed() && !$.isSm() ) {
|
|
299
|
+
|
|
300
|
+
if( li.hasClass('open') ) {
|
|
301
|
+
closeSubMenu( subMenu, event );
|
|
302
|
+
} else {
|
|
303
|
+
openSubMenu( this, event );
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if( $( this ).next().is( 'ul' ) ) {
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
/*Sub-menu delay on mouse leave*/
|
|
313
|
+
firstAnchor.on('mouseleave',function( event ){
|
|
314
|
+
var _self = $( this );
|
|
315
|
+
var _li = _self.parent();
|
|
316
|
+
var subMenu = _li.find( '> ul' );
|
|
317
|
+
|
|
318
|
+
if( !$.isSm() && isCollapsed() ){
|
|
319
|
+
|
|
320
|
+
//If mouse is over sub menu attach an additional mouseleave event to submenu
|
|
321
|
+
if ( subMenu.length > 0 ){
|
|
322
|
+
|
|
323
|
+
setTimeout(function(){
|
|
324
|
+
if( subMenu.is( ':hover' ) ){
|
|
325
|
+
|
|
326
|
+
subMenu.on( 'mouseleave', function(){
|
|
327
|
+
setTimeout(function(){
|
|
328
|
+
if( !_self.is( ':hover' ) ){
|
|
329
|
+
closeSubMenu( subMenu, event );
|
|
330
|
+
subMenu.off( 'mouseleave' );
|
|
331
|
+
}
|
|
332
|
+
}, 300);
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
}else{
|
|
336
|
+
closeSubMenu( subMenu, event );
|
|
337
|
+
}
|
|
338
|
+
}, 300);
|
|
339
|
+
|
|
340
|
+
}else{
|
|
341
|
+
_li.removeClass( 'open' );
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/*Close sidebar on click outside*/
|
|
348
|
+
$( document ).on("mousedown touchstart",function( event ){
|
|
349
|
+
if ( !$( event.target ).closest( leftSidebar ).length && !$.isSm() ) {
|
|
350
|
+
closeSubMenu( $( "ul.visible", leftSidebar), event );
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/*Open sub-menu functionality*/
|
|
356
|
+
anchor.on("click",function( event ){
|
|
357
|
+
var $el = $(this), $open;
|
|
358
|
+
var $li = $el.parent();
|
|
359
|
+
var $subMenu = $el.next();
|
|
360
|
+
var isFirstLevel = $el.parents().eq(1).hasClass('sidebar-elements');
|
|
361
|
+
|
|
362
|
+
// Get the open menus
|
|
363
|
+
$open = $li.siblings(".open");
|
|
364
|
+
|
|
365
|
+
if( $li.hasClass('open') ){
|
|
366
|
+
closeSubMenu( $subMenu, event );
|
|
367
|
+
}else{
|
|
368
|
+
openSubMenu( this, event );
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
//If current element has children stop link action
|
|
372
|
+
if( $el.next().is('ul') ){
|
|
373
|
+
event.preventDefault();
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
/*Calculate sidebar tree active & open classes*/
|
|
378
|
+
if ( wrapper.hasClass( config.collapsibleSidebarCollapsedClass ) ){
|
|
379
|
+
$("li.active", leftSidebar).parents(".parent").addClass("active");
|
|
380
|
+
} else {
|
|
381
|
+
$("li.active", leftSidebar).parents(".parent").addClass("active open");
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/* Add classes if top menu is present */
|
|
385
|
+
if( topNavbar.find('.container-fluid > .navbar-collapse').length && leftSidebar.length ) {
|
|
386
|
+
wrapper.addClass( config.offCanvasLeftSidebarClass ).addClass( config.offCanvasLeftSidebarMobileClass );
|
|
387
|
+
wrapper.addClass( config.topHeaderMenuClass );
|
|
388
|
+
toggleLeftSidebarButton = $('<a class="nav-link be-toggle-left-sidebar" href="#"><span class="icon mdi mdi-menu"></span></a>');
|
|
389
|
+
$('.be-navbar-header', topNavbar).prepend(toggleLeftSidebarButton);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/*Scrollbar plugin init when left sidebar is fixed*/
|
|
393
|
+
if( wrapper.hasClass("be-fixed-sidebar") ){
|
|
394
|
+
if( !$.isSm() || wrapper.hasClass( config.offCanvasLeftSidebarClass ) ) {
|
|
395
|
+
if (typeof ps_left_sidebar === "undefined" || !ps_left_sidebar || !ps_left_sidebar.nodeName) {
|
|
396
|
+
ps_left_sidebar = initScroller(lsc);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/*Update scrollbar height on window resize*/
|
|
401
|
+
$(window).resize(function () {
|
|
402
|
+
waitForFinalEvent(function(){
|
|
403
|
+
if( $.isSm() && !wrapper.hasClass( config.offCanvasLeftSidebarClass ) ) {
|
|
404
|
+
destroyScroller(ps_left_sidebar);
|
|
405
|
+
} else {
|
|
406
|
+
if( lsc.hasClass('ps') ) {
|
|
407
|
+
updateScroller(ps_left_sidebar);
|
|
408
|
+
} else {
|
|
409
|
+
if (typeof ps_left_sidebar === "undefined" || !ps_left_sidebar || !ps_left_sidebar.nodeName) {
|
|
410
|
+
ps_left_sidebar = initScroller(lsc);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}, 500, "be_update_scroller");
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/*Toggle sidebar on small devices*/
|
|
419
|
+
lsToggle.on('click',function( e ){
|
|
420
|
+
var spacer = $(this).next('.left-sidebar-spacer'), toggleBtn = $(this);
|
|
421
|
+
|
|
422
|
+
toggleBtn.toggleClass('open');
|
|
423
|
+
spacer.slideToggle(config.leftSidebarToggleSpeed, function(){
|
|
424
|
+
$(this).removeAttr('style').toggleClass('open');
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
e.preventDefault();
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
/*Off canvas menu*/
|
|
431
|
+
function leftSidebarOffCanvas() {
|
|
432
|
+
|
|
433
|
+
/*Open Sidebar with toggle button*/
|
|
434
|
+
toggleLeftSidebarButton.on("click", function(e){
|
|
435
|
+
if ( openSidebar && body.hasClass(config.openLeftSidebarClass) ) {
|
|
436
|
+
body.removeClass(config.openLeftSidebarClass);
|
|
437
|
+
sidebarDelay();
|
|
438
|
+
} else {
|
|
439
|
+
body.addClass( config.openLeftSidebarClass + " " + config.transitionClass);
|
|
440
|
+
openSidebar = true;
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
/*Close sidebar on click outside*/
|
|
445
|
+
$( document ).on("mousedown touchstart",function( e ){
|
|
446
|
+
if ( !$( e.target ).closest( leftSidebar ).length && !$( e.target ).closest( toggleLeftSidebarButton ).length && body.hasClass( config.openLeftSidebarClass ) ) {
|
|
447
|
+
body.removeClass( config.openLeftSidebarClass );
|
|
448
|
+
sidebarDelay();
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// Left sidebar off-canvas
|
|
454
|
+
if ( wrapper.hasClass(config.offCanvasLeftSidebarClass) ) {
|
|
455
|
+
leftSidebarOffCanvas();
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
function rightSidebarInit(){
|
|
460
|
+
|
|
461
|
+
var rsChatScrollbar = $(".be-scroller-chat", rightSidebar);
|
|
462
|
+
var rsTodoScrollbar = $(".be-scroller-todo", rightSidebar);
|
|
463
|
+
var rsSettingsScrollbar = $(".be-scroller-settings", rightSidebar);
|
|
464
|
+
|
|
465
|
+
function oSidebar(){
|
|
466
|
+
body.addClass( config.openRightSidebarClass + " " + config.transitionClass );
|
|
467
|
+
openSidebar = true;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function cSidebar(){
|
|
471
|
+
body.removeClass( config.openRightSidebarClass ).addClass( config.transitionClass );
|
|
472
|
+
sidebarDelay();
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if( rightSidebar.length > 0 ){
|
|
476
|
+
/*Open-Sidebar when click on topbar button*/
|
|
477
|
+
$('.be-toggle-right-sidebar').on("click", function(e){
|
|
478
|
+
if( openSidebar && body.hasClass( config.openRightSidebarClass ) ){
|
|
479
|
+
cSidebar();
|
|
480
|
+
}else if( !openSidebar ){
|
|
481
|
+
oSidebar();
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
e.preventDefault();
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
/*Close sidebar on click outside*/
|
|
488
|
+
$( document ).on("mousedown touchstart",function( e ){
|
|
489
|
+
if ( !$( e.target ).closest( rightSidebar ).length && body.hasClass( config.openRightSidebarClass ) && (config.closeRsOnClickOutside || $.isSm()) ) {
|
|
490
|
+
cSidebar();
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
if ((typeof ps_chat_scroll === "undefined" || !ps_chat_scroll || !ps_chat_scroll.nodeName) && rsChatScrollbar.length) {
|
|
496
|
+
ps_chat_scroll = initScroller(rsChatScrollbar);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
if ((typeof ps_todo_scroll === "undefined" || !ps_todo_scroll || !ps_todo_scroll.nodeName) && rsTodoScrollbar.length) {
|
|
500
|
+
ps_todo_scroll = initScroller(rsTodoScrollbar);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
if ((typeof ps_settings_scroll === "undefined" || !ps_settings_scroll || !ps_settings_scroll.nodeName) && rsSettingsScrollbar.length) {
|
|
504
|
+
ps_settings_scroll = initScroller(rsSettingsScrollbar);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/*Update scrollbar height on window resize*/
|
|
508
|
+
$(window).resize(function () {
|
|
509
|
+
waitForFinalEvent(function(){
|
|
510
|
+
updateScroller(ps_chat_scroll);
|
|
511
|
+
updateScroller(ps_todo_scroll);
|
|
512
|
+
updateScroller(ps_settings_scroll);
|
|
513
|
+
}, 500, "be_rs_update_scroller");
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
/*Update scrollbar when click on a tab*/
|
|
517
|
+
$('a[data-toggle="tab"]', rightSidebar).on('shown.bs.tab', function (e) {
|
|
518
|
+
updateScroller(ps_chat_scroll);
|
|
519
|
+
updateScroller(ps_todo_scroll);
|
|
520
|
+
updateScroller(ps_settings_scroll);
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
function sidebarDelay(){
|
|
525
|
+
openSidebar = true;
|
|
526
|
+
setTimeout(function(){
|
|
527
|
+
openSidebar = false;
|
|
528
|
+
}, config.openSidebarDelay );
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
function sidebarSwipe(){
|
|
532
|
+
/*Open sidedar on swipe*/
|
|
533
|
+
wrapper.swipe( {
|
|
534
|
+
allowPageScroll: "vertical",
|
|
535
|
+
preventDefaultEvents: false,
|
|
536
|
+
fallbackToMouseEvents: false,
|
|
537
|
+
swipeLeft: function(e){
|
|
538
|
+
if( !openSidebar && rightSidebar.length > 0 ){
|
|
539
|
+
body.addClass( config.openRightSidebarClass + " " + config.transitionClass );
|
|
540
|
+
openSidebar = true;
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
threshold: config.swipeTreshold
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
function chatWidget(){
|
|
548
|
+
var chat = $(".be-right-sidebar .tab-chat");
|
|
549
|
+
var contactsEl = $(".chat-contacts", chat);
|
|
550
|
+
var conversationEl = $(".chat-window", chat);
|
|
551
|
+
var messagesContainer = $(".chat-messages", conversationEl);
|
|
552
|
+
var messagesList = $(".content ul", messagesContainer);
|
|
553
|
+
var messagesScroll = $(".be-scroller-messages", messagesContainer);
|
|
554
|
+
var chatInputContainer = $(".chat-input", conversationEl);
|
|
555
|
+
var chatInput = $("input", chatInputContainer);
|
|
556
|
+
var chatInputSendButton = $(".send-msg", chatInputContainer);
|
|
557
|
+
|
|
558
|
+
function openChatWindow(){
|
|
559
|
+
if( !chat.hasClass("chat-opened") ){
|
|
560
|
+
chat.addClass("chat-opened");
|
|
561
|
+
if (typeof ps_messages_scroll === "undefined" || !ps_messages_scroll || !ps_messages_scroll.nodeName) {
|
|
562
|
+
ps_messages_scroll = initScroller(messagesScroll);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
function closeChatWindow(){
|
|
568
|
+
if( chat.hasClass("chat-opened") ){
|
|
569
|
+
chat.removeClass("chat-opened");
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/*Open Conversation Window when click on chat user*/
|
|
574
|
+
$(".user a", contactsEl).on('click',function( e ){
|
|
575
|
+
openChatWindow();
|
|
576
|
+
e.preventDefault();
|
|
577
|
+
});
|
|
578
|
+
|
|
579
|
+
/*Close chat conv window*/
|
|
580
|
+
$(".title .return", conversationEl).on('click',function( e ){
|
|
581
|
+
closeChatWindow();
|
|
582
|
+
scrollerInit();
|
|
583
|
+
});
|
|
584
|
+
|
|
585
|
+
/*Send message*/
|
|
586
|
+
function sendMsg(msg, self){
|
|
587
|
+
var $message = $('<li class="' + ((self)?'self':'friend') + '"></li>');
|
|
588
|
+
|
|
589
|
+
if( msg != '' ){
|
|
590
|
+
$('<div class="msg">' + msg + '</div>').appendTo($message);
|
|
591
|
+
$message.appendTo(messagesList);
|
|
592
|
+
|
|
593
|
+
messagesScroll.stop().animate({
|
|
594
|
+
'scrollTop': messagesScroll.prop("scrollHeight")
|
|
595
|
+
}, 900, 'swing');
|
|
596
|
+
|
|
597
|
+
updateScroller(ps_messages_scroll);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/*Send msg when click on 'send' button or press 'Enter'*/
|
|
602
|
+
chatInput.keypress(function(event){
|
|
603
|
+
var keycode = (event.keyCode ? event.keyCode : event.which);
|
|
604
|
+
var msg = $(this).val();
|
|
605
|
+
|
|
606
|
+
if(keycode == '13'){
|
|
607
|
+
sendMsg(msg, true);
|
|
608
|
+
$(this).val("");
|
|
609
|
+
}
|
|
610
|
+
event.stopPropagation();
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
chatInputSendButton.on('click',function(){
|
|
614
|
+
var msg = chatInput.val();
|
|
615
|
+
sendMsg(msg, true);
|
|
616
|
+
chatInput.val("");
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
function scrollerInit(){
|
|
621
|
+
if (typeof ps_be_scroller_notifications === "undefined" || !ps_be_scroller_notifications || !ps_be_scroller_notifications.nodeName) {
|
|
622
|
+
ps_be_scroller_notifications = initScroller(notificationsDiv);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
function scrollTopButton(){
|
|
627
|
+
var offset = 220;
|
|
628
|
+
var duration = 500;
|
|
629
|
+
var button = $('<div class="be-scroll-top"></div>');
|
|
630
|
+
button.appendTo("body");
|
|
631
|
+
|
|
632
|
+
$(window).on('scroll',function() {
|
|
633
|
+
if ( $(this).scrollTop() > offset ) {
|
|
634
|
+
button.fadeIn(duration);
|
|
635
|
+
} else {
|
|
636
|
+
button.fadeOut(duration);
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
button.on('touchstart mouseup',function( e ) {
|
|
641
|
+
$( 'html, body' ).animate({ scrollTop: 0 }, duration);
|
|
642
|
+
e.preventDefault();
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
//Add and remove active class on left sidebar
|
|
647
|
+
function activeItemLeftSidebar(menu_item){
|
|
648
|
+
var firstAnchor = menu_item;
|
|
649
|
+
var li = $(firstAnchor).parent();
|
|
650
|
+
var menu = $(li).parents('li');
|
|
651
|
+
|
|
652
|
+
if( !li.hasClass('active') ){
|
|
653
|
+
$('li.active', leftSidebar).removeClass('active');
|
|
654
|
+
$(menu).addClass('active');
|
|
655
|
+
$(li).addClass('active');
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
function initAsidePS() {
|
|
660
|
+
var pas = asideDiv;
|
|
661
|
+
ps_aside_scroll = initScroller(asideDiv);
|
|
662
|
+
$(window).resize(function () {
|
|
663
|
+
if( $.isSm() && !wrapper.hasClass( config.offCanvasLeftSidebarClass ) ) {
|
|
664
|
+
destroyScroller(ps_aside_scroll);
|
|
665
|
+
} else {
|
|
666
|
+
if( pas.hasClass('ps') ) {
|
|
667
|
+
updateScroller(ps_aside_scroll);
|
|
668
|
+
} else {
|
|
669
|
+
if (typeof ps_aside_scroll === "undefined" || !ps_aside_scroll || !ps_aside_scroll.nodeName) {
|
|
670
|
+
ps_aside_scroll = initScroller(asideDiv);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
//Wait for final event on window resize
|
|
678
|
+
var waitForFinalEvent = (function () {
|
|
679
|
+
var timers = {};
|
|
680
|
+
return function (callback, ms, uniqueId) {
|
|
681
|
+
if (!uniqueId) {
|
|
682
|
+
uniqueId = "x1x2x3x4";
|
|
683
|
+
}
|
|
684
|
+
if (timers[uniqueId]) {
|
|
685
|
+
clearTimeout (timers[uniqueId]);
|
|
686
|
+
}
|
|
687
|
+
timers[uniqueId] = setTimeout(callback, ms);
|
|
688
|
+
};
|
|
689
|
+
})();
|
|
690
|
+
|
|
691
|
+
return {
|
|
692
|
+
//General data
|
|
693
|
+
conf: config,
|
|
694
|
+
color: colors,
|
|
695
|
+
scroller: scrollers,
|
|
696
|
+
|
|
697
|
+
//Init function
|
|
698
|
+
init: function (options) {
|
|
699
|
+
|
|
700
|
+
//Get the main elements when document is ready
|
|
701
|
+
body = $("body");
|
|
702
|
+
wrapper = $(".be-wrapper");
|
|
703
|
+
topNavbar = $('.be-top-header', wrapper);
|
|
704
|
+
leftSidebar = $(".be-left-sidebar", wrapper);
|
|
705
|
+
rightSidebar = $(".be-right-sidebar", wrapper);
|
|
706
|
+
asideDiv = $(".be-scroller-aside", wrapper);
|
|
707
|
+
toggleLeftSidebarButton = $('.be-toggle-left-sidebar', topNavbar);
|
|
708
|
+
notificationsDiv = $(".be-scroller-notifications", topNavbar);
|
|
709
|
+
openSidebar = false;
|
|
710
|
+
|
|
711
|
+
//Extends basic config with options
|
|
712
|
+
$.extend( config, options );
|
|
713
|
+
|
|
714
|
+
/*FastClick on mobile*/
|
|
715
|
+
FastClick.attach(document.body);
|
|
716
|
+
|
|
717
|
+
/*Left Sidebar*/
|
|
718
|
+
if ( config.enableLeftSidebar ){
|
|
719
|
+
leftSidebarInit();
|
|
720
|
+
} else {
|
|
721
|
+
wrapper.addClass(config.disabledLeftSidebarClass);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/*Right Sidebar*/
|
|
725
|
+
if ( rightSidebar.length ){
|
|
726
|
+
rightSidebarInit();
|
|
727
|
+
chatWidget();
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/*Sidebars Swipe*/
|
|
731
|
+
if( config.enableSwipe ){
|
|
732
|
+
sidebarSwipe();
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/*Scroll Top button*/
|
|
736
|
+
if( config.scrollTop ){
|
|
737
|
+
scrollTopButton();
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/*Page Aside*/
|
|
741
|
+
if( asideDiv.length ){
|
|
742
|
+
initAsidePS();
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/*Scroller plugin init*/
|
|
746
|
+
if ( notificationsDiv.length ){
|
|
747
|
+
scrollerInit();
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/*Get colors*/
|
|
751
|
+
colors.primary = getColor('clr-primary');
|
|
752
|
+
colors.success = getColor('clr-success');
|
|
753
|
+
colors.warning = getColor('clr-warning');
|
|
754
|
+
colors.danger = getColor('clr-danger');
|
|
755
|
+
colors.grey = getColor('clr-grey');
|
|
756
|
+
|
|
757
|
+
/*Get scrollers*/
|
|
758
|
+
scrollers.be_scroller_notifications = ps_be_scroller_notifications;
|
|
759
|
+
scrollers.left_sidebar_scroll = ps_left_sidebar;
|
|
760
|
+
scrollers.be_left_sidebar_scroll = ps_be_scroller_left_sidebar;
|
|
761
|
+
scrollers.sub_menu_scroll = ps_sub_menu_scroller;
|
|
762
|
+
scrollers.chat_scroll = ps_chat_scroll;
|
|
763
|
+
scrollers.todo_scroll = ps_todo_scroll;
|
|
764
|
+
scrollers.settings_scroll = ps_settings_scroll;
|
|
765
|
+
scrollers.messages_scroll = ps_messages_scroll;
|
|
766
|
+
scrollers.aside_scroll = ps_aside_scroll;
|
|
767
|
+
scrollers.updateScroller = updateScroller;
|
|
768
|
+
scrollers.destroyScroller = destroyScroller;
|
|
769
|
+
scrollers.initScroller = initScroller;
|
|
770
|
+
|
|
771
|
+
/*Bind plugins on hidden elements*/
|
|
772
|
+
/*Dropdown shown event*/
|
|
773
|
+
$('.be-icons-nav .dropdown').on('shown.bs.dropdown', function () {
|
|
774
|
+
updateScroller(ps_be_scroller_notifications);
|
|
775
|
+
});
|
|
776
|
+
|
|
777
|
+
/*Tooltips*/
|
|
778
|
+
$('[data-toggle="tooltip"]').tooltip();
|
|
779
|
+
|
|
780
|
+
/*Popover*/
|
|
781
|
+
$('[data-toggle="popover"]').popover();
|
|
782
|
+
|
|
783
|
+
/*Bootstrap modal scroll top fix*/
|
|
784
|
+
$('.modal').on('show.bs.modal', function(){
|
|
785
|
+
$("html").addClass('be-modal-open');
|
|
786
|
+
});
|
|
787
|
+
|
|
788
|
+
$('.modal').on('hidden.bs.modal', function(){
|
|
789
|
+
$("html").removeClass('be-modal-open');
|
|
790
|
+
});
|
|
791
|
+
|
|
792
|
+
/*Fixes the Sweetalert gap in the top header on boxed layout*/
|
|
793
|
+
if (typeof Swal == 'function' && wrapper.hasClass('be-boxed-layout')) {
|
|
794
|
+
var observer = new MutationObserver(function(mutationsList, observer) {
|
|
795
|
+
mutationsList.forEach(function(mutation){
|
|
796
|
+
if (mutation.type == 'attributes' && mutation.attributeName == 'style') {
|
|
797
|
+
if(document.body.className.indexOf('swal2-shown') > 0){
|
|
798
|
+
topNavbar.css({marginLeft: 'calc(-' + document.body.style.paddingRight + ' / 2)'});
|
|
799
|
+
} else {
|
|
800
|
+
topNavbar.css({marginLeft: '0'});
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
});
|
|
804
|
+
});
|
|
805
|
+
|
|
806
|
+
observer.observe(document.body, { attributes: true });
|
|
807
|
+
}
|
|
808
|
+
},
|
|
809
|
+
|
|
810
|
+
//Methods
|
|
811
|
+
activeItemLeftSidebar: activeItemLeftSidebar
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
})();
|
|
815
|
+
|
|
816
|
+
function FastClick(o,e){"use strict";var t;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=o,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(o)){for(var n=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],i=this,r=0,s=n.length;r<s;r++)i[n[r]]=c(i[n[r]],i);deviceIsAndroid&&(o.addEventListener("mouseover",this.onMouse,!0),o.addEventListener("mousedown",this.onMouse,!0),o.addEventListener("mouseup",this.onMouse,!0)),o.addEventListener("click",this.onClick,!0),o.addEventListener("touchstart",this.onTouchStart,!1),o.addEventListener("touchmove",this.onTouchMove,!1),o.addEventListener("touchend",this.onTouchEnd,!1),o.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(o.removeEventListener=function(e,t,n){var i=Node.prototype.removeEventListener;"click"===e?i.call(o,e,t.hijacked||t,n):i.call(o,e,t,n)},o.addEventListener=function(e,t,n){var i=Node.prototype.addEventListener;"click"===e?i.call(o,e,t.hijacked||(t.hijacked=function(e){e.propagationStopped||t(e)}),n):i.call(o,e,t,n)}),"function"==typeof o.onclick&&(t=o.onclick,o.addEventListener("click",function(e){t(e)},!1),o.onclick=null)}function c(e,t){return function(){return e.apply(t,arguments)}}}var deviceIsAndroid=0<navigator.userAgent.indexOf("Android"),deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent),deviceIsIOS4=deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),deviceIsIOSWithBadTarget=deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent),deviceIsBlackBerry10=0<navigator.userAgent.indexOf("BB10");FastClick.prototype.needsClick=function(e){"use strict";switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(deviceIsIOS&&"file"===e.type||e.disabled)return!0;break;case"label":case"video":return!0}return/\bneedsclick\b/.test(e.className)},FastClick.prototype.needsFocus=function(e){"use strict";switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!deviceIsAndroid;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return/\bneedsfocus\b/.test(e.className)}},FastClick.prototype.sendClick=function(e,t){"use strict";var n,i,o,r;document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),r=t.changedTouches[0],(o=document.createEvent("MouseEvents")).initMouseEvent("mousedown",!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),o.forwardedTouchEvent=!0,e.dispatchEvent(o),(i=document.createEvent("MouseEvents")).initMouseEvent("mouseup",!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),i.forwardedTouchEvent=!0,e.dispatchEvent(i),(n=document.createEvent("MouseEvents")).initMouseEvent(this.determineEventType(e),!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,e.dispatchEvent(n)},FastClick.prototype.determineEventType=function(e){"use strict";return deviceIsAndroid&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},FastClick.prototype.focus=function(e){"use strict";var t;deviceIsIOS&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},FastClick.prototype.updateScrollParent=function(e){"use strict";var t,n;if(!(t=e.fastClickScrollParent)||!t.contains(e)){n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.fastClickLastScrollTop=t.scrollTop)},FastClick.prototype.getTargetElementFromEventTarget=function(e){"use strict";return e.nodeType===Node.TEXT_NODE?e.parentNode:e},FastClick.prototype.onTouchStart=function(e){"use strict";var t,n,i;if(1<e.targetTouches.length)return!0;if(t=this.getTargetElementFromEventTarget(e.target),n=e.targetTouches[0],deviceIsIOS){if((i=window.getSelection()).rangeCount&&!i.isCollapsed)return!0;if(!deviceIsIOS4){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=n.pageX,this.touchStartY=n.pageY,e.timeStamp-this.lastClickTime<this.tapDelay&&e.preventDefault(),!0},FastClick.prototype.touchHasMoved=function(e){"use strict";var t=e.changedTouches[0],n=this.touchBoundary;return Math.abs(t.pageX-this.touchStartX)>n||Math.abs(t.pageY-this.touchStartY)>n},FastClick.prototype.onTouchMove=function(e){"use strict";return this.trackingClick&&(this.targetElement===this.getTargetElementFromEventTarget(e.target)&&!this.touchHasMoved(e)||(this.trackingClick=!1,this.targetElement=null)),!0},FastClick.prototype.findControl=function(e){"use strict";return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},FastClick.prototype.onTouchEnd=function(e){"use strict";var t,n,i,o,r,s=this.targetElement;if(!this.trackingClick)return!0;if(e.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0;if(this.cancelNextClick=!1,this.lastClickTime=e.timeStamp,n=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,deviceIsIOSWithBadTarget&&(r=e.changedTouches[0],(s=document.elementFromPoint(r.pageX-window.pageXOffset,r.pageY-window.pageYOffset)||s).fastClickScrollParent=this.targetElement.fastClickScrollParent),"label"===(i=s.tagName.toLowerCase())){if(t=this.findControl(s)){if(this.focus(s),deviceIsAndroid)return!1;s=t}}else if(this.needsFocus(s))return 100<e.timeStamp-n||deviceIsIOS&&window.top!==window&&"input"===i?this.targetElement=null:(this.focus(s),this.sendClick(s,e),deviceIsIOS&&"select"===i||(this.targetElement=null,e.preventDefault())),!1;return!(!deviceIsIOS||deviceIsIOS4||!(o=s.fastClickScrollParent)||o.fastClickLastScrollTop===o.scrollTop)||(this.needsClick(s)||(e.preventDefault(),this.sendClick(s,e)),!1)},FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=!1,this.targetElement=null},FastClick.prototype.onMouse=function(e){"use strict";return!this.targetElement||(!!e.forwardedTouchEvent||(!e.cancelable||(!(!this.needsClick(this.targetElement)||this.cancelNextClick)||(e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1))))},FastClick.prototype.onClick=function(e){"use strict";var t;return this.trackingClick?(this.targetElement=null,!(this.trackingClick=!1)):"submit"===e.target.type&&0===e.detail||((t=this.onMouse(e))||(this.targetElement=null),t)},FastClick.prototype.destroy=function(){"use strict";var e=this.layer;deviceIsAndroid&&(e.removeEventListener("mouseover",this.onMouse,!0),e.removeEventListener("mousedown",this.onMouse,!0),e.removeEventListener("mouseup",this.onMouse,!0)),e.removeEventListener("click",this.onClick,!0),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchcancel",this.onTouchCancel,!1)},FastClick.notNeeded=function(e){"use strict";var t,n,i;if(void 0===window.ontouchstart)return!0;if(n=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!deviceIsAndroid)return!0;if(t=document.querySelector("meta[name=viewport]")){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(31<n&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(deviceIsBlackBerry10&&10<=(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/))[1]&&3<=i[2]&&(t=document.querySelector("meta[name=viewport]"))){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===e.style.msTouchAction},FastClick.attach=function(e,t){"use strict";return new FastClick(e,t)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){"use strict";return FastClick}):"undefined"!=typeof module&&module.exports?(module.exports=FastClick.attach,module.exports.FastClick=FastClick):window.FastClick=FastClick;
|
|
817
|
+
/*!
|
|
818
|
+
* @fileOverview TouchSwipe - jQuery Plugin
|
|
819
|
+
* @version 1.6.18
|
|
820
|
+
*
|
|
821
|
+
* @author Matt Bryson http://www.github.com/mattbryson
|
|
822
|
+
* @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin
|
|
823
|
+
* @see http://labs.rampinteractive.co.uk/touchSwipe/
|
|
824
|
+
* @see http://plugins.jquery.com/project/touchSwipe
|
|
825
|
+
* @license
|
|
826
|
+
* Copyright (c) 2010-2015 Matt Bryson
|
|
827
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
828
|
+
*
|
|
829
|
+
*/
|
|
830
|
+
!function(factory){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],factory):factory("undefined"!=typeof module&&module.exports?require("jquery"):jQuery)}(function($){"use strict";function init(options){return!options||void 0!==options.allowPageScroll||void 0===options.swipe&&void 0===options.swipeStatus||(options.allowPageScroll=NONE),void 0!==options.click&&void 0===options.tap&&(options.tap=options.click),options||(options={}),options=$.extend({},$.fn.swipe.defaults,options),this.each(function(){var $this=$(this),plugin=$this.data(PLUGIN_NS);plugin||(plugin=new TouchSwipe(this,options),$this.data(PLUGIN_NS,plugin))})}function TouchSwipe(element,options){function touchStart(jqEvent){if(!(getTouchInProgress()||$(jqEvent.target).closest(options.excludedElements,$element).length>0)){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(!event.pointerType||"mouse"!=event.pointerType||0!=options.fallbackToMouseEvents){var ret,touches=event.touches,evt=touches?touches[0]:event;return phase=PHASE_START,touches?fingerCount=touches.length:options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),distance=0,direction=null,currentDirection=null,pinchDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,maximumsMap=createMaximumsData(),cancelMultiFingerRelease(),createFingerData(0,evt),!touches||fingerCount===options.fingers||options.fingers===ALL_FINGERS||hasPinches()?(startTime=getTimeStamp(),2==fingerCount&&(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)),(options.swipeStatus||options.pinchStatus)&&(ret=triggerHandler(event,phase))):ret=!1,ret===!1?(phase=PHASE_CANCEL,triggerHandler(event,phase),ret):(options.hold&&(holdTimeout=setTimeout($.proxy(function(){$element.trigger("hold",[event.target]),options.hold&&(ret=options.hold.call($element,event,event.target))},this),options.longTapThreshold)),setTouchInProgress(!0),null)}}}function touchMove(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(phase!==PHASE_END&&phase!==PHASE_CANCEL&&!inMultiFingerRelease()){var ret,touches=event.touches,evt=touches?touches[0]:event,currentFinger=updateFingerData(evt);if(endTime=getTimeStamp(),touches&&(fingerCount=touches.length),options.hold&&clearTimeout(holdTimeout),phase=PHASE_MOVE,2==fingerCount&&(0==startTouchesDistance?(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)):(updateFingerData(touches[1]),endTouchesDistance=calculateTouchesDistance(fingerData[0].end,fingerData[1].end),pinchDirection=calculatePinchDirection(fingerData[0].end,fingerData[1].end)),pinchZoom=calculatePinchZoom(startTouchesDistance,endTouchesDistance),pinchDistance=Math.abs(startTouchesDistance-endTouchesDistance)),fingerCount===options.fingers||options.fingers===ALL_FINGERS||!touches||hasPinches()){if(direction=calculateDirection(currentFinger.start,currentFinger.end),currentDirection=calculateDirection(currentFinger.last,currentFinger.end),validateDefaultEvent(jqEvent,currentDirection),distance=calculateDistance(currentFinger.start,currentFinger.end),duration=calculateDuration(),setMaxDistance(direction,distance),ret=triggerHandler(event,phase),!options.triggerOnTouchEnd||options.triggerOnTouchLeave){var inBounds=!0;if(options.triggerOnTouchLeave){var bounds=getbounds(this);inBounds=isInBounds(currentFinger.end,bounds)}!options.triggerOnTouchEnd&&inBounds?phase=getNextPhase(PHASE_MOVE):options.triggerOnTouchLeave&&!inBounds&&(phase=getNextPhase(PHASE_END)),phase!=PHASE_CANCEL&&phase!=PHASE_END||triggerHandler(event,phase)}}else phase=PHASE_CANCEL,triggerHandler(event,phase);ret===!1&&(phase=PHASE_CANCEL,triggerHandler(event,phase))}}function touchEnd(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent,touches=event.touches;if(touches){if(touches.length&&!inMultiFingerRelease())return startMultiFingerRelease(event),!0;if(touches.length&&inMultiFingerRelease())return!0}return inMultiFingerRelease()&&(fingerCount=fingerCountAtRelease),endTime=getTimeStamp(),duration=calculateDuration(),didSwipeBackToCancel()||!validateSwipeDistance()?(phase=PHASE_CANCEL,triggerHandler(event,phase)):options.triggerOnTouchEnd||options.triggerOnTouchEnd===!1&&phase===PHASE_MOVE?(options.preventDefaultEvents!==!1&&jqEvent.cancelable!==!1&&jqEvent.preventDefault(),phase=PHASE_END,triggerHandler(event,phase)):!options.triggerOnTouchEnd&&hasTap()?(phase=PHASE_END,triggerHandlerForGesture(event,phase,TAP)):phase===PHASE_MOVE&&(phase=PHASE_CANCEL,triggerHandler(event,phase)),setTouchInProgress(!1),null}function touchCancel(){fingerCount=0,endTime=0,startTime=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,cancelMultiFingerRelease(),setTouchInProgress(!1)}function touchLeave(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;options.triggerOnTouchLeave&&(phase=getNextPhase(PHASE_END),triggerHandler(event,phase))}function removeListeners(){$element.off(START_EV,touchStart),$element.off(CANCEL_EV,touchCancel),$element.off(MOVE_EV,touchMove),$element.off(END_EV,touchEnd),LEAVE_EV&&$element.off(LEAVE_EV,touchLeave),setTouchInProgress(!1)}function getNextPhase(currentPhase){var nextPhase=currentPhase,validTime=validateSwipeTime(),validDistance=validateSwipeDistance(),didCancel=didSwipeBackToCancel();return!validTime||didCancel?nextPhase=PHASE_CANCEL:!validDistance||currentPhase!=PHASE_MOVE||options.triggerOnTouchEnd&&!options.triggerOnTouchLeave?!validDistance&¤tPhase==PHASE_END&&options.triggerOnTouchLeave&&(nextPhase=PHASE_CANCEL):nextPhase=PHASE_END,nextPhase}function triggerHandler(event,phase){var ret,touches=event.touches;return(didSwipe()||hasSwipes())&&(ret=triggerHandlerForGesture(event,phase,SWIPE)),(didPinch()||hasPinches())&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,PINCH)),didDoubleTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,DOUBLE_TAP):didLongTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,LONG_TAP):didTap()&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,TAP)),phase===PHASE_CANCEL&&touchCancel(event),phase===PHASE_END&&(touches?touches.length||touchCancel(event):touchCancel(event)),ret}function triggerHandlerForGesture(event,phase,gesture){var ret;if(gesture==SWIPE){if($element.trigger("swipeStatus",[phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection]),options.swipeStatus&&(ret=options.swipeStatus.call($element,event,phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection),ret===!1))return!1;if(phase==PHASE_END&&validateSwipe()){if(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),$element.trigger("swipe",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipe&&(ret=options.swipe.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection),ret===!1))return!1;switch(direction){case LEFT:$element.trigger("swipeLeft",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeLeft&&(ret=options.swipeLeft.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case RIGHT:$element.trigger("swipeRight",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeRight&&(ret=options.swipeRight.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case UP:$element.trigger("swipeUp",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeUp&&(ret=options.swipeUp.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case DOWN:$element.trigger("swipeDown",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeDown&&(ret=options.swipeDown.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection))}}}if(gesture==PINCH){if($element.trigger("pinchStatus",[phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchStatus&&(ret=options.pinchStatus.call($element,event,phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData),ret===!1))return!1;if(phase==PHASE_END&&validatePinch())switch(pinchDirection){case IN:$element.trigger("pinchIn",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchIn&&(ret=options.pinchIn.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData));break;case OUT:$element.trigger("pinchOut",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchOut&&(ret=options.pinchOut.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData))}}return gesture==TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),hasDoubleTap()&&!inDoubleTap()?(doubleTapStartTime=getTimeStamp(),singleTapTimeout=setTimeout($.proxy(function(){doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target))},this),options.doubleTapThreshold)):(doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target)))):gesture==DOUBLE_TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),doubleTapStartTime=null,$element.trigger("doubletap",[event.target]),options.doubleTap&&(ret=options.doubleTap.call($element,event,event.target))):gesture==LONG_TAP&&(phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),doubleTapStartTime=null,$element.trigger("longtap",[event.target]),options.longTap&&(ret=options.longTap.call($element,event,event.target)))),ret}function validateSwipeDistance(){var valid=!0;return null!==options.threshold&&(valid=distance>=options.threshold),valid}function didSwipeBackToCancel(){var cancelled=!1;return null!==options.cancelThreshold&&null!==direction&&(cancelled=getMaxDistance(direction)-distance>=options.cancelThreshold),cancelled}function validatePinchDistance(){return null!==options.pinchThreshold?pinchDistance>=options.pinchThreshold:!0}function validateSwipeTime(){var result;return result=options.maxTimeThreshold?!(duration>=options.maxTimeThreshold):!0}function validateDefaultEvent(jqEvent,direction){if(options.preventDefaultEvents!==!1)if(options.allowPageScroll===NONE)jqEvent.preventDefault();else{var auto=options.allowPageScroll===AUTO;switch(direction){case LEFT:(options.swipeLeft&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case RIGHT:(options.swipeRight&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case UP:(options.swipeUp&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case DOWN:(options.swipeDown&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case NONE:}}}function validatePinch(){var hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),hasCorrectDistance=validatePinchDistance();return hasCorrectFingerCount&&hasEndPoint&&hasCorrectDistance}function hasPinches(){return!!(options.pinchStatus||options.pinchIn||options.pinchOut)}function didPinch(){return!(!validatePinch()||!hasPinches())}function validateSwipe(){var hasValidTime=validateSwipeTime(),hasValidDistance=validateSwipeDistance(),hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),didCancel=didSwipeBackToCancel(),valid=!didCancel&&hasEndPoint&&hasCorrectFingerCount&&hasValidDistance&&hasValidTime;return valid}function hasSwipes(){return!!(options.swipe||options.swipeStatus||options.swipeLeft||options.swipeRight||options.swipeUp||options.swipeDown)}function didSwipe(){return!(!validateSwipe()||!hasSwipes())}function validateFingers(){return fingerCount===options.fingers||options.fingers===ALL_FINGERS||!SUPPORTS_TOUCH}function validateEndPoint(){return 0!==fingerData[0].end.x}function hasTap(){return!!options.tap}function hasDoubleTap(){return!!options.doubleTap}function hasLongTap(){return!!options.longTap}function validateDoubleTap(){if(null==doubleTapStartTime)return!1;var now=getTimeStamp();return hasDoubleTap()&&now-doubleTapStartTime<=options.doubleTapThreshold}function inDoubleTap(){return validateDoubleTap()}function validateTap(){return(1===fingerCount||!SUPPORTS_TOUCH)&&(isNaN(distance)||distance<options.threshold)}function validateLongTap(){return duration>options.longTapThreshold&&DOUBLE_TAP_THRESHOLD>distance}function didTap(){return!(!validateTap()||!hasTap())}function didDoubleTap(){return!(!validateDoubleTap()||!hasDoubleTap())}function didLongTap(){return!(!validateLongTap()||!hasLongTap())}function startMultiFingerRelease(event){previousTouchEndTime=getTimeStamp(),fingerCountAtRelease=event.touches.length+1}function cancelMultiFingerRelease(){previousTouchEndTime=0,fingerCountAtRelease=0}function inMultiFingerRelease(){var withinThreshold=!1;if(previousTouchEndTime){var diff=getTimeStamp()-previousTouchEndTime;diff<=options.fingerReleaseThreshold&&(withinThreshold=!0)}return withinThreshold}function getTouchInProgress(){return!($element.data(PLUGIN_NS+"_intouch")!==!0)}function setTouchInProgress(val){$element&&(val===!0?($element.on(MOVE_EV,touchMove),$element.on(END_EV,touchEnd),LEAVE_EV&&$element.on(LEAVE_EV,touchLeave)):($element.off(MOVE_EV,touchMove,!1),$element.off(END_EV,touchEnd,!1),LEAVE_EV&&$element.off(LEAVE_EV,touchLeave,!1)),$element.data(PLUGIN_NS+"_intouch",val===!0))}function createFingerData(id,evt){var f={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return f.start.x=f.last.x=f.end.x=evt.pageX||evt.clientX,f.start.y=f.last.y=f.end.y=evt.pageY||evt.clientY,fingerData[id]=f,f}function updateFingerData(evt){var id=void 0!==evt.identifier?evt.identifier:0,f=getFingerData(id);return null===f&&(f=createFingerData(id,evt)),f.last.x=f.end.x,f.last.y=f.end.y,f.end.x=evt.pageX||evt.clientX,f.end.y=evt.pageY||evt.clientY,f}function getFingerData(id){return fingerData[id]||null}function setMaxDistance(direction,distance){direction!=NONE&&(distance=Math.max(distance,getMaxDistance(direction)),maximumsMap[direction].distance=distance)}function getMaxDistance(direction){return maximumsMap[direction]?maximumsMap[direction].distance:void 0}function createMaximumsData(){var maxData={};return maxData[LEFT]=createMaximumVO(LEFT),maxData[RIGHT]=createMaximumVO(RIGHT),maxData[UP]=createMaximumVO(UP),maxData[DOWN]=createMaximumVO(DOWN),maxData}function createMaximumVO(dir){return{direction:dir,distance:0}}function calculateDuration(){return endTime-startTime}function calculateTouchesDistance(startPoint,endPoint){var diffX=Math.abs(startPoint.x-endPoint.x),diffY=Math.abs(startPoint.y-endPoint.y);return Math.round(Math.sqrt(diffX*diffX+diffY*diffY))}function calculatePinchZoom(startDistance,endDistance){var percent=endDistance/startDistance*1;return percent.toFixed(2)}function calculatePinchDirection(){return 1>pinchZoom?OUT:IN}function calculateDistance(startPoint,endPoint){return Math.round(Math.sqrt(Math.pow(endPoint.x-startPoint.x,2)+Math.pow(endPoint.y-startPoint.y,2)))}function calculateAngle(startPoint,endPoint){var x=startPoint.x-endPoint.x,y=endPoint.y-startPoint.y,r=Math.atan2(y,x),angle=Math.round(180*r/Math.PI);return 0>angle&&(angle=360-Math.abs(angle)),angle}function calculateDirection(startPoint,endPoint){if(comparePoints(startPoint,endPoint))return NONE;var angle=calculateAngle(startPoint,endPoint);return 45>=angle&&angle>=0?LEFT:360>=angle&&angle>=315?LEFT:angle>=135&&225>=angle?RIGHT:angle>45&&135>angle?DOWN:UP}function getTimeStamp(){var now=new Date;return now.getTime()}function getbounds(el){el=$(el);var offset=el.offset(),bounds={left:offset.left,right:offset.left+el.outerWidth(),top:offset.top,bottom:offset.top+el.outerHeight()};return bounds}function isInBounds(point,bounds){return point.x>bounds.left&&point.x<bounds.right&&point.y>bounds.top&&point.y<bounds.bottom}function comparePoints(pointA,pointB){return pointA.x==pointB.x&&pointA.y==pointB.y}var options=$.extend({},options),useTouchEvents=SUPPORTS_TOUCH||SUPPORTS_POINTER||!options.fallbackToMouseEvents,START_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerDown":"pointerdown":"touchstart":"mousedown",MOVE_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerMove":"pointermove":"touchmove":"mousemove",END_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerUp":"pointerup":"touchend":"mouseup",LEAVE_EV=useTouchEvents?SUPPORTS_POINTER?"mouseleave":null:"mouseleave",CANCEL_EV=SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerCancel":"pointercancel":"touchcancel",distance=0,direction=null,currentDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,pinchDirection=0,maximumsMap=null,$element=$(element),phase="start",fingerCount=0,fingerData={},startTime=0,endTime=0,previousTouchEndTime=0,fingerCountAtRelease=0,doubleTapStartTime=0,singleTapTimeout=null,holdTimeout=null;try{$element.on(START_EV,touchStart),$element.on(CANCEL_EV,touchCancel)}catch(e){$.error("events not supported "+START_EV+","+CANCEL_EV+" on jQuery.swipe")}this.enable=function(){return this.disable(),$element.on(START_EV,touchStart),$element.on(CANCEL_EV,touchCancel),$element},this.disable=function(){return removeListeners(),$element},this.destroy=function(){removeListeners(),$element.data(PLUGIN_NS,null),$element=null},this.option=function(property,value){if("object"==typeof property)options=$.extend(options,property);else if(void 0!==options[property]){if(void 0===value)return options[property];options[property]=value}else{if(!property)return options;$.error("Option "+property+" does not exist on jQuery.swipe.options")}return null}}var VERSION="1.6.18",LEFT="left",RIGHT="right",UP="up",DOWN="down",IN="in",OUT="out",NONE="none",AUTO="auto",SWIPE="swipe",PINCH="pinch",TAP="tap",DOUBLE_TAP="doubletap",LONG_TAP="longtap",HORIZONTAL="horizontal",VERTICAL="vertical",ALL_FINGERS="all",DOUBLE_TAP_THRESHOLD=10,PHASE_START="start",PHASE_MOVE="move",PHASE_END="end",PHASE_CANCEL="cancel",SUPPORTS_TOUCH="ontouchstart"in window,SUPPORTS_POINTER_IE10=window.navigator.msPointerEnabled&&!window.PointerEvent&&!SUPPORTS_TOUCH,SUPPORTS_POINTER=(window.PointerEvent||window.navigator.msPointerEnabled)&&!SUPPORTS_TOUCH,PLUGIN_NS="TouchSwipe",defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:".noSwipe",preventDefaultEvents:!0};$.fn.swipe=function(method){var $this=$(this),plugin=$this.data(PLUGIN_NS);if(plugin&&"string"==typeof method){if(plugin[method])return plugin[method].apply(plugin,Array.prototype.slice.call(arguments,1));$.error("Method "+method+" does not exist on jQuery.swipe")}else if(plugin&&"object"==typeof method)plugin.option.apply(plugin,arguments);else if(!(plugin||"object"!=typeof method&&method))return init.apply(this,arguments);return $this},$.fn.swipe.version=VERSION,$.fn.swipe.defaults=defaults,$.fn.swipe.phases={PHASE_START:PHASE_START,PHASE_MOVE:PHASE_MOVE,PHASE_END:PHASE_END,PHASE_CANCEL:PHASE_CANCEL},$.fn.swipe.directions={LEFT:LEFT,RIGHT:RIGHT,UP:UP,DOWN:DOWN,IN:IN,OUT:OUT},$.fn.swipe.pageScroll={NONE:NONE,HORIZONTAL:HORIZONTAL,VERTICAL:VERTICAL,AUTO:AUTO},$.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:ALL_FINGERS}});
|
|
831
|
+
// TinyColor v1.4.1
|
|
832
|
+
// https://github.com/bgrins/TinyColor
|
|
833
|
+
// 2016-07-07, Brian Grinstead, MIT License
|
|
834
|
+
!function(a){function b(a,d){if(a=a?a:"",d=d||{},a instanceof b)return a;if(!(this instanceof b))return new b(a,d);var e=c(a);this._originalInput=a,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=P(100*this._a)/100,this._format=d.format||e.format,this._gradientType=d.gradientType,this._r<1&&(this._r=P(this._r)),this._g<1&&(this._g=P(this._g)),this._b<1&&(this._b=P(this._b)),this._ok=e.ok,this._tc_id=O++}function c(a){var b={r:0,g:0,b:0},c=1,e=null,g=null,i=null,j=!1,k=!1;return"string"==typeof a&&(a=K(a)),"object"==typeof a&&(J(a.r)&&J(a.g)&&J(a.b)?(b=d(a.r,a.g,a.b),j=!0,k="%"===String(a.r).substr(-1)?"prgb":"rgb"):J(a.h)&&J(a.s)&&J(a.v)?(e=G(a.s),g=G(a.v),b=h(a.h,e,g),j=!0,k="hsv"):J(a.h)&&J(a.s)&&J(a.l)&&(e=G(a.s),i=G(a.l),b=f(a.h,e,i),j=!0,k="hsl"),a.hasOwnProperty("a")&&(c=a.a)),c=z(c),{ok:j,format:a.format||k,r:Q(255,R(b.r,0)),g:Q(255,R(b.g,0)),b:Q(255,R(b.b,0)),a:c}}function d(a,b,c){return{r:255*A(a,255),g:255*A(b,255),b:255*A(c,255)}}function e(a,b,c){a=A(a,255),b=A(b,255),c=A(c,255);var d,e,f=R(a,b,c),g=Q(a,b,c),h=(f+g)/2;if(f==g)d=e=0;else{var i=f-g;switch(e=h>.5?i/(2-f-g):i/(f+g),f){case a:d=(b-c)/i+(c>b?6:0);break;case b:d=(c-a)/i+2;break;case c:d=(a-b)/i+4}d/=6}return{h:d,s:e,l:h}}function f(a,b,c){function d(a,b,c){return 0>c&&(c+=1),c>1&&(c-=1),1/6>c?a+6*(b-a)*c:.5>c?b:2/3>c?a+6*(b-a)*(2/3-c):a}var e,f,g;if(a=A(a,360),b=A(b,100),c=A(c,100),0===b)e=f=g=c;else{var h=.5>c?c*(1+b):c+b-c*b,i=2*c-h;e=d(i,h,a+1/3),f=d(i,h,a),g=d(i,h,a-1/3)}return{r:255*e,g:255*f,b:255*g}}function g(a,b,c){a=A(a,255),b=A(b,255),c=A(c,255);var d,e,f=R(a,b,c),g=Q(a,b,c),h=f,i=f-g;if(e=0===f?0:i/f,f==g)d=0;else{switch(f){case a:d=(b-c)/i+(c>b?6:0);break;case b:d=(c-a)/i+2;break;case c:d=(a-b)/i+4}d/=6}return{h:d,s:e,v:h}}function h(b,c,d){b=6*A(b,360),c=A(c,100),d=A(d,100);var e=a.floor(b),f=b-e,g=d*(1-c),h=d*(1-f*c),i=d*(1-(1-f)*c),j=e%6,k=[d,h,g,g,i,d][j],l=[i,d,d,h,g,g][j],m=[g,g,i,d,d,h][j];return{r:255*k,g:255*l,b:255*m}}function i(a,b,c,d){var e=[F(P(a).toString(16)),F(P(b).toString(16)),F(P(c).toString(16))];return d&&e[0].charAt(0)==e[0].charAt(1)&&e[1].charAt(0)==e[1].charAt(1)&&e[2].charAt(0)==e[2].charAt(1)?e[0].charAt(0)+e[1].charAt(0)+e[2].charAt(0):e.join("")}function j(a,b,c,d,e){var f=[F(P(a).toString(16)),F(P(b).toString(16)),F(P(c).toString(16)),F(H(d))];return e&&f[0].charAt(0)==f[0].charAt(1)&&f[1].charAt(0)==f[1].charAt(1)&&f[2].charAt(0)==f[2].charAt(1)&&f[3].charAt(0)==f[3].charAt(1)?f[0].charAt(0)+f[1].charAt(0)+f[2].charAt(0)+f[3].charAt(0):f.join("")}function k(a,b,c,d){var e=[F(H(d)),F(P(a).toString(16)),F(P(b).toString(16)),F(P(c).toString(16))];return e.join("")}function l(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.s-=c/100,d.s=B(d.s),b(d)}function m(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.s+=c/100,d.s=B(d.s),b(d)}function n(a){return b(a).desaturate(100)}function o(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.l+=c/100,d.l=B(d.l),b(d)}function p(a,c){c=0===c?0:c||10;var d=b(a).toRgb();return d.r=R(0,Q(255,d.r-P(255*-(c/100)))),d.g=R(0,Q(255,d.g-P(255*-(c/100)))),d.b=R(0,Q(255,d.b-P(255*-(c/100)))),b(d)}function q(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.l-=c/100,d.l=B(d.l),b(d)}function r(a,c){var d=b(a).toHsl(),e=(d.h+c)%360;return d.h=0>e?360+e:e,b(d)}function s(a){var c=b(a).toHsl();return c.h=(c.h+180)%360,b(c)}function t(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+120)%360,s:c.s,l:c.l}),b({h:(d+240)%360,s:c.s,l:c.l})]}function u(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+90)%360,s:c.s,l:c.l}),b({h:(d+180)%360,s:c.s,l:c.l}),b({h:(d+270)%360,s:c.s,l:c.l})]}function v(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+72)%360,s:c.s,l:c.l}),b({h:(d+216)%360,s:c.s,l:c.l})]}function w(a,c,d){c=c||6,d=d||30;var e=b(a).toHsl(),f=360/d,g=[b(a)];for(e.h=(e.h-(f*c>>1)+720)%360;--c;)e.h=(e.h+f)%360,g.push(b(e));return g}function x(a,c){c=c||6;for(var d=b(a).toHsv(),e=d.h,f=d.s,g=d.v,h=[],i=1/c;c--;)h.push(b({h:e,s:f,v:g})),g=(g+i)%1;return h}function y(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b}function z(a){return a=parseFloat(a),(isNaN(a)||0>a||a>1)&&(a=1),a}function A(b,c){D(b)&&(b="100%");var d=E(b);return b=Q(c,R(0,parseFloat(b))),d&&(b=parseInt(b*c,10)/100),a.abs(b-c)<1e-6?1:b%c/parseFloat(c)}function B(a){return Q(1,R(0,a))}function C(a){return parseInt(a,16)}function D(a){return"string"==typeof a&&-1!=a.indexOf(".")&&1===parseFloat(a)}function E(a){return"string"==typeof a&&-1!=a.indexOf("%")}function F(a){return 1==a.length?"0"+a:""+a}function G(a){return 1>=a&&(a=100*a+"%"),a}function H(b){return a.round(255*parseFloat(b)).toString(16)}function I(a){return C(a)/255}function J(a){return!!V.CSS_UNIT.exec(a)}function K(a){a=a.replace(M,"").replace(N,"").toLowerCase();var b=!1;if(T[a])a=T[a],b=!0;else if("transparent"==a)return{r:0,g:0,b:0,a:0,format:"name"};var c;return(c=V.rgb.exec(a))?{r:c[1],g:c[2],b:c[3]}:(c=V.rgba.exec(a))?{r:c[1],g:c[2],b:c[3],a:c[4]}:(c=V.hsl.exec(a))?{h:c[1],s:c[2],l:c[3]}:(c=V.hsla.exec(a))?{h:c[1],s:c[2],l:c[3],a:c[4]}:(c=V.hsv.exec(a))?{h:c[1],s:c[2],v:c[3]}:(c=V.hsva.exec(a))?{h:c[1],s:c[2],v:c[3],a:c[4]}:(c=V.hex8.exec(a))?{r:C(c[1]),g:C(c[2]),b:C(c[3]),a:I(c[4]),format:b?"name":"hex8"}:(c=V.hex6.exec(a))?{r:C(c[1]),g:C(c[2]),b:C(c[3]),format:b?"name":"hex"}:(c=V.hex4.exec(a))?{r:C(c[1]+""+c[1]),g:C(c[2]+""+c[2]),b:C(c[3]+""+c[3]),a:I(c[4]+""+c[4]),format:b?"name":"hex8"}:(c=V.hex3.exec(a))?{r:C(c[1]+""+c[1]),g:C(c[2]+""+c[2]),b:C(c[3]+""+c[3]),format:b?"name":"hex"}:!1}function L(a){var b,c;return a=a||{level:"AA",size:"small"},b=(a.level||"AA").toUpperCase(),c=(a.size||"small").toLowerCase(),"AA"!==b&&"AAA"!==b&&(b="AA"),"small"!==c&&"large"!==c&&(c="small"),{level:b,size:c}}var M=/^\s+/,N=/\s+$/,O=0,P=a.round,Q=a.min,R=a.max,S=a.random;b.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var a=this.toRgb();return(299*a.r+587*a.g+114*a.b)/1e3},getLuminance:function(){var b,c,d,e,f,g,h=this.toRgb();return b=h.r/255,c=h.g/255,d=h.b/255,e=.03928>=b?b/12.92:a.pow((b+.055)/1.055,2.4),f=.03928>=c?c/12.92:a.pow((c+.055)/1.055,2.4),g=.03928>=d?d/12.92:a.pow((d+.055)/1.055,2.4),.2126*e+.7152*f+.0722*g},setAlpha:function(a){return this._a=z(a),this._roundA=P(100*this._a)/100,this},toHsv:function(){var a=g(this._r,this._g,this._b);return{h:360*a.h,s:a.s,v:a.v,a:this._a}},toHsvString:function(){var a=g(this._r,this._g,this._b),b=P(360*a.h),c=P(100*a.s),d=P(100*a.v);return 1==this._a?"hsv("+b+", "+c+"%, "+d+"%)":"hsva("+b+", "+c+"%, "+d+"%, "+this._roundA+")"},toHsl:function(){var a=e(this._r,this._g,this._b);return{h:360*a.h,s:a.s,l:a.l,a:this._a}},toHslString:function(){var a=e(this._r,this._g,this._b),b=P(360*a.h),c=P(100*a.s),d=P(100*a.l);return 1==this._a?"hsl("+b+", "+c+"%, "+d+"%)":"hsla("+b+", "+c+"%, "+d+"%, "+this._roundA+")"},toHex:function(a){return i(this._r,this._g,this._b,a)},toHexString:function(a){return"#"+this.toHex(a)},toHex8:function(a){return j(this._r,this._g,this._b,this._a,a)},toHex8String:function(a){return"#"+this.toHex8(a)},toRgb:function(){return{r:P(this._r),g:P(this._g),b:P(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+P(this._r)+", "+P(this._g)+", "+P(this._b)+")":"rgba("+P(this._r)+", "+P(this._g)+", "+P(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:P(100*A(this._r,255))+"%",g:P(100*A(this._g,255))+"%",b:P(100*A(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+P(100*A(this._r,255))+"%, "+P(100*A(this._g,255))+"%, "+P(100*A(this._b,255))+"%)":"rgba("+P(100*A(this._r,255))+"%, "+P(100*A(this._g,255))+"%, "+P(100*A(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":this._a<1?!1:U[i(this._r,this._g,this._b,!0)]||!1},toFilter:function(a){var c="#"+k(this._r,this._g,this._b,this._a),d=c,e=this._gradientType?"GradientType = 1, ":"";if(a){var f=b(a);d="#"+k(f._r,f._g,f._b,f._a)}return"progid:DXImageTransform.Microsoft.gradient("+e+"startColorstr="+c+",endColorstr="+d+")"},toString:function(a){var b=!!a;a=a||this._format;var c=!1,d=this._a<1&&this._a>=0,e=!b&&d&&("hex"===a||"hex6"===a||"hex3"===a||"hex4"===a||"hex8"===a||"name"===a);return e?"name"===a&&0===this._a?this.toName():this.toRgbString():("rgb"===a&&(c=this.toRgbString()),"prgb"===a&&(c=this.toPercentageRgbString()),("hex"===a||"hex6"===a)&&(c=this.toHexString()),"hex3"===a&&(c=this.toHexString(!0)),"hex4"===a&&(c=this.toHex8String(!0)),"hex8"===a&&(c=this.toHex8String()),"name"===a&&(c=this.toName()),"hsl"===a&&(c=this.toHslString()),"hsv"===a&&(c=this.toHsvString()),c||this.toHexString())},clone:function(){return b(this.toString())},_applyModification:function(a,b){var c=a.apply(null,[this].concat([].slice.call(b)));return this._r=c._r,this._g=c._g,this._b=c._b,this.setAlpha(c._a),this},lighten:function(){return this._applyModification(o,arguments)},brighten:function(){return this._applyModification(p,arguments)},darken:function(){return this._applyModification(q,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(n,arguments)},spin:function(){return this._applyModification(r,arguments)},_applyCombination:function(a,b){return a.apply(null,[this].concat([].slice.call(b)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(s,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(t,arguments)},tetrad:function(){return this._applyCombination(u,arguments)}},b.fromRatio=function(a,c){if("object"==typeof a){var d={};for(var e in a)a.hasOwnProperty(e)&&(d[e]="a"===e?a[e]:G(a[e]));a=d}return b(a,c)},b.equals=function(a,c){return a&&c?b(a).toRgbString()==b(c).toRgbString():!1},b.random=function(){return b.fromRatio({r:S(),g:S(),b:S()})},b.mix=function(a,c,d){d=0===d?0:d||50;var e=b(a).toRgb(),f=b(c).toRgb(),g=d/100,h={r:(f.r-e.r)*g+e.r,g:(f.g-e.g)*g+e.g,b:(f.b-e.b)*g+e.b,a:(f.a-e.a)*g+e.a};return b(h)},b.readability=function(c,d){var e=b(c),f=b(d);return(a.max(e.getLuminance(),f.getLuminance())+.05)/(a.min(e.getLuminance(),f.getLuminance())+.05)},b.isReadable=function(a,c,d){var e,f,g=b.readability(a,c);switch(f=!1,e=L(d),e.level+e.size){case"AAsmall":case"AAAlarge":f=g>=4.5;break;case"AAlarge":f=g>=3;break;case"AAAsmall":f=g>=7}return f},b.mostReadable=function(a,c,d){var e,f,g,h,i=null,j=0;d=d||{},f=d.includeFallbackColors,g=d.level,h=d.size;for(var k=0;k<c.length;k++)e=b.readability(a,c[k]),e>j&&(j=e,i=b(c[k]));return b.isReadable(a,i,{level:g,size:h})||!f?i:(d.includeFallbackColors=!1,b.mostReadable(a,["#fff","#000"],d))};var T=b.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},U=b.hexNames=y(T),V=function(){var a="[-\\+]?\\d+%?",b="[-\\+]?\\d*\\.\\d+%?",c="(?:"+b+")|(?:"+a+")",d="[\\s|\\(]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")\\s*\\)?",e="[\\s|\\(]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")\\s*\\)?";return{CSS_UNIT:new RegExp(c),rgb:new RegExp("rgb"+d),rgba:new RegExp("rgba"+e),hsl:new RegExp("hsl"+d),hsla:new RegExp("hsla"+e),hsv:new RegExp("hsv"+d),hsva:new RegExp("hsva"+e),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof module&&module.exports?module.exports=b:"function"==typeof define&&define.amd?define(function(){return b}):window.tinycolor=b}(Math);
|
|
835
|
+
!function(r){var i=function(n){var e,i;return i=(e=r("<div/>",{class:n}).appendTo("body")).is(":visible"),e.remove(),i};r.isBreakpoint=function(n){var e;switch(n){case"xs":e="d-block d-sm-none";break;case"sm":e="d-none d-sm-block d-md-none";break;case"md":e="d-none d-md-block d-lg-none";break;case"lg":e="d-none d-lg-block d-xl-none";break;case"xl":e="d-none d-xl-block"}return i(e)},r.isBreakpointUp=function(n){var e;switch(n){case"xs":return!0;case"sm":e="d-none d-sm-block";break;case"md":e="d-none d-md-block";break;case"lg":e="d-none d-lg-block";break;case"xl":e="d-none d-xl-block"}return i(e)},r.extend(r,{isXs:function(){return r.isBreakpoint("xs")},isSm:function(){return r.isBreakpoint("sm")},isMd:function(){return r.isBreakpoint("md")},isLg:function(){return r.isBreakpoint("lg")},isXl:function(){return r.isBreakpoint("xl")},isXsUp:function(){return r.isBreakpointUp("xs")},isSmUp:function(){return r.isBreakpointUp("sm")},isMdUp:function(){return r.isBreakpointUp("md")},isLgUp:function(){return r.isBreakpointUp("lg")},isXlUp:function(){return r.isBreakpointUp("xl")}})}(jQuery);
|