@@ -73,22 +73,33 @@ async function initPopup() {
7373 const { options } = await chrome . storage . sync . get ( [ 'options' ] )
7474 console . debug ( 'options:' , options )
7575 document . getElementById ( 'popupPreview' ) . checked = options . popupPreview
76- document . body . style . width = `${ options . popupWidth } px`
77-
78- // Table Max Height
7976 const wrapper = document . getElementById ( 'table-wrapper' )
80- if ( options . popupLinks ) {
81- wrapper . style . maxHeight = '500px'
77+ const platform = await chrome . runtime . getPlatformInfo ( )
78+ if ( platform . os !== 'android' ) {
79+ document . body . style . width = `${ options . popupWidth } px`
80+ if ( options . popupLinks ) {
81+ wrapper . style . maxHeight = '500px'
82+ } else {
83+ wrapper . style . maxHeight = '540px'
84+ }
8285 } else {
83- wrapper . style . maxHeight = '540px'
86+ if ( options . popupLinks ) {
87+ wrapper . style . maxHeight = '82vh'
88+ } else {
89+ wrapper . style . maxHeight = '88vh'
90+ }
91+ document . documentElement . style . fontSize = '1.3rem'
92+ document
93+ . querySelectorAll ( '.hover-menu > a' )
94+ . forEach ( ( el ) => el . classList . add ( 'px-1' ) )
8495 }
8596
8697 // Manifest
8798 const manifest = chrome . runtime . getManifest ( )
8899 const imgLink = document . querySelector ( '.head img' ) . closest ( 'a' )
89100 imgLink . href = manifest . homepage_url
90101 imgLink . title = `v${ manifest . version } `
91- const titleLink = document . querySelector ( '.head h3 a' )
102+ const titleLink = document . querySelector ( '.head h4 a' )
92103 titleLink . href = manifest . homepage_url
93104
94105 // Title Link
@@ -377,6 +388,11 @@ function updateTable(data, options) {
377388 thumbURL . searchParams . append ( 'token' , options . authToken )
378389 }
379390
391+ // Set mouseOver data on row
392+ row . classList . add ( 'mouse-link' )
393+ row . dataset . thumb = thumbURL ?. href || rawURL . href
394+ row . dataset . name = data [ i ] . name
395+
380396 // File Link -> 1
381397 const link = document . createElement ( 'a' )
382398 link . text = data [ i ] . name
@@ -387,8 +403,8 @@ function updateTable(data, options) {
387403 'link-underline' ,
388404 'link-underline-opacity-0' ,
389405 'link-underline-opacity-75-hover' ,
390- 'file-link' ,
391- 'mouse-link'
406+ 'file-link'
407+ // 'mouse-link'
392408 )
393409 link . target = '_blank'
394410 link . dataset . name = data [ i ] . name
@@ -609,7 +625,7 @@ async function ctxMenu(event) {
609625}
610626
611627async function togglePrivate ( ) {
612- console . debug ( ' togglePrivate' )
628+ console . debug ( ` togglePrivate: ${ ctxMenuRow . value } ` )
613629 // event.preventDefault()
614630 const file = fileData [ ctxMenuRow . value ]
615631 console . debug ( 'file:' , file )
@@ -641,7 +657,7 @@ async function togglePrivate() {
641657 * @param {SubmitEvent } event
642658 */
643659async function passwordForm ( event ) {
644- console . debug ( ' passwordForm:' , event )
660+ console . debug ( ` passwordForm: ${ ctxMenuRow . value } :` , event )
645661 event . preventDefault ( )
646662 const file = fileData [ ctxMenuRow . value ]
647663 console . debug ( 'file:' , file )
@@ -679,7 +695,7 @@ async function passwordForm(event) {
679695 * @param {SubmitEvent } event
680696 */
681697async function expireForm ( event ) {
682- console . debug ( ' expireForm:' , event )
698+ console . debug ( ` expireForm: ${ ctxMenuRow . value } :` , event )
683699 event . preventDefault ( )
684700 const file = fileData [ ctxMenuRow . value ]
685701 console . debug ( 'file:' , file )
@@ -717,7 +733,7 @@ async function expireForm(event) {
717733 * @param {MouseEvent } event
718734 */
719735async function deleteConfirm ( event ) {
720- console . debug ( ' deleteConfirm:' , event )
736+ console . debug ( ` deleteConfirm: ${ ctxMenuRow . value } :` , event )
721737 event . preventDefault ( )
722738 const file = fileData [ ctxMenuRow . value ]
723739 console . debug ( 'file:' , file )
@@ -842,6 +858,8 @@ function initPopupMouseover() {
842858 } )
843859}
844860
861+ let mouseRow
862+
845863function onMouseOver ( event ) {
846864 // console.debug('onMouseOver:', event)
847865 mediaError . classList . add ( 'd-none' )
@@ -853,12 +871,19 @@ function onMouseOver(event) {
853871 mediaOuter . classList . remove ( 'bottom-0' )
854872 mediaOuter . classList . add ( 'top-0' )
855873 }
856- const str = event . target . innerText
874+ const tr = event . target . closest ( 'tr' )
875+ if ( tr . id === mouseRow ) {
876+ // console.debug('onMouseOver: return')
877+ return
878+ }
879+ mouseRow = tr . id
880+ // console.debug('tr:', tr)
857881 const imageExtensions = / \. ( g i f | i c o | j p e g | j p g | p n g | s v g | w e b p ) $ / i
858- if ( str . match ( imageExtensions ) ) {
882+ if ( tr . dataset . name . match ( imageExtensions ) ) {
883+ // console.log('onMouseOver: UPDATE SRC')
859884 mediaImage . src = loadingImage
860- mediaImage . src = event . target . dataset . thumb
861- // console.debug('dataset.thumb', event.target .dataset.thumb)
885+ mediaImage . src = tr . dataset . thumb
886+ // console.debug('dataset.thumb', tr .dataset.thumb)
862887 mediaOuter . classList . remove ( 'd-none' )
863888 } else {
864889 mediaOuter . classList . add ( 'd-none' )
@@ -869,8 +894,16 @@ function onMouseOver(event) {
869894 }
870895}
871896
872- function onMouseOut ( ) {
873- // console.debug('onMouseOut')
897+ function onMouseOut ( event ) {
898+ // console.debug('onMouseOut:', event)
899+ const tr = event . target . closest ( 'tr' )
900+ // console.debug('tr:', tr)
901+ // console.debug('mouseRow:', mouseRow)
902+ if ( tr . id === mouseRow ) {
903+ // console.debug('onMouseOut: return')
904+ return
905+ }
906+ // console.debug('onMouseOut: START TIMEOUT')
874907 timeoutID = setTimeout ( function ( ) {
875908 mediaOuter . classList . add ( 'd-none' )
876909 mediaImage . src = loadingImage
0 commit comments