[Catalyst] Patch for HTML::Prototype::Useful

Bill Moseley moseley at hank.org
Mon Nov 28 16:52:02 CET 2005


Catalyst::Plugin::Prototype will use HTML::Prototype::Useful if
installed.  HTML::Prototype::Useful overrides
defined_javascript_functions and doesn't include all the javascript
that HTML::Prototype does.  Here's a patch:


Index: lib/HTML/Prototype/Useful.pm
===================================================================
--- lib/HTML/Prototype/Useful.pm        (revision 2276)
+++ lib/HTML/Prototype/Useful.pm        (working copy)
@@ -5,7 +5,7 @@
 use base 'HTML::Prototype';
 use HTML::Prototype::Useful::Js;
 
-our $VERSION = '0.04';
+our $VERSION = '0.05';
 our $prototype_useful = do { package HTML::Prototype::Useful::Js; local $/; <DATA> };
 
 =head1 NAME
@@ -36,14 +36,9 @@
 =cut
 
 sub define_javascript_functions {
-    return <<"";
-<script type="text/javascript">
-<!--
-$HTML::Prototype::prototype
-$prototype_useful
-//-->
-</script>
-
+    my $self = shift;
+    $self->SUPER::define_javascript_functions;
+    $self->javascript_tag( $prototype_useful );
 }
 
 =item remote_function
Index: Changes
===================================================================
--- Changes     (revision 2276)
+++ Changes     (working copy)
@@ -1,5 +1,9 @@
 Revision history for Perl extension HTML::Prototype::Useful
 
+0.05
+        - Fixed define_javascript_functions to call SUPER::
+          Was not returning all defined javascript - moseley
+
 0.04  2005-07-28 16:23:00
         - Fixed to handle new format for _build_observer.
 0.03  2005-06-19 00:06:00


-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list