Skip to content

Commit e709b6f

Browse files
committed
let-ification
1 parent 794a6c1 commit e709b6f

20 files changed

+166
-129
lines changed

src/js/FileSaver.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
function saveAs(text, type, filename) {
24
let element = document.createElement('a');
35
//encode text as blob

src/js/buildStandalone.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
let standalone_HTML_String="";
24

35
let clientStandaloneRequest = new XMLHttpRequest();

src/js/colors.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
colorPalettesAliases = {
1+
'use strict';
2+
3+
const colorPalettesAliases = {
24
1 : "mastersystem",
35
2 : "gameboycolour",
46
3 : "amiga",
@@ -15,7 +17,7 @@ colorPalettesAliases = {
1517
14 : "whitingjp"
1618
};
1719

18-
colorPalettes = {
20+
const colorPalettes = {
1921
mastersystem : {
2022
black : "#000000",
2123
white : "#FFFFFF",

src/js/console.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
function jumpToLine(i) {
24

35
let code = parent.form1.code;
@@ -66,7 +68,7 @@ function consolePrint(text,urgent,linenumber,inspect_ID) {
6668
let cache_n = 0;
6769

6870
function addToConsole(text) {
69-
cache = document.createElement("div");
71+
const cache = document.createElement("div");
7072
cache.id = "cache" + cache_n;
7173
cache.innerHTML = text;
7274
cache_n++;

src/js/debug.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
let canSetHTMLColors=false;
24
let canDump=true;
35
let recordingStartsFromLevel=0;

src/js/debug_off.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
let canSetHTMLColors=true;
24
let canDump=false;
35
let canOpenEditor=false;

src/js/editor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
let code = document.getElementById('code');
24
let _editorDirty = false;
35
let _editorCleanState = "";

src/js/font.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12

23
let font = {
34
'0': `

src/js/github.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
'use strict';
2+
13
// The client ID of a GitHub OAuth app registered at https://github.com/settings/developers.
24
// The “callback URL” of that app points to https://www.puzzlescript.net/auth.html.
35
// If you’re running from another host name, sharing might not work.
4-
OAUTH_CLIENT_ID = "211570277eb588cddf44";
6+
const OAUTH_CLIENT_ID = "211570277eb588cddf44";
57

68
function github_authURL() {
79
// Generates 32 letters of random data, like "liVsr/e+luK9tC02fUob75zEKaL4VpQn".

src/js/graphics.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
function createSprite(name, spritegrid, colors, padding) {
24
if (colors === undefined) {
35
colors = [state.bgcolor, state.fgcolor];
@@ -67,7 +69,7 @@ function regenText(spritecanvas, spritectx) {
6769
var n = row[nidx];
6870
if (!textImages.hasOwnProperty(n)) {
6971
if (font.hasOwnProperty(n)) {
70-
fontstr = font[n].split('\n').map(a => a.trim().split('').map(t => parseInt(t)));
72+
const fontstr = font[n].split('\n').map(a => a.trim().split('').map(t => parseInt(t)));
7173
fontstr.shift();
7274
textImages[n] = createSprite('char' + n, fontstr, ["#00000000", state.fgcolor], 1);
7375
} else {
@@ -143,7 +145,7 @@ function generateGlyphImages() {
143145
glyphImagesCorrespondance = [];
144146
glyphImages = [];
145147

146-
seenobjects = {};
148+
const seenobjects = {};
147149
for (var n of state.glyphOrder) {
148150
if (n.length == 1 && state.glyphDict.hasOwnProperty(n)) {
149151
var g = state.glyphDict[n];

0 commit comments

Comments
 (0)