1 2 3var App = function() { 4 5 var handleSidebardropdown = function() { 6 $('aside li').hover(function() { 7 $(this).addClass('open'); 8 }, function() { 9 $(this).removeClass('open'); 10 } 11 ); 12 }; // Sidebar menu dropdown 13 14 var handleSidebarOpenable = function() { 15 $('.openable > a').click(function() { 16 17 if (!$('#wrapper').hasClass('sidebar-mini')) { 18 if ($(this).parent().children('.submenu').is(':hidden')) { 19 $(this).parent().siblings().removeClass('open').children('.submenu').slideUp(); 20 $(this).parent().addClass('open').children('.submenu').slideDown(); 21 } 22 else { 23 $(this).parent().removeClass('open').children('.submenu').slideUp(); 24 } 25 } 26 27 return false; 28 }); 29 }; // Collapsible Sidebar Menu 30 31 var handleSidebarScroll = function() { 32 //scrollable sidebar 33 $('.scrollable-sidebar').slimScroll({ 34 height: '100%', 35 size: '3px' 36 }); 37 }; // Collapsible Sidebar Menu 38 39 var handleLoginLink = function() { 40 $('.login-link').click(function(e) { 41 e.preventDefault(); 42 href = $(this).attr('href'); 43 44 $('.login-wrapper').addClass('fadeOutUp'); 45 46 setTimeout(function() { 47 window.location = href; 48 }, 900); 49 50 return false; 51 }); 52 }; // Handel Login Link 53 54 var handleScrollToTop = function() { 55 $("#scroll-to-top").click(function() { 56 $("html, body").animate({scrollTop: 0}, 600); 57 return false; 58 }); 59 }; // scroll to top of the page 60 61 var handleToggleMenu = function() { 62 $('#sidebarToggle').click(function() { 63 $('#wrapper').toggleClass('sidebar-display'); 64 $('.main-menu').find('.openable').removeClass('open'); 65 $('.main-menu').find('.submenu').removeAttr('style'); 66 }); 67 68 $('#sizeToggle').click(function() { 69 70 $('#wrapper').off("resize"); 71 72 $('#wrapper').toggleClass('sidebar-mini'); 73 $('aside').toggleClass('scrollable'); 74 $('.main-menu').find('.openable').removeClass('open'); 75 $('.main-menu').find('.submenu').removeAttr('style'); 76 }); 77 78 if (!$('#wrapper').hasClass('sidebar-mini')) { 79 if (Modernizr.mq('(min-width: 768px)') && Modernizr.mq('(max-width: 868px)')) { 80 $('#wrapper').addClass('sidebar-mini'); 81 $('aside').removeClass('scrollable'); 82 } 83 else if (Modernizr.mq('(min-width: 869px)')) { 84 if (!$('#wrapper').hasClass('sidebar-mini')) { 85 $('aside').addClass('scrollable'); 86 } 87 } 88 } 89 90 $(window).resize(function() { 91 if (Modernizr.mq('(min-width: 768px)') && Modernizr.mq('(max-width: 868px)')) { 92 $('#wrapper').addClass('sidebar-mini').addClass('window-resize'); 93 $('aside').removeClass('scrollable'); 94 $('.main-menu').find('.openable').removeClass('open'); 95 $('.main-menu').find('.submenu').removeAttr('style'); 96 } 97 else if (Modernizr.mq('(min-width: 869px)')) { 98 if ($('#wrapper').hasClass('window-resize')) { 99 $('#wrapper').removeClass('sidebar-mini window-resize'); 100 $('aside').addClass('scrollable'); 101 $('.main-menu').find('.openable').removeClass('open'); 102 $('.main-menu').find('.submenu').removeAttr('style'); 103 } 104 } 105 else { 106 $('#wrapper').removeClass('sidebar-mini window-resize'); 107 $('aside').addClass('scrollable'); 108 $('.main-menu').find('.openable').removeClass('open'); 109 $('.main-menu').find('.submenu').removeAttr('style'); 110 } 111 }); 112 }; // Toggle Menu 113 114 var handleFriendListMenu = function() { 115 $('#friendListToggle').click(function() { 116 $('.chat-sidebar').toggleClass('sidebar-display'); 117 }); 118 $(window).resize(function() { 119 if (Modernizr.mq('(min-width: 767px)')) { 120 $('.chat-sidebar').removeClass("sidebar-display"); 121 } 122 }); 123 }; // Toggle Menu 124 125 var handleHoverTouchDevice = function() { 126 $('.image-wrapper').bind('touchstart', function(e) { 127 $('.image-wrapper').removeClass('active'); 128 $(this).addClass('active'); 129 }); 130 }; // Hover effect on touch device 131 132 var handleDropdownHover = function() { 133 $('.hover-dropdown').hover( 134 function() { 135 $(this).addClass('open') 136 }, 137 function() { 138 $(this).removeClass('open') 139 } 140 ); 141 }; // Dropdown menu with hover 142 143 var handelPanelTools = function() { 144 145 // For full Screen 146 $('.panel-tools .panel-expand').bind('click', function(e) { 147 $('.panel-tools a').not(this).hide(); 148 $('body').append('<div class="full-white-backdrop"></div>'); 149 $('.main-container').removeAttr('style'); 150 151 backdrop = $('.full-white-backdrop'); 152 wbox = $(this).parents('.panel'); 153 wbox.removeAttr('style'); 154 if (wbox.hasClass('panel-full-screen')) { 155 backdrop.fadeIn(200, function() { 156 $('.panel-tools a').show(); 157 wbox.removeClass('panel-full-screen'); 158 backdrop.fadeOut(200, function() { 159 backdrop.remove(); 160 }); 161 }); 162 } else { 163 $('body').append('<div class="full-white-backdrop"></div>'); 164 backdrop.fadeIn(200, function() { 165 $('.main-container').css({ 166 'max-height': $(window).outerHeight() - $('header').outerHeight() - $('.footer').outerHeight() - 100, 167 'overflow': 'hidden' 168 }); 169 backdrop.fadeOut(200); 170 backdrop.remove(); 171 wbox.addClass('panel-full-screen').css({ 172 'max-height': $(window).height(), 173 'overflow': 'auto' 174 }); 175 }); 176 } 177 }); 178 179 // Panel Close 180 $('.panel-tools .panel-close').bind('click', function(e) { 181 $(this).parents(".panel").remove(); 182 e.preventDefault(); 183 }); 184 185 // For Panel Referesh 186 $('.panel-tools .panel-refresh').bind('click', function(e) { 187 var el = $(this).parents(".panel"); 188 el.block({ 189 overlayCSS: { 190 backgroundColor: '#fff' 191 }, 192 message: '<img src="assets/images/loading.gif" />', 193 css: { 194 border: 'none', 195 color: '#333', 196 background: 'none' 197 } 198 }); 199 window.setTimeout(function() { 200 el.unblock(); 201 }, 1000); 202 e.preventDefault(); 203 }); 204 205 // For Panel Collapse and expend 206 $('.panel-tools .panel-collapse').bind('click', function(e) { 207 e.preventDefault(); 208 var el = jQuery(this).parent().closest(".panel").children(".panel-body"); 209 if ($(this).hasClass("collapses")) { 210 $(this).addClass("expand").removeClass("collapses"); 211 el.slideUp(200); 212 } else { 213 $(this).addClass("collapses").removeClass("expand"); 214 el.slideDown(200); 215 } 216 }); 217 218 }; // function to activate the panel tools 219 220 var handelSlimScroll = function() { 221 $(".scroller").each(function() { 222 $(this).slimScroll({ 223 size: "5px", 224 opacity: "0.6", 225 position: $(this).attr("data-position"), 226 height: $(this).attr("data-height"), 227 alwaysVisible: ($(this).attr("data-always-visible") == "1" ? true : false), 228 railVisible: ($(this).attr("data-rail-visible") == "1" ? true : false), 229 disableFadeOut: true 230 }); 231 }); 232 }; // function to Handel Slim Scroll 233 234 var handleSummernote = function() { 235 if (!jQuery().summernote) { 236 return; 237 } 238 239 $('.summernote-email').summernote({ 240 height: 430 //set editable area's height 241 }); 242 243 $('.summernote').summernote({ 244 height: 150 //set editable area's height 245 }); 246 }; // summernote Text Editor 247 248 var handelTooltip = function() { 249 $("[data-toggle=tooltip]").tooltip(); 250 }; // function to Handel Bootstrap Tooltip 251 252 var handelPopovers = function() { 253 $("[data-toggle=popover]").popover(); 254 }; 255 256 var handleInboxMenu = function() { 257 $('#inboxMenuToggle').click(function() { 258 $('#inboxMenu').toggleClass('menu-display'); 259 }); 260 261 }; //Inbox sidebar (inbox.html) 262 263 var handelSelect2 = function() { 264 265 if (!jQuery().select2) { 266 return; 267 } 268 269 $('.select2').select2({minimumResultsForSearch: -1 }); 270 271 $('.select2Search').select2(); 272 }; // Function to handel Sclect2 273 274 var handelFootable = function() { 275 276 if (!jQuery().footable) { 277 return; 278 } 279 280 $('.footable').footable(); 281 282 }; // Footable Responsive Table 283 284 var handelSortableTbl = function() { 285 286 // sortable tables 287 if ($(".js-table-sortable").length) { 288 $(".js-table-sortable").sortable({ 289 290 placeholder: "ui-state-highlight", 291 items: "tbody tr", 292 handle: ".js-sortable-handle", 293 forcePlaceholderSize: true, 294 helper: function(e, ui){ 295 ui.children().each(function() { 296 $(this).width($(this).width()); 297 }); 298 return ui; 299 }, 300 start: function(event, ui){ 301 if (typeof mainYScroller != 'undefined') 302 mainYScroller.disable(); 303 ui.placeholder.html('<td colspan="' + $(this).find('tbody tr:first td').size() + '"> </td>'); 304 }, 305 stop: function() { 306 if (typeof mainYScroller != 'undefined') 307 mainYScroller.enable(); 308 } 309 }); 310 } 311 312 }; // Draggable Columns Table 313 314 var handleTableCheckBox = function() { 315 316 $(".table th input:checkbox").click(function () { 317 $checks = $(this).closest(".table").find("tbody input:checkbox"); 318 if ($(this).is(":checked")) { 319 $checks.prop("checked", true); 320 } else { 321 $checks.prop("checked", false); 322 } 323 }); 324 325 }; // toggle all checkboxes from a table when header checkbox is clicked 326 327 var handelMultiselectBtn = function() { 328 329 if (!jQuery().multiselect) {return;} 330 $('.btn-multiselect').multiselect(); 331 }; // Bootstrap Editor 332
333 var handeliCheckbox = function () { 334 if (!jQuery().iCheck) { 335 return; 336 } 337 338 $('input.icheck').iCheck({ 339 checkboxClass: 'icheckbox_flat-red', 340 radioClass: 'iradio_flat-red' 341 }); 342 }; // Function to handel Checkbox 343 344 var handleUniform = function () { 345 if (!jQuery().uniform) { 346 return; 347 } 348 $('.uniforminpt').uniform(); 349 }; // Function to handle Uniform JS 350 351 var handelResponsivePagination = function() { 352 353 if (!jQuery().rPage) { 354 return; 355 } 356 357 $(".rPage").rPage(); 358 359 }; // Responsive Pagination 360 361 var handelTagInput = function () { 362 if (!jQuery().tagsinput) { 363 return; 364 } 365 366 $('.tags-labeld').tagsinput({ 367 tagClass: function(item) { 368 switch (item.continent) { 369 case 'Europe' : 370 return 'label label-primary'; 371 case 'America' : 372 return 'label label-danger label-important'; 373 case 'Australia': 374 return 'label label-success'; 375 case 'Africa' : 376 return 'label label-default'; 377 case 'Asia' : 378 return 'label label-warning'; 379 } 380 }, 381 itemValue: 'value', 382 itemText: 'text' 383 }); 384 $('.tags-labeld').tagsinput('add', {"value": 1, "text": "Amsterdam", "continent": "Europe"}); 385 $('.tags-labeld').tagsinput('add', {"value": 4, "text": "Washington", "continent": "America"}); 386 $('.tags-labeld').tagsinput('add', {"value": 7, "text": "Sydney", "continent": "Australia"}); 387 $('.tags-labeld').tagsinput('add', {"value": 10, "text": "Beijing", "continent": "Asia"}); 388 $('.tags-labeld').tagsinput('add', {"value": 13, "text": "Cairo", "continent": "Africa"}); 389 390 391 }; // Function to handel Tags 392 393 var handleDateRangePickers = function() { 394 if (!jQuery().daterangepicker) { 395 return; 396 } 397 398 $('#defaultrange').daterangepicker({format: 'YYYY-MM-DD'}); 399 400 $('#reportrange').daterangepicker({ 401 opens: 'right', 402 startDate: moment().subtract('days', 29), 403 endDate: moment(), 404 minDate: '2014-01-01', 405 maxDate: '2024-12-31', 406 dateLimit: { 407 days: 60 408 }, 409 showDropdowns: true, 410 showWeekNumbers: true, 411 timePicker: false, 412 timePickerIncrement: 1, 413 timePicker12Hour: true, 414 ranges: { 415 'Today': [moment(), moment()], 416 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)], 417 'Last 7 Days': [moment().subtract('days', 6), moment()], 418 'Last 30 Days': [moment().subtract('days', 29), moment()], 419 'This Month': [moment().startOf('month'), moment().endOf('month')], 420 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')] 421 }, 422 buttonClasses: ['btn'], 423 applyClass: 'btn-success', 424 cancelClass: 'btn-default', 425 format: 'YYYY-MM-DD', 426 separator: ' - ', 427 locale: { 428 applyLabel: 'Apply', 429 fromLabel: 'From', 430 toLabel: 'To', 431 customRangeLabel: 'Custom Range', 432 daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], 433 monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 434 firstDay: 1 435 } 436 }, 437 function(start, end) { 438 console.log("Callback has been called!"); 439 $('#reportrange span').html(start.format('YYYY MMMM D') + ' - ' + end.format('YYYY MMMM D')); 440 } 441 ); 442 //Set the initial state of the picker label 443 $('#reportrange span').html(moment().subtract('days', 29).format('YYYY MMMM D') + ' - ' + moment().format('YYYY MMMM D')); 444 445 446 $('#reportrange-top').daterangepicker({ 447 opens: 'left', 448 startDate: moment().subtract('days', 29), 449 endDate: moment(), 450 minDate: '2014-01-01', 451 maxDate: '2024-12-31', 452 dateLimit: { 453 days: 60 454 }, 455 showDropdowns: true, 456 showWeekNumbers: true, 457 timePicker: false, 458 timePickerIncrement: 1, 459 timePicker12Hour: true, 460 ranges: { 461 'Today': [moment(), moment()], 462 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)], 463 'Last 7 Days': [moment().subtract('days', 6), moment()], 464 },
465 buttonClasses: ['btn'], 466 applyClass: 'btn-success', 467 cancelClass: 'btn-default', 468 format: 'YYYY-MM-DD', 469 separator: ' -- ', 470 locale: { 471 applyLabel: 'Apply', 472 fromLabel: 'From', 473 toLabel: 'To', 474 customRangeLabel: 'Custom Range', 475 daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], 476 monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 477 firstDay: 1 478 } 479 }, 480 function(start, end) { 481 $('#reportrange-top span').html(start.format('YYYY MMMM D') + ' - ' + end.format('YYYY MMMM D')); 482 } 483 ); 484 //Set the initial state of the picker label 485 $('#reportrange-top span').html(moment().subtract('days', 29).format('YYYY MMMM D') + ' - ' + moment().format('YYYY MMMM D')); 486 487 }; 488 489 var handleDatePickers = function() { 490 if (!jQuery().datepicker) { 491 return; 492 } 493 494 $('.date-picker').datepicker({ 495 autoclose: true, 496 format: "yyyy-mm-dd", 497 weekStart: 1 498 }); 499 //$( ".date-picker" ).datepicker( "option", "dateFormat", 'yy-mm-dd' ); 500 501 $('#sandbox-container .input-group.date-picker').datepicker({dateFormat: "yy-mm-dd", 502 firstDay: 1}); 503 504 }; 505 506 var handleTimePicker = function () { 507 if (!jQuery().timepicker) { 508 return; 509 } 510 $('.timepicker').timepicker({showMeridian: false, minuteStep: 30}); 511 }; // Function to handle TimePicker 512 513 var handleClockface = function () { 514 if (!jQuery().clockface) { 515 return; 516 } 517 $('.clockface').clockface(); 518 }; // Function to handle TimePicker 519 520 var handleColorbox = function () { 521 if (!jQuery().colorbox) { 522 return; 523 } 524 $('.colorbox').colorbox({ 525 rel: 'group1', 526 width: "90%", 527 maxWidth: '800px' 528 }); 529 }; // Function to handle color box 530 531 return { 532 init: function() { 533 534 handleSidebardropdown(); 535 handleSidebarOpenable(); 536 handleSidebarScroll(); 537 handleLoginLink(); 538 handleScrollToTop(); 539 handleToggleMenu(); 540 handleFriendListMenu(); 541 handleHoverTouchDevice(); 542 handleDropdownHover(); 543 handelPanelTools(); 544 handelSlimScroll(); 545 handleSummernote(); 546 handelTooltip(); 547 handelPopovers(); 548 handleInboxMenu(); 549 handelSelect2(); 550 handelFootable(); 551 handelSortableTbl(); 552 handleTableCheckBox(); 553 handelMultiselectBtn(); 554 handeliCheckbox(); 555 handleUniform(); 556 handelResponsivePagination(); 557 handelTagInput(); 558 handleDateRangePickers(); 559 560 handleDatePickers(); 561 handleTimePicker(); 562 handleClockface(); 563 handleColorbox(); 564 } 565 566 }; 567}(); // Handel Application 568 569$(window).scroll(function() { 570 571 var position = $(window).scrollTop(); 572 573 //Display a scroll to top button 574 if (position >= 200) { 575 $('#scroll-to-top').attr('style', 'bottom:8px;'); 576 } 577 else { 578 $('#scroll-to-top').removeAttr('style'); 579 } 580}); 581 582 583$(document).ready(function() { 584 $(".emm").each(function(i, val) { 585 $(val).after("<a href='mailto:"+$(val).data("emm")+"'>"+$(val).data("emm")+"</a>"); 586 $(val).remove(); 587 }); 588});
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.