Inspection fixes

This commit is contained in:
Dennis Eichhorn 2015-12-22 23:15:06 +01:00
parent 8f2ad343d2
commit 2fe467d7e8
9 changed files with 61 additions and 53 deletions

View File

@ -116,7 +116,7 @@
*
* @param {string} key Key of the asset (hash)
*
* @return {bool}
* @return {boolean}
*
* @method
*

26
Chart/Chart.js vendored
View File

@ -70,7 +70,7 @@
}
return x;
}
};
jsOMS.Chart.prototype.calculateVerticalPosition = function (position)
{
@ -90,17 +90,17 @@
}
return y;
}
};
jsOMS.Chart.prototype.setColor = function (color)
{
this.color = color;
}
};
jsOMS.Chart.prototype.getColor = function ()
{
return this.color;
}
};
jsOMS.Chart.prototype.setAxis = function (id, axis)
{
@ -194,7 +194,7 @@
this.dataset = data;
this.findAxisDomain();
}
};
jsOMS.Chart.prototype.findAxisDomain = function ()
{
@ -215,12 +215,12 @@
});
})
}
}
};
jsOMS.Chart.prototype.getData = function ()
{
return this.dataset;
}
};
jsOMS.Chart.prototype.drawLegend = function (svg, dataPointEnter, dataPoint)
{
@ -253,8 +253,10 @@
});
dataPoint.exit().remove();
var tlength = this.chartSelect.select('.dataPoint-name').node().getComputedTextLength();
// Adding margin for legend
if (this.margin.right < (tlength = this.chartSelect.select('.dataPoint-name').node().getComputedTextLength())) {
if (this.margin.right < tlength) {
this.margin.right = tlength + 30;
this.shouldRedraw = true;
}
@ -262,7 +264,7 @@
this.margin.right = 10;
this.shouldRedraw = true;
}
}
};
jsOMS.Chart.prototype.drawMarker = function (svg, x, y, dataPointEnter, dataPoint)
{
@ -308,7 +310,7 @@
.style("opacity", 0);
});
}
}
};
jsOMS.Chart.prototype.drawText = function (svg)
{
@ -372,7 +374,7 @@
this.shouldRedraw = true;
}
}
}
};
jsOMS.Chart.prototype.drawAxis = function (svg, xAxis1, yAxis1)
{
@ -448,7 +450,7 @@
if (this.axis.y2 !== undefined) {
}
}
};
jsOMS.Chart.prototype.drawGrid = function (svg, xGrid, yGrid)
{

View File

@ -55,7 +55,7 @@
jsOMS.Chart.LineChart.prototype.getChart = function ()
{
return this.chart;
}
};
jsOMS.Chart.LineChart.prototype.draw = function ()
{
@ -193,7 +193,7 @@
this.chart.shouldRedraw = false;
this.chart.chartSelect.select("*").remove();
this.draw();
}
};
jsOMS.Chart.LineChart.prototype.drawData = function (svg, line, dataPointEnter, dataPoint)
{
@ -215,7 +215,7 @@
});
return [dataPointEnter, dataPoint];
}
};
jsOMS.Chart.LineChart.prototype.drawZoomPanel = function (svg, zoom)
{

View File

@ -25,10 +25,10 @@
* Set option.
*
* @param {int|string} key Option key
* @param {boo|int|float|string|Array} value Option value
* @param {bool} [overwrite=true] Overwrite value
* @param {boolean|int|float|string|Array} value Option value
* @param {boolean} [overwrite=true] Overwrite value
*
* @param {bool}
* @return {boolean}
*
* @method
*
@ -53,7 +53,7 @@
*
* @param {int|string} key Option key
*
* @return {boo|int|float|string|Array}
* @return {boolean|int|float|string|Array}
*
* @method
*
@ -74,7 +74,7 @@
*
* @param {int|string} key Option key
*
* @return {boo}
* @return {boolean}
*
* @method
*

View File

@ -23,7 +23,7 @@
/**
* Is local storage available?
*
* @return {boo}
* @return {boolean}
*
* @method
*

View File

@ -67,7 +67,7 @@
*
* EnumResponseType
*
* @param {string} method Method type
* @param {string} type Method type
*
* @method
*
@ -160,7 +160,7 @@
/**
* Set success callback.
*
* @param {requestCallback} success Success callback
* @param {requestCallback} callback Success callback
*
* @method
*
@ -207,7 +207,7 @@
*
* EnumRequestType
*
* @param {string} method Method type
* @param {string} type Method type
*
* @method
*

View File

@ -50,7 +50,7 @@
* @param {string} selector Form id
* @param {requestCallback} callback Callback to execute before submit
*
* @return {bool}
* @return {boolean}
*
* @method
*
@ -108,7 +108,7 @@
for (var i = 0; i < forms.length; i++) {
if (this.ignore.indexOf(forms[i].id) === -1) {
this.forms.push(forms[i])
this.forms.push(forms[i]);
this.bindElement(forms[i]);
}
}
@ -120,7 +120,7 @@
*
* @param {Object} e Form element
*
* @return {bool}
* @return {boolean}
*
* @method
*
@ -416,10 +416,10 @@
jsOMS.FormManager.prototype.getElements = function ()
{
return this.forms;
}
};
jsOMS.FormManager.prototype.count = function ()
{
return this.forms.length;
}
};
}(window.jsOMS = window.jsOMS || {}));

View File

@ -1,30 +1,36 @@
(function (jsOMS, undefined) {
(function (jsOMS, undefined)
{
// TODO: create comments
jsOMS.Markdown = function (source, destination) {
jsOMS.Markdown = function (source, destination)
{
this.source = document.querySelector(source);
this.dest = document.querySelector(destination);
var self = this;
var timer = 0;
this.source.addEventListener('input', function () {
this.source.addEventListener('input', function ()
{
maybeUpdateFromInput(this.value);
}, false);
// todo: maybe export to own olib function?!
function maybeUpdateFromInput(val) {
function maybeUpdateFromInput(val)
{
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(function () {
timer = setTimeout(function ()
{
self.dest.value = self.parse(self.source.value);
timer = 0;
}, 500);
}
};
jsOMS.Markdown.prototype.parse = function (plain) {
jsOMS.Markdown.prototype.parse = function (plain)
{
plain = plain.replace('\r\n', '\n');
plain = plain.replace('\r', '\n');
plain = plain.replace('\t', ' ');
@ -37,7 +43,8 @@
};
jsOMS.Markdown.prototype.lines = function (lines) {
jsOMS.Markdown.prototype.lines = function (lines)
{
var escaped = false;
var line = '';
@ -48,7 +55,7 @@
line += '</p><p>';
} else if (i === 0) {
line = '<p>' + line;
} else if(i === liens.length - 1) {
} else if (i === liens.length - 1) {
line += '</p>';
}
@ -60,20 +67,19 @@
var text = indent > 0 ? line.substr(indent) : line;
for(var j = 0; j < text.length; j++) {
if(text[j] === '*' && !escaped) {
for (var j = 0; j < text.length; j++) {
if (text[j] === '*' && !escaped) {
} else if(text[j] === '_' && !escaped) {}
else if(text[j] === '-' && !escaped) {}
else if(text[j] === '#' && !escaped) {}
else if(['1', '2', '3' , '4', '5', '6', '7', '8', '9', '0'].indexOf(text[j]) !== -1 && !escaped) {}
else if(text[j] === '`' && !escaped) {}
else if(text[j] === '"' && !escaped) {}
else if(text[j] === '[' && !escaped) {}
else if(text[j] === '\\' && !escaped) {
} else if (text[j] === '_' && !escaped) {
} else if (text[j] === '-' && !escaped) {
} else if (text[j] === '#' && !escaped) {
} else if (['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'].indexOf(text[j]) !== -1 && !escaped) {
} else if (text[j] === '`' && !escaped) {
} else if (text[j] === '"' && !escaped) {
} else if (text[j] === '[' && !escaped) {
} else if (text[j] === '\\' && !escaped) {
escaped = true;
}
else {
} else {
escaped = false;
}
}

View File

@ -16,7 +16,7 @@
* @param {Object} ele DOM Element
* @param {string} cls Class to find
*
* @return {bool}
* @return {boolean}
*
* @function
*
@ -173,7 +173,7 @@
*
* @param ele DOM Node
*
* @return {bool}
* @return {boolean}
*
* @function
*
@ -195,7 +195,7 @@
*
* @param o DOM Element
*
* @return {bool}
* @return {boolean}
*
* @function
*