/[suikacvs]/markup/html/html5/spec-ja/ja-script.js
Suika

Diff of /markup/html/html5/spec-ja/ja-script.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by wakaba, Sun Oct 26 09:26:56 2008 UTC revision 1.4 by wakaba, Sun Oct 26 10:10:54 2008 UTC
# Line 6  window.addEventListener ('load', functio Line 6  window.addEventListener ('load', functio
6    req.onreadystatechange = function () {    req.onreadystatechange = function () {
7      if (req.readyState == 4) {      if (req.readyState == 4) {
8        if (req.status >= 200 && req.status < 400) {        if (req.status >= 200 && req.status < 400) {
9          var updates = eval ('(' + req.responseText + ')');          applyJaUpdates (eval ('(' + req.responseText + ')'));
         for (var hash in updates) {  
           if (document.jaHashes[hash]) {  
             for (var i in document.jaHashes[hash]) {  
               applyJaEntry (document.jaHashes[hash][i], updates[hash]);  
             }  
           }  
           if (document.jaRealHashes[hash]) {  
             for (var i in document.jaRealHashes[hash]) {  
               applyJaEntry (document.jaRealHashes[hash][i], updates[hash]);  
             }  
           }  
         }  
10        }        }
11      }      }
12    }; // onreadystatechange    }; // onreadystatechange
# Line 122  function insertJaForm (targetNode) { Line 110  function insertJaForm (targetNode) {
110          form.getElementsByTagName ('output')[0].firstChild.data          form.getElementsByTagName ('output')[0].firstChild.data
111              = 'Save: ' + req.status + ' ' + req.statusText;              = 'Save: ' + req.status + ' ' + req.statusText;
112          if (req.status >= 200 && req.status < 400) {          if (req.status >= 200 && req.status < 400) {
           applyJaEntry (targetNode, {ja: ta[1].value, isPattern: isPattern});  
113            targetNode.jaForm = null;            targetNode.jaForm = null;
114            form.parentNode.removeChild (form);            form.parentNode.removeChild (form);
115              applyJaUpdates (eval ('(' + req.responseText + ')'));
116          }          }
117        }        }
118      }; // onreadystatechange      }; // onreadystatechange
# Line 190  function insertInterfaceElement (inserte Line 178  function insertInterfaceElement (inserte
178    parent.insertBefore (insertedElement, prev.nextSibling);    parent.insertBefore (insertedElement, prev.nextSibling);
179  } // insertInterfaceElement  } // insertInterfaceElement
180    
181    function applyJaUpdates (updates) {
182    document.newEntries =updates;
183      for (var hash in updates) {
184        if (document.jaHashes[hash]) {
185          for (var i in document.jaHashes[hash]) {
186            applyJaEntry (document.jaHashes[hash][i], updates[hash]);
187          }
188        }
189        if (document.jaRealHashes[hash]) {
190          for (var i in document.jaRealHashes[hash]) {
191            applyJaEntry (document.jaRealHashes[hash][i], updates[hash]);
192          }
193        }
194      }
195    } // applyJaUpdates
196    
197  function applyJaEntry (targetNode, entry) {  function applyJaEntry (targetNode, entry) {
198    if (entry.isPattern) {    if (entry.isPattern) {
199      targetNode.className += ' ja-not-patched';      targetNode.className += ' ja-not-patched';

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24