aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-06-02 11:53:22 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-06-02 11:53:22 -0300
commit50c45eca3131f3a1cd4a2736186a197a6e8dae2e (patch)
tree67b740994170c23533b9054a07172a0ff4d09c75
parent132588055fcb12d99fecf7cf6e4ca362142108ba (diff)
downloadvimperator-50c45eca3131f3a1cd4a2736186a197a6e8dae2e.tar.gz
vimperator-50c45eca3131f3a1cd4a2736186a197a6e8dae2e.tar.bz2
Initial links posting code
-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