Mercurial > code > home > repos > href
diff template/add.jade.mustache @ 5:f8c4c7ce5f4a
lots of href additions: add/edit, nav fixes
Ignore-this: 863335c4680ac9bcc6a7fc5867638d61
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Thu, 21 Feb 2013 01:39:01 -0800 |
parents | 409da49c148d |
children | 93d94f327e82 |
line wrap: on
line diff
--- a/template/add.jade.mustache Sun Feb 17 21:12:53 2013 -0800 +++ b/template/add.jade.mustache Thu Feb 21 01:39:01 2013 -0800 @@ -4,9 +4,19 @@ title add link {{> head.jade}} body + | {{{loginBar}}} + h2 add link - p Bookmarklet to get this form over any page: + p Bookmarklet to jump to the add page from a given page: + a(href="javascript:(function(){ + window.location.href = '{{absRoot}}/addLink?url='+encodeURIComponent(window.location.href)+ + '&title='+encodeURIComponent(document.title)+ + '&selected='+encodeURIComponent(''+( + window.getSelection ? window.getSelection(): document.getSelection? document.getSelection(): document.selection.createRange().text)); + })()") addpage + + p Bookmarklet to get this form over any page (unfinished): a(href="javascript:(function(){ var s=document.createElement('div'); s.innerHTML='Loading...'; @@ -23,7 +33,7 @@ s=document.createElement('script'); s.setAttribute('type','text/javascript'); - s.setAttribute('src','http://plus:10002/addOverlay'+ + s.setAttribute('src','{{absRoot}}/addOverlay'+ '?url='+encodeURIComponent(window.location.href)+ '&title='+encodeURIComponent(document.title)+ '&selected='+encodeURIComponent(''+( @@ -36,16 +46,18 @@ div URI: input(type='text', name='href', data-bind='value: href') div Title: - input(type='text', name='description') - div Tags: - input(type='text', name='tag') + input(type='text', name='description', data-bind='value: description') + div Tags (space-separated): + input(type='text', name='tag', data-bind='value: tag') div Comment: - textarea(name='extended') + textarea(name='extended', data-bind='value: extended') div Private: ... div Shared: ..? div - button(type='submit') - | Add + button(type='submit', data-bind="text: submitLabel") + Add {{> tail.jade}} script(src="{{toRoot}}/static/add.js") + script + model.href({{{fillHrefJson}}})