WordPress.org

Plugin Directory

Changeset 1739221


Ignore:
Timestamp:
10/01/17 20:49:50 (7 weeks ago)
Author:
urkekg
Message:

Add missing thumbnail quality option to TinyMCE shortcode selector

Location:
youtube-channel
Files:
44 added
4 edited

Legend:

Unmodified
Added
Removed
  • youtube-channel/trunk/inc/tinymce/plugin.js

    r1644170 r1739221  
    7575                                    tooltip: '', 
    7676                                    values : [ 
    77                                         {text: 'Channel (User Uploads)', value: '0', selected: true}, 
     77                                        {text: 'Channel (User Uploads)', value: '0'}, 
    7878                                        {text: 'Favourited videos', value: '1'}, 
    7979                                        {text: 'Liked videos', value: '3'}, 
    8080                                        {text: 'Playlist', value: '2'}, 
    81                                     ] 
     81                                    ], 
     82                                    value : '0' 
    8283                                }, 
    8384                                { 
     
    8990                                        {text: 'Do not cache', value: '0'}, 
    9091                                        {text: '1 minute', value: '60'}, 
    91                                         {text: '5 minutes', value: '300', selected: true}, 
     92                                        {text: '5 minutes', value: '300'}, 
    9293                                        {text: '15 minutes', value: '900'}, 
    9394                                        {text: '30 minutes', value: '1800'}, 
     
    108109                                        {text: '3 weeks', value: '1814400'}, 
    109110                                        {text: '1 month', value: '2419200'}, 
    110                                     ] 
     111                                    ], 
     112                                    value : '300' 
    111113                                }, 
    112114                                /* 
     
    160162                                    // tooltip: '', 
    161163                                    values : [ 
    162                                         {text: 'Widescreen (16:9)', value: '3', selected: true}, 
     164                                        {text: 'Widescreen (16:9)', value: '3'}, 
    163165                                        {text: 'Standard TV (4:3)', value: '1'}, 
    164                                     ] 
     166                                    ], 
     167                                    value : '3' 
    165168                                }, 
    166169                                { 
     
    189192                                        {text: 'Embedded Playlist', value: 'playlist'}, 
    190193                                        // {text: 'Gallery', value: 'gallery'}, 
    191                                     ] 
     194                                    ], 
     195                                    value : 'thumbnail' 
     196                                }, 
     197                                { 
     198                                    type: 'listbox', 
     199                                    name: 'thumb_quality', 
     200                                    label: 'Thumbnail Quality', 
     201                                    tooltip: '', 
     202                                    values : [ 
     203                                        {text: 'Default Quality (120x90px)', value: 'default'}, 
     204                                        {text: 'Medium Quality (320x180px)', value: 'mqdefault'}, 
     205                                        {text: 'High Quality (480x360px)', value: 'hqdefault'}, 
     206                                        {text: 'Standard Definition (640x480px)', value: 'sddefault'}, 
     207                                        {text: 'Maximum Resolution (1280x720px)', value: 'maxresdefault'}, 
     208                                    ], 
     209                                    value : 'hqdefault' 
    192210                                }, 
    193211                                /* 
     
    275293                                    tooltip: '', 
    276294                                    values : [ 
    277                                         {text: 'Hide title', value: 'none', selected: true}, 
     295                                        {text: 'Hide title', value: 'none'}, 
    278296                                        {text: 'Above video/thumbnail', value: 'above'}, 
    279297                                        {text: 'Below video/thumbnail', value: 'below'}, 
    280                                     ] 
     298                                    ], 
     299                                    value : 'none' 
    281300                                }, 
    282301                                { 
     
    318337                                    // tooltip: '', 
    319338                                    values : [ 
    320                                         {text: 'Hide link', value: 'none', selected: true}, 
     339                                        {text: 'Hide link', value: 'none'}, 
    321340                                        {text: 'Vanity/Custom URL', value: 'vanity'}, // ex 2 
    322341                                        {text: 'Channel page URL', value: 'channel'}, // ex 1 
    323342                                        {text: 'Legacy username URL', value: 'legacy'}, // ex 0 
    324                                     ] 
     343                                    ], 
     344                                    value : 'none' 
    325345                                }, 
    326346                                { 
     
    356376                        if ( e.data.width ) shortcode += ' width=' + e.data.width.replace(/[^0-9.]/g, '') + ''; 
    357377                        if ( e.data.display ) shortcode += ' display=' + e.data.display + ''; 
     378                        if ( e.data.thumb_quality ) shortcode += ' thumb_quality=' + e.data.thumb_quality + ''; 
    358379                        // if ( e.data.cols ) shortcode += ' cols=' + e.data.cols + ''; 
    359380                        if ( e.data.no_thumb_title ) shortcode += ' no_thumb_title=1'; 
  • youtube-channel/trunk/inc/tinymce/plugin.min.js

    r1644170 r1739221  
    1 !function(){tinymce.PluginManager.add("youtube_channel",function(e){e.addButton("youtube_channel_shortcode",{tooltip:"YouTube Channel",icon:"ytc",onclick:function(){e.windowManager.open({title:"YouTube Channel",bodyType:"tabpanel",buttons:[{text:"Insert Shortcode",onclick:"submit",classes:"widget btn primary",minWidth:130},{text:"Cancel",onclick:"close"}],body:[{title:"General Settings",type:"form",items:[{type:"textbox",name:"class",label:"Custom CSS Class",value:"",tooltip:"Enter custom class for YTC block, if you wish to target block styling"},{type:"textbox",name:"vanity",label:"Vanity/Custom ID",value:""},{type:"textbox",name:"channel",label:"YouTube Channel ID",value:""},{type:"textbox",name:"legacy",label:"Legacy Username",value:""},{type:"textbox",name:"playlist",label:"Playlist ID",value:""},{type:"listbox",name:"resource",label:"Resource to use",tooltip:"",values:[{text:"Channel (User Uploads)",value:"0",selected:!0},{text:"Favourited videos",value:"1"},{text:"Liked videos",value:"3"},{text:"Playlist",value:"2"}]},{type:"listbox",name:"cache",label:"Cache feed",tooltip:"",values:[{text:"Do not cache",value:"0"},{text:"1 minute",value:"60"},{text:"5 minutes",value:"300",selected:!0},{text:"15 minutes",value:"900"},{text:"30 minutes",value:"1800"},{text:"1 hour",value:"3600"},{text:"2 hours",value:"7200"},{text:"5 hours",value:"18000"},{text:"10 hours",value:"36000"},{text:"12 hours",value:"43200"},{text:"18 hours",value:"64800"},{text:"1 day",value:"86400"},{text:"2 days",value:"172800"},{text:"3 days",value:"259200"},{text:"4 days",value:"345600"},{text:"5 days",value:"432000"},{text:"6 days",value:"518400"},{text:"1 week",value:"604800"},{text:"2 weeks",value:"1209600"},{text:"3 weeks",value:"1814400"},{text:"1 month",value:"2419200"}]},{type:"textbox",name:"fetch",label:"Fetch",value:"10",tooltip:"Number of videos that will be used for random pick (min 2, max 50, default 25)"},{type:"textbox",name:"num",label:"Show",value:"1",tooltip:"Number of videos to display"},{type:"checkbox",name:"privacy",label:"Use Enhanced Privacy",tooltip:"Enable this option to protect your visitors privacy",checked:!1},{type:"checkbox",name:"random",label:"Random video",tooltip:'Show random video from resource (Have no effect if "Embed as" has been set to "Embedded Playlist")',checked:!1}]},{title:"Video Settings",type:"form",items:[{type:"listbox",name:"ratio",label:"Aspect Ratio",values:[{text:"Widescreen (16:9)",value:"3",selected:!0},{text:"Standard TV (4:3)",value:"1"}]},{type:"checkbox",name:"responsive",label:"Responsive video",tooltip:"Make video responsive (distribute one full width video per row)",checked:!0},{type:"textbox",name:"width",label:"Initial width (px)",value:"306",tooltip:"Set initial width for video or thumbnail (in pixels)"},{type:"listbox",name:"display",label:"Embed as",tooltip:"",values:[{text:"Thumbnail",value:"thumbnail"},{text:"HTML5 (iframe)",value:"iframe"},{text:"HTML5 (iframe) Asynchronous",value:"iframe2"},{text:"Embedded Playlist",value:"playlist"}]},{type:"checkbox",name:"nolightbox",label:"Disable YTC lightbox",tooltip:"This will work only for Thumbnail",checked:!1},{type:"listbox",name:"target",label:"Open thumbnail anchor",tooltip:"If you select Thumbnail and enable Disable lightbox, you can open thumbnail anchor in new window/tab",values:[{text:"Default",value:""},{text:"New window/tab",value:"_blank"}]},{type:"checkbox",name:"no_thumb_title",label:"Hide thumbnail tooltip",checked:!1},{type:"checkbox",name:"themelight",label:"Use light theme",tooltip:"Default theme is dark",checked:!1},{type:"checkbox",name:"controls",label:"Hide player controls",checked:!1},{type:"checkbox",name:"autoplay",label:"Autoplay video/playlist",checked:!1},{type:"checkbox",name:"mute",label:"Mute video on autoplay",checked:!1},{type:"checkbox",name:"norel",label:"Hide related videos",checked:!0},{type:"checkbox",name:"nobrand",label:"Hide YT Logo",tooltip:"Does not work for all videos",checked:!0}]},{title:"Content Layout",type:"form",items:[{type:"listbox",name:"showtitle",label:"Show video title",tooltip:"",values:[{text:"Hide title",value:"none",selected:!0},{text:"Above video/thumbnail",value:"above"},{text:"Below video/thumbnail",value:"below"}]},{type:"checkbox",name:"showdesc",label:"Show video description",checked:!1},{type:"textbox",name:"desclen",label:"Description length",value:"0",tooltip:"Set number of characters to cut down video description to (0 means full length)"},{type:"checkbox",name:"noanno",label:"Hide annotations",checked:!0},{type:"checkbox",name:"noinfo",label:"Hide video info",checked:!0}]},{title:"Link to Channel",type:"form",items:[{type:"listbox",name:"link_to",label:"Link to",values:[{text:"Hide link",value:"none",selected:!0},{text:"Vanity/Custom URL",value:"vanity"},{text:"Channel page URL",value:"channel"},{text:"Legacy username URL",value:"legacy"}]},{type:"textbox",name:"goto_txt",label:"Title for link",value:"Visit our YouTube channel"}]}],onsubmit:function(t){var a="[youtube_channel";t.data.vanity&&(a+=" vanity="+t.data.vanity),t.data.channel&&(a+=" channel="+t.data.channel),t.data.legacy&&(a+=" legacy="+t.data.legacy),t.data.playlist&&(a+=" playlist="+t.data.playlist),t.data.resource&&(a+=" resource="+t.data.resource),t.data.cache&&(a+=" cache="+t.data.cache),t.data.privacy&&(a+=" privacy=1"),t.data.random&&(a+=" random=1"),t.data.fetch&&(a+=" fetch="+t.data.fetch.replace(/[^0-9.]/g,"")),t.data.num&&(a+=" num="+t.data.num.replace(/[^0-9.]/g,"")),t.data.ratio&&(a+=" ratio="+t.data.ratio),t.data.responsive&&(a+=" responsive=1"),t.data.width&&(a+=" width="+t.data.width.replace(/[^0-9.]/g,"")),t.data.display&&(a+=" display="+t.data.display),t.data.no_thumb_title&&(a+=" no_thumb_title=1"),t.data.themelight&&(a+=" themelight=1"),t.data.controls&&(a+=" controls=1"),t.data.autoplay&&(a+=" autoplay=1"),t.data.mute&&(a+=" mute=1"),t.data.norel&&(a+=" norel=1"),t.data.nobrand&&(a+=" nobrand=1"),t.data.nolightbox&&(a+=" nolightbox=1"),t.data.target&&(a+=" target="+t.data.target),t.data.showtitle&&(a+=" showtitle="+t.data.showtitle),t.data.showdesc&&(a+=" showdesc=1"),t.data.desclen&&(a+=" desclen="+t.data.desclen.replace(/[^0-9.]/g,"")),t.data.noanno&&(a+=" noanno=1"),t.data.noinfo&&(a+=" noinfo=1"),t.data.link_to&&(a+=" link_to="+t.data.link_to),t.data.goto_txt&&(a+=' goto_txt="'+t.data.goto_txt+'"'),t.data.class&&(a+=" class="+t.data.class),a+="]",e.insertContent(a)}})}})})}(); 
     1!function(){tinymce.PluginManager.add("youtube_channel",function(e,t){e.addButton("youtube_channel_shortcode",{tooltip:"YouTube Channel",icon:"ytc",onclick:function(){e.windowManager.open({title:"YouTube Channel",bodyType:"tabpanel",buttons:[{text:"Insert Shortcode",onclick:"submit",classes:"widget btn primary",minWidth:130},{text:"Cancel",onclick:"close"}],body:[{title:"General Settings",type:"form",items:[{type:"textbox",name:"class",label:"Custom CSS Class",value:"",tooltip:"Enter custom class for YTC block, if you wish to target block styling"},{type:"textbox",name:"vanity",label:"Vanity/Custom ID",value:""},{type:"textbox",name:"channel",label:"YouTube Channel ID",value:""},{type:"textbox",name:"legacy",label:"Legacy Username",value:""},{type:"textbox",name:"playlist",label:"Playlist ID",value:""},{type:"listbox",name:"resource",label:"Resource to use",tooltip:"",values:[{text:"Channel (User Uploads)",value:"0"},{text:"Favourited videos",value:"1"},{text:"Liked videos",value:"3"},{text:"Playlist",value:"2"}],value:"0"},{type:"listbox",name:"cache",label:"Cache feed",tooltip:"",values:[{text:"Do not cache",value:"0"},{text:"1 minute",value:"60"},{text:"5 minutes",value:"300"},{text:"15 minutes",value:"900"},{text:"30 minutes",value:"1800"},{text:"1 hour",value:"3600"},{text:"2 hours",value:"7200"},{text:"5 hours",value:"18000"},{text:"10 hours",value:"36000"},{text:"12 hours",value:"43200"},{text:"18 hours",value:"64800"},{text:"1 day",value:"86400"},{text:"2 days",value:"172800"},{text:"3 days",value:"259200"},{text:"4 days",value:"345600"},{text:"5 days",value:"432000"},{text:"6 days",value:"518400"},{text:"1 week",value:"604800"},{text:"2 weeks",value:"1209600"},{text:"3 weeks",value:"1814400"},{text:"1 month",value:"2419200"}],value:"300"},{type:"textbox",name:"fetch",label:"Fetch",value:"10",tooltip:"Number of videos that will be used for random pick (min 2, max 50, default 25)"},{type:"textbox",name:"num",label:"Show",value:"1",tooltip:"Number of videos to display"},{type:"checkbox",name:"privacy",label:"Use Enhanced Privacy",tooltip:"Enable this option to protect your visitors privacy",checked:!1},{type:"checkbox",name:"random",label:"Random video",tooltip:'Show random video from resource (Have no effect if "Embed as" has been set to "Embedded Playlist")',checked:!1}]},{title:"Video Settings",type:"form",items:[{type:"listbox",name:"ratio",label:"Aspect Ratio",values:[{text:"Widescreen (16:9)",value:"3"},{text:"Standard TV (4:3)",value:"1"}],value:"3"},{type:"checkbox",name:"responsive",label:"Responsive video",tooltip:"Make video responsive (distribute one full width video per row)",checked:!0},{type:"textbox",name:"width",label:"Initial width (px)",value:"306",tooltip:"Set initial width for video or thumbnail (in pixels)"},{type:"listbox",name:"display",label:"Embed as",tooltip:"",values:[{text:"Thumbnail",value:"thumbnail"},{text:"HTML5 (iframe)",value:"iframe"},{text:"HTML5 (iframe) Asynchronous",value:"iframe2"},{text:"Embedded Playlist",value:"playlist"}],value:"thumbnail"},{type:"listbox",name:"thumb_quality",label:"Thumbnail Quality",tooltip:"",values:[{text:"Default Quality (120x90px)",value:"default"},{text:"Medium Quality (320x180px)",value:"mqdefault"},{text:"High Quality (480x360px)",value:"hqdefault"},{text:"Standard Definition (640x480px)",value:"sddefault"},{text:"Maximum Resolution (1280x720px)",value:"maxresdefault"}],value:"hqdefault"},{type:"checkbox",name:"nolightbox",label:"Disable YTC lightbox",tooltip:"This will work only for Thumbnail",checked:!1},{type:"listbox",name:"target",label:"Open thumbnail anchor",tooltip:"If you select Thumbnail and enable Disable lightbox, you can open thumbnail anchor in new window/tab",values:[{text:"Default",value:""},{text:"New window/tab",value:"_blank"}]},{type:"checkbox",name:"no_thumb_title",label:"Hide thumbnail tooltip",checked:!1},{type:"checkbox",name:"themelight",label:"Use light theme",tooltip:"Default theme is dark",checked:!1},{type:"checkbox",name:"controls",label:"Hide player controls",checked:!1},{type:"checkbox",name:"autoplay",label:"Autoplay video/playlist",checked:!1},{type:"checkbox",name:"mute",label:"Mute video on autoplay",checked:!1},{type:"checkbox",name:"norel",label:"Hide related videos",checked:!0},{type:"checkbox",name:"nobrand",label:"Hide YT Logo",tooltip:"Does not work for all videos",checked:!0}]},{title:"Content Layout",type:"form",items:[{type:"listbox",name:"showtitle",label:"Show video title",tooltip:"",values:[{text:"Hide title",value:"none"},{text:"Above video/thumbnail",value:"above"},{text:"Below video/thumbnail",value:"below"}],value:"none"},{type:"checkbox",name:"showdesc",label:"Show video description",checked:!1},{type:"textbox",name:"desclen",label:"Description length",value:"0",tooltip:"Set number of characters to cut down video description to (0 means full length)"},{type:"checkbox",name:"noanno",label:"Hide annotations",checked:!0},{type:"checkbox",name:"noinfo",label:"Hide video info",checked:!0}]},{title:"Link to Channel",type:"form",items:[{type:"listbox",name:"link_to",label:"Link to",values:[{text:"Hide link",value:"none"},{text:"Vanity/Custom URL",value:"vanity"},{text:"Channel page URL",value:"channel"},{text:"Legacy username URL",value:"legacy"}],value:"none"},{type:"textbox",name:"goto_txt",label:"Title for link",value:"Visit our YouTube channel"}]}],onsubmit:function(t){var a="[youtube_channel";t.data.vanity&&(a+=" vanity="+t.data.vanity),t.data.channel&&(a+=" channel="+t.data.channel),t.data.legacy&&(a+=" legacy="+t.data.legacy),t.data.playlist&&(a+=" playlist="+t.data.playlist),t.data.resource&&(a+=" resource="+t.data.resource),t.data.cache&&(a+=" cache="+t.data.cache),t.data.privacy&&(a+=" privacy=1"),t.data.random&&(a+=" random=1"),t.data.fetch&&(a+=" fetch="+t.data.fetch.replace(/[^0-9.]/g,"")),t.data.num&&(a+=" num="+t.data.num.replace(/[^0-9.]/g,"")),t.data.ratio&&(a+=" ratio="+t.data.ratio),t.data.responsive&&(a+=" responsive=1"),t.data.width&&(a+=" width="+t.data.width.replace(/[^0-9.]/g,"")),t.data.display&&(a+=" display="+t.data.display),t.data.thumb_quality&&(a+=" thumb_quality="+t.data.thumb_quality),t.data.no_thumb_title&&(a+=" no_thumb_title=1"),t.data.themelight&&(a+=" themelight=1"),t.data.controls&&(a+=" controls=1"),t.data.autoplay&&(a+=" autoplay=1"),t.data.mute&&(a+=" mute=1"),t.data.norel&&(a+=" norel=1"),t.data.nobrand&&(a+=" nobrand=1"),t.data.nolightbox&&(a+=" nolightbox=1"),t.data.target&&(a+=" target="+t.data.target),t.data.showtitle&&(a+=" showtitle="+t.data.showtitle),t.data.showdesc&&(a+=" showdesc=1"),t.data.desclen&&(a+=" desclen="+t.data.desclen.replace(/[^0-9.]/g,"")),t.data.noanno&&(a+=" noanno=1"),t.data.noinfo&&(a+=" noinfo=1"),t.data.link_to&&(a+=" link_to="+t.data.link_to),t.data.goto_txt&&(a+=' goto_txt="'+t.data.goto_txt+'"'),t.data.class&&(a+=" class="+t.data.class),a+="]",e.insertContent(a)}})}})})}(); 
  • youtube-channel/trunk/readme.txt

    r1739214 r1739221  
    55Requires at least: 4.0 
    66Tested up to: 4.9 
    7 Stable tag: 3.0.11.2 
     7Stable tag: 3.0.11.3 
    88License: GPLv3 
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    366366 
    367367== Changelog == 
     368 
     369= 3.0.11.3 (20171001) = 
     370* Fix: Default values in dropdown lists does not preselect in TinyMCE shortcode selector 
     371* Add: new option for thumbnail quality for TinyMCE shortcode selector 
    368372 
    369373= 3.0.11.2 (20171001) = 
  • youtube-channel/trunk/youtube-channel.php

    r1739214 r1739221  
    44Plugin URI: https://urosevic.net/wordpress/plugins/youtube-channel/ 
    55Description: Quick and easy embed latest or random videos from YouTube channel (user uploads, liked or favourited videos) or playlist. Use <a href="widgets.php">widget</a> for sidebar or shortcode for content. Works with <em>YouTube Data API v3</em>. 
    6 Version: 3.0.11.2 
     6Version: 3.0.11.3 
    77Author: Aleksandar Urošević 
    88Author URI: https://urosevic.net/ 
     
    1919 
    2020        const DB_VER = 20; 
    21         const VER = '3.0.11.2'; 
     21        const VER = '3.0.11.3'; 
    2222 
    2323        public $plugin_name   = 'YouTube Channel'; 
Note: See TracChangeset for help on using the changeset viewer.