Fix codestyle with phpcs

This commit is contained in:
Dennis Eichhorn 2018-02-10 20:45:42 +01:00
parent ea94fafcdd
commit 6f9367aa64
54 changed files with 400 additions and 381 deletions

View File

@ -35,7 +35,8 @@
this.chart.calculateDimension(); this.chart.calculateDimension();
this.chart.cellSize = Math.min(this.chart.dimension.width / (12 * 5), this.chart.dimension.height / (8)); this.chart.cellSize = Math.min(this.chart.dimension.width / (12 * 5), this.chart.dimension.height / (8));
document.getElementById(this.chart.chartId).style.height = (this.chart.dimension.height * this.chart.dataset.length) + 'px'; document.getElementById(this.chart.chartId)
.style.height = (this.chart.dimension.height * this.chart.dataset.length) + 'px';
svg = this.chart.chartSelect.selectAll('svg').data(this.chart.dataset).enter().append("svg") svg = this.chart.chartSelect.selectAll('svg').data(this.chart.dataset).enter().append("svg")
.attr("width", this.chart.dimension.width) .attr("width", this.chart.dimension.width)

View File

@ -72,9 +72,9 @@
jsOMS.Chart.CandlestickChart.prototype.draw = function () jsOMS.Chart.CandlestickChart.prototype.draw = function ()
{ {
let bar, svg, x, xAxis1, xAxis2, y, yAxis1, yAxis2, xGrid, yGrid, zoom, self = this; let bar, svg, x, xAxis1, xAxis2, y, yAxis1, yAxis2, xGrid, yGrid, zoom,
self = this,
let mm = 50; mm = 50;
this.chart.calculateDimension(); this.chart.calculateDimension();

View File

@ -17,21 +17,25 @@
anchor: "middle", anchor: "middle",
position: "center" position: "center"
}; };
this.subtitle = { this.subtitle = {
visible: true, visible: true,
text: "", text: "",
anchor: "middle", anchor: "middle",
position: "center" position: "center"
}; };
this.footer = { this.footer = {
visible: true, visible: true,
text: "", text: "",
anchor: "end", anchor: "end",
position: "right" position: "right"
}; };
this.legend = { this.legend = {
visible: true visible: true
}; };
this.color = d3.scale.category10(); this.color = d3.scale.category10();
this.dataset = []; this.dataset = [];
this.dataSettings = { this.dataSettings = {

View File

@ -116,6 +116,7 @@
temp = this.drawData(svg, x, y, dataPointEnter, dataPoint); temp = this.drawData(svg, x, y, dataPointEnter, dataPoint);
dataPointEnter = temp[0]; dataPointEnter = temp[0];
dataPoint = temp[1]; dataPoint = temp[1];
this.chart.drawMarker(svg, x, y, dataPointEnter, dataPoint); this.chart.drawMarker(svg, x, y, dataPointEnter, dataPoint);
this.chart.drawLegend(svg, dataPointEnter, dataPoint); this.chart.drawLegend(svg, dataPointEnter, dataPoint);
this.chart.drawText(svg); this.chart.drawText(svg);

View File

@ -221,7 +221,6 @@
jsOMS.Chart.LineChart.prototype.drawData = function (svg, line, dataPointEnter, dataPoint) jsOMS.Chart.LineChart.prototype.drawData = function (svg, line, dataPointEnter, dataPoint)
{ {
const self = this; const self = this;
dataPoint = svg.selectAll(".dataPoint").data(this.chart.dataset, function (c) dataPoint = svg.selectAll(".dataPoint").data(this.chart.dataset, function (c)
{ {
return c.id; return c.id;

View File

@ -8,6 +8,7 @@
// Setting default chart values // Setting default chart values
this.chart.margin = {top: 5, right: 0, bottom: 0, left: 0}; this.chart.margin = {top: 5, right: 0, bottom: 0, left: 0};
/** global: d3 */ /** global: d3 */
this.chart.color = d3.scale.category10(); this.chart.color = d3.scale.category10();
this.chart.dataSettings.style.strokewidth = 1; this.chart.dataSettings.style.strokewidth = 1;

View File

@ -80,7 +80,9 @@
jsOMS.Chart.PyramidChart.prototype.draw = function () jsOMS.Chart.PyramidChart.prototype.draw = function ()
{ {
let bar, svg, x, xAxis1, xAxis2, y, yAxis1, yAxis2, xGrid, yGrid, zoom, self = this, box = this.chart.chartSelect.node().getBoundingClientRect(); let bar, svg, x, xAxis1, xAxis2, y, yAxis1, yAxis2, xGrid, yGrid, zoom,
self = this,
box = this.chart.chartSelect.node().getBoundingClientRect();
this.chart.dimension = { this.chart.dimension = {
width: box.width, width: box.width,

View File

@ -8,6 +8,7 @@
// Setting default chart values // Setting default chart values
this.chart.margin = {top: 5, right: 0, bottom: 0, left: 0}; this.chart.margin = {top: 5, right: 0, bottom: 0, left: 0};
/** global: d3 */ /** global: d3 */
this.chart.color = d3.scale.category10(); this.chart.color = d3.scale.category10();
this.chart.axis = { this.chart.axis = {
@ -116,7 +117,6 @@
jsOMS.Chart.ScatterplotChart.prototype.drawData = function (svg, x, y, dataPointEnter, dataPoint) jsOMS.Chart.ScatterplotChart.prototype.drawData = function (svg, x, y, dataPointEnter, dataPoint)
{ {
const self = this; const self = this;
dataPoint = svg.selectAll(".dataPoint").data(this.chart.dataset, function (c) dataPoint = svg.selectAll(".dataPoint").data(this.chart.dataset, function (c)
{ {
return c.id; return c.id;

View File

@ -8,6 +8,7 @@
// Setting default chart values // Setting default chart values
this.chart.margin = {top: 5, right: 0, bottom: 0, left: 0}; this.chart.margin = {top: 5, right: 0, bottom: 0, left: 0};
/** global: d3 */ /** global: d3 */
this.chart.color = d3.scale.category10(); this.chart.color = d3.scale.category10();
this.chart.axis = { this.chart.axis = {
@ -53,6 +54,7 @@
visible: true visible: true
} }
}; };
this.chart.subtype = 'vwaterfall'; this.chart.subtype = 'vwaterfall';
}; };
@ -127,7 +129,6 @@
jsOMS.Chart.VWaterfallChart.prototype.drawData = function (svg, x, y, dataPointEnter, dataPoint) jsOMS.Chart.VWaterfallChart.prototype.drawData = function (svg, x, y, dataPointEnter, dataPoint)
{ {
const self = this; const self = this;
dataPoint = svg.selectAll(".dataPoint").data(this.chart.dataset[0].points, function (c) dataPoint = svg.selectAll(".dataPoint").data(this.chart.dataset[0].points, function (c)
{ {
return c.name; return c.name;

View File

@ -8,6 +8,7 @@
// Setting default chart values // Setting default chart values
this.chart.margin = {top: 5, right: 0, bottom: 0, left: 0}; this.chart.margin = {top: 5, right: 0, bottom: 0, left: 0};
/** global: d3 */ /** global: d3 */
this.chart.color = d3.scale.category10(); this.chart.color = d3.scale.category10();
this.chart.axis = { this.chart.axis = {
@ -53,6 +54,7 @@
visible: true visible: true
} }
}; };
this.chart.subtype = 'waterfall'; this.chart.subtype = 'waterfall';
}; };
@ -127,7 +129,6 @@
jsOMS.Chart.WaterfallChart.prototype.drawData = function (svg, x, y, dataPointEnter, dataPoint) jsOMS.Chart.WaterfallChart.prototype.drawData = function (svg, x, y, dataPointEnter, dataPoint)
{ {
const self = this; const self = this;
dataPoint = svg.selectAll(".dataPoint").data(this.chart.dataset[0].points, function (c) dataPoint = svg.selectAll(".dataPoint").data(this.chart.dataset[0].points, function (c)
{ {
return c.name; return c.name;

View File

@ -40,7 +40,13 @@
{ {
const exdate = new Date(); const exdate = new Date();
exdate.setDate(exdate.getDate() + exdays); exdate.setDate(exdate.getDate() + exdays);
const cValue = encodeURI(value) + ((exdays === null) ? "" : "; expires=" + exdate.toUTCString()) + ";domain=" + domain + ";path=" + path;
const cValue = encodeURI(value)
+ ((exdays === null) ? "" : "; expires="
+ exdate.toUTCString()) + ";domain="
+ domain + ";path="
+ path;
document.cookie = cName + "=" + cValue; document.cookie = cName + "=" + cValue;
}; };

View File

@ -3,9 +3,9 @@
jsOMS.mathEvaluate = function(equation) jsOMS.mathEvaluate = function(equation)
{ {
const stack = []; const stack = [],
const postfix = jsOMS.shuntingYard(equation); postfix = jsOMS.shuntingYard(equation);
const length = postfix.length; length = postfix.length;
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
if (!isNaN(parseFloat(postfix[i])) && isFinite(postfix[i])) { if (!isNaN(parseFloat(postfix[i])) && isFinite(postfix[i])) {
@ -61,11 +61,9 @@
let o1 = token; let o1 = token;
let o2 = stack[stack.length - 1]; let o2 = stack[stack.length - 1];
while ('^*/+-'.indexOf(o2) !== -1 && while ('^*/+-'.indexOf(o2) !== -1
( && ((operators[o1].order === -1 && operators[o1].precedence <= operators[o2].precedence)
(operators[o1].order === -1 && operators[o1].precedence <= operators[o2].precedence) || (operators[o1].order === 1 && operators[o1].precedence < operators[o2].precedence))
|| (operators[o1].order === 1 && operators[o1].precedence < operators[o2].precedence)
)
) { ) {
output.push(stack.pop()); output.push(stack.pop());
o2 = stack[stack.length - 1]; o2 = stack[stack.length - 1];

View File

@ -104,7 +104,6 @@
} }
this.app.eventManager.attach(e.id + 'attributes', function(data) {}); this.app.eventManager.attach(e.id + 'attributes', function(data) {});
this.app.uiManager.getDOMObserver().observe(e, observeConfig); this.app.uiManager.getDOMObserver().observe(e, observeConfig);
} }
}; };

View File

@ -225,10 +225,10 @@
} }
} }
} catch (e) { } catch (e) {
jsOMS.Log.Logger.instance.error('Invalid form response. \n' + jsOMS.Log.Logger.instance.error('Invalid form response. \n'
'URL: ' + form.getAction() + '\n' + + 'URL: ' + form.getAction() + '\n'
'Request: ' + JSON.stringify(form.getData()) + '\n' + + 'Request: ' + JSON.stringify(form.getData()) + '\n'
'Response: ' + xhr.response + 'Response: ' + xhr.response
); );
} }
}); });

View File

@ -87,7 +87,6 @@
const actions = this.elements[element], const actions = this.elements[element],
length = actions.length, length = actions.length,
keyLength = this.down.length; keyLength = this.down.length;
let match = false; let match = false;
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {

View File

@ -109,7 +109,9 @@
length = actions.length; length = actions.length;
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
if ((!actions[i].exact || event.target.getAttribute('id') === element) && actions[i].button === event.button) { if ((!actions[i].exact || event.target.getAttribute('id') === element)
&& actions[i].button === event.button
) {
jsOMS.preventAll(event); jsOMS.preventAll(event);
actions[i].callback(); actions[i].callback();
} }

View File

@ -62,6 +62,7 @@
utter.voice = this.voice; utter.voice = this.voice;
utter.pitch = this.pitch; utter.pitch = this.pitch;
utter.rate = this.rate; utter.rate = this.rate;
window.speechSynthesis.speak(utter); window.speechSynthesis.speak(utter);
}; };

View File

@ -59,7 +59,6 @@
} }
const self = this; const self = this;
this.recognition.lang = this.lang; this.recognition.lang = this.lang;
this.recognition.interimResults = false; this.recognition.interimResults = false;
this.recognition.maxAlternatives = 1; this.recognition.maxAlternatives = 1;
@ -72,8 +71,8 @@
} }
this.recognition.onstart = function() {}; this.recognition.onstart = function() {};
this.recognition.onresult = function(event)
this.recognition.onresult = function(event) { {
let result = jsOMS.trim(event.results[event.resultIndex][0].transcript); let result = jsOMS.trim(event.results[event.resultIndex][0].transcript);
if (self.commands.hasOwnProperty(result)) { if (self.commands.hasOwnProperty(result)) {
@ -81,14 +80,17 @@
} }
}; };
this.recognition.onspeechend = function() { this.recognition.onspeechend = function()
{
}; };
this.recognition.onnomatch = function(event) { this.recognition.onnomatch = function(event)
{
jsOMS.Log.Logger.instance.warning('Couldn\'t recognize speech'); jsOMS.Log.Logger.instance.warning('Couldn\'t recognize speech');
}; };
this.recognition.onerror = function(event) { this.recognition.onerror = function(event)
{
jsOMS.Log.Logger.instance.warning('Error during speech recognition: ' + event.error); jsOMS.Log.Logger.instance.warning('Error during speech recognition: ' + event.error);
}; };
}; };

View File

@ -151,8 +151,7 @@
{ {
/** global: Node */ /** global: Node */
return ( return (
typeof Node === "object" ? ele instanceof Node : typeof Node === "object" ? ele instanceof Node : ele && typeof ele === "object" && typeof ele.nodeType === "number" && typeof ele.nodeName === "string"
ele && typeof ele === "object" && typeof ele.nodeType === "number" && typeof ele.nodeName === "string"
); );
}; };

View File

@ -321,8 +321,7 @@
{ {
/** global: Node */ /** global: Node */
return ( return (
typeof Node === "object" ? ele instanceof Node : typeof Node === "object" ? ele instanceof Node : ele && typeof ele === "object" && typeof ele.nodeType === "number" && typeof ele.nodeName === "string"
ele && typeof ele === "object" && typeof ele.nodeType === "number" && typeof ele.nodeName === "string"
); );
}; };

View File

@ -196,7 +196,11 @@
try { try {
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
if ((elements[i].required && elements[i].value === '') || (typeof elements[i].pattern !== 'undefined' && elements[i].pattern !== '' && !(new RegExp(elements[i].pattern)).test(elements[i].value))) { if ((elements[i].required && elements[i].value === '')
|| (typeof elements[i].pattern !== 'undefined'
&& elements[i].pattern !== ''
&& !(new RegExp(elements[i].pattern)).test(elements[i].value))
) {
return false; return false;
} }
} }