mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-29 22:18:31 +00:00
Add settings for controlling the error reporting system.
Fix issues with destroying rooms and users. Fix the control center not being available on certain pages. Fix the host menu appearing when you aren't logged in. Clean up some old CSS.
This commit is contained in:
parent
e773600a3e
commit
92917453a7
12 changed files with 272 additions and 106 deletions
|
@ -10,7 +10,9 @@ import {has, deep_copy} from 'utilities/object';
|
|||
|
||||
import {parse_path} from 'src/settings';
|
||||
|
||||
const EXCLUSIVE_CONTAINER = '.twilight-main,.twilight-minimal-root>div';
|
||||
const EXCLUSIVE_SELECTOR = '.twilight-main,.twilight-minimal-root>div',
|
||||
MAXIMIZED_SELECTOR = '.twilight-main,.twilight-minimal-root',
|
||||
SELECTOR = '.twilight-root>.tw-full-height,.twilight-minimal-root>.tw-full-height';
|
||||
|
||||
function format_term(term) {
|
||||
return term.replace(/<[^>]*>/g, '').toLocaleLowerCase();
|
||||
|
@ -97,7 +99,7 @@ export default class MainMenu extends Module {
|
|||
|
||||
|
||||
async onEnable(event) {
|
||||
await this.site.awaitElement(EXCLUSIVE_CONTAINER);
|
||||
await this.site.awaitElement(EXCLUSIVE_SELECTOR);
|
||||
|
||||
this.on('site.menu_button:clicked', this.toggleVisible);
|
||||
if ( this._visible ) {
|
||||
|
@ -115,13 +117,23 @@ export default class MainMenu extends Module {
|
|||
this.off('site.menu_button:clicked', this.toggleVisible);
|
||||
}
|
||||
|
||||
getContainer() {
|
||||
if ( this.exclusive )
|
||||
return document.querySelector(EXCLUSIVE_SELECTOR);
|
||||
|
||||
if ( this._maximized )
|
||||
return document.querySelector(MAXIMIZED_SELECTOR);
|
||||
|
||||
return document.querySelector(SELECTOR);
|
||||
}
|
||||
|
||||
toggleVisible(event) {
|
||||
if ( event && event.button !== 0 )
|
||||
return;
|
||||
|
||||
const maximized = this._maximized,
|
||||
visible = this._visible = !this._visible,
|
||||
main = this.exclusive ? document.querySelector(EXCLUSIVE_CONTAINER) : document.querySelector(maximized ? '.twilight-main' : '.twilight-root>.tw-full-height');
|
||||
main = this.getContainer();
|
||||
|
||||
if ( ! visible ) {
|
||||
if ( maximized )
|
||||
|
@ -150,7 +162,7 @@ export default class MainMenu extends Module {
|
|||
return;
|
||||
|
||||
const maximized = this._maximized = !this._maximized,
|
||||
main = this.exclusive ? document.querySelector(EXCLUSIVE_CONTAINER) : document.querySelector(maximized ? '.twilight-main' : '.twilight-root>.tw-full-height'),
|
||||
main = this.getContainer(),
|
||||
old_main = this._menu.parentElement;
|
||||
|
||||
if ( maximized )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue