Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Commit 14b3ea8

Browse files
committed
first pass of client skeleton.
1 parent 313938b commit 14b3ea8

7 files changed

Lines changed: 1105 additions & 3 deletions

File tree

‎client/.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
css
2+
js

‎client/client.js‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
var gui = require('nw.gui')
2+
, moment = require('moment')
3+
4+
function startSpinner() { $('#bottom-menu-spinner').fadeIn(1500); }
5+
function stopSpinner() { $('#bottom-menu-spinner').fadeOut(1500); }
6+
7+
function pollClipboard() {
8+
startSpinner();
9+
setTimeout(function() {
10+
var cb = gui.Clipboard.get();
11+
var clipboard = document.getElementById('clipboard')
12+
var event = {'type': 'report', 'time': moment().utc().format('HH:mm:ss'), 'text': cb.get('text')};
13+
14+
var renderedEvent = $(Templates.event(event))
15+
$('#clipboard').prepend(renderedEvent);
16+
stopSpinner();
17+
18+
pollClipboard();
19+
}, 10000);
20+
}
21+
22+
window.onload = function() {
23+
stopSpinner();
24+
pollClipboard();
25+
gui.Window.get().show();
26+
}

‎client/index.html‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<meta name="language" content="en" />
6+
<link type="text/css" rel="stylesheet" media="screen" href="https://fonts.googleapis.com/css?family=Lato:900|Droid+Sans+Mono">
7+
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
8+
<link rel="stylesheet" type="text/css" href="style.css" />
9+
<title>Standing Fleet Client</title>
10+
<script src="js/lib.js"></script>
11+
<script src="js/templates.js"></script>
12+
<script src="client.js"></script>
13+
</head>
14+
<body>
15+
<div id="page">
16+
<!-- <div id="dim"></div> -->
17+
<div id="top-bar">
18+
<span id="current-system">Standing Fleet</span>
19+
<div class="sub-bar right" id="top-menu">
20+
<div class="menu-button hostiles" id="top-menu-hostiles">
21+
<i class="fa fa-exclamation-triangle"></i> <span>CLIPBOARD</span>
22+
</div>
23+
<div class="menu-button events" id="top-menu-events">
24+
<i class="fa fa-bell"></i> <span>LOGS</span>
25+
</div>
26+
</div>
27+
</div>
28+
<div id="content-wrapper">
29+
<div id="clipboard" class="main-content active"></div>
30+
<div id="logs" class="main-content"><div class="list"></div></div>
31+
</div>
32+
<div id="bottom-bar">
33+
<div class="sub-bar left" id="broadcast">
34+
</div>
35+
36+
<div class="sub-bar right" id="bottom-menu">
37+
<div class="menu-button" id="bottom-menu-spinner">
38+
<img src="spinner.gif" alt="Processing..." />
39+
</div>
40+
<div class="menu-button" id="bottom-menu-menu">
41+
<i class="fa fa-cog"></i> <span>MENU</span>
42+
</div>
43+
</div>
44+
</div>
45+
</div>
46+
<div id="alert-container"></div>
47+
</body>
48+
</html>

‎client/package.json‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "standing-fleet-client",
3+
"description": "Intelligence visualized",
4+
"version": "0.0.1",
5+
"main": "index.html",
6+
"window": {
7+
"show": false,
8+
"toolbar": false,
9+
"frame": false,
10+
"position": "center",
11+
"width": 360,
12+
"height": 300,
13+
"min_width": 220,
14+
"min_height": 220
15+
},
16+
"dependencies": {
17+
"moment": "^2.8.3"
18+
}
19+
}

‎client/spinner.gif‎

25.8 KB
Loading

0 commit comments

Comments
 (0)