[Bps-public-commit] Path-Dispatcher-Debugger branch, master, updated. f945dcdc2636a20d8b7bbce6ca50fab7d7349bb2

sartak at bestpractical.com sartak at bestpractical.com
Wed Dec 23 18:22:50 EST 2009


The branch, master has been updated
       via  f945dcdc2636a20d8b7bbce6ca50fab7d7349bb2 (commit)
      from  536f1a42fa2f231432ed5d9ffc2552e0c1c5df40 (commit)

Summary of changes:
 lib/Path/Dispatcher/Debugger/View.pm |    9 ++++++++-
 share/path-dispatcher-debugger.js    |    5 +++++
 2 files changed, 13 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit f945dcdc2636a20d8b7bbce6ca50fab7d7349bb2
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Dec 23 18:22:38 2009 -0500

    Make completions clicky

diff --git a/lib/Path/Dispatcher/Debugger/View.pm b/lib/Path/Dispatcher/Debugger/View.pm
index 644d88d..9f9af1a 100644
--- a/lib/Path/Dispatcher/Debugger/View.pm
+++ b/lib/Path/Dispatcher/Debugger/View.pm
@@ -186,7 +186,14 @@ sub display_completions {
 
     span {
         while (my $c = shift @completions) {
-            span { attr { class => 'completion' } $c };
+            a {
+                attr {
+                    class   => 'completion',
+                    onclick => "PathDispatcherDebugger.set_path('$c'); return false;",
+                    href    => '#',
+                }
+                $c
+            };
             span { ', ' } if @completions;
         }
     }
diff --git a/share/path-dispatcher-debugger.js b/share/path-dispatcher-debugger.js
index 3801930..f44d98d 100644
--- a/share/path-dispatcher-debugger.js
+++ b/share/path-dispatcher-debugger.js
@@ -18,6 +18,11 @@ PathDispatcherDebugger.update_matching_rules = function (response) {
     jQuery('#matching_rules').html(response);
 };
 
+PathDispatcherDebugger.set_path = function (path) {
+    jQuery('#path_tester').val(path);
+    PathDispatcherDebugger.recalculate_matching_rules();
+};
+
 jQuery(function () {
     jQuery('#path_tester').bind('keyup', PathDispatcherDebugger.recalculate_matching_rules);
     jQuery('.dispatch_type').bind('change', PathDispatcherDebugger.recalculate_matching_rules);

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list