[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 173/219: Improve calc
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 173/219: Improve calc |
Date: |
Mon, 18 Dec 2017 13:22:58 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit ae32c8fb9b73eac22f1cc6c4a5418f0df7cde81e
Author: Dany De Bontridder <address@hidden>
Date: Tue Nov 28 19:17:40 2017 +0100
Improve calc
---
html/js/calc.js | 11 ++++++++---
html/js/scripts.js | 2 +-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/html/js/calc.js b/html/js/calc.js
index dd42d07..5460a7b 100644
--- a/html/js/calc.js
+++ b/html/js/calc.js
@@ -38,6 +38,12 @@ function cal()
try
{
Compute();
+ p_variable=p_variable.replace(/[a-z]/,'');
+ p_variable=p_variable.replace(/[A-Z]/,'');
+ p_variable=p_variable.replace(/</,'');
+ p_variable=p_variable.replace(/%/,'');
+ p_variable=p_variable.replace(/;/,'');
+ p_variable=p_variable.replace(/>/,'');
p_variable=p_variable.replace(/ /g,"");
p_variable=p_variable.replace(/\+/g,"+ ");
p_variable=p_variable.replace(/-/g,"- ");
@@ -52,9 +58,8 @@ function cal()
alert_box("Mauvaise formule\n"+p_variable);
return false;
}
- p_history=p_history+'<hr>'+p_variable;
- p_history+="="+result.toString();
- var str_sub="<hr><p> Total :"+p_variable+" = "+result.toString()+"</p>";
+ p_history=p_variable+"="+result.toString()+'<br>'+p_history;
+ 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="";
diff --git a/html/js/scripts.js b/html/js/scripts.js
index 47e26a0..ae6fd7a 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -1064,7 +1064,7 @@ function show_calc()
shtml += '<div
style="float:right;height:10px;display:block;margin-top:2px;margin-right:2px"><span
id="pin_calc1"><a class="input_text" onclick="pin(\'calc1\')"
id="close_div">❉</a></span> <a onclick="removeDiv(\'calc1\');"
href="javascript:void(0)" id="close_div">X</a></div>';
shtml += '<div> <h2 class="title">Calculatrice</h2></div>';
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><span id="result"> </span><br><span id="sub_total">
Taper une formule (ex 20*5.1) puis enter </span><br><span id="listing">
</span>';
+ 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,
drag: true, style: ''
- [Noalyss-commit] [noalyss] 54/219: NEW : ICard , you can hide or show the accounting in the search box with the functions ICard->hide_accounting and ICard->show_accounting, (continued)
- [Noalyss-commit] [noalyss] 54/219: NEW : ICard , you can hide or show the accounting in the search box with the functions ICard->hide_accounting and ICard->show_accounting, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 67/219: Icon : for Inplace Edit field, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 166/219: Space, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 19/219: Replace global $http by new httpInput() to make the test of scenario working, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 128/219: Esthetic, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 99/219: CSS : button border, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 108/219: task #0001272: Rendre possible l'appel de la calculatrice depuis le fin fond d'une page., Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 174/219: space, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 114/219: Change max article in STOCK INV, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 16/219: Update test with new architecture, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 173/219: Improve calc,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 104/219: Réécriture de CFGPCMN pour utiliser ManageTable pas de delete proposé si compte utilisé, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 14/219: Infobulle : warning : esthetic, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 44/219: fix minor bug + doc, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 46/219: Manage_Table : Improve Javascript for adding / removing row of table, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 27/219: Task #0001443: opérations rapprochées : bug quand on utilise des tva avec autoliquidation Check with the view v_quant_detail and take into account the negative VAT, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 33/219: Task #0001324: Afficher la date (période) dans FSALDO, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 198/219: Task #001381 : reinitialize the search_form, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 154/219: Task #1440 CA - opération diverses inaccessibles Task #1370 les OD en comptabilité analytique - problème., Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 209/219: Merge branch 'master' of ns3:/srv/git/noalyss, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 186/219: Protect queryString with encodeURI, Dany De Bontridder, 2017/12/18