/** * Silex, live web creation * http://projects.silexlabs.org/?/silex/ * * Copyright (c) 2012 Silex Labs * http://www.silexlabs.org/ * * Silex is available under the GPL license * http://www.silexlabs.org/silex/silex-licensing/ */ /** * @fileoverview Silex Dashboard / "new website" dialog which displays templates * */ import {FileInfo} from '../../types'; import {Model} from '../../types'; import {Controller} from '../../types'; import {ModalDialog} from '../ModalDialog'; import {TipOfTheDay} from '../tip-of-the-day'; /** * Silex Dashboard dialog * @class {silex.view.dialog.Dashboard} */ export class Dashboard { // define properties readyCbk: (() => any) = null; errorCbk: ((p1?: any) => any) = null; selected: {url: string, fileInfo: FileInfo} = null; // make this a dialog modalDialog: any; /** * flag set to 'success' when the template list is loaded * and set to 'error' when the loading failed */ state: string = ''; /** * @param element container to render the UI * @param model model class which holds * the model instances - views use it for * read operation only * @param controller structure which holds * the controller instances */ constructor(protected element: HTMLElement, protected model: Model, protected controller: Controller) { this.modalDialog = new ModalDialog({ name: 'Dashboard', element, onOpen: (args) => this.redraw(), onClose: () => {}, }); } /** * render the data loaded from github into a