module Footnotes module Notes # This is the abstract class for notes. # You can overwrite all instance public methods to create your notes. # class AbstractNote # Class methods. Do NOT overwrite them. # class << self # Returns the symbol that represents this note. # It's the name of the class, underscored and without _note. # # For example, for ControllerNote it will return :controller. # def to_sym @note_sym ||= self.title.underscore.to_sym end # Returns the title that represents this note. # It's the name of the class without Note. # # For example, for ControllerNote it will return Controller. # def title @note_title ||= self.name.match(/^Footnotes::Notes::(\w+)Note$/)[1] end # Return true if Note is included in notes array. # def included? Footnotes::Filter.notes.include?(self.to_sym) end # Action to be called to start the Note. # This is applied as a before_filter. # def start!(controller = nil) end # Action to be called after the Note was used. # This is applied as an after_filter. # def close!(controller = nil) end end # Initialize notes. # Always receives a controller. # def initialize(controller = nil) end # Returns the symbol that represents this note. # def to_sym self.class.to_sym end # Specifies in which row should appear the title. # The default is :show. # def row :show end # Returns the title to be used as link. # The default is the note title. # def title self.class.title end # If has_fieldset? is true, create a fieldset with the value returned as legend. # By default, returns the title of the class (defined above). # def legend self.class.title end # If content is defined, has_fieldset? returns true and the value of content # is displayed when the Note is clicked. See has_fieldset? below for more info. # # def content # end # Set href field for Footnotes links. # If it's nil, Footnotes will use '#'. # def link end # Set onclick field for Footnotes links. # If it's nil, Footnotes will make it open the fieldset. # def onclick end # Insert here any additional stylesheet. # This is directly inserted into a