From: Silvio Rhatto Date: Thu, 18 Jun 2015 14:50:06 +0000 (-0300) Subject: Scuttle: cleanup X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=81bb39274ab572dba424f61dc60a7f669d372377;p=rhatto%2Fdotfiles%2Fvimperator.git Scuttle: cleanup --- 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);