mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
Less ES6
This commit is contained in:
parent
ea8766f370
commit
c5ca5ee132
@ -12,7 +12,7 @@
|
|||||||
import { base64_decode, base64_encode } from '../base64';
|
import { base64_decode, base64_encode } from '../base64';
|
||||||
import { bytify, debug } from '../util';
|
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)
|
export default function DiskII(io, slot, callbacks)
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
const Apple2 = require('./main2');
|
var Apple2 = require('./main2');
|
||||||
|
|
||||||
module.exports = { Apple2 };
|
module.exports = { Apple2: Apple2 };
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
const Apple2 = require('./main2e');
|
var Apple2 = require('./main2e');
|
||||||
|
|
||||||
module.exports = { Apple2 };
|
module.exports = { Apple2: Apple2 };
|
||||||
|
@ -149,7 +149,7 @@ function loadAjax(drive, url) {
|
|||||||
}).then(function(data) {
|
}).then(function(data) {
|
||||||
if (data.type == 'binary') {
|
if (data.type == 'binary') {
|
||||||
loadBinary(drive, data);
|
loadBinary(drive, data);
|
||||||
} else if (DISK_TYPES.includes(data.type)) {
|
} else if (DISK_TYPES.indexOf(data.type) > -1) {
|
||||||
loadDisk(drive, data);
|
loadDisk(drive, data);
|
||||||
}
|
}
|
||||||
initGamepad(data.gamepad);
|
initGamepad(data.gamepad);
|
||||||
@ -214,9 +214,9 @@ export function doDelete(name) {
|
|||||||
function doLoadLocal(drive, file) {
|
function doLoadLocal(drive, file) {
|
||||||
var parts = file.name.split('.');
|
var parts = file.name.split('.');
|
||||||
var ext = parts[parts.length - 1].toLowerCase();
|
var ext = parts[parts.length - 1].toLowerCase();
|
||||||
if (DISK_TYPES.includes(ext)) {
|
if (DISK_TYPES.indexOf(ext) > -1) {
|
||||||
doLoadLocalDisk(drive, file);
|
doLoadLocalDisk(drive, file);
|
||||||
} else if (TAPE_TYPES.includes(ext)) {
|
} else if (TAPE_TYPES.indexOf(ext) > -1) {
|
||||||
tape.doLoadLocalTape(file);
|
tape.doLoadLocalTape(file);
|
||||||
} else {
|
} else {
|
||||||
window.alert('Unknown file type: ' + ext);
|
window.alert('Unknown file type: ' + ext);
|
||||||
|
@ -144,7 +144,7 @@ function loadAjax(drive, url) {
|
|||||||
}).then(function(data) {
|
}).then(function(data) {
|
||||||
if (data.type == 'binary') {
|
if (data.type == 'binary') {
|
||||||
loadBinary(drive, data);
|
loadBinary(drive, data);
|
||||||
} else if (DISK_TYPES.includes(data.type)) {
|
} else if (DISK_TYPES.indexOf(data.type) > -1) {
|
||||||
loadDisk(drive, data);
|
loadDisk(drive, data);
|
||||||
}
|
}
|
||||||
initGamepad(data.gamepad);
|
initGamepad(data.gamepad);
|
||||||
@ -210,9 +210,9 @@ export function doDelete(name) {
|
|||||||
function doLoadLocal(drive, file) {
|
function doLoadLocal(drive, file) {
|
||||||
var parts = file.name.split('.');
|
var parts = file.name.split('.');
|
||||||
var ext = parts[parts.length - 1].toLowerCase();
|
var ext = parts[parts.length - 1].toLowerCase();
|
||||||
if (DISK_TYPES.includes(ext)) {
|
if (DISK_TYPES.indexOf(ext) > -1) {
|
||||||
doLoadLocalDisk(drive, file);
|
doLoadLocalDisk(drive, file);
|
||||||
} else if (TAPE_TYPES.includes(ext)) {
|
} else if (TAPE_TYPES.indexOf(ext) > -1) {
|
||||||
tape.doLoadLocalTape(file);
|
tape.doLoadLocalTape(file);
|
||||||
} else {
|
} else {
|
||||||
window.alert('Unknown file type: ' + ext);
|
window.alert('Unknown file type: ' + ext);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
import { debug } from '../util';
|
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) {
|
export default function Tape(io) {
|
||||||
var AudioContext = window.AudioContext || window.webkitAudioContext;
|
var AudioContext = window.AudioContext || window.webkitAudioContext;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user