Skip to content

Commit

Permalink
Merge pull request #24 from horihiro/bump-0.1.4
Browse files Browse the repository at this point in the history
Bump 0.1.4
  • Loading branch information
horihiro authored Nov 3, 2023
2 parents 446cd41 + 682cde3 commit 34a0e50
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ If you can try a development version, the following steps are needed.

# Change logs

## [0.1.4](https://github.com/horihiro/TextBlurrer-ChromeExtension/releases/tag/0.1.4)

- New features
- Add a link to [new issue](https://github.com/horihiro/TextBlurrer-ChromeExtension/issues/new)
- Bug fixes
- Fix logic for getting backgroud color
- Restore `title` attribute

## [0.1.3](https://github.com/horihiro/TextBlurrer-ChromeExtension/releases/tag/0.1.3)

- New features
Expand Down
17 changes: 16 additions & 1 deletion content/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,13 @@
) {
n.classList.add(blurredClassName);
n.classList.add(keepClassName);
options?.showValue && n.setAttribute('title', o.keyword);
if (options?.showValue) {
const originalTitle = n.getAttribute('title');
if (originalTitle) {
n.setAttribute('data-tb-original-title', originalTitle);
}
n.setAttribute('title', o.keyword);
}
if (size > 5) n.style.filter += ` blur(${size}px)`;
return;
}
Expand Down Expand Up @@ -347,6 +353,7 @@
});
}
const getBackgroundColorAlongDOMTree = (element) => {
if (element == document) return '';
const computedStyle = getComputedStyle(element);
return (!/(?:^| )rgba *\( *\d+ *, *\d+ *, *\d+ *, *0 *\)(?:$| )/.test(computedStyle.getPropertyValue('background-color')))
? computedStyle.getPropertyValue('background-color')
Expand Down Expand Up @@ -443,6 +450,14 @@
const now = Date.now();
m.forEach((n) => {
if (n.classList.contains(blurredClassName) && n.classList.contains(keepClassName)) {
// restore title
const originalTitle = n.getAttribute('data-tb-original-title');
if (originalTitle) {
n.setAttribute('title', originalTitle);
n.removeAttribute('data-tb-original-title');
}
else n.removeAttribute('title');

// restore class
n.classList.remove(blurredClassName);
n.classList.remove(keepClassName);
Expand Down
18 changes: 17 additions & 1 deletion popup/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,20 @@ input[type="checkbox"]:checked.blur-input+span::before {
left: 0;
top: 0;
z-index: -1;
}
}

div#linkContainer {
position: absolute;
bottom: 10px;
left: 10px;
font-size: small;
}
div#linkContainer a {
color: #1191ff;
text-decoration:underline;
}

div#linkContainer a>img {
filter: invert(44%) sepia(75%) saturate(3284%) hue-rotate(191deg) brightness(102%) contrast(100%);
height: 20px;
}
1 change: 1 addition & 0 deletions popup/img/arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions popup/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
</head>

<body>
<div id="linkContainer">
<div id="linkWrapper">
<a href="https://github.com/horihiro/TextBlurrer-ChromeExtension/issues/new" target="_blank"
rel="noopener noreferrer">Report an issue<img src="./img/arrow.svg"/></a><br>
</div>
</div>
<div id="toggleButton">
<label class="switch">
<input type="checkbox" id="statusCheckbox">
Expand Down

0 comments on commit 34a0e50

Please sign in to comment.