1/** 2 * AdminLTE Demo Menu 3 * ------------------ 4 * You should not use this file in production. 5 * This file is for demo purposes only. 6 */ 7$(function () { 8 'use strict' 9 10 /** 11 * Get access to plugins 12 */ 13 14 $('[data-toggle="control-sidebar"]').controlSidebar() 15 $('[data-toggle="push-menu"]').pushMenu() 16 17 var $pushMenu = $('[data-toggle="push-menu"]').data('lte.pushmenu') 18 var $controlSidebar = $('[data-toggle="control-sidebar"]').data('lte.controlsidebar') 19 var $layout = $('body').data('lte.layout') 20 21 /** 22 * List of all the available skins 23 * 24 * @type Array 25 */ 26 var mySkins = [ 27 'skin-blue', 28 'skin-black', 29 'skin-red', 30 'skin-yellow', 31 'skin-purple', 32 'skin-green', 33 'skin-blue-light', 34 'skin-black-light', 35 'skin-red-light', 36 'skin-yellow-light', 37 'skin-purple-light', 38 'skin-green-light' 39 ] 40 41 /** 42 * Get a prestored setting 43 * 44 * @param String name Name of of the setting 45 * @returns String The value of the setting | null 46 */ 47 function get(name) { 48 if (typeof (Storage) !== 'undefined') { 49 return localStorage.getItem(name) 50 } else { 51 window.alert('Please use a modern browser to properly view this template!') 52 } 53 } 54 55 /** 56 * Store a new settings in the browser 57 * 58 * @param String name Name of the setting 59 * @param String val Value of the setting 60 * @returns void 61 */ 62 function store(name, val) { 63 if (typeof (Storage) !== 'undefined') { 64 localStorage.setItem(name, val) 65 } else { 66 window.alert('Please use a modern browser to properly view this template!') 67 } 68 } 69 70 /** 71 * Toggles layout classes 72 * 73 * @param String cls the layout class to toggle 74 * @returns void 75 */ 76 function changeLayout(cls) { 77 $('body').toggleClass(cls) 78 $layout.fixSidebar() 79 if ($('body').hasClass('fixed') && cls == 'fixed') { 80 $pushMenu.expandOnHover() 81 $layout.activate() 82 } 83 $controlSidebar.fix() 84 } 85 86 /** 87 * Replaces the old skin with the new skin 88 * @param String cls the new skin class 89 * @returns Boolean false to prevent link's default action 90 */ 91 function changeSkin(cls) { 92 $.each(mySkins, function (i) { 93 $('body').removeClass(mySkins[i]) 94 }) 95 96 $('body').addClass(cls) 97 store('skin', cls) 98 return false 99 } 100 101 /** 102 * Retrieve default settings and apply them to the template 103 * 104 * @returns void 105 */ 106 function setup() { 107 var tmp = get('skin') 108 if (tmp && $.inArray(tmp, mySkins)) 109 changeSkin(tmp) 110 111 // Add the change skin listener 112 $('[data-skin]').on('click', function (e) { 113 if ($(this).hasClass('knob')) 114 return 115 e.preventDefault() 116 changeSkin($(this).data('skin')) 117 }) 118 119 // Add the layout manager 120 $('[data-layout]').on('click', function () { 121 changeLayout($(this).data('layout')) 122 }) 123 124 $('[data-controlsidebar]').on('click', function () { 125 changeLayout($(this).data('controlsidebar')) 126 var slide = !$controlSidebar.options.slide 127 128 $controlSidebar.options.slide = slide 129 if (!slide) 130 $('.control-sidebar').removeClass('control-sidebar-open') 131 }) 132 133 $('[data-sidebarskin="toggle"]').on('click', function () { 134 var $sidebar = $('.control-sidebar') 135 if ($sidebar.hasClass('control-sidebar-dark')) { 136 $sidebar.removeClass('control-sidebar-dark') 137 $sidebar.addClass('control-sidebar-light') 138 } else { 139 $sidebar.removeClass('control-sidebar-light') 140 $sidebar.addClass('control-sidebar-dark') 141 } 142 }) 143 144 $('[data-enable="expandOnHover"]').on('click', function () { 145 $(this).attr('disabled', true) 146 $pushMenu.expandOnHover() 147 if (!$('body').hasClass('sidebar-collapse')) 148 $('[data-layout="sidebar-collapse"]').click() 149 }) 150 151 // Reset options 152 if ($('body').hasClass('fixed')) { 153 $('[data-layout="fixed"]').attr('checked', 'checked') 154 } 155 if ($('body').hasClass('layout-boxed')) { 156 $('[data-layout="layout-boxed"]').attr('checked', 'checked') 157 } 158 if ($('body').hasClass('sidebar-collapse')) { 159 $('[data-layout="sidebar-collapse"]').attr('checked', 'checked') 160 } 161 162 } 163 164 // Create the new tab
165 var $tabPane = $('<div />', { 166 'id' : 'control-sidebar-theme-demo-options-tab', 167 'class': 'tab-pane active' 168 }) 169 170 // Create the tab button 171 var $tabButton = $('<li />', { 'class': 'active' }) 172 .html('<a href=\'#control-sidebar-theme-demo-options-tab\' data-toggle=\'tab\'>' 173 + '<i class="fa fa-wrench"></i>' 174 + '</a>') 175 176 // Add the tab button to the right sidebar tabs 177 $('[href="#control-sidebar-home-tab"]') 178 .parent() 179 .before($tabButton) 180 181 // Create the menu 182 var $demoSettings = $('<div />') 183 184 // Layout options 185 $demoSettings.append( 186 '<h4 class="control-sidebar-heading">' 187 + 'Layout Options' 188 + '</h4>' 189 // Fixed layout 190 + '<div class="form-group">' 191 + '<label class="control-sidebar-subheading">' 192 + '<input type="checkbox"data-layout="fixed"class="pull-right"/> ' 193 + 'Fixed layout' 194 + '</label>' 195 + '<p>Activate the fixed layout. You can\'t use fixed and boxed layouts together</p>' 196 + '</div>' 197 // Boxed layout 198 + '<div class="form-group">' 199 + '<label class="control-sidebar-subheading">' 200 + '<input type="checkbox"data-layout="layout-boxed" class="pull-right"/> ' 201 + 'Boxed Layout' 202 + '</label>' 203 + '<p>Activate the boxed layout</p>' 204 + '</div>' 205 // Sidebar Toggle 206 + '<div class="form-group">' 207 + '<label class="control-sidebar-subheading">' 208 + '<input type="checkbox"data-layout="sidebar-collapse"class="pull-right"/> ' 209 + 'Toggle Sidebar' 210 + '</label>' 211 + '<p>
211Toggle the left sidebar\'s state (open or collapse)</p>' 212 + '</div>' 213 // Sidebar mini expand on hover toggle 214 + '<div class="form-group">' 215 + '<label class="control-sidebar-subheading">' 216 + '<input type="checkbox"data-enable="expandOnHover"class="pull-right"/> ' 217 + 'Sidebar Expand on Hover' 218 + '</label>' 219 + '<p>Let the sidebar mini expand on hover</p>' 220 + '</div>' 221 // Control Sidebar Toggle 222 + '<div class="form-group">' 223 + '<label class="control-sidebar-subheading">' 224 + '<input type="checkbox"data-controlsidebar="control-sidebar-open"class="pull-right"/> ' 225 + 'Toggle Right Sidebar Slide' 226 + '</label>' 227 + '<p>Toggle between slide over content and push content effects</p>' 228 + '</div>' 229 // Control Sidebar Skin Toggle 230 + '<div class="form-group">' 231 + '<label class="control-sidebar-subheading">' 232 + '<input type="checkbox"data-sidebarskin="toggle"class="pull-right"/> ' 233 + 'Toggle Right Sidebar Skin' 234 + '</label>' 235 + '<p>Toggle between dark and light skins for the right sidebar</p>' 236 + '</div>' 237 ) 238 var $skinsList = $('<ul />', { 'class': 'list-unstyled clearfix' }) 239 240 // Dark sidebar skins 241 var $skinBlue = 242 $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' }) 243 .append('<a href="javascript:void(0)" data-skin="skin-blue" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 244 + '<div><span style="display:block; width: 20%; float: left; height: 7px; background: #367fa9"></span><span class="bg-light-blue" style="display:block; width: 80%; float: left; height: 7px;"></span></div>' 245 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 246 + '</a>' 247 + '<p class="text-center no-margin">Blue</p>') 248 $skinsList.append($skinBlue) 249 var $skinBlack = 250 $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' }) 251 .append('<a href="javascript:void(0)" data-skin="skin-black" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 252 + '<div style="box-shadow: 0 0 2px rgba(0,0,0,0.1)" class="clearfix"><span style="display:block; width: 20%; float: left; height: 7px; background: #fefefe"></span><span style="display:block; width: 80%; float: left; height: 7px; background: #fefefe"></span></div>' 253 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 254 + '</a>' 255 + '<p class="text-center no-margin">Black</p>') 256 $skinsList.append($skinBlack) 257 var $skinPurple = 258 $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' }) 259 .append('<a href="javascript:void(0)" data-skin="skin-purple" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 260 + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-purple-active"></span><span class="bg-purple" style="display:block; width: 80%; float: left; height: 7px;"></span></div>' 261 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 262 + '</a>' 263 + '<p class="text-center no-margin">Purple</p>') 264 $skinsList.append($skinPurple) 265 var $skinGreen = 266 $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' }) 267 .append('<a href="javascript:void(0)" data-skin="skin-green" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 268 + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-green-active"></span><span class="bg-green" style="display:block; width: 80%; float: left; height: 7px;"></span></div>' 269 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 270 + '</a>' 271 + '<p class="text-center no-margin">Green</p>') 272 $skinsList.append($skinGreen) 273 var $skinRed = 274 $('<li />', { style: 'float:left;
274 width: 33.33333%; padding: 5px;' }) 275 .append('<a href="javascript:void(0)" data-skin="skin-red" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 276 + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-red-active"></span><span class="bg-red" style="display:block; width: 80%; float: left; height: 7px;"></span></div>' 277 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 278 + '</a>' 279 + '<p class="text-center no-margin">Red</p>') 280 $skinsList.append($skinRed) 281 var $skinYellow = 282 $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' }) 283 .append('<a href="javascript:void(0)" data-skin="skin-yellow" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 284 + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-yellow-active"></span><span class="bg-yellow" style="display:block; width: 80%; float: left; height: 7px;"></span></div>' 285 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 286 + '</a>' 287 + '<p class="text-center no-margin">Yellow</p>') 288 $skinsList.append($skinYellow) 289 290 // Light sidebar skins 291 var $skinBlueLight = 292 $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' }) 293 .append('<a href="javascript:void(0)" data-skin="skin-blue-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 294 + '<div><span style="display:block; width: 20%; float: left; height: 7px; background: #367fa9"></span><span class="bg-light-blue" style="display:block; width: 80%; float: left; height: 7px;"></span></div>' 295 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 296 + '</a>' 297 + '<p class="text-center no-margin" style="font-size: 12px">Blue Light</p>') 298 $skinsList.append($skinBlueLight) 299 var $skinBlackLight = 300 $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' }) 301 .append('<a href="javascript:void(0)" data-skin="skin-black-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 302 + '<div style="box-shadow: 0 0 2px rgba(0,0,0,0.1)" class="clearfix"><span style="display:block; width: 20%; float: left; height: 7px; background: #fefefe"></span><span style="display:block; width: 80%; float: left; height: 7px; background: #fefefe"></span></div>' 303 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 304 + '</a>' 305 + '<p class="text-center no-margin" style="font-size: 12px">Black Light</p>') 306 $skinsList.append($skinBlackLight) 307 var $skinPurpleLight = 308 $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' }) 309 .append('<a href="javascript:void(0)" data-skin="skin-purple-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 310 + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-purple-active"></span><span class="bg-purple" style="display:block; width: 80%; float: left; height: 7px;"></span></div>' 311 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 312 + '</a>' 313 + '<p class="text-center no-margin" style="font-size: 12px">Purple Light</p>') 314 $skinsList.append($skinPurpleLight) 315 var $skinGreenLight = 316 $('<li />', { style: 'float:left;
316 width: 33.33333%; padding: 5px;' }) 317 .append('<a href="javascript:void(0)" data-skin="skin-green-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 318 + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-green-active"></span><span class="bg-green" style="display:block; width: 80%; float: left; height: 7px;"></span></div>' 319 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 320 + '</a>' 321 + '<p class="text-center no-margin" style="font-size: 12px">Green Light</p>') 322 $skinsList.append($skinGreenLight) 323 var $skinRedLight = 324 $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' }) 325 .append('<a href="javascript:void(0)" data-skin="skin-red-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 326 + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-red-active"></span><span class="bg-red" style="display:block; width: 80%; float: left; height: 7px;"></span></div>' 327 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 328 + '</a>' 329 + '<p class="text-center no-margin" style="font-size: 12px">Red Light</p>') 330 $skinsList.append($skinRedLight) 331 var $skinYellowLight = 332 $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' }) 333 .append('<a href="javascript:void(0)" data-skin="skin-yellow-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">' 334 + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-yellow-active"></span><span class="bg-yellow" style="display:block; width: 80%; float: left; height: 7px;"></span></div>' 335 + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>' 336 + '</a>' 337 + '<p class="text-center no-margin" style="font-size: 12px">Yellow Light</p>') 338 $skinsList.append($skinYellowLight) 339 340 $demoSettings.append('<h4 class="control-sidebar-heading">Skins</h4>') 341 $demoSettings.append($skinsList) 342 343 $tabPane.append($demoSettings) 344 $('#control-sidebar-home-tab').after($tabPane) 345 346 setup() 347 348 $('[data-toggle="tooltip"]').tooltip() 349})
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.