Initial release
This commit is contained in:
commit
97a5d725e7
13
index.html
Normal file
13
index.html
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</body>
|
||||||
|
</html>
|
116
main.js
Normal file
116
main.js
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
const {app, Menu, BrowserWindow} = require('electron')
|
||||||
|
const path = require('path')
|
||||||
|
const url = require('url')
|
||||||
|
|
||||||
|
// Keep a global reference of the window object, if you don't, the window will
|
||||||
|
// be closed automatically when the JavaScript object is garbage collected.
|
||||||
|
let win
|
||||||
|
const template = [
|
||||||
|
{
|
||||||
|
label: 'Edit',
|
||||||
|
submenu: [
|
||||||
|
{role: 'undo'},
|
||||||
|
{role: 'redo'},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'cut'},
|
||||||
|
{role: 'copy'},
|
||||||
|
{role: 'paste'},
|
||||||
|
{role: 'pasteandmatchstyle'},
|
||||||
|
{role: 'delete'},
|
||||||
|
{role: 'selectall'}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'View',
|
||||||
|
submenu: [
|
||||||
|
{role: 'reload'},
|
||||||
|
{role: 'forcereload'},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'resetzoom'},
|
||||||
|
{role: 'zoomin'},
|
||||||
|
{role: 'zoomout'},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'togglefullscreen'}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
role: 'window',
|
||||||
|
submenu: [
|
||||||
|
{role: 'minimize'},
|
||||||
|
{role: 'close'}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
|
template.unshift({
|
||||||
|
label: app.getName(),
|
||||||
|
submenu: [
|
||||||
|
{role: 'about'},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'services', submenu: []},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'hide'},
|
||||||
|
{role: 'hideothers'},
|
||||||
|
{role: 'unhide'},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'quit'}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
// Edit menu
|
||||||
|
template[1].submenu.push(
|
||||||
|
{type: 'separator'},
|
||||||
|
{
|
||||||
|
label: 'Speech',
|
||||||
|
submenu: [
|
||||||
|
{role: 'startspeaking'},
|
||||||
|
{role: 'stopspeaking'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// Window menu
|
||||||
|
template[3].submenu = [
|
||||||
|
{role: 'close'},
|
||||||
|
{role: 'minimize'},
|
||||||
|
{role: 'zoom'},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'front'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
// Create the browser window.
|
||||||
|
const menu = Menu.buildFromTemplate(template)
|
||||||
|
Menu.setApplicationMenu(menu)
|
||||||
|
|
||||||
|
win = new BrowserWindow({width: 480, height: 600,icon: path.join(__dirname, 'ic_launcher.png')})
|
||||||
|
|
||||||
|
// and load the index.html of the app.
|
||||||
|
win.loadURL('http://pf.gree.net/58737',{userAgent: 'Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F27E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36'});
|
||||||
|
// Open the DevTools.
|
||||||
|
|
||||||
|
// Emitted when the window is closed.
|
||||||
|
win.on('closed', () => {
|
||||||
|
// Dereference the window object, usually you would store windows
|
||||||
|
// in an array if your app supports multi windows, this is the time
|
||||||
|
// when you should delete the corresponding element.
|
||||||
|
win = null
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// This method will be called when Electron has finished
|
||||||
|
// initialization and is ready to create browser windows.
|
||||||
|
// Some APIs can only be used after this event occurs.
|
||||||
|
app.on('ready', createWindow)
|
||||||
|
|
||||||
|
// Quit when all windows are closed.
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
// On macOS it is common for applications and their menu bar
|
||||||
|
// to stay active until the user quits explicitly with Cmd + Q
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
9
package.json
Normal file
9
package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "MillionHopes",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "A thin wrapper for the game THE IDOLM@STER: Million Live!, using Electron.",
|
||||||
|
"main": "main.js",
|
||||||
|
"devDependencies": {
|
||||||
|
"electron": "^1.6.11"
|
||||||
|
}
|
||||||
|
}
|
2
package.sh
Executable file
2
package.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
# Mac OS X
|
||||||
|
electron-packager . "MillionHopes" --all --overwrite --icon icon.icns --out out
|
Reference in New Issue
Block a user