]> matita.cs.unibo.it Git - helm.git/blobdiff - matitaB/matita/matitaweb.js
Matitaweb: changes to file selection dialog box.
[helm.git] / matitaB / matita / matitaweb.js
index 07dbb06f68c7ce6717b442fbc1c716551caff28f..c0b9458425ccde715e620507f978bb74b9de3b1b 100644 (file)
@@ -178,7 +178,8 @@ function debug(txt)
         // internet explorer (v.9) doesn't work with innerHTML
        // but google chrome's innerText is, in a sense, "write only"
        // what should we do?
-        logarea.innerText = txt + "\n" + logarea.innerText;
+        // logarea.innerText = txt + "\n" + logarea.innerText;
+        logarea.innerHTML = txt; // + "\n" + logarea.innerText;
 }
 
 function listhd(l)
@@ -507,7 +508,9 @@ function gotoBottom()
                        if (len > 0) {
                          // len0 = unlocked.innerHTML.length;
                          unescaped = unlocked.innerHTML.html_to_matita();
-                         parsedtxt = parsed.childNodes[0].nodeValue;
+                          // not working in mozilla
+                         // parsedtxt = parsed.childNodes[0].nodeValue;
+                         parsedtxt = parsed.childNodes[0].wholeText;
                          //parsedtxt = unescaped.substr(0,len); 
                          unparsedtxt = unescaped.substr(len);
                          lockedbackup += parsedtxt;
@@ -611,7 +614,7 @@ function openFile()
                if (is_defined(xml)) {  
                        lockedbackup = "";
                        locked.innerHTML = lockedbackup;
-                       unlocked.innerHTML = xml.documentElement.textContent;
+                       unlocked.innerHTML = xml.documentElement.wholeText;
                } else {
                        debug("file open failed");
                }
@@ -626,8 +629,11 @@ function retrieveFile(thefile)
                if (is_defined(xml)) {  
                        lockedbackup = ""
                        locked.innerHTML = lockedbackup;
-                       debug(xml.getElementsByTagName("file")[0].childNodes[0].nodeValue);
-                       unlocked.innerHTML = xml.getElementsByTagName("file")[0].childNodes[0].nodeValue;
+                        // code originally used in google chrome (problems with mozilla)
+                       // debug(xml.getElementsByTagName("file")[0].childNodes[0].nodeValue);
+                       // unlocked.innerHTML = xml.getElementsByTagName("file")[0].childNodes[0].nodeValue;
+                       debug(xml.childNodes[0].textContent);
+                       unlocked.innerHTML = xml.childNodes[0].textContent;
 
                } else {
                        debug("file open failed");