var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/************************************************
Blank Space Gadget
************************************************/
var Dashboards;
(function (Dashboards) {
    var Models;
    (function (Models) {
        var BlankSpaceGadget = (function (_super) {
            __extends(BlankSpaceGadget, _super);
            function BlankSpaceGadget(gadgetOptions) {
                gadgetOptions.renderer = new Dashboards.Views.BlankSpaceRender();
                _super.call(this, gadgetOptions);
            }
            BlankSpaceGadget.CreateInstance = function (gadgetOptions) {
                var instance = new BlankSpaceGadget(gadgetOptions);
                return instance;
            };
            // Always seems configured
            BlankSpaceGadget.prototype.isConfigured = function () {
                return true;
            };
            BlankSpaceGadget.CreateNewBlankSpaceGadgetConfiguration = function () {
                var newId = Guid.newGuid();
                var newConfig = {
                    GadgetInstanceId: newId,
                    GadgetId: BlankSpaceGadget.TypeId,
                    Position: 1,
                    IsConfigured: true,
                    DataUri: "http://localhost/SystemDataService/Gadget/Data/" + newId,
                    SetupItems: [Settings.Gadget.GetNewHiddenSetting("Blank Space Gadget")]
                };
                return newConfig;
            };
            BlankSpaceGadget.TypeId = "59579095-f7fa-4d31-8735-f24ce9da9a62";
            return BlankSpaceGadget;
        }(Models.Gadget));
        Models.BlankSpaceGadget = BlankSpaceGadget;
    })(Models = Dashboards.Models || (Dashboards.Models = {}));
})(Dashboards || (Dashboards = {}));
var Dashboards;
(function (Dashboards) {
    var Views;
    (function (Views) {
        var BlankSpaceRender = (function (_super) {
            __extends(BlankSpaceRender, _super);
            function BlankSpaceRender() {
                _super.call(this);
                this.requiresTitle = false;
            }
            /* Gadget Render Implementation
            **************************************************************************/
            BlankSpaceRender.prototype.render = function () {
                this.gadget.gadgetInitialized = true;
                this.refresh();
            };
            // Render the gadget into the container. Note that the gadget has no data yet.
            BlankSpaceRender.prototype.refresh = function () {
                // Remove default status text class
                Dashboards.Views.Gadget.RemoveStatusMessage(this.$gadgetProper);
                var $gadgetAreaCap = this.$gadgetContent.find('.' + Dashboards.Views.Gadget.GadgetAreaCapClass);
                if (this.gadget.viewMode == Dashboards.Models.Application.ViewMode.Setup) {
                    // Show the wrapper, header and areaCap.  
                    this.$gadgetContent.css('border', '');
                    this.$gadgetContent.css('background-color', '');
                    $gadgetAreaCap.show();
                    this.$gadgetHeader.show();
                    // Add placehold text.
                    Dashboards.Views.Gadget.RenderStatusMessage(this.$gadgetProper, i18n.loc.unencoded('Gadgets', 'BlankSpaceGadgetControl_PlaceholderText'));
                }
                else {
                    // Hide the wrapper, header and areaCap.
                    this.$gadgetContent.css('border', 'none');
                    this.$gadgetContent.css('background-color', 'transparent');
                    $gadgetAreaCap.hide();
                    this.$gadgetHeader.hide();
                }
            };
            return BlankSpaceRender;
        }(Views.Gadget));
        Views.BlankSpaceRender = BlankSpaceRender;
    })(Views = Dashboards.Views || (Dashboards.Views = {}));
})(Dashboards || (Dashboards = {}));
// Register the gadget type
Dashboards.Controllers.GadgetType.RegisterDefinition({
    typeId: Dashboards.Models.BlankSpaceGadget.TypeId,
    create: Dashboards.Models.BlankSpaceGadget.CreateInstance,
    resourceSet: 'Gadgets'
});
//# sourceMappingURL=BlankSpaceGadget.js.map