aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vimperatorrc.dot.link15
1 files changed, 15 insertions, 0 deletions
diff --git a/vimperatorrc.dot.link b/vimperatorrc.dot.link
index 0662fdc..0ba9972 100644
--- a/vimperatorrc.dot.link
+++ b/vimperatorrc.dot.link
@@ -46,3 +46,18 @@ command sendtabs :emenu File.Send Tab URLs...
" Copy URLs shortcut
" https://addons.mozilla.org/en-US/firefox/addon/copyurls/
command copyurls :emenu Edit.Copy Urls Expert.Tabs In This Window
+
+" FIXME
+" Post to Links Saraventos
+command! -nargs=* link js link(<args>);
+:js <<EOJS
+ link = function(args) {
+ var instance = 'https://links.sarava.org/bookmarks?action=add&address=';
+ var doc = content.document;
+ var href = encodeURIComponent(content.document.location);
+ var title = encodeURIComponent(content.document.title);
+ var desc = encodeURIComponent(doc.getSelection());
+ var tags = encodeURIComponent(args.toString().replace(/,,/g, ';').replace(/,/g, ' ').replace(/;/g, ', '));
+ commands.execute('tabopen ' + instance + href + '&title=' + title + '&description=' + desc + '&tags=' + tags);
+ }
+EOJS