Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jcponce committed Feb 27, 2024
1 parent 6fccd64 commit c03a2cd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions function-plotter/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,13 @@ $('#texture-options a').each(function () {

// When the user presses the button, show some copyable text
function showLink() {
let expression_base64 = btoa($("#equation-input").val());
//let expression_base64 = encodeURI($("#equation-input").val());
let expression_unicode = encodeURI($("#equation-input").val());

let url = [location.protocol, "//", location.host, location.pathname].join(
""
);
url = url + "?expression=" + atob(expression_base64);
url = url + "?expression=" + (expression_unicode);
//url = url + "?expression=" + expression_base64;

$("#copyable-link").val(url);
Expand All @@ -248,11 +249,13 @@ $("#copyable-link").blur(function () {

// If the user already specified
$(function () {
var expression_base64 = getQueryVariable("expression");
//var expression_base64 = getQueryVariable("expression");
var expression_unicode = getQueryVariable("expression");
//console.log(expression_base64);
if (expression_base64) {
//if (expression_base64) {
if (expression_unicode) {
//$("#equation-input").val(atob(expression_base64.replace("/", "")));
$("#equation-input").val(decodeURIComponent(expression_base64));
$("#equation-input").val(decodeURIComponent(expression_unicode));
}
});

Expand Down

0 comments on commit c03a2cd

Please sign in to comment.