diff options
author | ryyee99 <35312666+ryyee99@users.noreply.github.com> | 2018-01-18 23:33:38 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2018-01-18 23:33:38 +0300 |
commit | 69352ce8862db4eba0ba165c13228f5a42169db0 (patch) | |
tree | 661d25a0c101ed0660324226e5e612a876f187cb /plugins | |
parent | 5351fdc7e8214d3c76c94b8a74774b3b7d2e3da7 (diff) |
Rough way of adding the page up and page down shortcuts to help list (#12461)
* Rough way of adding page up & down shortcut to help list
* To allow Macs to display different shortcut buttons
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreHome/CoreHome.php | 8 | ||||
-rwxr-xr-x | plugins/CoreHome/javascripts/corehome.js | 20 | ||||
-rw-r--r-- | plugins/CoreHome/lang/en.json | 9 |
3 files changed, 35 insertions, 2 deletions
diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php index f432043548..fc5eaec066 100644 --- a/plugins/CoreHome/CoreHome.php +++ b/plugins/CoreHome/CoreHome.php @@ -406,5 +406,13 @@ class CoreHome extends \Piwik\Plugin $translationKeys[] = 'CoreHome_ShortcutCalendar'; $translationKeys[] = 'CoreHome_ShortcutSearch'; $translationKeys[] = 'CoreHome_ShortcutHelp'; + $translationKeys[] = 'CoreHome_HomeShortcut'; + $translationKeys[] = 'CoreHome_PageUpShortcutDescription'; + $translationKeys[] = 'CoreHome_EndShortcut'; + $translationKeys[] = 'CoreHome_PageDownShortcutDescription'; + + $translationKeys[] = 'CoreHome_MacPageUp'; + $translationKeys[] = 'CoreHome_MacPageDown'; + } } diff --git a/plugins/CoreHome/javascripts/corehome.js b/plugins/CoreHome/javascripts/corehome.js index 76f6554573..3ae506f777 100755 --- a/plugins/CoreHome/javascripts/corehome.js +++ b/plugins/CoreHome/javascripts/corehome.js @@ -111,6 +111,24 @@ $( document ).ready(function() { } }); + var isMac = navigator.userAgent.indexOf('Mac OS X') != -1; + + if (isMac) { + list.append($('<dt />').text(_pk_translate("CoreHome_MacPageUp")).css('width','auto')); + } else { + list.append($('<dt />').text(_pk_translate("CoreHome_HomeShortcut")).css('width','auto')); + } + + list.append($('<dd />').text(_pk_translate('CoreHome_PageUpShortcutDescription'))); + + if (isMac) { + list.append($('<dt />').text(_pk_translate("CoreHome_MacPageDown")).css('width','auto')); + } else { + list.append($('<dt />').text(_pk_translate("CoreHome_EndShortcut")).css('width','auto')); + } + + list.append($('<dd />').text(_pk_translate('CoreHome_PageDownShortcutDescription'))); + piwikHelper.modalConfirm('#shortcuthelp'); }); -});
\ No newline at end of file +}); diff --git a/plugins/CoreHome/lang/en.json b/plugins/CoreHome/lang/en.json index 1ec3c66d1e..ff867de15a 100644 --- a/plugins/CoreHome/lang/en.json +++ b/plugins/CoreHome/lang/en.json @@ -18,10 +18,12 @@ "DonateCall2": "Matomo needs your continued support to grow and thrive.", "DonateCall3": "If you feel that Matomo has added significant value to your business or endeavour, %1$splease consider donating%2$s or %3$spurchasing a premium feature%4$s. Every penny will help.", "DonateFormInstructions": "Click on the slider to select an amount, then click subscribe to donate.", + "EndShortcut": "End", "ExceptionNotWhitelistedIP": "You cannot use this Matomo as your IP %s is not whitelisted", "ExcludeRowsWithLowPopulation": "All rows are shown %s Exclude low population", "ExternalHelp": "Help (opens in new tab)", "FlattenDataTable": "The report is hierarchical %s Make it flat", + "HomeShortcut": "Home", "HowMuchIsPiwikWorth": "How much is Matomo worth to you?", "IncludeRowsWithLowPopulation": "Rows with low population are hidden %s Show all rows", "InjectedHostEmailBody": "Hello, I tried to access Matomo today and encountered the unknown hostname warning.", @@ -66,6 +68,8 @@ "ClickRowToExpandOrContract": "Click this row to expand or contract the subtable.", "UndoPivotBySubtable": "This report has been pivoted %s Undo pivot", "NoSuchPage": "This page does not exist", + "PageUpShortcutDescription": "to get to the top of the page", + "PageDownShortcutDescription": "to get to the bottom of the page", "PivotBySubtable": "This report is not pivoted %1$s Pivot by %2$s", "SystemSummaryWidget": "System Summary", "SystemSummaryNWebsites": "%d websites", @@ -80,6 +84,9 @@ "OneClickUpdateNotPossibleAsMultiServerEnvironment": "The one-click update is not available as you are using Matomo with multiple servers. Please download the latest version from %1$s to proceed.", "AdblockIsMaybeUsed": "In case you are using an ad blocker, please disable it for this site to make sure Matomo works without any issues.", "ChangeCurrentWebsite": "Choose a website, currently selected website: %s", - "LeadingAnalyticsPlatformRespectsYourPrivacy": "The leading open analytics platform that respects your privacy." + "LeadingAnalyticsPlatformRespectsYourPrivacy": "The leading open analytics platform that respects your privacy.", + + "MacPageUp": "Fn + Left arrow", + "MacPageDown": "Fn + Right arrow" } } |