From 726fa6982b371aad7c3c837b9c30b98ef7b42b35 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Thu, 21 Nov 2013 02:00:30 +0400 Subject: [PATCH] Fix js error (TypeError: Cannot call method 'settingsGet' of undefined) + small other fixes --- dev/Admin/General.js | 14 ----- dev/Boots/AbstractApp.js | 15 ++--- dev/Boots/AdminApp.js | 6 +- dev/Boots/RainLoopApp.js | 22 ++++---- dev/Common/_End.js | 18 +++--- package.json | 2 +- .../0.0.0/app/libraries/RainLoop/Actions.php | 2 +- .../0.0.0/app/libraries/RainLoop/Service.php | 14 ++--- rainloop/v/0.0.0/static/js/admin.js | 53 ++++++------------ rainloop/v/0.0.0/static/js/admin.min.js | 6 +- rainloop/v/0.0.0/static/js/app.js | 55 +++++++++---------- rainloop/v/0.0.0/static/js/app.min.js | 4 +- 12 files changed, 87 insertions(+), 124 deletions(-) diff --git a/dev/Admin/General.js b/dev/Admin/General.js index 21c471c73..25f98659b 100644 --- a/dev/Admin/General.js +++ b/dev/Admin/General.js @@ -35,20 +35,6 @@ function AdminGeneral() return Utils.convertLangName(this.mainLanguage()); }, this); - this.languagesOptions = ko.computed(function () { - return _.map(oData.languages(), function (sLanguage) { - var - sName = Utils.convertLangName(sLanguage), - sEn = Utils.convertLangName(sLanguage, true) - ; - - return { - 'optValue': sLanguage, - 'optText': sName + (sEn !== sName ? ' (' + sEn + ')' : '') - }; - }); - }); - this.contactsSupported = RL.settingsGet('ContactsIsSupported'); this.contactsIsAllowed = RL.settingsGet('ContactsIsAllowed'); this.weakPassword = !!RL.settingsGet('WeakPassword'); diff --git a/dev/Boots/AbstractApp.js b/dev/Boots/AbstractApp.js index b726a4920..ca65d1ab7 100644 --- a/dev/Boots/AbstractApp.js +++ b/dev/Boots/AbstractApp.js @@ -143,15 +143,12 @@ AbstractApp.prototype.settingsSet = function (sName, mValue) AbstractApp.prototype.setTitle = function (sTitle) { sTitle = ((0 < sTitle.length) ? sTitle + ' - ' : '') + - this.settingsGet('Title') || ''; + RL.settingsGet('Title') || ''; - if (sTitle !== window.document.title) - { + window.document.title = sTitle; + _.delay(function () { window.document.title = sTitle; - _.delay(function () { - window.document.title = sTitle; - }, 5); - } + }, 5); }; /** @@ -161,8 +158,8 @@ AbstractApp.prototype.setTitle = function (sTitle) AbstractApp.prototype.loginAndLogoutReload = function (bLogout, bClose) { var - sCustomLogoutLink = Utils.pString(this.settingsGet('CustomLogoutLink')), - bInIframe = !!this.settingsGet('InIframe') + sCustomLogoutLink = Utils.pString(RL.settingsGet('CustomLogoutLink')), + bInIframe = !!RL.settingsGet('InIframe') ; bLogout = Utils.isUnd(bLogout) ? false : !!bLogout; diff --git a/dev/Boots/AdminApp.js b/dev/Boots/AdminApp.js index 9887ee974..d4930691a 100644 --- a/dev/Boots/AdminApp.js +++ b/dev/Boots/AdminApp.js @@ -200,7 +200,7 @@ AdminApp.prototype.bootstart = function () kn.hideLoading(); - if (!this.settingsGet('AllowAdminPanel')) + if (!RL.settingsGet('AllowAdminPanel')) { kn.routeOff(); kn.setHash(RL.link().root(), true); @@ -212,10 +212,10 @@ AdminApp.prototype.bootstart = function () } else { - if (!!this.settingsGet('Auth')) + if (!!RL.settingsGet('Auth')) { // TODO -// if (!this.settingsGet('AllowPackages') && AdminPackages) +// if (!RL.settingsGet('AllowPackages') && AdminPackages) // { // Utils.disableSettingsViewModel(AdminPackages); // } diff --git a/dev/Boots/RainLoopApp.js b/dev/Boots/RainLoopApp.js index a95f2f0b3..e5fe0eb98 100644 --- a/dev/Boots/RainLoopApp.js +++ b/dev/Boots/RainLoopApp.js @@ -19,7 +19,7 @@ function RainLoopApp() $.wakeUp(function (iSleepTime) { RL.remote().jsInfo(Utils.emptyFunction, { - 'Version': this.settingsGet('Version'), + 'Version': RL.settingsGet('Version'), 'WakeUpTime': Math.round(iSleepTime / 1000) }, true); }, {}, 60 * 60 * 1000); @@ -564,23 +564,23 @@ RainLoopApp.prototype.bootstart = function () var sCustomLoginLink = '', - sJsHash = this.settingsGet('JsHash'), - bGoogle = this.settingsGet('AllowGoogleSocial'), - bFacebook = this.settingsGet('AllowFacebookSocial'), - bTwitter = this.settingsGet('AllowTwitterSocial') + sJsHash = RL.settingsGet('JsHash'), + bGoogle = RL.settingsGet('AllowGoogleSocial'), + bFacebook = RL.settingsGet('AllowFacebookSocial'), + bTwitter = RL.settingsGet('AllowTwitterSocial') ; - if (!this.settingsGet('AllowChangePassword')) + if (!RL.settingsGet('AllowChangePassword')) { Utils.removeSettingsViewModel(SettingsChangePasswordScreen); } - if (!this.settingsGet('AllowAdditionalAccounts')) + if (!RL.settingsGet('AllowAdditionalAccounts')) { Utils.removeSettingsViewModel(SettingsAccounts); } - if (this.settingsGet('AllowIdentities')) + if (RL.settingsGet('AllowIdentities')) { Utils.removeSettingsViewModel(SettingsIdentity); } @@ -594,7 +594,7 @@ RainLoopApp.prototype.bootstart = function () Utils.removeSettingsViewModel(SettingsSocialScreen); } - if (!this.settingsGet('AllowThemes')) + if (!RL.settingsGet('AllowThemes')) { Utils.removeSettingsViewModel(SettingsThemes); } @@ -625,7 +625,7 @@ RainLoopApp.prototype.bootstart = function () window.SimplePace.sleep(); } - if (!!this.settingsGet('Auth')) + if (!!RL.settingsGet('Auth')) { this.setTitle(Utils.i18n('TITLES/LOADING')); @@ -699,7 +699,7 @@ RainLoopApp.prototype.bootstart = function () } else { - sCustomLoginLink = Utils.pString(this.settingsGet('CustomLoginLink')); + sCustomLoginLink = Utils.pString(RL.settingsGet('CustomLoginLink')); if (!sCustomLoginLink) { kn.hideLoading(); diff --git a/dev/Common/_End.js b/dev/Common/_End.js index dd63ed39d..fec51d72a 100644 --- a/dev/Common/_End.js +++ b/dev/Common/_End.js @@ -8,16 +8,16 @@ $window.unload(function () { }); // export -window.rl = window.rl || {}; -window.rl.addHook = Plugins.addHook; -window.rl.settingsGet = Plugins.mainSettingsGet; -window.rl.remoteRequest = Plugins.remoteRequest; -window.rl.pluginSettingsGet = Plugins.settingsGet; -window.rl.addSettingsViewModel = Utils.addSettingsViewModel; -window.rl.createCommand = Utils.createCommand; +window['rl'] = window['rl'] || {}; +window['rl']['addHook'] = Plugins.addHook; +window['rl']['settingsGet'] = Plugins.mainSettingsGet; +window['rl']['remoteRequest'] = Plugins.remoteRequest; +window['rl']['pluginSettingsGet'] = Plugins.settingsGet; +window['rl']['addSettingsViewModel'] = Utils.addSettingsViewModel; +window['rl']['createCommand'] = Utils.createCommand; -window.rl.EmailModel = EmailModel; -window.rl.Enums = Enums; +window['rl']['EmailModel'] = EmailModel; +window['rl']['Enums'] = Enums; window['__RLBOOT'] = function (fCall) { diff --git a/package.json b/package.json index 35ce088e4..7180cd550 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "RainLoop", "title": "RainLoop Webmail", "version": "1.4.1", - "release": "513", + "release": "516", "description": "Simple, modern & fast web-based email client", "homepage": "http://rainloop.net", "main": "Gruntfile.js", diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index 819a73ccf..48144d5c3 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -5183,7 +5183,7 @@ class Actions private function setupInformation() { $aResult = array( - 'hash' => \file_exists(APP_DATA_FOLDER_PATH.'HASH') ? @\file_get_contents(APP_DATA_FOLDER_PATH.'HASH') : '', + 'hash' => \file_exists(APP_DATA_FOLDER_PATH.'HASH') ? \md5(@\file_get_contents(APP_DATA_FOLDER_PATH.'HASH')) : '', 'version-full' => APP_VERSION, ); diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php index 69dfa4f6f..0b24e2f1a 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php @@ -143,12 +143,18 @@ class Service $aData = $this->startUpData($bAdmin); + $sAppHash = ''; + if (\file_exists(APP_DATA_FOLDER_PATH.'HASH')) + { + $sAppHash = md5(@\file_get_contents(APP_DATA_FOLDER_PATH.'HASH')); + } + $bCacheEnabled = $this->oActions->Config()->Get('labs', 'cache_system_data', true); $sCacheFileName = ''; if ($bCacheEnabled) { - $sCacheFileName = 'TMPL:'.$aData['Hash']; + $sCacheFileName = 'TMPL:'.$aData['Hash'].'/'.$sAppHash; $sResult = $this->oActions->Cacher()->Get($sCacheFileName); } @@ -178,12 +184,6 @@ class Service $bCached = true; } - $sAppHash = ''; - if (\file_exists(APP_DATA_FOLDER_PATH.'HASH')) - { - $sAppHash = @\file_get_contents(APP_DATA_FOLDER_PATH.'HASH'); - } - $sResult .= '