[chora] "patch" to allow easy directory navigation

Rob S.i.k.l.o.s rob2 at siklos.ca
Fri Jun 18 06:00:02 PDT 2004


Hello,

I recently started using Chora to track the CVS that I use for my company's
bugzilla customization project.  It's very nice and easy to use.    One
thing that I found a bit annoying though was that it took a long time to
navigate to a deep directory.  So instead of clicking on 5 or 6 directories
to get where I want, I thought it would be a good idea to provide an input
box in the headerbar.   So if you are currently in /home/mysrc  and you want
to browse to /home/mysrc/this/project/myproject, you would type
"this/project/myproject" and it will take you there.  Very handy.

If anyone cares, here's the patch (attached).

Note: it may only work using mod_rewrite - I haven't tried anything else.

Rob.
-------------- next part --------------
Index: headerbar.inc
===================================================================
RCS file: /repository/chora/templates/headerbar.inc,v
retrieving revision 1.8
diff -r1.8 headerbar.inc
0a1,13
> <script type="text/javascript">
>   function runGoto() {
>     var chora_url = "<?php echo Chora::url('',$where);?>"
>
>     var url_path = chora_url.replace(/^(.*)\?.*$/, "$1");
>     var url_args = chora_url.replace(/^.*(\?.*)$/, "$1");
>
>     loc = url_path + "/" + document.getElementById("gotoBox").value + url_args;
>
>     window.location = loc;
>   }
> </script>
>
11c24,25
<           <?php echo _("Location:") ?>
---
>           <form name="gotoForm" action="" onsubmit="javascript:runGoto(); return false;" >
>           <?php echo _("<u>L</u>ocation:") ?>
13a28,33
>
>           <?php if ($atdir): ?>
>               / <input type="text" size="30" id="gotoBox" accesskey="l">
>           <?php endif; ?>
>           </form>
>


More information about the chora mailing list