Anonymous avatar Anonymous committed f3640ed

Convert scripts, styles, style sheets, and script libraries to be render-tag-* methods, for clarity

Comments (0)

Files changed (1)

   (:documentation "Return a list of attribute names for the tag")
   )
 
-(defgeneric shared-scripts (*current-tag*)
+(defgeneric render-tag-scripts (*current-tag*)
   (:documentation
     "Return the script that should be shared by all instances
      of some-tag's class within the same context (page, stylesheet, etc.)
     )
   )
 
-(defgeneric shared-ready-scripts (*current-tag*)
+(defgeneric render-tag-ready-scripts (*current-tag*)
   (:documentation
     "Return a string representing script to run when a page
      first loads
     )
   )
 
-(defgeneric shared-script-libraries (*current-tag*)
+(defgeneric render-tag-script-libraries (*current-tag*)
   (:documentation
     "Return a list of strings pointing to script libraries used
      by instances of this tag
     )
   )
 
-(defgeneric shared-styles (*current-tag*)
+(defgeneric render-tag-styles (*current-tag*)
   (:documentation
     "Return a list of styles expected by instances of this tag
     "
     )
   )
 
-(defgeneric shared-style-sheets (*current-tag*)
+(defgeneric render-tag-style-sheets (*current-tag*)
   (:documentation
     "Return a list of strings pointing to stylesheets used
      by instances of this tag
 	  )
   )
 
-(defmethod shared-scripts ((some-tag-name symbol))
+(defmethod render-tag-scripts ((some-tag-name symbol))
     nil
     )
 
-(defmethod shared-scripts ((*current-tag* htmltag))
+(defmethod render-tag-scripts ((*current-tag* htmltag))
     nil
     )
 
-(defmethod shared-ready-scripts((some-tag-name symbol))
+(defmethod render-tag-ready-scripts((some-tag-name symbol))
     nil
     )
 
-(defmethod shared-ready-scripts((*current-tag* htmltag))
+(defmethod render-tag-ready-scripts((*current-tag* htmltag))
     nil
     )
 
-(defmethod shared-script-libraries((some-tag-name symbol))
+(defmethod render-tag-script-libraries((some-tag-name symbol))
     nil
     )
 
-(defmethod shared-script-libraries ((*current-tag* htmltag))
+(defmethod render-tag-script-libraries ((*current-tag* htmltag))
     nil
   )
 
-(defmethod shared-styles ((some-tag-name symbol))
+(defmethod render-tag-styles ((some-tag-name symbol))
     nil
     )
 
-(defmethod shared-styles ((*current-tag* htmltag))
+(defmethod render-tag-styles ((*current-tag* htmltag))
     nil
   )
 
-(defmethod shared-style-sheets ((some-tag-name symbol))
+(defmethod render-tag-style-sheets ((some-tag-name symbol))
     nil
     )
 
-(defmethod shared-style-sheets ((*current-tag* htmltag))
+(defmethod render-tag-style-sheets ((*current-tag* htmltag))
   nil
   )
 
   )
 
 (defmethod render-as-html ( (*current-tag* htmltag) )
-  ;; Render shared aspects first, which may result in no-op if not
-  ;; being captured
 
-  ;; TODO could move this into a common "setup rendering context" type of method,
-  ;; called from here and defhtmltag
-  ;; OR genericize this further, so that this is the only method specialization
-  ;; required--defhtmltag just declares the extra methods needed for the tag,
-  ;; with this method here providing the generalized rendering routine
-  (union-ordered (shared-script-libraries *current-tag* ) *page-script-libraries* )
-  (union-ordered (shared-scripts *current-tag* ) *page-scripts* )
-  (union-ordered (shared-styles *current-tag* ) *page-styles* )
-  (union-ordered (shared-style-sheets *current-tag* ) *page-style-sheets* )
-  (union-ordered (shared-ready-scripts *current-tag* ) *page-ready-scripts* )
+  (union-ordered (render-tag-script-libraries *current-tag* ) *page-script-libraries* )
+  (union-ordered (render-tag-scripts *current-tag* ) *page-scripts* )
+  (union-ordered (render-tag-styles *current-tag* ) *page-styles* )
+  (union-ordered (render-tag-style-sheets *current-tag* ) *page-style-sheets* )
+  (union-ordered (render-tag-ready-scripts *current-tag* ) *page-ready-scripts* )
 
   (render-tag-content *current-tag* )
 )
 	      )
 
      ,(when script
-	    `(defmethod shared-scripts ( (*current-tag* ,name) )
+	    `(defmethod render-tag-scripts ( (*current-tag* ,name) )
 	       (list ,script)
 	       )
 	    )
 
      ,(when ready
-	    `(defmethod shared-ready-scripts ( (*current-tag* ,name) )
+	    `(defmethod render-tag-ready-scripts ( (*current-tag* ,name) )
 	       (list ,ready)
 	       )
 	    )
 	    
      ,(when script-libraries
-	    `(defmethod shared-script-libraries ( (*current-tag* ,name) )
+	    `(defmethod render-tag-script-libraries ( (*current-tag* ,name) )
 	       ,script-libraries
 	       )
 	    )
 
      ,(when style
-	    `(defmethod shared-styles ( (*current-tag* ,name) )
+	    `(defmethod render-tag-styles ( (*current-tag* ,name) )
 	       (list ,style)
 	       )
 	    )
 
      ,(when style-sheets
-	    `(defmethod shared-style-sheets ( (*current-tag* ,name) )
+	    `(defmethod render-tag-style-sheets ( (*current-tag* ,name) )
 	       ,style-sheets
 	       )
 	    )
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.