You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2013/08/28 03:00:00 UTC

git commit: added hash removal to injected js for backbone/jQM routes

Updated Branches:
  refs/heads/master 7051baa78 -> d62ca3a12


added hash removal to injected js for backbone/jQM routes


Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/d62ca3a1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/d62ca3a1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/d62ca3a1

Branch: refs/heads/master
Commit: d62ca3a12615adc347a6ce06135369349d396eda
Parents: 7051baa
Author: purplecabbage <pu...@gmail.com>
Authored: Tue Aug 27 17:58:57 2013 -0700
Committer: purplecabbage <pu...@gmail.com>
Committed: Tue Aug 27 17:59:45 2013 -0700

----------------------------------------------------------------------
 wp8/template/cordovalib/XHRHelper.cs | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d62ca3a1/wp8/template/cordovalib/XHRHelper.cs
----------------------------------------------------------------------
diff --git a/wp8/template/cordovalib/XHRHelper.cs b/wp8/template/cordovalib/XHRHelper.cs
index 35b8bd3..027cab3 100644
--- a/wp8/template/cordovalib/XHRHelper.cs
+++ b/wp8/template/cordovalib/XHRHelper.cs
@@ -162,27 +162,22 @@ namespace WPCordovaClassLib.CordovaLib
                 else {
                     this.changeReadyState(XHRShim.OPENED);
                     var alias = this;
-                    var root = window.location.href; 
+                    var root = window.location.href.split('#')[0];   // remove hash
                     var basePath = root.substr(0,root.lastIndexOf('/')) + '/';
                     
-
-                    var resolvedUrl = this._url.split('//').join('/');
+                    var resolvedUrl = this._url.split('//').join('/').split('#')[0]; // remove hash
 
                     var wwwFolderPath = navigator.userAgent.indexOf('MSIE 9.0') > -1 ? 'app/www/' : 'www/';
 
-                    console.log('original resolvedUrl = ' + resolvedUrl);
-
                     if(resolvedUrl.indexOf('/') == 0) {
                         console.log('removing leading /');
                         resolvedUrl = resolvedUrl.substr(1);
                     }
 
                     if( resolvedUrl.indexOf('app/www') == 0 ) {
-                        
                         resolvedUrl = window.location.protocol  + wwwFolderPath + resolvedUrl.substr(7);
                     }
                     else if( resolvedUrl.indexOf('www') == 0) {
-
                         resolvedUrl = window.location.protocol  + wwwFolderPath + resolvedUrl.substr(4);
                     }
 
@@ -190,9 +185,6 @@ namespace WPCordovaClassLib.CordovaLib
                         resolvedUrl = basePath + resolvedUrl; // consider it relative
                     }
 
-                    console.log('sanitized resolvedUrl = ' + resolvedUrl);
-
-
                     var funk = function () {
                         window.__onXHRLocalCallback = function (responseCode, responseText) {
                             alias.status = responseCode;