[Sie-announce] SIEコード [2832] NAIBU. _mainの軽量化

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
2011年 7月 13日 (水) 23:40:04 JST


Revision: 2832
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2832
Author:   dhrname
Date:     2011-07-13 23:40:04 +0900 (Wed, 13 Jul 2011)

Log Message:
-----------
NAIBU._mainの軽量化

Modified Paths:
--------------
    branches/08x/082/org/w3c/dom/svg.js

Modified: branches/08x/082/org/w3c/dom/svg.js
===================================================================
--- branches/08x/082/org/w3c/dom/svg.js	2011-07-12 12:04:29 UTC (rev 2831)
+++ branches/08x/082/org/w3c/dom/svg.js	2011-07-13 14:40:04 UTC (rev 2832)
@@ -6213,10 +6213,11 @@
   }
   var ary = document.getElementsByTagName("script");
   //全script要素をチェックして、type属性がimage/svg+xmlならば、中身をSVGとして処理する
-  for (var i=0; i < ary.length; ++i) {
-    var hoge = ary[i].type;
-    if (ary[i].type === "image/svg+xml") {
-      var ait = ary[i].text;
+  for (var i=0; ary[i]; ++i) {
+    var ai = ary[i],
+        hoge = ai.type;
+    if (ai.type === "image/svg+xml") {
+      var ait = ai.text;
       if (sieb_s && ait.match(/&lt;svg/)) {
         //ソース内のタグを除去
         ait = ait.replace(/<.+?>/g, "");
@@ -6224,7 +6225,7 @@
         ait = ait.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&amp;/g, "&");
       }
       if (NAIBU.isMSIE) {
-        var gsd = new GetSVGDocument(ary[i]);
+        var gsd = new GetSVGDocument(ai);
         gsd.xmlhttp = {
           readyState : 4,
           status : 200,
@@ -6234,10 +6235,10 @@
       } else {
         var base = location.href.replace(/\/[^\/]+?$/,"/"); //URIの最後尾にあるファイル名は消す。例: /n/sie.js -> /n/
         ait = ait.replace(/\shref=(['"a-z]+?):\/\//g, " target='_top' xlink:href=$1://").replace(/\shref=(.)/g, " target='_top' xlink:href=$1"+base);
-        var s = NAIBU.textToSVG(ait,ary[i].getAttribute("width"),ary[i].getAttribute("height"));
-        ary[i].parentNode.insertBefore(s,ary[i]);
+        var s = NAIBU.textToSVG(ait,ai.getAttribute("width"),ai.getAttribute("height"));
+        ai.parentNode.insertBefore(s,ai);
       }
-      ait = null;
+      ai = ait = null;
     }
     hoge = null;
   }




Sie-announce メーリングリストの案内
Zurück zum Archiv-Index