Created
September 14, 2009 18:58
-
-
Save djsnipa1/186848 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "filestube", | |
takes: {"url": noun_arb_text}, | |
icon: "http://static.filestube.com/files/images/favicon.ico", | |
homepage: "http://twitter.com/djsnipa1", | |
author: { name: "djsnipa1", email: "djsnipa1@gmail.com"}, | |
license: "MPL,GPL", | |
description: "Search for files on filestube.com", | |
help: "Select a movie, actor, tv show... and issue netflix", | |
execute: function( ) { | |
var document = context.focusedWindow.document; | |
var selected_text=document.getSelection(); | |
selected_text=selected_text.substring(0,375); | |
var params = Utils.paramsToString({ | |
v1: selected_text | |
}); | |
filestube_url='http://www.filestube.com/search.html?q='+params; | |
Utils.openUrlInBrowser(filestube_search_url); | |
}, | |
preview: function( pblock ) { | |
var document = context.focusedWindow.document; | |
var selected_text=document.getSelection(); | |
selected_text=selected_text.substring(0,375); | |
var msg = 'Search for "<i>${movie_title}</i>" on Filestube'; | |
pblock.innerHTML = CmdUtils.renderTemplate( msg, {movie_title: selected_text} ); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment