Newer
Older
alert / js / src / common / components / CustomHtmlAlertWidget.js
@Réz István Réz István on 19 Nov 2021 908 bytes 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 app from 'flarum/forum/app';
import Widget from 'flarum/extensions/afrux-forum-widgets-core/common/components/Widget';

export default class LastTweetWidget extends Widget {
    oncreate(vnode) {
        document.getElementById('wghtml1').innerHTML = '<div class="ubuntuhu-alertWidget-icon"><i aria-hidden="true" class="icon fas fa-bullhorn "></i></div>' + app.forum.attribute('ubuntuhu-alert.customCode');
    }

    className() {
        return 'custom-html-alert-widget';
    }

    icon() {
        // Widget icon.
        return 'far fa-file-code';
    }

    content() {
        return <div class="htmlwidget" id="wghtml1"></div>;
    }
}