Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
panustaja
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Mihkel Putrinš
panustaja
Commits
1f3cf0f6
Commit
1f3cf0f6
authored
Nov 08, 2015
by
Mihkel Putrinš
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup and nicer progressbar
parent
04404871
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
20 deletions
+19
-20
code/app.js
code/app.js
+4
-4
code/main.js
code/main.js
+6
-7
code/style/style.css
code/style/style.css
+5
-5
code/views/main.jade
code/views/main.jade
+3
-3
package.json
package.json
+1
-1
No files found.
code/app.js
View file @
1f3cf0f6
...
...
@@ -23,9 +23,9 @@ if (IS_DEV) {
}
app
.
on
(
'
ready
'
,
function
()
{
var
home_path
=
app
.
getPath
(
'
home
'
)
USER_PATH
=
path
.
join
(
home_path
,
'
user.json
'
)
USER_PATH
=
path
.
join
(
app
.
getPath
(
'
temp
'
),
'
user.json
'
)
// windows['authWindow'] = new BrowserWindow({ width: 900, height: 600, show: true, "web-preferences": {partition: ''} })
windows
[
'
authWindow
'
]
=
new
BrowserWindow
({
width
:
900
,
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
'
].
center
()
...
...
@@ -49,14 +49,14 @@ app.on('ready', function() {
// + '\n"' + user_url + '"'
// , buttons:['ok']
// })
//
require('dialog').showMessageBox({type:'info', message:'HOME: ' + home_path, buttons:['ok']})
//
console.log(windows['authWindow'].webContents.session.cookies);
windows
[
'
authWindow
'
].
webContents
.
savePage
(
USER_PATH
,
'
HTMLOnly
'
,
function
(
err
)
{
if
(
err
)
{
require
(
'
dialog
'
).
showMessageBox
({
type
:
'
info
'
,
message
:
'
peale salvestamist: katki
'
+
err
,
buttons
:[
'
ok
'
]})
console
.
log
(
"
Error:
"
,
err
)
process
.
exit
()
}
else
{
var
view_path
=
path
.
join
(
__dirname
,
'
views
'
,
'
main.jade
'
)
var
view_path
=
path
.
join
(
app
.
getAppPath
(),
'
code
'
,
'
views
'
,
'
main.jade
'
)
// require('dialog').showMessageBox({type:'info', message:'peale salvestamist: korras\n'
// + 'Laen lehte: file://' + view_path, buttons:['ok']})
mainWindow
.
webContents
.
loadUrl
(
'
file://
'
+
view_path
)
...
...
code/main.js
View file @
1f3cf0f6
...
...
@@ -17,9 +17,6 @@ var pjson = require(path.join(__dirname, '..', '..', 'package.json'))
UPLOADER_VERSION
=
pjson
.
name
+
'
v.
'
+
pjson
.
version
+
(
pjson
.
version
.
indexOf
(
'
-
'
)
>
-
1
?
pjson
.
build
:
''
)
var
ipc
=
require
(
'
ipc
'
)
// ipc.send('userdata-query')
// ipc.on('userdata-reply', function(user_data) {
// })
var
b2s
=
require
(
path
.
join
(
__dirname
,
'
..
'
,
'
bytesToSize.js
'
))
...
...
@@ -31,11 +28,11 @@ var dom_resource_stats = document.getElementById('resourceStats')
var
renderer_interval
setTimeout
(
function
()
{
var
home_path
=
app
.
getPath
(
'
home
'
)
USER_PATH
=
path
.
join
(
home_path
,
'
user.json
'
)
// dialog.showMessageBox({type:'info', message:'loeme faili: ' + USER_PATH, buttons:['ok']})
USER_PATH
=
path
.
join
(
app
.
getPath
(
'
temp
'
),
'
user.json
'
)
fs
.
readFile
(
USER_PATH
,
'
utf8
'
,
function
(
err
,
data_json
)
{
if
(
err
)
throw
(
err
)
// dialog.showMessageBox({type:'info', message:'fail avatud: ' + USER_PATH, buttons:['ok']})
// dialog.showMessageBox({type:'info', message:data_json, buttons:['ok']})
var
data
=
JSON
.
parse
(
data_json
)
if
(
op
.
get
(
data
,
'
result.user_id
'
,
false
))
{
user_data
[
'
user_id
'
]
=
op
.
get
(
data
,
'
result.user_id
'
)
...
...
@@ -44,6 +41,7 @@ setTimeout(function () {
document
.
getElementById
(
'
userName
'
).
innerHTML
=
user_data
.
name
var
title
=
UPLOADER_VERSION
+
'
|
'
+
user_data
[
'
name
'
]
ipc
.
send
(
'
setTitle
'
,
title
)
setFormState
(
'
select
'
)
}
else
{
ipc
.
send
(
'
log
'
,
'
User data incomplete.
'
)
ipc
.
send
(
'
data
'
,
data
)
...
...
@@ -177,6 +175,8 @@ var setFormState = function setFormState(state) {
document
.
getElementById
(
'
uploading
'
).
setAttribute
(
'
hidden
'
,
''
)
document
.
getElementById
(
'
uploadResource
'
).
setAttribute
(
'
hidden
'
,
''
)
document
.
getElementById
(
'
resourceName
'
).
setAttribute
(
'
hidden
'
,
''
)
// ---
// document.getElementById('uploading').removeAttribute('hidden')
break
case
'
loading
'
:
document
.
getElementById
(
'
loading
'
).
removeAttribute
(
'
hidden
'
)
...
...
@@ -219,4 +219,3 @@ var setFormState = function setFormState(state) {
break
}
}
setFormState
(
'
select
'
)
code/style/style.css
View file @
1f3cf0f6
#resourceProgressbarOuter
{
width
:
100%
;
border-radius
:
25px
;
height
:
6
px
;
background-color
:
#
cdf
;
height
:
9
px
;
background-color
:
#
E8E8C3
;
border
:
0px
solid
black
;
}
#resourceProgressbarInner
{
width
:
0%
;
border-radius
:
25px
;
height
:
100%
;
background-color
:
#
79b
;
background-color
:
#
92CC6F
;
/*border: 0px solid green;*/
}
#fileProgressbarOuter
{
width
:
100%
;
border-radius
:
25px
;
height
:
6
px
;
height
:
9
px
;
background-color
:
#cdf
;
border
:
0px
solid
black
;
}
...
...
@@ -23,6 +23,6 @@
width
:
0%
;
border-radius
:
25px
;
height
:
100%
;
background-color
:
#
79b
;
background-color
:
#
0065CA
;
/*border: 0px solid green;*/
}
code/views/main.jade
View file @
1f3cf0f6
...
...
@@ -9,7 +9,7 @@ html
body
h1#userName() Tere
div#selectLocal
div#selectLocal
(hidden)
p#selectLocalMessage Palun vali fail(id) ja/või kataloog(id), mida soovid üles laadida.
button#selectLocalButton(onclick='selectLocal()') Vali
div#resourceName(hidden='')
...
...
@@ -32,12 +32,12 @@ html
span#uploadTotalResources 0
div#resourceProgressbarOuter
div#resourceProgressbarInner
div#fileProgressbarInner
span= 'Failid: '
span#uploadedSize 0
span /
span#uploadTotalSize 0
div#fileProgressbarOuter
div#fileProgressbarInner
//- div#fileProgressbarOuter
pre#status
div#thankYou(hidden='') Aitäh!
...
...
package.json
View file @
1f3cf0f6
...
...
@@ -2,7 +2,7 @@
"name"
:
"Panustaja"
,
"description"
:
"Ressursikataloogi upitamiseks keeleressurside Entu repositooriumisse."
,
"version"
:
"1.0.1-d"
,
"build"
:
64
,
"build"
:
88
,
"main"
:
"./code/app.js"
,
"license"
:
"CC-SA"
,
"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