# HG changeset patch # User Michiel Broek # Date 1571486078 -7200 # Node ID 9dfefad3ae1db92e1deb4be8b82fedc63f5cec1a # Parent 2991acd35cdbdb74ebc682f5ca7fd6208bc6b539 Code cleanup and manual compress diff -r 2991acd35cdb -r 9dfefad3ae1d www/js/log_brew.js --- a/www/js/log_brew.js Sat Oct 19 12:17:29 2019 +0200 +++ b/www/js/log_brew.js Sat Oct 19 13:54:38 2019 +0200 @@ -21,121 +21,116 @@ *****************************************************************************/ -$(document).ready(function () { - - $('#jqxMenu').jqxMenu('destroy'); +$(document).ready(function() { - $("#jqxLoader").jqxLoader({ - width: 250, - height: 150, - isModal: true, - text: "Opmaken grafiek ...", - theme: theme - }); - $('#jqxLoader').jqxLoader('open'); + $('#jqxMenu').jqxMenu('destroy'); + $('#jqxLoader').jqxLoader({ + width: 250, + height: 150, + isModal: true, + text: 'Opmaken grafiek ...', + theme: theme + }); + $('#jqxLoader').jqxLoader('open'); - function getExportServer() { - return "https://www.jqwidgets.com/export_server/export.php"; - } + function getExportServer() { + return 'https://www.jqwidgets.com/export_server/export.php'; + } - var sourceA = { - datatype: "json", - datafields: [ - { name: "date", type: "date", format: "yyyy-MM-dd HH:mm" }, - { name: "version", type: "int" }, - { name: "code", type: "string" }, - { name: "name", type: "string" }, - { name: "pv_mlt", type: "float" }, - { name: "pv_hlt", type: "float" }, - { name: "pv_room", type: "float" }, - { name: "sp_mlt", type: "float" }, - { name: "sp_hlt", type: "float" }, - { name: "pwm_mlt", type: "int" }, - { name: "pwm_hlt", type: "int" }, - { name: "event", type: "string" } - ], - url: 'getbrewlog.php?code=' + my_code - }, - dataAdapter = new $.jqx.dataAdapter(sourceA, { - autoBind: true, - async: false, - loadComplete: function () { - $('#jqxLoader').jqxLoader('close'); - }, - loadError: function (jqXHR, status, error) { - } - }), - settings = { - title: my_code + ' "' + my_name + '"', - description: "", - source: dataAdapter, - xAxis: { - dataField: 'date', - type: 'date', - formatFunction: function (value) { - return value.getHours() + ':' + value.getMinutes(); - }, - toolTipFormatFunction: function (value) { - var h = value.getHours(), - m = value.getMinutes(); - return value.getDate() + '-' + (value.getMonth() + 1) + '-' + value.getFullYear() - + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m); - }, - textRotationAngle: 300, - }, - colorScheme: 'scheme01', - seriesGroups: [ - { - type: 'spline', - valueAxis: { - minValue: 0, - description: 'Graden C' - }, - series: [ - { dataField: "pv_mlt", lineWidth: 2, displayText: "MLT" }, - { dataField: "sp_mlt", lineWidth: 1, displayText: "mlt", opacity: 0.7 }, - { dataField: "pv_hlt", lineWidth: 1, displayText: "HLT" }, - { dataField: "sp_hlt", lineWidth: 1, displayText: "hlt", opacity: 0.7 }, - { dataField: "pv_room", lineWidth: 1, displayText: "Room", opacity: 0.5 } - ] - } - ] - }; - $("#brew_chart").jqxChart(settings); + var sourceA = { + datatype: 'json', + datafields: [ + { name: 'date', type: 'date', format: 'yyyy-MM-dd HH:mm' }, + { name: 'version', type: 'int' }, + { name: 'code', type: 'string' }, + { name: 'name', type: 'string' }, + { name: 'pv_mlt', type: 'float' }, + { name: 'pv_hlt', type: 'float' }, + { name: 'pv_room', type: 'float' }, + { name: 'sp_mlt', type: 'float' }, + { name: 'sp_hlt', type: 'float' }, + { name: 'pwm_mlt', type: 'int' }, + { name: 'pwm_hlt', type: 'int' }, + { name: 'event', type: 'string' } + ], + url: 'getbrewlog.php?code=' + my_code + }, + dataAdapter = new $.jqx.dataAdapter(sourceA, { + autoBind: true, + async: false, + loadComplete: function() { + $('#jqxLoader').jqxLoader('close'); + }, + loadError: function(jqXHR, status, error) { + } + }), + settings = { + title: my_code + ' "' + my_name + '"', + description: '', + source: dataAdapter, + xAxis: { + dataField: 'date', + type: 'date', + formatFunction: function(value) { + return value.getHours() + ':' + value.getMinutes(); + }, + toolTipFormatFunction: function(value) { + var h = value.getHours(), m = value.getMinutes(); + return value.getDate() + '-' + (value.getMonth() + 1) + '-' + value.getFullYear() + + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m); + }, + textRotationAngle: 300, + }, + colorScheme: 'scheme01', + seriesGroups: [{ + type: 'spline', + valueAxis: { + minValue: 0, + description: 'Graden C' + }, + series: [ + { dataField: 'pv_mlt', lineWidth: 2, displayText: 'MLT' }, + { dataField: 'sp_mlt', lineWidth: 1, displayText: 'mlt', opacity: 0.7 }, + { dataField: 'pv_hlt', lineWidth: 1, displayText: 'HLT' }, + { dataField: 'sp_hlt', lineWidth: 1, displayText: 'hlt', opacity: 0.7 }, + { dataField: 'pv_room', lineWidth: 1, displayText: 'Ruimte', opacity: 0.5 } + ] + }] + }; + $('#brew_chart').jqxChart(settings); - $("#print").click(function () { - var content = $("#brew_chart")[0].outerHTML, - newWindow = window.open("", "", "width=865, height=425"), - document = newWindow.document.open(), - pageContent = - '' + - '' + - '' + - '' + - '' + - '' + my_code + ' ' + my_name + ' brouwdag' + - '' + - '' + content + ''; - document.write(pageContent); - document.close(); - newWindow.print(); - }); - $("#print").jqxButton({ template: "primary", width: 125, theme: theme }); + $('#print').click(function() { + var content = $('#brew_chart')[0].outerHTML, + newWindow = window.open('', '', 'width=865, height=425'), + document = newWindow.document.open(), + pageContent = + '' + + '' + + '' + + '' + + '' + + '' + my_code + ' ' + my_name + ' brouwdag' + + '' + + '' + content + ''; + document.write(pageContent); + document.close(); + newWindow.print(); + }); + $('#print').jqxButton({ template: 'primary', width: 125, theme: theme }); - - $("#pdfButton").click(function () { - $("#brew_chart").jqxChart("saveAsPDF", "brouw_"+my_code+".pdf", getExportServer()); - }); - $("#pdfButton").jqxButton({ template: "primary", width: 125, theme: theme }); + $('#pdfButton').click(function() { + $('#brew_chart').jqxChart('saveAsPDF', 'brouw_' + my_code + '.pdf', getExportServer()); + }); + $('#pdfButton').jqxButton({ template: 'primary', width: 125, theme: theme }); - $("#pngButton").click(function () { - $("#brew_chart").jqxChart("saveAsPNG", "brouw_"+my_code+".png", getExportServer()); - }); - $("#pngButton").jqxButton({ template: "primary", width: 125, theme: theme }); + $('#pngButton').click(function() { + $('#brew_chart').jqxChart('saveAsPNG', 'brouw_' + my_code + '.png', getExportServer()); + }); + $('#pngButton').jqxButton({ template: 'primary', width: 125, theme: theme }); - $("#Close").jqxButton({ template: "success", width: 125, theme: theme }); - $("#Close").click(function () { - window.close(); - }); + $('#Close').jqxButton({ template: 'success', width: 125, theme: theme }); + $('#Close').click(function() { + window.close(); + }); }); diff -r 2991acd35cdb -r 9dfefad3ae1d www/js/log_co2pressure.js --- a/www/js/log_co2pressure.js Sat Oct 19 12:17:29 2019 +0200 +++ b/www/js/log_co2pressure.js Sat Oct 19 13:54:38 2019 +0200 @@ -21,121 +21,107 @@ *****************************************************************************/ -$(document).ready(function () { - - $('#jqxMenu').jqxMenu('destroy'); +$(document).ready(function() { - $("#jqxLoader").jqxLoader({ - width: 250, - height: 150, - isModal: true, - text: "Opmaken grafiek ...", - theme: theme - }); - $('#jqxLoader').jqxLoader('open'); + $('#jqxMenu').jqxMenu('destroy'); + $('#jqxLoader').jqxLoader({ + width: 250, + height: 150, + isModal: true, + text: 'Opmaken grafiek ...', + theme: theme + }); + $('#jqxLoader').jqxLoader('open'); - function getExportServer() { - return "https://www.jqwidgets.com/export_server/export.php"; - } + function getExportServer() { + return 'https://www.jqwidgets.com/export_server/export.php'; + } - var sourceA = { - datatype: "json", - datafields: [ - { name: "date", type: "date", format: "yyyy-MM-dd HH:mm" }, - { name: "temperature", type: "float" }, - { name: "pressure", type: "float" }, - { name: "uuid", type: "string" } - ], - url: 'getco2pressurelog.php?code=' + my_code + '&name=' + my_name - }, - dataAdapter = new $.jqx.dataAdapter(sourceA, { - autoBind: true, - async: false, - loadComplete: function () { - $('#jqxLoader').jqxLoader('close'); - }, - loadError: function (jqXHR, status, error) { - } - }), - settings = { - title: my_code + ' "' + my_name + '"', - description: "", - source: dataAdapter, - xAxis: { - dataField: 'date', - type: 'date', - formatFunction: function (value) { - return value.getDate() + '-' + (value.getMonth() + 1) + '-' + value.getFullYear(); - }, - toolTipFormatFunction: function (value) { - var h = value.getHours(), - m = value.getMinutes(); - return value.getDate() + '-' + (value.getMonth() + 1) + '-' + value.getFullYear() - + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m); - }, - textRotationAngle: 45, - howGridLines: false - }, - colorScheme: 'scheme01', - seriesGroups: [ - { - type: "area", - valueAxis: { - minValue: 0, - displayValueAxis: false, - description: "Druk in bar" - }, - series: [ - { dataField: "pressure", lineWidth: 1, displayText: "Druk", opacity: 0.4 } - ] - }, - { - type: 'spline', - valueAxis: { - minValue: 0, - description: 'Graden C' - }, - series: [ - { dataField: "temperature", lineWidth: 1, displayText: "Temperatuur" } - ] - } - ] - }; - $("#pressure_chart").jqxChart(settings); + var sourceA = { + datatype: 'json', + datafields: [ + { name: 'date', type: 'date', format: 'yyyy-MM-dd HH:mm' }, + { name: 'temperature', type: 'float' }, + { name: 'pressure', type: 'float' }, + { name: 'uuid', type: 'string' } + ], + url: 'getco2pressurelog.php?code=' + my_code + '&name=' + my_name + }, + dataAdapter = new $.jqx.dataAdapter(sourceA, { + autoBind: true, + async: false, + loadComplete: function() { + $('#jqxLoader').jqxLoader('close'); + }, + loadError: function(jqXHR, status, error) { + } + }), + settings = { + title: my_code + ' "' + my_name + '"', + description: '', + source: dataAdapter, + xAxis: { + dataField: 'date', + type: 'date', + formatFunction: function(value) { + return value.getDate() + '-' + (value.getMonth() + 1) + '-' + value.getFullYear(); + }, + toolTipFormatFunction: function(value) { + var h = value.getHours(), m = value.getMinutes(); + return value.getDate() + '-' + (value.getMonth() + 1) + '-' + value.getFullYear() + + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m); + }, + textRotationAngle: 45, + howGridLines: false + }, + colorScheme: 'scheme01', + seriesGroups: [ + { + type: 'area', + valueAxis: { minValue: 0, displayValueAxis: false, description: 'Druk in bar' }, + series: [{ dataField: 'pressure', lineWidth: 1, displayText: 'Druk', opacity: 0.4 }] + }, + { + type: 'spline', + valueAxis: { minValue: 0, description: 'Graden C' }, + series: [{ dataField: 'temperature', lineWidth: 1, displayText: 'Temperatuur' }] + } + ] + }; + $('#pressure_chart').jqxChart(settings); - $("#print").click(function () { - var content = $("#pressure_chart")[0].outerHTML, - newWindow = window.open("", "", "width=865, height=425"), - document = newWindow.document.open(), - pageContent = - '' + - '' + - '' + - '' + - '' + - '' + my_code + ' ' + my_name + ' hergisting' + - '' + - '' + content + ''; - document.write(pageContent); - document.close(); - newWindow.print(); - }); - $("#print").jqxButton({ template: "primary", width: 125, theme: theme }); + $('#print').click(function() { + var content = $('#pressure_chart')[0].outerHTML, + newWindow = window.open('', '', 'width=865, height=425'), + document = newWindow.document.open(), + pageContent = + '' + + '' + + '' + + '' + + '' + + '' + my_code + ' ' + my_name + ' hergisting' + + '' + + '' + content + ''; + document.write(pageContent); + document.close(); + newWindow.print(); + }); + $('#print').jqxButton({ template: 'primary', width: 125, theme: theme }); - - $("#pdfButton").click(function () { - $("#pressure_chart").jqxChart("saveAsPDF", "hergisting_"+my_code+".pdf", getExportServer()); - }); - $("#pdfButton").jqxButton({ template: "primary", width: 125, theme: theme }); + $('#pdfButton').click(function() { + $('#pressure_chart').jqxChart('saveAsPDF', 'hergisting_' + my_code + '.pdf', getExportServer()); + }); + $('#pdfButton').jqxButton({ template: 'primary', width: 125, theme: theme }); - $("#pngButton").click(function () { - $("#pressure_chart").jqxChart("saveAsPNG", "hergisting_"+my_code+".png", getExportServer()); - }); - $("#pngButton").jqxButton({ template: "primary", width: 125, theme: theme }); + $('#pngButton').click(function() { + $('#pressure_chart').jqxChart('saveAsPNG', 'hergisting_' + my_code + '.png', getExportServer()); + }); + $('#pngButton').jqxButton({ template: 'primary', width: 125, theme: theme }); - $("#Close").jqxButton({ template: "success", width: 125, theme: theme }); - $("#Close").click(function () { - window.close(); - }); + $('#Close').jqxButton({ template: 'success', width: 125, theme: theme }); + $('#Close').click(function() { + window.close(); + }); }); diff -r 2991acd35cdb -r 9dfefad3ae1d www/js/log_fermentation.js --- a/www/js/log_fermentation.js Sat Oct 19 12:17:29 2019 +0200 +++ b/www/js/log_fermentation.js Sat Oct 19 13:54:38 2019 +0200 @@ -21,140 +21,138 @@ *****************************************************************************/ -$(document).ready(function () { +$(document).ready(function() { - $('#jqxMenu').jqxMenu('destroy'); + $('#jqxMenu').jqxMenu('destroy'); - $("#jqxLoader").jqxLoader({ - width: 250, - height: 150, - isModal: true, - text: "Opmaken grafiek ...", - theme: theme - }); - $('#jqxLoader').jqxLoader('open'); + $('#jqxLoader').jqxLoader({ + width: 250, + height: 150, + isModal: true, + text: 'Opmaken grafiek ...', + theme: theme + }); + $('#jqxLoader').jqxLoader('open'); - function getExportServer() { - return "https://www.jqwidgets.com/export_server/export.php"; - } + function getExportServer() { + return 'https://www.jqwidgets.com/export_server/export.php'; + } - var sourceA = { - datatype: "json", - datafields: [ - { name: "date", type: "date", format: "yyyy-MM-dd HH:mm" }, - { name: "air", type: "float" }, - { name: "beer", type: "float" }, - { name: "chiller", type: "float" }, - { name: "room", type: "float" }, - { name: "tlo", type: "float" }, - { name: "thi", type: "float" }, - { name: "heater", type: "int" }, - { name: "cooler", type: "int" }, - { name: "event", type: "string" } - ], - url: 'getfermentlog.php?code=' + my_code + '&name=' + my_name - }, - dataAdapter = new $.jqx.dataAdapter(sourceA, { - autoBind: true, - async: false, - loadComplete: function () { - $('#jqxLoader').jqxLoader('close'); - }, - loadError: function (jqXHR, status, error) { - } - }), - settings = { - title: my_code + ' "' + my_name + '"', - description: "", - source: dataAdapter, - xAxis: { - dataField: 'date', - type: 'date', - formatFunction: function (value) { - return value.getDate() + '-' + (value.getMonth() + 1) + '-' + value.getFullYear(); - }, - toolTipFormatFunction: function (value) { - var h = value.getHours(), - m = value.getMinutes(); - return value.getDate() + '-' + (value.getMonth() + 1) + '-' + value.getFullYear() - + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m); - }, - textRotationAngle: 45, - howGridLines: false, - rangeSelector: { - size: 90, - dataField: 'beer', - serieType: 'line', - gridLines: {visible: false}, - } - }, - colorScheme: 'scheme01', - seriesGroups: [ - { - type: "area", - valueAxis: { - minValue: 0, - maxValue: 100, - displayValueAxis: false, - description: "Heat/Cool %" - }, - series: [ - { dataField: "cooler", lineWidth: 1, displayText: "Cool %", opacity: 0.4 }, - { dataField: "heater", lineWidth: 1, displayText: "Heat %", opacity: 0.3 } - ] - }, - { - type: 'spline', - valueAxis: { - minValue: 0, - description: 'Graden C' - }, - series: [ - { dataField: "air", lineWidth: 1, displayText: "Air" }, - { dataField: "beer", lineWidth: 2, displayText: "Beer" }, - { dataField: "tlo", lineWidth: 1, displayText: "Target Lo", opacity: 0.7 }, - { dataField: "thi", lineWidth: 1, displayText: "Target Hi", opacity: 0.7 }, - { dataField: "room", lineWidth: 1, displayText: "Room", opacity: 0.5 }, - { dataField: "chiller", lineWidth: 1, displayText: "Chiller", color: '#0000bb' } - ] - } - ] - }; - $("#fermenter_chart").jqxChart(settings); + var sourceA = { + datatype: 'json', + datafields: [ + { name: 'date', type: 'date', format: 'yyyy-MM-dd HH:mm' }, + { name: 'air', type: 'float' }, + { name: 'beer', type: 'float' }, + { name: 'chiller', type: 'float' }, + { name: 'room', type: 'float' }, + { name: 'tlo', type: 'float' }, + { name: 'thi', type: 'float' }, + { name: 'heater', type: 'int' }, + { name: 'cooler', type: 'int' }, + { name: 'event', type: 'string' } + ], + url: 'getfermentlog.php?code=' + my_code + '&name=' + my_name + }, + dataAdapter = new $.jqx.dataAdapter(sourceA, { + autoBind: true, + async: false, + loadComplete: function() { + $('#jqxLoader').jqxLoader('close'); + }, + loadError: function(jqXHR, status, error) { + } + }), + settings = { + title: my_code + ' "' + my_name + '"', + description: '', + source: dataAdapter, + xAxis: { + dataField: 'date', + type: 'date', + formatFunction: function(value) { + return value.getDate() + '-' + (value.getMonth() + 1) + '-' + value.getFullYear(); + }, + toolTipFormatFunction: function(value) { + var h = value.getHours(), m = value.getMinutes(); + return value.getDate() + '-' + (value.getMonth() + 1) + '-' + value.getFullYear() + + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m); + }, + textRotationAngle: 45, + howGridLines: false, + rangeSelector: { + size: 90, + dataField: 'beer', + serieType: 'line', + gridLines: {visible: false}, + } + }, + colorScheme: 'scheme01', + seriesGroups: [ + { + type: 'area', + valueAxis: { + minValue: 0, + maxValue: 100, + displayValueAxis: false, + description: 'Verwarm/Koel %' + }, + series: [ + { dataField: 'cooler', lineWidth: 1, displayText: 'Koel %', opacity: 0.4 }, + { dataField: 'heater', lineWidth: 1, displayText: 'Verwarm %', opacity: 0.3 } + ] + }, + { + type: 'spline', + valueAxis: { + minValue: 0, + description: 'Graden C' + }, + series: [ + { dataField: 'air', lineWidth: 1, displayText: 'Lucht' }, + { dataField: 'beer', lineWidth: 2, displayText: 'Bier' }, + { dataField: 'tlo', lineWidth: 1, displayText: 'Doel laag', opacity: 0.7 }, + { dataField: 'thi', lineWidth: 1, displayText: 'Doel hoog', opacity: 0.7 }, + { dataField: 'room', lineWidth: 1, displayText: 'Ruimte', opacity: 0.5 }, + { dataField: 'chiller', lineWidth: 1, displayText: 'Koeler', color: '#0000bb' } + ] + } + ] + }; + $('#fermenter_chart').jqxChart(settings); - $("#print").click(function () { - var content = $("#fermenter_chart")[0].outerHTML, - newWindow = window.open("", "", "width=865, height=425"), - document = newWindow.document.open(), - pageContent = - '' + - '' + - '' + - '' + - '' + - '' + my_code + ' ' + my_name + ' vergisting' + - '' + - '' + content + ''; - document.write(pageContent); - document.close(); - newWindow.print(); - }); - $("#print").jqxButton({ template: "primary", width: 125, theme: theme }); + $('#print').click(function() { + var content = $('#fermenter_chart')[0].outerHTML, + newWindow = window.open('', '', 'width=865, height=425'), + document = newWindow.document.open(), + pageContent = + '' + + '' + + '' + + '' + + '' + + '' + my_code + ' ' + my_name + ' vergisting' + + '' + + '' + content + ''; + document.write(pageContent); + document.close(); + newWindow.print(); + }); + $('#print').jqxButton({ template: 'primary', width: 125, theme: theme }); - - $("#pdfButton").click(function () { - $("#fermenter_chart").jqxChart("saveAsPDF", "vergisting_"+my_code+".pdf", getExportServer()); - }); - $("#pdfButton").jqxButton({ template: "primary", width: 125, theme: theme }); + $('#pdfButton').click(function() { + $('#fermenter_chart').jqxChart('saveAsPDF', 'vergisting_' + my_code + '.pdf', getExportServer()); + }); + $('#pdfButton').jqxButton({ template: 'primary', width: 125, theme: theme }); - $("#pngButton").click(function () { - $("#fermenter_chart").jqxChart("saveAsPNG", "vergisting_"+my_code+".png", getExportServer()); - }); - $("#pngButton").jqxButton({ template: "primary", width: 125, theme: theme }); + $('#pngButton').click(function() { + $('#fermenter_chart').jqxChart('saveAsPNG', 'vergisting_' + my_code + '.png', getExportServer()); + }); + $('#pngButton').jqxButton({ template: 'primary', width: 125, theme: theme }); - $("#Close").jqxButton({ template: "success", width: 125, theme: theme }); - $("#Close").click(function () { - window.close(); - }); + $('#Close').jqxButton({ template: 'success', width: 125, theme: theme }); + $('#Close').click(function() { + window.close(); + }); });