X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matitaB%2Fmatita%2Fmatitaweb.js;h=1088f51ce9047d3be85394ef4e565a7b8d653dc7;hb=7b1406845cc6a9885114c8be79224f2b0a17d700;hp=0cf29e3493241df078acf5bd79e4aaa73f67c2f2;hpb=98a02c0402c29eceb2c07b45ab2383983f13cc95;p=helm.git diff --git a/matitaB/matita/matitaweb.js b/matitaB/matita/matitaweb.js index 0cf29e349..1088f51ce 100644 --- a/matitaB/matita/matitaweb.js +++ b/matitaB/matita/matitaweb.js @@ -114,11 +114,19 @@ function keypress(e) pressmesg('keypress',e); var s = string_of_key(e.charCode); if (s == " ") { - i = unlocked.innerHTML.lastIndexOf('\\',getCursorPos()); + j = getCursorPos(); + i = unlocked.innerHTML.lastIndexOf('\\',j); if (i >= 0) { - window.alert("found " + unlocked.innerHTML.substring(i,getCursorPos())); + match = unlocked.innerHTML.substring(i,j); + pre = unlocked.innerHTML.substring(0,i-1); + post = unlocked.innerHTML.substring(j+1); + if (match == '\\to') { + unlocked.innerHTML = pre + "-> " + post; + return suppressdefault(e,true); + } + else return suppressdefault(e,false); } - return suppressdefault(e,true); + else return suppressdefault(e,false); } else { return suppressdefault(e,false); }