Can anyone help me regarding below the onclick is frontend function not backend so its not showing in the source and when i click on it nothing happens, So how can I add that onclick in that button, I mean like button <button onclick= "imageGUI()">Content</button>
import { extend } from 'flarum/common/extend';
import app from 'flarum/common/app';
import TextEditor from 'flarum/common/components/TextEditor';
app.initializers.add('ramesh-dada/flarum-gui-image-and-link', () => {
extend(TextEditor.prototype, 'toolbarItems', function (items) {
items.add(
'ramesh-dada-premium-imagegui',
m(
'Tooltip',
{
text: app.translator.trans('ramesh.imageGUI'),
},
[
m('button',
{
type: 'buton',
class: 'Button Button--icon Button--link hasIcon GuiImage',
title: app.translator.trans('ramesh.imageGUI'),
onclick: 'imageGUI()'
}),
],
[ m('i', { class: 'fas fa-image' }),],
[ m('span', { class: 'Button-label' }, app.translator.trans('ramesh.imageGUI')), ]
),
4
);
});
extend(TextEditor.prototype, 'toolbarItems', function (items) {
items.add(
'ramesh-dada-premium-linkgui',
m(
'Tooltip',
{
text: app.translator.trans('ramesh.linkGUI'),
},
[
m('button',
{
type: 'buton',
class: 'Button Button--icon Button--link hasIcon GuiImage',
title: app.translator.trans('ramesh.linkGUI'),
onclick: 'linkGUI()'
}),
],
[ m('i', { class: 'fas fa-link' }),],
[ m('span', { class: 'Button-label' }, app.translator.trans('ramesh.linkGUI')), ]
),
5
);
});
});
and also Tooltip is showing as html
which is ultra bad
please help me regarding this