Pastebin and source web app updates

release
Slava Pestov 2007-12-08 15:14:24 -05:00
parent cce5b733a6
commit 88f06748f6
3 changed files with 7 additions and 8 deletions

View File

@ -1,7 +1,7 @@
<% USING: furnace namespaces ; %> <% USING: furnace namespaces ; %>
<% <%
"new paste" "title" set "New paste" "title" set
"header" render-template "header" render-template
%> %>

View File

@ -79,9 +79,10 @@ SYMBOL: store
pastebin-pastes 2dup length swap set-paste-n push ; pastebin-pastes 2dup length swap set-paste-n push ;
: submit-paste ( summary author channel mode contents -- ) : submit-paste ( summary author channel mode contents -- )
<paste> <paste> [
\ pastebin get-global add-paste \ pastebin get-global add-paste
save-pastebin-store ; save-pastebin-store
] keep paste-link permanent-redirect ;
\ submit-paste { \ submit-paste {
{ "summary" v-required } { "summary" v-required }
@ -91,8 +92,6 @@ SYMBOL: store
{ "contents" v-required } { "contents" v-required }
} define-action } define-action
\ submit-paste [ paste-list ] define-redirect
: annotate-paste ( n summary author mode contents -- ) : annotate-paste ( n summary author mode contents -- )
<annotation> swap get-paste <annotation> swap get-paste
paste-annotations push paste-annotations push

View File

@ -1,7 +1,7 @@
! Copyright (C) 2007 Slava Pestov. ! Copyright (C) 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: io.files namespaces webapps.file http.server.responders USING: io.files namespaces webapps.file http.server.responders
xmode.code2html kernel ; xmode.code2html kernel html ;
IN: webapps.source IN: webapps.source
global [ global [
@ -12,7 +12,7 @@ global [
[ [
drop drop
serving-html serving-html
swap htmlize-stream [ swap htmlize-stream ] with-html-stream
] serve-file-hook set ] serve-file-hook set
file-responder file-responder
] with-scope ] with-scope