noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 219/323: Improve cal


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 219/323: Improve cal
Date: Wed, 14 Mar 2018 17:38:52 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 9581ba5958bedec40a77111fb91ed23211ac932b
Author: Dany De Bontridder <address@hidden>
Date:   Sun Feb 18 21:31:49 2018 +0100

    Improve cal
---
 html/js/calc.js    | 11 +++++++----
 html/js/scripts.js |  4 ++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/html/js/calc.js b/html/js/calc.js
index 5460a7b..fe71536 100644
--- a/html/js/calc.js
+++ b/html/js/calc.js
@@ -62,20 +62,23 @@ function cal()
     var str_sub="Total :"+p_variable+" = "+result.toString();
     this.document.getElementById("sub_total").innerHTML=str_sub;
     this.document.getElementById("listing").innerHTML=p_history;
-    this.document.getElementById('inp').value="";
+    this.document.getElementById('inp').value=result;
 }
 // Clean
 //
-function Clean()
+function CleanHistory()
 {
     this.document.getElementById('listing').innerHTML="";
-    this.document.getElementById('result').innerHTML="";
     this.document.getElementById('sub_total').innerHTML="";
     this.document.getElementById('inp').value="";
     this.document.getElementById('inp').focus();
 
 }
-
+function Clean() 
+{
+    this.document.getElementById('inp').value="";
+    this.document.getElementById('inp').focus();
+}
 function Compute()
 {
     var tot=0;
diff --git a/html/js/scripts.js b/html/js/scripts.js
index 4e15b53..5634fb5 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -1077,10 +1077,10 @@ function show_calc()
     var sid = 'calc1';
     var shtml = '';
     shtml +="<div class=\"bxbutton\">";
-    shtml += '<a class="icon" onclick="pin(\'calc1\')" 
id="pin_calc1">&#xf192;</a>     <a onclick="removeDiv(\'calc1\');" 
href="javascript:void(0)" id="close_div">X</a>';
+    shtml += '<a class="icon" onclick="pin(\'calc1\')" 
id="pin_calc1">&#xf047;</a>     <a onclick="removeDiv(\'calc1\');" 
href="javascript:void(0)" title="" class="icon">&#10761;</a>';
     shtml +="</div>";
     shtml += '   <h2 class="title">Calculatrice</h2>';
-    shtml += '<form name="calc_line"  method="GET" onSubmit="cal();return 
false;" >Calculatrice simplifiée: écrivez simplement les opérations que vous 
voulez puis la touche retour. exemple : 1+2+3*(1/5) <input class="input_text" 
type="text" size="30" id="inp" name="calculator"> <input type="button" 
value="Efface tout" class="button" onClick="Clean();return false;" > <input 
type="button" class="button" value="Fermer" onClick="removeDiv(\'calc1\')" >';
+    shtml += '<form name="calc_line"  method="GET" onSubmit="cal();return 
false;" >Calculatrice simplifiée: écrivez simplement les opérations que vous 
voulez puis la touche retour. exemple : 1+2+3*(1/5) <input class="input_text" 
type="text" size="30" id="inp" name="calculator"> <input type="button" 
value="Efface" class="button" onClick="Clean();return false;" > <input 
type="button" value="Efface historique" class="button" 
onClick="CleanHistory();return false;" > <input type="button" clas [...]
     shtml += '</form><span class="highligth" style="display:block" 
id="sub_total">  Taper une formule (ex 20*5.1) puis enter  </span><span 
style="display:block"  id="listing"> </span>';
 
     var obj = {id: sid, html: shtml,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]