Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
r20727@GOP: gugod | 2008-02-03 09:49:21 +0800
JQueryHelper is renamed to jQueryHelper. Implement a jQuery helper function in Perl that can do both: jQuery("#selector") and jQuery.ajax( ... ) Add an "obj_as_string" routine that can dump functions as strings. git-svn-id: http://code.handlino.com/svn/perl5/JavaScript-Writer@196 b19cb30a-9f2e-4084-8847-5e1a13269302
- Loading branch information
Showing
4 changed files
with
140 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use strict; | ||
use warnings; | ||
|
||
package JavaScript::Writer::jQueryHelper; | ||
|
||
our $VERSION = '0.0.2'; | ||
|
||
use JavaScript::Writer; | ||
|
||
use Sub::Exporter -setup => { | ||
exports => ['jQuery'], | ||
groups => { | ||
default => [ -all ], | ||
} | ||
}; | ||
|
||
sub jQuery { | ||
my ($selector) = @_; | ||
if (!defined $selector) { | ||
return js->object('jQuery') | ||
} | ||
elsif (ref($selector) eq '') { | ||
return js->call('jQuery', \ $selector); | ||
} | ||
} | ||
|
||
1; | ||
|
||
__END__ | ||
=head1 NAME | ||
JavaScript::Writer::JQueryHelper - Helper methods powered by jQuery. | ||
=head1 SYNOPSIS | ||
=head1 METHODS | ||
=head1 DESCRIPTION | ||
=cut | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters