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
@@ -1,5 +1,5 @@
|
|
1
|
-
module JqueryAutoComplete
|
2
|
-
|
1
|
+
module JqueryAutoComplete
|
2
|
+
|
3
3
|
def self.included(base)
|
4
4
|
base.extend(ClassMethods)
|
5
5
|
end
|
@@ -8,16 +8,16 @@ module JqueryAutoComplete
|
|
8
8
|
def auto_complete_for(object, method, options = {})
|
9
9
|
define_method("auto_complete_for_#{object}_#{method}") do
|
10
10
|
object_constant = object.to_s.camelize.constantize
|
11
|
-
|
12
|
-
find_options = {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
|
12
|
+
find_options = {
|
13
|
+
:conditions => ["LOWER(#{method}) LIKE ?", '%' + params[:term].downcase + '%'],
|
14
|
+
:order => "#{method} ASC",
|
15
|
+
:limit => 10}.merge!(options)
|
16
|
+
|
17
17
|
render :json => object_constant.to_auto_complete(:json, find_options)
|
18
18
|
end
|
19
19
|
end
|
20
|
-
end
|
20
|
+
end
|
21
21
|
end
|
22
22
|
|
23
23
|
module JqueryAutoCompleteJson
|
@@ -1,27 +1,27 @@
|
|
1
1
|
module ActionController
|
2
2
|
class Base
|
3
|
-
|
3
|
+
|
4
4
|
# From http://paydrotalks.com/posts/45-standard-json-response-for-rails-and-jquery
|
5
|
-
|
5
|
+
|
6
6
|
def render_json_response(type, hash)
|
7
|
-
unless [
|
7
|
+
unless [:ok, :redirect, :error].include?(type)
|
8
8
|
raise "Invalid json response type: #{type}"
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
# To keep the structure consistent, we'll build the json
|
12
12
|
# structure with the default properties.
|
13
13
|
#
|
14
14
|
# This will also help other developers understand what
|
15
15
|
# is returned by the server by looking at this method.
|
16
|
-
default_json_structure = {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
render_options = {:json => default_json_structure}
|
16
|
+
default_json_structure = {
|
17
|
+
:status => type,
|
18
|
+
:html => nil,
|
19
|
+
:message => nil,
|
20
|
+
:to => nil}.merge(hash)
|
21
|
+
|
22
|
+
render_options = {:json => default_json_structure}
|
23
23
|
render_options[:status] = 400 if type == :error
|
24
|
-
|
24
|
+
|
25
25
|
render(render_options)
|
26
26
|
end
|
27
27
|
end
|
@@ -13,66 +13,68 @@
|
|
13
13
|
# with jQuery-based code as opposed to Prototype's:
|
14
14
|
#
|
15
15
|
module ActionController
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
module Assertions
|
17
|
+
module SelectorAssertions
|
18
|
+
silence_warnings do
|
19
|
+
RJS_PATTERN_HTML = "\"((\\\\\"|[^\"])*)\""
|
20
20
|
# RJS_ANY_ID = "\"([^\"])*\""
|
21
21
|
# better match with single or double quoted ids
|
22
|
-
|
23
|
-
|
24
|
-
RJS_STATEMENTS = {
|
25
|
-
:chained_replace => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.replaceWith\\(#{RJS_PATTERN_HTML}\\)",
|
26
|
-
:chained_replace_html => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.updateWith\\(#{RJS_PATTERN_HTML}\\)",
|
27
|
-
:replace_html => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.html\\(#{RJS_PATTERN_HTML}\\)",
|
28
|
-
:replace => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.replaceWith\\(#{RJS_PATTERN_HTML}\\)",
|
29
|
-
:insert_top => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.prepend\\(#{RJS_PATTERN_HTML}\\)",
|
30
|
-
:insert_bottom => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.append\\(#{RJS_PATTERN_HTML}\\)",
|
31
|
-
:effect => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.effect\\(",
|
32
|
-
:highlight => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.effect\\('highlight'"
|
33
|
-
|
34
|
-
=begin TODO:
|
22
|
+
RJS_ANY_ID = "[\"']([^\"])*[\"']"
|
35
23
|
|
36
|
-
|
24
|
+
RJS_STATEMENTS = {
|
25
|
+
:chained_replace => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.replaceWith\\(#{RJS_PATTERN_HTML}\\)",
|
26
|
+
:chained_replace_html => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.updateWith\\(#{RJS_PATTERN_HTML}\\)",
|
27
|
+
:replace_html => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.html\\(#{RJS_PATTERN_HTML}\\)",
|
28
|
+
:replace => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.replaceWith\\(#{RJS_PATTERN_HTML}\\)",
|
29
|
+
:insert_top => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.prepend\\(#{RJS_PATTERN_HTML}\\)",
|
30
|
+
:insert_bottom => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.append\\(#{RJS_PATTERN_HTML}\\)",
|
31
|
+
:effect => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.effect\\(",
|
32
|
+
:highlight => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.effect\\('highlight'"
|
37
33
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
so I modified jrails/lib/jrails.rb line 337
|
42
|
-
... javascript = "#{JQUERY_VAR}('#{jquery_id(element_id)}').#{mode || 'effect'}('#{name}'"
|
43
|
-
to
|
44
|
-
... javascript = "#{JQUERY_VAR}(\"#{jquery_id(element_id)}\").#{mode || 'effect'}('#{name}'"
|
45
|
-
so it writes double quotes like most of the others. This change should probably be
|
46
|
-
done to the others, but as I don't use them so haven't tested them.
|
34
|
+
=
|
35
|
+
begin
|
36
|
+
TODO :
|
47
37
|
|
48
|
-
|
49
|
-
... id ? statement.gsub(RJS_ANY_ID, "\"#{id}\"") : statement
|
50
|
-
which forces the expectation that the id is double quoted. If I changed it to
|
51
|
-
... statement.gsub(RJS_ANY_ID, "[\"']{1}#{id}[\"']{1}")
|
52
|
-
I believe that it would work as the logic seemed to work in some testing.
|
53
|
-
I have not actually tried to modify rails, as this file doesn't seem to
|
54
|
-
actually be in the git repository.
|
38
|
+
I 've never used the chained_* so I don' t know if they work.
|
55
39
|
|
40
|
+
I couldn 't seem to get assert_select_rjs to actually match the single quoted ids
|
41
|
+
which are created by some of the effects like ...
|
42
|
+
... jQuery(' #item_1559').effect('highlight',{},1000);
|
43
|
+
so I modified jrails/lib/jrails.rb line 337
|
44
|
+
... javascript = "#{JQUERY_VAR}('#{jquery_id(element_id)}').#{mode || 'effect'}('#{name}'"
|
45
|
+
to
|
46
|
+
... javascript = "#{JQUERY_VAR}(\"#{jquery_id(element_id)}\").#{mode || 'effect'}('#{name}'"
|
47
|
+
so it writes double quotes like most of the others.This change should probably be
|
48
|
+
done to the others, but as I don 't use them so haven' t tested them.
|
56
49
|
|
57
|
-
|
50
|
+
My other option seemed to require modifying rails ' selector_assertions.rb line 427
|
51
|
+
... id ? statement.gsub(RJS_ANY_ID, "\"#{id}\"") : statement
|
52
|
+
which forces the expectation that the id is double quoted. If I changed it to
|
53
|
+
... statement.gsub(RJS_ANY_ID, "[\"']{1} #{id}[\"']{1}")
|
54
|
+
I believe that it would work as the logic seemed to work in some testing.
|
55
|
+
I have not actually tried to modify rails, as this file doesn 't seem to
|
56
|
+
actually be in the git repository.
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
58
|
+
|
59
|
+
jrails now uses a nonconflict option so $ is jQuery. I put both in the pattern in case it gets changed.
|
60
|
+
|
61
|
+
:insert_after => "",
|
62
|
+
:insert_before => "",
|
63
|
+
=end
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
[:remove, :show, :hide, :toggle, :reset].each do |action|
|
68
|
+
RJS_STATEMENTS[action] = "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.#{action}\\(\\)"
|
69
|
+
end
|
70
|
+
|
71
|
+
# TODO:
|
72
|
+
#RJS_STATEMENTS[:insert_html] = "Element.insert\\(#{RJS_ANY_ID}, \\{ (#{RJS_INSERTIONS.join('|')}):
|
73
|
+
#{RJS_PATTERN_HTML} \\}\\)"
|
74
|
+
|
75
|
+
RJS_STATEMENTS[:any] = Regexp.new("(#{RJS_STATEMENTS.values.join('|')})")
|
76
|
+
RJS_PATTERN_UNICODE_ESCAPED_CHAR = /\\u([0-9a-zA-Z]{4})/
|
76
77
|
end
|
77
|
-
|
78
|
+
end
|
79
|
+
end
|
78
80
|
end
|
data/lib/jquery/jstree.rb
CHANGED
data/lib/jquery/mobile.rb
CHANGED
data/lib/jquery/ribbon.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
module ActionController
|
2
2
|
class Base
|
3
|
-
|
3
|
+
|
4
4
|
def render_close_dialog(dialog_id)
|
5
5
|
render :js => close_dialog
|
6
|
-
end
|
7
|
-
|
6
|
+
end
|
7
|
+
|
8
8
|
private
|
9
|
-
|
9
|
+
|
10
10
|
def close_dialog(dialog_id)
|
11
11
|
"jQuery('##{dialog_id}').dialog('close');"
|
12
|
-
end
|
12
|
+
end
|
13
13
|
end
|
14
14
|
end
|
@@ -1,18 +1,18 @@
|
|
1
1
|
module ActionController
|
2
2
|
class Base
|
3
|
-
|
3
|
+
|
4
4
|
def render_refresh_grid
|
5
5
|
render :js => refresh_grid("#{params[:controller]}_table")
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
def render_close_dialog_and_refresh_grid
|
9
9
|
render :js => close_dialog("#{params["controller"]}_#{params["action"]}_dialog")+refresh_grid("#{params[:controller]}_table")
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
private
|
13
|
-
|
13
|
+
|
14
14
|
def refresh_grid(grid_id)
|
15
15
|
"jQuery('##{grid_id}').trigger('reloadGrid');"
|
16
|
-
end
|
16
|
+
end
|
17
17
|
end
|
18
18
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module SecretSauce
|
2
|
-
module Helpers
|
3
|
-
module UiFormHelper
|
2
|
+
module Helpers
|
3
|
+
module UiFormHelper
|
4
4
|
class UiFormBuilder < ActionView::Helpers::FormBuilder
|
5
5
|
|
6
6
|
def submit(value, options={})
|
@@ -12,8 +12,8 @@ module SecretSauce
|
|
12
12
|
def error_messages
|
13
13
|
@template.error_messages_for(object_name)
|
14
14
|
end
|
15
|
-
end
|
16
|
-
|
15
|
+
end
|
16
|
+
|
17
17
|
# renders a jquery-ui templated static dialog box (cannot be resized or moved, appears on base z-index)
|
18
18
|
# to be used for things like forms
|
19
19
|
def ui_static_dialog(options={}, &block)
|
@@ -46,7 +46,7 @@ module SecretSauce
|
|
46
46
|
# of the form
|
47
47
|
def ui_form_for(record_or_name_or_array, *args, &proc)
|
48
48
|
raise ArgumentError, "Missing block" unless block_given?
|
49
|
-
|
49
|
+
|
50
50
|
if params[:layout] == "dialog"
|
51
51
|
return form_for(record_or_name_or_array, *args, &proc)
|
52
52
|
else
|
@@ -61,23 +61,23 @@ module SecretSauce
|
|
61
61
|
end
|
62
62
|
|
63
63
|
case record_or_name_or_array
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
64
|
+
when String, Symbol
|
65
|
+
object_name = record_or_name_or_array
|
66
|
+
when Array
|
67
|
+
object = record_or_name_or_array.last
|
68
|
+
object_name = ActionController::RecordIdentifier.singular_class_name(object)
|
69
|
+
apply_form_for_options!(record_or_name_or_array, options)
|
70
|
+
args.unshift object
|
71
|
+
else
|
72
|
+
object = record_or_name_or_array
|
73
|
+
object_name = ActionController::RecordIdentifier.singular_class_name(object)
|
74
|
+
apply_form_for_options!([object], options)
|
75
|
+
args.unshift object
|
76
76
|
end
|
77
77
|
concat("<div id='#{object_name}_form_container'>")
|
78
78
|
concat(form_tag(options.delete(:url) || {}, options.delete(:html) || {}))
|
79
79
|
concat(ui_static_dialog_tags(options[:dialog_options]))
|
80
|
-
|
80
|
+
fields_for(object_name, *(args << options), &proc)
|
81
81
|
concat(%Q{
|
82
82
|
</div>
|
83
83
|
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
|
@@ -91,28 +91,28 @@ module SecretSauce
|
|
91
91
|
end
|
92
92
|
|
93
93
|
# render a button pane
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
94
|
+
def ui_button_pane(&block)
|
95
|
+
body = capture(&block)
|
96
|
+
concat("<div class='ui-dialog-buttonpane ui-widget-content ui-helper-clearfix'>")
|
97
|
+
body
|
98
|
+
concat("</div>")
|
99
|
+
end
|
100
100
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
101
|
+
# render a submit tag themed with jquery ui
|
102
|
+
def ui_submit_tag(value = "Save changes", options = {})
|
103
|
+
if options[:class]
|
104
|
+
options[:class] << " ui-state-default ui-corner-all"
|
105
|
+
else
|
106
|
+
options[:class] = "ui-state-default ui-corner-all"
|
107
|
+
end
|
108
|
+
submit_tag(value, options)
|
109
|
+
end
|
110
110
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
111
|
+
def error_messages_for(*params)
|
112
|
+
render :partial => "shared/ui_form_error_messages", :locals => {:messages => super(*params)}
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
117
|
|
118
118
|
|
@@ -130,56 +130,56 @@ module SecretSauce
|
|
130
130
|
name_or_array = args.first
|
131
131
|
options = args.extract_options!
|
132
132
|
option_map = {
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
133
|
+
:alternate_rows => "altRows", # bool
|
134
|
+
:caption => "caption", # string
|
135
|
+
:cell_edit => "cellEdit", # bool
|
136
|
+
:cell_submit => "cellSubmit", # string
|
137
|
+
:cell_url => "cellUrl", # string
|
138
|
+
:column_model => "colModel", # array
|
139
|
+
:column_names => "colNames", # array
|
140
|
+
:datastring => "dataStr", # string
|
141
|
+
:datatype => "datatype", # string
|
142
|
+
:deslect_after_sort => "deselectAfterSort", # bool
|
143
|
+
:edit_url => "editUrl", # string
|
144
|
+
:expand_column => "ExpandColumn", # string
|
145
|
+
:footer_row => "footerrow", # bool TODO: ADD DOCUMENTATION
|
146
|
+
:force_fit => "forceFit", # bool
|
147
|
+
:grid_state => "gridstate", # string
|
148
|
+
:hidden_grid => "hiddengrid", # bool
|
149
|
+
:hide_grid => "hidegrid", # bool
|
150
|
+
:height => "height", # string
|
151
|
+
:image_path => "imgpath", # string
|
152
|
+
:json_reader => "jsonReader", # array
|
153
|
+
:load_complete => "loadComplete", # string TODO: ADD DOCUMENTATION
|
154
|
+
:load_once => "loadonce", # bool
|
155
|
+
:load_text => "load_text", # string
|
156
|
+
:load_ui => "loadui", # string
|
157
|
+
:request_method => "mtype", # string
|
158
|
+
:multikey => "multikey", # string
|
159
|
+
:multibox => "multiboxonly", # bool
|
160
|
+
:multiselect => "multiselect", # bool
|
161
|
+
:pager => "pager", # string TODO: ADD DOCUMENATION
|
162
|
+
:param_keys => "prmnames", # array
|
163
|
+
:post_data => "postData", # array
|
164
|
+
:resize_class => "resizeclass", # string
|
165
|
+
:restful => "restful", # bool
|
166
|
+
:row_num => "rowNum", # integer TODO: ADD DOCUMENATION
|
167
|
+
:row_list => "rowList", # array TODO: ADD DOCUMENATION
|
168
|
+
:scroll => "scroll", # bool
|
169
|
+
:scroll_rows => "scrollrows", # bool
|
170
|
+
:sort_class => "sortclass", # string
|
171
|
+
:shrink_to_fit => "shrinkToFit", # bool
|
172
|
+
:sort_asc_image => "sortascimg", # string
|
173
|
+
:sort_desc_image => "sortdescimg", # string
|
174
|
+
:sort_name => "sortname", # string
|
175
|
+
:sort_order => "sortorder", # string
|
176
|
+
:toolbar => "toolbar", # array
|
177
|
+
:tree_grid => "treeGrid", # bool
|
178
|
+
:user_data => "userData", # array
|
179
|
+
:url => "url", # string TODO: ADD DOCUMENATION
|
180
|
+
:view_records => "viewrecords", # bool TODO: ADD DOCUMENTATION
|
181
|
+
:width => "width", # string
|
182
|
+
:xml_reader => "xmlReader", # array
|
183
183
|
}
|
184
184
|
if name_or_array.class == Symbol
|
185
185
|
options[:grid] = {} unless options[:grid]
|
@@ -190,37 +190,37 @@ module SecretSauce
|
|
190
190
|
{:name => m, :index => m, :label => m.titleize, :width => (1024 / name_or_array.to_s.singularize.classify.constantize.new.attributes.length)}
|
191
191
|
end
|
192
192
|
grid_options = {
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
}
|
193
|
+
##########################################
|
194
|
+
#:url => "/#{name_or_array}.json",
|
195
|
+
:url => "#{options[:url]}.json",
|
196
|
+
##########################################
|
197
|
+
:alternate_rows => true,
|
198
|
+
:caption => "#{name_or_array}".titleize,
|
199
|
+
:column_model => column_model,
|
200
|
+
:datatype => "json",
|
201
|
+
:restful => true,
|
202
|
+
:json_reader => {:repeatitems => false},
|
203
|
+
#:height => 22 * 30,
|
204
|
+
:height => :auto,
|
205
|
+
:row_num => 20,
|
206
|
+
:row_list => [10, 20, 30],
|
207
|
+
:pager => "#{name_or_array}_pager",
|
208
|
+
:hide_grid => false,
|
209
|
+
:view_records => true,
|
210
|
+
}
|
211
211
|
grid_options.merge!(options[:grid])
|
212
212
|
mapped_options = {}
|
213
|
-
grid_options.each do |k,v|
|
213
|
+
grid_options.each do |k, v|
|
214
214
|
mapped_options[option_map[k]] = v
|
215
215
|
end
|
216
216
|
options[:nav].replace({
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
217
|
+
:edit => false,
|
218
|
+
:add => false,
|
219
|
+
:del => false
|
220
|
+
}.merge(options[:nav]))
|
221
221
|
render(:file => 'shared/_ui_grid_for_without_block.js.haml', :locals => {:options => mapped_options, :name => name_or_array, :url => options[:url], :nav => options[:nav], :actions => options[:actions]})
|
222
222
|
end
|
223
223
|
end
|
224
|
-
end
|
224
|
+
end
|
225
225
|
end
|
226
226
|
end
|