From 9e0172c27fb0bed8551b3ba27df5113c984743d6 Mon Sep 17 00:00:00 2001 From: Sebastian Riedel Date: Tue, 14 Dec 2010 03:06:57 +0100 Subject: [PATCH] default to lazy html5 style --- lib/Mojo/HelloWorld.pm | 24 +++---- lib/Mojolicious/Controller.pm | 6 +- lib/Mojolicious/Guides/Growing.pod | 14 ++-- lib/Mojolicious/Guides/Rendering.pod | 6 +- lib/Mojolicious/Lite.pm | 14 ++-- lib/Mojolicious/Plugin/TagHelpers.pm | 64 +++++++++--------- t/mojolicious/lite_app.t | 98 ++++++++++++++-------------- 7 files changed, 113 insertions(+), 113 deletions(-) diff --git a/lib/Mojo/HelloWorld.pm b/lib/Mojo/HelloWorld.pm index a9db2e9b47..c82b2d11ff 100644 --- a/lib/Mojo/HelloWorld.pm +++ b/lib/Mojo/HelloWorld.pm @@ -117,11 +117,11 @@ sub _diag { Mojo Diagnostics Cookies - Chunked Request Parameters
- Dump Environment Variables
- Dump Request Parameters
- Proxy
- Upload
+ Chunked Request Parameters
+ Dump Environment Variables
+ Dump Request Parameters
+ Proxy
+ Upload
WebSocket @@ -207,14 +207,14 @@ sub _proxy { Sync:
- - + +
-
+
Async:
- - + +
@@ -253,8 +253,8 @@ sub _upload { File:
- - + +
diff --git a/lib/Mojolicious/Controller.pm b/lib/Mojolicious/Controller.pm index 12fa0ef6f0..971fef0b7c 100644 --- a/lib/Mojolicious/Controller.pm +++ b/lib/Mojolicious/Controller.pm @@ -796,8 +796,8 @@ __DATA__ Mojolicious Exception - - + + %= base_tag %= javascript 'js/jquery.js' %= stylesheet 'css/prettify.css' @@ -1005,7 +1005,7 @@ __DATA__ %= javascript begin diff --git a/lib/Mojolicious/Guides/Growing.pod b/lib/Mojolicious/Guides/Growing.pod index fa967b1c39..d9074f0df6 100644 --- a/lib/Mojolicious/Guides/Growing.pod +++ b/lib/Mojolicious/Guides/Growing.pod @@ -439,21 +439,21 @@ like this. % layout 'default'; <%= form_for index => begin %> <% if (param 'user') { %> - Wrong name or password, please try again.
+ Wrong name or password, please try again.
<% } %> - Name:
- <%= text_field 'user' %>
- Password:
- <%= password_field 'pass' %>
+ Name:
+ <%= text_field 'user' %>
+ Password:
+ <%= password_field 'pass' %>
<%= submit_button 'Login' %> <% end %> @@ protected.html.ep % layout 'default'; <% if (my $message = flash 'message') { %> - <%= $message %>
+ <%= $message %>
<% } %> - Welcome <%= session 'user' %>!
+ Welcome <%= session 'user' %>!
<%= link_to Logout => 'logout' %> More information about template helpers can be found in diff --git a/lib/Mojolicious/Guides/Rendering.pod b/lib/Mojolicious/Guides/Rendering.pod index a9bc6adffd..a2be82d8c3 100644 --- a/lib/Mojolicious/Guides/Rendering.pod +++ b/lib/Mojolicious/Guides/Rendering.pod @@ -458,7 +458,7 @@ stylesheets. $self->write_chunk('Example'); $self->write_chunk('write_chunk(' type="text/css" />', sub { + $self->write_chunk(' type="text/css">', sub { my $self = shift; $self->write_chunk('Example'); $self->write_chunk(''); @@ -472,8 +472,8 @@ An empty chunk marks the end of the stream. Example 29 + 17 + type="text/css"> 1C Example 0 diff --git a/lib/Mojolicious/Lite.pm b/lib/Mojolicious/Lite.pm index 54164b5d96..76d8aca0ad 100644 --- a/lib/Mojolicious/Lite.pm +++ b/lib/Mojolicious/Lite.pm @@ -534,21 +534,21 @@ request), this is very useful in combination with C. % layout 'default'; <%= form_for login => begin %> <% if (param 'name') { %> - Wrong name or password, please try again.
+ Wrong name or password, please try again.
<% } %> - Name:
- <%= text_field 'name' %>
- Password:
- <%= password_field 'pass' %>
+ Name:
+ <%= text_field 'name' %>
+ Password:
+ <%= password_field 'pass' %>
<%= submit_button 'Login' %> <% end %> @@ index.html.ep % layout 'default'; <% if (my $message = flash 'message' ) { %> - <%= $message %>
+ <%= $message %>
<% } %> - Welcome <%= session 'name' %>!
+ Welcome <%= session 'name' %>!
<%= link_to logout => begin %> Logout <% end %> diff --git a/lib/Mojolicious/Plugin/TagHelpers.pm b/lib/Mojolicious/Plugin/TagHelpers.pm index 71d0efcd36..17a2f11192 100644 --- a/lib/Mojolicious/Plugin/TagHelpers.pm +++ b/lib/Mojolicious/Plugin/TagHelpers.pm @@ -313,7 +313,7 @@ sub _tag { } # Empty element - else { $tag .= ' />' } + else { $tag .= '>' } # Prevent escaping return b($tag); @@ -352,7 +352,7 @@ Note that this module is EXPERIMENTAL and might change without warning! Generate C tag refering to the current base URL. - + =item check_box @@ -361,8 +361,8 @@ Generate C tag refering to the current base URL. Generate checkbox input element. - - + + =item file_field @@ -371,8 +371,8 @@ Generate checkbox input element. Generate file input element. - - + + =item form_for @@ -396,20 +396,20 @@ Generate file input element. Generate form for route, path or URL.
- - + +
- - + +
- - + +
- - + +
=item hidden_field @@ -419,8 +419,8 @@ Generate form for route, path or URL. Generate hidden input element. - - + + =item input_tag @@ -431,10 +431,10 @@ Generate hidden input element. Generate form input element. - - - - + + + + =item javascript @@ -445,7 +445,7 @@ Generate form input element. Generate script tag for C asset. - @@ -478,8 +478,8 @@ will be used as content. Generate password input element. - - + + =item radio_button @@ -488,8 +488,8 @@ Generate password input element. Generate radio input element. - - + + =item select_field @@ -528,7 +528,7 @@ Generate select, option and optgroup elements. Generate style or link tag for C asset. - + @@ -540,8 +540,8 @@ Generate style or link tag for C asset. Generate submit input element. - - + + =item tag @@ -551,8 +551,8 @@ Generate submit input element. HTML5 tag generator. -
-
+
+
Content
=item text_field @@ -562,8 +562,8 @@ HTML5 tag generator. Generate text input element. - - + + =item text_area diff --git a/t/mojolicious/lite_app.t b/t/mojolicious/lite_app.t index 77a6d57169..77133c0ae8 100644 --- a/t/mojolicious/lite_app.t +++ b/t/mojolicious/lite_app.t @@ -792,8 +792,8 @@ $ENV{MOJO_REVERSE_PROXY} = $backup; # GET /tags $t->get_ok('/tags/lala?a=b&b=0&c=2&d=3&escaped=1%22+%222')->status_is(200) ->content_is(< - + + Hello Path Foo @@ -801,31 +801,31 @@ $t->get_ok('/tags/lala?a=b&b=0&c=2&d=3&escaped=1%22+%222')->status_is(200) Home Foo
- +
- - - - - - - + + + + + + + - - - - + + + +
- +
- - - + + + - +