mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: prettier 2.2.1 (#11862)
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
"use strict";
|
||||
|
||||
function setUp($el, settings) {
|
||||
var width = $el.data("width"),
|
||||
let width = $el.data("width"),
|
||||
height = $el.data("height"),
|
||||
ratio = $el.data("ratio") ? $el.data("ratio") : settings.default_ratio,
|
||||
id = $el.data("youtube-id"),
|
||||
@@ -88,7 +88,7 @@
|
||||
innerHtml.push("</div>"); // .html5-title-text-wrapper
|
||||
innerHtml.push("</div>"); // end of Video title .html5-info-bar
|
||||
|
||||
var prefetchedThumbnail = $el[0].querySelector(".ytp-thumbnail-image");
|
||||
let prefetchedThumbnail = $el[0].querySelector(".ytp-thumbnail-image");
|
||||
|
||||
$el
|
||||
.css({
|
||||
@@ -158,15 +158,15 @@
|
||||
}
|
||||
|
||||
$.fn.lazyYT = function (newSettings) {
|
||||
var defaultSettings = {
|
||||
let defaultSettings = {
|
||||
default_ratio: "16:9",
|
||||
callback: null, // ToDO execute callback if given
|
||||
container_class: "lazyYT-container",
|
||||
};
|
||||
var settings = $.extend(defaultSettings, newSettings);
|
||||
let settings = $.extend(defaultSettings, newSettings);
|
||||
|
||||
return this.each(function () {
|
||||
var $el = $(this).addClass(settings.container_class);
|
||||
let $el = $(this).addClass(settings.container_class);
|
||||
setUp($el, settings);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -302,7 +302,7 @@ export function setup(helper) {
|
||||
* http://www.opensource.org/licenses/bsd-license
|
||||
*/
|
||||
function md5cycle(x, k) {
|
||||
var a = x[0],
|
||||
let a = x[0],
|
||||
b = x[1],
|
||||
c = x[2],
|
||||
d = x[3];
|
||||
@@ -406,14 +406,14 @@ function md51(s) {
|
||||
// Converts the string to UTF-8 "bytes"
|
||||
s = unescape(encodeURI(s));
|
||||
|
||||
var n = s.length,
|
||||
let n = s.length,
|
||||
state = [1732584193, -271733879, -1732584194, 271733878],
|
||||
i;
|
||||
for (i = 64; i <= s.length; i += 64) {
|
||||
md5cycle(state, md5blk(s.substring(i - 64, i)));
|
||||
}
|
||||
s = s.substring(i - 64);
|
||||
var tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
let tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
for (i = 0; i < s.length; i++) {
|
||||
tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);
|
||||
}
|
||||
@@ -431,7 +431,7 @@ function md51(s) {
|
||||
|
||||
function md5blk(s) {
|
||||
/* I figured global was faster. */
|
||||
var md5blks = [],
|
||||
let md5blks = [],
|
||||
i; /* Andy King said do it this way. */
|
||||
for (i = 0; i < 64; i += 4) {
|
||||
md5blks[i >> 2] =
|
||||
@@ -443,10 +443,10 @@ function md5blk(s) {
|
||||
return md5blks;
|
||||
}
|
||||
|
||||
var hex_chr = "0123456789abcdef".split("");
|
||||
let hex_chr = "0123456789abcdef".split("");
|
||||
|
||||
function rhex(n) {
|
||||
var s = "",
|
||||
let s = "",
|
||||
j = 0;
|
||||
for (; j < 4; j++) {
|
||||
s += hex_chr[(n >> (j * 8 + 4)) & 0x0f] + hex_chr[(n >> (j * 8)) & 0x0f];
|
||||
@@ -455,7 +455,7 @@ function rhex(n) {
|
||||
}
|
||||
|
||||
function hex(x) {
|
||||
for (var i = 0; i < x.length; i++) {
|
||||
for (let i = 0; i < x.length; i++) {
|
||||
x[i] = rhex(x[i]);
|
||||
}
|
||||
return x.join("");
|
||||
|
||||
@@ -4,7 +4,7 @@ function sumsUpTo100(percentages) {
|
||||
}
|
||||
|
||||
export default function (percentages) {
|
||||
var decimals = percentages.map((a) => a % 1);
|
||||
let decimals = percentages.map((a) => a % 1);
|
||||
const sumOfDecimals = Math.ceil(decimals.reduce((a, b) => a + b));
|
||||
// compensate error by adding 1 to n items with the greatest decimal part
|
||||
for (let i = 0, max = decimals.length; i < sumOfDecimals && i < max; i++) {
|
||||
|
||||
@@ -553,7 +553,7 @@ function pieChartConfig(data, labels, opts = {}) {
|
||||
}
|
||||
|
||||
function stripHtml(html) {
|
||||
var doc = new DOMParser().parseFromString(html, "text/html");
|
||||
let doc = new DOMParser().parseFromString(html, "text/html");
|
||||
return doc.body.textContent || "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user