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
9658f4c21b
commit
fe5878b42e
@ -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; }
|
||||
|
||||
@ -1181,7 +1181,6 @@ define([
|
||||
return;
|
||||
}
|
||||
|
||||
let rtChannel, lastVersion, answersChannel;
|
||||
let attributes = {};
|
||||
nThen(function (waitFor) {
|
||||
if (parsed.hashData.type !== 'pad') { return; }
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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; }
|
||||
|
||||
@ -654,7 +654,7 @@ define([
|
||||
addLink($rightside);
|
||||
addFriendRequest($rightside);
|
||||
addMuteButton($rightside);
|
||||
//addBadges($rightside); // XXX 2025.6
|
||||
addBadges($rightside);
|
||||
addPublicKey($rightside);
|
||||
addCopyData($rightside);
|
||||
addViewButton($rightside);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user