diff options
author | otsune | 2008-04-27 16:24:57 +0000 |
---|---|---|
committer | otsune | 2008-04-27 16:24:57 +0000 |
commit | 99f21fa69ed1106f410ac7904c71a7ca3cbb37dc (patch) | |
tree | 81c8fbf54ed17333e58ac3998e0806c4472130ab /nicovideo_comment.js | |
parent | 8ea8539200e4acb5257134ac9a613d16e5b513f2 (diff) | |
download | vimperator-plugins-99f21fa69ed1106f410ac7904c71a7ca3cbb37dc.tar.bz2 |
* alpha quality
* I'm not premium user of nicovideo. plz somebody test it.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@10612 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'nicovideo_comment.js')
-rw-r--r-- | nicovideo_comment.js | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/nicovideo_comment.js b/nicovideo_comment.js new file mode 100644 index 0000000..86efba0 --- /dev/null +++ b/nicovideo_comment.js @@ -0,0 +1,76 @@ +/** + * ==VimperatorPlugin== + * @name nicovideo_comment.js + * @description + * @description-ja ニコニコ動画のコメント欄を入力 + * @minVersion 0.6pre + * @author otsune + * @version 0.1 + * ==/VimperatorPlugin== + * + * Usage: + * :nico {String} -> Fill comment form + * :nico! {String} -> Fill mail form + */ +(function(){ +var flvp = window.content.wrappedJSObject.document.getElementById('flvplayer'); + +liberator.commands.addUserCommand(['nico'],'Fill comment form in nicovideo', + function(arg, special){ + var form = special ? 'inputArea.MailInput.text' : 'inputArea.ChatInput1.text' ; + flvp.SetVariable(form, arg.toString() ); + },{ + completer: function(filter, special){ + var templates = []; + var commands = [ + 'ue', + 'shita', + 'big', + 'medium', + 'small', + 'white', + 'red', + 'pink', + 'orange', + 'yellow', + 'green', + 'cyan', + 'blue', + 'purple', + '184', + 'sage' + ]; + var premiumcommands = [ + 'invisible', + 'niconicowhite', + 'truered', + 'passionorange', + 'madyellow', + 'elementalgreen', + 'marineblue', + 'nobleviolet', + 'black' + ]; + if (special){ + commands.forEach(function(command){ + if (command[0].toLowerCase().indexOf(filter.toLowerCase()) == 0){ + templates.push(command); + } + }); + }; + if (special && !(flvp.GetVariable('premiumNo')) ){ + premiumcommands.forEach(function(premiumcommand){ + if (premiumcommand[0].toLowerCase().indexOf(filter.toLowerCase()) == 0){ + templates.push(premiumcommand); + } + }); + }; + + return [0, templates]; + } + } +); + +})(); + +// vim: set fdm=marker sw=4 ts=4 et: |