mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17:22 +00:00
Cleanup
This commit is contained in:
parent
ae31af0106
commit
675a84c14b
13 changed files with 34 additions and 54 deletions
|
|
@ -11,5 +11,6 @@ export default function ({ theme, setLocation, buildLink }) {
|
|||
return (
|
||||
<input
|
||||
type='file'
|
||||
onChange={fileInputHandler} />)
|
||||
onChange={fileInputHandler} />
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,5 +17,6 @@ export default function ({ theme, setLocation, buildLink }) {
|
|||
<input
|
||||
type='text'
|
||||
placeholder='https://...'
|
||||
onKeyPress={onKeyPress} />)
|
||||
onKeyPress={onKeyPress} />
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ const keyCodes = {
|
|||
KEY_LEFT: 37,
|
||||
KEY_UP: 38,
|
||||
KEY_RIGHT: 39,
|
||||
KEY_DOWN: 40}
|
||||
KEY_DOWN: 40
|
||||
}
|
||||
|
||||
const keyNames = {
|
||||
[keyCodes.KEY_BACKSPACE]: 'delete',
|
||||
|
|
@ -28,7 +29,8 @@ const keyNames = {
|
|||
[keyCodes.KEY_LEFT]: 'left',
|
||||
[keyCodes.KEY_UP]: 'up',
|
||||
[keyCodes.KEY_RIGHT]: 'right',
|
||||
[keyCodes.KEY_DOWN]: 'down'}
|
||||
[keyCodes.KEY_DOWN]: 'down'
|
||||
}
|
||||
/* eslint-enable */
|
||||
|
||||
export default function ({ currentWindow, inputType, sendMessage }) {
|
||||
|
|
@ -62,18 +64,15 @@ export default function ({ currentWindow, inputType, sendMessage }) {
|
|||
|
||||
const inputHandlers = {
|
||||
char: {
|
||||
placeholder: 'Press any key',
|
||||
onKeyDown: charHandler
|
||||
},
|
||||
line: {
|
||||
placeholder: ' > ',
|
||||
onKeyPress: lineHandler
|
||||
}
|
||||
}
|
||||
|
||||
const placeholder = {
|
||||
char: 'Press any key',
|
||||
line: ' > '
|
||||
}
|
||||
|
||||
const enterFullscreen = _ =>
|
||||
document.documentElement.requestFullscreen()
|
||||
|
||||
|
|
@ -82,7 +81,6 @@ export default function ({ currentWindow, inputType, sendMessage }) {
|
|||
className='inputBox'
|
||||
ref={inputEl}
|
||||
value={inputText}
|
||||
placeholder={placeholder[inputType]}
|
||||
autofocus
|
||||
autocomplete='off'
|
||||
onDblClick={enterFullscreen}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,6 @@ const INITIAL_STATUS = {
|
|||
}
|
||||
|
||||
const runMachine = ({ Engine, file, handlers }) => {
|
||||
console.log('runMachine')
|
||||
|
||||
const vm = new Engine()
|
||||
const { glkInterface, sendFn } = CheapGlkOte(handlers)
|
||||
|
||||
|
|
@ -117,5 +115,6 @@ export default function ({ vmParts: { file, engine } }) {
|
|||
inputType,
|
||||
sendMessage
|
||||
}} />
|
||||
</section>)
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,20 @@
|
|||
import { h } from 'preact'
|
||||
import { Link } from 'wouter-preact'
|
||||
|
||||
const fail = details => (
|
||||
<div class='status fail'>
|
||||
<h1>Error</h1>
|
||||
<h1>
|
||||
Error
|
||||
</h1>
|
||||
{details.map(x => (<p>{x}</p>))}
|
||||
<hr />
|
||||
<a href='/'>
|
||||
<Link href='/'>
|
||||
Home
|
||||
</a>
|
||||
</Link>
|
||||
|
|
||||
<a href='https://github.com/He4eT/ifplayer/issues'>
|
||||
<a
|
||||
target='_blank'
|
||||
href='https://github.com/He4eT/ifplayer/issues'>
|
||||
Report bug
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
// import CheapGlkOte from 'cheap-glkote'
|
||||
// import engine from 'emglken/src/tads.js'
|
||||
|
||||
// import { engineByFilename } from './engines'
|
||||
|
||||
// export const fetchGameFile = url => fetch(url)
|
||||
// .then(response => (console.log(response), response))
|
||||
// .then(response => response.blob())
|
||||
// .then(blob => new Response(blob).arrayBuffer())
|
||||
// .then(buffer => new Uint8Array(buffer))
|
||||
// .then(file => {
|
||||
// const { glkInterface, sendFn } = CheapGlkOte({
|
||||
// onUpdateContent: messages => console.log(messages)
|
||||
// })
|
||||
// window.send = sendFn
|
||||
|
||||
// const vm = new engine()
|
||||
// vm.prepare(file, glkInterface)
|
||||
// vm.start()
|
||||
// })
|
||||
// .catch(console.log)
|
||||
|
|
@ -65,4 +65,3 @@
|
|||
66% { content: '..'; }
|
||||
100% { content: '...'; }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,5 +12,6 @@ export default function ({ themeEngine }) {
|
|||
onChange={({ target }) =>
|
||||
themeEngine.setTheme(target.value)}>
|
||||
{options}
|
||||
</select>)
|
||||
</select>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue