[Pkg-javascript-commits] [backbone] 127/211: Adding test for hashbang URLs. For pull request #312.

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:00:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.5.0
in repository backbone.

commit ee215be027417a18d89346514ef59bc850fda92c
Merge: 0cc8cb0 914ff9d
Author: Samuel Clay <samuel at ofbrooklyn.com>
Date:   Fri Apr 22 12:15:46 2011 -0400

    Adding test for hashbang URLs. For pull request #312.

 backbone.js        | 2 +-
 test/controller.js | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --cc backbone.js
index b5bfe01,6accd5c..bec4de0
--- a/backbone.js
+++ b/backbone.js
@@@ -730,11 -731,8 +730,11 @@@
    };
  
    // Cached regex for cleaning hashes.
-   var hashStrip = /^#*/;
+   var hashStrip = /^#*!?/;
  
 +  // Cached regex for detecting MSIE.
 +  var isExplorer = /msie [\w.]+/;
 +
    // Has the history handling already been started?
    var historyStarted = false;
  
diff --cc test/controller.js
index 1ad3c6c,1ad3c6c..2c02953
--- a/test/controller.js
+++ b/test/controller.js
@@@ -106,4 -106,4 +106,13 @@@ $(document).ready(function() 
      }, 10);
    });
  
++  asyncTest("Controller: routes (hashbang)", 2, function() {
++    window.location.hash = '!search/news';
++    setTimeout(function() {
++      equals(controller.query, 'news');
++      equals(controller.page, undefined);
++      start();
++    }, 10);
++  });
++
  });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list