From 9a8cf4e8a04daad9865d00075c269f04adaefcf8 Mon Sep 17 00:00:00 2001 From: janus_wel Date: Tue, 21 Oct 2008 10:27:41 +0000 Subject: 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 --- nicontroller.js | 76 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 31 deletions(-) (limited to 'nicontroller.js') diff --git a/nicontroller.js b/nicontroller.js index a519c0c..aaa4275 100644 --- a/nicontroller.js +++ b/nicontroller.js @@ -4,8 +4,8 @@ * @description this script give you keyboard opration for nicovideo.jp. * @description-ja ニコニコ動画のプレーヤーをキーボードで操作できるようにする。 * @author janus_wel - * @version 0.52 - * @minversion 1.2 + * @version 0.53 + * @minversion 2.0pre 2008/10/16 * ==VimperatorPlugin== * * LICENSE @@ -78,29 +78,29 @@ javascript < 1) + ? args.arguments[0].toString() + : args.string; + special ? controller.seekBy(arg) : controller.seekTo(arg); + } catch(e) { liberator.echoerr(e); } }, { @@ -480,11 +485,16 @@ liberator.commands.addUserCommand( } ); -liberator.commands.addUserCommand( +liberator.modules.commands.addUserCommand( ['nicovolume'], 'controll volume', - function(arg, special) { - try { special ? controller.volumeBy(arg) : controller.volumeTo(arg); } + function(args, special) { + try { + var arg = (args.arguments.length > 1) + ? args.arguments[0].toString() + : args.string; + special ? controller.volumeBy(arg) : controller.volumeTo(arg); + } catch(e) { liberator.echoerr(e); } }, { @@ -492,7 +502,7 @@ liberator.commands.addUserCommand( } ); -liberator.commands.addUserCommand( +liberator.modules.commands.addUserCommand( ['nicosize'], 'toggle video size', function() { @@ -502,21 +512,23 @@ liberator.commands.addUserCommand( {} ); -liberator.commands.addUserCommand( +liberator.modules.commands.addUserCommand( ['nicodescription'], 'toggle display or not the description for video', - function(arg) { + function() { try { controller.toggleDescription(); } catch(e) { liberator.echoerr(e); } }, {} ); -liberator.commands.addUserCommand( +liberator.modules.commands.addUserCommand( ['nicomment'], 'fill comment box', - function(arg) { + function(args) { try { + var arg = args.string; + var command, comment; [command, comment] = expandExCommand(arg); @@ -534,15 +546,17 @@ liberator.commands.addUserCommand( {} ); -liberator.commands.addUserCommand( +liberator.modules.commands.addUserCommand( ['nicommand'], 'fill command box', function(arg) { - try { controller.setValue('inputArea.MailInput.text', arg); } + try { controller.setValue('inputArea.MailInput.text', arg.string); } catch(e) { liberator.echoerr(e); } }, { - completer: function(arg){ + completer: function(args){ + var arg = args.string; + // get available commands by roll var availableCommands = controller.getAvailableCommands(); @@ -592,7 +606,7 @@ const MAX_LINE = { medium: 25, small: 38, }; -const EMSP = ' '; +const EMSP = '\u3000'; const NBSP = '\u00a0'; const LF = '\u000a'; const PROPATIES_DEFAULT = { -- cgit v1.2.3