Commits

Anonymous committed 2499856

Added clarifying comments about the source tag for scripts (both regular and 'ready') and styles

  • Participants
  • Parent commits a723743

Comments (0)

Files changed (1)

 		  )
   )
 
+(defgeneric tag-library-name-for-tag (*current-tag*)
+  (:documentation "Return the name of the tag library in which the tag is defined")
+  )
+
 (defgeneric tag-expansion (some-tag-symbol)
   (:documentation "Return the macro for expanding a tag expression
 into a tag object"
 ;;; Methods
 ;;;------------------------------------------------------------------------------------
 
+(defmethod tag-library-name-for-tag ( (*current-tag* htmltag) )
+  (package-name (symbol-package (tag-name *current-tag*) ) )
+  )
+
 (defmethod tag-attributes ( (some-tag-name symbol) )
   (select (mapcar (lambda (s) (slot-definition-name s))
 		 (class-slots (find-class some-tag-name))
 
      ,(when script
 	    `(defmethod render-tag-scripts ( (*current-tag* ,name) )
-	         (union-ordered (list ,script) *page-scripts* )
+	         (union-ordered (list (format nil "/* --------- Script for tag ~a:~a ------------- */~%"
+					      (tag-library-name-for-tag *current-tag*)
+					      (tag-name *current-tag*)
+					      )
+				      ,script
+				      ) 
+				*page-scripts* 
+				)
 	       )
 	    )
 
      ,(when ready
 	    `(defmethod render-tag-ready-scripts ( (*current-tag* ,name) )
-	       (union-ordered (list ,ready) *page-ready-scripts*)
+	       (union-ordered (list (format nil "/* --------- Initialization for tag ~a:~a ------------- */~%"
+					      (tag-library-name-for-tag *current-tag*)
+					      (tag-name *current-tag*)
+					      )
+			       ,ready
+			       )
+			      *page-ready-scripts*
+			      )
 	       )
 	    )
 	    
 
      ,(when style
 	    `(defmethod render-tag-styles ( (*current-tag* ,name) )
-	       (union-ordered (list ,style) *page-styles*)
+	       (union-ordered (list (format nil "/* --------- Styles for tag ~a:~a ------------- */~%"
+					    (tag-library-name-for-tag *current-tag*)
+					    (tag-name *current-tag*)
+					    )
+				    ,style
+				    )
+			      *page-styles*
+			      )
 	       )
 	    )