HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/globfdxw/public_html/wp-content/plugins/sermone/src/helpers.js
import Plyr from 'plyr'
import tippy, { followCursor } from 'tippy.js'

export const NavMediaContentRender = ( $el ) => {
  let MediaType = $el.data( 'media-type' )
  let MediaPlayer = $el.data( 'media-player' )
  let MediaSource = $el.data( 'media-source' )
  let Content = $el.data( 'media-content' )
  
  switch ( MediaSource ) {
    case 'video_wp_media':
    case 'audio_wp_media':
      
      switch( MediaType ) {
        case 'sermone-video':
          $el.html( `
          <video controls> 
            <source src="${ Content }">
          </video>` )
          break;

        case 'sermone-audio':
          $el.html( `
          <audio controls>
            <source src="${ Content }">
          </audio>` )
          break;
      }
      break;

    default:
      $el.html( Content )
      break;
  }

  if( MediaPlayer == 'plyr' ) {
    $el.find( 'video, audio' ).each( function() {
      new Plyr( this )
    } )
  }

  $el.addClass( '__is-render' )
}

export const TippyTooltip = ( Selector, opts ) => {
  let _opts = window.jQuery.extend( {
    allowHTML: true,
    followCursor: true, 
    plugins: [ followCursor ],
    offset: [0, 25],
    maxWidth: 320,
    theme: 'sermone',
  }, opts )

  tippy( Selector, _opts )
  window.jQuery( Selector ).removeAttr( 'title' )
}