view template/add.jade.mustache @ 7:93d94f327e82

autocomplete in link page box Ignore-this: 9e2c68e81aaac5dcf25ddbbe6c1f25d6
author Drew Perttula <drewp@bigasterisk.com>
date Wed, 06 Mar 2013 23:18:39 -0800
parents f8c4c7ce5f4a
children e054949143e9
line wrap: on
line source

doctype html
html
  head
    title add link
    {{> head.jade}}
  body
    | {{{loginBar}}}
  
    h2 add link

    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...';
    s.style.position='fixed';
    s.style.zIndex='9999';
    s.style.border='2px solid black';
    
    s.style.top='40px';
    s.style.right='40px';
    s.style.bottom='40px';
    s.style.left='40px';
    s.style.background='white';
    document.body.appendChild(s);

    s=document.createElement('script');
    s.setAttribute('type','text/javascript');
    s.setAttribute('src','{{absRoot}}/addOverlay'+
        '?url='+encodeURIComponent(window.location.href)+
        '&title='+encodeURIComponent(document.title)+
        '&selected='+encodeURIComponent(''+(
            window.getSelection ? window.getSelection(): document.getSelection? document.getSelection(): document.selection.createRange().text))
        );
    document.body.appendChild(s);
})();") addlink

    form(method='post', action='{{toRoot}}/{{user}}')
      div URI:
        input(type='text', name='href', data-bind='value: href')
      div Title:
        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', data-bind='value: extended')
      div Private: ...
      div Shared: ..?
        | type name to autocomplete from bigfoaf service
        |    bigfoaf-> people ? q= name_or_email_substr
        |      -> json list of uri, fullname, email, img
        | accumulate foaf uris
        | upon submit, send msgs to c3po who has to buffer them against resends.
        | bigfoaf display should talk to c3po to learn msgs sent from and to this person.
        | 
      div
        button(type='submit', data-bind="text: submitLabel")
          Add

    {{> tail.jade}}
    script(src="{{toRoot}}/static/add.js")
    script
      model.href({{{fillHrefJson}}})