Plugin Directory

Changeset 585525


Ignore:
Timestamp:
08/14/2012 08:30:17 PM (14 years ago)
Author:
srcoley
Message:

Fixed major bug in ssl support and the .ysw-youtube class

Location:
youtube-sidebar-widget
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • youtube-sidebar-widget/tags/1.3.1/readme.txt

    r583051 r585525  
    44Requires at least: 2.0.2
    55Tested up to: 3.4.1
    6 Stable tag: 1.3
    7 Version: 1.3
     6Stable tag: 1.3.1
     7Version: 1.3.1
    88
    99List video thumbnails from a Youtube video, account, or playlist in your WordPress theme using widgets. Play the videos right on your theme!
     
    9090* Added .ysw-youtube class that can be added to elements along with an id attribute with a value equal to the YouTube video's ID hash. Clicking these elements will cause the video to appear.
    9191
     92= 1.3.1 =
     93* Fixed major bug with both ssl and the .ysw-youtube class
     94
    9295== Upgrade Notice ==
    9396
     
    123126* Added an autoplay widget setting
    124127* Added .ysw-youtube class that can be added to elements along with an id attribute with a value equal
     128= 1.3.1 =
     129* This version fixes a major bug in ssl functionality and the .yws-youtube class.
  • youtube-sidebar-widget/tags/1.3.1/script.js

    r583051 r585525  
     1/*
     2 *  Version: 1.3.1
     3 */
    14jQuery(function($){
    25    $("#youtube-sidebar-widget li div.play_arrow, #youtube-sidebar-widget li a, .ysw-youtube").click(function(){
    3         var el = $(this).parent();
     6        if($(this).is(".ysw-youtube")) {
     7            var el = $(this);
     8        } else {
     9            var el = $(this).parent();
     10        }
    411        var hash = el.attr('id');
    512        var autoplay = el.attr('data-autoplay');
    6         $('body').prepend("<div id='ysw-overlay'></div><div id='ysw-viewer'><a href='#'>close</a><iframe title='YouTube video player' width='640' height='390' src='http://www.youtube.com/embed/" + hash + "?autoplay=" + autoplay + "' frameborder='0' allowfullscreen></iframe></div>");
     13        var ssl = document.location.protocol;
     14        console.log(ssl);
     15        $('body').prepend("<div id='ysw-overlay'></div><div id='ysw-viewer'><a href='#'>close</a><iframe title='YouTube video player' width='640' height='390' src='" + ssl + "//www.youtube.com/embed/" + hash + "?autoplay=" + autoplay + "' frameborder='0' allowfullscreen></iframe></div>");
    716        var win = $(window);
    817        var overlay = $("#ysw-overlay");
  • youtube-sidebar-widget/tags/1.3.1/youtube-sidebar-widget.php

    r583051 r585525  
    44    Plugin URI: http://wordpress.org/extend/plugins/youtube-sidebar-widget/
    55    Description: List video thumbnails from a Youtube account or playlist in your WordPress theme using widgets. Play the videos right on your theme!
    6     Version: 1.3
     6    Version: 1.3.1
    77    Author: Stephen Coley
    88    Author URI: http://coley.co
     
    3434    }
    3535
     36    function ssl() {
     37        if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
     38            return "https";
     39        } else {
     40            return "http";
     41        }
     42    }
     43
    3644    class YoutubeSidebarWidget extends WP_Widget {
    3745
     
    5866            $height = ($width * 3) / 4;
    5967            $key = "AI39si4egIgiaFaxxolUNjk1Iw4ip4GHWJMt44ZpnWXidiFLjlX1_kSwUYUI-bhtK9oW3bvZ7CFe7syG__AtokRmrTMDYHdXvA";
    60             $vidid_url = "http://gdata.youtube.com/feeds/api/videos/$ident?v=2&key=$key";
    61             $username_url = "http://gdata.youtube.com/feeds/base/users/$ident/uploads?alt=rss&amp;v=2&amp;orderby=published&amp;client=ytapi-youtube-profile&key=$key";
    62             $playlist_url = "http://gdata.youtube.com/feeds/api/playlists/$ident?v=2&key=$key";
     68            $vidid_url = ssl() . "://gdata.youtube.com/feeds/api/videos/$ident?v=2&key=$key";
     69            $username_url = ssl() . "://gdata.youtube.com/feeds/base/users/$ident/uploads?alt=rss&amp;v=2&amp;orderby=published&amp;client=ytapi-youtube-profile&key=$key";
     70            $playlist_url = ssl() . "://gdata.youtube.com/feeds/api/playlists/$ident?v=2&key=$key";
    6371            echo $before_widget;
    6472            if($title) {
     
    9098                                    $link = explode("/watch?v=", $item->link);
    9199                                    $hash = explode("&", $link[1]);
    92                                     $img = "http://i2.ytimg.com/vi/$hash[0]/0.jpg";
     100                                    $img = ssl() . "://i2.ytimg.com/vi/$hash[0]/0.jpg";
    93101
    94102                                    if($titles == "yes") {
     
    107115                                $link = explode("/watch?v=", $item->link);
    108116                                $hash = explode("&", $link[1]);
    109                                 $img = "http://i2.ytimg.com/vi/$hash[0]/0.jpg";
     117                                $img = ssl() . "://i2.ytimg.com/vi/$hash[0]/0.jpg";
    110118
    111119                                if($titles == "yes") {
     
    146154                        $link = explode("watch?v=", $item->link['href']);
    147155                        $hash = explode("&", $link[1]);
    148                         $img = "http://i2.ytimg.com/vi/$hash[0]/0.jpg";
     156                        $img = ssl() . "://i2.ytimg.com/vi/$hash[0]/0.jpg";
    149157
    150158                        if($titles == "yes") {
     
    179187                                $link = explode("/watch?v=", $link_url['href']);
    180188                                $hash = explode("&", $link[1]);
    181                                 $img = "http://i2.ytimg.com/vi/$hash[0]/0.jpg";
     189                                $img = ssl() . "://i2.ytimg.com/vi/$hash[0]/0.jpg";
    182190
    183191                                if($titles == "yes") {
  • youtube-sidebar-widget/trunk/readme.txt

    r583051 r585525  
    44Requires at least: 2.0.2
    55Tested up to: 3.4.1
    6 Stable tag: 1.3
    7 Version: 1.3
     6Stable tag: 1.3.1
     7Version: 1.3.1
    88
    99List video thumbnails from a Youtube video, account, or playlist in your WordPress theme using widgets. Play the videos right on your theme!
     
    9090* Added .ysw-youtube class that can be added to elements along with an id attribute with a value equal to the YouTube video's ID hash. Clicking these elements will cause the video to appear.
    9191
     92= 1.3.1 =
     93* Fixed major bug with both ssl and the .ysw-youtube class
     94
    9295== Upgrade Notice ==
    9396
     
    123126* Added an autoplay widget setting
    124127* Added .ysw-youtube class that can be added to elements along with an id attribute with a value equal
     128= 1.3.1 =
     129* This version fixes a major bug in ssl functionality and the .yws-youtube class.
  • youtube-sidebar-widget/trunk/script.js

    r583051 r585525  
     1/*
     2 *  Version: 1.3.1
     3 */
    14jQuery(function($){
    25    $("#youtube-sidebar-widget li div.play_arrow, #youtube-sidebar-widget li a, .ysw-youtube").click(function(){
    3         var el = $(this).parent();
     6        if($(this).is(".ysw-youtube")) {
     7            var el = $(this);
     8        } else {
     9            var el = $(this).parent();
     10        }
    411        var hash = el.attr('id');
    512        var autoplay = el.attr('data-autoplay');
    6         $('body').prepend("<div id='ysw-overlay'></div><div id='ysw-viewer'><a href='#'>close</a><iframe title='YouTube video player' width='640' height='390' src='http://www.youtube.com/embed/" + hash + "?autoplay=" + autoplay + "' frameborder='0' allowfullscreen></iframe></div>");
     13        var ssl = document.location.protocol;
     14        console.log(ssl);
     15        $('body').prepend("<div id='ysw-overlay'></div><div id='ysw-viewer'><a href='#'>close</a><iframe title='YouTube video player' width='640' height='390' src='" + ssl + "//www.youtube.com/embed/" + hash + "?autoplay=" + autoplay + "' frameborder='0' allowfullscreen></iframe></div>");
    716        var win = $(window);
    817        var overlay = $("#ysw-overlay");
  • youtube-sidebar-widget/trunk/youtube-sidebar-widget.php

    r583051 r585525  
    44    Plugin URI: http://wordpress.org/extend/plugins/youtube-sidebar-widget/
    55    Description: List video thumbnails from a Youtube account or playlist in your WordPress theme using widgets. Play the videos right on your theme!
    6     Version: 1.3
     6    Version: 1.3.1
    77    Author: Stephen Coley
    88    Author URI: http://coley.co
     
    3434    }
    3535
     36    function ssl() {
     37        if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
     38            return "https";
     39        } else {
     40            return "http";
     41        }
     42    }
     43
    3644    class YoutubeSidebarWidget extends WP_Widget {
    3745
     
    5866            $height = ($width * 3) / 4;
    5967            $key = "AI39si4egIgiaFaxxolUNjk1Iw4ip4GHWJMt44ZpnWXidiFLjlX1_kSwUYUI-bhtK9oW3bvZ7CFe7syG__AtokRmrTMDYHdXvA";
    60             $vidid_url = "http://gdata.youtube.com/feeds/api/videos/$ident?v=2&key=$key";
    61             $username_url = "http://gdata.youtube.com/feeds/base/users/$ident/uploads?alt=rss&amp;v=2&amp;orderby=published&amp;client=ytapi-youtube-profile&key=$key";
    62             $playlist_url = "http://gdata.youtube.com/feeds/api/playlists/$ident?v=2&key=$key";
     68            $vidid_url = ssl() . "://gdata.youtube.com/feeds/api/videos/$ident?v=2&key=$key";
     69            $username_url = ssl() . "://gdata.youtube.com/feeds/base/users/$ident/uploads?alt=rss&amp;v=2&amp;orderby=published&amp;client=ytapi-youtube-profile&key=$key";
     70            $playlist_url = ssl() . "://gdata.youtube.com/feeds/api/playlists/$ident?v=2&key=$key";
    6371            echo $before_widget;
    6472            if($title) {
     
    9098                                    $link = explode("/watch?v=", $item->link);
    9199                                    $hash = explode("&", $link[1]);
    92                                     $img = "http://i2.ytimg.com/vi/$hash[0]/0.jpg";
     100                                    $img = ssl() . "://i2.ytimg.com/vi/$hash[0]/0.jpg";
    93101
    94102                                    if($titles == "yes") {
     
    107115                                $link = explode("/watch?v=", $item->link);
    108116                                $hash = explode("&", $link[1]);
    109                                 $img = "http://i2.ytimg.com/vi/$hash[0]/0.jpg";
     117                                $img = ssl() . "://i2.ytimg.com/vi/$hash[0]/0.jpg";
    110118
    111119                                if($titles == "yes") {
     
    146154                        $link = explode("watch?v=", $item->link['href']);
    147155                        $hash = explode("&", $link[1]);
    148                         $img = "http://i2.ytimg.com/vi/$hash[0]/0.jpg";
     156                        $img = ssl() . "://i2.ytimg.com/vi/$hash[0]/0.jpg";
    149157
    150158                        if($titles == "yes") {
     
    179187                                $link = explode("/watch?v=", $link_url['href']);
    180188                                $hash = explode("&", $link[1]);
    181                                 $img = "http://i2.ytimg.com/vi/$hash[0]/0.jpg";
     189                                $img = ssl() . "://i2.ytimg.com/vi/$hash[0]/0.jpg";
    182190
    183191                                if($titles == "yes") {
Note: See TracChangeset for help on using the changeset viewer.