From 3a3d0fc3d4733f8908e23a03f860d76340479ec4 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Tue, 11 Jun 2019 23:53:30 +0200 Subject: Reorganize Project structure --- .../src/js/modules/ui/components/router.js | 44 ---------------------- 1 file changed, 44 deletions(-) delete mode 100644 WebInterface/NodeJSServer/src/js/modules/ui/components/router.js (limited to 'WebInterface/NodeJSServer/src/js/modules/ui/components/router.js') diff --git a/WebInterface/NodeJSServer/src/js/modules/ui/components/router.js b/WebInterface/NodeJSServer/src/js/modules/ui/components/router.js deleted file mode 100644 index c01c21b..0000000 --- a/WebInterface/NodeJSServer/src/js/modules/ui/components/router.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Class for routing between pages - */ -export default class Router { - /** - * @param {Interface} iface Interface for comm. with other objects - */ - constructor(iface) { - iface.addObject(this, 'serverListing', ['routePlay']); - this.iface = iface; - } - - /** - * Routes to the play page - * @param {HubConnection} connection Connection to the server - */ - routePlay(connection) { - window.history.pushState('object or string', 'Game Page', - 'play#game=' + this.serverName); - fetch('play').then((response) => { - response.text().then((htmlString) => { - // Replace all references, since we're starting one level farther up - htmlString = htmlString.replace(/\.\.\//g, './'); - htmlString = /((.)|(\n))*<\/body>/g.exec(htmlString)[0]; - htmlString = htmlString.replace(/