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.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")
.attr("width", this.chart.dimension.width)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -80,7 +80,9 @@
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 = {
width: box.width,

View File

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

View File

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

View File

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

View File

@ -40,7 +40,13 @@
{
const exdate = new Date();
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;
};

View File

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

View File

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

View File

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

View File

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

View File

@ -109,7 +109,9 @@
length = actions.length;
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);
actions[i].callback();
}

View File

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

View File

@ -59,7 +59,6 @@
}
const self = this;
this.recognition.lang = this.lang;
this.recognition.interimResults = false;
this.recognition.maxAlternatives = 1;
@ -72,8 +71,8 @@
}
this.recognition.onstart = function() {};
this.recognition.onresult = function(event) {
this.recognition.onresult = function(event)
{
let result = jsOMS.trim(event.results[event.resultIndex][0].transcript);
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');
};
this.recognition.onerror = function(event) {
this.recognition.onerror = function(event)
{
jsOMS.Log.Logger.instance.warning('Error during speech recognition: ' + event.error);
};
};

View File

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

View File

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

View File

@ -196,7 +196,11 @@
try {
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;
}
}