aboutsummaryrefslogtreecommitdiffstats
path: root/nnp_cooperation.js
diff options
context:
space:
mode:
authorjanus_wel2008-10-21 10:27:41 +0000
committerjanus_wel2008-10-21 10:27:41 +0000
commit9a8cf4e8a04daad9865d00075c269f04adaefcf8 (patch)
tree8aac1aac8f9a63e462a40e57d5dbef6103aa026b /nnp_cooperation.js
parent4a9c57ab1b5675da743d11d75838fb9089491119 (diff)
downloadvimperator-plugins-9a8cf4e8a04daad9865d00075c269f04adaefcf8.tar.bz2
liberator -> liberator.modules
- buffer - commandline - commands - hints - ..etc コマンド追加時に使う addUserCommand の第 3 引数に指定する関数の第 1 引数が String から Object に変更したのに対応 - ldrize_cooperation_fetch_flv.js - lookupDictionary.js - matanico.js - nicontroller.js - nnp_cooperation.js - reading.js - youtubeamp.js migemo_hint.js で一時的にグローバルオブジェクト plugins を定義 応急処置なのであとで削る必要あり git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@21797 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'nnp_cooperation.js')
-rw-r--r--nnp_cooperation.js28
1 files changed, 16 insertions, 12 deletions
diff --git a/nnp_cooperation.js b/nnp_cooperation.js
index 8a5ea0a..26f149e 100644
--- a/nnp_cooperation.js
+++ b/nnp_cooperation.js
@@ -5,7 +5,7 @@
* @description-ja NicoNicoPlaylist をキーボードで操作できるようにする。
* @author janus_wel <janus_wel@fb3.so-net.ne.jp>
* @version 0.32
- * @minversion 1.2
+ * @minversion 2.0pre 2008/10/16
* ==VimperatorPlugin==
*
* CONSTRAINT
@@ -62,22 +62,22 @@ javascript <<EOM
// [N],nn
// N 番目の動画を再生する。
// 指定なしの場合次の動画が再生される。
-liberator.mappings.addUserMap(
- [liberator.modes.NORMAL],
+liberator.modules.mappings.addUserMap(
+ [liberator.modules.modes.NORMAL],
[',nn'],
'play next item in NicoNicoPlaylist',
function(count) {
if(count === -1) count = 1;
liberator.execute(':nnpplaynext ' + count);
},
- { flags: liberator.Mappings.flags.COUNT }
+ { flags: liberator.modules.Mappings.flags.COUNT }
);
// [N],nr
// 上から N 個の動画を削除する。
// 指定なしの場合一番上の動画が削除される。
-liberator.mappings.addUserMap(
- [liberator.modes.NORMAL],
+liberator.modules.mappings.addUserMap(
+ [liberator.modules.modes.NORMAL],
[',nr'],
'remove item in NicoNicoPlaylist',
function(count) {
@@ -85,7 +85,7 @@ liberator.mappings.addUserMap(
for(var i=0 ; i<count ; ++i) liberator.execute(':nnpremove');
liberator.execute(':nnpgetlist');
},
- { flags: liberator.Mappings.flags.COUNT }
+ { flags: liberator.modules.Mappings.flags.COUNT }
);
EOM
@@ -143,8 +143,12 @@ const itemHTML = [
// scrape from div element that inserted by NicoNicoPlaylist
-liberator.commands.addUserCommand(['nnpgetlist'], 'get NicoNicoPlaylist',
- function (arg) {
+liberator.modules.commands.addUserCommand(['nnpgetlist'], 'get NicoNicoPlaylist',
+ function (args) {
+ var arg = (args.arguments.length > 1)
+ ? args.arguments[0].toString()
+ : args.string;
+
// check existence of NicoNicoPlaylist
var playlist = $f('//div[contains(@id, "playlistcontroller_")]');
if(!playlist) {
@@ -204,7 +208,7 @@ liberator.commands.addUserCommand(['nnpgetlist'], 'get NicoNicoPlaylist',
.replace(/\$THEAD/g, thead)
.replace(/\$ITEMS/g, items.join(''));
- liberator.echo(str, liberator.commandline.FORCE_MULTILINE);
+ liberator.echo(str, liberator.modules.commandline.FORCE_MULTILINE);
},{}
);
@@ -250,10 +254,10 @@ function $s(query, node) {
[['nnpfullscreen'], "toggle fullscreen mode of NicoNicoPlaylist", 'GMNNPFullScreen'],
].forEach(
function ([command, description, eventname]){
- liberator.commands.addUserCommand(command, description,
+ liberator.modules.commands.addUserCommand(command, description,
function (arg) {
var r = document.createEvent("CommandEvent");
- r.initCommandEvent(eventname, true, true, arg);
+ r.initCommandEvent(eventname, true, true, arg.string);
window.content.dispatchEvent(r);
},{}
);