JQuery

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for JQuery

1.00    First Release
1.01    The cgi-bin files used an incorrect namespace
1.02    Added alt to img in Treeview (HTML Validation)
        In Tabs, escaped href
        Remove empty styles (HTML Validation)
        There was a problem with installation - TableSorter was checked but non-existant.
        Added TableSorter.
1.03    Fixed separator on menus
1.04    Left a DEBUG message in Taconite which stopped it from working
1.05    Changed jquery_heartbeat.js so that it uses a counter to ensure that IE does not cache
        Add Module::Build dependency
1.06    Added some missing files

MANIFEST  view on Meta::CPAN

lib/JQuery/Accordion.pm
lib/JQuery/ClickMenu.pm
lib/JQuery/CSS.pm
lib/JQuery/Demo.pm
lib/JQuery/Form.pm
lib/JQuery/Heartbeat.pm
lib/JQuery/Splitter.pm
lib/JQuery/Tabs.pm
lib/JQuery/TableSorter.pm
lib/JQuery/Taconite.pm
lib/JQuery/Treeview.pm

lib/JQuery/jquery_js/plugins/clickmenu/arrow_right.gif
lib/JQuery/jquery_js/plugins/clickmenu/arrow_right_plain.png
lib/JQuery/jquery_js/plugins/clickmenu/clickmenu.css
lib/JQuery/jquery_js/plugins/clickmenu/jquery.clickmenu.js
lib/JQuery/jquery_js/plugins/clickmenu/jquery.clickmenu.pack.js
lib/JQuery/jquery_js/plugins/clickmenu/myshadow.png



META.yml  view on Meta::CPAN

    version: 1.00
  JQuery::TableSorter:
    file: lib/JQuery/TableSorter.pm
    version: 1.00
  JQuery::Tabs:
    file: lib/JQuery/Tabs.pm
    version: 1.00
  JQuery::Taconite:
    file: lib/JQuery/Taconite.pm
    version: 1.00
  JQuery::Treeview:
    file: lib/JQuery/Treeview.pm
    version: 1.01
resources:
  license: http://dev.perl.org/licenses/

lib/JQuery/Treeview.pm  view on Meta::CPAN

package JQuery::Treeview ; 

our $VERSION = '1.01';

use strict ;
use warnings ; 

use XML::Writer ;
use IO::String ;

sub new { 
    my $this = shift;
    my $class = ref($this) || $this;
    my $my ;
    %{$my->{param}} = @_ ; 
    die "No id defined for Treeview" unless $my->{param}{id} =~ /\S/ ; 

    my $jquery = $my->{param}{addToJQuery} ; 
    my $jqueryDir = $jquery->getJQueryDir ; 
    $my->{fileDir} = "$jqueryDir/plugins" ;
    $my->{param}{separator} = "/" unless defined $my->{param}{separator} ; 
    bless $my, $class;
    $my->add_to_jquery ; 
    return $my ;
}

lib/JQuery/Treeview.pm  view on Meta::CPAN

} 

sub get_jquery_code { 
    my $my = shift ; 
    my $id = $my->id ; 
    my $remoteProgram = $my->{param}{remoteProgram} ; 
    return '' unless $id =~ /\S/ ; 
    my $treeControlId = $my->treeControlId ; 
    my $function1 =<<'EOD1';
	
$("#ID").Treeview(TREE_CONTROL);
EOD1
    my $treeControl = '' ; 
    if ($treeControlId =~ /\S/) { 
	$treeControl = qq[{ control: "#$treeControlId" }] ;
    } 
    $function1 =~ s/TREE_CONTROL/$treeControl/ ; 

    my $function2 =<<'EOD2';
$("#ID span").click(function(event) { 
    ALERT

lib/JQuery/Treeview.pm  view on Meta::CPAN

    $rm = '' unless $my->{param}{rm} =~ /\S/ ; 
    $function2 =~ s/RM/$rm/ ;
    $function2 = '' unless $remoteProgram =~ /\S/ ; 
    my $function4 = $my->dragAndDrop ;
    
    return $function1 . $function2 . $function3 . $function4 ; 
}
1;
=head1 NAME

JQuery::Treeview -  shows a information as a tree. 

=head1 VERSION

Version 1.00

=cut

=head1 SYNOPSIS

JQuery::Treeview shows a information as a tree. 

    use JQuery;
    use JQuery::Treeview;

    my $list =<<EOD;
 folder 1(fc)
  file 1.1
  file 1.2 
  file 1.3
  folder 1.2(f)
   file 2.1
   file 2.2 
   file 2.3
   folder 1.3(fc)
    folder 1.4(f)
   file 1.4 
 folder 2(f)
  file 2.1
 folder 3(f)
 EOD

   my $tree = JQuery::Treeview->new(list => $list, 
				 id => 'mytree',
                                 separator => "/",
				 addToJQuery => $jquery,
				 treeControlId => 'myTreeControl',
				 treeControlText => ['Collapse All','Expand All','Toggle All'],
				 defaultState => 'open', 
				 highlightNodes => 1, 
				 highlightLeaves => 1, 
				 highlightUnderline => 1,
				 type => 'directory',
				 rm => 'MyTreeView',
				 debug => 0,
				 remoteProgram => '/cgi-bin/jquery_treeview_results.pl') ; 
    my $htmlControl = $tree->HTMLControl ;
    my $html = $tree->HTML ;
    
=head1 DESCRIPTION

Treeview shows data in a tree format. For an example see L<http://jquery.bassistance.de/treeview/>

The simplest way to present the data is in the format shown
above. Each indentation represents another level. The letters in brackets stand for

=over 

=item f

A folder or node

lib/JQuery/Treeview.pm  view on Meta::CPAN

element being separated by the separator.

In other words, you might get data=myfile, and data1=dir/dir1/dir2/myfile

=item addToJQuery

The JQuery container

=item treeControlId 

The id of a control element. JQuery::Treeview can
generate the control HTML, which is just a set of links allowing the
user to manipulate the tree. The user can collapse all, expand all, and toggle all.

=item treeControlText

These are the text items needed for the treeControlId

=item defaultState

The default state of the tree, either open or closed.

lib/JQuery/Treeview.pm  view on Meta::CPAN


=head1 COPYRIGHT & LICENSE

Copyright 2007 Peter Gordon, all rights reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut

1; # End of JQuery::Treeview

lib/JQuery/cgi-bin/jquery_treeview.pl  view on Meta::CPAN

use strict ; 
use warnings ;
use JQuery::Demo ;
use CGI ; 

package main ;
my $tester =  new JQuery::Demo ; 
$tester->run ; 

package JQuery::Demo ;
use JQuery::Treeview ; 

sub start {
    my $my = shift ;
    my $q = new CGI ; 

    $my->{info}{TITLE} = "Treeview" ;

    my $jquery = $my->{jquery} ; 

my $list =<<EOD;
folder 1(fc)
 file 1.1
 file 1.2 
 file 1.3
 folder 1.2(f)
  file 2.1
  file 2.2 
  file 2.3
  folder 1.3(fc)
   folder 1.4(f)
  file 1.4 
folder 2(f)
   file 2.1
folder 3(f)
EOD

my $tree = JQuery::Treeview->new(list => $list, 
				 id => 'mytree',
				 addToJQuery => $jquery,
				 treeControlId => 'myTreeControl',
				 treeControlText => ['Collapse All','Expand All','Toggle All'],
				 defaultState => 'open', 
				 highlightNodes => 1, 
				 highlightLeaves => 1, 
				 highlightUnderline => 1,
				 type => 'directory',
				 rm => 'MyTreeView',

lib/JQuery/jquery_js/plugins/treeview/jquery.treeview.js  view on Meta::CPAN

/*
 * Treeview 1.2 - jQuery plugin to hide and show branches of a tree
 *
 * Copyright (c) 2006 Jörn Zaefferer, Myles Angell
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.treeview.js 1534 2007-03-15 22:28:17Z joern $
 *
 */

lib/JQuery/jquery_js/plugins/treeview/jquery.treeview.js  view on Meta::CPAN

 * }
 * 
 * .treeview li { background: url(images/tv-item.gif) 0 0 no-repeat; }
 * .treeview .collapsable { background-image: url(images/tv-collapsable.gif); }
 * .treeview .expandable { background-image: url(images/tv-expandable.gif); }
 * .treeview .last { background-image: url(images/tv-item-last.gif); }
 * .treeview .lastCollapsable { background-image: url(images/tv-collapsable-last.gif); }
 * .treeview .lastExpandable { background-image: url(images/tv-expandable-last.gif); }
 * @desc The following styles are necessary in your stylesheet. There is are alternative sets of images available.
 *
 * @example $("ul").Treeview();
 * @before <ul>
 *   <li>Item 1
 *     <ul>
 *       <li>Item 1.1</li>
 *     </ul>
 *   </li>
 *   <li class="closed">Item 2 (starts closed)
 *     <ul>
 *       <li>Item 2.1
 *         <ul>

lib/JQuery/jquery_js/plugins/treeview/jquery.treeview.js  view on Meta::CPAN

 *           <li>Item 2.1.2</li>
 *         </ul>
 *       </li>
 *       <li>Item 2.2</li>
 *     </ul>
 *   </li>
 *   <li>Item 3</li>
 * </ul>
 * @desc Basic usage example
 *
 * @example $("ul").Treeview({ speed: "fast", collapsed: true});
 * @before <ul>
 *   <li class="open">Item 1 (starts open)
 *     <ul>
 *       <li>Item 1.1</li>
 *     </ul>
 *   </li>
 *   <li>Item 2
 *     <ul>
 *       <li>Item 2.1</li>
 *       <li>Item 2.2</li>
 *     </ul>
 *   </li>
 * </ul>
 * @desc Create a treeview that starts collapsed. Toggling branches is animated.
 *
 * @example $("ul").Treeview({ control: #treecontrol });
 * @before <div id="treecontrol">
 *   <a href="#">Collapse All</a>
 *   <a href="#">Expand All</a>
 *   <a href="#">Toggle All</a>
 * </div>
 * @desc Creates a treeview that can be controlled with a few links.
 * Very likely to be changed/improved in future versions.
 *
 * @param Map options Optional settings to configure treeview
 * @option String|Number speed Speed of animation, see animate() for details. Default: none, no animation

lib/JQuery/jquery_js/plugins/treeview/jquery.treeview.js  view on Meta::CPAN

 * 		   Arguments: "this" refers to the UL that was shown or hidden.
 * 		   Works only with speed option set (set speed: 1 to enable callback without animations).
 *		   Default: none
 * @option Boolean|Object store When set, stores the tree-state in a cookie when leaving/reloading the page,
 * 		   and restoring that state when loading the page. By default, no state is stored. Only one tree-per-page can be stored.
 * 	       When specifying the option as a boolean-true, the default setting for cookie-storage is used,
 * 		   saving the state for the browser session. To set a different expiration, set the option to an
 *  	   object with a "expiration" property. Refer to the cookie plugin for details about
 * 	       possible values of that object.
 * @type jQuery
 * @name Treeview
 * @cat Plugins/Treeview
 */

(function($) {

	// classes used by the plugin
	// need to be styled via external stylesheet, see first example
	var CLASSES = {
		open: "open",
		closed: "closed",
		expandable: "expandable",

lib/JQuery/jquery_js/plugins/treeview/jquery.treeview.js  view on Meta::CPAN

					$this.removeClass(c2).addClass(c1);
			});
		},
		replaceclass: function(c1, c2) {
			return this.each(function() {
				var $this = $(this);
				if ( $.className.has(this, c1) )
					$this.removeClass(c1).addClass(c2);
			});
		},
		Treeview: function(settings) {
		
			// currently no defaults necessary, all implicit
			settings = $.extend({}, settings);
		
			// factory for treecontroller
			function treeController(tree, control) {
				// factory for click handlers
				function handler(filter) {
					return function() {
						// reuse toggle event handler, applying the elements to toggle

lib/JQuery/jquery_js/plugins/treeview/jquery.treeview.pack.js  view on Meta::CPAN

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};whi...

t/00-load.t  view on Meta::CPAN

BEGIN {
	use_ok( 'JQuery' );
	use_ok( 'JQuery::Accordion' );
	use_ok( 'JQuery::CSS' );
	use_ok( 'JQuery::Demo' );
	use_ok( 'JQuery::Form' );
	use_ok( 'JQuery::Splitter' );
	use_ok( 'JQuery::TableSorter' );
	use_ok( 'JQuery::Tabs' );
	use_ok( 'JQuery::Taconite' );
	use_ok( 'JQuery::Treeview' );
}

diag( "Testing JQuery $JQuery::VERSION, Perl $], $^X" );



( run in 0.657 second using v1.01-cache-2.11-cpan-49f99fa48dc )