Feature/#109 adaptive font color for badges #149

Merged
Serraniel merged 6 commits from feature/#109-adaptive-font-color-for-badges into develop 2020-12-24 11:11:04 +01:00
9 changed files with 432 additions and 389 deletions
Showing only changes of commit a362b1fee4 - Show all commits

View file

@ -19,6 +19,8 @@
* Autoplay after screenshot * Autoplay after screenshot
## Download ## Download
Click the badge for your browser to get to the download page:
[![Chrome Web Store](https://img.shields.io/chrome-web-store/v/hgniihpjiioldkafogebpkbaiflmpimb?label=Google%20Chrome&logo=Google%20Chrome&style=flat-square)](https://chrome.google.com/webstore/detail/aniwatch-plus/hgniihpjiioldkafogebpkbaiflmpimb?hl=de) [![Chrome Web Store](https://img.shields.io/chrome-web-store/v/hgniihpjiioldkafogebpkbaiflmpimb?label=Google%20Chrome&logo=Google%20Chrome&style=flat-square)](https://chrome.google.com/webstore/detail/aniwatch-plus/hgniihpjiioldkafogebpkbaiflmpimb?hl=de)
[![Mozilla Add-on](https://img.shields.io/amo/v/aniwatch-plus?label=Mozilla%20Firefox&logo=Firefox&style=flat-square)](https://addons.mozilla.org/de/firefox/addon/aniwatch-plus/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search) [![Mozilla Add-on](https://img.shields.io/amo/v/aniwatch-plus?label=Mozilla%20Firefox&logo=Firefox&style=flat-square)](https://addons.mozilla.org/de/firefox/addon/aniwatch-plus/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search)
[![GitHub release tag for opera (latest by date including pre-releases)](https://img.shields.io/github/v/release/serraniel/aniwatchplus?include_prereleases&label=Opera&logo=Opera&logoColor=red&style=flat-square)](https://addons.opera.com/de/extensions/details/aniwatch-plus/) [![GitHub release tag for opera (latest by date including pre-releases)](https://img.shields.io/github/v/release/serraniel/aniwatchplus?include_prereleases&label=Opera&logo=Opera&logoColor=red&style=flat-square)](https://addons.opera.com/de/extensions/details/aniwatch-plus/)

774
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "aniwatch-plus", "name": "aniwatch-plus",
"version": "0.4.0-beta", "version": "0.4.2-beta.1",
"description": "Aniwatch Plus is a browser extension for https://aniwatch.me/", "description": "Aniwatch Plus is a browser extension for https://aniwatch.me/",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -34,19 +34,19 @@
"homepage": "https://github.com/Serraniel/AniwatchPlus#readme", "homepage": "https://github.com/Serraniel/AniwatchPlus#readme",
"dependencies": { "dependencies": {
"color": "^3.1.3", "color": "^3.1.3",
"uuid": "^8.3.1" "uuid": "^8.3.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/compat-data": "^7.12.5", "@babel/compat-data": "^7.12.7",
"@babel/core": "^7.12.3", "@babel/core": "^7.12.10",
"@babel/helper-module-imports": "^7.12.5", "@babel/helper-module-imports": "^7.12.5",
"@babel/plugin-proposal-class-properties": "^7.12.1", "@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-private-methods": "^7.12.1", "@babel/plugin-proposal-private-methods": "^7.12.1",
"@babel/preset-env": "^7.12.1", "@babel/preset-env": "^7.12.11",
"@babel/register": "^7.12.1", "@babel/register": "^7.12.10",
"babelify": "^10.0.0", "babelify": "^10.0.0",
"browserify": "^17.0.0", "browserify": "^17.0.0",
"cross-env": "^7.0.2", "cross-env": "^7.0.3",
"cssnano": "^4.1.10", "cssnano": "^4.1.10",
"del": "^6.0.0", "del": "^6.0.0",
"factor-bundle": "^2.5.0", "factor-bundle": "^2.5.0",
@ -55,7 +55,7 @@
"gulp-babel": "^8.0.0", "gulp-babel": "^8.0.0",
"gulp-if": "^3.0.0", "gulp-if": "^3.0.0",
"gulp-imagemin": "^7.1.0", "gulp-imagemin": "^7.1.0",
"gulp-load-plugins": "^2.0.5", "gulp-load-plugins": "^2.0.6",
"gulp-merge": "^0.1.1", "gulp-merge": "^0.1.1",
"gulp-plumber": "^1.2.1", "gulp-plumber": "^1.2.1",
"gulp-postcss": "^9.0.0", "gulp-postcss": "^9.0.0",
@ -63,13 +63,13 @@
"gulp-replace": "^1.0.0", "gulp-replace": "^1.0.0",
"gulp-sass": "^4.1.0", "gulp-sass": "^4.1.0",
"gulp-size": "^3.0.0", "gulp-size": "^3.0.0",
"gulp-sourcemaps": "^2.6.5", "gulp-sourcemaps": "^3.0.0",
"gulp-terser": "^1.4.1", "gulp-terser": "^2.0.0",
"gulp-zip": "^5.0.2", "gulp-zip": "^5.0.2",
"merge-stream": "^2.0.0", "merge-stream": "^2.0.0",
"postcss": "^8.1.7", "postcss": "^8.2.1",
"sass": "^1.29.0", "sass": "^1.30.0",
"terser": "^5.3.8", "terser": "^5.5.1",
"vinyl-buffer": "^1.0.1", "vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0" "vinyl-source-stream": "^2.0.0"
} }

View file

@ -23,7 +23,7 @@ function observeScreenshotTooltip(tooltip) {
// Switched to invisible // Switched to invisible
if (!mutation.oldValue.includes('display: none') && mutation.target.style.display == 'none') { if (!mutation.oldValue.includes('display: none') && mutation.target.style.display == 'none') {
let player = findPlayer(); let player = findPlayer();
if (typeof player !== 'undefined') { if (helper.assigned(player)) {
resumePlayer(player); resumePlayer(player);
} }
} }

View file

@ -31,8 +31,7 @@ function updateLanguageDisplay(node) {
function updateLanguageDisplayListMode(node) { function updateLanguageDisplayListMode(node) {
// last column with flags // last column with flags
let col = node.querySelector('h3.layout-align-end-center'); let col = node.querySelector('h3.layout-align-end-center');
if (!helper.assigned(col) || col.awpManipulated) {
if (typeof col === 'undefined' || col.awpManipulated) {
return; return;
} }
@ -43,7 +42,7 @@ function updateLanguageDisplayBoxMode(node) {
// last column with flags // last column with flags
let col = node.querySelector('div.layout-align-end-start'); let col = node.querySelector('div.layout-align-end-start');
if (typeof col === 'undefined' || col.awpManipulated) { if (!helper.assigned(col) || col.awpManipulated) {
return; return;
} }

View file

@ -70,7 +70,7 @@ function handleQuickSearch(event) {
function handleSearchForShiftF(event) { function handleSearchForShiftF(event) {
if (helper.isShiftPressed) { if (helper.isShiftPressed) {
// check if some kind of input is focused already; we then prevent our hotkey // check if some kind of input is focused already; we then prevent our hotkey
if (document.activeElement instanceof HTMLInputElement || document.activeElement.isContentEditable) { if (document.activeElement instanceof HTMLInputElement || document.activeElement instanceof HTMLTextAreaElement || document.activeElement.isContentEditable) {
return; return;
} }

View file

@ -1,6 +1,7 @@
import * as core from '../utils/aniwatchCore'; import * as core from '../utils/aniwatchCore';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { getGlobalConfiguration, SETTINGS_w2gDisplayCharacterCounter } from '../configuration/configuration'; import { getGlobalConfiguration, SETTINGS_w2gDisplayCharacterCounter } from '../configuration/configuration';
import { assigned } from '../utils/helpers';
export function init() { export function init() {
getGlobalConfiguration().getProperty(SETTINGS_w2gDisplayCharacterCounter, value => { getGlobalConfiguration().getProperty(SETTINGS_w2gDisplayCharacterCounter, value => {
@ -16,7 +17,7 @@ function manipulateChatInput() {
let textarea = document.querySelector('.chat-input textarea'); let textarea = document.querySelector('.chat-input textarea');
// avoid duplicate registration // avoid duplicate registration
if (typeof textarea.dataset.charCounterId !== 'undefined') { if (assigned(textarea.dataset.charCounterId)) {
return; return;
} }
@ -40,7 +41,6 @@ function addCharCounter(textarea) {
updateCharCounter(textarea, charCounterSpan); updateCharCounter(textarea, charCounterSpan);
textarea.addEventListener('keyup', () => { textarea.addEventListener('keyup', () => {
console.log('TRIGGER')
updateCharCounter(textarea, charCounterSpan) updateCharCounter(textarea, charCounterSpan)
}); });
} }

View file

@ -82,7 +82,7 @@ function awaitPageLoaded() {
}); });
}; };
if (typeof preLoader === 'undefined') { if (!helper.assigned(preLoader)) {
runScripts(); runScripts();
return; return;
} }

View file

@ -1,8 +1,8 @@
{ {
"name": "Aniwatch Plus", "name": "Aniwatch Plus",
"short_name": "AW+", "short_name": "AW+",
"version": "0.4.0.0", "version": "0.4.2.1",
"version_name": "0.4.0 Beta", "version_name": "0.4.2 Beta",
"description": "Aniwatch Plus is an unofficial extension which provides several UI improvments for https://aniwatch.me.", "description": "Aniwatch Plus is an unofficial extension which provides several UI improvments for https://aniwatch.me.",
"permissions": [ "permissions": [
"storage", "storage",