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

sartak at bestpractical.com sartak at bestpractical.com
Wed Dec 23 14:47:01 EST 2009


The branch, master has been updated
       via  de77e52e45800e2c3a4df237370c44a823e51beb (commit)
      from  73606245a9fef06586ee7b5126a2d98f62a2ed29 (commit)

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

- Log -----------------------------------------------------------------
commit de77e52e45800e2c3a4df237370c44a823e51beb
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Dec 23 14:46:48 2009 -0500

    Have the radio buttons participate in ajax updates too

diff --git a/lib/Path/Dispatcher/Debugger/View.pm b/lib/Path/Dispatcher/Debugger/View.pm
index 94e598b..ea5ab52 100644
--- a/lib/Path/Dispatcher/Debugger/View.pm
+++ b/lib/Path/Dispatcher/Debugger/View.pm
@@ -42,7 +42,7 @@ template testing_form => sub {
         attr {
             type  => 'text',
             name  => 'path',
-            class => 'path_tester',
+            id    => 'path_tester',
             size  => 50,
         }
     }
@@ -51,6 +51,7 @@ template testing_form => sub {
         attr {
             type    => 'radio',
             name    => 'dispatch_type',
+            class   => 'dispatch_type',
             value   => 'dispatch',
             checked => 'checked',
         }
@@ -61,6 +62,7 @@ template testing_form => sub {
         attr {
             type  => 'radio',
             name  => 'dispatch_type',
+            class => 'dispatch_type',
             value => 'prefix',
         }
     }
@@ -70,6 +72,7 @@ template testing_form => sub {
         attr {
             type  => 'radio',
             name  => 'dispatch_type',
+            class => 'dispatch_type',
             value => 'completion',
         }
     }
diff --git a/share/path-dispatcher-debugger.js b/share/path-dispatcher-debugger.js
index 3b9e135..3801930 100644
--- a/share/path-dispatcher-debugger.js
+++ b/share/path-dispatcher-debugger.js
@@ -1,17 +1,25 @@
 var PathDispatcherDebugger = {};
 
+PathDispatcherDebugger.recalculate_matching_rules = function (form) {
+    var dispatch_type = jQuery("input[@name='dispatch_type']:checked").val();
+
+    jQuery.get(
+        '/matching_rules',
+        {
+            test_path: jQuery('#path_tester').val(),
+            dispatch_type: dispatch_type
+        },
+        PathDispatcherDebugger.update_matching_rules,
+        'html'
+    );
+};
+
 PathDispatcherDebugger.update_matching_rules = function (response) {
     jQuery('#matching_rules').html(response);
 };
 
 jQuery(function () {
-    jQuery('.path_tester').bind('keyup', function () {
-        jQuery.get(
-            '/matching_rules',
-            { test_path: this.value },
-            PathDispatcherDebugger.update_matching_rules,
-            'html'
-        );
-    });
+    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