mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
refactor: unify frontend initializers naming (#4003)
* refactor: use consistent naming for frontend initializers * refactor: use arrow functions for frontend initializers
This commit is contained in:
@@ -2,7 +2,7 @@ import app from 'flarum/admin/app';
|
|||||||
|
|
||||||
export { default as extend } from './extend';
|
export { default as extend } from './extend';
|
||||||
|
|
||||||
app.initializers.add('lock', () => {
|
app.initializers.add('flarum-lock', () => {
|
||||||
app.extensionData.for('flarum-lock').registerPermission(
|
app.extensionData.for('flarum-lock').registerPermission(
|
||||||
{
|
{
|
||||||
icon: 'fas fa-lock',
|
icon: 'fas fa-lock',
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import app from 'flarum/admin/app';
|
import app from 'flarum/admin/app';
|
||||||
|
|
||||||
app.initializers.add('flarum-mentions', function () {
|
app.initializers.add('flarum-mentions', () => {
|
||||||
app.extensionData
|
app.extensionData
|
||||||
.for('flarum-mentions')
|
.for('flarum-mentions')
|
||||||
.registerSetting({
|
.registerSetting({
|
||||||
|
@@ -17,7 +17,7 @@ app.mentionFormats = new MentionFormats();
|
|||||||
|
|
||||||
export { default as extend } from './extend';
|
export { default as extend } from './extend';
|
||||||
|
|
||||||
app.initializers.add('flarum-mentions', function () {
|
app.initializers.add('flarum-mentions', () => {
|
||||||
// For every mention of a post inside a post's content, set up a hover handler
|
// For every mention of a post inside a post's content, set up a hover handler
|
||||||
// that shows a preview of the mentioned post.
|
// that shows a preview of the mentioned post.
|
||||||
addPostMentionPreviews();
|
addPostMentionPreviews();
|
||||||
|
@@ -5,7 +5,7 @@ import BasicsPage from 'flarum/admin/components/BasicsPage';
|
|||||||
import extractText from 'flarum/common/utils/extractText';
|
import extractText from 'flarum/common/utils/extractText';
|
||||||
import { extend } from 'flarum/common/extend';
|
import { extend } from 'flarum/common/extend';
|
||||||
|
|
||||||
app.initializers.add('flarum/nicknames', () => {
|
app.initializers.add('flarum-nicknames', () => {
|
||||||
app.extensionData
|
app.extensionData
|
||||||
.for('flarum-nicknames')
|
.for('flarum-nicknames')
|
||||||
.registerSetting(function () {
|
.registerSetting(function () {
|
||||||
|
@@ -7,7 +7,7 @@ import NickNameModal from './components/NicknameModal';
|
|||||||
|
|
||||||
export { default as extend } from './extend';
|
export { default as extend } from './extend';
|
||||||
|
|
||||||
app.initializers.add('flarum/nicknames', () => {
|
app.initializers.add('flarum-nicknames', () => {
|
||||||
extend('flarum/forum/components/SettingsPage', 'accountItems', function (items) {
|
extend('flarum/forum/components/SettingsPage', 'accountItems', function (items) {
|
||||||
if (app.forum.attribute('displayNameDriver') !== 'nickname') return;
|
if (app.forum.attribute('displayNameDriver') !== 'nickname') return;
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@ import addSubscriptionSettings from './addSubscriptionSettings';
|
|||||||
|
|
||||||
export { default as extend } from './extend';
|
export { default as extend } from './extend';
|
||||||
|
|
||||||
app.initializers.add('subscriptions', function () {
|
app.initializers.add('flarum-subscriptions', () => {
|
||||||
addSubscriptionBadge();
|
addSubscriptionBadge();
|
||||||
addSubscriptionControls();
|
addSubscriptionControls();
|
||||||
addSubscriptionFilter();
|
addSubscriptionFilter();
|
||||||
|
@@ -10,7 +10,7 @@ import addTagComposer from './addTagComposer';
|
|||||||
|
|
||||||
export { default as extend } from './extend';
|
export { default as extend } from './extend';
|
||||||
|
|
||||||
app.initializers.add('flarum-tags', function () {
|
app.initializers.add('flarum-tags', () => {
|
||||||
app.tagList = new TagListState();
|
app.tagList = new TagListState();
|
||||||
|
|
||||||
addTagList();
|
addTagList();
|
||||||
|
Reference in New Issue
Block a user