Switched from concatenated strings to template literals

This commit is contained in:
amarcu5
2018-09-29 12:29:31 +01:00
parent a3140ed05f
commit fb024ae0cc
5 changed files with 10 additions and 10 deletions

Binary file not shown.

View File

@@ -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);
};
};

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -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>