User:Tark/Sandbox/Page.js

From Team Fortress Wiki
< User:Tark‎ | Sandbox
Revision as of 04:59, 21 September 2021 by Tark (talk | contribs)
Jump to: navigation, search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
// Audio player thing
// Imported from pwiki, modified
function toggleAudio(el) {
    var theParent = $(el).parent();
    var theAudio = theParent.find('audio').get(0);
    var theFancyText = theParent.find('a');
    theAudio.play()
    theAudio.addEventListener("play", function () {
        theFancyText.text("Playing")
    });
    theAudio.addEventListener("ended", function () {
        theFancyText.text("Play")
    });
};