Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 committed Sep 20, 2024
1 parent 76d174d commit 7ccbe0d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
24 changes: 9 additions & 15 deletions extensions/emoji/js/src/admin/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import app from 'flarum/admin/app';
import {version} from "../common/cdn";
import { version } from '../common/cdn';

app.initializers.add('flarum-emoji', () => {

app.extensionData
.for('flarum-emoji')

// add a cdn address to the settings page
.registerSetting({
setting: 'flarum-emoji.cdn',
type: 'text',
label: app.translator.trans('flarum-emoji.admin.settings.cdn_label'),
help: app.translator.trans('flarum-emoji.admin.settings.cdn_help', {
version: version
}),
})

app.extensionData.for('flarum-emoji').registerSetting({
setting: 'flarum-emoji.cdn',
type: 'text',
label: app.translator.trans('flarum-emoji.admin.settings.cdn_label'),
help: app.translator.trans('flarum-emoji.admin.settings.cdn_help', {
version: version,
}),
});
});
5 changes: 2 additions & 3 deletions extensions/emoji/js/src/common/cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ import twemoji from 'twemoji';
export const version = /([0-9]+).[0-9]+.[0-9]+/g.exec(twemoji.base)[1];

export default function () {
return app.forum.attribute('flarum-emoji.cdn')
.replace('[version]', version)
};
return app.forum.attribute('flarum-emoji.cdn').replace('[version]', version);
}
2 changes: 1 addition & 1 deletion extensions/emoji/js/src/forum/renderEmoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function options() {
attributes: () => ({
loading: 'lazy',
}),
}
};
}

/**
Expand Down

0 comments on commit 7ccbe0d

Please sign in to comment.