Newer
Older
alert / js / src / admin / index.js
@Réz István Réz István on 19 Nov 2021 1 KB rc2
/*
 * This file is part of justoverclock/custom-html-widget
 *
 * Copyright (c) 2021 Marco Colia.
 * https://flarum.it
 *
 * For the full copyright and license information, please view the LICENSE.md
 * file that was distributed with this source code.
 */

import registerWidget from '../common/registerWidget';
import app from 'flarum/admin/app';

app.initializers.add('ubuntuhu/alert', () => {
    registerWidget(app);
    app.extensionData
      .for('ubuntuhu-alert')
      .registerSetting(function () {
        const warningMessage = app.translator.trans('ubuntuhu-alert.admin.warningmessage');
        const warnintTitle = app.translator.trans('ubuntuhu-alert.admin.warningtext');
        //fine anteprima in tempo reale
        return (
            <div className="Form-group settingscustomhtmlalert">
                <label>{warnintTitle}</label>
                <aside class="customhtmlwarningalert">{warningMessage}</aside>
              <div class="textandprwalert">
                <textarea id="htmltext1" className="FormControl customhtmlboxalert" bidi={this.setting('ubuntuhu-alert.customCode')}/>
              </div>
              </div>
        );
    });
});