From: Michael M Slusarz Date: Wed, 18 Nov 2009 05:42:29 +0000 (-0700) Subject: Removing support for dhtmlHistory in dimp. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=49c264e6dc60a1239f59eac7e31719704bd3db6a;p=horde.git Removing support for dhtmlHistory in dimp. It is just too much work to try to maintain - (the original code base hasn't been touched/updated for 2+ years) and it doesn't work properly with all current browsers, let alone with previous browsers. Keep the most important part of the code - allowing to link to messages/folders - but axe the rest. --- diff --git a/imp/index-dimp.php b/imp/index-dimp.php index da85be950..9474b15ff 100644 --- a/imp/index-dimp.php +++ b/imp/index-dimp.php @@ -20,7 +20,6 @@ $scripts = array( array('DimpBase.js', 'imp'), array('DimpSlider.js', 'imp'), array('ViewPort.js', 'imp'), - array('dhtmlHistory.js', 'horde'), array('dialog.js', 'imp'), array('dragdrop2.js', 'horde'), array('imp.js', 'imp'), diff --git a/imp/js/DimpBase.js b/imp/js/DimpBase.js index 52e129fdc..5c78ea741 100644 --- a/imp/js/DimpBase.js +++ b/imp/js/DimpBase.js @@ -230,7 +230,7 @@ var DimpBase = { // This catches the refresh case - no need to re-add to history if (!Object.isUndefined(this.folder) && !this.search) { - this._addHistory(loc); + location.hash = escape(loc); } } @@ -250,7 +250,7 @@ var DimpBase = { return; } this.highlightSidebar('app' + app); - this._addHistory(loc, data); + location.hash = escape(loc); if (data) { this.iframeContent(loc, data); } else if (DIMP.conf.app_urls[app]) { @@ -273,7 +273,7 @@ var DimpBase = { case 'portal': this.highlightSidebar('appportal'); - this._addHistory(loc); + location.hash = escape(loc); DimpCore.setTitle(DIMP.text.portal); DimpCore.doAction('ShowPortal', {}, { callback: this._portalCallback.bind(this) }); break; @@ -286,13 +286,6 @@ var DimpBase = { } }, - _addHistory: function(loc, data) - { - if (Horde.dhtmlHistory.getCurrentLocation() != loc) { - Horde.dhtmlHistory.add(loc, data); - } - }, - highlightSidebar: function(id) { // Folder bar may not be fully loaded yet. @@ -1199,7 +1192,7 @@ var DimpBase = { eval(r.js.join(';')); } - this._addHistory('msg:' + row.view + ':' + row.imapuid); + location.hash = escape('msg:' + row.view + ':' + row.imapuid); }, // opts = mailbox, uid @@ -2616,7 +2609,7 @@ var DimpBase = { { DimpCore.init(); - var DM = DimpCore.DMenu; + var DM = DimpCore.DMenu, tmp; /* Register global handlers now. */ document.observe('keydown', this.keydownHandler.bindAsEventListener(this)); @@ -2647,21 +2640,18 @@ var DimpBase = { DM.addSubMenu('ctx_qsearchopts_filternot', 'ctx_flag'); } - /* Start message list loading as soon as possible. */ - if (Horde.dhtmlHistory.initialize()) { - Horde.dhtmlHistory.addListener(this.go.bind(this)); + /* Initialize the starting page. */ + tmp = location.hash; + if (!tmp.empty() && tmp.startsWith('#')) { + tmp = (tmp.length == 1) ? "" : tmp.substring(1); } - - /* Initialize the starting page if necessary. addListener() will have - * already fired if there is a current location so only do a go() - * call if there is no current location. */ - if (!Horde.dhtmlHistory.getCurrentLocation()) { - if (DIMP.conf.login_view == 'inbox') { - this.go('folder:INBOX'); - } else { - this.go('portal'); - this.loadMailbox('INBOX', { background: true }); - } + if (!tmp.empty()) { + this.go(unescape(tmp)); + } else if (DIMP.conf.login_view == 'inbox') { + this.go('folder:INBOX'); + } else { + this.go('portal'); + this.loadMailbox('INBOX', { background: true }); } this._setQsearchText(true); diff --git a/imp/js/DimpCore.js b/imp/js/DimpCore.js index 005f8804a..876f85b3a 100644 --- a/imp/js/DimpCore.js +++ b/imp/js/DimpCore.js @@ -274,15 +274,11 @@ var DimpCore = { { var ptr = parent.frames.horde_main ? parent : window; - if (Horde.dhtmlHistory) { - Horde.dhtmlHistory.stop(); - } - ptr.location.assign(this.addURLParam(url)); // Catch browsers that don't redirect on assign(). if (force && !Prototype.Browser.WebKit) { - (function() { ptr.location.reload(); }).delay(0.4); + (function() { ptr.location.reload(); }).delay(0.5); } },