New convienience functions on toggle menus, allow paths in sys module search

This commit is contained in:
Bryan Ashby 2023-01-30 22:13:38 -07:00
parent c456c18b85
commit a829905c63
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
3 changed files with 24 additions and 1 deletions

View File

@ -135,6 +135,7 @@ module.exports = class Actor extends ActivityPubObject {
bbsInfo: { bbsInfo: {
boardName: Config().general.boardName, boardName: Config().general.boardName,
memberSince: user.getProperty(UserProps.AccountCreated), memberSince: user.getProperty(UserProps.AccountCreated),
affiliations: user.getProperty(UserProps.Affiliations) || '',
}, },
}; };

View File

@ -30,7 +30,7 @@ const ALL_ASSETS = [
]; ];
const ASSET_RE = new RegExp( const ASSET_RE = new RegExp(
'^@(' + ALL_ASSETS.join('|') + ')' + /:(?:([^:]+):)?([A-Za-z0-9_\-.]+)$/.source '^@(' + ALL_ASSETS.join('|') + ')' + /:(?:([^:]+):)?([A-Za-z0-9_\-./]+)$/.source
); );
function parseAsset(s) { function parseAsset(s) {

View File

@ -77,6 +77,28 @@ ToggleMenuView.prototype.setFocusItemIndex = function (index) {
this.updateSelection(); this.updateSelection();
}; };
ToggleMenuView.prototype.setTrue = function () {
this.setFocusItemIndex(0);
this.updateSelection();
};
ToggleMenuView.prototype.setFalse = function () {
this.setFocusItemIndex(1);
this.updateSelection();
};
ToggleMenuView.prototype.setFromBoolean = function (bool) {
return bool ? this.setTrue() : this.setFalse();
};
ToggleMenuView.prototype.setYes = function () {
return this.setTrue();
};
ToggleMenuView.prototype.setNo = function () {
return this.setFalse();
};
ToggleMenuView.prototype.setFocus = function (focused) { ToggleMenuView.prototype.setFocus = function (focused) {
ToggleMenuView.super_.prototype.setFocus.call(this, focused); ToggleMenuView.super_.prototype.setFocus.call(this, focused);