1
- import { getResource } from './../common .js'
1
+ import { getButton } from './../button .js'
2
2
3
3
export const domain = 'hulu' ;
4
4
5
5
export const resource = {
6
- buttonClassName : 'simple-button' ,
7
6
buttonDidAppear : function ( ) {
8
- const buttonParent = getResource ( ) . buttonParent ( ) ;
9
- buttonParent . querySelector ( '.progress-bar-tracker' ) . style . width = 'calc(100% - 380px)' ;
10
- buttonParent . querySelector ( '.progress-time-container' ) . style . marginRight = '45px' ;
7
+
8
+ // Get localized button title and hide default tooltip
9
+ const button = getButton ( ) ;
10
+ const /** string */ title = button . title ;
11
+ button . title = '' ;
12
+
13
+ // Create stylized tooltip and add to DOM
14
+ const tooltip = /** @type {HTMLElement } */ ( document . createElement ( 'div' ) ) ;
15
+ tooltip . className = 'button-tool-tips' ;
16
+ tooltip . style . cssText = /** CSS */ ( `
17
+ white-space: nowrap;
18
+ padding: 0 5px;
19
+ right: 0;
20
+ ` ) ;
21
+ tooltip . textContent = title . toUpperCase ( ) ;
22
+ button . appendChild ( tooltip ) ;
23
+
24
+ // Display stylized tooltip on mouseover
25
+ button . addEventListener ( 'mouseover' , function ( ) {
26
+ tooltip . style . display = 'block' ;
27
+ } ) ;
28
+ button . addEventListener ( 'mouseout' , function ( ) {
29
+ tooltip . style . display = 'none' ;
30
+ } ) ;
11
31
} ,
12
32
buttonElementType : 'div' ,
13
- buttonHoverStyle : /** CSS */ ( `
14
- filter: brightness(50%) sepia(1) hue-rotate(58deg) saturate(160%) brightness(110%) !important;
15
- ` ) ,
33
+ buttonHoverStyle : /** CSS */ ( `opacity: 1.0 !important` ) ,
34
+ buttonInsertBefore : function ( /** Element */ parent ) {
35
+ return document . querySelector ( '.controls__view-mode-button' ) ;
36
+ } ,
16
37
buttonParent : function ( ) {
17
- return document . querySelector ( '#site -player .main-bar ' ) ;
38
+ return document . querySelector ( '#dash -player-container .controls__menus-right ' ) ;
18
39
} ,
19
- buttonScale : 0.7 ,
20
40
buttonStyle : /** CSS */ ( `
21
- top: -45px ;
22
- left: -50px ;
23
- filter: brightness(80%) ;
41
+ opacity: 0.7 ;
42
+ cursor: pointer ;
43
+ width: 24px ;
24
44
` ) ,
25
45
captionElement : function ( ) {
26
- return document . querySelector ( '.closed-caption-container ' ) ;
46
+ return document . querySelector ( '.closed-caption-outband ' ) ;
27
47
} ,
28
48
videoElement : function ( ) {
29
- return document . getElementById ( 'content- video-player') ;
49
+ return document . querySelector ( '. video-player') ;
30
50
} ,
31
51
} ;
0 commit comments