22
33$ ( document ) . ready ( function ( ) {
44 var annotations = $ ( "dt:contains('Annotations')" ) . next ( "dd" ) . children ( "span.name" ) ;
5- addBadges ( annotations , "AlphaComponent" , ":: AlphaComponent ::" , "<span class='experimental badge'>ALPHA COMPONENT </span>" ) ;
5+ addBadges ( annotations , "AlphaComponent" , ":: AlphaComponent ::" , "<span class='alphaComponent badge'>Alpha Component </span>" ) ;
66 addBadges ( annotations , "DeveloperApi" , ":: DeveloperApi ::" , "<span class='developer badge'>Developer API</span>" ) ;
77 addBadges ( annotations , "Experimental" , ":: Experimental ::" , "<span class='experimental badge'>Experimental</span>" ) ;
88} ) ;
99
1010function addBadges ( allAnnotations , name , tag , html ) {
11- var fullName = "org.apache.spark.annotations." + name ;
12- var annotations = allAnnotations . children ( "a[name='" + fullName + "']" ) ;
13- var tags = $ ( "p.comment:contains(" + tag + ")" ) . add (
14- $ ( "div.comment p:contains(" + tag + ")" ) ) ;
11+ var annotations = allAnnotations . filter ( ":contains('" + name + "')" )
12+ var tags = $ ( ".cmt:contains(" + tag + ")" )
1513
1614 // Remove identifier tags from comments
1715 tags . each ( function ( index ) {
@@ -21,7 +19,8 @@ function addBadges(allAnnotations, name, tag, html) {
2119 } ) ;
2220
2321 // Add badges to all containers
24- tags . prevAll ( "h4.signature" ) . prepend ( html ) ;
25- annotations . closest ( "div.fullcomment" ) . prevAll ( "h4.signature" ) . prepend ( html ) ;
26- annotations . closest ( "div.fullcommenttop" ) . prepend ( html ) ;
22+ tags . prevAll ( "h4.signature" )
23+ . add ( annotations . closest ( "div.fullcommenttop" ) )
24+ . add ( annotations . closest ( "div.fullcomment" ) . prevAll ( "h4.signature" ) )
25+ . prepend ( html ) ;
2726}
0 commit comments