View layer for the Brazen userscripts framework
Detta skript bör inte installeras direkt. Det är ett bibliotek för andra skript att inkludera med meta-direktivet // @require https://update.sleazyfork.org/scripts/416104/1847284/Brazen%20Framework%20-%20View%20Layer.js
Shared settings panel UI: #bv-ui, tabs, form controls, modals, bookmarks panel, compliance statistics widgets.
Greasy Fork: View Layer · Requires: Utilities · Used by: Configuration Manager, Framework core
Styles are inlined at runtime via GM_addStyle (source CSS ships with the module).
BrazenFramework exposes this._uiGen (a BrazenViewLayer instance). You compose this._userInterface from its factory methods; the framework embeds the panel unless _disableUI is set (e.g. headless auto-download on certain page types).
Requires @grant GM_addStyle on the View Layer script or the app.
Typical layout:
createSettingsSection()
└── createTabsSection([tab names], [tab panels])
└── createTabPanel('Filters', isDefault).append([...fields...])
createBottomSection([statistics, separators, page buttons, Apply/Save/Reset])
Common building blocks:
| Factory | Use |
|---|---|
createTitle(text) |
Section heading inside a tab |
createSeparator() / createBreakSeparator() |
Horizontal rules |
createFormActions(buttons, layout?) |
Button row or column |
createStatisticsFormGroup(configKey) |
Filter removal count |
createModal(title) |
Dialog shell |
Tab switches call userScript._configurationManager.updateInterface() — set getSelectedSection()[0].userScript = this in _onAfterUIBuild if custom widgets need the app instance.
let modal = this._uiGen.createModal('Active hide rules')
this._uiGen.showModal(modal)
this._uiGen.hideModal(modal)
Compliance rule modal uses .bv-compliance-rule-* row classes.
BrazenViewLayer.createBookmarksPanel(fieldKey, options) — list UI for addBookmarksField. Options include pageMatch for star state on current URL. Persistence is usually app-side (GM_setValue), not config backup.
enhanceTagSidebarCounts(container, slotBuilder) — injects hover action slots next to tag counts (bookmark / ignore / blacklist buttons on tag sidebar rows).
Apps often pass site-specific overrides through GM_addStyle in the app script. Keep structural classes (#bv-ui, .bv-tab-panel, .bv-group) so Configuration Manager bindings still align.
Optional #bv-resizer handle for panel width — patch drag in _onAfterUIBuild if needed (not enabled by default).