--- a/coffee/register.coffee Sat Apr 09 17:27:10 2016 +0800
+++ b/coffee/register.coffee Sat Apr 09 17:37:12 2016 +0800
X.savevCard(data, okcb, failcb)
window.regRivet = rivets.bind($('[data-form="registration"]'), data: regData, register: registerfn)
-window.vcRivet = rivets.bind($('[data-form="vcard"]'), data: vcData, save: savefn)
+window.vcRivet = rivets.bind($('[data-form="vcard"]'), data: vcData, save: savefn, cancel: cancelfn)
window.X = new Tram.XMPPInterface()
X.on 'status', (status) ->
when Strophe.Status.REGISTERED
--- a/js/register.js Sat Apr 09 17:27:10 2016 +0800
+++ b/js/register.js Sat Apr 09 17:37:12 2016 +0800
// Generated by CoffeeScript 1.10.0
- var ProfileData, RegistrationData, registerfn, savefn,
+ var ProfileData, RegistrationData, cancelfn, registerfn, savefn,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
+ cancelfn = function() {
window.regRivet = rivets.bind($('[data-form="registration"]'), {
window.vcRivet = rivets.bind($('[data-form="vcard"]'), {
window.X = new Tram.XMPPInterface();
return $('#fullname').focus();
+ X.on('disconnected', function() {
+ return location.reload();
X.on('status', function(status) {
case Strophe.Status.REGISTERED:
--- a/js/register.js.map Sat Apr 09 17:27:10 2016 +0800
+++ b/js/register.js.map Sat Apr 09 17:37:12 2016 +0800
- "mappings": ";AAAA;AAAA,MAAA,iDAAA;IAAA;;;EAAA,MAAM,CAAC,WAAP,GAAyB,IAAA,IAAI,CAAC,WAAL,CAAA;;EACzB,MAAM,CAAC,WAAP,GAAyB,IAAA,IAAI,CAAC,WAAL,CAAiB;IAAA,EAAA,EAAI,CAAA,CAAE,uBAAF,CAAJ;IAAgC,KAAA,EAAO,WAAvC;GAAjB;;EAGnB;;;;;;;+BACJ,QAAA,GACE;MAAA,QAAA,EAAU,EAAV;MACA,SAAA,EAAW,EADX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AAmB,CAAC,EAApB,CAAuB,SAAvB,EAAkC,SAAC,CAAD;AAChC,UAAA;MAAA,IAAG,CAAC,CAAI,IAAC,CAAA,QAAL,IAAiB,IAAC,CAAA,KAAD,KAAY,EAA9B,CAAA,IAAsC,CAAC,CAAC,OAAF,KAAa,EAAtD;QACE,CAAC,CAAC,cAAF,CAAA;QACA,KAAA,GAAQ,KAAK,CAAC,IAAN,CAAW,OAAX,CAAmB,CAAC,KAApB,CAA0B,IAA1B;QACR,KAAA,GAAQ,KAAK,CAAC,IAAN,CAAW,OAAX,CAAmB,CAAC,EAApB,CAAuB,KAAA,GAAQ,CAA/B;QACR,IAAG,KAAK,CAAC,MAAN,KAAkB,CAArB;iBACE,KAAK,CAAC,KAAN,CAAA,EADF;SAAA,MAAA;iBAGE,KAAK,CAAC,IAAN,CAAW,QAAX,CAAoB,CAAC,OAArB,CAA6B,OAA7B,EAHF;SAJF;;IADgC,CAAlC;EAFwD,CAA1D;AA9HA"
\ No newline at end of file
--- a/register.html Sat Apr 09 17:27:10 2016 +0800
+++ b/register.html Sat Apr 09 17:37:12 2016 +0800
<div class="uk-form-row">
<div class="uk-form-controls">
<button class="uk-button uk-button-primary" rv-on-click="save">Save</button>
+ <button class="uk-button uk-button-danger uk-float-right" rv-on-click="cancel">Cancel registration</button>