Loading lib/jsduck/tag/class.rb +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ module JsDuck::Tag :small => File.dirname(__FILE__) + "/icons/class.png", :large => File.dirname(__FILE__) + "/icons/class-large.png", :redirect => File.dirname(__FILE__) + "/icons/class-redirect.png", :priority => PRIORITY_CLASS, } end Loading lib/jsduck/tag/component.rb +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ module JsDuck::Tag :small => File.dirname(__FILE__) + "/icons/component.png", :large => File.dirname(__FILE__) + "/icons/component-large.png", :redirect => File.dirname(__FILE__) + "/icons/component-redirect.png", :priority => PRIORITY_COMPONENT, } super end Loading lib/jsduck/tag/singleton.rb +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ module JsDuck::Tag :small => File.dirname(__FILE__) + "/icons/singleton.png", :large => File.dirname(__FILE__) + "/icons/singleton-large.png", :redirect => File.dirname(__FILE__) + "/icons/singleton-redirect.png", :priority => PRIORITY_SINGLETON, } @signature = {:long => "singleton", :short => "single"} @css = <<-EOCSS Loading lib/jsduck/tag/tag.rb +12 −2 Original line number Diff line number Diff line Loading @@ -135,13 +135,23 @@ module JsDuck::Tag # Defines custom class icon files. # # It must be a hash with keys :small, :large, :redirect - # each referencing an icon file. # It must be a hash with the following keys: # # - :large - the large icon used in class header # - :small - small icon used in class tree and search # - :redirect - redirect icon for alternateClassNames in search. # - :priority - a number to determine which icon gets used when # a class has several tags that set a custom icon. An icon # with a larger priority wins. # # Used by @class tag to define the default icon. # Used by @singleton and @component tags for a different icon. attr_reader :class_icon PRIORITY_SINGLETON = 2 PRIORITY_COMPONENT = 1 PRIORITY_CLASS = 0 # Returns all descendants of JsDuck::Tag::Tag class. def self.descendants result = [] Loading lib/jsduck/web/class_icons.rb +3 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,9 @@ module JsDuck end def self.class_icon_providers TagRegistry.class_icon_providers @providers ||= TagRegistry.class_icon_providers.sort do |a, b| a.class_icon[:priority] <=> b.class_icon[:priority] end.reverse end end Loading Loading
lib/jsduck/tag/class.rb +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ module JsDuck::Tag :small => File.dirname(__FILE__) + "/icons/class.png", :large => File.dirname(__FILE__) + "/icons/class-large.png", :redirect => File.dirname(__FILE__) + "/icons/class-redirect.png", :priority => PRIORITY_CLASS, } end Loading
lib/jsduck/tag/component.rb +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ module JsDuck::Tag :small => File.dirname(__FILE__) + "/icons/component.png", :large => File.dirname(__FILE__) + "/icons/component-large.png", :redirect => File.dirname(__FILE__) + "/icons/component-redirect.png", :priority => PRIORITY_COMPONENT, } super end Loading
lib/jsduck/tag/singleton.rb +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ module JsDuck::Tag :small => File.dirname(__FILE__) + "/icons/singleton.png", :large => File.dirname(__FILE__) + "/icons/singleton-large.png", :redirect => File.dirname(__FILE__) + "/icons/singleton-redirect.png", :priority => PRIORITY_SINGLETON, } @signature = {:long => "singleton", :short => "single"} @css = <<-EOCSS Loading
lib/jsduck/tag/tag.rb +12 −2 Original line number Diff line number Diff line Loading @@ -135,13 +135,23 @@ module JsDuck::Tag # Defines custom class icon files. # # It must be a hash with keys :small, :large, :redirect - # each referencing an icon file. # It must be a hash with the following keys: # # - :large - the large icon used in class header # - :small - small icon used in class tree and search # - :redirect - redirect icon for alternateClassNames in search. # - :priority - a number to determine which icon gets used when # a class has several tags that set a custom icon. An icon # with a larger priority wins. # # Used by @class tag to define the default icon. # Used by @singleton and @component tags for a different icon. attr_reader :class_icon PRIORITY_SINGLETON = 2 PRIORITY_COMPONENT = 1 PRIORITY_CLASS = 0 # Returns all descendants of JsDuck::Tag::Tag class. def self.descendants result = [] Loading
lib/jsduck/web/class_icons.rb +3 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,9 @@ module JsDuck end def self.class_icon_providers TagRegistry.class_icon_providers @providers ||= TagRegistry.class_icon_providers.sort do |a, b| a.class_icon[:priority] <=> b.class_icon[:priority] end.reverse end end Loading