[Sie-announce] SIEコード [2105] 0. 62betaに対応させるよう、改良した

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 11月 1日 (月) 21:43:27 JST


Revision: 2105
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2105
Author:   dhrname
Date:     2010-11-01 21:43:27 +0900 (Mon, 01 Nov 2010)

Log Message:
-----------
0.62betaに対応させるよう、改良した

Modified Paths:
--------------
    trunk/svginhtml.js

Modified: trunk/svginhtml.js
===================================================================
--- trunk/svginhtml.js	2010-10-31 13:57:41 UTC (rev 2104)
+++ trunk/svginhtml.js	2010-11-01 12:43:27 UTC (rev 2105)
@@ -41,31 +41,40 @@
     }
   }
   if (navigator.userAgent.indexOf('WebKit') > -1 || navigator.userAgent.indexOf('Safari') > -1) { //WebKit系ならば、Ajaxを使って自分自身のページを再読み込み
-    getURL(document.location.href, _webkit_wo, [{style:{display:""}}], 1);
+    var xmlhttp = new XMLHttpRequest();
+    xmlhttp.open("GET", document.location.href, true);
+    xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+    xmlhttp.onreadystatechange = function() {
+      if ((xmlhttp.readyState === 4) && (xmlhttp.status === 200)) {
+        _webkit_wo(xmlhttp.responseText);
+      }
+    };
+    xmlhttp.send(null);
     return;
   }
   document.getElementById("hogehoge").innerHTML = source;
   var isOpera = (window.opera !== void 0); //Operaだったらtrueを返す
   if (isOpera){
-    svgtovml();
+    NAIBU._main();
   }
 };
-function _webkit_wo(data) {
-  if (data.success) {
-    var source = "";
-    source = data.content.replace(/<svg[^>]*/g, (function(s) {
-                s = s.replace(/xmlns(\:xlink)?=["'][^"']+?["']/g, "").replace(/<svg/, "");
-                s = '<script type="image/svg+xml"' +s+ '><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ' +s;
-                return s;
-             }))
-             .replace(/<\/svg>/g, "</svg></script>")
-             .replace(/<\/(body|html)>/g, "");
-    var n = source.indexOf("svginhtml.js");
-    source = source.substring(n+24, source.length-1);
-    document.getElementById("hogehoge").innerHTML = source;
-    svgtovml();
-  }
+function _webkit_wo(content) {
+  var source = "";
+  source = content.replace(/<svg[^>]*/g, (function(s) {
+              s = s.replace(/xmlns(\:xlink)?=["'][^"']+?["']/g, "").replace(/<svg/, "");
+              s = '<script type="image/svg+xml"' +s+ '><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ' +s;
+              return s;
+           }))
+           .replace(/<\/svg>/g, "</svg></script>")
+           .replace(/<\/(body|html)>/g, "");
+  alert(source);
+  var n = source.indexOf("svginhtml.js");
+  source = source.substring(n+24, source.length-1);
+  document.getElementById("hogehoge").innerHTML = source;
+  NAIBU._main();
 };
-window.onload = _wo;
-document.write('<div id="hogehoge"></div>');
-document.write('<script type="text/svg"><p style="display:none;">n</p>'); //p要素を入れておかないとIE8でバグ
\ No newline at end of file
+if (navigator.userAgent.indexOf('Chrome') === -1) { //WebKit系ならば、Ajaxを使って自分自身のページを再読み込み
+  window.onload = _wo;
+  document.write('<div id="hogehoge"></div>');
+  document.write('<script type="text/svg"><p style="display:none;">n</p>');
+}
\ No newline at end of file




Sie-announce メーリングリストの案内
Back to archive index