1/* 2 * 3 * INSPINIA - Responsive Admin Theme 4 * version 2.6 5 * 6 */ 7 8 9$(document).ready(function () { 10 11 12 // Add body-small class if window less than 768px 13 if ($(this).width() < 769) { 14 $('body').addClass('body-small') 15 } else { 16 $('body').removeClass('body-small') 17 } 18 19 // MetsiMenu 20 $('#side-menu').metisMenu(); 21 22 // Collapse ibox function 23 $('.collapse-link').on('click', function () { 24 var ibox = $(this).closest('div.ibox'); 25 var button = $(this).find('i'); 26 var content = ibox.find('div.ibox-content'); 27 content.slideToggle(200); 28 button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down'); 29 ibox.toggleClass('').toggleClass('border-bottom'); 30 setTimeout(function () { 31 ibox.resize(); 32 ibox.find('[id^=map-]').resize(); 33 }, 50); 34 }); 35 36 // Close ibox function 37 $('.close-link').on('click', function () { 38 var content = $(this).closest('div.ibox'); 39 content.remove(); 40 }); 41 42 // Fullscreen ibox function 43 $('.fullscreen-link').on('click', function () { 44 var ibox = $(this).closest('div.ibox'); 45 var button = $(this).find('i'); 46 $('body').toggleClass('fullscreen-ibox-mode'); 47 button.toggleClass('fa-expand').toggleClass('fa-compress'); 48 ibox.toggleClass('fullscreen'); 49 setTimeout(function () { 50 $(window).trigger('resize'); 51 }, 100); 52 }); 53 54 // Close menu in canvas mode 55 $('.close-canvas-menu').on('click', function () { 56 $("body").toggleClass("mini-navbar"); 57 SmoothlyMenu(); 58 }); 59 60 // Run menu of canvas 61 $('body.canvas-menu .sidebar-collapse').slimScroll({ 62 height: '100%', 63 railOpacity: 0.9 64 }); 65 66 // Open close right sidebar 67 $('.right-sidebar-toggle').on('click', function () { 68 $('#right-sidebar').toggleClass('sidebar-open'); 69 }); 70 71 // Initialize slimscroll for right sidebar 72 $('.sidebar-container').slimScroll({ 73 height: '100%', 74 railOpacity: 0.4, 75 wheelStep: 10 76 }); 77 78 // Open close small chat 79 $('.open-small-chat').on('click', function () { 80 $(this).children().toggleClass('fa-comments').toggleClass('fa-remove'); 81 $('.small-chat-box').toggleClass('active'); 82 }); 83 84 // Initialize slimscroll for small chat 85 $('.small-chat-box .content').slimScroll({ 86 height: '234px', 87 railOpacity: 0.4 88 }); 89 90 // Small todo handler 91 $('.check-link').on('click', function () { 92 var button = $(this).find('i'); 93 var label = $(this).next('span'); 94 button.toggleClass('fa-check-square').toggleClass('fa-square-o'); 95 label.toggleClass('todo-completed'); 96 return false; 97 }); 98 99 // Append config box / Only for demo purpose 100 // Uncomment on server mode to enable XHR calls 101// $.get("skin-config.html", function (data) { 102// if (!$('body').hasClass('no-skin-config')) 103// $('body').append(data); 104// }); 105 106 // Minimalize menu 107 $('.navbar-minimalize').on('click', function () { 108 $("body").toggleClass("mini-navbar"); 109 SmoothlyMenu(); 110 111 }); 112 113 // Tooltips demo 114 $('.tooltip-demo').tooltip({ 115 selector: "[data-toggle=tooltip]", 116 container: "body" 117 }); 118 119 120 // Full height of sidebar 121 function fix_height() { 122 var heightWithoutNavbar = $("body > #wrapper").height() - 61; 123 $(".sidebard-panel").css("min-height", heightWithoutNavbar + "px"); 124 125 var navbarHeigh = $('nav.navbar-default').height(); 126 var wrapperHeigh = $('#page-wrapper').height(); 127 128 if (navbarHeigh > wrapperHeigh) { 129 $('#page-wrapper').css("min-height", navbarHeigh + "px"); 130 } 131 132 if (navbarHeigh < wrapperHeigh) { 133 $('#page-wrapper').css("min-height", $(window).height() + "px"); 134 } 135 136 if ($('body').hasClass('fixed-nav')) { 137 if (navbarHeigh > wrapperHeigh) { 138 $('#page-wrapper').css("min-height", navbarHeigh + "px"); 139 } else { 140 $('#page-wrapper').css("min-height", $(window).height() - 60 + "px"); 141 } 142 } 143 144 } 145 146 fix_height(); 147 148 // Fixed Sidebar 149 $(window).bind("load", function () { 150 if ($("body").hasClass('fixed-sidebar')) { 151 $('.sidebar-collapse').slimScroll({ 152 height: '100%', 153 railOpacity: 0.9 154 }); 155 } 156 }); 157 158 // Move right sidebar top after scroll 159 $(window).scroll(function () { 160 if ($(window).scrollTop() > 0 && !$('body').hasClass('fixed-nav')) { 161 $('#right-sidebar').addClass('sidebar-top'); 162 } else { 163 $('#right-sidebar').removeClass('sidebar-top'); 164 } 165 }); 166 167 $(window).bind("load resize scroll", function () { 168 if (!$("body").hasClass('body-small')) { 169 fix_height(); 170 } 171 }); 172 173 $("[data-toggle=popover]") 174 .popover(); 175 176 // Add slimscroll to element 177 $('.full-height-scroll').slimscroll({ 178 height: '100%' 179 }) 180}); 181 182 183// Minimalize menu when screen is less than 768px 184$(window).bind("resize", function () { 185 if ($(this).width() < 769) { 186 $('body').addClass('body-small') 187 } else { 188 $('body').removeClass('body-small') 189 } 190}); 191 192// Local Storage functions 193// Set proper body class and plugins based on user configuration 194$(document).ready(function () { 195 if (localStorageSupport()) { 196 197 var collapse = localStorage.getItem("collapse_menu"); 198 var fixedsidebar = localStorage.getItem("fixedsidebar"); 199 var fixednavbar = localStorage.getItem("fixednavbar"); 200 var boxedlayout = localStorage.getItem("boxedlayout"); 201 var fixedfooter = localStorage.getItem("fixedfooter"); 202 203 var body = $('body'); 204 205 if (fixedsidebar == 'on') { 206 body.addClass('fixed-sidebar'); 207 $('.sidebar-collapse').slimScroll({ 208 height: '100%', 209 railOpacity: 0.9 210 }); 211 } 212 213 if (collapse == 'on') { 214 if (body.hasClass('fixed-sidebar')) { 215 if (!body.hasClass('body-small')) { 216 body.addClass('mini-navbar'); 217 } 218 } else { 219 if (!body.hasClass('body-small')) { 220 body.addClass('mini-navbar'); 221 } 222 223 } 224 } 225 226 if (fixednavbar == 'on') { 227 $(".navbar-static-top").removeClass('navbar-static-top').addClass('navbar-fixed-top'); 228 body.addClass('fixed-nav'); 229 } 230 231 if (boxedlayout == 'on') { 232 body.addClass('boxed-layout'); 233 } 234 235 if (fixedfooter == 'on') { 236 $(".footer").addClass('fixed'); 237 } 238 } 239}); 240 241// check if browser support HTML5 local storage 242function localStorageSupport() { 243 return (('localStorage' in window) && window['localStorage'] !== null) 244} 245 246// For demo purpose - animation css script 247function animationHover(element, animation) { 248 element = $(element); 249 element.hover( 250 function () { 251 element.addClass('animated ' + animation); 252 }, 253 function () { 254 //wait for animation to finish before removing classes 255 window.setTimeout(function () { 256 element.removeClass('animated ' + animation); 257 }, 2000); 258 }); 259} 260 261function SmoothlyMenu() { 262 if (!$('body').hasClass('mini-navbar') || $('body').hasClass('body-small')) { 263 // Hide menu in order to smoothly turn on when maximize menu 264 $('#side-menu').hide(); 265 // For smoothly turn on menu 266 setTimeout( 267 function () { 268 $('#side-menu').fadeIn(400); 269 }, 200); 270 } else if ($('body').hasClass('fixed-sidebar')) { 271 $('#side-menu').hide(); 272 setTimeout( 273 function () { 274 $('#side-menu').fadeIn(400); 275 }, 100); 276 } else { 277 // Remove all inline style from jquery fadeIn function to reset menu state 278 $('#side-menu').removeAttr('style'); 279 } 280} 281 282// Dragable panels 283function WinMove() { 284 var element = "[class*=col]"; 285 var handle = ".ibox-title"; 286 var connect = "[class*=col]"; 287 $(element).sortable( 288 { 289 handle: handle, 290 connectWith: connect, 291 tolerance: 'pointer', 292 forcePlaceholderSize: true, 293 opacity: 0.8 294 }) 295 .disableSelection(); 296} 297 298
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.