about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-10-25 23:23:30 +0200
committerSoispha <soispha@vhack.eu>2023-10-25 23:23:30 +0200
commit701a5da284308f3a561fa6670124d358dd9f2ba9 (patch)
tree5064dc1e5754d290fd49a813698d023e81a6e7ef
parentbuild(build.sh): Add a script, which makes maintaining this fork easier (diff)
parentAdded support for Chromium Sync https://github.com/libredirect/browser_extens... (diff)
downloadlibredirect-701a5da284308f3a561fa6670124d358dd9f2ba9.zip
chore(merge): remote-tracking branch 'origin/master'
-rw-r--r--src/assets/images/mozhi-icon.svg154
-rw-r--r--src/assets/javascripts/services.js89
-rw-r--r--src/config.json6
-rw-r--r--src/pages/options/widgets/general.js45
4 files changed, 226 insertions, 68 deletions
diff --git a/src/assets/images/mozhi-icon.svg b/src/assets/images/mozhi-icon.svg
new file mode 100644
index 00000000..b04b5416
--- /dev/null
+++ b/src/assets/images/mozhi-icon.svg
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   width="512"
+   height="512"
+   viewBox="0 0 512 512"
+   version="1.1"
+   id="svg1"
+   sodipodi:docname="mozhi.svg"
+   inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
+   inkscape:export-filename="mozhi.png"
+   inkscape:export-xdpi="96"
+   inkscape:export-ydpi="96"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <sodipodi:namedview
+     id="namedview1"
+     pagecolor="#ffffff"
+     bordercolor="#eeeeee"
+     borderopacity="1"
+     inkscape:showpageshadow="0"
+     inkscape:pageopacity="0"
+     inkscape:pagecheckerboard="false"
+     inkscape:deskcolor="#d1d1d1"
+     inkscape:document-units="px"
+     inkscape:zoom="0.85449218"
+     inkscape:cx="126.39086"
+     inkscape:cy="247.51543"
+     inkscape:window-width="1888"
+     inkscape:window-height="1060"
+     inkscape:window-x="32"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="layer1"
+     showgrid="false" />
+  <defs
+     id="defs1">
+    <rect
+       x="447.58857"
+       y="274.24914"
+       width="82.898286"
+       height="70.866286"
+       id="rect6" />
+    <rect
+       x="444.70632"
+       y="249.71617"
+       width="91.789733"
+       height="104.34795"
+       id="rect5" />
+    <rect
+       x="417.77323"
+       y="221.92324"
+       width="75.620828"
+       height="87.946305"
+       id="rect4" />
+    <rect
+       x="31.513527"
+       y="105.19809"
+       width="77.838314"
+       height="113.70924"
+       id="rect3" />
+    <rect
+       x="444.05983"
+       y="63.136958"
+       width="55.320802"
+       height="148.09968"
+       id="rect2" />
+  </defs>
+  <g
+     inkscape:label="Calque 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <circle
+       style="fill:#f57c00;stroke-width:4.40315;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.53144;fill-opacity:1"
+       id="path1"
+       cx="256"
+       cy="256"
+       r="256" />
+    <g
+       id="g11"
+       transform="translate(-1.6455033e-8,-8.8717685)">
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:462.93px;line-height:0;font-family:FreeSerif;-inkscape-font-specification:FreeSerif;letter-spacing:0.52px;word-spacing:1.62px;white-space:pre;inline-size:0;display:inline;fill:#fbe9e7;fill-opacity:1;stroke:none;stroke-width:3.47197"
+         x="110.57372"
+         y="306.22528"
+         id="text1"
+         transform="translate(4.9270244,-6.9413264)"
+         inkscape:label="Tamil"><tspan
+           id="tspan1"
+           x="110.57372"
+           y="306.22528"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0;font-family:FreeSerif;-inkscape-font-specification:FreeSerif;letter-spacing:0.52px;word-spacing:1.62px;stroke-width:3.47197">ழ</tspan></text>
+      <text
+         xml:space="preserve"
+         id="text2"
+         style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';white-space:pre;shape-inside:url(#rect2);display:inline;fill:#fbe9e7;fill-opacity:1;stroke:none"
+         transform="matrix(2.799327,0,0,3.3785361,-962.26923,-98.905679)"
+         inkscape:label="O"><tspan
+           x="444.06055"
+           y="98.527344"
+           id="tspan6">O</tspan></text>
+      <text
+         xml:space="preserve"
+         id="text3"
+         style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';white-space:pre;shape-inside:url(#rect3);display:inline;fill:#fbe9e7;fill-opacity:1;stroke:none"
+         transform="matrix(2.9268206,0,0,2.9268206,53.853031,-147.27301)"
+         inkscape:label="M"><tspan
+           x="31.513672"
+           y="140.58789"
+           id="tspan7">M</tspan></text>
+      <text
+         xml:space="preserve"
+         id="text4"
+         style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';white-space:pre;shape-inside:url(#rect4);display:inline;fill:#fbe9e7;fill-opacity:1;stroke:none"
+         transform="matrix(3.1593397,0,0,2.8648022,-1159.7463,-343.82656)"
+         inkscape:label="Z"><tspan
+           x="417.77344"
+           y="257.31445"
+           id="tspan8">Z</tspan></text>
+      <text
+         xml:space="preserve"
+         id="text5"
+         style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';white-space:pre;shape-inside:url(#rect5);display:inline;fill:#fbe9e7;fill-opacity:1;stroke:none"
+         transform="matrix(2.900492,0,0,2.900492,-998.44727,-381.36539)"
+         inkscape:label="H"><tspan
+           x="444.70703"
+           y="285.10742"
+           id="tspan9">H</tspan></text>
+      <g
+         id="g10"
+         inkscape:label="I">
+        <path
+           id="path10"
+           style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';white-space:pre;shape-inside:url(#rect6);display:inline;fill:#fbe9e7;fill-opacity:1;stroke:none"
+           d="m 452.34766,289.85002 c 0.22541,-0.20952 0.45142,-0.41589 0.67406,-0.63903 0.32908,-0.32981 0.65502,-0.67506 0.97635,-1.03568 0.32133,-0.36061 0.63824,-0.73678 0.94979,-1.12946 0.31155,-0.39269 0.61727,-0.80176 0.91702,-1.22778 0.29975,-0.42602 0.59324,-0.86886 0.87916,-1.32948 0.28593,-0.46063 0.56447,-0.93921 0.83453,-1.43571 0.16921,-0.31108 0.32867,-0.64231 0.491,-0.96787 h -7.06609 c -0.0345,0.0663 -0.0646,0.13695 -0.0994,0.20284 -0.32015,0.60473 -0.65585,1.19202 -1.00573,1.75663 -0.32204,0.51971 -0.65924,1.01474 -1.0046,1.49221 l 3.45395,1.58826 z"
+           transform="matrix(3.4567616,0,0,3.4567616,-1200.9959,-724.14164)" />
+        <path
+           id="path9"
+           style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';white-space:pre;shape-inside:url(#rect6);display:inline;fill:#fbe9e7;fill-opacity:1;stroke:none"
+           d="m 451.63291,310.64486 h 10.2347 v -3.43981 l -3.47993,-1.60013 v -18.47997 l 3.47993,-1.60013 v -3.43981 h -3.79804 c -0.16233,0.32556 -0.32179,0.65679 -0.491,0.96787 -0.27006,0.4965 -0.5486,0.97508 -0.83453,1.43571 -0.28592,0.46062 -0.57941,0.90346 -0.87916,1.32948 -0.29975,0.42602 -0.60547,0.83509 -0.91702,1.22778 -0.31155,0.39268 -0.62846,0.76885 -0.94979,1.12946 -0.32133,0.36062 -0.64727,0.70587 -0.97635,1.03568 -0.22264,0.22314 -0.44865,0.42951 -0.67406,0.63903 v 15.18763 h 0.14634 c 0.46872,0 0.87071,0.0248 1.20969,0.0729 0.33899,0.0481 0.61522,0.11925 0.83284,0.21132 0.10881,0.046 0.20303,0.0975 0.28307,0.15368 0.08,0.0562 0.14601,0.11772 0.19832,0.18363 0.0523,0.0659 0.0908,0.13625 0.11639,0.21132 0.0256,0.0751 0.0384,0.15474 0.0384,0.23844 0,0.13392 -0.0422,0.48538 -0.15312,0.93736 -0.0554,0.22599 -0.12811,0.47691 -0.22149,0.73847 -0.0934,0.26157 -0.20712,0.53392 -0.34522,0.80176 -0.13811,0.26784 -0.30024,0.53151 -0.48987,0.77633 -0.18964,0.24482 -0.4069,0.47082 -0.65486,0.66333 -0.12398,0.0963 -0.25567,0.18392 -0.39551,0.2616 -0.13984,0.0777 -0.28812,0.14513 -0.44466,0.20058 -0.15655,0.0554 -0.32142,0.0987 -0.49552,0.12826 -0.10754,0.0183 -0.22508,0.021 -0.33958,0.0283 z"
+           transform="matrix(3.4567616,0,0,3.4567616,-1200.9959,-724.14164)" />
+        <path
+           id="path8"
+           style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';white-space:pre;shape-inside:url(#rect6);display:inline;fill:#fbe9e7;fill-opacity:1;stroke:none"
+           d="m 451.63291,310.64486 c 0.1145,-0.007 0.23204,-0.01 0.33958,-0.0283 0.1741,-0.0295 0.33897,-0.0728 0.49552,-0.12826 0.15654,-0.0555 0.30482,-0.12289 0.44466,-0.20058 0.13984,-0.0777 0.27153,-0.16534 0.39551,-0.2616 0.24796,-0.19251 0.46522,-0.41851 0.65486,-0.66333 0.18963,-0.24482 0.35176,-0.50849 0.48987,-0.77633 0.1381,-0.26784 0.25184,-0.54019 0.34522,-0.80176 0.0934,-0.26156 0.16604,-0.51248 0.22149,-0.73847 0.1109,-0.45198 0.15312,-0.80344 0.15312,-0.93736 0,-0.0837 -0.0128,-0.16337 -0.0384,-0.23844 -0.0256,-0.0751 -0.0641,-0.1454 -0.11639,-0.21132 -0.0523,-0.0659 -0.11828,-0.12739 -0.19832,-0.18363 -0.08,-0.0562 -0.17426,-0.10765 -0.28307,-0.15368 -0.21762,-0.0921 -0.49385,-0.16319 -0.83284,-0.21132 -0.33898,-0.0481 -0.74097,-0.0729 -1.20969,-0.0729 h -0.14634 v 0.56727 l -3.47994,1.60013 v 3.43981 z"
+           transform="matrix(3.4567616,0,0,3.4567616,-1200.9959,-724.14164)" />
+      </g>
+    </g>
+  </g>
+</svg>
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index 6610b3d7..446926c0 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -172,6 +172,9 @@ function redirect(url, type, initiator, forceRedirection) {
 		case "simplyTranslate": {
 			return `${randomInstance}/${url.search}`
 		}
+		case "mozhi": {
+			return `${randomInstance}`
+		}
 		case "libreTranslate": {
 			let search = url.search
 				.replace("sl", "source")
@@ -645,50 +648,50 @@ async function reverse(url) {
 }
 
 const defaultInstances = {
-	// This is still a little bit flaky, thus not activated by default
-	'invidious': [ 'https://invidious.vhack.eu' ],
-	'piped': [ ],
-	'pipedMaterial': [ ],
-	'cloudtube': [ ],
-	'poketube': [ ],
-	'proxiTok': [ ],
-	'nitter': [ ],
+	'invidious': [ 'https://invidious.vhack.eu' ], // still a little bit flaky, thus not active
+	'piped': ['https://pipedapi-libre.kavin.rocks'],
+	'pipedMaterial': ['https://piped-material.xn--17b.net'],
+	'cloudtube': ['https://tube.cadence.moe'],
+	'poketube': ['https://poketube.fun'],
+	'proxiTok': ['https://proxitok.pabloferreiro.es'],
+	'nitter': ['https://nitter.net'],
 	'libreddit': [ 'https://libreddit.vhack.eu' ],
-	'teddit': [ ],
-	'scribe': [ ],
-	'libMedium': [ ],
-	'quetre': [ ],
-	'libremdb': [ ],
-	'simplyTranslate': [ ],
-	'searxng': [ ],
-	'4get': [ ],
-	'rimgo': [ ],
-	'hyperpipe': [ ],
-	'facil': [ ],
-	'osm': [ ],
-	'breezeWiki': [ ],
-	'neuters': [ ],
-	'dumb': [ ],
-	"intellectual": [ ],
-	'ruralDictionary': [ ],
-	'anonymousOverflow': [ ],
-	'biblioReads': [ ],
-	'wikiless': [ ],
-	'suds': [ ],
-	'waybackClassic': [ ],
-	'gothub': [ ],
-	'mikuInvidious': [ ],
-	"tent": [ ],
-	"wolfreeAlpha": [ ],
-	"laboratory": [ ],
-	'binternet': [ ],
-	'pixivFe': [ ],
-	'indestructables': [ ],
-	'destructables': [ ],
-	'safetwitch': [ ],
-	'proxigram': [ ],
-	'tuboYoutube': [ ],
-	'tuboSoundcloud': [ ]
+	'teddit': ['https://teddit.net'],
+	'scribe': ['https://scribe.rip'],
+	'libMedium': ['https://md.vern.cc'],
+	'quetre': ['https://quetre.iket.me'],
+	'libremdb': ['https://libremdb.iket.me'],
+	'simplyTranslate': ['https://simplytranslate.org'],
+	'mozhi': ['https://mozhi.aryak.me'],
+	'searxng': ['https://search.bus-hit.me'],
+	'4get': ['https://4get.ca'],
+	'rimgo': ['https://rimgo.vern.cc'],
+	'hyperpipe': ['https://hyperpipe.surge.sh'],
+	'facil': [' https://facilmap.org '],
+	'osm': ['https://www.openstreetmap.org'],
+	'breezeWiki': ['https://breezewiki.com'],
+	'neuters': ['https://neuters.de'],
+	'dumb': ['https://dm.vern.cc'],
+	"intellectual": ['https://intellectual.insprill.net'],
+	'ruralDictionary': ['https://rd.vern.cc'],
+	'anonymousOverflow': ['https://code.whatever.social'],
+	'biblioReads': ['https://biblioreads.ml'],
+	'wikiless': ['https://wikiless.org'],
+	'suds': ['https://sd.vern.cc'],
+	'waybackClassic': ['https://wayback-classic.net'],
+	'gothub': ['https://gh.odyssey346.dev'],
+	'mikuInvidious': ['https://mikuinv.resrv.org'],
+	"tent": ['https://tent.sny.sh'],
+	"wolfreeAlpha": ['https://gqq.gitlab.io', 'https://uqq.gitlab.io'],
+	"laboratory": ['https://lab.vern.cc'],
+	'binternet': ['https://binternet.ahwx.org'],
+	'pixivFe': ['https://pixivfe.exozy.me'],
+	'indestructables': ['https://indestructables.private.coffee'],
+	'destructables': ['https://ds.vern.cc'],
+	'safetwitch': ['https://safetwitch.drgns.space'],
+	'proxigram': ['https://proxigram.privacyfrontends.repl.co'],
+	'tuboYoutube': ['https://tubo.migalmoreno.com'],
+	'tuboSoundcloud': ['https://tubo.migalmoreno.com'],
 }
 
 function initDefaults() {
diff --git a/src/config.json b/src/config.json
index 03660afc..9ff73dae 100644
--- a/src/config.json
+++ b/src/config.json
@@ -523,6 +523,12 @@
 					"url": "https://git.sr.ht/~metalune/simplytranslate_web",
 					"localhost": true
 				},
+				"mozhi": {
+					"name": "Mozhi",
+					"instanceList": true,
+					"url": "https://codeberg.org/aryak/mozhi",
+					"localhost": false
+				},
 				"libreTranslate": {
 					"name": "LibreTranslate",
 					"instanceList": true,
diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js
index 794e3e7e..ed61440b 100644
--- a/src/pages/options/widgets/general.js
+++ b/src/pages/options/widgets/general.js
@@ -68,34 +68,29 @@ importSettingsElement.addEventListener("change", () => {
 const exportSettingsSync = document.getElementById("export-settings-sync")
 const importSettingsSync = document.getElementById("import-settings-sync")
 const importSettingsSyncText = document.getElementById("import_settings_sync_text")
-if (!isChrome) {
-	exportSettingsSync.addEventListener("click", async () => {
-		let options = await utils.getOptions()
-		options.version = browser.runtime.getManifest().version
-		browser.storage.sync.set({ options }, () => location.reload())
-	})
 
-	importSettingsSync.addEventListener("click", () => {
-		function importError() {
-			importSettingsSyncText.innerHTML = '<span style="color:red;">Error!</span>'
-			setTimeout(() => (importSettingsSyncText.innerHTML = oldHTML), 1000)
+exportSettingsSync.addEventListener("click", async () => {
+	let options = await utils.getOptions()
+	options.version = browser.runtime.getManifest().version
+	browser.storage.sync.set({ options }, () => location.reload())
+})
+
+importSettingsSync.addEventListener("click", () => {
+	function importError() {
+		importSettingsSyncText.innerHTML = '<span style="color:red;">Error!</span>'
+		setTimeout(() => (importSettingsSyncText.innerHTML = oldHTML), 1000)
+	}
+	const oldHTML = importSettingsSyncText.innerHTML
+	importSettingsSyncText.innerHTML = "..."
+	browser.storage.sync.get({ options }, r => {
+		const options = r.options
+		if (options.version == browser.runtime.getManifest().version) {
+			browser.storage.local.set({ options }, () => location.reload())
+		} else {
+			importError()
 		}
-		const oldHTML = importSettingsSyncText.innerHTML
-		importSettingsSyncText.innerHTML = "..."
-		browser.storage.sync.get({ options }, r => {
-			const options = r.options
-			if (options.version == browser.runtime.getManifest().version) {
-				browser.storage.local.set({ options }, () => location.reload())
-			} else {
-				importError()
-			}
-		})
 	})
-} else {
-	exportSettingsSync.style.display = 'none'
-	importSettingsSync.style.display = 'none'
-}
-
+})
 
 const resetSettings = document.getElementById("reset-settings")
 resetSettings.addEventListener("click", async () => {