Skip to content

Commit

Permalink
allow channel and action page names to vary by site (for facebook apps)
Browse files Browse the repository at this point in the history
  • Loading branch information
vii committed Apr 25, 2010
1 parent e59a740 commit 557b47c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/webapp/actions.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
,@body))

(defmacro page-action-link (&body body)
`(page-link +action-page-name+ :.id. (register-action-id (page-action-lambda ,@body))))
`(page-link (action-page-name (current-site)) :.id. (register-action-id (page-action-lambda ,@body))))

(defmacro html-replace-link (text &body body)
(with-unique-names (body-func)
Expand Down Expand Up @@ -124,7 +124,8 @@
(channel-respond-body .channels. :always-body t)))

(defun register-action-page ()
(defpage-lambda +action-page-name+ #'action-respond-body :defaulting-lambda-list (.id. .javascript.)))
(defpage-lambda (site-action-page-name (current-site))
#'action-respond-body :defaulting-lambda-list (.id. .javascript.)))


(my-defun frame 'simple-channel-body-ml ()
Expand Down
2 changes: 1 addition & 1 deletion src/webapp/channel.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
(apply original-hangup-handler args)))))))))))

(defun register-channel-page ()
(dispatcher-register-path (site-dispatcher (current-site)) +channel-page-name+ #'channel-respond-page))
(dispatcher-register-path (site-dispatcher (current-site)) (site-channel-page-name (current-site)) #'channel-respond-page))

(my-defun channel 'object-to-ml ()
(js-html-script (channel (unquote (force-string (my id))) (unquote (my state)))))
Expand Down
2 changes: 2 additions & 0 deletions src/webapp/site.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
`(with-ml-output
(<title ,title)
(webapp-default-page-head-contents))))
(action-page-name +action-page-name+)
(channel-page-name +channel-page-name+)
(page-body-start
(lambda(title)
`(<h1 ,title)))
Expand Down
2 changes: 1 addition & 1 deletion teepeedee2.asd
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
(:file "site")
(:file "default-site" :depends-on ("site" "webapp" "js-library"))
(:file "js-library" :depends-on ("html-constants" "page"))
(:file "actions" :depends-on ("page" "html-constants" "frame"))
(:file "actions" :depends-on ("page" "html-constants" "frame" "site"))
(:file "channel" :depends-on ("page" "html-constants"))
(:file "webapp" :depends-on ("actions"))
(:file "message-channel" :depends-on ("channel"))))
Expand Down

0 comments on commit 557b47c

Please sign in to comment.