mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 07:57:02 +03:00
Composer fixes
This commit is contained in:
parent
01e1c770ea
commit
b062e9b190
9 changed files with 86 additions and 61 deletions
|
|
@ -22,6 +22,7 @@
|
||||||
'Sheet': 'sheet',
|
'Sheet': 'sheet',
|
||||||
'Presentation': 'presentation',
|
'Presentation': 'presentation',
|
||||||
'Certificate': 'certificate',
|
'Certificate': 'certificate',
|
||||||
|
'CertificateBin': 'certificate-bin',
|
||||||
'Archive': 'archive'
|
'Archive': 'archive'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@
|
||||||
this.resize = _.throttle(_.bind(this.resize, this), 100);
|
this.resize = _.throttle(_.bind(this.resize, this), 100);
|
||||||
|
|
||||||
this.__inited = false;
|
this.__inited = false;
|
||||||
this.__initedData = null;
|
|
||||||
|
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
@ -206,10 +205,6 @@
|
||||||
this.focus();
|
this.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
this.__initedData = [true, sHtml, bFocus];
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
HtmlEditor.prototype.setPlain = function (sPlain, bFocus)
|
HtmlEditor.prototype.setPlain = function (sPlain, bFocus)
|
||||||
|
|
@ -233,10 +228,6 @@
|
||||||
this.focus();
|
this.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
this.__initedData = [false, sPlain, bFocus];
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
HtmlEditor.prototype.init = function ()
|
HtmlEditor.prototype.init = function ()
|
||||||
|
|
@ -318,37 +309,29 @@
|
||||||
self.focusTrigger();
|
self.focusTrigger();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (self.fOnReady)
|
self.editor.on('instanceReady', function () {
|
||||||
{
|
|
||||||
self.editor.on('instanceReady', function () {
|
|
||||||
|
|
||||||
if (self.editor.removeMenuItem)
|
if (self.editor.removeMenuItem)
|
||||||
{
|
{
|
||||||
self.editor.removeMenuItem('cut');
|
self.editor.removeMenuItem('cut');
|
||||||
self.editor.removeMenuItem('copy');
|
self.editor.removeMenuItem('copy');
|
||||||
self.editor.removeMenuItem('paste');
|
self.editor.removeMenuItem('paste');
|
||||||
}
|
}
|
||||||
|
|
||||||
self.editor.setKeystroke(window.CKEDITOR.CTRL + 65 /* A */, 'selectAll');
|
self.editor.setKeystroke(window.CKEDITOR.CTRL + 65 /* A */, 'selectAll');
|
||||||
|
|
||||||
|
|
||||||
|
self.__resizable = true;
|
||||||
|
self.__inited = true;
|
||||||
|
|
||||||
|
self.resize();
|
||||||
|
|
||||||
|
if (self.fOnReady)
|
||||||
|
{
|
||||||
self.fOnReady();
|
self.fOnReady();
|
||||||
self.__resizable = true;
|
}
|
||||||
self.__inited = true;
|
|
||||||
self.resize();
|
|
||||||
|
|
||||||
if (self.__initedData)
|
});
|
||||||
{
|
|
||||||
if (self.__initedData[0])
|
|
||||||
{
|
|
||||||
self.setHtml(self.__initedData[1], self.__initedData[2]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
self.setPlain(self.__initedData[1], self.__initedData[2]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
||||||
29
dev/External/ko.js
vendored
29
dev/External/ko.js
vendored
|
|
@ -24,32 +24,41 @@
|
||||||
'init': function (oElement, fValueAccessor) {
|
'init': function (oElement, fValueAccessor) {
|
||||||
|
|
||||||
var
|
var
|
||||||
fValue = fValueAccessor(),
|
|
||||||
oEditor = null,
|
oEditor = null,
|
||||||
|
fValue = fValueAccessor(),
|
||||||
|
|
||||||
fUpdateEditorValue = function () {
|
fUpdateEditorValue = function () {
|
||||||
if (oEditor)
|
if (fValue && fValue.__editor)
|
||||||
{
|
{
|
||||||
oEditor.setHtmlOrPlain(fValue());
|
fValue.__editor.setHtmlOrPlain(fValue());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
fUpdateKoValue = function () {
|
fUpdateKoValue = function () {
|
||||||
if (oEditor && oEditor.__inited)
|
if (fValue && fValue.__editor)
|
||||||
{
|
{
|
||||||
fValue(oEditor.getDataWithHtmlMark());
|
fValue(fValue.__editor.getDataWithHtmlMark());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
fOnReady = function () {
|
||||||
|
fValue.__editor = oEditor;
|
||||||
|
fUpdateEditorValue();
|
||||||
|
},
|
||||||
|
|
||||||
HtmlEditor = require('Common/HtmlEditor')
|
HtmlEditor = require('Common/HtmlEditor')
|
||||||
;
|
;
|
||||||
|
|
||||||
if (fValue)
|
if (ko.isObservable(fValue) && HtmlEditor)
|
||||||
{
|
{
|
||||||
oEditor = new HtmlEditor(oElement, fUpdateKoValue, fUpdateEditorValue, fUpdateKoValue);
|
oEditor = new HtmlEditor(oElement, fUpdateKoValue, fOnReady, fUpdateKoValue);
|
||||||
fValue.__editor = oEditor;
|
|
||||||
fValue.__fetchEditorValue = fUpdateKoValue;
|
fValue.__fetchEditorValue = fUpdateKoValue;
|
||||||
fValue.__updateEditorValue = fUpdateEditorValue;
|
|
||||||
|
|
||||||
fValue.subscribe(fUpdateEditorValue);
|
fValue.subscribe(fUpdateEditorValue);
|
||||||
fUpdateEditorValue();
|
|
||||||
|
// ko.utils.domNodeDisposal.addDisposeCallback(oElement, function () {
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,8 @@
|
||||||
*/
|
*/
|
||||||
AttachmentModel.prototype.hasPreview = function ()
|
AttachmentModel.prototype.hasPreview = function ()
|
||||||
{
|
{
|
||||||
return this.isImage() || (this.isPdf() && Globals.bAllowPdfPreview) || this.isText() || this.isFramed();
|
return this.isImage() || (this.isPdf() && Globals.bAllowPdfPreview) ||
|
||||||
|
this.isText() || this.isFramed();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -370,12 +371,17 @@
|
||||||
sResult = Enums.FileType.Pdf;
|
sResult = Enums.FileType.Pdf;
|
||||||
break;
|
break;
|
||||||
case -1 < Utils.inArray(sMimeType, [
|
case -1 < Utils.inArray(sMimeType, [
|
||||||
'application/pgp-signature', 'application/pkcs7-signature', 'application/pgp-keys'
|
'application/pgp-signature', 'application/pgp-keys'
|
||||||
]) || -1 < Utils.inArray(sExt, [
|
]) || -1 < Utils.inArray(sExt, [
|
||||||
'asc', 'pem', 'ppk'
|
'asc', 'pem', 'ppk'
|
||||||
]):
|
]):
|
||||||
sResult = Enums.FileType.Certificate;
|
sResult = Enums.FileType.Certificate;
|
||||||
break;
|
break;
|
||||||
|
case -1 < Utils.inArray(sMimeType, ['application/pkcs7-signature']) ||
|
||||||
|
-1 < Utils.inArray(sExt, ['p7s']):
|
||||||
|
|
||||||
|
sResult = Enums.FileType.CertificateBin;
|
||||||
|
break;
|
||||||
case -1 < Utils.inArray(aMimeTypeParts[1], [
|
case -1 < Utils.inArray(aMimeTypeParts[1], [
|
||||||
'rtf', 'msword', 'vnd.msword', 'vnd.openxmlformats-officedocument.wordprocessingml.document',
|
'rtf', 'msword', 'vnd.msword', 'vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
'vnd.openxmlformats-officedocument.wordprocessingml.template',
|
'vnd.openxmlformats-officedocument.wordprocessingml.template',
|
||||||
|
|
@ -447,6 +453,7 @@
|
||||||
sClass = 'icon-file-zip';
|
sClass = 'icon-file-zip';
|
||||||
break;
|
break;
|
||||||
case Enums.FileType.Certificate:
|
case Enums.FileType.Certificate:
|
||||||
|
case Enums.FileType.CertificateBin:
|
||||||
sClass = 'icon-file-certificate';
|
sClass = 'icon-file-certificate';
|
||||||
break;
|
break;
|
||||||
case Enums.FileType.Sheet:
|
case Enums.FileType.Sheet:
|
||||||
|
|
@ -509,6 +516,7 @@
|
||||||
sClass = 'icon-file-zip';
|
sClass = 'icon-file-zip';
|
||||||
break;
|
break;
|
||||||
case Enums.FileType.Certificate:
|
case Enums.FileType.Certificate:
|
||||||
|
case Enums.FileType.CertificateBin:
|
||||||
sClass = 'icon-file-certificate';
|
sClass = 'icon-file-certificate';
|
||||||
break;
|
break;
|
||||||
case Enums.FileType.Sheet:
|
case Enums.FileType.Sheet:
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,6 @@
|
||||||
{
|
{
|
||||||
if (oData.Result)
|
if (oData.Result)
|
||||||
{
|
{
|
||||||
this.formHidden(true);
|
|
||||||
require('App/Admin').loginAndLogoutReload(true);
|
require('App/Admin').loginAndLogoutReload(true);
|
||||||
}
|
}
|
||||||
else if (oData.ErrorCode)
|
else if (oData.ErrorCode)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
|
|
||||||
|
/* global require, module */
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
|
||||||
|
|
@ -213,12 +213,10 @@
|
||||||
}
|
}
|
||||||
else if (oData.Admin)
|
else if (oData.Admin)
|
||||||
{
|
{
|
||||||
this.formHidden(true);
|
|
||||||
require('App/User').redirectToAdminPanel();
|
require('App/User').redirectToAdminPanel();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.formHidden(true);
|
|
||||||
require('App/User').loginAndLogoutReload(false);
|
require('App/User').loginAndLogoutReload(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -382,8 +380,6 @@
|
||||||
if (0 === iErrorCode)
|
if (0 === iErrorCode)
|
||||||
{
|
{
|
||||||
self.submitRequest(true);
|
self.submitRequest(true);
|
||||||
self.formHidden(true);
|
|
||||||
|
|
||||||
require('App/User').loginAndLogoutReload(false);
|
require('App/User').loginAndLogoutReload(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -1921,6 +1921,7 @@ class MailClient
|
||||||
* @param bool $bUseSortIfSupported = false
|
* @param bool $bUseSortIfSupported = false
|
||||||
* @param bool $bUseThreadSortIfSupported = false
|
* @param bool $bUseThreadSortIfSupported = false
|
||||||
* @param bool $bUseESearchOrESortRequest = false
|
* @param bool $bUseESearchOrESortRequest = false
|
||||||
|
* @param string $sThreadUid = ''
|
||||||
*
|
*
|
||||||
* @return \MailSo\Mail\MessageCollection
|
* @return \MailSo\Mail\MessageCollection
|
||||||
*
|
*
|
||||||
|
|
@ -1929,7 +1930,8 @@ class MailClient
|
||||||
* @throws \MailSo\Imap\Exceptions\Exception
|
* @throws \MailSo\Imap\Exceptions\Exception
|
||||||
*/
|
*/
|
||||||
public function MessageList($sFolderName, $iOffset = 0, $iLimit = 10, $sSearch = '', $sPrevUidNext = '', $oCacher = null,
|
public function MessageList($sFolderName, $iOffset = 0, $iLimit = 10, $sSearch = '', $sPrevUidNext = '', $oCacher = null,
|
||||||
$bUseSortIfSupported = false, $bUseThreadSortIfSupported = false, $bUseESearchOrESortRequest = false)
|
$bUseSortIfSupported = false, $bUseThreadSortIfSupported = false, $bUseESearchOrESortRequest = false,
|
||||||
|
$sThreadUid = '')
|
||||||
{
|
{
|
||||||
$sSearch = \trim($sSearch);
|
$sSearch = \trim($sSearch);
|
||||||
if (!\MailSo\Base\Validator::RangeInt($iOffset, 0) ||
|
if (!\MailSo\Base\Validator::RangeInt($iOffset, 0) ||
|
||||||
|
|
@ -1958,6 +1960,11 @@ class MailClient
|
||||||
$bUseThreadSortIfSupported = $bUseThreadSortIfSupported ?
|
$bUseThreadSortIfSupported = $bUseThreadSortIfSupported ?
|
||||||
($this->oImapClient->IsSupported('THREAD=REFS') || $this->oImapClient->IsSupported('THREAD=REFERENCES') || $this->oImapClient->IsSupported('THREAD=ORDEREDSUBJECT')) : false;
|
($this->oImapClient->IsSupported('THREAD=REFS') || $this->oImapClient->IsSupported('THREAD=REFERENCES') || $this->oImapClient->IsSupported('THREAD=ORDEREDSUBJECT')) : false;
|
||||||
|
|
||||||
|
if (!empty($sThreadUid) && !$bUseThreadSortIfSupported)
|
||||||
|
{
|
||||||
|
throw new \MailSo\Base\Exceptions\InvalidArgumentException();
|
||||||
|
}
|
||||||
|
|
||||||
if (!$oCacher || !($oCacher instanceof \MailSo\Cache\CacheClient))
|
if (!$oCacher || !($oCacher instanceof \MailSo\Cache\CacheClient))
|
||||||
{
|
{
|
||||||
$oCacher = null;
|
$oCacher = null;
|
||||||
|
|
@ -1986,6 +1993,12 @@ class MailClient
|
||||||
$bIndexAsUid = false;
|
$bIndexAsUid = false;
|
||||||
$aIndexOrUids = array();
|
$aIndexOrUids = array();
|
||||||
|
|
||||||
|
// $mThreads = $this->MessageListThreadsMap($sFolderName, $sFolderHash, array(), $oCacher, true);
|
||||||
|
// if (\is_array($mThreads))
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
if (0 < \strlen($sSearch))
|
if (0 < \strlen($sSearch))
|
||||||
{
|
{
|
||||||
$aIndexOrUids = $this->getSearchUidsResult($sSearch,
|
$aIndexOrUids = $this->getSearchUidsResult($sSearch,
|
||||||
|
|
@ -2263,7 +2276,10 @@ class MailClient
|
||||||
{
|
{
|
||||||
$aSubscribedFolders = $this->oImapClient->FolderSubscribeList($sParent, $sListPattern);
|
$aSubscribedFolders = $this->oImapClient->FolderSubscribeList($sParent, $sListPattern);
|
||||||
}
|
}
|
||||||
catch (\Exception $oException) {}
|
catch (\Exception $oException)
|
||||||
|
{
|
||||||
|
unset($oException);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$aImapSubscribedFoldersHelper = null;
|
$aImapSubscribedFoldersHelper = null;
|
||||||
|
|
|
||||||
|
|
@ -5509,11 +5509,12 @@ class Actions
|
||||||
$sSearch = '';
|
$sSearch = '';
|
||||||
$sUidNext = '';
|
$sUidNext = '';
|
||||||
$bUseThreads = false;
|
$bUseThreads = false;
|
||||||
|
$sThreadUid = '';
|
||||||
|
|
||||||
$sRawKey = $this->GetActionParam('RawKey', '');
|
$sRawKey = $this->GetActionParam('RawKey', '');
|
||||||
$aValues = $this->getDecodedClientRawKeyValue($sRawKey, 9);
|
$aValues = $this->getDecodedClientRawKeyValue($sRawKey, 9);
|
||||||
|
|
||||||
if (\is_array($aValues) && 9 === \count($aValues))
|
if (\is_array($aValues) && 7 < \count($aValues))
|
||||||
{
|
{
|
||||||
$sFolder =(string) $aValues[0];
|
$sFolder =(string) $aValues[0];
|
||||||
$iOffset = (int) $aValues[1];
|
$iOffset = (int) $aValues[1];
|
||||||
|
|
@ -5522,6 +5523,11 @@ class Actions
|
||||||
$sUidNext = (string) $aValues[6];
|
$sUidNext = (string) $aValues[6];
|
||||||
$bUseThreads = (bool) $aValues[7];
|
$bUseThreads = (bool) $aValues[7];
|
||||||
|
|
||||||
|
if ($bUseThreads)
|
||||||
|
{
|
||||||
|
$sThreadUid = ''; // TODO
|
||||||
|
}
|
||||||
|
|
||||||
$this->verifyCacheByKey($sRawKey);
|
$this->verifyCacheByKey($sRawKey);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -5532,6 +5538,11 @@ class Actions
|
||||||
$sSearch = $this->GetActionParam('Search', '');
|
$sSearch = $this->GetActionParam('Search', '');
|
||||||
$sUidNext = $this->GetActionParam('UidNext', '');
|
$sUidNext = $this->GetActionParam('UidNext', '');
|
||||||
$bUseThreads = '1' === (string) $this->GetActionParam('UseThreads', '0');
|
$bUseThreads = '1' === (string) $this->GetActionParam('UseThreads', '0');
|
||||||
|
|
||||||
|
if ($bUseThreads)
|
||||||
|
{
|
||||||
|
$sThreadUid = (string) $this->GetActionParam('ThreadUid', '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 === strlen($sFolder))
|
if (0 === strlen($sFolder))
|
||||||
|
|
@ -5552,8 +5563,8 @@ class Actions
|
||||||
$sFolder, $iOffset, $iLimit, $sSearch, $sUidNext,
|
$sFolder, $iOffset, $iLimit, $sSearch, $sUidNext,
|
||||||
$this->cacherForUids(),
|
$this->cacherForUids(),
|
||||||
!!$this->Config()->Get('labs', 'use_imap_sort', false),
|
!!$this->Config()->Get('labs', 'use_imap_sort', false),
|
||||||
$bUseThreads,
|
$bUseThreads, !!$this->Config()->Get('labs', 'use_imap_esearch_esort', false),
|
||||||
!!$this->Config()->Get('labs', 'use_imap_esearch_esort', false)
|
$sThreadUid
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch (\Exception $oException)
|
catch (\Exception $oException)
|
||||||
|
|
@ -7724,10 +7735,10 @@ class Actions
|
||||||
$iUid = (int) (isset($aValues['Uid']) ? $aValues['Uid'] : 0);
|
$iUid = (int) (isset($aValues['Uid']) ? $aValues['Uid'] : 0);
|
||||||
$sMimeIndex = (string) (isset($aValues['MimeIndex']) ? $aValues['MimeIndex'] : '');
|
$sMimeIndex = (string) (isset($aValues['MimeIndex']) ? $aValues['MimeIndex'] : '');
|
||||||
|
|
||||||
header('Content-Type: text/plain', true);
|
\header('Content-Type: text/plain', true);
|
||||||
|
|
||||||
return $this->MailClient()->MessageMimeStream(function ($rResource) {
|
return $this->MailClient()->MessageMimeStream(function ($rResource) {
|
||||||
if (is_resource($rResource))
|
if (\is_resource($rResource))
|
||||||
{
|
{
|
||||||
\MailSo\Base\Utils::FpassthruWithTimeLimitReset($rResource);
|
\MailSo\Base\Utils::FpassthruWithTimeLimitReset($rResource);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue