From 01576f24da90a85484aff75df38dc584ac24aa7f Mon Sep 17 00:00:00 2001 From: webchick Date: Sun, 3 Dec 2017 08:04:02 -0800 Subject: [PATCH] Issue #2927228 by drpal, mikejw, dawehner, webchick, xjm: 2/3 JS codestyle: camelcase --- core/modules/color/color.es6.js | 12 ++++++------ core/modules/color/color.js | 6 +++--- core/modules/color/preview.es6.js | 18 +++++++++--------- core/modules/color/preview.js | 18 +++++++++--------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/core/modules/color/color.es6.js b/core/modules/color/color.es6.js index 5a514e564ca..109bfa1a2ca 100644 --- a/core/modules/color/color.es6.js +++ b/core/modules/color/color.es6.js @@ -91,10 +91,10 @@ * This algorithm ensures relative ordering on the saturation and * luminance axes is preserved, and performs a simple hue shift. * - * It is also symmetrical. If: shift_color(c, a, b) === d, then - * shift_color(d, b, a) === c. + * It is also symmetrical. If: shiftColor(c, a, b) === d, then + * shiftColor(d, b, a) === c. * - * @function Drupal.color~shift_color + * @function Drupal.color~shiftColor * * @param {string} given * A hex color code to shift. @@ -106,7 +106,7 @@ * @return {string} * A hex color, shifted. */ - function shift_color(given, ref1, ref2) { + function shiftColor(given, ref1, ref2) { let d; // Convert to HSL. given = farb.RGBToHSL(farb.unpack(given)); @@ -177,14 +177,14 @@ if (!locks[j - 1] || $(locks[j - 1]).is('.is-unlocked')) { break; } - matched = shift_color(color, reference[input.key], reference[inputs[j].key]); + matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); callback(inputs[j], matched, false); } for (j = i - 1; ; --j) { if (!locks[j] || $(locks[j]).is('.is-unlocked')) { break; } - matched = shift_color(color, reference[input.key], reference[inputs[j].key]); + matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); callback(inputs[j], matched, false); } diff --git a/core/modules/color/color.js b/core/modules/color/color.js index 1b036c3aa1b..ee91e56274d 100644 --- a/core/modules/color/color.js +++ b/core/modules/color/color.js @@ -67,7 +67,7 @@ Drupal.color.callback(context, settings, form, farb, height, width); } - function shift_color(given, ref1, ref2) { + function shiftColor(given, ref1, ref2) { var d = void 0; given = farb.RGBToHSL(farb.unpack(given)); @@ -116,14 +116,14 @@ if (!locks[j - 1] || $(locks[j - 1]).is('.is-unlocked')) { break; } - matched = shift_color(color, reference[input.key], reference[inputs[j].key]); + matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); callback(inputs[j], matched, false); } for (j = i - 1;; --j) { if (!locks[j] || $(locks[j]).is('.is-unlocked')) { break; } - matched = shift_color(color, reference[input.key], reference[inputs[j].key]); + matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); callback(inputs[j], matched, false); } diff --git a/core/modules/color/preview.es6.js b/core/modules/color/preview.es6.js index 357a62680bc..f5988b382db 100644 --- a/core/modules/color/preview.es6.js +++ b/core/modules/color/preview.es6.js @@ -47,20 +47,20 @@ } // Set up gradients if there are some. - let color_start; - let color_end; + let colorStart; + let colorEnd; for (const i in settings.gradients) { if (settings.gradients.hasOwnProperty(i)) { - color_start = farb.unpack(form.find(`.color-palette input[name="palette[${settings.gradients[i].colors[0]}]"]`).val()); - color_end = farb.unpack(form.find(`.color-palette input[name="palette[${settings.gradients[i].colors[1]}]"]`).val()); - if (color_start && color_end) { + colorStart = farb.unpack(form.find(`.color-palette input[name="palette[${settings.gradients[i].colors[0]}]"]`).val()); + colorEnd = farb.unpack(form.find(`.color-palette input[name="palette[${settings.gradients[i].colors[1]}]"]`).val()); + if (colorStart && colorEnd) { delta = []; - for (const j in color_start) { - if (color_start.hasOwnProperty(j)) { - delta[j] = (color_end[j] - color_start[j]) / (settings.gradients[i].vertical ? height[i] : width[i]); + for (const j in colorStart) { + if (colorStart.hasOwnProperty(j)) { + delta[j] = (colorEnd[j] - colorStart[j]) / (settings.gradients[i].vertical ? height[i] : width[i]); } } - accum = color_start; + accum = colorStart; // Render gradient lines. form.find(`#gradient-${i} > div`).each(gradientLineColor); } diff --git a/core/modules/color/preview.js b/core/modules/color/preview.js index b4bcbcc8964..6ca5e32891c 100644 --- a/core/modules/color/preview.js +++ b/core/modules/color/preview.js @@ -25,20 +25,20 @@ element.style.backgroundColor = farb.pack(accum); } - var color_start = void 0; - var color_end = void 0; + var colorStart = void 0; + var colorEnd = void 0; for (var i in settings.gradients) { if (settings.gradients.hasOwnProperty(i)) { - color_start = farb.unpack(form.find('.color-palette input[name="palette[' + settings.gradients[i].colors[0] + ']"]').val()); - color_end = farb.unpack(form.find('.color-palette input[name="palette[' + settings.gradients[i].colors[1] + ']"]').val()); - if (color_start && color_end) { + colorStart = farb.unpack(form.find('.color-palette input[name="palette[' + settings.gradients[i].colors[0] + ']"]').val()); + colorEnd = farb.unpack(form.find('.color-palette input[name="palette[' + settings.gradients[i].colors[1] + ']"]').val()); + if (colorStart && colorEnd) { delta = []; - for (var j in color_start) { - if (color_start.hasOwnProperty(j)) { - delta[j] = (color_end[j] - color_start[j]) / (settings.gradients[i].vertical ? height[i] : width[i]); + for (var j in colorStart) { + if (colorStart.hasOwnProperty(j)) { + delta[j] = (colorEnd[j] - colorStart[j]) / (settings.gradients[i].vertical ? height[i] : width[i]); } } - accum = color_start; + accum = colorStart; form.find('#gradient-' + i + ' > div').each(gradientLineColor); }