[Sie-announce] SIEコード [3038] a要素について、HTMLファイルへのリンクは、location . hrefを使わないように処理

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
2011年 10月 25日 (火) 23:43:21 JST


Revision: 3038
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=3038
Author:   dhrname
Date:     2011-10-25 23:43:21 +0900 (Tue, 25 Oct 2011)

Log Message:
-----------
a要素について、HTMLファイルへのリンクは、location.hrefを使わないように処理

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

Modified: branches/08x/088/org/w3c/dom/svg.js
===================================================================
--- branches/08x/088/org/w3c/dom/svg.js	2011-10-25 13:32:09 UTC (rev 3037)
+++ branches/08x/088/org/w3c/dom/svg.js	2011-10-25 14:43:21 UTC (rev 3038)
@@ -4863,47 +4863,45 @@
   this.addEventListener("DOMNodeInsertedIntoDocument", function(evt){
     var tar = evt.target;
     tar._tar.setAttribute("target", tar.target.baseVal);
-    tar = void 0;
-  }, false);
-  this.addEventListener("click", function(evt){
-    var tar = evt.target;
     if (tar.href.baseVal.indexOf(".svg") !== -1) { //もし、リンク先がSVGファイルならば
-      var sd = document.body,
-          ob, nd;
-      sd.lastChild.innerHTML = "<object data='" +tar.href.baseVal.split("#")[0]+ "' width='" +screen.width+ "' height='" +screen.height+ "' type='image/svg+xml'></object>";
-      if (tar.target.baseVal === "_self") {
-        nd = tar.ownerDocument._iframe;
-        nd.parentNode.insertBefore(sd.lastChild.firstChild, nd);
-        ob = nd.nextSibling;
-        if (ob && (ob.tagName === "OBJECT")) {
-          nd.previousSibling.setAttribute("width", ob.getAttribute("width"));
-          nd.previousSibling.setAttribute("height", ob.getAttribute("height"));
-          nd.parentNode.removeChild(ob);
-        }
-        ob = NAIBU._search([nd.previousSibling]);
-        nd.parentNode.removeChild(nd);
-      } else {
-        sd.appendChild(sd.lastChild.firstChild);
-        while (sd.firstChild !== sd.lastChild) {     //オブジェクト要素以外を除去
-          sd.removeChild(sd.firstChild);
-        }
-        ob = NAIBU._search([sd.lastChild]);
-      }
-      NAIBU.doc = new ActiveXObject("MSXML2.DomDocument");
-      evt.preventDefault();
-      ob._next = {
-        _init: (function (ob) {
-          return (function(){
-            document.title = ob.getSVGDocument().title;
-            ob = void 0;
-          });
-        })(ob)
-      };
-      ob._init();
-      sd = ob = nd = void 0;
-    } else {
-      location.href = tar.href.baseVal;
+      tar.addEventListener("click", function(evt){
+        var tar = evt.target;
+          var sd = document.body,
+              ob, nd;
+          sd.lastChild.innerHTML = "<object data='" +tar.href.baseVal.split("#")[0]+ "' width='" +screen.width+ "' height='" +screen.height+ "' type='image/svg+xml'></object>";
+          if (tar.target.baseVal === "_self") {
+            nd = tar.ownerDocument._iframe;
+            nd.parentNode.insertBefore(sd.lastChild.firstChild, nd);
+            ob = nd.nextSibling;
+            if (ob && (ob.tagName === "OBJECT")) {
+              nd.previousSibling.setAttribute("width", ob.getAttribute("width"));
+              nd.previousSibling.setAttribute("height", ob.getAttribute("height"));
+              nd.parentNode.removeChild(ob);
+            }
+            ob = NAIBU._search([nd.previousSibling]);
+            nd.parentNode.removeChild(nd);
+          } else {
+            sd.appendChild(sd.lastChild.firstChild);
+            while (sd.firstChild !== sd.lastChild) {     //オブジェクト要素以外を除去
+              sd.removeChild(sd.firstChild);
+            }
+            ob = NAIBU._search([sd.lastChild]);
+          }
+          NAIBU.doc = new ActiveXObject("MSXML2.DomDocument");
+          evt.preventDefault();
+          ob._next = {
+            _init: (function (ob) {
+              return (function(){
+                document.title = ob.getSVGDocument().title;
+                ob = void 0;
+              });
+            })(ob)
+          };
+          ob._init();
+          sd = ob = nd = void 0;
+      }, false);
     }
+    tar = void 0;
   }, false);
   SVGURIReference.apply(this, arguments);
   return this;




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