<link rel="import" href="sections/about.html">
require('./assets/imports')
// ./assets/imports
const links = document.querySelectorAll('link[rel="import"]')
// Import and add each page to the DOM
Array.prototype.forEach.call(links, function (link) {
let template = link.import.querySelector('.task-template')
let clone = document.importNode(template.content, true)
if (link.href.match('about.html')) {
document.querySelector('body').appendChild(clone)
} else {
document.querySelector('.content').appendChild(clone)
}
})
const ipc = require('electron').ipcRenderer
const informationBtn = document.getElementById('information-dialog')
informationBtn.addEventListener('click', function (event) {
ipc.send('open-information-dialog')
})
ipc.on('information-dialog-selection', function (event, index) {
let message = 'You selected '
if (index === 0) message += 'yes.'
else message += 'no.'
document.getElementById('info-selection').innerHTML = message
})
const app = require('electron').app
const ipc = require('electron').ipcMain
ipc.on('get-app-path', function (event) {
event.sender.send('got-app-path', app.getAppPath())
})