aboutsummaryrefslogtreecommitdiffstats
path: root/ldrize_cooperation.js
diff options
context:
space:
mode:
authortrapezoid2009-06-11 16:11:22 +0000
committertrapezoid2009-06-11 16:11:22 +0000
commita676aa169fdd07e62cb4d07537b7a687f7847ab1 (patch)
tree2359569394444adab6407d59e14d15e713e8e454 /ldrize_cooperation.js
parent9c5a7d92bab0338ec0752f08449d634560a85a6c (diff)
downloadvimperator-plugins-a676aa169fdd07e62cb4d07537b7a687f7847ab1.tar.bz2
ldrize_cooperation_fetch_flv.js: add pinned movie to mylist
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@33910 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'ldrize_cooperation.js')
-rw-r--r--ldrize_cooperation.js28
1 files changed, 16 insertions, 12 deletions
diff --git a/ldrize_cooperation.js b/ldrize_cooperation.js
index 70d165c..966fde4 100644
--- a/ldrize_cooperation.js
+++ b/ldrize_cooperation.js
@@ -1,6 +1,6 @@
// Vimperator plugin: 'Cooperation LDRize Mappings'
-// Version: 0.24
-// Last Change: 08-May-2009. Jan 2008
+// Version: 0.25
+// Last Change: 12-Jun-2009. Jan 2008
// License: Creative Commons
// Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid
//
@@ -68,7 +68,9 @@ if (liberator.plugins.LDRizeCooperation == undefined) (function(){
var handlerInfo = [
//{
// pattern: "http://www.nicovideo.jp/*",
- // handler: ["c:\\usr\\SmileDownloader\\SmileDownloader.exe",["%URL%"]],
+ // handler: {
+ // download: ["c:\\usr\\SmileDownloader\\SmileDownloader.exe",["%URL%"]]
+ // },
// wait: 5000
//},
//{
@@ -263,7 +265,9 @@ if (liberator.plugins.LDRizeCooperation == undefined) (function(){
}
});
liberator.modules.commands.addUserCommand(["pindownload"],"Download pinned links by any software",
- function(arg){ self.downloadLinksByProgram(self.getPinnedItems());},{});
+ function(arg){ self.downloadLinksByProgram("download",self.getPinnedItems());},{});
+ liberator.modules.commands.addUserCommand(["pindo"],"Do external command, with pinned links",
+ function(arg){ self.downloadLinksByProgram(arg.string, self.getPinnedItems());},{});
liberator.modules.commands.addUserCommand(["toggleldrizecooperation","toggleldrc"],"Toggle LDRize Cooperation",
function(arg){ self.isEnable = !self.isEnable},{});
//Options
@@ -309,20 +313,20 @@ if (liberator.plugins.LDRizeCooperation == undefined) (function(){
return [linkResult,viewResult ? viewResult.textContent : null];
});
},
- downloadLinksByProgram: function(links){
+ downloadLinksByProgram: function(command, links){
var self = this;
var count = 0;
links.forEach(function([url,title]){
for each(let x in self.handlerInfo){
if(x.include.test(url)){
setTimeout(function(){
- if(typeof x.handler == "object"){
- let args = x.handler[1].map(function(s) s.replace(/%URL%/g,url).replace(/%TITLE%/g,title));
- liberator.modules.io.run(x.handler[0],args,false);
- }else if(typeof x.handler == "string"){
- liberator.modules.io.run(x.handler,[url],false);
- }else if(typeof x.handler == "function"){
- x.handler(url.toString(),title);
+ if(typeof x.handler[command] == "object"){
+ let args = x.handler[command][1].map(function(s) s.replace(/%URL%/g,url).replace(/%TITLE%/g,title));
+ liberator.modules.io.run(x.handler[command][0],args,false);
+ }else if(typeof x.handler[command] == "string"){
+ liberator.modules.io.run(x.handler[command],[url],false);
+ }else if(typeof x.handler[command] == "function"){
+ x.handler[command](url.toString(),title);
}
},x.wait != undefined ? x.wait * count++ : 0);
return;