1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-12-23 16:18:48 -05:00

Add 'connecting' indicator on first load.

This commit is contained in:
Lance Stout 2013-09-11 23:53:35 -07:00
parent 49d5f8e692
commit 48cc126bac
7 changed files with 22 additions and 8 deletions

10
clientapp/template.html Normal file
View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="#{cssFileName}" />
<script src="#{jsFileName}"></script>
</head>
<body>
<p>Connecting</p>
</body>
</html>

View File

@ -12,7 +12,7 @@ exports.pages = {};
exports.body = function anonymous(locals) {
var buf = [];
with (locals || {}) {
buf.push('<body><div class="wrap"><div id="reconnect"></div><header id="me"><img class="avatar"/><p class="status"></p></header><nav class="main"><li><a href="/logout">Logout</a></li><li><a href="/">Home</a></li></nav><nav id="contactList"></nav><section id="pages"></section><footer></footer></div></body>');
buf.push('<body><div class="wrap"><aside id="connectionStatus"><button class="reconnect">Reconnect</button><span class="message">disconnected</span></aside><div id="connectionOverlay"></div><header id="me"><img class="avatar"/><p class="status"></p></header><nav class="main"><li><a href="/logout">Logout</a></li><li><a href="/">Home</a></li></nav><nav id="contactList"></nav><section id="pages"></section><footer></footer></div></body>');
}
return buf.join("");
};
@ -71,7 +71,7 @@ exports.pages.chat = function anonymous(locals) {
exports.pages.main = function anonymous(locals) {
var buf = [];
with (locals || {}) {
buf.push('<section class="page main"></section>');
buf.push('<section class="page main"><p>This space intentionally left blank.</p></section>');
}
return buf.join("");
};

View File

@ -1,6 +1,9 @@
body
.wrap
#reconnect
aside#connectionStatus
button.reconnect Reconnect
span.message disconnected
#connectionOverlay
header#me
img.avatar
p.status

View File

@ -1 +1,2 @@
section.page.main
p This space intentionally left blank.

View File

@ -12,7 +12,7 @@ module.exports = HumanView.extend({
'click a[href]': 'handleLinkClick'
},
classBindings: {
connected: '#reconnect'
connected: '#connectionOverlay'
},
render: function () {
$('head').append(templates.head());

View File

@ -15,9 +15,8 @@ html, body {
padding: 5px;
}
#reconnect {
#connectionOverlay {
z-index: 5000;
position: absolute;
left: 0px;
top: 0px;
height: 100%;
@ -25,7 +24,7 @@ html, body {
background-color: rgba(0, 0, 0, .5);
}
#reconnect.connected {
#connectionOverlay {
display: none;
}
@ -195,7 +194,7 @@ nav.main a {
overflow-x: hidden;
position: relative;
margin-top: 50px;
padding-top: 50px;
padding-top: 30px;
bottom: 50px;
}

View File

@ -19,6 +19,7 @@ app.use(helmet.contentTypeOptions());
var clientApp = new Moonboots({
main: __dirname + '/clientapp/app.js',
templateFile: __dirname + '/clientapp/template.html',
developmentMode: config.isDev,
libraries: [
__dirname + '/clientapp/libraries/zepto.js',