Page 1 of 1

Awesome: Clickable Breadcrumb is available!

Posted: 07 Jan 2013 10:22
by binocular222
I want to make a "clickable breadcrum" base on this:

Code: Select all

goto html("<html><body><a href="<curpath>">"<curpath>"</a></body></html>")
As I'm totally illiterate at html language, Please confirm whether html() can return variable or trigger goto command?

Edit, ah, found it, Clickable Breadcrum similar to Win 7 Windows Explorer is coming soon

Code: Select all

goto replace(html("<html><body><a href='xys:E:\7Utilities\ViceVersa Pro 2\'>"<curpath>"</a><br><a href="xys:No!">Say "No!"</a></body></html>"), "%20", " ")

Re: goto html()?

Posted: 07 Jan 2013 11:12
by highend
Edit title: [Solved] *g*

Re: goto html()?

Posted: 07 Jan 2013 11:45
by binocular222
No, not solved yet. I'm writing Clickable Breadcrum, and here's a working script (still limited functionality but I'm working on it)

Code: Select all

$CurPath = <curpath>;
 $Count = getpathcomponent("<curpath>", "count");
 $p1 = getpathcomponent("<curpath>", "component", -$Count) . ":\";
 $p2 = getpathcomponent("<curpath>", "component", -$Count +1) . "\";
 $p3 = getpathcomponent("<curpath>", "component", -$Count +2) . "\";
 $p4 = getpathcomponent("<curpath>", "component", -$Count +3) . "\";
 goto replace(html("<html><body><a href='xys:$p1'>$p1</a><a href='xys:$p1$p2'>$p2</a><a href='xys:$p1$p2$p3'>$p3</a><a href='xys:$p1$p2$p3$p4'>$p4</a></body></html>"), "%20", " ")
Now, I'm incorporating Array into this

Re: goto html()?

Posted: 07 Jan 2013 12:04
by highend
You should do that in a while loop, you'll never know how deep the directory structure will be. At least not, if somebody else should use this as well.

Re: goto html()?

Posted: 07 Jan 2013 12:15
by binocular222
Whao, I made it:
+ Update: Support unlimited level of sub-directory (Many thanks to serendipity's Diskmanager code)
+ Hightlight path component when mouse hover (thanks serendipity again)
+ Support network folder as well (i.e: \\Mary-PC\Picture)
+ Customizable font

Code: Select all

 $Count = getpathcomponent("<curpath>", "count");
 $Fontsize = "font-size:18px;" ;
 $Fontname = "font-family: Verdana;";
 $Bold = "True";

 If (substr(<curpath>,,2) == "\\") {$Link = "\\" . getpathcomponent("<curpath>", "component", -$Count) . "\"};
 Else {$Link = getpathcomponent("<curpath>", "component", -$Count) . ":\"};

 $html = "<a href='xys:" . $Link . "'>" . $Link . "</a>";
 $Index = 1;
 While ($Index < $Count){
 $Link = $Link . getpathcomponent("<curpath>", "component", -$Count + $Index) . "\";
 $html = $html . "<a href='xys:" . $Link . "'>" . getpathcomponent("<curpath>", "component", -$Count + $Index) . "\" . "</a>";
 incr $Index};

 If ($Bold == "True") {$html = "<b>" . $html . "</b>"};
 
   $displaybread= <<<BREAD
<TABLE><TD class="special"><span style='$Fontsize $Fontname'>$html</span></TD></TABLE>
BREAD;

 $style= <<<STYLE
<STYLE TYPE="text/css">
TD.special :hover {background-color: #c5e5c5;}
</STYLE>
STYLE;

 goto html($style $displaybread);
P.S:
- @Admin: Please move this to Script exchange please
- Any suggestion to improve the code?
- As I mentioned in this post: http://www.xyplorer.com/xyfc/viewtopic. ... =60#p80035 The GUI would be much better if, instead of running a separate script like this, holding down Ctrl will put addressbar in Clickable Breadcrumb mode. Hope that this concept is sexy enough to be on Don's priority list

Re: Awesome: Clickable Breadcrumb is available!

Posted: 07 Jan 2013 22:01
by serendipity
Nice, I have a very old version of such a breadcrumb in my diskmanager script.

Re: Awesome: Clickable Breadcrumb is available!

Posted: 08 Jan 2013 18:04
by binocular222
Agh, after hours of coding, I just re-invented serendipity's wheel!
Have a look at his Diskmanager.xys, it's a monster truck and I plucked out 1 wheel, decorate it a bit and post as new topic.
Anyway, I can help people understand how easy it's to make a breadcrumb.

Re: Awesome: Clickable Breadcrumb is available!

Posted: 08 Jan 2013 19:41
by serendipity
binocular222 wrote:Agh, after hours of coding, I just re-invented serendipity's wheel!
Have a look at his Diskmanager.xys, it's a monster truck and I plucked out 1 wheel, decorate it a bit and post as new topic.
Anyway, I can help people understand how easy it's to make a breadcrumb.
Thanks! Glad you like it. And always happy to help.
By the way, in your script add ; to the end of goto command just in case.

Re: Awesome: Clickable Breadcrumb is available!

Posted: 09 Jan 2013 03:25
by binocular222
Added ;
btw, if anyone don't like the hightlight, just delete from $displaybread to end and paste this code in:

Code: Select all

goto replace(html("<html><body><span style='$Fontsize $Fontname'>$html</span></body></html>", 1000, 150, "Breadcrumb"), "%20", " ");

Re: Awesome: Clickable Breadcrumb is available!

Posted: 07 Feb 2013 05:26
by Anselma
The code seems imperfect for click on a parent location with space-separated name. For example, if I am currently on "Programs" directory and wish to go up to "New backup" parent directory within %Drive%\New backup\Programs structure, I will be prompted that New%20backup directory does not exist and whether I want to create it.

Re: Awesome: Clickable Breadcrumb is available!

Posted: 07 Feb 2013 06:39
by highend
You can fix that easily.

Just replace the last line

Code: Select all

goto html($style $displaybread);
with

Code: Select all

goto replace(html($style $displaybread), "%20", " ");

Re: Awesome: Clickable Breadcrumb is available!

Posted: 19 Jul 2013 07:33
by Brendon77
I will try this code.