diff --git a/src/langs/zh_Hans.txt b/src/langs/zh_Hans.txt index 23b858f..1ea6aed 100644 --- a/src/langs/zh_Hans.txt +++ b/src/langs/zh_Hans.txt @@ -30,6 +30,8 @@ Search=搜索 Default=默认 Expand=展开 Collapse=折叠 +Expand All=全部展开 +Collapse All=全部折叠 Open=打开 Save=保存 Import=导入 @@ -42,6 +44,8 @@ By Progress=按进度 By Remain Time=按剩余时间 By Download Speed=按下载速度 By Upload Speed=按上传速度 +By Peer Address=按节点地址 +By Client Name=按客户端名称 Filters=过滤器 Download=下载 Upload=上传 diff --git a/src/langs/zh_Hant.txt b/src/langs/zh_Hant.txt index e2eaec5..3d846ca 100644 --- a/src/langs/zh_Hant.txt +++ b/src/langs/zh_Hant.txt @@ -30,6 +30,8 @@ Search=搜尋 Default=預設 Expand=展開 Collapse=摺疊 +Expand All=全部展開 +Collapse All=全部摺疊 Open=打開 Save=儲存 Import=匯入 @@ -42,6 +44,8 @@ By Progress=依進度 By Remain Time=依剩餘時間 By Download Speed=依下載速度 By Upload Speed=依上傳速度 +By Peer Address=依節點位址 +By Client Name=依客戶端名 Filters=篩選器 Download=下載 Upload=上傳 diff --git a/src/scripts/config/defaultLanguage.js b/src/scripts/config/defaultLanguage.js index c74da6e..f208d7a 100644 --- a/src/scripts/config/defaultLanguage.js +++ b/src/scripts/config/defaultLanguage.js @@ -34,6 +34,8 @@ 'Default': 'Default', 'Expand': 'Expand', 'Collapse': 'Collapse', + 'Expand All': 'Expand All', + 'Collapse All': 'Collapse All', 'Open': 'Open', 'Save': 'Save', 'Import': 'Import', @@ -46,6 +48,8 @@ 'By Remain Time': 'By Remain Time', 'By Download Speed': 'By Download Speed', 'By Upload Speed': 'By Upload Speed', + 'By Peer Address': 'By Peer Address', + 'By Client Name': 'By Client Name', 'Filters': 'Filters', 'Download': 'Download', 'Upload': 'Upload', diff --git a/src/scripts/controllers/task-detail.js b/src/scripts/controllers/task-detail.js index 71b6cc9..03d9aba 100644 --- a/src/scripts/controllers/task-detail.js +++ b/src/scripts/controllers/task-detail.js @@ -543,14 +543,14 @@ } }; - $scope.collapseDir = function (dirNode, newValue) { + $scope.collapseDir = function (dirNode, newValue, forceRecurse) { var nodePath = dirNode.nodePath; if (angular.isUndefined(newValue)) { newValue = !$scope.context.collapsedDirs[nodePath]; } - if (newValue) { + if (newValue || forceRecurse) { for (var i = 0; i < dirNode.subDirs.length; i++) { $scope.collapseDir(dirNode.subDirs[i], newValue); } @@ -561,6 +561,22 @@ } }; + $scope.collapseAllDirs = function (newValue) { + if (!$scope.task || !$scope.task.files) { + return; + } + + for (var i = 0; i < $scope.task.files.length; i++) { + var node = $scope.task.files[i]; + + if (!node.isDir) { + continue; + } + + $scope.collapseDir(node, newValue, true); + } + }; + $scope.setSelectedNode = function (dirNode) { setSelectedNode(dirNode, dirNode.selected); updateAllDirNodesSelectedStatus(); diff --git a/src/views/task-detail.html b/src/views/task-detail.html index 5a3445d..c246bef 100644 --- a/src/views/task-detail.html +++ b/src/views/task-detail.html @@ -245,6 +245,7 @@