Anton Shestakov <av6@dwimlabs.net>, Thu, 07 Jul 2016 00:12:35 +0800
provision: update tasks to use more YAMLy syntax
js/register.js
Permissions: -rw-r--r--
// Generated by CoffeeScript 1.10.0 var cancelfn, registerfn, savefn; window.clientState = new Tram.ClientState(); window.progressApp = new Tram.ProgressApp({ el: $('[data-app="progress"]'), window.regForm = new Tram.RegistrationForm(); window.profileForm = new Tram.ProfileForm(); registerfn = function() { clientState.set('progress', 0); return X.register(regForm.get('username').trim(), regForm.get('password1')); var data, failcb, file, okcb, reader; if (!profileForm.isValid()) { fullname: profileForm.get('fullname').trim(), nickname: profileForm.get('nickname').trim() clientState.set('progress', 100); $('[data-step="profile"]').addClass('uk-hidden'); return location.href = '/'; clientState.unset('progress'); console.warn('profile is NOT set!', arguments); return $('[data-msg="save-failed"]').removeClass('uk-hidden'); file = $('#avatar').get(0).files[0]; reader = new FileReader(); reader.onloadend = function() { clientState.set('progress', 0); return X.savevCard(data, okcb, failcb); return reader.readAsDataURL(file); clientState.set('progress', 0); return X.savevCard(data, okcb, failcb); window.regRivet = rivets.bind($('[data-form="registration"]'), { window.profileRivet = rivets.bind($('[data-form="profile"]'), { window.X = new Tram.XMPPInterface(); X.on('register', function() { return $('[data-step="registration"]').removeClass('uk-hidden'); X.on('registered', function() { return $('[data-step="registration"]').addClass('uk-hidden'); X.on('regifail', function() { return $('[data-msg="registration-closed"]').removeClass('uk-hidden'); X.on('conflict', function() { return regForm.set('username-errors', ['A user with this username already exists.']); X.on('notacceptable', function() { return $('[data-msg="registration-failed"]').removeClass('uk-hidden'); X.on('connected', function() { profileForm.set('nickname', regForm.get('username').trim()); $('[data-step="profile"]').removeClass('uk-hidden'); return $('#fullname').focus(); X.on('disconnected', function() { return location.reload(); X.on('status', function(status) { case Strophe.Status.REGISTERED: return clientState.set('progress', 50); case Strophe.Status.CONNECTED: return clientState.set('progress', 100); return clientState.unset('progress'); $('[data-form="registration"], [data-form="profile"]').streamline(); //# sourceMappingURL=register.js.map