Skip to content

Commit

Permalink
honestly I'm just grasping at straws here
Browse files Browse the repository at this point in the history
  • Loading branch information
Mego committed Nov 13, 2015
1 parent 995f759 commit 0376a48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions static/seriously.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ $(document).ready(
function() {
$("#permalink").click(
function() {
var code = utf8_to_b64(window.JSON.stringify({
var code = encodeURIComponent(utf8_to_b64(window.JSON.stringify({
code : $('#code').val(),
input : $('#input').val()
}));
})));
prompt("Permalink:", "http://"
+ window.location.hostname + "/link/" + code);
window.location.pathname = "/link/" + code;
Expand Down
2 changes: 1 addition & 1 deletion templates/link.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>
<script>
$(document).ready(function() {
var s = window.JSON.parse(b64_to_utf8("{{ link }}"));
var s = window.JSON.parse(b64_to_utf8(decodeURIComponent("{{ link }}")));
var sCode = s.code;
var sInput = s.input;
var url = "http://" + window.location.hostname + "/";
Expand Down

2 comments on commit 0376a48

@ConorOBrien-Foxx
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 too much jQuery.

@phase
Copy link
Contributor

@phase phase commented on 0376a48 Nov 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah this was annoying. Flask encodes it as HTML instead of URI. Checkout mine to see how I did it

Please sign in to comment.