Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
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
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
b4f29ef1
bin
bin
node_modules
node_modules
old
old
Panustaja*
code/app.js
View file @
b4f29ef1
...
@@ -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
)
{
...
...
package.json
View file @
b4f29ef1
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
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