Download:
child 171:c125c0463184
parent 169:4cebef28d40b
170:584e37c0b89c
Anton Shestakov <av6@dwimlabs.net>, Sun, 17 Apr 2016 07:45:45 +0800
forms: rename rivets.bind() parameter

6 файлов изменено, 20 вставок(+), 20 удалений(-) [+]
coffee/index.coffee file | annotate | diff | comparison | revisions
coffee/register.coffee file | annotate | diff | comparison | revisions
index.html file | annotate | diff | comparison | revisions
js/index.js file | annotate | diff | comparison | revisions
js/register.js file | annotate | diff | comparison | revisions
register.html file | annotate | diff | comparison | revisions
--- a/coffee/index.coffee Sun Apr 17 07:39:05 2016 +0800
+++ b/coffee/index.coffee Sun Apr 17 07:45:45 2016 +0800
@@ -667,7 +667,7 @@
$form.streamline()
-window.connRivet = rivets.bind($form, data: connForm, connect: connectfn)
+window.connRivet = rivets.bind($form, form: connForm, connect: connectfn)
sendMessage = ->
--- a/coffee/register.coffee Sun Apr 17 07:39:05 2016 +0800
+++ b/coffee/register.coffee Sun Apr 17 07:45:45 2016 +0800
@@ -47,8 +47,8 @@
X.unregister()
-window.regRivet = rivets.bind($('[data-form="registration"]'), data: regForm, register: registerfn)
-window.profileRivet = rivets.bind($('[data-form="profile"]'), data: profileForm, save: savefn, cancel: cancelfn)
+window.regRivet = rivets.bind($('[data-form="registration"]'), form: regForm, register: registerfn)
+window.profileRivet = rivets.bind($('[data-form="profile"]'), form: profileForm, save: savefn, cancel: cancelfn)
window.X = new Tram.XMPPInterface()
--- a/index.html Sun Apr 17 07:39:05 2016 +0800
+++ b/index.html Sun Apr 17 07:45:45 2016 +0800
@@ -41,21 +41,21 @@
<label for="username" class="uk-form-label">Username</label>
<div class="uk-form-controls">
<input id="username" type="text" class="uk-width-1-1" required autofocus
- rv-value="data:username" rv-class-uk-form-danger="data:username-errors">
- <div class="uk-text-danger" rv-each-error="data:username-errors">{ error }</div>
+ rv-value="form:username" rv-class-uk-form-danger="form:username-errors">
+ <div class="uk-text-danger" rv-each-error="form:username-errors">{ error }</div>
</div>
</div>
<div class="uk-form-row">
<label for="password" class="uk-form-label">Password</label>
<div class="uk-form-controls">
<input id="password" type="password" class="uk-width-1-1" required
- rv-value="data:password" rv-class-uk-form-danger="data:password-errors">
- <div class="uk-text-danger" rv-each-error="data:password-errors">{ error }</div>
+ rv-value="form:password" rv-class-uk-form-danger="form:password-errors">
+ <div class="uk-text-danger" rv-each-error="form:password-errors">{ error }</div>
</div>
</div>
<div class="uk-form-row">
<div class="uk-form-controls">
- <div class="uk-alert uk-alert-danger" rv-each-error="data:auth-errors">{ error }</div>
+ <div class="uk-alert uk-alert-danger" rv-each-error="form:auth-errors">{ error }</div>
<button type="button" class="uk-button uk-button-primary" rv-on-click="connect">
<i class="uk-icon-sign-in"></i>&nbsp;Log in
</button>
--- a/js/index.js Sun Apr 17 07:39:05 2016 +0800
+++ b/js/index.js Sun Apr 17 07:45:45 2016 +0800
@@ -816,7 +816,7 @@
$form.streamline();
window.connRivet = rivets.bind($form, {
- data: connForm,
+ form: connForm,
connect: connectfn
});
--- a/js/register.js Sun Apr 17 07:39:05 2016 +0800
+++ b/js/register.js Sun Apr 17 07:45:45 2016 +0800
@@ -61,12 +61,12 @@
};
window.regRivet = rivets.bind($('[data-form="registration"]'), {
- data: regForm,
+ form: regForm,
register: registerfn
});
window.profileRivet = rivets.bind($('[data-form="profile"]'), {
- data: profileForm,
+ form: profileForm,
save: savefn,
cancel: cancelfn
});
--- a/register.html Sun Apr 17 07:39:05 2016 +0800
+++ b/register.html Sun Apr 17 07:45:45 2016 +0800
@@ -39,24 +39,24 @@
<label for="username" class="uk-form-label">Username</label>
<div class="uk-form-controls">
<input id="username" type="text" class="uk-width-1-1" required autofocus
- rv-value="data:username" rv-class-uk-form-danger="data:username-errors">
- <div class="uk-text-danger" rv-each-error="data:username-errors">{ error }</div>
+ rv-value="form:username" rv-class-uk-form-danger="form:username-errors">
+ <div class="uk-text-danger" rv-each-error="form:username-errors">{ error }</div>
</div>
</div>
<div class="uk-form-row">
<label for="password1" class="uk-form-label">Password</label>
<div class="uk-form-controls">
<input id="password1" type="password" class="uk-width-1-1" required
- rv-value="data:password1" rv-class-uk-form-danger="data:password1-errors">
- <div class="uk-text-danger" rv-each-error="data:password1-errors">{ error }</div>
+ rv-value="form:password1" rv-class-uk-form-danger="form:password1-errors">
+ <div class="uk-text-danger" rv-each-error="form:password1-errors">{ error }</div>
</div>
</div>
<div class="uk-form-row">
<label for="password2" class="uk-form-label">Confirmation</label>
<div class="uk-form-controls">
<input id="password2" type="password" class="uk-width-1-1" required
- rv-value="data:password2" rv-class-uk-form-danger="data:password2-errors">
- <div class="uk-text-danger" rv-each-error="data:password2-errors">{ error }</div>
+ rv-value="form:password2" rv-class-uk-form-danger="form:password2-errors">
+ <div class="uk-text-danger" rv-each-error="form:password2-errors">{ error }</div>
</div>
</div>
<div class="uk-form-row">
@@ -72,20 +72,20 @@
<div class="uk-form-row">
<label for="fullname" class="uk-form-label">Full Name</label>
<div class="uk-form-controls">
- <input id="fullname" class="uk-width-1-1" type="text" rv-value="data:fullname">
+ <input id="fullname" class="uk-width-1-1" type="text" rv-value="form:fullname">
</div>
</div>
<div class="uk-form-row">
<label for="nickname" class="uk-form-label">Nickname</label>
<div class="uk-form-controls">
- <input id="nickname" class="uk-width-1-1" type="text" rv-value="data:nickname">
+ <input id="nickname" class="uk-width-1-1" type="text" rv-value="form:nickname">
</div>
</div>
<div class="uk-form-row">
<label for="avatar" class="uk-form-label">Avatar</label>
<div class="uk-form-controls">
<input id="avatar" type="file" accept="image/*" value="">
- <div class="uk-text-danger" rv-each-error="data:avatar-errors">{ error }</div>
+ <div class="uk-text-danger" rv-each-error="form:avatar-errors">{ error }</div>
<p>A good avatar:</p>
<ul>
<li>has width and height between 32 and 96 pixels</li>