{"size": 2337, "ext": "js", "max_stars_repo_path": "plugins/thirdparty/html.widgets.js", "max_stars_repo_name": "DeanCording/freeboard", "max_stars_repo_stars_event_min_datetime": "2021-08-03T21:49:11.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-03T21:49:11.000Z", "max_issues_repo_path": "plugins/thirdparty/html.widgets.js", "max_issues_repo_name": "DeanCording/freeboard", "max_issues_repo_issues_event_min_datetime": "2017-10-07T12:36:05.000Z", "max_issues_repo_issues_event_max_datetime": "2017-10-12T01:40:25.000Z", "max_forks_repo_path": "plugins/thirdparty/html.widgets.js", "max_forks_repo_name": "DeanCording/freeboard", "max_forks_repo_forks_event_min_datetime": "2021-05-27T09:48:06.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-27T09:48:06.000Z"}
{"max_stars_count": 1, "max_issues_count": 3, "max_forks_count": 1, "avg_line_length": 34.3676470588, "max_line_length": 87, "alphanum_fraction": 0.406504065}
// ┌────────────────────────────────────────────────────────────────────┐ \\
// │ F R E E B O A R D                                                  │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Copyright © 2013 Jim Heising (https://github.com/jheising)         │ \\
// │ Copyright © 2013 Bug Labs, Inc. (http://buglabs.net)               │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Licensed under the MIT license.                                    │ \\
// └────────────────────────────────────────────────────────────────────┘ \\

(function () {

    freeboard.addStyle('.html-widget', "white-space:normal;width:100%;height:100%");

    var htmlWidget = function (settings) {
        var self = this;
        var htmlElement = $('<div class="html-widget"></div>');
        var currentSettings = settings;

        this.render = function (element) {
            $(element).append(htmlElement);
        };

        this.onSettingsChanged = function (newSettings) {
            currentSettings = newSettings;
        };

        this.onCalculatedValueChanged = function (settingName, newValue) {
            if (settingName == "html") {
                htmlElement.html(newValue);
            }
        };

        this.onDispose = function () {
        };

        this.getHeight = function () {
            return Number(currentSettings.height);
        };

        this.onSettingsChanged(settings);
    };

    freeboard.loadWidgetPlugin({
        "type_name": "html",
        "display_name": "HTML",
        "fill_size": true,
        "settings": [
            {
                "name": "html",
                "display_name": "HTML",
                "type": "calculated",
                "description": "Can be literal HTML, or javascript that outputs HTML."
            },
            {
                "name": "height",
                "display_name": "Height Blocks",
                "type": "number",
                "default_value": 4,
                "description": "A height block is around 60 pixels"
            }
        ],
        newInstance: function (settings, newInstanceCallback) {
            newInstanceCallback(new htmlWidget(settings));
        }
    });

}());
