From 7750dd566dc1d50f87e32e2616cd0af53c50f430 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 16 Aug 2010 23:32:11 -0600 Subject: [PATCH] Add DimpBase.setHash(). --- imp/js/dimpbase.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/imp/js/dimpbase.js b/imp/js/dimpbase.js index ee968de78..d14308f8e 100644 --- a/imp/js/dimpbase.js +++ b/imp/js/dimpbase.js @@ -189,7 +189,7 @@ var DimpBase = { // This catches the refresh case - no need to re-add to history if (!Object.isUndefined(this.folder) && !this.search) { - location.hash = encodeURIComponent(loc); + this.setHash(loc); } } @@ -209,7 +209,7 @@ var DimpBase = { return; } this.highlightSidebar('app' + app); - location.hash = encodeURIComponent(loc); + this.setHash(loc); if (data) { this.iframeContent(loc, data); } else if (DIMP.conf.app_urls[app]) { @@ -232,20 +232,25 @@ var DimpBase = { case 'portal': this.highlightSidebar('appportal'); - location.hash = encodeURIComponent(loc); + this.setHash(loc); DimpCore.setTitle(DIMP.text.portal); DimpCore.doAction('showPortal', {}, { callback: this._portalCallback.bind(this) }); break; case 'options': this.highlightSidebar('appoptions'); - location.hash = encodeURIComponent(loc); + this.setHash(loc); DimpCore.setTitle(DIMP.text.prefs); this.iframeContent(loc, DIMP.conf.URI_PREFS_IMP); break; } }, + setHash: function(loc) + { + location.hash = escape(encodeURIComponent(loc)); + }, + highlightSidebar: function(id) { // Folder bar may not be fully loaded yet. @@ -1219,7 +1224,7 @@ var DimpBase = { eval(r.js.join(';')); } - location.hash = encodeURIComponent('msg:' + row.view + ':' + row.imapuid); + this.setHash('msg:' + row.view + ':' + row.imapuid); }, _stripAttachmentCallback: function(r) @@ -2978,7 +2983,7 @@ var DimpBase = { } if (!tmp.empty()) { - this.go(decodeURIComponent(tmp)); + this.go(decodeURIComponent(unescape(tmp))); } else if (DIMP.conf.login_view == 'inbox') { this.go('folder:INBOX'); } else { -- 2.11.0