Plugin Directory

Changeset 1848545


Ignore:
Timestamp:
03/28/2018 01:39:05 PM (8 years ago)
Author:
doytch
Message:

Version 1.4

Location:
skip-to-timestamp
Files:
11 added
3 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • skip-to-timestamp/trunk/js/skiptotimestamp.js

    r1369929 r1848545  
    4646        }
    4747
     48        var playbackRate = STT.media.playbackRate;
    4849        STT.media.addEventListener('canplaythrough', STT.doHTML5Skip);
    4950        STT.media.load();
     51        STT.media.playbackRate = playbackRate;
    5052        STT.media.play();
    5153        return;
     
    7173    return;
    7274}
     75
     76// Listen to all clicks on the document
     77document.addEventListener('click', function (event) {
     78    var elem = event.target;
     79    // If the event target doesn't match bail
     80    if (!elem.hasAttribute('data-stt-time')) {
     81        return;
     82    }
     83    var time = elem.getAttribute('data-stt-time');
     84    STTSkipTo(time);
     85}, false);
  • skip-to-timestamp/trunk/readme.txt

    r1424400 r1848545  
    44Tags: audio, embed, html5, media, plugin, shortcode, video, youtube
    55Requires at least: 3.0.1
    6 Tested up to: 4.5
    7 Stable tag: 1.3
     6Tested up to: 4.9.4
     7Stable tag: 1.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6060== Changelog ==
    6161
     62= 1.4 =
     63* Fixed issue where playbackRate wouldn't be preserved.
     64* Switched to dataset tags and global event handlers.
     65* Thanks Lewis Cowles for the pull request!
     66
     67= 1.3 =
     68* Housekeeping
     69
    6270= 1.2 =
    6371* Added ability to turn off automatic linking on a per-page basis.
  • skip-to-timestamp/trunk/skiptotimestamp.php

    r1424400 r1848545  
    22/*
    33Plugin Name: Skip to Timestamp
    4 Plugin URI: http://qedev.com
     4Plugin URI: http://github.com/doytch/SkipToTimestamp
    55Description: Adds clickable timestamps via shortcode or search-and-replace that skip to a time in a media player.
    6 Version: 1.3
    7 Author: Mark Hurst Deutsch
    8 Author URI: http://qedev.com
     6Version: 1.4
     7Author: Mark Deutsch
     8Author URI: http://github.com/doytch
    99License: GPLv2
    1010*/
     
    7272        return $content;
    7373    } else {
    74         return '<a href="javascript:void(0)" class="qed_stt_tslink" onclick="STTSkipTo(\'' . $time . '\')">' . $content . '</a>';
     74        return "<span class=\"qed_stt_tslink\" data-stt-time=\"{$time}\">{$content}</span>";
    7575    }
    7676}
     
    311311    $content = preg_replace(
    312312        "/(?:(?:(?<hh>\d{1,2})[:.])?(?<mm>\d{1,2})[:.])(?<ss>\d{1,2})/",
    313         '<a href="javascript:void(0)" class="qed_stt_tslink" onclick="STTSkipTo(\'$0\')">$0</a>',
     313        '<span class="qed_stt_tslink" data-stt-time="$0">$0</span>',
    314314        $content
    315315    );
     
    317317    return $content;
    318318}
     319
     320add_action('wp_footer', 'qed_stt_custom_css');
     321function qed_stt_custom_css() {
    319322?>
     323    <style>
     324    .qed_stt_tslink {
     325        cursor: pointer;
     326    }
     327    </style>
     328<?php
     329}
     330?>
Note: See TracChangeset for help on using the changeset viewer.