Catalyst-View-Component-jQuery
view release on metacpan or search on metacpan
examples/TestApp/root/src/index.tt2 view on Meta::CPAN
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Catalyst::View::Component::jQuery Demo</title>
[% jquery.link_elements %]
[% jquery.script_src_elements %]
</head>
<body>
<h2>Catalyst::View::Component::jQuery Demo</h2>
<p>
Navigation menu generated automatically from Catalyst application action attributes (MenuPath and MenuTitle).
</p>
<div style="float: left">
[% menu %]
</div>
<p style="clear: both">
This page demonstrates the use of <a href="http://search.cpan.org/perldoc?Catalyst::View::Component::jQuery">Catalyst::View::Component::jQuery</a>
to make a "jquery" method available in your TT templates.
</p>
<p><a href="http://search.cpan.org/perldoc?CatalystX::Menu::Suckerfish">CatalystX::Menu::Suckerfish</a>
is used to generate a Suckerfish-style menu from action attributes defined in the TestApp application.
Modify the MenuPath and MenuTitle attributes and restart the application to see how the menu is
automatically generated on-the-fly.
</p>
<p>
Running the testapp_server.pl script with the -r switch will automatically restart the script if you
want a quick way to test changes.
</p>
<p>
The following three lines in the template print the html elements required to fetch the stylesheets and
JavaScript files required by your jQuery plugins, and then the jQuery ready event.
[% stag = "[\%"
etag = "%\]"
%]
<p>
<strong><code>
[% stag; ' jquery.link_elements '; etag %]
</code></strong>
</p>
<p>Inserts:</p>
<pre>
<link type="text/css" href="/static/css/theme/jquery-ui.custom.css" rel="stylesheet" media="all" />
<link type="text/css" href="/static/css/superfish.css" rel="stylesheet" media="all" />
<link type="text/css" href="/static/css/superfish-vertical.css" rel="stylesheet" media="all" />
<link type="text/css" href="/static/css/superfish-navbar.css" rel="stylesheet" media="all" />
<link type="text/css" href="/static/site/css/superfish.css" rel="stylesheet" media="all" />
<link type="text/css" href="/static/site/css/superfish-skin.css" rel="stylesheet" media="all" />
</pre>
<p>
<strong><code>
[% stag; ' jquery.script_src_elements '; etag %]
</code></strong>
</p>
<p>Inserts:</p>
<pre>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="/static/js/hoverIntent.js"></script>
<script type="text/javascript" src="/static/js/superfish.js"></script>
( run in 0.672 second using v1.01-cache-2.11-cpan-3d66aa2751a )