lib/cytoplasm.rb in cytoplasm-0.3.9 vs lib/cytoplasm.rb in cytoplasm-0.4.0

- old
+ new

@@ -1,7 +1,20 @@ +# Load core require 'cytoplasm/version' require 'cytoplasm/railtie' + +# Load plugins +[ + 'button', + 'colorpicker', + 'radio', + 'select', + 'slider', + 'table', + 'upload' +].each {|plugin| require 'cytoplasm/plugins/'+plugin} + require 'yaml' require 'active_support/core_ext/hash/deep_merge' module Cytoplasm # List of all Cytoplasm variables, with their corresponding default values. @@ -323,9 +336,16 @@ (0...50).map{('a'..'z').to_a[rand(26)]}.join end def index + end + + def self.addClass(options,newclasses) + options[:class] ||= "" + newclasses = [newclasses] if newclasses.is_a? String + newclasses.each_with_index {|c,i| options[:class] += ((i>0)?" ":"")+c.to_s} + return options end # Instantiate engine module Rails class Engine < ::Rails::Engine \ No newline at end of file