Awesome: Clickable Breadcrumb is available!

Discuss and share scripts and script files...
Post Reply
binocular222
Posts: 1414
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Awesome: Clickable Breadcrumb is available!

Post by binocular222 » 07 Jan 2013 10:22

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", " ")
Last edited by binocular222 on 07 Jan 2013 17:47, edited 2 times in total.
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

highend
Posts: 9099
Joined: 06 Feb 2011 00:33

Re: goto html()?

Post by highend » 07 Jan 2013 11:12

Edit title: [Solved] *g*
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

binocular222
Posts: 1414
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: goto html()?

Post by binocular222 » 07 Jan 2013 11:45

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
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

highend
Posts: 9099
Joined: 06 Feb 2011 00:33

Re: goto html()?

Post by highend » 07 Jan 2013 12:04

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.
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

binocular222
Posts: 1414
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: goto html()?

Post by binocular222 » 07 Jan 2013 12:15

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
Last edited by binocular222 on 09 Jan 2013 03:22, edited 5 times in total.
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

serendipity
Posts: 3355
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Awesome: Clickable Breadcrumb is available!

Post by serendipity » 07 Jan 2013 22:01

Nice, I have a very old version of such a breadcrumb in my diskmanager script.

binocular222
Posts: 1414
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: Awesome: Clickable Breadcrumb is available!

Post by binocular222 » 08 Jan 2013 18:04

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.
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

serendipity
Posts: 3355
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Awesome: Clickable Breadcrumb is available!

Post by serendipity » 08 Jan 2013 19:41

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.

binocular222
Posts: 1414
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: Awesome: Clickable Breadcrumb is available!

Post by binocular222 » 09 Jan 2013 03:25

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", " ");
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

Anselma
Posts: 78
Joined: 17 Jan 2012 07:31

Re: Awesome: Clickable Breadcrumb is available!

Post by Anselma » 07 Feb 2013 05:26

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.

highend
Posts: 9099
Joined: 06 Feb 2011 00:33

Re: Awesome: Clickable Breadcrumb is available!

Post by highend » 07 Feb 2013 06:39

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", " ");
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

Brendon77
Posts: 2
Joined: 19 Jul 2013 07:30

Re: Awesome: Clickable Breadcrumb is available!

Post by Brendon77 » 19 Jul 2013 07:33

I will try this code.

Post Reply