Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mihkel Putrinš
panustaja
Commits
b4f29ef1
Commit
b4f29ef1
authored
Nov 05, 2015
by
Mihkel Putrinš
Browse files
version number to auth window
parent
0f518d4c
Changes
3
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
b4f29ef1
bin
node_modules
old
Panustaja*
code/app.js
View file @
b4f29ef1
...
...
@@ -16,18 +16,26 @@ var home_path = process.env.HOME ? process.env.HOME : process.env.HOMEPATH
USER_PATH
=
path
.
join
(
home_path
,
'
user.json
'
)
IS_DEV
=
process
.
env
.
DEV
?
true
:
false
var
pjson_path
=
path
.
join
(
__dirname
,
'
..
'
,
'
package.json
'
)
var
pjson
=
require
(
pjson_path
)
if
(
IS_DEV
)
{
var
pjson_path
=
path
.
join
(
__dirname
,
'
..
'
,
'
package.json
'
)
var
pjson
=
require
(
pjson_path
)
console
.
log
(
'
----====
'
+
pjson
.
name
+
'
v.
'
+
pjson
.
version
+
'
(build
'
+
(
++
pjson
.
build
)
+
'
) ====----
'
)
pjson
.
build
++
console
.
log
(
'
----====
'
+
pjson
.
name
+
'
v.
'
+
pjson
.
version
+
'
(build
'
+
(
pjson
.
build
)
+
'
) ====----
'
)
fs
.
writeFileSync
(
pjson_path
,
JSON
.
stringify
(
pjson
,
null
,
4
))
}
app
.
on
(
'
ready
'
,
function
()
{
windows
[
'
authWindow
'
]
=
new
BrowserWindow
({
width
:
300
,
height
:
600
,
show
:
true
})
windows
[
'
authWindow
'
].
setTitle
(
'
Panustaja - log in
'
)
windows
[
'
authWindow
'
]
=
new
BrowserWindow
({
width
:
350
,
height
:
600
,
show
:
true
,
"
web-preferences
"
:
{
partition
:
"
persist:panustaja (build
"
+
(
pjson
.
build
)
+
"
)
"
}
})
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
'
].
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']})
windows
[
'
authWindow
'
].
webContents
.
savePage
(
USER_PATH
,
'
HTMLOnly
'
,
function
(
err
)
{
if
(
err
)
{
...
...
package.json
View file @
b4f29ef1
...
...
@@ -2,7 +2,7 @@
"name"
:
"Panustaja"
,
"description"
:
"Ressursikataloogi upitamiseks keeleressurside Entu repositooriumisse."
,
"version"
:
"1.0.1-d"
,
"build"
:
41
,
"build"
:
56
,
"main"
:
"./code/app.js"
,
"license"
:
"CC-SA"
,
"private"
:
true
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment