sinatra-hexacta 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/sinatra/handlers/errors.rb +23 -0
- data/lib/sinatra/handlers/init.rb +3 -0
- data/lib/sinatra/handlers/notifications.rb +74 -0
- data/lib/sinatra/handlers/reports.rb +1 -0
- data/lib/sinatra/helpers/charts.rb +15 -0
- data/lib/sinatra/helpers/init.rb +5 -0
- data/lib/sinatra/helpers/inputs.rb +47 -0
- data/lib/sinatra/helpers/libraries.rb +25 -0
- data/lib/sinatra/helpers/subscriptions.rb +44 -0
- data/lib/sinatra/hexacta.rb +32 -0
- data/lib/sinatra/public/css/app.min.1.css +16231 -0
- data/lib/sinatra/public/css/app.min.2.css +3341 -0
- data/lib/sinatra/public/css/shell.css +65 -0
- data/lib/sinatra/public/fonts/montserrat/Montserrat-Black.otf +0 -0
- data/lib/sinatra/public/fonts/montserrat/Montserrat-ExtraLight.otf +0 -0
- data/lib/sinatra/public/fonts/montserrat/Montserrat-Light.otf +0 -0
- data/lib/sinatra/public/fonts/montserrat/Montserrat-SemiBold.otf +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Bold-webfont.eot +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Bold-webfont.svg +593 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Bold-webfont.ttf +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Bold-webfont.woff +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Light-webfont.eot +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Light-webfont.svg +641 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Light-webfont.ttf +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Light-webfont.woff +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Medium-webfont.eot +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Medium-webfont.svg +593 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Medium-webfont.ttf +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Medium-webfont.woff +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Regular-webfont.eot +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Regular-webfont.svg +621 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Regular-webfont.ttf +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Regular-webfont.woff +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.eot +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.svg +631 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.ttf +0 -0
- data/lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.woff +0 -0
- data/lib/sinatra/public/img/select.png +0 -0
- data/lib/sinatra/public/img/select@2x.png +0 -0
- data/lib/sinatra/public/js/app.js +794 -0
- data/lib/sinatra/public/js/form_validator.js +29 -0
- data/lib/sinatra/public/vendors/animate.css/animate.min.css +7 -0
- data/lib/sinatra/public/vendors/bootstrap-validator/validator.js +405 -0
- data/lib/sinatra/public/vendors/bootstrap/bootstrap.min.js +7 -0
- data/lib/sinatra/public/vendors/chartist/chartist.min.css +1 -0
- data/lib/sinatra/public/vendors/chartist/chartist.min.js +10 -0
- data/lib/sinatra/public/vendors/chosen/chosen-sprite.png +0 -0
- data/lib/sinatra/public/vendors/chosen/chosen-sprite@2x.png +0 -0
- data/lib/sinatra/public/vendors/chosen/chosen.jquery.min.js +3 -0
- data/lib/sinatra/public/vendors/chosen/chosen.min.css +11 -0
- data/lib/sinatra/public/vendors/eonasdan-bootstrap-datetimepicker/bootstrap-datetimepicker.js +2051 -0
- data/lib/sinatra/public/vendors/eonasdan-bootstrap-datetimepicker/bootstrap-datetimepicker.min.css +5 -0
- data/lib/sinatra/public/vendors/jquery/jquery.min.js +5 -0
- data/lib/sinatra/public/vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js +5 -0
- data/lib/sinatra/public/vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css +1267 -0
- data/lib/sinatra/public/vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js +2370 -0
- data/lib/sinatra/public/vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.min.css +1 -0
- data/lib/sinatra/public/vendors/malihu-custom-scrollbar-plugin/mCSB_buttons.png +0 -0
- data/lib/sinatra/public/vendors/material-design-iconic-font/css/material-design-iconic-font.css +5166 -0
- data/lib/sinatra/public/vendors/material-design-iconic-font/css/material-design-iconic-font.min.css +1 -0
- data/lib/sinatra/public/vendors/material-design-iconic-font/fonts/Material-Design-Iconic-Font.eot +0 -0
- data/lib/sinatra/public/vendors/material-design-iconic-font/fonts/Material-Design-Iconic-Font.svg +787 -0
- data/lib/sinatra/public/vendors/material-design-iconic-font/fonts/Material-Design-Iconic-Font.ttf +0 -0
- data/lib/sinatra/public/vendors/material-design-iconic-font/fonts/Material-Design-Iconic-Font.woff +0 -0
- data/lib/sinatra/public/vendors/material-design-iconic-font/fonts/Material-Design-Iconic-Font.woff2 +0 -0
- data/lib/sinatra/public/vendors/moment/moment.min.js +7 -0
- data/lib/sinatra/public/vendors/typeahead.js/bloodhound.min.js +7 -0
- data/lib/sinatra/public/vendors/typeahead.js/handlebars.js +2610 -0
- data/lib/sinatra/public/vendors/typeahead.js/typeahead.bundle.min.js +8 -0
- data/lib/sinatra/public/vendors/waves/waves.min.css +8 -0
- data/lib/sinatra/public/vendors/waves/waves.min.js +10 -0
- data/lib/sinatra/views/charts/simple_line.slim +36 -0
- data/lib/sinatra/views/errors/403.slim +9 -0
- data/lib/sinatra/views/errors/404.slim +27 -0
- data/lib/sinatra/views/errors/500.slim +24 -0
- data/lib/sinatra/views/inputs/date.slim +12 -0
- data/lib/sinatra/views/inputs/input.slim +18 -0
- data/lib/sinatra/views/inputs/month.slim +13 -0
- data/lib/sinatra/views/inputs/multiple_select.slim +27 -0
- data/lib/sinatra/views/inputs/radio.slim +8 -0
- data/lib/sinatra/views/inputs/select.slim +26 -0
- data/lib/sinatra/views/inputs/textarea.slim +14 -0
- data/lib/sinatra/views/inputs/tick.slim +8 -0
- data/lib/sinatra/views/inputs/year.slim +12 -0
- data/lib/sinatra/views/libraries/include_css.slim +28 -0
- data/lib/sinatra/views/libraries/include_js_after.slim +53 -0
- data/lib/sinatra/views/libraries/include_js_before.slim +7 -0
- data/lib/sinatra/views/notifications.slim +98 -0
- data/lib/sinatra/views/notifications/form.slim +41 -0
- data/lib/sinatra/views/notifications/item.slim +11 -0
- data/lib/sinatra/views/notifications/modal.slim +29 -0
- data/lib/sinatra/views/notifications/new.slim +21 -0
- data/lib/sinatra/views/notifications/view.slim +80 -0
- data/lib/sinatra/views/notifications/widget.slim +33 -0
- metadata +136 -0
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,794 @@
|
|
1
|
+
/*
|
2
|
+
* Detact Mobile Browser
|
3
|
+
*/
|
4
|
+
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
|
5
|
+
$('html').addClass('ismobile');
|
6
|
+
}
|
7
|
+
|
8
|
+
// configuration of the observer:
|
9
|
+
var config = { attributes: false, childList: true, characterData: false, subtree: true };
|
10
|
+
|
11
|
+
|
12
|
+
// Chosen touch support.
|
13
|
+
if ($('.chosen-container').length > 0) {
|
14
|
+
$('.chosen-container').on('touchstart', function(e){
|
15
|
+
e.stopPropagation(); e.preventDefault();
|
16
|
+
// Trigger the mousedown event.
|
17
|
+
$(this).trigger('mousedown');
|
18
|
+
});
|
19
|
+
}
|
20
|
+
|
21
|
+
$(document).ready(function(){
|
22
|
+
|
23
|
+
// Fix modal inside other components
|
24
|
+
$('.modal').appendTo("body");
|
25
|
+
|
26
|
+
if (window.top.location.hash.indexOf("#") != -1) {
|
27
|
+
$("a[href=" + window.top.location.hash +"]").trigger('click');
|
28
|
+
}
|
29
|
+
|
30
|
+
$("a[data-toggle='tab']").click(function() {
|
31
|
+
window.top.location.hash = $(this).attr("href");
|
32
|
+
});
|
33
|
+
/* --------------------------------------------------------
|
34
|
+
Layout
|
35
|
+
-----------------------------------------------------------*/
|
36
|
+
(function () {
|
37
|
+
|
38
|
+
//Get saved layout type from LocalStorage
|
39
|
+
var layoutStatus = localStorage.getItem('ma-layout-status');
|
40
|
+
$('#header').attr('data-current-skin', "pink");
|
41
|
+
if(!$('#header-2')[0]) { //Make it work only on normal headers
|
42
|
+
if (layoutStatus == 1) {
|
43
|
+
$('body').addClass('sw-toggled');
|
44
|
+
$('#tw-switch').prop('checked', true);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
$('body').on('change', '#toggle-width input:checkbox', function () {
|
49
|
+
if ($(this).is(':checked')) {
|
50
|
+
setTimeout(function () {
|
51
|
+
$('body').addClass('toggled sw-toggled');
|
52
|
+
localStorage.setItem('ma-layout-status', 1);
|
53
|
+
}, 250);
|
54
|
+
}
|
55
|
+
else {
|
56
|
+
setTimeout(function () {
|
57
|
+
$('body').removeClass('toggled sw-toggled');
|
58
|
+
localStorage.setItem('ma-layout-status', 0);
|
59
|
+
}, 250);
|
60
|
+
}
|
61
|
+
});
|
62
|
+
})();
|
63
|
+
|
64
|
+
//Hack for modal to work on dropdown menu
|
65
|
+
$('header .lv-item').click(function(e) {
|
66
|
+
e.stopPropagation();
|
67
|
+
if ($(e.target).is('[data-toggle=modal]')) {
|
68
|
+
$($(e.target).data('target')).modal()
|
69
|
+
}
|
70
|
+
});
|
71
|
+
|
72
|
+
/* --------------------------------------------------------
|
73
|
+
Scrollbar
|
74
|
+
-----------------------------------------------------------*/
|
75
|
+
function scrollBar(selector, theme, mousewheelaxis) {
|
76
|
+
$(selector).mCustomScrollbar({
|
77
|
+
theme: theme,
|
78
|
+
scrollInertia: 100,
|
79
|
+
axis:'yx',
|
80
|
+
mouseWheel: {
|
81
|
+
enable: true,
|
82
|
+
axis: mousewheelaxis,
|
83
|
+
preventDefault: true
|
84
|
+
}
|
85
|
+
});
|
86
|
+
}
|
87
|
+
|
88
|
+
if (!$('html').hasClass('ismobile')) {
|
89
|
+
//On Custom Class
|
90
|
+
if ($('.c-overflow')[0]) {
|
91
|
+
scrollBar('.c-overflow', 'minimal-dark', 'y');
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
/*
|
96
|
+
* Top Search
|
97
|
+
*/
|
98
|
+
(function(){
|
99
|
+
$('body').on('click', '#top-search > a', function(e){
|
100
|
+
e.preventDefault();
|
101
|
+
|
102
|
+
$('#header').addClass('search-toggled');
|
103
|
+
$('#top-search-wrap input').focus();
|
104
|
+
});
|
105
|
+
|
106
|
+
$('body').on('click', '#top-search-close', function(e){
|
107
|
+
e.preventDefault();
|
108
|
+
|
109
|
+
$('#header').removeClass('search-toggled');
|
110
|
+
});
|
111
|
+
})();
|
112
|
+
|
113
|
+
/*
|
114
|
+
* Sidebar
|
115
|
+
*/
|
116
|
+
(function(){
|
117
|
+
//Toggle
|
118
|
+
$('body').on('click', '#menu-trigger, #chat-trigger', function(e){
|
119
|
+
e.preventDefault();
|
120
|
+
var x = $(this).data('trigger');
|
121
|
+
|
122
|
+
$(x).toggleClass('toggled');
|
123
|
+
$(this).toggleClass('open');
|
124
|
+
|
125
|
+
//Close opened sub-menus
|
126
|
+
$('.sub-menu.toggled').not('.active').each(function(){
|
127
|
+
$(this).removeClass('toggled');
|
128
|
+
$(this).find('ul').hide();
|
129
|
+
});
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
$('.profile-menu .main-menu').hide();
|
134
|
+
|
135
|
+
if (x == '#sidebar') {
|
136
|
+
|
137
|
+
$elem = '#sidebar';
|
138
|
+
$elem2 = '#menu-trigger';
|
139
|
+
|
140
|
+
$('#chat-trigger').removeClass('open');
|
141
|
+
|
142
|
+
if (!$('#chat').hasClass('toggled')) {
|
143
|
+
$('#header').toggleClass('sidebar-toggled');
|
144
|
+
}
|
145
|
+
else {
|
146
|
+
$('#chat').removeClass('toggled');
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
if (x == '#chat') {
|
151
|
+
$elem = '#chat';
|
152
|
+
$elem2 = '#chat-trigger';
|
153
|
+
|
154
|
+
$('#menu-trigger').removeClass('open');
|
155
|
+
|
156
|
+
if (!$('#sidebar').hasClass('toggled')) {
|
157
|
+
$('#header').toggleClass('sidebar-toggled');
|
158
|
+
}
|
159
|
+
else {
|
160
|
+
$('#sidebar').removeClass('toggled');
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
//When clicking outside
|
165
|
+
if ($('#header').hasClass('sidebar-toggled')) {
|
166
|
+
$(document).on('click', function (e) {
|
167
|
+
if (($(e.target).closest($elem).length === 0) && ($(e.target).closest($elem2).length === 0)) {
|
168
|
+
setTimeout(function(){
|
169
|
+
$($elem).removeClass('toggled');
|
170
|
+
$('#header').removeClass('sidebar-toggled');
|
171
|
+
$($elem2).removeClass('open');
|
172
|
+
});
|
173
|
+
}
|
174
|
+
});
|
175
|
+
}
|
176
|
+
})
|
177
|
+
|
178
|
+
//Submenu
|
179
|
+
$('body').on('click', '.sub-menu > a', function(e){
|
180
|
+
e.preventDefault();
|
181
|
+
$(this).next().slideToggle(200);
|
182
|
+
$(this).parent().toggleClass('toggled');
|
183
|
+
});
|
184
|
+
})();
|
185
|
+
|
186
|
+
/*
|
187
|
+
* Clear Notification
|
188
|
+
*/
|
189
|
+
$('body').on('click', '[data-clear="notification"]', function(e){
|
190
|
+
e.preventDefault();
|
191
|
+
|
192
|
+
var x = $(this).closest('.listview');
|
193
|
+
var y = x.find('.lv-item');
|
194
|
+
var z = y.size();
|
195
|
+
|
196
|
+
$(this).parent().fadeOut();
|
197
|
+
|
198
|
+
x.find('.list-group').prepend('<i class="grid-loading hide-it"></i>');
|
199
|
+
x.find('.grid-loading').fadeIn(1500);
|
200
|
+
|
201
|
+
|
202
|
+
var w = 0;
|
203
|
+
y.each(function(){
|
204
|
+
var z = $(this);
|
205
|
+
setTimeout(function(){
|
206
|
+
z.addClass('animated fadeOutRightBig').delay(1000).queue(function(){
|
207
|
+
z.remove();
|
208
|
+
});
|
209
|
+
}, w+=150);
|
210
|
+
})
|
211
|
+
|
212
|
+
//Popup empty message
|
213
|
+
setTimeout(function(){
|
214
|
+
$('#notifications').addClass('empty');
|
215
|
+
}, (z*150)+200);
|
216
|
+
});
|
217
|
+
|
218
|
+
/*
|
219
|
+
* Dropdown Menu
|
220
|
+
*/
|
221
|
+
if($('.dropdown')[0]) {
|
222
|
+
//Propagate
|
223
|
+
$('body').on('click', '.dropdown.open .dropdown-menu', function(e){
|
224
|
+
e.stopPropagation();
|
225
|
+
});
|
226
|
+
|
227
|
+
$('.dropdown').on('shown.bs.dropdown', function (e) {
|
228
|
+
if($(this).attr('data-animation')) {
|
229
|
+
$animArray = [];
|
230
|
+
$animation = $(this).data('animation');
|
231
|
+
$animArray = $animation.split(',');
|
232
|
+
$animationIn = 'animated '+$animArray[0];
|
233
|
+
$animationOut = 'animated '+ $animArray[1];
|
234
|
+
$animationDuration = ''
|
235
|
+
if(!$animArray[2]) {
|
236
|
+
$animationDuration = 500; //if duration is not defined, default is set to 500ms
|
237
|
+
}
|
238
|
+
else {
|
239
|
+
$animationDuration = $animArray[2];
|
240
|
+
}
|
241
|
+
|
242
|
+
$(this).find('.dropdown-menu').removeClass($animationOut)
|
243
|
+
$(this).find('.dropdown-menu').addClass($animationIn);
|
244
|
+
}
|
245
|
+
});
|
246
|
+
|
247
|
+
$('.dropdown').on('hide.bs.dropdown', function (e) {
|
248
|
+
if($(this).attr('data-animation')) {
|
249
|
+
e.preventDefault();
|
250
|
+
$this = $(this);
|
251
|
+
$dropdownMenu = $this.find('.dropdown-menu');
|
252
|
+
|
253
|
+
$dropdownMenu.addClass($animationOut);
|
254
|
+
setTimeout(function(){
|
255
|
+
$this.removeClass('open')
|
256
|
+
|
257
|
+
}, $animationDuration);
|
258
|
+
}
|
259
|
+
});
|
260
|
+
}
|
261
|
+
|
262
|
+
/*
|
263
|
+
* Profile Menu
|
264
|
+
*/
|
265
|
+
$('body').on('click', '.profile-menu > a', function(e){
|
266
|
+
e.preventDefault();
|
267
|
+
$(this).parent().toggleClass('toggled');
|
268
|
+
$(this).next().slideToggle(200);
|
269
|
+
});
|
270
|
+
|
271
|
+
/*
|
272
|
+
* Text Feild
|
273
|
+
*/
|
274
|
+
|
275
|
+
//Add blue animated border and remove with condition when focus and blur
|
276
|
+
if($('.fg-line')[0]) {
|
277
|
+
$('body').on('focus', '.fg-line .form-control', function(){
|
278
|
+
$(this).closest('.fg-line').addClass('fg-toggled');
|
279
|
+
})
|
280
|
+
|
281
|
+
$('body').on('blur', '.form-control', function(){
|
282
|
+
var p = $(this).closest('.form-group, .input-group');
|
283
|
+
var i = p.find('.form-control').val();
|
284
|
+
|
285
|
+
if (p.hasClass('fg-float')) {
|
286
|
+
if (i.length == 0) {
|
287
|
+
$(this).closest('.fg-line').removeClass('fg-toggled');
|
288
|
+
}
|
289
|
+
}
|
290
|
+
else {
|
291
|
+
$(this).closest('.fg-line').removeClass('fg-toggled');
|
292
|
+
}
|
293
|
+
});
|
294
|
+
}
|
295
|
+
|
296
|
+
//Add blue border for pre-valued fg-flot text feilds
|
297
|
+
if($('.fg-float')[0]) {
|
298
|
+
$('.fg-float .form-control').each(function(){
|
299
|
+
var i = $(this).val();
|
300
|
+
|
301
|
+
if (!i.length == 0) {
|
302
|
+
$(this).closest('.fg-line').addClass('fg-toggled');
|
303
|
+
}
|
304
|
+
|
305
|
+
});
|
306
|
+
}
|
307
|
+
|
308
|
+
/*
|
309
|
+
* Tag Select
|
310
|
+
*/
|
311
|
+
if($('.chosen')[0]) {
|
312
|
+
$('.chosen').chosen({
|
313
|
+
allow_single_deselect: true,
|
314
|
+
width: '100%'
|
315
|
+
});
|
316
|
+
}
|
317
|
+
|
318
|
+
/*
|
319
|
+
* Date Time Picker
|
320
|
+
*/
|
321
|
+
|
322
|
+
|
323
|
+
//Date Time Picker
|
324
|
+
if ($('.date-time-picker')[0]) {
|
325
|
+
$('.date-time-picker').datetimepicker({
|
326
|
+
locale: 'es'
|
327
|
+
});
|
328
|
+
}
|
329
|
+
|
330
|
+
//Time
|
331
|
+
if ($('.time-picker')[0]) {
|
332
|
+
$('.time-picker').datetimepicker({
|
333
|
+
format: 'LT'
|
334
|
+
});
|
335
|
+
}
|
336
|
+
|
337
|
+
//Date
|
338
|
+
if ($('.date-picker')[0]) {
|
339
|
+
$('.date-picker').datetimepicker({
|
340
|
+
format: 'DD/MM/YYYY',
|
341
|
+
locale: 'en'
|
342
|
+
});
|
343
|
+
}
|
344
|
+
|
345
|
+
//Date
|
346
|
+
if ($('.month-picker')[0]) {
|
347
|
+
$('.month-picker').datetimepicker({
|
348
|
+
viewMode: 'years',
|
349
|
+
format: 'MM/YYYY'
|
350
|
+
});
|
351
|
+
}
|
352
|
+
|
353
|
+
//Date
|
354
|
+
if ($('.year-picker')[0]) {
|
355
|
+
$('.year-picker').datetimepicker({
|
356
|
+
viewMode: 'years',
|
357
|
+
format: 'YYYY'
|
358
|
+
});
|
359
|
+
}
|
360
|
+
|
361
|
+
/*
|
362
|
+
* Waves Animation
|
363
|
+
*/
|
364
|
+
(function(){
|
365
|
+
Waves.attach('.btn:not(.btn-icon):not(.btn-float)');
|
366
|
+
Waves.attach('.btn-icon, .btn-float', ['waves-circle', 'waves-float']);
|
367
|
+
Waves.init();
|
368
|
+
})();
|
369
|
+
|
370
|
+
/*
|
371
|
+
* Lightbox
|
372
|
+
*/
|
373
|
+
if ($('.lightbox')[0]) {
|
374
|
+
$('.lightbox').lightGallery({
|
375
|
+
enableTouch: true
|
376
|
+
});
|
377
|
+
}
|
378
|
+
|
379
|
+
/*
|
380
|
+
* Link prevent
|
381
|
+
*/
|
382
|
+
$('body').on('click', '.a-prevent', function(e){
|
383
|
+
e.preventDefault();
|
384
|
+
});
|
385
|
+
|
386
|
+
/*
|
387
|
+
* Collaspe Fix
|
388
|
+
*/
|
389
|
+
if ($('.collapse')[0]) {
|
390
|
+
|
391
|
+
//Add active class for opened items
|
392
|
+
$('.collapse').on('show.bs.collapse', function (e) {
|
393
|
+
$(this).closest('.panel').find('.panel-heading').addClass('active');
|
394
|
+
});
|
395
|
+
|
396
|
+
$('.collapse').on('hide.bs.collapse', function (e) {
|
397
|
+
$(this).closest('.panel').find('.panel-heading').removeClass('active');
|
398
|
+
});
|
399
|
+
|
400
|
+
//Add active class for pre opened items
|
401
|
+
$('.collapse.in').each(function(){
|
402
|
+
$(this).closest('.panel').find('.panel-heading').addClass('active');
|
403
|
+
});
|
404
|
+
}
|
405
|
+
|
406
|
+
/*
|
407
|
+
* Tooltips
|
408
|
+
*/
|
409
|
+
if ($('[data-toggle="tooltip"]')[0]) {
|
410
|
+
$('[data-toggle="tooltip"]').tooltip();
|
411
|
+
}
|
412
|
+
|
413
|
+
/*
|
414
|
+
* Popover
|
415
|
+
*/
|
416
|
+
if ($('[data-toggle="popover"]')[0]) {
|
417
|
+
$('[data-toggle="popover"]').popover();
|
418
|
+
}
|
419
|
+
|
420
|
+
/*
|
421
|
+
* Message
|
422
|
+
*/
|
423
|
+
|
424
|
+
//Actions
|
425
|
+
if ($('.on-select')[0]) {
|
426
|
+
var checkboxes = '.lv-avatar-content input:checkbox';
|
427
|
+
var actions = $('.on-select').closest('.lv-actions');
|
428
|
+
|
429
|
+
$('body').on('click', checkboxes, function() {
|
430
|
+
if ($(checkboxes+':checked')[0]) {
|
431
|
+
actions.addClass('toggled');
|
432
|
+
}
|
433
|
+
else {
|
434
|
+
actions.removeClass('toggled');
|
435
|
+
}
|
436
|
+
});
|
437
|
+
}
|
438
|
+
|
439
|
+
if($('#ms-menu-trigger')[0]) {
|
440
|
+
$('body').on('click', '#ms-menu-trigger', function(e){
|
441
|
+
e.preventDefault();
|
442
|
+
$(this).toggleClass('open');
|
443
|
+
$('.ms-menu').toggleClass('toggled');
|
444
|
+
});
|
445
|
+
}
|
446
|
+
|
447
|
+
/*
|
448
|
+
* Login
|
449
|
+
*/
|
450
|
+
if ($('.login-content')[0]) {
|
451
|
+
//Add class to HTML. This is used to center align the logn box
|
452
|
+
$('html').addClass('login-content');
|
453
|
+
|
454
|
+
$('body').on('click', '.login-navigation > li', function(){
|
455
|
+
var z = $(this).data('block');
|
456
|
+
var t = $(this).closest('.lc-block');
|
457
|
+
|
458
|
+
t.removeClass('toggled');
|
459
|
+
|
460
|
+
setTimeout(function(){
|
461
|
+
$(z).addClass('toggled');
|
462
|
+
});
|
463
|
+
|
464
|
+
})
|
465
|
+
}
|
466
|
+
|
467
|
+
/*
|
468
|
+
* Fullscreen Browsing
|
469
|
+
*/
|
470
|
+
if ($('[data-action="fullscreen"]')[0]) {
|
471
|
+
var fs = $("[data-action='fullscreen']");
|
472
|
+
fs.on('click', function(e) {
|
473
|
+
e.preventDefault();
|
474
|
+
|
475
|
+
//Launch
|
476
|
+
function launchIntoFullscreen(element) {
|
477
|
+
if(element.requestFullscreen) {
|
478
|
+
element.requestFullscreen();
|
479
|
+
} else if(element.mozRequestFullScreen) {
|
480
|
+
element.mozRequestFullScreen();
|
481
|
+
} else if(element.webkitRequestFullscreen) {
|
482
|
+
element.webkitRequestFullscreen();
|
483
|
+
} else if(element.msRequestFullscreen) {
|
484
|
+
element.msRequestFullscreen();
|
485
|
+
}
|
486
|
+
}
|
487
|
+
|
488
|
+
//Exit
|
489
|
+
function exitFullscreen() {
|
490
|
+
if(document.exitFullscreen) {
|
491
|
+
document.exitFullscreen();
|
492
|
+
} else if(document.mozCancelFullScreen) {
|
493
|
+
document.mozCancelFullScreen();
|
494
|
+
} else if(document.webkitExitFullscreen) {
|
495
|
+
document.webkitExitFullscreen();
|
496
|
+
}
|
497
|
+
}
|
498
|
+
|
499
|
+
launchIntoFullscreen(document.documentElement);
|
500
|
+
fs.closest('.dropdown').removeClass('open');
|
501
|
+
});
|
502
|
+
}
|
503
|
+
|
504
|
+
/*
|
505
|
+
* Clear Local Storage
|
506
|
+
*/
|
507
|
+
if ($('[data-action="clear-localstorage"]')[0]) {
|
508
|
+
var cls = $('[data-action="clear-localstorage"]');
|
509
|
+
|
510
|
+
cls.on('click', function(e) {
|
511
|
+
e.preventDefault();
|
512
|
+
|
513
|
+
swal({
|
514
|
+
title: "¿Estás seguro?",
|
515
|
+
text: "Todos tus datos locales serán borrados.",
|
516
|
+
type: "warning",
|
517
|
+
showCancelButton: true,
|
518
|
+
confirmButtonColor: "#DD6B55",
|
519
|
+
confirmButtonText: "Borrar",
|
520
|
+
cancelButtonText: "Cancelar",
|
521
|
+
closeOnConfirm: false
|
522
|
+
}, function(){
|
523
|
+
localStorage.clear();
|
524
|
+
swal("Hecho!", "Cache borrada", "success");
|
525
|
+
});
|
526
|
+
});
|
527
|
+
}
|
528
|
+
|
529
|
+
/*
|
530
|
+
* Profile Edit Toggle
|
531
|
+
*/
|
532
|
+
if ($('[data-pmb-action]')[0]) {
|
533
|
+
$('body').on('click', '[data-pmb-action]', function(e){
|
534
|
+
e.preventDefault();
|
535
|
+
var d = $(this).data('pmb-action');
|
536
|
+
|
537
|
+
if (d === "edit") {
|
538
|
+
$(this).closest('.pmb-block').toggleClass('toggled');
|
539
|
+
}
|
540
|
+
|
541
|
+
if (d === "reset") {
|
542
|
+
$(this).closest('.pmb-block').removeClass('toggled');
|
543
|
+
}
|
544
|
+
|
545
|
+
|
546
|
+
});
|
547
|
+
}
|
548
|
+
|
549
|
+
/*
|
550
|
+
* IE 9 Placeholder
|
551
|
+
*/
|
552
|
+
if($('html').hasClass('ie9')) {
|
553
|
+
$('input, textarea').placeholder({
|
554
|
+
customClass: 'ie9-placeholder'
|
555
|
+
});
|
556
|
+
}
|
557
|
+
|
558
|
+
|
559
|
+
/*
|
560
|
+
* Listview Search
|
561
|
+
*/
|
562
|
+
if ($('.lvh-search-trigger')[0]) {
|
563
|
+
|
564
|
+
|
565
|
+
$('body').on('click', '.lvh-search-trigger', function(e){
|
566
|
+
e.preventDefault();
|
567
|
+
x = $(this).closest('.lv-header-alt').find('.lvh-search');
|
568
|
+
|
569
|
+
x.fadeIn(300);
|
570
|
+
x.find('.lvhs-input').focus();
|
571
|
+
});
|
572
|
+
|
573
|
+
//Close Search
|
574
|
+
$('body').on('click', '.lvh-search-close', function(){
|
575
|
+
x.fadeOut(300);
|
576
|
+
setTimeout(function(){
|
577
|
+
x.find('.lvhs-input').val('');
|
578
|
+
}, 350);
|
579
|
+
})
|
580
|
+
}
|
581
|
+
|
582
|
+
|
583
|
+
/*
|
584
|
+
* Print
|
585
|
+
*/
|
586
|
+
if ($('[data-action="print"]')[0]) {
|
587
|
+
$('body').on('click', '[data-action="print"]', function(e){
|
588
|
+
e.preventDefault();
|
589
|
+
|
590
|
+
window.print();
|
591
|
+
})
|
592
|
+
}
|
593
|
+
|
594
|
+
/*
|
595
|
+
* Modal hide
|
596
|
+
*/
|
597
|
+
$('.modal').bind('shown.bs.modal', function (e) {
|
598
|
+
$(this).find('#submit').attr("disabled",false);
|
599
|
+
});
|
600
|
+
|
601
|
+
});
|
602
|
+
|
603
|
+
function start_load() {
|
604
|
+
if (!$("#loader")[0]) {
|
605
|
+
$("html").append('<div id="loader" style="position: fixed;z-index: 100000000;padding:5px;top: 0;"><div class="preloader pl-lg pls-white" style="left: 10px; top: 5px;"><svg class="pl-circular" viewBox="25 25 50 50"><circle class="plc-path" cx="50" cy="50" r="20"></circle></svg></div></div>');
|
606
|
+
}
|
607
|
+
}
|
608
|
+
|
609
|
+
function stop_load() {
|
610
|
+
$("#loader").remove();
|
611
|
+
}
|
612
|
+
|
613
|
+
|
614
|
+
$( document ).ajaxSend(function( event, jqxhr, settings ) {
|
615
|
+
if (!settings.url.includes(".json")) {
|
616
|
+
start_load();
|
617
|
+
}
|
618
|
+
});
|
619
|
+
|
620
|
+
$( document ).ajaxStop(function() {
|
621
|
+
stop_load();
|
622
|
+
});
|
623
|
+
|
624
|
+
function rm(url) {
|
625
|
+
disableButtons();
|
626
|
+
if (confirm('¿Estás seguro que deseas realizar esta operación?')) {
|
627
|
+
$.ajax({
|
628
|
+
url: url,
|
629
|
+
type: 'DELETE',
|
630
|
+
done: function(result) {
|
631
|
+
location.reload();
|
632
|
+
},
|
633
|
+
success: function(result) {
|
634
|
+
location.reload();
|
635
|
+
},
|
636
|
+
error: function(error) {
|
637
|
+
alert("Ha ocurrido un error, intentalo nuevamente!");
|
638
|
+
enableButtons();
|
639
|
+
}
|
640
|
+
});
|
641
|
+
} else {
|
642
|
+
enableButtons();
|
643
|
+
}
|
644
|
+
}
|
645
|
+
|
646
|
+
|
647
|
+
function rm_object(object,id) {
|
648
|
+
disableButtons();
|
649
|
+
$.ajax({
|
650
|
+
url: '/' + object + '/' + id,
|
651
|
+
type: 'DELETE',
|
652
|
+
data: {},
|
653
|
+
success: function(result) {
|
654
|
+
location.reload();
|
655
|
+
}
|
656
|
+
});
|
657
|
+
}
|
658
|
+
|
659
|
+
function post(url) {
|
660
|
+
disableButtons();
|
661
|
+
if (confirm('¿Estás seguro que deseas realizar esta operación?')) {
|
662
|
+
$.ajax({
|
663
|
+
url: url,
|
664
|
+
type: 'POST',
|
665
|
+
done: function(result) {
|
666
|
+
location.reload();
|
667
|
+
},
|
668
|
+
success: function(result) {
|
669
|
+
location.reload();
|
670
|
+
},
|
671
|
+
error: function(error) {
|
672
|
+
alert("Ha ocurrido un error, intentalo nuevamente!");
|
673
|
+
enableButtons();
|
674
|
+
}
|
675
|
+
});
|
676
|
+
} else {
|
677
|
+
enableButtons();
|
678
|
+
}
|
679
|
+
}
|
680
|
+
|
681
|
+
function disableButtons() {
|
682
|
+
$(".btn").each(function() {
|
683
|
+
$(this).data("temp",$(this).val());
|
684
|
+
$(this).attr("disabled",true);
|
685
|
+
});
|
686
|
+
return true
|
687
|
+
}
|
688
|
+
function enableButtons() {
|
689
|
+
$(".btn").each(function() {
|
690
|
+
$(this).attr("disabled",false);
|
691
|
+
});
|
692
|
+
return true
|
693
|
+
}
|
694
|
+
(function( $ ){
|
695
|
+
$.fn.disableSelect = function() {
|
696
|
+
$(this).prop("disabled", true);
|
697
|
+
$(this).selectpicker('refresh');
|
698
|
+
};
|
699
|
+
})( jQuery );
|
700
|
+
(function( $ ){
|
701
|
+
$.fn.enableSelect = function() {
|
702
|
+
$(this).prop("disabled", false);
|
703
|
+
$(this).selectpicker('refresh');
|
704
|
+
};
|
705
|
+
})( jQuery );
|
706
|
+
|
707
|
+
/*
|
708
|
+
* Bootstrap Growl - Notifications popups
|
709
|
+
*/
|
710
|
+
function notify(message, type){
|
711
|
+
$('[data-growl="container"]').find('[data-growl="dismiss"]').trigger('click');
|
712
|
+
$.growl({
|
713
|
+
message: message
|
714
|
+
},{
|
715
|
+
type: type,
|
716
|
+
allow_dismiss: false,
|
717
|
+
label: 'Cancel',
|
718
|
+
className: 'btn-xs btn-inverse growl-animated',
|
719
|
+
placement: {
|
720
|
+
from: 'bottom',
|
721
|
+
align: 'left'
|
722
|
+
},
|
723
|
+
delay: 5000,
|
724
|
+
animate: {
|
725
|
+
enter: 'animated fadeInUp',
|
726
|
+
exit: 'animated fadeOutDown'
|
727
|
+
},
|
728
|
+
offset: {
|
729
|
+
x: 0,
|
730
|
+
y: 0
|
731
|
+
}
|
732
|
+
});
|
733
|
+
};
|
734
|
+
|
735
|
+
function encodeQueryData(data)
|
736
|
+
{
|
737
|
+
var ret = [];
|
738
|
+
for (var d in data)
|
739
|
+
ret.push(encodeURIComponent(d) + "=" + encodeURIComponent(data[d]));
|
740
|
+
return ret.join("&");
|
741
|
+
}
|
742
|
+
|
743
|
+
(function ($) {
|
744
|
+
"use strict";
|
745
|
+
function centerModal() {
|
746
|
+
$(this).css('display', 'block');
|
747
|
+
var $dialog = $(this).find(".modal-dialog"),
|
748
|
+
offset = ($(window).height() - $dialog.height()) / 2,
|
749
|
+
bottomMargin = parseInt($dialog.css('marginBottom'), 10);
|
750
|
+
|
751
|
+
// Make sure you don't hide the top part of the modal w/ a negative margin if it's longer than the screen height, and keep the margin equal to the bottom margin of the modal
|
752
|
+
if(offset < bottomMargin) offset = bottomMargin;
|
753
|
+
$dialog.css("margin-top", offset);
|
754
|
+
}
|
755
|
+
|
756
|
+
$(document).on('show.bs.modal', '.modal', centerModal);
|
757
|
+
$(window).on("resize", function () {
|
758
|
+
$('.modal:visible').each(centerModal);
|
759
|
+
});
|
760
|
+
}(jQuery));
|
761
|
+
|
762
|
+
function buildFilterMap(offset) {
|
763
|
+
filter_map = {};
|
764
|
+
$("#form select, #form input").each(function() {
|
765
|
+
if ($(this).val() != null && $(this).val() != "") {
|
766
|
+
if ($(this).is(':checkbox')) {
|
767
|
+
if ($(this).is(':checked')) {
|
768
|
+
filter_map[$(this)[0].name] = "on";
|
769
|
+
} else {
|
770
|
+
filter_map[$(this)[0].name] = "off";
|
771
|
+
}
|
772
|
+
} else {
|
773
|
+
filter_map[$(this)[0].name] = $(this).val();
|
774
|
+
}
|
775
|
+
}
|
776
|
+
});
|
777
|
+
if (offset != null) {
|
778
|
+
filter_map["offset"] = offset;
|
779
|
+
} else {
|
780
|
+
filter_map["offset"] = filter_map["offset"] - 1;
|
781
|
+
}
|
782
|
+
return filter_map;
|
783
|
+
}
|
784
|
+
|
785
|
+
function read_notify(id,url) {
|
786
|
+
$.ajax({
|
787
|
+
url: '/notifications/' + id,
|
788
|
+
type: 'POST',
|
789
|
+
data: {},
|
790
|
+
success: function(result) {
|
791
|
+
window.location = url;
|
792
|
+
}
|
793
|
+
});
|
794
|
+
}
|