From 2e342a14e4e03385e2def0c0c0bbd9bc9367fc9e Mon Sep 17 00:00:00 2001 From: ivan770 Date: Sun, 3 Jun 2018 14:36:37 +0300 Subject: [PATCH] About page --- about.html | 24 ++++++++++++++++++++++++ css/about.css | 6 ++++++ js/base.js | 2 ++ main.js | 29 +++++++++++++++++++++-------- 4 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 about.html create mode 100644 css/about.css diff --git a/about.html b/about.html new file mode 100644 index 0000000..e30317d --- /dev/null +++ b/about.html @@ -0,0 +1,24 @@ + + + + + + + + + +
+ +

PineSQL

+
Created by ivan770
+
Version: 1.5.1
+
+ + + + diff --git a/css/about.css b/css/about.css new file mode 100644 index 0000000..717c6d7 --- /dev/null +++ b/css/about.css @@ -0,0 +1,6 @@ +.center { + position: absolute; + top: 50%; + left: 50%; + transform: translateX(-50%) translateY(-50%); +} diff --git a/js/base.js b/js/base.js index 09c728b..6b286ec 100644 --- a/js/base.js +++ b/js/base.js @@ -15,6 +15,8 @@ function updateCheck(){ if (compareVersions(`${pjson.version}`, `${JSON.parse(body).tag_name}`) == -1){ appendLog(`New version available: ${JSON.parse(body).tag_name}`, "UPDATE") } + } else { + appendLog("Connection error", "UPDATE") } }); } diff --git a/main.js b/main.js index 142efcc..cbc628e 100644 --- a/main.js +++ b/main.js @@ -40,15 +40,24 @@ app.on('ready', () => { icon: path.join(__dirname, 'img/icon.png') }) + aboutWin = new BrowserWindow({ + width: 800, + height: 600, + show: false, + icon: path.join(__dirname, 'img/icon.png') + }) + assistantWin.loadURL(`file://${__dirname}/construct.html`) splash.loadURL(`file://${__dirname}/splash.html`) mainWindow.loadURL(`file://${__dirname}/index.html`) settingsWin.loadURL(`file://${__dirname}/settings.html`) + aboutWin.loadURL(`file://${__dirname}/about.html`) mainWindow.on('closed', function() { mainWindow = null assistantWin.destroy() settingsWin.destroy() + aboutWin.destroy() }) assistantWin.on('close', function(event) { @@ -61,6 +70,11 @@ app.on('ready', () => { event.preventDefault() }) + aboutWin.on('close', function(event) { + aboutWin.hide() + event.preventDefault() + }) + mainWindow.once('ready-to-show', () => { splash.destroy() mainWindow.show() @@ -82,7 +96,13 @@ app.on('ready', () => { click() { settingsWin.show() } - } + }, + { + label: 'About', + click() { + aboutWin.show() + } + } ] }, { @@ -98,13 +118,6 @@ app.on('ready', () => { click() { require('electron').shell.openExternal('https://raw.githubusercontent.com/ivan770/pinesql/master/LICENSE') } - }, - { - type: 'separator' - }, - { - label: 'Created by ivan770', - enabled: false } ] }