diff --git a/bin/plugins/checkPlugin.js b/bin/plugins/checkPlugin.js index 9dca0779f..fd31c148e 100755 --- a/bin/plugins/checkPlugin.js +++ b/bin/plugins/checkPlugin.js @@ -205,8 +205,8 @@ fs.readdir(pluginPath, (err, rootFiles) => { console.warn('Missing peer deps reference in package.json'); if (autoFix) { const peerDependencies = { - "ep_etherpad-lite": ">=1.8.6", - } + 'ep_etherpad-lite': '>=1.8.6', + }; hasAutoFixed = true; parsedPackageJSON.peerDependencies = peerDependencies; fs.writeFileSync(`${pluginPath}/package.json`, JSON.stringify(parsedPackageJSON, null, 2)); @@ -246,7 +246,7 @@ fs.readdir(pluginPath, (err, rootFiles) => { } } - if ( (packageJSON.toLowerCase().indexOf('engines') === -1) || !parsedPackageJSON.engines.node) { + if ((packageJSON.toLowerCase().indexOf('engines') === -1) || !parsedPackageJSON.engines.node) { console.warn('No engines or node engine in package.json'); if (autoFix) { const engines = { @@ -374,17 +374,17 @@ fs.readdir(pluginPath, (err, rootFiles) => { const gitignore = fs.readFileSync('bin/plugins/lib/gitignore', {encoding: 'utf8', flag: 'r'}); fs.writeFileSync(`${pluginPath}/.gitignore`, gitignore); } - }else{ + } else { let gitignore = fs.readFileSync(`${pluginPath}/.gitignore`, {encoding: 'utf8', flag: 'r'}); - if(gitignore.indexOf("node_modules/") === -1){ - console.warn("node_modules/ missing from .gitignore") - if(autoFix){ - gitignore += "node_modules/"; - fs.writeFileSync(`${pluginPath}/.gitignore`, gitignore); - hasAutoFixed = true; - } - } + if (gitignore.indexOf('node_modules/') === -1) { + console.warn('node_modules/ missing from .gitignore'); + if (autoFix) { + gitignore += 'node_modules/'; + fs.writeFileSync(`${pluginPath}/.gitignore`, gitignore); + hasAutoFixed = true; + } + } } // if we include templates but don't have translations... diff --git a/src/node/eejs/index.js b/src/node/eejs/index.js index 3e30200f2..1da0b7cca 100644 --- a/src/node/eejs/index.js +++ b/src/node/eejs/index.js @@ -112,7 +112,7 @@ exports.require = function (name, args, mod) { paths, basedir, extensions: ['.html', '.ejs'], - }, + } ); args.e = exports; diff --git a/src/node/handler/APIHandler.js b/src/node/handler/APIHandler.js index 242e4e873..0708cc009 100644 --- a/src/node/handler/APIHandler.js +++ b/src/node/handler/APIHandler.js @@ -71,65 +71,65 @@ version['1'] = Object.assign({}, setPublicStatus: ['padID', 'publicStatus'], getPublicStatus: ['padID'], listAuthorsOfPad: ['padID'], - padUsersCount: ['padID']}, + padUsersCount: ['padID']} ); version['1.1'] = Object.assign({}, version['1'], {getAuthorName: ['authorID'], padUsers: ['padID'], sendClientsMessage: ['padID', 'msg'], - listAllGroups: []}, + listAllGroups: []} ); version['1.2'] = Object.assign({}, version['1.1'], - {checkToken: []}, + {checkToken: []} ); version['1.2.1'] = Object.assign({}, version['1.2'], - {listAllPads: []}, + {listAllPads: []} ); version['1.2.7'] = Object.assign({}, version['1.2.1'], {createDiffHTML: ['padID', 'startRev', 'endRev'], getChatHistory: ['padID', 'start', 'end'], - getChatHead: ['padID']}, + getChatHead: ['padID']} ); version['1.2.8'] = Object.assign({}, version['1.2.7'], {getAttributePool: ['padID'], - getRevisionChangeset: ['padID', 'rev']}, + getRevisionChangeset: ['padID', 'rev']} ); version['1.2.9'] = Object.assign({}, version['1.2.8'], {copyPad: ['sourceID', 'destinationID', 'force'], - movePad: ['sourceID', 'destinationID', 'force']}, + movePad: ['sourceID', 'destinationID', 'force']} ); version['1.2.10'] = Object.assign({}, version['1.2.9'], - {getPadID: ['roID']}, + {getPadID: ['roID']} ); version['1.2.11'] = Object.assign({}, version['1.2.10'], {getSavedRevisionsCount: ['padID'], listSavedRevisions: ['padID'], saveRevision: ['padID', 'rev'], - restoreRevision: ['padID', 'rev']}, + restoreRevision: ['padID', 'rev']} ); version['1.2.12'] = Object.assign({}, version['1.2.11'], - {appendChatMessage: ['padID', 'text', 'authorID', 'time']}, + {appendChatMessage: ['padID', 'text', 'authorID', 'time']} ); version['1.2.13'] = Object.assign({}, version['1.2.12'], - {appendText: ['padID', 'text']}, + {appendText: ['padID', 'text']} ); version['1.2.14'] = Object.assign({}, version['1.2.13'], - {getStats: []}, + {getStats: []} ); version['1.2.15'] = Object.assign({}, version['1.2.14'], - {copyPadWithoutHistory: ['sourceID', 'destinationID', 'force']}, + {copyPadWithoutHistory: ['sourceID', 'destinationID', 'force']} ); // set the latest available API version here diff --git a/src/node/utils/ImportHtml.js b/src/node/utils/ImportHtml.js index 2a31fc12e..48ae30087 100644 --- a/src/node/utils/ImportHtml.js +++ b/src/node/utils/ImportHtml.js @@ -25,10 +25,10 @@ exports.setPadHTML = async (pad, html) => { const apiLogger = log4js.getLogger('ImportHtml'); rehype() - .use(minifyWhitespace, {newlines: false}) - .process(html, (err, output) => { - html = String(output); - }); + .use(minifyWhitespace, {newlines: false}) + .process(html, (err, output) => { + html = String(output); + }); const $ = cheerio.load(html); diff --git a/src/node/utils/Minify.js b/src/node/utils/Minify.js index 181e67956..368e682c1 100644 --- a/src/node/utils/Minify.js +++ b/src/node/utils/Minify.js @@ -64,9 +64,9 @@ function prefixLocalLibraryPath(path) { for (const key in tar) { exports.tar[prefixLocalLibraryPath(key)] = tar[key].map(prefixLocalLibraryPath).concat( - tar[key].map(prefixLocalLibraryPath).map((p) => p.replace(/\.js$/, '')), + tar[key].map(prefixLocalLibraryPath).map((p) => p.replace(/\.js$/, '')) ).concat( - tar[key].map(prefixLocalLibraryPath).map((p) => `${p.replace(/\.js$/, '')}/index.js`), + tar[key].map(prefixLocalLibraryPath).map((p) => `${p.replace(/\.js$/, '')}/index.js`) ); } diff --git a/src/node/utils/toolbar.js b/src/node/utils/toolbar.js index 9e036ab47..59fe6e30b 100644 --- a/src/node/utils/toolbar.js +++ b/src/node/utils/toolbar.js @@ -108,8 +108,8 @@ _.extend(Button.prototype, { }; return tag('li', liAttributes, tag('a', {'class': this.grouping, 'data-l10n-id': this.attributes.localizationId}, - tag('button', {'class': ` ${this.attributes.class}`, 'data-l10n-id': this.attributes.localizationId}), - ), + tag('button', {'class': ` ${this.attributes.class}`, 'data-l10n-id': this.attributes.localizationId}) + ) ); }, }); @@ -150,7 +150,7 @@ _.extend(SelectButton.prototype, Button.prototype, { 'data-type': 'select', }; return tag('li', attributes, - this.select({id: this.attributes.selectId}), + this.select({id: this.attributes.selectId}) ); }, }); diff --git a/src/static/js/ace.js b/src/static/js/ace.js index 3bc788d0e..12e3dc535 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -319,7 +319,7 @@ window.onload = function () {\n\ return path; } return `../static/plugins/${path}`; - }, + } ); includedCSS = includedCSS.concat(additionalCSS); $$INCLUDE_CSS(`../static/skins/${clientVars.skinName}/pad.css?v=${clientVars.randomVersionString}`); diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index 63f6214ec..7d6db689d 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -291,7 +291,7 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas ['lmkr', '1'], ['insertorder', 'first'], ].concat( - _.map(state.lineAttributes, (value, key) => [key, value]), + _.map(state.lineAttributes, (value, key) => [key, value]) ); lines.appendText('*', Changeset.makeAttribsString('+', attributes, apool)); } diff --git a/src/static/js/pad_editor.js b/src/static/js/pad_editor.js index e7e723080..912c50f64 100644 --- a/src/static/js/pad_editor.js +++ b/src/static/js/pad_editor.js @@ -100,7 +100,7 @@ const padeditor = (function () { $('#languagemenu').val(html10n.getLanguage()); $('#languagemenu').change(() => { Cookies.set('language', $('#languagemenu').val()); - window.html10n.localize([$("#languagemenu").val(), 'en']); + window.html10n.localize([$('#languagemenu').val(), 'en']); if ($('select').niceSelect) { $('select').niceSelect('update'); } diff --git a/src/static/js/pluginfw/hooks.js b/src/static/js/pluginfw/hooks.js index 4dd957cb2..6243a9305 100644 --- a/src/static/js/pluginfw/hooks.js +++ b/src/static/js/pluginfw/hooks.js @@ -371,7 +371,7 @@ function aCallFirst(hook_name, args, cb, predicate) { hookCallWrapper(hook, hook_name, args, (res) => { cb(null, res); }); }, cb, - predicate, + predicate ); } diff --git a/src/static/js/pluginfw/plugins.js b/src/static/js/pluginfw/plugins.js index 7e41be5e7..52fbdd271 100644 --- a/src/static/js/pluginfw/plugins.js +++ b/src/static/js/pluginfw/plugins.js @@ -150,10 +150,10 @@ function partsToParentChildList(parts) { // Used only in Node, so no need for _ function sortParts(parts) { return tsort( - partsToParentChildList(parts), + partsToParentChildList(parts) ).filter( - (name) => parts[name] !== undefined, + (name) => parts[name] !== undefined ).map( - (name) => parts[name], + (name) => parts[name] ); } diff --git a/src/static/js/pluginfw/shared.js b/src/static/js/pluginfw/shared.js index 486e003dc..749706812 100644 --- a/src/static/js/pluginfw/shared.js +++ b/src/static/js/pluginfw/shared.js @@ -92,7 +92,7 @@ exports.clientPluginNames = function () { const client_plugin_names = _.uniq( defs.parts .filter((part) => part.hasOwnProperty('client_hooks')) - .map((part) => `plugin-${part.plugin}`), + .map((part) => `plugin-${part.plugin}`) ); return client_plugin_names; diff --git a/src/static/js/scroll.js b/src/static/js/scroll.js index 29f2695c2..064831fe7 100644 --- a/src/static/js/scroll.js +++ b/src/static/js/scroll.js @@ -315,7 +315,7 @@ Scroll.prototype.getVisibleLineRange = function (rep) { // return the first line that the top position is greater or equal than // the viewport. That is the first line that is below the viewport bottom. // So the line that is in the bottom of the viewport is the very previous one. - self._getLineEntryTopBottom(e, obj).top >= viewport.bottom, + self._getLineEntryTopBottom(e, obj).top >= viewport.bottom ); if (end < start) end = start; // unlikely // top.console.log(start+","+(end -1));