Move static dir and fix eslint issues

This commit is contained in:
Jan Tuomi
2017-09-24 16:21:45 +03:00
parent dd69a0c395
commit 010fab5be1
38 changed files with 20 additions and 26 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
members/static/js/lib
infoscreen/static/js/lib
webapp/static/js/lib
global_static/js/lib
static/js/lib
collected_static
+2 -1
View File
@@ -1,6 +1,7 @@
{
"env": {
"browser": true
"browser": true,
"jquery": true
},
"globals": {
"angular": 1,
+1 -1
View File
@@ -9,9 +9,9 @@ infoscreen/static/js/hsl.json
members/logs/*
.idea/
logs/
/static/
/media/
node_modules/
/.coverage
db.sqlite3
requirements_henu.txt
/collected_static/
+13 -21
View File
@@ -12,22 +12,13 @@ $(document).ready(function(){
$(window).resize(resize);
var defaultBackoffTime = 1000;
var modified = 0;
function fetchdata(data, status){
var backoffTime = defaultBackoffTime;
modified = 1;
if (typeof status !== 'undefined'){
if (status == "success"){
backoffTime = defaultBackoffTime;
parseData(data);
}
else if (status == "error"){
backoffTime *= 2;
modified = 0
handleError();
return;
}
}
}
@@ -38,20 +29,21 @@ setInterval(function() {
}, 2000);
function formatBrewTime(){
if(!brewtext && lastBrew instanceof Date){
if (!brewtext && lastBrew instanceof Date){
var now = new Date();
var timeDiff = Math.max(now.getTime()-lastBrew.getTime(),0);
if(timeDiff < 3600000)
tmp = Math.round(timeDiff/60000) + ' min';
else
tmp = '~' + Math.round(timeDiff/3600000*2)/2 + ' h';
var timeDiff = Math.max(now.getTime() - lastBrew.getTime(), 0);
var tmp = (timeDiff < 3600000)
? Math.round(timeDiff / 60000) + ' min'
: '~' + Math.round(timeDiff / 3600000 * 2) / 2 + ' h';
$("#brewtime").html(tmp);
}else
} else {
$("#brewtime").html(brewtext);
}
}
function handleError(){
setData("?",0,0,Number.MAX_VALUE,Number.MAX_VALUE);
function handleError() {
setData("?", 0, 0, Number.MAX_VALUE, Number.MAX_VALUE);
}
function parseData(data) {
@@ -62,7 +54,7 @@ function parseData(data) {
var cups = data.cups;
var brewing = data.brewing;
var timeDiff = Math.max(now.getTime() - lastBrew.getTime(),0);
var opa = Math.max(100-timeDiff/90000,0);
var opa = Math.max(100 - timeDiff / 90000,0);
setData(cups, data.temp, opa,now.getTime()-date.getTime(), timeDiff, brewing);
}
else{
@@ -71,9 +63,9 @@ function parseData(data) {
}
function setData(cups, temp, opa, timeFromUpdate, timeFromBrew, brewing){
var now = new Date();
if(cups == 0)
if (cups == 0) {
opa = 0;
}
brewtext = "";
$("#upper").css({opacity: opa/100});
$("#scale2").css({width: Math.min(cups/9*100,100) + '%'});
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

+2 -2
View File
@@ -237,9 +237,9 @@ STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
)
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_ROOT = os.path.join(BASE_DIR, 'collected_static')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'global_static'),
os.path.join(BASE_DIR, 'static'),
)
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 267 B