annotate template/add.jade.mustache @ 6:ce779bdd2fb3

links to peers Ignore-this: 31f60d68f279b53eee2f38b1f570c6c9
author Drew Perttula <drewp@bigasterisk.com>
date Fri, 01 Mar 2013 01:24:05 -0800
parents f8c4c7ce5f4a
children 93d94f327e82
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
1 doctype html
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
2 html
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
3 head
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
4 title add link
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
5 {{> head.jade}}
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
6 body
5
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
7 | {{{loginBar}}}
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
8
4
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
9 h2 add link
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
10
5
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
11 p Bookmarklet to jump to the add page from a given page:
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
12 a(href="javascript:(function(){
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
13 window.location.href = '{{absRoot}}/addLink?url='+encodeURIComponent(window.location.href)+
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
14 '&title='+encodeURIComponent(document.title)+
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
15 '&selected='+encodeURIComponent(''+(
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
16 window.getSelection ? window.getSelection(): document.getSelection? document.getSelection(): document.selection.createRange().text));
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
17 })()") addpage
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
18
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
19 p Bookmarklet to get this form over any page (unfinished):
4
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
20 a(href="javascript:(function(){
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
21 var s=document.createElement('div');
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
22 s.innerHTML='Loading...';
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
23 s.style.position='fixed';
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
24 s.style.zIndex='9999';
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
25 s.style.border='2px solid black';
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
26
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
27 s.style.top='40px';
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
28 s.style.right='40px';
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
29 s.style.bottom='40px';
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
30 s.style.left='40px';
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
31 s.style.background='white';
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
32 document.body.appendChild(s);
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
33
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
34 s=document.createElement('script');
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
35 s.setAttribute('type','text/javascript');
5
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
36 s.setAttribute('src','{{absRoot}}/addOverlay'+
4
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
37 '?url='+encodeURIComponent(window.location.href)+
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
38 '&title='+encodeURIComponent(document.title)+
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
39 '&selected='+encodeURIComponent(''+(
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
40 window.getSelection ? window.getSelection(): document.getSelection? document.getSelection(): document.selection.createRange().text))
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
41 );
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
42 document.body.appendChild(s);
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
43 })();") addlink
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
44
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
45 form(method='post', action='{{toRoot}}/{{user}}')
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
46 div URI:
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
47 input(type='text', name='href', data-bind='value: href')
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
48 div Title:
5
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
49 input(type='text', name='description', data-bind='value: description')
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
50 div Tags (space-separated):
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
51 input(type='text', name='tag', data-bind='value: tag')
4
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
52 div Comment:
5
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
53 textarea(name='extended', data-bind='value: extended')
4
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
54 div Private: ...
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
55 div Shared: ..?
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
56 div
5
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
57 button(type='submit', data-bind="text: submitLabel")
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
58 Add
4
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
59
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
60 {{> tail.jade}}
409da49c148d partway though add
drewp@bigasterisk.com
parents:
diff changeset
61 script(src="{{toRoot}}/static/add.js")
5
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
62 script
f8c4c7ce5f4a lots of href additions: add/edit, nav fixes
Drew Perttula <drewp@bigasterisk.com>
parents: 4
diff changeset
63 model.href({{{fillHrefJson}}})