Skip to content

Commit

Permalink
feat: add "copy uri" option in file browser
Browse files Browse the repository at this point in the history
  • Loading branch information
bajrangCoder committed Oct 25, 2024
1 parent 2352946 commit bc3fabd
Show file tree
Hide file tree
Showing 31 changed files with 69 additions and 30 deletions.
3 changes: 2 additions & 1 deletion src/lang/ar-ye.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "أضاف حديثا",
"top_rated": "أعلى تصنيف",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/be-by.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/bn-bd.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/cs-cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/de-de.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Neu Hinzugefügte",
"top_rated": "Am besten Bewertete",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/es-sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/fr-fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/hi-in.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,6 @@
"newly_added": "नया नया़ा",
"top_rated": "टॉप रेटेड",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/hu-hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Újonnan hozzáadott",
"top_rated": "Legjobbra értékelt",
"rename not supported": "A Termux könyvtár átnevezése nem támogatott ",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/id-id.json
Original file line number Diff line number Diff line change
Expand Up @@ -385,5 +385,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/ir-fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/it-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/ja-jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/ko-kr.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "새로 추가되었습니다",
"top_rated": "최고 평점",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/ml-in.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/mm-unicode.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/mm-zawgyi.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/pl-pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Ostatnio dodane",
"top_rated": "Najwyżej oceniane",
"rename not supported": "Zmiana nazwy katalogu w termux nie jest obsługiwana",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/pu-in.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/ru-ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,6 @@
"newly_added": "Новые",
"top_rated": "С высокой оценкой",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/tl-ph.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/tr-tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/uk-ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/uz-uz.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/vi-vn.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,6 @@
"newly_added": "Mới được thêm vào",
"top_rated": "Đánh giá cao nhất",
"rename not supported": "Đổi tên trên thư mục Termux không được hỗ trợ",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "最近上架",
"top_rated": "最多好评",
"rename not supported": "不支持修改 Termux 内的文件夹名",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/zh-hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "最近上架",
"top_rated": "最多好評",
"rename not supported": "不支持修改 Termux 內的文件夾名",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
3 changes: 2 additions & 1 deletion src/lang/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
"newly_added": "Newly Added",
"top_rated": "Top Rated",
"rename not supported": "Rename on termux dir isn't supported",
"compress": "Compress"
"compress": "Compress",
"copy uri": "Copy Uri"
}
9 changes: 9 additions & 0 deletions src/pages/fileBrowser/fileBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) {
options.push(["info", strings.info, "info"]);
}

if (currentDir.url !== "/" && url) {
options.push(["copyuri", strings["copy uri"], "copy"]);
}

const option = await select(strings["select"], options);
switch (option) {
case "delete": {
Expand Down Expand Up @@ -589,6 +593,11 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) {
case "info":
acode.exec("file-info", url);
break;

case "copyuri":
navigator.clipboard.writeText(url);
alert(strings.success, strings["copied to clipboard"]);
break;
}
}

Expand Down

0 comments on commit bc3fabd

Please sign in to comment.