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
0fbae700
Commit
0fbae700
authored
Nov 23, 2015
by
Mihkel Putrinš
Browse files
refactor
parent
ac5b3a02
Changes
2
Hide whitespace changes
Inline
Side-by-side
code/app.js
View file @
0fbae700
...
...
@@ -23,12 +23,11 @@ if (IS_DEV) {
}
console
.
log
(
'
----====
'
+
pjson
.
name
+
'
v.
'
+
pjson
.
version
+
'
(build
'
+
(
pjson
.
build
)
+
'
) ====----
'
)
var
web_preferences
=
{
'
partition
'
:
'
persist:panustaja (build
'
+
(
pjson
.
build
)
+
'
)
'
,
'
page-visibility
'
:
true
,
// Prevent throttling DOM timers (app gets less priority while in background)
}
app
.
on
(
'
ready
'
,
function
()
{
// USER_PATH = path.join(app.getPath('temp'), 'user.json')
var
web_preferences
=
{
'
partition
'
:
'
persist:panustaja (build
'
+
(
pjson
.
build
)
+
'
)
'
,
}
windows
.
authWindow
=
new
BrowserWindow
({
width
:
900
,
height
:
600
,
show
:
true
,
'
web-preferences
'
:
web_preferences
})
// windows.authWindow.webContents.openDevTools(true)
var
title
=
pjson
.
name
+
'
v.
'
+
pjson
.
version
+
(
pjson
.
version
.
indexOf
(
'
-
'
)
>
-
1
?
pjson
.
build
:
''
)
+
'
| Logi sisse
'
...
...
@@ -49,10 +48,6 @@ app.on('ready', function() {
windows
.
authWindow
.
webContents
.
selectAll
()
windows
.
authWindow
.
webContents
.
copy
()
var
web_preferences
=
{
'
partition
'
:
'
persist:panustaja (build
'
+
(
pjson
.
build
)
+
'
)
'
,
'
page-visibility
'
:
true
,
// Prevent throttling DOM timers (app gets less priority while in background)
}
setTimeout
(
function
()
{
mainWindow
=
new
BrowserWindow
({
width
:
900
,
height
:
600
,
show
:
true
,
'
web-preferences
'
:
web_preferences
})
mainWindow
.
setTitle
(
'
Panustaja
'
)
...
...
code/bytesToSize.js
View file @
0fbae700
var
sizes
=
[
'
B
'
,
'
KB
'
,
'
MB
'
,
'
GB
'
,
'
TB
'
]
function
bytesToSize
(
bytes
)
{
if
(
bytes
===
undefined
)
{
bytes
=
0
}
var
sizes
=
[
'
B
'
,
'
KB
'
,
'
MB
'
,
'
GB
'
,
'
TB
'
]
if
(
bytes
===
0
)
{
return
'
0 B
'
}
if
(
bytes
===
undefined
or
bytes
===
0
)
{
return
'
0 B
'
}
try
{
var
i
=
parseInt
(
Math
.
floor
(
Math
.
log
(
bytes
)
/
Math
.
log
(
1024
)),
10
)
var
decimals
=
Math
.
max
(
0
,
i
-
1
)
...
...
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