eternal september banner
Main Page | Bulletin Board | About | Label | Listserv



Random Article


11B-X-1371 | 2001 | 23-enigma | ARPANET | Abercrombie | About | Advertising | Ai | Alban-berg | Alejandro-jodorowsky | Alien | Altered-states | Alters | Ambien | Andrei-tarkovsky | Anima | Anton-webern | Apeirophobia | Aphasia | Apocrypha | Archangel-michael | Arizona | Arnold-schwarzenegger | Ashtar | Asparagaceae | Asphodel-meadows | Atari | Automaton | Baconator | Baudelaire | Behold a Pale Horse | Bell-labs | Berhold-brecht | Berserk | Berserk! ▶︎ | Beta page | Bicameralism | Bitcoin | Black-drop | Black-screen-o'-death | Blade-runner | BladeEnc | Bloomin-onion | Boltzmann Brain | Bomaye | Bowerbirds | Brain-virus | Bruges | Brutalism | Bulletin-board | Burgundy-car-interior | Byrds-of-paradise | CIA | COBOL | COINTELPRO | Cannabis | Captain-crunch | Cave of Brahma | Cenobites | Cerulean-fog ▶︎ | Chemtrails | Chernobyl | Chris-marker | Christian Family Research Council | Christianity | Chrysanthemum | Cicada-3301 | Cicadas | Cimmerian | Circuit-city | Cocobolo | Cocteau-twins | Code-x-digital | Codex | Codex-exoniensis | Codicil | Cold-slither | Collexion-III ▶︎ | Collexion-II ▶︎ | Collexion-IV ▶︎ | Collexion-I ▶︎ | Colonel-john-matrix | Coltan | Combahee-river | Contra | Copiale-cipher | Coral-gables | Cotton-mather | Credits | Crib-death | Cross-of-akht | Crystal-pepsi | Cult-of-the-dead-cow | Cybernetics | Dactyls | Daemon | Dallas | David Icke | Death-of-optimus | Deep-blue | Dekalog | Delorean | Destro | Destroy! | Dharma | Dialectic | Dido | Digital | Digital-riptide | Dikembe-mutombo | Dillinger-is-dead | Directory | Disclaimer | Division-bell | Dokken | Dolly | Doppler | Egyptian Helicopter | Ehspf | Elektroshock-therapy | Elysium | Enneagram | Enochian | Eraserhead | Error | Essential-oils | Et | Eternalblue | Eucharist | Event-horizon | Exile from Paradise | FBI | Faye-dunaway | Fleetwood-mac | Freeside | Galactus | Gallowglass | Gauntlet | Generation x | George-van-tassel | Ghost-from-three-men-and-a-baby | Gi-joe | Giant Panther | Gnosticism | Gowanus-canal | Gravitys-rainbow | Grey-waves | Gyokusai | HAL ▶︎ | Hadean-lands | Hades | Hair-metal | Hatra | He-man | Healthgoth | Helicopter-fetish | Helikopter-streichquartett | Hotline-connect | Hysteria | I-Antichrist | IBM | Icer-addis | Illuminati-quartet | Imago | Imbruglia | Immanuel-velikovsky | Incubus | Info | Info/ | Integraton | Internet | Internet-relay-chat | Jan-michael-vincent | Japanese-streetwear | Jazzercise | Jesus of Nazareth | John-david-mcafee | Jon-and-kate | Joybubbles | Judgement-day ▶︎ | Kareem-abdul-jabbar | Karlheinz-stockhausen | Kinesiology | Klf | Knight-ridder | Knight-rider | Konami | Konami Dream | Kosciuszko-bridge | Kumbaya | Lawns | Legions-of-osiris | Lesser-key-of-solomon | Light-singing | Lindisfarne-gospel | Linguistics | Listserv | Lord-digital | Los Angeles | Luciferin | Lyric-suite | Ma-bell | Mailer-daemon | Main Page | Marduk | Massed-vulture | Maudlin Show | Max-headroom | Mech | Meconium | Mega-man-2 | Memorex | Meshes-of-the-afternoon | Metal-gear-solid | Metatron | Metroid | Michael-j-fox | Microsoft | Microsoft-solitaire | Millennium-rift | MindRape | Mindvox | Minotaur | Molly-millions | Mountain Dew | Murad-Jacob-Kevorkian | My-nepenthe | NESticle | NY1 | Narcotics | NeXT BlackBox3 | Neon-babylon | Neon-genesis-evangelion | Nes | Nettle | New Jerusalem | Ninel-kulagina | Nirvana | No-wave | No-wire-hangers-ever | Noid | Nordgen | Normcore | Obelisk | Oberheim-SEM | Obolus | Octagon-of-dex | Operation-mindcrime | Operation-sundevil | Ophite-diagrams | Ornithomancy | Otherworld | PARCO | PARCO-collexion | Palimpsest | Panopticon | Parallax | Paresthesia | Pazuzu | Perfect-strangers | Periaqueductal-grey | Phage | Phantom-archives | Phantom-city | Phantom Access Technologies | Phiber-optik | Phowa | Phreaking | Pokemon | Pole-position ▶︎ | Power-electronics | Public-enemy-era | Quantum | Quantum-loop-gravity | Radioshack | Ragnarok | Rammellzee | Ramparts-magazine | Relational Aesthetics | Ringu | Robert-Anton-Wilson | Robert-john-mutt-lange | Roger-bacon | Ronald-reagan | Rorschach-test | Rose-pattern | Running-cola | Rygar | Saccharin | Sacred geometry | Saddam Hussein | Saraya-sarhaddi-nelson | Satanism | Saturn's Hexagon | Schizophrenia | Sega | Septuagint | Serialism | Sex-with-Satan | Shamir | Shepherds-of-apocrypha | Signal-hijacking | Silicon-valley | Silmarillion | Silurian Hypothesis | Simulation-theory | Skinemax | Skynet-syndrome | Slideshow demo | Snow-crash | Socotra | Solaris | Solemn Simulacrum | Solitaire ▶︎ | Solomons-key | Southern-incident | Spaceships-of-ezekiel | Spectral-peaks | Spectre-complex | Ssynthündßäx | Stalker | Steven-bochco | Steven-seagal | Studs-terkel | Susumu Hirasawa | Sword-of-damocles | T-1-carrier | Technostalgia | Terminator | Tetra-denim | The-Song-of-the-Cow | The-baroness | The-exorcist | The-iceman-cometh | The-legion-of-doom | The-moldau | The-self | The-waste-land | The-woman-in-the-dunes | The Bogdanov Twins | Thomas-kinkade | Tikrit | Timeline | Tobo-bottleneck | Top-gun | Total-freedom | Tottori Sand Dunes | Tower-of-babel | Transformers | Tron | True-hunger | UNTITLED ▶︎ | Un-chien-andalou | UseNet | Valhalla | Valkyrie | Vannevar-bush | VaporTech | Vaporwave | Venetian-pool | Venusian-enigmata | Videotex | Viduus | Viewtron | Voices-in-my-head | Voynich-manuscript | Vpd | W.A.S.P. | Warner-Amex Satellite Productions's Music Television | Weld-am-draht | White-columns | Wight | William-gibson | Winamp | Wintermute | Xenakis | Y2K | Yukio-mishima | Zelda | Zellige | Ziggurat
No edit summary
No edit summary
Line 161: Line 161:
         }
         }
     });
     });
});
// Auto-embed VideoJS audio players on load
$(document).ready(function() {
  // Only run on article pages
  if (mw.config.get('wgNamespaceNumber') === 0 || mw.config.get('wgNamespaceNumber') === 6) {
   
    // Function to convert file links to embedded audio players
    function convertAudioLinks() {
      // Target links to audio files
      $('a.internal').each(function() {
        var $link = $(this);
        var href = $link.attr('href');
       
        // Check if the link is to an audio file
        if (href && (
            href.match(/\.(ogg|mp3|wav|flac)$/i) ||
            href.match(/\/wiki\/File:.+\.(ogg|mp3|wav|flac)$/i) ||
            $link.parents('.gallerybox').length && $link.find('img[alt*="audio"]').length
          )) {
         
          // Get the file path from the link or title attribute
          var filePath = href;
          var fileName = $link.attr('title') || $link.text();
         
          // Skip if already has a player parent
          if ($link.parent().hasClass('vjs-wrapper')) {
            return;
          }
         
          // Create a container for the player
          var $container = $('<div class="vjs-wrapper"></div>');
         
          // Create the audio element
          var $audio = $('<audio class="video-js vjs-default-skin" controls preload="auto"></audio>');
         
          // Set the source to the file URL
          // Transform wiki URL to direct file URL if needed
          var fileUrl = href;
          if (fileUrl.indexOf('/wiki/File:') !== -1) {
            var apiUrl = mw.util.wikiScript('api');
            $.ajax({
              url: apiUrl,
              data: {
                action: 'query',
                titles: fileName.replace(/^File:/, ''),
                prop: 'imageinfo',
                iiprop: 'url',
                format: 'json'
              },
              async: false,
              dataType: 'json',
              success: function(data) {
                $.each(data.query.pages, function(i, page) {
                  if (page.imageinfo && page.imageinfo[0]) {
                    fileUrl = page.imageinfo[0].url;
                  }
                });
              }
            });
          }
         
          // Add the source to the audio element
          $audio.append($('<source></source>').attr('src', fileUrl));
         
          // Add audio to container
          $container.append($audio);
         
          // Replace the link with the player
          $link.after($container);
          $link.hide();
         
          // Initialize VideoJS
          if (typeof videojs !== 'undefined') {
            videojs($audio[0], {}, function() {
              // Player is ready
              console.log('VideoJS player initialized for: ' + fileName);
            });
          }
        }
      });
    }
   
    // Run the conversion after page load
    convertAudioLinks();
   
    // Also run after AJAX content loads (for dynamically loaded content)
    mw.hook('wikipage.content').add(convertAudioLinks);
  }
});
});

Revision as of 22:06, 3 May 2025

// Add play buttons to spans with a specific class
mw.hook('wikipage.content').add(function ($content) {
    // Target spans with your specific class, e.g., 'audio-text'
    $content.find('span.audio-text').each(function () {
        var $span = $(this);

  $span.css({
            'display': 'inline-flex',
            'align-items': 'center'
        });
        
        // Create the play button
        var $playButton = $('<button>')
            .addClass('play-button')
            .text('')
            .css({
                'margin-left': '10px',

                'cursor': 'pointer',
'background': 'transparent',
'color':'white'
            })
            .click(function (e) {
                e.preventDefault();
                // Add your play functionality here
                // For example, read the text aloud or play an associated audio file
                var textToSpeak = $span.text();
                console.log('Playing:', textToSpeak);
                
                // Example: Use the Web Speech API for text-to-speech
                // Uncomment if you want to use this functionality
                /*
                if ('speechSynthesis' in window) {
                    var utterance = new SpeechSynthesisUtterance(textToSpeak);
                    speechSynthesis.speak(utterance);
                }
                */
            });
        
        // Insert the play button after the span
        $span.append($playButton);
    });
});

/* IFRAME COMMUNICATION */


(function() {
  'use strict';
  
  // Only run if we're in an iframe
  if (window.parent !== window) {
    // Wait for the page to load
    $(function() {
      // Configuration
      var PARENT_ORIGIN = 'http://127.0.0.1:5500/wiki/index.html';
      var CLICKABLE_ELEMENTS = [
        'a',     // Category links
'.audio-ref'

      ];
      
      // Add click handlers to the specified elements
      $(CLICKABLE_ELEMENTS.join(', ')).on('click', function(e) {
        // Get element information
        var elementInfo = {
          type: 'elementClicked',
          elementId: this.id || 'unnamed-element',
          elementTag: this.tagName.toLowerCase(),
          elementClass: this.className,
          elementText: $(this).text().trim(),
          timestamp: Date.now()
        };
        
        // Send message to parent React app
        window.parent.postMessage(elementInfo, PARENT_ORIGIN);
        
        console.log('Click detected and reported:', elementInfo);
        
      });
      
      console.log('Click detection initialized for iframe communication');
    });
  }
})();


/* SIDEBAR CUSTOMIZATION */

$(document).ready(function() {
  // Get element's position relative to the viewport
  function getElementTopPosition(selector) {
    var element = $(selector);
    if (element.length) {
      var elementPosition = element.offset().top;
      var scrollTop = $(window).scrollTop();
      var positionInViewport = elementPosition - scrollTop;
      
      // Store the position for later use
      var storedPosition = elementPosition;
      
      console.log('Element position stored:', storedPosition);
      return storedPosition;
    }
    return 0;
  }
  
  // Store positions when page loads
  var onePosition = getElementTopPosition('.sidebar-heading.one');
  var twoPosition = getElementTopPosition('.sidebar-heading.two');
  var threePosition = getElementTopPosition('.sidebar-heading.three');

  // Select elements with the scroll-trigger class
  $('.sidebar-heading.one').click(function() {
    // Find the scrollable container
    var container = $('#topbar');
    
    // Scroll to the top of the container (position 0)
    container.animate({
      scrollTop: onePosition - 202
    }, 300); // 300ms animation duration
  });

$('.sidebar-heading.two').click(function() {
    // Find the scrollable container
    var container = $('#topbar');
    
    // Scroll to the top of the container (position 0)
    container.animate({
      scrollTop: twoPosition - 240
    }, 300); // 300ms 
  });

 // Select elements with the scroll-trigger class
  $('.sidebar-heading.three').click(function() {
    // Find the scrollable container
    var container = $('#topbar');
    
    // Scroll to the top of the container (position 0)
    container.animate({
      scrollTop: threePosition - 275
    }, 300); // 300ms animation duration
  });

});

mw.hook('wikipage.content').add(function ($content) {
    // Find all links in the content
    var links = $content.find('a');
    
    // Iterate through each link
    links.each(function() {
        var $link = $(this);
        var html = $link.html();
        
        // Check if the link contains the symbol (including variant selectors)
        if (html && html.indexOf('▶') !== -1) {
            // Replace the symbol with a span that has white color
            var newHtml = html.replace(/▶[\uFE0E\uFE0F]?/g, '<span class="symbol-container" style="color: white;">▶</span>');
            $link.html(newHtml);
        }
    });
});



// Auto-embed VideoJS audio players on load
$(document).ready(function() {
  // Only run on article pages
  if (mw.config.get('wgNamespaceNumber') === 0 || mw.config.get('wgNamespaceNumber') === 6) {
    
    // Function to convert file links to embedded audio players
    function convertAudioLinks() {
      // Target links to audio files
      $('a.internal').each(function() {
        var $link = $(this);
        var href = $link.attr('href');
        
        // Check if the link is to an audio file
        if (href && (
            href.match(/\.(ogg|mp3|wav|flac)$/i) || 
            href.match(/\/wiki\/File:.+\.(ogg|mp3|wav|flac)$/i) ||
            $link.parents('.gallerybox').length && $link.find('img[alt*="audio"]').length
          )) {
          
          // Get the file path from the link or title attribute
          var filePath = href;
          var fileName = $link.attr('title') || $link.text();
          
          // Skip if already has a player parent
          if ($link.parent().hasClass('vjs-wrapper')) {
            return;
          }
          
          // Create a container for the player
          var $container = $('<div class="vjs-wrapper"></div>');
          
          // Create the audio element
          var $audio = $('<audio class="video-js vjs-default-skin" controls preload="auto"></audio>');
          
          // Set the source to the file URL
          // Transform wiki URL to direct file URL if needed
          var fileUrl = href;
          if (fileUrl.indexOf('/wiki/File:') !== -1) {
            var apiUrl = mw.util.wikiScript('api');
            $.ajax({
              url: apiUrl,
              data: {
                action: 'query',
                titles: fileName.replace(/^File:/, ''),
                prop: 'imageinfo',
                iiprop: 'url',
                format: 'json'
              },
              async: false,
              dataType: 'json',
              success: function(data) {
                $.each(data.query.pages, function(i, page) {
                  if (page.imageinfo && page.imageinfo[0]) {
                    fileUrl = page.imageinfo[0].url;
                  }
                });
              }
            });
          }
          
          // Add the source to the audio element
          $audio.append($('<source></source>').attr('src', fileUrl));
          
          // Add audio to container
          $container.append($audio);
          
          // Replace the link with the player
          $link.after($container);
          $link.hide();
          
          // Initialize VideoJS
          if (typeof videojs !== 'undefined') {
            videojs($audio[0], {}, function() {
              // Player is ready
              console.log('VideoJS player initialized for: ' + fileName);
            });
          }
        }
      });
    }
    
    // Run the conversion after page load
    convertAudioLinks();
    
    // Also run after AJAX content loads (for dynamically loaded content)
    mw.hook('wikipage.content').add(convertAudioLinks);
  }
});