Skip to content
Permalink
Browse files

Starting to switch to angular.

  • Loading branch information...
roncli committed Jun 26, 2015
1 parent f4af783 commit 8d8e43ebffedc17d765cbfe79dfcd669a0d3dd02
@@ -1,17 +1,17 @@
<html>
<html ng-app="ddsn">
<head>
<script src="/js/jquery-2.1.4.min.js"></script>
<script src="/js/bootstrap-3.3.5.min.js"></script>
<script src="/js/handlebars-3.0.3.min.js"></script>
<script src="/js/angular-1.3.16.min.js"></script>
<script src="/js/ddsn.js"></script>
<link rel="stylesheet" href="/css/bootstrap-slate-3.3.5.min.css" />
</head>
<body>
<body ng-controller="ddsn">
<div class="jumbotron text-center">
<h1>Descent DSN</h1>
</div>
<div id="content">
<ul id="server-tabs" class="nav nav-pills"></ul>
<server-tabs></server-tabs>
<ul id="menu-tabs" class="nav nav-pills"></ul>
<div id="feature"></div>
</div>

Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
/*jslint browser: true*/
/*global $, WebSocket*/
/*global $, WebSocket, angular*/

var createWebsocketClient = function() {
"use strict";
@@ -39,3 +39,30 @@ $(document).ready(function() {

createWebsocketClient();
});

// Set up Angular application.
var app = angular.module("ddsn", []);

app.directive("serverTabs", function() {
"use strict";

return {
restrict: "E",
templateUrl: "/templates/server-tabs.htm"
};
});

app.controller("ddsn", ["$scope", function($scope) {
"use strict";

$scope.servers = [
{
gameName: "Descent 3 Dedicated Server",
port: 2092
},
{
gameName: "Descent 3 Dedicated Server",
port: 2093
}
];
}]);

This file was deleted.

This file was deleted.

This file was deleted.

@@ -0,0 +1,17 @@
<ul class="nav nav-pills">
<li role="presentation">
<button id="news" class="btn btn-primary"><span class="glyphicon glyphicon-home"></span> News</button>
</li>
<li role="presentation">
<button id="dashboard" class="btn btn-primary"><span class="glyphicon glyphicon-dashboard"></span> Dashboard</button>
</li>
<li role="presentation" ng-repeat="server in servers">
<button class="btn btn-primary server" data-id="{{server.port}}">{{server.gameName}} <span class="glyphicon glyphicon-arrow-right"></span> {{server.port}}</button>
</li>
<li role="presentation">
<button id="addserver" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Add Server</button>
</li>
<li role="presentation">
<button id="settings" class="btn btn-primary"><span class="glyphicon glyphicon-cog"></span> Settings</button>
</li>
</ul>
@@ -22,7 +22,7 @@ module.exports = function() {
});

// Allow for static content in the public directory.
app.use(express.static("public"));
app.use(express.static("public", {index: "index.htm"}));

// Force quit Descent DSN entirely.
app.get("/quit", function(req, res) {

0 comments on commit 8d8e43e

Please sign in to comment.
You can’t perform that action at this time.