mirror of
https://github.com/gosticks/PiPer.git
synced 2026-07-01 13:50:01 +00:00
Switched from concatenated strings to template literals
This commit is contained in:
Binary file not shown.
@@ -30,17 +30,17 @@ export const addButton = function(parent) {
|
||||
// Add scaled SVG image to button
|
||||
const image = /** @type {HTMLImageElement} */ (document.createElement('img'));
|
||||
const buttonImage = getResource().buttonImage || 'default';
|
||||
image.src = getExtensionURL('images/' + buttonImage + '.svg');
|
||||
image.src = getExtensionURL(`images/${buttonImage}.svg`);
|
||||
image.style.width = image.style.height = '100%';
|
||||
const buttonScale = getResource().buttonScale;
|
||||
if (buttonScale) image.style.transform = 'scale(' + buttonScale + ')';
|
||||
if (buttonScale) image.style.transform = `scale(${buttonScale})`;
|
||||
button.appendChild(image);
|
||||
|
||||
// Add hover style to button (a nested stylesheet is used to avoid tracking another element)
|
||||
const buttonHoverStyle = getResource().buttonHoverStyle;
|
||||
if (buttonHoverStyle) {
|
||||
const style = document.createElement('style');
|
||||
const css = '#' + BUTTON_ID + ':hover{' + buttonHoverStyle + '}';
|
||||
const css = `#${BUTTON_ID}:hover{${buttonHoverStyle}}`;
|
||||
style.appendChild(document.createTextNode(css));
|
||||
button.appendChild(style);
|
||||
}
|
||||
@@ -83,4 +83,4 @@ export const getButton = function() {
|
||||
*/
|
||||
export const checkButton = function() {
|
||||
return !!document.getElementById(BUTTON_ID);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -101,7 +101,7 @@ export const videoPresentationModeChanged = function(event) {
|
||||
lastUnprocessedCaption = '';
|
||||
processCaptions();
|
||||
|
||||
info('Video presentation mode changed (showingCaptions: ' + showingCaptions + ')');
|
||||
info(`Video presentation mode changed (showingCaptions: ${showingCaptions})`);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -131,7 +131,7 @@ const removeCaptions = function(video, workaround = true) {
|
||||
*/
|
||||
const addCaption = function(video, caption) {
|
||||
|
||||
info('Showing caption "' + caption + '"');
|
||||
info(`Showing caption '${caption}'`);
|
||||
track.addCue(new VTTCue(video.currentTime, video.currentTime + 60, caption));
|
||||
|
||||
showingEmptyCaption = false;
|
||||
@@ -175,9 +175,9 @@ export const processCaptions = function() {
|
||||
if (segment) {
|
||||
const style = window.getComputedStyle(walk.currentNode.parentElement);
|
||||
if (style.fontStyle == 'italic') {
|
||||
caption += '<i>' + segment + '</i>';
|
||||
caption += `<i>${segment}</i>`;
|
||||
} else if (style.textDecoration == 'underline') {
|
||||
caption += '<u>' + segment + '</u>';
|
||||
caption += `<u>${segment}</u>`;
|
||||
} else {
|
||||
caption += segment;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ const mutationObserver = function() {
|
||||
const domainName = location.hostname && location.hostname.match(/([^.]+)\.(?:co\.)?[^.]+$/)[1];
|
||||
|
||||
if (domainName in resources) {
|
||||
info('Matched site ' + domainName + ' (' + location + ')');
|
||||
info(`Matched site ${domainName} (${location})`);
|
||||
setResource(resources[domainName]);
|
||||
|
||||
initialiseCaches();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string></string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>170</string>
|
||||
<string>171</string>
|
||||
<key>Developer Identifier</key>
|
||||
<string>BQ6Q24MF9X</string>
|
||||
<key>URL</key>
|
||||
|
||||
Reference in New Issue
Block a user