From 81bb39274ab572dba424f61dc60a7f669d372377 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 18 Jun 2015 11:50:06 -0300 Subject: Scuttle: cleanup --- vimperator.dot.link/plugin/scuttle.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vimperator.dot.link/plugin/scuttle.js b/vimperator.dot.link/plugin/scuttle.js index 8ce2178..06f160a 100644 --- a/vimperator.dot.link/plugin/scuttle.js +++ b/vimperator.dot.link/plugin/scuttle.js @@ -35,14 +35,13 @@ commands.addUserCommand(['scuttle'], "Save page as a bookmark on Scuttle", var re = new RegExp(/"([^"]+)"/); var ext = args.string.match(re); if (ext) { - tags = args.string.substr(ext[0].length).replace(/,,/g, ';').replace(/,/g, ' ').replace(/;/g, ', ').replace(/%2C/g, ','); + tags = args.string.substr(ext[0].length) url += "&extended=" + encodeURIComponent(ext[1]); - url += tags; } else { - tags = "&tags=" + encodeURIComponent(args.toString().replace(/,,/g, ';').replace(/,/g, ' ').replace(/;/g, ', ')).replace(/%2C/g, ','); - url += tags; + tags = args.string; } + url += "&tags=" + encodeURIComponent(tags).replace(/,,/g, ';').replace(/,/g, ' ').replace(/;/g, ', ').replace(/%2C/g, ','); var xhr = new XMLHttpRequest(); xhr.open("POST", url, false); xhr.send(null); -- cgit v1.2.3