<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>examples/location_override/quirkey.html</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -29,6 +29,129 @@
         return this.$element().data('appState', newState);
       };
       
+      // _checkFormSubmission: function(form) {
+      //   var $form, path, verb, params, returned;
+      //   this.trigger('check-form-submission', {form: form});
+      //   $form = $(form);
+      //   path  = $form.attr('action');
+      //   verb  = $form.attr('method').toString().toLowerCase();
+      //   params = {};
+      //   $form.find(':input[type!=submit]').each(function() {
+      //     params[$(this).attr('name')] = $(this).val();
+      //   });
+      //   try { // catch 404s
+      //     returned = this.runRoute(verb, path, params);
+      //   } catch(e) {
+      //     if (e.toString().match(/^404/) &amp;&amp; this.silence_404) {
+      //       return true;
+      //     } else {
+      //       throw(e);
+      //     }
+      //   }
+      //   return (typeof returned == 'undefined') ? false : returned;
+      // },
+      
+      // _checkLocation: function() {
+      //   try { // try, catch 404s
+      //     // get current location
+      //     var location, returned;
+      //     location = this.getLocation();
+      //     // compare to see if hash has changed
+      //     if (location != this.last_location) {
+      //       // lookup route for current hash
+      //       returned = this.runRoute('get', location);
+      //     // compare to see if path has changed
+      //     }
+      //     // reset last location
+      //     this.last_location = location;
+      //   } catch(e) {
+      //     // reset last location
+      //     this.last_location = location;
+      //     // unless the error is a 404 and 404s are silenced
+      //     if (e.toString().match(/^404/) &amp;&amp; this.silence_404) {
+      //       return returned;
+      //     } else {
+      //       throw(e);
+      //     }
+      //   }
+      //   return returned;
+      // },
+      
+      // ----------------------------------------------------------------
+  
+      Sammy.Application.prototype._checkFormSubmission = function(form) {
+        var $form, path, verb, params, returned;
+        this.trigger('check-form-submission', {form: form});
+        $form = $(form);
+        path  = $form.attr('action');
+        verb  = $form.attr('method').toString().toLowerCase();
+        params = {};
+        $form.find(':input[type!=submit]').each(function() {
+          params[$(this).attr('name')] = $(this).val();
+        });
+        try { // catch 404s
+          
+// console.log('this.runRoute call: ', verb, path, params);
+          returned = this.runRoute(verb, path, params);
+        } catch(e) {
+          if (e.toString().match(/^404/) &amp;&amp; this.silence_404) {
+            return true;
+          } else {
+            throw(e);
+          }
+        }
+        return (typeof returned == 'undefined') ? false : returned;
+      };
+      
+      // ----------------------------------------------------------------
+      
+      Sammy.Application.prototype.runRoute = function(verb, path, params) {
+// console.log('runRoute receive: ', verb, path, params);
+        this.trigger('run-route', {verb: verb, path: path, params: params});
+        if (typeof params == 'undefined') params = {};
+      
+        var route = this.lookupRoute(verb, path);
+        if (route) {
+          this.trigger('route-found', {route: route});
+          // pull out the params from the path
+          if ((path_params = route.path.exec(path)) != null) {
+            // first match is the full path
+            path_params.shift();
+            // for each of the matches
+            this.each(path_params, function(i, param) {
+              // if theres a matching param name
+              if (route.param_names[i]) {
+                // set the name to the match
+                params[route.param_names[i]] = param;
+              } else {
+                // initialize 'splat'
+                if (!params['splat']) params['splat'] = [];
+                params['splat'].push(param);
+              }
+            });
+          }
+        
+          // set event context
+          var context  = new this.context_prototype(this, verb, path, params);
+          this.last_route = route;
+          // run all the before filters
+          var before_value = true; 
+          var befores = this.befores.slice(0);
+          while (befores.length &gt; 0) {
+            if (befores.shift().apply(context) === false) return false;
+          }
+          context.trigger('event-context-before');
+          var returned = route.callback.apply(context);
+          context.trigger('event-context-after');
+          return returned;
+        } else {
+          this.notFound(verb, path);
+        }
+      };
+      
+      // ----------------------------------------------------------------
+      
+      
       
       var app = new Sammy.Application(function() { with(this) {
         // debug = true;
@@ -64,6 +187,40 @@
             }
           });
           
+          // $('form', element).bind('submit', function(e) {
+            // var form = $(this);
+            // var path = form.attr('action');
+            // if (path.match(/^#/)) {
+            //   console.log(&quot;form was captured&quot;, path, context.app);
+            //   context.redirect(path);
+            //   return false;
+            // } else {
+            //   return true;
+            // }
+          // });
+          
+          // _checkFormSubmission: function(form) {
+          //   var $form, path, verb, params, returned;
+          //   this.trigger('check-form-submission', {form: form});
+          //   $form = $(form);
+          //   path  = $form.attr('action');
+          //   verb  = $form.attr('method').toString().toLowerCase();
+          //   params = {};
+          //   $form.find(':input[type!=submit]').each(function() {
+          //     params[$(this).attr('name')] = $(this).val();
+          //   });
+          //   try { // catch 404s
+          //     returned = this.runRoute(verb, path, params);
+          //   } catch(e) {
+          //     if (e.toString().match(/^404/) &amp;&amp; this.silence_404) {
+          //       return true;
+          //     } else {
+          //       throw(e);
+          //     }
+          //   }
+          //   return (typeof returned == 'undefined') ? false : returned;
+          // },
+          
         }});
         
       }});</diff>
      <filename>examples/location_override/issue.html</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f253ad69db4c40ed4dd602f23f350db8546fe745</id>
    </parent>
  </parents>
  <author>
    <name>Russell Jones</name>
    <email>spam@codeofficer.com</email>
  </author>
  <url>http://github.com/CodeOfficer/sammy/commit/bc93f25c927be40423507d14adfafe4560b03328</url>
  <id>bc93f25c927be40423507d14adfafe4560b03328</id>
  <committed-date>2009-07-04T01:02:27-07:00</committed-date>
  <authored-date>2009-07-04T01:02:27-07:00</authored-date>
  <message>more issues</message>
  <tree>50a89f1352ff40a6fd5ab0c7791b3f03765b320f</tree>
  <committer>
    <name>Russell Jones</name>
    <email>spam@codeofficer.com</email>
  </committer>
</commit>
