From fe5878b42e506b31852cd992de900e8e5468f9e6 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 6 Jun 2025 13:52:52 +0200 Subject: [PATCH] lint compliance --- www/common/common-ui-elements.js | 22 ---------------------- www/common/cryptpad-common.js | 1 - www/common/onlyoffice/inner.js | 18 ++++-------------- www/common/toolbar.js | 2 +- www/profile/inner.js | 2 +- 5 files changed, 6 insertions(+), 39 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index c3de21053..3ffb4f079 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2830,7 +2830,6 @@ define([ var selected = 0; // Selected template in the list (highlighted) var TEMPLATES_DISPLAYED = big ? 6 : 3; // Max templates displayed per page - var next = function () {}; // Function called when pressing tab to highlight the next template var i = 0; // Index of the first template displayed in the current page sframeChan.query("Q_CREATE_TEMPLATES", type, function (err, res) { if (!res.data || !Array.isArray(res.data)) { @@ -2939,27 +2938,6 @@ define([ redraw(0); } - - // Change template selection when Tab is pressed - next = function (revert) { - var max = $creation.find('.cp-creation-template-element').length; - if (selected + 1 === max && !revert) { - selected = i + TEMPLATES_DISPLAYED < allData.length ? 0 : max; - return void redraw(i + TEMPLATES_DISPLAYED); - } - if (selected === 0 && revert) { - selected = i - TEMPLATES_DISPLAYED >= 0 ? TEMPLATES_DISPLAYED - 1 : 0; - return void redraw(i - TEMPLATES_DISPLAYED); - } - selected = revert ? - (--selected < 0 ? 0 : selected) : - ++selected >= max ? max-1 : selected; - $creation.find('.cp-creation-template-element') - .removeClass('cp-creation-template-selected'); - $($creation.find('.cp-creation-template-element').get(selected)) - .addClass('cp-creation-template-selected'); - }; - $w.on('resize', function () { var _big = $w.width() > 800; if (big === _big) { return; } diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 234bb8515..32d887e74 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1181,7 +1181,6 @@ define([ return; } - let rtChannel, lastVersion, answersChannel; let attributes = {}; nThen(function (waitFor) { if (parsed.hashData.type !== 'pad') { return; } diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index b60b1b7b0..a7f71d65f 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -306,6 +306,10 @@ define([ return; } delete hashes[lastIndex]; + APP.onLocal(); + APP.realtime.onSettle(function () { + UI.log(Messages.saved); + }); }; var rtChannel = { @@ -642,20 +646,6 @@ define([ }); } }; - var deleteLastCp = function () { - var hashes = content.hashes; - if (!hashes || !Object.keys(hashes).length) { return; } - var i = 0; - var idx = Object.keys(hashes).map(Number).sort(function (a, b) { - return a-b; - }); - var lastIndex = idx[idx.length - 1 - i]; - delete content.hashes[lastIndex]; - APP.onLocal(); - APP.realtime.onSettle(function () { - UI.log(Messages.saved); - }); - }; var restoreLastCp = function () { content.saveLock = myOOId; APP.onLocal(); diff --git a/www/common/toolbar.js b/www/common/toolbar.js index d5e6f34e7..a74bd9d77 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -427,7 +427,7 @@ MessengerUI, Messages, Pages, PadTypes) { $span.append($rightCol); }, data.uid); $span.data('uid', data.uid); - if (false && data.badge && data.edPublic) { // XXX 2025.6 + if (data.badge && data.edPublic) { const addBadge = (badge) => { let i = Badges.render(badge); if (!i) { return; } diff --git a/www/profile/inner.js b/www/profile/inner.js index 455595286..1f4723e4b 100644 --- a/www/profile/inner.js +++ b/www/profile/inner.js @@ -654,7 +654,7 @@ define([ addLink($rightside); addFriendRequest($rightside); addMuteButton($rightside); - //addBadges($rightside); // XXX 2025.6 + addBadges($rightside); addPublicKey($rightside); addCopyData($rightside); addViewButton($rightside);