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) * @param {string} key Key of the asset (hash)
* *
* @return {bool} * @return {boolean}
* *
* @method * @method
* *

26
Chart/Chart.js vendored
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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