Changeset 1848545
- Timestamp:
- 03/28/2018 01:39:05 PM (8 years ago)
- Location:
- skip-to-timestamp
- Files:
-
- 11 added
- 3 deleted
- 3 edited
-
tags/1.0 (deleted)
-
tags/1.1 (deleted)
-
tags/1.2 (deleted)
-
tags/1.3/LICENSE (added)
-
tags/1.3/README.md (added)
-
tags/1.4 (added)
-
tags/1.4/LICENSE (added)
-
tags/1.4/README.md (added)
-
tags/1.4/js (added)
-
tags/1.4/js/skiptotimestamp.js (added)
-
tags/1.4/readme.txt (added)
-
tags/1.4/skiptotimestamp.php (added)
-
trunk/LICENSE (added)
-
trunk/README.md (added)
-
trunk/js/skiptotimestamp.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/skiptotimestamp.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
skip-to-timestamp/trunk/js/skiptotimestamp.js
r1369929 r1848545 46 46 } 47 47 48 var playbackRate = STT.media.playbackRate; 48 49 STT.media.addEventListener('canplaythrough', STT.doHTML5Skip); 49 50 STT.media.load(); 51 STT.media.playbackRate = playbackRate; 50 52 STT.media.play(); 51 53 return; … … 71 73 return; 72 74 } 75 76 // Listen to all clicks on the document 77 document.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 4 4 Tags: audio, embed, html5, media, plugin, shortcode, video, youtube 5 5 Requires at least: 3.0.1 6 Tested up to: 4. 57 Stable tag: 1. 36 Tested up to: 4.9.4 7 Stable tag: 1.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 60 60 == Changelog == 61 61 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 62 70 = 1.2 = 63 71 * Added ability to turn off automatic linking on a per-page basis. -
skip-to-timestamp/trunk/skiptotimestamp.php
r1424400 r1848545 2 2 /* 3 3 Plugin Name: Skip to Timestamp 4 Plugin URI: http:// qedev.com4 Plugin URI: http://github.com/doytch/SkipToTimestamp 5 5 Description: Adds clickable timestamps via shortcode or search-and-replace that skip to a time in a media player. 6 Version: 1. 37 Author: Mark HurstDeutsch8 Author URI: http:// qedev.com6 Version: 1.4 7 Author: Mark Deutsch 8 Author URI: http://github.com/doytch 9 9 License: GPLv2 10 10 */ … … 72 72 return $content; 73 73 } 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>"; 75 75 } 76 76 } … … 311 311 $content = preg_replace( 312 312 "/(?:(?:(?<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>', 314 314 $content 315 315 ); … … 317 317 return $content; 318 318 } 319 320 add_action('wp_footer', 'qed_stt_custom_css'); 321 function qed_stt_custom_css() { 319 322 ?> 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.