Commit 5329469d authored by Mihkel Putrinš's avatar Mihkel Putrinš

eliminate potential bugs

parent f46361fd
...@@ -7,6 +7,7 @@ var clipboard = require('clipboard') ...@@ -7,6 +7,7 @@ var clipboard = require('clipboard')
var BrowserWindow = require('browser-window') var BrowserWindow = require('browser-window')
var windows = {} var windows = {}
var mainWindow
var user_url = 'https://entu.keeleressursid.ee/api2/user' var user_url = 'https://entu.keeleressursid.ee/api2/user'
var auth_url = user_url + '/auth' var auth_url = user_url + '/auth'
...@@ -23,7 +24,7 @@ if (IS_DEV) { ...@@ -23,7 +24,7 @@ if (IS_DEV) {
console.log('----==== ' + pjson.name + ' v.' + pjson.version + ' (build ' + (pjson.build) + ') ====----') console.log('----==== ' + pjson.name + ' v.' + pjson.version + ' (build ' + (pjson.build) + ') ====----')
app.on('ready', function() { app.on('ready', function() {
USER_PATH = path.join(app.getPath('temp'), 'user.json') // USER_PATH = path.join(app.getPath('temp'), 'user.json')
var web_preferences = { var web_preferences = {
"partition": "persist:panustaja (build " + (pjson.build) + ")", "partition": "persist:panustaja (build " + (pjson.build) + ")",
......
...@@ -3,7 +3,7 @@ function bytesToSize(bytes) { ...@@ -3,7 +3,7 @@ function bytesToSize(bytes) {
var sizes = ['B', 'KB', 'MB', 'GB', 'TB'] var sizes = ['B', 'KB', 'MB', 'GB', 'TB']
if (bytes === 0) return '0 B' if (bytes === 0) return '0 B'
try { try {
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))) var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10)
var decimals = Math.max(0, i-1) var decimals = Math.max(0, i-1)
return (bytes / Math.pow(1024, i)).toFixed(decimals) + ' ' + sizes[i] return (bytes / Math.pow(1024, i)).toFixed(decimals) + ' ' + sizes[i]
} catch (exception) { } catch (exception) {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
border-radius: 25px; border-radius: 25px;
height: 9px; height: 9px;
background-color: #E8E8C3; background-color: #E8E8C3;
border: 0px solid black; /*border: 0px solid black;*/
} }
#resourceProgressbarInner { #resourceProgressbarInner {
width: 0%; width: 0%;
......
...@@ -16,6 +16,8 @@ var uploaded_files_progress ...@@ -16,6 +16,8 @@ var uploaded_files_progress
ENTU_API_ENTITY = 'https://entu.keeleressursid.ee/api2/entity' ENTU_API_ENTITY = 'https://entu.keeleressursid.ee/api2/entity'
ENTU_API_FILE = 'https://entu.keeleressursid.ee/api2/file' ENTU_API_FILE = 'https://entu.keeleressursid.ee/api2/file'
var renderer_interval
function upload() { function upload() {
op.set(resource, ['name'], document.getElementById('resourceNameInput').value) op.set(resource, ['name'], document.getElementById('resourceNameInput').value)
......
var app = require('app')
var op = require('object-path')
var path = require('path')
var fs = require('fs')
var ipc = require('ipc')
var j = require('electron-jade')({pretty: true}, {})
var BrowserWindow = require('browser-window')
var user_url = 'https://entu.keeleressursid.ee/api2/user'
var auth_url = user_url + '/auth'
console.log(auth_url)
app.on('ready', function() {
var home_path = app.getPath('home')
//
mainWindow = new BrowserWindow({ width: 900, height: 600, show: true })
// var title = pjson.name + ' v.' + pjson.version + (pjson.version.indexOf('-') > -1 ? pjson.build : '') + ' | Logi sisse'
var view_path = path.join(__dirname, 'code', 'views', 'test.jade')
mainWindow.webContents.loadUrl('file://' + view_path)
//
// mainWindow.center()
// mainWindow.setTitle(title)
// mainWindow.loadUrl(auth_url)
// mainWindow.webContents.on('did-get-response-details', function(e, s, new_url) {
})
//
// app.on('window-all-closed', function() {
// app.quit()
// })
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