Skip to content

Commit

Permalink
Added initial ESPN support
Browse files Browse the repository at this point in the history
  • Loading branch information
amarcu5 committed Mar 31, 2019
1 parent 3b66f11 commit 4f1dbbf
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
Binary file modified out/PiPer-chrome.zip
Binary file not shown.
Binary file modified out/PiPer-safari-legacy.safariextz
Binary file not shown.
Binary file modified out/PiPer-safari.pkg
Binary file not shown.
53 changes: 53 additions & 0 deletions src/common/scripts/resources/espn.js
@@ -0,0 +1,53 @@
import { getButton } from './../button.js'

export const domain = 'espn';

export const resource = {
buttonClassName: 'media-icon',
buttonDidAppear: function() {
// Get localized button title and hide default tooltip
const button = getButton();
const /** string */ title = button.title;
button.title = '';

// Create stylized tooltip and add to DOM
const tooltip = /** @type {HTMLElement} */ (document.createElement('div'));
tooltip.className = 'control-tooltip';
tooltip.style.cssText = /** CSS */ (`
right: 0px;
bottom: 35px;
transition: bottom 0.2s ease-out;
`);
tooltip.textContent = title;
button.appendChild(tooltip);

// Display stylized tooltip on mouseover
button.addEventListener('mouseover', function() {
button.classList.add('displaying');
tooltip.style.bottom = '75px';
});
button.addEventListener('mouseout', function() {
button.classList.remove('displaying');
tooltip.style.bottom = '35px';
});
},
buttonElementType: 'div',
buttonInsertBefore: function(/** Element */ parent) {
return parent.lastChild;
},
buttonParent: function() {
return document.querySelector('.controls-right-horizontal');
},
buttonScale: 0.7,
buttonStyle: /** CSS */ (`
width: 44px;
height: 44px;
order: 4;
`),
captionElement: function() {
return document.querySelector('.text-track-display');
},
videoElement: function() {
return document.querySelector('video.js-video-content');
},
};
2 changes: 1 addition & 1 deletion src/safari-legacy/update.plist
Expand Up @@ -10,7 +10,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0.3</string>
<key>CFBundleVersion</key>
<string>209</string>
<string>210</string>
<key>Developer Identifier</key>
<string>BQ6Q24MF9X</string>
<key>URL</key>
Expand Down

0 comments on commit 4f1dbbf

Please sign in to comment.