mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-06 18:03:48 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b8e5b7433 | ||
|
|
f6f3db2df9 | ||
|
|
abd3a0c47c | ||
|
|
89734e6954 | ||
|
|
59bd9265bc | ||
|
|
dbd6321fec | ||
|
|
d18e290ad4 | ||
|
|
d7b68e214e | ||
|
|
148eb79ef0 | ||
|
|
80615c533c | ||
|
|
b0b091c4f7 |
@@ -811,9 +811,9 @@
|
||||
<!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.-->
|
||||
<path d="M433 179.1c0-97.2-63.7-125.7-63.7-125.7-62.5-28.7-228.6-28.4-290.5 0 0 0-63.7 28.5-63.7 125.7 0 115.7-6.6 259.4 105.6 289.1 40.5 10.7 75.3 13 103.3 11.4 50.8-2.8 79.3-18.1 79.3-18.1l-1.7-36.9s-36.3 11.4-77.1 10.1c-40.4-1.4-83-4.4-89.6-54a102.5 102.5 0 0 1 -.9-13.9c85.6 20.9 158.7 9.1 178.8 6.7 56.1-6.7 105-41.3 111.2-72.9 9.8-49.8 9-121.5 9-121.5zm-75.1 125.2h-46.6v-114.2c0-49.7-64-51.6-64 6.9v62.5h-46.3V197c0-58.5-64-56.6-64-6.9v114.2H90.2c0-122.1-5.2-147.9 18.4-175 25.9-28.9 79.8-30.8 103.8 6.1l11.6 19.5 11.6-19.5c24.1-37.1 78.1-34.8 103.8-6.1 23.7 27.3 18.4 53 18.4 175z"></path>
|
||||
</symbol>
|
||||
<symbol id="bluesky" viewBox="0 0 448 512">
|
||||
<!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.-->
|
||||
<path d="M0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96z"></path>
|
||||
<symbol id="bluesky" viewBox="0 0 512 512">
|
||||
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
||||
<path d="M111.8 62.2C170.2 105.9 233 194.7 256 242.4c23-47.6 85.8-136.4 144.2-180.2c42.1-31.6 110.3-56 110.3 21.8c0 15.5-8.9 130.5-14.1 149.2C478.2 298 412 314.6 353.1 304.5c102.9 17.5 129.1 75.5 72.5 133.5c-107.4 110.2-154.3-27.6-166.3-62.9l0 0c-1.7-4.9-2.6-7.8-3.3-7.8s-1.6 3-3.3 7.8l0 0c-12 35.3-59 173.1-166.3 62.9c-56.5-58-30.4-116 72.5-133.5C100 314.6 33.8 298 15.7 233.1C10.4 214.4 1.5 99.4 1.5 83.9c0-77.8 68.2-53.4 110.3-21.8z"/>
|
||||
</symbol>
|
||||
<symbol id="custom" viewBox="0 0 512 512">
|
||||
<!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.-->
|
||||
|
||||
@@ -1,6 +1,35 @@
|
||||
{
|
||||
"header": {
|
||||
"about_title": "পেয়ার ড্রপ সম্পর্কে",
|
||||
"install_title": "পেয়ার ড্রপ ইন্সটল করুন"
|
||||
"install_title": "পেয়ার ড্রপ ইন্সটল করুন",
|
||||
"pair-device_title": "ডিভাইস স্থায়ী ভাবে যুক্ত করুন",
|
||||
"cancel-share-mode": "বাতিল",
|
||||
"theme-light_title": "সবসময় সাদা থিম ব্যাবহার",
|
||||
"language-selector_title": "ভাষা সেট করুন",
|
||||
"about_aria-label": "পেয়ারড্রপ সম্পর্কে",
|
||||
"theme-auto_title": "থিমের ধরন ডিভাইস অনুযায়ী",
|
||||
"theme-dark_title": "সবসময় কালো থিব ব্যাবহার",
|
||||
"notification_title": "নোটিফিকেশন চালু করুন",
|
||||
"edit-paired-devices_title": "যুক্ত ডিভাইস সম্পাদনা করুন",
|
||||
"join-public-room_title": "সাময়িক ভাবে পাবলিক রুমে জয়েন করুন",
|
||||
"edit-share-mode": "সম্পাদনা",
|
||||
"expand_title": "হেডার বোতামের সারিটি বড় করুন"
|
||||
},
|
||||
"instructions": {
|
||||
"activate-share-mode-and-other-file": "আর একটি ফাইল যোগ করুন",
|
||||
"activate-share-mode-shared-file": "পাঠানো ফাইল",
|
||||
"no-peers-subtitle": "ডিভাইস প্রদর্শিত হতে নতুন ডিভাইস যুক্ত করুন অথবা পাবলিক রুমে জয়েন দিন",
|
||||
"no-peers-title": "ফাইল পাঠানোর জন্য অন্যান্য ডিভাইসে পেয়ারড্রপ খুলুন",
|
||||
"x-instructions_data-drop-bg": "প্রাপক নির্বাচন করতে ছেড়ে দিন",
|
||||
"no-peers_data-drop-bg": "প্রাপক নির্বাচন ছেড়ে দিন",
|
||||
"x-instructions_desktop": "ফাইল পাঠাতে ক্লিক করুন অথবা মেসেজ পাঠাতে ডানে চাপুন",
|
||||
"x-instructions_mobile": "ফাইল পাঠাতে ক্লিক করুন অথবা বেশি চেপে মেসেজ পাঠান",
|
||||
"x-instructions_data-drop-peer": "পিয়ারকে পাঠানোর জন্য রিলিজ করুন",
|
||||
"x-instructions-share-mode_desktop": "পাঠাতে ক্লিক করুন",
|
||||
"x-instructions-share-mode_mobile": "পাঠাতে ক্লিক করুন",
|
||||
"activate-share-mode-base": "অন্য ডিভাইসে পাঠাতে পেয়ারড্রপ খুলুন",
|
||||
"activate-share-mode-and-other-files-plural": "অন্য ফাইল যোগ করুন",
|
||||
"activate-share-mode-shared-text": "পাঠানো টেক্সট",
|
||||
"activate-share-mode-shared-files-plural": "পাঠানো ফাইল গুলো"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"footer": {
|
||||
"webrtc": "(WebRTCが無効なため)",
|
||||
"public-room-devices_title": "公開ルーム内のデバイスは、接続中のネットワークと関係なくアクセスできます。",
|
||||
"public-room-devices_title": "公開ルーム内のデバイスは、別のネットワークからもアクセスできます。",
|
||||
"display-name_data-placeholder": "読み込み中…",
|
||||
"display-name_title": "デバイス名を変更する",
|
||||
"traffic": "この通信は",
|
||||
"paired-devices_title": "ペアリング済みデバイスであれば、接続中のネットワークに関わらずアクセスできます。",
|
||||
"paired-devices_title": "ペアリング済みデバイスは、別のネットワークからもアクセスできます。",
|
||||
"public-room-devices": "ルーム{{roomId}}",
|
||||
"paired-devices": "ペアリング済みデバイス",
|
||||
"on-this-network": "このネットワーク上",
|
||||
"on-this-network": "このネットワーク内",
|
||||
"routed": "サーバーを経由します",
|
||||
"discovery": "このデバイスを検出可能なネットワーク:",
|
||||
"on-this-network_title": "このネットワーク上のすべてのデバイスからアクセスできます。",
|
||||
"on-this-network_title": "このネットワーク内のすべてのデバイスからアクセスできます。",
|
||||
"known-as": "このデバイスの名前:"
|
||||
},
|
||||
"notifications": {
|
||||
@@ -20,9 +20,9 @@
|
||||
"message-received": "{{name}}から受信したメッセージ(クリックしてコピー)",
|
||||
"rate-limit-join-key": "レート制限に到達しました。10秒待ってから再度お試しください。",
|
||||
"connecting": "接続中…",
|
||||
"pairing-key-invalidated": "コード{{key}}が失効しました",
|
||||
"pairing-key-invalidated": "コード{{key}}は無効になりました",
|
||||
"pairing-key-invalid": "無効なコード",
|
||||
"connected": "接続しました",
|
||||
"connected": "接続済み",
|
||||
"pairing-not-persistent": "このデバイスとのペアリングは解除される可能性があります",
|
||||
"text-content-incorrect": "無効なテキスト内容です",
|
||||
"message-transfer-completed": "メッセージを送信しました",
|
||||
@@ -39,7 +39,7 @@
|
||||
"copied-to-clipboard-error": "コピーできませんでした。手動でコピーしてください。",
|
||||
"pairing-success": "ペアリングしました",
|
||||
"clipboard-content-incorrect": "無効なクリップボード内容です",
|
||||
"display-name-changed-temporarily": "この接続のみデバイス名が変更されました",
|
||||
"display-name-changed-temporarily": "この接続でのみデバイス名が変更されました",
|
||||
"copied-to-clipboard": "クリップボードにコピーしました",
|
||||
"offline": "オフラインです",
|
||||
"pairing-tabs-error": "同じWebブラウザーで開いたタブ同士でペアリングすることはできません",
|
||||
@@ -79,9 +79,9 @@
|
||||
"activate-share-mode-and-other-files-plural": "とその他{{count}}個のファイル",
|
||||
"x-instructions-share-mode_mobile": "タップして{{descriptor}}を送信",
|
||||
"activate-share-mode-base": "他のデバイスでPairDropを開いて送信します",
|
||||
"no-peers-subtitle": "ペアリングや公開ルームを使用すると、他のネットワーク上のデバイスと共有できます",
|
||||
"no-peers-subtitle": "ペアリングや公開ルームを使うと、別のネットワークにあるデバイスと共有できます",
|
||||
"activate-share-mode-shared-text": "共有されたテキスト",
|
||||
"x-instructions_desktop": "左クリックでファイルを送信、右クリックでメッセージを送信します",
|
||||
"x-instructions_desktop": "左クリックでファイル送信、右クリックでメッセージ送信",
|
||||
"no-peers-title": "ファイル共有するには他のデバイスでPairDropを開きます",
|
||||
"x-instructions_data-drop-peer": "ドロップするとこのデバイスに送信します",
|
||||
"x-instructions_data-drop-bg": "送信したいデバイスの上でドロップしてください",
|
||||
@@ -94,7 +94,7 @@
|
||||
"peer-ui": {
|
||||
"processing": "処理中…",
|
||||
"click-to-send-share-mode": "クリックして{{descriptor}}を送信",
|
||||
"click-to-send": "左クリックでファイルを送信、右クリックでメッセージを送信します",
|
||||
"click-to-send": "左クリックでファイル送信、右クリックでメッセージ送信",
|
||||
"waiting": "待機中…",
|
||||
"connection-hash": "エンドツーエンド暗号化のセキュリティを確認するには、両方のデバイスのセキュリティナンバーを確認してください",
|
||||
"preparing": "準備中…",
|
||||
@@ -102,7 +102,7 @@
|
||||
},
|
||||
"dialogs": {
|
||||
"base64-paste-to-send": "ここをタップして{{type}}を送信",
|
||||
"auto-accept-instructions-2": "」を有効にすると、そのデバイスから送信されたすべてのファイルを自動的に受け入れます。",
|
||||
"auto-accept-instructions-2": "」が有効なら、そのデバイスが送信したすべてのファイルを自動で受け入れます。",
|
||||
"receive-text-title": "メッセージを受信",
|
||||
"edit-paired-devices-title": "ペアリング設定",
|
||||
"cancel": "キャンセル",
|
||||
@@ -126,7 +126,7 @@
|
||||
"has-sent": "が送信:",
|
||||
"file-other-description-file": "とその他1個のファイル",
|
||||
"close": "閉じる",
|
||||
"system-language": "システム言語",
|
||||
"system-language": "システムの言語",
|
||||
"unpair": "ペアリング解除",
|
||||
"title-image": "画像",
|
||||
"file-other-description-file-plural": "とその他{{count}}個のファイル",
|
||||
@@ -135,7 +135,7 @@
|
||||
"language-selector-title": "言語設定",
|
||||
"pair": "ペアリング",
|
||||
"hr-or": "または",
|
||||
"scan-qr-code": "もしくはQRコードをスキャンしてください。",
|
||||
"scan-qr-code": "QRコードをスキャンしてください。",
|
||||
"input-key-on-this-device": "このコードを他のデバイスに入力するか",
|
||||
"download-again": "もう一度ダウンロードする",
|
||||
"accept": "承諾",
|
||||
@@ -162,13 +162,13 @@
|
||||
"share-text-title": "テキストメッセージを共有します"
|
||||
},
|
||||
"about": {
|
||||
"claim": "デバイス間のファイル共有を手軽に実現します",
|
||||
"tweet_title": "PairDropのことをポストする",
|
||||
"claim": "デバイス間でかんたんファイル共有",
|
||||
"tweet_title": "PairDropについてポスト",
|
||||
"close-about_aria-label": "PairDropについてを閉じる",
|
||||
"buy-me-a-coffee_title": "コーヒーを一杯おごってください!",
|
||||
"github_title": "PairDrop on GitHub",
|
||||
"github_title": "GitHub上のPairDropプロジェクト",
|
||||
"faq_title": "FAQ",
|
||||
"mastodon_title": "MastodonにPairDropのことをトゥートする",
|
||||
"mastodon_title": "MastodonでPairDropについてトゥート",
|
||||
"bluesky_title": "BlueSkyでフォロー",
|
||||
"custom_title": "フォロー",
|
||||
"privacypolicy_title": "プライバシーポリシーを開く"
|
||||
|
||||
@@ -5,7 +5,7 @@ class Localization {
|
||||
Localization.defaultLocale = "en";
|
||||
Localization.supportedLocales = [
|
||||
"ar", "be", "bg", "ca", "cs", "da", "de", "en", "es", "et", "eu", "fa", "fr", "he", "hu", "id", "it", "ja",
|
||||
"kn", "ko", "nb", "nn", "nl", "pl", "pt-BR", "ro", "ru", "sk", "ta", "tr", "uk", "zh-CN", "zh-HK", "zh-TW"
|
||||
"kn", "ko", "nb", "nl", "nn", "pl", "pt-BR", "ro", "ru", "sk", "ta", "tr", "uk", "zh-CN", "zh-HK", "zh-TW"
|
||||
];
|
||||
Localization.supportedLocalesRtl = ["ar", "he"];
|
||||
|
||||
|
||||
@@ -2404,7 +2404,7 @@ class Base64Dialog extends Dialog {
|
||||
class AboutUI {
|
||||
constructor() {
|
||||
this.$donationBtn = $('donation-btn');
|
||||
this.$twitterBtn = $('twitter-btn');
|
||||
this.$twitterBtn = $('x-twitter-btn');
|
||||
this.$mastodonBtn = $('mastodon-btn');
|
||||
this.$blueskyBtn = $('bluesky-btn');
|
||||
this.$customBtn = $('custom-btn');
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
const cacheVersion = 'v1.11.1';
|
||||
const cacheTitle = `pairdrop-cache-${cacheVersion}`;
|
||||
const forceFetch = false; // FOR DEVELOPMENT: Set to true to always update assets instead of using cached versions
|
||||
const relativePathsToCache = [
|
||||
'./',
|
||||
'index.html',
|
||||
'manifest.json',
|
||||
'styles/styles-main.css',
|
||||
'styles/styles-deferred.css',
|
||||
'scripts/browser-tabs-connector.js',
|
||||
'scripts/localization.js',
|
||||
'scripts/main.js',
|
||||
'scripts/network.js',
|
||||
@@ -28,14 +28,19 @@ const relativePathsToCache = [
|
||||
'images/android-chrome-512x512.png',
|
||||
'images/android-chrome-512x512-maskable.png',
|
||||
'images/apple-touch-icon.png',
|
||||
'fonts/OpenSans/static/OpenSans-Medium.ttf',
|
||||
'lang/ar.json',
|
||||
'lang/be.json',
|
||||
'lang/bg.json',
|
||||
'lang/ca.json',
|
||||
'lang/cs.json',
|
||||
'lang/da.json',
|
||||
'lang/de.json',
|
||||
'lang/en.json',
|
||||
'lang/es.json',
|
||||
'lang/et.json',
|
||||
'lang/eu.json',
|
||||
'lang/fa.json',
|
||||
'lang/fr.json',
|
||||
'lang/he.json',
|
||||
'lang/hu.json',
|
||||
@@ -43,15 +48,20 @@ const relativePathsToCache = [
|
||||
'lang/it.json',
|
||||
'lang/ja.json',
|
||||
'lang/kn.json',
|
||||
'lang/ko.json',
|
||||
'lang/nb.json',
|
||||
'lang/nl.json',
|
||||
'lang/nn.json',
|
||||
'lang/pl.json',
|
||||
'lang/pt-BR.json',
|
||||
'lang/ro.json',
|
||||
'lang/ru.json',
|
||||
'lang/sk.json',
|
||||
'lang/ta.json',
|
||||
'lang/tr.json',
|
||||
'lang/uk.json',
|
||||
'lang/zh-CN.json',
|
||||
'lang/zh-HK.json',
|
||||
'lang/zh-TW.json'
|
||||
];
|
||||
const relativePathsNotToCache = [
|
||||
@@ -59,14 +69,16 @@ const relativePathsNotToCache = [
|
||||
]
|
||||
|
||||
self.addEventListener('install', function(event) {
|
||||
// Perform install steps
|
||||
// Perform install steps
|
||||
console.log("Cache files for sw:", cacheVersion);
|
||||
event.waitUntil(
|
||||
caches.open(cacheTitle)
|
||||
.then(function(cache) {
|
||||
return cache
|
||||
.addAll(relativePathsToCache)
|
||||
.then(_ => {
|
||||
console.log('All files cached.');
|
||||
console.log('All files cached for sw:', cacheVersion);
|
||||
self.skipWaiting();
|
||||
});
|
||||
})
|
||||
);
|
||||
@@ -76,20 +88,25 @@ self.addEventListener('install', function(event) {
|
||||
const fromNetwork = (request, timeout) =>
|
||||
new Promise((resolve, reject) => {
|
||||
const timeoutId = setTimeout(reject, timeout);
|
||||
fetch(request)
|
||||
fetch(request, {cache: "no-store"})
|
||||
.then(response => {
|
||||
if (response.redirected) {
|
||||
throw new Error("Fetch is redirect. Abort usage and cache!");
|
||||
}
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
resolve(response);
|
||||
|
||||
// Prevent requests that are in relativePathsNotToCache from being cached
|
||||
if (doNotCacheRequest(request)) return;
|
||||
|
||||
update(request)
|
||||
updateCache(request)
|
||||
.then(() => console.log("Cache successfully updated for", request.url))
|
||||
.catch(reason => console.log("Cache could not be updated for", request.url, "Reason:", reason));
|
||||
.catch(err => console.log("Cache could not be updated for", request.url, err));
|
||||
})
|
||||
.catch(error => {
|
||||
// Handle any errors that occurred during the fetch
|
||||
console.error(`Could not fetch ${request.url}. Are you online?`);
|
||||
console.error(`Could not fetch ${request.url}.`);
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
@@ -111,16 +128,16 @@ const doNotCacheRequest = request => {
|
||||
};
|
||||
|
||||
// cache the current page to make it available for offline
|
||||
const update = request => new Promise((resolve, reject) => {
|
||||
if (doNotCacheRequest(request)) {
|
||||
reject("Url is specifically prevented from being cached in the serviceworker.");
|
||||
return;
|
||||
}
|
||||
const updateCache = request => new Promise((resolve, reject) => {
|
||||
caches
|
||||
.open(cacheTitle)
|
||||
.then(cache =>
|
||||
fetch(request, {cache: "no-store"})
|
||||
.then(response => {
|
||||
if (response.redirected) {
|
||||
throw new Error("Fetch is redirect. Abort usage and cache!");
|
||||
}
|
||||
|
||||
cache
|
||||
.put(request, response)
|
||||
.then(() => resolve());
|
||||
@@ -129,9 +146,10 @@ const update = request => new Promise((resolve, reject) => {
|
||||
);
|
||||
});
|
||||
|
||||
// general strategy when making a request (eg if online try to fetch it
|
||||
// from cache, if something fails fetch from network. Update cache everytime files are fetched.
|
||||
// This way files should only be fetched if cacheVersion is changed
|
||||
// general strategy when making a request:
|
||||
// 1. Try to retrieve file from cache
|
||||
// 2. If cache is not available: Fetch from network and update cache.
|
||||
// This way, cached files are only updated if the cacheVersion is changed
|
||||
self.addEventListener('fetch', function(event) {
|
||||
if (event.request.method === "POST") {
|
||||
// Requests related to Web Share Target.
|
||||
@@ -141,39 +159,48 @@ self.addEventListener('fetch', function(event) {
|
||||
})());
|
||||
}
|
||||
else {
|
||||
// Regular requests not related to Web Share Target.
|
||||
if (forceFetch) {
|
||||
event.respondWith(fromNetwork(event.request, 10000));
|
||||
}
|
||||
else {
|
||||
event.respondWith(
|
||||
fromCache(event.request)
|
||||
// Regular requests not related to Web Share Target:
|
||||
// If request is excluded from cache -> respondWith fromNetwork
|
||||
// else -> try fromCache first
|
||||
event.respondWith(
|
||||
doNotCacheRequest(event.request)
|
||||
? fromNetwork(event.request, 10000)
|
||||
: fromCache(event.request)
|
||||
.then(rsp => {
|
||||
// if fromCache resolves to undefined fetch from network instead
|
||||
return rsp || fromNetwork(event.request, 10000);
|
||||
if (!rsp) {
|
||||
throw new Error("No match found.");
|
||||
}
|
||||
return rsp;
|
||||
})
|
||||
);
|
||||
}
|
||||
.catch(error => {
|
||||
console.error("Could not retrieve request from cache:", event.request.url, error);
|
||||
return fromNetwork(event.request, 10000);
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// on activation, we clean up the previously registered service workers
|
||||
self.addEventListener('activate', evt => {
|
||||
return evt.waitUntil(
|
||||
caches.keys()
|
||||
.then(cacheNames => {
|
||||
return Promise.all(
|
||||
cacheNames.map(cacheName => {
|
||||
if (cacheName !== cacheTitle) {
|
||||
return caches.delete(cacheName);
|
||||
}
|
||||
})
|
||||
);
|
||||
})
|
||||
)
|
||||
}
|
||||
);
|
||||
console.log("Activate sw:", cacheVersion);
|
||||
evt.waitUntil(clients.claim());
|
||||
return evt.waitUntil(
|
||||
caches
|
||||
.keys()
|
||||
.then(cacheNames => {
|
||||
return Promise.all(
|
||||
cacheNames.map(cacheName => {
|
||||
if (cacheName !== cacheTitle) {
|
||||
console.log("Delete cache:", cacheName);
|
||||
return caches.delete(cacheName);
|
||||
}
|
||||
})
|
||||
);
|
||||
})
|
||||
)
|
||||
});
|
||||
|
||||
const evaluateRequestData = function (request) {
|
||||
return new Promise(async (resolve) => {
|
||||
|
||||
Reference in New Issue
Block a user