root/lang/javascript/vimperator-plugins/branches/2.0/literal-bmark.js

Revision 31428, 3.6 kB (checked in by anekos, 18 months ago)

Initial release: ブックマークレットなど用の :bmark コマンド

Line 
1/* NEW BSD LICENSE {{{
2Copyright (c) 2009, anekos.
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without modification,
6are permitted provided that the following conditions are met:
7
8    1. Redistributions of source code must retain the above copyright notice,
9       this list of conditions and the following disclaimer.
10    2. Redistributions in binary form must reproduce the above copyright notice,
11       this list of conditions and the following disclaimer in the documentation
12       and/or other materials provided with the distribution.
13    3. The names of the authors may not be used to endorse or promote products
14       derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25THE POSSIBILITY OF SUCH DAMAGE.
26
27
28###################################################################################
29# http://sourceforge.jp/projects/opensource/wiki/licenses%2Fnew_BSD_license       #
30# に参考になる日本語訳がありますが、有効なのは上記英文となります。                #
31###################################################################################
32
33}}} */
34
35// PLUGIN_INFO {{{
36let PLUGIN_INFO =
37<VimperatorPlugin>
38  <name>literal bmark</name>
39  <description>:bmark command that can included characters such as '"' in the URL.</description>
40  <description lang="ja">'"' などの文字を含めることができる :bmark コマンド</description>
41  <version>1.0.0</version>
42  <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author>
43  <license>new BSD License (Please read the source code comments of this plugin)</license>
44  <license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license>
45  <updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/literal-bmark.js</updateURL>
46  <minVersion>2.0pre</minVersion>
47  <maxVersion>2.0pre</maxVersion>
48  <detail><![CDATA[
49    == Commands ==
50      :lbmark:
51        The arguments are the same as :bmark command.
52        But, in this command, characters such as '"' can be included in the URL.
53        However, there should be the options (e.g. -title=...) before the URL.
54  ]]></detail>
55  <detail lang="ja"><![CDATA[
56    == Commands ==
57      :lbmark:
58        引数は :bmark コマンドと同じですが、URL に '"' などの文字を含めることが出来ます。
59        ただし、-title などのオプションは URL に先行する必要があります。
60  ]]></detail>
61</VimperatorPlugin>;
62// }}}
63
64(function () {
65
66  let bmark = commands.get('bmark');
67
68  commands.addUserCommand(
69    ['lbm[ark]'],
70    'Add a bookmark - literal',
71    bmark.action,
72    {
73      literal: 0,
74      bang: bmark.bang,
75      count: bmark.count,
76      argCount: '1',
77      options: bmark.options,
78      complete: bmark.complete
79    },
80    true
81  );
82
83
84})();
85
86// vim:sw=2 ts=2 et si fdm=marker:
Note: See TracBrowser for help on using the browser.