mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 17:58:41 +00:00
Fix codestyle with phpcs
This commit is contained in:
parent
ea94fafcdd
commit
6f9367aa64
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -104,7 +104,6 @@
|
|||
}
|
||||
|
||||
this.app.eventManager.attach(e.id + 'attributes', function(data) {});
|
||||
|
||||
this.app.uiManager.getDOMObserver().observe(e, observeConfig);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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++) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@
|
|||
utter.voice = this.voice;
|
||||
utter.pitch = this.pitch;
|
||||
utter.rate = this.rate;
|
||||
|
||||
window.speechSynthesis.speak(utter);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user