masterview 0.2.5 → 0.3.0

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 (155) hide show
  1. data/CHANGELOG +31 -1
  2. data/README +70 -69
  3. data/RELEASE_NOTES +70 -64
  4. data/Rakefile +26 -27
  5. data/TODO +13 -29
  6. data/doc/about.html +246 -0
  7. data/doc/configuration.html +49 -36
  8. data/doc/developer.html +423 -41
  9. data/doc/directives.html +139 -51
  10. data/doc/guide.html +19 -9
  11. data/doc/index.html +90 -224
  12. data/doc/installation.html +36 -28
  13. data/doc/media_list.html +30 -20
  14. data/doc/simple_diagram.html +3 -5
  15. data/doc/stylesheets/masterview.css +16 -1
  16. data/examples/rails_app_config/masterview/settings.rb +2 -1
  17. data/init.rb +1 -1
  18. data/lib/#ChangeLog# +6 -0
  19. data/lib/masterview/analyzer.rb +48 -34
  20. data/lib/masterview/attr_string_parser.rb +5 -1
  21. data/lib/masterview/case_insensitive_hash.rb +69 -0
  22. data/lib/masterview/{pathname_extensions.rb → core_ext/pathname.rb} +0 -0
  23. data/lib/masterview/{string_extensions.rb → core_ext/string.rb} +0 -0
  24. data/lib/masterview/deprecated/directive_base.rb +362 -0
  25. data/lib/masterview/directive_base.rb +201 -179
  26. data/lib/masterview/directive_dsl.rb +457 -0
  27. data/lib/masterview/directive_helpers.rb +28 -141
  28. data/lib/masterview/directive_load_path.rb +388 -0
  29. data/lib/masterview/directive_metadata.rb +377 -0
  30. data/lib/masterview/directive_registry.rb +259 -69
  31. data/lib/masterview/directives/.metadata +16 -0
  32. data/lib/masterview/directives/attr.rb +9 -8
  33. data/lib/masterview/directives/block.rb +11 -14
  34. data/lib/masterview/directives/check_box.rb +13 -18
  35. data/lib/masterview/directives/collection_select.rb +15 -29
  36. data/lib/masterview/directives/content.rb +9 -3
  37. data/lib/masterview/directives/else.rb +15 -13
  38. data/lib/masterview/directives/elsif.rb +14 -13
  39. data/lib/masterview/directives/eval.rb +20 -0
  40. data/lib/masterview/directives/form.rb +56 -9
  41. data/lib/masterview/directives/form_remote.rb +26 -0
  42. data/lib/masterview/directives/global_inline_erb.rb +10 -14
  43. data/lib/masterview/directives/hidden_field.rb +11 -20
  44. data/lib/masterview/directives/if.rb +13 -12
  45. data/lib/masterview/directives/image_tag.rb +20 -28
  46. data/lib/masterview/directives/import.rb +5 -12
  47. data/lib/masterview/directives/import_render.rb +7 -19
  48. data/lib/masterview/directives/insert_generated_comment.rb +8 -11
  49. data/lib/masterview/directives/javascript_include.rb +21 -12
  50. data/lib/masterview/directives/link_to.rb +14 -8
  51. data/lib/masterview/directives/link_to_function.rb +22 -0
  52. data/lib/masterview/directives/link_to_if.rb +15 -13
  53. data/lib/masterview/directives/link_to_remote.rb +13 -8
  54. data/lib/masterview/directives/omit_tag.rb +32 -16
  55. data/lib/masterview/directives/password_field.rb +10 -22
  56. data/lib/masterview/directives/radio_button.rb +11 -22
  57. data/lib/masterview/directives/replace.rb +7 -8
  58. data/lib/masterview/directives/select.rb +11 -24
  59. data/lib/masterview/directives/stylesheet_link.rb +20 -12
  60. data/lib/masterview/directives/submit.rb +11 -5
  61. data/lib/masterview/directives/text_area.rb +10 -23
  62. data/lib/masterview/directives/text_field.rb +10 -22
  63. data/lib/masterview/exceptions.rb +21 -0
  64. data/lib/masterview/extras/app/controllers/masterview_controller.rb +102 -75
  65. data/lib/masterview/extras/app/views/layouts/masterview_admin.rhtml +24 -23
  66. data/lib/masterview/extras/app/views/layouts/masterview_admin_config.rhtml +81 -0
  67. data/lib/masterview/extras/app/views/masterview/admin/configuration.rhtml +5 -1
  68. data/lib/masterview/extras/app/views/masterview/admin/create.rhtml +2 -2
  69. data/lib/masterview/extras/app/views/masterview/admin/directives.rhtml +5 -0
  70. data/lib/masterview/extras/app/views/masterview/admin/features.rhtml +5 -79
  71. data/lib/masterview/extras/app/views/masterview/admin/interact.rhtml +5 -0
  72. data/lib/masterview/extras/app/views/masterview/admin/list.rhtml +3 -71
  73. data/lib/masterview/extras/init_mv_admin_pages.rb +42 -23
  74. data/lib/masterview/filter_helpers.rb +26 -0
  75. data/lib/masterview/initializer.rb +99 -53
  76. data/lib/masterview/io.rb +19 -15
  77. data/lib/masterview/keyword_expander.rb +7 -2
  78. data/lib/masterview/masterview_info.rb +229 -23
  79. data/lib/masterview/masterview_version.rb +2 -2
  80. data/lib/masterview/parser.rb +275 -105
  81. data/lib/masterview/parser_helpers.rb +54 -0
  82. data/lib/masterview/rails_ext/action_controller_erb_direct.rb +29 -0
  83. data/lib/masterview/rails_ext/action_controller_reparse_checking.rb +27 -0
  84. data/lib/masterview/{extras/init_rails_erb_mv_direct.rb → rails_ext/action_view_erb_direct.rb} +12 -59
  85. data/lib/masterview/template_spec.rb +3 -2
  86. data/lib/masterview.rb +21 -12
  87. data/lib/rexml/parsers/baseparser_with_doctype_fix.rb +473 -0
  88. data/lib/rexml/parsers/sax2parser_with_doctype_fix.rb +243 -0
  89. data/test/directive_test_helper.rb +135 -0
  90. data/test/fixtures/directives/id_check.rb +18 -0
  91. data/test/fixtures/directives/test_directive_events.rb +70 -0
  92. data/test/test_helper.rb +18 -5
  93. data/test/tmp/views/layouts/product.rhtml +10 -10
  94. data/test/tmp/views/product/_form.rhtml +4 -4
  95. data/test/tmp/views/product/_product.rhtml +3 -3
  96. data/test/tmp/views/product/destroy.rhtml +5 -5
  97. data/test/tmp/views/product/edit.rhtml +4 -4
  98. data/test/tmp/views/product/list.rhtml +3 -3
  99. data/test/tmp/views/product/new.rhtml +4 -4
  100. data/test/tmp/views/product/show.rhtml +2 -2
  101. data/test/unit/attr_string_parser_test.rb +105 -0
  102. data/test/unit/case_insensitive_hash_mod_test.rb +104 -0
  103. data/test/unit/config_settings_test.rb +13 -1
  104. data/test/unit/default_generate_mio_filter_test.rb +3 -3
  105. data/test/unit/deprecated_directive_base_test.rb +30 -0
  106. data/test/unit/directive_attr_test.rb +111 -35
  107. data/test/unit/directive_base_test.rb +520 -1
  108. data/test/unit/directive_block_test.rb +30 -22
  109. data/test/unit/directive_content_test.rb +24 -11
  110. data/test/unit/directive_else_test.rb +18 -15
  111. data/test/unit/directive_elsif_test.rb +17 -15
  112. data/test/unit/directive_form_remote_test.rb +59 -0
  113. data/test/unit/directive_form_test.rb +31 -39
  114. data/test/unit/directive_global_inline_erb_test.rb +28 -17
  115. data/test/unit/directive_grid_test_notready.rb +38 -0
  116. data/test/unit/directive_helpers_test.rb +39 -0
  117. data/test/unit/directive_hidden_field_test.rb +44 -29
  118. data/test/unit/directive_if_test.rb +10 -7
  119. data/test/unit/directive_image_tag_test.rb +69 -61
  120. data/test/unit/directive_import_render_test.rb +28 -38
  121. data/test/unit/directive_import_test.rb +16 -14
  122. data/test/unit/directive_insert_generated_comment_test.rb +32 -0
  123. data/test/unit/directive_javascript_include_test.rb +40 -43
  124. data/test/unit/directive_link_to_function_test.rb +40 -0
  125. data/test/unit/directive_link_to_if_test.rb +52 -12
  126. data/test/unit/directive_link_to_remote_test.rb +58 -0
  127. data/test/unit/directive_link_to_test.rb +46 -31
  128. data/test/unit/directive_load_path_test.rb +257 -0
  129. data/test/unit/directive_metadata_test.rb +313 -0
  130. data/test/unit/directive_omit_tag_test.rb +73 -21
  131. data/test/unit/directive_password_field_test.rb +44 -38
  132. data/test/unit/directive_registry_test.rb +44 -0
  133. data/test/unit/directive_replace_test.rb +28 -12
  134. data/test/unit/directive_stylesheet_link_test.rb +43 -36
  135. data/test/unit/directive_submit_test.rb +29 -30
  136. data/test/unit/directive_text_area_test.rb +40 -36
  137. data/test/unit/directive_text_field_test.rb +44 -38
  138. data/test/unit/example_directive_child_events_test.rb +41 -0
  139. data/test/unit/example_test.rb +31 -4
  140. data/test/unit/file_mio_test.rb +18 -13
  141. data/test/unit/filter_helpers_test.rb +10 -8
  142. data/test/unit/find_directive_parent_test.rb +174 -0
  143. data/test/unit/keyword_expander_test.rb +4 -2
  144. data/test/unit/mio_test.rb +18 -11
  145. data/test/unit/mtime_string_hash_mio_tree_test.rb +5 -1
  146. data/test/unit/parser_test.rb +41 -29
  147. data/test/unit/pathname_extensions_test.rb +1 -1
  148. data/test/unit/run_parser_test.rb +2 -2
  149. data/test/unit/simplified_directive_base_test.rb +256 -0
  150. data/test/unit/string_hash_mio_test.rb +5 -1
  151. data/test/unit/template_file_watcher_test.rb +2 -2
  152. data/test/unit/template_test.rb +221 -46
  153. metadata +86 -45
  154. data/lib/masterview/directives/testfilter.rb +0 -55
  155. data/lib/masterview/extras/init_rails_reparse_checking.rb +0 -62
data/doc/directives.html CHANGED
@@ -1,8 +1,8 @@
1
1
  <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
2
+ <!DOCTYPE html
3
3
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
4
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
5
+
6
6
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
7
  <head>
8
8
 
@@ -25,6 +25,8 @@
25
25
  &middot;&nbsp;
26
26
  <a href="./index.html">Doc Home</a>
27
27
  &nbsp;|&nbsp;
28
+ <a href="./about.html">About</a>
29
+ &nbsp;|&nbsp;
28
30
  <a href="./installation.html">Installation</a>
29
31
  &nbsp;|&nbsp;
30
32
  <a href="./configuration.html">Configuration</a>
@@ -32,8 +34,10 @@
32
34
  <a href="./guide.html">Usage</a>
33
35
  &nbsp;|&nbsp;
34
36
  <a href="./directives.html">Directives</a>
35
- &nbsp;&nbsp;
36
- <a href="./media_list.html">Media (Videos/Illustrations)</a>
37
+ &nbsp;|&nbsp;
38
+ <a href="./developer.html">Developers</a>
39
+ &nbsp;|&nbsp;
40
+ <a href="./media_list.html">Screencasts</a>
37
41
  &nbsp;&middot;
38
42
  </div>
39
43
  </div>
@@ -41,7 +45,7 @@
41
45
  <div id="pageBody">
42
46
  <div id="bodyContent">
43
47
 
44
- <h1>MasterView - Directives Reference</h1>
48
+ <h1>MasterView Directives Reference</h1>
45
49
 
46
50
  <p>MasterView template processing directives are encoded in an (x)html template
47
51
  using attribute markup. A MasterView directive is an element attribute
@@ -81,8 +85,8 @@ file being processed that can be used in attribute values for the
81
85
  <p>A typical use would be to specify the generated output for the main content
82
86
  of a template <code>one/two/foo.html</code> with the directive
83
87
  <code>mv:generate="{template_path}"</code>.
84
- This keyword notation avoids the need to replicate the template's own file name or
85
- it's relative path within the Rails <code>app/views</code> directory in the
88
+ This keyword notation avoids the need to replicate the template's own file name or
89
+ it's relative path within the Rails <code>app/views</code> directory in the
86
90
  directive markup in the template.
87
91
  </p>
88
92
 
@@ -91,9 +95,9 @@ directive markup in the template.
91
95
  Typically MasterView template files will contain mv:generate or mv:gen_partial directives
92
96
  to tell MasterView where to output the rendered rhtml. However if none are found in the template
93
97
  file, MasterView will automatically add in a mv:generate="{template_path}" to the body tag
94
- if found otherwise the root element. Additionally if MasterView was adding this to the body tag,
95
- it will add in a mv:omit_tag="" which will prevent the body tag from being included in the generated
96
- output. If you wish to disable this default generate mechanism, set the
98
+ if found otherwise the root element. Additionally if MasterView was adding this to the body tag,
99
+ it will add in a mv:omit_tag="" which will prevent the body tag from being included in the generated
100
+ output. If you wish to disable this default generate mechanism, set the
97
101
  config.default_parser_options[:default_generate] = false in your masterview settings or
98
102
  environments files.
99
103
  </p>
@@ -154,6 +158,10 @@ environments files.
154
158
  <td>Expands to the equivalent rhtml (erb) block code around this element</td>
155
159
  </tr>
156
160
  <tr>
161
+ <td class="directive"><a href="#mv_eval">mv:eval</a></td>
162
+ <td>Inserts an rhtml evaluation expression for the attribute value prior to this element</td>
163
+ </tr>
164
+ <tr>
157
165
  <td class="directive"><a href="#mv_if">mv:if</a></td>
158
166
  <td>Wraps this element with an <code>if... end</code> block using the attribute contents for the condition</td>
159
167
  </tr>
@@ -198,6 +206,14 @@ Used on <code>&lt;a&gt;</code> link elements
198
206
  </td>
199
207
  </tr>
200
208
  <tr>
209
+ <td class="directive"><a href="#mv_link_to_function">mv:link_to_function</a></td>
210
+ <td>Replaces this element using the Rails <code>link_to_function</code> helper which creates a link which calls a JavaScript function.
211
+ <span class="explanation">(
212
+ Used on <code>&lt;a&gt;</code> link elements
213
+ )</span>
214
+ </td>
215
+ </tr>
216
+ <tr>
201
217
  <td class="directive"><a href="#mv_link_to_if">mv:link_to_if</a></td>
202
218
  <td>Replaces this element using the Rails <code>link_to_if</code> helper
203
219
  <span class="explanation">(
@@ -239,7 +255,11 @@ Used on <code>&lt;select&gt;</code> form elements
239
255
  </tr>
240
256
  <tr>
241
257
  <td class="directive"><a href="#mv_form">mv:form</a></td>
242
- <td>Replaces the start and end tags of this element using the Rails <code>form_tag</code> and <code>form_tag</code> helpers</td>
258
+ <td>Replaces the start and end tags of this element using the Rails <code>form_tag</code> helper and closing form tag</td>
259
+ </tr>
260
+ <tr>
261
+ <td class="directive"><a href="#mv_form_remote">mv:form_remote</a></td>
262
+ <td>Replaces the start and end tags of this element using the Rails <code>form_remote_tag</code> helper and a closing form tag for Ajax-enabled form submission using the Prototype library</td>
243
263
  </tr>
244
264
  <tr>
245
265
  <td class="directive"><a href="#mv_hidden_field">mv:hidden_field</a></td>
@@ -584,6 +604,27 @@ mv:block=&quot;rubyBlockCodeHere&quot;
584
604
  Its all based on the ruby and rails syntax while keeping things xhtml and designer friendly.
585
605
  </pre>
586
606
 
607
+ <a name="mv_eval"></a>
608
+ <h4>mv:eval</h4>
609
+ <p>
610
+ mv:eval=&quot;rubyExpression&quot;
611
+ </p>
612
+ <pre>
613
+ At runtime this causes an rhtml evaluation expression for the attribute value
614
+ to be inserted into the output preceding this element, for example...
615
+
616
+ &lt;table mv:eval=&quot;num_alerts = 0&quot;&gt;
617
+ ... some table content here ...
618
+ &lt;/table&gt;
619
+
620
+ becomes
621
+
622
+ &lt;% num_alerts = 0 %&gt;
623
+ &lt;table&gt;
624
+ ... some table content here ...
625
+ &lt;/table&gt;
626
+ </pre>
627
+
587
628
  <a name="mv_if"></a>
588
629
  <h4>mv:if</h4>
589
630
  <p>
@@ -711,7 +752,7 @@ mv:image_tag=&quot;cat.jpg&quot;
711
752
  </p>
712
753
  <pre>
713
754
  Replaces the tag with a image_tag helper, size is determined by width and height, other html attributes
714
- are passed through. for example...
755
+ are passed through. for example...
715
756
 
716
757
  &lt;img src=&quot;../../../public/images/cat.jpg&quot; mv:image_tag=&quot;cat.jpg&quot;/>
717
758
 
@@ -726,8 +767,8 @@ mv:image_tag=&quot;cat.jpg&quot;
726
767
 
727
768
  &lt;%= image_tag 'cat.jpg', :alt =&gt; 'my cat', :size =&gt; '20x10' %&gt;
728
769
 
729
- Also if path isn't specified in the mv:image_tag attribute value then it will infer the path looking
730
- for what follows the public/images/ in the src atttribute, like so
770
+ Also if path isn't specified in the mv:image_tag attribute value then it will infer the path looking
771
+ for what follows the public/images/ in the src atttribute, like so
731
772
 
732
773
  &lt;img src=&quot;../../../public/images/cat.jpg&quot; mv:image_tag=&quot;&quot;/>
733
774
 
@@ -754,7 +795,7 @@ mv:javascript_include=&quot;prototype.js&quot;
754
795
 
755
796
  &lt;%= javascript_include_tag 'prototype.js' %&gt;
756
797
 
757
- You can also use a symbol
798
+ You can also use a symbol
758
799
 
759
800
  &lt;script type=&quot;text/javascript&quot; src=&quot;../../../public/javascripts/prototype.js&quot;
760
801
  mv:javascript_include=&quot;:defaults&quot;&gt;&lt;/script&gt;
@@ -763,7 +804,7 @@ mv:javascript_include=&quot;prototype.js&quot;
763
804
 
764
805
  &lt;%= javascript_include_tag :defaults %&gt;
765
806
 
766
- And you can have the path inferred from the src path (uses the relative path to public/javascripts)
807
+ And you can have the path inferred from the src path (uses the relative path to public/javascripts)
767
808
 
768
809
  &lt;script type=&quot;text/javascript&quot; src=&quot;../../../public/javascripts/prototype.js&quot;
769
810
  mv:javascript_include=&quot;&quot;&gt;&lt;/script&gt;
@@ -793,6 +834,21 @@ mv:link_to=&quot;linkToOptions&quot;
793
834
  &lt;%= link_to 'New product', :action =&gt; 'new' %&gt;
794
835
  </pre>
795
836
 
837
+ <a name="mv_link_to_function"></a>
838
+ <h4>mv:link_to_function</h4>
839
+ <p>
840
+ mv:link_to_function=&quot;mv:link_to_if=&quot;function, options&quot;&quot;
841
+ </p>
842
+ <pre>
843
+ Replaces the tag with a link_to_function helper. The attribute values
844
+ contains the function to call, along with optional keyword arguments
845
+ to pass to the link_to_function helper. The content of the element
846
+ is used as the function name.
847
+
848
+ ### todo: add example here ###
849
+
850
+ </pre>
851
+
796
852
  <a name="mv_link_to_if"></a>
797
853
  <h4>mv:link_to_if</h4>
798
854
  <p>
@@ -862,8 +918,8 @@ mv:stylesheet_link=&quot;style&quot;
862
918
  mv:check_box=&quot;product, name&quot;
863
919
  </p>
864
920
  <pre>
865
- Replaces this element with the check_box helper. It quotes the object and name if necessary, and merges any
866
- html attributes into options if supplied
921
+ Replaces this element with the check_box helper. It quotes the object and name if necessary, and merges any
922
+ html attributes into options if supplied
867
923
 
868
924
  &lt;input type="checkbox" mv:check_box=&quot;product, name&quot;/&gt;
869
925
 
@@ -871,7 +927,7 @@ mv:check_box=&quot;product, name&quot;
871
927
 
872
928
  &lt;% check_box 'product', 'name' %&gt;
873
929
 
874
- and
930
+ and
875
931
 
876
932
  &lt;input type="checkbox" class=&quot;green&quot; id=&quot;cb1&quot; mv:check_box=&quot;product, name, {:readonly =&gt; true}, &apos;yes,&apos;, &apos;no&apos;&quot;/&gt;
877
933
 
@@ -888,14 +944,14 @@ mv:collection_select=&quot;product, category, Category.find_all, id, name&quot;
888
944
  </p>
889
945
  <pre>
890
946
  Replaces the tag with a select helper, it quotes the object and method if necessary, and
891
- merges any html attributes into the html_options
947
+ merges any html attributes into the html_options
948
+
892
949
 
950
+ &lt;select mv:collection_select=&quot;product, category, Category.find_all, id, name&quot;&gt;
951
+ &lt;option&gt;One&lt;/option&gt;
952
+ &lt;option&gt;One&lt;/option&gt;
953
+ &lt;/select&gt;
893
954
 
894
- &lt;select mv:collection_select=&quot;product, category, Category.find_all, id, name&quot;&gt;
895
- &lt;option&&gt;One&lt;/option&gt;
896
- &lt;option&&gt;One&lt;/option&gt;
897
- &lt;/select&gt;
898
-
899
955
  becomes
900
956
 
901
957
  &lt;%= collection_select &apos;product&apos;, &apos;category&apos;, Category.find_all, &apos;id&apos;, &apos;name&apos; %&gt;
@@ -903,11 +959,11 @@ mv:collection_select=&quot;product, category, Category.find_all, id, name&quot;
903
959
  and
904
960
 
905
961
 
906
- &lt;select size=&quot;3&quot; mv:collection_select=&quot;product, category, Category.find_all, id, name, {}, :readonly => true &quot;&gt;
907
- &lt;option&&gt;One&lt;/option&gt;
908
- &lt;option&&gt;One&lt;/option&gt;
909
- &lt;/select&gt;
910
-
962
+ &lt;select size=&quot;3&quot; mv:collection_select=&quot;product, category, Category.find_all, id, name, {}, :readonly => true &quot;&gt;
963
+ &lt;option&gt;One&lt;/option&gt;
964
+ &lt;option&gt;One&lt;/option&gt;
965
+ &lt;/select&gt;
966
+
911
967
 
912
968
  becomes
913
969
 
@@ -922,24 +978,34 @@ mv:collection_select=&quot;product, category, Category.find_all, id, name&quot;
922
978
  mv:form=&quot;:action =&gt; &#8216;new&#8217;&quot;
923
979
  </p>
924
980
  <pre>
925
- Replaces this tag and closing tag with the form_tag and end_form_tag helpers. It also pulls the
981
+ Replaces this tag and closing tag with the form_tag helper and a closing form tag. It also pulls the
926
982
  method and multipart attributes from the element and merges that into the form_tag options, for example...
927
983
 
928
984
  &lt;form mv:form=&quot;:action =&gt; 'new'&quot;&gt;foobar&lt;/form&gt;
929
985
 
930
986
  becomes
931
987
 
932
- &lt;% form_tag :action =&gt; 'new' %&gt;
988
+ &lt;%= form_tag( :action =&gt; 'new') %&gt;
933
989
  foobar
934
- &lt;% end_form_tag %&gt;
990
+ &lt;/form&gt;
935
991
 
936
992
  &lt;form method=&quot;GET&quot; mv:form=&quot;:action =&gt; 'new'&quot;&gt;foobar&lt;/form&gt;
937
993
 
938
994
  becomes
939
995
 
940
- &lt;% form_tag { :action =&gt; 'new' }, :method =&gt; 'GET' %&gt;
996
+ &lt;%= form_tag( { :action =&gt; 'new' }, :method =&gt; 'GET') %&gt;
941
997
  foobar
942
- &lt;% end_form_tag %&gt;
998
+ &lt;/form&gt;
999
+ </pre>
1000
+
1001
+ <a name="mv_form_remote"></a>
1002
+ <h4>mv:form_remote</h4>
1003
+ <p>
1004
+ mv:form_remote=&quot;:action =&gt; &#8216; url_for(:controller => "some", :action => "place")&#8217;&quot;
1005
+ </p>
1006
+ <pre>
1007
+ Replaces this tag and closing tag with the form_remote_tag helper and a closing form tag
1008
+ ### needs work - fix prototype and add example ###
943
1009
  </pre>
944
1010
 
945
1011
  <a name="mv_hidden_field"></a>
@@ -989,7 +1055,7 @@ mv:radio_button=&quot;product, category, 'clothing'&quot;
989
1055
  </p>
990
1056
  <pre>
991
1057
  Replaces the tag with a radio_button helper, it quotes the object and method if necessary, and
992
- merges any html attributes into the options
1058
+ merges any html attributes into the options
993
1059
 
994
1060
 
995
1061
  &lt;input type=&quot;radio&quot; mv:radio_button=&quot;product, category, 'clothing'&quot;/&gt;
@@ -1015,14 +1081,14 @@ mv:select=&quot;product, category, Category.find_all.collect{|c| [c.name, c.id]}
1015
1081
  </p>
1016
1082
  <pre>
1017
1083
  Replaces the tag with a select helper, it quotes the object and method if necessary, and
1018
- merges any html attributes into the html_options
1084
+ merges any html attributes into the html_options
1085
+
1019
1086
 
1087
+ &lt;select mv:select=&quot;product, category, Category.find_all.collect{|c| [c.name, c.id]}&quot;&gt;
1088
+ &lt;option&gt;One&lt;/option&gt;
1089
+ &lt;option&gt;One&lt;/option&gt;
1090
+ &lt;/select&gt;
1020
1091
 
1021
- &lt;select mv:select=&quot;product, category, Category.find_all.collect{|c| [c.name, c.id]}&quot;&gt;
1022
- &lt;option&&gt;One&lt;/option&gt;
1023
- &lt;option&&gt;One&lt;/option&gt;
1024
- &lt;/select&gt;
1025
-
1026
1092
  becomes
1027
1093
 
1028
1094
  &lt;%= select &apos;product&apos;, &apos;category&apos;, Category.find_all.collect{|c| [c.name, c.id]} %&gt;
@@ -1030,11 +1096,11 @@ mv:select=&quot;product, category, Category.find_all.collect{|c| [c.name, c.id]}
1030
1096
  and
1031
1097
 
1032
1098
 
1033
- &lt;select size=&quot;3&quot; mv:select=&quot;product, category, Category.find_all.collect{|c| [c.name, c.id]}, {}, :readonly => true &quot;&gt;
1034
- &lt;option&&gt;One&lt;/option&gt;
1035
- &lt;option&&gt;One&lt;/option&gt;
1036
- &lt;/select&gt;
1037
-
1099
+ &lt;select size=&quot;3&quot; mv:select=&quot;product, category, Category.find_all.collect{|c| [c.name, c.id]}, {}, :readonly => true &quot;&gt;
1100
+ &lt;option&gt;One&lt;/option&gt;
1101
+ &lt;option&gt;One&lt;/option&gt;
1102
+ &lt;/select&gt;
1103
+
1038
1104
 
1039
1105
  becomes
1040
1106
 
@@ -1167,11 +1233,19 @@ Used on <code>&lt;select&gt;</code> form elements
1167
1233
  <td class="directive"><a href="#mv_elsif">mv:elsif</a></td>
1168
1234
  <td>Used in conjunction with the <span class="directiveName">mv:if</span> directive to allow you to create <code>if... elsif... end</code> blocks</td>
1169
1235
  </tr>
1236
+ <tr>
1237
+ <td class="directive"><a href="#mv_eval">mv:eval</a></td>
1238
+ <td>Inserts an rhtml evaluation expression for the attribute value prior to this element</td>
1239
+ </tr>
1170
1240
 
1171
1241
  <!-- f -->
1172
1242
  <tr>
1173
1243
  <td class="directive"><a href="#mv_form">mv:form</a></td>
1174
- <td>Replaces the start and end tags of this element using the Rails <code>form_tag</code> and <code>form_tag</code> helpers</td>
1244
+ <td>Replaces the start and end tags of this element using the Rails <code>form_tag</code> block helper and a closing form tag</td>
1245
+ </tr>
1246
+ <tr>
1247
+ <td class="directive"><a href="#mv_form_remote">mv:form_remote</a></td>
1248
+ <td>Replaces the start and end tags of this element using the Rails <code>form_remote_tag</code> helper and a closing form tag for Ajax-enabled form submission using the Prototype library</td>
1175
1249
  </tr>
1176
1250
 
1177
1251
  <!-- g -->
@@ -1244,6 +1318,14 @@ Used on <code>&lt;a&gt;</code> link elements
1244
1318
  </td>
1245
1319
  </tr>
1246
1320
  <tr>
1321
+ <td class="directive"><a href="#mv_link_to_function">mv:link_to_function</a></td>
1322
+ <td>Replaces this element using the Rails <code>link_to_function</code> helper which creates a link which calls a JavaScript function.
1323
+ <span class="explanation">(
1324
+ Used on <code>&lt;a&gt;</code> link elements
1325
+ )</span>
1326
+ </td>
1327
+ </tr>
1328
+ <tr>
1247
1329
  <td class="directive"><a href="#mv_link_to_if">mv:link_to_if</a></td>
1248
1330
  <td>Replaces this element using the Rails <code>link_to_if</code> helper
1249
1331
  <span class="explanation">(
@@ -1336,6 +1418,8 @@ Used on <code>&lt;input&gt;</code> form elements
1336
1418
  &middot;&nbsp;
1337
1419
  <a href="./index.html">Doc Home</a>
1338
1420
  &nbsp;|&nbsp;
1421
+ <a href="./about.html">About</a>
1422
+ &nbsp;|&nbsp;
1339
1423
  <a href="./installation.html">Installation</a>
1340
1424
  &nbsp;|&nbsp;
1341
1425
  <a href="./configuration.html">Configuration</a>
@@ -1343,8 +1427,10 @@ Used on <code>&lt;input&gt;</code> form elements
1343
1427
  <a href="./guide.html">Usage</a>
1344
1428
  &nbsp;|&nbsp;
1345
1429
  <a href="./directives.html">Directives</a>
1346
- &nbsp;&nbsp;
1347
- <a href="./media_list.html">Media (Videos/Illustrations)</a>
1430
+ &nbsp;|&nbsp;
1431
+ <a href="./developer.html">Developers</a>
1432
+ &nbsp;|&nbsp;
1433
+ <a href="./media_list.html">Screencasts</a>
1348
1434
  &nbsp;&middot;
1349
1435
  </div>
1350
1436
  <table summary="layout area">
@@ -1352,7 +1438,9 @@ Used on <code>&lt;input&gt;</code> form elements
1352
1438
  <tr>
1353
1439
  <td class="copyright">&copy;&nbsp;Copyright MasterView 2006</td>
1354
1440
  <td class="validators">
1355
- <a href="http://validator.w3.org/check/referer"><img src="http://www.w3.org/Icons/valid-xhtml10" title="Valid XHTML 1.0!" alt="Valid XHTML 1.0!" /></a>
1441
+ <a href="http://validator.w3.org/check/referer"><img
1442
+ src="http://www.w3.org/Icons/valid-xhtml10" class="w3c_validator"
1443
+ title="Valid XHTML 1.0!" alt="Valid XHTML 1.0!" /></a>
1356
1444
  </td>
1357
1445
  </tr>
1358
1446
  </tbody>
data/doc/guide.html CHANGED
@@ -24,6 +24,8 @@
24
24
  &middot;&nbsp;
25
25
  <a href="./index.html">Doc Home</a>
26
26
  &nbsp;|&nbsp;
27
+ <a href="./about.html">About</a>
28
+ &nbsp;|&nbsp;
27
29
  <a href="./installation.html">Installation</a>
28
30
  &nbsp;|&nbsp;
29
31
  <a href="./configuration.html">Configuration</a>
@@ -31,8 +33,10 @@
31
33
  <a href="./guide.html">Usage</a>
32
34
  &nbsp;|&nbsp;
33
35
  <a href="./directives.html">Directives</a>
34
- &nbsp;&nbsp;
35
- <a href="./media_list.html">Media (Videos/Illustrations)</a>
36
+ &nbsp;|&nbsp;
37
+ <a href="./developer.html">Developers</a>
38
+ &nbsp;|&nbsp;
39
+ <a href="./media_list.html">Screencasts</a>
36
40
  &nbsp;&middot;
37
41
  </div>
38
42
  </div>
@@ -40,7 +44,7 @@
40
44
  <div id="pageBody">
41
45
  <div id="bodyContent">
42
46
 
43
- <h1>MasterView - User's Guide</h1>
47
+ <h1>MasterView User's Guide</h1>
44
48
 
45
49
  <p>
46
50
  MasterView is designed to be easy
@@ -123,10 +127,10 @@ generating all parts to a single file for the ultimate in DRY.
123
127
  <p>
124
128
  For example, if our generated Controller name is Store and the Model is Product this is
125
129
  what would be generated.<br/>
126
- <table id="generatedRhtml">
130
+ <table id="generatedRhtml" summary="descriptions of generated scaffold templates">
127
131
  <thead>
128
132
  <tr>
129
- <th>Template</h>
133
+ <th>Template</th>
130
134
  <th>Contained rhtml parts</th>
131
135
  </tr>
132
136
  </thead>
@@ -167,7 +171,7 @@ what would be generated.<br/>
167
171
  </tr>
168
172
  </tbody>
169
173
  </table>
170
- </p>
174
+
171
175
  <p>
172
176
  By adding the &#8212;single-file switch MasterView will create a single file
173
177
  and to make it easier to use this template at design time, some design time
@@ -283,6 +287,8 @@ rake -T
283
287
  &middot;&nbsp;
284
288
  <a href="./index.html">Doc Home</a>
285
289
  &nbsp;|&nbsp;
290
+ <a href="./about.html">About</a>
291
+ &nbsp;|&nbsp;
286
292
  <a href="./installation.html">Installation</a>
287
293
  &nbsp;|&nbsp;
288
294
  <a href="./configuration.html">Configuration</a>
@@ -290,8 +296,10 @@ rake -T
290
296
  <a href="./guide.html">Usage</a>
291
297
  &nbsp;|&nbsp;
292
298
  <a href="./directives.html">Directives</a>
293
- &nbsp;&nbsp;
294
- <a href="./media_list.html">Media (Videos/Illustrations)</a>
299
+ &nbsp;|&nbsp;
300
+ <a href="./developer.html">Developers</a>
301
+ &nbsp;|&nbsp;
302
+ <a href="./media_list.html">Screencasts</a>
295
303
  &nbsp;&middot;
296
304
  </div>
297
305
  <table summary="layout area">
@@ -299,7 +307,9 @@ rake -T
299
307
  <tr>
300
308
  <td class="copyright">&copy;&nbsp;Copyright MasterView 2006</td>
301
309
  <td class="validators">
302
- <a href="http://validator.w3.org/check/referer">[Valid XHTML]</a>
310
+ <a href="http://validator.w3.org/check/referer"><img
311
+ src="http://www.w3.org/Icons/valid-xhtml10" class="w3c_validator"
312
+ title="Valid XHTML 1.0!" alt="Valid XHTML 1.0!" /></a>
303
313
  </td>
304
314
  </tr>
305
315
  </tbody>