WordPress.org

Plugin Directory

Changeset 583732


Ignore:
Timestamp:
08/10/12 00:51:04 (21 months ago)
Author:
Viper007Bond
Message:

Quicktime: bgcolor parameter + argument code rewrite

Location:
vipers-video-quicktags/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vipers-video-quicktags/trunk/readme.txt

    r576332 r583732  
    55Requires at least: 2.8 
    66Tested up to: 3.4 
    7 Stable tag: trunk 
     7Stable tag: 6.4.3 
    88 
    99Allows easy and XHTML valid posting of videos from various websites such as YouTube, DailyMotion, Vimeo, and more. 
     
    9999 
    100100== Changelog == 
     101 
     102= v6.4.3 = 
     103 
     104* **Quicktime:** Control the background color via a new parameter (`bgcolor`) per request. 
     105* **Quicktime:** Rewrite of the Quicktime parameter functionality. Also a new filter for other plugins to be able to control these parameters. 
    101106 
    102107= July 23rd, 2012 (no version bump) == 
  • vipers-video-quicktags/trunk/vipers-video-quicktags.php

    r576330 r583732  
    66Plugin URI:   http://www.viper007bond.com/wordpress-plugins/vipers-video-quicktags/ 
    77Description:  Easily embed videos from various video websites such as YouTube, DailyMotion, and Vimeo into your posts. 
    8 Version:      6.4.2 
     8Version:      6.4.3 
    99Author:       Viper007Bond 
    1010Author URI:   http://www.viper007bond.com/ 
     
    5656 
    5757class VipersVideoQuicktags { 
    58     var $version = '6.4.2'; 
     58    var $version = '6.4.3'; 
    5959    var $settings = array(); 
    6060    var $defaultsettings = array(); 
     
    36363636            'placeholder'    => str_replace( '.mov', '.jpg', $content ), 
    36373637            'controller'     => 1, 
    3638  
     3638            'bgcolor'        => '', 
    36393639        ), $atts); 
    36403640 
     
    36423642        $atts = apply_filters( 'vvq_shortcodeatts', $atts, 'quicktime', $origatts ); 
    36433643 
     3644        $qt_args = array( 
     3645            'scale' => 'aspect', 
     3646        ); 
    36443647 
    36453648        if ( 1 == $atts['useplaceholder'] && !empty($atts['placeholder']) ) { 
    36463649            $mov = $atts['placeholder']; 
    3647             $href = ' myQTObject.addParam("href", "' . $content . '"); myQTObject.addParam("target", "myself");'; 
     3650            $qt_args['href'] = $content; 
     3651            $qt_args['target'] = 'myself'; 
    36483652        } else { 
    36493653            $mov = $content; 
    3650             $href = ''; 
    36513654        } 
    36523655 
    36533656        if ( 1 == $atts['autostart'] ) 
    3654             $autoplay = 'true'; 
     3657            $qt_args['autoplay'] = 'true'; 
    36553658        else 
    3656             $autoplay = ( 1 == $atts['autoplay'] ) ? 'true' : 'false'; 
    3657  
    3658         $controller = ( 1 == $atts['controller'] ) ? 'true' : 'false'; 
    3659  
    3660         return '<span class="vvqbox vvqquicktime" style="width:' . $atts['width'] . 'px;height:' . $atts['height'] . 'px;"><script type="text/javascript">var myQTObject = new QTObject("' . $mov . '", "' . $this->videoid('quicktime') . '", "' . $atts['width'] . '", "' . $atts['height'] . '");' . $href . ' myQTObject.addParam("autoplay", "' . $autoplay . '"); myQTObject.addParam("controller", "' . $controller . '"); myQTObject.addParam("scale", "aspect"); myQTObject.write();</script></span>'; 
     3659            $qt_args['autoplay'] = ( 1 == $atts['autoplay'] ) ? 'true' : 'false'; 
     3660 
     3661        $qt_args['controller'] = ( 1 == $atts['controller'] ) ? 'true' : 'false'; 
     3662 
     3663        if ( ! empty( $atts['bgcolor'] ) ) 
     3664            $qt_args['bgcolor'] = $atts['bgcolor']; 
     3665 
     3666        // Use this to inject extra myQTObject.addParam() entries 
     3667        $qt_args = apply_filters( 'vvq_quicktime_args', $qt_args ); 
     3668 
     3669        $html = '<span class="vvqbox vvqquicktime" style="width:' . esc_attr( $atts['width'] ) . 'px;height:' . esc_attr( $atts['height'] ) . 'px;"><script type="text/javascript">' . "var myQTObject = new QTObject( '" . esc_js( $mov ) . "', '" . esc_js( $this->videoid('quicktime') ) . "', '" . esc_js( $atts['width'] ) . "', '" . esc_js( $atts['height'] ) . "');"; 
     3670 
     3671        foreach ( $qt_args as $name => $value ) 
     3672            $html .= " myQTObject.addParam( '" . esc_js( $name ) . "', '" . esc_js( $value ) . "' );"; 
     3673 
     3674        $html .= ' myQTObject.write();</script></span>'; 
     3675 
     3676        return $html; 
    36613677    } 
    36623678 
Note: See TracChangeset for help on using the changeset viewer.