1let body = document.body; 2let html = document.documentElement; 3let width = body.scrollWidth; 4function mini_header () { 5 max_height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ) - $(window).height(); 6 $('.header .progress').css('width', ($(window).scrollTop() * 101 / max_height) + '%'); 7 8 if(width > 800){ 9 if ($(window).scrollTop() > 200) { 10 $('.header').addClass('mini-header'); 11 $('.sidebar').addClass('mini-header'); 12 13 } else if ($(window).scrollTop() < 180) { 14 $('.header').removeClass('mini-header'); 15 $('.sidebar').removeClass('mini-header'); 16 } 17 } 18} 19 20function toggle_child_menu(x) { 21 $('.mobile-navigation .box').removeClass('active'); 22 $(`.mobile-navigation .box-${x}`).addClass('active'); 23 $('.mobile-navigation .item').removeClass('active'); 24 $(`.mobile-navigation .item-${x}`).addClass('active'); 25} 26 27let menu_status = sidebar_status = 0; 28function show_menu(numb) { 29 if($(`.navigation .nav-row:nth-child(${numb}) .box`).hasClass('flex')) { 30 menu_status = 0; 31 $(`.navigation .box`).removeClass('flex'); 32 $('body').removeClass('no-scroll'); 33 }else{ 34 menu_status = 1; 35 $(`.navigation .box`).removeClass('flex'); 36 $(`.navigation .nav-row:nth-child(${numb}) .box`).addClass('flex'); 37 $('body').addClass('no-scroll'); 38 } 39} 40 41$(document).ready(function(){ 42 mini_header() 43}) 44$(window).on('scroll', mini_header) 45 46 47$('.dropdown-toggle').on('click', function (e) { 48 $(e.currentTarget).parent().find('.dropdown-menu').toggle(); 49}) 50 51let direction = $('body').prop('dir'); 52let attr = $('body').prop('dir') == 'ltr' ? 'left' : 'right'; 53$('.main-sidebar').on('click', function (){ 54 close_menu(); 55}) 56$('.close-menu-btn').on('click', function (){ 57 close_menu(); 58}) 59 60function close_menu () { 61 if(!menu_status){ 62 menu_status = 1; 63 if(attr == 'left'){ 64 $('.mobile-navigation').animate({left: 0}) 65 }else { 66 $('.mobile-navigation').animate({right: 0}) 67 } 68 $('body').addClass('no-scroll'); 69 $(`.navigation .box`).addClass('flex'); 70 } else{ 71 menu_status = 0; 72 if(attr == 'left') { 73 $('.mobile-navigation').animate({left: '-101%'}) 74 }else { 75 $('.mobile-navigation').animate({right: '-101%'}) 76 } 77 $('body').removeClass('no-scroll'); 78 $(`.navigation .box`).removeClass('flex'); 79 $(`.navigation .nav-row .box`).removeClass('flex'); 80 } 81} 82 83$('.mini-sidebar').on('click', function (){ 84 if(!sidebar_status){ 85 sidebar_status = 1; 86 $('.sidebar').animate({width: '250px'}); 87 } else{ 88 sidebar_status = 0; 89 $('.sidebar').animate({width: '0px'}); 90 } 91}) 92 93function code_preview (example) { 94 if(lang == 'c#') { 95 lang = 'c-sharp'; 96 } 97 let href = example['flag'] ? `/${loc}/laboratory/${lang}/${example['flag']}` : example['href']; 98 let html = ''; 99 100 if(href || example['title']) { 101 html += `<div class="code-preview-box">`; 102 html += `<h3 class="title">${dic['main.example']}</h3>`; 103 } 104 105 if (example['title']) { 106 html += `<p class="code-title">${example['title']}</p>`; 107 } 108 109 html += `<textarea id="code_preview_${example['index']}">${example['code']}</textarea>`; 110 111 if(href) { 112 html += `<a href="${href}" class="lab-link" target="_blank"><span class="btn-1">${dic['main.lab']}</span></a>`; 113 } 114 115 if(href || example['title']) { 116 html += `</div>`; 117 } 118 119 return html; 120} 121 122function switch_color_mode () {
123 let color_mode = get_cookie('color_mode') != '' ? get_cookie('color_mode') : 'light'; 124 $('body').removeClass(color_mode); 125 if(color_mode == 'light') { 126 $('.switch_color_mode span').addClass('dark-mode').removeClass('light-mode'); 127 color_mode = 'dark'; 128 }else { 129 $('.switch_color_mode span').removeClass('dark-mode').addClass('light-mode'); 130 color_mode = 'light'; 131 } 132 set_cookie('color_mode', color_mode, 365); 133 $('body').addClass(color_mode); 134} 135 136function set_cookie(cname, cvalue, exdays) { 137 const d = new Date(); 138 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 139 let expires = "expires="+d.toUTCString(); 140 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 141} 142 143let old_active_menu_modal; 144function toggle_menu_modal (cls) { 145 $('.lang-box').hide(); 146 $('.account-box').hide(); 147 148 if(old_active_menu_modal != cls){ 149 $(`.${cls}`).show(); 150 old_active_menu_modal = cls; 151 }else { 152 old_active_menu_modal = undefined; 153 } 154} 155 156function hider_menu_modal_bg () { 157 $('.lang-box').hide(); 158 $('.account-box').hide(); 159 old_active_menu_modal = undefined; 160} 161 162function get_cookie(cname) { 163 let name = cname + "=";
164 let ca = document.cookie.split(';'); 165 for(let i = 0; i < ca.length; i++) { 166 let c = ca[i]; 167 while (c.charAt(0) == ' ') { 168 c = c.substring(1); 169 } 170 if (c.indexOf(name) == 0) { 171 return c.substring(name.length, c.length); 172 } 173 } 174 return ""; 175}
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.