Class: ActiveScaffold::Bridges::DatePicker

Inherits:
DataStructures::Bridge show all
Defined in:
lib/active_scaffold/bridges/date_picker.rb,
lib/active_scaffold/bridges/date_picker/ext.rb,
lib/active_scaffold/bridges/date_picker/helper.rb

Defined Under Namespace

Modules: AttributeParams, DatePickerBridge, Finder, Helper

Constant Summary collapse

@@default_ui =
true

Class Method Summary collapse

Methods inherited from DataStructures::Bridge

javascripts, prepare, run

Class Method Details

.installObject



4
5
6
# File 'lib/active_scaffold/bridges/date_picker.rb', line 4

def self.install
  require File.join(File.dirname(__FILE__), 'date_picker/ext.rb')
end

.install?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/active_scaffold/bridges/date_picker.rb', line 8

def self.install?
  ActiveScaffold.js_framework == :jquery && jquery_ui_included?
end

.jquery_ui_included?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/active_scaffold/bridges/date_picker.rb', line 12

def self.jquery_ui_included?
  ActiveScaffold.jquery_ui_included?
end

.localizationObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/active_scaffold/bridges/date_picker.rb', line 22

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

.stylesheetsObject



18
19
20
# File 'lib/active_scaffold/bridges/date_picker.rb', line 18

def self.stylesheets
  'jquery-ui-timepicker-addon'
end