diff --git a/Extensions/combined/_locales/en/messages.json b/Extensions/combined/_locales/en/messages.json index b3c4de8..8493b52 100644 --- a/Extensions/combined/_locales/en/messages.json +++ b/Extensions/combined/_locales/en/messages.json @@ -31,5 +31,20 @@ }, "textUpdate": { "message": "update to" + }, + "version30installed": { + "message": "Version 4.0.0.0 installed" + }, + "whatsnew": { + "message": "What's new" + }, + "shortsSupport": { + "message": "YouTube Shorts Support" + }, + "customColors": { + "message": "Custom colors for dislike bar and buttons" + }, + "customNumberFormats": { + "message": "Custom number formats" } } diff --git a/Extensions/combined/_locales/en_GB/messages.json b/Extensions/combined/_locales/en_GB/messages.json deleted file mode 100644 index b3c4de8..0000000 --- a/Extensions/combined/_locales/en_GB/messages.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "extensionName": { - "message": "Return YouTube Dislike" - }, - "extensionDesc": { - "message": "Returns ability to see dislikes" - }, - "textDeveloper": { - "message": "by Dmitry Selivanov & Community" - }, - "linkWebsite": { - "message": "Website" - }, - "linkFAQ": { - "message": "FAQ" - }, - "linkDonate": { - "message": "Donate" - }, - "linkHelp": { - "message": "Help" - }, - "legendSettings": { - "message": "Settings" - }, - "textSettings": { - "message": "Disable like/dislike submission" - }, - "textSettingsHover": { - "message": "Stops counting your likes and dislikes." - }, - "textUpdate": { - "message": "update to" - } -} diff --git a/Extensions/combined/_locales/en_US/messages.json b/Extensions/combined/_locales/en_US/messages.json deleted file mode 100644 index b3c4de8..0000000 --- a/Extensions/combined/_locales/en_US/messages.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "extensionName": { - "message": "Return YouTube Dislike" - }, - "extensionDesc": { - "message": "Returns ability to see dislikes" - }, - "textDeveloper": { - "message": "by Dmitry Selivanov & Community" - }, - "linkWebsite": { - "message": "Website" - }, - "linkFAQ": { - "message": "FAQ" - }, - "linkDonate": { - "message": "Donate" - }, - "linkHelp": { - "message": "Help" - }, - "legendSettings": { - "message": "Settings" - }, - "textSettings": { - "message": "Disable like/dislike submission" - }, - "textSettingsHover": { - "message": "Stops counting your likes and dislikes." - }, - "textUpdate": { - "message": "update to" - } -} diff --git a/Extensions/combined/_locales/es_419/messages.json b/Extensions/combined/_locales/es_419/messages.json deleted file mode 100644 index 3905851..0000000 --- a/Extensions/combined/_locales/es_419/messages.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "extensionName": { - "message": "Regresar los Dislikes de YouTube" - }, - "extensionDesc": { - "message": "Regresa la posibilidad de ver los dislikes" - }, - "textDeveloper": { - "message": "por Dmitry Selivanov y la Comunidad" - }, - "linkWebsite": { - "message": "Página web" - }, - "linkFAQ": { - "message": "P+F" - }, - "linkDonate": { - "message": "Donar" - }, - "linkHelp": { - "message": "Ayuda" - }, - "legendSettings": { - "message": "Ajustes" - }, - "textSettings": { - "message": "Desactivar los dislikes" - }, - "textSettingsHover": { - "message": "Dejar de contar los dislikes." - }, - "textUpdate": { - "message": "actualizar a" - } -} diff --git a/Extensions/combined/_locales/ru/messages.json b/Extensions/combined/_locales/ru/messages.json index dc83f7c..0c1cc5b 100644 --- a/Extensions/combined/_locales/ru/messages.json +++ b/Extensions/combined/_locales/ru/messages.json @@ -1,9 +1,9 @@ { "extensionName": { - "message": "Возвращение отметки не нравится YouTube" + "message": "Return YouTube Dislike" }, "extensionDesc": { - "message": "Возвращает способность видеть отметки не нравится" + "message": "Возвращает способность видеть дизлайки" }, "textDeveloper": { "message": "Дмитрий Селиванов и сообщество" @@ -24,12 +24,27 @@ "message": "Настройки" }, "textSettings": { - "message": "Отключить отправку нравится/не нравится" + "message": "Отключить отправку лайков/дизлайков" }, "textSettingsHover": { "message": "Отключает отправку ваших отметок нравится/не нравится" }, "textUpdate": { "message": "обновление до" + }, + "version30installed": { + "message": "Версия 4.0.0.0 установлена" + }, + "whatsnew": { + "message": "Что нового" + }, + "shortsSupport": { + "message": "Поддержка YouTube Shorts" + }, + "customColors": { + "message": "Выбор цветов дизлайк бара и кнопок" + }, + "customNumberFormats": { + "message": "Выбор формата чисел" } } diff --git a/Extensions/combined/changelog/3/changelog_3.0.html b/Extensions/combined/changelog/3/changelog_3.0.html new file mode 100644 index 0000000..d10562e --- /dev/null +++ b/Extensions/combined/changelog/3/changelog_3.0.html @@ -0,0 +1,68 @@ + + + + + __MSG_extensionName__ + + + + + + +
+ + + + + +

+ __MSG_extensionName__ +

+

+ __MSG_textDeveloper__ +

+

__MSG_version30installed__

+

__MSG_whatsnew__:

+ + +
+ +
+ + + +
+ + + +
+
+
+ + + diff --git a/Extensions/combined/changelog/changelog.css b/Extensions/combined/changelog/changelog.css new file mode 100644 index 0000000..6a38432 --- /dev/null +++ b/Extensions/combined/changelog/changelog.css @@ -0,0 +1,209 @@ +/* Variables */ +:root { + --primary: #cc2929; + --accent: #581111; + + --background: #111; + --secondary: #272727; + --tertiary: #424242; + --lightGrey: #999; + --white: #fff; +} + +/* Window Styling */ +html, +body { + background-color: var(--background); + color: var(--white); + min-width: 300px; + padding: 0.5em; + font-family: "Roboto", Arial, Helvetica, sans-serif; + font-size: 16px; +} + +h1 { + +} + +button { + color: var(--white); + background: var(--secondary); + cursor: pointer; + padding: 5px 16px; + border: none; + border-radius: 4px; + font-weight: 500; + /* box-shadow: 0 2px 4px -1px rgb(0 0 0 / 20%), 0 4px 5px 0 rgb(0 0 0 / 14%), + 0 1px 10px 0 rgb(0 0 0 / 12%); */ + transition: 0.4s; + font-size: 16px; +} + +button:hover { + background: #444; +} + +#ext-version { + padding: 0.25rem 0.5rem; +} + +#ext-update { + cursor: pointer; + color: var(--white); + text-decoration: none; + background: var(--primary); + border-radius: 0.25rem; +} +#ext-update:hover { + text-decoration: underline; +} + +#ext { + padding: 0.25rem 0; + z-index: 69; + position: fixed; + background: var(--secondary); + margin: 0; + bottom: 1.15rem; + right: 1.15rem; + border-radius: 0.25rem; +} + +.switch:before { + content: attr(data-hover); + visibility: hidden; + width: 250px; + background-color: var(--secondary); + border-radius: 0.5rem; + padding: 0.5rem; + + position: absolute; + z-index: 1; + left: 0; + top: 160%; +} + +.switch:hover:before { + visibility: visible; +} + +#advancedToggle { + position: fixed; + background: none; + box-shadow: none; + color: var(--lightGrey); + top: 26px; + right: 26px; + padding: 2px; + z-index: 69; + height: 2rem; + width: 2rem; +} + +#advancedToggle:hover { + color: var(--white); + transform: rotate(-90deg); +} + +#advancedToggle:active { + transform: scale(1.5); +} + +#advancedSettings { + opacity: 0; + pointer-events: none; + transition-duration: 0.15s; + transition-timing-function: ease-in-out; + transform: scale(1.1); + position: fixed; + background: var(--background); + top: 10px; + right: 14px; + width: calc(100% - 65px); + height: calc(100% - 58px); + border: 2px solid var(--secondary); + border-radius: 0.5rem; + padding: 1rem; +} + +#advancedLegend { + color: var(--tertiary) !important; + /* margin: auto; */ /* Center the label */ + /* padding: .25rem .5rem; */ + /* border-radius: .25rem; */ + /* border: .25rem solid var(--secondary); */ +} + +/* Switches */ +.switch { + position: relative; + display: inline-block; + width: 30px; + height: 17px; + margin-bottom: 1rem; +} + +.switch:last-of-type { + margin-bottom: 0; +} + +.switch input { + display: none; +} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: var(--secondary); + transition: 0.4s; + border-radius: 34px; +} + +.slider:before { + position: absolute; + content: ""; + height: 13px; + width: 13px; + left: 2px; + bottom: 2px; + background: var(--lightGrey); + transition: 0.4s; + border-radius: 50%; +} + +input:checked + .slider { + background: var(--accent); +} + +input:checked + .slider:before { + transform: translateX(13px); + background: var(--primary); +} + +.switchLabel { + margin-left: 0.5rem; + width: 250px !important; + transform: translateX(35px); + display: inline-block; +} + +#server-status { + height: 72px; + width: 90px; + /* filter: invert(21%) sepia(100%) saturate(3618%) hue-rotate(102deg) + brightness(96%) contrast(108%); */ +} + +.container { + display: flex; + flex-direction: column; + align-items: center; +} + +h2 { + margin: 0.25rem; +} diff --git a/Extensions/combined/changelog/changelog.js b/Extensions/combined/changelog/changelog.js new file mode 100644 index 0000000..8c9e332 --- /dev/null +++ b/Extensions/combined/changelog/changelog.js @@ -0,0 +1,57 @@ +/* Config */ +const config = { + advanced: false, + disableVoteSubmission: false, + coloredThumbs: false, + coloredBar: false, + colorTheme: "classic", + numberDisplayFormat: "compactShort", + numberDisplayRoundDown: true, + showAdvancedMessage: + '', + hideAdvancedMessage: + '', + + links: { + website: "https://returnyoutubedislike.com", + github: "https://github.com/Anarios/return-youtube-dislike", + discord: "https://discord.gg/mYnESY4Md5", + donate: "https://returnyoutubedislike.com/donate", + faq: "https://returnyoutubedislike.com/faq", + help: "https://returnyoutubedislike.com/help", + }, +}; + +/* Change language */ +function localizeHtmlPage() { + //Localize by replacing __MSG_***__ meta tags + var objects = document.getElementsByTagName("html"); + for (var j = 0; j < objects.length; j++) { + var obj = objects[j]; + + var valStrH = obj.innerHTML.toString(); + var valNewH = valStrH.replace(/__MSG_(\w+)__/g, function (match, v1) { + return v1 ? chrome.i18n.getMessage(v1) : ""; + }); + + if (valNewH != valStrH) { + obj.innerHTML = valNewH; + } + } +} + +localizeHtmlPage(); + +/* Links */ +createLink(config.links.website, "link_website"); +createLink(config.links.github, "link_github"); +createLink(config.links.discord, "link_discord"); +createLink(config.links.faq, "link_faq"); +createLink(config.links.donate, "link_donate"); +createLink(config.links.help, "link_help"); + +function createLink(url, id) { + document.getElementById(id).addEventListener("click", () => { + chrome.tabs.create({ url: url }); + }); +} diff --git a/Extensions/combined/changelog/images/colorize.jpg b/Extensions/combined/changelog/images/colorize.jpg new file mode 100644 index 0000000..32a6141 Binary files /dev/null and b/Extensions/combined/changelog/images/colorize.jpg differ diff --git a/Extensions/combined/changelog/images/colorize_example.jpg b/Extensions/combined/changelog/images/colorize_example.jpg new file mode 100644 index 0000000..add351d Binary files /dev/null and b/Extensions/combined/changelog/images/colorize_example.jpg differ diff --git a/Extensions/combined/changelog/images/number_format.jpg b/Extensions/combined/changelog/images/number_format.jpg new file mode 100644 index 0000000..43a17cc Binary files /dev/null and b/Extensions/combined/changelog/images/number_format.jpg differ diff --git a/Extensions/combined/popup.css b/Extensions/combined/popup.css index b14ee41..dfe94cb 100644 --- a/Extensions/combined/popup.css +++ b/Extensions/combined/popup.css @@ -196,3 +196,9 @@ input:checked + .slider:before { /* filter: invert(21%) sepia(100%) saturate(3618%) hue-rotate(102deg) brightness(96%) contrast(108%); */ } + +.container { + display: flex; + flex-direction: column; + align-items: center; +} diff --git a/Extensions/combined/popup.html b/Extensions/combined/popup.html index d2becf7..aa2d6a8 100644 --- a/Extensions/combined/popup.html +++ b/Extensions/combined/popup.html @@ -1,166 +1,166 @@ - - - __MSG_extensionName__ - - - - + + __MSG_extensionName__ + + + + + + +
+ + - - -
- - - - -

- __MSG_extensionName__ -

-

- __MSG_textDeveloper__ -

+ + +

+ __MSG_extensionName__ +

+

+ __MSG_textDeveloper__ +

- - - -
- - - + + + +
+ + + -
-
-

API Status:

- +
+
+

API Status:

+ -
-
-
+
+
+
- - + + - -
- - -
+ +
+ + +
- -
- - __MSG_legendSettings__ - + +
+ + __MSG_legendSettings__ + - -
- -
-
- - -
-
-
- -
- -
-
- - - + + + __MSG_textSettings__ + +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +   -   -
-
- - + >  + +
+ + diff --git a/Extensions/combined/ryd.background.js b/Extensions/combined/ryd.background.js index 53d8ae9..18eb0fa 100644 --- a/Extensions/combined/ryd.background.js +++ b/Extensions/combined/ryd.background.js @@ -74,6 +74,10 @@ api.runtime.onMessage.addListener((request, sender, sendResponse) => { } }); +api.runtime.onInstalled.addListener(() => { + api.tabs.create({url: api.runtime.getURL("/changelog/3/changelog_3.0.html")}); +}) + async function sendVote(videoId, vote) { api.storage.sync.get(null, async (storageResult) => { if (!storageResult.userId || !storageResult.registrationConfirmed) { @@ -362,6 +366,7 @@ function initializeColorTheme() { } }); } + function initializeNumberDisplayFormat() { api.storage.sync.get(["numberDisplayFormat"], (res) => { if (res.numberDisplayFormat === undefined) {