aboutsummaryrefslogtreecommitdiffstats
path: root/tombloo.js
diff options
context:
space:
mode:
authormattn2008-07-17 10:29:43 +0000
committermattn2008-07-17 10:29:43 +0000
commite35a8e5dcb79184101e3165a8af79628e0aae97f (patch)
treefe749f5590ac8c788f0ce13af06968a03091ecf3 /tombloo.js
parent30b81faf2abc10fe2ae100e49ed66f8ead2ff784 (diff)
downloadvimperator-plugins-e35a8e5dcb79184101e3165a8af79628e0aae97f.tar.bz2
:set fenc=utf-8 ff=unix|wq
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@15932 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'tombloo.js')
-rw-r--r--tombloo.js144
1 files changed, 72 insertions, 72 deletions
diff --git a/tombloo.js b/tombloo.js
index f9fdb2c..54ef90d 100644
--- a/tombloo.js
+++ b/tombloo.js
@@ -1,72 +1,72 @@
-/**
- * ==VimperatorPlugin==
- * @name tombloo.js
- * @description Tombloo integrate plugin
- * @description-ja TomblooŒo—R‚Å‘I‘ð—̈æ‚Ȃǂðpost‚·‚é
- * @author Trapezoid
- * @version 0.1
- * ==/VimperatorPlugin==
- *
- * Usage:
- * :tombloo arg -> post by Tombloo
- * :tomblooAction arg -> execute Tombloo's action in tool menu
- **/
-var TomblooService = Components.classes['@brasil.to/tombloo-service;1'].getService().wrappedJSObject;
-function update(target, src, keys){
- if(keys){
- keys.forEach(function(key){
- target[key] = src[key];
- });
- } else {
- for(var key in src)
- target[key] = src[key];
- }
-
- return target;
-}
-
-function getContext(){
- var doc = window.content.document;
- var win = window.content.wrappedJSObject;
- return update(update({
- document : doc,
- window : win,
- title : ''+doc.title || '',
- selection : ''+win.getSelection(),
- target : doc,
- //event : event,
- //mouse : mouse,
- //menu : gContextMenu,
- }, {}), win.location);
-}
-
-liberator.commands.addUserCommand(['tomblooAction'],'Execute Tombloo actions',
- function(arg){
- TomblooService.Tombloo.Service.actions[arg].execute();
- },{
- completer: function(filter){
- var completionList = new Array();
- for(var name in TomblooService.Tombloo.Service.actions)
- if(name.indexOf(filter) > -1)
- completionList.push([name,name]);
- return [0,completionList];
- }
- }
-);
-
-liberator.commands.addUserCommand(['tombloo'],'Post by Tombloo',
- function(arg){
- liberator.log(TomblooService.Tombloo.Service.extracters);
- TomblooService.Tombloo.Service.share(getContext(), TomblooService.Tombloo.Service.extracters[arg],false);
- },{
- completer: function(filter){
- var completionList = new Array();
- var exts = TomblooService.Tombloo.Service.check(getContext());
- liberator.log(exts[0]);
- for(var i=0; i < exts.length; i++)
- if(exts[i].name.indexOf(filter) > -1)
- completionList.push([exts[i].name,exts[i].name]);
- return [0,completionList];
- }
- }
-);
+/**
+ * ==VimperatorPlugin==
+ * @name tombloo.js
+ * @description Tombloo integrate plugin
+ * @description-ja Tombloo経由ã§é¸æŠžé ˜åŸŸãªã©ã‚’postã™ã‚‹
+ * @author Trapezoid
+ * @version 0.1
+ * ==/VimperatorPlugin==
+ *
+ * Usage:
+ * :tombloo arg -> post by Tombloo
+ * :tomblooAction arg -> execute Tombloo's action in tool menu
+ **/
+var TomblooService = Components.classes['@brasil.to/tombloo-service;1'].getService().wrappedJSObject;
+function update(target, src, keys){
+ if(keys){
+ keys.forEach(function(key){
+ target[key] = src[key];
+ });
+ } else {
+ for(var key in src)
+ target[key] = src[key];
+ }
+
+ return target;
+}
+
+function getContext(){
+ var doc = window.content.document;
+ var win = window.content.wrappedJSObject;
+ return update(update({
+ document : doc,
+ window : win,
+ title : ''+doc.title || '',
+ selection : ''+win.getSelection(),
+ target : doc,
+ //event : event,
+ //mouse : mouse,
+ //menu : gContextMenu,
+ }, {}), win.location);
+}
+
+liberator.commands.addUserCommand(['tomblooAction'],'Execute Tombloo actions',
+ function(arg){
+ TomblooService.Tombloo.Service.actions[arg].execute();
+ },{
+ completer: function(filter){
+ var completionList = new Array();
+ for(var name in TomblooService.Tombloo.Service.actions)
+ if(name.indexOf(filter) > -1)
+ completionList.push([name,name]);
+ return [0,completionList];
+ }
+ }
+);
+
+liberator.commands.addUserCommand(['tombloo'],'Post by Tombloo',
+ function(arg){
+ liberator.log(TomblooService.Tombloo.Service.extracters);
+ TomblooService.Tombloo.Service.share(getContext(), TomblooService.Tombloo.Service.extracters[arg],false);
+ },{
+ completer: function(filter){
+ var completionList = new Array();
+ var exts = TomblooService.Tombloo.Service.check(getContext());
+ liberator.log(exts[0]);
+ for(var i=0; i < exts.length; i++)
+ if(exts[i].name.indexOf(filter) > -1)
+ completionList.push([exts[i].name,exts[i].name]);
+ return [0,completionList];
+ }
+ }
+);