From 8c6b25f7071e9db98581f5891dcfe2f3e64112c1 Mon Sep 17 00:00:00 2001 From: David Boon Date: Thu, 3 Jan 2013 16:06:34 -0500 Subject: [PATCH 1/5] Added a small improvement for hash routing that checks for routes already containing '#' or '/#' --- lib/extensions/davis.hashRouting.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/extensions/davis.hashRouting.js b/lib/extensions/davis.hashRouting.js index cdecd6c..393b94e 100644 --- a/lib/extensions/davis.hashRouting.js +++ b/lib/extensions/davis.hashRouting.js @@ -206,7 +206,8 @@ Davis.hashRouting = function(options) { * @params {Request} the request to set the current location to. */ var wrapper = function(request, opts, setter) { - setter("#" + options.prefix + request.location()); + var location = request.location(); + setter( (location.match(/^\/?#/) ? '': '#') + options.prefix + location); lastPolledLocation = getLocation(); if (opts && opts.silent) return invokeCallbacks(request); From d8f5df1d14e34743325d9a1c4e6dce177abf3b78 Mon Sep 17 00:00:00 2001 From: David Boon Date: Fri, 4 Jan 2013 09:45:37 -0500 Subject: [PATCH 2/5] Hacking on davis.js. I don't have a good fix for this nor the time to spend much longer on it. When using forceHashRouting=true, upon the first load of Davis, the link selector event handler was running and causing issues with routes not being found. Seems like a load order problem where the hash routing plugin hadn't overriden enough functionality from base davis.js... --- davis.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/davis.js b/davis.js index 8f3ae66..70fa0e1 100644 --- a/davis.js +++ b/davis.js @@ -358,8 +358,9 @@ Davis.listener = function () { * @memberOf listener */ this.listen = function () { - Davis.$(document).delegate(this.settings.formSelector, 'submit', submitHandler) - Davis.$(document).delegate(this.settings.linkSelector, 'click', clickHandler) + // Commenting these out because they are causing issues when we use 'forceHashRouting=true' + //Davis.$(document).delegate(this.settings.formSelector, 'submit', submitHandler) + //Davis.$(document).delegate(this.settings.linkSelector, 'click', clickHandler) } /** @@ -372,8 +373,9 @@ Davis.listener = function () { * @memberOf listener */ this.unlisten = function () { - Davis.$(document).undelegate(this.settings.linkSelector, 'click', clickHandler) - Davis.$(document).undelegate(this.settings.formSelector, 'submit', submitHandler) + // Commenting these out because they are causing issues when we use 'forceHashRouting=true' + //Davis.$(document).undelegate(this.settings.linkSelector, 'click', clickHandler) + //Davis.$(document).undelegate(this.settings.formSelector, 'submit', submitHandler) } } /*! From 1be7992910b380d9a004cbe160db606bb3fac8ed Mon Sep 17 00:00:00 2001 From: David Boon Date: Tue, 15 Jan 2013 07:13:10 -0500 Subject: [PATCH 3/5] turned down davis.js logging --- davis.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/davis.js b/davis.js index 70fa0e1..97b6377 100644 --- a/davis.js +++ b/davis.js @@ -1787,7 +1787,7 @@ Davis.App = (function () { var bindToInternalEvents = function () { self .bind('runRoute', function (request) { - self.logger.info("runRoute: " + request.toString()); + self.logger.debug("runRoute: " + request.toString()); }) .bind('routeNotFound', function (request) { if (!self.settings.handleRouteNotFound && !request.isForPageLoad) { @@ -1797,10 +1797,10 @@ Davis.App = (function () { self.logger.warn("routeNotFound: " + request.toString()); }) .bind('start', function () { - self.logger.info("application started") + self.logger.debug("application started") }) .bind('stop', function () { - self.logger.info("application stopped") + self.logger.debug("application stopped") }) .bind('routeError', function (request, route, error) { if (self.settings.throwErrors) throw(error) From f06c593d3809cfa87d6c51bc63e7e1ad9c651f0e Mon Sep 17 00:00:00 2001 From: David Boon Date: Tue, 15 Jan 2013 07:17:21 -0500 Subject: [PATCH 4/5] Removed noisy logging --- davis.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/davis.js b/davis.js index 97b6377..c383c2d 100644 --- a/davis.js +++ b/davis.js @@ -1787,7 +1787,7 @@ Davis.App = (function () { var bindToInternalEvents = function () { self .bind('runRoute', function (request) { - self.logger.debug("runRoute: " + request.toString()); + //self.logger.info("runRoute: " + request.toString()); }) .bind('routeNotFound', function (request) { if (!self.settings.handleRouteNotFound && !request.isForPageLoad) { @@ -1797,10 +1797,10 @@ Davis.App = (function () { self.logger.warn("routeNotFound: " + request.toString()); }) .bind('start', function () { - self.logger.debug("application started") + //self.logger.debug("application started") }) .bind('stop', function () { - self.logger.debug("application stopped") + //self.logger.debug("application stopped") }) .bind('routeError', function (request, route, error) { if (self.settings.throwErrors) throw(error) From 80ed12720174d28725da3a331ba3071eb0e5c872 Mon Sep 17 00:00:00 2001 From: David Boon Date: Thu, 5 Jun 2014 13:50:00 -0400 Subject: [PATCH 5/5] removed recursive symbolic link --- tests/src | 1 - 1 file changed, 1 deletion(-) delete mode 120000 tests/src diff --git a/tests/src b/tests/src deleted file mode 120000 index e831038..0000000 --- a/tests/src +++ /dev/null @@ -1 +0,0 @@ -src \ No newline at end of file