Commit b4f29ef1 authored by Mihkel Putrinš's avatar Mihkel Putrinš
Browse files

version number to auth window

parent 0f518d4c
bin bin
node_modules node_modules
old old
Panustaja*
...@@ -16,18 +16,26 @@ var home_path = process.env.HOME ? process.env.HOME : process.env.HOMEPATH ...@@ -16,18 +16,26 @@ var home_path = process.env.HOME ? process.env.HOME : process.env.HOMEPATH
USER_PATH = path.join(home_path, 'user.json') USER_PATH = path.join(home_path, 'user.json')
IS_DEV = process.env.DEV ? true : false IS_DEV = process.env.DEV ? true : false
var pjson_path = path.join(__dirname, '..', 'package.json')
var pjson = require(pjson_path)
if (IS_DEV) { if (IS_DEV) {
var pjson_path = path.join(__dirname, '..', 'package.json') pjson.build++
var pjson = require(pjson_path) console.log('----==== ' + pjson.name + ' v.' + pjson.version + ' (build ' + (pjson.build) + ') ====----')
console.log('----==== ' + pjson.name + ' v.' + pjson.version + ' (build ' + (++pjson.build) + ') ====----')
fs.writeFileSync(pjson_path, JSON.stringify(pjson, null, 4)) fs.writeFileSync(pjson_path, JSON.stringify(pjson, null, 4))
} }
app.on('ready', function() { app.on('ready', function() {
windows['authWindow'] = new BrowserWindow({ width: 300, height: 600, show: true }) windows['authWindow'] = new BrowserWindow({ width: 350, height: 600, show: true, "web-preferences": {partition: "persist:panustaja (build " + (pjson.build) + ")"} })
windows['authWindow'].setTitle('Panustaja - log in') var title = pjson.name + ' v.' + pjson.version + (pjson.version.indexOf('-') > -1 ? pjson.build : '') + ' | Logi sisse.'
windows['authWindow'].setTitle(title)
windows['authWindow'].loadUrl(auth_url) windows['authWindow'].loadUrl(auth_url)
windows['authWindow'].webContents.on('did-finish-load', function() { windows['authWindow'].webContents.on('did-finish-load', function() {
windows['authWindow'].setTitle(title)
console.log(windows['authWindow'].webContents.getUrl())
if (windows['authWindow'].webContents.getUrl() !== user_url
&& windows['authWindow'].webContents.getUrl() !== user_url + '#') {
return
}
// require('dialog').showMessageBox({type:'info', message:'enne salvestamist: ' + USER_PATH, buttons:['ok']}) // require('dialog').showMessageBox({type:'info', message:'enne salvestamist: ' + USER_PATH, buttons:['ok']})
windows['authWindow'].webContents.savePage(USER_PATH, 'HTMLOnly', function(err) { windows['authWindow'].webContents.savePage(USER_PATH, 'HTMLOnly', function(err) {
if (err) { if (err) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "Panustaja", "name": "Panustaja",
"description": "Ressursikataloogi upitamiseks keeleressurside Entu repositooriumisse.", "description": "Ressursikataloogi upitamiseks keeleressurside Entu repositooriumisse.",
"version": "1.0.1-d", "version": "1.0.1-d",
"build": 41, "build": 56,
"main": "./code/app.js", "main": "./code/app.js",
"license": "CC-SA", "license": "CC-SA",
"private": true, "private": true,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment