lib/masterview/deprecated/directive_base.rb in masterview-0.3.0 vs lib/masterview/deprecated/directive_base.rb in masterview-0.3.1

- old
+ new

@@ -1,13 +1,7 @@ module MasterView - # Namespace module for built-in directive implementations - # that are standard with the MasterView template engine. - # - module Directives - end - # THIS CLASS IS DEPRECATED!!! UPGRADE DIRECTIVES TO USE NEW DirectiveBase # # Base class for directive implementations. # # The standard technique for implementing a directive @@ -79,10 +73,11 @@ # how its processing is hooked up to effect the template output. #++ # class DirectiveBaseOld include PluginLoadTracking + include DirectiveMetadata include DirectiveHelpers # Register a class manually without regard to whether it inherits from DirectiveBase. # Classes which derive from DirectiveBase will automatically be registered as they are # loaded. @@ -91,10 +86,12 @@ #and DirectiveBase.register_directive, in addition to MasterView.register_directive??? #[DJL 04-Jul-2006] MasterView.register_directive(directive_class) end + #DEPRECATED- superseded by DirectiveMetadata attribute_qname + # # Returns the fully qualified attribute name of the directive, # consisting of the directive namespace and the directive attribute name. # # The default MasterView namespace_prefix is used if the directive does not # specify a separate namespace. @@ -109,10 +106,12 @@ def self.full_attr_name( namespace_prefix ) #TODO: fix this so that directives can override to define their own namespace separate from mv: namespace_prefix + self.attr_name end + #DEPRECATED- superseded by DirectiveMetadata attribute_name + # # Returns the attribute name of the directive. # # Use full_attr_name to obtain the fully-qualified name # of the directive attribute with the qualifying namespace prefix. # @@ -122,10 +121,11 @@ # def self.attr_name() self.default_attr_name() end + #DEPRECATED- superseded by DirectiveMetadata default_directive_name def self.default_attr_name() #:nodoc: self.name.split(':').last.downcase_first_letter end # Construct a directive processor for the attribute_value @@ -271,9 +271,10 @@ parse(attr_value) end # check for common html options and return the hash def common_html_options(attrs_lck) + ####CHANGED: new DirectiveBase provides more extensive list options = {} options[:id] = attrs_lck['id'] if attrs_lck['id'] options[:class] = attrs_lck['class'] if attrs_lck['class'] options[:style] = attrs_lck['style'] if attrs_lck['style'] options[:tabindex] = attrs_lck['tabindex'] if attrs_lck['tabindex']