mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
lint compliance
This commit is contained in:
parent
3188a457f0
commit
d52a66da8d
@ -39,6 +39,7 @@ www/pad/mathjax/
|
||||
www/code/mermaid*.js
|
||||
www/code/orgmode.js
|
||||
|
||||
testapi.js
|
||||
www/common/worker.bundle.js
|
||||
src/tweetnacl/
|
||||
_build/
|
||||
|
||||
@ -374,7 +374,7 @@
|
||||
let href = url.href + (ignoreCache ? '?'+(+new Date()) : '');
|
||||
if (typeof(self) !== "undefined" && self.crypto) {
|
||||
// Browser
|
||||
fetch(url.href).then(res => {
|
||||
fetch(href).then(res => {
|
||||
if (!res.ok) {
|
||||
throw new Error(`Fetch error: ${res.status}`);
|
||||
}
|
||||
|
||||
@ -3,14 +3,11 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
(() => {
|
||||
const factory = (AppConfig = {}, Util, Hash,
|
||||
Realtime, Messages = {}) => {
|
||||
const factory = (Util, Hash, Realtime) => {
|
||||
let window = globalThis;
|
||||
var module = {};
|
||||
|
||||
module.setCustomize = (data) => {
|
||||
Messages = data.Messages;
|
||||
AppConfig = data.AppConfig;
|
||||
module.setCustomize = (/*data*/) => {
|
||||
};
|
||||
|
||||
var clone = function (o) {
|
||||
@ -985,19 +982,15 @@ const factory = (AppConfig = {}, Util, Hash,
|
||||
|
||||
if (typeof(module) !== 'undefined' && module.exports) {
|
||||
module.exports = factory(
|
||||
undefined,
|
||||
require('./common-util'),
|
||||
require('./common-hash'),
|
||||
require('./common-realtime'),
|
||||
undefined
|
||||
);
|
||||
} else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) {
|
||||
define([
|
||||
'/customize/application_config.js',
|
||||
'/common/common-util.js',
|
||||
'/common/common-hash.js',
|
||||
'/common/common-realtime.js',
|
||||
'/customize/messages.js',
|
||||
], factory);
|
||||
} else {
|
||||
// unsupported initialization
|
||||
|
||||
@ -3,14 +3,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
(() => {
|
||||
const factory = (AppConfig = {}, Util, Hash,
|
||||
const factory = (Util, Hash,
|
||||
Constants, UOSetter, Crypto, Messages = {}) => {
|
||||
let window = globalThis;
|
||||
var module = {};
|
||||
|
||||
module.setCustomize = (data) => {
|
||||
Messages = data.Messages;
|
||||
AppConfig = data.AppConfig;
|
||||
UOSetter.setCustomize(data);
|
||||
};
|
||||
|
||||
@ -972,7 +971,6 @@ const factory = (AppConfig = {}, Util, Hash,
|
||||
|
||||
if (typeof(module) !== 'undefined' && module.exports) {
|
||||
module.exports = factory(
|
||||
undefined,
|
||||
require('./common-util'),
|
||||
require('./common-hash'),
|
||||
require('./common-constants'),
|
||||
@ -982,7 +980,6 @@ if (typeof(module) !== 'undefined' && module.exports) {
|
||||
);
|
||||
} else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) {
|
||||
define([
|
||||
'/customize/application_config.js',
|
||||
'/common/common-util.js',
|
||||
'/common/common-hash.js',
|
||||
'/common/common-constants.js',
|
||||
|
||||
@ -624,7 +624,7 @@ const factory = (ApiConfig = {}, Sortify, UserObject, ProxyManager,
|
||||
return metadata;
|
||||
};
|
||||
|
||||
Store.onMaintenanceUpdate = function (uid) {
|
||||
Store.onMaintenanceUpdate = function (/*uid*/) {
|
||||
// use uid in /api/broadcast so that all connected users will use the same cached
|
||||
// version on the server
|
||||
let origin = ApiConfig.httpUnsafeOrigin;
|
||||
@ -639,7 +639,7 @@ const factory = (ApiConfig = {}, Sortify, UserObject, ProxyManager,
|
||||
});
|
||||
});
|
||||
};
|
||||
Store.onSurveyUpdate = function (uid) {
|
||||
Store.onSurveyUpdate = function (/*uid*/) {
|
||||
// use uid in /api/broadcast so that all connected users will use the same cached
|
||||
// version on the server
|
||||
let origin = ApiConfig.httpUnsafeOrigin;
|
||||
|
||||
@ -3,12 +3,11 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
(() => {
|
||||
const factory = (AppConfig = {}, Feedback, Hash, Util,
|
||||
const factory = (Feedback, Hash, Util,
|
||||
Messaging, Crypt, Mailbox, Messages = {},
|
||||
Realtime, nThen, Crypto) => {
|
||||
|
||||
const setCustomize = data => {
|
||||
AppConfig = data.AppConfig;
|
||||
Messages = data.Messages;
|
||||
};
|
||||
|
||||
@ -510,7 +509,6 @@ const factory = (AppConfig = {}, Feedback, Hash, Util,
|
||||
|
||||
if (typeof(module) !== 'undefined' && module.exports) {
|
||||
module.exports = factory(
|
||||
undefined,
|
||||
require('../../common/common-feedback'),
|
||||
require('../../common/common-hash'),
|
||||
require('../../common/common-util'),
|
||||
@ -524,7 +522,6 @@ if (typeof(module) !== 'undefined' && module.exports) {
|
||||
);
|
||||
} else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) {
|
||||
define([
|
||||
'/customize/application_config.js',
|
||||
'/common/common-feedback.js',
|
||||
'/common/common-hash.js',
|
||||
'/common/common-util.js',
|
||||
|
||||
@ -2,8 +2,6 @@
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
/* global importScripts */
|
||||
|
||||
const Interface = require('./interface');
|
||||
const Util = require('../../common/common-util');
|
||||
let start = (setConfig) => {
|
||||
|
||||
@ -2,8 +2,6 @@
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
/* global importScripts */
|
||||
|
||||
const Interface = require('./interface');
|
||||
let start = (setConfig) => {
|
||||
let ready = false;
|
||||
@ -50,7 +48,7 @@ let start = (setConfig) => {
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = { start };
|
||||
|
||||
|
||||
@ -4,11 +4,10 @@
|
||||
|
||||
(() => {
|
||||
const factory = (Util, Hash, Constants, Realtime, Cache, Rec,
|
||||
Messages = {}, nThen, Listmap, FP, Crypto, ChainPad) => {
|
||||
nThen, Listmap, FP, Crypto, ChainPad) => {
|
||||
var Calendar = {};
|
||||
|
||||
Calendar.setCustomize = data => {
|
||||
Messages = data.Messages;
|
||||
Calendar.setCustomize = (/*data*/) => {
|
||||
};
|
||||
|
||||
var getStore = function (ctx, id) {
|
||||
@ -1218,7 +1217,6 @@ if (typeof(module) !== 'undefined' && module.exports) {
|
||||
require('../../common/common-realtime'),
|
||||
require('../../common/cache-store'),
|
||||
require('../../common/recurrence'),
|
||||
undefined,
|
||||
require('nthen'),
|
||||
require('chainpad-listmap'),
|
||||
require('../../../www/lib/datepicker/flatpickr'),
|
||||
@ -1233,7 +1231,6 @@ if (typeof(module) !== 'undefined' && module.exports) {
|
||||
'/common/common-realtime.js',
|
||||
'/common/outer/cache-store.js',
|
||||
'/calendar/recurrence.js',
|
||||
'/customize/messages.js',
|
||||
'/components/nthen/index.js',
|
||||
'chainpad-listmap',
|
||||
'/lib/datepicker/flatpickr.js',
|
||||
|
||||
@ -374,7 +374,7 @@
|
||||
let href = url.href + (ignoreCache ? '?'+(+new Date()) : '');
|
||||
if (typeof(self) !== "undefined" && self.crypto) {
|
||||
// Browser
|
||||
fetch(url.href).then(res => {
|
||||
fetch(href).then(res => {
|
||||
if (!res.ok) {
|
||||
throw new Error(`Fetch error: ${res.status}`);
|
||||
}
|
||||
|
||||
@ -33,8 +33,6 @@ define([
|
||||
|
||||
Additionally, there is some basic functionality for import/export.
|
||||
*/
|
||||
var urlArgs = Util.find(Config, ['requireConf', 'urlArgs']) || '';
|
||||
|
||||
var postMessage = function (/*cmd, data, cb*/) {
|
||||
/*setTimeout(function () {
|
||||
AStore.query(cmd, data, cb);
|
||||
@ -2669,7 +2667,7 @@ define([
|
||||
}).then(waitFor(store => {
|
||||
postMsg = store?.postMsg;
|
||||
msgEv = store?.msgEv;
|
||||
}))
|
||||
}));
|
||||
}).nThen(function () {
|
||||
Channel.create(msgEv, postMsg, function (chan) {
|
||||
console.log('Outer ready');
|
||||
|
||||
@ -293,7 +293,7 @@ define([
|
||||
|
||||
let closeAll = () => {
|
||||
History.state = false;
|
||||
$hist.hide()
|
||||
$hist.hide();
|
||||
$bottom.show();
|
||||
$cke.show();
|
||||
$(window).trigger('resize');
|
||||
|
||||
@ -33,10 +33,11 @@ const factory = function () {
|
||||
|
||||
let called = false;
|
||||
let msgEv = mkEvent();
|
||||
let todo = (resolve, reject) => {
|
||||
let todo = (resolve/*, reject*/) => {
|
||||
if (called) { return; }
|
||||
called = true;
|
||||
|
||||
let worker, postMsg;
|
||||
if (!noWorker && !noSharedWorker && typeof(SharedWorker) !== "undefined") {
|
||||
worker = new SharedWorker('/common/worker.bundle.js?' + urlArgs);
|
||||
worker.onerror = function (e) {
|
||||
@ -85,7 +86,7 @@ const factory = function () {
|
||||
// aren't available
|
||||
//if (typeof(require) === "undefined") { return; }
|
||||
require(['/common/worker.bundle.js'], function (Store) {
|
||||
let store = Store?.store
|
||||
let store = Store?.store;
|
||||
if (!store) { return void console.error("No store"); }
|
||||
store.onMessage(function (data) {
|
||||
if (data === "STORE_READY") { return; }
|
||||
@ -107,7 +108,7 @@ const factory = function () {
|
||||
};
|
||||
let todoNode = (resolve, reject) => {
|
||||
const Store = require('./worker.bundle');
|
||||
let store = Store?.store
|
||||
let store = Store?.store;
|
||||
if (!store) {
|
||||
reject('NOSTORE');
|
||||
return void console.error("No store");
|
||||
@ -116,7 +117,7 @@ const factory = function () {
|
||||
if (data === "STORE_READY") { return; }
|
||||
msgEv.fire({data: data, origin: ''});
|
||||
});
|
||||
postMsg = function (d) {
|
||||
let postMsg = function (d) {
|
||||
setTimeout(function () {
|
||||
store.query(d);
|
||||
});
|
||||
@ -144,7 +145,7 @@ const factory = function () {
|
||||
}
|
||||
if (typeof(Worker) !== "undefined") {
|
||||
try {
|
||||
worker = new Worker('/common/testworker.js?' + urlArgs);
|
||||
let worker = new Worker('/common/testworker.js?' + urlArgs);
|
||||
worker.onerror = function (errEv) {
|
||||
errEv.preventDefault();
|
||||
errEv.stopPropagation();
|
||||
|
||||
@ -3,14 +3,11 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
(() => {
|
||||
const factory = (AppConfig = {}, Util, Hash,
|
||||
Realtime, Messages = {}) => {
|
||||
const factory = (Util, Hash, Realtime) => {
|
||||
let window = globalThis;
|
||||
var module = {};
|
||||
|
||||
module.setCustomize = (data) => {
|
||||
Messages = data.Messages;
|
||||
AppConfig = data.AppConfig;
|
||||
module.setCustomize = (/*data*/) => {
|
||||
};
|
||||
|
||||
var clone = function (o) {
|
||||
@ -985,19 +982,15 @@ const factory = (AppConfig = {}, Util, Hash,
|
||||
|
||||
if (typeof(module) !== 'undefined' && module.exports) {
|
||||
module.exports = factory(
|
||||
undefined,
|
||||
require('./common-util'),
|
||||
require('./common-hash'),
|
||||
require('./common-realtime'),
|
||||
undefined
|
||||
);
|
||||
} else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) {
|
||||
define([
|
||||
'/customize/application_config.js',
|
||||
'/common/common-util.js',
|
||||
'/common/common-hash.js',
|
||||
'/common/common-realtime.js',
|
||||
'/customize/messages.js',
|
||||
], factory);
|
||||
} else {
|
||||
// unsupported initialization
|
||||
|
||||
@ -3,14 +3,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
(() => {
|
||||
const factory = (AppConfig = {}, Util, Hash,
|
||||
const factory = (Util, Hash,
|
||||
Constants, UOSetter, Crypto, Messages = {}) => {
|
||||
let window = globalThis;
|
||||
var module = {};
|
||||
|
||||
module.setCustomize = (data) => {
|
||||
Messages = data.Messages;
|
||||
AppConfig = data.AppConfig;
|
||||
UOSetter.setCustomize(data);
|
||||
};
|
||||
|
||||
@ -972,7 +971,6 @@ const factory = (AppConfig = {}, Util, Hash,
|
||||
|
||||
if (typeof(module) !== 'undefined' && module.exports) {
|
||||
module.exports = factory(
|
||||
undefined,
|
||||
require('./common-util'),
|
||||
require('./common-hash'),
|
||||
require('./common-constants'),
|
||||
@ -982,7 +980,6 @@ if (typeof(module) !== 'undefined' && module.exports) {
|
||||
);
|
||||
} else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) {
|
||||
define([
|
||||
'/customize/application_config.js',
|
||||
'/common/common-util.js',
|
||||
'/common/common-hash.js',
|
||||
'/common/common-constants.js',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user