From: Michael M Slusarz Date: Wed, 1 Sep 2010 19:45:19 +0000 (-0600) Subject: POP3 fixes X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b496687e2e71f3ebaecdff5ee49561fbfc1c74cb;p=horde.git POP3 fixes --- diff --git a/imp/js/dimpbase.js b/imp/js/dimpbase.js index 2cc00d89c..3c67b6150 100644 --- a/imp/js/dimpbase.js +++ b/imp/js/dimpbase.js @@ -302,7 +302,7 @@ var DimpBase = { var url = DIMP.conf.URI_MESSAGE; url += (url.include('?') ? '&' : '?') + $H({ folder: r.view, - uid: Number(r.imapuid) }).toQueryString(); + uid: r.imapuid }).toQueryString(); DimpCore.popupWindow(url, 'msgview' + r.view + r.imapuid); }, @@ -354,7 +354,7 @@ var DimpBase = { } } - this.viewport.loadView(f, { search: (this.uid ? { imapuid: Number(this.uid) } : null), background: opts.background}); + this.viewport.loadView(f, { search: (this.uid ? { imapuid: this.uid } : null), background: opts.background}); if (need_delete) { this.viewport.deleteView(need_delete); @@ -1538,15 +1538,20 @@ var DimpBase = { // 'noload' = (boolean) If true, don't load the mailbox quicksearchClear: function(noload) { - var f = this.folder; + var f = this.folder, + qs = $('qsearch'); - if (!$('qsearch').hasClassName('qsearchFocus')) { + if (!qs) { + return; + } + + if (!qs.hasClassName('qsearchFocus')) { this._setQsearchText(true); } if (this.isSearch()) { this.resetSelected(); - $('qsearch', 'qsearch_icon', 'qsearch_input').invoke('show'); + $(qs, 'qsearch_icon', 'qsearch_input').invoke('show'); if (!noload) { this.loadMailbox(this.search ? this.search.mbox : 'INBOX'); } @@ -2297,6 +2302,8 @@ var DimpBase = { _folderLoadCallback: function(r, callback) { + var nf = $('normalfolders'); + if (r.response.expand) { this.expandfolder = true; } @@ -2316,7 +2323,7 @@ var DimpBase = { $('foldersLoading').hide(); $('foldersSidebar').show(); - if ($('normalfolders').getStyle('max-height') !== null) { + if (nf && nf.getStyle('max-height') !== null) { this._sizeFolderlist(); } @@ -2662,7 +2669,9 @@ var DimpBase = { _sizeFolderlist: function() { var nf = $('normalfolders'); - nf.setStyle({ height: (document.viewport.getHeight() - nf.cumulativeOffset()[1]) + 'px' }); + if (nf) { + nf.setStyle({ height: (document.viewport.getHeight() - nf.cumulativeOffset()[1]) + 'px' }); + } }, toggleSubscribed: function() diff --git a/imp/js/dimpcore.js b/imp/js/dimpcore.js index cf7ae940e..3adadf9f8 100644 --- a/imp/js/dimpcore.js +++ b/imp/js/dimpcore.js @@ -44,13 +44,13 @@ var DimpCore = { return; } - var u = o.value.numericSort(), + var u = (DIMP.conf.pop3 ? o.value : o.value.numericSort()), first = u.shift(), last = first, out = []; u.each(function(k) { - if (last + 1 == k) { + if (!DIMP.conf.pop3 && (last + 1 == k)) { last = k; } else { out.push(first + (last == first ? '' : (':' + last))); @@ -93,8 +93,9 @@ var DimpCore = { uidstr.split(',').each(function(e) { var r = e.split(':'); if (r.size() == 1) { - uids.push(Number(e)); + uids.push(DIMP.conf.pop3 ? e : Number(e)); } else { + // POP3 will never exist in range here. uids = uids.concat($A($R(Number(r[0]), Number(r[1])))); } }); diff --git a/imp/lib/Ajax/Application.php b/imp/lib/Ajax/Application.php index 82e4841f1..40a15b4f7 100644 --- a/imp/lib/Ajax/Application.php +++ b/imp/lib/Ajax/Application.php @@ -907,7 +907,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application $args = array( 'mailbox' => $mbox, 'preview' => true, - 'uid' => intval($idx) + 'uid' => $idx ); $result = new stdClass; $result->preview = new stdClass; @@ -1381,10 +1381,10 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application $result = $this->showPreview(); $new_indices_list = $new_indices->getSingle(); - $result->newuid = intval($new_indices_list[1]); + $result->newuid = $new_indices_list[1]; $old_indices_list = $indices->getSingle(); $result->oldmbox = $old_indices_list[0]; - $result->olduid = intval($old_indices_list[1]); + $result->olduid = $old_indices_list[1]; $result->ViewPort = $this->_viewPortData(true); return $result; diff --git a/imp/lib/Views/ListMessages.php b/imp/lib/Views/ListMessages.php index fdf16def9..7b3e2bf74 100644 --- a/imp/lib/Views/ListMessages.php +++ b/imp/lib/Views/ListMessages.php @@ -374,7 +374,7 @@ class IMP_Views_ListMessages while (list(,$ob) = each($overview['overview'])) { /* Initialize the header fields. */ $msg = array( - 'imapuid' => intval($ob['uid']), + 'imapuid' => (($_SESSION['imp']['protocol'] == 'pop') ? $ob['uid'] : intval($ob['uid'])), 'view' => $ob['mailbox'], ); diff --git a/imp/lib/Views/ShowMessage.php b/imp/lib/Views/ShowMessage.php index be1574453..11a9fb771 100644 --- a/imp/lib/Views/ShowMessage.php +++ b/imp/lib/Views/ShowMessage.php @@ -100,7 +100,7 @@ class IMP_Views_ShowMessage $result = array( 'js' => array(), 'mailbox' => $mailbox, - 'uid' => intval($uid) + 'uid' => $uid ); /* Set the current time zone. */ diff --git a/imp/templates/dimp/index.inc b/imp/templates/dimp/index.inc index 612ce4c1f..b2788d9d5 100644 --- a/imp/templates/dimp/index.inc +++ b/imp/templates/dimp/index.inc @@ -114,6 +114,7 @@ function _simpleButton($id, $text, $image, $nodisplay = false) +
+ diff --git a/imp/templates/dimp/javascript_defs_dimp.php b/imp/templates/dimp/javascript_defs_dimp.php index 2792a23d6..c699a129c 100644 --- a/imp/templates/dimp/javascript_defs_dimp.php +++ b/imp/templates/dimp/javascript_defs_dimp.php @@ -66,6 +66,7 @@ $code['conf'] = array_filter(array( 'login_view' => $GLOBALS['prefs']->getValue('dimp_login_view'), 'mbox_expand' => intval($GLOBALS['prefs']->getValue('nav_expanded') == 2), 'name' => $GLOBALS['registry']->get('name', 'imp'), + 'pop3' => intval((isset($_SESSION['imp']) && ($_SESSION['imp']['protocol'] == 'pop'))), 'popup_height' => 610, 'popup_width' => 820, 'preview_pref' => ($GLOBALS['prefs']->getValue('dimp_show_preview') ? $GLOBALS['prefs']->getValue('dimp_show_preview') : 'horiz'), diff --git a/imp/themes/dimp/screen.css b/imp/themes/dimp/screen.css index a0523dfad..0ab42a867 100644 --- a/imp/themes/dimp/screen.css +++ b/imp/themes/dimp/screen.css @@ -378,6 +378,9 @@ div.vpRowVert.flagUnseen { #logo, #dimpbarActions, #serviceActions, #foldersSidebar, #normalfolders { overflow-x: hidden; } +#applicationfolders { + overflow: hidden; +} #folderopts a { display: inline !important;