" + moment().format('llll') + "
" + "" + calcHistory[i].expression + "
= " + calcHistory[i].out + "
"); + + textii = calcHistory[i].out; + let textvi = calcHistory[i].out.toString(); + textiv="1248.64"; + console.log(textvi); + testi="="+textvi+"R"+textvi; + // testi=textvi; + console.log(testi); + // responsiveVoice.speak(textvi,'UK English Female', parameters); + // responsiveVoice.speak(" I Repeat. ",'UK English Female', parameters); + // responsiveVoice.speak( testi.toString(), 'UK English Female', {rate: 0.95, onend: () => location.reload()}); + doFunction(testi); + } + } + + // Adds a token to the token list and updates the display + function addToken(token) { + if(isNaN(token)) { + if((token === "bracket-left" || token === "num-pi") && !isNaN(tokenList[tokenList.length - 1])) { + tokenList.push("op-multiply"); + } + tokenList.push(token); + } else { + if(!isNaN(tokenList[tokenList.length - 1])) { + tokenList[tokenList.length - 1] = tokenList[tokenList.length - 1] + token; + } else { + if(!isNaN(token) && (tokenList[tokenList.length - 1] === "bracket-right" || tokenList[tokenList.length - 1] === "num-pi")) { + tokenList.push("op-multiply"); + } + tokenList.push(token); + } + } + + displayEquation(); + } + + // Updates the expression display's HTML + function displayEquation() { + var htmlString = ""; + for(var i = 0; i < tokenList.length; i++) { + if(isNaN(tokenList[i])) { + if(tokenList[i] === "bracket-left") { + htmlString += " ("; + } else if(tokenList[i] === "bracket-right") { + htmlString += ") "; + } else if(tokenList[i] === "num-pi") { + htmlString += " π "; + } else { + htmlString += getOperator(tokenList[i]).symbol; + } + } else { + htmlString += tokenList[i]; + } + } + $("#expression").html(htmlString); + } + + // Deletes the last entered token + function deleteLast() { + if(isNaN(tokenList[tokenList.length - 1])) { + tokenList.pop(); + } else { + tokenList[tokenList.length - 1] = tokenList[tokenList.length - 1].slice(0, -1); + if(tokenList[tokenList.length -1].length === 0) { + tokenList.pop(); + } + } + + displayEquation(); + } + + // Shows/hides the advanced operators panel + function toggleAdvanced() { + $("#advanced-buttons").toggle(); + if($("#advanced-buttons").is(":visible")) { + $("#toggle-advanced").removeClass("button-off"); + $("#toggle-advanced span").removeClass("glyphicon-triangle-bottom").addClass("glyphicon-triangle-top"); + } else { + $("#toggle-advanced").addClass("button-off"); + $("#toggle-advanced span").removeClass("glyphicon-triangle-top").addClass("glyphicon-triangle-bottom"); + } + } + + // Triggers the appropriate action for each button that can be pressed + function processButton(button) { + switch($(button).attr("id")) { + case "delete": + deleteLast(); + break; + case "clear": + if(tokenList.length === 0) { + // calcHistory.length = 0; + // $("#calc-history-box").html(""); + } else { + tokenList.length = 0; + displayEquation(); + } + break; + case "period": + if(isNaN(tokenList[tokenList.length - 1])) { + addToken("0."); + } else { + if(tokenList[tokenList.length - 1].indexOf(".") === -1) { + tokenList[tokenList.length - 1] += "."; + } + } + displayEquation(); + break; + case "equals": + calculate(); + break; + case "toggle-advanced": + toggleAdvanced(); + break; + case "num-pi": + addToken("num-pi"); + break; + default: + if($(button).hasClass("num")) { + addToken($(button).html()); + } else { + addToken($(button).attr("id")); + } + } + } + + // Catches all button clicks on the page + + $(".btn").off('click').click(function(event) { + event.stopPropagation(); + event.stopImmediatePropagation(); + $(event.target).blur(); + // console.log("i am called"); + processButton(event.target); + return false; + }); + + $(document).on("click", ".calc-history-eq", function(event) { + var tokens = calcHistory[parseInt($(event.target).attr("id").substring(2))].tokens; + console.log(parseInt($(event.target).attr("id").substring(2))); + console.log(calcHistory); + console.log(tokens); + tokenList = tokens; + displayEquation(); + }); + +}); + +/* +function mySave() { + myContent += document.getElementById("calc-history-box").innerHTML; + console.log(myContent); + localStorage.setItem("myContent", myContent); + // console.log('History Saved'); + } +*/ + +function speak() { +// $('#61')[0].play(); +console.log('i am called'); +document.getElementById('13').play(); +} + +var down = false; + + document.addEventListener("keydown", (e) => { + + if(down) return; + down = true; + +var keyPressed = window.event.keyCode; +var shiftPressed = window.event.shiftKey; + + +if (e.key !== "Enter" && typeof filemaps[e.key] !== 'undefined') { +// console.log(filemaps[e.key]); +var myaudio = new Audio('region/' + filemaps[e.key] + '.mp3'); +myaudio.play(); +} + +// console.log(e.key); + +if (e.key >= 0 && e.key <= 9) { + event.preventDefault(); + e.stopPropagation(); + // document.getElementById(filemaps[e.key]).play(); + document.getElementById("num-" + e.key).click(); + return false; +} else if (e.key == "Enter" || e.key == "=") { + event.preventDefault(); + // document.getElementById('61').play(); + // speak(); + // document.getElementById('13').play(); + + // var speech = new SpeechSynthesisUtterance("hello world"); + // Window.speechSynthesis.speak(speech); + + // document.getElementById('=').play(); + document.getElementById("equals").click(); + saveData(); + // window.location.reload(); + // document.getElementById("clear").click(); + +/* + document.onkeydown = function (e) { + return false; +} + + setTimeout(function() { + // Do something after 5 seconds + location.reload();//reload page + +document.onkeydown = function (e) { + return true; +} + +}, 10000); +*/ + + +} else if (e.key == ".") { + event.preventDefault(); + // document.getElementById(filemaps['`']).play(); + document.getElementById("period").click(); +} else if (e.key == "+") { + event.preventDefault(); + // document.getElementById(filemaps['P']).play(); + document.getElementById("op-add").click(); +} else if (event.keyCode == 16 && keyPressed == 43) { + event.preventDefault(); + // document.getElementById(filemaps['P']).play(); + document.getElementById("op-add").click(); +} else if (e.key == "-") { + event.preventDefault(); + // document.getElementById(filemaps['-']).play(); + document.getElementById("op-subtract").click(); +} else if (e.key == "*") { + event.preventDefault(); + // document.getElementById(filemaps['MU']).play(); + document.getElementById("op-multiply").click(); +} else if (e.key == "/") { + event.preventDefault(); + // document.getElementById(filemaps['D']).play(); + document.getElementById("op-divide").click(); +} else if (e.key == "Backspace") { + event.preventDefault(); + // document.getElementById(filemaps['B']).play(); + document.getElementById("delete").click(); +} else if (e.key == "Escape") { + event.preventDefault(); + // document.getElementById(filemaps['E']).play(); + document.getElementById("clear").click(); +} else if (event.keyCode == 12) { + event.preventDefault(); + // document.getElementById(filemaps['NL']).play(); + // document.getElementById("clear").click(); +} +}, false); + +document.addEventListener('keyup', function () { + down = false; +}, false); diff --git a/hindi/style.css b/hindi/style.css new file mode 100755 index 0000000..3331338 --- /dev/null +++ b/hindi/style.css @@ -0,0 +1,146 @@ +body { + background-color: #121212; + color: white; +} + +h1 { + margin-bottom: 20px; + text-align: center; +} + +.btn { + box-shadow: 0px 5px 10px #222222; + font-size:18px; +} + +.btn:focus { + outline: none; +} + +.button-row div { + width: 60px; + height: 60px; + text-align: center; + line-height: 60px; + margin: 5px; +} + +.button-row .btn { + width: 60px; + height: 60px; + background-color: #636363; +} + +.button-row .btn:hover { + background-color: #858585; + color: white !important; +} + +.button-orange { + background-color: #FF8400 !important; +} + +.button-orange:hover { + background-color: #FFA647 !important; +} + +.button-blue { + background-color: #0099FF !important; +} + +.button-blue:hover { + background-color: #33ADFF !important; +} + +.button-off { + background-color: aquamarine !important; + color: black !important; +} + +.button-khaki { + background-color: khaki !important; + color: black !important; +} + +.calc-history-eq { + color: #B0B0B0; + cursor: pointer; +} + +#container { + width: 600px; + background-color: #2E2E2E; + height: 100%; + border-radius: 10px; + margin-top: 4%; +} + +#expression { + height: 60px; + margin-bottom: 20px; + padding: 10px; + text-align: right; + background-color: #636363; + border-radius: 5px; + font-size: 30px; + box-shadow: 0px 5px 10px #444444 inset; +} + +#standard-buttons { + display: inline-block; + margin-left: -20px; + margin-bottom: 10px; +} + +#advanced-buttons { + display: inline-block; + display: none; + margin-left: -20px; +} + +#toggle-advanced:hover { + background-color: #858585 !important; +} + +#toggle-advanced span { + pointer-events: none; +} + +#calc-history { + float: right; + width: 200px; + height: 270px; + background-color: #636363; + border-radius: 5px; + margin-top: 6px; + padding: 10px; + box-shadow: 0px 5px 10px #444444 inset; + overflow:auto; + font-size:18px; +} + +#calc-history-box { + width: 180px !important; + height: 220px !important; + resize: none; + overflow: auto; + font-size:18px; +} + +#calc-history hr { + margin-top: 5px; + margin-bottom: 5px; +} + +#footer { + background-color: #262626; + margin-left: -15px; + margin-right: -15px; + margin-bottom: -15px; + margin-top: 15px; + padding: 10px; + padding-bottom: 1px; + color: #636363; + border-bottom-left-radius: 10px; + border-bottom-right-radius: 10px; +} diff --git a/marathi/LICENSE b/marathi/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/marathi/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc." + moment().format('llll') + "
" + "" + calcHistory[i].expression + "
= " + calcHistory[i].out + "
"); + + textii = calcHistory[i].out; + let textvi = calcHistory[i].out.toString(); + textiv="1248.64"; + console.log(textvi); + testi="="+textvi+"R"+textvi; + // testi=textvi; + console.log(testi); + // responsiveVoice.speak(textvi,'UK English Female', parameters); + // responsiveVoice.speak(" I Repeat. ",'UK English Female', parameters); + // responsiveVoice.speak( testi.toString(), 'UK English Female', {rate: 0.95, onend: () => location.reload()}); + doFunction(testi); + } + } + + // Adds a token to the token list and updates the display + function addToken(token) { + if(isNaN(token)) { + if((token === "bracket-left" || token === "num-pi") && !isNaN(tokenList[tokenList.length - 1])) { + tokenList.push("op-multiply"); + } + tokenList.push(token); + } else { + if(!isNaN(tokenList[tokenList.length - 1])) { + tokenList[tokenList.length - 1] = tokenList[tokenList.length - 1] + token; + } else { + if(!isNaN(token) && (tokenList[tokenList.length - 1] === "bracket-right" || tokenList[tokenList.length - 1] === "num-pi")) { + tokenList.push("op-multiply"); + } + tokenList.push(token); + } + } + + displayEquation(); + } + + // Updates the expression display's HTML + function displayEquation() { + var htmlString = ""; + for(var i = 0; i < tokenList.length; i++) { + if(isNaN(tokenList[i])) { + if(tokenList[i] === "bracket-left") { + htmlString += " ("; + } else if(tokenList[i] === "bracket-right") { + htmlString += ") "; + } else if(tokenList[i] === "num-pi") { + htmlString += " π "; + } else { + htmlString += getOperator(tokenList[i]).symbol; + } + } else { + htmlString += tokenList[i]; + } + } + $("#expression").html(htmlString); + } + + // Deletes the last entered token + function deleteLast() { + if(isNaN(tokenList[tokenList.length - 1])) { + tokenList.pop(); + } else { + tokenList[tokenList.length - 1] = tokenList[tokenList.length - 1].slice(0, -1); + if(tokenList[tokenList.length -1].length === 0) { + tokenList.pop(); + } + } + + displayEquation(); + } + + // Shows/hides the advanced operators panel + function toggleAdvanced() { + $("#advanced-buttons").toggle(); + if($("#advanced-buttons").is(":visible")) { + $("#toggle-advanced").removeClass("button-off"); + $("#toggle-advanced span").removeClass("glyphicon-triangle-bottom").addClass("glyphicon-triangle-top"); + } else { + $("#toggle-advanced").addClass("button-off"); + $("#toggle-advanced span").removeClass("glyphicon-triangle-top").addClass("glyphicon-triangle-bottom"); + } + } + + // Triggers the appropriate action for each button that can be pressed + function processButton(button) { + switch($(button).attr("id")) { + case "delete": + deleteLast(); + break; + case "clear": + if(tokenList.length === 0) { + // calcHistory.length = 0; + // $("#calc-history-box").html(""); + } else { + tokenList.length = 0; + displayEquation(); + } + break; + case "period": + if(isNaN(tokenList[tokenList.length - 1])) { + addToken("0."); + } else { + if(tokenList[tokenList.length - 1].indexOf(".") === -1) { + tokenList[tokenList.length - 1] += "."; + } + } + displayEquation(); + break; + case "equals": + calculate(); + break; + case "toggle-advanced": + toggleAdvanced(); + break; + case "num-pi": + addToken("num-pi"); + break; + default: + if($(button).hasClass("num")) { + addToken($(button).html()); + } else { + addToken($(button).attr("id")); + } + } + } + + // Catches all button clicks on the page + + $(".btn").off('click').click(function(event) { + event.stopPropagation(); + event.stopImmediatePropagation(); + $(event.target).blur(); + // console.log("i am called"); + processButton(event.target); + return false; + }); + + $(document).on("click", ".calc-history-eq", function(event) { + var tokens = calcHistory[parseInt($(event.target).attr("id").substring(2))].tokens; + console.log(parseInt($(event.target).attr("id").substring(2))); + console.log(calcHistory); + console.log(tokens); + tokenList = tokens; + displayEquation(); + }); + +}); + +/* +function mySave() { + myContent += document.getElementById("calc-history-box").innerHTML; + console.log(myContent); + localStorage.setItem("myContent", myContent); + // console.log('History Saved'); + } +*/ + +function speak() { +// $('#61')[0].play(); +console.log('i am called'); +document.getElementById('13').play(); +} + +var down = false; + + document.addEventListener("keydown", (e) => { + + if(down) return; + down = true; + +var keyPressed = window.event.keyCode; +var shiftPressed = window.event.shiftKey; + + +if (e.key !== "Enter" && typeof filemaps[e.key] !== 'undefined') { +// console.log(filemaps[e.key]); +var myaudio = new Audio('region/' + filemaps[e.key] + '.mp3'); +myaudio.play(); +} + +// console.log(e.key); + +if (e.key >= 0 && e.key <= 9) { + event.preventDefault(); + e.stopPropagation(); + // document.getElementById(filemaps[e.key]).play(); + document.getElementById("num-" + e.key).click(); + return false; +} else if (e.key == "Enter" || e.key == "=") { + event.preventDefault(); + // document.getElementById('61').play(); + // speak(); + // document.getElementById('13').play(); + + // var speech = new SpeechSynthesisUtterance("hello world"); + // Window.speechSynthesis.speak(speech); + + // document.getElementById('=').play(); + document.getElementById("equals").click(); + saveData(); + // window.location.reload(); + // document.getElementById("clear").click(); + +/* + document.onkeydown = function (e) { + return false; +} + + setTimeout(function() { + // Do something after 5 seconds + location.reload();//reload page + +document.onkeydown = function (e) { + return true; +} + +}, 10000); +*/ + + +} else if (e.key == ".") { + event.preventDefault(); + // document.getElementById(filemaps['`']).play(); + document.getElementById("period").click(); +} else if (e.key == "+") { + event.preventDefault(); + // document.getElementById(filemaps['P']).play(); + document.getElementById("op-add").click(); +} else if (event.keyCode == 16 && keyPressed == 43) { + event.preventDefault(); + // document.getElementById(filemaps['P']).play(); + document.getElementById("op-add").click(); +} else if (e.key == "-") { + event.preventDefault(); + // document.getElementById(filemaps['-']).play(); + document.getElementById("op-subtract").click(); +} else if (e.key == "*") { + event.preventDefault(); + // document.getElementById(filemaps['MU']).play(); + document.getElementById("op-multiply").click(); +} else if (e.key == "/") { + event.preventDefault(); + // document.getElementById(filemaps['D']).play(); + document.getElementById("op-divide").click(); +} else if (e.key == "Backspace") { + event.preventDefault(); + // document.getElementById(filemaps['B']).play(); + document.getElementById("delete").click(); +} else if (e.key == "Escape") { + event.preventDefault(); + // document.getElementById(filemaps['E']).play(); + document.getElementById("clear").click(); +} else if (event.keyCode == 12) { + event.preventDefault(); + // document.getElementById(filemaps['NL']).play(); + // document.getElementById("clear").click(); +} +}, false); + +document.addEventListener('keyup', function () { + down = false; +}, false); diff --git a/marathi/style.css b/marathi/style.css new file mode 100755 index 0000000..3331338 --- /dev/null +++ b/marathi/style.css @@ -0,0 +1,146 @@ +body { + background-color: #121212; + color: white; +} + +h1 { + margin-bottom: 20px; + text-align: center; +} + +.btn { + box-shadow: 0px 5px 10px #222222; + font-size:18px; +} + +.btn:focus { + outline: none; +} + +.button-row div { + width: 60px; + height: 60px; + text-align: center; + line-height: 60px; + margin: 5px; +} + +.button-row .btn { + width: 60px; + height: 60px; + background-color: #636363; +} + +.button-row .btn:hover { + background-color: #858585; + color: white !important; +} + +.button-orange { + background-color: #FF8400 !important; +} + +.button-orange:hover { + background-color: #FFA647 !important; +} + +.button-blue { + background-color: #0099FF !important; +} + +.button-blue:hover { + background-color: #33ADFF !important; +} + +.button-off { + background-color: aquamarine !important; + color: black !important; +} + +.button-khaki { + background-color: khaki !important; + color: black !important; +} + +.calc-history-eq { + color: #B0B0B0; + cursor: pointer; +} + +#container { + width: 600px; + background-color: #2E2E2E; + height: 100%; + border-radius: 10px; + margin-top: 4%; +} + +#expression { + height: 60px; + margin-bottom: 20px; + padding: 10px; + text-align: right; + background-color: #636363; + border-radius: 5px; + font-size: 30px; + box-shadow: 0px 5px 10px #444444 inset; +} + +#standard-buttons { + display: inline-block; + margin-left: -20px; + margin-bottom: 10px; +} + +#advanced-buttons { + display: inline-block; + display: none; + margin-left: -20px; +} + +#toggle-advanced:hover { + background-color: #858585 !important; +} + +#toggle-advanced span { + pointer-events: none; +} + +#calc-history { + float: right; + width: 200px; + height: 270px; + background-color: #636363; + border-radius: 5px; + margin-top: 6px; + padding: 10px; + box-shadow: 0px 5px 10px #444444 inset; + overflow:auto; + font-size:18px; +} + +#calc-history-box { + width: 180px !important; + height: 220px !important; + resize: none; + overflow: auto; + font-size:18px; +} + +#calc-history hr { + margin-top: 5px; + margin-bottom: 5px; +} + +#footer { + background-color: #262626; + margin-left: -15px; + margin-right: -15px; + margin-bottom: -15px; + margin-top: 15px; + padding: 10px; + padding-bottom: 1px; + color: #636363; + border-bottom-left-radius: 10px; + border-bottom-right-radius: 10px; +}