aboutsummaryrefslogtreecommitdiffstats
path: root/youtubeamp.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 /youtubeamp.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 'youtubeamp.js')
-rw-r--r--youtubeamp.js40
1 files changed, 25 insertions, 15 deletions
diff --git a/youtubeamp.js b/youtubeamp.js
index 46a186a..7b269ea 100644
--- a/youtubeamp.js
+++ b/youtubeamp.js
@@ -4,8 +4,8 @@
* @description this script gives you keyboard oprations for YouTube.com.
* @description-ja YouTube のプレーヤーをキーボードで操作できるようにする。
* @author janus_wel <janus_wel@fb3.so-net.ne.jp>
- * @version 0.11
- * @minversion 1.2
+ * @version 0.12
+ * @minversion 2.0pre 2008/10/16
* ==VimperatorPlugin==
*
* LICENSE
@@ -60,7 +60,7 @@ YouTubePlayerController.prototype = {
},
constants: {
- VERSION: '0.10',
+ VERSION: '0.12',
CARDINAL_NUMBER: 10,
@@ -102,7 +102,7 @@ YouTubePlayerController.prototype = {
throw new Error('current tab is not watch page on youtube.com');
},
- getURL: function() { return liberator.buffer.URL; },
+ getURL: function() { return liberator.modules.buffer.URL; },
_player: function() {
if(this.pagecheck() === this.constants.WATCH_PAGE) {
@@ -250,7 +250,7 @@ YouTubePlayerController.prototype = {
var controller = new YouTubePlayerController();
// command register
-liberator.commands.addUserCommand(
+liberator.modules.commands.addUserCommand(
['ytinfo'],
'display player information',
function() {
@@ -258,14 +258,14 @@ liberator.commands.addUserCommand(
var info = [
'controller version : ' + controller.getControllerVersion(),
].join('\n');
- liberator.echo(info, liberator.commandline.FORCE_MULTILINE);
+ liberator.echo(info, liberator.modules.commandline.FORCE_MULTILINE);
}
catch(e) { liberator.echoerr(e); }
},
{}
);
-liberator.commands.addUserCommand(
+liberator.modules.commands.addUserCommand(
['ytpause'],
'toggle play / pause',
function() {
@@ -275,7 +275,7 @@ liberator.commands.addUserCommand(
{}
);
-liberator.commands.addUserCommand(
+liberator.modules.commands.addUserCommand(
['ytmute'],
'toggle mute',
function() {
@@ -285,11 +285,16 @@ liberator.commands.addUserCommand(
{}
);
-liberator.commands.addUserCommand(
+liberator.modules.commands.addUserCommand(
['ytseek'],
'control seek bar',
- function(arg, special) {
- try { special ? controller.seekBy(arg) : controller.seekTo(arg); }
+ function(args, special) {
+ try {
+ var arg = (args.arguments.length > 1)
+ ? args.arguments[0].toString()
+ : args.string;
+ special ? controller.seekBy(arg) : controller.seekTo(arg);
+ }
catch(e) { liberator.echoerr(e); }
},
{
@@ -297,11 +302,16 @@ liberator.commands.addUserCommand(
}
);
-liberator.commands.addUserCommand(
+liberator.modules.commands.addUserCommand(
['ytvolume'],
'control 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); }
},
{
@@ -309,7 +319,7 @@ liberator.commands.addUserCommand(
}
);
-liberator.commands.addUserCommand(
+liberator.modules.commands.addUserCommand(
['ytsize'],
'toggle video size',
function() {