Skip to content

Commit

Permalink
Formatting after JavaScript changes from last night.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdsmith committed Jun 9, 2020
1 parent 40d99f5 commit 5247ea9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
1 change: 0 additions & 1 deletion format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ function format_hs {
rm "$tmpfile"
}

run . cabal_install ormolu-0.0.2.0
function formatall_hs {
for f in $(find */src -regex .*\\.hs$ -type f)
do
Expand Down
2 changes: 0 additions & 2 deletions web/css/runner.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@
cursor: default;
width: 100vw;
height: 100vh;
/* max-height: 100vh; */
/* max-width: 100vh; */
}
25 changes: 12 additions & 13 deletions web/js/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,34 +214,33 @@ function start() {

function init() {
let paramList = location.search.slice(1).split('&');
let params = {};
const params = {};
for (let i = 0; i < paramList.length; i++) {
let name = decodeURIComponent(paramList[i].split('=')[0]);
let value = decodeURIComponent(paramList[i].slice(name.length + 1));
const name = decodeURIComponent(paramList[i].split('=')[0]);
const value = decodeURIComponent(paramList[i].slice(name.length + 1));
params[name] = value;
}
// params from the hash
paramList = location.hash.slice(1).split('&');
for (let i = 0; i < paramList.length; i++) {
let name = decodeURIComponent(paramList[i].split('=')[0]);
let value = decodeURIComponent(paramList[i].slice(name.length + 1));
const name = decodeURIComponent(paramList[i].split('=')[0]);
const value = decodeURIComponent(paramList[i].slice(name.length + 1));
params[name] = value;
}

let hash = params['hash'];
let dhash = params['dhash'];
const hash = params['hash'];
const dhash = params['dhash'];
let mode = params['mode'];

let gid = params['gid'];
if (!mode) mode = 'codeworld';

let query = '?mode=' + encodeURIComponent(mode);
if (hash) query += '&hash=' + encodeURIComponent(hash);
if (dhash) query += '&dhash=' + encodeURIComponent(dhash);
let query = `?mode=${encodeURIComponent(mode)}`;
if (hash) query += `&hash=${encodeURIComponent(hash)}`;
if (dhash) query += `&dhash=${encodeURIComponent(dhash)}`;

let uri = 'runJS' + query;
const uri = `runJS${query}`;

let loadScript = document.createElement('script');
const loadScript = document.createElement('script');
loadScript.setAttribute('type', 'text/javascript');
loadScript.setAttribute('src', uri);
document.body.appendChild(loadScript);
Expand Down
5 changes: 3 additions & 2 deletions web/run.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<head>
<title>CodeWorld</title>
<link rel="stylesheet" type="text/css" href="css/theme-variables.css">
<link rel="stylesheet" type="text/css" href="css/runner.css">
</head>

Expand All @@ -13,6 +12,8 @@
</body>
<script type="text/javascript" src="js/run.js"></script>
<script type="text/javascript" src="js/debugmode.js"></script>
<script type="text/javascript">init();</script>
<script type="text/javascript">
init();
</script>

</html>

0 comments on commit 5247ea9

Please sign in to comment.