From 274321cbaeaa66d2d9cea2f92a74268798f5a4b8 Mon Sep 17 00:00:00 2001 From: SPGoding Date: Mon, 5 Aug 2019 21:29:13 +0800 Subject: [PATCH] Add base64 encoding for share link --- model.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model.js b/model.js index 11820cea..fba0d411 100644 --- a/model.js +++ b/model.js @@ -15,7 +15,7 @@ addEntry($('#structure .pool').get()); const params = new URLSearchParams(window.location.search); if (params.has('q')) { - $('#source').val(params.get('q')); + $('#source').val(atob(params.get('q'))); updateSouce(); } @@ -42,7 +42,7 @@ function showSource() { } function linkSource() { - let link = window.location.origin + window.location.pathname + '?q=' + JSON.stringify(table); + let link = window.location.origin + window.location.pathname + '?q=' + btoa(JSON.stringify(table)); $('#copyTextarea').removeClass('d-none').val(link); $('#copyTextarea').get()[0].select(); document.execCommand('copy');