1 <!xml version="1.0" encoding="utf-8"!>
\r
2 <html xmlns="http://www.w3.org/1999/xhtml">
\r
4 <title>Sieb:SIEのブックマークレット</title>
\r
5 <meta http-equiv="Content-Type" content="text/html; charset=urf-8">
\r
6 <link rel="stylesheet" type="text/css" href="instyle.css"></link>
\r
9 <h1>Sieb - ブラウザでSVGを表示できるブックマークレット</h1>
\r
11 <p>SIEを使えば、普通の文章をSVG画像に変換して、表示することができます。このような機能をText2SVGと呼ぶことにします。Siebでは、このText2SVG機能を使って、たとえば、2ちゃんねるのような掲示板やブログやWIKIなどに書き込まれたSVGを簡単に表示できるようにしました。特徴は以下のとおりです。</p>
\r
13 <li>インストール、プラグイン不要</li>
\r
14 <li>ブックマークから呼び出せる</li>
\r
16 <li>ブログ、WIKIなどに書き込まれたSVGソースを、画像として表示できる</li>
\r
21 <p><a href="javascript:void(function(){var ss=function(tag){var pr=document.getElementsByTagName(tag);for(var i=0;i<pr.length;i++){var prr=pr[i].innerHTML;prr=prr.replace(/(&lt;svg(?:\s|&gt;|>))/g,'&nbsp;<script type=image/svg+xml width=300 height=300>$1').replace(/(\/svg(?:&gt;|>))/g,'$1</script>');pr[i].innerHTML=prr;}};ss('pre');ss('dd');sieb_s=true;var src=document.createElement('script');src.setAttribute('src','http://sie.sourceforge.jp/sie-mini.js');document.body.appendChild(src);})();">Sieb2</a>(ブックマークレット)</p>
\r
22 <p>あらかじめ、上記のリンク先をブックマーク(IEでは、「右クリック->お気に入りに追加」。それ以外のブラウザではツールバーにドラッグでOK)してください。</p>
\r
25 <li>掲示板やブログにSVGのソースを必ず「整形テキスト」で書き込んでください。たとえば、以下のSVGのソースを使ってみましょう。<textarea rows="3" cols="70"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preseveAspectRatio="none">
\r
27 <circle cx="50" cy="40" r="40"/>
\r
28 <circle cx="40" cy="30" r="20" fill="red"/>
\r
30 </svg></textarea>なお、整形テキストはpre要素を利用した文章です。</li>
\r
31 <li>上記でブックマークしたものを呼び出してください。ブックマークを呼び出したら、すぐに、下記のデモで円が表示されるはずです。</li>
\r
33 <h2>デモ(4wd.svg)</h2>
\r
36 <dd><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preseveAspectRatio="none">
\r
38 <circle cx="50" cy="40" r="40"/><BR>
\r
39 <circle cx="40" cy="30" r="20" fill="red"/>
\r
44 <svg xmlns="<a href="http://www.w3.org/2000/svg" target="_blank">http://www.w3.org/2000/svg</a>" viewBox="0 0 100 100" preseveAspectRatio="none">
\r
45 &lt;<g id="eo">
\r
46 <circle cx="50" cy="40" r="40"/>
\r
47 <circle cx="40" cy="30" r="20" fill="red"/>
\r
51 <p>HTML文書のソースは以下のとおり。</p>
\r
52 <pre><html xmlns="http://www.w3.org/1999/xhtml">
\r
54 <title>SIE</title>
\r
55 <script defer="defer" type="text/javascript" src="sie.js"></script>
\r
56 <link rel="stylesheet" type="text/css" href="instyle.css"></link>
\r
59 <h1>SIE - プラグインなしでIEにSVGを表示する方法</h1>
\r
60 <h2>デモ(ant.svg)</h2>
\r
62 <p><pre>&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preseveAspectRatio="none"&gt;
\r
63 &lt;g id="eo"&gt;
\r
64 &lt;circle cx="50" cy="40" r="40"/&gt;
\r
65 &lt;circle cx="40" cy="30" r="20" fill="red"/&gt;
\r
67 &lt;/svg&gt;</pre></p>
\r
71 <script type="image/svg+xml" width="200" height="200"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preseveAspectRatio="none">
\r
73 <circle cx="50" cy="40" r="40"/>
\r
74 <circle cx="40" cy="30" r="20" fill="red"/>
\r
78 <p>WindowsXP SP2 IE7で確認</p>
\r
79 <p>その他、Windows XPの、Firefox3、Opera9.51、Safari3.1.2</p>
\r
81 <p>Inkscapeで作成されたSVGを表示できるようにする。</p>
\r
83 <p>バージョンや、問題等につきましては、ブログで公開しています。「<a href="http://d.hatena.ne.jp/dhrname/">dhrnameのウェブ日誌</a>」をご覧ください。</p>
\r
84 <p>最後に、<a href="http://sourceforge.jp/"><img src="http://sourceforge.jp/sflogo.php?group_id=3313" width="96" height="31" border="0" alt="SourceForge.jp"></a>さんに謝意を述べたいと思います。</p>
\r
85 <address>© Copyright 2003 dhr(Eメールで<a href="mailto:dhrname@mail.goo.ne.jp">dhrname@mail.goo.ne.jp</a>)コードの著作権の許諾に関しては、次の文章に書かれています。(英文<a href="http://dhr.at.infoseek.co.jp/LICENCE.txt">LICENCE.txt</a>)。このページの許諾に関しても、同様のライセンスが適用されるものとします。</address>
\r
86 <!--/*SIE-SVGtoVML LGPL2.1 & GPL1.1 & Mozilla Public Lisence*/
\r
87 /* ***** BEGIN LICENSE BLOCK *****
\r
88 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
\r
90 * The contents of this file are subject to the Mozilla Public License Version
\r
91 * 1.1 (the "License"); you may not use this file except in compliance with
\r
92 * the License. You may obtain a copy of the License at
\r
93 * http://www.mozilla.org/MPL/
\r
95 * Software distributed under the License is distributed on an "AS IS" basis,
\r
96 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
\r
97 * for the specific language governing rights and limitations under the
\r
100 * Contributor(s):DHRNAME
\r
102 * Alternatively, the contents of this file may be used under the terms of
\r
103 * either of the GNU General Public License Version 2 or later (the "GPL"),
\r
104 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
\r
105 * in which case the provisions of the GPL or the LGPL are applicable instead
\r
106 * of those above. If you wish to allow use of your version of this file only
\r
107 * under the terms of either the GPL or the LGPL, and not to allow others to
\r
108 * use your version of this file under the terms of the MPL, indicate your
\r
109 * decision by deleting the provisions above and replace them with the notice
\r
110 * and other provisions required by the GPL or the LGPL. If you do not delete
\r
111 * the provisions above, a recipient may use your version of this file under
\r
112 * the terms of any one of the MPL, the GPL or the LGPL.
\r
114 * ***** END LICENSE BLOCK ***** */-->
\r