Merged from sub repository (updated ckeditor, filters - step 2)

This commit is contained in:
RainLoop Team 2014-12-01 21:34:21 +04:00
parent a57dc3720e
commit ec7324b061
427 changed files with 10909 additions and 3336 deletions

View file

@ -167,6 +167,8 @@
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{
Data.coreReal(!!oData.Result.Real);
Data.coreChannel(oData.Result.Channel || 'stable');
Data.coreType(oData.Result.Type || 'stable');
Data.coreUpdatable(!!oData.Result.Updatable);
Data.coreAccess(!!oData.Result.Access);
Data.coreRemoteVersion(oData.Result.RemoteVersion || '');
@ -176,6 +178,8 @@
else
{
Data.coreReal(false);
Data.coreChannel('stable');
Data.coreType('stable');
Data.coreRemoteVersion('');
Data.coreRemoteRelease('');
Data.coreVersionCompare(-2);

View file

@ -51,7 +51,7 @@
'Gravatar': 'GRAVATAR',
'Themes': 'THEMES',
'UserBackground': 'USER_BACKGROUND',
'Filters': 'FILTERS',
'Sieve': 'SIEVE',
'AdditionalAccounts': 'ADDITIONAL_ACCOUNTS',
'AdditionalIdentities': 'ADDITIONAL_IDENTITIES'
};
@ -291,7 +291,6 @@
*/
Enums.FilterConditionField = {
'From': 'From',
'To': 'To',
'Recipient': 'Recipient',
'Subject': 'Subject'
};
@ -320,8 +319,8 @@
* @enum {string}
*/
Enums.FilterRulesType = {
'And': 'And',
'Or': 'Or'
'All': 'All',
'Any': 'Any'
};
/**

View file

@ -145,7 +145,7 @@
'removeButtons': 'Format,Undo,Redo,Cut,Copy,Paste,Anchor,Strike,Subscript,Superscript,Image,SelectAll,Source',
'removeDialogTabs': 'link:advanced;link:target;image:advanced;images:advanced',
'extraPlugins': 'plain',
'extraPlugins': 'plain,signature',
'allowedContent': true,
'font_defaultLabel': 'Arial',

View file

@ -62,6 +62,19 @@
return this.editor ? 'wysiwyg' === this.editor.mode : false;
};
/**
* @param {string} sSignature
*/
HtmlEditor.prototype.setSignature = function (sSignature)
{
if (this.editor)
{
this.editor.execCommand('insertSignature', {
'signature': sSignature
});
}
};
/**
* @return {boolean}
*/
@ -172,7 +185,7 @@
bBiti = !!Settings.settingsGet('AllowHtmlEditorBitiButtons')
;
if ((bSource || bBiti) && !oConfig.toolbarGroups.__SourceInited)
if ((bSource || !bBiti) && !oConfig.toolbarGroups.__SourceInited)
{
oConfig.toolbarGroups.__SourceInited = true;
@ -181,9 +194,9 @@
oConfig.removeButtons = oConfig.removeButtons.replace(',Source', '');
}
if (bBiti)
if (!bBiti)
{
oConfig.extraPlugins += (oConfig.extraPlugins ? ',' : '') + 'bidi';
oConfig.removePlugins += (oConfig.removePlugins ? ',' : '') + 'bidi';
}
}

View file

@ -1059,6 +1059,7 @@
oData.capaAdditionalAccounts = ko.observable(false);
oData.capaAdditionalIdentities = ko.observable(false);
oData.capaGravatar = ko.observable(false);
oData.capaSieve = ko.observable(false);
oData.determineUserLanguage = ko.observable(false);
oData.determineUserDomain = ko.observable(false);
@ -1561,6 +1562,8 @@
{
sPlain = sPlain.toString().replace(/\r/g, '');
bFindEmailAndLinks = Utils.isUnd(bFindEmailAndLinks) ? false : !!bFindEmailAndLinks;
var
bIn = false,
bDo = true,
@ -1627,7 +1630,6 @@
.replace(/>/g, '&gt;').replace(/</g, '&lt;')
.replace(/~~~blockquote~~~[\s]*/g, '<blockquote>')
.replace(/[\s]*~~~\/blockquote~~~/g, '</blockquote>')
.replace(/ /g, '&nbsp;')
.replace(/\n/g, '<br />')
;
@ -1784,11 +1786,12 @@
for (iIndex = 0, iLen = aList.length; iIndex < iLen; iIndex++)
{
oItem = aList[iIndex];
if (oItem.subScribed() || !oItem.existen || bBuildUnvisible)
// if (oItem.subScribed() || !oItem.existen || bBuildUnvisible)
if ((oItem.subScribed() || !oItem.existen || bBuildUnvisible) && (oItem.selectable || oItem.hasSubScribedSubfolders()))
{
if (fVisibleCallback ? fVisibleCallback.call(null, oItem) : true)
{
if (Enums.FolderType.User === oItem.type() || !bSystem || 0 < oItem.subFolders().length)
if (Enums.FolderType.User === oItem.type() || !bSystem || oItem.hasSubScribedSubfolders())
{
if (bSep && 0 < aResult.length)
{

44
dev/External/ko.js vendored
View file

@ -36,6 +36,7 @@
var
$oEl = null,
bi18n = true,
sClass = '',
sPlacement = '',
oSubscription = null,
@ -47,6 +48,7 @@
{
$oEl = $(oElement);
sClass = $oEl.data('tooltip-class') || '';
bi18n = 'on' === ($oEl.data('tooltip-i18n') || 'on');
sPlacement = $oEl.data('tooltip-placement') || 'top';
$oEl.tooltip({
@ -59,8 +61,9 @@
'placement': sPlacement,
'trigger': 'hover',
'title': function () {
return $oEl.is('.disabled') || Globals.dropdownVisibility() ? '' : '<span class="tooltip-class ' + sClass + '">' +
Utils.i18n(ko.unwrap(fValueAccessor())) + '</span>';
var sValue = bi18n ? ko.unwrap(fValueAccessor()) : fValueAccessor()();
return '' === sValue || $oEl.is('.disabled') || Globals.dropdownVisibility() ? '' :
'<span class="tooltip-class ' + sClass + '">' + (bi18n ? Utils.i18n(sValue) : sValue) + '</span>';
}
}).on('click.koTooltip', function () {
$oEl.tooltip('hide');
@ -75,42 +78,7 @@
}
};
ko.bindingHandlers.tooltip2 = {
'init': function (oElement, fValueAccessor) {
var
Globals = require('Common/Globals'),
$oEl = $(oElement),
oSubscription = null,
sClass = $oEl.data('tooltip-class') || '',
sPlacement = $oEl.data('tooltip-placement') || 'top'
;
$oEl.tooltip({
'delay': {
'show': 500,
'hide': 100
},
'html': true,
'container': 'body',
'placement': sPlacement,
'title': function () {
return $oEl.is('.disabled') || Globals.dropdownVisibility() ? '' :
'<span class="tooltip-class ' + sClass + '">' + fValueAccessor()() + '</span>';
}
}).on('click.koTooltip', function () {
$oEl.tooltip('hide');
});
oSubscription = Globals.tooltipTrigger.subscribe(function () {
$oEl.tooltip('hide');
});
fDisposalTooltipHelper(oElement, $oEl, oSubscription);
}
};
ko.bindingHandlers.tooltip3 = {
ko.bindingHandlers.tooltipForTest = {
'init': function (oElement) {
var

View file

@ -26,14 +26,10 @@
this.name = ko.observable('');
this.conditionsType = ko.observable(Enums.FilterRulesType.And);
this.conditionsType = ko.observable(Enums.FilterRulesType.All);
this.conditions = ko.observableArray([]);
this.regDisposables(this.conditions.subscribe(function () {
Utils.windowResize();
}));
// Actions
this.actionMarkAsRead = ko.observable(false);
this.actionSkipOtherFilters = ko.observable(true);
@ -41,18 +37,27 @@
this.actionType = ko.observable(Enums.FiltersAction.Move);
this.actionTypeOptions = [ // TODO i18n
{'id': Enums.FiltersAction.None, 'name': 'Action - None'},
{'id': Enums.FiltersAction.Move, 'name': 'Action - Move to'},
// {'id': Enums.FiltersAction.Forward, 'name': 'Action - Forward to'},
{'id': Enums.FiltersAction.Discard, 'name': 'Action - Discard'}
{'id': Enums.FiltersAction.None, 'name': 'None'},
{'id': Enums.FiltersAction.Move, 'name': ' Move to'},
// {'id': Enums.FiltersAction.Forward, 'name': 'Forward to'},
{'id': Enums.FiltersAction.Discard, 'name': 'Discard'}
];
this.actionMarkAsReadVisiblity = ko.computed(function () {
return -1 < Utils.inArray(this.actionType(), [
Enums.FiltersAction.None, Enums.FiltersAction.Forward, Enums.FiltersAction.Move
this.enableSkipOtherFilters = ko.computed(function () {
return -1 === Utils.inArray(this.actionType(), [
Enums.FiltersAction.Move, Enums.FiltersAction.Forward, Enums.FiltersAction.Discard
]);
}, this);
this.actionSkipOtherFiltersResult = ko.computed({
'read': function () {
return this.actionSkipOtherFilters() ||
!this.enableSkipOtherFilters();
},
'write': this.actionSkipOtherFilters,
'owner': this
});
this.actionTemplate = ko.computed(function () {
var sTemplate = '';
@ -75,7 +80,11 @@
}, this);
this.regDisposables([this.actionMarkAsReadVisiblity, this.actionTemplate]);
this.regDisposables(this.conditions.subscribe(function () {
Utils.windowResize();
}));
this.regDisposables([this.enableSkipOtherFilters, this.actionSkipOtherFiltersResult, this.actionTemplate]);
}
_.extend(FilterModel.prototype, AbstractModel.prototype);

View file

@ -27,7 +27,6 @@
this.fieldOptions = [ // TODO i18n
{'id': Enums.FilterConditionField.From, 'name': 'From'},
{'id': Enums.FilterConditionField.Recipient, 'name': 'Recipient (To or CC)'},
{'id': Enums.FilterConditionField.To, 'name': 'To'},
{'id': Enums.FilterConditionField.Subject, 'name': 'Subject'}
];

View file

@ -86,12 +86,14 @@
}, this);
this.visible = ko.computed(function () {
var
bSubScribed = this.subScribed(),
bSubFolders = this.hasSubScribedSubfolders()
;
return (bSubScribed || (bSubFolders && (!this.existen || !this.selectable)));
}, this);
this.isSystemFolder = ko.computed(function () {

View file

@ -69,7 +69,7 @@
'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity');
}
if (Settings.capa(Enums.Capa.Filters))
if (Settings.capa(Enums.Capa.Sieve))
{
kn.addSettingsViewModel(require('Settings/User/Filters'),
'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');

View file

@ -22,6 +22,8 @@
this.errorDesc = ko.observable('');
this.coreReal = Data.coreReal;
this.coreChannel = Data.coreChannel;
this.coreType = Data.coreType;
this.coreUpdatable = Data.coreUpdatable;
this.coreAccess = Data.coreAccess;
this.coreChecking = Data.coreChecking;

View file

@ -45,6 +45,7 @@
this.capaAdditionalAccounts(Settings.capa(Enums.Capa.AdditionalAccounts));
this.capaAdditionalIdentities(Settings.capa(Enums.Capa.AdditionalIdentities));
this.capaGravatar(Settings.capa(Enums.Capa.Gravatar));
this.capaSieve(Settings.capa(Enums.Capa.Sieve));
this.determineUserLanguage(!!Settings.settingsGet('DetermineUserLanguage'));
this.determineUserDomain(!!Settings.settingsGet('DetermineUserDomain'));

View file

@ -31,6 +31,8 @@
this.packages.loading = ko.observable(false).extend({'throttle': 100});
this.coreReal = ko.observable(true);
this.coreChannel = ko.observable('stable');
this.coreType = ko.observable('stable');
this.coreUpdatable = ko.observable(true);
this.coreAccess = ko.observable(true);
this.coreChecking = ko.observable(false).extend({'throttle': 100});

View file

@ -212,7 +212,7 @@
RemoteAdminStorage.prototype.createOrUpdateDomain = function (fCallback,
bCreate, sName,
sIncHost, iIncPort, sIncSecure, bIncShortLogin,
bUseSieve, bUseImapServerForSieve, sSieveHost, iSievePort, sSieveSecure,
bUseSieve, sSieveHost, iSievePort, sSieveSecure,
sOutHost, iOutPort, sOutSecure, bOutShortLogin, bOutAuth, bOutPhpMail,
sWhiteList)
{
@ -226,7 +226,6 @@
'IncShortLogin': bIncShortLogin ? '1' : '0',
'UseSieve': bUseSieve ? '1' : '0',
'UseImapServerForSieve': bUseImapServerForSieve ? '1' : '0',
'SieveHost': sSieveHost,
'SievePort': iSievePort,
'SieveSecure': sSieveSecure,
@ -244,7 +243,7 @@
RemoteAdminStorage.prototype.testConnectionForDomain = function (fCallback, sName,
sIncHost, iIncPort, sIncSecure,
bUseSieve, bUseImapServerForSieve, sSieveHost, iSievePort, sSieveSecure,
bUseSieve, sSieveHost, iSievePort, sSieveSecure,
sOutHost, iOutPort, sOutSecure, bOutAuth, bOutPhpMail)
{
this.defaultRequest(fCallback, 'AdminDomainTest', {
@ -253,7 +252,6 @@
'IncPort': iIncPort,
'IncSecure': sIncSecure,
'UseSieve': bUseSieve ? '1' : '0',
'UseImapServerForSieve': bUseImapServerForSieve ? '1' : '0',
'SieveHost': sSieveHost,
'SievePort': iSievePort,
'SieveSecure': sSieveSecure,

View file

@ -90,6 +90,7 @@
@import "SettingsOpenPGP.less";
@import "SettingsFolders.less";
@import "SettingsThemes.less";
@import "SettingsFilters.less";
@import "Animations.less";
//@import "Responsive.less";

View file

@ -68,7 +68,7 @@
border-bottom: 1px dashed #555;
}
}
.e-row {
line-height: 30px;
}
@ -135,6 +135,12 @@
}
}
.cke_chrome {
border-left-width: 0 !important;
border-right-width: 0 !important;
border-bottom-width: 0 !important;
}
.b-attachment-button {
display: inline-block;
}

View file

@ -1,10 +1,14 @@
.popups {
.b-filter-content {
width: 800px;
width: 750px;
.modal-header {
background-color: #fff;
}
.button-delete {
cursor: pointer;
}
}
}

View file

@ -0,0 +1,59 @@
.b-settings-filters {
.process-place {
text-align: center;
width: 600px;
padding: 14px 0;
}
.list-table {
width: 600px;
td {
padding: 4px 8px;
line-height: 30px;
}
.filter-img {
font-size: 12px;
margin-right: 5px;
}
.filter-name {
display: inline-block;
word-break: break-all;
box-sizing: border-box;
line-height: 22px;
cursor: pointer;
}
}
.filter-item {
.e-action {
cursor: pointer;
}
.button-delete {
margin-right: 15px;
margin-top: 5px;
visibility: hidden;
opacity: 0;
}
.delete-access {
&.button-delete {
visibility: visible;
margin-right: 0;
opacity: 1;
}
}
.delete-filter {
cursor: pointer;
opacity: 0.5;
}
}
}

View file

@ -10,6 +10,7 @@
.e-signature-place {
display: inline-block;
width: 680px;
width: 725px;
height: 250px;
}

View file

@ -3,6 +3,7 @@
.e-signature-place {
display: inline-block;
width: 680px;
width: 725px;
height: 250px;
}
}

View file

@ -2,6 +2,40 @@
display: none !important;
}*/
.cke_chrome {
border: 1px solid #ccc !important;
}
.cke_toolgroup, .cke_combo_button {
border: 1px solid #A6A6A6 !important;
}
.cke_top {
padding: 6px 4px 1px 6px !important;
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
.cke_button {
padding: 5px 6px !important;
}
.cke_combo_text {
line-height: 28px !important;
padding-left: 8px !important;
}
.cke_combo_button {
background: #FBFBFB !important;
}
.cke_source {
font-family: Monaco, Menlo, Consolas, 'Courier New', monospace !important;
padding: 10px !important;
padding-right: 0 !important;
}
.cke_plain {
background-color: #fff;
@ -38,7 +72,7 @@
}
.cke_wysiwyg_div {
padding: 10px !important;
font-family: arial, sans-serif;
font-size: 13px;

View file

@ -1052,10 +1052,10 @@
return false;
});
key('ctrl+enter, command+enter', Enums.KeyState.Compose, function () {
self.sendCommand();
return false;
});
// key('ctrl+enter, command+enter', Enums.KeyState.Compose, function () {
// self.sendCommand();
// return false;
// });
key('esc', Enums.KeyState.Compose, function () {
if (self.modalVisibility())

View file

@ -12,6 +12,7 @@
Utils = require('Common/Utils'),
Remote = require('Storage/Admin/Remote'),
Settings = require('Storage/Settings'),
kn = require('Knoin/Knoin'),
AbstractView = require('Knoin/AbstractView')
@ -62,14 +63,13 @@
this.name = ko.observable('');
this.name.focused = ko.observable(false);
this.allowSieve = ko.observable(false);
this.allowSieve = ko.observable(Settings.capa(Enums.Capa.Sieve));
this.imapServer = ko.observable('');
this.imapPort = ko.observable('' + Consts.Values.ImapDefaulPort);
this.imapSecure = ko.observable(Enums.ServerSecure.None);
this.imapShortLogin = ko.observable(false);
this.useSieve = ko.observable(false);
this.useImapServerForSieve = ko.observable(true);
this.sieveServer = ko.observable('');
this.sievePort = ko.observable('' + Consts.Values.SieveDefaulPort);
this.sieveSecure = ko.observable(Enums.ServerSecure.None);
@ -94,14 +94,13 @@
var
bPhpMail = this.smtpPhpMail(),
bAllowSieve = this.allowSieve(),
bUseSieve = this.useSieve(),
bIseImapServerForSieve = this.useImapServerForSieve()
bUseSieve = this.useSieve()
;
return '' !== this.name() &&
'' !== this.imapServer() &&
'' !== this.imapPort() &&
(bAllowSieve && bUseSieve ? (bIseImapServerForSieve ? true : ('' !== this.sieveServer() && '' !== this.sievePort())) : true) &&
(bAllowSieve && bUseSieve ? ('' !== this.sieveServer() && '' !== this.sievePort()) : true) &&
(('' !== this.smtpServer() && '' !== this.smtpPort()) || bPhpMail);
}, this);
@ -127,7 +126,6 @@
this.imapShortLogin(),
this.useSieve(),
this.useImapServerForSieve(),
this.sieveServer(),
Utils.pInt(this.sievePort()),
this.sieveSecure(),
@ -162,7 +160,6 @@
this.imapSecure(),
this.useSieve(),
this.useImapServerForSieve(),
this.sieveServer(),
Utils.pInt(this.sievePort()),
this.sieveSecure(),
@ -201,9 +198,9 @@
}, this);
this.sieveServerFocus.subscribe(function (bValue) {
if (bValue && '' !== this.name() && '' === this.sieveServer())
if (bValue && '' !== this.imapServer() && '' === this.sieveServer())
{
this.sieveServer(this.name().replace(/[.]?[*][.]?/g, ''));
this.sieveServer(this.imapServer());
}
}, this);
@ -356,7 +353,6 @@
this.imapSecure(Utils.trim(oDomain.IncSecure));
this.imapShortLogin(!!oDomain.IncShortLogin);
this.useSieve(!!oDomain.UseSieve);
this.useImapServerForSieve(!!oDomain.UseImapServerForSieve);
this.sieveServer(Utils.trim(oDomain.SieveHost));
this.sievePort('' + Utils.pInt(oDomain.SievePort));
this.sieveSecure(Utils.trim(oDomain.SieveSecure));
@ -400,7 +396,6 @@
this.imapShortLogin(false);
this.useSieve(false);
this.useImapServerForSieve(true);
this.sieveServer('');
this.sievePort('' + Consts.Values.SieveDefaulPort);
this.sieveSecure(Enums.ServerSecure.None);

View file

@ -48,7 +48,8 @@
LanguagesPopupView.prototype.languageEnName = function (sLanguage)
{
return Utils.convertLangName(sLanguage, true);
var sResult = Utils.convertLangName(sLanguage, true);
return 'English' === sResult ? '' : sResult;
};
LanguagesPopupView.prototype.resetMainLanguage = function ()

View file

@ -452,12 +452,6 @@
}
});
// TODO // more toggle
// key('', [Enums.KeyState.MessageList, Enums.KeyState.MessageView], function () {
// self.moreDropdownTrigger(true);
// return false;
// });
// reply
key('r', [Enums.KeyState.MessageList, Enums.KeyState.MessageView], function () {
if (Data.message())

1
dev/bootstrap.js vendored
View file

@ -42,6 +42,7 @@
window['rl']['remoteRequest'] = _.bind(Plugins.remoteRequest, Plugins);
window['rl']['pluginSettingsGet'] = _.bind(Plugins.settingsGet, Plugins);
window['rl']['createCommand'] = Utils.createCommand;
window['rl']['i18n'] = Utils.i18n;
window['rl']['EmailModel'] = EmailModel;
window['rl']['Enums'] = Enums;