Skip to content

Commit

Permalink
no need for javascript and stylesheet helpers most of the time
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 3, 2014
1 parent 878b84e commit d35255e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions examples/websocket.pl
Expand Up @@ -24,7 +24,7 @@
<html>
<head>
<title>WebSocket Test</title>
%= javascript begin
<script>
var ws;
if ("WebSocket" in window) {
ws = new WebSocket('<%= url_for('test')->to_abs %>');
Expand All @@ -40,7 +40,7 @@
else {
document.body.innerHTML += 'Browser does not support WebSockets.';
}
% end
</script>
</head>
<body>Testing WebSockets: </body>
</html>
4 changes: 2 additions & 2 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -705,10 +705,10 @@ with methods like L<Mojolicious::Validator::Validation/"is_valid">.
<!DOCTYPE html>
<html>
<head>
%= stylesheet begin
<style>
label.field-with-error { color: #dd7e5e }
input.field-with-error { background-color: #fd9e7e }
% end
</style>
</head>
<body>
%= form_for index => begin
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -917,15 +917,15 @@ and return them with L<Mojolicious::Controller/"send">.
<html>
<head>
<title>Echo</title>
%= javascript begin
<script>
var ws = new WebSocket('<%= url_for('echo')->to_abs %>');
ws.onmessage = function (event) {
document.body.innerHTML += JSON.parse(event.data).msg;
};
ws.onopen = function (event) {
ws.send(JSON.stringify({msg: 'I ♥ Mojolicious!'}));
};
% end
</script>
</head>
</html>
Expand Down
12 changes: 6 additions & 6 deletions lib/Mojolicious/templates/development.html.ep
Expand Up @@ -8,7 +8,7 @@
%= javascript '/mojo/jquery/jquery.js'
%= javascript '/mojo/prettify/run_prettify.js'
%= stylesheet '/mojo/prettify/prettify-mojo-dark.css'
%= stylesheet begin
<style>
a img { border: 0 }
body {
background: url(<%= url_for '/mojo/pinstripe-light.png' %>);
Expand Down Expand Up @@ -111,11 +111,11 @@
max-width: 1000px;
margin: 0 auto;
}
% end
</style>
</head>
<body>
%= include inline => app->renderer->_bundled('mojobar')
%= javascript begin
<script>
function mojoDrawer (handle, drawer) {
$(handle).click(function() {
$(drawer).slideToggle('slow');
Expand All @@ -129,7 +129,7 @@
mojoDrawer('#trace', '#frames');
mojoDrawer('#more', '#infos');
});
% end
</script>
<div id="wrapperlicious">
% my $kv = begin
% my ($key, $value) = @_;
Expand Down Expand Up @@ -177,7 +177,7 @@
</table>
</div>
<div class="tap">tap for more</div>
%= javascript begin
<script>
var current = '#context';
$('#showcase').click(function() {
$(current).slideToggle('slow', function() {
Expand All @@ -191,7 +191,7 @@
});
});
$('#insight').toggle();
% end
</script>
% }
</div>
<div id="trace" class="box spaced">
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/templates/exception.html.ep
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head><title>Server error</title></head>
%= stylesheet begin
<style>
body { background-color: #caecf6 }
#raptor {
background: url(<%= url_for '/mojo/failraptor.png' %>);
Expand All @@ -13,6 +13,6 @@
top: 50%;
width: 743px;
}
% end
</style>
<body><div id="raptor"></div></body>
</html>
4 changes: 2 additions & 2 deletions lib/Mojolicious/templates/mojobar.html.ep
Expand Up @@ -67,7 +67,7 @@
%= end
</div>
</div>
%= javascript begin
<script>
var mojobar = $('#mojobar');
var mojobarHeight = mojobar.outerHeight();
function fixOffset() {
Expand Down Expand Up @@ -120,4 +120,4 @@
fixOffset();
});
});
% end
</script>
4 changes: 2 additions & 2 deletions lib/Mojolicious/templates/not_found.html.ep
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head><title>Page not found</title></head>
%= stylesheet begin
<style>
a img { border: 0 }
body { background-color: #caecf6 }
#noraptor {
Expand All @@ -19,7 +19,7 @@
top: 50%;
width: 306px;
}
% end
</style>
<body>
%= link_to url_for->base => begin
%= image '/mojo/noraptor.png', alt => 'Bye!', id => 'noraptor'
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/templates/perldoc.html.ep
Expand Up @@ -4,7 +4,7 @@
<title><%= $title %></title>
%= javascript '/mojo/prettify/run_prettify.js'
%= stylesheet '/mojo/prettify/prettify-mojo-light.css'
%= stylesheet begin
<style>
a { color: inherit }
a:hover { color: #2a2a2a }
a img { border: 0 }
Expand Down Expand Up @@ -75,7 +75,7 @@
h1:hover .permalink, h2:hover .permalink, h3:hover .permalink {
display: block;
}
% end
</style>
</head>
<body>
%= include inline => app->renderer->_bundled('mojobar')
Expand Down

0 comments on commit d35255e

Please sign in to comment.