From 0df6df4c9984d1183c8cc9d91ec7f03a53c95cb6 Mon Sep 17 00:00:00 2001 From: drry Date: Tue, 7 Oct 2008 18:03:17 +0000 Subject: * fixed typos, "controll". * et cetera. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@20940 d0d07461-0603-4401-acd4-de1884942a52 --- youtubeamp.js | 68 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'youtubeamp.js') diff --git a/youtubeamp.js b/youtubeamp.js index 77da365..46a186a 100644 --- a/youtubeamp.js +++ b/youtubeamp.js @@ -1,10 +1,10 @@ /* * ==VimperatorPlugin== * @name youtubeamp.js - * @description this script give you keyboard opration for youtube.com. + * @description this script gives you keyboard oprations for YouTube.com. * @description-ja YouTube のプレーヤーをキーボードで操作できるようにする。 * @author janus_wel - * @version 0.10 + * @version 0.11 * @minversion 1.2 * ==VimperatorPlugin== * @@ -40,13 +40,13 @@ * 2008/10/07 ver. 0.10 - initial written. * */ -(function(){ +(function() { Function.prototype.bind = function(object) { var __method = this; return function() { return __method.apply(object, arguments); - } + }; }; // class definition @@ -55,33 +55,33 @@ function YouTubePlayerController() { this.initialize.apply(this, arguments); } YouTubePlayerController.prototype = { - initialize: function () { + initialize: function() { this.fuller = this._changeToFull.bind(this); }, constants: { - VERSION: '0.10', + VERSION: '0.10', - CARDINAL_NUMBER: 10, + CARDINAL_NUMBER: 10, - YOUTUBE_DOMAIN: '.youtube.jp', - YOUTUBE_URL: '^http://[^.]+\\.youtube\\.com/', - WATCH_URL: 'http://[^.]+\\.youtube\\.com/watch', - WATCH_PAGE: 1, + YOUTUBE_DOMAIN: '.youtube.jp', + YOUTUBE_URL: '^http://[^.]+\\.youtube\\.com/', + WATCH_URL: 'http://[^.]+\\.youtube\\.com/watch', + WATCH_PAGE: 1, PLAYER_NODE_ID: 'movie_player', - STATE_PLAYING: 1, + STATE_PLAYING: 1, - SIZE_WIDTH_DEFAULT: 480, - SIZE_HEIGHT_DEFAULT: 385, + SIZE_WIDTH_DEFAULT: 480, + SIZE_HEIGHT_DEFAULT: 385, NAME_PLAYER_VERSION: 'PLAYER_VERSION', - SEEKTO_DEFAULT: 0, - SEEKBY_DEFAULT: 0, - VOLUMETO_DEFAULT: 100, - VOLUMEBY_DEFAULT: 0, + SEEKTO_DEFAULT: 0, + SEEKBY_DEFAULT: 0, + VOLUMETO_DEFAULT: 100, + VOLUMEBY_DEFAULT: 0, HIDE_NODES: [ 'old-masthead', @@ -95,7 +95,7 @@ YouTubePlayerController.prototype = { ], }, - getControllerVersion: function () { return this.constants.VERSION; }, + getControllerVersion: function() { return this.constants.VERSION; }, pagecheck: function() { if(this.getURL().match(this.constants.WATCH_URL)) return this.constants.WATCH_PAGE; @@ -133,24 +133,24 @@ YouTubePlayerController.prototype = { : this._normalSize(); }, - _changeToFull: function () { + _changeToFull: function() { var p = this._player(); - setTimeout(function () { + setTimeout(function() { p.width = content.innerWidth; p.height = content.innerHeight; }, 0); }, - _getElementById: function (id) { + _getElementById: function(id) { var e = window.content.document.getElementById(id); - if (!e) return null; + if(!e) return null; return e.wrappedJSObject ? e.wrappedJSObject : e; }, - _fullSize: function () { + _fullSize: function() { var b = this._getElementById('baseDiv'); this.defMargin = b.style.margin; this.defPadding = b.style.padding; @@ -159,9 +159,9 @@ YouTubePlayerController.prototype = { b.style.padding = 0; b.style.width = '100%'; - for (var i=0, max=this.constants.HIDE_NODES.length ; i