New Ask popup

Fix inputosaurus fake span width detection
Add Esc trigger to all popups (#29)
Many minor fixes
This commit is contained in:
RainLoop Team 2013-12-14 03:27:12 +04:00
parent 214d905f90
commit dcc486a114
57 changed files with 1200 additions and 307 deletions

View file

@ -171,6 +171,7 @@ module.exports = function (grunt) {
"dev/ViewModels/PopupsPluginViewModel.js", "dev/ViewModels/PopupsPluginViewModel.js",
"dev/ViewModels/PopupsActivateViewModel.js", "dev/ViewModels/PopupsActivateViewModel.js",
"dev/ViewModels/PopupsLanguagesViewModel.js", "dev/ViewModels/PopupsLanguagesViewModel.js",
"dev/ViewModels/PopupsAskViewModel.js",
"dev/ViewModels/AdminLoginViewModel.js", "dev/ViewModels/AdminLoginViewModel.js",
@ -260,6 +261,7 @@ module.exports = function (grunt) {
"dev/ViewModels/PopupsAddAccountViewModel.js", "dev/ViewModels/PopupsAddAccountViewModel.js",
"dev/ViewModels/PopupsIdentityViewModel.js", "dev/ViewModels/PopupsIdentityViewModel.js",
"dev/ViewModels/PopupsLanguagesViewModel.js", "dev/ViewModels/PopupsLanguagesViewModel.js",
"dev/ViewModels/PopupsAskViewModel.js",
"dev/ViewModels/LoginViewModel.js", "dev/ViewModels/LoginViewModel.js",

View file

@ -35,8 +35,27 @@ AdminPlugins.prototype.configurePlugin = function (oPlugin)
RL.remote().plugin(this.onPluginLoadRequest, oPlugin.name); RL.remote().plugin(this.onPluginLoadRequest, oPlugin.name);
}; };
AdminPlugins.prototype.onBuild = function () AdminPlugins.prototype.onBuild = function (oDom)
{ {
var self = this;
oDom
.on('click', '.e-item .configure-plugin-action', function () {
var oPlugin = ko.dataFor(this);
if (oPlugin)
{
self.configurePlugin(oPlugin);
}
})
.on('click', '.e-item .disable-plugin', function () {
var oPlugin = ko.dataFor(this);
if (oPlugin)
{
self.disablePlugin(oPlugin);
}
})
;
this.enabledPlugins.subscribe(function (bValue) { this.enabledPlugins.subscribe(function (bValue) {
RL.remote().saveAdminConfig(Utils.emptyFunction, { RL.remote().saveAdminConfig(Utils.emptyFunction, {
'EnabledPlugins': bValue ? '1' : '0' 'EnabledPlugins': bValue ? '1' : '0'

View file

@ -240,7 +240,6 @@ AbstractApp.prototype.pub = function (sName, aArgs)
{ {
if (!Utils.isUnd(this.oSubs[sName])) if (!Utils.isUnd(this.oSubs[sName]))
{ {
window.console.log(sName);
_.each(this.oSubs[sName], function (aItem) { _.each(this.oSubs[sName], function (aItem) {
if (aItem[0]) if (aItem[0])
{ {

View file

@ -110,6 +110,7 @@ Enums.ClientSideKeyName = {
*/ */
Enums.EventKeyCode = { Enums.EventKeyCode = {
'Backspace': 8, 'Backspace': 8,
'Tab': 9,
'Enter': 13, 'Enter': 13,
'Esc': 27, 'Esc': 27,
'PageUp': 33, 'PageUp': 33,

View file

@ -40,6 +40,7 @@
@import "Scroll.less"; @import "Scroll.less";
@import "SystemDropDown.less"; @import "SystemDropDown.less";
@import "Login.less"; @import "Login.less";
@import "Ask.less";
@import "FolderList.less"; @import "FolderList.less";
@import "FolderClear.less"; @import "FolderClear.less";
@import "FolderCreate.less"; @import "FolderCreate.less";

20
dev/Styles/Ask.less Normal file
View file

@ -0,0 +1,20 @@
.popups {
.b-ask-content {
&.modal {
z-index: 10000;
}
.modal-header {
background-color: #fff;
}
.modal-body {
text-align: center;
}
.desc-place {
font-size: 18px;
}
}
}

View file

@ -1,2 +1,5 @@
input[type="text"], input[type="password"], input[type="email"], input[type="search"] {
height: 20px;
line-height: 21px;
}

View file

@ -45,12 +45,6 @@
} }
} }
.inputosaurus-fake-span {
position: absolute;
top: 0;
left: -5000px;
}
.inputosaurus-input { .inputosaurus-input {
margin: 1px 10px 1px 0px; margin: 1px 10px 1px 0px;
@ -67,3 +61,9 @@
.ui-autocomplete { .ui-autocomplete {
z-index: 2000; z-index: 2000;
} }
.inputosaurus-fake-span {
position: absolute;
top: 0;
left: -5000px;
}

View file

@ -108,8 +108,18 @@ PopupsAddAccountViewModel.prototype.onShow = function ()
this.emailFocus(true); this.emailFocus(true);
}; };
PopupsAddAccountViewModel.prototype.onBuild = function () PopupsAddAccountViewModel.prototype.onBuild = function ()
{ {
this.allowCustomLogin(!!RL.settingsGet('AllowCustomLogin')); this.allowCustomLogin(!!RL.settingsGet('AllowCustomLogin'));
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
}; };

View file

@ -105,3 +105,17 @@ PopupsAdvancedSearchViewModel.prototype.onShow = function ()
this.fromFocus(true); this.fromFocus(true);
}; };
PopupsAdvancedSearchViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};

View file

@ -0,0 +1,116 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
* @constructor
* @extends KnoinAbstractViewModel
*/
function PopupsAskViewModel()
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAsk');
this.askDesc = ko.observable('');
this.yesButton = ko.observable('');
this.noButton = ko.observable('');
this.yesFocus = ko.observable(false);
this.noFocus = ko.observable(false);
this.fYesAction = null;
this.fNoAction = null;
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsAskViewModel', PopupsAskViewModel);
PopupsAskViewModel.prototype.clearPopup = function ()
{
this.askDesc('');
this.yesButton(Utils.i18n('POPUPS_ASK/BUTTON_YES'));
this.noButton(Utils.i18n('POPUPS_ASK/BUTTON_NO'));
this.yesFocus(false);
this.noFocus(false);
this.fYesAction = null;
this.fNoAction = null;
};
PopupsAskViewModel.prototype.yesClick = function ()
{
if (Utils.isFunc(this.fYesAction))
{
this.fYesAction.call(null);
}
this.cancelCommand();
};
PopupsAskViewModel.prototype.noClick = function ()
{
if (Utils.isFunc(this.fNoAction))
{
this.fNoAction.call(null);
}
this.cancelCommand();
};
/**
* @param {string} sAskDesc
* @param {Function=} fYesFunc
* @param {Function=} fNoFunc
* @param {string=} sYesButton
* @param {string=} sNoButton
*/
PopupsAskViewModel.prototype.onShow = function (sAskDesc, fYesFunc, fNoFunc, sYesButton, sNoButton)
{
this.clearPopup();
this.fYesAction = fYesFunc || null;
this.fNoAction = fNoFunc || null;
this.askDesc(sAskDesc || '');
if (sYesButton)
{
this.yesButton(sYesButton);
}
if (sYesButton)
{
this.yesButton(sNoButton);
}
this.yesFocus(true);
};
PopupsAskViewModel.prototype.onHide = function ()
{
};
PopupsAskViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && self.modalVisibility())
{
if (Enums.EventKeyCode.Tab === oEvent.keyCode || Enums.EventKeyCode.Right === oEvent.keyCode || Enums.EventKeyCode.Left === oEvent.keyCode)
{
if (self.yesFocus())
{
self.noFocus(true);
}
else
{
self.yesFocus(true);
}
bResult = false;
}
}
return bResult;
});
};

View file

@ -801,6 +801,17 @@ PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToE
this.triggerForResize(); this.triggerForResize();
}; };
PopupsComposeViewModel.prototype.tryToClosePopup = function ()
{
var self = this;
kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'), function () {
if (self.modalVisibility())
{
kn.delegateRun(self, 'closeCommand');
}
}]);
};
PopupsComposeViewModel.prototype.onBuild = function () PopupsComposeViewModel.prototype.onBuild = function ()
{ {
this.initEditor(); this.initEditor();
@ -826,6 +837,11 @@ PopupsComposeViewModel.prototype.onBuild = function ()
self.sendCommand(); self.sendCommand();
bResult = false; bResult = false;
} }
else if (Enums.EventKeyCode.Esc === oEvent.keyCode)
{
self.tryToClosePopup();
bResult = false;
}
} }
return bResult; return bResult;

View file

@ -457,6 +457,17 @@ PopupsContactsViewModel.prototype.onBuild = function (oDom)
} }
}) })
; ;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'closeCommand');
bResult = false;
}
return bResult;
});
}; };
PopupsContactsViewModel.prototype.onShow = function () PopupsContactsViewModel.prototype.onShow = function ()

View file

@ -186,6 +186,20 @@ PopupsDomainViewModel.prototype.onShow = function (oDomain)
} }
}; };
PopupsDomainViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};
PopupsDomainViewModel.prototype.clearForm = function () PopupsDomainViewModel.prototype.clearForm = function ()
{ {
this.edit(false); this.edit(false);

View file

@ -95,3 +95,17 @@ PopupsFolderClearViewModel.prototype.onShow = function (oFolder)
this.selectedFolder(oFolder); this.selectedFolder(oFolder);
} }
}; };
PopupsFolderClearViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};

View file

@ -105,3 +105,17 @@ PopupsFolderCreateViewModel.prototype.onShow = function ()
this.clearPopup(); this.clearPopup();
this.focusTrigger(true); this.focusTrigger(true);
}; };
PopupsFolderCreateViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};

View file

@ -103,3 +103,17 @@ PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType)
this.notification(sNotification); this.notification(sNotification);
}; };
PopupsFolderSystemViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};

View file

@ -120,7 +120,6 @@ PopupsIdentityViewModel.prototype.clearPopup = function ()
}; };
/** /**
*
* @param {?IdentityModel} oIdentity * @param {?IdentityModel} oIdentity
*/ */
PopupsIdentityViewModel.prototype.onShow = function (oIdentity) PopupsIdentityViewModel.prototype.onShow = function (oIdentity)
@ -145,3 +144,17 @@ PopupsIdentityViewModel.prototype.onShow = function (oIdentity)
this.email.focused(true); this.email.focused(true);
} }
}; };
PopupsIdentityViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};

View file

@ -54,6 +54,20 @@ PopupsLanguagesViewModel.prototype.onHide = function ()
this.exp(false); this.exp(false);
}; };
PopupsLanguagesViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};
PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang) PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
{ {
RL.data().mainLanguage(sLang); RL.data().mainLanguage(sLang);

View file

@ -111,3 +111,28 @@ PopupsPluginViewModel.prototype.onShow = function (oPlugin)
} }
} }
}; };
PopupsPluginViewModel.prototype.tryToClosePopup = function ()
{
var self = this;
kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'), function () {
if (self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
}
}]);
};
PopupsPluginViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
self.tryToClosePopup();
bResult = false;
}
return bResult;
});
};

View file

@ -1,8 +1,8 @@
{ {
"name": "RainLoop", "name": "RainLoop",
"title": "RainLoop Webmail", "title": "RainLoop Webmail",
"version": "1.5.0", "version": "1.5.1",
"release": "532", "release": "546",
"description": "Simple, modern & fast web-based email client", "description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net", "homepage": "http://rainloop.net",
"main": "Gruntfile.js", "main": "Gruntfile.js",

View file

@ -33,7 +33,7 @@
</div> </div>
<div data-bind="visible: 'sqlite' !== contactsType()"> <div data-bind="visible: 'sqlite' !== contactsType()">
<div class="legend"> <div class="legend">
PDO (MySQL / PostgreSQL / ...) PDO (MySQL / PostgreSQL)
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label"> <label class="control-label">
@ -42,10 +42,8 @@
<div class="controls"> <div class="controls">
<input type="text" class="span6" data-bind="value: pdoDsn, saveTrigger: pdoDsnTrigger" /> <input type="text" class="span6" data-bind="value: pdoDsn, saveTrigger: pdoDsnTrigger" />
<div data-bind="saveTrigger: pdoDsnTrigger"></div> <div data-bind="saveTrigger: pdoDsnTrigger"></div>
<blockquote style="margin-top: 10px"> <blockquote style="margin: 10px 0 0 0">
<p class="muted"> <p class="muted">
<strong>Examples:</strong>
<br />
mysql:host=127.0.0.1;port=3306;dbname=rainloop mysql:host=127.0.0.1;port=3306;dbname=rainloop
<br /> <br />
pgsql:host=127.0.0.1;port=5432;dbname=rainloop pgsql:host=127.0.0.1;port=5432;dbname=rainloop

View file

@ -1,4 +1,4 @@
<div class="b-admin-domains" > <div class="b-admin-domains g-ui-user-select-none">
<div class="legend"> <div class="legend">
Domains Domains
</div> </div>
@ -18,7 +18,7 @@
&nbsp;&nbsp; &nbsp;&nbsp;
loading... loading...
</div> </div>
<table class="table table-hover b-admin-domains-list-table g-ui-user-select-none" data-bind="i18nUpdate: domains"> <table class="table table-hover b-admin-domains-list-table" data-bind="i18nUpdate: domains">
<colgroup> <colgroup>
<col /> <col />
<col style="width: 140px" /> <col style="width: 140px" />

View file

@ -1,15 +1,10 @@
<tr class="e-item" data-bind="css: {'disabled': disabled }"> <tr class="e-item" data-bind="css: {'disabled': disabled }">
<td> <td class="configure-plugin-action e-action">
<i class="plugin-img icon-lightning"></i> <i class="plugin-img icon-lightning"></i>
<span class="plugin-name" data-bind="text: name"></span> <span class="plugin-name" data-bind="text: name"></span>
</td> </td>
<td> <td>
<span class="configure-plugin" data-bind="click: function (oPlugin) { $root.configurePlugin(oPlugin); }"> <span class="disable-plugin">
<i class="icon-settings5 e-action"></i>
</span>
</td>
<td>
<span class="disable-plugin" data-bind="click: function (oPlugin) { $root.disablePlugin(oPlugin); }">
<i data-bind="css: {'e-action icon-checkbox-checked': !disabled(), 'e-action icon-checkbox-unchecked': disabled}"></i> <i data-bind="css: {'e-action icon-checkbox-checked': !disabled(), 'e-action icon-checkbox-unchecked': disabled}"></i>
</span> </span>
</td> </td>

View file

@ -1,4 +1,4 @@
<div class="b-admin-plugins"> <div class="b-admin-plugins g-ui-user-select-none">
<div class="row"> <div class="row">
<div class="alert span8" data-bind="visible: '' !== pluginsError()"> <div class="alert span8" data-bind="visible: '' !== pluginsError()">
@ -39,7 +39,6 @@
<colgroup> <colgroup>
<col /> <col />
<col style="width: 30px" /> <col style="width: 30px" />
<col style="width: 30px" />
</colgroup> </colgroup>
<tbody data-bind="template: { name: 'AdminSettingsPluginListItem', foreach: plugins }"></tbody> <tbody data-bind="template: { name: 'AdminSettingsPluginListItem', foreach: plugins }"></tbody>
</table> </table>

View file

@ -1,5 +1,5 @@
<div class="popups"> <div class="popups">
<div class="modal hide b-account-add-content" data-bind="modal: modalVisibility"> <div class="modal hide b-account-add-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div> <div>
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button> <button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups"> <div class="popups">
<div class="modal hide b-advanced-search-content" data-bind="modal: modalVisibility"> <div class="modal hide b-advanced-search-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button> <button type="button" class="close" data-bind="command: cancelCommand">&times;</button>
<h3> <h3>

View file

@ -0,0 +1,26 @@
<div class="popups">
<div class="modal hide b-ask-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-body">
<br />
<br />
<span class="desc-place" data-bind="html: askDesc"></span>
<br />
<br />
<br />
</div>
<div class="modal-footer">
<button class="btn buttonYes" data-bind="click: yesClick, hasFocus: yesFocus">
<i class="icon-ok"></i>
&nbsp;&nbsp;
<span data-bind="text: yesButton"></span>
</button>
<button class="btn buttonNo" data-bind="click: noClick, hasFocus: noFocus">
<i class=" icon-remove"></i>
&nbsp;&nbsp;
<span data-bind="text: noButton"></span>
</button>
</div>
</div>
</div>
</div>

View file

@ -19,6 +19,30 @@
<div class="b-list-toopbar"> <div class="b-list-toopbar">
<input class="i18n span3 e-search" type="text" placeholder="Search" data-18n-placeholder="CONTACS/SEARCH_INPUT_PLACEHOLDER" data-bind="value: search" /> <input class="i18n span3 e-search" type="text" placeholder="Search" data-18n-placeholder="CONTACS/SEARCH_INPUT_PLACEHOLDER" data-bind="value: search" />
</div> </div>
<!--
<div class="btn-toolbar b-list-toopbar g-ui-user-select-none">
<div class="btn-group">
<input class="i18n span3 e-search" type="text" placeholder="Search" data-18n-placeholder="CONTACS/SEARCH_INPUT_PLACEHOLDER" data-bind="value: search" />
</div>
<div class="btn-group pull-right">
<a class="btn dropdown-toggle button-filter" data-toggle="dropdown">
<i class="icon-lightning"></i>
</a>
<ul class="dropdown-menu g-ui-menu">
<li class="e-item">
<a class="e-link">
Personal address book
</a>
</li>
<li class="e-item">
<a class="e-link">
Collected
</a>
</li>
</ul>
</div>
</div>
-->
<div class="b-list-content g-ui-user-select-none" data-bind="nano: true, css: {'hideContactListCheckbox': !useCheckboxesInList()}"> <div class="b-list-content g-ui-user-select-none" data-bind="nano: true, css: {'hideContactListCheckbox': !useCheckboxesInList()}">
<div class="content g-scrollbox"> <div class="content g-scrollbox">
<div class="content-wrapper"> <div class="content-wrapper">

View file

@ -1,5 +1,5 @@
<div class="popups"> <div class="popups">
<div class="modal hide b-domain-content" data-bind="modal: modalVisibility, css: {'domain-edit': edit, 'domain-white-list-page': whiteListPage}"> <div class="modal hide b-domain-content g-ui-user-select-none" data-bind="modal: modalVisibility, css: {'domain-edit': edit, 'domain-white-list-page': whiteListPage}">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button> <button type="button" class="close" data-bind="command: cancelCommand">&times;</button>
<h3 data-bind="text: headerText"></h3> <h3 data-bind="text: headerText"></h3>

View file

@ -1,5 +1,5 @@
<div class="popups"> <div class="popups">
<div class="modal hide b-folder-clear-content" data-bind="modal: modalVisibility"> <div class="modal hide b-folder-clear-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div> <div>
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button> <button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups"> <div class="popups">
<div class="modal hide b-folder-create-content" data-bind="modal: modalVisibility"> <div class="modal hide b-folder-create-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div> <div>
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button> <button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups"> <div class="popups">
<div class="modal hide b-folder-system-content" data-bind="modal: modalVisibility"> <div class="modal hide b-folder-system-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button> <button type="button" class="close" data-bind="command: cancelCommand">&times;</button>
<h3> <h3>

View file

@ -1,5 +1,5 @@
<div class="popups"> <div class="popups">
<div class="modal hide b-identity-content" data-bind="modal: modalVisibility"> <div class="modal hide b-identity-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div> <div>
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button> <button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "Versandt"
FORWARD_MESSAGE_TOP_SUBJECT = "Thema" FORWARD_MESSAGE_TOP_SUBJECT = "Thema"
EMPTY_TO_ERROR_DESC = "Geben Sie bitte mindestens einen Empfänger an" EMPTY_TO_ERROR_DESC = "Geben Sie bitte mindestens einen Empfänger an"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language" TITLE_LANGUAGES = "Choose language"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "Sent"
FORWARD_MESSAGE_TOP_SUBJECT = "Subject" FORWARD_MESSAGE_TOP_SUBJECT = "Subject"
EMPTY_TO_ERROR_DESC = "Please specify at least one recipient" EMPTY_TO_ERROR_DESC = "Please specify at least one recipient"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language" TITLE_LANGUAGES = "Choose language"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "Enviado"
FORWARD_MESSAGE_TOP_SUBJECT = "Asunto" FORWARD_MESSAGE_TOP_SUBJECT = "Asunto"
EMPTY_TO_ERROR_DESC = "Por favor especifique al menos un destinatario" EMPTY_TO_ERROR_DESC = "Por favor especifique al menos un destinatario"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language" TITLE_LANGUAGES = "Choose language"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "Envoyé"
FORWARD_MESSAGE_TOP_SUBJECT = "Sujet" FORWARD_MESSAGE_TOP_SUBJECT = "Sujet"
EMPTY_TO_ERROR_DESC = "S'il vous plaît spécifier au moins un destinataire" EMPTY_TO_ERROR_DESC = "S'il vous plaît spécifier au moins un destinataire"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choisir la langue" TITLE_LANGUAGES = "Choisir la langue"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "Sent"
FORWARD_MESSAGE_TOP_SUBJECT = "Viðfangsefni" FORWARD_MESSAGE_TOP_SUBJECT = "Viðfangsefni"
EMPTY_TO_ERROR_DESC = "Vinsamlegast taktu fram að minnsta kosti einn viðtakanda" EMPTY_TO_ERROR_DESC = "Vinsamlegast taktu fram að minnsta kosti einn viðtakanda"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language" TITLE_LANGUAGES = "Choose language"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "보냄"
FORWARD_MESSAGE_TOP_SUBJECT = "제목" FORWARD_MESSAGE_TOP_SUBJECT = "제목"
EMPTY_TO_ERROR_DESC = "수신인을 한 명 이상 선택하세요" EMPTY_TO_ERROR_DESC = "수신인을 한 명 이상 선택하세요"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "사용할 언어를 선택하세요" TITLE_LANGUAGES = "사용할 언어를 선택하세요"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "Nosūtīts"
FORWARD_MESSAGE_TOP_SUBJECT = "Tēma" FORWARD_MESSAGE_TOP_SUBJECT = "Tēma"
EMPTY_TO_ERROR_DESC = "Pievienojat vismaz vienu saņēmēju" EMPTY_TO_ERROR_DESC = "Pievienojat vismaz vienu saņēmēju"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language" TITLE_LANGUAGES = "Choose language"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "Verzonden"
FORWARD_MESSAGE_TOP_SUBJECT = "Onderwerp" FORWARD_MESSAGE_TOP_SUBJECT = "Onderwerp"
EMPTY_TO_ERROR_DESC = "Gelieve minstens 1 ontvanger aan te duiden" EMPTY_TO_ERROR_DESC = "Gelieve minstens 1 ontvanger aan te duiden"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Kies uw taal" TITLE_LANGUAGES = "Kies uw taal"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "Wysłany"
FORWARD_MESSAGE_TOP_SUBJECT = "Temat" FORWARD_MESSAGE_TOP_SUBJECT = "Temat"
EMPTY_TO_ERROR_DESC = "Wprowadź co najmniej jednego odbiorcę" EMPTY_TO_ERROR_DESC = "Wprowadź co najmniej jednego odbiorcę"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language" TITLE_LANGUAGES = "Choose language"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "Enviar"
FORWARD_MESSAGE_TOP_SUBJECT = "Assunto" FORWARD_MESSAGE_TOP_SUBJECT = "Assunto"
EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário" EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language" TITLE_LANGUAGES = "Choose language"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "Enviar"
FORWARD_MESSAGE_TOP_SUBJECT = "Assunto" FORWARD_MESSAGE_TOP_SUBJECT = "Assunto"
EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário" EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language" TITLE_LANGUAGES = "Choose language"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "Отправлено"
FORWARD_MESSAGE_TOP_SUBJECT = "Тема" FORWARD_MESSAGE_TOP_SUBJECT = "Тема"
EMPTY_TO_ERROR_DESC = "Укажите как минимум одного получателя" EMPTY_TO_ERROR_DESC = "Укажите как минимум одного получателя"
[POPUPS_ASK]
BUTTON_YES = "Да"
BUTTON_NO = "Нет"
DESC_WANT_CLOSE_THIS_WINDOW = "Вы уверены, что хотите закрыть это окно?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Выберите язык" TITLE_LANGUAGES = "Выберите язык"

View file

@ -171,6 +171,11 @@ FORWARD_MESSAGE_TOP_SENT = "发送"
FORWARD_MESSAGE_TOP_SUBJECT = "主题" FORWARD_MESSAGE_TOP_SUBJECT = "主题"
EMPTY_TO_ERROR_DESC = "请至少选择一位接收人" EMPTY_TO_ERROR_DESC = "请至少选择一位接收人"
[POPUPS_ASK]
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
[POPUPS_LANGUAGES] [POPUPS_LANGUAGES]
TITLE_LANGUAGES = "选择语言" TITLE_LANGUAGES = "选择语言"

View file

@ -5647,11 +5647,6 @@ html.no-rgba .modal {
.inputosaurus-container li.inputosaurus-selected { .inputosaurus-container li.inputosaurus-selected {
background-color: #ddd; background-color: #ddd;
} }
.inputosaurus-container .inputosaurus-fake-span {
position: absolute;
top: 0;
left: -5000px;
}
.inputosaurus-container .inputosaurus-input { .inputosaurus-container .inputosaurus-input {
margin: 1px 10px 1px 0px; margin: 1px 10px 1px 0px;
height: 22px; height: 22px;
@ -5664,6 +5659,11 @@ html.no-rgba .modal {
.ui-autocomplete { .ui-autocomplete {
z-index: 2000; z-index: 2000;
} }
.inputosaurus-fake-span {
position: absolute;
top: 0;
left: -5000px;
}
.g-ui-user-select-none { .g-ui-user-select-none {
-webkit-user-select: none; -webkit-user-select: none;
-khtml-user-select: none; -khtml-user-select: none;
@ -6132,6 +6132,18 @@ html.rl-no-preview-pane #rl-right .ui-resizable-handle {
.b-login-content .flag-selector { .b-login-content .flag-selector {
margin-bottom: 0; margin-bottom: 0;
} }
.popups .b-ask-content.modal {
z-index: 10000;
}
.popups .b-ask-content .modal-header {
background-color: #fff;
}
.popups .b-ask-content .modal-body {
text-align: center;
}
.popups .b-ask-content .desc-place {
font-size: 18px;
}
.b-folders .b-toolbar { .b-folders .b-toolbar {
position: absolute; position: absolute;
top: 0; top: 0;
@ -8410,3 +8422,10 @@ html.rl-message-fullscreen .messageView .b-content .buttonFull {
.editorFontStylePicker .editorFpFonts .editorFpFont { .editorFontStylePicker .editorFpFonts .editorFpFont {
padding: 5px; padding: 5px;
} }
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"] {
height: 20px;
line-height: 21px;
}

File diff suppressed because one or more lines are too long

View file

@ -3492,11 +3492,6 @@ html.no-rgba .modal {
.inputosaurus-container li.inputosaurus-selected { .inputosaurus-container li.inputosaurus-selected {
background-color: #ddd; background-color: #ddd;
} }
.inputosaurus-container .inputosaurus-fake-span {
position: absolute;
top: 0;
left: -5000px;
}
.inputosaurus-container .inputosaurus-input { .inputosaurus-container .inputosaurus-input {
margin: 1px 10px 1px 0px; margin: 1px 10px 1px 0px;
height: 22px; height: 22px;
@ -3509,6 +3504,11 @@ html.no-rgba .modal {
.ui-autocomplete { .ui-autocomplete {
z-index: 2000; z-index: 2000;
} }
.inputosaurus-fake-span {
position: absolute;
top: 0;
left: -5000px;
}
.g-ui-user-select-none { .g-ui-user-select-none {
-webkit-user-select: none; -webkit-user-select: none;
-khtml-user-select: none; -khtml-user-select: none;
@ -3977,6 +3977,18 @@ html.rl-no-preview-pane #rl-right .ui-resizable-handle {
.b-login-content .flag-selector { .b-login-content .flag-selector {
margin-bottom: 0; margin-bottom: 0;
} }
.popups .b-ask-content.modal {
z-index: 10000;
}
.popups .b-ask-content .modal-header {
background-color: #fff;
}
.popups .b-ask-content .modal-body {
text-align: center;
}
.popups .b-ask-content .desc-place {
font-size: 18px;
}
.b-folders .b-toolbar { .b-folders .b-toolbar {
position: absolute; position: absolute;
top: 0; top: 0;
@ -6255,3 +6267,10 @@ html.rl-message-fullscreen .messageView .b-content .buttonFull {
.editorFontStylePicker .editorFpFonts .editorFpFont { .editorFontStylePicker .editorFpFonts .editorFpFont {
padding: 5px; padding: 5px;
} }
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"] {
height: 20px;
line-height: 21px;
}

View file

@ -372,6 +372,7 @@ Enums.ClientSideKeyName = {
*/ */
Enums.EventKeyCode = { Enums.EventKeyCode = {
'Backspace': 8, 'Backspace': 8,
'Tab': 9,
'Enter': 13, 'Enter': 13,
'Esc': 27, 'Esc': 27,
'PageUp': 33, 'PageUp': 33,
@ -4641,6 +4642,20 @@ PopupsDomainViewModel.prototype.onShow = function (oDomain)
} }
}; };
PopupsDomainViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};
PopupsDomainViewModel.prototype.clearForm = function () PopupsDomainViewModel.prototype.clearForm = function ()
{ {
this.edit(false); this.edit(false);
@ -4773,6 +4788,31 @@ PopupsPluginViewModel.prototype.onShow = function (oPlugin)
} }
}; };
PopupsPluginViewModel.prototype.tryToClosePopup = function ()
{
var self = this;
kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'), function () {
if (self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
}
}]);
};
PopupsPluginViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
self.tryToClosePopup();
bResult = false;
}
return bResult;
});
};
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -4937,12 +4977,141 @@ PopupsLanguagesViewModel.prototype.onHide = function ()
this.exp(false); this.exp(false);
}; };
PopupsLanguagesViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};
PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang) PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
{ {
RL.data().mainLanguage(sLang); RL.data().mainLanguage(sLang);
this.cancelCommand(); this.cancelCommand();
}; };
/**
* @constructor
* @extends KnoinAbstractViewModel
*/
function PopupsAskViewModel()
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAsk');
this.askDesc = ko.observable('');
this.yesButton = ko.observable('');
this.noButton = ko.observable('');
this.yesFocus = ko.observable(false);
this.noFocus = ko.observable(false);
this.fYesAction = null;
this.fNoAction = null;
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsAskViewModel', PopupsAskViewModel);
PopupsAskViewModel.prototype.clearPopup = function ()
{
this.askDesc('');
this.yesButton(Utils.i18n('POPUPS_ASK/BUTTON_YES'));
this.noButton(Utils.i18n('POPUPS_ASK/BUTTON_NO'));
this.yesFocus(false);
this.noFocus(false);
this.fYesAction = null;
this.fNoAction = null;
};
PopupsAskViewModel.prototype.yesClick = function ()
{
if (Utils.isFunc(this.fYesAction))
{
this.fYesAction.call(null);
}
this.cancelCommand();
};
PopupsAskViewModel.prototype.noClick = function ()
{
if (Utils.isFunc(this.fNoAction))
{
this.fNoAction.call(null);
}
this.cancelCommand();
};
/**
* @param {string} sAskDesc
* @param {Function=} fYesFunc
* @param {Function=} fNoFunc
* @param {string=} sYesButton
* @param {string=} sNoButton
*/
PopupsAskViewModel.prototype.onShow = function (sAskDesc, fYesFunc, fNoFunc, sYesButton, sNoButton)
{
this.clearPopup();
this.fYesAction = fYesFunc || null;
this.fNoAction = fNoFunc || null;
this.askDesc(sAskDesc || '');
if (sYesButton)
{
this.yesButton(sYesButton);
}
if (sYesButton)
{
this.yesButton(sNoButton);
}
this.yesFocus(true);
};
PopupsAskViewModel.prototype.onHide = function ()
{
};
PopupsAskViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && self.modalVisibility())
{
if (Enums.EventKeyCode.Tab === oEvent.keyCode || Enums.EventKeyCode.Right === oEvent.keyCode || Enums.EventKeyCode.Left === oEvent.keyCode)
{
if (self.yesFocus())
{
self.noFocus(true);
}
else
{
self.yesFocus(true);
}
bResult = false;
}
}
return bResult;
});
};
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -5772,8 +5941,27 @@ AdminPlugins.prototype.configurePlugin = function (oPlugin)
RL.remote().plugin(this.onPluginLoadRequest, oPlugin.name); RL.remote().plugin(this.onPluginLoadRequest, oPlugin.name);
}; };
AdminPlugins.prototype.onBuild = function () AdminPlugins.prototype.onBuild = function (oDom)
{ {
var self = this;
oDom
.on('click', '.e-item .configure-plugin-action', function () {
var oPlugin = ko.dataFor(this);
if (oPlugin)
{
self.configurePlugin(oPlugin);
}
})
.on('click', '.e-item .disable-plugin', function () {
var oPlugin = ko.dataFor(this);
if (oPlugin)
{
self.disablePlugin(oPlugin);
}
})
;
this.enabledPlugins.subscribe(function (bValue) { this.enabledPlugins.subscribe(function (bValue) {
RL.remote().saveAdminConfig(Utils.emptyFunction, { RL.remote().saveAdminConfig(Utils.emptyFunction, {
'EnabledPlugins': bValue ? '1' : '0' 'EnabledPlugins': bValue ? '1' : '0'
@ -7119,7 +7307,6 @@ AbstractApp.prototype.pub = function (sName, aArgs)
{ {
if (!Utils.isUnd(this.oSubs[sName])) if (!Utils.isUnd(this.oSubs[sName]))
{ {
window.console.log(sName);
_.each(this.oSubs[sName], function (aItem) { _.each(this.oSubs[sName], function (aItem) {
if (aItem[0]) if (aItem[0])
{ {

File diff suppressed because one or more lines are too long

View file

@ -372,6 +372,7 @@ Enums.ClientSideKeyName = {
*/ */
Enums.EventKeyCode = { Enums.EventKeyCode = {
'Backspace': 8, 'Backspace': 8,
'Tab': 9,
'Enter': 13, 'Enter': 13,
'Esc': 27, 'Esc': 27,
'PageUp': 33, 'PageUp': 33,
@ -7655,6 +7656,20 @@ PopupsFolderClearViewModel.prototype.onShow = function (oFolder)
} }
}; };
PopupsFolderClearViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -7761,6 +7776,20 @@ PopupsFolderCreateViewModel.prototype.onShow = function ()
this.focusTrigger(true); this.focusTrigger(true);
}; };
PopupsFolderCreateViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -7864,6 +7893,20 @@ PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType)
this.notification(sNotification); this.notification(sNotification);
}; };
PopupsFolderSystemViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};
/** /**
* @constructor * @constructor
@ -8666,6 +8709,17 @@ PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToE
this.triggerForResize(); this.triggerForResize();
}; };
PopupsComposeViewModel.prototype.tryToClosePopup = function ()
{
var self = this;
kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'), function () {
if (self.modalVisibility())
{
kn.delegateRun(self, 'closeCommand');
}
}]);
};
PopupsComposeViewModel.prototype.onBuild = function () PopupsComposeViewModel.prototype.onBuild = function ()
{ {
this.initEditor(); this.initEditor();
@ -8691,6 +8745,11 @@ PopupsComposeViewModel.prototype.onBuild = function ()
self.sendCommand(); self.sendCommand();
bResult = false; bResult = false;
} }
else if (Enums.EventKeyCode.Esc === oEvent.keyCode)
{
self.tryToClosePopup();
bResult = false;
}
} }
return bResult; return bResult;
@ -9711,6 +9770,17 @@ PopupsContactsViewModel.prototype.onBuild = function (oDom)
} }
}) })
; ;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'closeCommand');
bResult = false;
}
return bResult;
});
}; };
PopupsContactsViewModel.prototype.onShow = function () PopupsContactsViewModel.prototype.onShow = function ()
@ -9837,6 +9907,20 @@ PopupsAdvancedSearchViewModel.prototype.onShow = function ()
this.fromFocus(true); this.fromFocus(true);
}; };
PopupsAdvancedSearchViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -9945,10 +10029,20 @@ PopupsAddAccountViewModel.prototype.onShow = function ()
this.emailFocus(true); this.emailFocus(true);
}; };
PopupsAddAccountViewModel.prototype.onBuild = function () PopupsAddAccountViewModel.prototype.onBuild = function ()
{ {
this.allowCustomLogin(!!RL.settingsGet('AllowCustomLogin')); this.allowCustomLogin(!!RL.settingsGet('AllowCustomLogin'));
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
}; };
/** /**
@ -10071,7 +10165,6 @@ PopupsIdentityViewModel.prototype.clearPopup = function ()
}; };
/** /**
*
* @param {?IdentityModel} oIdentity * @param {?IdentityModel} oIdentity
*/ */
PopupsIdentityViewModel.prototype.onShow = function (oIdentity) PopupsIdentityViewModel.prototype.onShow = function (oIdentity)
@ -10097,6 +10190,20 @@ PopupsIdentityViewModel.prototype.onShow = function (oIdentity)
} }
}; };
PopupsIdentityViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -10151,12 +10258,141 @@ PopupsLanguagesViewModel.prototype.onHide = function ()
this.exp(false); this.exp(false);
}; };
PopupsLanguagesViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
{
kn.delegateRun(self, 'cancelCommand');
bResult = false;
}
return bResult;
});
};
PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang) PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
{ {
RL.data().mainLanguage(sLang); RL.data().mainLanguage(sLang);
this.cancelCommand(); this.cancelCommand();
}; };
/**
* @constructor
* @extends KnoinAbstractViewModel
*/
function PopupsAskViewModel()
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAsk');
this.askDesc = ko.observable('');
this.yesButton = ko.observable('');
this.noButton = ko.observable('');
this.yesFocus = ko.observable(false);
this.noFocus = ko.observable(false);
this.fYesAction = null;
this.fNoAction = null;
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsAskViewModel', PopupsAskViewModel);
PopupsAskViewModel.prototype.clearPopup = function ()
{
this.askDesc('');
this.yesButton(Utils.i18n('POPUPS_ASK/BUTTON_YES'));
this.noButton(Utils.i18n('POPUPS_ASK/BUTTON_NO'));
this.yesFocus(false);
this.noFocus(false);
this.fYesAction = null;
this.fNoAction = null;
};
PopupsAskViewModel.prototype.yesClick = function ()
{
if (Utils.isFunc(this.fYesAction))
{
this.fYesAction.call(null);
}
this.cancelCommand();
};
PopupsAskViewModel.prototype.noClick = function ()
{
if (Utils.isFunc(this.fNoAction))
{
this.fNoAction.call(null);
}
this.cancelCommand();
};
/**
* @param {string} sAskDesc
* @param {Function=} fYesFunc
* @param {Function=} fNoFunc
* @param {string=} sYesButton
* @param {string=} sNoButton
*/
PopupsAskViewModel.prototype.onShow = function (sAskDesc, fYesFunc, fNoFunc, sYesButton, sNoButton)
{
this.clearPopup();
this.fYesAction = fYesFunc || null;
this.fNoAction = fNoFunc || null;
this.askDesc(sAskDesc || '');
if (sYesButton)
{
this.yesButton(sYesButton);
}
if (sYesButton)
{
this.yesButton(sNoButton);
}
this.yesFocus(true);
};
PopupsAskViewModel.prototype.onHide = function ()
{
};
PopupsAskViewModel.prototype.onBuild = function ()
{
var self = this;
$window.on('keydown', function (oEvent) {
var bResult = true;
if (oEvent && self.modalVisibility())
{
if (Enums.EventKeyCode.Tab === oEvent.keyCode || Enums.EventKeyCode.Right === oEvent.keyCode || Enums.EventKeyCode.Left === oEvent.keyCode)
{
if (self.yesFocus())
{
self.noFocus(true);
}
else
{
self.yesFocus(true);
}
bResult = false;
}
}
return bResult;
});
};
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -15742,7 +15978,6 @@ AbstractApp.prototype.pub = function (sName, aArgs)
{ {
if (!Utils.isUnd(this.oSubs[sName])) if (!Utils.isUnd(this.oSubs[sName]))
{ {
window.console.log(sName);
_.each(this.oSubs[sName], function (aItem) { _.each(this.oSubs[sName], function (aItem) {
if (aItem[0]) if (aItem[0])
{ {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -23,6 +23,8 @@
version: "0.1.6", version: "0.1.6",
fakeSpan: $('<span class="inputosaurus-fake-span"></span>'),
eventprefix: "inputosaurus", eventprefix: "inputosaurus",
options: { options: {
@ -72,7 +74,6 @@
// Create the elements // Create the elements
els.ul = $('<ul class="inputosaurus-container"></ul>'); els.ul = $('<ul class="inputosaurus-container"></ul>');
els.fakeSpan = $('<span class="inputosaurus-fake-span"></span>');
els.input = $('<input type="email" />'); els.input = $('<input type="email" />');
els.inputCont = $('<li class="inputosaurus-input inputosaurus-required"></li>'); els.inputCont = $('<li class="inputosaurus-input inputosaurus-required"></li>');
els.origInputCont = $('<li class="inputosaurus-input-hidden inputosaurus-required"></li>'); els.origInputCont = $('<li class="inputosaurus-input-hidden inputosaurus-required"></li>');
@ -94,7 +95,6 @@
els.inputCont.append(els.input); els.inputCont.append(els.input);
els.ul.append(els.inputCont); els.ul.append(els.inputCont);
els.ul.append(els.origInputCont); els.ul.append(els.origInputCont);
els.ul.append(els.fakeSpan);
o.width && els.ul.css('width', o.width); o.width && els.ul.css('width', o.width);
@ -235,13 +235,17 @@
} }
}, },
resizeInput : function () {
this._resizeInput();
},
// the input dynamically resizes based on the length of its value // the input dynamically resizes based on the length of its value
_resizeInput : function(ev) { _resizeInput : function(ev) {
var widget = (ev && ev.data.widget) || this; var widget = (ev && ev.data.widget) || this;
widget.elements.fakeSpan.text(widget.elements.input.val()); inputosaurustext.fakeSpan.text(widget.elements.input.val());
// window.setTimeout(function () { // window.setTimeout(function () {
var txtWidth = 25 + widget.elements.fakeSpan.width(); var txtWidth = 25 + inputosaurustext.fakeSpan.width();
txtWidth = txtWidth > 50 ? txtWidth : 50; txtWidth = txtWidth > 50 ? txtWidth : 50;
txtWidth = txtWidth < 500 ? txtWidth : 500; txtWidth = txtWidth < 500 ? txtWidth : 500;
widget.elements.input.width(txtWidth); widget.elements.input.width(txtWidth);
@ -577,6 +581,8 @@
} }
}; };
$('body').append(inputosaurustext.fakeSpan);
$.widget("ui.inputosaurus", inputosaurustext); $.widget("ui.inputosaurus", inputosaurustext);
})(jQuery); })(jQuery);

File diff suppressed because one or more lines are too long