From ddb7643ff7d57dc4cef7c5cb34ff277b4090a303 Mon Sep 17 00:00:00 2001 From: Kathryn Norris Date: Fri, 10 Apr 2015 03:16:17 -0700 Subject: [PATCH 1/6] Updated the custom day start information in settings. (#5006) --- common/locales/en/settings.json | 5 ++++- website/public/js/controllers/settingsCtrl.js | 13 +++++++++++++ website/views/options/settings.jade | 12 +++++------- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/common/locales/en/settings.json b/common/locales/en/settings.json index db4bf0953e..c3f4646847 100644 --- a/common/locales/en/settings.json +++ b/common/locales/en/settings.json @@ -41,7 +41,10 @@ "json": "(JSON)", "customDayStart": "Custom Day Start", "24HrClock": "24Hr Clock", - "clockInfo": "HabitRPG defaults to check and reset your Dailies at midnight each day. You can customize that here (Enter number between 0 and 24).", + "customDayStartInfo1": "HabitRPG defaults to check and reset your Dailies at midnight each day. It is recommended that you read the following information before changing it: ", + "customDayStartInfo2": "(show info)", + "customDayStartInfo3": "(hide info)", + "customDayStartInfo4": "From the wiki:
The Custom Day Start is the time of day at which one day ends and the next day begins in the player's HabitRPG world; all tasks register the passage of a day. The default day start is midnight in the player's time zone, based on the time registered by the player's computer, but the time can be changed to suit the player's needs.

Enter an hour from 0 to 23 (it uses a 24 hour clock). It is best to type the new time instead of using the arrow buttons, which do not always work correctly. After you have entered the new time, click your mouse once anywhere on the page outside the field to move the cursor out of the text box or else your change won't be saved. If you want to be certain that your change has been saved, reload the page and check that the new value is being displayed.

Some people have trouble with Custom Day Start on the first day that they change it because changing it can cause Cron to run immediately, but after the first day it works well. To minimize problems on the first day, complete all your Dailies before changing the Custom Day Start or Rest in the Inn that day.

If you change the Custom Day Start from or to a time that is too close to the current time, then the new setting will not be used until the next day. It is best to allow a window of two hours for the change to take effect. For example, if it is currently set to 0 (midnight), change it before 10pm; if you want to set it to 9pm, change it before 7pm.", "misc": "Misc", "showHeader": "Show Header", "changePass": "Change Password", diff --git a/website/public/js/controllers/settingsCtrl.js b/website/public/js/controllers/settingsCtrl.js index 6ba382bb44..6d01716444 100644 --- a/website/public/js/controllers/settingsCtrl.js +++ b/website/public/js/controllers/settingsCtrl.js @@ -74,6 +74,19 @@ habitrpg.controller('SettingsCtrl', } User.set({'preferences.dayStart': dayStart}); } + + $scope.toggleCustomDayStartInfo = function(){ + var infoElement = window.document.getElementById('customDayStartInfo'); + var currentDisplay = infoElement.currentStyle ? infoElement.currentStyle.display : getComputedStyle(infoElement, null).display; + var linkElement = window.document.getElementById('customDayStartLink'); + if (currentDisplay === 'none') { + infoElement.style.display = 'block'; + linkElement.innerHTML = window.env.t('customDayStartInfo3'); + } else { + infoElement.style.display = 'none'; + linkElement.innerHTML = window.env.t('customDayStartInfo2'); + } + } $scope.language = window.env.language; $scope.avalaibleLanguages = window.env.avalaibleLanguages; diff --git a/website/views/options/settings.jade b/website/views/options/settings.jade index 9f436526ca..4f4fc25a4e 100644 --- a/website/views/options/settings.jade +++ b/website/views/options/settings.jade @@ -74,17 +74,15 @@ script(type='text/ng-template', id='partials/options.settings.settings.html') button.btn.btn-default(ng-if='!user.preferences.disableClasses && user.flags.classSelected', ng-click='showClassesTour()', popover-trigger='mouseenter', popover-placement='right', popover=env.t('classTourPop'))= env.t('showClass') div.alert.alert-warning(style='padding:2px;margin-top:7px') - h5.hint(popover=env.t('clockInfo'), popover-trigger='mouseenter')=env.t('customDayStart') + h5=env.t('customDayStart') + h5=env.t('customDayStartInfo1') + a(id='customDayStartLink' ng-click='toggleCustomDayStartInfo()')=env.t('customDayStartInfo2') + h5(id='customDayStartInfo' style='display:none') + !=env.t('customDayStartInfo4') .form-group .input-group input.form-control(type='number', min='0', max='23', ng-model='user.preferences.dayStart', ng-blur='saveDayStart()') span.input-group-addon= ':00 (' + env.t('24HrClock') + ')' - small - =env.t('subWarning1') - |  - a(href='https://github.com/HabitRPG/habitrpg/issues/1057' target='_blank')=env.t('subWarning2') - |  - =env.t('subWarning3') .personal-options.col-md-6 .panel.panel-default From ea2ad4e4b5843ce3c1ecd1fdfac75ebd85469868 Mon Sep 17 00:00:00 2001 From: Kathryn Norris Date: Fri, 10 Apr 2015 16:17:52 -0700 Subject: [PATCH 2/6] Changed the text for custom day start info. (#5006) --- common/locales/en/settings.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/locales/en/settings.json b/common/locales/en/settings.json index c3f4646847..5742d4aef5 100644 --- a/common/locales/en/settings.json +++ b/common/locales/en/settings.json @@ -42,9 +42,9 @@ "customDayStart": "Custom Day Start", "24HrClock": "24Hr Clock", "customDayStartInfo1": "HabitRPG defaults to check and reset your Dailies at midnight each day. It is recommended that you read the following information before changing it: ", - "customDayStartInfo2": "(show info)", - "customDayStartInfo3": "(hide info)", - "customDayStartInfo4": "From the wiki:
The Custom Day Start is the time of day at which one day ends and the next day begins in the player's HabitRPG world; all tasks register the passage of a day. The default day start is midnight in the player's time zone, based on the time registered by the player's computer, but the time can be changed to suit the player's needs.

Enter an hour from 0 to 23 (it uses a 24 hour clock). It is best to type the new time instead of using the arrow buttons, which do not always work correctly. After you have entered the new time, click your mouse once anywhere on the page outside the field to move the cursor out of the text box or else your change won't be saved. If you want to be certain that your change has been saved, reload the page and check that the new value is being displayed.

Some people have trouble with Custom Day Start on the first day that they change it because changing it can cause Cron to run immediately, but after the first day it works well. To minimize problems on the first day, complete all your Dailies before changing the Custom Day Start or Rest in the Inn that day.

If you change the Custom Day Start from or to a time that is too close to the current time, then the new setting will not be used until the next day. It is best to allow a window of two hours for the change to take effect. For example, if it is currently set to 0 (midnight), change it before 10pm; if you want to set it to 9pm, change it before 7pm.", + "customDayStartInfo2": "(show more)", + "customDayStartInfo3": "(show less)", + "customDayStartInfo4": "Complete all your Dailies before changing the Custom Day Start or Rest in the Inn that day. Changing your Custom Day Start may cause Cron to run immediately, but after the first day it works as expected.

Allow a window of two hours for the change to take effect. For example, if it is currently set to 0 (midnight), change it before 10pm; if you want to set it to 9pm, change it before 7pm.

Enter an hour from 0 to 23 (it uses a 24 hour clock). Typing is more effective than arrow keys. Once set, reload the page to confirm that the new value is being displayed.", "misc": "Misc", "showHeader": "Show Header", "changePass": "Change Password", From 5dc1d58f8f9b3fcb4404c84ac10ddbbb3a264c5a Mon Sep 17 00:00:00 2001 From: Kathryn Norris Date: Mon, 13 Apr 2015 17:11:48 -0700 Subject: [PATCH 3/6] Altered custom day start text. (#5006) --- common/locales/en/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/locales/en/settings.json b/common/locales/en/settings.json index 5742d4aef5..12f9c3b882 100644 --- a/common/locales/en/settings.json +++ b/common/locales/en/settings.json @@ -44,7 +44,7 @@ "customDayStartInfo1": "HabitRPG defaults to check and reset your Dailies at midnight each day. It is recommended that you read the following information before changing it: ", "customDayStartInfo2": "(show more)", "customDayStartInfo3": "(show less)", - "customDayStartInfo4": "Complete all your Dailies before changing the Custom Day Start or Rest in the Inn that day. Changing your Custom Day Start may cause Cron to run immediately, but after the first day it works as expected.

Allow a window of two hours for the change to take effect. For example, if it is currently set to 0 (midnight), change it before 10pm; if you want to set it to 9pm, change it before 7pm.

Enter an hour from 0 to 23 (it uses a 24 hour clock). Typing is more effective than arrow keys. Once set, reload the page to confirm that the new value is being displayed.", + "customDayStartInfo4": "Complete all your Dailies before changing the Custom Day Start or Rest in the Inn that day. Changing your Custom Day Start may cause Cron to run immediately, but after the first day it works as expected.

Allow a window of two hours for the change to take effect. For example, if it is currently set to 0 (midnight), change it before 10pm; if you want to set it to 9pm, change it before 7pm.

Enter an hour from 0 to 23 (it uses a 24 hour clock). Typing is more effective than arrow keys. Once set, reload the page to confirm that the new value is being displayed.", "misc": "Misc", "showHeader": "Show Header", "changePass": "Change Password", From 8c45ab8dc4d23e8501126ebef7debc9811bef0cd Mon Sep 17 00:00:00 2001 From: Kathryn Norris Date: Tue, 14 Apr 2015 14:23:20 -0700 Subject: [PATCH 4/6] Removed unused strings and altered custom day start text. (#5006) --- common/locales/en/settings.json | 2 +- common/locales/en/subscriber.json | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/common/locales/en/settings.json b/common/locales/en/settings.json index 12f9c3b882..9c51e71194 100644 --- a/common/locales/en/settings.json +++ b/common/locales/en/settings.json @@ -41,7 +41,7 @@ "json": "(JSON)", "customDayStart": "Custom Day Start", "24HrClock": "24Hr Clock", - "customDayStartInfo1": "HabitRPG defaults to check and reset your Dailies at midnight each day. It is recommended that you read the following information before changing it: ", + "customDayStartInfo1": "HabitRPG defaults to check and reset your Dailies at midnight in your own time zone each day. It is recommended that you read the following information before changing it: ", "customDayStartInfo2": "(show more)", "customDayStartInfo3": "(show less)", "customDayStartInfo4": "Complete all your Dailies before changing the Custom Day Start or Rest in the Inn that day. Changing your Custom Day Start may cause Cron to run immediately, but after the first day it works as expected.

Allow a window of two hours for the change to take effect. For example, if it is currently set to 0 (midnight), change it before 10pm; if you want to set it to 9pm, change it before 7pm.

Enter an hour from 0 to 23 (it uses a 24 hour clock). Typing is more effective than arrow keys. Once set, reload the page to confirm that the new value is being displayed.", diff --git a/common/locales/en/subscriber.json b/common/locales/en/subscriber.json index c033ea6088..4f602a48a3 100644 --- a/common/locales/en/subscriber.json +++ b/common/locales/en/subscriber.json @@ -2,9 +2,6 @@ "subscription": "Subscription", "subscriptions": "Subscriptions", "subDescription": "Disable ads, buy gems with gold, monthly mystery item, retain progress history, double daily drop-caps, supports the devs. Click for more info.", - "subWarning1": "Warning: this is a highly-experimental feature, and many", - "subWarning2": "experience issues", - "subWarning3": "with it.", "disableAds": "Disable ads", "disableAdsText": "Ads will stay disabled while you have an active subscription (original users with disabled ads are grandfathered).", "buyGemsGold": "Buy Gems with Gold", From 6a461be0a47b4cdf7857eed6550616d501e33c59 Mon Sep 17 00:00:00 2001 From: Kathryn Norris Date: Tue, 14 Apr 2015 14:49:45 -0700 Subject: [PATCH 5/6] Replaced toggleCustomDayStartInfo function with angular magic. (#5006) --- website/public/js/controllers/settingsCtrl.js | 13 ------------- website/views/options/settings.jade | 6 +++--- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/website/public/js/controllers/settingsCtrl.js b/website/public/js/controllers/settingsCtrl.js index 6d01716444..6ba382bb44 100644 --- a/website/public/js/controllers/settingsCtrl.js +++ b/website/public/js/controllers/settingsCtrl.js @@ -74,19 +74,6 @@ habitrpg.controller('SettingsCtrl', } User.set({'preferences.dayStart': dayStart}); } - - $scope.toggleCustomDayStartInfo = function(){ - var infoElement = window.document.getElementById('customDayStartInfo'); - var currentDisplay = infoElement.currentStyle ? infoElement.currentStyle.display : getComputedStyle(infoElement, null).display; - var linkElement = window.document.getElementById('customDayStartLink'); - if (currentDisplay === 'none') { - infoElement.style.display = 'block'; - linkElement.innerHTML = window.env.t('customDayStartInfo3'); - } else { - infoElement.style.display = 'none'; - linkElement.innerHTML = window.env.t('customDayStartInfo2'); - } - } $scope.language = window.env.language; $scope.avalaibleLanguages = window.env.avalaibleLanguages; diff --git a/website/views/options/settings.jade b/website/views/options/settings.jade index 4f4fc25a4e..ab337ba952 100644 --- a/website/views/options/settings.jade +++ b/website/views/options/settings.jade @@ -76,9 +76,9 @@ script(type='text/ng-template', id='partials/options.settings.settings.html') div.alert.alert-warning(style='padding:2px;margin-top:7px') h5=env.t('customDayStart') h5=env.t('customDayStartInfo1') - a(id='customDayStartLink' ng-click='toggleCustomDayStartInfo()')=env.t('customDayStartInfo2') - h5(id='customDayStartInfo' style='display:none') - !=env.t('customDayStartInfo4') + a(ng-show='!showCustomDayStartInfo' ng-click='showCustomDayStartInfo = !showCustomDayStartInfo')=env.t('customDayStartInfo2') + a(ng-show='showCustomDayStartInfo' ng-click='showCustomDayStartInfo = !showCustomDayStartInfo')=env.t('customDayStartInfo3') + h5(ng-if='showCustomDayStartInfo')!=env.t('customDayStartInfo4') .form-group .input-group input.form-control(type='number', min='0', max='23', ng-model='user.preferences.dayStart', ng-blur='saveDayStart()') From 2fc01ee77615784870663ca66f76c0d1e073c888 Mon Sep 17 00:00:00 2001 From: Kathryn Norris Date: Tue, 14 Apr 2015 16:47:37 -0700 Subject: [PATCH 6/6] Simplified custom day start info in settings. (#5006) --- website/views/options/settings.jade | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/website/views/options/settings.jade b/website/views/options/settings.jade index ab337ba952..dc8d25983a 100644 --- a/website/views/options/settings.jade +++ b/website/views/options/settings.jade @@ -76,8 +76,7 @@ script(type='text/ng-template', id='partials/options.settings.settings.html') div.alert.alert-warning(style='padding:2px;margin-top:7px') h5=env.t('customDayStart') h5=env.t('customDayStartInfo1') - a(ng-show='!showCustomDayStartInfo' ng-click='showCustomDayStartInfo = !showCustomDayStartInfo')=env.t('customDayStartInfo2') - a(ng-show='showCustomDayStartInfo' ng-click='showCustomDayStartInfo = !showCustomDayStartInfo')=env.t('customDayStartInfo3') + a(ng-click='showCustomDayStartInfo = !showCustomDayStartInfo') {{!showCustomDayStartInfo ? env.t('customDayStartInfo2') : env.t('customDayStartInfo3')}} h5(ng-if='showCustomDayStartInfo')!=env.t('customDayStartInfo4') .form-group .input-group