From 986f89f41b59148d3c93580b9bef695482914d66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Wed, 9 Apr 2014 17:49:23 +0200 Subject: [PATCH 1/1] jslint. --- skins/ckeditor/plugins/plinn_image/plugin.js | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/skins/ckeditor/plugins/plinn_image/plugin.js b/skins/ckeditor/plugins/plinn_image/plugin.js index 0220127..13ce7f7 100644 --- a/skins/ckeditor/plugins/plinn_image/plugin.js +++ b/skins/ckeditor/plugins/plinn_image/plugin.js @@ -53,7 +53,7 @@ PlinnCKDDUploader.prototype.createFileProxy = function(file) { link.appendText(file.name); container.append(link); - var proxy = new Object(); + var proxy = {}; proxy.file = file; proxy.container = container; proxy.progressBar = progressBar; @@ -173,13 +173,13 @@ var reSize = /getResizedImage\?size=(\d+)_(\d+)$/; function updateImageSizeUrlParameters(img) { if (reSize.test(img.src)){ var matches = reSize.exec(img.src); - var srcWidth = parseInt(matches[1]); - var srcHeight = parseInt(matches[2]); + var srcWidth = parseInt(matches[1], 10); + var srcHeight = parseInt(matches[2], 10); - var imgWidth = parseInt((img.style.width) ? img.style.width : img.width); - var imgHeight = parseInt((img.style.height) ? img.style.height : img.height); + var imgWidth = parseInt((img.style.width) ? img.style.width : img.width, 10); + var imgHeight = parseInt((img.style.height) ? img.style.height : img.height, 10); - if ((imgWidth && imgHeight) && srcWidth != imgWidth && srcHeight != imgHeight) { + if ((imgWidth && imgHeight) && srcWidth !== imgWidth && srcHeight !== imgHeight) { var newUrl = img.getAttribute('src', 2).replace(reSize, 'getResizedImage?size=' + imgWidth + '_' + imgHeight); img.width = imgWidth; img.height = imgHeight; @@ -197,7 +197,7 @@ function openPlinnImageDialog(path, editor) { //",left=" + iLeft ; var win = open(path + 'dialog/plinn_image.html', 'PlinnImageDialog', winOptions); - win.dialogArguments = new Object(); + win.dialogArguments = {}; win.dialogArguments.editor = editor; win.dialogArguments.pluginPath = path; win.dialogArguments.CKEDITOR = CKEDITOR; @@ -217,8 +217,9 @@ CKEDITOR.plugins.add( 'plinn_image', var tmpDiv = document.createElement('div'); tmpDiv.innerHTML = evt.data.dataValue; var images = tmpDiv.getElementsByTagName('IMG'); - for (var i = 0 ; i < images.length ; i++) - updateImageSizeUrlParameters(images[i]); + var i; + for (i = 0 ; i < images.length ; i++) { + updateImageSizeUrlParameters(images[i]);} evt.data.dataValue = tmpDiv.innerHTML; } ); @@ -248,4 +249,4 @@ CKEDITOR.plugins.add( 'plinn_image', }); -})(); +}()); -- 2.20.1