forked from prose/prose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
425 lines (389 loc) · 15.7 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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'/>
<title>Prose · A Content Editor for GitHub</title>
<link rel='shortcut icon' href='./img/favicon.ico' type='image/x-icon' />
<link rel='stylesheet' href='./app.css'>
<script data-template='app' type='text/html'>
<div class='header'>
<div class='limiter clearfix'>
<div class='fr user-status<%= !window.authenticated ? " logged-out" : "" %>'>
<% if (window.authenticated) { %>
<div class='dropdown-menu'>
<a href='#' class='round dropdown-hover'><%= app.username %></a>
<ul class='dropdown round arrow-top'>
<li><a class='logout' href='#'><strong>Logout</strong></a></li>
</ul>
</div>
<% } else { %>
<a class='button round' href='https://github.com/login/oauth/authorize?client_id=c602a8bd54b1e774f864&scope=repo,user,gist&redirect_uri=<%= encodeURIComponent(window.location.href) %>'>Sign in using Github</a>
<% } %>
</div>
</div>
</div>
<div id='heading' class='heading limiter clearfix'></div>
<div class='application clearfix limiter'>
<div id='content' class='content fl'></div>
<div class='sidebar fl'>
<div id='drawer' class='drawer'></div>
<div class='vert navigation'>
<ul class='project nav'>
<li>
<a href='/' class='icon round repos <% if (!app.state.mode) { %>active<% } %>'>
<span class='popup round arrow-left'>Your Projects</span>
</a>
</li>
<% if (state.repo) { %>
<li>
<a href='#<%= user %>/<%= repo %>/tree/<%= branch %>' class='icon round repo <% if (app.state.mode === "tree") { %>active<% } %>'>
<span class='popup round arrow-left'><%= repo %></span>
</a>
</li>
<% if (window.authenticated) { %>
<li>
<a href='#<%= user %>/<%= repo %>/new/<%= branch %><%= path ? "/"+path : ""%>' class='icon round new new-file'>
<span class='popup round arrow-left'>New File</span>
</a>
</li>
<% } %>
<% } %>
</ul>
<% if (state.mode === 'edit' || state.mode === 'blob' || state.mode === 'new') { %>
<ul class='post-views nav'>
<li>
<a href='#' class='icon round edit' data-state='edit'>
<span class='popup round arrow-left'>Edit</span>
</a>
</li>
<% if (state.markdown || state.mode === 'new') { %>
<li>
<a href='#' class='icon round preview' data-state='preview'<% if (jekyll) { %>data-jekyll=true<% } %>>
<span class='popup round arrow-left'>Preview</span>
</a>
</li>
<% } %>
<li>
<a href='#' class='icon round settings' data-state='settings' data-drawer=true>
<span class='popup round arrow-left'>Post Settings</span>
</a>
</li>
</ul>
<% } %>
</div>
</div>
</div>
</script>
<script data-template='heading' type='text/html'>
<% if (alterable) { %>
<div class='avatar round fl'><%= avatar %></div>
<div class='fl details'>
<h4><a class='user' href='#<%= parentUrl %>'><%= parent %></a></h4>
<input type='text' class='filepath' value='<%= title %>'>
</div>
<% } else { %>
<div class='avatar round fl'><%= avatar %></div>
<div class='fl details'>
<h4><a class='user' href='#<%= parentUrl %>'><%= parent %></a></h4>
<h2><a class='repo' href='#<%= titleUrl %>'><%= title %></a></h2>
</div>
<% } %>
</script>
<script data-template='notification' type='text/html'>
<% if (!window.authenticated) { %>
<div class='notify <%= type %>'>
<div class='inner'>
Please login with your GitHub account to access that project.
<p><a class='button round' href='https://github.com/login/oauth/authorize?client_id={{site.oauth_client_id}}&scope=repo, user&redirect_uri=<%= encodeURIComponent(window.location.href) %>'>Sign in</a></a>
</div>
</div>
<% } else { %>
<div class='notify <%= type %>'>
<div class='inner'>
<p><%= message %></p>
<p><a class='button create' href='#'>Create it </a></p>
<p><a class='button round' href='../'>Go back </a></p>
</div>
</div>
<% } %>
</script>
<script data-template='post' type='text/html'>
<% if (markdown) { %>
<div class='topbar toolbar'>
<div class='inner clearfix'>
<div class='dropdown-menu fr'>
<a href='#' class='round dropdown-hover'>Markdown</a>
<ul class='dropdown markdown-snippets round'>
<li><a href='#' data-snippet='# Heading'>Main Header</a></li>
<li><a href='#' data-snippet='## Sub Heading'>Sub Header</a></li>
<li><a href='#' data-snippet='<% print("```\nvar foo;\n```"); %>'>Code</a></li>
<li><a href='#' data-snippet='[Google](http://google.com)'>Link</a></li>
<li><a href='#' data-snippet='![picture alt](http://placekitten.com/200/300 "Cats Are Awesome (title)")'>Image</a></li>
<li><a href='#' data-snippet='<% print("> We loved with a love that was more than love"); %>'>Blockquote</a></li>
<li><a href='#' data-snippet='<% print("- item\n- item\n- item\n"); %>'>List</a></li>
<li class='divider'></li>
<li><a href='http://daringfireball.net/projects/markdown/syntax' target='_blank' target='_blank'><strong>Learn More</strong></a></li>
</ul>
</div>
</div>
</div>
<% } %>
<div class='inner'>
<div class='inner views'>
<div id='diff' class='view diff'></div>
<div id='code' class='view active edit <% if (markdown) { %> markdown<% } %>'></div>
<div id='preview' class='view preview prose'><%= markdown ? marked(content) : '' %></div>
</div>
</div>
</script>
<script data-template='posts' type='text/html'>
<div class='topbar content-search'>
<span class='icon search inline fr'></span>
<input type='text' id='filter' placeholder='Filter Files' />
</div>
<% if (path.length) { %>
<div class='breadcrumb'>
<a class='branch' href='#<%= [user, repo, "tree", branch].join("/") %>'>..</a>
<% _.each(_.chunkedPath(path), function(p) { %>
<span class='slash'>/</span>
<a class='path' href='#<%= [user, repo, "tree", branch, p.url].join("/") %>'><%= p.name %></a>
<% }); %>
</div>
<% } %>
<ul id='files' class='listing'></ul>
</script>
<script data-template='profile' type='text/html'>
<div class='topbar content-search'>
<span class='icon search inline fr'></span>
<input type='text' id='filter' placeholder='Filter projects' />
</div>
<ul id='projects' class='listing'></ul>
</script>
<script data-template='start' type='text/html'>
<% if (!authenticated) { %>
<div class='round splash'>
<h2 class='icon landing'>Prose</h2>
<div class='inner'>
<p>Prose is a content editor for GitHub designed for managing websites.</p>
<p><a href='/about.html'>Learn more</a></p>
<a class='round button' href='https://github.com/login/oauth/authorize?client_id=c602a8bd54b1e774f864&scope=repo,user,gist'>Authorize with GitHub</a>
</div>
</div>
<% } %>
</script>
<!-- Sidebar Views -->
<script data-template='sidebarOrganizations' type='text/html'>
<% if (authenticated) { %>
<div class='inner'>
<h2 class='label'>Groups</h2>
</div>
<ul class='listing'>
<% if (organizations && organizations.length) { %>
<li>
<a href='#<%= app.username %>' title='<%= app.username %>'>
<span class='icon folder-group inline small'></span>
<%= app.username %>
</a>
</li>
<% _.each(organizations, function(org) { %>
<li>
<a href='#<%= org.login %>' title='<%= org.login %>'>
<span class='icon folder-group inline small'></span>
<%= org.login %>
</a>
</li>
<% }); %>
<% } %>
</ul>
<% } %>
</script>
<script data-template='sidebarProject' type='text/html'>
<% if (authenticated) { %>
<div class='inner'>
<% if (app.state.branches.length > 0) { %>
<h2 class='label'>Switch Branch</h2>
<select data-placeholder='Current Branch Name' class='chzn-select'>
<option value='#<%= [user, repo, "tree", app.state.branch].join("/") %>' selected><%= app.state.branch %></option>
<% _.each(app.state.branches, function(branch) { %>
<option value='#<%= [user, repo, "tree", branch].join("/") %>'><%= branch %></option>
<% }); %>
</select>
<% } %>
</div>
<% } %>
</script>
<script data-template='settings' type='text/html'>
<% if (jekyll) { %>
<div id='meta' class='meta inner'></div>
<% } %>
<% if (window.authenticated) { %>
<div class='inner'>
<div class='commit'>
<textarea class='commit-message' placeholder='Describe your Changes'></textarea>
<a class='icon inline small cancel' href='#' title='ESC'>
×<span class='popup round arrow-left'>Cancel</span>
</a>
</div>
<a class='save button round' href='#'>
<%= writeable ? 'Save' : 'Submit Change' %>
<span class='popup round arrow-left'>⌘ + s</span>
</a>
<% if (jekyll && markdown) { %>
<a href='#' class='toggle publish button round'>Publish</a>
<% } %>
<% if (app.state.config && app.state.config.languages) { %>
<% _(app.state.config.languages).each(function(lang) { %>
<% if (metadata.lang && metadata.lang !== lang.key) { %>
<a class='translate round button' href='#<%= lang.key %>'>Translate to <%= lang.name %></a>
<% } %>
<% }); %>
<% } %>
<a class='delete button round' href='#'>Delete this File</a>
</div>
<% } %>
</script>
<!-- Metadata Views -->
<script data-template='text' type='text/html'>
<label for='<%= name %>'><%= label %></label>
<input type='text' name='<%= name %>' value='<%= value %>' />
</script>
<script data-template='multiselect' type='text/html'>
<label for='<%= name %>'><%= label %></label>
<select name='<%= name %>' data-placeholder='<%= placeholder %>' multiple class='chzn-select'>
<% _(options).each(function(o) { %>
<% if (o.name) { %>
<option value='<%= o.value %>'><%= o.name %></option>
<% } else { %>
<option value='<%= o.value %>'><%= o.value %></option>
<% } %>
<% }); %>
</select>
</script>
<script data-template='select' type='text/html'>
<label for='<%= name %>'><%= label %></label>
<select name='<%= name %>' data-placeholder='<%= placeholder %>' class='chzn-select'>
<% _(options).each(function(o) { %>
<% if (o.name) { %>
<option value='<%= o.value %>'><%= o.name %></option>
<% } else { %>
<option value='<%= o.value %>'><%= o.value %></option>
<% } %>
<% }); %>
</select>
</script>
<!-- Directory Listings -->
<script data-template='files' type='text/html'>
<% _.each(files, function(f, i) { %>
<% if (f.type === 'tree') { %>
<!-- folders -->
<li><a class='item' data-index='<%= i %>' href='#<%= user %>/<%= repo %>/tree/<%= branch %><%= f.path ? "/" +f.path : "" %>'>
<span class='icon inline small folder'></span>
<%= f.path === _.parentPath(currentPath) ? ".." : f.name %>
</a></li>
<% } else { %>
<!-- files -->
<%
var parts = f.name.split('.');
var extension = parts.pop().toLowerCase();
var filename = parts.slice(0, parts.length).join('');
%>
<% if (app.state.jekyll && extension === 'md') { %>
<li class='markdown'>
<a class='clearfix item' data-index='<%= i %>' href='#<%= user %>/<%= repo %>/edit/<%= branch %>/<%= f.path %>'>
<span class='fl icon round md'></span>
<span class='fl details'>
<h3><%= filename || 'Untitled' %></h3>
<span class='deemphasize'><%= f.name %></span>
</span>
</a>
</li>
<% } else { %>
<li><a class='light item' data-index='<%= i %>' href='#<%= user %>/<%= repo %>/edit/<%= branch %>/<%= f.path %>'>
<span class='icon inline small file <%= extension %>'></span>
<%= f.name || 'Untitled' %>
</a></li>
<% } %>
<% } %>
<% }); %>
</script>
<script data-template='projects' type='text/html'>
<% if (state && (app.username === state.user)) { %>
<% _.each(owners, function(repos, owner) { %>
<% _.each(repos, function(r, i) { %>
<li class='clearfix' data-index='<%= i %>'>
<% if (r.private) { %>
<div class='fl icon round repo private'></div>
<% } else { %>
<div class='fl icon round repo'></div>
<% } %>
<div class='details fl'>
<a data-user='<%= r.owner.login %>' data-repo='<%= r.name %>' href='#<%= r.owner.login %>/<%= r.name %>'>
<h3><%= r.name %></h3>
</a>
<span class='deemphasize'><%= r.description %></span>
</div>
<div class='fl actions cleafix'>
<a
data-user='<%= r.owner.login %>'
data-repo='<%= r.name %>'
href='#<%= r.owner.login %>/<%= r.name %>'>
View Project
</a>
<% if (r.homepage) { %>
<a href='<%= r.homepage %>'>View Site</a>
<% } %>
</div>
</li>
<% }); %>
<% }); %>
<% } else { %>
<% _.each(repos, function(r, i) { %>
<li class='clearfix' data-index='<%= i %>'>
<% if (r.private) { %>
<div class='fl icon round repo private'></div>
<% } else { %>
<div class='fl icon round repo'></div>
<% } %>
<div class='details fl'>
<a data-user='<%= r.owner.login %>' data-repo='<%= r.name %>' href='#<%= r.owner.login %>/<%= r.name %>'>
<h3><%= r.name %></h3>
</a>
<span class='deemphasize'><%= r.description %></span>
</div>
<div class='fl actions cleafix'>
<a
data-user='<%= r.owner.login %>'
data-repo='<%= r.name %>'
href='#<%= r.owner.login %>/<%= r.name %>'>
View Project
</a>
<% if (r.homepage) { %>
<a href='<%= r.homepage %>'>View Site</a>
<% } %>
</div>
</li>
<% }); %>
<% } %>
</script>
</head>
<body>
<div id='prose'></div>
<div class='footer'>
<div class='limiter clearfix'>
<div class='fr brand'>
<a href='https://github.com/prose/prose#readme'>Prose v1.0.0</a>
</div>
<a class='prose-logo' href='./'>
<span class='icon branding'>
Prose
</span>
</a>
<ul class='menu clearfix fl'>
<li><a class='help' href='./help.html'><span class='icon inline small help'></span>Help</a></li>
<li><a class='about' href='./about.html'><span class='icon inline small about'></span>About</a></li>
</ul>
</div>
</div>
<script src='prose.js'></script>
</body>
</html>