presenting 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. data/LICENSE +20 -20
  2. data/README +10 -10
  3. data/Rakefile +22 -22
  4. data/app/assets/javascripts/search.js +13 -13
  5. data/app/assets/stylesheets/details-color.css +7 -7
  6. data/app/assets/stylesheets/details.css +10 -10
  7. data/app/assets/stylesheets/form.css +1 -1
  8. data/app/assets/stylesheets/grid-color.css +71 -71
  9. data/app/assets/stylesheets/grid.css +64 -64
  10. data/app/assets/stylesheets/search-color.css +16 -16
  11. data/app/assets/stylesheets/search.css +45 -45
  12. data/app/controllers/presentation/assets_controller.rb +42 -42
  13. data/app/views/presentations/_details.erb +11 -11
  14. data/app/views/presentations/_field_search.erb +14 -14
  15. data/app/views/presentations/_form.erb +20 -20
  16. data/app/views/presentations/_grid.erb +70 -70
  17. data/app/views/presentations/_search.erb +7 -7
  18. data/lib/presentation/base.rb +31 -31
  19. data/lib/presentation/details.rb +21 -21
  20. data/lib/presentation/field_search.rb +67 -67
  21. data/lib/presentation/form.rb +149 -149
  22. data/lib/presentation/grid.rb +162 -160
  23. data/lib/presentation/search.rb +9 -9
  24. data/lib/presenting/attribute.rb +51 -51
  25. data/lib/presenting/configurable.rb +10 -10
  26. data/lib/presenting/defaults.rb +10 -10
  27. data/lib/presenting/field_set.rb +26 -26
  28. data/lib/presenting/form_helpers.rb +51 -51
  29. data/lib/presenting/helpers.rb +114 -114
  30. data/lib/presenting/sanitize.rb +19 -19
  31. data/lib/presenting/search.rb +185 -185
  32. data/lib/presenting/sorting.rb +87 -87
  33. data/test/attribute_test.rb +61 -61
  34. data/test/configurable_test.rb +20 -20
  35. data/test/details_test.rb +68 -68
  36. data/test/field_search_test.rb +102 -102
  37. data/test/field_set_test.rb +46 -46
  38. data/test/grid_test.rb +246 -239
  39. data/test/helpers_test.rb +72 -72
  40. data/test/presenting_test.rb +15 -15
  41. data/test/r3/Gemfile +7 -7
  42. data/test/r3/Gemfile.lock +86 -82
  43. data/test/r3/config/application.rb +12 -12
  44. data/test/r3/config/boot.rb +6 -6
  45. data/test/r3/config/database.yml +22 -22
  46. data/test/r3/config/environment.rb +5 -5
  47. data/test/r3/config/environments/test.rb +35 -35
  48. data/test/r3/db/test.sqlite3 +0 -0
  49. data/test/r3/log/test.log +336 -0
  50. data/test/r3/public/javascripts/presenting/grid.js +0 -0
  51. data/test/r3/public/javascripts/presenting/search.js +13 -13
  52. data/test/r3/public/stylesheets/presenting/details-color.css +7 -7
  53. data/test/r3/public/stylesheets/presenting/details.css +10 -10
  54. data/test/r3/public/stylesheets/presenting/form.css +1 -1
  55. data/test/r3/public/stylesheets/presenting/grid-color.css +71 -71
  56. data/test/r3/public/stylesheets/presenting/grid.css +64 -64
  57. data/test/r3/public/stylesheets/presenting/search-color.css +16 -16
  58. data/test/r3/public/stylesheets/presenting/search.css +45 -45
  59. data/test/sanitize_test.rb +15 -15
  60. data/test/search_conditions_test.rb +137 -137
  61. data/test/search_test.rb +30 -30
  62. data/test/sorting_test.rb +63 -63
  63. metadata +74 -74
data/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- Copyright (c) 2008 Lance Ivy
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2008 Lance Ivy
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README CHANGED
@@ -1,10 +1,10 @@
1
- Presenting
2
- ==========
3
- Bringing together my work on ActiveScaffold and Components into standardized, reusable view macros.
4
-
5
- Performance
6
- ===========
7
- I don't see why it wouldn't be fast. But if anyone "discovers":http://rpm.newrelic.com a "problem":http://ruby-prof.rubyforge.org/, we can go from there. Why worry early?
8
-
9
-
10
- Copyright (c) 2008 Lance Ivy, released under the MIT license
1
+ Presenting
2
+ ==========
3
+ Bringing together my work on ActiveScaffold and Components into standardized, reusable view macros.
4
+
5
+ Performance
6
+ ===========
7
+ I don't see why it wouldn't be fast. But if anyone "discovers":http://rpm.newrelic.com a "problem":http://ruby-prof.rubyforge.org/, we can go from there. Why worry early?
8
+
9
+
10
+ Copyright (c) 2008 Lance Ivy, released under the MIT license
data/Rakefile CHANGED
@@ -1,22 +1,22 @@
1
- require 'rake'
2
- require 'rake/testtask'
3
- require 'rake/rdoctask'
4
-
5
- desc 'Default: run unit tests.'
6
- task :default => :test
7
-
8
- desc 'Test the presenting plugin.'
9
- Rake::TestTask.new(:test) do |t|
10
- t.libs << 'lib'
11
- t.pattern = 'test/**/*_test.rb'
12
- t.verbose = true
13
- end
14
-
15
- desc 'Generate documentation for the presenting plugin.'
16
- Rake::RDocTask.new(:rdoc) do |rdoc|
17
- rdoc.rdoc_dir = 'rdoc'
18
- rdoc.title = 'Presenting'
19
- rdoc.options << '--line-numbers' << '--inline-source'
20
- rdoc.rdoc_files.include('README')
21
- rdoc.rdoc_files.include('lib/**/*.rb')
22
- end
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rdoc/task'
4
+
5
+ desc 'Default: run unit tests.'
6
+ task :default => :test
7
+
8
+ desc 'Test the presenting plugin.'
9
+ Rake::TestTask.new(:test) do |t|
10
+ t.libs << 'lib'
11
+ t.pattern = 'test/**/*_test.rb'
12
+ t.verbose = true
13
+ end
14
+
15
+ desc 'Generate documentation for the presenting plugin.'
16
+ Rake::RDocTask.new(:rdoc) do |rdoc|
17
+ rdoc.rdoc_dir = 'rdoc'
18
+ rdoc.title = 'Presenting'
19
+ rdoc.options << '--line-numbers' << '--inline-source'
20
+ rdoc.rdoc_files.include('README')
21
+ rdoc.rdoc_files.include('lib/**/*.rb')
22
+ end
@@ -1,13 +1,13 @@
1
- $('.presentation-search .compact fieldset label').livequery(function() {
2
- var label = $(this);
3
- var field = label.siblings('input');
4
- if (!field[0] || field.attr('type') == 'checkbox') return;
5
-
6
- label.addClass('overlabel');
7
-
8
- var hide_label = function() { label.css('text-indent', '-1000px') };
9
- var show_label = function() { this.value || label.css('text-indent', '0px') };
10
-
11
- $(field).focus(hide_label).blur(show_label).each(hide_label).each(show_label);
12
- $(label).click(function() {field.focus()});
13
- });
1
+ $('.presentation-search .compact fieldset label').livequery(function() {
2
+ var label = $(this);
3
+ var field = label.siblings('input');
4
+ if (!field[0] || field.attr('type') == 'checkbox') return;
5
+
6
+ label.addClass('overlabel');
7
+
8
+ var hide_label = function() { label.css('text-indent', '-1000px') };
9
+ var show_label = function() { this.value || label.css('text-indent', '0px') };
10
+
11
+ $(field).focus(hide_label).blur(show_label).each(hide_label).each(show_label);
12
+ $(label).click(function() {field.focus()});
13
+ });
@@ -1,7 +1,7 @@
1
- .presentation-details dt {
2
- color: #444;
3
- }
4
-
5
- .presentation-details dd {
6
- border-color: #888;
7
- }
1
+ .presentation-details dt {
2
+ color: #444;
3
+ }
4
+
5
+ .presentation-details dd {
6
+ border-color: #888;
7
+ }
@@ -1,10 +1,10 @@
1
- .presentation-details dt {
2
- font-weight: bold;
3
- }
4
-
5
- .presentation-details dd {
6
- margin-left: 0;
7
- padding-bottom: 0.5em;
8
- border-bottom: 1px dotted;
9
- margin-bottom: 0.5em;
10
- }
1
+ .presentation-details dt {
2
+ font-weight: bold;
3
+ }
4
+
5
+ .presentation-details dd {
6
+ margin-left: 0;
7
+ padding-bottom: 0.5em;
8
+ border-bottom: 1px dotted;
9
+ margin-bottom: 0.5em;
10
+ }
@@ -1 +1 @@
1
- .presentation-form {}
1
+ .presentation-form {}
@@ -1,71 +1,71 @@
1
- .presentation-grid a {
2
- color: #06c;
3
- }
4
-
5
- .presentation-grid {
6
- font-family: sans-serif;
7
- background-color: #fff;
8
- }
9
-
10
- .presentation-grid caption {
11
- background-color: transparent;
12
- }
13
-
14
- .presentation-grid thead {
15
- background-color: transparent;
16
- }
17
-
18
- .presentation-grid thead th {
19
- border-bottom: 2px solid #aaa;
20
- font-weight: normal;
21
- color: #666;
22
- background-color: transparent;
23
- }
24
-
25
- .presentation-grid tbody tr.even {
26
- background-color: #e6f2ff;
27
- border-bottom: 1px solid #c5dbf7;
28
- border-top: 1px solid #c5dbf7;
29
- }
30
-
31
- .presentation-grid tbody td.sorted {
32
- background-color: #f5f5f5;
33
- }
34
-
35
- .presentation-grid tbody tr.even td.sorted {
36
- background-color: #c5dbf7;
37
- }
38
-
39
- .presentation-grid tfoot .pagination {
40
- margin-top: 0.5em;
41
- }
42
-
43
- .presentation-grid tfoot .pagination a {
44
- text-decoration: none;
45
- }
46
-
47
- .presentation-grid tfoot .pagination .prev_page,
48
- .presentation-grid tfoot .pagination .next_page {
49
- padding: 0.1em 0.5em;
50
- background-color: #eee;
51
- border: 1px solid #e5e5e5;
52
- }
53
-
54
- .presentation-grid tfoot .pagination a.prev_page:hover,
55
- .presentation-grid tfoot .pagination a.next_page:hover {
56
- background-color: #e6f2ff;
57
- border-color: #c5dbf7;
58
- }
59
-
60
- .presentation-grid tfoot .pagination .prev_page {
61
- margin-right: 0.7em;
62
- }
63
-
64
- .presentation-grid tfoot .pagination .next_page {
65
- margin-left: 0.7em;
66
- }
67
-
68
- .presentation-grid tfoot .pagination .current {
69
- padding: 0.1em 0.5em;
70
- border: 1px solid #e5e5e5;
71
- }
1
+ .presentation-grid a {
2
+ color: #06c;
3
+ }
4
+
5
+ .presentation-grid {
6
+ font-family: sans-serif;
7
+ background-color: #fff;
8
+ }
9
+
10
+ .presentation-grid caption {
11
+ background-color: transparent;
12
+ }
13
+
14
+ .presentation-grid thead {
15
+ background-color: transparent;
16
+ }
17
+
18
+ .presentation-grid thead th {
19
+ border-bottom: 2px solid #aaa;
20
+ font-weight: normal;
21
+ color: #666;
22
+ background-color: transparent;
23
+ }
24
+
25
+ .presentation-grid tbody tr.even {
26
+ background-color: #e6f2ff;
27
+ border-bottom: 1px solid #c5dbf7;
28
+ border-top: 1px solid #c5dbf7;
29
+ }
30
+
31
+ .presentation-grid tbody td.sorted {
32
+ background-color: #f5f5f5;
33
+ }
34
+
35
+ .presentation-grid tbody tr.even td.sorted {
36
+ background-color: #c5dbf7;
37
+ }
38
+
39
+ .presentation-grid tfoot .pagination {
40
+ margin-top: 0.5em;
41
+ }
42
+
43
+ .presentation-grid tfoot .pagination a {
44
+ text-decoration: none;
45
+ }
46
+
47
+ .presentation-grid tfoot .pagination .prev_page,
48
+ .presentation-grid tfoot .pagination .next_page {
49
+ padding: 0.1em 0.5em;
50
+ background-color: #eee;
51
+ border: 1px solid #e5e5e5;
52
+ }
53
+
54
+ .presentation-grid tfoot .pagination a.prev_page:hover,
55
+ .presentation-grid tfoot .pagination a.next_page:hover {
56
+ background-color: #e6f2ff;
57
+ border-color: #c5dbf7;
58
+ }
59
+
60
+ .presentation-grid tfoot .pagination .prev_page {
61
+ margin-right: 0.7em;
62
+ }
63
+
64
+ .presentation-grid tfoot .pagination .next_page {
65
+ margin-left: 0.7em;
66
+ }
67
+
68
+ .presentation-grid tfoot .pagination .current {
69
+ padding: 0.1em 0.5em;
70
+ border: 1px solid #e5e5e5;
71
+ }
@@ -1,64 +1,64 @@
1
- /** cellspacing **/
2
- .presentation-grid table,
3
- .presentation-grid td,
4
- .presentation-grid th {
5
- border: 0;
6
- border-collapse: collapse;
7
- }
8
-
9
- .presentation-grid table {
10
- width: 100%;
11
- }
12
-
13
- .presentation-grid caption {
14
- text-align: left;
15
- font-weight: bold;
16
- padding-left: 0.2em;
17
- }
18
-
19
- .presentation-grid th {
20
- padding: 0.2em 0.5em 0em 0.2em;
21
- text-align: left;
22
- vertical-align: bottom;
23
- }
24
-
25
- .presentation-grid th a {
26
- text-decoration: none;
27
- }
28
-
29
- .presentation-grid td {
30
- padding: 0.4em 0.5em 0.4em 0.2em;
31
- vertical-align: top;
32
- }
33
-
34
- .presentation-grid ul.actions {
35
- overflow: auto;
36
- zoom: 1;
37
- float: right;
38
- list-style: none;
39
- margin: 0;
40
- padding: 0;
41
- }
42
-
43
- .presentation-grid ul.actions li {
44
- float: left;
45
- }
46
-
47
- .presentation-grid ul.actions li a {
48
- font-weight: normal;
49
- display: block;
50
- padding: 0em 0.3em;
51
- text-decoration: none;
52
- }
53
-
54
- .presentation-grid ul.actions li a:hover {
55
- text-decoration: underline;
56
- }
57
-
58
- .presentation-grid ul.actions li a {
59
- outline: none;
60
- }
61
-
62
- .presentation-grid caption ul.actions {
63
- margin-right: 0.5em;
64
- }
1
+ /** cellspacing **/
2
+ .presentation-grid table,
3
+ .presentation-grid td,
4
+ .presentation-grid th {
5
+ border: 0;
6
+ border-collapse: collapse;
7
+ }
8
+
9
+ .presentation-grid table {
10
+ width: 100%;
11
+ }
12
+
13
+ .presentation-grid caption {
14
+ text-align: left;
15
+ font-weight: bold;
16
+ padding-left: 0.2em;
17
+ }
18
+
19
+ .presentation-grid th {
20
+ padding: 0.2em 0.5em 0em 0.2em;
21
+ text-align: left;
22
+ vertical-align: bottom;
23
+ }
24
+
25
+ .presentation-grid th a {
26
+ text-decoration: none;
27
+ }
28
+
29
+ .presentation-grid td {
30
+ padding: 0.4em 0.5em 0.4em 0.2em;
31
+ vertical-align: top;
32
+ }
33
+
34
+ .presentation-grid ul.actions {
35
+ overflow: auto;
36
+ zoom: 1;
37
+ float: right;
38
+ list-style: none;
39
+ margin: 0;
40
+ padding: 0;
41
+ }
42
+
43
+ .presentation-grid ul.actions li {
44
+ float: left;
45
+ }
46
+
47
+ .presentation-grid ul.actions li a {
48
+ font-weight: normal;
49
+ display: block;
50
+ padding: 0em 0.3em;
51
+ text-decoration: none;
52
+ }
53
+
54
+ .presentation-grid ul.actions li a:hover {
55
+ text-decoration: underline;
56
+ }
57
+
58
+ .presentation-grid ul.actions li a {
59
+ outline: none;
60
+ }
61
+
62
+ .presentation-grid caption ul.actions {
63
+ margin-right: 0.5em;
64
+ }
@@ -1,16 +1,16 @@
1
- .presentation-search label {
2
- color: #666;
3
- }
4
-
5
- .presentation-search fieldset {
6
- border: 1px solid #c5dbf7;
7
- background-color: #e6f2ff;
8
- padding: 2px;
9
- }
10
-
11
- .presentation-search fieldset.submit {
12
- border: 0px;
13
- padding: 0px;
14
- background-color: transparent;
15
- }
16
-
1
+ .presentation-search label {
2
+ color: #666;
3
+ }
4
+
5
+ .presentation-search fieldset {
6
+ border: 1px solid #c5dbf7;
7
+ background-color: #e6f2ff;
8
+ padding: 2px;
9
+ }
10
+
11
+ .presentation-search fieldset.submit {
12
+ border: 0px;
13
+ padding: 0px;
14
+ background-color: transparent;
15
+ }
16
+
@@ -1,45 +1,45 @@
1
- .presentation-search {
2
- overflow: hidden;
3
- zoom: 1;
4
- }
5
-
6
- .presentation-search fieldset {
7
- border: 0;
8
- margin: 0 0.5em 1em 0;
9
- padding: 0;
10
- float: left;
11
- width: 145px;
12
- }
13
-
14
- .presentation-search fieldset label {
15
- font-weight: normal;
16
- margin: 0;
17
- padding: 0;
18
- text-transform: none;
19
- }
20
-
21
- .presentation-search fieldset input,
22
- .presentation-search fieldset select {
23
- padding: 0px;
24
- margin: 0px;
25
- }
26
-
27
- /* for overlabels (requires javascript) */
28
-
29
- .presentation-search .compact label {
30
- display: inline;
31
- }
32
-
33
- .presentation-search .compact fieldset {
34
- position: relative;
35
- width: auto;
36
- }
37
-
38
- .presentation-search .compact fieldset label.overlabel {
39
- display: block;
40
- position: absolute;
41
- top: 0.2em;
42
- left: 0.5em;
43
- z-index: 1;
44
- cursor: text;
45
- }
1
+ .presentation-search {
2
+ overflow: hidden;
3
+ zoom: 1;
4
+ }
5
+
6
+ .presentation-search fieldset {
7
+ border: 0;
8
+ margin: 0 0.5em 1em 0;
9
+ padding: 0;
10
+ float: left;
11
+ width: 145px;
12
+ }
13
+
14
+ .presentation-search fieldset label {
15
+ font-weight: normal;
16
+ margin: 0;
17
+ padding: 0;
18
+ text-transform: none;
19
+ }
20
+
21
+ .presentation-search fieldset input,
22
+ .presentation-search fieldset select {
23
+ padding: 0px;
24
+ margin: 0px;
25
+ }
26
+
27
+ /* for overlabels (requires javascript) */
28
+
29
+ .presentation-search .compact label {
30
+ display: inline;
31
+ }
32
+
33
+ .presentation-search .compact fieldset {
34
+ position: relative;
35
+ width: auto;
36
+ }
37
+
38
+ .presentation-search .compact fieldset label.overlabel {
39
+ display: block;
40
+ position: absolute;
41
+ top: 0.2em;
42
+ left: 0.5em;
43
+ z-index: 1;
44
+ cursor: text;
45
+ }
@@ -1,42 +1,42 @@
1
- class Presentation::AssetsController < ActionController::Base
2
- # TODO: consider packaging a minifier so we get the perfect solution: a cached, minified bundle of assets
3
- caches_page :stylesheet, :javascript
4
-
5
- def stylesheet
6
- dir = asset_path(:stylesheets)
7
- sheet = params[:id].split(',').collect{ |id| File.read("#{dir}/#{id}.css") }.join("\n")
8
-
9
- respond_to do |type|
10
- type.css {render :text => sheet}
11
- end
12
- end
13
-
14
- # TODO: bundle unobtrusive javascripts that can add behavior.
15
- # - jquery vs prototype (i'll develop jquery, and wait for prototype contributions)
16
- # - ajax links with html response
17
- # - - inline
18
- # - - modal dialog
19
- # - ajax links with js response
20
- # - ajax links with no response
21
- # - inline editing
22
- # - "dirty" form awareness
23
- # - tabbed forms
24
- # - tooltips for extended information (e.g. column description or truncated field text)
25
- # - basic form validation
26
- # - - required fields
27
- # TODO: tests for ujs
28
- def javascript
29
- dir = asset_path(:javascripts)
30
- script = params[:id].split(',').collect{ |id| File.read("#{dir}/#{id}.js") }.join("\n")
31
-
32
- respond_to do |type|
33
- type.js {render :text => script}
34
- end
35
- end
36
-
37
- protected
38
-
39
- def asset_path(type)
40
- File.join(File.dirname(__FILE__), '..', '..', 'assets', type.to_s)
41
- end
42
- end
1
+ class Presentation::AssetsController < ActionController::Base
2
+ # TODO: consider packaging a minifier so we get the perfect solution: a cached, minified bundle of assets
3
+ caches_page :stylesheet, :javascript
4
+
5
+ def stylesheet
6
+ dir = asset_path(:stylesheets)
7
+ sheet = params[:id].split(',').collect{ |id| File.read("#{dir}/#{id}.css") }.join("\n")
8
+
9
+ respond_to do |type|
10
+ type.css {render :text => sheet}
11
+ end
12
+ end
13
+
14
+ # TODO: bundle unobtrusive javascripts that can add behavior.
15
+ # - jquery vs prototype (i'll develop jquery, and wait for prototype contributions)
16
+ # - ajax links with html response
17
+ # - - inline
18
+ # - - modal dialog
19
+ # - ajax links with js response
20
+ # - ajax links with no response
21
+ # - inline editing
22
+ # - "dirty" form awareness
23
+ # - tabbed forms
24
+ # - tooltips for extended information (e.g. column description or truncated field text)
25
+ # - basic form validation
26
+ # - - required fields
27
+ # TODO: tests for ujs
28
+ def javascript
29
+ dir = asset_path(:javascripts)
30
+ script = params[:id].split(',').collect{ |id| File.read("#{dir}/#{id}.js") }.join("\n")
31
+
32
+ respond_to do |type|
33
+ type.js {render :text => script}
34
+ end
35
+ end
36
+
37
+ protected
38
+
39
+ def asset_path(type)
40
+ File.join(File.dirname(__FILE__), '..', '..', 'assets', type.to_s)
41
+ end
42
+ end