-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
239 lines (238 loc) · 13.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="Mark Daggett">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<style type="text/css" media="screen">
.container { width:960px; margin:0 auto;}
</style>
</head>
<body>
<div class="container" data-host='http://www.pledgie.com' data-pledgie-account='heavysixer'></div>
<style type="text/css" media="screen">
.pledgie h1,.pledgie h2,.pledgie h3,.pledgie h4,.pledgie h5,.pledgie h6,.pledgie p,.pledgie blockquote,.pledgie pre,.pledgie a,.pledgie abbr,.pledgie acronym,.pledgie address,.pledgie cite,.pledgie code,.pledgie del,.pledgie dfn,.pledgie em,.pledgie img,.pledgie q,.pledgie s,.pledgie samp,.pledgie small,.pledgie strike,.pledgie strong,.pledgie sub,.pledgie sup,.pledgie tt,.pledgie var,.pledgie dd,.pledgie dl,.pledgie dt,.pledgie li,.pledgie ol,.pledgie ul,.pledgie fieldset,.pledgie form,.pledgie label,.pledgie legend,.pledgie button,.pledgie table,.pledgie caption,.pledgie tbody,.pledgie tfoot,.pledgie thead,.pledgie tr,.pledgie th,.pledgie td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1.2;font-family:inherit;}
.pledgie table{border-collapse:collapse;border-spacing:0;}
.pledgie ol,.pledgie ul{list-style:none;}
.pledgie q:before,.pledgie q:after,.pledgie blockquote:before,.pledgie blockquote:after{content:"";}
.pledgie a { color: #3399cc; margin: 0; padding: 0; }
.pledgie a:hover { color: #0099ff; }
.pledgie a:focus { outline: none; }
.pledgie a:focus{outline:thin dotted;}
.pledgie a:hover,.pledgie a:active{outline:0;}
.pledgie article,.pledgie aside,.pledgie details,.pledgie figcaption,.pledgie figure,.pledgie footer,.pledgie header,.pledgie hgroup,.pledgie nav,.pledgie section{display:block;}
.pledgie audio,.pledgie canvas,.pledgie video{display:inline-block;*display:inline;*zoom:1;}
.pledgie audio:not([controls]){display:none;}
.pledgie sub,.pledgie sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}
.pledgie sup{top:-0.5em;}
.pledgie sub{bottom:-0.25em;}
.pledgie img{border:0;-ms-interpolation-mode:bicubic;}
.pledgie button,.pledgie input,.pledgie select,.pledgie textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;}
.pledgie button,.pledgie input{line-height:normal;*overflow:visible;}
.pledgie button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}
.pledgie button,.pledgie input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;}
.pledgie textarea{overflow:auto;vertical-align:top;}
.pledgie .campaignFormat{color: #333333;font-family: "Lucida Grande","Lucida Sans Unicode",Verdana,Helvetica,Arial,sans-serif;font-size: 12px;}
.pledgie .prependTop { margin-top:10px !important;}
.pledgie .appendBottom { margin-bottom:10px !important;}
.pledgie .left { float:left !important;}
.pledgie .right { float:right !important;}
.pledgie .container:after{clear:both;}
.pledgie .row{zoom:1;}
.pledgie .row:before,.pledgie .row:after{display:table;content:"";zoom:1;clear:both;}
.pledgie .description p {margin-bottom:10px;}
.pledgie .campaignContainer{margin:10px;width:400px;padding: 5px 20px 20px 20px;-moz-border-radius: 5px;border-radius: 5px;-moz-box-shadow: 0 0 10px #888; -webkit-box-shadow: 0 0 10px #888; box-shadow: 0 0 10px #888;}
.pledgie .campaignImages {background-color:#F1F1F1;-moz-border-radius: 3px;border-radius: 3px;}
.pledgie .campaignImages img{max-width:400px;margin:0 auto; display:block;}
.pledgie .campaignHeader{color: #222222;font-size: 14px;font-weight: bold;margin: 5px 0;white-space: nowrap;}
.pledgie .campaignHeader a {border-bottom: 2px solid #E8E8E8; color: #222222; font-weight: bold; text-decoration: none; }
.pledgie .amountMessage { color:#8A8A83;margin: 0;font-weight:bold;}
.pledgie .pledgeometer .graph {background-color:#F1F1F1;-moz-border-radius: 3px;border-radius: 3px;}
.pledgie .pledgeometer .graph .bar{-moz-border-radius: 3px;border-radius: 3px;display:block;position:relative;background:#C7D942;text-align:center;color:#fff;height:2em;line-height:2em;}
.pledgie .pledgeometer .graph .bar span{position:absolute;left:1em;}
.pledgie .pledgeometer .amounts{height:1.5em;width:100%;}
.pledgie .pledgeometer li{padding:0;border-left:1px solid #b8b3a5;margin:0;float:left;}
.pledgie .pledgeometer li.last{border:none;padding-right:0.5em;border-right:1px solid #b8b3a5;margin:0;float:right;text-align:right;}
.pledgie .pledgeometer li:before{content:"" !important;}
.pledgie .additionalInformation dt { font-weight:bold;}
.pledgie .additionalInformation dd, .pledgie .additionalInformation dt { margin-right:5px;}
.pledgie .pledgeForm h3 { font-weight:bold;}
.pledgie .pledgeForm { padding-left:20px;}
.pledgie form{margin-bottom:18px;}
.pledgie fieldset{margin-bottom:18px;padding-top:18px;}
.pledgie fieldset legend{display:block;padding-left:150px;font-size:19.5px;line-height:1;color:#404040;*padding:0 0 5px 145px;*line-height:1.5;}
.pledgie form .clearfix{margin-bottom:18px;zoom:1;}
.pledgie form .clearfix:before,
.pledgie form .clearfix:after{display:table;content:"";zoom:1;}
.pledgie form .clearfix:after{clear:both;}
.pledgie label,.pledgie input,.pledgie select,.pledgie textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:normal;}
.pledgie label{padding-top:6px;font-size:13px;line-height:18px;float:left;text-align:right;color:#404040;}
.pledgie form .input{margin-left:150px;}
.pledgie input[type=checkbox],input[type=radio]{cursor:pointer;}
.pledgie input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;font-size:13px;line-height:18px;color:#808080;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
.pledgie input.wantsMoney { width:100px;}
.pledgie select{padding:initial;}
.pledgie input[type=checkbox],.pledgie input[type=radio]{width:auto;height:auto;padding:0;margin:3px 0;*margin-top:0;line-height:normal;border:none;}
.pledgie input[type=file]{background-color:#ffffff;padding:initial;border:initial;line-height:initial;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
.pledgie input[type=button],input[type=reset],input[type=submit]{width:auto;height:auto;}
.pledgie select,.pledgie input[type=file]{height:27px;*height:auto;line-height:27px;*margin-top:4px;}
.pledgie select[multiple]{height:inherit;background-color:#ffffff;}
.pledgie .well { background-color: #F5F5F5; border: 1px solid rgba(0, 0, 0, 0.05); border-radius: 4px 4px 4px 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset; min-height: 20px; }
</style>
<script type="text/javascript" charset="utf-8">
/* <![CDATA[ */
$(document).ready(function() {
function pledgieSkin() {
return {
evenOrOdd: function(val) {
return ((val % 2 === 0) ? 'odd': 'even');
},
amountMessage: function(campaign) {
if (campaign.goal) {
return campaign.amount_raised_formatted + " - " + campaign.goal_formatted;
} else {
return campaign.amount_raised_formatted + "Raised";
}
},
categories: function(campaign) {
var categories = [];
var len = campaign.categories.length;
if (len === 0) {
return "";
} else {
for (var x = 0; x < len; x++) {
categories.push(campaign.categories[x].category.name);
}
return "<dl class='additionalInformation'>\
<dt class='left'> Categories</dt>\
<dd class='left'>" + categories.join(', ') + "</dd>\
</dl>";
}
},
campaign: function(campaign) {
return "\
<div class='row left campaignFormat campaignContainer'>\
<div class='campaignHeader appendBottom'>\
<h1><a href='" + host + "/campaigns/" + campaign.id + "' target='_new'>" + campaign.title + "</a></h1>\
</div>\
<p class='amountMessage appendBottom'>" + this.amountMessage(campaign) + "</p>\
" + this.pledgeometer(campaign) + "\
<div class='row left appendBottom'> \
" + this.images(campaign) + "\
<div class='description left row'>" + campaign.description + "</div>\
" + this.categories(campaign) + "\
</div>\
<div class='row'>" + this.donateForm(campaign) + "</div>\
</div>";
},
images: function(campaign) {
var str = '';
var len = campaign.images.length;
if (len > 0) {
str += "<div class='campaignImages appendBottom prependTop'>";
for (var x = 0; x < len; x++) {
str += "<img src='" + host + "" + campaign.images[x].medium + "'/>";
}
str += "</div>";
}
return str;
},
pledgeometer: function(campaign) {
if (campaign.goal) {
return "<div class='row pledgeometer appendBottom'>\
<div class='graph'>\
<strong class='bar' style='width: " + campaign.percent_towards_goal + "%;'>\
<span>" + campaign.percent_towards_goal + "%</span>\
</strong>\
</div>\
</div>";
} else {
return '';
}
},
donateForm: function(campaign) {
return "<div class='row prependTop well'> \
<form action='" + host + "/campaigns/" + campaign.id + "/pledge/confirm' method='post'>\
<div style='margin: 0pt; padding: 0pt; display: inline;'>\
<input name='authenticity_token' value='" + this.auth_token + "' type='hidden'>\
</div>\
<div class='pledgeForm prependTop'>\
<h3 class='appendBottom'>Make A Donation</h3>\
<ul>\
<li>\
<label>Amount:</label>\
<input class='wantsMoney' name='pledge[amount]' size='10' type='text'>\
<input name='commit' value='Submit' type='submit'>\
</li>\
</ul>\
</div>\
</form>\
</div>";
},
donors: function(campaign) {
var donors = [];
for (var x = 0; x < campaign.pledges.length; x++) {
donors.push(
"<tr class='" + evenOrOdd(x) + "'>" +
" <td>" +
(x + 1) + ". " +
campaign.pledges[x].display_name +
((campaign.pledges[x].donation_type === 'manual') ? "<span class='manualDonation'*</span>": "") +
" </td> " +
" <td> " + campaign.pledges[x].date + "</td>" +
"</tr>"
);
}
return "<div class='donors columnItem'> \
<table cellpadding='0' cellspacing='0'> \
<caption> Donors (" + campaign.pledges_count + ")</caption> \
<thead> \
<tr> \
<th>Name</th> \
<th>Date</th> \
</tr> \
</thead> \
<tfoot> \
<tr> \
<td colspan='2'> \
<span><em>* Denotes a manually entered pledge.</em></span> \
<a href='" + host + "/campaigns/" + campaign.id + "/donations_feed'>Donation RSS Feed</a> \
</td> \
</tr> \
</tfoot> \
<tbody>" +
donors.join('') +
"</tbody> \
</table> \
</div>";
}
};
}
var host = $("*[data-host]");
host = (host) ? $("*[data-host]").attr('data-host') : 'http://www.pledgie.com';
$("*[data-pledgie-account]").each(function(i, e) {
var account = $(e).attr('data-pledgie-account');
if (account) {
var accountContainer = $("*[data-pledgie-account='"+account+"']");
$.getJSON(host + "/accounts/" + account + ".json?_method=get&callback=?",
function(data) {
var p = pledgieSkin();
p.auth_token = data.auth_token;
$(accountContainer).addClass('pledgie');
var str ="";
$.each(data.account.campaigns,
function(i, c) {
str +="<div data-pledgie-campaign-id='" + c.id + "'>"+p.campaign(c)+"</div>";
});
$(accountContainer).append(str);
});
}
});
});
/* ]]> */
</script>
</body>
</html>