Re: On-topic: HTML/JS help please

2010-02-12 Thread Jonathan Stowe
On Thu, 2010-02-11 at 13:40 +, David Cantrell wrote:
> On Wed, Feb 10, 2010 at 06:49:05PM +, Oliver Gorwits wrote:
> > On 05/02/2010 14:25, David Cantrell wrote:
> > > I want to add a Thingy to CPANdeps to let users collapse/expand portions
> > > of the dependency tree.  How would one go about this?
> > > Naively wrapping s in s and toggling their style.display
> > > doesn't work, presumably because  isn't kosher in a .
> > Use this, it's very simple indeed and works well:
> >http://www.mattkruse.com/javascript/mktree/documentation.html
> 
> I'm going to be very rude to the next person to suggest something that
> assumes I have a hierarchy of s instead of a .
> 

unordered lists are the new table, it's just like 1997 really but with a
different semantic element being abused for presentation purposes,

/J\
-- 
Rabid Gravy:http://rabidgravy.com/
On Soundcloud:  http://soundcloud.com/rabidgravy
Twitter:http://twitter.com/RabidGravy


Re: On-topic: HTML/JS help please

2010-02-12 Thread Simon Wistow
On Fri, Feb 12, 2010 at 10:27:32AM +, Bob MacCallum said:
> Just to let you know that if you collapse A::B before collapsing A, you get
> (I think) unexpected results.
> But thanks for posting a nice simple template and jquery example, I haven't
> used it before and may need/want to soon.

Hmm, good point - should be fairly easily fixable though.


Re: On-topic: HTML/JS help please

2010-02-12 Thread Bob MacCallum
Simon,

Just to let you know that if you collapse A::B before collapsing A, you get
(I think) unexpected results.
But thanks for posting a nice simple template and jquery example, I haven't
used it before and may need/want to soon.

cheers,
Bob.

On Thu, Feb 11, 2010 at 10:18 PM, Simon Wistow  wrote:

> On Thu, Feb 11, 2010 at 05:28:25PM +, Richard Huxton said:
> > You already have an "id" attribute on the toggle links (e.g.
> "toggler_1").
> > Add a class on each "tr": "depends_on_1" and then a couple of lines of
> > jquery or similar should let you toggle the rows on/off.
>
> I knocked this together over lunch
>
> http://thegestalt.org/simon/tmp/collapse/collapse.html
>
>
> All in a table, readable without JS on but can collpase and expand
> trees if you have it on.
>
> Code that generated it is in
>
> http://thegestalt.org/simon/tmp/collapse/
>
>


-- 
http://darwintunes.org - a test-tube for cultural evolution
http://evolectronica.com - survival of the funkiest
http://compare-stuff.com - confused? you will be!
http://twitter.com/darwintunes
http://twitter.com/bobmaccallum


Re: On-topic: HTML/JS help please

2010-02-12 Thread David Dorward

On 12 Feb 2010, at 08:43, Ruud H.G. van Tol wrote:

> David Cantrell wrote:
> 
>> I'm going to be very rude to the next person to suggest something that
>> assumes I have a hierarchy of s instead of a .
> 
> No javascript:
> http://www.xs4all.nl/~rvtol/DHTML/final_drop.html


No keyboard (or breath-switch, etc)  access.

No forgiveness for people with motor skill related problems (e.g. arthritis) 
who wobble the cursor off the end or sides of the menu as they try to aim.

-- 
David Dorward
http://dorward.me.uk




Re: On-topic: HTML/JS help please

2010-02-12 Thread Ruud H.G. van Tol

Ruud H.G. van Tol wrote:

David Cantrell wrote:



I'm going to be very rude to the next person to suggest something that
assumes I have a hierarchy of s instead of a .


No javascript:
http://www.xs4all.nl/~rvtol/DHTML/final_drop.html


More of that here:
http://www.cssplay.co.uk/menus/final_drop.html

--
Ruud


Re: On-topic: HTML/JS help please

2010-02-12 Thread Ruud H.G. van Tol

David Cantrell wrote:


I'm going to be very rude to the next person to suggest something that
assumes I have a hierarchy of s instead of a .


No javascript:
http://www.xs4all.nl/~rvtol/DHTML/final_drop.html

--
Ruud


Re: On-topic: HTML/JS help please

2010-02-11 Thread Andy Wardley

On 11/02/2010 17:28, Richard Huxton wrote:

You already have an "id" attribute on the toggle links (e.g.
"toggler_1"). Add a class on each "tr": "depends_on_1" and then a couple
of lines of jquery or similar should let you toggle the rows on/off.


As per my previous response, complete with example:

  http://london.pm.org/pipermail/london.pm/Week-of-Mon-20100201/019103.html

A



Re: On-topic: HTML/JS help please

2010-02-11 Thread Simon Wistow
On Thu, Feb 11, 2010 at 05:28:25PM +, Richard Huxton said:
> You already have an "id" attribute on the toggle links (e.g. "toggler_1"). 
> Add a class on each "tr": "depends_on_1" and then a couple of lines of 
> jquery or similar should let you toggle the rows on/off.

I knocked this together over lunch

http://thegestalt.org/simon/tmp/collapse/collapse.html


All in a table, readable without JS on but can collpase and expand 
trees if you have it on.

Code that generated it is in

http://thegestalt.org/simon/tmp/collapse/



Re: On-topic: HTML/JS help please

2010-02-11 Thread David Cantrell
On Thu, Feb 11, 2010 at 06:43:43PM +, Simon Wilcox wrote:

> I don't think that a table is the only way to represent that data, 
> unless you have particular accessibility concerns that require one. I'm 
> not seeing anything in the html that suggests that though.

Must be accessible and readable in all reasonable browsers, including
those used by crazy people who turn off Javascript.  I test this using
w3m.

> By the time you've flung enough divs at it to make it work, you'd 
> probably rather have solved the problem of collapsing rows in a table 
> instead :-)

Indeed, which is what I ended up doing, except today I noticed that it
breaks in Firefox.  Grrr.

-- 
David Cantrell | A machine for turning tea into grumpiness

 Nuke a disabled unborn gay baby whale for JESUS!


Re: On-topic: HTML/JS help please

2010-02-11 Thread Simon Wilcox

On 11/2/10 17:25, David Cantrell wrote:

On Thu, Feb 11, 2010 at 05:02:07PM +, Simon Wilcox wrote:

On 11/2/10 16:28, David Cantrell wrote:

I assume that the reason is that people haven't bothered looking at the
site.  Because if they did, they would see obviously tabular data.

You didn't cite a link but I assume we're looking at something like this:
http://deps.cpantesters.org/?module=HTML%3A%3ATreeBuilder&perl=5.10.0&os=Linux
Doesn't look very tabular to me. I see a bunch of stuff lining up but 
that's not the same as a table.


Actually, that's exactly what a table is.

A time*table*, for example, would be no good if stuff was thrown at
random all over the page.


Hmm, yeah fair point. I wasn't making myself very clear there obviously :-)

I think I meant that each column only has a relationship in it's row. 
There's no vertical relationship, unlike a timetable which has 
relationships in a vertical and horizontal direction. Lining columns up 
in your case is largely presentational. Not that there is anything wrong 
with that, it would be an ugly mess if they weren't.


I don't think that a table is the only way to represent that data, 
unless you have particular accessibility concerns that require one. I'm 
not seeing anything in the html that suggests that though.


I would start by putting the SBRD, results by version and pass bar into 
a div and floating it right. That will make them all line up against an 
enclosing div that's not as wide as the page.


Then put the fail scores into a div and float it with some cunning 
margin jiggery pokery to hang it out on the right, outside of the 
containing div.


The tricky part is making the SBRD div float just to the right of the 
longest module name. I can't think of a sensible way of doing that at 
the moment and am as ever deficient in tuits to work on it.


It might not be possible but it probably is solvable and then you can 
use the tools that already exist for manipulating trees in Javascript.


By the time you've flung enough divs at it to make it work, you'd 
probably rather have solved the problem of collapsing rows in a table 
instead :-)


S.



Re: On-topic: HTML/JS help please

2010-02-11 Thread David Cantrell
On Thu, Feb 11, 2010 at 05:02:07PM +, Simon Wilcox wrote:
> On 11/2/10 16:28, David Cantrell wrote:
> >I assume that the reason is that people haven't bothered looking at the
> >site.  Because if they did, they would see obviously tabular data.
> You didn't cite a link but I assume we're looking at something like this:
> http://deps.cpantesters.org/?module=HTML%3A%3ATreeBuilder&perl=5.10.0&os=Linux
> Doesn't look very tabular to me. I see a bunch of stuff lining up but 
> that's not the same as a table.

Actually, that's exactly what a table is.

A time*table*, for example, would be no good if stuff was thrown at
random all over the page.

-- 
David Cantrell | Cake Smuggler Extraordinaire

[OS X] appeals to me as a monk, a user, a compiler-of-apps, a
sometime coder, and an easily amused primate with a penchant
for those that are pretty, colorful, and make nice noises.
-- Dan Birchall, in The Monastery


Re: On-topic: HTML/JS help please

2010-02-11 Thread Richard Huxton

On 11/02/10 17:02, Simon Wilcox wrote:

On 11/2/10 16:28, David Cantrell wrote:


I assume that the reason is that people haven't bothered looking at the
site. Because if they did, they would see obviously tabular data.


You didn't cite a link but I assume we're looking at something like this:

http://deps.cpantesters.org/?module=HTML%3A%3ATreeBuilder&perl=5.10.0&os=Linux

Doesn't look very tabular to me. I see a bunch of stuff lining up but
that's not the same as a table.


Blimey - it is a table too.

You already have an "id" attribute on the toggle links (e.g. 
"toggler_1"). Add a class on each "tr": "depends_on_1" and then a couple 
of lines of jquery or similar should let you toggle the rows on/off.


--
  Richard Huxton
  Archonet Ltd


Re: On-topic: HTML/JS help please

2010-02-11 Thread Simon Wilcox

On 11/2/10 16:28, David Cantrell wrote:

On Thu, Feb 11, 2010 at 02:07:41PM +, Jonathan Tweed wrote:

On 11 Feb 2010, at 13:40, David Cantrell wrote:

I'm going to be very rude to the next person to suggest something that
assumes I have a hierarchy of s instead of a .

Could it be that you're doing the wrong thing?
Maybe it keeps getting suggested for a reason...


I assume that the reason is that people haven't bothered looking at the
site.  Because if they did, they would see obviously tabular data.


You didn't cite a link but I assume we're looking at something like this:

http://deps.cpantesters.org/?module=HTML%3A%3ATreeBuilder&perl=5.10.0&os=Linux

Doesn't look very tabular to me. I see a bunch of stuff lining up but 
that's not the same as a table.


Or am I looking at the wrong thing ?

S.


Re: On-topic: HTML/JS help please

2010-02-11 Thread David Cantrell
On Thu, Feb 11, 2010 at 02:07:41PM +, Jonathan Tweed wrote:
> On 11 Feb 2010, at 13:40, David Cantrell wrote:
> > I'm going to be very rude to the next person to suggest something that
> > assumes I have a hierarchy of s instead of a .
> Could it be that you're doing the wrong thing?
> Maybe it keeps getting suggested for a reason...

I assume that the reason is that people haven't bothered looking at the
site.  Because if they did, they would see obviously tabular data.

-- 
David Cantrell | Nth greatest programmer in the world

Computer Science is about lofty design goals and careful algorithmic
optimisation.  Sysadminning is about cleaning up the resulting mess.


Re: On-topic: HTML/JS help please

2010-02-11 Thread Dominic Thoreau
On 11 February 2010 13:40, David Cantrell  wrote:
>
> I'm going to be very rude to the next person to suggest something that
> assumes I have a hierarchy of s instead of a .

Using and  tags does not mean you need to have them display in
a bulleted list.
* ducks and runs*
-- 
Noli immiscere te draconum rebus nam fragilis es dentibus et cum garo
bene sapis.


Re: On-topic: HTML/JS help please

2010-02-11 Thread Jonathan Tweed

On 11 Feb 2010, at 13:40, David Cantrell wrote:


I'm going to be very rude to the next person to suggest something that
assumes I have a hierarchy of s instead of a .


Could it be that you're doing the wrong thing?

Maybe it keeps getting suggested for a reason...

Cheers
Jonathan


Re: On-topic: HTML/JS help please

2010-02-11 Thread David Cantrell
On Wed, Feb 10, 2010 at 06:49:05PM +, Oliver Gorwits wrote:
> On 05/02/2010 14:25, David Cantrell wrote:
> > I want to add a Thingy to CPANdeps to let users collapse/expand portions
> > of the dependency tree.  How would one go about this?
> > Naively wrapping s in s and toggling their style.display
> > doesn't work, presumably because  isn't kosher in a .
> Use this, it's very simple indeed and works well:
>http://www.mattkruse.com/javascript/mktree/documentation.html

I'm going to be very rude to the next person to suggest something that
assumes I have a hierarchy of s instead of a .

-- 
David Cantrell | top google result for "internet beard fetish club"

Immigration: making Britain great since AD43


Re: On-topic: HTML/JS help please

2010-02-10 Thread Oliver Gorwits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 05/02/2010 14:25, David Cantrell wrote:
> I want to add a Thingy to CPANdeps to let users collapse/expand portions
> of the dependency tree.  How would one go about this?
> 
> Naively wrapping s in s and toggling their style.display
> doesn't work, presumably because  isn't kosher in a .

Use this, it's very simple indeed and works well:

   http://www.mattkruse.com/javascript/mktree/documentation.html

- -- 
Oliver Gorwits, Network and Telecommunications Group,
Oxford University Computing Services
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkty/6EACgkQ2NPq7pwWBt5FNACgwUvKbAuP+dYi1Sw6aAh5vjhJ
s84AoPdtgEPf2E1GME9tJSiYWbTZV3Ck
=tosP
-END PGP SIGNATURE-


Re: On-topic: HTML/JS help please

2010-02-10 Thread David Cantrell
On Wed, Feb 10, 2010 at 05:15:25PM +, Simon Wistow wrote:
> On Wed, Feb 10, 2010 at 10:04:01AM +, Piers Cawley said:
> > That sounds to me like you don't have a table. You have a tree with
> > tabular data at each node. Consider using nested divs to represent
> > your hierarchy and then either cunning styling or one row tables to
> > display the tabular data. Sure the page might get a bit big, but
> > that's what gzipped responses are for.
> Or, alternatively, a series of, potentially nested  elements with 
> either a ... at the nodes or a 
> single row table.

Trouble is, I know of no way to get divs and spans to line up properly
without knowing in advance how wide, for example, the largest entry in a
column will be when displayed.

 and friends just Do The Right Thing.

-- 
David Cantrell | even more awesome than a panda-fur coat

Did you know that shotguns taste like candy canes?  Put the barrel in
your mouth and pull the trigger for an extra blast of minty goodness!


Re: On-topic: HTML/JS help please

2010-02-10 Thread Piers Cawley
On Wed, Feb 10, 2010 at 5:15 PM, Simon Wistow  wrote:
> On Wed, Feb 10, 2010 at 10:04:01AM +, Piers Cawley said:
>> That sounds to me like you don't have a table. You have a tree with
>> tabular data at each node. Consider using nested divs to represent
>> your hierarchy and then either cunning styling or one row tables to
>> display the tabular data. Sure the page might get a bit big, but
>> that's what gzipped responses are for.
>
> Or, alternatively, a series of, potentially nested  elements with
> either a ... at the nodes or a
> single row table.

Yeah, nested  elements makes more sense.


Re: On-topic: HTML/JS help please

2010-02-10 Thread Simon Wistow
On Wed, Feb 10, 2010 at 10:04:01AM +, Piers Cawley said:
> That sounds to me like you don't have a table. You have a tree with
> tabular data at each node. Consider using nested divs to represent
> your hierarchy and then either cunning styling or one row tables to
> display the tabular data. Sure the page might get a bit big, but
> that's what gzipped responses are for.

Or, alternatively, a series of, potentially nested  elements with 
either a ... at the nodes or a 
single row table.




Re: On-topic: HTML/JS help please

2010-02-10 Thread Piers Cawley
On Fri, Feb 5, 2010 at 10:31 PM, David Cantrell  wrote:
> On Fri, Feb 05, 2010 at 05:13:25PM +, Jacqui Caren-home wrote:
>> David Cantrell wrote:
>> >I want to add a Thingy to CPANdeps to let users collapse/expand portions
>> >of the dependency tree.  How would one go about this?
>> >Naively wrapping s in s and toggling their style.display
>> >doesn't work, presumably because  isn't kosher in a .
>> Jquery tree thingy is data driven and works well.
>
> Unfortunately every pre-existing Javascript thingy I've looked at
> assumes that I have a simple tree.  I don't, I have a *table*, which has
> a hierarchy.

That sounds to me like you don't have a table. You have a tree with
tabular data at each node. Consider using nested divs to represent
your hierarchy and then either cunning styling or one row tables to
display the tabular data. Sure the page might get a bit big, but
that's what gzipped responses are for.



Re: On-topic: HTML/JS help please

2010-02-05 Thread David Cantrell
On Fri, Feb 05, 2010 at 05:13:25PM +, Jacqui Caren-home wrote:
> David Cantrell wrote:
> >I want to add a Thingy to CPANdeps to let users collapse/expand portions
> >of the dependency tree.  How would one go about this?
> >Naively wrapping s in s and toggling their style.display
> >doesn't work, presumably because  isn't kosher in a .
> Jquery tree thingy is data driven and works well.

Unfortunately every pre-existing Javascript thingy I've looked at
assumes that I have a simple tree.  I don't, I have a *table*, which has
a hierarchy.

Also, none of them make it obvious that they degrade gracefully for
browsers which support neither CSS nor Javascript.

Anyway, I have something that partially works now:
  http://cpandeps-dev.cantrell.org.uk/?module=Test::Class::Most

with just the *teensy* little bug that if you first collapse a sub-tree
(like, say, that for Test::Exception on that page) and then collapse a
tree that contains it, it Does The Wrong Thing.  Meh, nothing that a
small amount of programming can't fix.

-- 
David Cantrell | Reality Engineer, Ministry of Information

You are so cynical.  And by "cynical", of course, I mean "correct".
 -- Kurt Starsinic


Re: On-topic: HTML/JS help please

2010-02-05 Thread Andy Wardley

On 05/02/2010 14:53, David Cantrell wrote:

   
 +
 this::module
 blahblahblah
   


Add all the dependencies to the .  e.g.

  

Then use jQuery to toggle a .hidden CSS class on all the  elements that
have a particular dependency, like so:

  

Then add a CSS class:

  tr.hidden {
display: none;
  }

That should degrade gracefully on a browser without JS or CSS.

Here's the full thing:


function toggle(module) {
$('tr.depends-' + module.replace(/:+/,'-',1)).toggleClass('hidden');
return false;
}



  
+
this::module
blahblahblah
  
  
+
other::module
 blahblahblah
  
  
+
yet::another::module
blahblahblah
  
  
  
+
Test::More
blahblahblah
  



HTH
A


Re: On-topic: HTML/JS help please

2010-02-05 Thread Jacqui Caren-home

David Cantrell wrote:

I want to add a Thingy to CPANdeps to let users collapse/expand portions
of the dependency tree.  How would one go about this?

Naively wrapping s in s and toggling their style.display
doesn't work, presumably because  isn't kosher in a .



Jquery tree thingy is data driven and works well.

Jacqui


Re: On-topic: HTML/JS help please

2010-02-05 Thread Mark Fowler
2010/2/5 David Cantrell :


> Absolutely!  Although I've come up with an Evil But Workable solution
> now - create really long ids that contain all the possible ids I might
> want to collapse.  Now I just need to fiddle with the toggle function to
> instead of just hiding/showing a single element, do it for all the
> elements whose ids contain a particular substring.

Can't you do this with classes?  Remember you can assign multiple
classes to a element, and then you can just collapse all nodes of a
given class (this is trivial in jQuery)

Mark.



Re: On-topic: HTML/JS help please

2010-02-05 Thread David Cantrell
On Fri, Feb 05, 2010 at 10:36:39AM -0500, Casey West wrote:
> I went to the site for the source code[0] and tried to clone the repo[1] and
> hack on this but I got the following error:
> 
> Initialized empty Git repository in /Users/cwest/src/cpandeps/repo/.git/
> fatal: The remote end hung up unexpectedly

Fixed;

git clone anony...@bytemark.barnyard.co.uk:/git/cpandeps/repo.git

password is anonygit.  I can't persuade Linux to have no password for
that user and for ssh to not ask for it.  

> Is a contribution something you're up for?

Absolutely!  Although I've come up with an Evil But Workable solution
now - create really long ids that contain all the possible ids I might
want to collapse.  Now I just need to fiddle with the toggle function to
instead of just hiding/showing a single element, do it for all the
elements whose ids contain a particular substring.

-- 
David Cantrell | Godless Liberal Elitist

Anyone willing to give up a little fun for tolerance deserves neither


Re: On-topic: HTML/JS help please

2010-02-05 Thread Dominic Thoreau
On 5 February 2010 16:05, Dermot  wrote:
>
> I like Gianni method personally.  It's far more shiny. But here's my
> effort anyway.

>  
>   function toggle(num) {
>       var Tbl = document.getElementById('mytable');
>        var i;
>        for (i = 1; i < Tbl.rows[num].cells.length; ++i) {
>            alert(Tbl.rows[num].cells[i]);
>            Tbl.rows[num].cells[i].style.display = 'none';
>        }
>  }
>  

You're posting on a perl list (a language with an reputation (to
outsiders) for line-noise style cryptic code, and you haven't written
it in JQuery? For shame!

Plus you can probably cut that code down quite a lot, just in
complexity and size.

Seriously, writing JavaScript without an external library is like
using Perl without CPAN. Sure you can, but why? Life's too short for
NIH

-- 
Better to remain silent and be thought a fool than to speak out and
remove all doubt.
-- Abraham Lincoln



Re: On-topic: HTML/JS help please

2010-02-05 Thread Dermot
On 5 February 2010 15:41, David Cantrell  wrote:
> On Fri, Feb 05, 2010 at 03:14:51PM +, Bob MacCallum wrote:
>
>> 
>> has worked for me in the past.  why do you need to wrap it in a div?
>> is it not standards compliant?
>
> Because on this page, for example:
>  http://deps.cpantesters.org/?module=Data::Compare;perl=latest
>
> the row for Test::More needs to disappear if I collapse the tree for
> either File::Find::Rule or Data::Compare.  So I tried wrapping each row
> in several s, one for each of the needed ids.



I like Gianni method personally.  It's far more shiny. But here's my
effort anyway. This just collapses. You'll need to determine the
current style and act accordingly.
Dp.



http://www.w3.org/1999/xhtml";>
 
 Collapse test

 
   function toggle(num) {
   var Tbl = document.getElementById('mytable');
var i;
for (i = 1; i < Tbl.rows[num].cells.length; ++i) {
alert(Tbl.rows[num].cells[i]);
Tbl.rows[num].cells[i].style.display = 'none';
}
  }
 
 
 

 
   +
   this::module
   blahblahblah
 
 
 +
 other::module
 blahblahblah
 
 
   +
   yet::another::module
   blahblahblah
 
 
 +
 Test::More
 blahblahblah
   

 




Re: On-topic: HTML/JS help please

2010-02-05 Thread Magnus Erixzon
On 5 February 2010 15:41, David Cantrell  wrote:
> On Fri, Feb 05, 2010 at 03:14:51PM +, Bob MacCallum wrote:
>
>> 
>> has worked for me in the past.  why do you need to wrap it in a div?
>> is it not standards compliant?
>
> Because on this page, for example:
>  http://deps.cpantesters.org/?module=Data::Compare;perl=latest
>
> the row for Test::More needs to disappear if I collapse the tree for
> either File::Find::Rule or Data::Compare.  So I tried wrapping each row
> in several s, one for each of the needed ids.

I've found the jsTree jquery plugin quite nice for tree views.
Feed it your data via html, json or xml and you're done.

http://www.jstree.com/demo/basic_html

 /m



Re: On-topic: HTML/JS help please

2010-02-05 Thread Casey West
On Fri, Feb 5, 2010 at 9:25 AM, David Cantrell wrote:

> I want to add a Thingy to CPANdeps to let users collapse/expand portions
> of the dependency tree.  How would one go about this?
>
> Naively wrapping s in s and toggling their style.display
> doesn't work, presumably because  isn't kosher in a .
>

I went to the site for the source code[0] and tried to clone the repo[1] and
hack on this but I got the following error:

Initialized empty Git repository in /Users/cwest/src/cpandeps/repo/.git/
fatal: The remote end hung up unexpectedly

Is a contribution something you're up for? I would be converting your table
to a nested  listing, taking advantage of the value attribute on the
 element to ensure the incriminator doesn't break, such as the
DBIx::Class[2] page.

Cheers,

-- 
Casey West

[0] http://www.cantrell.org.uk/cgit/cgit.cgi/cpandeps/
[1] git://bytemark.barnyard.co.uk/cpandeps/repo.git
[2]
http://deps.cpantesters.org/?module=DBIx%3A%3AClass&perl=any+version&os=any+OS


Re: On-topic: HTML/JS help please

2010-02-05 Thread David Cantrell
On Fri, Feb 05, 2010 at 03:14:51PM +, Bob MacCallum wrote:

> 
> has worked for me in the past.  why do you need to wrap it in a div?
> is it not standards compliant?

Because on this page, for example:
  http://deps.cpantesters.org/?module=Data::Compare;perl=latest

the row for Test::More needs to disappear if I collapse the tree for
either File::Find::Rule or Data::Compare.  So I tried wrapping each row
in several s, one for each of the needed ids.

-- 
David Cantrell | Reality Engineer, Ministry of Information

   When a man is tired of London, he is tired of life
  -- Samuel Johnson


Re: On-topic: HTML/JS help please

2010-02-05 Thread Dominic Thoreau
Actually, that looks like a very good way to do it.

You could build on to this some JQuery to alter the style depending on
what it is now very simply.

On 5 February 2010 15:14, Bob MacCallum  wrote:
> 
> has worked for me in the past.  why do you need to wrap it in a div?
> is it not standards compliant?
>



-- 
Better to remain silent and be thought a fool than to speak out and
remove all doubt.
-- Abraham Lincoln



Re: On-topic: HTML/JS help please

2010-02-05 Thread mirod

David Cantrell wrote:

On Fri, Feb 05, 2010 at 03:01:32PM +, James Laver wrote:

On Fri, Feb 5, 2010 at 2:56 PM, David Cantrell  wrote:

On Fri, Feb 05, 2010 at 02:39:01PM +, James Laver wrote:

On Fri, Feb 5, 2010 at 2:25 PM, David Cantrell  wrote:

Naively wrapping s in s and toggling their style.display
doesn't work, presumably because  isn't kosher in a .

Use  instead?

Can you have multiple s in a table, and can they nest?

Yes, no. To have tbodys inside a tbody would require another table.


Then it won't work, because in the case of very large trees, I want the
user to be able to collapse arbitrary sub-trees, which are nested.  And
putting another table in would reset all the column widths and screw up
the display.



Something like this? http://grouper.ieee.org/groups/detailed_index_s.html

The code maybe a bit more complicated that what you want because the state is 
saved in a cookie (the tree is small enough that the cookie remains within the 
4K maximum size).


It uses nested tables and in order not to screw up the table uses colspans (as 
far as I remember, I wrote this a while back).


Feel free to reuse if you want.

--
mirod


Re: On-topic: HTML/JS help please

2010-02-05 Thread Bob MacCallum

has worked for me in the past.  why do you need to wrap it in a div?
is it not standards compliant?

On Fri, Feb 5, 2010 at 3:01 PM, James Laver  wrote:

> On Fri, Feb 5, 2010 at 2:56 PM, David Cantrell 
> wrote:
> > On Fri, Feb 05, 2010 at 02:39:01PM +, James Laver wrote:
> >> On Fri, Feb 5, 2010 at 2:25 PM, David Cantrell 
> wrote:
> >> > Naively wrapping s in s and toggling their style.display
> >> > doesn't work, presumably because  isn't kosher in a .
> >> Use  instead?
> >
> > Can you have multiple s in a table, and can they nest?
>
> Yes, no. To have tbodys inside a tbody would require another table.
>
> --James
>



-- 
http://darwintunes.org - a test-tube for cultural evolution
http://evolectronica.com - survival of the funkiest
http://compare-stuff.com - confused? you will be!
http://twitter.com/darwintunes
http://twitter.com/bobmaccallum


Re: On-topic: HTML/JS help please

2010-02-05 Thread James Laver
On Fri, Feb 5, 2010 at 3:08 PM, David Cantrell  wrote:
>
> Then it won't work, because in the case of very large trees, I want the
> user to be able to collapse arbitrary sub-trees, which are nested.  And
> putting another table in would reset all the column widths and screw up
> the display.

An easy (albeit hacky) way to do it would be when you're dumping the
table to the page from your perl, for each nested level, generate a
classname such as tree-depth-. Your javascript can parse that out
and use that to determine nesting.

To do it correctly, you're going to have to consider restructuring
your markup somewhat.

--James



Re: On-topic: HTML/JS help please

2010-02-05 Thread Greg Sheard

David Cantrell wrote:

On Fri, Feb 05, 2010 at 02:39:01PM +, James Laver wrote:

On Fri, Feb 5, 2010 at 2:25 PM, David Cantrell  wrote:

Naively wrapping s in s and toggling their style.display
doesn't work, presumably because  isn't kosher in a .

Use  instead?


Can you have multiple s in a table, and can they nest?



Yes and no, in that order. Doesn't seem any easier than toggling the 
.display on the  anyway.


--
Greg


Re: On-topic: HTML/JS help please

2010-02-05 Thread David Cantrell
On Fri, Feb 05, 2010 at 03:01:32PM +, James Laver wrote:
> On Fri, Feb 5, 2010 at 2:56 PM, David Cantrell  wrote:
> > On Fri, Feb 05, 2010 at 02:39:01PM +, James Laver wrote:
> >> On Fri, Feb 5, 2010 at 2:25 PM, David Cantrell  
> >> wrote:
> >> > Naively wrapping s in s and toggling their style.display
> >> > doesn't work, presumably because  isn't kosher in a .
> >> Use  instead?
> > Can you have multiple s in a table, and can they nest?
> Yes, no. To have tbodys inside a tbody would require another table.

Then it won't work, because in the case of very large trees, I want the
user to be able to collapse arbitrary sub-trees, which are nested.  And
putting another table in would reset all the column widths and screw up
the display.

-- 
David Cantrell | Bourgeois reactionary pig

Fashion label: n: a liferaft for personalities
which lack intrinsic buoyancy


Re: On-topic: HTML/JS help please

2010-02-05 Thread James Laver
On Fri, Feb 5, 2010 at 2:56 PM, David Cantrell  wrote:
> On Fri, Feb 05, 2010 at 02:39:01PM +, James Laver wrote:
>> On Fri, Feb 5, 2010 at 2:25 PM, David Cantrell  wrote:
>> > Naively wrapping s in s and toggling their style.display
>> > doesn't work, presumably because  isn't kosher in a .
>> Use  instead?
>
> Can you have multiple s in a table, and can they nest?

Yes, no. To have tbodys inside a tbody would require another table.

--James


Re: On-topic: HTML/JS help please

2010-02-05 Thread David Cantrell
On Fri, Feb 05, 2010 at 02:39:01PM +, James Laver wrote:
> On Fri, Feb 5, 2010 at 2:25 PM, David Cantrell  wrote:
> > Naively wrapping s in s and toggling their style.display
> > doesn't work, presumably because  isn't kosher in a .
> Use  instead?

Can you have multiple s in a table, and can they nest?

-- 
David Cantrell | Nth greatest programmer in the world

Are you feeling bored? depressed? slowed down?  Evil Scientists may
be manipulating the speed of light in your vicinity.  Buy our patented
instructional video to find out how, and maybe YOU can stop THEM


Re: On-topic: HTML/JS help please

2010-02-05 Thread David Cantrell
On Fri, Feb 05, 2010 at 02:33:17PM +, Dermot wrote:
> On 5 February 2010 14:25, David Cantrell  wrote:
> > I want to add a Thingy to CPANdeps to let users collapse/expand portions
> > of the dependency tree.  How would one go about this?
> >
> > Naively wrapping s in s and toggling their style.display
> > doesn't work, presumably because  isn't kosher in a .
> One way would be to  and change the style.display on all it's children.

I'm struggling to imagine what you mean here.  Perhaps it would help if
I show you what I've done so far (which doesn't work).  This represents
a simple dependency tree:

  this::module
other::module
  yet::another::module
Test::More


  
+
this::module
blahblahblah
  
  

  +
  other::module
  blahblahblah

  
  

  
+
yet::another::module
blahblahblah
  

  
  

  +
  Test::More
  blahblahblah

  


The data in blahblahblah are several columns of a table.  The data
*must* be displayed as a table, and *must* work in any reasonable
browser, including those that don't do CSS - although obviously I don't
expect any fancy stuff like the expanding/collapsing thingy to work in
such primitive browsers.  This is called Degrading Gracefully ;-)

-- 
David Cantrell | even more awesome than a panda-fur coat


Re: On-topic: HTML/JS help please

2010-02-05 Thread Gianni Ceccarelli
On 2010-02-05 David Cantrell  wrote:
> I want to add a Thingy to CPANdeps to let users collapse/expand
> portions of the dependency tree.  How would one go about this?


http://www.w3.org/1999/xhtml";>
 
  Collapse test
  http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js";>
  
   $(document).ready(function() {
$('td.collapse').bind('click',function() {
 $(this).nextAll().toggle();
 $(this).text( $(this).text()=='+' ? '-' : '+' )
});
   });
  
 
 
  
   

 Collapse stuff

   
   
-lorem
-ipsum
-stuf
-more
-etc
   
  
 


-- 
Dakkar - 
GPG public key fingerprint = A071 E618 DD2C 5901 9574
 6FE2 40EA 9883 7519 3F88
key id = 0x75193F88

   Some people are pragmatists, taking things as they come and making
   the best of the choices available. Some people are idealists,
   standing for principle and refusing to compromise. And some people
   just act on any whim that enters their heads. I pragmatically turn
   my whims into principles!  -- Calvin


signature.asc
Description: PGP signature


Re: On-topic: HTML/JS help please

2010-02-05 Thread James Laver
On Fri, Feb 5, 2010 at 2:25 PM, David Cantrell  wrote:
> I want to add a Thingy to CPANdeps to let users collapse/expand portions
> of the dependency tree.  How would one go about this?
>
> Naively wrapping s in s and toggling their style.display
> doesn't work, presumably because  isn't kosher in a .

Use  instead?

--James



Re: On-topic: HTML/JS help please

2010-02-05 Thread Dermot
On 5 February 2010 14:25, David Cantrell  wrote:
> I want to add a Thingy to CPANdeps to let users collapse/expand portions
> of the dependency tree.  How would one go about this?
>
> Naively wrapping s in s and toggling their style.display
> doesn't work, presumably because  isn't kosher in a .
>

One way would be to  and change the style.display on all it's children.
Dp.



On-topic: HTML/JS help please

2010-02-05 Thread David Cantrell
I want to add a Thingy to CPANdeps to let users collapse/expand portions
of the dependency tree.  How would one go about this?

Naively wrapping s in s and toggling their style.display
doesn't work, presumably because  isn't kosher in a .

-- 
David Cantrell | top google result for "topless karaoke murders"

There is no one true indentation style,
But if there were K&R would be Its Prophets.
Peace be upon Their Holy Beards.