import { FastClick } from "./lib/fastclick" import { ComposerEntryPage } from "./view/composerEntryPage" import { browserHashService } from "./service/browserHashService" import * as Settings from "./settings" import { FileChangeNotificationService } from "./service/fileChangeNotificationService" import { TestResourceMaintainer } from "./service/testResourceMaintainer" export class Application { constructor() { } public fileChangeNotificationService public testResourceMaintainer initialize() { // Solve mobile problem FastClick.attach(document.body); let hash = window.location.hash let widget: string let path = `${window.location.protocol}//${window.location.host}` path = path.replace("http", "ws") this.fileChangeNotificationService = new FileChangeNotificationService(path) this.testResourceMaintainer = new TestResourceMaintainer() setTimeout(() => { browserHashService.syncFromHash(hash) let composerEntryPage: ComposerEntryPage if (browserHashService.has("path")) { widget = browserHashService.get("path") composerEntryPage = new ComposerEntryPage(widget) // composerEntryPage.preview(widget) } else { composerEntryPage = new ComposerEntryPage() } composerEntryPage.appendTo(document.body) }, 100) } } export const App = new Application()