From 6299531f4c8f7daa1b4afab45d0439f635b03982 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Tue, 7 Oct 2014 15:01:42 +0200 Subject: Fixed jshint errors --- web-ui/app/js/helpers/contenttype.js | 32 +++++++++++++++++--------------- web-ui/app/js/helpers/iterator.js | 5 +++-- web-ui/app/js/helpers/view_helper.js | 10 +++++----- 3 files changed, 25 insertions(+), 22 deletions(-) (limited to 'web-ui/app/js/helpers') diff --git a/web-ui/app/js/helpers/contenttype.js b/web-ui/app/js/helpers/contenttype.js index 7a3957d3..764b6032 100644 --- a/web-ui/app/js/helpers/contenttype.js +++ b/web-ui/app/js/helpers/contenttype.js @@ -14,6 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with Pixelated. If not, see . */ +'use strict'; define([], function () { var exports = {}; @@ -23,24 +24,25 @@ define([], function () { function MediaType(s, p){ this.type = ''; this.params = {}; - if(typeof s=='string'){ - var c = splitQuotedString(s); + var c, i, n; + if(typeof s==='string'){ + c = splitQuotedString(s); this.type = c.shift(); - for(var i=0; i. */ +'use strict'; define(function () { return Iterator; @@ -24,7 +25,7 @@ define(function () { this.elems = elems; this.hasPrevious = function () { - return this.index != 0; + return this.index !== 0; }; this.hasNext = function () { @@ -51,7 +52,7 @@ define(function () { var removed = this.current(), toRemove = this.index; - !this.hasNext() && this.index--; + if(!this.hasNext()) { this.index--; } this.elems.remove(toRemove); return removed; }; diff --git a/web-ui/app/js/helpers/view_helper.js b/web-ui/app/js/helpers/view_helper.js index a9a10378..841a1077 100644 --- a/web-ui/app/js/helpers/view_helper.js +++ b/web-ui/app/js/helpers/view_helper.js @@ -79,9 +79,9 @@ define( } function moveCaretToEnd(el) { - if (typeof el.selectionStart == "number") { + if (typeof el.selectionStart === 'number') { el.selectionStart = el.selectionEnd = el.value.length; - } else if (typeof el.createTextRange != "undefined") { + } else if (typeof el.createTextRange !== 'undefined') { el.focus(); var range = el.createTextRange(); range.collapse(false); @@ -92,7 +92,7 @@ define( function fixedSizeNumber(num, size) { var res = num.toString(); while(res.length < size) { - res = "0" + res; + res = '0' + res; } return res; } @@ -100,9 +100,9 @@ define( function getFormattedDate(date){ var today = createTodayDate(); if (date.getTime() > today.getTime()) { - return fixedSizeNumber(date.getHours(), 2) + ":" + fixedSizeNumber(date.getMinutes(), 2); + return fixedSizeNumber(date.getHours(), 2) + ':' + fixedSizeNumber(date.getMinutes(), 2); } else { - return "" + date.getFullYear() + "-" + fixedSizeNumber(date.getMonth() + 1, 2) + "-" + fixedSizeNumber(date.getDate(), 2); + return '' + date.getFullYear() + '-' + fixedSizeNumber(date.getMonth() + 1, 2) + '-' + fixedSizeNumber(date.getDate(), 2); } } -- cgit v1.2.3