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

Commit

Permalink
Add displaying version, bump to 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysdz committed Apr 9, 2018
1 parent 8a76690 commit 8856f9e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@
<h1>O aplikacji</h1>
<h2>Aplikacja Puzzle Edukacyjne</h2>

Wersja aplikacji: <span id="appVer"></span><br>
Wersja Node.js: <script>document.write(process.versions.node)</script><br>
Chromium: <script>document.write(process.versions.chrome)</script><br>
Electron: <script>document.write(process.versions.electron)</script><br>
Electron: <script>document.write(process.versions.electron)</script><br><br>

Ikony:<br>
Icons made by Google from www.flaticon.com is licensed by CC 3.0 BY
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "szkola-puzzle",
"version": "0.2.0",
"version": "0.3.0",
"description": "Puzzle dla p. Cwołek",
"author": {
"name": "krzysdz",
"url": "https://github.com/krzysdz"
"url": "https://github.com/krzysdz",
"email": "[email protected]"
},
"contributors": [
{
Expand All @@ -17,7 +18,8 @@
"start": "npm install && electron ./",
"test": "echo \"Error: no test specified\" && exit 1",
"pack": "build --dir",
"dist": "build -wl --x64 --ia32"
"dist": "build -wl --x64 --ia32",
"dist-mac": "build -m"
},
"build": {
"appId": "pl.dziembala-mazur.szkola-puzzle",
Expand Down
16 changes: 15 additions & 1 deletion renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ const remote = require("electron").remote;
const gameScr = require("./game");
const {dialog} = remote;
const {BrowserWindow} = remote;
const {app} = remote;

/**
* Add eventListeners to window state buttons (minimize, maximize, close)
* Run when app is loaded
*/
(function () {
/**
* Add eventListeners to window state buttons (minimize, maximize, close, fullscreen)
*/
function init() {
document.getElementById("min-btn").addEventListener("click", function () {
var window = BrowserWindow.getFocusedWindow();
Expand Down Expand Up @@ -46,6 +51,7 @@ const {BrowserWindow} = remote;
document.onreadystatechange = function () {
if (document.readyState == "complete") {
init();
showVersion();
}
};
})();
Expand Down Expand Up @@ -114,3 +120,11 @@ function changeTab(event){
for(let a = 0; a < document.getElementById("top-menu").childElementCount; a++){
document.getElementById("top-menu").children[a].addEventListener("click", changeTab);
}

/**
* Display app version in "about" tab in `#appVer` span
*/
function showVersion(){
var appVersion = app.getVersion();
document.getElementById("appVer").appendChild(document.createTextNode(appVersion));
}
3 changes: 3 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ body {
.legend-div{
margin-top: 10px;
}
#appVer {
font-weight: 700;
}
/* width */
::-webkit-scrollbar {
width: 4px;
Expand Down

0 comments on commit 8856f9e

Please sign in to comment.