mirror of
https://github.com/misode/misode.github.io.git
synced 2026-05-01 01:59:33 +00:00
Merge pull request #7 from SPGoding/feature/base64
Add base64 encoding for share link
This commit is contained in:
4
model.js
4
model.js
@@ -15,7 +15,7 @@ addEntry($('#structure .pool').get());
|
|||||||
|
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
if (params.has('q')) {
|
if (params.has('q')) {
|
||||||
$('#source').val(params.get('q'));
|
$('#source').val(atob(params.get('q')));
|
||||||
updateSouce();
|
updateSouce();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ function showSource() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function linkSource() {
|
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').removeClass('d-none').val(link);
|
||||||
$('#copyTextarea').get()[0].select();
|
$('#copyTextarea').get()[0].select();
|
||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
|
|||||||
Reference in New Issue
Block a user