Version Description
Download this release
Release Info
Developer | embedplus |
Plugin | YouTube |
Version | 10.5 |
Comparing to | |
See all releases |
Code changes from version 10.4 to 10.5
- images/arrow-left.svg +7 -0
- images/arrow-right.svg +7 -0
- images/ssaltgalleryall.jpg +0 -0
- readme.txt +7 -4
- scripts/ytprefs.min.js +10 -9
- styles/ytprefs.min.css +1 -1
- youtube.php +200 -116
images/arrow-left.svg
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4 |
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
5 |
+
width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
|
6 |
+
<path fill="#010101" d="M0,256L256,0v128L128,256l128,128v128L0,256z M512,512V384L384,256l128-128V0L256,256L512,512z"/>
|
7 |
+
</svg>
|
images/arrow-right.svg
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4 |
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
5 |
+
width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
|
6 |
+
<path fill="#010101" d="M256,512V384l128-128L256,128V0l256,256L256,512z M256,256L0,0v128l128,128L0,384v128L256,256z"/>
|
7 |
+
</svg>
|
images/ssaltgalleryall.jpg
ADDED
Binary file
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: embedplus
|
|
3 |
Plugin Name: YouTube Embed
|
4 |
Tags: youtube channel, video gallery, youtube galleries, channel gallery, gallery, playlist gallery, youtube gallery, accessibility, analytics, api, blocked youtube videos, cache, caching, channel, deleted youtube videos, effects, embed youtube, embedding youtube, featured image, get_locale, i18n, internationalization, l10n, language, lazy, lazy load, locale, localization, mute, no-cookie, oembed, page speed, playlist, playlists, plugin, Reddit, responsive, seo, short code, shortcode, ssl, subtitles, thumbnail, thumbnail image, thumbnails, tinymce, translate, translator, video, video analytics, video plugin, video seo, video shortcode, video thumbnails, view count, volume, widget, wordpress security, wordpress youtube embed, youtube, youtube api, youtube analytics, youtube embed, youtube impressions, youtube player, youtube playlist, youtube plugin, youtube shortcode, youtube snippets, youtube takedowns, youtube thumbnails, youtube plugin migration
|
5 |
Requires at least: 3.3
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 10.
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
YouTube embed plugin. Embed a responsive video, YouTube channel gallery, or playlist gallery. Add video thumbnails, analytics, SEO, caching...
|
@@ -17,7 +17,7 @@ YouTube embed plugin. Embed a responsive video, YouTube channel gallery, or play
|
|
17 |
* Improved accessibility by using title attributes for screen reader support. It should help your site [pass functional accessibility evaluations (FAE)](https://www.youtube.com/watch?v=gpAiFnYYkbk).
|
18 |
* Site origin information with each embed code as an extra security measure. In YouTube's/Google's own words, checking this option "protects against malicious third-party JavaScript being injected into your page and hijacking control of your YouTube player." We especially recommend checking it as it adds higher security than the built-in YouTube embedding method that comes with the current version of WordPress (i.e. oembed).
|
19 |
* Easy "Insert" button for both the Visual and Text mode of the editor
|
20 |
-
* [Embed an entire channel as a playlist >>](https://www.youtube.com/watch?v=_9D4yMyd40g)
|
21 |
* Start video settings for playlist embeds. You can now choose to start a playlist with a specific video or have the plugin automatically start with the most recently added video.
|
22 |
* [Volume level initialization](http://www.embedplus.com/mute-volume-youtube-wordpress.aspx) - helpful when autoplay is checked
|
23 |
* iOS playback preferences
|
@@ -48,7 +48,7 @@ This plugin helps you easily manage the growing complexity of YouTube embedding.
|
|
48 |
|
49 |
The settings page has plenty of default options that you can automatically apply to all your embedded YouTube videos. **Check out the free options below:**
|
50 |
|
51 |
-
* Force HD quality when available
|
52 |
* Make your videos responsive so that they dynamically fit in all screen sizes (smart phone, PC and tablet)
|
53 |
* Modest branding - hide YouTube logo while playing
|
54 |
* Turn on/off all annotations by default
|
@@ -147,6 +147,9 @@ You can also start and end each individual video at particular times. Like the a
|
|
147 |
|
148 |
== Changelog ==
|
149 |
|
|
|
|
|
|
|
150 |
= YouTube Embed 10.4 =
|
151 |
Addresses limitations some users were getting when pasting a YouTube channel and/or playlist gallery.
|
152 |
|
3 |
Plugin Name: YouTube Embed
|
4 |
Tags: youtube channel, video gallery, youtube galleries, channel gallery, gallery, playlist gallery, youtube gallery, accessibility, analytics, api, blocked youtube videos, cache, caching, channel, deleted youtube videos, effects, embed youtube, embedding youtube, featured image, get_locale, i18n, internationalization, l10n, language, lazy, lazy load, locale, localization, mute, no-cookie, oembed, page speed, playlist, playlists, plugin, Reddit, responsive, seo, short code, shortcode, ssl, subtitles, thumbnail, thumbnail image, thumbnails, tinymce, translate, translator, video, video analytics, video plugin, video seo, video shortcode, video thumbnails, view count, volume, widget, wordpress security, wordpress youtube embed, youtube, youtube api, youtube analytics, youtube embed, youtube impressions, youtube player, youtube playlist, youtube plugin, youtube shortcode, youtube snippets, youtube takedowns, youtube thumbnails, youtube plugin migration
|
5 |
Requires at least: 3.3
|
6 |
+
Tested up to: 4.3
|
7 |
+
Stable tag: 10.5
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
YouTube embed plugin. Embed a responsive video, YouTube channel gallery, or playlist gallery. Add video thumbnails, analytics, SEO, caching...
|
17 |
* Improved accessibility by using title attributes for screen reader support. It should help your site [pass functional accessibility evaluations (FAE)](https://www.youtube.com/watch?v=gpAiFnYYkbk).
|
18 |
* Site origin information with each embed code as an extra security measure. In YouTube's/Google's own words, checking this option "protects against malicious third-party JavaScript being injected into your page and hijacking control of your YouTube player." We especially recommend checking it as it adds higher security than the built-in YouTube embedding method that comes with the current version of WordPress (i.e. oembed).
|
19 |
* Easy "Insert" button for both the Visual and Text mode of the editor
|
20 |
+
* [Embed an entire channel as a (non-gallery, single embedded player) playlist >>](https://www.youtube.com/watch?v=_9D4yMyd40g)
|
21 |
* Start video settings for playlist embeds. You can now choose to start a playlist with a specific video or have the plugin automatically start with the most recently added video.
|
22 |
* [Volume level initialization](http://www.embedplus.com/mute-volume-youtube-wordpress.aspx) - helpful when autoplay is checked
|
23 |
* iOS playback preferences
|
48 |
|
49 |
The settings page has plenty of default options that you can automatically apply to all your embedded YouTube videos. **Check out the free options below:**
|
50 |
|
51 |
+
* [Force HD quality when available >>](http://www.embedplus.com/force-high-definition-hd-youtube-embed.aspx) (now deprecated)
|
52 |
* Make your videos responsive so that they dynamically fit in all screen sizes (smart phone, PC and tablet)
|
53 |
* Modest branding - hide YouTube logo while playing
|
54 |
* Turn on/off all annotations by default
|
147 |
|
148 |
== Changelog ==
|
149 |
|
150 |
+
= YouTube Embed 10.5 =
|
151 |
+
Enhanced gallery settings for scrolling, video titles, and thumbnail styling.
|
152 |
+
|
153 |
= YouTube Embed 10.4 =
|
154 |
Addresses limitations some users were getting when pasting a YouTube channel and/or playlist gallery.
|
155 |
|
scripts/ytprefs.min.js
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
-
(function(a){document.querySelectorAll||(document.querySelectorAll=function(
|
2 |
-
isNaN(a)||(0===a?
|
3 |
-
justid:function(
|
4 |
-
encodeURIComponent(a.location.href.split("#")[0])+"&"+
|
5 |
-
(b
|
6 |
-
|
7 |
-
(function(a){a(document).ready(function(){a(".epyt-gallery").each(function(){var
|
8 |
-
|
9 |
-
|
|
1 |
+
(function(a){document.querySelectorAll||(document.querySelectorAll=function(c){var d=document,b=d.documentElement.firstChild,e=d.createElement("STYLE");b.appendChild(e);d.__qsaels=[];e.styleSheet.cssText=c+"{x:expression(document.__qsaels.push(this))}";a.scrollBy(0,0);return d.__qsaels});"undefined"===typeof a._EPADashboard_&&(a._EPADashboard_={initStarted:!1,checkCount:0,onPlayerReady:function(c){try{if("undefined"!==typeof epdovol&&epdovol){var a=parseInt(c.target.getIframe().getAttribute("data-vol"));
|
2 |
+
isNaN(a)||(0===a?c.target.mute():(c.target.isMuted()&&c.target.unMute(),c.target.setVolume(a)))}}catch(b){}setTimeout(function(){try{var a=_EPADashboard_.justid(c.target.getVideoUrl());_EPADashboard_.jp("ytid="+a)}catch(d){}},1700)},onPlayerStateChange:function(a){var d=a.target.getIframe();if(a.data===YT.PlayerState.PLAYING&&!0!==a.target.ponce&&-1===d.src.indexOf("autoplay=1")){a.target.ponce=!0;try{var b=_EPADashboard_.justid(a.target.getVideoUrl());_EPADashboard_.jp("ytid="+b+"&p=1")}catch(e){}}},
|
3 |
+
justid:function(a){return/[\?&]v=([^&#]*)/.exec(a)[1]},dynsetupevents:function(){"undefined"===typeof this.epytsetupdone&&_EPADashboard_.setupevents(this.id)},setupevents:function(a){_EPADashboard_.log("Setting up YT API events: "+a);YT.loaded&&(document.getElementById(a).epytsetupdone=!0,new YT.Player(a,{events:{onReady:_EPADashboard_.onPlayerReady,onStateChange:_EPADashboard_.onPlayerStateChange}}))},jp:function(c){var b=document.createElement("script");b.src="//www.embedplus.com/test-page.aspx?es=w&u="+
|
4 |
+
encodeURIComponent(a.location.href.split("#")[0])+"&"+c+(-1<navigator.userAgent.toLowerCase().indexOf("chrome")?"&b=c&":"&b=&");var f=document.getElementsByTagName("head")[0].appendChild(b);setTimeout(function(){f.parentNode.removeChild(f)},500)},apiInit:function(){_EPADashboard_.initStarted=!0;setTimeout(function(){for(var a=document.querySelectorAll('iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]'),b=0;b<a.length;b++)a[b].hasAttribute("id")||
|
5 |
+
(a[b].id="_dytid_"+Math.round(8999*Math.random()+1E3)),_EPADashboard_.setupevents(a[b].id)},300)},log:function(a){try{console.log(a)}catch(b){}},doubleCheck:function(){_EPADashboard_.checkInterval=setInterval(function(){_EPADashboard_.checkCount++;5<=_EPADashboard_.checkCount||_EPADashboard_.initStarted?clearInterval(_EPADashboard_.checkInterval):(_EPADashboard_.apiInit(),_EPADashboard_.log("YT API init"))},1E3)}});if("undefined"===typeof a.YT){var b=document.createElement("script");b.src="//www.youtube.com/iframe_api";
|
6 |
+
b.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(b)}else YT.loaded&&(_EPADashboard_.apiInit(),_EPADashboard_.log("YT API available"));_EPADashboard_.doubleCheck();a.onYouTubeIframeAPIReady="undefined"!==typeof a.onYouTubeIframeAPIReady?a.onYouTubeIframeAPIReady:function(){_EPADashboard_.apiInit();_EPADashboard_.log("YT API ready")}})(window);
|
7 |
+
(function(a){a(document).ready(function(){a(".epyt-gallery").each(function(){var b=a(this),c=a(this).find("iframe").first(),d=c.data("ep-gallerysrc"),f=a(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid"),d=d.replace("GALLERYVIDEOID",f);c.attr("src",d);var e=b.find(".epyt-gallery-list"),g=function(){try{if(e.hasClass("epyt-gallery-style-carousel")){var b=a(e.find(".epyt-gallery-thumb").get(0)).height()/2;e.find(".epyt-pagination:first-child .epyt-pagenumbers").css("top",
|
8 |
+
b+15+"px")}}catch(c){}};g();a(window).resize(g);b.on("click",".epyt-gallery-list .epyt-gallery-thumb",function(){var b=a(this).data("videoid"),d=c.data("ep-gallerysrc").replace("GALLERYVIDEOID",b),d=0<d.indexOf("autoplay")?d.replace("autoplay=0","autoplay=1"):d+"&autoplay=1";a("html, body").animate({scrollTop:c.offset().top-parseInt(_EPYT_.gallery_scrolloffset)},500,function(){c.attr("src",d)})});b.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){a(this).addClass("hover")});b.on("mouseleave",
|
9 |
+
".epyt-gallery-list .epyt-gallery-thumb",function(){a(this).removeClass("hover")});b.on("click",".epyt-pagebutton",function(){var c={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:a(this).data("playlistid"),pageToken:a(this).data("pagetoken"),pageSize:a(this).data("pagesize"),columns:a(this).data("columns"),showTitle:a(this).data("showtitle"),style:a(this).data("style")}},d=a(this).hasClass("epyt-next"),e=parseInt(b.data("currpage")+"");b.data("currpage",e+(d?1:-1));
|
10 |
+
b.find(".epyt-gallery-list").addClass("epyt-loading");a.post(_EPYT_.ajaxurl,c,function(c){b.find(".epyt-gallery-list").html(c);b.find(".epyt-current").each(function(){a(this).text(b.data("currpage"))})}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){b.find(".epyt-gallery-list").removeClass("epyt-loading");g()})})})})})(jQuery);
|
styles/ytprefs.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.epyt-gallery{text-align:center}.epyt-gallery iframe{margin-bottom:0}.epyt-gallery-list{margin:0 -8px}.epyt-gallery-list.epyt-loading{opacity:.5}.epyt-gallery-thumb{box-sizing:border-box;overflow-y:hidden;display:block!important;cursor:pointer;opacity:.8;float:left;padding:0 8px 10px}.epyt-gallery-thumb.hover{opacity:1;transition:opacity ease-out .3s}.epyt-gallery-img-box{width:100%}.epyt-gallery-img{height:0;width:100%;padding-top:56.25%;position:relative;overflow:hidden!important;background-size:cover!important;background-position:center!important}.epyt-gallery-playhover{opacity:0;position:absolute;top:-10px;left:0;width:100%;height:100%;vertical-align:middle;text-align:center;transition:opacity ease-out .3s}.epyt-gallery-thumb.hover .epyt-gallery-playhover{opacity:1;top:0;transition:all ease-out .3s}.epyt-gallery-thumb .epyt-gallery-playcrutch{display:inline-block;height:100%;vertical-align:middle;width:0}.epyt-gallery-playhover .epyt-play-img{height:auto;max-width:15
|
1 |
+
.epyt-gallery-clear,.epyt-gallery-rowbreak{clear:both}.epyt-gallery{text-align:center}.epyt-gallery iframe{margin-bottom:0}.epyt-gallery-list{margin:0 -8px;position:relative;transition:opacity ease-out .3s}.epyt-gallery-list.epyt-loading{opacity:.5;transition:opacity ease-out .3s}.epyt-gallery-thumb{box-sizing:border-box;overflow-y:hidden;display:block!important;cursor:pointer;opacity:.8;float:left;padding:0 8px 10px}.epyt-gallery-thumb.hover{opacity:1;transition:opacity ease-out .3s}.epyt-gallery-img-box{width:100%}.epyt-gallery-img{height:0;width:100%;padding-top:56.25%;position:relative;overflow:hidden!important;background-size:cover!important;background-position:center!important}.epyt-gallery-playhover{opacity:0;position:absolute;top:-10px;left:0;width:100%;height:100%;vertical-align:middle;text-align:center;transition:opacity ease-out .3s}.epyt-gallery-thumb.hover .epyt-gallery-playhover{opacity:1;top:0;transition:all ease-out .3s}.epyt-gallery-thumb .epyt-gallery-playcrutch{display:inline-block;height:100%;vertical-align:middle;width:0}.epyt-gallery-playhover .epyt-play-img{height:auto!important;max-width:15%!important;padding:0!important;margin:0!important;min-width:30px!important;vertical-align:middle!important;display:inline-block!important}.epyt-gallery-title{font-size:80%;line-height:120%;padding:10px}.epyt-gallery-notitle{padding:4px}.epyt-gallery-list.epyt-gallery-style-listview{margin-left:0;margin-right:0;margin-bottom:25px}.epyt-gallery-thumb.epyt-listview{width:100%!important;padding:0;margin:8px 0}.epyt-gallery-thumb.epyt-listview+.epyt-gallery-rowbreak{display:none}.epyt-gallery-thumb.epyt-listview .epyt-gallery-img-box{float:left;width:150px;max-width:25%;margin-right:20px}.epyt-gallery-thumb.epyt-listview .epyt-gallery-title{padding:10px;text-align:left}.epyt-gallery-thumb.epyt-listview.hover{background-color:#ddd;color:#000;transition:background-color ease-out .3s,color ease-out .3s}.epyt-pagination{clear:both;text-align:center;padding:10px 8px}.epyt-pagenumbers>div,.epyt-pagination>div{display:inline-block;padding:0 2px;vertical-align:middle}.epyt-pagination .epyt-pagebutton{cursor:pointer;display:inline-block;padding:0 10px}.epyt-pagebutton>div{display:inline}.epyt-pagination .epyt-loader{display:none}.epyt-gallery-list.epyt-loading .epyt-pagination .epyt-loader{display:inline-block}.epyt-gallery-list.epyt-gallery-style-carousel{margin-bottom:50px}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagination{display:none}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagination:first-child{position:absolute;left:-8px;width:100%;display:block;margin:auto;top:0;bottom:0;padding-top:0;padding-bottom:0;height:30px}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-gallery-allthumbs{margin:15px 35px}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-gallery-thumb{padding-bottom:0}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton>div{display:none}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton>div.arrow{background:url(../images/arrow-right.svg) no-repeat;background-size:contain;width:20px;height:100%;display:block;text-indent:-99999px;opacity:.7}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton>div.arrow:hover{opacity:1}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton.epyt-prev>div.arrow{background-image:url(../images/arrow-left.svg)}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-next{float:right}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-prev{float:left}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagenumbers{position:absolute;top:100%;left:0;right:0}
|
youtube.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: YouTube
|
4 |
Plugin URI: http://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx
|
5 |
Description: YouTube embed plugin. Embed a responsive YouTube video, playlist gallery, or channel gallery. Add video thumbnails, analytics, SEO, caching...
|
6 |
-
Version: 10.
|
7 |
Author: EmbedPlus Team
|
8 |
Author URI: http://www.embedplus.com
|
9 |
*/
|
@@ -32,7 +32,7 @@
|
|
32 |
class YouTubePrefs
|
33 |
{
|
34 |
|
35 |
-
public static $version = '10.
|
36 |
public static $opt_version = 'version';
|
37 |
public static $optembedwidth = null;
|
38 |
public static $optembedheight = null;
|
@@ -89,6 +89,8 @@ class YouTubePrefs
|
|
89 |
public static $opt_gallery_apikey = 'gallery_apikey';
|
90 |
public static $opt_gallery_columns = 'gallery_columns';
|
91 |
public static $opt_gallery_style = 'gallery_style';
|
|
|
|
|
92 |
public static $opt_alloptions = 'youtubeprefs_alloptions';
|
93 |
public static $alloptions = null;
|
94 |
public static $yt_options = array();
|
@@ -260,12 +262,12 @@ class YouTubePrefs
|
|
260 |
jQuery(ele).parent('.accbox').hide(400);
|
261 |
}
|
262 |
|
263 |
-
(function($j)
|
264 |
{
|
265 |
-
$j(document).ready(function() {
|
266 |
|
267 |
|
268 |
-
$j('.acctitle').click(function() {
|
269 |
var $acctitle = $j(this);
|
270 |
var $accbox = $j(this).parent().children('.accbox');
|
271 |
var pid = $accbox.attr("data-postid");
|
@@ -277,7 +279,7 @@ class YouTubePrefs
|
|
277 |
timeout: 30000,
|
278 |
url: wpajaxurl,
|
279 |
data: {action: 'my_embedplus_glance_vids', postid: pid},
|
280 |
-
success: function(response) {
|
281 |
if (response.type == "success") {
|
282 |
$accbox.html(response.data),
|
283 |
$accbox.show(400);
|
@@ -285,10 +287,10 @@ class YouTubePrefs
|
|
285 |
else {
|
286 |
}
|
287 |
},
|
288 |
-
error: function(xhr, ajaxOptions, thrownError) {
|
289 |
|
290 |
},
|
291 |
-
complete: function() {
|
292 |
$acctitle.children('.accloader').remove();
|
293 |
}
|
294 |
|
@@ -501,12 +503,12 @@ class YouTubePrefs
|
|
501 |
?>
|
502 |
<script type="text/javascript">
|
503 |
function widen_ytprefs_wiz() {
|
504 |
-
setTimeout(function() {
|
505 |
jQuery("#TB_window").animate({marginLeft: '-' + parseInt((950 / 2), 10) + 'px', width: '950px'}, 300);
|
506 |
jQuery("#TB_window iframe").animate({width: '950px'}, 300);
|
507 |
}, 15);
|
508 |
}
|
509 |
-
jQuery(document).ready(function() {
|
510 |
jQuery("#ytprefs_wiz_button").click(widen_ytprefs_wiz);
|
511 |
jQuery(window).resize(widen_ytprefs_wiz);
|
512 |
});
|
@@ -559,23 +561,23 @@ class YouTubePrefs
|
|
559 |
</div>
|
560 |
<iframe allowTransparency="true" src="<?php echo self::$epbase . '/both-plugins-conflict.aspx' ?>" style="width:2px; height: 2px;" ></iframe>
|
561 |
<script type="text/javascript">
|
562 |
-
(function($) {
|
563 |
-
$(document).ready(function() {
|
564 |
-
$('.epxout').click(function() {
|
565 |
$.ajax({
|
566 |
type: "post",
|
567 |
dataType: "json",
|
568 |
timeout: 30000,
|
569 |
url: wpajaxurl,
|
570 |
data: {action: 'my_embedplus_dismiss_double_plugin_warning'},
|
571 |
-
success: function(response) {
|
572 |
if (response.type == "success") {
|
573 |
$(".embedpluswarningbox").hide();
|
574 |
}
|
575 |
},
|
576 |
-
error: function(xhr, ajaxOptions, thrownError) {
|
577 |
},
|
578 |
-
complete: function() {
|
579 |
}
|
580 |
});
|
581 |
});
|
@@ -701,6 +703,8 @@ class YouTubePrefs
|
|
701 |
$_hl = '';
|
702 |
$_dohl = 0;
|
703 |
$_gallery_columns = 3;
|
|
|
|
|
704 |
$_gallery_pagesize = 15;
|
705 |
$_gallery_style = 'grid';
|
706 |
|
@@ -754,6 +758,8 @@ class YouTubePrefs
|
|
754 |
$_apikey = self::tryget($arroptions, self::$opt_apikey, '');
|
755 |
$_gallery_pagesize = self::tryget($arroptions, self::$opt_gallery_pagesize, 15);
|
756 |
$_gallery_columns = self::tryget($arroptions, self::$opt_gallery_columns, 3);
|
|
|
|
|
757 |
$_gallery_style = self::tryget($arroptions, self::$opt_gallery_style, 'grid');
|
758 |
}
|
759 |
else
|
@@ -807,6 +813,8 @@ class YouTubePrefs
|
|
807 |
self::$opt_vol => $_vol,
|
808 |
self::$opt_apikey => $_apikey,
|
809 |
self::$opt_gallery_columns => $_gallery_columns,
|
|
|
|
|
810 |
self::$opt_gallery_style => $_gallery_style,
|
811 |
self::$opt_gallery_pagesize => $_gallery_pagesize
|
812 |
);
|
@@ -910,30 +918,35 @@ class YouTubePrefs
|
|
910 |
return self::get_html($m, false);
|
911 |
}
|
912 |
|
913 |
-
public static function get_gallery_page($playlistId, $pageToken, $pageSize, $columns, $style, $apiKey)
|
|
|
914 |
{
|
915 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
916 |
{
|
917 |
return '<div>Please enter your YouTube API key to embed galleries.</div>';
|
918 |
}
|
919 |
-
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0 && $style == 'listview')
|
920 |
-
{
|
921 |
-
//$columns = 1;
|
922 |
-
}
|
923 |
|
924 |
-
$apiEndpoint = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,status&playlistId=' . $playlistId
|
925 |
-
. '&maxResults=' . $pageSize
|
926 |
-
. '&key=' . $apiKey;
|
927 |
-
if ($pageToken != null)
|
928 |
{
|
929 |
-
$apiEndpoint .= '&pageToken=' . $pageToken;
|
930 |
}
|
931 |
$spdckey = '';
|
932 |
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0 && self::$alloptions[self::$opt_spdc] == 1)
|
933 |
{
|
934 |
try
|
935 |
{
|
936 |
-
$spdckey = self::$spdcprefix . '_' . md5($apiEndpoint . $columns . $style);
|
937 |
$spdcval = get_transient($spdckey);
|
938 |
if (!empty($spdcval))
|
939 |
{
|
@@ -952,6 +965,13 @@ class YouTubePrefs
|
|
952 |
$apiResult = wp_remote_get($apiEndpoint);
|
953 |
$jsonResult = json_decode($apiResult['body']);
|
954 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
955 |
$resultsPerPage = $jsonResult->pageInfo->resultsPerPage;
|
956 |
$totalResults = $jsonResult->pageInfo->totalResults;
|
957 |
|
@@ -968,6 +988,7 @@ class YouTubePrefs
|
|
968 |
}
|
969 |
|
970 |
$cnt = 0;
|
|
|
971 |
foreach ($jsonResult->items as $item)
|
972 |
{
|
973 |
|
@@ -975,7 +996,7 @@ class YouTubePrefs
|
|
975 |
|
976 |
$thumb->id = isset($item->snippet->resourceId->videoId) ? $item->snippet->resourceId->videoId : null;
|
977 |
$thumb->id = $thumb->id ? $thumb->id : $item->id->videoId;
|
978 |
-
$thumb->title = $item->snippet->title;
|
979 |
$thumb->privacyStatus = isset($item->status->privacyStatus) ? $item->status->privacyStatus : null;
|
980 |
|
981 |
if ($thumb->privacyStatus == 'private')
|
@@ -1002,14 +1023,15 @@ class YouTubePrefs
|
|
1002 |
}
|
1003 |
}
|
1004 |
|
1005 |
-
$code .= self::get_thumbnail_html($thumb, $
|
1006 |
$cnt++;
|
1007 |
|
1008 |
-
if ($cnt % $columns === 0)
|
1009 |
{
|
1010 |
$code .= '<div class="epyt-gallery-rowbreak"></div>';
|
1011 |
}
|
1012 |
}
|
|
|
1013 |
|
1014 |
$totalPages = ceil($totalResults / $resultsPerPage);
|
1015 |
$pagination = '<div class="epyt-pagination">';
|
@@ -1017,12 +1039,13 @@ class YouTubePrefs
|
|
1017 |
{
|
1018 |
if (!empty($prevPageToken))
|
1019 |
{
|
1020 |
-
$pagination .= '<div class="epyt-pagebutton epyt-prev" data-playlistid="' . esc_attr($playlistId)
|
1021 |
-
. '" data-pagesize="' . intval($pageSize)
|
1022 |
. '" data-pagetoken="' . esc_attr($prevPageToken)
|
1023 |
-
. '" data-style="' . esc_attr($style)
|
1024 |
-
. '" data-columns="' . intval($columns)
|
1025 |
-
. '"
|
|
|
1026 |
}
|
1027 |
|
1028 |
$pagination .= '<div class="epyt-pagenumbers">';
|
@@ -1031,12 +1054,13 @@ class YouTubePrefs
|
|
1031 |
|
1032 |
if (!empty($nextPageToken))
|
1033 |
{
|
1034 |
-
$pagination .= '<div class="epyt-pagebutton epyt-next" data-playlistid="' . esc_attr($playlistId)
|
1035 |
-
. '" data-pagesize="' . intval($pageSize)
|
1036 |
. '" data-pagetoken="' . esc_attr($nextPageToken)
|
1037 |
-
. '" data-style="' . esc_attr($style)
|
1038 |
-
. '" data-columns="' . intval($columns)
|
1039 |
-
. '"
|
|
|
1040 |
}
|
1041 |
$pagination .= '<div class="epyt-loader"><img src="' . plugins_url('images/gallery-page-loader.gif', __FILE__) . '"></div>';
|
1042 |
}
|
@@ -1057,22 +1081,37 @@ class YouTubePrefs
|
|
1057 |
return $code;
|
1058 |
}
|
1059 |
|
1060 |
-
public static function get_thumbnail_html($thumb, $
|
1061 |
{
|
1062 |
$escId = esc_attr($thumb->id);
|
1063 |
$code = '';
|
1064 |
$styleclass = '';
|
|
|
1065 |
|
1066 |
-
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0
|
1067 |
{
|
1068 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1069 |
}
|
1070 |
|
1071 |
-
$code .= '<div data-videoid="' . $escId . '" class="epyt-gallery-thumb ' . $styleclass . '">';
|
1072 |
$code .= '<div class="epyt-gallery-img-box"><div class="epyt-gallery-img" style="background-image: url(' . esc_attr($thumb->img) . ')">' .
|
1073 |
'<div class="epyt-gallery-playhover"><img class="epyt-play-img" src="' . plugins_url('images/playhover.png', __FILE__) . '" /><div class="epyt-gallery-playcrutch"></div></div>' .
|
1074 |
'</div></div>';
|
1075 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1076 |
$code .= '</div>';
|
1077 |
|
1078 |
|
@@ -1084,7 +1123,10 @@ class YouTubePrefs
|
|
1084 |
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
|
1085 |
{
|
1086 |
check_ajax_referer('embedplus-nonce', 'security');
|
1087 |
-
echo self::get_gallery_page($_POST['playlistId'], $_POST['pageToken'], $_POST['pageSize'], $_POST['columns'], $_POST['style'], self::$alloptions[self::$opt_apikey]);
|
|
|
|
|
|
|
1088 |
die();
|
1089 |
}
|
1090 |
}
|
@@ -1265,10 +1307,22 @@ class YouTubePrefs
|
|
1265 |
isset($finalparams['layout']) && strtolower($finalparams['layout']) == 'gallery' && isset($finalparams['list'])
|
1266 |
)
|
1267 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1268 |
$dynsrc = 'data-ep-gallery';
|
1269 |
$galleryWrapper1 = '<div class="epyt-gallery" data-currpage="1">';
|
1270 |
$galleryWrapper2 = '</div>';
|
1271 |
-
$galleryCode = '<div class="epyt-gallery-list
|
|
|
|
|
|
|
1272 |
$videoidoutput = 'GALLERYVIDEOID';
|
1273 |
}
|
1274 |
|
@@ -1347,7 +1401,8 @@ class YouTubePrefs
|
|
1347 |
|
1348 |
public static function spdcpurge()
|
1349 |
{
|
1350 |
-
$allk = get_option(self::$spdcall, array());
|
|
|
1351 |
foreach ($allk as $t)
|
1352 |
{
|
1353 |
$success = delete_transient($t);
|
@@ -1851,15 +1906,15 @@ class YouTubePrefs
|
|
1851 |
?>
|
1852 |
<script type="text/javascript">
|
1853 |
function widen_ytprefs_glance() {
|
1854 |
-
setTimeout(function() {
|
1855 |
jQuery("#TB_window").animate({marginLeft: '-' + parseInt((780 / 2), 10) + 'px', width: '780px'}, 300);
|
1856 |
jQuery("#TB_window iframe").animate({width: '780px'}, 300);
|
1857 |
}, 15);
|
1858 |
}
|
1859 |
|
1860 |
-
(function($j)
|
1861 |
{
|
1862 |
-
$j(document).ready(function() {
|
1863 |
|
1864 |
$j.ajax({
|
1865 |
type: "post",
|
@@ -1867,7 +1922,7 @@ class YouTubePrefs
|
|
1867 |
timeout: 30000,
|
1868 |
url: wpajaxurl,
|
1869 |
data: {action: 'my_embedplus_glance_count'},
|
1870 |
-
success: function(response) {
|
1871 |
if (response.type == "success") {
|
1872 |
$j(response.container).append(response.data);
|
1873 |
$j(".ytprefs_glance_button").click(widen_ytprefs_glance);
|
@@ -1880,10 +1935,10 @@ class YouTubePrefs
|
|
1880 |
else {
|
1881 |
}
|
1882 |
},
|
1883 |
-
error: function(xhr, ajaxOptions, thrownError) {
|
1884 |
|
1885 |
},
|
1886 |
-
complete: function() {
|
1887 |
}
|
1888 |
});
|
1889 |
|
@@ -1914,7 +1969,7 @@ class YouTubePrefs
|
|
1914 |
edge: '<?php echo $array['edge']; ?>',
|
1915 |
align: '<?php echo $array['align']; ?>'
|
1916 |
},
|
1917 |
-
close: function() {
|
1918 |
$.post(wpajaxurl, {
|
1919 |
pointer: '<?php echo $pointer; ?>',
|
1920 |
action: 'dismiss-wp-pointer'
|
@@ -1944,11 +1999,11 @@ class YouTubePrefs
|
|
1944 |
$new_pointer_content .= '<p>'; // ooopointer
|
1945 |
if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
|
1946 |
{
|
1947 |
-
$new_pointer_content .= __("This update improves
|
1948 |
}
|
1949 |
else
|
1950 |
{
|
1951 |
-
$new_pointer_content .= __("This update improves
|
1952 |
}
|
1953 |
$new_pointer_content .= '</p>';
|
1954 |
|
@@ -2032,6 +2087,7 @@ class YouTubePrefs
|
|
2032 |
$new_options[self::$opt_defaultdims] = self::postchecked(self::$opt_defaultdims) ? 1 : 0;
|
2033 |
$new_options[self::$opt_defaultvol] = self::postchecked(self::$opt_defaultvol) ? 1 : 0;
|
2034 |
$new_options[self::$opt_dohl] = self::postchecked(self::$opt_dohl) ? 1 : 0;
|
|
|
2035 |
|
2036 |
$_defaultwidth = '';
|
2037 |
try
|
@@ -2089,6 +2145,17 @@ class YouTubePrefs
|
|
2089 |
}
|
2090 |
$new_options[self::$opt_gallery_columns] = $_gallery_columns;
|
2091 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2092 |
$_gallery_style = 'grid';
|
2093 |
try
|
2094 |
{
|
@@ -2272,7 +2339,7 @@ class YouTubePrefs
|
|
2272 |
.wp-pointer-buttons a.close {margin-top: 0 !important;}
|
2273 |
.pad20{padding: 20px 0 20px 0;}
|
2274 |
.ssgallery {float: right; width: 130px; height: auto; margin-left: 15px; border: 3px solid #ffffff;}
|
2275 |
-
.ssaltgallery {float: right; height: auto; margin-right: 10px; margin-left: 15px; margin-bottom: 10px; width:
|
2276 |
</style>
|
2277 |
<div class="ytindent">
|
2278 |
<br>
|
@@ -2291,7 +2358,7 @@ class YouTubePrefs
|
|
2291 |
<input type="hidden" name="<?php echo $ytprefs_submitted; ?>" value="Y">
|
2292 |
|
2293 |
<h3 class="sect">
|
2294 |
-
|
2295 |
</h3>
|
2296 |
<p>
|
2297 |
<b>For videos:</b> <i>Method 1 - </i> Do you already have a URL to the video you want to embed in a post, page, or even a widget? All you have to do is paste it on its own line, as shown below (including the http:// part). Easy, eh?<br>
|
@@ -2341,10 +2408,10 @@ class YouTubePrefs
|
|
2341 |
</p>
|
2342 |
<div class="jumper" id="jumpdefaults"></div>
|
2343 |
<h3 class="sect">
|
2344 |
-
|
2345 |
</h3>
|
2346 |
<p>
|
2347 |
-
|
2348 |
</p>
|
2349 |
<p class="submit">
|
2350 |
<input type="submit" onclick="return savevalidate();" name="Submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
@@ -2495,7 +2562,9 @@ class YouTubePrefs
|
|
2495 |
<p>
|
2496 |
<input name="<?php echo self::$opt_playlistorder; ?>" id="<?php echo self::$opt_playlistorder; ?>" <?php checked($all[self::$opt_playlistorder], 1); ?> type="checkbox" class="checkbox">
|
2497 |
<label for="<?php echo self::$opt_playlistorder; ?>">
|
2498 |
-
<b class="chktitle">Playlist Ordering: <sup class="orange bold">NEW</sup></b>
|
|
|
|
|
2499 |
</label>
|
2500 |
</p>
|
2501 |
|
@@ -2517,7 +2586,7 @@ class YouTubePrefs
|
|
2517 |
<h3 class="sect">Gallery Settings and Directions<sup class="orange bold">NEW</sup></h3>
|
2518 |
<img class="ssgallery" src="<?php echo plugins_url('images/ssgallery.png', __FILE__) ?>">
|
2519 |
<p>
|
2520 |
-
You can now make playlist embeds (and channel-playlist embeds) have a gallery layout
|
2521 |
Don't worry, it's an easy process. Just <a href="https://www.youtube.com/watch?v=2vmBACVETf4" target="_blank">click this link »</a> and follow the video on that page to get your API key. Then paste it in the box below, and click the "Save Changes" button:
|
2522 |
</p>
|
2523 |
<p>
|
@@ -2529,7 +2598,7 @@ class YouTubePrefs
|
|
2529 |
<code style="font-size: .9em;">http://www.youtube.com/watch?listType=playlist&width=474&height=266&list=UUAuUUnT6oDeKwE6v1NGQxug&plindex=0<b>&layout=gallery</b></code>
|
2530 |
</p>
|
2531 |
<p class="smallnote">
|
2532 |
-
PRO
|
2533 |
</p>
|
2534 |
<p>
|
2535 |
Below are the settings for galleries:
|
@@ -2550,6 +2619,16 @@ class YouTubePrefs
|
|
2550 |
<input name="<?php echo self::$opt_gallery_columns; ?>" id="<?php echo self::$opt_gallery_columns; ?>" type="number" class="textinput" style="width: 60px;" value="<?php echo trim($all[self::$opt_gallery_columns]); ?>">
|
2551 |
Enter how many thumbnails can fit per row.
|
2552 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2553 |
</div>
|
2554 |
|
2555 |
<p class="submit">
|
@@ -2566,7 +2645,22 @@ class YouTubePrefs
|
|
2566 |
{
|
2567 |
?>
|
2568 |
<p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). Gallery options for PRO users will also be listed here.</p>
|
2569 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2570 |
<p>
|
2571 |
<input name="<?php echo self::$opt_spdc; ?>" id="<?php echo self::$opt_spdc; ?>" <?php checked($all[self::$opt_spdc], 1); ?> type="checkbox" class="checkbox">
|
2572 |
<label for="<?php echo self::$opt_spdc; ?>">
|
@@ -2591,20 +2685,7 @@ class YouTubePrefs
|
|
2591 |
</div>
|
2592 |
</p>
|
2593 |
<div class="hr"></div>
|
2594 |
-
|
2595 |
-
<img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgallery.jpg', __FILE__) ?>" />
|
2596 |
-
<?php $cleanstyle = trim($all[self::$opt_gallery_style]); ?>
|
2597 |
-
<select name="<?php echo self::$opt_gallery_style; ?>" id="<?php echo self::$opt_gallery_style; ?>" >
|
2598 |
-
<option value="">Gallery Style</option>
|
2599 |
-
<option value="grid" <?php echo 'grid' === $cleanstyle ? 'selected' : '' ?> >Default (grid)</option>
|
2600 |
-
<option value="listview" <?php echo 'listview' === $cleanstyle ? 'selected' : '' ?> >List view</option>
|
2601 |
-
</select>
|
2602 |
-
<label for="<?php echo self::$opt_gallery_style; ?>">
|
2603 |
-
<b>(PRO)</b> <b class="chktitle">Alternate Gallery Styling: <sup class="orange">NEW</sup></b></b>
|
2604 |
-
Switch from the grid style of the FREE version to another gallery style. Right now, we provide a vertical (single column) list style as an alternative, with more designs coming. This current alternative was inspired by the standard YouTube playlist player’s “table of contents,” except our gallery’s video list is always visible and shown under the playing video. <a target="_blank" href="<?php echo self::$epbase ?>/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx">Read more here »</a>
|
2605 |
-
</label>
|
2606 |
-
</p>
|
2607 |
-
<div class="hr"></div>
|
2608 |
<p>
|
2609 |
<input name="<?php echo self::$opt_schemaorg; ?>" id="<?php echo self::$opt_schemaorg; ?>" <?php checked($all[self::$opt_schemaorg], 1); ?> type="checkbox" class="checkbox">
|
2610 |
<label for="<?php echo self::$opt_schemaorg; ?>">
|
@@ -2630,7 +2711,7 @@ class YouTubePrefs
|
|
2630 |
<input name="<?php echo self::$opt_dynload; ?>" id="<?php echo self::$opt_dynload; ?>" <?php checked($all[self::$opt_dynload], 1); ?> type="checkbox" class="checkbox">
|
2631 |
<span id="boxdyn">
|
2632 |
Animation:
|
2633 |
-
|
2634 |
<select name="<?php echo self::$opt_dyntype; ?>" id="<?php echo self::$opt_dyntype; ?>" >
|
2635 |
<option value="">Select type</option>
|
2636 |
<option value="rotateIn" <?php echo 'rotateIn' === $cleandyn ? 'selected' : '' ?> >rotate in</option>
|
@@ -2677,6 +2758,19 @@ class YouTubePrefs
|
|
2677 |
{
|
2678 |
?>
|
2679 |
<p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). </p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2680 |
<p>
|
2681 |
<input disabled type="checkbox" class="checkbox">
|
2682 |
<label>
|
@@ -2692,18 +2786,7 @@ class YouTubePrefs
|
|
2692 |
</div>
|
2693 |
</p>
|
2694 |
<div class="hr"></div>
|
2695 |
-
<p>
|
2696 |
-
<img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgallery.jpg', __FILE__) ?>" />
|
2697 |
-
<select disabled>
|
2698 |
-
<option value="">Gallery Style</option>
|
2699 |
-
</select>
|
2700 |
-
<label>
|
2701 |
-
<b>(PRO)</b> <b class="chktitle">Alternate Gallery Styling: <sup class="orange">NEW</sup></b> <span class="pronon">(PRO Users)</span>
|
2702 |
-
Switch from the grid style of the FREE version to another gallery style. Right now, we provide a vertical (single column) list style as an alternative, with more designs coming. This current alternative was inspired by the standard YouTube playlist player’s “table of contents,” except our gallery’s video list is always visible and shown under the playing video. <a target="_blank" href="<?php echo self::$epbase ?>/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx">Read more here »</a>
|
2703 |
-
</label>
|
2704 |
-
</p>
|
2705 |
|
2706 |
-
<div class="hr"></div>
|
2707 |
|
2708 |
<p>
|
2709 |
<input disabled type="checkbox" class="checkbox">
|
@@ -2759,7 +2842,7 @@ class YouTubePrefs
|
|
2759 |
<div class="jumper" id="jumpoverride"></div>
|
2760 |
|
2761 |
<h3 class="sect">
|
2762 |
-
|
2763 |
</h3>
|
2764 |
<p>Suppose you have a few videos that need to be different from the above defaults. You can add options to the end of a link as displayed below to override the above defaults. Each option should begin with '&'.
|
2765 |
<br><span class="smallnote orange">PRO users: You can use the <a href="<?php echo self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=protab' ?>" target="_blank" class="button-primary cuz">► Customize</a> button that you will see inside the wizard, instead of memorizing the following.</span>
|
@@ -3057,8 +3140,8 @@ class YouTubePrefs
|
|
3057 |
var prokeyval;
|
3058 |
var mydomain = escape("http://" + window.location.host.toString());
|
3059 |
|
3060 |
-
jQuery(document).ready(function($) {
|
3061 |
-
jQuery('#<?php echo self::$opt_defaultdims; ?>').change(function()
|
3062 |
{
|
3063 |
if (jQuery(this).is(":checked"))
|
3064 |
{
|
@@ -3071,7 +3154,7 @@ class YouTubePrefs
|
|
3071 |
|
3072 |
});
|
3073 |
|
3074 |
-
jQuery('#<?php echo self::$opt_dynload; ?>').change(function()
|
3075 |
{
|
3076 |
if (jQuery(this).is(":checked"))
|
3077 |
{
|
@@ -3084,7 +3167,7 @@ class YouTubePrefs
|
|
3084 |
|
3085 |
});
|
3086 |
|
3087 |
-
jQuery('#<?php echo self::$opt_spdc; ?>').change(function()
|
3088 |
{
|
3089 |
if (jQuery(this).is(":checked"))
|
3090 |
{
|
@@ -3097,7 +3180,7 @@ class YouTubePrefs
|
|
3097 |
});
|
3098 |
|
3099 |
|
3100 |
-
jQuery('#<?php echo self::$opt_migrate; ?>').change(function()
|
3101 |
{
|
3102 |
if (jQuery(this).is(":checked"))
|
3103 |
{
|
@@ -3111,7 +3194,7 @@ class YouTubePrefs
|
|
3111 |
|
3112 |
|
3113 |
|
3114 |
-
jQuery('#<?php echo self::$opt_nocookie; ?>').change(function()
|
3115 |
{
|
3116 |
if (jQuery(this).is(":checked"))
|
3117 |
{
|
@@ -3124,7 +3207,7 @@ class YouTubePrefs
|
|
3124 |
|
3125 |
});
|
3126 |
|
3127 |
-
jQuery('#<?php echo self::$opt_schemaorg; ?>').change(function()
|
3128 |
{
|
3129 |
if (jQuery(this).is(":checked"))
|
3130 |
{
|
@@ -3152,7 +3235,7 @@ class YouTubePrefs
|
|
3152 |
|
3153 |
|
3154 |
|
3155 |
-
jQuery('#<?php echo self::$opt_defaultvol; ?>').change(function()
|
3156 |
{
|
3157 |
if (jQuery(this).is(":checked"))
|
3158 |
{
|
@@ -3171,7 +3254,7 @@ class YouTubePrefs
|
|
3171 |
//canrange = false;
|
3172 |
if (canrange)
|
3173 |
{
|
3174 |
-
$("input#vol").prop("type", "range").addClass("vol-range").on("input change", function() {
|
3175 |
$('.vol-output').text($(this).val() > 0 ? $(this).val() + '%' : 'Mute');
|
3176 |
});
|
3177 |
$('.vol-output').css("display", "inline-block").text($("input#vol").val() > 0 ? $("input#vol").val() + '%' : 'Mute');
|
@@ -3184,7 +3267,7 @@ class YouTubePrefs
|
|
3184 |
}
|
3185 |
|
3186 |
|
3187 |
-
jQuery('#boxspdc input.button').click(function() {
|
3188 |
jQuery('#clearspdcloading').show();
|
3189 |
jQuery('#clearspdcfailed').hide();
|
3190 |
jQuery('#clearspdcsuccess').hide();
|
@@ -3198,7 +3281,7 @@ class YouTubePrefs
|
|
3198 |
timeout: 30000,
|
3199 |
url: wpajaxurl,
|
3200 |
data: {action: 'my_embedplus_clearspdc'},
|
3201 |
-
success: function(response) {
|
3202 |
if (response.type == "success") {
|
3203 |
jQuery("#clearspdcsuccess").show();
|
3204 |
}
|
@@ -3206,10 +3289,10 @@ class YouTubePrefs
|
|
3206 |
jQuery("#clearspdcfailed").show();
|
3207 |
}
|
3208 |
},
|
3209 |
-
error: function(xhr, ajaxOptions, thrownError) {
|
3210 |
jQuery("#clearspdcfailed").show();
|
3211 |
},
|
3212 |
-
complete: function() {
|
3213 |
jQuery('#clearspdcloading').hide();
|
3214 |
$clearbutton.removeAttr('disabled');
|
3215 |
}
|
@@ -3221,16 +3304,16 @@ class YouTubePrefs
|
|
3221 |
|
3222 |
|
3223 |
|
3224 |
-
jQuery("#showcase-validate").click(function() {
|
3225 |
window.open("<?php echo self::$epbase . "/showcase-validate.aspx?prokey=" . self::$alloptions[self::$opt_pro] ?>" + "&domain=" + mydomain);
|
3226 |
});
|
3227 |
|
3228 |
-
jQuery('#showprokey').click(function() {
|
3229 |
jQuery('.submitpro').show(500);
|
3230 |
return false;
|
3231 |
});
|
3232 |
|
3233 |
-
jQuery('#prokeysubmit').click(function() {
|
3234 |
jQuery(this).attr('disabled', 'disabled');
|
3235 |
jQuery('#prokeyfailed').hide();
|
3236 |
jQuery('#prokeysuccess').hide();
|
@@ -3240,13 +3323,13 @@ class YouTubePrefs
|
|
3240 |
var tempscript = document.createElement("script");
|
3241 |
tempscript.src = "//www.embedplus.com/dashboard/wordpress-pro-validatejp.aspx?simple=1&prokey=" + prokeyval + "&domain=" + mydomain;
|
3242 |
var n = document.getElementsByTagName("head")[0].appendChild(tempscript);
|
3243 |
-
setTimeout(function() {
|
3244 |
n.parentNode.removeChild(n);
|
3245 |
}, 500);
|
3246 |
return false;
|
3247 |
});
|
3248 |
|
3249 |
-
window.embedplus_record_prokey = function(good) {
|
3250 |
|
3251 |
jQuery.ajax({
|
3252 |
type: "post",
|
@@ -3254,7 +3337,7 @@ class YouTubePrefs
|
|
3254 |
timeout: 30000,
|
3255 |
url: wpajaxurl,
|
3256 |
data: {action: 'my_embedplus_pro_record', <?php echo self::$opt_pro; ?>: (good ? prokeyval : "")},
|
3257 |
-
success: function(response) {
|
3258 |
if (response.type == "success") {
|
3259 |
jQuery("#prokeysuccess").show();
|
3260 |
}
|
@@ -3262,10 +3345,10 @@ class YouTubePrefs
|
|
3262 |
jQuery("#prokeyfailed").show();
|
3263 |
}
|
3264 |
},
|
3265 |
-
error: function(xhr, ajaxOptions, thrownError) {
|
3266 |
jQuery('#prokeyfailed').show();
|
3267 |
},
|
3268 |
-
complete: function() {
|
3269 |
jQuery('#prokeyloading').hide();
|
3270 |
jQuery('#prokeysubmit').removeAttr('disabled');
|
3271 |
}
|
@@ -3304,7 +3387,8 @@ class YouTubePrefs
|
|
3304 |
wp_enqueue_script('__ytprefs__', plugins_url('scripts/ytprefs.min.js', __FILE__), array('jquery'));
|
3305 |
wp_localize_script('__ytprefs__', '_EPYT_', array(
|
3306 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
3307 |
-
'security' => wp_create_nonce('embedplus-nonce')
|
|
|
3308 |
));
|
3309 |
|
3310 |
|
@@ -3484,7 +3568,7 @@ class YouTubePrefs
|
|
3484 |
var epmessageEvent = epeventMethod == "attachEvent" ? "onmessage" : "message";
|
3485 |
|
3486 |
// Listen to message from child window
|
3487 |
-
epeventer(epmessageEvent, function(e)
|
3488 |
{
|
3489 |
var embedcode = "";
|
3490 |
try
|
3 |
Plugin Name: YouTube
|
4 |
Plugin URI: http://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx
|
5 |
Description: YouTube embed plugin. Embed a responsive YouTube video, playlist gallery, or channel gallery. Add video thumbnails, analytics, SEO, caching...
|
6 |
+
Version: 10.5
|
7 |
Author: EmbedPlus Team
|
8 |
Author URI: http://www.embedplus.com
|
9 |
*/
|
32 |
class YouTubePrefs
|
33 |
{
|
34 |
|
35 |
+
public static $version = '10.5';
|
36 |
public static $opt_version = 'version';
|
37 |
public static $optembedwidth = null;
|
38 |
public static $optembedheight = null;
|
89 |
public static $opt_gallery_apikey = 'gallery_apikey';
|
90 |
public static $opt_gallery_columns = 'gallery_columns';
|
91 |
public static $opt_gallery_style = 'gallery_style';
|
92 |
+
public static $opt_gallery_scrolloffset = 'gallery_scrolloffset';
|
93 |
+
public static $opt_gallery_showtitle = 'gallery_showtitle';
|
94 |
public static $opt_alloptions = 'youtubeprefs_alloptions';
|
95 |
public static $alloptions = null;
|
96 |
public static $yt_options = array();
|
262 |
jQuery(ele).parent('.accbox').hide(400);
|
263 |
}
|
264 |
|
265 |
+
(function ($j)
|
266 |
{
|
267 |
+
$j(document).ready(function () {
|
268 |
|
269 |
|
270 |
+
$j('.acctitle').click(function () {
|
271 |
var $acctitle = $j(this);
|
272 |
var $accbox = $j(this).parent().children('.accbox');
|
273 |
var pid = $accbox.attr("data-postid");
|
279 |
timeout: 30000,
|
280 |
url: wpajaxurl,
|
281 |
data: {action: 'my_embedplus_glance_vids', postid: pid},
|
282 |
+
success: function (response) {
|
283 |
if (response.type == "success") {
|
284 |
$accbox.html(response.data),
|
285 |
$accbox.show(400);
|
287 |
else {
|
288 |
}
|
289 |
},
|
290 |
+
error: function (xhr, ajaxOptions, thrownError) {
|
291 |
|
292 |
},
|
293 |
+
complete: function () {
|
294 |
$acctitle.children('.accloader').remove();
|
295 |
}
|
296 |
|
503 |
?>
|
504 |
<script type="text/javascript">
|
505 |
function widen_ytprefs_wiz() {
|
506 |
+
setTimeout(function () {
|
507 |
jQuery("#TB_window").animate({marginLeft: '-' + parseInt((950 / 2), 10) + 'px', width: '950px'}, 300);
|
508 |
jQuery("#TB_window iframe").animate({width: '950px'}, 300);
|
509 |
}, 15);
|
510 |
}
|
511 |
+
jQuery(document).ready(function () {
|
512 |
jQuery("#ytprefs_wiz_button").click(widen_ytprefs_wiz);
|
513 |
jQuery(window).resize(widen_ytprefs_wiz);
|
514 |
});
|
561 |
</div>
|
562 |
<iframe allowTransparency="true" src="<?php echo self::$epbase . '/both-plugins-conflict.aspx' ?>" style="width:2px; height: 2px;" ></iframe>
|
563 |
<script type="text/javascript">
|
564 |
+
(function ($) {
|
565 |
+
$(document).ready(function () {
|
566 |
+
$('.epxout').click(function () {
|
567 |
$.ajax({
|
568 |
type: "post",
|
569 |
dataType: "json",
|
570 |
timeout: 30000,
|
571 |
url: wpajaxurl,
|
572 |
data: {action: 'my_embedplus_dismiss_double_plugin_warning'},
|
573 |
+
success: function (response) {
|
574 |
if (response.type == "success") {
|
575 |
$(".embedpluswarningbox").hide();
|
576 |
}
|
577 |
},
|
578 |
+
error: function (xhr, ajaxOptions, thrownError) {
|
579 |
},
|
580 |
+
complete: function () {
|
581 |
}
|
582 |
});
|
583 |
});
|
703 |
$_hl = '';
|
704 |
$_dohl = 0;
|
705 |
$_gallery_columns = 3;
|
706 |
+
$_gallery_scrolloffset = 20;
|
707 |
+
$_gallery_showtitle = 1;
|
708 |
$_gallery_pagesize = 15;
|
709 |
$_gallery_style = 'grid';
|
710 |
|
758 |
$_apikey = self::tryget($arroptions, self::$opt_apikey, '');
|
759 |
$_gallery_pagesize = self::tryget($arroptions, self::$opt_gallery_pagesize, 15);
|
760 |
$_gallery_columns = self::tryget($arroptions, self::$opt_gallery_columns, 3);
|
761 |
+
$_gallery_scrolloffset = self::tryget($arroptions, self::$opt_gallery_scrolloffset, 20);
|
762 |
+
$_gallery_showtitle = self::tryget($arroptions, self::$opt_gallery_showtitle, 1);
|
763 |
$_gallery_style = self::tryget($arroptions, self::$opt_gallery_style, 'grid');
|
764 |
}
|
765 |
else
|
813 |
self::$opt_vol => $_vol,
|
814 |
self::$opt_apikey => $_apikey,
|
815 |
self::$opt_gallery_columns => $_gallery_columns,
|
816 |
+
self::$opt_gallery_scrolloffset => $_gallery_scrolloffset,
|
817 |
+
self::$opt_gallery_showtitle => $_gallery_showtitle,
|
818 |
self::$opt_gallery_style => $_gallery_style,
|
819 |
self::$opt_gallery_pagesize => $_gallery_pagesize
|
820 |
);
|
918 |
return self::get_html($m, false);
|
919 |
}
|
920 |
|
921 |
+
//public static function get_gallery_page($playlistId, $pageToken, $pageSize, $columns, $style, $apiKey)
|
922 |
+
public static function get_gallery_page($options)
|
923 |
{
|
924 |
+
// $playlistId = $options->playlistId;
|
925 |
+
// $pageToken = $options->pageToken;
|
926 |
+
$options->pageSize = intval($options->pageSize);
|
927 |
+
$options->columns = intval($options->columns);
|
928 |
+
// $style = $options->style;
|
929 |
+
// $apiKey = $options->apiKey;
|
930 |
+
$options->showTitle = intval($options->showTitle);
|
931 |
+
|
932 |
+
if (empty($options->apiKey))
|
933 |
{
|
934 |
return '<div>Please enter your YouTube API key to embed galleries.</div>';
|
935 |
}
|
|
|
|
|
|
|
|
|
936 |
|
937 |
+
$apiEndpoint = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,status&playlistId=' . $options->playlistId
|
938 |
+
. '&maxResults=' . $options->pageSize
|
939 |
+
. '&key=' . $options->apiKey;
|
940 |
+
if ($options->pageToken != null)
|
941 |
{
|
942 |
+
$apiEndpoint .= '&pageToken=' . $options->pageToken;
|
943 |
}
|
944 |
$spdckey = '';
|
945 |
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0 && self::$alloptions[self::$opt_spdc] == 1)
|
946 |
{
|
947 |
try
|
948 |
{
|
949 |
+
$spdckey = self::$spdcprefix . '_' . md5($apiEndpoint . $options->columns . $options->style . $options->showTitle);
|
950 |
$spdcval = get_transient($spdckey);
|
951 |
if (!empty($spdcval))
|
952 |
{
|
965 |
$apiResult = wp_remote_get($apiEndpoint);
|
966 |
$jsonResult = json_decode($apiResult['body']);
|
967 |
|
968 |
+
if (isset($jsonResult->error))
|
969 |
+
{
|
970 |
+
return '<div>Sorry, there may be an issue with your YouTube API key. Please enter a valid key to embed galleries.</div>';
|
971 |
+
}
|
972 |
+
|
973 |
+
|
974 |
+
|
975 |
$resultsPerPage = $jsonResult->pageInfo->resultsPerPage;
|
976 |
$totalResults = $jsonResult->pageInfo->totalResults;
|
977 |
|
988 |
}
|
989 |
|
990 |
$cnt = 0;
|
991 |
+
$code.= '<div class="epyt-gallery-allthumbs">';
|
992 |
foreach ($jsonResult->items as $item)
|
993 |
{
|
994 |
|
996 |
|
997 |
$thumb->id = isset($item->snippet->resourceId->videoId) ? $item->snippet->resourceId->videoId : null;
|
998 |
$thumb->id = $thumb->id ? $thumb->id : $item->id->videoId;
|
999 |
+
$thumb->title = $options->showTitle ? $item->snippet->title : '';
|
1000 |
$thumb->privacyStatus = isset($item->status->privacyStatus) ? $item->status->privacyStatus : null;
|
1001 |
|
1002 |
if ($thumb->privacyStatus == 'private')
|
1023 |
}
|
1024 |
}
|
1025 |
|
1026 |
+
$code .= self::get_thumbnail_html($thumb, $options);
|
1027 |
$cnt++;
|
1028 |
|
1029 |
+
if ($cnt % $options->columns === 0 && $options->style !== 'carousel')
|
1030 |
{
|
1031 |
$code .= '<div class="epyt-gallery-rowbreak"></div>';
|
1032 |
}
|
1033 |
}
|
1034 |
+
$code .= '<div class="epyt-gallery-clear"></div></div>';
|
1035 |
|
1036 |
$totalPages = ceil($totalResults / $resultsPerPage);
|
1037 |
$pagination = '<div class="epyt-pagination">';
|
1039 |
{
|
1040 |
if (!empty($prevPageToken))
|
1041 |
{
|
1042 |
+
$pagination .= '<div class="epyt-pagebutton epyt-prev" data-playlistid="' . esc_attr($options->playlistId)
|
1043 |
+
. '" data-pagesize="' . intval($options->pageSize)
|
1044 |
. '" data-pagetoken="' . esc_attr($prevPageToken)
|
1045 |
+
. '" data-style="' . esc_attr($options->style)
|
1046 |
+
. '" data-columns="' . intval($options->columns)
|
1047 |
+
. '" data-showtitle="' . intval($options->showTitle)
|
1048 |
+
. '"><div class="arrow">«</div> <div>' . _('Prev') . '</div></div>';
|
1049 |
}
|
1050 |
|
1051 |
$pagination .= '<div class="epyt-pagenumbers">';
|
1054 |
|
1055 |
if (!empty($nextPageToken))
|
1056 |
{
|
1057 |
+
$pagination .= '<div class="epyt-pagebutton epyt-next" data-playlistid="' . esc_attr($options->playlistId)
|
1058 |
+
. '" data-pagesize="' . intval($options->pageSize)
|
1059 |
. '" data-pagetoken="' . esc_attr($nextPageToken)
|
1060 |
+
. '" data-style="' . esc_attr($options->style)
|
1061 |
+
. '" data-columns="' . intval($options->columns)
|
1062 |
+
. '" data-showtitle="' . intval($options->showTitle)
|
1063 |
+
. '"><div>' . _('Next') . '</div> <div class="arrow">»</div></div>';
|
1064 |
}
|
1065 |
$pagination .= '<div class="epyt-loader"><img src="' . plugins_url('images/gallery-page-loader.gif', __FILE__) . '"></div>';
|
1066 |
}
|
1081 |
return $code;
|
1082 |
}
|
1083 |
|
1084 |
+
public static function get_thumbnail_html($thumb, $options)
|
1085 |
{
|
1086 |
$escId = esc_attr($thumb->id);
|
1087 |
$code = '';
|
1088 |
$styleclass = '';
|
1089 |
+
$rawstyle = '';
|
1090 |
|
1091 |
+
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0)
|
1092 |
{
|
1093 |
+
if ($options->style == 'listview')
|
1094 |
+
{
|
1095 |
+
$styleclass = 'epyt-listview';
|
1096 |
+
}
|
1097 |
+
else if ($options->style == 'carousel')
|
1098 |
+
{
|
1099 |
+
$rawstyle = ' style="width: ' . (100.0 / floatval($options->pageSize)) . '%;" ';
|
1100 |
+
}
|
1101 |
}
|
1102 |
|
1103 |
+
$code .= '<div data-videoid="' . $escId . '" class="epyt-gallery-thumb ' . $styleclass . '" ' . $rawstyle . '>';
|
1104 |
$code .= '<div class="epyt-gallery-img-box"><div class="epyt-gallery-img" style="background-image: url(' . esc_attr($thumb->img) . ')">' .
|
1105 |
'<div class="epyt-gallery-playhover"><img class="epyt-play-img" src="' . plugins_url('images/playhover.png', __FILE__) . '" /><div class="epyt-gallery-playcrutch"></div></div>' .
|
1106 |
'</div></div>';
|
1107 |
+
if ($options->style != 'carousel' && !empty($thumb->title))
|
1108 |
+
{
|
1109 |
+
$code .= '<div class="epyt-gallery-title">' . esc_html($thumb->title) . '</div>';
|
1110 |
+
}
|
1111 |
+
else
|
1112 |
+
{
|
1113 |
+
$code .= '<div class="epyt-gallery-notitle"></div>';
|
1114 |
+
}
|
1115 |
$code .= '</div>';
|
1116 |
|
1117 |
|
1123 |
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
|
1124 |
{
|
1125 |
check_ajax_referer('embedplus-nonce', 'security');
|
1126 |
+
//echo self::get_gallery_page($_POST['playlistId'], $_POST['pageToken'], $_POST['pageSize'], $_POST['columns'], $_POST['style'], self::$alloptions[self::$opt_apikey]);
|
1127 |
+
$options = (object) $_POST['options'];
|
1128 |
+
$options->apiKey = self::$alloptions[self::$opt_apikey];
|
1129 |
+
echo self::get_gallery_page($options);
|
1130 |
die();
|
1131 |
}
|
1132 |
}
|
1307 |
isset($finalparams['layout']) && strtolower($finalparams['layout']) == 'gallery' && isset($finalparams['list'])
|
1308 |
)
|
1309 |
{
|
1310 |
+
$gallery_options = new stdClass();
|
1311 |
+
$gallery_options->playlistId = $finalparams['list'];
|
1312 |
+
$gallery_options->pageToken = null;
|
1313 |
+
$gallery_options->pageSize = $finalparams[self::$opt_gallery_pagesize];
|
1314 |
+
$gallery_options->columns = intval($finalparams[self::$opt_gallery_columns]);
|
1315 |
+
$gallery_options->showTitle = intval($finalparams[self::$opt_gallery_showtitle]);
|
1316 |
+
$gallery_options->style = $finalparams[self::$opt_gallery_style];
|
1317 |
+
$gallery_options->apiKey = self::$alloptions[self::$opt_apikey];
|
1318 |
+
|
1319 |
$dynsrc = 'data-ep-gallery';
|
1320 |
$galleryWrapper1 = '<div class="epyt-gallery" data-currpage="1">';
|
1321 |
$galleryWrapper2 = '</div>';
|
1322 |
+
$galleryCode = '<div class="epyt-gallery-list epyt-gallery-style-' . esc_attr($gallery_options->style) . '">' .
|
1323 |
+
//self::get_gallery_page($finalparams['list'], null, $finalparams[self::$opt_gallery_pagesize], intval($finalparams[self::$opt_gallery_columns]), $finalparams[self::$opt_gallery_style], self::$alloptions[self::$opt_apikey]) .
|
1324 |
+
self::get_gallery_page($gallery_options) .
|
1325 |
+
'</div>';
|
1326 |
$videoidoutput = 'GALLERYVIDEOID';
|
1327 |
}
|
1328 |
|
1401 |
|
1402 |
public static function spdcpurge()
|
1403 |
{
|
1404 |
+
$allk = get_option(self::$spdcall, array());
|
1405 |
+
{
|
1406 |
foreach ($allk as $t)
|
1407 |
{
|
1408 |
$success = delete_transient($t);
|
1906 |
?>
|
1907 |
<script type="text/javascript">
|
1908 |
function widen_ytprefs_glance() {
|
1909 |
+
setTimeout(function () {
|
1910 |
jQuery("#TB_window").animate({marginLeft: '-' + parseInt((780 / 2), 10) + 'px', width: '780px'}, 300);
|
1911 |
jQuery("#TB_window iframe").animate({width: '780px'}, 300);
|
1912 |
}, 15);
|
1913 |
}
|
1914 |
|
1915 |
+
(function ($j)
|
1916 |
{
|
1917 |
+
$j(document).ready(function () {
|
1918 |
|
1919 |
$j.ajax({
|
1920 |
type: "post",
|
1922 |
timeout: 30000,
|
1923 |
url: wpajaxurl,
|
1924 |
data: {action: 'my_embedplus_glance_count'},
|
1925 |
+
success: function (response) {
|
1926 |
if (response.type == "success") {
|
1927 |
$j(response.container).append(response.data);
|
1928 |
$j(".ytprefs_glance_button").click(widen_ytprefs_glance);
|
1935 |
else {
|
1936 |
}
|
1937 |
},
|
1938 |
+
error: function (xhr, ajaxOptions, thrownError) {
|
1939 |
|
1940 |
},
|
1941 |
+
complete: function () {
|
1942 |
}
|
1943 |
});
|
1944 |
|
1969 |
edge: '<?php echo $array['edge']; ?>',
|
1970 |
align: '<?php echo $array['align']; ?>'
|
1971 |
},
|
1972 |
+
close: function () {
|
1973 |
$.post(wpajaxurl, {
|
1974 |
pointer: '<?php echo $pointer; ?>',
|
1975 |
action: 'dismiss-wp-pointer'
|
1999 |
$new_pointer_content .= '<p>'; // ooopointer
|
2000 |
if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
|
2001 |
{
|
2002 |
+
$new_pointer_content .= __("This update improves existing video gallery support for Free and Pro users with <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">additional Pro benefits »</a>");
|
2003 |
}
|
2004 |
else
|
2005 |
{
|
2006 |
+
$new_pointer_content .= __("This update improves existing video gallery support for Free and Pro users with additional Pro benefits.");
|
2007 |
}
|
2008 |
$new_pointer_content .= '</p>';
|
2009 |
|
2087 |
$new_options[self::$opt_defaultdims] = self::postchecked(self::$opt_defaultdims) ? 1 : 0;
|
2088 |
$new_options[self::$opt_defaultvol] = self::postchecked(self::$opt_defaultvol) ? 1 : 0;
|
2089 |
$new_options[self::$opt_dohl] = self::postchecked(self::$opt_dohl) ? 1 : 0;
|
2090 |
+
$new_options[self::$opt_gallery_showtitle] = self::postchecked(self::$opt_gallery_showtitle) ? 1 : 0;
|
2091 |
|
2092 |
$_defaultwidth = '';
|
2093 |
try
|
2145 |
}
|
2146 |
$new_options[self::$opt_gallery_columns] = $_gallery_columns;
|
2147 |
|
2148 |
+
$_gallery_scrolloffset = 20;
|
2149 |
+
try
|
2150 |
+
{
|
2151 |
+
$_gallery_scrolloffset = is_numeric(trim($_POST[self::$opt_gallery_scrolloffset])) ? intval(trim($_POST[self::$opt_gallery_scrolloffset])) : $_gallery_scrolloffset;
|
2152 |
+
}
|
2153 |
+
catch (Exception $ex)
|
2154 |
+
{
|
2155 |
+
|
2156 |
+
}
|
2157 |
+
$new_options[self::$opt_gallery_scrolloffset] = $_gallery_scrolloffset;
|
2158 |
+
|
2159 |
$_gallery_style = 'grid';
|
2160 |
try
|
2161 |
{
|
2339 |
.wp-pointer-buttons a.close {margin-top: 0 !important;}
|
2340 |
.pad20{padding: 20px 0 20px 0;}
|
2341 |
.ssgallery {float: right; width: 130px; height: auto; margin-left: 15px; border: 3px solid #ffffff;}
|
2342 |
+
.ssaltgallery {float: right; height: auto; margin-right: 10px; margin-left: 15px; margin-bottom: 10px; width: 350px;}
|
2343 |
</style>
|
2344 |
<div class="ytindent">
|
2345 |
<br>
|
2358 |
<input type="hidden" name="<?php echo $ytprefs_submitted; ?>" value="Y">
|
2359 |
|
2360 |
<h3 class="sect">
|
2361 |
+
<?php _e("How to Insert a YouTube Video or Playlist") ?> <!--<span class="pronon">(For Free and <a href="<?php echo self::$epbase ?>/dashboard/pro-easy-video-analytics.aspx" target="_blank">PRO Users »</a>)</span>-->
|
2362 |
</h3>
|
2363 |
<p>
|
2364 |
<b>For videos:</b> <i>Method 1 - </i> Do you already have a URL to the video you want to embed in a post, page, or even a widget? All you have to do is paste it on its own line, as shown below (including the http:// part). Easy, eh?<br>
|
2408 |
</p>
|
2409 |
<div class="jumper" id="jumpdefaults"></div>
|
2410 |
<h3 class="sect">
|
2411 |
+
<?php _e("Default YouTube Options") ?> <a href="#top" class="totop">▲ top</a>
|
2412 |
</h3>
|
2413 |
<p>
|
2414 |
+
<?php _e("One of the benefits of using this plugin is that you can set site-wide default options for all your videos (click \"Save Changes\" when finished). However, you can also override them (and more) on a per-video basis. Directions on how to do that are in the next section.") ?>
|
2415 |
</p>
|
2416 |
<p class="submit">
|
2417 |
<input type="submit" onclick="return savevalidate();" name="Submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
2562 |
<p>
|
2563 |
<input name="<?php echo self::$opt_playlistorder; ?>" id="<?php echo self::$opt_playlistorder; ?>" <?php checked($all[self::$opt_playlistorder], 1); ?> type="checkbox" class="checkbox">
|
2564 |
<label for="<?php echo self::$opt_playlistorder; ?>">
|
2565 |
+
<b class="chktitle">Playlist Ordering: <sup class="orange bold">NEW</sup></b>
|
2566 |
+
Check this option if you want your playlists to begin with the latest added video by default. (Unchecking this will force playlists to always start with your selected specific video, even if you add videos to the playlist later).
|
2567 |
+
Note that this is not for setting the thumbnail list order of galleries, just the standard playlist player that YouTube provides.
|
2568 |
</label>
|
2569 |
</p>
|
2570 |
|
2586 |
<h3 class="sect">Gallery Settings and Directions<sup class="orange bold">NEW</sup></h3>
|
2587 |
<img class="ssgallery" src="<?php echo plugins_url('images/ssgallery.png', __FILE__) ?>">
|
2588 |
<p>
|
2589 |
+
<a target="_blank" href="<?php echo self::$epbase ?>/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx">You can now make playlist embeds (and channel-playlist embeds) have a gallery layout »</a>. <strong>First, you must obtain your YouTube API key</strong>.
|
2590 |
Don't worry, it's an easy process. Just <a href="https://www.youtube.com/watch?v=2vmBACVETf4" target="_blank">click this link »</a> and follow the video on that page to get your API key. Then paste it in the box below, and click the "Save Changes" button:
|
2591 |
</p>
|
2592 |
<p>
|
2598 |
<code style="font-size: .9em;">http://www.youtube.com/watch?listType=playlist&width=474&height=266&list=UUAuUUnT6oDeKwE6v1NGQxug&plindex=0<b>&layout=gallery</b></code>
|
2599 |
</p>
|
2600 |
<p class="smallnote">
|
2601 |
+
The PRO wizard steps for playlist and channels can also fully to build codes like the above.
|
2602 |
</p>
|
2603 |
<p>
|
2604 |
Below are the settings for galleries:
|
2619 |
<input name="<?php echo self::$opt_gallery_columns; ?>" id="<?php echo self::$opt_gallery_columns; ?>" type="number" class="textinput" style="width: 60px;" value="<?php echo trim($all[self::$opt_gallery_columns]); ?>">
|
2620 |
Enter how many thumbnails can fit per row.
|
2621 |
</p>
|
2622 |
+
<p>
|
2623 |
+
<label for="<?php echo self::$opt_gallery_scrolloffset; ?>"><b class="chktitle">Scroll Offset:</b></label>
|
2624 |
+
<input name="<?php echo self::$opt_gallery_scrolloffset; ?>" id="<?php echo self::$opt_gallery_scrolloffset; ?>" type="number" class="textinput" style="width: 60px;" value="<?php echo trim($all[self::$opt_gallery_scrolloffset]); ?>">
|
2625 |
+
After you click on a thumbnail, the gallery will automatically smooth scroll up to the actual player. If you need it to scroll a few pixels further, increase this number.
|
2626 |
+
</p>
|
2627 |
+
<p>
|
2628 |
+
<input name="<?php echo self::$opt_gallery_showtitle; ?>" id="<?php echo self::$opt_gallery_showtitle; ?>" <?php checked($all[self::$opt_gallery_showtitle], 1); ?> type="checkbox" class="checkbox">
|
2629 |
+
<label for="<?php echo self::$opt_gallery_showtitle; ?>"><b class="chktitle">Show Thumbnail Title:</b> Show titles with each thumbnail.</label>
|
2630 |
+
</p>
|
2631 |
+
|
2632 |
</div>
|
2633 |
|
2634 |
<p class="submit">
|
2645 |
{
|
2646 |
?>
|
2647 |
<p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). Gallery options for PRO users will also be listed here.</p>
|
2648 |
+
<p>
|
2649 |
+
<img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgalleryall.jpg', __FILE__) ?>" />
|
2650 |
+
<?php $cleanstyle = trim($all[self::$opt_gallery_style]); ?>
|
2651 |
+
<select name="<?php echo self::$opt_gallery_style; ?>" id="<?php echo self::$opt_gallery_style; ?>" >
|
2652 |
+
<option value="">Gallery Style</option>
|
2653 |
+
<option value="grid" <?php echo 'grid' === $cleanstyle ? 'selected' : '' ?> >Grid (default)</option>
|
2654 |
+
<option value="listview" <?php echo 'listview' === $cleanstyle ? 'selected' : '' ?> >Vertical List</option>
|
2655 |
+
<option value="carousel" <?php echo 'carousel' === $cleanstyle ? 'selected' : '' ?> >Horizontal Slider</option>
|
2656 |
+
</select>
|
2657 |
+
<label for="<?php echo self::$opt_gallery_style; ?>">
|
2658 |
+
<b>(PRO)</b> <b class="chktitle">Alternate Gallery Styling: <sup class="orange">NEW</sup></b></b>
|
2659 |
+
Switch from the grid style of the FREE version to another gallery style. Right now, we provide a vertical (single column) and horizontal (single row) list style as alternatives to the grid, with more designs coming. These current alternatives were inspired by the standard YouTube playlist player's "table of contents," except our gallery's video lists are always visible and shown under the playing video.
|
2660 |
+
<a target="_blank" href="<?php echo self::$epbase ?>/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx">Read more here »</a>
|
2661 |
+
</label>
|
2662 |
+
</p>
|
2663 |
+
<div class="hr"></div>
|
2664 |
<p>
|
2665 |
<input name="<?php echo self::$opt_spdc; ?>" id="<?php echo self::$opt_spdc; ?>" <?php checked($all[self::$opt_spdc], 1); ?> type="checkbox" class="checkbox">
|
2666 |
<label for="<?php echo self::$opt_spdc; ?>">
|
2685 |
</div>
|
2686 |
</p>
|
2687 |
<div class="hr"></div>
|
2688 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2689 |
<p>
|
2690 |
<input name="<?php echo self::$opt_schemaorg; ?>" id="<?php echo self::$opt_schemaorg; ?>" <?php checked($all[self::$opt_schemaorg], 1); ?> type="checkbox" class="checkbox">
|
2691 |
<label for="<?php echo self::$opt_schemaorg; ?>">
|
2711 |
<input name="<?php echo self::$opt_dynload; ?>" id="<?php echo self::$opt_dynload; ?>" <?php checked($all[self::$opt_dynload], 1); ?> type="checkbox" class="checkbox">
|
2712 |
<span id="boxdyn">
|
2713 |
Animation:
|
2714 |
+
<?php $cleandyn = trim($all[self::$opt_dyntype]); ?>
|
2715 |
<select name="<?php echo self::$opt_dyntype; ?>" id="<?php echo self::$opt_dyntype; ?>" >
|
2716 |
<option value="">Select type</option>
|
2717 |
<option value="rotateIn" <?php echo 'rotateIn' === $cleandyn ? 'selected' : '' ?> >rotate in</option>
|
2758 |
{
|
2759 |
?>
|
2760 |
<p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). </p>
|
2761 |
+
<p>
|
2762 |
+
<img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgalleryall.jpg', __FILE__) ?>" />
|
2763 |
+
<select disabled>
|
2764 |
+
<option value="">Gallery Style</option>
|
2765 |
+
</select>
|
2766 |
+
<label>
|
2767 |
+
<b>(PRO)</b> <b class="chktitle">Alternate Gallery Styling: <sup class="orange">NEW</sup></b> <span class="pronon">(PRO Users)</span>
|
2768 |
+
Switch from the grid style of the FREE version to another gallery style. Right now, we provide a vertical (single column) and horizontal (single row) list style as alternatives to the grid, with more designs coming. These current alternatives were inspired by the standard YouTube playlist player's "table of contents," except our gallery's video lists are always visible and shown under the playing video.
|
2769 |
+
<a target="_blank" href="<?php echo self::$epbase ?>/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx">Read more here »</a>
|
2770 |
+
</label>
|
2771 |
+
</p>
|
2772 |
+
|
2773 |
+
<div class="hr"></div>
|
2774 |
<p>
|
2775 |
<input disabled type="checkbox" class="checkbox">
|
2776 |
<label>
|
2786 |
</div>
|
2787 |
</p>
|
2788 |
<div class="hr"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2789 |
|
|
|
2790 |
|
2791 |
<p>
|
2792 |
<input disabled type="checkbox" class="checkbox">
|
2842 |
<div class="jumper" id="jumpoverride"></div>
|
2843 |
|
2844 |
<h3 class="sect">
|
2845 |
+
<?php _e("How To Override Defaults / Other Options") ?> <a href="#top" class="totop">▲ top</a>
|
2846 |
</h3>
|
2847 |
<p>Suppose you have a few videos that need to be different from the above defaults. You can add options to the end of a link as displayed below to override the above defaults. Each option should begin with '&'.
|
2848 |
<br><span class="smallnote orange">PRO users: You can use the <a href="<?php echo self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=protab' ?>" target="_blank" class="button-primary cuz">► Customize</a> button that you will see inside the wizard, instead of memorizing the following.</span>
|
3140 |
var prokeyval;
|
3141 |
var mydomain = escape("http://" + window.location.host.toString());
|
3142 |
|
3143 |
+
jQuery(document).ready(function ($) {
|
3144 |
+
jQuery('#<?php echo self::$opt_defaultdims; ?>').change(function ()
|
3145 |
{
|
3146 |
if (jQuery(this).is(":checked"))
|
3147 |
{
|
3154 |
|
3155 |
});
|
3156 |
|
3157 |
+
jQuery('#<?php echo self::$opt_dynload; ?>').change(function ()
|
3158 |
{
|
3159 |
if (jQuery(this).is(":checked"))
|
3160 |
{
|
3167 |
|
3168 |
});
|
3169 |
|
3170 |
+
jQuery('#<?php echo self::$opt_spdc; ?>').change(function ()
|
3171 |
{
|
3172 |
if (jQuery(this).is(":checked"))
|
3173 |
{
|
3180 |
});
|
3181 |
|
3182 |
|
3183 |
+
jQuery('#<?php echo self::$opt_migrate; ?>').change(function ()
|
3184 |
{
|
3185 |
if (jQuery(this).is(":checked"))
|
3186 |
{
|
3194 |
|
3195 |
|
3196 |
|
3197 |
+
jQuery('#<?php echo self::$opt_nocookie; ?>').change(function ()
|
3198 |
{
|
3199 |
if (jQuery(this).is(":checked"))
|
3200 |
{
|
3207 |
|
3208 |
});
|
3209 |
|
3210 |
+
jQuery('#<?php echo self::$opt_schemaorg; ?>').change(function ()
|
3211 |
{
|
3212 |
if (jQuery(this).is(":checked"))
|
3213 |
{
|
3235 |
|
3236 |
|
3237 |
|
3238 |
+
jQuery('#<?php echo self::$opt_defaultvol; ?>').change(function ()
|
3239 |
{
|
3240 |
if (jQuery(this).is(":checked"))
|
3241 |
{
|
3254 |
//canrange = false;
|
3255 |
if (canrange)
|
3256 |
{
|
3257 |
+
$("input#vol").prop("type", "range").addClass("vol-range").on("input change", function () {
|
3258 |
$('.vol-output').text($(this).val() > 0 ? $(this).val() + '%' : 'Mute');
|
3259 |
});
|
3260 |
$('.vol-output').css("display", "inline-block").text($("input#vol").val() > 0 ? $("input#vol").val() + '%' : 'Mute');
|
3267 |
}
|
3268 |
|
3269 |
|
3270 |
+
jQuery('#boxspdc input.button').click(function () {
|
3271 |
jQuery('#clearspdcloading').show();
|
3272 |
jQuery('#clearspdcfailed').hide();
|
3273 |
jQuery('#clearspdcsuccess').hide();
|
3281 |
timeout: 30000,
|
3282 |
url: wpajaxurl,
|
3283 |
data: {action: 'my_embedplus_clearspdc'},
|
3284 |
+
success: function (response) {
|
3285 |
if (response.type == "success") {
|
3286 |
jQuery("#clearspdcsuccess").show();
|
3287 |
}
|
3289 |
jQuery("#clearspdcfailed").show();
|
3290 |
}
|
3291 |
},
|
3292 |
+
error: function (xhr, ajaxOptions, thrownError) {
|
3293 |
jQuery("#clearspdcfailed").show();
|
3294 |
},
|
3295 |
+
complete: function () {
|
3296 |
jQuery('#clearspdcloading').hide();
|
3297 |
$clearbutton.removeAttr('disabled');
|
3298 |
}
|
3304 |
|
3305 |
|
3306 |
|
3307 |
+
jQuery("#showcase-validate").click(function () {
|
3308 |
window.open("<?php echo self::$epbase . "/showcase-validate.aspx?prokey=" . self::$alloptions[self::$opt_pro] ?>" + "&domain=" + mydomain);
|
3309 |
});
|
3310 |
|
3311 |
+
jQuery('#showprokey').click(function () {
|
3312 |
jQuery('.submitpro').show(500);
|
3313 |
return false;
|
3314 |
});
|
3315 |
|
3316 |
+
jQuery('#prokeysubmit').click(function () {
|
3317 |
jQuery(this).attr('disabled', 'disabled');
|
3318 |
jQuery('#prokeyfailed').hide();
|
3319 |
jQuery('#prokeysuccess').hide();
|
3323 |
var tempscript = document.createElement("script");
|
3324 |
tempscript.src = "//www.embedplus.com/dashboard/wordpress-pro-validatejp.aspx?simple=1&prokey=" + prokeyval + "&domain=" + mydomain;
|
3325 |
var n = document.getElementsByTagName("head")[0].appendChild(tempscript);
|
3326 |
+
setTimeout(function () {
|
3327 |
n.parentNode.removeChild(n);
|
3328 |
}, 500);
|
3329 |
return false;
|
3330 |
});
|
3331 |
|
3332 |
+
window.embedplus_record_prokey = function (good) {
|
3333 |
|
3334 |
jQuery.ajax({
|
3335 |
type: "post",
|
3337 |
timeout: 30000,
|
3338 |
url: wpajaxurl,
|
3339 |
data: {action: 'my_embedplus_pro_record', <?php echo self::$opt_pro; ?>: (good ? prokeyval : "")},
|
3340 |
+
success: function (response) {
|
3341 |
if (response.type == "success") {
|
3342 |
jQuery("#prokeysuccess").show();
|
3343 |
}
|
3345 |
jQuery("#prokeyfailed").show();
|
3346 |
}
|
3347 |
},
|
3348 |
+
error: function (xhr, ajaxOptions, thrownError) {
|
3349 |
jQuery('#prokeyfailed').show();
|
3350 |
},
|
3351 |
+
complete: function () {
|
3352 |
jQuery('#prokeyloading').hide();
|
3353 |
jQuery('#prokeysubmit').removeAttr('disabled');
|
3354 |
}
|
3387 |
wp_enqueue_script('__ytprefs__', plugins_url('scripts/ytprefs.min.js', __FILE__), array('jquery'));
|
3388 |
wp_localize_script('__ytprefs__', '_EPYT_', array(
|
3389 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
3390 |
+
'security' => wp_create_nonce('embedplus-nonce'),
|
3391 |
+
'gallery_scrolloffset' => intval(self::$alloptions[self::$opt_gallery_scrolloffset])
|
3392 |
));
|
3393 |
|
3394 |
|
3568 |
var epmessageEvent = epeventMethod == "attachEvent" ? "onmessage" : "message";
|
3569 |
|
3570 |
// Listen to message from child window
|
3571 |
+
epeventer(epmessageEvent, function (e)
|
3572 |
{
|
3573 |
var embedcode = "";
|
3574 |
try
|