;;; -*- mode: Lisp; Syntax: Common-Lisp; -*- ;;; ;;; Copyright (c) 2009 by the authors. ;;; ;;; See LICENCE for details. (in-package :hu.dwim.presentation) ;;;;;; ;;; API (def (generic e) application-relative-path-for-no-javascript-support-error (application) (:method ((application application)) "/help/")) ;;;;;; ;;; frame/widget (def (component e) frame/widget (top/component layer/mixin) ((content-mime-type +xhtml-mime-type+) (stylesheet-uris nil) (script-uris (make-default-script-uris)) (page-icon-uri nil) (title nil))) (def method parent-component-of ((self frame/widget)) nil) (def method supports-debug-component-hierarchy? ((self frame/widget)) #f) ;;;;;; ;;; dojo-frame/widget (def (component e) dojo-frame/widget (frame/widget) ((dojo-skin-name *dojo-skin-name*) (dojo-script-uri (or *dojo-script-uri* (hu.dwim.uri:append-path (hu.dwim.uri:clone-uri *dojo-base-uri*) "dojo/dojo.js"))) (parse-dojo-widgets-on-load #f :type boolean) (debug-client-side :type boolean :writer (setf debug-client-side?)))) (def (macro e) frame/widget ((&rest args &key (widget-library :dojo) &allow-other-keys) &body content) (remove-from-plistf args :widget-library) (ecase widget-library (:dojo `(make-instance 'dojo-frame/widget ,@args :content ,(the-only-element content))))) (def method debug-client-side? ((self dojo-frame/widget)) (if (slot-boundp self 'debug-client-side) (slot-value self 'debug-client-side) (debug-client-side? *application*))) (def component-environment dojo-frame/widget (with-active-layers (dojo-layer) (call-next-method))) ;; we stay with render-xhtml here, because component-environment is reinstated only after us, so the dojo layer is not active yet (def render-xhtml dojo-frame/widget (bind ((application *application*) (application-path (path-of application)) (encoding (or (when *response* (encoding-name-of *response*)) +default-encoding+)) (debug-client-side? (debug-client-side? -self-)) (javascript-supported? (not (request-parameter-value *request* +no-javascript-error-parameter-name+)))) (emit-xhtml-prologue encoding +xhtml-1.1-doctype+) ,(bind (((&optional icon-uri timestamp) (ensure-list (page-icon-uri-of -self-)))) (when icon-uri ))