Skip to content

Commit 924a726

Browse files
committed
intial commit
0 parents  commit 924a726

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+4048
-0
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Generated CouchApp
2+
3+
This repo is a snapshot of the development going on in [The CouchApp generate command.](http://github.com/couchapp/couchapp/tree/master/templates/app/)
4+
5+
It's easier for me to receive patches against couchapp/couchapp. This repo is intended primarily so you can deploy new versions of the example app without needing to upgrade CouchApp.

_attachments/index.html

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>My New CouchApp</title>
5+
<link rel="stylesheet" href="style/main.css" type="text/css">
6+
</head>
7+
<body>
8+
<div id="account"></div>
9+
10+
<h1>Generated CouchApp</h1>
11+
12+
<div id="profile"></div>
13+
<div id="items"></div>
14+
15+
<div id="sidebar">
16+
<p>Edit welcome message.</p>
17+
<p>Ideas: You could easily turn this into a photo sharing app, or a grocery list, or a chat room.</p>
18+
</div>
19+
</body>
20+
<script src="vendor/couchapp/loader.js"></script>
21+
<script type="text/javascript" charset="utf-8">
22+
$.couch.app(function(app) {
23+
$("#account").evently("account", app);
24+
$("#profile").evently("profile", app);
25+
$.evently.connect("#account","#profile", ["loggedIn","loggedOut"]);
26+
$("#items").evently("items", app);
27+
});
28+
</script>
29+
</html>

_attachments/style/main.css

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/* add styles here */
2+
3+
body {
4+
font:1em Helvetica, sans-serif;
5+
padding:4px;
6+
}
7+
8+
#account {
9+
float:right;
10+
}
11+
12+
#profile {
13+
border:4px solid #edd;
14+
background:#fee;
15+
padding:8px;
16+
margin-bottom:8px;
17+
}
18+
19+
#items {
20+
border:4px solid #dde;
21+
background:#eef;
22+
padding:8px;
23+
width:60%;
24+
float:left;
25+
}
26+
27+
#sidebar {
28+
border:4px solid #dfd;
29+
padding:8px;
30+
float:right;
31+
width:30%;
32+
}
33+
34+
#items li {
35+
border:4px solid #f5f5ff;
36+
background:#fff;
37+
padding:8px;
38+
margin:4px 0;
39+
}
40+
41+
form {
42+
padding:4px;
43+
margin:6px;
44+
background-color:#ddd;
45+
}
46+
47+
div.avatar {
48+
padding:2px;
49+
padding-bottom:0;
50+
margin-right:4px;
51+
float:left;
52+
font-size:0.78em;
53+
width : 60px;
54+
height : 60px;
55+
text-align: center;
56+
}
57+
58+
div.avatar .name {
59+
padding-top:2px;
60+
}
61+
62+
div.avatar img {
63+
margin:0 auto;
64+
padding:0;
65+
width : 40px;
66+
height : 40px;
67+
}
68+
69+
#items ul {
70+
list-style: none;
71+
}

_id

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_design/proto

couchapp.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "Name of your CouchApp",
3+
"description": "CouchApp"
4+
}

evently/items/_changes/data.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function(data) {
2+
$.log(data)
3+
var p;
4+
return {
5+
items : data.rows.map(function(r) {
6+
p = r.value.profile;
7+
p.message = r.value.message;
8+
return p;
9+
})
10+
}
11+
};

evently/items/_changes/mustache.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<p>Customize this format here: <tt>ddoc.evently.items._changes.mustache</tt></p>
2+
<h3>Recent Messages</h3>
3+
<ul>
4+
{{#items}}
5+
<li>
6+
<div class="avatar">
7+
{{#gravatar_url}}<img src="{{gravatar_url}}"/>{{/gravatar_url}}
8+
<div class="name">
9+
{{nickname}}
10+
</div>
11+
</div>
12+
<p>{{message}}</p>
13+
<div style="clear:left;"></div>
14+
</li>
15+
{{/items}}
16+
</ul>
17+
<p><em>Protip:</em> If you setup continuous replication between this database and a remote one, this list will reflect remote changes in near real-time.</p>
18+
<p>This would be a good place to add pagination.</p>

evently/items/_changes/query.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"view" : "recent-items",
3+
"descending" : "true",
4+
"limit" : 50
5+
}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<p>Most applications will customize this template (<tt>ddoc.evently.profile.profileReady.mustache</tt>) for user input.</p>
2+
3+
<div class="avatar">
4+
{{#gravatar_url}}<img src="{{gravatar_url}}"/>{{/gravatar_url}}
5+
<div class="name">
6+
{{name}}
7+
</div>
8+
</div>
9+
10+
<form>
11+
<label>New message from {{nickname}}: <input type="text" name="message" size=60 value=""></label>
12+
</form>
13+
14+
<div style="clear:left;"></div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function() {
2+
var form = this;
3+
var doc = {
4+
created_at : new Date(),
5+
profile : $$("#profile").profile,
6+
message : $("[name=message]", form).val()
7+
};
8+
$$(this).app.db.saveDoc(doc, {
9+
success : function() {
10+
$("[name=message]", form).val("");
11+
}
12+
});
13+
return false;
14+
};

language

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
javascript

vendor/couchapp/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## CouchApp - more than just a filesystem mapper
2+
3+
This is where documentation will go for the client and server JavaScript parts of CouchApp.

vendor/couchapp/_attachments/docs.css

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
body {
2+
font:1em Helvetica, sans-serif;
3+
margin:0;
4+
padding:4px;
5+
}
6+
7+
h1 {
8+
margin:0.5em;
9+
}
10+
11+
h2 {
12+
color:#222;
13+
}
14+
15+
pre {
16+
padding:4px;
17+
margin:4px;
18+
background:#bbb;
19+
}
20+
21+
#content {
22+
padding:4px;
23+
margin:2px;
24+
}
25+
26+
#sidebar {
27+
float:right;
28+
width:34%;
29+
}
30+
31+
#docs {
32+
-moz-box-shadow:0 0 2em #000;
33+
-webkit-box-shadow:0 0 2em #000;
34+
width:58%;
35+
padding:8px;
36+
margin:4px;
37+
}
38+
39+
.example {
40+
background:#ffd;
41+
padding:4px;
42+
margin:4px;
43+
position:absolute;
44+
}
45+
46+
textarea.code {
47+
width:100%;
48+
}
49+
50+
.edit {
51+
float:right;
52+
font-size:0.8em;
53+
}
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Evently and CouchApp Docs</title>
5+
<link rel="stylesheet" href="docs.css" type="text/css">
6+
</head>
7+
<body>
8+
<div id="header">
9+
<div id="account"></div>
10+
<h1><a href="#/">Docs for $.evently, $.pathbinder, and $.couch.app</a></h1>
11+
</div>
12+
<div id="content">
13+
<div id="sidebar">
14+
<p><em>These docs are stored as Markdown in the CouchApp vendor directory. Use CouchApp to edit them on the filesystem.</em></p>
15+
</div>
16+
<div id="docs">
17+
</div>
18+
<br style="clear:both;"/>
19+
</div>
20+
</body>
21+
<script src="/_utils/script/json2.js"></script>
22+
<script src="/_utils/script/jquery.js"></script>
23+
<script src="/_utils/script/jquery.couch.js"></script>
24+
<script src="/_utils/script/sha1.js"></script>
25+
<script src="jquery.couch.app.js"></script>
26+
<script src="jquery.couch.app.util.js"></script>
27+
<script src="jquery.evently.js"></script>
28+
<script src="jquery.pathbinder.js"></script>
29+
<script src="jquery.mustache.js"></script>
30+
<script src="../showdown/showdown.js"></script>
31+
<script src="docs.js"></script>
32+
</html>

vendor/couchapp/_attachments/docs.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
$.log = function() {
2+
// console.log(arguments)
3+
};
4+
5+
$.couch.app(function(app) {
6+
$("#docs").evently(app.ddoc.vendor.couchapp.evently.docs, app);
7+
$.pathbinder.begin("/");
8+
});

0 commit comments

Comments
 (0)