urbit/pub/paste/elem.hook
C. Guy Yarvin a0a2cdf64f Revert "Cleanup commit #1; revert this when ready to merge."
This reverts commit c12823babc63665e30fe4e3935ccda80601d6cf8.
2016-01-25 16:49:09 -08:00

42 lines
1.3 KiB
Plaintext

/= all /; flop /^ (list (pair time *)) /: /%%/ /& /mime/
;div
;link(rel "stylesheet", href "/home/lib/base.css");
;link(rel "stylesheet", href "/home/pub/paste/main.css");
;script@"//code.jquery.com/jquery-2.1.4.min.js";
;script@"/~/as/own/~/at/home/lib/urb.js";
;script:'''
document.title = 'pastebin - urbit'
urb.appl = 'write'
urb.send.mark = 'write-paste'
submit = function(){
if($("select :selected").attr('value')===undefined) {
$("select").addClass('err')
return false
}
$("select").removeClass('err')
$("textarea,button").attr('disabled', true)
urb.send({
txt:$("textarea").val(),
typ:$("select :selected").val()
}, function(){
$.getJSON('paste/new.json',null,function(resp){
if(!resp) throw "No paste"
window.location = "paste/"+resp.u
})})
}
'''
::
;h1: New
;p:textarea;
;select
;option(): Type
;option(value "md"): Markdown
;option(value "txt"): Text
;option(value "hoon"): Hoon
==
;button(onclick "submit()"):"Submit"
;hr;
;h1: Recent
;* (turn all |=([a=time *] ;p:a/"paste/{<a>}":"{<a>}"))
==