document.onkeydown = (e) => { if (e.key == 123) {e.preventDefault();} if (e.ctrlKey && e.shiftKey && e.key == 'I') {e.preventDefault();} //if (e.ctrlKey && e.shiftKey && e.key == 'C') {e.preventDefault();} if (e.ctrlKey && e.shiftKey && e.key == 'J') {e.preventDefault();} if (e.ctrlKey && e.key == 'U') {e.preventDefault();} //if (e.ctrlKey && e.key == 'u') {e.preventDefault();} }; function capfirst(str) { return str.toLowerCase().split(' ').map(function(word) { return word.charAt(0).toUpperCase() + word.slice(1); }).join(' '); } function capEachWord(kalimat, lowercase=true, a_spasi='_', b_spasi=' ') { const words = lowercase==false ? kalimat : kalimat.toLowerCase(); const kataArray = words.split(a_spasi); const kataKapitalArray = kataArray.map(ka=>{ if (ka.length === 0) { return '';} return ka.charAt(0).toUpperCase() + ka.slice(1); }); return kataKapitalArray.join(b_spasi); } function truncate(text, maxLength) { if (text.length > maxLength) { return text.substring(0, maxLength) + "..."; } return text } function getTextWidth(text, font=false) { const canvas = document.createElement('canvas'); const context = canvas.getContext('2d'); context.font = Boolean(font)==true ? font : ('400 ' + (4 * 3.5) + 'px Roboto'); const metrics = context.measureText(text); return metrics.width; } delete history.pushState; for (let i = 0; i <= 30; i++) { history.pushState({ page: i }, "/", ""); } // history.pushState({ page: 1 }, "", ""); // history.back(); // window.history.forward();