Skip to content

Commit 3640cf6

Browse files
committed
remove dependency on unnecessary magic
1 parent 3606c99 commit 3640cf6

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ This is meant to be an example CouchApp and to ship with most of the CouchApp go
44

55
Install with
66

7-
couchapp push . http://localhost:5984/proto
7+
couchapp push . http://localhost:5984/example
88

99
or (if you have security turned on)
1010

11-
couchapp push . http://myname:mypass@localhost:5984/proto
11+
couchapp push . http://myname:mypass@localhost:5984/example
1212

1313
You can also create this app by running
1414

1515
couchapp generate proto && cd proto
16-
couchapp push . http://localhost:5984/proto
16+
couchapp push . http://localhost:5984/example
1717

1818
## Todo
1919

_attachments/index.html

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ <h1>Example CouchApp</h1>
2626
<script src="vendor/couchapp/jquery.couchLogin.js"></script>
2727
<script src="vendor/couchapp/jquery.couchProfile.js"></script>
2828
<script src="vendor/couchapp/md5.js"></script>
29-
<script src="vendor/couchapp/jquery.couchForm.js"></script>
3029
<script src="vendor/couchapp/jquery.mustache.js"></script>
3130

3231
<!-- templates used by app.js -->

_attachments/script/app.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,13 @@ $(function() {
3131
loggedIn : function(r) {
3232
$("#profile").couchProfile(r, {
3333
profileReady : function(profile) {
34-
$("#create-message").couchForm({
35-
beforeSave : function(doc) {
34+
$("#create-message").submit(function(){
35+
var form = this, doc = {};
3636
doc.created_at = new Date();
37-
doc.profile = profile;
38-
return doc;
39-
}
40-
});
41-
$("#create-message").find("input").focus();
37+
doc.profile = profile;
38+
db.saveDoc(doc, {success : function() {form.reset();}});
39+
return false;
40+
}).find("input").focus();
4241
}
4342
});
4443
},

0 commit comments

Comments
 (0)