--- a/coffee/index.coffee Mon Mar 21 15:47:51 2016 +0800
+++ b/coffee/index.coffee Mon Mar 21 19:50:21 2016 +0800
$('[data-step="login"]').removeClass('uk-hidden')
+ $('[data-step="main"]').addClass('uk-hidden')
X.on 'connected attached', ->
$('[data-step="login"]').addClass('uk-hidden')
+ $('[data-step="main"]').removeClass('uk-hidden')
+$('button[data-disconnect]').on 'click', ->
+ X.disconnect('Logged out')
$form = $('[data-form="connect"]')
--- a/index.html Mon Mar 21 15:47:51 2016 +0800
+++ b/index.html Mon Mar 21 19:50:21 2016 +0800
$('[data-step="noscript"]').addClass('uk-hidden');
$('[data-step="login"]').removeClass('uk-hidden');
+ <div class="uk-hidden" data-step="main">
+ <button type="button" class="uk-button" data-disconnect>
+ <i class="uk-icon-sign-out"></i> Log out
<script src='/js/tram.js'></script>
<script src='/js/validation.js'></script>
<script src='/js/xmpp.js'></script>
--- a/js/index.js Mon Mar 21 15:47:51 2016 +0800
+++ b/js/index.js Mon Mar 21 19:50:21 2016 +0800
X.on('disconnected', function() {
- return $('[data-step="login"]').removeClass('uk-hidden');
+ $('[data-step="login"]').removeClass('uk-hidden');
+ return $('[data-step="main"]').addClass('uk-hidden');
X.on('connected attached', function() {
- return $('[data-step="login"]').addClass('uk-hidden');
+ $('[data-step="login"]').addClass('uk-hidden');
+ return $('[data-step="main"]').removeClass('uk-hidden');
+ $('button[data-disconnect]').on('click', function() {
+ return X.disconnect('Logged out');
$form = $('[data-form="connect"]');
--- a/js/index.js.map Mon Mar 21 15:47:51 2016 +0800
+++ b/js/index.js.map Mon Mar 21 19:50:21 2016 +0800
- "mappings": ";AAAA;AAAA,MAAA;;EAAA,MAAM,CAAC,CAAP,GAAe,IAAA,IAAI,CAAC,aAAL,CAAA;;EAGf,CAAC,CAAC,EAAF,CAAK,YAAL,EAAmB,SAAA;WACjB,CAAA,CAAE,kBAAF,CAAqB,CAAC,QAAtB,CAA+B,WAA/B;EADiB,CAAnB;;EAIA,CAAC,CAAC,EAAF,CA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