From 4a1f8b915ca21f3bdd6fff1e1bc7d686d2a7ed6a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 20 Jan 2015 14:25:16 +0100 Subject: [PATCH] Fix posting unicode characters to scuttle --- conkeror/.conkerorrc/site-js/scuttle.js | 56 +++++++++++++++---------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/conkeror/.conkerorrc/site-js/scuttle.js b/conkeror/.conkerorrc/site-js/scuttle.js index 8ecb63a..f173afe 100644 --- a/conkeror/.conkerorrc/site-js/scuttle.js +++ b/conkeror/.conkerorrc/site-js/scuttle.js @@ -52,22 +52,26 @@ interactive("scuttle-post", function (I) { check_buffer(I.buffer, content_buffer); let posturl = 'https://ryuslash.org/scuttle/api/posts_add.php?&url=' + - encodeURIComponent( - load_spec_uri_string( - load_spec(I.buffer.top_frame))) + + escape(load_spec_uri_string(load_spec(I.buffer.top_frame))) + '&description=' + - encodeURIComponent( + escape(( yield I.minibuffer.read( $prompt = "name (required): ", - $initial_value = I.buffer.title)) + + $initial_value = I.buffer.title + ) + )) + '&tags=' + - encodeURIComponent( + escape(( yield I.minibuffer.read( - $prompt = "tags (space delimited): ")) + + $prompt = "tags (space delimited): " + ) + )) + '&extended=' + - encodeURIComponent( + escape(( yield I.minibuffer.read( - $prompt = "extended description: ")); + $prompt = "extended description: " + ) + )); try { var content = yield send_http_request( @@ -90,20 +94,26 @@ interactive("scuttle-post-link", load_spec(encodeURIComponent(bo))); check_buffer(I.buffer, content_buffer); let postlinkurl = 'https://ryuslash.org/scuttle/api/posts_add.php?&url=' + - mylink + - '&description=' + - encodeURIComponent( - yield I.minibuffer.read( - $prompt = "name (required): ", - $initial_value = bo.textContent)) + - '&tags=' + - encodeURIComponent( - yield I.minibuffer.read( - $prompt = "tags (space delimited): ")) + - '&extended=' + - encodeURIComponent( - yield I.minibuffer.read( - $prompt = "extended description: ")); + mylink + + '&description=' + + escape(( + yield I.minibuffer.read( + $prompt = "name (required): ", + $initial_value = bo.textContent + ) + )) + + '&tags=' + + escape(( + yield I.minibuffer.read( + $prompt = "tags (space delimited): " + ) + )) + + '&extended=' + + escape(( + yield I.minibuffer.read( + $prompt = "extended description: " + ) + )); try { var content = yield send_http_request(