PageSourceSearch

https://europass.lt/mobilumo-dokumentu-sistema/public/js/paper-dashboard.js

js europass.lt collected 2026-09-26 02:33:57 UTC 10,914 bytes, 348 lines download raw bytes

1/*!
2
3  =========================================================
4  * Paper Dashboard PRO - V1.3.1
5  =========================================================
6
7  * Product Page: https://www.creative-tim.com/product/paper-dashboard-pro
8  * Available with purchase of license from https://www.creative-tim.com/product/paper-dashboard-pro
9  * Copyright 2017 Creative Tim (https://www.creative-tim.com)
10  * License Creative Tim (https://www.creative-tim.com/license)
11
12  =========================================================
13
14*/
15
16var fixedTop = false;
17
18var mobile_menu_visible = 0,
19    mobile_menu_initialized = false,
20    toggle_initialized = false,
21    bootstrap_nav_initialized = false,
22    $sidebar,
23    isWindows;
24
25
26$(document).ready(function(){
27    window_width = $(window).width();
28    $sidebar = $('.sidebar');
29
30    // We put modals out of wrapper to working properly
31    $('.modal').appendTo("body");
32
33      var isWindows = navigator.platform.startsWith('Win');
34
35    if (isWindows){
36       // if we are on windows OS we activate the perfectScrollbar function
37       var $sidebar_wrapper = document.getElementsByClassName('sidebar-wrapper')[0];
38       var $main_panel = document.getElementsByClassName('main-panel')[0];
39
40       var ps = new PerfectScrollbar($sidebar_wrapper);
41       ps = new PerfectScrollbar($main_panel);
42
43       $('html').addClass('perfect-scrollbar-on');
44   } else {
45       $('html').addClass('perfect-scrollbar-off');
46   }
47
48    if($('body').hasClass('sidebar-mini')){
49        pdp.misc.sidebar_mini_active = true;
50    }
51
52    pdp.initSidebarsCheck();
53    pdp.initMinimizeSidebar();
54
55    $('.form-control').on("focus", function(){
56        $(this).parent('.input-group').addClass("input-group-focus");
57    }).on("blur", function(){
58        $(this).parent(".input-group").removeClass("input-group-focus");
59    });
60
61    //  Activate the tooltips
62    $('[rel="tooltip"]').tooltip();
63
64
65    $('.switch').bootstrapSwitch({
66        onColor:'primary'
67    });
68
69    $('.switch-plain').bootstrapSwitch({
70        onColor:'',
71        onText: '',
72        offText: ''
73    });
74
75    $('.switch-icon').bootstrapSwitch({
76        onColor:'',
77        onText: '<i class="fa fa-check"></i>',
78        offText: '<i class="fa fa-times"></i>'
79    });
80
81
82    //Activate tags
83    //removed class label and label-color from tag span and replaced with data-color
84    if($(".tagsinput").length != 0){
85        var tagClass = $('.tagsinput').data('color');
86
87        $('.tagsinput').tagsinput({
88            tagClass: ' tag-'+ tagClass +' '
89        });
90    }
91
92    //  Init Bootstrap Select Picker
93    if($(".selectpicker").length != 0){
94      $(".selectpicker").selectpicker();
95      $('.bootstrap-select .dropdown-menu .inner').perfectScrollbar();
96    }
97
98});
99
100
101
102// activate collapse right menu when the windows is resized
103$(window).resize(function(){
104    pdp.initSidebarsCheck();
105
106});
107
108pdp = {
109    misc:{
110        navbar_menu_visible: 0,
111        active_collapse: true,
112        disabled_collapse_init: 0
113
114    },
115    initSidebarsCheck: function(){
116        // Init navigation toggle for small screens
117        if($(window).width() <= 991 || matchMedia('only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape)').matches){
118            if($sidebar.length != 0){
119                pdp.initSidebarMenu();
120            } else {
121                pdp.initBootstrapNavbarMenu();
122            }
123        } else if(mobile_menu_initialized == true){
124            // reset all the additions that we made for the sidebar wrapper only if the screen is bigger than 991px
125            $sidebar_wrapper.find('.navbar-form').remove();
126            $sidebar_wrapper.find('.nav-mobile-menu').remove();
127
128            mobile_menu_initialized = false;
129        }
130    },
131
132    initMinimizeSidebar: function(){
133        $('#minimizeSidebar').click(function(){
134            var $btn = $(this);
135
136            if(pdp.misc.sidebar_mini_active == true){
137                $('body').removeClass('sidebar-mini');
138                $btn.html('<i class="ti-more-alt"></i>');
139                pdp.misc.sidebar_mini_active = false;
140
141            }else{
142                $('body').addClass('sidebar-mini');
143                $btn.html('<i class="ti-menu-alt"></i>');
144                pdp.misc.sidebar_mini_active = true;
145            }
146
147            // we simulate the window Resize so the charts will get updated in realtime.
148            var simulateWindowResize = setInterval(function(){
149                window.dispatchEvent(new Event('resize'));
150            },180);
151
152            // we stop the simulation of Window Resize after the animations are completed
153            setTimeout(function(){
154                clearInterval(simulateWindowResize);
155            },1000);
156        });
157    },
158
159    initSidebarMenu: function(){
160        $sidebar_wrapper = $('.sidebar-wrapper');
161
162        if(!mobile_menu_initialized){
163
164            $navbar = $('nav').find('.navbar-collapse').first().clone(true);
165
166            nav_content = '';
167            mobile_menu_content = '';
168
169            $navbar.children('ul').each(function(){
170
171                content_buff = $(this).html();
172                nav_content = nav_content + content_buff;
173            });
174
175            nav_content = '<ul class="nav nav-mobile-menu">' + nav_content + '</ul>';
176
177            $navbar_form = $('nav').find('.navbar-form').clone(true);
178
179            $sidebar_nav = $sidebar_wrapper.find(' > .nav');
180
181            // insert the navbar form before the sidebar list
182            $nav_content = $(nav_content);
183            $nav_content.insertBefore($sidebar_nav);
184            $navbar_form.insertBefore($nav_content);
185
186
187            $(".sidebar-wrapper .dropdown .dropdown-menu > li > a").click(function(event) {
188                event.stopPropagation();
189
190            });
191
192            mobile_menu_initialized = true;
193        } else {
194            if($(window).width() > 991){
195                // reset all the additions that we made for the sidebar wrapper only if the screen is bigger than 991px
196                $sidebar_wrapper.find('.navbar-form').remove();
197                $sidebar_wrapper.find('.nav-mobile-menu').remove();
198
199                mobile_menu_initialized = false;
200            }
201        }
202
203        if(!toggle_initialized){
204            $toggle = $('.navbar-toggle');
205
206            $toggle.click(function (){
207
208                if(mobile_menu_visible == 1) {
209                    $('html').removeClass('nav-open');
210
211                    $('.close-layer').remove();
212                    setTimeout(function(){
213                        $toggle.removeClass('toggled');
214                    }, 400);
215
216                    mobile_menu_visible = 0;
217                } else {
218                    setTimeout(function(){
219                        $toggle.addClass('toggled');
220                    }, 430);
221
222                    main_panel_height = $('.main-panel')[0].scrollHeight;
223                    $layer = $('<div class="close-layer"></div>');
224                    $layer.css('height',main_panel_height + 'px');
225                    $layer.appendTo(".main-panel");
226
227
228                    setTimeout(function(){
229                        $layer.addClass('visible');
230                    }, 100);
231
232                    $layer.click(function() {
233                        $('html').removeClass('nav-open');
234                        mobile_menu_visible = 0;
235
236                        $layer.removeClass('visible');
237
238                         setTimeout(function(){
239                            $layer.remove();
240                            $toggle.removeClass('toggled');
241
242                         }, 400);
243                    });
244
245                    $('html').addClass('nav-open');
246                    mobile_menu_visible = 1;
247
248                }
249            });
250
251            toggle_initialized = true;
252        }
253
254    },
255
256      initBootstrapNavbarMenu: debounce(function(){
257
258        if(!bootstrap_nav_initialized){
259            $navbar = $('nav').find('.navbar-collapse').first().clone(true);
260
261            nav_content = '';
262            mobile_menu_content = '';
263
264            //add the content from the regular header to the mobile menu
265            $navbar.children('ul').each(function(){
266                content_buff = $(this).html();
267                nav_content = nav_content + content_buff;
268            });
269
270            nav_content = '<ul class="nav nav-mobile-menu">' + nav_content + '</ul>';
271
272            $navbar.html(nav_content);
273            $navbar.addClass('off-canvas-sidebar');
274
275            // append it to the body, so it will come from the right side of the screen
276            $('body').append($navbar);
277
278            $toggle = $('.navbar-toggle');
279
280            $navbar.find('a').removeClass('btn btn-round btn-default');
281            $navbar.find('button').removeClass('btn-round btn-fill btn-info btn-primary btn-success btn-danger btn-warning btn-neutral');
282            $navbar.find('button').addClass('btn-simple btn-block');
283
284            $toggle.click(function (){
285                if(mobile_menu_visible == 1) {
286                    $('html').removeClass('nav-open');
287
288                    $('.close-layer').remove();
289                    setTimeout(function(){
290                        $toggle.removeClass('toggled');
291                    }, 400);
292
293                    mobile_menu_visible = 0;
294                } else {
295                    setTimeout(function(){
296                        $toggle.addClass('toggled');
297                    }, 430);
298
299                    $layer = $('<div class="close-layer"></div>');
300                    $layer.appendTo(".wrapper-full-page");
301
302                    setTimeout(function(){
303                        $layer.addClass('visible');
304                    }, 100);
305
306
307                    $layer.click(function() {
308                        $('html').removeClass('nav-open');
309                        mobile_menu_visible = 0;
310
311                        $layer.removeClass('visible');
312
313                         setTimeout(function(){
314                            $layer.remove();
315                            $toggle.removeClass('toggled');
316
317                         }, 400);
318                    });
319
320                    $('html').addClass('nav-open');
321                    mobile_menu_visible = 1;
322
323                }
324
325            });
326            bootstrap_nav_initialized = true;
327        }
328    }, 500),
329}
330
331
332// Returns a function, that, as long as it continues to be invoked, will not
333// be triggered. The function will be called after it stops being called for
334// N milliseconds. If `immediate` is passed, trigger the function on the
335// leading edge, instead of the trailing.
336
337function debounce(func, wait, immediate) {
338	var timeout;
339	return function() {
340		var context = this, args = arguments;
341		clearTimeout(timeout);
342		timeout = setTimeout(function() {
343			timeout = null;
344			if (!immediate) func.apply(context, args);
345		}, wait);
346		if (immediate && !timeout) func.apply(context, args);
347	};
348};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.