lint: Run eslint --fix on src/

This commit is contained in:
Richard Hansen 2020-11-23 13:24:19 -05:00 committed by John McLear
parent b8d07a42eb
commit 8e5fd19db2
109 changed files with 9061 additions and 10572 deletions

View file

@ -1,43 +1,41 @@
var $, jQuery;
$ = jQuery = require("ep_etherpad-lite/static/js/rjquery").$;
var _ = require("underscore");
let $, jQuery;
$ = jQuery = require('ep_etherpad-lite/static/js/rjquery').$;
const _ = require('underscore');
var pluginUtils = require('./shared');
var defs = require('./plugin_defs');
const pluginUtils = require('./shared');
const defs = require('./plugin_defs');
exports.baseURL = '';
exports.ensure = function (cb) {
if (!defs.loaded)
exports.update(cb);
else
cb();
if (!defs.loaded) exports.update(cb);
else cb();
};
exports.update = function (cb) {
// It appears that this response (see #620) may interrupt the current thread
// of execution on Firefox. This schedules the response in the run-loop,
// which appears to fix the issue.
var callback = function () {setTimeout(cb, 0);};
$.ajaxSetup({ cache: false });
jQuery.getJSON(exports.baseURL + 'pluginfw/plugin-definitions.json').done(function(data) {
const callback = function () { setTimeout(cb, 0); };
$.ajaxSetup({cache: false});
jQuery.getJSON(`${exports.baseURL}pluginfw/plugin-definitions.json`).done((data) => {
defs.plugins = data.plugins;
defs.parts = data.parts;
defs.hooks = pluginUtils.extractHooks(defs.parts, "client_hooks");
defs.hooks = pluginUtils.extractHooks(defs.parts, 'client_hooks');
defs.loaded = true;
callback();
}).fail(function(e){
console.error("Failed to load plugin-definitions: " + err);
}).fail((e) => {
console.error(`Failed to load plugin-definitions: ${err}`);
callback();
});
};
function adoptPluginsFromAncestorsOf(frame) {
// Bind plugins with parent;
var parentRequire = null;
let parentRequire = null;
try {
while (frame = frame.parent) {
if (typeof (frame.require) !== "undefined") {
if (typeof (frame.require) !== 'undefined') {
parentRequire = frame.require;
break;
}
@ -46,17 +44,17 @@ function adoptPluginsFromAncestorsOf(frame) {
// Silence (this can only be a XDomain issue).
}
if (parentRequire) {
var ancestorPluginDefs = parentRequire("ep_etherpad-lite/static/js/pluginfw/plugin_defs");
const ancestorPluginDefs = parentRequire('ep_etherpad-lite/static/js/pluginfw/plugin_defs');
defs.hooks = ancestorPluginDefs.hooks;
defs.loaded = ancestorPluginDefs.loaded;
defs.parts = ancestorPluginDefs.parts;
defs.plugins = ancestorPluginDefs.plugins;
var ancestorPlugins = parentRequire("ep_etherpad-lite/static/js/pluginfw/client_plugins");
const ancestorPlugins = parentRequire('ep_etherpad-lite/static/js/pluginfw/client_plugins');
exports.baseURL = ancestorPlugins.baseURL;
exports.ensure = ancestorPlugins.ensure;
exports.update = ancestorPlugins.update;
} else {
throw new Error("Parent plugins could not be found.")
throw new Error('Parent plugins could not be found.');
}
}