getWheelDelta: function(event) { if(event.wheelDelta) { return event.wheelDelta; }else { return -event.detail * 40 } }, getCharCode: function(event) { if(typeof event.charCode == 'number') { return event.charCode; }else { return event.keyCode; } }, getClipboardText: function(event...
event = EventUtil.getEvent(event); // var target = EventUtil.getTarget(event); var charCode = EventUtil.getCharCode(event); if (!/\d/.test(String.fromCharCode(charCode)) && charCode > 9 && !event.ctrlKey) { EventUtil.preventDefault(event); } }) </script> 1. 2. 3. 4. 5. 6. 7...
Delta:function(event){if(event.wheelDelta){returnevent.wheelDelta;}else{return-event.detail*40}},getCharCode:function(event){if(typeof event.charCode=='number'){returnevent.charCode;}else{returnevent.keyCode;}}}; 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17...
functiontokenize(code){letREGEXES=[// ...];letstatements=code.split(' ');lettokens;REGEXES.forEach((REGEX)=>{statements.forEach((statement)=>{// ...})});returntokens;}functionlexer(tokens){letast;tokens.forEach((token)=>{// lex...});returnast;}functionparseBetterJSAlternative(code){l...
0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be....
function hashIt(data) { // The hash var hash = 0; // Length of string var length = data.length; // Loop through every character in data for (var i = 0; i < length; i++) { // Get character code. var char = data.charCodeAt(i); // Make the hash hash = ((hash << 5)...
Remove dead codeDead code is just as bad as duplicate code. There's no reason to keep it in your codebase. If it's not being called, get rid of it! It will still be safe in your version history if you still need it.Bad:
console.log(get_copyright()); `; // 将 JS 代码转换为二进制字符串 function convertToBinary(code) { let binary = ""; for (let i = 0; i < code.length; i++) { const charCode = code.charCodeAt(i); const charBinary = charCode.toString(2).padStart(8, "0"); ...
async function recognizeCodeWithTesseract(base64) { const worker = await Tesseract.createWorker("eng"); const charCodes = []; for (let i = 0; i < 26; i++) { if (i <= 9) charCodes.push(i); charCodes.push(String.fromCharCode(97 + i), String.fromCharCode(65 + i)); //生成...
length; // Loop through every character in data for (var i = 0; i < length; i++) { // Get character code. var char = data.charCodeAt(i); // Make the hash hash = ((hash << 5) - hash) + char; // Convert to 32-bit integer hash = hash & hash; } }Good:...