From 02a25d3f84d1f0ad7c7eed15d87b997acda6bbf4 Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Fri, 9 Jun 2017 10:26:53 +0200 Subject: [PATCH] Fix eslint violations --- .../dialogs/importwizard/steps/AdjustSize.js | 2 +- src/js/controller/preview/PreviewController.js | 3 ++- .../settings/exportimage/GifExportController.js | 3 ++- src/js/tools/drawing/Circle.js | 6 +++++- src/js/utils/FunctionUtils.js | 3 ++- src/js/utils/PixelUtils.js | 2 +- src/js/utils/Template.js | 16 ++++++++-------- src/js/widgets/HslRgbColorPicker.js | 3 ++- .../imageprocessor/ImageProcessorWorker.js | 4 +++- 9 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/js/controller/dialogs/importwizard/steps/AdjustSize.js b/src/js/controller/dialogs/importwizard/steps/AdjustSize.js index 4f7e6ae8..c93ac80b 100644 --- a/src/js/controller/dialogs/importwizard/steps/AdjustSize.js +++ b/src/js/controller/dialogs/importwizard/steps/AdjustSize.js @@ -70,7 +70,7 @@ if (isBigger && keep) { anchorInfo.innerHTML = [ '', - 'Imported content will be cropped!', + ' Imported content will be cropped!', '', ' ', 'Select crop origin' diff --git a/src/js/controller/preview/PreviewController.js b/src/js/controller/preview/PreviewController.js index f441ffbe..b6aa657f 100644 --- a/src/js/controller/preview/PreviewController.js +++ b/src/js/controller/preview/PreviewController.js @@ -309,7 +309,8 @@ var isSeamless = pskl.UserSettings.get(pskl.UserSettings.SEAMLESS_MODE); this.renderer.setRepeated(isSeamless); - var height, width; + var width; + var height; if (isSeamless) { height = PREVIEW_SIZE; diff --git a/src/js/controller/settings/exportimage/GifExportController.js b/src/js/controller/settings/exportimage/GifExportController.js index bf4d0f44..3d0e9a03 100644 --- a/src/js/controller/settings/exportimage/GifExportController.js +++ b/src/js/controller/settings/exportimage/GifExportController.js @@ -85,7 +85,8 @@ var isTransparent = layers.some(function (l) {return l.isTransparent();}); var preserveColors = !isTransparent && currentColors.length < MAX_GIF_COLORS; - var transparentColor, transparent; + var transparentColor; + var transparent; // transparency only supported if preserveColors is true, see Issue #357 if (preserveColors) { transparentColor = this.getTransparentColor(currentColors); diff --git a/src/js/tools/drawing/Circle.js b/src/js/tools/drawing/Circle.js index a5275275..55d0cefb 100644 --- a/src/js/tools/drawing/Circle.js +++ b/src/js/tools/drawing/Circle.js @@ -35,7 +35,11 @@ var evenY = (coords.y0 + coords.y1) % 2; var rX = coords.x1 - xC; var rY = coords.y1 - yC; - var x, y, angle, r; + + var x; + var y; + var angle; + var r; if (penSize == 1) { for (x = coords.x0 ; x <= xC ; x++) { diff --git a/src/js/utils/FunctionUtils.js b/src/js/utils/FunctionUtils.js index 9c8233e1..e89ad16e 100644 --- a/src/js/utils/FunctionUtils.js +++ b/src/js/utils/FunctionUtils.js @@ -21,7 +21,8 @@ * every X milliseconds, where X is the provided interval. */ throttle : function (fn, interval) { - var last, timer; + var last; + var timer; return function () { var now = Date.now(); if (last && now < last + interval) { diff --git a/src/js/utils/PixelUtils.js b/src/js/utils/PixelUtils.js index cdfd9f59..a992cf1f 100644 --- a/src/js/utils/PixelUtils.js +++ b/src/js/utils/PixelUtils.js @@ -182,7 +182,7 @@ var loopCount = 0; var cellCount = frame.getWidth() * frame.getHeight(); while (queue.length > 0) { - loopCount ++; + loopCount++; var currentItem = queue.pop(); diff --git a/src/js/utils/Template.js b/src/js/utils/Template.js index 1c6e0797..dc291331 100644 --- a/src/js/utils/Template.js +++ b/src/js/utils/Template.js @@ -90,15 +90,15 @@ _getDummyEl : pskl.utils.UserAgent.isIE11 ? // IE11 specific implementation - function () { - return document.createElement('div'); - } + function () { + return document.createElement('div'); + } : // Normal, sane browsers implementation. - : function () { - if (!ns.Template._dummyEl) { - ns.Template._dummyEl = document.createElement('div'); - } - return ns.Template._dummyEl; + function () { + if (!ns.Template._dummyEl) { + ns.Template._dummyEl = document.createElement('div'); } + return ns.Template._dummyEl; + } }; })(); diff --git a/src/js/widgets/HslRgbColorPicker.js b/src/js/widgets/HslRgbColorPicker.js index 8af3399f..50e4a4fa 100644 --- a/src/js/widgets/HslRgbColorPicker.js +++ b/src/js/widgets/HslRgbColorPicker.js @@ -227,7 +227,8 @@ var dimension = slider.dataset.dimension; var model = slider.dataset.model; - var start, end; + var start; + var end; var isHueSlider = dimension === 'h'; if (!isHueSlider) { var colors = this.getSliderBackgroundColors_(model, dimension); diff --git a/src/js/worker/imageprocessor/ImageProcessorWorker.js b/src/js/worker/imageprocessor/ImageProcessorWorker.js index 8b6fb72b..33928073 100644 --- a/src/js/worker/imageprocessor/ImageProcessorWorker.js +++ b/src/js/worker/imageprocessor/ImageProcessorWorker.js @@ -2,7 +2,9 @@ var ns = $.namespace('pskl.worker.imageprocessor'); ns.ImageProcessorWorker = function () { - var currentStep, currentProgress, currentTotal; + var currentStep; + var currentProgress; + var currentTotal; var initStepCounter_ = function (total) { currentStep = 0;