1$(document).ready(function(){ 2 3 if( $('#profiler_icon').length ) 4 { 5 initProfiler(); 6 7 handleProfilerSwitcher(); 8 9 handleProfilerMenuItems(); 10 11 handleProfilerQueryRows(); 12 13 handleProfilerBlockRows(); 14 } 15 16}); 17 18var initProfiler = function() { 19 20 if( localStorageTest() && localStorage.getItem('profilerBarOpen') !== null ) 21 $('#profiler_bar').addClass('opened'); 22 23} 24 25var handleProfilerSwitcher = function() { 26 27 $('#profiler_icon').off('click').on('click', function(){ 28 var profiler_bar = $('#profiler_bar'); 29 var admin_box = $('#admin_box'); 30 var admin_box_button = $('#minimal_admin'); 31 32 if( profiler_bar.hasClass('opened') ) 33 { 34 profiler_bar.removeClass('opened'); 35 if( localStorageTest() ) 36 localStorage.removeItem('profilerBarOpen'); 37 } 38 else 39 { 40 profiler_bar.addClass('opened'); 41 if( localStorageTest() ) 42 localStorage.setItem('profilerBarOpen', 1); 43 44 if( admin_box.length && admin_box.hasClass('opened') ) 45 admin_box_button.trigger('click'); 46 } 47 }); 48 49} 50 51var handleProfilerMenuItems = function() { 52 53 var main_li_s = $('#profiler-main-ul li').not('.profiler-no-sub'); 54 55 main_li_s.off('click').on('click', function(){ 56 var was_active = $(this).hasClass('active'); 57 main_li_s.removeClass('active'); 58 if( !was_active ) 59 $(this).addClass('active'); 60 }); 61 62} 63 64var handleProfilerQueryRows = function() { 65 66 var query_short_rows = $('.profiler-query-short-row'); 67 var query_long_rows = $('.profiler-query-long-row'); 68 69 query_short_rows.off('click').on('click', function(){ 70 var id = $(this).data('id'); 71 query_long_rows.removeClass('opened'); 72 if( !$(this).hasClass('opened') ) 73 { 74 query_short_rows.removeClass('opened'); 75 $(this).addClass('opened'); 76 query_long_rows.filter('[data-id="' + id + '"]').addClass('opened'); 77 } 78 else 79 $(this).removeClass('opened'); 80 }); 81} 82 83var handleProfilerBlockRows = function() { 84 85 var block_short_rows = $('.profiler-block-short-row'); 86 var block_long_rows = $('.profiler-block-long-row'); 87 88 block_short_rows.off('click').on('click', function(){ 89 var id = $(this).data('id'); 90 block_long_rows.removeClass('opened'); 91 if( !$(this).hasClass('opened') ) 92 { 93 block_short_rows.removeClass('opened'); 94 $(this).addClass('opened'); 95 block_long_rows.filter('[data-id="' + id + '"]').addClass('opened'); 96 } 97 else 98 $(this).removeClass('opened'); 99 }); 100} 101 102var localStorageTest = function() { 103 var test = 'test'; 104 try { 105 localStorage.setItem(test, test); 106 localStorage.removeItem(test); 107 return true; 108 } catch(e) { 109 return false; 110 } 111}
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.