11
22
33//
4- // Generated on Wed Jun 25 2014 00:16:13 GMT-0700 (PDT ) by Nodejitsu, Inc (Using Codesurgeon).
5- // Version 1.2.4
4+ // Generated on Fri Sep 26 2014 20:19:31 GMT-0400 (EDT ) by Nodejitsu, Inc (Using Codesurgeon).
5+ // Version 1.2.5
66//
77
88( function ( exports ) {
1717
1818var dloc = document . location ;
1919
20+ function getHash ( ) {
21+ var hash = dloc . href . split ( "#" ) [ 1 ] || '' ;
22+ if ( hash !== '' ) { hash = '#' + hash }
23+ return hash ;
24+ }
25+
2026function dlocHashEmpty ( ) {
2127 // Non-IE browsers return '' when the address bar shows '#'; Director's logic
2228 // assumes both mean empty.
23- return dloc . hash === '' || dloc . hash === '#' ;
29+ var hash = getHash ( ) ;
30+ return hash === '' || hash === '#' ;
2431}
2532
2633var listener = {
2734 mode : 'modern' ,
28- hash : dloc . hash ,
35+ hash : getHash ( ) ,
2936 history : false ,
3037
3138 check : function ( ) {
32- var h = dloc . hash ;
39+ var h = getHash ( ) ;
3340 if ( h != this . hash ) {
3441 this . hash = h ;
3542 this . onHashChanged ( ) ;
@@ -150,7 +157,7 @@ var listener = {
150157 syncHash : function ( ) {
151158 // IE support...
152159 var s = this . _hash ;
153- if ( s != dloc . hash ) {
160+ if ( s != getHash ( ) ) {
154161 dloc . hash = s ;
155162 }
156163 return this ;
@@ -191,11 +198,11 @@ Router.prototype.init = function (r) {
191198 if ( dlocHashEmpty ( ) && r ) {
192199 dloc . hash = r ;
193200 } else if ( ! dlocHashEmpty ( ) ) {
194- self . dispatch ( 'on' , '/' + dloc . hash . replace ( / ^ ( # \/ | # | \/ ) / , '' ) ) ;
201+ self . dispatch ( 'on' , '/' + getHash ( ) . replace ( / ^ ( # \/ | # | \/ ) / , '' ) ) ;
195202 }
196203 }
197204 else {
198- var routeTo = dlocHashEmpty ( ) && r ? r : ! dlocHashEmpty ( ) ? dloc . hash . replace ( / ^ # / , '' ) : null ;
205+ var routeTo = dlocHashEmpty ( ) && r ? r : ! dlocHashEmpty ( ) ? getHash ( ) . replace ( / ^ # / , '' ) : null ;
199206 if ( routeTo ) {
200207 window . history . replaceState ( { } , document . title , routeTo ) ;
201208 }
@@ -211,7 +218,7 @@ Router.prototype.init = function (r) {
211218} ;
212219
213220Router . prototype . explode = function ( ) {
214- var v = this . history === true ? this . getPath ( ) : dloc . hash ;
221+ var v = this . history === true ? this . getPath ( ) : getHash ( ) ;
215222 if ( v . charAt ( 1 ) === '/' ) { v = v . slice ( 1 ) }
216223 return v . slice ( 1 , v . length ) . split ( "/" ) ;
217224} ;
0 commit comments