compony 0.5.1 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +33 -0
  4. data/VERSION +1 -1
  5. data/compony.gemspec +4 -4
  6. data/config/routes.rb +9 -6
  7. data/doc/ComponentGenerator.html +3 -3
  8. data/doc/Components.html +3 -3
  9. data/doc/ComponentsGenerator.html +3 -3
  10. data/doc/Compony/Component.html +3 -3
  11. data/doc/Compony/ComponentMixins/Default/Labelling.html +3 -3
  12. data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +3 -3
  13. data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +40 -28
  14. data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +3 -3
  15. data/doc/Compony/ComponentMixins/Default/Standalone.html +3 -3
  16. data/doc/Compony/ComponentMixins/Default.html +3 -3
  17. data/doc/Compony/ComponentMixins/Resourceful.html +3 -3
  18. data/doc/Compony/ComponentMixins.html +3 -3
  19. data/doc/Compony/Components/Button.html +11 -7
  20. data/doc/Compony/Components/Destroy.html +3 -3
  21. data/doc/Compony/Components/Edit.html +3 -3
  22. data/doc/Compony/Components/Form.html +148 -77
  23. data/doc/Compony/Components/New.html +3 -3
  24. data/doc/Compony/Components/WithForm.html +3 -3
  25. data/doc/Compony/Components.html +3 -3
  26. data/doc/Compony/ControllerMixin.html +3 -3
  27. data/doc/Compony/Engine.html +3 -3
  28. data/doc/Compony/MethodAccessibleHash.html +3 -3
  29. data/doc/Compony/ModelFields/Anchormodel.html +3 -3
  30. data/doc/Compony/ModelFields/Association.html +4 -4
  31. data/doc/Compony/ModelFields/Attachment.html +3 -3
  32. data/doc/Compony/ModelFields/Base.html +3 -3
  33. data/doc/Compony/ModelFields/Boolean.html +3 -3
  34. data/doc/Compony/ModelFields/Color.html +3 -3
  35. data/doc/Compony/ModelFields/Currency.html +3 -3
  36. data/doc/Compony/ModelFields/Date.html +3 -3
  37. data/doc/Compony/ModelFields/Datetime.html +3 -3
  38. data/doc/Compony/ModelFields/Decimal.html +3 -3
  39. data/doc/Compony/ModelFields/Email.html +3 -3
  40. data/doc/Compony/ModelFields/Float.html +3 -3
  41. data/doc/Compony/ModelFields/Integer.html +3 -3
  42. data/doc/Compony/ModelFields/Percentage.html +3 -3
  43. data/doc/Compony/ModelFields/Phone.html +3 -3
  44. data/doc/Compony/ModelFields/RichText.html +3 -3
  45. data/doc/Compony/ModelFields/String.html +3 -3
  46. data/doc/Compony/ModelFields/Text.html +3 -3
  47. data/doc/Compony/ModelFields/Time.html +3 -3
  48. data/doc/Compony/ModelFields/Url.html +3 -3
  49. data/doc/Compony/ModelFields.html +3 -3
  50. data/doc/Compony/ModelMixin.html +3 -3
  51. data/doc/Compony/NaturalOrdering.html +3 -3
  52. data/doc/Compony/RequestContext.html +3 -3
  53. data/doc/Compony/Version.html +3 -3
  54. data/doc/Compony/ViewHelpers.html +32 -14
  55. data/doc/Compony.html +4 -4
  56. data/doc/ComponyController.html +3 -3
  57. data/doc/_index.html +4 -4
  58. data/doc/class_list.html +6 -3
  59. data/doc/css/full_list.css +3 -3
  60. data/doc/css/style.css +6 -0
  61. data/doc/file.README.html +36 -3
  62. data/doc/file_list.html +5 -2
  63. data/doc/frames.html +10 -5
  64. data/doc/index.html +36 -3
  65. data/doc/js/app.js +294 -264
  66. data/doc/js/full_list.js +30 -4
  67. data/doc/method_list.html +152 -141
  68. data/doc/top-level-namespace.html +3 -3
  69. data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +7 -1
  70. data/lib/compony/components/button.rb +5 -3
  71. data/lib/compony/components/form.rb +9 -1
  72. data/lib/compony/model_fields/association.rb +1 -1
  73. data/lib/compony/view_helpers.rb +12 -4
  74. data/lib/compony.rb +1 -1
  75. metadata +3 -3
data/doc/js/full_list.js CHANGED
@@ -62,8 +62,25 @@ function enableToggles() {
62
62
  evt.stopPropagation();
63
63
  evt.preventDefault();
64
64
  $(this).parent().parent().toggleClass('collapsed');
65
+ $(this).attr('aria-expanded', function (i, attr) {
66
+ return attr == 'true' ? 'false' : 'true'
67
+ });
65
68
  highlight();
66
69
  });
70
+
71
+ // navigation of nested classes using keyboard
72
+ $('#full_list a.toggle').on('keypress',function(evt) {
73
+ // enter key is pressed
74
+ if (evt.which == 13) {
75
+ evt.stopPropagation();
76
+ evt.preventDefault();
77
+ $(this).parent().parent().toggleClass('collapsed');
78
+ $(this).attr('aria-expanded', function (i, attr) {
79
+ return attr == 'true' ? 'false' : 'true'
80
+ });
81
+ highlight();
82
+ }
83
+ });
67
84
  }
68
85
 
69
86
  function populateSearchCache() {
@@ -91,7 +108,7 @@ function enableSearch() {
91
108
  }
92
109
  });
93
110
 
94
- $('#full_list').after("<div id='noresults' style='display:none'></div>");
111
+ $('#full_list').after("<div id='noresults' role='status' style='display: none'></div>");
95
112
  }
96
113
 
97
114
  function ignoredKeyPress(event) {
@@ -154,11 +171,14 @@ function partialSearch(searchString, offset) {
154
171
  function searchDone() {
155
172
  searchTimeout = null;
156
173
  highlight();
157
- if ($('#full_list li:visible').size() === 0) {
158
- $('#noresults').text('No results were found.').hide().fadeIn();
174
+ var found = $('#full_list li:visible').size();
175
+ if (found === 0) {
176
+ $('#noresults').text('No results were found.');
159
177
  } else {
160
- $('#noresults').text('').hide();
178
+ // This is read out to screen readers
179
+ $('#noresults').text('There are ' + found + ' results.');
161
180
  }
181
+ $('#noresults').show();
162
182
  $('#content').removeClass('insearch');
163
183
  }
164
184
 
@@ -188,6 +208,12 @@ function expandTo(path) {
188
208
  $target.addClass('clicked');
189
209
  $target.removeClass('collapsed');
190
210
  $target.parentsUntil('#full_list', 'li').removeClass('collapsed');
211
+
212
+ $target.find('a.toggle').attr('aria-expanded', 'true')
213
+ $target.parentsUntil('#full_list', 'li').each(function(i, el) {
214
+ $(el).find('> div > a.toggle').attr('aria-expanded', 'true');
215
+ });
216
+
191
217
  if($target[0]) {
192
218
  window.scrollTo(window.scrollX, $target.offset().top - 250);
193
219
  highlight();