chore: remove unnecessary console logs

This commit is contained in:
yflory 2026-04-30 16:40:42 +02:00
parent d774729b3b
commit 83ecc99944
7 changed files with 16 additions and 16 deletions

View File

@ -61,7 +61,6 @@ const factory = (Crypto, CPNetflux, Netflux, Util,
nThen(function (waitFor) {
Session.accessKeys.forEach(function (obj) {
Pinpad.create(config.network, obj, waitFor(function (e) {
console.log('done', obj);
if (e) { console.error(e); }
}));
});

View File

@ -62,7 +62,7 @@ const factory = (SRpc, Channel, Util) => {
} catch (e) {
console.error('Error in webworker when executing query ' + q);
console.error(e);
console.log(data);
//console.log(data);
}
if (q === "DISCONNECT") {
onClose();
@ -99,7 +99,7 @@ const factory = (SRpc, Channel, Util) => {
} catch (e) {
console.error('Error in webworker when executing query JOIN_PAD');
console.error(e);
console.log(data);
//console.log(data);
}
});
chan.on('SEND_PAD_MSG', function (msg, cb) {
@ -112,7 +112,7 @@ const factory = (SRpc, Channel, Util) => {
} catch (e) {
console.error('Error in webworker when executing query SEND_PAD_MSG');
console.error(e);
console.log(data);
//console.log(data);
}
});

View File

@ -116,7 +116,6 @@ const factory = (Crypto, Hash, Util, Realtime, Messaging,
var getChannelMessagesSince = function (ctx, channel, data, keys) {
var network = ctx.store.network;
console.log('Fetching [%s] messages since [%s]', channel.id, data.lastKnownHash || '');
if (channel.isPadChat || channel.isTeamChat) {
// We need to use GET_HISTORY_RANGE to make sure we won't get the full history

View File

@ -170,7 +170,6 @@ const factory = (Util, Hash, Constants, Realtime,
ctx.emit('UPDATE', ctx.listmap.proxy, ctx.clients);
};
profile.execCommand = function (clientId, obj, cb) {
console.log(obj);
var cmd = obj.cmd;
var data = obj.data;
if (cmd === 'SUBSCRIBE') {

View File

@ -213,7 +213,6 @@ define([
opt.channelHex = secret.channel;
}
console.warn(opt);
return opt;
};

View File

@ -5,6 +5,8 @@
(function () {
'use strict';
var factory = function (/*Hash*/) {
let devMode = false;
try { devMode = localStorage.CryptPad_dev === "1"; } catch (e) {}
// This API is used to load a CryptPad editor for a provided document in
// an external platform.
@ -48,7 +50,7 @@
var msg = data.msg;
var txid = data.txid;
if (commands[msg.q]) {
console.warn('OUTER RECEIVED QUERY', msg.q, msg.data);
if (devMode) { console.warn('OUTER RECEIVED QUERY', msg.q, msg.data); }
commands[msg.q](msg.data, function (args) {
_sendCb(txid, args);
});
@ -62,7 +64,7 @@
var txid = getTxid();
if (cb) { handlers[txid] = cb; }
console.warn('OUTER SENT QUERY', q, data);
if (devMode) { console.warn('OUTER SENT QUERY', q, data); }
iWindow.postMessage({ msg: {
q: q,
data: data,

View File

@ -14,7 +14,10 @@ define([
return Math.random().toString(16).replace('0.', '');
};
var init = function () {
console.warn('INIT');
let devMode = false;
try { devMode = localStorage.CryptPad_dev === "1"; } catch (e) {}
if (devMode) { console.warn('INIT'); }
var p = window.parent;
var txid = getTxid();
p.postMessage({ q: 'INTEGRATION_READY', txid: txid }, '*');
@ -86,7 +89,7 @@ define([
http.open('HEAD', url);
http.onreadystatechange = function() {
if (this.readyState === this.DONE) {
console.error(oldKey, this.status);
if (devMode) { console.error(oldKey, this.status); }
if (this.status === 200) {
return cb({state: true});
}
@ -150,7 +153,7 @@ define([
}
if (data.keepOld) { // they provide their own key, we must turn it into a hash
var key = sanitizeKey(data.key) + "000000000000000000000000000000000";
console.warn('KEY', key);
if (devMode) { console.warn('KEY', key); }
let hash = `/2/integration/edit/${key.slice(0,24)}/`;
return void cb({
key: hash,
@ -265,7 +268,7 @@ define([
xhr.responseType = 'blob';
//xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function () {
console.error(this.status);
if (devMode) { console.error(this.status); }
if (this.status === 200) {
cb();
} else {
@ -278,7 +281,7 @@ define([
xhr.send(blob);
};
chan.on('START', function (data, cb) {
console.warn('INNER START', data);
if (devMode) { console.warn('INNER START', data); }
// data.key is a hash
var href = Hash.hashToHref(data.key, data.application);
if (data.editorConfig.lang) {
@ -303,7 +306,7 @@ define([
});
};
console.error(Hash.hrefToHexChannelId(href));
if (devMode) { console.error(Hash.hrefToHexChannelId(href)); }
let startApp = function (blob) {
window.CP_integration_outer = {
pathname: `/${data.application}/`,
@ -336,7 +339,6 @@ define([
path = '/common/onlyoffice/main.js';
}
require([path], function () {
console.warn('SAO REQUIRED');
delete window.CP_integration_outer;
cb();
});