1 /* 2 * 1 - ФÑнкÑÐ¸Ñ ÐºÐ¾ÑоÑÐ°Ñ Ð±ÑÐ´ÐµÑ Ð²Ñполнена 3 * 2 - код клавиÑи коÑоÑÐ°Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° ÑÑабоÑаÑÑ 4 * 3 - вÑоÑÐ°Ñ ÐºÐ»Ð°Ð²Ð¸Ñа в ÑоÑеÑании Ñ Ð¿ÐµÑвой 5 * 4 - ÑÑеÑÑÑ ÐºÐ»Ð°Ð²Ð¸Ñа в ÑоÑеÑании Ñ Ð¿ÐµÑвой и вÑоÑой 6 * 7 * ФÑнкÑÐ¸Ñ Ð´Ð»Ñ Ð¾Ð±ÑабоÑки лÑбого ÑоÑеÑÐ°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñ. 8 * ÐолиÑеÑÑво ÐºÐ»Ð°Ð²Ð¸Ñ Ð¿Ñи нажаÑии коÑоÑÑÑ Ð±ÑÐ´ÐµÑ Ð²Ñполнена ÑÑнкÑÐ¸Ñ 9 * неогÑаниÑено. 10 */ 11 function bodyEvent(func) 12 { 13 var codes = [].slice.call(arguments, 1); 14 var pressed = {}; 15 16 document.onkeydown = function(e) { 17 e = e || window.event; 18 19 pressed[e.keyCode] = true; 20 21 for (var i = 0; i < codes.length; i++) { // пÑовеÑиÑÑ, вÑе ли клавиÑи нажаÑÑ 22 if (!pressed[codes[i]]) { 23 return; 24 } 25 } 26 27 pressed = {}; 28 29 func(); 30 31 }; 32 33 document.onkeyup = function(e) 34 { 35 e = e || window.event; 36 37 delete pressed[e.keyCode]; 38 }; 39 } 40 41 42 function closeModalWindow() 43 { 44 var modalWin = document.getElementById("modal-window-home-id"); 45 modalWin.style.display = "none"; 46 //modalWin.parentNode.removeChild(modalWin); 47 } 48 49 50 51 52 function modalWindow() 53 { 54 var modalW = document.getElementsByClassName("modal-window-home").length; 55 if(modalW <= 1) 56 { 57 var formElem = document.getElementById('elem-form'); 58 var elemStr = '<textarea class="form-sm-element message-text-submit" id="text-form" name="error_desc"' + 59 'placeholder="ÐожалÑйÑÑа, опиÑиÑе оÑибкÑ"></textarea>' + 60 '<input type="hidden" name="error_message" value="' + copySelectionText() + '">' + 61 '<input type="hidden" name="error_url" value="' + window.location + '">' + 62 '<input type="hidden" name="error_referer" value="' + document.referrer + '">' + 63 '<input type="hidden" name="error_useragent" value="' + navigator.userAgent + '">'; 64 formElem.innerHTML = elemStr; 65 66 var modalFormMess = document.getElementById('mess'); 67 var hideFormText = document.getElementById('error_message'); 68 var submitButton = document.getElementById('send'); 69 var textForm = document.getElementById('text-form'); 70 console.log(String(textForm)); 71 72 var hideText = copySelectionText(); 73 if(hideText != '') { 74 var str = ''; 75 if(String(hideText).length >= 120) 76 str = '...'; 77 modalFormMess.innerHTML = String(hideText).substring(0,120) + str; 78 submitButton.style.display = 'block'; 79 textForm.style.display = 'block'; 80 modalFormMess.style.color = 'rgba(0,0,0,.54)'; 81 } 82 else { 83 modalFormMess.innerHTML = 'ТекÑÑ Ñ Ð¾Ñибкой не вÑделен. ÐожалÑйÑÑа вÑделиÑе ÑекÑÑ Ñ Ð¾Ñибкой и нажмиÑе Ctrl+Enter'; 84 textForm.style.display = 'none'; 85 submitButton.style.display = 'none'; 86 modalFormMess.style.color = 'rgba(255,0,0,.87)'; 87 } 88 var modWindow = document.getElementById("modal-window-home-id"); 89 modWindow.style.display = "flex"; 90 } 91 } 92 93 94 bodyEvent(modalWindow,"17","13"); 95 96 /* 97 * ФУÐÐЦÐЯ modalWindowEsc ÐÐÐРЫÐÐЮЩÐЯ ÐÐÐÐÐЬÐÐÐ ÐÐÐÐ 98 * ÐÐ Ð ÐÐÐÐТÐÐ ÐÐ ÐÐÐÐÐШУ ESC 99 * 100 */ 101 102 function modalWindowEsc(e) 103 { 104 if(e.keyCode == 27) 105 closeModalWindow(); 106 } 107 108 addEventListener("keydown", modalWindowEsc); 109 110 111 112 function handlerEvents(e) { 113 var flagObjHandler = e.target.hasAttribute('params'); 114 if(flagObjHandler) { 115 var objHandler = e.target.getAttribute('params'); 116 switch(objHandler) { 117 case 'close': 118 closeModalWindow(); 119 break; 120 } 121 } 122 } 123 124 125 126 127 window.onload = function() { 128 document.body.addEventListener('click',handlerEvents); 129 } 130 131 function copySelectionText() 132 { 133 if(window.getSelection) 134 strText = window.getSelection(); 135 else if(document.getSelection) 136 strText = document.getSelection(); 137 else if(document.selection) 138 strText = document.CDATA_SECTION_NODE.createRange().text; 139 else return; 140 141 return strText; 142 } 143 144 function text() { 145 146 }
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.