Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7 from realzimon/CSP
Browse files Browse the repository at this point in the history
Make everything ready for deployment
  • Loading branch information
Hojosa authored Nov 30, 2018
2 parents 9a69799 + 5746c7d commit d5d5ce8
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 61 deletions.
4 changes: 2 additions & 2 deletions design.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<title>Zimon</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/segment7" type="text/css">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="app/style.css">
</head>

<body>

<div class="d-flex flex-column flex-md-row align-items-center p-1 px-md-4 mb-3 bg-white border-bottom box-shadow">
<h1 class="my-0 p-2 mr-md-auto"><img src="assets/zimon-hat.png" alt="Zimon hat" height="40" class="align-middle" /> ZIMON</h5>
<h1 class="my-0 p-2 mr-md-auto"><img src="resources/assets/zimon-hat.png" alt="Zimon hat" height="40" class="align-middle" /> ZIMON</h5>
<span class="p-2 text-danger h1" id="clock" style="font-family:Segment7Standard">UHRZEIT</a>
</div>

Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<title>Zimon</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/segment7" type="text/css">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="app/style.css">
</head>

<body>

<div class="d-flex flex-column flex-md-row align-items-center p-1 px-md-4 mb-3 bg-white border-bottom box-shadow">
<h1 class="my-0 p-2 mr-md-auto"><img src="assets/zimon-hat.png" alt="Zimon hat" height="40" class="align-middle" /> ZIMON</h5>
<h1 class="my-0 p-2 mr-md-auto"><img src="resources/assets/zimon-hat.png" alt="Zimon hat" height="40" class="align-middle" /> ZIMON</h5>
<span class="p-2 text-danger h1" id="clock" style="font-family:Segment7Standard">UHRZEIT</a>
</div>

Expand Down
93 changes: 54 additions & 39 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,58 @@
const {app, BrowserWindow, Menu} = require('electron')

function createWindow () {
// Create the browser window.
let win = new BrowserWindow({ fullscreen: true, titleBarStyle: 'hidden' })

// and load the index.html of the app.
win.loadFile('index.html')

// Open the DevTools.
//win.webContents.openDevTools()

//let test = new BrowserWindow({width: 800, height: 600, parent: win})
// 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
})
const { app,BrowserWindow,Menu } = require('electron')

// 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', () => {
// session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
// callback({responseHeaders: Object.assign({
// "Content-Security-Policy": ["default-src 'self'"]
// }, details.responseHeaders)});
// });
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()
}
})

app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (win === null) {
createWindow()
}
// 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(); loadModules();})
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()
}
})

//Electron update service
require('update-electron-app')()

function createWindow() {
// Create the browser window.
let win = new BrowserWindow({
fullscreen: true,
titleBarStyle: 'hidden'
})

app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (win === null) {
createWindow()
}
// and load the index.html of the app.
win.loadFile('index.html')

// Open the DevTools.
//win.webContents.openDevTools()

//let test = new BrowserWindow({width: 800, height: 600, parent: win})
// 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
})
}
2 changes: 1 addition & 1 deletion modules/quotes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$.get("components/quoteEdit.html", function(response) {
$.get("resources/components/quoteEdit.html", function(response) {
quoteEditTemplate = response;
});
//every 3 hours
Expand Down
8 changes: 4 additions & 4 deletions modules/zivis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ let zivis, counter = [];
let roundZivis = [];

var ziviTemplate, ziviEditTemplate, ziviEditButton;
$.get("components/ziviCards.html", function(response) {
$.get("resources/components/ziviCards.html", function(response) {
ziviTemplate = response;
});
$.get("components/ziviEdit.html", function(response) {
$.get("resources/components/ziviEdit.html", function(response) {
ziviEditTemplate = response;
});
$.get("components/ziviEditButton.html", function(response) {
$.get("resources/components/ziviEditButton.html", function(response) {
ziviEditButton = response;
});

var warTemplate;
$.get("components/warTemplate.html", function(response) {
$.get("resources/components/warTemplate.html", function(response) {
warTemplate = response;
});

Expand Down
97 changes: 85 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"bootstrap": "^4.1.3",
"jquery": "^3.3.1",
"mysql": "^2.16.0",
"popper.js": "^1.14.4"
"popper.js": "^1.14.4",
"update-electron-app": "^1.3.0"
}
}
3 changes: 3 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

npm start

0 comments on commit d5d5ce8

Please sign in to comment.