Sha256: f005e7733c93fe8ca8ab4d828dae4b03f9f9a5a543ff1d1cda7627e20b6316ea

Contents?: true

Size: 1.68 KB

Versions: 1

Compression:

Stored size: 1.68 KB

Contents

# External dependencies
require 'netzke-core'
require 'searchlogic'

require 'netzke/ar_ext'

# Default boot config
Netzke::Base.config.merge!({
  :grid_panel => {:filters => true}
}.recursive_merge(Object.const_defined?(:NETZKE_BOOT_CONFIG) ? Object.const_get(:NETZKE_BOOT_CONFIG) : {}))

%w{ models }.each do |dir|
  path = File.join(File.dirname(__FILE__), 'app', dir)
  $LOAD_PATH << path
  ActiveSupport::Dependencies.load_paths << path
  ActiveSupport::Dependencies.load_once_paths.delete(path)
end

# Include the javascript
Netzke::Base.config[:javascripts] << "#{File.dirname(__FILE__)}/../javascripts/basepack.js"
Netzke::Base.config[:javascripts] << "#{File.dirname(__FILE__)}/../javascripts/check_column.js"

# TODO: implement configurable loading of JS, to spare the traffic at the initial loading
extjs_dir = "#{RAILS_ROOT}/public/extjs"

# Filters in GridPanel
if Netzke::Base.config[:grid_panel][:filters]
  Netzke::Base.config[:javascripts] << "#{extjs_dir}/examples/grid-filtering/menu/EditableItem.js"
  Netzke::Base.config[:javascripts] << "#{extjs_dir}/examples/grid-filtering/menu/RangeMenu.js"
  Netzke::Base.config[:javascripts] << "#{extjs_dir}/examples/grid-filtering/grid/GridFilters.js"
  %w{Boolean Date List Numeric String}.unshift("").each do |f|
    Netzke::Base.config[:javascripts] << "#{extjs_dir}/examples/grid-filtering/grid/filter/#{f}Filter.js"
  end
  Netzke::Base.config[:javascripts] << "#{File.dirname(__FILE__)}/../javascripts/filters.js"
end

# Make this plugin reloadable for easier development
ActiveSupport::Dependencies.load_once_paths.delete(File.join(File.dirname(__FILE__)))

# Include CSS
Netzke::Base.config[:css] << "#{File.dirname(__FILE__)}/../css/basepack.css"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
netzke-basepack-0.3.1 lib/netzke-basepack.rb