Skip to content

Commit

Permalink
✨ Implement #24
Browse files Browse the repository at this point in the history
  • Loading branch information
re-fort committed Dec 23, 2016
1 parent 9d4af4b commit 4c46eae
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 3 deletions.
27 changes: 24 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,18 @@ app.on('ready', () => {
})

app.once('ready', () => {
const template = [{
const template = [
{
label: 'Application',
submenu: [{
type: 'separator'
},
{
label: 'About TV-kko',
click: showAbout
}]
},
{
label: 'Edit',
submenu: [{
type: 'separator'
Expand Down Expand Up @@ -75,7 +86,7 @@ app.once('ready', () => {
label: 'Close',
accelerator: 'CmdOrCtrl+W',
role: 'close'
}]
}]
}]

const menu = Menu.buildFromTemplate(template)
Expand Down Expand Up @@ -104,4 +115,14 @@ ipcMain.on('async-fetchProgramList', (event, args) => {

ipcMain.on('async-fetchReservedList', (event, args) => {
nasne.fetchReservedList(event, args.ip)
})
})

function showAbout() {
const aboutWindow = new BrowserWindow({
width: 275,
height: 160,
parent: mainWindow
})
let currentVersion = require('./package.json').version
aboutWindow.loadURL(`file://${__dirname}/renderer/about.html#${currentVersion}`)
}
30 changes: 30 additions & 0 deletions renderer/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!doctype html>
<html lang="jp">
<head>
<meta charset="UTF-8"/>
<title>TV-kko</title>
<link href="./stylesheets/app.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- App -->
<div id="app">
<!-- Container -->
<div class="container">
<!-- Header -->
<header class="header">
<div class="logo">
<div class="tvkko-svg"></div>
<h2 class="heading">TV-kko</h2>
<span id="version">0.0.0</span>
</div>
</header>
</div>
</div>
</body>

</html>

<script>
let currentVersion = location.hash.replace('#', '')
document.querySelector('#version').textContent = currentVersion
</script>

0 comments on commit 4c46eae

Please sign in to comment.