compass-jquery-plugin 0.3.2.3 → 0.3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +54 -37
- data/VERSION.yml +1 -1
- data/lib/handle_attributes.rb +4 -4
- data/lib/handle_js_files.rb +5 -5
- data/lib/jqtouch_theme.rb +2 -2
- data/lib/jquery/dynatree.rb +2 -2
- data/lib/jquery/emulators.rb +1 -1
- data/lib/jquery/flash_messages.rb +6 -6
- data/lib/jquery/graphics.rb +5 -0
- data/lib/jquery/gridify/assertions.rb +1 -1
- data/lib/jquery/gridify/grid.rb +76 -59
- data/lib/jquery/gridify/grid_column.rb +73 -67
- data/lib/jquery/gridify/grid_finder.rb +79 -79
- data/lib/jquery/gridify/grid_options.rb +154 -149
- data/lib/jquery/gridify/grid_view.rb +143 -143
- data/lib/jquery/gridify.rb +25 -25
- data/lib/jquery/ical/calendar.rb +2 -2
- data/lib/jquery/ical/event.rb +48 -44
- data/lib/jquery/ical/helpers/ui_event_helper.rb +3 -3
- data/lib/jquery/jqgrid/jqgrid.rb +58 -58
- data/lib/jquery/jqgrid.rb +1 -1
- data/lib/jquery/jqtouch.rb +1 -1
- data/lib/jquery/jquery.rb +117 -117
- data/lib/jquery/jquery_auto_complete.rb +9 -9
- data/lib/jquery/jquery_json_response.rb +12 -12
- data/lib/jquery/jquery_selector_assertions.rb +55 -53
- data/lib/jquery/jstree.rb +2 -2
- data/lib/jquery/mobile.rb +1 -1
- data/lib/jquery/ribbon.rb +2 -2
- data/lib/jquery/secret_sauce/controller/ui_dialog_controls.rb +5 -5
- data/lib/jquery/secret_sauce/controller/ui_grid_controls.rb +5 -5
- data/lib/jquery/secret_sauce/helpers/ui_dialog_helper.rb +1 -1
- data/lib/jquery/secret_sauce/helpers/ui_form_helper.rb +39 -39
- data/lib/jquery/secret_sauce/helpers/ui_grid_helper.rb +74 -74
- data/lib/jquery/secret_sauce/model/find_for_grid.rb +21 -21
- data/lib/jquery/secret_sauce.rb +1 -1
- data/lib/jquery/tools.rb +1 -1
- data/lib/jquery_mobile_theme.rb +2 -2
- data/lib/jquery_ui_theme.rb +12 -12
- data/templates/dynatree/config/initializers/dynatree.rb +3 -3
- data/templates/dynatree/jquery/dynatree/aero.scss +16 -16
- data/templates/dynatree/jquery/dynatree/aqua.scss +16 -16
- data/templates/dynatree/jquery/dynatree/crystal.scss +16 -16
- data/templates/dynatree/jquery/dynatree/xp.scss +17 -17
- data/templates/dynatree/jquery.dynatree.js +2926 -2912
- data/templates/emulators/config/initializers/emulators.rb +6 -6
- data/templates/graphics/config/initializers/graphics.rb +5 -0
- data/templates/graphics/jquery/ganttView.scss +89 -0
- data/templates/graphics/jquery.ganttView.js +1669 -0
- data/templates/graphics/jquery.ganttView.min.js +70 -0
- data/templates/{jquery → graphics}/jquery.sparkline.js +466 -438
- data/templates/{jquery → graphics}/jquery.sparkline.min.js +0 -0
- data/templates/graphics/manifest.rb +9 -0
- data/templates/jqgrid/config/initializers/jqgrid.rb +1 -1
- data/templates/jqgrid/i18n/jqgrid/locale-ar.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-bg.js +135 -131
- data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +135 -131
- data/templates/jqgrid/i18n/jqgrid/locale-cat.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-cn.js +137 -131
- data/templates/jqgrid/i18n/jqgrid/locale-cs.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-da.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-de.js +138 -132
- data/templates/jqgrid/i18n/jqgrid/locale-el.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-en.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-es.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-fa.js +19 -16
- data/templates/jqgrid/i18n/jqgrid/locale-fi.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-fr.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-gl.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-he.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-hu.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-is.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-it.js +8 -1
- data/templates/jqgrid/i18n/jqgrid/locale-ja.js +139 -136
- data/templates/jqgrid/i18n/jqgrid/locale-nl.js +4 -1
- data/templates/jqgrid/i18n/jqgrid/locale-no.js +14 -1
- data/templates/jqgrid/i18n/jqgrid/locale-pl.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-pt.js +130 -124
- data/templates/jqgrid/i18n/jqgrid/locale-ro.js +144 -138
- data/templates/jqgrid/i18n/jqgrid/locale-ru.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-sk.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-sr.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-sv.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-tr.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-ua.js +132 -126
- data/templates/jqgrid/jquery.jqGrid.js +12735 -10444
- data/templates/jqgrid/jquery.jqGrid.min.js +477 -469
- data/templates/jqgrid/public/stylesheets/ellipsis-xbl.xml +12 -10
- data/templates/jqtouch/config/initializers/jqtouch.rb +3 -3
- data/templates/jqtouch/jquery/touch/jqtouch.scss +1 -1
- data/templates/jqtouch/jquery.jqtouch.js +10025 -10043
- data/templates/jquery/config/initializers/jquery.rb +2 -4
- data/templates/jquery/history.adapter.jquery.js +71 -0
- data/templates/jquery/history.adapter.jquery.min.js +4 -0
- data/templates/jquery/history.html4.js +690 -0
- data/templates/jquery/history.html4.min.js +21 -0
- data/templates/jquery/history.js +1297 -0
- data/templates/jquery/history.min.js +29 -0
- data/templates/jquery/i18n/jquery.ui/datepicker-af.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-ar.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-az.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-bg.js +8 -8
- data/templates/jquery/i18n/jquery.ui/datepicker-bs.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ca.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-cs.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-da.js +14 -14
- data/templates/jquery/i18n/jquery.ui/datepicker-de.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-el.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-GB.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-eo.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-es.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-et.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-eu.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fa.js +18 -18
- data/templates/jquery/i18n/jquery.ui/datepicker-fi.js +15 -15
- data/templates/jquery/i18n/jquery.ui/datepicker-fo.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fr-CH.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fr.js +22 -22
- data/templates/jquery/i18n/jquery.ui/datepicker-gl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-he.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hu.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hu.min.js +1 -1
- data/templates/jquery/i18n/jquery.ui/datepicker-hy.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-id.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-is.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-it.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ja.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ko.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-kz.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-lt.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-lv.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ml.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ms.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-nl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-no.js +16 -16
- data/templates/jquery/i18n/jquery.ui/datepicker-no.min.js +2 -2
- data/templates/jquery/i18n/jquery.ui/datepicker-pl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-pt-BR.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-pt.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-rm.js +18 -18
- data/templates/jquery/i18n/jquery.ui/datepicker-ro.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ru.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sk.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sq.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sr-SR.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sv.js +14 -14
- data/templates/jquery/i18n/jquery.ui/datepicker-ta.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-th.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-tr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-uk.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-vi.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-CN.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-HK.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-TW.js +20 -20
- data/templates/jquery/{partials → jquery/ui}/_flash_messages.scss +0 -0
- data/templates/jquery/jquery/ui/_theme.scss +14 -13
- data/templates/jquery/jquery/ui/contextMenu/configure.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/copy.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/cut.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/delete.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/edit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/exit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/new.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/paste.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/rename.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/show.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/trash.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu.scss +16 -10
- data/templates/jquery/jquery-ui.js +11839 -23066
- data/templates/jquery/jquery-ui.min.js +401 -795
- data/templates/jquery/jquery.bgiframe.js +27 -25
- data/templates/jquery/jquery.contextMenu.js +209 -196
- data/templates/jquery/jquery.cookie.js +3 -1
- data/templates/jquery/jquery.dotimeout.js +236 -228
- data/templates/jquery/jquery.dst.js +154 -151
- data/templates/jquery/jquery.farbtastic.js +293 -293
- data/templates/jquery/jquery.flashMessages.js +26 -0
- data/templates/jquery/jquery.flashMessages.min.js +1 -0
- data/templates/jquery/jquery.form.js +803 -786
- data/templates/jquery/jquery.haml.js +248 -247
- data/templates/jquery/jquery.hotkeys.js +89 -89
- data/templates/jquery/jquery.js +8141 -8106
- data/templates/jquery/jquery.layout.js +2451 -2415
- data/templates/jquery/jquery.min.js +167 -166
- data/templates/jquery/jquery.mousewheel.js +62 -54
- data/templates/jquery/jquery.offline.js +171 -171
- data/templates/jquery/jquery.pngFix.js +76 -76
- data/templates/jquery/jquery.replacetext.js +83 -83
- data/templates/jquery/jquery.themeswitchertool.js +202 -177
- data/templates/jquery/jquery.tmpl.js +478 -473
- data/templates/jquery/jquery.tmplPlus.js +82 -81
- data/templates/jquery/jrails.js +178 -175
- data/templates/jquery/json.js +77 -7
- data/templates/jquery/json2.js +480 -0
- data/templates/jquery/json2.min.js +7 -0
- data/templates/jquery/lib/tasks/haml.rake +2 -2
- data/templates/jquery/manifest.rb +21 -17
- data/templates/jstree/jquery.jstree.js +5967 -4536
- data/templates/mobile/config/initializers/mobile.rb +1 -1
- data/templates/mobile/jquery/mobile/_base.scss +944 -927
- data/templates/mobile/jquery/mobile/default.scss +61 -48
- data/templates/mobile/jquery/mobile/valencia.scss +56 -42
- data/templates/mobile/jquery.mobile.js +4461 -4347
- data/templates/mobile/jquery.mobile.min.js +11 -2
- data/templates/mobile/lib/tasks/jquery.mobile.rake +12 -12
- data/templates/ribbon/config/initializers/ribbon.rb +2 -2
- data/templates/ribbon/jquery.ribbon.js +50 -29
- data/templates/secret_sauce/secret_sauce.js +8 -8
- data/templates/tools/flowplayer.js +945 -1
- data/templates/tools/jquery.tools.js +4645 -4335
- data/templates/tools/jquery.tools.min.js +37 -37
- data/templates/tools/lib/tasks/jquery.tools.rake +4 -4
- data/templates/tools/swfobject.js +813 -773
- metadata +33 -21
- data/templates/jquery/haml.js +0 -506
- data/templates/jquery/haml.min.js +0 -5
- data/templates/jquery/jquery/ui/contextMenu/door.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_copy.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_delete.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_edit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_new.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_paste.png +0 -0
- data/templates/jquery/jquery.compat-1.3.js +0 -291
- data/templates/jquery/jquery.compat-1.3.min.js +0 -6
- data/templates/jquery/jquery.flash_messages.js +0 -5
- data/templates/jquery/jquery.flash_messages.min.js +0 -1
- data/templates/jquery/jquery.history.js +0 -194
- data/templates/jquery/jquery.history.min.js +0 -5
data/lib/jquery/gridify.rb
CHANGED
@@ -2,41 +2,41 @@ require 'jquery/gridify/grid'
|
|
2
2
|
|
3
3
|
module Gridify
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
def self.included(base)
|
6
|
+
base.extend(ClassMethods)
|
7
|
+
end
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
module ClassMethods
|
10
|
+
attr_accessor :grids
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
def gridify(*args, &block)
|
13
|
+
# debugger
|
14
|
+
grid = Gridify::Grid.new(self, *args, &block)
|
15
|
+
@grids ||= {}
|
16
|
+
@grids[grid.name.to_sym] = grid
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
unless self.respond_to?(:find_for_grid)
|
19
|
+
class_eval <<-EOV
|
20
20
|
named_scope :find_for_grid, lambda {|name, params|
|
21
21
|
grid = grids[name]
|
22
22
|
grid.update_from_params( params )
|
23
23
|
grid.current_scope
|
24
24
|
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
25
|
+
EOV
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def grids
|
30
|
+
@grids || {}
|
31
|
+
end
|
32
|
+
|
33
|
+
def grid(name=nil)
|
34
|
+
name ? grids[name] : grids[:grid]
|
35
|
+
end
|
36
|
+
end
|
37
37
|
end
|
38
38
|
|
39
39
|
class ActiveRecord::Base
|
40
|
-
|
40
|
+
include Gridify
|
41
41
|
end
|
42
42
|
|
data/lib/jquery/ical/calendar.rb
CHANGED
data/lib/jquery/ical/event.rb
CHANGED
@@ -1,118 +1,122 @@
|
|
1
1
|
module Ical
|
2
2
|
module Event
|
3
|
-
|
3
|
+
|
4
4
|
def ical_event
|
5
5
|
@ical_event ||= RiCal.parse_string(ical_string || '').first || RiCal.Event
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
def starts_at
|
9
9
|
@starts_at ||= ical_event.dtstart ? ical_event.dtstart.to_datetime : DateTime.now
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def starts_at=(date_time)
|
13
13
|
@start_time = @start_date = nil
|
14
14
|
@starts_at = date_time
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def start_date
|
18
18
|
@start_date ||= I18n.l(Date.parse(starts_at.to_s))
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def start_date=(string_date)
|
22
22
|
if parsed = DateTime.parse("#{string_date} #{start_time}") rescue nil
|
23
23
|
@starts_at = parsed
|
24
24
|
end
|
25
25
|
@start_date = string_date
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
def start_time
|
29
29
|
@start_time ||= I18n.l(Time.parse(starts_at.to_s), :format => :time)
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
def start_time=(string_time)
|
33
33
|
if parsed = DateTime.parse("#{start_date} #{string_time}") rescue nil
|
34
34
|
@starts_at = parsed
|
35
35
|
end
|
36
36
|
@start_time = string_time
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
def ends_at
|
40
40
|
@ends_at ||= ical_event.dtend ? ical_event.dtend.to_datetime : starts_at + 60.minutes
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
def ends_at=(date_time)
|
44
44
|
@end_time = @end_date = nil
|
45
45
|
@ends_at = date_time
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
def end_date
|
49
49
|
@end_date ||= I18n.l(Date.parse(ends_at.to_s))
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
def end_date=(string_date)
|
53
53
|
if parsed = DateTime.parse("#{string_date} #{end_time}") rescue nil
|
54
54
|
@ends_at = parsed
|
55
55
|
end
|
56
56
|
@end_date = string_date
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
59
|
def end_time
|
60
60
|
@end_time ||= I18n.l(Time.parse(ends_at.to_s), :format => :time)
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
63
|
def end_time=(string_time)
|
64
64
|
if parsed = DateTime.parse("#{end_date} #{string_time}") rescue nil
|
65
65
|
@ends_at = parsed
|
66
66
|
end
|
67
67
|
@end_time = string_time
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
def summary
|
71
71
|
@summary ||= ical_event.summary
|
72
72
|
end
|
73
|
+
|
73
74
|
attr_writer :summary
|
74
|
-
|
75
|
+
|
75
76
|
def location
|
76
77
|
@location ||= ical_event.location
|
77
78
|
end
|
78
|
-
|
79
|
-
|
79
|
+
|
80
|
+
attr_writer :location
|
81
|
+
|
80
82
|
def description
|
81
83
|
@description ||= ical_event.description
|
82
84
|
end
|
85
|
+
|
83
86
|
attr_writer :description
|
84
|
-
|
87
|
+
|
85
88
|
def all_day
|
86
89
|
@all_day ||= ical_event.x_properties["X-MICROSOFT-CDO-ALLDAYEVENT"][0] ? 1 : 0
|
87
90
|
end
|
91
|
+
|
88
92
|
attr_writer :all_day
|
89
|
-
|
93
|
+
|
90
94
|
private
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
else
|
103
|
-
ical_event.dtstart = DateTime.parse("#{start_date}T00:00")
|
104
|
-
ical_event.dtend = ical_event.dtstart+1.day-1.minute
|
105
|
-
end
|
95
|
+
def serialize_ical_event
|
96
|
+
ical_event.summary = summary
|
97
|
+
ical_event.location = location
|
98
|
+
ical_event.description = description
|
99
|
+
ical_event.x_properties["X-MICROSOFT-CDO-ALLDAYEVENT"] = []
|
100
|
+
|
101
|
+
if all_day == "1"
|
102
|
+
ical_event.add_x_property("X-MICROSOFT-CDO-ALLDAYEVENT", "1")
|
103
|
+
if starts_at <= ends_at
|
104
|
+
ical_event.dtstart = DateTime.parse("#{start_date}T00:00")
|
105
|
+
ical_event.dtend = DateTime.parse("#{end_date}T23:59")
|
106
106
|
else
|
107
|
-
|
108
|
-
|
109
|
-
ical_event.dtend = DateTime.parse("#{end_date}T#{end_time}")
|
110
|
-
else
|
111
|
-
ical_event.dtstart = DateTime.parse("#{start_date}T#{start_time}")
|
112
|
-
ical_event.dtend = ical_event.dtstart+1.hour
|
113
|
-
end
|
107
|
+
ical_event.dtstart = DateTime.parse("#{start_date}T00:00")
|
108
|
+
ical_event.dtend = ical_event.dtstart+1.day-1.minute
|
114
109
|
end
|
115
|
-
|
116
|
-
|
117
|
-
|
110
|
+
else
|
111
|
+
if starts_at <= ends_at
|
112
|
+
ical_event.dtstart = DateTime.parse("#{start_date}T#{start_time}")
|
113
|
+
ical_event.dtend = DateTime.parse("#{end_date}T#{end_time}")
|
114
|
+
else
|
115
|
+
ical_event.dtstart = DateTime.parse("#{start_date}T#{start_time}")
|
116
|
+
ical_event.dtend = ical_event.dtstart+1.hour
|
117
|
+
end
|
118
|
+
end
|
119
|
+
self.ical_string = ical_event.to_s
|
120
|
+
end
|
121
|
+
end
|
118
122
|
end
|
@@ -4,10 +4,10 @@ module Ical
|
|
4
4
|
def ui_event_for(*args)
|
5
5
|
domid = args.first
|
6
6
|
options = args.extract_options!
|
7
|
-
options[:url]
|
7
|
+
options[:url] = {} unless options[:url]
|
8
8
|
options[:actions] = {} unless options[:actions]
|
9
|
-
render(:file => 'shared/_ui_event_for.js.haml', :locals => {
|
9
|
+
render(:file => 'shared/_ui_event_for.js.haml', :locals => {:domid => domid, :url => options[:url], :actions => options[:actions]})
|
10
10
|
end
|
11
|
-
end
|
11
|
+
end
|
12
12
|
end
|
13
13
|
end
|
data/lib/jquery/jqgrid/jqgrid.rb
CHANGED
@@ -1,42 +1,42 @@
|
|
1
1
|
module ActionView
|
2
2
|
module Helpers
|
3
|
-
|
3
|
+
|
4
4
|
def jqgrid_javascripts(locale)
|
5
|
-
js = capture { javascript_include_tag "i18n/jqgrid/locale-#{locale}.min" }
|
6
|
-
js << capture {javascript_tag "jQuery.jgrid.no_legacy_api = true;" }
|
5
|
+
js = capture { javascript_include_tag "i18n/jqgrid/locale-#{locale}.min" }
|
6
|
+
js << capture { javascript_tag "jQuery.jgrid.no_legacy_api = true;" }
|
7
7
|
js << capture { javascript_include_tag 'jquery.jqGrid.min' }
|
8
8
|
end
|
9
9
|
|
10
|
-
def jqgrid(title, id, action, columns = {},
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
def jqgrid(title, id, action, columns = {},
|
11
|
+
options = {}, edit_options = "", add_options = "", del_options = "", search_options = "",
|
12
|
+
custom1_button = nil, custom2_button = nil, custom3_button = nil, custom4_button = nil, custom5_button = nil)
|
13
|
+
|
14
14
|
# Default options
|
15
|
-
options =
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
15
|
+
options =
|
16
|
+
{
|
17
|
+
:rows_per_page => '10',
|
18
|
+
:sort_column => '',
|
19
|
+
:sort_order => '',
|
20
|
+
:height => '150',
|
21
|
+
:gridview => 'false',
|
22
|
+
:error_handler => 'null',
|
23
|
+
:inline_edit_handler => 'null',
|
24
|
+
:add => 'false',
|
25
|
+
:delete => 'false',
|
26
|
+
:search => 'true',
|
27
|
+
:edit => 'false',
|
28
|
+
:inline_edit => 'false',
|
29
|
+
:autowidth => 'false',
|
30
|
+
:hidegrid => 'false',
|
31
|
+
:rownumbers => 'false'
|
32
|
+
}.merge(options)
|
33
|
+
|
34
34
|
# Stringify options values
|
35
35
|
options.inject({}) do |options, (key, value)|
|
36
36
|
options[key] = (key != :subgrid) ? value.to_s : value
|
37
37
|
options
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
options[:error_handler_return_value] = (options[:error_handler] == 'null') ? 'true;' : options[:error_handler]
|
41
41
|
edit_button = (options[:edit] == 'true' && options[:inline_edit] == 'false').to_s
|
42
42
|
|
@@ -130,32 +130,32 @@ module ActionView
|
|
130
130
|
}
|
131
131
|
},/
|
132
132
|
end
|
133
|
-
|
133
|
+
|
134
134
|
# Enable subgrids
|
135
135
|
subgrid = ""
|
136
136
|
subgrid_enabled = "subGrid:false,"
|
137
137
|
|
138
138
|
if options[:subgrid].present?
|
139
|
-
|
139
|
+
|
140
140
|
subgrid_enabled = "subGrid:true,"
|
141
|
-
|
142
|
-
options[:subgrid] =
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
141
|
+
|
142
|
+
options[:subgrid] =
|
143
|
+
{
|
144
|
+
:rows_per_page => '10',
|
145
|
+
:sort_column => 'id',
|
146
|
+
:sort_order => 'asc',
|
147
|
+
:add => 'false',
|
148
|
+
:edit => 'false',
|
149
|
+
:delete => 'false',
|
150
|
+
:search => 'false'
|
151
|
+
}.merge(options[:subgrid])
|
152
152
|
|
153
153
|
# Stringify options values
|
154
154
|
options[:subgrid].inject({}) do |suboptions, (key, value)|
|
155
155
|
suboptions[key] = value.to_s
|
156
156
|
suboptions
|
157
157
|
end
|
158
|
-
|
158
|
+
|
159
159
|
subgrid_inline_edit = ""
|
160
160
|
if options[:subgrid][:inline_edit] == true
|
161
161
|
options[:subgrid][:edit] = 'false'
|
@@ -169,7 +169,7 @@ module ActionView
|
|
169
169
|
},
|
170
170
|
/
|
171
171
|
end
|
172
|
-
|
172
|
+
|
173
173
|
if options[:subgrid][:direct_selection] && options[:subgrid][:selection_handler].present?
|
174
174
|
subgrid_direct_link = %Q/
|
175
175
|
onSelectRow: function(id){
|
@@ -178,10 +178,10 @@ module ActionView
|
|
178
178
|
}
|
179
179
|
},
|
180
180
|
/
|
181
|
-
end
|
182
|
-
|
181
|
+
end
|
182
|
+
|
183
183
|
sub_col_names, sub_col_model = gen_columns(options[:subgrid][:columns])
|
184
|
-
|
184
|
+
|
185
185
|
subgrid = %Q(
|
186
186
|
subGridRowExpanded: function(subgrid_id, row_id) {
|
187
187
|
var subgrid_table_id, pager_id;
|
@@ -201,7 +201,7 @@ module ActionView
|
|
201
201
|
viewrecords: true,
|
202
202
|
//toolbar : [true,"top"],
|
203
203
|
#{subgrid_inline_edit}
|
204
|
-
|
204
|
+
#{subgrid_direct_link}
|
205
205
|
height: '100%'
|
206
206
|
});
|
207
207
|
jQuery("#"+subgrid_table_id).jqGrid('navGrid', "#"+pager_id,{edit:#{options[:subgrid][:edit]},add:#{options[:subgrid][:add]},del:#{options[:subgrid][:delete]},search:false})
|
@@ -319,12 +319,12 @@ module ActionView
|
|
319
319
|
// ajaxGridOptions :{},
|
320
320
|
// direction : "ltr",
|
321
321
|
#{multiselect}
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
322
|
+
#{masterdetails}
|
323
|
+
#{grid_loaded}
|
324
|
+
#{direct_link}
|
325
|
+
#{editable}
|
326
|
+
#{subgrid_enabled}
|
327
|
+
#{subgrid}
|
328
328
|
// toppager: false,
|
329
329
|
// headertitles: false,
|
330
330
|
// scrollTimeout: 40,
|
@@ -343,14 +343,14 @@ module ActionView
|
|
343
343
|
{#{search_options}}
|
344
344
|
);
|
345
345
|
#{multihandler}
|
346
|
-
|
346
|
+
#{selection_link}
|
347
347
|
});
|
348
348
|
</script>
|
349
349
|
)
|
350
|
-
end
|
350
|
+
end
|
351
351
|
|
352
352
|
private
|
353
|
-
|
353
|
+
|
354
354
|
def gen_columns(columns)
|
355
355
|
# Generate columns data
|
356
356
|
col_names = "[" # Labels
|
@@ -362,8 +362,8 @@ module ActionView
|
|
362
362
|
col_names.chop! << "]"
|
363
363
|
col_model.chop! << "]"
|
364
364
|
[col_names, col_model]
|
365
|
-
end
|
366
|
-
|
365
|
+
end
|
366
|
+
|
367
367
|
# Generate a list of attributes for related column (align:'right', sortable:true, resizable:false, ...)
|
368
368
|
def get_attributes(column)
|
369
369
|
options = ","
|
@@ -407,7 +407,7 @@ module ActionView
|
|
407
407
|
if couple[1].instance_of?(Fixnum) || couple[1] == 'true' || couple[1] == 'false' || couple[1] == true || couple[1] == false
|
408
408
|
options << %Q/#{couple[0]}:#{couple[1]},/
|
409
409
|
else
|
410
|
-
options << %Q/#{couple[0]}:"#{couple[1]}",/
|
410
|
+
options << %Q/#{couple[0]}:"#{couple[1]}",/
|
411
411
|
end
|
412
412
|
end
|
413
413
|
end
|