diff --git a/Gruntfile.js b/Gruntfile.js index 271b65b81..b61446030 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -314,7 +314,6 @@ module.exports = function (grunt) { "vendors/jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.css", "vendors/normalize/normalize.css", "vendors/fontastic/styles.css", - "rainloop/v/0.0.0/static/css/styles.css", "vendors/jquery-nanoscroller/nanoscroller.css", "vendors/jquery-magnific-popup/magnific-popup.css", "vendors/jquery-magnific-popup/magnific-popup-animations.css", diff --git a/dev/Boots/RainLoopApp.js b/dev/Boots/RainLoopApp.js index f7f20434e..f4ceede34 100644 --- a/dev/Boots/RainLoopApp.js +++ b/dev/Boots/RainLoopApp.js @@ -14,6 +14,30 @@ function RainLoopApp() this.quotaDebounce = _.debounce(this.quota, 1000 * 30); + window.setInterval(function () { + RL.pub('interval.30s'); + }, 30000); + + window.setInterval(function () { + RL.pub('interval.1m'); + }, 60000); + + window.setInterval(function () { + RL.pub('interval.2m'); + }, 60000 * 2); + + window.setInterval(function () { + RL.pub('interval.3m'); + }, 60000 * 3); + + window.setInterval(function () { + RL.pub('interval.5m'); + }, 60000 * 5); + + window.setInterval(function () { + RL.pub('interval.10m'); + }, 60000 * 10); + $.wakeUp(function () { RL.remote().jsVersion(function (sResult, oData) { if (Enums.StorageResultType.Success === sResult && oData && !oData.Result) @@ -690,6 +714,14 @@ RainLoopApp.prototype.bootstart = function () }); }, 1000); + RL.sub('interval.5m', function () { + RL.quota(); + }); + + RL.sub('interval.2m', function () { + RL.folderInformation('INBOX'); + }); + Plugins.runHook('rl-start-user-screens'); } else @@ -764,6 +796,10 @@ RainLoopApp.prototype.bootstart = function () }; } + RL.sub('interval.1m', function () { + Globals.momentTrigger(!Globals.momentTrigger()); + }); + Plugins.runHook('rl-start-screens'); }; diff --git a/dev/Common/Globals.js b/dev/Common/Globals.js index 797e09beb..b3c568574 100644 --- a/dev/Common/Globals.js +++ b/dev/Common/Globals.js @@ -8,17 +8,12 @@ Globals.now = (new Date()).getTime(); /** * @type {?} */ -Globals.minuteTick = ko.observable(true); +Globals.momentTrigger = ko.observable(true); /** * @type {?} */ -Globals.fiveMinuteTick = ko.observable(true); - -/** - * @type {?} - */ -Globals.langChangeTick = ko.observable(true); +Globals.langChangeTrigger = ko.observable(true); /** * @type {number} diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js index ec7f20828..f3bba391f 100644 --- a/dev/Common/Utils.js +++ b/dev/Common/Utils.js @@ -348,7 +348,7 @@ Utils.i18nToDoc = function () I18n = window.rainloopI18N || {}; Utils.i18nToNode($document); - Globals.langChangeTick(!Globals.langChangeTick()); + Globals.langChangeTrigger(!Globals.langChangeTrigger()); } window.rainloopI18N = {}; @@ -368,7 +368,7 @@ Utils.initOnStartOrLangChange = function (fCallback, oScope, fLangCallback) if (fLangCallback) { - Globals.langChangeTick.subscribe(function () { + Globals.langChangeTrigger.subscribe(function () { if (fCallback) { fCallback.call(oScope); @@ -379,7 +379,7 @@ Utils.initOnStartOrLangChange = function (fCallback, oScope, fLangCallback) } else if (fCallback) { - Globals.langChangeTick.subscribe(fCallback, oScope); + Globals.langChangeTrigger.subscribe(fCallback, oScope); } }; @@ -934,8 +934,13 @@ Utils.initDataConstructorBySettings = function (oData) */ Utils.createMomentDate = function (oObject) { + if (Utils.isUnd(oObject.moment)) + { + oObject.moment = ko.observable(moment()); + } + return ko.computed(function () { - Globals.minuteTick(); + Globals.momentTrigger(); return this.moment().fromNow(); }, oObject); }; diff --git a/dev/Common/_End.js b/dev/Common/_End.js index fec51d72a..6459920d9 100644 --- a/dev/Common/_End.js +++ b/dev/Common/_End.js @@ -27,14 +27,6 @@ window['__RLBOOT'] = function (fCall) { if (window['rainloopTEMPLATES'] && window['rainloopTEMPLATES'][0]) { $('#rl-templates').html(window['rainloopTEMPLATES'][0]); - - window.setInterval(function () { - Globals.minuteTick(!Globals.minuteTick()); - }, 1000 * 60); - - window.setInterval(function () { - Globals.fiveMinuteTick(!Globals.fiveMinuteTick()); - }, 1000 * 60 * 5); _.delay(function () { window['rainloopAppData'] = {}; diff --git a/dev/Models/ContactPropertyModel.js b/dev/Models/ContactPropertyModel.js index f55f6eca5..8d2496af3 100644 --- a/dev/Models/ContactPropertyModel.js +++ b/dev/Models/ContactPropertyModel.js @@ -3,12 +3,13 @@ /** * @param {number=} iType = Enums.ContactPropertyType.Unknown * @param {string=} sValue = '' + * @param {boolean=} bFocused = false * * @constructor */ -function ContactPropertyModel(iType, sValue) +function ContactPropertyModel(iType, sValue, bFocused) { this.type = ko.observable(Utils.isUnd(iType) ? Enums.ContactPropertyType.Unknown : iType); - this.focused = ko.observable(false); + this.focused = ko.observable(Utils.isUnd(bFocused) ? false : !!bFocused); this.value = ko.observable(Utils.pString(sValue)); } diff --git a/dev/Models/FolderModel.js b/dev/Models/FolderModel.js index 84aed087d..d9a9f6b4b 100644 --- a/dev/Models/FolderModel.js +++ b/dev/Models/FolderModel.js @@ -168,7 +168,7 @@ FolderModel.prototype.initComputed = function () this.localName = ko.computed(function () { - Globals.langChangeTick(); + Globals.langChangeTrigger(); var iType = this.type(), @@ -203,7 +203,7 @@ FolderModel.prototype.initComputed = function () this.manageFolderSystemName = ko.computed(function () { - Globals.langChangeTick(); + Globals.langChangeTrigger(); var sSuffix = '', diff --git a/dev/Screens/MailBox.js b/dev/Screens/MailBox.js index 9f27d8a3f..0aabbacf0 100644 --- a/dev/Screens/MailBox.js +++ b/dev/Screens/MailBox.js @@ -83,10 +83,6 @@ MailBoxScreen.prototype.onStart = function () RL.accountsAndIdentities(); } - _.delay(function () { - RL.quota(); - }, 1000 * 5); - _.delay(function () { if ('INBOX' !== oData.currentFolderFullNameRaw()) { @@ -111,16 +107,12 @@ MailBoxScreen.prototype.onStart = function () }, 2000); _.delay(function () { - RL.remote().appDelayStart(Utils.emptyFunction); - }, 1000 * 35); - - window.setInterval(function () { - RL.folderInformation('INBOX'); - }, 1000 * 60 * 2); - - window.setInterval(function () { RL.quota(); - }, 1000 * 60 * 5); + }, 5000); + + _.delay(function () { + RL.remote().appDelayStart(Utils.emptyFunction); + }, 35000); $html.toggleClass('rl-no-preview-pane', !oData.usePreviewPane()); diff --git a/dev/Styles/Contacts.less b/dev/Styles/Contacts.less index 08e50cbe9..0561c572e 100644 --- a/dev/Styles/Contacts.less +++ b/dev/Styles/Contacts.less @@ -3,6 +3,15 @@ .b-contacts-content { + .control-group { + .control-label.fix-width { + width: 110px; + } + .controls.fix-width { + margin-left: 135px; + } + } + &.modal { position: absolute; diff --git a/dev/Styles/_BootstrapFix.less b/dev/Styles/_BootstrapFix.less index 00c935e52..868cbbb9d 100644 --- a/dev/Styles/_BootstrapFix.less +++ b/dev/Styles/_BootstrapFix.less @@ -232,3 +232,7 @@ html.no-rgba .modal { .picker.modal-dialog, .picker.picker-dialog { z-index: 2001 !important; } + +.control-label.remove-padding-top { + padding-top: 0; +} diff --git a/dev/Styles/_FontasticToBoot.less b/dev/Styles/_FontasticToBoot.less index c2f22455f..b06ca518a 100644 --- a/dev/Styles/_FontasticToBoot.less +++ b/dev/Styles/_FontasticToBoot.less @@ -9,13 +9,18 @@ vertical-align: text-top; } -.icon-folder, .icon-folder-add, .icon-address-book, .icon-list { +.icon-folder, .icon-folder-add, .icon-list { line-height: 18px; font-size: 18px; margin-top: -2px; margin-left: -2px; } +.iconsize24 { + line-height: 24px; + font-size: 24px; +} + /* White icons with optional class, or on hover/active states of certain elements */ .icon-white, .nav > .active > a > [class^="icon-"], diff --git a/dev/ViewModels/PopupsComposeViewModel.js b/dev/ViewModels/PopupsComposeViewModel.js index 00d1bd79d..6308ce763 100644 --- a/dev/ViewModels/PopupsComposeViewModel.js +++ b/dev/ViewModels/PopupsComposeViewModel.js @@ -335,7 +335,7 @@ function PopupsComposeViewModel() }, this.canBeSendedOrSaved); - Globals.minuteTick.subscribe(function () { + RL.sub('interval.1m', function () { if (this.modalVisibility() && !RL.data().draftFolderNotEnabled() && !this.isEmptyForm(false) && !this.saving() && !this.sending() && !this.savedError()) { diff --git a/dev/ViewModels/PopupsContactsViewModel.js b/dev/ViewModels/PopupsContactsViewModel.js index 019b49f79..7a2291df5 100644 --- a/dev/ViewModels/PopupsContactsViewModel.js +++ b/dev/ViewModels/PopupsContactsViewModel.js @@ -9,13 +9,17 @@ function PopupsContactsViewModel() KnoinAbstractViewModel.call(this, 'Popups', 'PopupsContacts'); var + oT = Enums.ContactPropertyType, self = this, - aNameTypes = [Enums.ContactPropertyType.FullName, Enums.ContactPropertyType.FirstName, Enums.ContactPropertyType.SurName, Enums.ContactPropertyType.MiddleName], - aEmailTypes = [Enums.ContactPropertyType.EmailPersonal, Enums.ContactPropertyType.EmailBussines, Enums.ContactPropertyType.EmailOther], + aNameTypes = [oT.FullName, oT.FirstName, oT.SurName, oT.MiddleName], + aEmailTypes = [oT.EmailPersonal, oT.EmailBussines, oT.EmailOther], aPhonesTypes = [ - Enums.ContactPropertyType.PhonePersonal, Enums.ContactPropertyType.PhoneBussines, Enums.ContactPropertyType.PhoneOther, - Enums.ContactPropertyType.MobilePersonal, Enums.ContactPropertyType.MobileBussines, Enums.ContactPropertyType.MobileOther, - Enums.ContactPropertyType.FaxPesonal, Enums.ContactPropertyType.FaxBussines, Enums.ContactPropertyType.FaxOther + oT.PhonePersonal, oT.PhoneBussines, oT.PhoneOther, + oT.MobilePersonal, oT.MobileBussines, oT.MobileOther, + oT.FaxPesonal, oT.FaxBussines, oT.FaxOther + ], + aOtherTypes = [ + oT.Facebook, oT.Skype, oT.GitHub ], fFastClearEmptyListHelper = function (aList) { if (aList && 0 < aList.length) { @@ -69,6 +73,10 @@ function PopupsContactsViewModel() return -1 < Utils.inArray(oProperty.type(), aPhonesTypes); }); + this.viewPropertiesOther = this.viewProperties.filter(function(oProperty) { + return -1 < Utils.inArray(oProperty.type(), aOtherTypes); + }); + this.viewPropertiesEmailsEmptyAndOnFocused = this.viewPropertiesEmails.filter(function(oProperty) { var bF = oProperty.focused(); return '' === Utils.trim(oProperty.value()) && !bF; @@ -126,10 +134,6 @@ function PopupsContactsViewModel() }); }, this); - this.newCommand = Utils.createCommand(this, function () { - this.populateViewContact(null); - }); - this.selector = new Selector(this.contacts, this.currentContact, '.e-contact-item .actionHandle', '.e-contact-item.selected', '.e-contact-item .checkboxItem'); @@ -152,6 +156,7 @@ function PopupsContactsViewModel() this.deleteCommand = Utils.createCommand(this, function () { this.deleteSelectedContacts(); + this.emptySelection(true); }, function () { return 0 < this.contactsCheckedOrSelected().length; }); @@ -242,18 +247,22 @@ function PopupsContactsViewModel() Utils.extendAsViewModel('PopupsContactsViewModel', PopupsContactsViewModel); -PopupsContactsViewModel.prototype.addNewEmail = function () + +PopupsContactsViewModel.prototype.addNewProperty = function (sType) { - var oItem = new ContactPropertyModel(Enums.ContactPropertyType.EmailPersonal, ''); + var oItem = new ContactPropertyModel(sType, ''); oItem.focused(true); this.viewProperties.push(oItem); }; +PopupsContactsViewModel.prototype.addNewEmail = function () +{ + this.addNewProperty(Enums.ContactPropertyType.EmailPersonal); +}; + PopupsContactsViewModel.prototype.addNewPhone = function () { - var oItem = new ContactPropertyModel(Enums.ContactPropertyType.PhonePersonal, ''); - oItem.focused(true); - this.viewProperties.push(oItem); + this.addNewProperty(Enums.ContactPropertyType.PhonePersonal); }; PopupsContactsViewModel.prototype.removeCheckedOrSelectedContactsFromList = function () @@ -367,7 +376,7 @@ PopupsContactsViewModel.prototype.populateViewContact = function (oContact) if (!bHasName) { - aList.push(new ContactPropertyModel(Enums.ContactPropertyType.FullName, '')); + aList.push(new ContactPropertyModel(Enums.ContactPropertyType.FullName, '', true)); } this.viewID(sId); diff --git a/rainloop/v/0.0.0/app/templates/Views/PopupsContacts.html b/rainloop/v/0.0.0/app/templates/Views/PopupsContacts.html index 415d24603..7418a627a 100644 --- a/rainloop/v/0.0.0/app/templates/Views/PopupsContacts.html +++ b/rainloop/v/0.0.0/app/templates/Views/PopupsContacts.html @@ -92,43 +92,53 @@
-