X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matitaB%2Fmatita%2Fmatitaweb.js;h=ecb0133c3d31f3de5f4edcafd34fd71a20f17d60;hb=c9f62ea7b8b3a77048c7d1f78c3d430110b0745a;hp=e87a19f520d3171f259a7428ad58d44dff52de01;hpb=d2a3f16be6c74cc7d79198a6ed126103bb502aea;p=helm.git diff --git a/matitaB/matita/matitaweb.js b/matitaB/matita/matitaweb.js index e87a19f52..ecb0133c3 100644 --- a/matitaB/matita/matitaweb.js +++ b/matitaB/matita/matitaweb.js @@ -194,6 +194,19 @@ function switch_goal(meta) } } +String.prototype.sescape = function() { + var patt1 = /%/gi; + var patt2 = /=/gi; + var patt3 = /&/gi; + var patt4 = /\+/gi; + var result = this; + result = result.replace(patt1,"%25"); + result = result.replace(patt2,"%3D"); + result = result.replace(patt3,"%26"); + result = result.replace(patt4,"%2B"); + return (result); +} + String.prototype.unescapeHTML = function() { var patt1 = //gi; @@ -279,7 +292,8 @@ function callServer(servicename,processResponse,reqbody) } } }; - req.open("POST", servicename); // + escape(unlocked.innerHTML), true); + req.open("POST", servicename); // + escape(unlocked.innerHTML), true); + req.setRequestHeader("Content-type","application/x-www-form-urlencoded"); if (reqbody) { req.send(reqbody); } else { @@ -312,7 +326,7 @@ function advanceForm1() resume(); }; pause(); - callServer("advance",processor,unlocked.innerHTML.unescapeHTML()); + callServer("advance",processor,"body=" + (unlocked.innerHTML.unescapeHTML()).sescape()); } @@ -340,7 +354,7 @@ function gotoBottom() resume(); }; pause(); - callServer("bottom",processor,unlocked.innerHTML.unescapeHTML()); + callServer("bottom",processor,"body=" + (unlocked.innerHTML.unescapeHTML()).sescape()); } @@ -380,7 +394,7 @@ function gotoPos(offset) } } pause(); - callServer("advance",processor,unlocked.innerHTML.unescapeHTML()); + callServer("advance",processor,"body=" + (unlocked.innerHTML.unescapeHTML()).sescape()); } function retract() @@ -419,7 +433,7 @@ function openFile() debug("file open failed"); } }; - callServer("open?file=" + escape(filename.value),processor); + callServer("open",processor,"file=" + escape(filename.value)); } var goalcell;