--- a/coffee/register.coffee Sun Mar 20 11:43:20 2016 +0800
+++ b/coffee/register.coffee Sun Mar 20 11:48:13 2016 +0800
$('#register').on 'click', ->
- validation.unsetError($('#username, #password1, #password2'))
- ok &= validation.validateRequired($('#username'), true)
- ok &= validation.validatePasswords($('#password1'), $('#password2'))
- ok &= validation.validateRequired($('#password1'))
- ok &= validation.validateRequired($('#password2'))
+ Tram.validation.unsetError($('#username, #password1, #password2'))
+ ok &= Tram.validation.validateRequired($('#username'), true)
+ ok &= Tram.validation.validatePasswords($('#password1'), $('#password2'))
+ ok &= Tram.validation.validateRequired($('#password1'))
+ ok &= Tram.validation.validateRequired($('#password2'))
R.register $('#username').val().trim(), $('#password1').val()
- validation.setError $('#username'), 'A user with this username already exists.'
+ Tram.validation.setError $('#username'), 'A user with this username already exists.'
--- a/coffee/ui/validation.coffee Sun Mar 20 11:43:20 2016 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
- setError: ($field, message) ->
- $el = $('<div class="uk-text-danger"></div>').text(message)
- $field.addClass('uk-form-danger')
- unsetError: ($field) ->
- $field.removeClass('uk-form-danger').siblings('.uk-text-danger').remove()
- validateRequired: (field, trim) ->
- val = val.trim() if trim
- @setError $field, 'This field is required.'
- validatePasswords: (field1, field2) ->
- if $field1.val() isnt $field2.val()
- @setError $field2, 'Passwords must match.'
-window.validation = new Validation()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coffee/validation.coffee Sun Mar 20 11:48:13 2016 +0800
+ setError: ($field, message) ->
+ $el = $('<div class="uk-text-danger"></div>').text(message)
+ $field.addClass('uk-form-danger')
+ unsetError: ($field) ->
+ $field.removeClass('uk-form-danger').siblings('.uk-text-danger').remove()
+ validateRequired: (field, trim) ->
+ val = val.trim() if trim
+ @setError $field, 'This field is required.'
+ validatePasswords: (field1, field2) ->
+ if $field1.val() isnt $field2.val()
+ @setError $field2, 'Passwords must match.'
--- a/js/register.js Sun Mar 20 11:43:20 2016 +0800
+++ b/js/register.js Sun Mar 20 11:48:13 2016 +0800
$('#register').on('click', function() {
- validation.unsetError($('#username, #password1, #password2'));
- ok &= validation.validateRequired($('#username'), true);
- ok &= validation.validatePasswords($('#password1'), $('#password2'));
- ok &= validation.validateRequired($('#password1'));
- ok &= validation.validateRequired($('#password2'));
+ Tram.validation.unsetError($('#username, #password1, #password2'));
+ ok &= Tram.validation.validateRequired($('#username'), true);
+ ok &= Tram.validation.validatePasswords($('#password1'), $('#password2'));
+ ok &= Tram.validation.validateRequired($('#password1'));
+ ok &= Tram.validation.validateRequired($('#password2'));
return R.register($('#username').val().trim(), $('#password1').val());
R.on('r/conflict', function() {
- return validation.setError($('#username'), 'A user with this username already exists.');
+ return Tram.validation.setError($('#username'), 'A user with this username already exists.');
R.on('r/failed', function() {
--- a/js/register.js.map Sun Mar 20 11:43:20 2016 +0800
+++ b/js/register.js.map Sun Mar 20 11:48:13 2016 +0800
- "mappings": ";AAAA;AAAA,MAAA;;EAAA,SAAA,GAAY,SAAC,MAAD,EAAS,KAAT;AACV,YAAO,MAAP;AAAA,WACO,OAAO,CAAC,MAAM,CAAC,UADtB;eAEI,OAAO,CAAC,KAAR,CAAc,wBAAd;AAFJ,WAIO,OAAO,CAAC,MAAM,CAAC,cAJtB;eAKI,OAAO,CAAC,KAAR,CAAc,4BAAd;AALJ,WAOO,OAAO,CAAC,MAAM,CAAC,QAPtB;eAQI,OAAO,CAAC,KAAR,CAAc,iCAAd,EAAiD,KAAjD;AARJ,WAUO,OAAO,CAAC,MAAM,CAAC,KAVtB;eAWI,OAAO,CAAC,KAAR,CAAc,4BAAd,EAA4C,KAA5C;AAXJ,WAaO,OAAO,CAAC,MAAM,CAAC,QAbtB;eAcI,OAAO,CAAC,KAAR,CAAc,4BAAd,EAA4C,KAA5C;AAdJ,WAgBO,OAAO,CAAC,MAAM,CAAC,aAhBtB;eAiBI,OAAO,CAAC,KAAR,CAAc,2BAAd;AAjBJ,WAmBO,OAAO,CAAC,MAAM,CAAC,YAnBtB;eA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AAe,SAAA;IACb,CAAA,CAAE,qBAAF,CAAwB,CAAC,QAAzB,CAAkC,WAAlC;WACA,QAAQ,CAAC,IAAT,GAAgB;EAFH,CAAf;;EAKA,CAAC,CAAC,EAAF,CAAK,UAAL,EAAiB,SAAA;WACf,CAAA,CAAE,uBAAF,CAA0B,CAAC,WAA3B,CAAuC,WAAvC;EADe,CAAjB;AA3JA"
\ No newline at end of file
--- a/js/ui/validation.js Sun Mar 20 11:43:20 2016 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
-// Generated by CoffeeScript 1.10.0
- Validation = (function() {
- function Validation() {}
- Validation.prototype.setError = function($field, message) {
- $el = $('<div class="uk-text-danger"></div>').text(message);
- $field.addClass('uk-form-danger');
- return $field.after($el);
- Validation.prototype.unsetError = function($field) {
- return $field.removeClass('uk-form-danger').siblings('.uk-text-danger').remove();
- Validation.prototype.validateRequired = function(field, trim) {
- this.setError($field, 'This field is required.');
- Validation.prototype.validatePasswords = function(field1, field2) {
- if ($field1.val() !== $field2.val()) {
- this.setError($field2, 'Passwords must match.');
- window.validation = new Validation();
-//# sourceMappingURL=validation.js.map
--- a/js/ui/validation.js.map Sun Mar 20 11:43:20 2016 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
- "file": "validation.js",
- "coffee/ui/validation.coffee"
- "mappings": ";AAAA;AAAA,MAAA;;EAAM;;;yBACJ,QAAA,GAAU,SAAC,MAAD,EAAS,OAAT;AACR,UAAA;MAAA,GAAA,GAAM,CAAA,CAAE,oCAAF,CAAuC,CAAC,IAAxC,CAA6C,OAA7C;MACN,MAAM,CAAC,QAAP,CAAgB,gBAAhB;aACA,MAAM,CAAC,KAAP,CAAa,GAAb;IAHQ;;yBAKV,UAAA,GAAY,SAAC,MAAD;aACV,MAAM,CAAC,WAAP,CAAmB,gBAAnB,CAAoC,CAAC,QAArC,CAA8C,iBAA9C,CAAgE,CAAC,MAAjE,CAAA;IADU;;yBAGZ,gBAAA,GAAkB,SAAC,KAAD,EAAQ,IAAR;AAChB,UAAA;MAAA,MAAA,GAAS,CAAA,CAAE,KAAF;MACT,GAAA,GAAM,MAAM,CAAC,GAAP,CAAA;MACN,IAAoB,IAApB;QAAA,GAAA,GAAM,GAAG,CAAC,IAAJ,CAAA,EAAN;;MACA,IAAG,GAAA,KAAO,EAAV;QACE,IAAC,CAAA,QAAD,CAAU,MAAV,EAAkB,yBAAlB;AACA,eAAO,MAFT;OAAA,MAAA;AAIE,eAAO,KAJT;;IAJgB;;yBAUlB,iBAAA,GAAmB,SAAC,MAAD,EAAS,MAAT;AACjB,UAAA;MAAA,OAAA,GAAU,CAAA,CAAE,MAAF;MACV,OAAA,GAAU,CAAA,CAAE,MAAF;MACV,IAAG,OAAO,CAAC,GAAR,CAAA,CAAA,KAAmB,OAAO,CAAC,GAAR,CAAA,CAAtB;QACE,IAAC,CAAA,QAAD,CAAU,OAAV,EAAmB,uBAAnB;AACA,eAAO,MAFT;OAAA,MAAA;AAIE,eAAO,KAJT;;IAHiB;;;;;;EAUrB,MAAM,CAAC,UAAP,GAAwB,IAAA,UAAA,CAAA;AA7BxB"
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/js/validation.js Sun Mar 20 11:48:13 2016 +0800
+// Generated by CoffeeScript 1.10.0
+ setError: function($field, message) {
+ $el = $('<div class="uk-text-danger"></div>').text(message);
+ $field.addClass('uk-form-danger');
+ return $field.after($el);
+ unsetError: function($field) {
+ return $field.removeClass('uk-form-danger').siblings('.uk-text-danger').remove();
+ validateRequired: function(field, trim) {
+ this.setError($field, 'This field is required.');
+ validatePasswords: function(field1, field2) {
+ if ($field1.val() !== $field2.val()) {
+ this.setError($field2, 'Passwords must match.');
+//# sourceMappingURL=validation.js.map
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/js/validation.js.map Sun Mar 20 11:48:13 2016 +0800
+ "file": "validation.js",
+ "coffee/validation.coffee"
+ "mappings": ";AAAA;EAAA,IAAI,CAAC,UAAL,GACE;IAAA,QAAA,EAAU,SAAC,MAAD,EAAS,OAAT;AACR,UAAA;MAAA,GAAA,GAAM,CAAA,CAAE,oCAAF,CAAuC,CAAC,IAAxC,CAA6C,OAA7C;MACN,MAAM,CAAC,QAAP,CAAgB,gBAAhB;aACA,MAAM,CAAC,KAAP,CAAa,GAAb;IAHQ,CAAV;IAKA,UAAA,EAAY,SAAC,MAAD;aACV,MAAM,CAAC,WAAP,CAAmB,gBAAnB,CAAoC,CAAC,QAArC,CAA8C,iBAA9C,CAAgE,CAAC,MAAjE,CAAA;IADU,CALZ;IAQA,gBAAA,EAAkB,SAAC,KAAD,EAAQ,IAAR;AAChB,UAAA;MAAA,MAAA,GAAS,CAAA,CAAE,KAAF;MACT,GAAA,GAAM,MAAM,CAAC,GAAP,CAAA;MACN,IAAoB,IAApB;QAAA,GAAA,GAAM,GAAG,CAAC,IAAJ,CAAA,EAAN;;MACA,IAAG,GAAA,KAAO,EAAV;QACE,IAAC,CAAA,QAAD,CAAU,MAAV,EAAkB,yBAAlB;AACA,eAAO,MAFT;OAAA,MAAA;AAIE,eAAO,KAJT;;IAJgB,CARlB;IAkBA,iBAAA,EAAmB,SAAC,MAAD,EAAS,MAAT;AACjB,UAAA;MAAA,OAAA,GAAU,CAAA,CAAE,MAAF;MACV,OAAA,GAAU,CAAA,CAAE,MAAF;MACV,IAAG,OAAO,CAAC,GAAR,CAAA,CAAA,KAAmB,OAAO,CAAC,GAAR,CAAA,CAAtB;QACE,IAAC,CAAA,QAAD,CAAU,OAAV,EAAmB,uBAAnB;AACA,eAAO,MAFT;OAAA,MAAA;AAIE,eAAO,KAJT;;IAHiB,CAlBnB;;AADF"
\ No newline at end of file
--- a/register.html Sun Mar 20 11:43:20 2016 +0800
+++ b/register.html Sun Mar 20 11:48:13 2016 +0800
<div class="uk-alert uk-alert-danger uk-hidden" data-msg="v/failed">Couldn't save the vCard.</div>
- <script src='/js/ui/validation.js'></script>
<script src='/js/tram.js'></script>
+ <script src='/js/validation.js'></script>
<script src='/js/register.js'></script>