Mercurial > code > home > repos > href
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 |
rev | line source |
---|---|
4 | 1 doctype html |
2 html | |
3 head | |
4 title add link | |
5 {{> head.jade}} | |
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 | 9 h2 add link |
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 | 20 a(href="javascript:(function(){ |
21 var s=document.createElement('div'); | |
22 s.innerHTML='Loading...'; | |
23 s.style.position='fixed'; | |
24 s.style.zIndex='9999'; | |
25 s.style.border='2px solid black'; | |
26 | |
27 s.style.top='40px'; | |
28 s.style.right='40px'; | |
29 s.style.bottom='40px'; | |
30 s.style.left='40px'; | |
31 s.style.background='white'; | |
32 document.body.appendChild(s); | |
33 | |
34 s=document.createElement('script'); | |
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 | 37 '?url='+encodeURIComponent(window.location.href)+ |
38 '&title='+encodeURIComponent(document.title)+ | |
39 '&selected='+encodeURIComponent(''+( | |
40 window.getSelection ? window.getSelection(): document.getSelection? document.getSelection(): document.selection.createRange().text)) | |
41 ); | |
42 document.body.appendChild(s); | |
43 })();") addlink | |
44 | |
45 form(method='post', action='{{toRoot}}/{{user}}') | |
46 div URI: | |
47 input(type='text', name='href', data-bind='value: href') | |
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 | 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 | 54 div Private: ... |
55 div Shared: ..? | |
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 | 59 |
60 {{> tail.jade}} | |
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}}}) |