Sha256: 6ea7257926d95834cf0e4a8931447bb1d39ad0e44a984ca2d862ffb9224f6e2f

Contents?: true

Size: 990 Bytes

Versions: 13

Compression:

Stored size: 990 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.stylesheets
      'jquery-ui-timepicker-addon'
    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

13 entries across 13 versions & 1 rubygems

Version Path
active_scaffold-3.7.0 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.20 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.19 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.17 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.15 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.14 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.13 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.12 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.11.1 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.11 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.10 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.9 lib/active_scaffold/bridges/date_picker.rb
active_scaffold-3.6.8 lib/active_scaffold/bridges/date_picker.rb