فهرست منبع

merge AriaNg commit(https://github.com/mayswind/AriaNg/commit/15973d12662cd95462d96da9764eeec337c0fe4b)

MaysWind 3 سال پیش
والد
کامیت
2e6fb60519

+ 2 - 1
app/scripts/controllers/settings-ariang.js

@@ -1,7 +1,7 @@
 (function () {
     'use strict';
 
-    angular.module('ariaNg').controller('AriaNgSettingsController', ['$rootScope', '$scope', '$routeParams', '$window', '$interval', '$timeout', '$filter', 'clipboard', 'ariaNgLanguages', 'ariaNgCommonService', 'ariaNgNotificationService', 'ariaNgLocalizationService', 'ariaNgLogService', 'ariaNgFileService', 'ariaNgSettingService', 'ariaNgMonitorService', 'ariaNgTitleService', 'aria2SettingService', 'ariaNgVersionService', 'ariaNgNativeElectronService', function ($rootScope, $scope, $routeParams, $window, $interval, $timeout, $filter, clipboard, ariaNgLanguages, ariaNgCommonService, ariaNgNotificationService, ariaNgLocalizationService, ariaNgLogService, ariaNgFileService, ariaNgSettingService, ariaNgMonitorService, ariaNgTitleService, aria2SettingService, ariaNgVersionService, ariaNgNativeElectronService) {
+    angular.module('ariaNg').controller('AriaNgSettingsController', ['$rootScope', '$scope', '$routeParams', '$window', '$interval', '$timeout', '$filter', 'clipboard', 'ariaNgLanguages', 'ariaNgCommonService', 'ariaNgKeyboardService', 'ariaNgNotificationService', 'ariaNgLocalizationService', 'ariaNgLogService', 'ariaNgFileService', 'ariaNgSettingService', 'ariaNgMonitorService', 'ariaNgTitleService', 'aria2SettingService', 'ariaNgVersionService', 'ariaNgNativeElectronService', function ($rootScope, $scope, $routeParams, $window, $interval, $timeout, $filter, clipboard, ariaNgLanguages, ariaNgCommonService, ariaNgKeyboardService, ariaNgNotificationService, ariaNgLocalizationService, ariaNgLogService, ariaNgFileService, ariaNgSettingService, ariaNgMonitorService, ariaNgTitleService, aria2SettingService, ariaNgVersionService, ariaNgNativeElectronService) {
         var extendType = $routeParams.extendType;
         var lastRefreshPageNotification = null;
 
@@ -74,6 +74,7 @@
             nativeSettings: getNativeSettings(),
             sessionSettings: ariaNgSettingService.getAllSessionOptions(),
             rpcSettings: ariaNgSettingService.getAllRpcSettings(),
+            isMacKeyboardLike: ariaNgKeyboardService.isMacKeyboardLike(),
             isSupportReconnect: aria2SettingService.canReconnect(),
             isSupportBlob: ariaNgFileService.isSupportBlob(),
             isSupportDarkMode: ariaNgSettingService.isBrowserSupportDarkMode(),

+ 3 - 0
app/scripts/services/ariaNgKeyboardService.js

@@ -25,6 +25,9 @@
         };
 
         return {
+            isMacKeyboardLike: function () {
+                return isMacLike;
+            },
             isCtrlAPressed: function (event) {
                 return (isModifierKeyPressed(event) && (event.code === 'KeyA' || getKeyCode(event) === 65)); // Ctrl+A / Command+A
             },

+ 2 - 2
app/views/settings-ariang.html

@@ -162,8 +162,8 @@
                                data-trigger="hover" data-placement="auto right" data-container="body" data-html="true"
                                data-content="{{('Supported Keyboard Shortcuts' | translate) + ':<br/>' +
                                ('Remove Selected Task' | translate) + ': <span class=\'keyboard-key\'>Delete</span><br/>' +
-                               ('Select All Tasks' | translate) + ': <span class=\'keyboard-key\'>Ctrl</span>+<span class=\'keyboard-key\'>A</span> / <span class=\'keyboard-key\'>Command</span>+<span class=\'keyboard-key\'>A</span><br/>' +
-                               ('Download Now' | translate) + ': <span class=\'keyboard-key\'>Ctrl</span>+<span class=\'keyboard-key\'>Enter</span> / <span class=\'keyboard-key\'>Command</span>+<span class=\'keyboard-key\'>Return</span>'}}"></i>
+                               ('Select All Tasks' | translate) + ': ' + (!context.isMacKeyboardLike ? '<span class=\'keyboard-key\'>Ctrl</span>+<span class=\'keyboard-key\'>A</span>' : '<span class=\'keyboard-key\'>Command</span>+<span class=\'keyboard-key\'>A</span>') + '<br/>' +
+                               ('Download Now' | translate) + ': ' + (!context.isMacKeyboardLike ? '<span class=\'keyboard-key\'>Ctrl</span>+<span class=\'keyboard-key\'>Enter</span>' : '<span class=\'keyboard-key\'>Command</span>+<span class=\'keyboard-key\'>Return</span>')}}"></i>
                         </div>
                         <div class="setting-value col-sm-8">
                             <select class="form-control" style="width: 100%;" ng-model="context.settings.keyboardShortcuts"