Plugin Directory

Changeset 1369929


Ignore:
Timestamp:
03/12/2016 09:20:43 PM (10 years ago)
Author:
doytch
Message:

Adding version 1.2

Location:
skip-to-timestamp
Files:
5 edited
4 copied

Legend:

Unmodified
Added
Removed
  • skip-to-timestamp

    • Property svn:ignore set to
      trunk/.git
      trunk/.gitignore

  • skip-to-timestamp/tags/1.2/js/skiptotimestamp.js

    r986462 r1369929  
    3535    }
    3636
    37     if ((parseInt(STT.settings.link_audio) && audio.length) || 
    38         (parseInt(STT.settings.link_video) && video.length)) 
     37    if ((parseInt(STT.settings.link_audio) && audio.length) ||
     38        (parseInt(STT.settings.link_video) && video.length))
    3939    {
    4040        STT.doSkip = STT.doHTML5Skip;
  • skip-to-timestamp/tags/1.2/readme.txt

    r1048727 r1369929  
    11=== Plugin Name ===
    22Contributors: doytch
    3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mark%2edeutsch%40utoronto%2eca&lc=US&item_name=Coffee%20Donation%20%3d%29&amount=10%2e00&currency_code=USD&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted
     3Donate link: http://qedev.com/
    44Tags: audio, embed, html5, media, plugin, shortcode, video, youtube
    55Requires at least: 3.0.1
    6 Tested up to: 4.1
    7 Stable tag: 1.1
     6Tested up to: 4.5
     7Stable tag: 1.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3333You don't really need to do anything special to install this plugin. Just:
    3434
    35 1. Download using the button above, unzip and place the folder in your wp-content/plugins/ folder. Alternately, 
     351. Download using the button above, unzip and place the folder in your wp-content/plugins/ folder. Alternately,
    3636install using Wordpress' built-in plugin installer.
    37371. Activate the plugin through the Plugins menu in WordPress
     
    4242If it adds an <audio> or <video> tag, then maybe. The plugin uses the currentTime parameter of those elements
    4343to set the location to skip to. If you open your browsers developer console and see a message saying
    44 'Skip to Timestamp: No media player found!', then that player isn't currently supported. I'd like to help you 
    45 though, so please submit a request for that player on the Wordpress plugin page. It's the only way I know 
    46 which players to prioritise! 
     44'Skip to Timestamp: No media player found!', then that player isn't currently supported. I'd like to help you
     45though, so please submit a request for that player on the Wordpress plugin page. It's the only way I know
     46which players to prioritise!
    4747
    4848= Can I use both shortcodes and automatically-replaced timestamps? =
    49 Yes, as long as you don't use both in the same post. Each post can contain either shortcodes OR timestamps to 
     49Yes, as long as you don't use both in the same post. Each post can contain either shortcodes OR timestamps to
    5050auto-replace. If both are present, then timestamps will not be automatically replaced.
    5151
    5252= It's not working! =
    53 Please leave me a message with information about the media you embedded, how you tried to create the link, and what 
     53Please leave me a message with information about the media you embedded, how you tried to create the link, and what
    5454browser and operating system you're running. If it's a bug, I'll get right to work on it!
    5555
     
    6060== Changelog ==
    6161
     62= 1.2 =
     63* Added ability to turn off automatic linking on a per-page basis.
     64
    6265= 1.1 =
    63 * Fixed array return-and-reference for old PHP versions.
     66* Support for older versions of WordPress
    6467
    6568= 1.0 =
  • skip-to-timestamp/tags/1.2/skiptotimestamp.php

    r1024277 r1369929  
    44Plugin URI: http://qedev.com
    55Description: Adds clickable timestamps via shortcode or search-and-replace that skip to a time in a media player.
    6 Version: 1.0
     6Version: 1.2
    77Author: Mark Hurst Deutsch
    88Author URI: http://qedev.com
     
    9090function qed_stt_create_menu() {
    9191    add_options_page(
    92         'Skip to Timestamp', 
    93         'Skip to Timestamp', 
     92        'Skip to Timestamp',
     93        'Skip to Timestamp',
    9494        'manage_options',
    9595        'skiptotimestamp',
     
    188188    if ($link_video) echo ' checked ';
    189189    echo "/>Skip to timestamp in video embedded with the [video] shortcode or <video> HTML5 tag.";
    190    
     190
    191191}
    192192
     
    220220}
    221221
     222/* --- Metaboxes --- */
     223add_action( 'add_meta_boxes', 'qed_stt_add_metabox' );
     224add_action( 'save_post', 'qed_stt_save_metabox');
     225add_action( 'wp_ajax_qed_stt_ajax_get_page_settings', 'qed_stt_get_page_settings');
     226
     227/**
     228 * Register the metabox
     229 *
     230 */
     231function qed_stt_add_metabox($post_type) {
     232    $screens = array( 'post', 'page');
     233
     234    foreach ($screens as $screen) {
     235        add_meta_box(
     236            'stt_post_mb',
     237            __('Skip to Timestamp Configuration', 'stt'),
     238            'qed_stt_create_metabox',
     239            $screen,
     240            'normal',
     241            'high'
     242        );
     243    }
     244}
     245
     246function qed_stt_create_metabox($post) {
     247    wp_nonce_field('qed_stt_post_mb', 'qed_stt_post_mb_nonce');
     248
     249    ?>
     250    <table id='qed-stt-mb-table' class='form-table'>
     251        <tr valign='top'>
     252            <th scope='row'><?php _e('Disable Automatic Links'); ?></th>
     253            <td>
     254                <input type='checkbox' id='qed-stt-disable-auto-link' name='qed-stt-disable-auto-link' valu
     255                    <?php echo get_post_meta(get_the_ID(), 'qed-stt-disable-auto-link', true) ? 'checked' : '' ?>
     256                />
     257            </td>
     258        </tr>
     259    </table>
     260    <?php
     261}
     262
     263function qed_stt_save_metabox($post_id) {
     264    // Verify the nonce to ensure we're getting called from the right spot.
     265    if (!isset($_POST['qed_stt_post_mb_nonce'])) {
     266        return $post_id;
     267    }
     268    $nonce = $_POST['qed_stt_post_mb_nonce'];
     269    if (!wp_verify_nonce($nonce, 'qed_stt_post_mb')) {
     270        return $post_id;
     271    }
     272
     273    update_post_meta($post_id, 'qed-stt-disable-auto-link', isset($_POST['qed-stt-disable-auto-link']));
     274}
     275
    222276/* --- Automatic Hyperlinking --- */
    223277add_action('plugins_loaded', 'qed_stt_loaded');
     
    228282add_action('wp_enqueue_scripts', 'qed_stt_enqueue_scripts');
    229283function qed_stt_enqueue_scripts() {
     284    wp_enqueue_style( 'thickbox');
    230285    wp_enqueue_script('qed-stt-youtube', 'https://www.youtube.com/iframe_api');
    231286    wp_enqueue_script('qed-stt-js', plugin_dir_url(__FILE__).'/js/skiptotimestamp.js');
     
    235290
    236291function qed_stt_hyperlink_timestamps($content) {
    237     // Don't autolink if it's turned off. 
     292    // Don't autolink if it's turned off.
    238293    $options = get_option('qed_stt_settings');
    239294    if (!$options['auto_replace_ts']) {
     
    244299        return $content;
    245300    }
     301    // Don't autolink if they've turned off autolinking for this page.
     302    if (get_post_meta(get_the_ID(), 'qed-stt-disable-auto-link', true)) {
     303        return $content;
     304    }
     305
    246306    // Don't allow shortcodes and autolinks in the same post
    247307    if (qed_stt_post_has_shortcode()) {
     
    250310
    251311    $content = preg_replace(
    252         "/(?:(?:(?<hh>\d{1,2})[:.])?(?<mm>\d{1,2})[:.])(?<ss>\d{1,2})/", 
    253         '<a href="javascript:void(0)" class="qed_stt_tslink" onclick="STTSkipTo(\'$0\')">$0</a>', 
     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>',
    254314        $content
    255315    );
  • skip-to-timestamp/trunk/js/skiptotimestamp.js

    r986462 r1369929  
    3535    }
    3636
    37     if ((parseInt(STT.settings.link_audio) && audio.length) || 
    38         (parseInt(STT.settings.link_video) && video.length)) 
     37    if ((parseInt(STT.settings.link_audio) && audio.length) ||
     38        (parseInt(STT.settings.link_video) && video.length))
    3939    {
    4040        STT.doSkip = STT.doHTML5Skip;
  • skip-to-timestamp/trunk/readme.txt

    r1048727 r1369929  
    11=== Plugin Name ===
    22Contributors: doytch
    3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mark%2edeutsch%40utoronto%2eca&lc=US&item_name=Coffee%20Donation%20%3d%29&amount=10%2e00&currency_code=USD&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted
     3Donate link: http://qedev.com/
    44Tags: audio, embed, html5, media, plugin, shortcode, video, youtube
    55Requires at least: 3.0.1
    6 Tested up to: 4.1
    7 Stable tag: 1.1
     6Tested up to: 4.5
     7Stable tag: 1.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3333You don't really need to do anything special to install this plugin. Just:
    3434
    35 1. Download using the button above, unzip and place the folder in your wp-content/plugins/ folder. Alternately, 
     351. Download using the button above, unzip and place the folder in your wp-content/plugins/ folder. Alternately,
    3636install using Wordpress' built-in plugin installer.
    37371. Activate the plugin through the Plugins menu in WordPress
     
    4242If it adds an &lt;audio&gt; or &lt;video&gt; tag, then maybe. The plugin uses the currentTime parameter of those elements
    4343to set the location to skip to. If you open your browsers developer console and see a message saying
    44 'Skip to Timestamp: No media player found!', then that player isn't currently supported. I'd like to help you 
    45 though, so please submit a request for that player on the Wordpress plugin page. It's the only way I know 
    46 which players to prioritise! 
     44'Skip to Timestamp: No media player found!', then that player isn't currently supported. I'd like to help you
     45though, so please submit a request for that player on the Wordpress plugin page. It's the only way I know
     46which players to prioritise!
    4747
    4848= Can I use both shortcodes and automatically-replaced timestamps? =
    49 Yes, as long as you don't use both in the same post. Each post can contain either shortcodes OR timestamps to 
     49Yes, as long as you don't use both in the same post. Each post can contain either shortcodes OR timestamps to
    5050auto-replace. If both are present, then timestamps will not be automatically replaced.
    5151
    5252= It's not working! =
    53 Please leave me a message with information about the media you embedded, how you tried to create the link, and what 
     53Please leave me a message with information about the media you embedded, how you tried to create the link, and what
    5454browser and operating system you're running. If it's a bug, I'll get right to work on it!
    5555
     
    6060== Changelog ==
    6161
     62= 1.2 =
     63* Added ability to turn off automatic linking on a per-page basis.
     64
    6265= 1.1 =
    63 * Fixed array return-and-reference for old PHP versions.
     66* Support for older versions of WordPress
    6467
    6568= 1.0 =
  • skip-to-timestamp/trunk/skiptotimestamp.php

    r1024277 r1369929  
    44Plugin URI: http://qedev.com
    55Description: Adds clickable timestamps via shortcode or search-and-replace that skip to a time in a media player.
    6 Version: 1.0
     6Version: 1.2
    77Author: Mark Hurst Deutsch
    88Author URI: http://qedev.com
     
    9090function qed_stt_create_menu() {
    9191    add_options_page(
    92         'Skip to Timestamp', 
    93         'Skip to Timestamp', 
     92        'Skip to Timestamp',
     93        'Skip to Timestamp',
    9494        'manage_options',
    9595        'skiptotimestamp',
     
    188188    if ($link_video) echo ' checked ';
    189189    echo "/>Skip to timestamp in video embedded with the [video] shortcode or &lt;video&gt; HTML5 tag.";
    190    
     190
    191191}
    192192
     
    220220}
    221221
     222/* --- Metaboxes --- */
     223add_action( 'add_meta_boxes', 'qed_stt_add_metabox' );
     224add_action( 'save_post', 'qed_stt_save_metabox');
     225add_action( 'wp_ajax_qed_stt_ajax_get_page_settings', 'qed_stt_get_page_settings');
     226
     227/**
     228 * Register the metabox
     229 *
     230 */
     231function qed_stt_add_metabox($post_type) {
     232    $screens = array( 'post', 'page');
     233
     234    foreach ($screens as $screen) {
     235        add_meta_box(
     236            'stt_post_mb',
     237            __('Skip to Timestamp Configuration', 'stt'),
     238            'qed_stt_create_metabox',
     239            $screen,
     240            'normal',
     241            'high'
     242        );
     243    }
     244}
     245
     246function qed_stt_create_metabox($post) {
     247    wp_nonce_field('qed_stt_post_mb', 'qed_stt_post_mb_nonce');
     248
     249    ?>
     250    <table id='qed-stt-mb-table' class='form-table'>
     251        <tr valign='top'>
     252            <th scope='row'><?php _e('Disable Automatic Links'); ?></th>
     253            <td>
     254                <input type='checkbox' id='qed-stt-disable-auto-link' name='qed-stt-disable-auto-link' valu
     255                    <?php echo get_post_meta(get_the_ID(), 'qed-stt-disable-auto-link', true) ? 'checked' : '' ?>
     256                />
     257            </td>
     258        </tr>
     259    </table>
     260    <?php
     261}
     262
     263function qed_stt_save_metabox($post_id) {
     264    // Verify the nonce to ensure we're getting called from the right spot.
     265    if (!isset($_POST['qed_stt_post_mb_nonce'])) {
     266        return $post_id;
     267    }
     268    $nonce = $_POST['qed_stt_post_mb_nonce'];
     269    if (!wp_verify_nonce($nonce, 'qed_stt_post_mb')) {
     270        return $post_id;
     271    }
     272
     273    update_post_meta($post_id, 'qed-stt-disable-auto-link', isset($_POST['qed-stt-disable-auto-link']));
     274}
     275
    222276/* --- Automatic Hyperlinking --- */
    223277add_action('plugins_loaded', 'qed_stt_loaded');
     
    228282add_action('wp_enqueue_scripts', 'qed_stt_enqueue_scripts');
    229283function qed_stt_enqueue_scripts() {
     284    wp_enqueue_style( 'thickbox');
    230285    wp_enqueue_script('qed-stt-youtube', 'https://www.youtube.com/iframe_api');
    231286    wp_enqueue_script('qed-stt-js', plugin_dir_url(__FILE__).'/js/skiptotimestamp.js');
     
    235290
    236291function qed_stt_hyperlink_timestamps($content) {
    237     // Don't autolink if it's turned off. 
     292    // Don't autolink if it's turned off.
    238293    $options = get_option('qed_stt_settings');
    239294    if (!$options['auto_replace_ts']) {
     
    244299        return $content;
    245300    }
     301    // Don't autolink if they've turned off autolinking for this page.
     302    if (get_post_meta(get_the_ID(), 'qed-stt-disable-auto-link', true)) {
     303        return $content;
     304    }
     305
    246306    // Don't allow shortcodes and autolinks in the same post
    247307    if (qed_stt_post_has_shortcode()) {
     
    250310
    251311    $content = preg_replace(
    252         "/(?:(?:(?<hh>\d{1,2})[:.])?(?<mm>\d{1,2})[:.])(?<ss>\d{1,2})/", 
    253         '<a href="javascript:void(0)" class="qed_stt_tslink" onclick="STTSkipTo(\'$0\')">$0</a>', 
     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>',
    254314        $content
    255315    );
Note: See TracChangeset for help on using the changeset viewer.