Fix locales, fix the popup basic template

This commit is contained in:
ilyaigpetrov 2024-07-30 19:50:23 +05:00
parent 3985973d06
commit 1a75f766e8
6 changed files with 33 additions and 57 deletions

View File

@ -10,36 +10,13 @@
"FOR_TESTING": { "FOR_TESTING": {
"message": "FOR TESTING" "message": "FOR TESTING"
}, },
"Version": {
"IfToDecode": { "message": "Version"
"message": "If to decode",
"description": ""
}, },
"IfToEncodeUrlTerminators": { "PacUpdated": {
"message": "If to encode URL terminators", "message": "Updated"
"description": ""
},
"IfToDecodeMultipleTimes": {
"message": "If to decode multiple times",
"description": ""
}, },
"Donate": { "Donate": {
"message": "Donate ❤", "message": "Donate ❤"
"description": ""
},
"CopyUnicodeUrl": {
"message": "Copy Unicode URL",
"description": ""
},
"IconHint": {
"message": "Click to copy unicode URL into the clipboard",
"description": ""
},
"CopyUnicodeLinkToHighlight": {
"message": "Copy Unicode link to highlight",
"description": ""
},
"CopyUrlFromTheAddressBar": {
"message": "Copy URL from the address bar"
} }
} }

View File

@ -4,31 +4,19 @@
"description": "Name of the extension." "description": "Name of the extension."
}, },
"ExtensionDescription": { "ExtensionDescription": {
"message": "Копируйте юникодные ссылки в буфер обмена без ужасных кодировок с процентами или Punycode!", "message": "Обход интернет-цензуры в России: https://git.io/ac-wiki",
"description": "Description of the extension." "description": "Description of the extension."
}, },
"FOR_TESTING": { "FOR_TESTING": {
"message": "FOR TESTING" "message": "ДЛЯ ТЕСТОВ"
}, },
"Version": {
"IfToDecode": { "message": "Версия"
"message": "Декодировать",
"description": ""
}, },
"IfToEncodeUrlTerminators": { "PacUpdated": {
"message": "Кодировать знаки окончания URL", "message": "Обновлялись"
"description": ""
}, },
"Donate": { "Donate": {
"message": "Поддержать ❤", "message": "Поддержать ❤"
"description": ""
},
"CopyUnicodeUrl": {
"message": "Скопировать юникодную ссылку",
"description": ""
},
"IconHint": {
"message": "Кликните для копирования юникодной ссылки в буфер обмена",
"description": ""
} }
} }

View File

@ -31,7 +31,7 @@ export const render = ({ version, edition }) => {
"action": { "action": {
"default_title": "default_title":
`__MSG___ | __MSG_Version__: ${version + localizedSuffix}`, `__MSG_PacUpdated__ | __MSG_Version__: ${version + localizedSuffix}`,
"default_popup": "/src/pages/options/index.html" "default_popup": "/src/pages/options/index.html"
}, },
"options_ui": { "options_ui": {

View File

@ -3,8 +3,9 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<style> <style>
:root { :root, html, body {
background: url('./gsbg.png') no-repeat; /*background: url('./gsbg.png') no-repeat;*/
z-index: 0;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
@ -26,11 +27,20 @@
color: #bfbfbf; color: #bfbfbf;
} }
} }
img.gsbg {
z-index: -1;
position: relative;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
</style> </style>
</head> </head>
<body> <body>
<img src="./gsbg.png" class="gsbg">
<header> <header>
<div>PAC-script</div> PAC-script:
</header> </header>
<nav> <nav>
<ul> <ul>
@ -42,10 +52,10 @@
<input type="radio" value="anticensority" name="pacScript" id="anticensority"> <input type="radio" value="anticensority" name="pacScript" id="anticensority">
<label for="anticensority">Антицензорити</label> <label for="anticensority">Антицензорити</label>
</li> </li>
<!-- li> <li>
<input type="radio" value="external" name="pacScript"> <input type="radio" value="external" name="pacScript">
<label for="external">Внешний:</label> <input type="text"> <label for="external">Внешний:</label> <input type="url">
</li--> </li>
<li> <li>
<input type="radio" value="disabled" name="pacScript" id="disabled" checked> <input type="radio" value="disabled" name="pacScript" id="disabled" checked>
<label for="disabled">Отключить / сброс</label> <label for="disabled">Отключить / сброс</label>
@ -58,4 +68,4 @@
</footer> </footer>
<script src="./index.mjs" type="module"></script> <script src="./index.mjs" type="module"></script>
</body> </body>
</html> </html>

View File

@ -1,3 +1,4 @@
/*
import { storage } from '../../lib/common-apis.mjs'; import { storage } from '../../lib/common-apis.mjs';
donate.href = await storage.getAsync('donateUrl'); donate.href = await storage.getAsync('donateUrl');
@ -16,7 +17,7 @@ options.forEach(([key, value], i) => {
chrome.contextMenus.update(key, { checked: target.checked }); chrome.contextMenus.update(key, { checked: target.checked });
}; };
}); });
*/
const textElements = document.querySelectorAll('[data-localize]'); const textElements = document.querySelectorAll('[data-localize]');
textElements.forEach((e) => { textElements.forEach((e) => {
const ref = e.dataset.localize; const ref = e.dataset.localize;

View File

@ -35,7 +35,7 @@ const ifAllArgsProvided = requiredFlags.reduce(
const currentDate = new Date().toISOString().split('T')[0].replaceAll('-', ''); const currentDate = new Date().toISOString().split('T')[0].replaceAll('-', '');
const semver = process.env.npm_package_version; const semver = process.env.npm_package_version;
const context = { const context = {
version: `${semver}.${currentDate}`, version: `${currentDate}.${semver}`,
edition: args.edition, edition: args.edition,
}; };