diff options
| author | teramako | 2013-04-10 22:14:28 +0900 | 
|---|---|---|
| committer | teramako | 2013-04-10 22:14:28 +0900 | 
| commit | 596ae3e9f228d34891f8e52225205e78371b4828 (patch) | |
| tree | 3e8338fb8c47c07be169a227a5112bab78b7ceba | |
| parent | 004f9e2fd284912c3b70401310e118493c7fa8d3 (diff) | |
| parent | 8eb425bbdb21e37603603db84d444c90a2d30fb5 (diff) | |
| download | vimperator-plugins-596ae3e9f228d34891f8e52225205e78371b4828.tar.bz2 | |
Merge branch '3.6'
185 files changed, 1009 insertions, 1108 deletions
| @@ -33,26 +33,24 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> -  <plugin name="PDF.js.js" version="1.0.0" -          href="http://vimpr.github.com/" -          summary="PDF.js controller." -          lang="en-US" -          xmlns="http://vimperator.org/namespaces/liberator"> -    <author email="anekos@snca.net">anekos</author> -    <license>New BSD License</license> -    <project name="Vimperator" minVersion="3.0"/> -    <p></p> -    <item> -      <tags>:pdfjs-mapping-sample</tags> -      <description><p>mapping sample</p><code><![CDATA[ -        nnoremap -urls ^\\.pdf$ i :<C-u>pdfjs index<Space> -        nnoremap -urls ^\\.pdf$ z :<C-u>pdfjs zoom<Space> -      ]]></code></description> -    </item> -  </plugin> -</>; +let INFO = xml` +<plugin name="PDF.js.js" version="1.0.0" +        href="http://vimpr.github.com/" +        summary="PDF.js controller." +        lang="en-US" +        xmlns="http://vimperator.org/namespaces/liberator"> +  <author email="anekos@snca.net">anekos</author> +  <license>New BSD License</license> +  <project name="Vimperator" minVersion="3.0"/> +  <p></p> +  <item> +    <tags>:pdfjs-mapping-sample</tags> +    <description><p>mapping sample</p><code><![CDATA[ +      nnoremap -urls ^\\.pdf$ i :<C-u>pdfjs index<Space> +      nnoremap -urls ^\\.pdf$ z :<C-u>pdfjs zoom<Space> +    ]]></code></description> +  </item> +</plugin>`;  // }}}  (function () { @@ -206,9 +204,9 @@ let INFO =                function desc (o) {                  const PageRE = /#page=(\d+)\&/;                  if (o.href && PageRE.test(o.href)) { -                  return String(<>{nSpace(getOutlineLevel(o))} {o.textContent} (p{o.href.match(PageRE)[1]})</>); +                  return `${nSpace(getOutlineLevel(o))} ${o.textContent} (p${o.href.match(PageRE)[1]})`;                  } else { -                  return String(<>{nSpace(getOutlineLevel(o))} {o.textContent}</>); +                  return `${nSpace(getOutlineLevel(o))} ${o.textContent}`;                  }                } diff --git a/PMWriter.js b/PMWriter.js index a4fc95c..aa3099a 100644 --- a/PMWriter.js +++ b/PMWriter.js @@ -81,13 +81,13 @@      }      function concatXML (xmls) { -      let result = <></>; +      let result = ``;        xmls.forEach(function (xml) result += xml);        return result;      }      function langList (info, name) { -      let result = <></>; +      let result = ``;        let i = info.length();        while (i-- > 0) {          if (info[i].@lang.toString()) { @@ -124,7 +124,7 @@        if (!tag)          tag = 'div'; -      let result = <></>; +      let result = ``;        for (let i = 0, l = info.length(); i < l; i++) {          let it = info[i]; @@ -146,8 +146,8 @@      };      let files = io.File(pluginDirPath).readDirectory(); -    let indexHtml = <></>; -    let allHtml = <></>; +    let indexHtml = ``; +    let allHtml = ``;      let pminfos = [];      files.forEach(function (file) { @@ -236,7 +236,7 @@                                     true,                                     function (it) (it.toString()) || '---') -          let versionsBody = <></>; +          let versionsBody = ``;            VERSIONS.forEach(function (ver) {              let url = CodeReposBranch + ver + '/' + pluginFilename; @@ -245,17 +245,17 @@              file.append(ver);              file.append(pluginFilename);              versionsBody += -              <> +              `                  <dt>{'for ' + ver}</dt> -                {file.exists() ?  <a href={url} class="coderepos" target="_blank">{url}</a> : <>not supported</>} -              </>; +                {file.exists() ?  <a href={url} class="coderepos" target="_blank">{url}</a> : `not supported`} +              `;            });            versionsBody += -            <> +            `                <dt>{'for Nightly'}</dt>                <a href={CodeRepos + pluginFilename} class="coderepos" target="_blank">{CodeRepos + pluginFilename}</a> -            </>; +            `;  //                      <dt>Vimperator version</dt> @@ -6,7 +6,8 @@      http://www.opensource.jp/licenses/mit-license.html  }}}  END LICENSE BLOCK ***/  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +/* +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>libly(filename _libly.js)</name>      <description>Vimperator plugins library?</description> @@ -130,7 +131,7 @@ Request(url, headers, options):          以下の値はデフォルトで設定される('Content-type'はPOST時のみ)          >||          { -            'Accept': 'text/javascript, application/javascript, text/html, application/xhtml+xml, application/xml, text/xml, */*;q=0.1', +            'Accept': 'text/javascript, application/javascript, text/html, application/xhtml+xml, application/xml, text/xml, * /*;q=0.1',              'Content-type': 'application/x-www-form-urlencoded; charset=' + options.encodingの値          }          ||< @@ -189,7 +190,8 @@ clearCache:    wedata 読込み成功したら、強制的にキャッシュと置き換えるの作って!      ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`; +*/  //}}}  //if (!liberator.plugins.libly) { @@ -463,21 +465,7 @@ libly.$U = {//{{{      },      xmlToDom: function xmlToDom(node, doc, nodes)      { -        XML.prettyPrinting = false; -        switch (node.nodeKind()) -        { -            case "text": -                return doc.createTextNode(node); -            case "element": -                let domnode = doc.createElementNS(node.namespace(), node.localName()); -                for each (let attr in node.@*) -                    domnode.setAttributeNS(attr.name() == "highlight" ? NS.uri : attr.namespace(), attr.name(), String(attr)); -                for each (let child in node.*) -                    domnode.appendChild(arguments.callee(child, doc, nodes)); -                if (nodes && node.@key) -                    nodes[node.@key] = domnode; -                return domnode; -        } +        return util.xmlToDom(node, doc, nodes);      },      getElementPosition: function(elem) {          var offsetTrail = elem; diff --git a/_smooziee.js b/_smooziee.js index 36df3f5..ae4915c 100644 --- a/_smooziee.js +++ b/_smooziee.js @@ -8,84 +8,74 @@  //     http://www.opensource.jp/licenses/mit-license.html  // }}}  // -// PLUGIN INFO: {{{ -var PLUGIN_INFO = -<VimperatorPlugin> -  <name>smooziee</name> -  <description>At j,k key scrolling to be smooth.</description> -  <description lang="ja">j,kキーでのスクロールをスムースに</description> -  <minVersion>2.3pre</minVersion> -  <maxVersion>2.3</maxVersion> -  <updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/_smooziee.js</updateURL> -  <author mail="snaka.gml@gmail.com" homepage="http://vimperator.g.hatena.ne.jp/snaka72/">snaka</author> +// INFO: {{{ +var INFO = xml` +<plugin name="smooziee" version="0.10.2" +        href="https://github.com/vimpr/vimperator-plugins/raw/master/_smooziee.js" +        summary="j,kキーでのスクロールをスムースに" +        lang="en_US" +        xmlns="http://vimperator.org/namespaces/liberator"> +  <author email="snaka.gml@gmail.com" homepage="http://vimperator.g.hatena.ne.jp/snaka72/">snaka</author> +  <project name="Vimperator" minVersion="3.6"/>    <license>MIT style license</license> -  <version>0.10.2</version> -  <detail><![CDATA[ -    == Subject == -    j,k key scrolling to be smoothly. - -    == Global variables == -    You can configure following variable as you like. -    :smooziee_scroll_amount: Scrolling amount(unit:px). Default value is 400px. -    :smooziee_interval: Scrolling interval(unit:ms). Default value is 20ms. - -    === Excample === -    Set scroll amount is 300px and interval is 10ms. -    >|| +  <p>j,k key scrolling to be smoothly.</p> +  <h3 tag="smooziee_global_variables">Global vriables</h3> +  <p>You can configure following variable as you like.</p> +  <dl> +    <dt>smooziee_scroll_amount</dt><dd>Scrolling amount(unit:px). Default value is 400px.</dd> +    <dt>smooziee_interval</dt><dd>Scrolling interval(unit:ms). Default value is 20ms.</dd> +  </dl> +  <h3 tag="smooziee_example">Example</h3> +  <p>Set scroll amount is 300px and interval is 10ms.</p> +  <code><ex><![CDATA[      let g:smooziee_scroll_amount="300"      let g:smooziee_scroll_interval="10" -    ||< - -    == API == -    >|| -    smooziee.smoothScrollBy(amount); -    ||< -    Example. -    >|| +  ]]></ex></code> +  <h3 tag="smooziee_API">API</h3> +  <code>smooziee.smoothScrollBy(amount);</code> +  <p>Example</p> +  <code><ex><![CDATA[      :js liberator.plugins.smooziee.smoothScrollBy(600)      :js liberator.plugins.smooziee.smoothScrollBy(-600) -    ||< - -    == ToDo == - -  ]]></detail> - -  <detail lang="ja"><![CDATA[ -    == 概要 == -    普段のj,kキーのスクロールをLDRizeライクにスムースにします。 - -    == グローバル変数 == -    以下の変数を.vimperatorrcなどで設定することで動作を調整することができます。 -    :smooziee_scroll_amount: -      1回にスクロールする幅です(単位:ピクセル)。デフォルトは"400"です。 -    :smooziee_interval: -      スクロール時のアニメーションのインターバルです(単位:ミリ秒)。 -      "1"以上の値を設定します。デフォルトは"20"です。 -    === 設定例 === -    スクロール量を300pxに、インターバルを10msに設定します。 -    >|| +  ]]></ex></code> +</plugin> +<plugin name="smooziee" version="0.10.2" +        href="https://github.com/vimpr/vimperator-plugins/raw/master/_smooziee.js" +        summary="j,kキーでのスクロールをスムースに" +        lang="ja" +        xmlns="http://vimperator.org/namespaces/liberator"> +  <author email="snaka.gml@gmail.com" homepage="http://vimperator.g.hatena.ne.jp/snaka72/">snaka</author> +  <project name="Vimperator" minVersion="3.6"/> +  <license>MIT style license</license> +  <p>普段のj,kキーのスクロールをLDRizeライクにスムースにします。</p> +  <h3 tag="smooziee_global_variables">グローバル変数</h3> +  <p>以下の変数を.vimperatorrcなどで設定することで動作を調整することができます。</p> +  <dl> +    <dt>smooziee_scroll_amount</dt> +    <dd>1回にスクロールする幅です(単位:ピクセル)。デフォルトは"400"です。</dd> +    <dt>smooziee_interval</dt> +    <dd>スクロール時のアニメーションのインターバルです(単位:ミリ秒)。 +      "1"以上の値を設定します。デフォルトは"20"です。</dd> +  </dl> +  <h3 tag="smooziee_example">設定例</h3> +  <p>スクロール量を300pxに、インターバルを10msに設定します。</p> +  <code><ex><![CDATA[      let g:smooziee_scroll_amount="300"      let g:smooziee_scroll_interval="10" -    ||< - -    == API == -    他のキーにマップする場合やスクリプトから呼び出せるようAPIを用意してます。 -    >|| -    smooziee.smoothScrollBy(amount); -    ||< -    amountにはスクロール量(ピクセル)を指定してください。正の値で下方向へ負の値で上方向へスクロールします。 - -    Example. -    >|| +  ]]></ex></code> +  <h3 tag="smooziee_API">API</h3> +  <p>他のキーにマップする場合やスクリプトから呼び出せるようAPIを用意してます。</p> +  <code>smooziee.smoothScrollBy(amount);</code> +  <p>Example</p> +  <code><ex><![CDATA[      :js liberator.plugins.smooziee.smoothScrollBy(600)      :js liberator.plugins.smooziee.smoothScrollBy(-600) -    ||< - -    == ToDo == -    - 読み込みの順番によっては他のプラグインと競合する可能性があるのをなんとかしたい。 - -  ]]></detail> -</VimperatorPlugin>; +  ]]></ex></code> +  <h3 tag="soomziee_ToDo">ToDo</h3> +  <ul> +    <li>読み込みの順番によっては他のプラグインと競合する可能性があるのをなんとかしたい。</li> +  </ul> +</plugin>`;  // }}}  let self = liberator.plugins.smooziee = (function(){ diff --git a/access_hatena.js b/access_hatena.js index b291b02..a8945e0 100644 --- a/access_hatena.js +++ b/access_hatena.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Access to Hatena Sevices quickly.</description> @@ -46,7 +46,7 @@ map ; :accesshatena  # 最後にスペースを入れておくと直ぐにホストの入力から始められます.  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function(){      var useWedata;      var ignoreIds; diff --git a/account_switcher.js b/account_switcher.js index 4ad1caa..5678759 100644 --- a/account_switcher.js +++ b/account_switcher.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Switch account easily.</description> @@ -50,7 +50,7 @@ liberator.accountSwitcherOpenNewTab = 1;  ||<  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function(){      var services = [];      var accounts = []; @@ -180,7 +180,7 @@ liberator.accountSwitcherOpenNewTab = 1;                      if (value.indexOf('=') > 0) {                          params.push(value);                      } else { -                        res.responseText.match(new RegExp('<([^<>]*?name=\"' + value + '\"[^<>]*?)>')); +                        res.responseText.match(new RegExp('<([^`]*?name=\"' + value + '\"[^`]*?)>'));                          RegExp.$1.match(/value=\"([\w-]+)\"/);                          params.push(value + '=' + encodeURIComponent(RegExp.$1));                      } diff --git a/adddialog.js b/adddialog.js index 6911e47..0bc3151 100644 --- a/adddialog.js +++ b/adddialog.js @@ -33,7 +33,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN  THE SOFTWARE.     }}} */ -let PLUGIN_INFO = // {{{ +let PLUGIN_INFO = xml` // {{{  <VimperatorPlugin>  <name>{NAME}</name>  <description>Add/Delete a :dialog argument.</description> @@ -62,7 +62,7 @@ let PLUGIN_INFO = // {{{  :deldialog gmmanage  ||<  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  /// }}}  liberator.plugins.adddialog = (function(args) { // {{{ diff --git a/addhatebu.js b/addhatebu.js index 93a6ef0..77cb14a 100644 --- a/addhatebu.js +++ b/addhatebu.js @@ -1,5 +1,5 @@ -// INFO // -var INFO = +// {{{ INFO +var INFO =xml`  <plugin name="addhatebu.js" version="0.2"          summary="Add Hatena Bookmark"          href="http://github.com/vimpr/vimperator-plugins/blob/master/addhatebu.js" @@ -15,7 +15,8 @@ var INFO =        <p>Add Hatena Bookmark</p>      </description>    </item> -</plugin>; +</plugin>`; +// }}}  commands.addUserCommand(    ['addhatebu'], @@ -7,7 +7,7 @@  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Alert</name>    <name lang="ja">アラート</name> @@ -48,7 +48,7 @@ let PLUGIN_INFO =        JavaScriptでSLを走らせる「SL.JS」を作りました ::: creazy photograph        http://creazy.net/2008/02/sl_js.html    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { @@ -388,14 +388,14 @@ let PLUGIN_INFO =        let sleep = parseFloat(arg || 3) * 1000;        let sz = innerWidth / msg.length / 1.5;        liberator.echo( -        <div style="background: white; color: black;"> +        xml`<div style="background: white; color: black;">            <table>              <tr>                <td><img src={gunsou}/></td>                <td style={"font-size: " + sz + "px; white-space: nowrap;"}>{msg}</td>              </tr>            </table> -        </div> +        </div>`        );        setTimeout(next, sleep);      }, @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>alias</name>    <name lang="ja">alias</name> @@ -54,11 +54,10 @@ let PLUGIN_INFO =      :alias <new-command-name> <old-command-name>:        コマンド <old-command-name> に <new-command-name> という別名をつけます。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="alias" version="1.0.0"            href="http://github.com/vimpr/vimperator-plugins/blob/master/alias.js"            summary="Define the alias for a command." @@ -107,7 +106,7 @@ let INFO =  :lazy alias newName oldCommandName      </ex></code>    </plugin> -</>; +`;  // }}} diff --git a/amazon_simple_uri.js b/amazon_simple_uri.js index 34b4e6e..e21c79a 100644 --- a/amazon_simple_uri.js +++ b/amazon_simple_uri.js @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>amazon_simple_uri</name>    <description>Copy Amazon Simple URI.</description> @@ -19,7 +19,7 @@ var PLUGIN_INFO =  と設定することにより、Amazon アソシエイトID(上の例ではhogehoge-22)をURLに追加します。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  //  (function() diff --git a/amebanow.js b/amebanow.js index 3f06aa1..fd2b7be 100644 --- a/amebanow.js +++ b/amebanow.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>AmebaNau</name>    <name lang="ja">Amebaなう</name> @@ -55,10 +55,10 @@ let PLUGIN_INFO =          let g:amebanow_multipost = "twitter|wassr"        ||<    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = +let INFO = xml`  <plugin name="AmebaNow" version="1.0.4"          href="http://github.com/vimpr/vimperator-plugins/blob/master/amebanow.js"          summary="AmebaNau" @@ -77,7 +77,7 @@ let INFO =        </p>      </description>    </item> -</plugin>; +</plugin>`;  // }}} diff --git a/appendAnchor.js b/appendAnchor.js index 8ca02a2..d5f7935 100644 --- a/appendAnchor.js +++ b/appendAnchor.js @@ -1,4 +1,4 @@ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>appendAnchor</name>    <description>append anchors to texts look like url.</description> @@ -27,7 +27,7 @@ let PLUGIN_INFO =        g:auto_append_anchor_once:          最初の一回だけ。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function(){ @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>show application information</description> @@ -15,7 +15,7 @@ appinfo [information]:      echo and copy mozilla information       ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function() { diff --git a/applauncher.js b/applauncher.js index 09b9f83..146a46b 100644 --- a/applauncher.js +++ b/applauncher.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>AppLauncher</name>    <name lang='ja'>アプリケーションランチャー</name> @@ -30,7 +30,7 @@ var PLUGIN_INFO =      引数を複数指定する場合は配列形式で指定してください。      applauncher_charset を指定すると、渡される文字列が指定の文字セットに変換されます。    ]]></detail> -</VimperatorPlugin> +</VimperatorPlugin>`;  liberator.plugins.AppLauncher = (function(){    const UConv = Cc['@mozilla.org/intl/scriptableunicodeconverter'].getService(Ci.nsIScriptableUnicodeConverter); diff --git a/asdfghjkl.js b/asdfghjkl.js index 361c33c..1f48516 100644 --- a/asdfghjkl.js +++ b/asdfghjkl.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>asdfghjkl;</name>    <description>Inputting numbers by asdfghjkl; keys in hint mode.</description> @@ -85,7 +85,7 @@ let PLUGIN_INFO =      == Link ==        http://d.hatena.ne.jp/nokturnalmortum/20081021#1224543467    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { @@ -1,6 +1,5 @@  // INFO {{{
 -let INFO =
 -<>
 +let INFO = xml`
    <plugin name="atnd" version="0.1.0"
            href="http://github.com/vimpr/vimperator-plugins/blob/master/atnd.js"
            summary="Atndのイベント検索"
 @@ -20,7 +19,7 @@ let INFO =        </description>
      </item>
    </plugin>
 -</>;
 +`;
  // }}}
 diff --git a/atodeyomu.js b/atodeyomu.js index 012ebda..7cb5480 100644 --- a/atodeyomu.js +++ b/atodeyomu.js @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>atodeyomu</description> @@ -11,7 +11,7 @@ var PLUGIN_INFO =      <license>public domain</license>      <detail><![CDATA[  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function(){ diff --git a/auto-bookmark.js b/auto-bookmark.js index a3ed359..96ed9dc 100644 --- a/auto-bookmark.js +++ b/auto-bookmark.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="AutoBookmark" version="1.3.1"            href="http://vimpr.github.com/"            summary="Auto update bookmark" @@ -65,7 +64,7 @@ let INFO =        <description><p></p></description>      </item>    </plugin> -</>; +`;  // }}}  (function () { @@ -351,18 +350,15 @@ let INFO =      'autobookmark',      'Auto bookmarking',      function () { +      function block ([name, data]) { +        return xml` +          <dt style="font-weight: bold">${name}</dt> +          <dd>${data.current.title} <a href=${data.current.URL}> ${data.current.URL} </a> (${def(data, 'scroll.x', '?')}, ${def(data, 'scroll.y', '?')}) (${def(data, 'pages.length', '?')})</dd> +        `; +      } +        liberator.echo( -        <dl>{ -          template.map( -            bookmarks, -            function ([name, data]) { -              return <> -                <dt style="font-weight: bold">{name}</dt> -                <dd>{data.current.title} <a href={data.current.URL}> {data.current.URL} </a> ({def(data, 'scroll.x', '?')}, {def(data, 'scroll.y', '?')}) ({def(data, 'pages.length', '?')})</dd> -              </>; -            } -          ) -        }</dl> +        xml`<dl>${template.map(bookmarks, block)}</dl>`        );      },      { @@ -447,24 +443,24 @@ let INFO =              let name = args.literalArg;              let data = bookmarks.get(name);              if (data) { -              liberator.echo(<> +              liberator.echo(xml`                  <dl>                    <dt>Name</dt> -                  <dd>{name}</dd> +                  <dd>${name}</dd>                    <dt>Start URL</dt> -                  <dd><a href={data.start.URL}>{data.start.URL}</a></dd> +                  <dd><a href=${data.start.URL}>{data.start.URL}</a></dd>                    <dt>Current Title</dt> -                  <dd>{data.current.Title}</dd> +                  <dd>${data.current.Title}</dd>                    <dt>Current URL</dt> -                  <dd><a href={data.current.URL}>{data.current.URL}</a></dd> +                  <dd><a href=${data.current.URL}>{data.current.URL}</a></dd>                    <dt>Current Position</dt> -                  <dd>{def(data, 'scroll.x', '?')}, {def(data, 'scroll.y', '?')}</dd> +                  <dd>${def(data, 'scroll.x', '?')}, {def(data, 'scroll.y', '?')}</dd>                    <dt>Pages</dt> -                  <dd>{ -                    template.map(data.pages, function (it) (<li>{it.URL}</li>)) +                  <dd>${ +                    template.map(data.pages, function (it) (`<li>${it.URL}</li>`))                    }</dd>                  </dl> -              </>); +              `);              } else {                liberator.echoerr('Bookmark not found: ' + name);              } @@ -548,7 +544,7 @@ let INFO =          title = name;        if (bookmarks.get(name)) { -        error.data = String(<>"{name}" already exists</>); +        error.data = String(`"{name}" already exists`);          return false;        } @@ -559,7 +555,7 @@ let INFO =        updateCurrent(data, url, title);        if (!initializeTab(tab, data)) { -        error.data = String(<>This tab is already started</>); +        error.data = String(`This tab is already started`);          return false;        } diff --git a/auto-focus-frame.js b/auto-focus-frame.js index 25f3445..18349b1 100644 --- a/auto-focus-frame.js +++ b/auto-focus-frame.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Auto focus frame</name>    <description>Automatically focus to largest frame.</description> @@ -54,7 +54,7 @@ let PLUGIN_INFO =        インストールするだけ        一番面積の大きいフレームをフォーカスします    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/auto-wildoptions.js b/auto-wildoptions.js index 96dbab1..0e92936 100644 --- a/auto-wildoptions.js +++ b/auto-wildoptions.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Auto wildoptions</name>    <description>Automatically toggle wildoptions=auto</description> @@ -51,7 +51,7 @@ let PLUGIN_INFO =    <detail lang="ja"><![CDATA[      ----    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/auto_detect_link.js b/auto_detect_link.js index 4f11cc8..5be989e 100644 --- a/auto_detect_link.js +++ b/auto_detect_link.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Auto Detect Link</name>    <description>Find (next|previous) link, and jump.</description> @@ -78,7 +78,7 @@ var PLUGIN_INFO =            liberator.plugins.autoDetectLink.detect(false, {useBackHistory: false});          ||<    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function () { diff --git a/auto_reload.js b/auto_reload.js index 64dcf69..86198bf 100644 --- a/auto_reload.js +++ b/auto_reload.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Auto Reload</name>    <name lang="ja">自動リロード</name> @@ -51,7 +51,7 @@ let PLUGIN_INFO =    <detail lang="ja"><![CDATA[      制作中    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/auto_source.js b/auto_source.js index 48dffb8..2054808 100644 --- a/auto_source.js +++ b/auto_source.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Auto Source</name>    <description>Sourcing automatically when the specified file is modified.</description> @@ -65,8 +65,8 @@ let PLUGIN_INFO =        - :aso! taro.js        - :autoso[urce]! taro.js    ]]></detail> -</VimperatorPlugin>; -let INFO = +</VimperatorPlugin>`; +let INFO = xml`  <plugin name="Auto Source" version="1.6.0"          href="http://github.com/vimpr/vimperator-plugins/blob/master/auto_source.js"          summary="Sourcing automatically when the specified file is modified." @@ -95,7 +95,7 @@ let INFO =        </dl>      </description>    </item> -</plugin>; +</plugin>`;  // }}}  // Links: diff --git a/auto_word_select_mode.js b/auto_word_select_mode.js index e32adea..aa50b90 100644 --- a/auto_word_select_mode.js +++ b/auto_word_select_mode.js @@ -31,7 +31,7 @@  // }}}  // PLUGIN INFO: {{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <description>Add auto word select mode.</description> @@ -143,7 +143,7 @@ var PLUGIN_INFO =      - http://d.zeromemory.info/2008/11/20/vimperator-multi_requester.html    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function(){ diff --git a/autopagerize_controll.js b/autopagerize_controll.js index 51b8719..eb73ab7 100644 --- a/autopagerize_controll.js +++ b/autopagerize_controll.js @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <description>controls autopagerize</description> @@ -24,7 +24,7 @@ prevpage:  == TODO ==    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function() { diff --git a/autoproxychanger.js b/autoproxychanger.js index 797b7bb..397176e 100644 --- a/autoproxychanger.js +++ b/autoproxychanger.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>autoproxychanger</name>    <description>setting proxy</description> @@ -50,7 +50,7 @@ var PLUGIN_INFO =        EOM        ||<    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.AutoProxyChanger = (function() {  var gVar = liberator.globalVariables; diff --git a/bijin_clock.js b/bijin_clock.js index c6a068a..dd7e8a0 100644 --- a/bijin_clock.js +++ b/bijin_clock.js @@ -8,12 +8,12 @@   * == Stop ==   * js plugins.bijin_clock.stop()   */ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Bijin Clock - http://www.bijint.com</description>  <version>0.1</version> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.bijin_clock = (function(){  const BASE_URL = 'http://www.bijint.com/jp/img/photo/'; @@ -34,7 +34,7 @@ function showBijinClock(){    let image_src = BASE_URL + getTimeString(date) + ".jpg";    liberator.echomsg(date.toLocaleString(), 0);    openDialog('data:application/vnd.mozilla.xul+xml;charset=utf-8,' + -    <><?xml-stylesheet type="text/css" href="chrome://global/skin/"?> +    `<?xml-stylesheet type="text/css" href="chrome://global/skin/"?>      <?xml-stylesheet type="text/css" href="chrome://browser/skin/browser.css"?>      <window title={TITLE}              windowtype="alert:clock" @@ -74,7 +74,7 @@ function showBijinClock(){          </hbox>          <image id="img" src={image_src} onload="init()" onerror="window.close()"/>        </vbox> -    </window></>.toXMLString(), +    </window>`.toXMLString(),      TITLE,      'chrome,dialog=yes,titlebar=no,popup=yes');  } @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>bit.ly</name>    <description>Get short alias by bit.ly and j.mp</description> @@ -53,7 +53,7 @@ let PLUGIN_INFO =      == Require ==        bit.ly API Key    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}} diff --git a/browser_object.js b/browser_object.js index dfdc583..badeba4 100644 --- a/browser_object.js +++ b/browser_object.js @@ -1,5 +1,5 @@  // PLUGIN_INFO {{{
 -let PLUGIN_INFO =
 +let PLUGIN_INFO = xml`
  <VimperatorPlugin>
    <name>{NAME}</name>
    <description>Map behave like text-object</description>
 @@ -52,7 +52,7 @@ let PLUGIN_INFO =            t:
              Tabs
    ]]></detail>
 -</VimperatorPlugin>;
 +</VimperatorPlugin>`;
  // }}}
  // Vimperator plugin: 'Map behave like text-object'
 diff --git a/buffer-multiple-hints.js b/buffer-multiple-hints.js index 076a4a5..d15fabd 100644 --- a/buffer-multiple-hints.js +++ b/buffer-multiple-hints.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="BufferMultipeHints" version="1.0.0"            href="http://vimpr.github.com/"            summary="Open multiple hints in tabs (;F) at the same time." @@ -57,7 +56,7 @@ let INFO =      <require type="plugin">_libly.js</require>      <p>This plugin requires _libly.js.</p>    </plugin> -</>; +`;  // }}} diff --git a/caret-hint.js b/caret-hint.js index 60c6ec0..ea9ebbe 100644 --- a/caret-hint.js +++ b/caret-hint.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="Caret Hint" version="1.4.0"            href="http://vimpr.github.com/"            summary="Move caret position by hint" @@ -161,7 +160,7 @@ let INFO =        </p></description>      </item>    </plugin> -</>; +`;  // }}}  /*       _\|/_ @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="Chaika-Controller" version="1.0.0"            href="http://vimpr.github.com/"            summary="for Chika" @@ -59,7 +58,7 @@ let INFO =        </p></description>      </item>    </plugin> -</>; +`;  // }}}  (function () { diff --git a/clear_privacy_data.js b/clear_privacy_data.js index d94ca45..6321907 100644 --- a/clear_privacy_data.js +++ b/clear_privacy_data.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>clear privacy data</description> @@ -48,7 +48,7 @@ var PLUGIN_INFO =          で 1m2d3h は 32日と3時間 という意味になり、現在から32日と3時間前までのデータを削除します。  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.privacySanitizer = (function(){  var isFx31 = (Application.version.substring(0, 3) == "3.1")  @@ -1,4 +1,4 @@ -let PLUGIN_INFO =
 +let PLUGIN_INFO = xml`
  <VimperatorPlugin>
  <name>{NAME}</name>
  <description>clock</description>
 @@ -94,7 +94,7 @@ let clock_format='(%t %d)'  ||<
  ]]></detail>
 -</VimperatorPlugin>;
 +</VimperatorPlugin>`;
  ( function () {
 diff --git a/commandBookmarklet.js b/commandBookmarklet.js index 811691c..af3d837 100644 --- a/commandBookmarklet.js +++ b/commandBookmarklet.js @@ -5,7 +5,7 @@   * @version 0.6.4   */ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>convert bookmarklets to commands</description> @@ -60,7 +60,7 @@ let PLUGIN_INFO =    この問題を避けるためにブックマークレットのタイトルを ASCII 文字のみに書き換えることをおすすめします。  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  ( function () { diff --git a/command_menu.js b/command_menu.js index ef00cb1..417cfc8 100644 --- a/command_menu.js +++ b/command_menu.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Command Menu</name>    <description>Execute main-menu and tool-bar by ex-command.</description> @@ -65,7 +65,7 @@ let PLUGIN_INFO =      == Requires ==        XUL/Migemo アドオン    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // TODO == diff --git a/cookieManager.js b/cookieManager.js index f1c0cb9..21db32b 100644 --- a/cookieManager.js +++ b/cookieManager.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Manage Cookies (list, remove, add/remove permission)</description> @@ -40,7 +40,7 @@ Cookie の管理をするプラグイン  補完機能を存分にお楽しみください :)  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.cookieManager = (function(){ @@ -135,7 +135,7 @@ commands.addUserCommand(["cookiem[anager]"], "Cookie Management",          if (!host) return;          switch (args[0]){              case "list": -                let xml = <></>; +                let xml = ``;                  let tree = cManager.stored.getTree(host);                  for (let name in tree){                      xml += template.table(name, [[c.name, c.value] for each(c in tree[name])]); @@ -1,5 +1,5 @@  var INFO = -<plugin name="copy" version="0.7.6" +xml`<plugin name="copy" version="0.7.6"          href="http://github.com/vimpr/vimperator-plugins/blob/master/copy.js"          summary="copy strings from the template (like CopyURL+)"          xmlns="http://vimperator.org/namespaces/liberator"> @@ -113,19 +113,7 @@ EOM              <p>wedata から読込まない label のリストを定義します。</p>          </description>      </item> -</plugin>; -var PLUGIN_INFO = -<VimperatorPlugin> -<name>{NAME}</name> -<description>enable to copy strings from a template (like CopyURL+)</description> -<description lang="ja">テンプレートから文字列のコピーを可能にします(CopyURL+みたいなもの)</description> -<minVersion>2.0pre</minVersion> -<maxVersion>2.0pre</maxVersion> -<updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/copy.js</updateURL> -<author mail="teramako@gmail.com" homepage="http://vimperator.g.hatena.ne.jp/teramako/">teramako</author> -<license>MPL 1.1/GPL 2.0/LGPL 2.1</license> -<version>0.7.5</version> -</VimperatorPlugin>; +</plugin>`;  liberator.plugins.exCopy = (function(){  var excludeLabelsMap = {}; diff --git a/cpan-search.js b/cpan-search.js index 9cb6fd3..bef3ff5 100644 --- a/cpan-search.js +++ b/cpan-search.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>CPAN search</description> @@ -16,7 +16,7 @@ var PLUGIN_INFO =    WebService::Hatena をマッチさせたいなら Web::Ha[tab] などで補完できると思います。    :cpan! で bang をつけると別のタブで開きます。  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function() {  var p = function(arg) { diff --git a/delicious_search.js b/delicious_search.js index fb5d2c9..996f5ea 100644 --- a/delicious_search.js +++ b/delicious_search.js @@ -1,4 +1,4 @@ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>search DeliciousBookmark and that completer</description> @@ -40,7 +40,7 @@ set go-=D  ||<  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.delicious = (function(){ @@ -185,11 +185,11 @@ function templateDescription(item){  }  function templateTitleAndIcon(item){    let simpleURL = item.text.replace(/^https?:\/\//, ''); -  return <> -    <span highlight="CompIcon">{item.icon ? <img src={item.icon}/> : <></>}</span><span class="td-strut"/>{item.name}<a href={item.text} highlight="simpleURL"> +  return ` +    <span highlight="CompIcon">{item.icon ? <img src={item.icon}/> : ``}</span><span class="td-strut"/>{item.name}<a href={item.text} highlight="simpleURL">        <span class="extra-info">{simpleURL}</span>      </a> -  </>; +  `;  }  commands.addUserCommand(["delicious[search]","ds[earch]"], "Delicious Bookmark Search", @@ -201,7 +201,7 @@ commands.addUserCommand(["delicious[search]","ds[earch]"], "Delicious Bookmark S      let list = bookmarkSearch(args["-tags"], args["-query"]);      let xml = template.tabular(["Title","Tags and Note"], [], list.map(function(item){        return [ -        <><img src={item.icon}/><a highlight="URL" href={item.url}>{item.name}</a></>, +        `<img src={item.icon}/><a highlight="URL" href={item.url}>{item.name}</a>`,          "[" + item.tags.join(",") + "] " + item.note        ];      })); diff --git a/direct_bookmark.js b/direct_bookmark.js index aafa575..aba403d 100644 --- a/direct_bookmark.js +++ b/direct_bookmark.js @@ -1,89 +1,92 @@ -var PLUGIN_INFO =
 -<VimperatorPlugin>
 -    <name>{NAME}</name>
 -    <description>Direct Post to Social Bookmarks</description>
 -    <author mail="trapezoid.g@gmail.com" homepage="http://unsigned.g.hatena.ne.jp/Trapezoid">Trapezoid</author>
 -    <version>0.19.0</version>
 +var INFO = xml`<plugin name=${NAME} version="0.19.0"
 +        href="https://github.com/vimpr/vimperator-plugins/raw/master/direct_bookmark.js"
 +        summary="Direct Post to Social Bookmarks"
 +        lang="en_US"
 +        xmlns="http://vimperator.org/namespaces/liberator">
 +    <project name="Vimperator" minVersion="3.6"/>
 +    <author email="trapezoid.g@gmail.com" homepage="http://unsigned.g.hatena.ne.jp/Trapezoid/">Trapezoid</author>
      <license>GPL</license>
 -    <minVersion>2.0pre</minVersion>
 -    <updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/direct_bookmark.js</updateURL>
 -    <detail><![CDATA[
 -Social Bookmark direct add script for Vimperator 2.2
 -for Migemo search: require XUL/Migemo Extension
 -
 -== Parts ==
 -- http://d.hatena.ne.jp/fls/20080309/p1
 -- Pagerization (c) id:ofk
 -- AutoPagerize (c) id:swdyh
 -- direct_delb.js id:mattn
 -- JSDeferred id:cho45
 -
 -
 -== Variables ==
 -=== g:direct_sbm_use_services_by_tag ===
 ->||
 -      Use social bookmark services to extract tags
 -          'h': Hatena Bookmark
 -          'd': del.icio.us
 -          'l': livedoor clip
 -          'g': Google Bookmarks
 -          'p': Places (Firefox bookmarks)
 -          'P': pinboard.in
 -      Usage: let g:direct_sbm_use_services_by_tag = "hdl"
 -||<
 -=== g:direct_sbm_use_services_by_post ===
 ->||
 -      Use social bookmark services to post
 -          'h': Hatena Bookmark
 -          'd': del.icio.us
 -          'l': livedoor clip
 -          'g': Google Bookmarks
 -          'P': pinboard.in
 -      Usage: let g:direct_sbm_use_services_by_post = "hdl"
 -||<
 -=== g:direct_sbm_echo_type ===
 ->||
 -      Post message type
 -          'simple'    : single line, no posted services description
 -          'multiline' : multi line, display services description
 -          'none'      : hide post message
 -||<
 -=== g:direct_sbm_is_normalize ===
 ->||
 -      Use normalize permalink
 -||<
 -=== g:direct_sbm_is_use_migemo ===
 ->||
 -      Use Migemo completion
 -||<
 -=== g:direct_sbm_private ===
 ->||
 -      Private bookmark
 -||<
 -
 -
 -== Commands ==
 -=== :btags ===
 ->||
 -      Extract tags from social bookmarks for completion
 -||<
 -=== :sbm ===
 ->||
 -      Post a current page to social bookmarks
 -      Arguments
 -          -s,-service: default:"hdl"
 -              Specify target SBM services to post
 -||<
 -=== :bentry ===
 ->||
 -      Goto Bookmark Entry Page
 -||<
 -=== :bicon ===
 ->||
 -      Show Bookmark Count as Icon
 -||<
 -   ]]></detail>
 -</VimperatorPlugin>;
 +    <p>Social Bookmark direct add script</p>
 +    <p>for Migemo search: require XUL/Migemo Extension</p>
 +    <h3 tag="directBookmark_Parts">Parts</h3>
 +    <ul>
 +        <li>http://d.hatena.ne.jp/fls/20080309/p1</li>
 +        <li>Pagerization (c) id:ofk</li>
 +        <li>AutoPagerize (c) id:swdyh</li>
 +        <li>direct_delb.js id:mattn</li>
 +        <li>JSDeferred id:cho45</li>
 +    </ul>
 +    <h3 tag="directBookmark_variables">Viriables</h3>
 +    <h4 tag="direct_sbm_use_services_by_tag">g:direct_sbm_use_services_by_tag</h4>
 +    <p>Use social bookmark services to extract tags</p>
 +    <dl>
 +        <dt>h</dt><dd>Hatena Bookmark</dd>
 +        <dt>d</dt><dd>del.icio.us</dd>
 +        <dt>l</dt><dd>livedoor clip</dd>
 +        <dt>g</dt><dd>Google Bookmarks</dd>
 +        <dt>p</dt><dd>Places (Firefox bookmarks)</dd>
 +        <dt>P</dt><dd>pinboard.in</dd>
 +    </dl>
 +    <p>Usage: <ex>let g:direct_sbm_use_services_by_tag = "hdl"</ex></p>
 +
 +    <h4 tag="direct_sbm_use_services_by_post">g:direct_sbm_use_services_by_post</h4>
 +    <p>Use social bookmark services to post</p>
 +    <dl>
 +        <dt>h</dt><dd>Hatena Bookmark</dd>
 +        <dt>d</dt><dd>del.icio.us</dd>
 +        <dt>l</dt><dd>livedoor clip</dd>
 +        <dt>g</dt><dd>Google Bookmarks</dd>
 +        <dt>P</dt><dd>pinboard.in</dd>
 +    </dl>
 +    <p>Usage: <ex>let g:direct_sbm_use_services_by_post = "hdl"</ex></p>
 +
 +    <h4 tag="direct_sbm_echo_type">g:direct_sbm_echo_type</h4>
 +    <p>Post message type</p>
 +    <dl>
 +        <dt>simple</dt><dd>single line, no posted services description</dd>
 +        <dt>multiline</dt><dd>multi line, display services description</dd>
 +        <dt>none</dt><dd>hide post message</dd>
 +    </dl>
 +
 +    <h4 tag="direct_sbm_is_normalize">g:direct_sbm_is_normalize</h4>
 +    <p>Use normalize permalink</p>
 +
 +    <h4 tag="direct_sbm_is_use_migemo">g:direct_sbm_is_use_migemo</h4>
 +    <p>Use Migemo completion</p>
 +
 +    <h4 tag="direct_sbm_private">g:direct_sbm_private</h4>
 +    <p>Private bookmark</p>
 +
 +    <item>
 +        <tags>:btags</tags>
 +        <spec>:btags</spec>
 +        <description>
 +            <p>Extract tags from social bookmarks for completion</p>
 +        </description>
 +    </item>
 +    <item>
 +        <tags>:sbm</tags>
 +        <spec>:sbm <oa>-s<oa>ervice</oa> <a>service</a></oa></spec>
 +        <description>
 +            <p>Post a current page to social bookmarks.</p>
 +            <p><a>service</a>: Specify target SBM services to post (default: "hdl")</p>
 +        </description>
 +    </item>
 +    <item>
 +        <tags>:bentry</tags>
 +        <spec>:bentry</spec>
 +        <description>
 +            <p>Goto Bookmark Entry Page</p>
 +        </description>
 +    </item>
 +    <item>
 +        <tags>:bicon</tags>
 +        <spec>:bicon</spec>
 +        <description>
 +            <p>Show Bookmark Count as Icon</p>
 +        </description>
 +    </item>
 +</plugin>`;
  (function(){
      var evalFunc = window.eval;
 @@ -347,12 +350,19 @@ for Migemo search: require XUL/Migemo Extension              entryPage:'http://b.hatena.ne.jp/entry/%URL::HATENA%',
              poster:function(user,password,url,title,comment,tags){
                  var tagString = tags.length > 0 ? '[' + tags.join('][') + ']' : "";
 -                var request =
 -                    <entry xmlns="http://purl.org/atom/ns#">
 -                        <title>dummy</title>
 -                        <link rel="related" type="text/html" href={url}/>
 -                        <summary type="text/plain">{tagString + comment}</summary>
 -                    </entry>;
 +                // TODO: xml`...` を使うとillegal character 言われる、、、何故?
 +                /*
 +                var request = xml`<entry xmlns="http://purl.org/atom/ns#">
 +                    <title>dummy</title>
 +                    <link rel="related" type="text/html" href=${url}/>
 +                    <summary type="text/plain">${tagString + comment}</summary>
 +                </entry>`;
 +                */
 +                var request = '<entry xmlns="http://purl.org/atom/ns#">' +
 +                        '<title>dummy</title>' +
 +                        '<link rel="related" type="text/html" href="' + url + '"/>' +
 +                        '<summary type="text/plain">' + tagString + comment + '</summary>' +
 +                    '</entry>';
                  var wsse = new WSSEUtils(user,password);
                  return Deferred.http({
 @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <name lang="ja">{NAME}</name> @@ -62,7 +62,7 @@ let PLUGIN_INFO =      == Link ==        http://d.hatena.ne.jp/nokturnalmortum/20081111#1226414487    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/edit-vimperator-files.js b/edit-vimperator-files.js index 690ce54..e6cc6cb 100644 --- a/edit-vimperator-files.js +++ b/edit-vimperator-files.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="EditVimperatorFile" version="1.2.3"            href="http://github.com/vimpr/vimperator-plugins/blob/master/edit-vimperator-files.js"            summary="Open vimperator files with text-editor." @@ -65,7 +64,7 @@ let INFO =        <spec>:edit <a>file</a></spec>      </item>    </plugin> -</>; +`;  // }}} diff --git a/ego_counter.js b/ego_counter.js index 66a3e03..a37786c 100644 --- a/ego_counter.js +++ b/ego_counter.js @@ -16,7 +16,7 @@    let update = function(color) {      myHatebu.setAttribute(        'src', -      <>http://b.hatena.ne.jp/bc/{color}/{MY_SITE}/</>.toSource() +      `http://b.hatena.ne.jp/bc/{color}/{MY_SITE}/`.toSource()      );    }; diff --git a/epub-reader.js b/epub-reader.js index 394c521..2976c05 100644 --- a/epub-reader.js +++ b/epub-reader.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="ePub Reader" version="1.1.1"            href="http://vimpr.github.com/"            summary="for ePub Reader addon" @@ -102,7 +101,7 @@ let INFO =        一つのアクションに複数のマッピングをしたいときは、スペースで区切ります。      </p>    </plugin> -</>; +`;  // }}} diff --git a/erection.js b/erection.js index 303ac8d..b78182c 100644 --- a/erection.js +++ b/erection.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="erection" version="1.1.1"            href="http://vimpr.github.com/"            summary="Show the Erection." @@ -75,12 +74,12 @@ let INFO =        <description><p>エレクチオンテキストと画像を表示します。</p></description>      </item>    </plugin> -</>; +`;  // }}}  (function () { -  const VERSION = INFO.@version[0]; +  const VERSION = '1.1.1';    function erect (callback) {      const VC = @@ -218,7 +217,7 @@ let INFO =            ['c[opy]'],            'Copy text',            makeErectionCommand(function (e) { -            util.copyToClipboard(String(<>{e.text} - {e.by} {e.from} {e.imageURL}</>)); +            util.copyToClipboard(String(`{e.text} - {e.by} {e.from} {e.imageURL}`));            }),            subOption          ), @@ -226,13 +225,13 @@ let INFO =            ['s[how]'],            'Show text and image',            makeErectionCommand(function (e) { -            liberator.echo(<> +            liberator.echo(xml`                <div style="height: 800px">                  <h1>{e.text}</h1>                  <img src={e.imageURL} />                  <span>{e.by}</span> <span>{e.from}</span>                </div> -            </>); +            `);            }),            subOption          ), @@ -240,7 +239,7 @@ let INFO =            ['e[xcommand]'],            'Open command line with select erection',            makeErectionCommand(function (e, args) { -            let cmdArgs = String(<>{e.text} - {e.by} {e.from} {e.imageURL}</>); +            let cmdArgs = String(`{e.text} - {e.by} {e.from} {e.imageURL}`);              setTimeout(function () commandline.open('', args[0] + ' ' + cmdArgs, modes.EX), 1);            }),            { diff --git a/escape-from-iframe.js b/escape-from-iframe.js index 5a86324..b72c0ee 100644 --- a/escape-from-iframe.js +++ b/escape-from-iframe.js @@ -34,7 +34,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  // INFO {{{  let INFO = -<> +xml`    <plugin name="Escape from iframe." version="1.0.0"            href="http://vimpr.github.com/"            summary="Escape from iframe (focus to parent window)." @@ -49,8 +49,7 @@ let INFO =        <spec><Esc></spec>        <description><p>Escape from iframe (focus to parent window).</p></description>      </item> -  </plugin> -</>; +  </plugin>`;  // }}}  (function () { @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>every.js</name>    <description>to run a specified command every time at specified interval.</description> @@ -87,7 +87,7 @@ let PLUGIN_INFO =      == Links ==        http://d.hatena.ne.jp/nokturnalmortum/20081102#1225552718    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  ps = []; @@ -1,81 +1,83 @@ -var PLUGIN_INFO = -<VimperatorPlugin> -<name>{NAME}</name> -<description>Open URL from a template</description> -<description lang="ja">テンプレートからURLをOpenします</description> -<minVersion>2.0pre</minVersion> -<maxVersion>2.0pre</maxVersion> -<updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/exopen.js</updateURL> -<author homepage="http://vimperator.g.hatena.ne.jp/pekepekesamurai/">pekepekesamurai</author> -<version>0.10.1</version> -<detail lang="ja"><![CDATA[ -== Command == -:exopen [template_name] -  [template_name] で設定されたURLを開きます。 +var INFO = +xml`<plugin name=${NAME} version="0.10.2" +            href="http://github.com/vimpr/vimperator-plugins/blob/master/exopen.js" +            summary="テンプレートからURLをOpenします" +            lang="ja" +            xmlns="http://vimperator.org/namespaces/liberator"> +  <author homepage="http://vimperator.g.hatena.ne.jp/pekepekesamurai">pekepekesamurai</author> +  <project name="Vimperator" minVersion="3.6"/> +  <item> +    <tags>:exopen</tags> +    <spec>:exopen <a>template_name</a></spec> +    <description> +      <p> +        <a>template_name</a> で設定されたURLを開きます。 +      </p> +    </description> +  </item> +  <h3 tag="exopen-example">Example</h3> +  <code><ex><![CDATA[ +    :exopen http://www.google.co.jp/search?q=%TITLE% +  ]]></ex></code> +  <p>%TITLE%を現在開いているWebページのタイトルに展開してURLを開きます。</p> -=== Example === -:exopen http://www.google.co.jp/search?q=%TITLE%: -  %TITLE%を現在開いているWebページのタイトルに展開してURLを開きます。 -:exopen [title] -  テンプレートで設定されたURLを開きます。 +  <code><ex><![CDATA[ +    :exopen [title] +  ]]></ex></code> +  <p>テンプレートで設定されたURLを開きます。</p> -== Keyword == -%TITLE%: -  現在のWebページのタイトル -%URL%: -  現在のWebページのURL -%SEL%: -  選択中の文字列 -%HTMLSEL%: -  選択中のHTMLソース +  <h3 tag="exopen-keyword">Keyword</h3> +  <dl> +    <dt>%TITLE%</dt><dd>現在のWebページのタイトル</dd> +    <dt>%URL%</dt><dd>現在のWebページのURL</dd> +    <dt>%SEL%</dt><dd>選択中の文字列</dd> +    <dt>%HTMLSEL%</dt><dd>選択中のHTMLソース</dd> +  </dl> -== .vimperatorrc == ->|| -javascript <<EOM -liberator.globalVariables.exopen_templates = [ -  { -    label: 'vimpnightly', -    value: 'http://code.google.com/p/vimperator-labs/downloads/list?can=1&q=label:project-vimperator', -    description: 'open vimperator nightly xpi page', -    newtab: true -  }, { -    label: 'vimplab', -    value: 'http://www.vimperator.org/vimperator', -    description: 'open vimperator trac page', -    newtab: true -  }, { -    label: 'vimpscript', -    value: 'http://code.google.com/p/vimperator-labs/issues/list?can=2&q=label%3Aproject-vimperator+label%3Atype-plugin', -    description: 'open vimperator trac script page', -    newtab: true -  }, { -    label: 'coderepos', -    value: 'http://coderepos.org/share/browser/lang/javascript/vimperator-plugins/trunk/', -    description: 'open coderepos vimperator-plugin page', -    newtab: true -  }, { -    label: 'sldr', -    value: 'http://reader.livedoor.com/subscribe/%URL%' -  } -]; -EOM -||< -label: -  テンプレート名。コマンドの引数で指定してください。 -value: -  OpenするURL -custom: -  関数か配列で指定してください。 -  関数の場合、return された文字列をオープンします。 -  配列の場合、value で指定された文字列を置換します。(条件→Array[0]、置換文字列→Array[1]) -description: -  補完時に表示する説明文。 -newtab: -  新規タブで開く場合は true を指定してください。 -escape: -  URLエンコードする場合、true を指定してください。 -]]></detail> -</VimperatorPlugin>; +  <h3 tag="exopen-rc-example">.vimperatorrc exmaple</h3> +  <code><ex><![CDATA[ +  javascript <<EOM +  liberator.globalVariables.exopen_templates = [ +    { +      label: 'vimpnightly', +      value: 'http://code.google.com/p/vimperator-labs/downloads/list?can=1&q=label:project-vimperator', +      description: 'open vimperator nightly xpi page', +      newtab: true +    }, { +      label: 'vimplab', +      value: 'http://www.vimperator.org/vimperator', +      description: 'open vimperator trac page', +      newtab: true +    }, { +      label: 'vimpscript', +      value: 'http://code.google.com/p/vimperator-labs/issues/list?can=2&q=label%3Aproject-vimperator+label%3Atype-plugin', +      description: 'open vimperator trac script page', +      newtab: true +    }, { +      label: 'coderepos', +      value: 'http://coderepos.org/share/browser/lang/javascript/vimperator-plugins/trunk/', +      description: 'open coderepos vimperator-plugin page', +      newtab: true +    }, { +      label: 'sldr', +      value: 'http://reader.livedoor.com/subscribe/%URL%' +    } +  ]; +  EOM +  ]]></ex></code> +  <dl> +    <dt>label</dt><dd>テンプレート名。コマンドの引数で指定してください。</dd> +    <dt>value</dt><dd>OpenするURL</dd> +    <dt>custom</dt><dd> +      関数か配列で指定してください。 +      関数の場合、return された文字列をオープンします。 +      配列の場合、value で指定された文字列を置換します。(条件→Array[0]、置換文字列→Array[1]) +    </dd> +    <dt>description</dt><dd>補完時に表示する説明文。</dd> +    <dt>newtab</dt><dd>新規タブで開く場合は true を指定してください。</dd> +    <dt>escape</dt><dd>URLエンコードする場合、true を指定してください。</dd> +  </dl> +</plugin>`;  liberator.plugins.exOpen = (function() {    var global = liberator.globalVariables.exopen_templates; diff --git a/extension-manager.js b/extension-manager.js index 241ddc3..c4fcdc9 100644 --- a/extension-manager.js +++ b/extension-manager.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>extension manager</name>    <name lang="ja">アドオン管理</name> @@ -56,11 +56,10 @@ let PLUGIN_INFO =      read the help with the below command.      ":help extension-manager-plugin"    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="extension-manager" version="1.1.0"            href="http://github.com/vimpr/vimperator-plugins/blob/master/extension-manager.js"            summary="extension manager" @@ -144,7 +143,7 @@ let INFO =        </description>      </item>    </plugin> -</>; +`;  // }}} diff --git a/facebook.js b/facebook.js index 9c30146..4902be3 100644 --- a/facebook.js +++ b/facebook.js @@ -1,6 +1,5 @@  // INFO {{{
 -let INFO =
 -<>
 +let INFO = xml`
    <plugin name="facebook" version="0.2.0"
            href="http://github.com/vimpr/vimperator-plugins/blob/master/facebook.js"
            summary="[facebook.js] コマンドラインからfacebookを操作するプラグイン"
 @@ -152,7 +151,7 @@ let INFO =  		</description>
      </item>
    </plugin>
 -</>;
 +`;
  // }}}
  (function(){
 diff --git a/feedSomeKeys_3.js b/feedSomeKeys_3.js index 30bf52d..fd08ec6 100644 --- a/feedSomeKeys_3.js +++ b/feedSomeKeys_3.js @@ -33,8 +33,8 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = <> -  <plugin name="feedSomeKeys" version="1.9.3" +let INFO = +xml`<plugin name="feedSomeKeys" version="1.9.3"            href="http://github.com/vimpr/vimperator-plugins/blob/master/feedSomeKeys_3.js"            summary="Feed some defined key events into the Web content"            lang="en-US" @@ -245,8 +245,7 @@ let INFO = <>  :lazy fmaps -u='http://code.google.com/p/vimperator-labs/issues/list' o j k  :lazy fmaps -u='http://code.google.com/p/vimperator-labs/issues/detail' u      </ex></code> -  </plugin> -</>; +</plugin>`;  // }}} @@ -472,20 +471,23 @@ let INFO = <>    function list (condition) {      let maps = findMappings(condition);      let template = modules.template; +    let length = 0;      let list = -      <table> -        { -          template.map(maps, function (map) -            template.map(map.names, function (name) -            <tr> -              <td style="font-weight: bold">{name}</td> -              <td style="font-weight: bold">{map.feedSomeKeys.rhs}</td> -              <td>{map.matchingUrls ? map.matchingUrls : '[Global]'}</td> -            </tr>)) +      xml`<table> +        ${ +          template.map(maps, function (map){ +            ++length; +            return template.map(map.names, function (name) +            xml`<tr> +              <td style="font-weight: bold">${name}</td> +              <td style="font-weight: bold">${map.feedSomeKeys.rhs}</td> +              <td>${map.matchingUrls ? map.matchingUrls : '[Global]'}</td> +            </tr>`) +          })          } -      </table>; +      </table>`; -    if (list.*.length() == list.text().length()) { +    if (length == 0) {        liberator.echomsg("No mapping found");        return;      } @@ -496,15 +498,15 @@ let INFO = <>      context.title = ['name', 'rhs & url'];      context.completions = [        [ -        <span style="font-weight: bold">{map.names[0]}</span>, +        xml`<span style="font-weight: bold">${map.names[0]}</span>,          <span> -          <span style="font-weight: bold">{map.feedSomeKeys.rhs}</span> -          <span>{ +          <span style="font-weight: bold">${map.feedSomeKeys.rhs}</span> +          <span>${              args['-ignoreurls'] -              ? <><span> for </span><span>{map.matchingUrls ? map.matchingUrls : 'Global'}</span></> +              ? xml`<span> for </span><span>${map.matchingUrls ? map.matchingUrls : 'Global'}</span>`                : ''            }</span> -        </span> +        </span>`        ]        for each (map in findMappings({urls: args['-urls'], ignoreUrls: args['-ignoreurls']}))      ]; diff --git a/fetchyoutube.js b/fetchyoutube.js index a19c823..dd8d9e2 100644 --- a/fetchyoutube.js +++ b/fetchyoutube.js @@ -22,7 +22,7 @@  (function () {      function fixFilename (filename) { -      const badChars = /[\\\/:;*?"<>|]/g; +      const badChars = /[\\\/:;*?"`|]/g;        return filename.replace(badChars, '_');      } diff --git a/forcefocuscontent.js b/forcefocuscontent.js index 0dbf2ca..8822cfc 100644 --- a/forcefocuscontent.js +++ b/forcefocuscontent.js @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>force focuscontent</description> @@ -8,7 +8,7 @@ var PLUGIN_INFO =      <minVersion>2.0pre</minVersion>      <maxVersion>2.0pre</maxVersion>      <updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/forcefocuscontent.js</updateURL> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  getBrowser().addEventListener("load", onPageLoad, true); diff --git a/foxage2ch.js b/foxage2ch.js index 5586757..327ff99 100644 --- a/foxage2ch.js +++ b/foxage2ch.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="FoxAge2ch" version="1.3.1"            href="https://github.com/vimpr/vimperator-plugins/blob/master/foxage2ch.js"            summary="for FoxAge2ch addon" @@ -78,7 +77,7 @@ let INFO =        </description>      </item>    </plugin> -</>; +`;  // }}} diff --git a/foxytunes.js b/foxytunes.js index 780dd39..61013f5 100644 --- a/foxytunes.js +++ b/foxytunes.js @@ -32,7 +32,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Foxy Tunes</name>    <description>for FoxyTunes</description> @@ -60,7 +60,7 @@ var PLUGIN_INFO =        + :ftprevious        + :ftvolume <VOLUME>    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function () { diff --git a/function-template.js b/function-template.js index f739cae..fa1c682 100644 --- a/function-template.js +++ b/function-template.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="XXXX" version="1.0.0"            href="http://vimpr.github.com/"            summary="XXXXX" @@ -95,7 +94,7 @@ EOM        </description>      </item>    </plugin> -</>; +`;  // }}} diff --git a/garbage_finder.js b/garbage_finder.js index d7072c4..511ec33 100644 --- a/garbage_finder.js +++ b/garbage_finder.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Garbage Finder</name>    <name lang="ja">ゴミ探し</name> @@ -58,7 +58,7 @@ let PLUGIN_INFO =        :garbages:          (追加|削除)された変数を表示。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { @@ -116,7 +116,7 @@ let PLUGIN_INFO =      function (args) {        function makeLI (list) {          if (list.length) { -          let result = <></>; +          let result = ``;            list.forEach(function (it) (result += <li>{it}</li>));            return <ol>{result}</ol>;          } @@ -1,5 +1,5 @@ -// INFO // -var INFO =  +// {{{ INFO +var INFO =xml`  <plugin name="gbmark.js" version="0.2"          summary="Add Google Bookmark."          href="http://github.com/vimpr/vimperator-plugins/blob/master/gbmark.js" @@ -15,7 +15,8 @@ var INFO =        <p>Add Google Bookmark.</p>      </description>    </item> -</plugin>; +</plugin>`; +// }}}  (function(){    commands.addUserCommand( diff --git a/gmail-commando.js b/gmail-commando.js index 3d2f95f..cfa4cdb 100644 --- a/gmail-commando.js +++ b/gmail-commando.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="GMailCommando" version="1.4.11"            href="http://github.com/vimpr/vimperator-plugins/blob/master/gmail-commando.js"            summary="The handy commands for GMail" @@ -109,7 +108,7 @@ let INFO =        </description>      </item>    </plugin> -</>; +`;  // }}} @@ -1,5 +1,5 @@ -// INFO // -var INFO =  +// {{{ INFO +var INFO =xml`  <plugin name="gmap.js" version="0.1"          summary="Get google maps URL of current machine location."          href="http://github.com/vimpr/vimperator-plugins/blob/master/gmap.js" @@ -24,7 +24,8 @@ var INFO =        </dl>      </description>    </item> -</plugin>; +</plugin>`; +// }}}  (function(){  	commands.addUserCommand( diff --git a/gmperator.js b/gmperator.js index df11af2..7d9c988 100644 --- a/gmperator.js +++ b/gmperator.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Vimperator plugin for Greasemonkey</description> @@ -105,7 +105,7 @@ liberator.plugins.gmperator:                                )  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function(){ @@ -235,7 +235,7 @@ liberator.plugins.gmperator = (function(){ //{{{  // ---------------------------  commands.addUserCommand(['gmli[st]','lsgm'],'list Greasemonkey scripts', //{{{      function(args){ -        var xml = <></>; +        var xml = ``;          var scripts = GM_getConfig().scripts;          var reg;          if (args.bang || args.string == 'full'){ @@ -1,5 +1,5 @@  // {{{ INFO -var INFO = +var INFO =xml`  <plugin name="goo.gl.js" version="0.2"          summary="google url shortener"          href="http://github.com/vimpr/vimperator-plugins/blob/master/goo.gl.js" @@ -15,7 +15,7 @@ var INFO =        <p>Shorten URL by used of google</p>      </description>    </item> -</plugin>; +</plugin>`;  // }}}  commands.addUserCommand( diff --git a/google-plus-commando.js b/google-plus-commando.js index a1b7cb8..1b0440d 100644 --- a/google-plus-commando.js +++ b/google-plus-commando.js @@ -34,8 +34,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="GooglePlusCommando" version="2.4.7"            href="http://github.com/vimpr/vimperator-plugins/blob/master/google-plus-commando.js"            summary="The handy commands for Google+" @@ -230,7 +229,7 @@ let g:gplus_commando_map_menu            = "m"        </description>      </item>    </plugin> -</>; +`;  // }}}  (function () { @@ -522,7 +521,7 @@ let g:gplus_commando_map_menu            = "m"          // エントリにコメント          function get1 (root) {            function button (editor, name) -            editor.parentNode.querySelector(S.role('button', <>[id$=".{name}"]</>)); +            editor.parentNode.querySelector(S.role('button', `[id$=".{name}"]`));            if (!root)              return; @@ -574,7 +573,7 @@ let g:gplus_commando_map_menu            = "m"          // ダイアログ          function get3 (root) {            function button (editor, name) -            editor.parentNode.querySelector(S.role('button', <>[id$=".{name}"]</>)); +            editor.parentNode.querySelector(S.role('button', `[id$=".{name}"]`));            if (!root)              return; @@ -832,7 +831,7 @@ let g:gplus_commando_map_menu            = "m"          ps.backgroundColor = 'white';          ps.border = 'solid 1px grey';        } -      panel.innerHTML = <> +      panel.innerHTML = `          <table>            <tr><th>入力</th>           <th>効果</th>                   <th>解説</th>                                 </tr>            <tr><td>*TEXT*</td>         <td><b>TEXT</b></td>            <td>太字</td>                                 </tr> @@ -843,7 +842,7 @@ let g:gplus_commando_map_menu            = "m"            <tr><td>-ね こ-</td>        <td><s>ね こ</s></td>           <td>英数字や半角スペースを入れたらOK</td>     </tr>            <tr><td>-Aねこす-</td>      <td><s>Aねこす</s></td>         <td>英数字を前後に入れても良い</td>           </tr>          </table> -      </>; +      `;        move(panel);        parent.appendChild(panel); @@ -1122,7 +1121,7 @@ let g:gplus_commando_map_menu            = "m"            for (let [, root] in Iterator(roots)) {              if (!root.visible)                continue; -            xpath.push(String(<>div[contains(@class, "{s2x(S.closeButton)}")]</>)); +            xpath.push(String(`div[contains(@class, "{s2x(S.closeButton)}")]`));              xpath = xpath.map(function (it) (root.selector + '//' + it));              break;            } diff --git a/google-search.js b/google-search.js index 9be5cea..efda50e 100644 --- a/google-search.js +++ b/google-search.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Google Search, and AutoComplete.</description> @@ -17,7 +17,7 @@ var PLUGIN_INFO =  google suggest での飛び先はあくまで google ですが、このプラグインは google の検索結果先に飛びます。  この plugin を作ってから multi_requester.js の存在をしってあっちを使えば・・・、と思いました。いちおう favicon が表示されたりします。  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function() { diff --git a/google-tasks.js b/google-tasks.js index d968b1c..7da89a4 100644 --- a/google-tasks.js +++ b/google-tasks.js @@ -1,4 +1,4 @@ -var INFO = +var INFO = xml`  <plugin name="google-tasks.js"          version="0.1"          summary="For Google Tasks" @@ -6,7 +6,7 @@ var INFO =    <author email="ebith.h@gmail.com">ebith</author>    <license href="http://www.opensource.org/licenses/bsd-license.php">New BSD License</license>    <project name="Vimperator" minVersion="3.3"/> -</plugin>; +</plugin>`;  let httpGet = util.httpGet; @@ -43,17 +43,17 @@ function setup() {        access_token = getAccessToken();        let url = rest_uri + '/users/@me/lists?oauth_token=' + access_token;        let lists = JSON.parse(httpGet(url).responseText).items; -      let tbody = <></>; +      let tbody = xml``;        for (let i=0; i<lists.length; i++) {          let url = rest_uri + '/lists/' + lists[i].id + '/tasks?oauth_token=' + access_token;          let tasks = JSON.parse(httpGet(url).responseText).items;          if (!tasks) { continue; } //空っぽのリストは飛ばす          for (let i2=0; i2<tasks.length; i2++) { -          let taskTitle = (tasks[i2].status == 'completed') ? <>☑<del>{tasks[i2].title}</del></>  : <>☐{tasks[i2].title}</>; -          tbody += <tr style="border-bottom: 1px dotted;"><td style="width: 20%">{lists[i].title}</td><td>{taskTitle}</td></tr>; +          let taskTitle = (tasks[i2].status == 'completed') ? xml`☑<del>${tasks[i2].title}</del>`  : `☐${tasks[i2].title}`; +          tbody += xml`<tr style="border-bottom: 1px dotted;"><td style="width: 20%">${lists[i].title}</td><td>${taskTitle}</td></tr>`;          }        } -      liberator.echo(<><table style="width: 100%; line-height: 1.6; border-collapse: collapse; border-top: 1px solid;">{tbody}</table></>); +      liberator.echo(xml`<table style="width: 100%; line-height: 1.6; border-collapse: collapse; border-top: 1px solid;">{tbody}</table>`);      },      {        subCommands: [ diff --git a/googledocs.js b/googledocs.js index 12e0200..f732ad9 100644 --- a/googledocs.js +++ b/googledocs.js @@ -37,7 +37,7 @@   * */  // Last Change: 2009/01/14 22:14:16. -let PLUGIN_INFO =  +let PLUGIN_INFO = xml`   <VimperatorPlugin>      <name>{NAME}</name>      <description>provide extended-hints modes for Google Docs</description> @@ -74,7 +74,7 @@ Google Docs のトップページ ( http://docs.google.com/ ) で ';d' と押し  let googledocs_mapping='g'  ||<      ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  ( function () { diff --git a/googlekanji.js b/googlekanji.js index 7381aca..3bea153 100644 --- a/googlekanji.js +++ b/googlekanji.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Google Kanji</name>    <name lang="ja">Google 漢字</name> @@ -55,7 +55,7 @@ let PLUGIN_INFO =        が開き、補完が可能になるので、正しそうな漢字を選びます。        すると、クリップボードにその漢字がコピーされます。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { @@ -22,7 +22,7 @@  //      un-fav someone's last status.. mean remove Hatena Star.
  //  :haiku! #keyword
  //      show the keyword timeline.
 -var PLUGIN_INFO =
 +var PLUGIN_INFO = xml`
  <VimperatorPlugin>
    <name>{NAME}</name>
    <description>Hatena Haiku Client</description>
 @@ -52,7 +52,7 @@ The script allows you to update Haiku status from Vimperator.  :haiku! #keyword:
      show the keyword timeline.
    ]]></detail>
 -</VimperatorPlugin>;
 +</VimperatorPlugin>`;
  (function(){
      liberator.plugins.haiku = {
 @@ -149,8 +149,8 @@ The script allows you to update Haiku status from Vimperator.          statuses.forEach(function(status) {
              var text = status.text;
              var keyword = status.keyword;
 -            var star = status.favorited > 0 ? <><img src="http://s.hatena.ne.jp/images/star.gif"/><span style="color:orange;">{'x' + status.favorited}</span></> : <></>;
 -            var replies = <></>;
 +            var star = status.favorited > 0 ? `<img src="http://s.hatena.ne.jp/images/star.gif"/><span style="color:orange;">{'x' + status.favorited}</span>` : ``;
 +            var replies = ``;
              if (text.indexOf(keyword+"=") == 0) text = status.text.substr(keyword.length + 1);
              text = convert(text);
 @@ -159,16 +159,16 @@ The script allows you to update Haiku status from Vimperator.              if (status.replies.length > 0){
                  replies = <dl class="haiku"></dl>;
                  status.replies.forEach(function(rep){
 -                    replies.* += <>
 +                    replies.* += `
                                   <dt>
                                      <img src={rep.user.profile_image_url} alt={rep.user.screen_name} class="haiku photo"/>
                                      <strong>{rep.user.name}</strong>
                                   </dt>
                                   <dd class="haiku entry-content">{rep.text.substr(keyword.length)}</dd>
 -                                 </>;
 +                                 `;
                  });
              }
 -            html += <>
 +            html += `
                  <div>
                      <img src={status.user.profile_image_url}
                           alt={status.user.screen_name}
 @@ -182,7 +182,7 @@ The script allows you to update Haiku status from Vimperator.                  </div>
                  {replies}
                  <hr/>
 -            </>;
 +            `;
          });
          return html;
      }
 diff --git a/happy_hacking_vimperator.js b/happy_hacking_vimperator.js index 1b0aa79..d721295 100644 --- a/happy_hacking_vimperator.js +++ b/happy_hacking_vimperator.js @@ -32,7 +32,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  */ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Happy Happy Vimperator</name>    <description>This plugin makes you to True Vimperatorer</description> @@ -51,7 +51,7 @@ let PLUGIN_INFO =      == Requirements ==      Steel Heart    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function () { @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>hash of file</description> @@ -15,7 +15,7 @@ hash:      :hash md2|md5|sha1|sha256|sha384|sha512 file-path  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function() { diff --git a/hateDAopener.js b/hateDAopener.js index 8e9864f..378ead1 100644 --- a/hateDAopener.js +++ b/hateDAopener.js @@ -31,7 +31,7 @@  // }}}  // PLUGIN INFO: {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <description>Search specified Hatena::Diary</description> @@ -84,7 +84,7 @@ let PLUGIN_INFO =      - APIを用意する    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  plugins.hateDAopener = (function(){ @@ -258,13 +258,13 @@ plugins.hateDAopener = (function(){       * template: title & url       */      function templateTitleAndUrl(item) -        <> +        `              <img src={getFaviconURI(item.baseUrl + '/')} />              <span class="td-strut"/>{item.name}              <a href={item.text} highlight="simpleURL">                <span class="extra-info">{item.text.replace(/^https?:\/\//, '')}</span>              </a> -        </>; +        `;      /**       * template: tags diff --git a/hatebuWatchDog.js b/hatebuWatchDog.js index 0a683e4..b87f42c 100644 --- a/hatebuWatchDog.js +++ b/hatebuWatchDog.js @@ -30,7 +30,7 @@  //  // }}}  // PLUGIN INFO: {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <description>Make notify hatebu-count when specified site's hatebu-count changed.</description> @@ -89,7 +89,7 @@ let PLUGIN_INFO =        - 監視フレームワークにのっける      ]]></detail> -  </VimperatorPlugin>; +  </VimperatorPlugin>`;  // }}}  // Clear all watchers if started watcher exists. diff --git a/hatena-bookmark-search.js b/hatena-bookmark-search.js index 22fc58d..e98fa94 100644 --- a/hatena-bookmark-search.js +++ b/hatena-bookmark-search.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO =
 +var PLUGIN_INFO = xml`
  <VimperatorPlugin>
  <name>{NAME}</name>
  <description>Hatena Bookmark UserSearch</description>
 @@ -63,7 +63,7 @@ let g:hatena_bookmark_suffix_array='true';  -- キャッシュの追加, SuffixArray 検索の追加
  ]]></detail>
 -</VimperatorPlugin>;
 +</VimperatorPlugin>`;
  liberator.plugins.HatenaBookmark = (function(){
 @@ -116,29 +116,29 @@ HatenaBookmark.reload = function() {  HatenaBookmark.Command = {
     templateDescription: function (item, text) {
 -       return <>
 +       return `
             {
                 !(item.extra && item.extra.length) ? "" :
                 <span class="extra-info">
                     {
                         template.map(item.extra, function (e)
 -                       <><span highlight={e[2]}>{e[1]}</span></>,
 -                       <> </>/* Non-breaking space */)
 +                       `<span highlight={e[2]}>{e[1]}</span>`,
 +                       ` `/* Non-breaking space */)
                     }
                 </span>
             }
 -       </>
 +       `
      },
      templateTitleIcon: function (item, text) {
         var simpleURL = text.replace(/^https?:\/\//, '');
         if (simpleURL.indexOf('/') == simpleURL.length-1)
             simpleURL = simpleURL.replace('/', '');
 -       return <><span highlight="CompIcon">{item.icon ? <img src={item.icon}/> : <></>}</span><span class="td-strut"/>{item.item.title}
 +       return `<span highlight="CompIcon">{item.icon ? <img src={item.icon}/> : ``}</span><span class="td-strut"/>{item.item.title}
         <a href={item.item.url} highlight="simpleURL"><span class="extra-info">{
               simpleURL
         }</span></a>
 -       </>
 +       `
      },
      filter: function (_item) {
          var item = _item.item;
 diff --git a/hatenaStar.js b/hatenaStar.js index 4c2302a..faca1a1 100644 --- a/hatenaStar.js +++ b/hatenaStar.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  	<name>{NAME}</name>  	<description>Add Hatena Star.</description> @@ -8,7 +8,7 @@ var PLUGIN_INFO =  	<minVersion>2.3pre</minVersion>  	<maxVersion>2.3pre</maxVersion>  	<updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/hatenaStar.js</updateURL> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function() {  const Cc = Components.classes; diff --git a/hatena_fotolife.js b/hatena_fotolife.js index cb0b146..9d604e4 100644 --- a/hatena_fotolife.js +++ b/hatena_fotolife.js @@ -23,7 +23,7 @@   * IN THE SOFTWARE.   * */ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>Generates and yanks thumbnail tags in Hatena Fotolife</description> @@ -64,7 +64,7 @@ hatena_fotolife_hint_key='f'  image_extender_yank_key='f'  ||<  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  ( function () { diff --git a/hatena_highlight.js b/hatena_highlight.js index 2ce0d5c..a3f02c5 100644 --- a/hatena_highlight.js +++ b/hatena_highlight.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Clear highlight or highlight keywords in Hatena Services.</description> @@ -26,7 +26,7 @@ Google で検索してはてなにアクセスしたときにハイライトを  ||<  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function(){      function toggleHighlight(isClear) {          var elements = window.content.document.getElementsByTagName('span'); diff --git a/hint-tombloo.js b/hint-tombloo.js index 7c0cfd1..09d9bd6 100644 --- a/hint-tombloo.js +++ b/hint-tombloo.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Hint mode for Tombloo</description> @@ -18,7 +18,7 @@ let g:hint_tombloo_xpath = '//img'      Share target element by Tombloo  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function () { diff --git a/hints-for-embedded.js b/hints-for-embedded.js index 1fa940b..3f80672 100644 --- a/hints-for-embedded.js +++ b/hints-for-embedded.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="HintsForEmbeded" version="1.6.0"            href="http://github.com/vimpr/vimperator-plugins/blob/master/hints-for-embedded.js"            summary="Add the hints mode for embedded objects." @@ -123,7 +122,7 @@ let INFO =        </description>      </item>    </plugin> -</>; +`;  // }}}  (function () { diff --git a/hints-yank-paste.js b/hints-yank-paste.js index 4cd5964..78231c8 100644 --- a/hints-yank-paste.js +++ b/hints-yank-paste.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>Adds "Yank element's text/html/attrs" or "Paste to element" hint mode</description> @@ -38,7 +38,7 @@ set hintpastetags='//xpath|//xpath2';      Paste(replace) to input/textarea.  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function() {  var p = function(msg) { diff --git a/history-search-backward.js b/history-search-backward.js index c5bfe0d..45f796f 100644 --- a/history-search-backward.js +++ b/history-search-backward.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>History search backward like UNIX shell.</description> @@ -16,7 +16,7 @@ liberator.globalVariables.history_search_backward_map = ['<C-r>'];  ||<  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function() {      let p = function(msg) { diff --git a/imageextender.js b/imageextender.js index d9078b8..d2452d5 100644 --- a/imageextender.js +++ b/imageextender.js @@ -32,7 +32,7 @@   *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   * */ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>extend image operation.</description> @@ -144,7 +144,7 @@ image_skip_prompt='true'  と設定すると、 ';g' で画像の URL をヤンクする拡張ヒントモードが開始されます。  ';e' で画像を保存しますが、その際ダイアログは表示されません。  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  ( function () { diff --git a/inspector.js b/inspector.js index dac4b4c..884584f 100644 --- a/inspector.js +++ b/inspector.js @@ -1,4 +1,4 @@ -let INFO = +let INFO = xml`  <plugin name="Inspector" version="0.3"          href="http://github.com/vimpr/vimperator-plugins/raw/master/inspector.js"          summary="run DOM Inspector" @@ -25,7 +25,7 @@ let INFO =        <p>inspect the return value of evaluated the <a>expr</a></p>      </description>    </item> -</plugin>; +</plugin>`;  var inspectorID = "inspector@mozilla.org"; diff --git a/jquery-loader.js b/jquery-loader.js index 9248e9e..4589145 100644 --- a/jquery-loader.js +++ b/jquery-loader.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>jQuery Loader</name>    <name lang="ja">jQuery Loader</name> @@ -52,11 +52,10 @@ let PLUGIN_INFO =    <detail lang="ja"><![CDATA[      Load jQuery for commandline.    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="jQueryLoader" version="1.0.1"            href="http://github.com/vimpr/vimperator-plugins/blob/master/jquery-loader.js"            summary="jQuery Loader" @@ -67,7 +66,7 @@ let INFO =      <project name="Vimperator" minVersion="2.3"/>      <p>Load jQuery for commandline.</p>    </plugin> -</>; +`;  // }}}  (function () { diff --git a/jweather.js b/jweather.js index 6959ae9..3232860 100644 --- a/jweather.js +++ b/jweather.js @@ -1,5 +1,5 @@ -// INFO // -var INFO =  +// {{{ INFO +var INFO =xml`  <plugin name="jweather.js" version="0.1"          summary="Get Japanese Weather Report"          href="http://github.com/vimpr/vimperator-plugins/blob/master/jweather.js" @@ -16,7 +16,8 @@ var INFO =        <p>See. <link topic="http://www.weathermap.co.jp/hitokuchi_rss/">http://www.weathermap.co.jp/hitokuchi_rss/</link></p>      </description>    </item> -</plugin>; +</plugin>`; +// }}}  commands.addUserCommand(  	['jw[eather]'], diff --git a/ldc-completer.js b/ldc-completer.js index 562594c..2ce943e 100644 --- a/ldc-completer.js +++ b/ldc-completer.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="LivedoorClipCompleter" version="1.0.0"            href="http://vimpr.github.com/"            summary="Add the completer for Livedoor Clip" @@ -65,7 +64,7 @@ let INFO =        <description><p>同期して、ローカルにインポートする。</p></description>      </item>    </plugin> -</>; +`;  // }}}  (function () { diff --git a/ldrize_cooperation_fetch_flv.js b/ldrize_cooperation_fetch_flv.js index 8ba6737..59e9856 100644 --- a/ldrize_cooperation_fetch_flv.js +++ b/ldrize_cooperation_fetch_flv.js @@ -1,5 +1,5 @@  // Last Change: 12-Jun-2009. Jan 2008
 -var PLUGIN_INFO =
 +var PLUGIN_INFO = xml`
  <VimperatorPlugin>
      <name>{NAME}</name>
      <description>Flv Downloader for Nicovideo</description>
 @@ -42,7 +42,7 @@ Flv downloader for nicovideo.      Nicovideo Mylist of registration destination.
  ||<
      ]]></detail>
 -</VimperatorPlugin>;
 +</VimperatorPlugin>`;
  (function () {
  function Deferred () this instanceof Deferred ? this.init(this) : new Deferred();
 @@ -184,7 +184,7 @@ var groupId = liberator.globalVariables.nicovideo_mylist || '';  function NiconicoFlvHandler(url, title) {
      let videoId = url.match(/\w{2}\d+/)[0];
 -    let fileName = title.replace(/[?\\*\/:<>|"]/g, '_') + '.flv';
 +    let fileName = title.replace(/[?\\*\/:`|"]/g, '_') + '.flv';
      Deferred.http.get(nicoApiEndPoint + videoId).next(function(apiResult){
          let flvUrl = decodeURIComponent(apiResult.responseText.match(/url=(.*?)&/)[1]);
 @@ -218,7 +218,7 @@ function NiconicoMylistHandler(url, title){              var csrfToken = getElementsByXPath('//input[@name="csrf_token"]', html)[0].value;
              var mylists = getElementsByXPath('id("mylist_add_group_id")/option', html).map(function(element) [element.innerHTML, element.value]);
 -            var params = [['ajax', '1'], ['mylist', 'add'], ['mylist_add', 'o^'], ['csrf_token', csrfToken], ['group_id', groupId]].map(function(p) p[0] + "=" + encodeURIComponent(p[1])).join("&");
 +            var params = [['ajax', '1'], ['mylist', 'add'], ['mylist_add', '登録'], ['csrf_token', csrfToken], ['group_id', groupId]].map(function(p) p[0] + "=" + encodeURIComponent(p[1])).join("&");
              return Deferred.wait(count++ * 5).next(function(est){
                  return Deferred.http.post(nicoWatchEndPoint + videoId, params).next(function(mylistResult){
                          liberator.log(mylistResult.responseText);
 diff --git a/literal-bmark.js b/literal-bmark.js index ac2f0a1..ff0d08b 100644 --- a/literal-bmark.js +++ b/literal-bmark.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>literal bmark</name>    <description>:bmark command that can included characters such as '"' in the URL.</description> @@ -58,7 +58,7 @@ let PLUGIN_INFO =          引数は :bmark コマンドと同じですが、URL に '"' などの文字を含めることが出来ます。          ただし、-title などのオプションは URL に先行する必要があります。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Link Opener</name>    <name lang="ja">Link Opener</name> @@ -49,11 +49,10 @@ let PLUGIN_INFO =    <detail><![CDATA[      :help link-opener-plugin    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="link-opener" version="2.4.0"            href="http://github.com/vimpr/vimperator-plugins/blob/master/lo.js"            summary="Link Opener" @@ -153,7 +152,7 @@ let INFO =        </description>      </item>    </plugin> -</>; +`;  // }}}  // Usage: @@ -342,7 +341,7 @@ let INFO =            context.process = [              process[0],              function (item, text) -              (item.thumbnail ? <><img src={item.thumbnail} style={CompItemStyle}/>{text}</> +              (item.thumbnail ? `<img src={item.thumbnail} style={CompItemStyle}/>{text}`                                : process[1].apply(this, arguments))            ];            context.completions = lolinks.map(function (it, i) ({elem: it, index: i})); diff --git a/localkeymode.js b/localkeymode.js index ff46394..639c047 100644 --- a/localkeymode.js +++ b/localkeymode.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>localkeymode</name>    <description>assign temporary keymap</description> @@ -52,7 +52,7 @@ var PLUGIN_INFO =        extra:        noremap, count 等の指定。addUserMap にて使用されます。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.LocalKeyMode = (function() { diff --git a/loginManager.js b/loginManager.js index 80b1eab..efb9e90 100644 --- a/loginManager.js +++ b/loginManager.js @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>login manager</description> @@ -17,7 +17,7 @@ var PLUGIN_INFO =  === TODO ===  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function(){ diff --git a/lolipo-ojisan.js b/lolipo-ojisan.js index 68f2dfb..91b87ff 100644 --- a/lolipo-ojisan.js +++ b/lolipo-ojisan.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>lolipo-ojisan</name>    <name lang="ja">ロリポおじさん</name> @@ -58,11 +58,10 @@ let PLUGIN_INFO =          ロリポおじさんに話しかけます。          [message] を省略すると、魅惑のチャットモードが始まります。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="lolipo-ojisan" version="1.0.1"            href="http://github.com/vimpr/vimperator-plugins/blob/master/lolipo-ojisan.js"            summary="Chat with lolipo-ojisan." @@ -99,7 +98,7 @@ let INFO =        </p></description>      </item>    </plugin> -</>; +`;  // }}} @@ -152,10 +151,10 @@ let INFO =          let you = getContent('.you > div > div > p');          let ojisan = getContent('.ojisan > div > div > p'); -        liberator.echo(<> +        liberator.echo(`            <dt>あなた</dt><dd>{you}</dd>            <dt>ロリポおじさん</dt><dd>{ojisan}</dd> -        </>); +        `);          after && after();        }      ); @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="longcat" version="1.0.0"            href="http://vimpr.github.com/"            summary="Longcat beautifies your life." @@ -50,7 +49,7 @@ let INFO =        <description><p>Meow!</p></description>      </item>    </plugin> -</>; +`;  // }}} @@ -195,7 +194,7 @@ let INFO =      let canvas = doc.createElement('canvas');      let bg = doc.createElement('div'); -    canvas.setAttribute('style', String(<><![CDATA[ +    canvas.setAttribute('style', String(`<![CDATA[        position: absolute; !important;        top: 0px !important;        background-color: black !important; @@ -203,9 +202,9 @@ let INFO =        right: 0;        left: 0;        z-index: 666; -    ]]></>)); +    ]]>`)); -    bg.setAttribute('style', String(<><![CDATA[ +    bg.setAttribute('style', String(`<![CDATA[        position: fixed; !important;        top: 0px;        left: 0px; @@ -213,7 +212,7 @@ let INFO =        width: 100%;        height: 100%;        z-index: 616; -    ]]></>)); +    ]]>`));      canvas.width = 114;      canvas.height = 100 + n * 100 + 30; diff --git a/lookupDictionary.js b/lookupDictionary.js index 6d6e7ff..6ebafc7 100644 --- a/lookupDictionary.js +++ b/lookupDictionary.js @@ -34,14 +34,14 @@ const SITE_DEFINITION = [{      names: ['wikipe[diaja]'],      url: 'http://ja.wikipedia.org/wiki/%s',      shortHelp: 'Wikipedia lite(ja)', -    xpath: 'id("bodyContent")/p[1]', +    xpath: 'id("mw-content-text")/p[1]',      dictionary: 'ja'  },{      names: ['wikipe[diaen]'],      url: 'http://en.wikipedia.org/wiki/%s',      shortHelp: 'Wikipedia lite(en)', -    xpath: 'id("bodyContent")/p[1]', -    dictionary: 'en' +    xpath: 'id("mw-content-text")/p[1]', +    dictionary: 'en-US'  }];  let (siteDef = liberator.globalVariables.lookupDictionary_site_definition) { @@ -164,34 +164,38 @@ SITE_DEFINITION.forEach(function (dictionary) {                  url = dictionary.url.replace(/%s/g,encodeURIComponent(arg));              }              //liberator.log('URL: ' +url); -            var result; -            getHTML(url, function (str) { -                var doc = createHTMLDocument(str); +            getHTML(url, function (doc) {                  var result = getNodeFromXPath(dictionary.xpath, doc, dictionary.multi);                  if (!result) {                      liberator.echoerr('Nothing to show...'); +                    return;                  } +                result = sanitizeScript(result);                  var xs = new XMLSerializer(); -                liberator.echo(new XMLList('<div style="white-space:normal;"><base href="' + util.escapeHTML(url) + '"/>' + xs.serializeToString( result ).replace(/<[^>]+>/g,function (all) all.toLowerCase() ) + '</div>'), true); +                liberator.echo(xml`<div style="white-space:normal;"> +                    <base href=${util.escapeHTML(url)}/> +                    ${template.maybeXML(xs.serializeToString( result ))} +                </div>`);              }, dictionary.srcEncode ? dictionary.srcEncode : null);          },          { -            completer: function (arg) { +            completer: function (context, args) {                  if (!spellChecker ||                      !dictionary.dictionary ||                      !spellChecker.setDictionary(dictionary.dictionary)) -                return [0, []]; +                return; -                var suggestions = spellChecker.suggest(arg); +                var filter = context.filter; +                var suggestions = spellChecker.suggest(filter);                  var candidates = [];                  for (let i=0, max=suggestions.length ; i<max ; ++i) {                      candidates.push([suggestions[i], 'suggest']);                  } -                if (!spellChecker.check(arg)) { +                if (!spellChecker.check(filter)) {                      candidates.unshift(['', 'not exist']);                  } -                return [0, candidates]; +                context.completions = candidates;              },              bang: true          } @@ -210,30 +214,30 @@ commands.addUserCommand(   */  function getHTML(url, callback, charset) {      var xhr= new XMLHttpRequest(); +    xhr.open('GET',url,true); +    xhr.responseType = "document";      xhr.onreadystatechange = function () {          if (xhr.readyState == 4) {              if (xhr.status == 200) { -                callback.call(this,xhr.responseText); +                callback.call(this,xhr.response);              } else {                  throw new Error(xhr.statusText);              }          }      }; -    xhr.open('GET',url,true);      if (charset) xhr.overrideMimeType('text/html; charset=' + charset);      xhr.send(null);  }  /** - * @param {String} str - * @return {DOMDocument} + * sanitize script element + * @param {Element} element + * @return {Element}   */ -function createHTMLDocument(str) { -    str = str.replace(/^[\s\S]*?<html(?:[ \t\r\n][^>]*)?>[ \t\n\r]*|[ \t\n\r]*<\/html[ \t\r\n]*>[\S\s]*$/ig,'').replace(/[\r\n]+/g,' '); -    var htmlFragment = content.document.implementation.createDocument(null,'html',null); -    var range = content.document.createRange(); -    range.setStartAfter(window.content.document.body); -    htmlFragment.documentElement.appendChild(htmlFragment.importNode(range.createContextualFragment(str),true)); -    return htmlFragment; +function sanitizeScript (element) { +    for (let node of element.querySelectorAll("script")){ +        node.parentNode.removeChild(node); +    } +    return element;  }  /**   * @param {String} xpath XPath Expression @@ -247,8 +251,10 @@ function getNodeFromXPath(xpath,doc,isMulti) {      if (isMulti) {          let nodesSnapshot = doc.evaluate(xpath,doc.documentElement,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);          if (nodesSnapshot.snapshotLength == 0) return; -        result = document.createElementNS(null,'div'); -        for (let i=0; i<nodesSnapshot.snapshotLength; result.appendChild(nodesSnapshot.snapshotItem(i++))); +        result = doc.createElementNS(XHTML.uri,'div'); +        for (let i=0, len = nodesSnapshot.snapshotLength; i<len; i++) { +            result.appendChild(nodesSnapshot.snapshotItem(i)); +        }      } else {          let node = doc.evaluate(xpath,doc.documentElement,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null);          if (!node.singleNodeValue) return; diff --git a/maine_coon.js b/maine_coon.js index ad0023f..fab21ca 100644 --- a/maine_coon.js +++ b/maine_coon.js @@ -32,7 +32,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  */ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Maine Coon</name>    <name lang="ja">メインクーン</name> @@ -139,7 +139,7 @@ let PLUGIN_INFO =      == メインクーン ==        http://ja.wikipedia.org/wiki/%E3%83%A1%E3%82%A4%E3%83%B3%E3%82%AF%E3%83%BC%E3%83%B3    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function () { diff --git a/marker_reader.js b/marker_reader.js index d6fe0a1..2bd1c7c 100644 --- a/marker_reader.js +++ b/marker_reader.js @@ -5,7 +5,7 @@    http://www.gnu.org/copyleft/gpl.html  }}}  END LICENSE BLOCK ***/  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>marker PageDown/PageUp.</description> @@ -44,7 +44,7 @@ let g:marker_reader_mapping = "J,K"  adds mapping J = mnext, K = mprev.  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  plugins.marker_reader = (function() { diff --git a/matanico.js b/matanico.js index 6e25421..802d167 100644 --- a/matanico.js +++ b/matanico.js @@ -1,4 +1,4 @@ -let PLUGIN_INFO =
 +let PLUGIN_INFO = xml`
  <VimperatorPlugin>
  <name>{NAME}</name>
  <description>update Twitter status to current video/search page information and comment.</description>
 @@ -111,7 +111,7 @@ matanico_related_tag_format:  matanico_related_tag_servicename:
      matanico_related_tag_format で指定した $SERVICENAME 部分がこの値で展開されます。書式はそのままで投稿する文字列のみを変更したい場合にこの値を変更することで設定が容易になります。設定なしの場合 "またキーワードでニコニコタグ検索してる" が使用されます。
  ]]></detail>
 -</VimperatorPlugin>;
 +</VimperatorPlugin>`;
  (function () {
 @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <description>Write a memo to the specified file.</description> @@ -59,7 +59,7 @@ let PLUGIN_INFO =        :memo fooooobar!          "fooooobar!" と、メモに書く    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // References: @@ -122,9 +122,9 @@ let PLUGIN_INFO =        if (arg.literalArg) {          puts(arg.literalArg);        } else { -        let out = <></>; +        let out = xml``;          gets().split(/\n/).reverse().forEach(function (l) { -          out += <li>{l}</li> +          out += xml`<li>${l}</li>`;          });          liberator.echo(out);        } @@ -142,16 +142,16 @@ let PLUGIN_INFO =            let desc = item[1] || this.process[1].call(this, item, item.description);            if (item.description && item.description.length) { -            return <div highlight={highlightGroup || "CompItem"} style="white-space: nowrap"> +            return xml`<div highlight=${highlightGroup || "CompItem"} style="white-space: nowrap">                  <li highlight="CompDesc"> -                  {item.description} +                  ${item.description}                  </li> -            </div>; +            </div>`;            } -          return <div highlight={highlightGroup || "CompItem"} style="white-space: nowrap"> -              <li highlight="CompDesc">{item[0]} </li> -          </div>; +          return xml`<div highlight=${highlightGroup || "CompItem"} style="white-space: nowrap"> +              <li highlight="CompDesc">${item[0]} </li> +          </div>`;          };          context.filters = [function (item) this.match(item.description)]; diff --git a/microUpdate.js b/microUpdate.js index 274e20a..85e681e 100644 --- a/microUpdate.js +++ b/microUpdate.js @@ -31,7 +31,7 @@  // }}}  // PLUGIN INFO: {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <description>Update blog more quickly.</description> @@ -67,7 +67,7 @@ let PLUGIN_INFO =      == ToDo ==    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  plugins.microUpdate = (function() { @@ -84,12 +84,12 @@ plugins.microUpdate = (function() {        transport.open('POST', this.endpoint['collection'], false /* synchronous */);        transport.setRequestHeader('X-WSSE', hatena.wsseHeader);        transport.setRequestHeader('Content-Type', 'application/atom+xml;type=entry;charset="utf-8"'); -      transport.send(<> +      transport.send(`            <entry xmlns="http://purl.org/atom/ns#">              <title>{title}</title>              <content type="text/plain">{content}</content>            </entry> -      </>.toXMLString()); +      `.toXMLString());        return transport.responseXML;      }    }; diff --git a/microsoft-translator.js b/microsoft-translator.js index 57ced85..927b033 100644 --- a/microsoft-translator.js +++ b/microsoft-translator.js @@ -1,6 +1,6 @@  /* NEW BSD LICENSE {{{  Copyright (c) 2009-2010, anekos. -Copyright (c) 2012, Jagua. +Copyright (c) 2012-2013, Jagua.  All rights reserved.  Redistribution and use in source and binary forms, with or without modification, @@ -33,26 +33,8 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */ -// PLUGIN_INFO {{{ -let PLUGIN_INFO = -<VimperatorPlugin> -  <name>Microsoft Translator</name> -  <name lang="ja">Microsoft Translator</name> -  <description>Translate with Microsoft AJAX Language API</description> -  <version>1.0.0</version> -  <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author> -  <author homepage="https://github.com/Jagua">Jagua</author> -  <license>new BSD License (Please read the source code comments of this plugin)</license> -  <license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license> -  <updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/microsoft-translator.js</updateURL> -  <require>_libly.js</require> -  <minVersion>2.3</minVersion> -  <maxVersion>3.3</maxVersion> -</VimperatorPlugin>; -// }}} -  // INFO {{{ -let INFO = +let INFO = xml`  <plugin name="Microsoft Translator" version="1.0.0"          href="http://github.com/vimpr/vimperator-plugins/blob/master/microsoft-translator.js"          summary="Translate with Microsoft AJAX Language API" @@ -90,7 +72,7 @@ let INFO =        </dl>      </description>    </item> -</plugin>; +</plugin>`;  // }}}  (function () { diff --git a/migemized_find.js b/migemized_find.js index 5930e16..22a738e 100644 --- a/migemized_find.js +++ b/migemized_find.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="MigemizedFind" version="2.11.5"            href="http://vimpr.github.com/"            summary="Search and Highlight with Migemo." @@ -99,7 +98,7 @@ let INFO =        </p></description>      </item>    </plugin> -</>; +`;  // }}}  (function () { @@ -256,7 +255,7 @@ let INFO =    }    let colorsCompltions = [ -    [name, <span style={'color: ' + name}>{'\u25a0 ' + value}</span>] +    [name, xml`<span style=${'color: ' + name}>${'\u25a0 ' + value}</span>`]      for each ([name, value] in Iterator(colors))    ]; diff --git a/migemo-find.js b/migemo-find.js index 22560ad..ed529f8 100644 --- a/migemo-find.js +++ b/migemo-find.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Replace default search to migemo.</description> @@ -25,7 +25,7 @@ migemo-find.js は pIXMigemoFind が提供している XUL/Migemo のインタ  -- 検索開始文字の先頭が \ なら、通常の検索を行う。migemo りたくない時など用に  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.migemoFind = (function() {      let p = function(m) Application.console.log(m); diff --git a/mixiecho.js b/mixiecho.js index 2f27b7c..d08af50 100644 --- a/mixiecho.js +++ b/mixiecho.js @@ -83,13 +83,13 @@  		]]></style>.toSource()
  				   .replace(/(?:\r?\n|\r)[ \t]*/g, " ") +
  			statuses.map(function(status)
 -				<>
 +				`
  					<img src={status.user.profile_image_url}
  						 alt={status.user.screen_name}
  						 title={status.user.screen_name}
  						 class="twitter photo"/>
  					<strong>{status.user.name}‬</strong>
 -				</>.toSource()
 +				`.toSource()
  				   .replace(/(?:\r?\n|\r)[ \t]*/g, " ") +
  					sprintf(': <span class="twitter entry-content">%s‬</span>', status.text))
  						.join("<br/>");
 @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>mkcolor</name>    <name lang="ja">mkcolor</name> @@ -51,7 +51,7 @@ let PLUGIN_INFO =        - mkcolor <FILENAME>          <FILENAME> に現在の Highlight 設定を書き出します。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Morse</name>    <name lang="ja">Morse</name> @@ -54,10 +54,10 @@ let PLUGIN_INFO =      :morse text:        output text by morse code.    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = +let INFO = xml`  <plugin name="Morse" version="1.2.1"          href="http://github.com/vimpr/vimperator-plugins/blob/master/morse.js"          summary="Morse code" @@ -76,7 +76,7 @@ let INFO =        </p>      </description>    </item> -</plugin>; +</plugin>`;  // }}} diff --git a/mouse_gestures.js b/mouse_gestures.js index bde92f4..21b3aa7 100644 --- a/mouse_gestures.js +++ b/mouse_gestures.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Mouse Gestures</name>    <name lang='ja'>マウスジェスチャー</name> @@ -68,7 +68,7 @@ var PLUGIN_INFO =      - noremap flag        キーを送る、かつ、そのキーコードを noremap で処理を行いたい場合、true を指定してください。    ]]></detail> -</VimperatorPlugin> +</VimperatorPlugin>`;  liberator.plugins.MouseGestures = (function() { diff --git a/mpd-currentsong.js b/mpd-currentsong.js index 983d9ef..f852b9a 100644 --- a/mpd-currentsong.js +++ b/mpd-currentsong.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="MPDCurrentSong" version="1.0.0"            href="http://vimpr.github.com/"            summary="Get current song for MPD" @@ -45,7 +44,7 @@ let INFO =      <project name="Vimperator" minVersion="3.0"/>      <p>        <code><![CDATA[ -:cabbrev -javascript .song let (song = plugins.mpdCurrentsong.API.getSongInfo()) <>{song.Title} / {song.Artist} #NowPlaying</> +:cabbrev -javascript .song let (song = plugins.mpdCurrentsong.API.getSongInfo()) xml\`\${song.Title} / \${song.Artist} #NowPlaying\`        ]]> </code>      </p>    </plugin> @@ -59,11 +58,11 @@ let INFO =      <project name="Vimperator" minVersion="3.0"/>      <p>        <code><![CDATA[ -:cabbrev -javascript .song let (song = plugins.mpdCurrentsong.API.getSongInfo()) <>{song.Title} / {song.Artist} #NowPlaying</> +:cabbrev -javascript .song let (song = plugins.mpdCurrentsong.API.getSongInfo()) xml\`\${song.Title} / \${song.Artist} #NowPlaying\`        ]]> </code>      </p>    </plugin> -</>; +`;  // }}} diff --git a/multi-exec.js b/multi-exec.js index 0c21093..cb93311 100644 --- a/multi-exec.js +++ b/multi-exec.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Multi-execute</name>    <description>Add the command which execute some ex-commands.</description> @@ -70,7 +70,7 @@ let PLUGIN_INFO =            :mx ; echo 1 ; echo 2          ||<    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/multi_requester.js b/multi_requester.js index f075779..90ca321 100644 --- a/multi_requester.js +++ b/multi_requester.js @@ -5,18 +5,16 @@    http://www.opensource.jp/licenses/mit-license.html  }}}  END LICENSE BLOCK ***/  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = -<VimperatorPlugin> -  <name>{NAME}</name> -  <description>request, and the result is displayed to the buffer.</description> -  <description lang="ja">リクエストの結果をバッファに出力する。</description> -  <author mail="suvene@zeromemory.info" homepage="http://zeromemory.sblo.jp/">suVene</author> -  <version>0.4.16</version> -  <license>MIT</license> -  <minVersion>2.0pre</minVersion> -  <maxVersion>2.3</maxVersion> -  <updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/multi_requester.js</updateURL> -  <detail><![CDATA[ +var INFO = xml` +<plugin name="multi_requester" version="0.4.16" +        href="https://github.com/vimpr/vimperator-plugins/raw/master/multi_requester.js" +        summary="request, and the result is displayed to the buffer." +        xmlns="http://vimperator.org/namespaces/liberator"> +    <author href="http://zeromemory.sblo.jp/">suVene</author> +    <license>MIT</license> +    <project name="Vimperator" minVersion="3.6"/> +    <p> +      <code><![CDATA[  == Needs Library ==  - _libly.js(ver.0.1.19)    @see http://coderepos.org/share/browser/lang/javascript/vimperator-plugins/trunk/_libly.js @@ -99,9 +97,9 @@ let g:multi_requester_order = 'count'; // date by default  ||<  補完の順番を設定します。(大きい順に並びます)  "count" または "date" を設定してください。 - -   ]]></detail> -</VimperatorPlugin>; +      ]]></code> +    </p> +</plugin>`;  //}}}  (function() {  if (!liberator.plugins.libly) { diff --git a/my-style.js b/my-style.js index 2ae6098..6d69312 100644 --- a/my-style.js +++ b/my-style.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="MyStyle" version="1.0.0"            href="http://vimpr.github.com/"            summary="Apply my style sheet to current page." @@ -121,7 +120,7 @@ EOM        </description>      </item>    </plugin> -</>; +`;  // }}}  (function () { @@ -129,14 +128,14 @@ EOM    const StyleNamePrefix = 'my-style-';    const DefaultDefinedStyle = { -    BLACKBOARD: <><![CDATA[ +    BLACKBOARD: `<![CDATA[        * {          color: white !important;          background-color: #004040 !important;          background-image: none !important;        } -    ]]></>, -    NEKOME: <><![CDATA[ +    ]]>`, +    NEKOME: `<![CDATA[        body {          background-image: url(http://snca.net/images/redeye.jpg) !important;        } @@ -144,15 +143,15 @@ EOM          background: transparent !important;          color: white !important;        } -    ]]></>, -    VIMPMASK: <><![CDATA[ +    ]]>`, +    VIMPMASK: `<![CDATA[        body {          background-image: url(http://snca.net/images/ildjarn.png) !important;          background-repeat: no-repeat !important;          background-position: right bottom !important;          background-attachment: fixed !important;        } -    ]]></> +    ]]>`    };    if (!__context__.DefinedStyles) { diff --git a/namakubi.js b/namakubi.js index 7d389f5..46d4ed6 100644 --- a/namakubi.js +++ b/namakubi.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Namakubi</name>    <name lang="ja">生首</name> @@ -60,10 +60,10 @@ let PLUGIN_INFO =        喋ります!    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = +let INFO = xml`  <plugin name="生首" version="1.0.0"          href="http://github.com/vimpr/vimperator-plugins/blob/master/namakubi.js"          summary="Wonderful Namakubi Talker" @@ -108,7 +108,7 @@ let INFO =      <link topic="http://chi.usamimi.info/Program/Application/BouyomiChan/">http://chi.usamimi.info/Program/Application/BouyomiChan/</link>      で Windows 用バイナリが手に入ります。    </p> -</plugin>; +</plugin>`;  // }}}  (function () { @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="Newtab" version="1.0.0"            href="http://vimpr.github.com/"            summary="Add about:newtab URL Completer." @@ -50,7 +49,7 @@ let INFO =        ]]></code>      </p>    </plugin> -</>; +`;  // }}}  (function () { diff --git a/nextlink.js b/nextlink.js index e96ea1c..df6e073 100644 --- a/nextlink.js +++ b/nextlink.js @@ -5,7 +5,7 @@    http://www.gnu.org/copyleft/gpl.html  }}}  END LICENSE BLOCK ***/  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>nextlink</name>    <description>mapping "[[", "]]" by AutoPagerize XPath.</description> @@ -62,7 +62,7 @@ n:  == TODO ==    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  liberator.plugins.nextlink = (function() { diff --git a/nicolist.js b/nicolist.js index 854a869..c4892d9 100644 --- a/nicolist.js +++ b/nicolist.js @@ -3,7 +3,7 @@   * http://twitter.com/ebith   */ -var INFO = +var INFO = xml`  <plugin name="nicolist"          version="0.3"          summary="ニコニコ動画のマイリストを操作します" @@ -31,7 +31,7 @@ var INFO =      <spec>:nicolist open <a>mylist-id</a> <a>video-id</a></spec>      <description><p><a>mylist-id</a>のみであればマイリストを、<a>video-id</a>の指定もあれば動画を開きます</p></description>    </item> -</plugin>; +</plugin>`;  commands.addUserCommand(    ['nicolist'], diff --git a/nnp_cooperation.js b/nnp_cooperation.js index ea96aac..94a109a 100644 --- a/nnp_cooperation.js +++ b/nnp_cooperation.js @@ -140,7 +140,7 @@ liberator.modules.commands.addUserCommand(          }
          // evaluate variables
 -        let xml = <>
 +        let xml = `
              {style()}
              {table({
                  numofDisplay: (nodesLength < numofList) ? nodesLength : numofList,
 @@ -149,7 +149,7 @@ liberator.modules.commands.addUserCommand(                  statuses:     getStatusText(playlistNode.id),
                  items:        items,
              })}
 -        </>
 +        `
          liberator.echo(xml, liberator.modules.commandline.FORCE_MULTILINE);
      },
 diff --git a/notifier.js b/notifier.js index cb78c9d..ff5266f 100644 --- a/notifier.js +++ b/notifier.js @@ -5,7 +5,7 @@    http://www.opensource.jp/licenses/mit-license.html  }}}  END LICENSE BLOCK ***/  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <description>change notice framework.</description> @@ -122,7 +122,7 @@ buildMessages(diff):    this.diff() により抽出されたオブジェクトを元に、liberator.plugins.notifier.Message のインスタンス、    または、その配列を返却して下さい。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function() {  if (!liberator.plugins.libly) { @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="nume" version="1.0.0"            href="http://vimpr.github.com/"            summary="Make numeronymized text." @@ -50,7 +49,7 @@ let INFO =        <description><p>Make numeronymized text.</p></description>      </item>    </plugin> -</>; +`;  // }}} @@ -1,5 +1,5 @@ -// INFO // -var INFO = +// {{{ INFO +var INFO =xml`  <plugin name="onclick.js" version="0.2"          summary="Emulate onClick event."          href="http://github.com/vimpr/vimperator-plugins/blob/master/onclick.js" @@ -27,7 +27,8 @@ For Exsample,        ]]></code>      </description>    </item> -</plugin>; +</plugin>`; +// }}}  (function(){    let onclick=function(args){ diff --git a/open-frame.js b/open-frame.js index 945128d..1560b56 100644 --- a/open-frame.js +++ b/open-frame.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>openframe-command</name>    <name lang="ja">openframeコマンド</name> @@ -52,11 +52,10 @@ let PLUGIN_INFO =    <detail lang="ja"><![CDATA[      コマンド "openframe" と "tabopenframe" を追加します。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="openframe-command" version="1.2.1"            href="http://github.com/vimpr/vimperator-plugins/blob/master/open-frame.js"            summary="Add openframe command." @@ -95,7 +94,7 @@ let INFO =        <description><p>新しいタブに選択したフレームを開く</p></description>      </item>    </plugin> -</>; +`;  // }}}  (function () { @@ -1,5 +1,5 @@  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>opener</name>    <name lang="ja">opener</name> @@ -17,11 +17,10 @@ let PLUGIN_INFO =    <detail lang="ja"><![CDATA[      URL 移動時にそのURLが既に開かれていたら、そのタブに移動する    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="opener" version="1.0.0"            href="http://github.com/vimpr/vimperator-plugins/blob/master/opener.js"            summary="URL 移動時にそのURLが既に開かれていたら、そのタブに移動する" @@ -31,7 +30,7 @@ let INFO =      <project name="Vimperator" minVersion="2.3"/>      <p>URL 移動時にそのURLが既に開かれていたら、そのタブに移動する</p>    </plugin> -</>; +`;  // }}}  /* diff --git a/option-selector.js b/option-selector.js index ee29dc7..db4609f 100644 --- a/option-selector.js +++ b/option-selector.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Option Selector</name>    <description>Select a option of the select element.</description> @@ -51,7 +51,7 @@ let PLUGIN_INFO =    <detail lang="ja"><![CDATA[       "select" 要素上で <C-i> を打つ。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/options-migrate-user-pref.js b/options-migrate-user-pref.js index 07aa8a7..229c0b5 100644 --- a/options-migrate-user-pref.js +++ b/options-migrate-user-pref.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>options migrate user_pref</description> @@ -41,7 +41,7 @@ EOF  ||<  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function() {      let p = function(msg) { @@ -30,7 +30,7 @@  //  // }}}  // PLUGIN INFO: {{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <description>Open livedoor Reader pinned items</description> @@ -142,7 +142,7 @@ var PLUGIN_INFO =        linkに該当するピンを一覧から削除する。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  let self = liberator.plugins.pino = (function() {    // COMMAND /////////////////////////////////////////////////////// {{{ @@ -159,13 +159,13 @@ let self = liberator.plugins.pino = (function() {        if (args["-list"]) {          //let items = pins.items(); -        let list = <div>{items.length} items. +        let list = xml`<div>{items.length} items.                      <ul>{                        [<li><a href={i.link}>{i.title}</a><br/></li>                          for each (i in items)                        ].reduce(function(a, b) a + b)                      }</ul> -                   </div>; +                   </div>`;          liberator.echo(list, commandline.FORCE_MULTILINE);          return;        } @@ -1,5 +1,5 @@  // {{{ INFO -var INFO = +var INFO =xml`  <plugin name="pixiv.js" version="0.7.3"          summary="Download image from pixiv"          href="http://github.com/vimpr/vimperator-plugins/blob/master/pixiv.js" @@ -19,7 +19,7 @@ var INFO =        <p>You must login pixiv.</p>      </description>    </item> -</plugin>; +</plugin>`;  // }}}  commands.addUserCommand( diff --git a/pluginManager.js b/pluginManager.js index f191b9a..26442a3 100644 --- a/pluginManager.js +++ b/pluginManager.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Manage Vimperator Plugins</description> @@ -99,7 +99,7 @@ detail:  - スタイルの追加(これはすべき?)  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.pluginManager = (function(){ @@ -109,22 +109,22 @@ var tags = { // {{{      name: function(info) fromUTF8Octets(info.toString()),      author: function(info){          var name = fromUTF8Octets(info.toString()); -        var xml = <>{name}</>; +        var xml = `{name}`;          if (info.@mail.toString() != '') -            xml += <><span> </span><<a href={'mailto:'+name+' <'+info.@mail+'>'} highlight="URL">{info.@mail}</a>></>; +            xml += `<span> </span><<a href={'mailto:'+name+' <'+info.@mail+'>'} highlight="URL">{info.@mail}</a>>`;          if (info.@homepage.toString() != '') -            xml += <><span> </span>({makeLink(info.@homepage.toString())})</>; +            xml += `<span> </span>({makeLink(info.@homepage.toString())})`;          return xml;      },      description: function(info) makeLink(fromUTF8Octets(info.toString())),      license: function(info){ -        var xml = <>{fromUTF8Octets(info.toString())}</>; +        var xml = `{fromUTF8Octets(info.toString())}`;          if (info.@document.toString() != '') -            xml += <><span> </span>{makeLink(info.@document.toString())}</>; +            xml += `<span> </span>{makeLink(info.@document.toString())}`;          return xml;      },      require: function(infos){ -        let xml = <></>; +        let xml = ``;          for (let i=0; i<infos.length(); i++){              let info = infos[i];              let name = info.toString(); @@ -195,10 +195,10 @@ function makeLink(str, withLink){      while (s.length > 0) {          let m = s.match(/(?:https?:\/\/|mailto:)\S+/);          if (m) { -            result += <>{s.slice(0, m.index)}<a href={withLink ? m[0] : '#'} highlight="URL">{m[0]}</a></>; +            result += `{s.slice(0, m.index)}<a href={withLink ? m[0] : '#'} highlight="URL">{m[0]}</a>`;              s = s.slice(m.index + m[0].length);          } else { -            result += <>{s}</>; +            result += `{s}`;              break;          }      } @@ -230,7 +230,7 @@ Plugin.prototype = { // {{{      initialize: function(path, context){          this.path = path;          this.name = context.NAME; -        this.info = context.PLUGIN_INFO || <></>; +        this.info = context.PLUGIN_INFO || ``;          this.getItems();      },      getItems: function(){ @@ -386,7 +386,7 @@ var WikiParser = (function () {          return new arguments.callee(lines, result, indents);      this.lines = lines; -    this.result = result || <></>; +    this.result = result || ``;      this.indents = indents || [];    }    State.prototype = { @@ -439,7 +439,7 @@ var WikiParser = (function () {      Array.concat(ary);    function xmlJoin (xs, init) { -    let result = init || <></>; +    let result = init || ``;      for (let i = 0, l = xs.length; i < l; i++)        result += xs[i];      return result; @@ -470,13 +470,13 @@ var WikiParser = (function () {    // FIXME    function link (s) {      let m; -    let result = <></>; +    let result = ``;      while (s && (m = s.match(/(?:https?:\/\/|mailto:)\S+/))) { -      result += <>{RegExp.leftContext || ''}<a href={m[0]}>{m[0]}</a></>; +      result += `{RegExp.leftContext || ''}<a href={m[0]}>{m[0]}</a>`;        s = RegExp.rightContext;      }      if (s) -      result += <>{s}</>; +      result += `{s}`;      return result;    } @@ -591,7 +591,7 @@ var WikiParser = (function () {          if (m) {            let h = m[2];            let next = C.many(self.wikiLine)(st.next.indent(m[1])); -          return next.indentBack().set(xmlJoin([<>{h}<br/></>].concat(next.result))).wrap('li'); +          return next.indentBack().set(xmlJoin([`{h}<br/>`].concat(next.result))).wrap('li');          }          return Error(c, st);        }; @@ -606,7 +606,7 @@ var WikiParser = (function () {        emptyLine: function emptyLine (st) {          if (/^\s*$/.test(st.head)) { -          return st.next.set(<></>); +          return st.next.set(``);          }          return Error('spaces', st);        }, @@ -614,7 +614,7 @@ var WikiParser = (function () {        // St -> St XML        plain: function plain (st) {          let text = st.head; -        return st.next.set(<>{stripAndLink(text)}<br/></>); +        return st.next.set(`{stripAndLink(text)}<br/>`);        },        // St -> St XML @@ -750,7 +750,7 @@ HTMLStack.prototype = { // {{{          }          var buf = this.last[this.last.length()-1];          if (buf.nodeKind() == 'text'){ -            this.last[this.last.length()-1] += this.isInline(xml) ? <><br/>{xml}</> : xml; +            this.last[this.last.length()-1] += this.isInline(xml) ? `<br/>{xml}` : xml;          } else if (this.isInline(xml)){              this.stack[this.length-1] += xml;          } else if (buf.localName() == xml.localName()){ @@ -783,7 +783,7 @@ HTMLStack.prototype = { // {{{              if (tmp[tmp.length()-1].nodeKind() == 'element'){                  buf[buf.length()-1].* += xml;              } else { -                buf[buf.length()-1].* += <><br/>{xml}</>; +                buf[buf.length()-1].* += `<br/>{xml}`;              }          } else {              this.last[this.last.length()-1].* += xml; @@ -965,14 +965,14 @@ var public = {          return plugins.filter(function(plugin) names.indexOf(plugin.name) >= 0);      },      checkVersion: function(names){ -        let xml = <></>; +        let xml = ``;          this.getPlugins(names).forEach(function(plugin){              xml += plugin.checkVersion();          });          return xml;      },      update: function(names){ -        let xml = <></>; +        let xml = ``;          this.getPlugins(names).forEach(function(plugin){              xml += plugin.updatePlugin();          }); @@ -986,7 +986,7 @@ var public = {          return;      },      list: function(names, verbose){ -        let xml = <></> +        let xml = ``          this.getPlugins(names).forEach(function(plugin){              xml += plugin.itemFormatter(verbose);          }); diff --git a/plugin_loader.js b/plugin_loader.js index b304fbf..d71a310 100644 --- a/plugin_loader.js +++ b/plugin_loader.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Plugin Loader</name>    <name lang="ja">プラグインローダー</name> @@ -60,7 +60,7 @@ let PLUGIN_INFO =      == Link ==         http://d.hatena.ne.jp/nokturnalmortum/20081008#1223397705    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}} diff --git a/prevent_focus_ietab.js b/prevent_focus_ietab.js index 4417175..4bf467f 100644 --- a/prevent_focus_ietab.js +++ b/prevent_focus_ietab.js @@ -8,7 +8,7 @@  // }}}  //  // PLUGIN INFO: {{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>prevent_focus_ietab</name>    <description>This plugin prevents focusing IETab automaticaly.</description> @@ -31,7 +31,7 @@ var PLUGIN_INFO =      == 使い方 ==      vimpのpluginディレクトリにこのファイルを格納してください。それだけです。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function() { diff --git a/property-panel.js b/property-panel.js index 8a92797..fea7229 100644 --- a/property-panel.js +++ b/property-panel.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="PropertyPanel" version="1.0.0"            href="http://vimpr.github.com/"            summary="Show a object in Property Panel." @@ -53,7 +52,7 @@ let INFO =        </p></description>      </item>    </plugin> -</>; +`;  // }}} @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>pypi</name>  <description>Add a pypi command</description> @@ -15,7 +15,7 @@ var PLUGIN_INFO =  :pypi {package or term}  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.pypi = (function(){ diff --git a/readcatlater.js b/readcatlater.js index 770bc3e..4b0ccd9 100644 --- a/readcatlater.js +++ b/readcatlater.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Read Cat Later</name>    <description>Read it later</description> @@ -73,7 +73,7 @@ let PLUGIN_INFO =      == Link ==         http://d.hatena.ne.jp/nokturnalmortum/20080918#1221729188    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/readitlater.js b/readitlater.js index 32ebed4..74f1453 100644 --- a/readitlater.js +++ b/readitlater.js @@ -5,7 +5,7 @@   * TODO:ADDにbufferからのリストを入れられるように  */ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>  	<name>readitlater</name>  	<description lang="ja">Read it Later を快適に使うためのプラグインです</description> @@ -55,7 +55,7 @@ let PLUGIN_INFO =  	]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function(){ @@ -412,18 +412,18 @@ let PLUGIN_INFO =  		req.addEventListener("success",function(data){  			let res = libly.$U.evalJson(data.responseText); -			liberator.echo( +			liberator.echo(xml`  			<style type="text/css"><![CDATA[  				div.stats{font-weight:bold;text-decoration:underline;color:gold;padding-left:1em;line-height:1.5em;} -			]]></style> + -			<div>#ReadItLater Stats</div> + -			<div class="stats"> -				since : {unixtimeToDate(res.user_since)} <br /> -				list : {res.count_list} <br /> -				unread : {res.count_unread} <br /> -				read : {res.count_read} <br /> +			]]></style>` + +			xml`<div>#ReadItLater Stats</div>` + +			xml`<div class="stats"> +				since : ${unixtimeToDate(res.user_since)} <br /> +				list : ${res.count_list} <br /> +				unread : ${res.count_unread} <br /> +				read : ${res.count_read} <br />  			</div> -			); +			`);  		});  		req.addEventListener("failure",function(data){ @@ -452,17 +452,17 @@ let PLUGIN_INFO =  		);  		req.addEventListener("success",function(data){ -			liberator.echo( +			liberator.echo(xml`  			<div> -				X-Limit-User-Limit : {data.transport.getResponseHeader("X-Limit-User-Limit")} <br /> -				X-Limit-User-Remaining : {data.transport.getResponseHeader("X-Limit-User-Remaining")} <br /> -				X-Limit-User-Reset : {data.transport.getResponseHeader("X-Limit-User-Reset")} <br /> -				X-Limit-Key-Limit : {data.transport.getResponseHeader("X-Limit-Key-Limit")} <br /> -				X-Limit-Key-Remaining : {data.transport.getResponseHeader("X-Limit-Key-Remaining")} <br /> -				X-Limit-Key-Reset : {data.transport.getResponseHeader("X-Limit-Key-Reset")} <br /> +				X-Limit-User-Limit : ${data.transport.getResponseHeader("X-Limit-User-Limit")} <br /> +				X-Limit-User-Remaining : ${data.transport.getResponseHeader("X-Limit-User-Remaining")} <br /> +				X-Limit-User-Reset : ${data.transport.getResponseHeader("X-Limit-User-Reset")} <br /> +				X-Limit-Key-Limit : ${data.transport.getResponseHeader("X-Limit-Key-Limit")} <br /> +				X-Limit-Key-Remaining : ${data.transport.getResponseHeader("X-Limit-Key-Remaining")} <br /> +				X-Limit-Key-Reset : ${data.transport.getResponseHeader("X-Limit-Key-Reset")} <br />  			</div> -			); +			`);  		});  		req.addEventListener("failure",function(data){ diff --git a/refcontrol.js b/refcontrol.js index 54261b3..d5ef0fb 100644 --- a/refcontrol.js +++ b/refcontrol.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>refcontrol</name>    <description>control referrer</description> @@ -40,7 +40,7 @@ param:    url:      指定したURLでリファラーを送信します。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.RefControl = (function() { @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="refe" version="1.0.0"            href="http://vimpr.github.com/"            summary="refe (Ruby reference) for vimperator" @@ -75,7 +74,7 @@ let INFO =        <description><p>補完で検索し、リファレンスのページを新しいタブに開きます。</p></description>      </item>    </plugin> -</>; +`;  // }}}  (function () { diff --git a/relatedBlogSearch.js b/relatedBlogSearch.js index e1987e2..f79cf14 100644 --- a/relatedBlogSearch.js +++ b/relatedBlogSearch.js @@ -1,4 +1,4 @@ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Show/Open related blog</description> @@ -62,7 +62,7 @@ let コマンドで設定してください(しない場合はデフォルト値  %updated%:    更新された日時(%Y-%m-%dT%H:%M:%SZ)  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.relatedBlogSearch = (function(){  const LANG = window.navigator.language; diff --git a/removetabs.js b/removetabs.js index a753ab6..d55b6b9 100644 --- a/removetabs.js +++ b/removetabs.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>removetabs</name>  <description>RemoveTabs</description> @@ -30,7 +30,7 @@ https://addons.mozilla.org/ja/firefox/addon/4227      noremap <C-S-n> :removetabsright<CR>  ||<  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function(){      liberator.modules.commands.addUserCommand(['removetabsleft'], 'remove tabs left', diff --git a/reporter.js b/reporter.js index ed2fd0a..4a022be 100644 --- a/reporter.js +++ b/reporter.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>mkreport</name>    <description>Write current information to the specified file</description> @@ -58,7 +58,7 @@ let PLUGIN_INFO =          - デフォルトから変更されている preference (about:config でみられる設定) のリスト          - バージョンなどの情報    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/resizable_textarea.js b/resizable_textarea.js index dbad5a5..0d87bad 100644 --- a/resizable_textarea.js +++ b/resizable_textarea.js @@ -5,7 +5,7 @@    http://www.opensource.jp/licenses/mit-license.html  }}}  END LICENSE BLOCK ***/  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <description>Allows you to resize textareas.</description> @@ -41,7 +41,7 @@ you can resize current component by using a keyboad.  "escape" or "enter":    end of resize.    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function() { @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>retweet</name>    <description>ReTweet This Page.</description> @@ -19,7 +19,7 @@ Usage:      ReTweet This Post.    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  //  ( diff --git a/reveal-ie-ctrl-a-images.js b/reveal-ie-ctrl-a-images.js index 9424c42..5ce2324 100644 --- a/reveal-ie-ctrl-a-images.js +++ b/reveal-ie-ctrl-a-images.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Reveal Image</name>    <description>Reveal IE Ctrl-A images.</description> @@ -63,7 +63,7 @@ let PLUGIN_INFO =        g:reveal_ie_image_mode_reverse = 'R':          反対版のヒントモード    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/sbmcommentsviewer.js b/sbmcommentsviewer.js index 3e6d599..fb9c647 100644 --- a/sbmcommentsviewer.js +++ b/sbmcommentsviewer.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>SBM Comments Viewer</name>      <description>List show Social Bookmark Comments</description> @@ -43,7 +43,7 @@ e.g.)   一度取得したものは(30分ほど)キャッシュに貯めてますので何度も見直すことが可能です。   粋なコマンド名募集中       ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.sbmCommentsViewer = (function(){  var isFilterNoComments = liberator.globalVariables.sbm_comments_viewer_filter_nocomments || false; @@ -74,11 +74,11 @@ SBMContainer.prototype = { //{{{          ));      },      toHTML: function(format, countOnly){ -        var label = <> -            {this.faviconURL ? <img src={this.faviconURL} width="16" height="16" style="vertical-align: middle; margin-right: 5px;" /> : <></>} +        var label = ` +            {this.faviconURL ? <img src={this.faviconURL} width="16" height="16" style="vertical-align: middle; margin-right: 5px;" /> : ``}              {manager.type[this.type] + ' ' + this.count + '(' + this.entries.length + ')'} -            {this.pageURL ? <a href="#" highlight="URL" style="margin-left: 5px;">{this.pageURL}</a> : <></>} -        </>; +            {this.pageURL ? <a href="#" highlight="URL" style="margin-left: 5px;">{this.pageURL}</a> : ``} +        `;          if (countOnly){              return label;          } else { @@ -87,7 +87,7 @@ SBMContainer.prototype = { //{{{              </div>;              let self = this;              xml.* += (function(){ -                var div = <></>; +                var div = ``;                  self.entries.forEach(function(e){                      if (isFilterNoComments && !e.comment) return;                      div += e.toHTML(format); @@ -129,10 +129,10 @@ SBMEntry.prototype = { //{{{              while (s.length > 0) {                  let m = s.match(/(?:https?:\/\/|mailto:)\S+/);                  if (m) { -                    result += <>{s.slice(0, m.index)}<a href={withLink ? m[0] : '#'} highlight="URL">{m[0]}</a></>; +                    result += `{s.slice(0, m.index)}<a href={withLink ? m[0] : '#'} highlight="URL">{m[0]}</a>`;                      s = s.slice(m.index + m[0].length);                  } else { -                    result += <>{s}</>; +                    result += `{s}`;                      break;                  }              } @@ -144,7 +144,7 @@ SBMEntry.prototype = { //{{{          format.forEach(function(colum){              switch(colum){                  case 'id': -                    xml.* += <span class="liberator-sbmcommentsviewer-id" style="margin-right: 10px;">{self.userIcon ? <><img src={self.userIcon} width="16" height="16" style="margin-right: 5px; vertical-align: middle;"/>{self.id}</> : <>{self.id}</>}</span>; +                    xml.* += <span class="liberator-sbmcommentsviewer-id" style="margin-right: 10px;">{self.userIcon ? `<img src={self.userIcon} width="16" height="16" style="margin-right: 5px; vertical-align: middle;"/>{self.id}` : `{self.id}`}</span>;                      break;                  case 'timestamp':                      xml.* += <span class="liberator-sbmcommentsviewer-timestamp" style="margin-right: 10px;">{self.formatDate()}</span>; @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Scala API document</description> @@ -16,7 +16,7 @@ Scala の API を検索し、保管し、該当のページを開きます。  引数には正規表現も利用できます。  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function() {  var p = function(arg) { diff --git a/scenario-actor.js b/scenario-actor.js index 727edb0..d896f17 100644 --- a/scenario-actor.js +++ b/scenario-actor.js @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>browser act scenario semi-automatic.</description> @@ -78,7 +78,7 @@ and action expressions are quoted by {begin: ...}.  - fix bugs.  - a lot.       ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function() { diff --git a/session-manager.js b/session-manager.js index 117aae3..1560c58 100644 --- a/session-manager.js +++ b/session-manager.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Session Manager</name>    <name lang="ja">Session Manager</name> @@ -51,11 +51,10 @@ let PLUGIN_INFO =    <detail lang="ja"><![CDATA[      sm <sub-command> <session-name>    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="session-manager" version="1.3.4"            href="http://github.com/vimpr/vimperator-plugins/blob/master/session-manager"            summary="for Session Manager Addon" @@ -96,7 +95,7 @@ let INFO =        </description>      </item>    </plugin> -</>; +`;  // }}}  // 参考スクリプト: @@ -1,5 +1,5 @@ -// INFO // -var INFO = +// {{{ INFO +var INFO =xml`  <plugin name="simg.js" version="0.4"          summary="Save image on contents area"          href="http://github.com/vimpr/vimperator-plugins/blob/master/simg.js" @@ -17,7 +17,8 @@ var INFO =        <p>You can save image on the currnet context area by this plugin.</p>      </description>    </item> -</plugin>; +</plugin>`; +// }}}  commands.addUserCommand(    ['simg'], diff --git a/slideshare.js b/slideshare.js index 9ebc472..0a6f9bc 100644 --- a/slideshare.js +++ b/slideshare.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="Slideshare" version="1.1.1"            href="http://vimpr.github.com/"            summary="Controll slideshare's slide." @@ -85,7 +84,7 @@ let INFO =        <description><p>フルスクリーン切り換え</p></description>      </item>    </plugin> -</>; +`;  // }}} @@ -158,14 +157,14 @@ let INFO =    function FlashSlideshare (doc, callback) {      let player = doc.querySelector('#player'); -    const fullScreenStyle = <><![CDATA[ +    const fullScreenStyle = `<![CDATA[        position : fixed !important;        top : 0px !important;        left : 0px !important;        z-index : 1000 !important;        width : 100% !important;        height : 100% !important; -    ]]></>; +    ]]>`;      let toggleFullscreen = makeFullscreenToggler(doc, makeStyleToggler(fullScreenStyle, player)); diff --git a/spatial-navigation.js b/spatial-navigation.js index 74c15d1..feb0192 100644 --- a/spatial-navigation.js +++ b/spatial-navigation.js @@ -38,7 +38,7 @@  /* Original version is "SpatialNavigation.js" of Firefox. */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Spatial Navigation</name>    <name lang="ja">空間ナビゲーション</name> @@ -54,11 +54,10 @@ let PLUGIN_INFO =    <detail lang="ja"><![CDATA[      Read the help. (:help SpatialNavigation-plugin)    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="SpatialNavigation" version="1.0.0"            href="http://github.com/vimpr/vimperator-plugins/blob/master/spatial-navigation.js"            summary="Spatial navigation" @@ -95,7 +94,7 @@ let g:spatial_navigation_mappings="<A-h> <A-j> <A-k> <A-l>"        </description>      </item>    </plugin> -</>; +`;  // }}} diff --git a/statstat.js b/statstat.js index 6263aa3..aff34d8 100644 --- a/statstat.js +++ b/statstat.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Stat Stat</name>    <name lang="ja">すた☆すた</name> @@ -52,10 +52,10 @@ let PLUGIN_INFO =      Links:        http://d.hatena.ne.jp/nokturnalmortum/20081202/1228218135    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = +let INFO = xml`  <plugin name="Stat Stat" version="1.0.4"          href="http://github.com/vimpr/vimperator-plugins/blob/master/statstat.js"          summary="Show information on statusline." @@ -74,7 +74,7 @@ let INFO =        </p>      </description>    </item> -</plugin>; +</plugin>`;  // }}}  (function () { diff --git a/statusbar_panel.js b/statusbar_panel.js index 7180890..fe2a52b 100644 --- a/statusbar_panel.js +++ b/statusbar_panel.js @@ -1,4 +1,4 @@ -let INFO = //{{{ +let INFO = xml` //{{{  <plugin name="statusbar panel" version="0.1"          href="https://github.com/vimpr/vimperator-plugins/raw/master/statusbar_panel.js"          summary="Click statusbar panel" @@ -29,7 +29,7 @@ let INFO = //{{{              <p><oa>-double-click</oa>を指定するとダブルクリックになります。</p>          </description>    </item> -</plugin>; +</plugin>`;  //}}}  let MOUSE_BUTTON_LEFT = 0; @@ -52,15 +52,14 @@ function getImages(panel) {  }  function makeIcon(panel) { -    var icon = <image xmlns={XUL.uri}/>; +    var icon = xml`<image xmlns=${XUL.uri}/>`;      var image = getImages(panel)[0];      if (image) {          let style = window.getComputedStyle(image, null);          let src = image.src || style.listStyleImage.replace(/^url\("(.+)"\)$/, '$1');          if (src != '') { -            icon.@style = 'list-style-image: url("' + src + '");' + -                          '-moz-image-region: ' + style.MozImageRegion; +            icon.setAttribute('style','list-style-image: url("' + src + '");' + '-moz-image-region: ' + style.MozImageRegion);          }      }      return icon; @@ -140,7 +139,7 @@ commands.addUserCommand(['statusbarpanel'],'click statusbar panel',              context.keys = { text: 'text', description: 'desc', icon: 'icon' };              context.compare = CompletionContext.Sort.unsorted;              context.process = [function (item, text) { -                return <><span highlight="CompIcon">{item.icon ? item.icon : <></>}</span><span class="td-strut"/>{text}</> +                return xml`<span highlight="CompIcon">{item.icon ? item.icon : ``}</span><span class="td-strut"/>{text}`              }];              var list = generateStatusbarpaneIDlList(arg); diff --git a/statusline-toolbar.js b/statusline-toolbar.js index b524e88..a5b4ce7 100644 --- a/statusline-toolbar.js +++ b/statusline-toolbar.js @@ -1,4 +1,4 @@ -var INFO = +var INFO = xml`  <plugin name="Statusline Toolbar" version="0.1"          href="http://github.com/vimpr/vimperator-plugins/raw/master/statusline-toolbar.js"          summary="Append Toolbar to Statusline" @@ -29,7 +29,7 @@ var INFO =          </p>        </description>      </item> -</plugin> +</plugin>`;  var updater = {    "star-button": [ @@ -39,7 +39,8 @@ var updater = {      }    ],  }; -var css = <css><![CDATA[ +var css = xml` +<css><![CDATA[    #liberator-customize-toolbar {      border: none !important;      min-width: 5px !important; @@ -49,18 +50,18 @@ var css = <css><![CDATA[    #liberator-customize-toolbar .statusbar-resizerpanel { display: none; }    #liberator-customize-toolbar toolbarbutton { padding: 0 !important; }    #status-bar { background-color: transparent !important; } -]]></css>.toString() + +]]></css>`.toString() +  ({ -  WINNT: <css></css>, -  Linux: <css></css>, -  Darwin: <css><![CDATA[ +  WINNT: xml`<css></css>`, +  Linux: xml`<css></css>`, +  Darwin: xml`<css><![CDATA[      #liberator-customize-toolbar toolbarbutton {        background: transparent !important;        border: none !important;        margin: 0 !important;        padding: 0 !important;      } -  ]]></css> +  ]]></css>`  })[Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS].toString();  function $(id) document.getElementById(id); @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Stella</name>    <name lang="ja">すてら</name> @@ -239,7 +239,7 @@ addLocalMappings(      == Link ==        http://d.hatena.ne.jp/nokturnalmortum/20081213/1229168832    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  /* {{{ @@ -366,7 +366,7 @@ Thanks:      },      fixFilename: function (filename) { -      const badChars = /[\\\/:;*?"<>|]/g; +      const badChars = /[\\\/:;*?"`|]/g;        return filename.replace(badChars, '_');      }, @@ -956,7 +956,7 @@ Thanks:          [            'tags',            XMLList([ -            <span>[<a href={v.href}>{v.textContent}</a>]</span> +            xml`<span>[<a href=${v.href}>${v.textContent}</a>]</span>`              for ([, v] in Iterator(doc.querySelectorAll('#eow-tags > li > a')))            ].join(''))          ], @@ -1112,7 +1112,7 @@ Thanks:          [            'tags',            XMLList([ -            <span>[<a href={v.href}>{v.textContent}</a>]</span> +            xml`<span>[<a href=${v.href}>${v.textContent}</a>]</span>`              for ([, v] in Iterator(doc.querySelectorAll('#eow-tags > li > a')))            ].join(''))          ], @@ -1339,12 +1339,12 @@ Thanks:      get pageinfo () {        let v = content.wrappedJSObject.Video;        return [ -        ['thumbnail', <img src={v.thumbnail} />], +        ['thumbnail', xml`<img src=${v.thumbnail} />`],          ['comment', U.toXML(v.description)],          [            'tag',            [ -            <span>[<a href={this.makeURL(t, Player.URL_TAG)}>{t}</a>]</span> +            xml`<span>[<a href=${this.makeURL(t, Player.URL_TAG)}>${t}</a>]</span>`              for each (t in Array.slice(v.tags))            ].join('')          ] @@ -2033,7 +2033,7 @@ Thanks:                context.process = [                  process[0],                  function (item, text) -                  (item.thumbnail ? <><img src={item.thumbnail} style="margin-right: 0.5em; height: 3em;"/>{text}</> +                  (item.thumbnail ? `<img src={item.thumbnail} style="margin-right: 0.5em; height: 3em;"/>{text}`                                    : process[1].apply(this, arguments))                ];                lastCompletions = self.player.relations; @@ -2054,7 +2054,7 @@ Thanks:          function (verbose)            (self.isValid && self.player.has('pageinfo', 'r')              ? [ -                [n, <div style="white-space: normal">{modules.template.maybeXML(v)}</div>] +                [n, xml`<div style="white-space: normal">${modules.template.maybeXML(v)}</div>`]                  for each ([n, v] in self.player.pageinfo)                ]              : []) @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>stylish</description> @@ -11,7 +11,7 @@ var PLUGIN_INFO =      <license>public domain</license>      <detail><![CDATA[  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function(){ diff --git a/subscldr.js b/subscldr.js index cfdb2a0..c34523e 100644 --- a/subscldr.js +++ b/subscldr.js @@ -9,7 +9,7 @@  // }}}  //  // PLUGIN INFO: {{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <description>Adds subscriptions to livedoor Reader/Fastladder in place.</description> @@ -44,7 +44,7 @@ var PLUGIN_INFO =      ||<    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  liberator.plugins.subscldr = (function() { diff --git a/tab-history.js b/tab-history.js index e6d61c3..62f75b7 100644 --- a/tab-history.js +++ b/tab-history.js @@ -1,4 +1,4 @@ -var INFO = +var INFO = xml`  <plugin name="TabHistory"          version="0.1"          summary="Go back/forward the tab selection history" @@ -25,7 +25,7 @@ var INFO =        <p>Go forward the history</p>      </description>    </item> -</plugin>; +</plugin>`;  var tabHistory = (function(){    const gBrowser = window.gBrowser, diff --git a/tabmixplus.js b/tabmixplus.js index 5251dda..ef3b3de 100644 --- a/tabmixplus.js +++ b/tabmixplus.js @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>add some tabmixplus commands</description> @@ -22,7 +22,7 @@ lock:      lock current tab  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function(){  commands.add(["dup[licate]"], "duplicate current tab", function(args) { @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>tabsort</name>    <description>Add ":tabsort" and ":tabuniq" command.</description> @@ -59,7 +59,7 @@ let PLUGIN_INFO =      ||<      なんかを .vimperatorrc に書いておくと良いよ。    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { @@ -9,7 +9,7 @@  // }}}
  // PLUGIN INFO: {{{
 -var PLUGIN_INFO =
 +var PLUGIN_INFO = xml`
  <VimperatorPlugin>
    <name>{NAME}</name>
    <description>Show ToDo items in commandline buffer. Also add item to your Ta-da list.</description>
 @@ -100,7 +100,7 @@ var PLUGIN_INFO =        - 表示のパフォーマンス改善
    ]]></detail>
 -</VimperatorPlugin>;
 +</VimperatorPlugin>`;
  // }}}
  liberator.plugins.tada = (function(){
 diff --git a/takahashiPresentation.js b/takahashiPresentation.js index 03f5ff9..304ea38 100644 --- a/takahashiPresentation.js +++ b/takahashiPresentation.js @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>simple takahashi-method presentation tool</description> @@ -18,7 +18,7 @@ presentation:  open HTML file includes <pre id="page">...</pre> and <div id="text">...</div>.  start :presentation.       ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function() {      let keys = [ diff --git a/tinymenu.js b/tinymenu.js index ea2cd8e..d25179b 100644 --- a/tinymenu.js +++ b/tinymenu.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Tiny Menu for Vimperator</description> @@ -17,7 +17,7 @@ thx icon id:tnx.    :opentinymenu:      Open the tiny menu.  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function() {      if (!liberator.plugins.tinymenu) @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>TinyURL from Vimperator</description> @@ -23,7 +23,7 @@ plugins.tinyurl.getExpand(url):      return ExpandURL      ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function() { @@ -91,7 +91,7 @@ var manager = {  		}  	},  	list: function(name){ -		var xml = <></>; +		var xml = ``;  		if (name && (name in settings)){  			xml += settings[name].list();  		} else { @@ -1,5 +1,5 @@ -// INFO // -var INFO =  +// {{{ INFO +var INFO =xml`  <plugin name="tohex.js" version="0.1"          summary="Get hex value from string"          href="http://github.com/vimpr/vimperator-plugins/blob/master/tohex.js" @@ -16,7 +16,8 @@ var INFO =        <p>If you use <link topic="http://github.com/vimpr/vimperator-plugins/blob/master/i_love_echo.js">i_love_echo.js</link>, you should not use tohex plugin.</p>      </description>    </item> -</plugin>; +</plugin>`; +// }}}  commands.addUserCommand(    ['tohex'], @@ -1,4 +1,4 @@ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>  <name>{NAME}</name>  <description>Tombloo integrate plugin</description> @@ -35,7 +35,7 @@ let PLUGIN_INFO =      ツールバーから選択できる Tombloo のメニューを実行します  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  (function () { diff --git a/translaten.js b/translaten.js index 13b5597..7e75dd1 100644 --- a/translaten.js +++ b/translaten.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>translaten</name>    <name lang="ja">自動一括翻訳</name> @@ -61,7 +61,7 @@ let PLUGIN_INFO =      == Link ==        http://vimperator.g.hatena.ne.jp/nokturnalmortum/20090104/1231070505    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/twittperator.js b/twittperator.js index 1173693..40bc733 100644 --- a/twittperator.js +++ b/twittperator.js @@ -24,8 +24,7 @@   */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="Twittperator" version="1.19.1"            href="https://github.com/vimpr/vimperator-plugins/raw/master/twittperator.js"            summary="Twitter Client using OAuth and Streaming API"> @@ -333,7 +332,7 @@ let INFO =          プラグイン書きましょう。      </p>    </plugin> -</>; +`;  // }}} @@ -1708,9 +1707,9 @@ let INFO =          let center = m[0];          let [head, tail] = [center[0], center.slice(1)];          let right = str.substring(m.index + m[0].length); -        let content = head === "@" ? <a highlight="URL" href={setting.showTLURLScheme + "://twitter.com/" + tail}> {center} </a> -                                   : <a highlight="URL" href={center}> {center} </a>; -        return <>{Utils.anchorLink(left)}{content}{Utils.anchorLink(right)}</>; +        let content = head === "@" ? xml`<a highlight="URL" href=${setting.showTLURLScheme + "://twitter.com/" + tail}> ${center} </a>` +                                   : xml`<a highlight="URL" href=${center}> ${center} </a>`; +        return xml`${Utils.anchorLink(left)}${content}${Utils.anchorLink(right)}`;        }        return str;      }, // }}} @@ -1783,7 +1782,7 @@ let INFO =          {},          function(json) {            function idToIcon (id) { -            return <span><a href={'http://twitter.com/#!/' + id}>{icons[id] ? <img src={icons[id]}/> : <>😸</>}</a></span>; +            return `<span><a href=${'http://twitter.com/#!/' + id}>${icons[id] ? `<img src=${icons[id]}/>` : "😸"}</a></span>`;            }            let icons = {}; @@ -1791,14 +1790,14 @@ let INFO =              if (t.user && t.user.id_str && t.user.profile_image_url)                icons[t.user.id_str] = t.user.profile_image_url;            } -          liberator.echo(<> +          liberator.echo(xml`              <dl> -              <dt>Retweeter {json.retweeters_count}</dt> -              <dd>{template.map(json.retweeters, idToIcon)}</dd> -              <dt>Favoriters {json.favoriters_count}</dt> -              <dd>{template.map(json.favoriters, idToIcon)}</dd> +              <dt>Retweeter ${json.retweeters_count}</dt> +              <dd>${template.map(json.retweeters, idToIcon)}</dd> +              <dt>Favoriters ${json.favoriters_count}</dt> +              <dd>${template.map(json.favoriters, idToIcon)}</dd>              </dl> -          </>); +          `);          }        );      }, // }}} @@ -1874,36 +1873,35 @@ let INFO =      lookupUser: function(users) { // {{{        function showUsersInfo(json) { // {{{          let xml = modules.template.map(json, function(user) { -          return <> +          return xml`              <tr>                <td class="twittperator lookup-user photo"> -                <img src={user.profile_image_url} /> +                <img src=${user.profile_image_url} />                </td>                <td class="twittperator lookup-user screen-name"> -                <a href={"https://twitter.com/#!/" + user.screen_name}> -                  {user.name} +                <a href=${"https://twitter.com/#!/" + user.screen_name}> +                  ${user.name}                  </a>                </td>                <td class="twittperator lookup-user attributes"> -                {user.location} - -                id {user.id_str} - -                {user.following ? '' : 'not'} following - -                {user.friends_count}/{user.followers_count} ee/er - -                {user.statuses_count} tweets - -                {user.favourites_count} favs - -                {user.listed_count} listed - -                from {new Date(user.created_at).toLocaleString()} +                ${user.location} - +                id ${user.id_str} - +                ${user.following ? '' : 'not'} following - +                ${user.friends_count}/${user.followers_count} ee/er - +                ${user.statuses_count} tweets - +                ${user.favourites_count} favs - +                ${user.listed_count} listed - +                from ${new Date(user.created_at).toLocaleString()}                </td>              </tr>              <tr>                <td class="twittperator lookup-user description" colspan="3"> -                {user.description} +                ${user.description}                </td>              </tr> -          </>; +          `;          }); -        liberator.echo( -          <> +        liberator.echo(xml`              <style type="text/css"><![CDATA[                .twittperator.lookup-user.photo { vertical-align: top; width: 28px; }                .twittperator.lookup-user.photo img { border: 0px; width: 24px; height: 24px; vertical-align: baseline; margin: 1px; } @@ -1911,9 +1909,8 @@ let INFO =                .twittperator.lookup-user.description { white-space: normal !important; }                .twittperator.lookup-user.description a { text-decoration: none; }              ]]></style> -            <table>{xml}</table> -          </> -        ); +            <table>${xml}</table> +        `);        } // }}}        let ids = [], screenNames = []; @@ -1994,59 +1991,56 @@ let INFO =        function menuEvent(st)          ("window.parent.liberator.modules.plugins.twittperator.Twittperator.showStatusMenu(" + parseInt(st.id) + ")"); -      let html = <style type="text/css"><![CDATA[ +      let html = `<style type="text/css"><![CDATA[            .twittperator.timeline.user { vertical-align: top; }            .twittperator.timeline.entry-content { white-space: normal !important; }            .twittperator.timeline.entry-content a { text-decoration: none; }            .twittperator.timeline.entry-content.rt:before { content: "RT "; color: silver; }            img.twittperator.timeline.photo { border: 0px; width: 24px; height: 24px; vertical-align: baseline; margin: 1px; } -      ]]></style>.toSource() -                 .replace(/(?:\r\n|[\r\n])[ \t]*/g, " ") + +      ]]></style>` +          .replace(/(?:\r\n|[\r\n])[ \t]*/g, " ") + +          '<table>' +            s.reduce(function(table, status) { -            return table.appendChild( -              ("retweeted_status" in status) ? -              let (rt = status.retweeted_status) -              <tr> +            if ("retweeted_status" in status) { +              let rt = status.retweeted_status; +              return table + xml`<tr>                  <td class="twittperator timeline user"> -                  <a href={userURL(rt.user.screen_name)}> -                    <img src={rt.user.profile_image_url} alt={rt.user.screen_name} class="twittperator timeline photo"/> -                    <strong>{rt.user.screen_name}‬</strong> +                  <a href=${userURL(rt.user.screen_name)}> +                    <img src=${rt.user.profile_image_url} alt=${rt.user.screen_name} class="twittperator timeline photo"/> +                    <strong>${rt.user.screen_name}‬</strong>                    </a> -                  <a href={userURL(status.user.screen_name)}> -                    <img src={status.user.profile_image_url} alt={status.user.screen_name} class="twittperator timeline photo"/> +                  <a href=${userURL(status.user.screen_name)}> +                    <img src=${status.user.profile_image_url} alt=${status.user.screen_name} class="twittperator timeline photo"/>                    </a>                  </td>                  <td class="twittperator timeline entry-content rt"> -                  {Utils.anchorLink(rt.text)} +                  ${Utils.anchorLink(rt.text)}                  </td>                  <td class="twittperator timeline menu"> -                  <a href="javascript: void 0" onclick={menuEvent(status)}> -                   ۞ -                  </a> +                  <a href="javascript: void 0" onclick=${menuEvent(status)}>۞</a>                  </td> -              </tr> : -              <tr> +              </tr>`.toString(); +            } else { +              return table + xml`<tr>                  <td class="twittperator timeline user"> -                  <a href={userURL(status.user.screen_name)}> -                    <img src={status.user.profile_image_url} alt={status.user.screen_name} class="twittperator timeline photo"/> -                    <strong title={status.user.name}>{status.user.screen_name}‬</strong> +                  <a href=${userURL(status.user.screen_name)}> +                    <img src=${status.user.profile_image_url} alt=${status.user.screen_name} class="twittperator timeline photo"/> +                    <strong title=${status.user.name}>${status.user.screen_name}‬</strong>                    </a>                  </td>                  <td class="twittperator timeline entry-content"> -                  {Utils.anchorLink(status.text)} +                  ${Utils.anchorLink(status.text)}                  </td>                  <td class="twittperator timeline menu"> -                  <a href="javascript: void 0" onclick={menuEvent(status)}> -                   ۞ -                  </a> +                  <a href="javascript: void 0" onclick=${menuEvent(status)}>۞</a>                  </td> -              </tr> -              ); - -          }, <table/>) -            .toSource().replace(/(?:\r\n|[\r\n])[ \t]*/g, " "); +              </tr>`.toString(); +            } +          }, "").replace(/(?:\r\n|[\r\n])[ \t]*/g, " ") + +          '</table>'; -      liberator.echo(html, true); +      window.Services.console.logStringMessage(html); +      liberator.echo(new TemplateXML(html), true);      }, // }}}      showTwitterMentions: function(arg) { // {{{        tw.jsonGet("statuses/mentions_timeline", null, function(res) { @@ -2173,25 +2167,25 @@ let INFO =        context.compare = void 0;        context.createRow = function(item, highlightGroup) {          if (highlightGroup === "CompTitle") { -          return <div highlight="CompTitle" style="white-space: nowrap"> -              <li highlight="CompDesc">{item} </li> -          </div>; +          return xml`<div highlight="CompTitle" style="white-space: nowrap"> +              <li highlight="CompDesc">${item} </li> +          </div>`;          }          let [value, st] = item.item;          if (st.user) { -          return <div highlight="CompItem" style="white-space: nowrap"> +          return xml`<div highlight="CompItem" style="white-space: nowrap">                <li highlight="CompDesc"> -                <img src={st.user.profile_image_url} style="max-width: 24px; max-height: 24px"/> -                 {st.user.screen_name}: {st.text} +                <img src=${st.user.profile_image_url} style="max-width: 24px; max-height: 24px"/> +                 ${st.user.screen_name}: ${st.text}                </li> -          </div>; +          </div>`;          } else { -          return <div highlight="CompItem" style="white-space: nowrap"> +          return xml`<div highlight="CompItem" style="white-space: nowrap">                <li highlight="CompDesc"> -                {st.text} +                ${st.text}                </li> -          </div>; +          </div>`;          }        }; @@ -2361,20 +2355,22 @@ let INFO =        description: "Display status information",        action: function(arg) {          function dtdd(obj) { -          let items = <></>; +          let items = "";            for (let [n, v] in Iterator(obj)) {              let cont = (v && typeof v === "object") ? dtdd(v) : v; -            items += <><dt>{n}</dt><dd>{cont}</dd></>; +            items += `<dt>${n}</dt><dd>${cont}</dd>`;            } -          return <dl>{items}</dl>; +          return `<dl>${items}</dl>`;          }          let m = arg.match(/^\d+/);          if (!m)            return;          let id = m[0]; -        history.filter(function(st) st.id === id).map(dtdd).forEach(liberator.echo); +        history.filter(function(st) st.id === id).map(dtdd).forEach(function(v) { +          liberator.echo(new TemplateXML(v)); +        });        },        timelineCompleter: true,        completer: Completers.rawid(function(st) st.id) diff --git a/twittperator/twsidebar.tw b/twittperator/twsidebar.tw index ee8ba3b..191fc13 100644 --- a/twittperator/twsidebar.tw +++ b/twittperator/twsidebar.tw @@ -84,7 +84,7 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () {      str = str.trim();      let reg = /https?:\/\/[^\s]+|[#@]\w+/g;      XML.ignoreWhitespace = false; -    let m, i = 0, buf = "", x = <xhtml:p class="twlist-text" xmlns:xhtml="http://www.w3.org/1999/xhtml"/>; +    let m, i = 0, buf = "", x = xml`<xhtml:p class="twlist-text" xmlns:xhtml="http://www.w3.org/1999/xhtml"/>`;      while((m=reg.exec(str))){        buf = str.substring(i, m.index);        if (buf) @@ -103,8 +103,7 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () {            klass += " twlist-url";            href = m[0];        } -      x.appendChild(<xhtml:a class={klass} href={href} -                           onclick="twlist.onClick(event)" xmlns:xhtml={XHTML}>{m[0]}</xhtml:a>); +      x.appendChild(xml`<xhtml:a class=${klass} href=${href} onclick="twlist.onClick(event)" xmlns:xhtml=${XHTML}>${m[0]}</xhtml:a>`);        i=reg.lastIndex;      }      buf = str.substr(i); @@ -128,32 +127,32 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () {        let richlistitemClasses = [className('tweet-panel'), className('tweet-' + t.type)];        let nameClass = className('item-name') + ' ' + (t.protected ? className('tweet-protected') : '');        xml = -        <richlistitem -          id={t.id} -          class={richlistitemClasses.join(' ')} -          style={[ +        xml`<richlistitem +          id=${t.id} +          class=${richlistitemClasses.join(' ')} +          style=${[              "font-size: " + px(Config.fontSize - (t.text.length > 70 ? 2 : 0)),              "width: " + px(sbWidth - 100) + ' !important'            ].join(';')}            xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">            <hbox flex="1">              <vbox width="48"> -              <image src={t.img} height="48" width="48" /> +              <image src=${t.img} height="48" width="48" />              </vbox>              <vbox flex="1">                <hbox flex="1"> -                <label flex="2" class={nameClass}>{escapeBreakers(t.name)}</label> -                <spacer hidden={!(t.sub || t.time)} /> -                <description flex="1" class={className('item-time-and-sub')} hidden={!(t.sub || t.time)}>{escapeBreakers(t.sub || t.time)}</description> +                <label flex="2" class=${nameClass}>${escapeBreakers(t.name)}</label> +                <spacer hidden=${!(t.sub || t.time)} /> +                <description flex="1" class=${className('item-time-and-sub')} hidden=${!(t.sub || t.time)}>${escapeBreakers(t.sub || t.time)}</description>                </hbox> -              <description flex="1" class={className('item-text')}>{escapeBreakers(t.text)}</description> +              <description flex="1" class=${className('item-text')}>${escapeBreakers(t.text)}</description>                <hbox> -                <description flex="1" class={className('item-sub')} hidden={!t.sub}>{escapeBreakers(t.sub || '')}</description> -                <description flex="1" class={className('item-time')} hidden={!t.time}>{escapeBreakers(t.time || '')}</description> +                <description flex="1" class=${className('item-sub')} hidden=${!t.sub}>${escapeBreakers(t.sub || '')}</description> +                <description flex="1" class=${className('item-time')} hidden=${!t.time}>${escapeBreakers(t.time || '')}</description>                </hbox>              </vbox>            </hbox> -        </richlistitem>; +        </richlistitem>`;        return xml;      } @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>twopen</name>    <description>open pages relative to the twitter id</description> @@ -108,7 +108,7 @@ let PLUGIN_INFO =      ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/uaSwitchLite.js b/uaSwitchLite.js index 6c98a8c..0262eff 100644 --- a/uaSwitchLite.js +++ b/uaSwitchLite.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>UserAgentSwitcherLite</name>    <description>switch user agent</description> @@ -38,7 +38,7 @@ var PLUGIN_INFO =          EOM        ||<    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  liberator.plugins.UserAgentSwitcherLite = (function(){ @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Exchange Converter</name>    <name lang="ja">外国為替換算</name> @@ -86,7 +86,7 @@ let PLUGIN_INFO =      == Require ==        _libly.js    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { @@ -137,7 +137,7 @@ let PLUGIN_INFO =    ];    function echo (msg) { -    liberator.echo(<pre>{msg}</pre>); +    liberator.echo(xml`<pre>${msg}</pre>`);    }    function kawase (value, clipboard, from, to) { @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>{NAME}</name>    <description>Copy the escaped-unicode text to the clipboard.</description> @@ -50,7 +50,7 @@ let PLUGIN_INFO =        :uc <MULTIBYTE_TEXT>        :uc! <ESCAPED_UNICODE_TEXT>    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/unload-tab.js b/unload-tab.js index 951c2b9..1bee8f4 100644 --- a/unload-tab.js +++ b/unload-tab.js @@ -3,9 +3,9 @@   * unload[tab] num   */ -var INFO = +var INFO = xml`  <plugin name="unloadTab" -        version="0.2" +        version="0.3"          summary="Unload tab contents like (BarTab)"          xmlns="http://vimperator.org/namespaces/liberator">    <author email="teramako@gmail.com">teramako</author> @@ -18,27 +18,29 @@ var INFO =        <p>Unload the tab contents.</p>      </description>    </item> -</plugin>; +</plugin>`;  if (!("SS" in this)) {    XPCOMUtils.defineLazyServiceGetter(this, "SS", "@mozilla.org/browser/sessionstore;1", "nsISessionStore");  }  function unloadTab (aTab) { -  var state = SS.getTabState(aTab); -  var tab = gBrowser.addTab(null, { skipAnimation: true }); -  SS.setTabState(tab, state); -  if (aTab.pinned) { -    gBrowser.pinTab(tab); -  } else { -    let objState = JSON.parse(state); -    if (objState.hidden) { -      gBrowser.hideTab(tab); -      TabView.moveTabTo(tab, JSON.parse(objState.extData["tabview-tab"]).groupID); -    } -  } -  gBrowser.moveTabTo(tab, aTab._tPos + 1) -  gBrowser.removeTab(aTab); +  var browser = aTab.linkedBrowser, +      state = SS.getTabState(aTab), +      shistory = browser.sessionHistory, +      icon = aTab.getAttribute("image"); + +  browser.addEventListener("load", function onload(){ +    this.removeEventListener("load", onload, true); +    if (shistory.count > 1) +      shistory.PurgeHistory(shistory.count -1); + +    aTab.ownerDocument.defaultView.setTimeout(function(){ +      aTab.setAttribute("image", icon); +    }, 0); +    SS.setTabState(aTab, state); +  }, true); +  browser.loadURI("about:blank");  }  commands.addUserCommand(["unload[tab]"], "Unload Tabs", @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="usi.js" version="1.3.4"            href="http://vimpr.github.com/"            summary="for Remember The Milk." @@ -55,7 +54,7 @@ let INFO =        <description><p></p></description>      </item>    </plugin> -</>; +`;  // }}}  (function () { @@ -496,12 +495,12 @@ let INFO =              }              let n = new Date().getTime();              Utils.timeArraySort(cs); -            let contents = <></>; +            let contents = ``;              for (let [, [d, [a, b]]] in Iterator(cs)) {                let hl = (n - d) > 0 ? 'ErrorMsg' : '';                contents += <tr highlight={hl}><td>{a}</td><td>{b}</td></tr>;              } -            liberator.echo(<><table>{contents}</table></>); +            liberator.echo(`<table>{contents}</table>`);            }          }        ); @@ -1,5 +1,5 @@  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>UUID generator</description> @@ -17,7 +17,7 @@ uuid:  == THANKS ==  http://moz-addon.g.hatena.ne.jp/ZIGOROu/20080417/1208413079  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function() { diff --git a/video-controller.js b/video-controller.js index 0368afd..fc4aa62 100644 --- a/video-controller.js +++ b/video-controller.js @@ -34,8 +34,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  // PLUGIN_INFO {{{  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="VideoController" version="1.1.1"            href="http://github.com/vimpr/vimperator-plugins/blob/master/video-controller.js"            summary="Control HTML5 Videos" @@ -70,7 +69,7 @@ let INFO =        </description>      </item>    </plugin> -</>; +`;  // }}} diff --git a/vimp_to_android_phone.js b/vimp_to_android_phone.js index f428f59..c0015fc 100644 --- a/vimp_to_android_phone.js +++ b/vimp_to_android_phone.js @@ -1,4 +1,4 @@ -var PLUGIN_INFO =
 +var PLUGIN_INFO = xml`
  <VimperatorPlugin>
  	<name>{NAME}</name>
  	<description>Send to your Android Phone</description>
 @@ -7,7 +7,7 @@ var PLUGIN_INFO =  	<minVersion>2.3</minVersion>
  	<maxVersion>2.3</maxVersion>
  	<updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/vimp_to_android_phone.js</updateURL>
 -</VimperatorPlugin>;
 +</VimperatorPlugin>`;
  (function() {
 diff --git a/walk-input.js b/walk-input.js index f5dd445..f310875 100644 --- a/walk-input.js +++ b/walk-input.js @@ -19,7 +19,7 @@  // </html>  // PLUGIN_INFO {{{ -let INFO = +let INFO = xml`  <plugin name="Walk-Input" version="1.3.0"          href="http://github.com/vimpr/vimperator-plugins/blob/master/walk-input.js"          summary="The focus walks 'input' and 'textarea' element." @@ -59,7 +59,7 @@ let INFO =              <p>Move focus backward</p>  	</description>      </item> -</plugin>; +</plugin>`;  // }}}  (function () { @@ -81,13 +81,13 @@          ]]></style>.toSource()
                     .replace(/(?:\r?\n|\r)[ \t]*/g, " ") +
              statuses.map(function(status)
 -                <>
 +                `
                      <img src={status.user.profile_image_url}
                           alt={status.user.screen_name}
                           title={status.user.screen_name}
                           class="wassr photo"/>
                      <strong>{status.user_login_id}‬</strong>
 -                </>.toSource()
 +                `.toSource()
                     .replace(/(?:\r?\n|\r)[ \t]*/g, " ") +
                      sprintf(': <span class="wassr entry-content">%s‬</span>', status.html))
                          .join("<br/>");
 @@ -126,13 +126,13 @@          ]]></style>.toSource()
                     .replace(/(?:\r?\n|\r)[ \t]*/g, " ") +
              statuses.map(function(status)
 -                <>
 +                `
                      <img src={status.user.profile_image_url}
                           alt={status.user.screen_name}
                           title={status.user.screen_name}
                           class="wassr photo"/>
                      <strong>{status.user_login_id}‬</strong>
 -                </>.toSource()
 +                `.toSource()
                     .replace(/(?:\r?\n|\r)[ \t]*/g, " ") +
                      sprintf(': <span class="wassr entry-content">%s‬</span>', status.html))
                          .join("<br/>");
 @@ -150,12 +150,12 @@          ]]></style>.toSource()
              .replace(/(?:\r?\n|\r)[ \t]*/g, " ");
          for (var n = 0; n < items.length; n++)
 -            html += <>
 +            html += `
                  <strong>{items[n].getElementsByTagName('title')[0].textContent.replace(/>/g, '>').replace(/</g, '<').replace(/^%/, '')}‬</strong>
                  : <span class="wassr entry-content">{items[n].getElementsByTagName('description')[0].textContent.replace(/>/g, '>').replace(/</g, '<')}‬</span>
                  <br />
 -            </>.toSource()
 +            `.toSource()
                  .replace(/(?:\r?\n|\r)[ \t]*/g, " ");
          liberator.echo(html, true);
      }
 @@ -198,13 +198,13 @@          ]]></style>.toSource()
                     .replace(/(?:\r?\n|\r)[ \t]*/g, " ") +
              todos.map(function(todo)
 -                <>
 +                `
                      <img src="http://wassr.jp/img/icn-balloon.gif"
                           alt="todo"
                           title="todo"
                           class="wassr icon"/>
                      <strong>{todo.todo_rid}</strong>
 -                </>.toSource()
 +                `.toSource()
                     .replace(/(?:\r?\n|\r)[ \t]*/g, " ") +
                      sprintf(': <span class="wassr entry-content">%s</span>', todo.body))
                          .join("<br/>");
 @@ -223,13 +223,13 @@          ]]></style>.toSource()
                     .replace(/(?:\r?\n|\r)[ \t]*/g, " ") +
              footmarks.map(function(footmark)
 -                <>
 +                `
                      <img src={"http://wassr.jp/user/" + footmark.login_id + "/profile_img.png.32"}
                           alt={footmark.nick}
                           title={footmark.nick}
                           class="wassr photo"/>
                      <strong>{footmark.login_id}‬</strong>
 -                </>.toSource()
 +                `.toSource()
                     .replace(/(?:\r?\n|\r)[ \t]*/g, " ")).join("<br/>");
          liberator.echo(html, true);
 @@ -246,13 +246,13 @@          ]]></style>.toSource()
                     .replace(/(?:\r?\n|\r)[ \t]*/g, " ") +
              footmarks.map(function(footmark)
 -                <>
 +                `
                      <img src={"http://wassr.jp/user/" + footmark.login_id + "/profile_img.png.32"}
                           alt={footmark.nick}
                           title={footmark.nick}
                           class="wassr photo"/>
                      <strong>{footmark.login_id}‬</strong>
 -                </>.toSource()
 +                `.toSource()
                     .replace(/(?:\r?\n|\r)[ \t]*/g, " ")).join("<br/>");
          liberator.echo(html, true);
 diff --git a/watchizu.js b/watchizu.js index c40596f..e5091b2 100644 --- a/watchizu.js +++ b/watchizu.js @@ -1,5 +1,5 @@ -// INFO // -var INFO =  +// {{{ INFO +var INFO =xml`  <plugin name="watchizu.js" version="0.1"          summary="Get Watchizu URL of current machine location"          href="http://github.com/vimpr/vimperator-plugins/blob/master/watchizu.js" @@ -17,7 +17,8 @@ var INFO =        <p>You can get <link topic="http://watchizux.gsi.go.jp/index.html">Watchizu</link> URL of current machine location by this plugin.</p>      </description>    </item> -</plugin>; +</plugin>`; +// }}}  (function(){  	commands.addUserCommand( diff --git a/win-mouse.js b/win-mouse.js index 285b838..89dae08 100644 --- a/win-mouse.js +++ b/win-mouse.js @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="Win Cursor" version="1.3.2"            href="http://vimpr.github.com/"            summary="Cursor control plugin for MS Windows" @@ -119,7 +118,7 @@ let INFO =        </description>      </item>    </plugin> -</>; +`;  // }}}  (function () { @@ -558,7 +557,7 @@ let INFO =    function displayCurrent () {      let pos = API.position;      let col = API.getPixel(pos); -    return liberator.echo(<>[Position] {pos.x}, {pos.y} [Color] {col.r}, {col.g}, {col.b} ({col.name})</>); +    return liberator.echo(`[Position] {pos.x}, {pos.y} [Color] {col.r}, {col.g}, {col.b} ({col.name})`);    }    commands.addUserCommand( @@ -32,33 +32,8 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */ -// PLUGIN_INFO {{{ -let PLUGIN_INFO = -<VimperatorPlugin> -  <name>X-Hint</name> -  <name lang="ja">X-Hint</name> -  <description>Show the hints with given XPath.</description> -  <description lang="ja">指定のXPathでヒントを表示する。</description> -  <version>1.1.2</version> -  <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author> -  <license>new BSD License (Please read the source code comments of this plugin)</license> -  <license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license> -  <updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/x-hint.js</updateURL> -  <minVersion>2.3</minVersion> -  <maxVersion>2.3</maxVersion> -  <detail><![CDATA[ -    :xh[int] <Hint-Mode> <XPath>: -      Show the <Hint-Mode> hints with <XPath> -  ]]></detail> -  <detail lang="ja"><![CDATA[ -    :xh[int] <Hint-Mode> <XPath>: -      <XPath> で <Hint-Mode> ヒントを表示 -  ]]></detail> -</VimperatorPlugin>; -// }}}  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="X-Hint" version="1.1.3"            href="http://github.com/vimpr/vimperator-plugins/blob/master/x-hint.js"            summary="Show the hints with given XPath." @@ -121,8 +96,7 @@ let INFO =          </p>        </description>      </item> -  </plugin> -</>; +  </plugin>`;  // }}} diff --git a/xpath_hint.js b/xpath_hint.js index 754a105..835595a 100644 --- a/xpath_hint.js +++ b/xpath_hint.js @@ -5,7 +5,7 @@      http://www.opensource.jp/licenses/mit-license.html  }}}  END LICENSE BLOCK ***/  // PLUGIN_INFO//{{{ -var PLUGIN_INFO = +var PLUGIN_INFO = xml`  <VimperatorPlugin>      <name>{NAME}</name>      <description>add "get element's XPath" hint mode</description> @@ -22,7 +22,7 @@ var PLUGIN_INFO =      copy selected element's XPath  ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  //}}}  (function(){ diff --git a/yetmappings.js b/yetmappings.js index 955bb23..d7ba675 100644 --- a/yetmappings.js +++ b/yetmappings.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Yet Mappings</name>    <description>Display the keys that are not mapped yet.</description> @@ -54,7 +54,7 @@ let PLUGIN_INFO =      == Links ==        http://d.hatena.ne.jp/nokturnalmortum/20081109/1226223461    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  (function () { diff --git a/zip-de-download.js b/zip-de-download.js index a111958..f7a25b4 100644 --- a/zip-de-download.js +++ b/zip-de-download.js @@ -1,4 +1,4 @@ -let INFO = +let INFO = xml`  <plugin name="zip-de-download" version="0.7.1"          href=""          summary="ZIPでダウンロードするお" @@ -6,7 +6,7 @@ let INFO =    <author email="teramako@gmail.com">teramako</author>    <license href="http://opensource.org/licenses/mit-license.php">MIT</license>    <project name="Vimperator" minVersion="2.3"/> -  <p xmlns={XHTML}> +  <p xmlns=${XHTML}>      特定ページの画像とかのURLを取ってきて一気にZIPにしてダウンロードするお      <code style='font-family: sans-serif !important;'><![CDATA[               /) @@ -17,7 +17,7 @@ let INFO =      /   ,i   ,二ニ⊃( ●). (●)\     /    ノ    il゙フ::::::⌒(__人__)⌒::::: \        ,イ「ト、  ,!,!|     |r┬-|     | -     / iトヾヽ_/ィ"\      `ー'´     / +     / iトヾヽ_/ィ"\      \`ー'´     /      ]]></code>    </p>    <item> @@ -74,7 +74,7 @@ let INFO =        </p>      </description>    </item> -</plugin>; +</plugin>`;  // FIXME: 将来的には、storageに入れるべき  // FIXME: あと、それぞれダウンロード先を指定できた方が良い(?) @@ -320,14 +320,14 @@ let SITE_INFO = [        }        if ("-list" in arg){          let [file, urls, comment] = self.download(arg[0], true, option); -        let xml = <> +        let xml = `            <h1><span>Download :</span><span>{file.path}</span></h1>            <p>{comment}</p>            <ol>              {liberator.modules.template.map(urls, function(url) <li>{url}</li>)}            </ol>            <br/> -        </>; +        `;          liberator.echo(xml, true);          return;        } diff --git a/zoom-em-all.js b/zoom-em-all.js index 3479bcc..177cc6a 100644 --- a/zoom-em-all.js +++ b/zoom-em-all.js @@ -33,7 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // PLUGIN_INFO {{{ -let PLUGIN_INFO = +let PLUGIN_INFO = xml`  <VimperatorPlugin>    <name>Zoom Em All</name>    <name lang="ja">Zoom Em All</name> @@ -52,11 +52,10 @@ let PLUGIN_INFO =    <detail lang="ja"><![CDATA[      ----    ]]></detail> -</VimperatorPlugin>; +</VimperatorPlugin>`;  // }}}  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="ZoomEmAll" version="1.1.0"            href="http://github.com/vimpr/vimperator-plugins/blob/master/zoom-em-all.js"            summary="Zoom or pan for whole firefox." @@ -95,7 +94,7 @@ let INFO =        </description>      </item>    </plugin> -</>; +`;  // }}}  (function () { @@ -33,8 +33,7 @@ THE POSSIBILITY OF SUCH DAMAGE.  }}} */  // INFO {{{ -let INFO = -<> +let INFO = xml`    <plugin name="跳.jp" version="1.0.2"            href="http://vimpr.github.com/"            summary="跳ねます" @@ -52,7 +51,7 @@ let INFO =        </p></description>      </item>    </plugin> -</>; +`;  // }}} | 
