User:Chlod/Scripts/Deputy.js: Difference between revisions

Content deleted Content added
(bot/CD)
(bot/CD)
Line 351:
 
var version = "0.6.0";
var gitAbbrevHash = "e4c177b80a82f7";
var gitBranch = "main";
var gitDate = "FriSat, 2324 Feb 2024 0811:5751:1410 +0800";
var gitVersion = "0.6.0+ge4c177bg80a82f7";
 
/**
Line 3,525:
framed: false
});
let contentToggled = !window.deputy.prefsconfig.get('cci.contentDefault'autoCollapseRows.get();
/**
* Toggles the content.
Line 3,540:
'deputy.session.row.content.open').text());
contentContainer.style.display = show ? 'block' : 'none';
contentToggled = !contentToggledshow;
};
toggleContent(contentToggled);
Line 6,226:
}
}
 
/**
*
*/
class DeputyPreferences {
constructor() {
this.preferences = DeputyPreferences.default;
}
/**
* @param id
* @return value
*/
get(id) {
var _a;
const idParts = id.split('.');
let current = this.preferences;
for (const part of idParts) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
current = (_a = current === null || current === void 0 ? void 0 : current[part]) !== null && _a !== void 0 ? _a : null;
}
return current;
}
}
DeputyPreferences.default = {
configVersion: 0,
lastVersion: '0.1.0',
cci: {
contentDefault: 'expanded'
}
};
 
/**
Line 12,540 ⟶ 12,509:
}),
showUsername: new Setting({
defaultValue: false,
// @ts-ignore displayOptions: {
type: 'checkbox'
*/ }
}),
autoCollapseRows: new Setting({
defaultValue: false,
displayOptions: {
Line 13,061 ⟶ 13,036:
"deputy.setting.user.cci.showUsername.name": "Show username",
"deputy.setting.user.cci.showUsername.description": "Show the username of the user who made the edit on revision rows. This may be redundant for cases which only have one editor.",
"deputy.setting.user.cci.autoCollapseRows.name": "Automatically collapse rows",
"deputy.setting.user.cci.autoCollapseRows.description": "Automatically collapse rows when the page is loaded. This is useful for cases where each row has many revisions, but may be annoying for cases where each row has few revisions.",
"deputy.setting.user.cci.autoShowDiff.name": "Automatically show diffs",
"deputy.setting.user.cci.autoShowDiff.description": "Enabling automatic loading of diffs. Configurable with two additional options to avoid loading too much content.",
Line 16,837 ⟶ 16,814:
this.DeputyStorage = DeputyStorage;
this.DeputySession = DeputySession;
this.DeputyPreferences = DeputyPreferences;
this.DeputyCommunications = DeputyCommunications;
this.DeputyCase = DeputyCase;
Line 16,920 ⟶ 16,896:
// Initialize the Deputy API interface
this.dispatch = new DeputyDispatch();
// Initialize the Deputy preferences instance
this.prefs = new DeputyPreferences();
// Initialize communications
this.comms = new DeputyCommunications();