From 9558eeeff8bc3e6c2b4871977984c7e2eafce4d8 Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Mon, 28 Jan 2019 17:48:09 +0100 Subject: [PATCH] allow entering negative values in base 10 --- web/htdocs/scripts/xmlpage.js | 3 ++- xml-db/put.pl | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web/htdocs/scripts/xmlpage.js b/web/htdocs/scripts/xmlpage.js index 5977a55..0b397d5 100644 --- a/web/htdocs/scripts/xmlpage.js +++ b/web/htdocs/scripts/xmlpage.js @@ -13,6 +13,7 @@ text += "\nCurrent Value: "+curr+" ("+e.target.parentNode.getAttribute("raw")+")\n "; var newval = prompt(text,e.target.parentNode.getAttribute("raw")); if (newval != null) { + if (newval < 0) { newval = 'm'+(-newval);} getdataprint('../xml-db/put.pl?'+e.target.parentNode.getAttribute("cstr")+'-'+newval,'returntext',false,-1,refresh); } } @@ -168,4 +169,4 @@ document.cookie = cname + "=" + cvalue + "; " + expires + ";path= " + path; } - \ No newline at end of file + diff --git a/xml-db/put.pl b/xml-db/put.pl index 2950c74..b16e8ec 100755 --- a/xml-db/put.pl +++ b/xml-db/put.pl @@ -59,6 +59,7 @@ foreach my $req (@request) { my $RealBin = "."; $isbrowser = 1; ($entity,$netaddr,$name,$value) = split("-",$req); + $file = "$RealBin/cache/$entity.entity"; } } @@ -78,6 +79,8 @@ foreach my $req (@request) { $value = $ARGV[3] || ""; } + $value =~ s/m/\-/; #encoded negative values + ############################### -- 2.43.0