From c5ca5ee132387bba79864af7fa40b998df9a9538 Mon Sep 17 00:00:00 2001 From: Will Scullin Date: Sat, 15 Jun 2019 15:59:02 -0700 Subject: [PATCH] Less ES6 --- js/cards/disk2.js | 2 +- js/entry2.js | 4 ++-- js/entry2e.js | 4 ++-- js/main2.js | 6 +++--- js/main2e.js | 6 +++--- js/ui/tape.js | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/js/cards/disk2.js b/js/cards/disk2.js index 27d3f78..8f1dcc5 100644 --- a/js/cards/disk2.js +++ b/js/cards/disk2.js @@ -12,7 +12,7 @@ import { base64_decode, base64_encode } from '../base64'; import { bytify, debug } from '../util'; -export const DISK_TYPES = ['dsk','d13','do','po','raw','nib','2mg']; +export var DISK_TYPES = ['dsk','d13','do','po','raw','nib','2mg']; export default function DiskII(io, slot, callbacks) { diff --git a/js/entry2.js b/js/entry2.js index 5adb7b4..e91fa82 100644 --- a/js/entry2.js +++ b/js/entry2.js @@ -1,3 +1,3 @@ -const Apple2 = require('./main2'); +var Apple2 = require('./main2'); -module.exports = { Apple2 }; +module.exports = { Apple2: Apple2 }; diff --git a/js/entry2e.js b/js/entry2e.js index dcdb025..35b2e71 100644 --- a/js/entry2e.js +++ b/js/entry2e.js @@ -1,3 +1,3 @@ -const Apple2 = require('./main2e'); +var Apple2 = require('./main2e'); -module.exports = { Apple2 }; +module.exports = { Apple2: Apple2 }; diff --git a/js/main2.js b/js/main2.js index 9bf5f85..5e447d3 100644 --- a/js/main2.js +++ b/js/main2.js @@ -149,7 +149,7 @@ function loadAjax(drive, url) { }).then(function(data) { if (data.type == 'binary') { loadBinary(drive, data); - } else if (DISK_TYPES.includes(data.type)) { + } else if (DISK_TYPES.indexOf(data.type) > -1) { loadDisk(drive, data); } initGamepad(data.gamepad); @@ -214,9 +214,9 @@ export function doDelete(name) { function doLoadLocal(drive, file) { var parts = file.name.split('.'); var ext = parts[parts.length - 1].toLowerCase(); - if (DISK_TYPES.includes(ext)) { + if (DISK_TYPES.indexOf(ext) > -1) { doLoadLocalDisk(drive, file); - } else if (TAPE_TYPES.includes(ext)) { + } else if (TAPE_TYPES.indexOf(ext) > -1) { tape.doLoadLocalTape(file); } else { window.alert('Unknown file type: ' + ext); diff --git a/js/main2e.js b/js/main2e.js index caa3518..90f8764 100644 --- a/js/main2e.js +++ b/js/main2e.js @@ -144,7 +144,7 @@ function loadAjax(drive, url) { }).then(function(data) { if (data.type == 'binary') { loadBinary(drive, data); - } else if (DISK_TYPES.includes(data.type)) { + } else if (DISK_TYPES.indexOf(data.type) > -1) { loadDisk(drive, data); } initGamepad(data.gamepad); @@ -210,9 +210,9 @@ export function doDelete(name) { function doLoadLocal(drive, file) { var parts = file.name.split('.'); var ext = parts[parts.length - 1].toLowerCase(); - if (DISK_TYPES.includes(ext)) { + if (DISK_TYPES.indexOf(ext) > -1) { doLoadLocalDisk(drive, file); - } else if (TAPE_TYPES.includes(ext)) { + } else if (TAPE_TYPES.indexOf(ext) > -1) { tape.doLoadLocalTape(file); } else { window.alert('Unknown file type: ' + ext); diff --git a/js/ui/tape.js b/js/ui/tape.js index 5dc1156..dc4306c 100644 --- a/js/ui/tape.js +++ b/js/ui/tape.js @@ -12,7 +12,7 @@ import { debug } from '../util'; -export const TAPE_TYPES = ['wav','aiff','aif','mp3','m4a']; +export var TAPE_TYPES = ['wav','aiff','aif','mp3','m4a']; export default function Tape(io) { var AudioContext = window.AudioContext || window.webkitAudioContext;