Sha256: afeb4716a702097d7a46cdb1449911d6269d713887bf6007b24c16ba4edfd5c7

Contents?: true

Size: 918 Bytes

Versions: 29

Compression:

Stored size: 918 Bytes

Contents

module ActiveScaffold::Bridges
  class DatePicker < ActiveScaffold::DataStructures::Bridge
    autoload :Helper, 'active_scaffold/bridges/date_picker/helper'
    def self.install
      require File.join(File.dirname(__FILE__), 'date_picker/ext.rb')
    end
    def self.install?
      ActiveScaffold.js_framework == :jquery && jquery_ui_included?
    end
    def self.jquery_ui_included?
      Jquery::Rails.const_defined?('JQUERY_UI_VERSION') || Jquery.const_defined?('Ui') if Object.const_defined?('Jquery')
    end
    def self.localization
      "jQuery(function($){
  if (typeof($.datepicker) === 'object') {
    #{Helper.date_options_for_locales}
    $.datepicker.setDefaults($.datepicker.regional['#{::I18n.locale}']);
  }
  if (typeof($.timepicker) === 'object') {
    #{Helper.datetime_options_for_locales}
    $.timepicker.setDefaults($.timepicker.regional['#{::I18n.locale}']);
  }
});\n"
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
active_scaffold-3.4.43 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.42 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.41.1 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.41 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.40 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.39 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.38 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.37 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.36 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.35 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.34 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.33 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.32 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.31 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.30 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.29 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.28 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.27 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.26 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.4.25 lib/active_scaffold/bridges/date_picker.rb