Version Description
Download this release
Release Info
Developer | embedplus |
Plugin | YouTube |
Version | 14.1.3 |
Comparing to | |
See all releases |
Code changes from version 14.1.2 to 14.1.3
- readme.txt +6 -1
- scripts/ytprefs-admin.js +1 -27
- scripts/ytprefs-admin.min.js +38 -2
- scripts/ytprefs.js +21 -9
- scripts/ytprefs.min.js +26 -2
- youtube.php +10 -6
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Embed Plus Plugin for YouTube, with YouTube Gallery, Channel, Playl
|
|
4 |
Tags: youtube gallery, youtube wordpress plugin, channel gallery, playlist gallery, defer css javascript, youtube channel, youtube live, lazy load, facade
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 6.0
|
7 |
-
Stable tag: 14.1.
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, YouTube livestream. Defer JavaScript
|
@@ -189,6 +189,11 @@ Assuming you already have the EmbedPlus plugin active, you can embed a YouTube s
|
|
189 |
|
190 |
== Changelog ==
|
191 |
|
|
|
|
|
|
|
|
|
|
|
192 |
= Embed Plus for YouTube WordPress Plugin 14.1.2 =
|
193 |
* Higher quality facade images
|
194 |
* Avoid unused javascript with facade mode
|
4 |
Tags: youtube gallery, youtube wordpress plugin, channel gallery, playlist gallery, defer css javascript, youtube channel, youtube live, lazy load, facade
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 6.0
|
7 |
+
Stable tag: 14.1.3
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, YouTube livestream. Defer JavaScript
|
189 |
|
190 |
== Changelog ==
|
191 |
|
192 |
+
= Embed Plus for YouTube WordPress Plugin 14.1.3 =
|
193 |
+
* Better compatibility with Jetpack images
|
194 |
+
* Avoids unused javascript when not using responsive sizing
|
195 |
+
* Fixes obscure livestream fallback issue
|
196 |
+
|
197 |
= Embed Plus for YouTube WordPress Plugin 14.1.2 =
|
198 |
* Higher quality facade images
|
199 |
* Avoid unused javascript with facade mode
|
scripts/ytprefs-admin.js
CHANGED
@@ -234,7 +234,7 @@
|
|
234 |
window._EPADashboard_.apiInit();
|
235 |
window._EPADashboard_.log("YT API GB");
|
236 |
window._EPADashboard_.pageReady();
|
237 |
-
|
238 |
};
|
239 |
|
240 |
window._EPYTA_.iabAdd = function (iabVal, iabText, iabTextParent)
|
@@ -399,32 +399,6 @@
|
|
399 |
}
|
400 |
});
|
401 |
|
402 |
-
$(window).on('hashchange', function ()
|
403 |
-
{
|
404 |
-
if (window.location.hash.length > 0 && false) // stop; due to vi deprecation
|
405 |
-
{
|
406 |
-
$section = $('section' + window.location.hash);
|
407 |
-
if ($section.length > 0)
|
408 |
-
{
|
409 |
-
$section.find('h2').addClass('ytvi-hash-scroll');
|
410 |
-
setTimeout(function ()
|
411 |
-
{
|
412 |
-
$section.find('h2').removeClass('ytvi-hash-scroll');
|
413 |
-
}, 2000);
|
414 |
-
}
|
415 |
-
|
416 |
-
$jumper = $('.jumper' + window.location.hash);
|
417 |
-
if ($jumper.length > 0)
|
418 |
-
{
|
419 |
-
$('.jumper' + window.location.hash + ' + h3.sect').addClass('ytvi-hash-scroll');
|
420 |
-
setTimeout(function ()
|
421 |
-
{
|
422 |
-
$('.jumper' + window.location.hash + ' + h3.sect').removeClass('ytvi-hash-scroll');
|
423 |
-
}, 2000);
|
424 |
-
}
|
425 |
-
}
|
426 |
-
});
|
427 |
-
|
428 |
$('.vi-cover-prompt-no').on('click', function ()
|
429 |
{
|
430 |
$.ajax({
|
234 |
window._EPADashboard_.apiInit();
|
235 |
window._EPADashboard_.log("YT API GB");
|
236 |
window._EPADashboard_.pageReady();
|
237 |
+
$.fn.fitVidsEP && $('body').fitVidsEP();
|
238 |
};
|
239 |
|
240 |
window._EPYTA_.iabAdd = function (iabVal, iabText, iabTextParent)
|
399 |
}
|
400 |
});
|
401 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
$('.vi-cover-prompt-no').on('click', function ()
|
403 |
{
|
404 |
$.ajax({
|
scripts/ytprefs-admin.min.js
CHANGED
@@ -1,2 +1,38 @@
|
|
1 |
-
|
2 |
-
(function(a,b){a._EPYTA_.widen_ytprefs_wiz=a._EPYTA_.widen_ytprefs_wiz||function(){setTimeout(function(){var c=Math.min(950,b(a).width()-100);var d=-1*c/2;b("#TB_window").addClass("epyt-thickbox").animate({marginLeft:d,width:c},150,"swing",function(){b("#TB_window").get(0).style.setProperty("width",c,"important")});b("#TB_overlay").addClass("epyt-thickbox");b("#TB_window iframe").animate({width:c},150)},750)};a._EPYTA_.ytvi_cancel=a._EPYTA_.ytvi_cancel||function(){b(".ytvi-step").hide("fade",{},500,function(){b(".ytvi-step-1").show("fade",{},500)})};a._EPYTA_.moneyFormat=a._EPYTA_.moneyFormat||function(c){return"$"+parseFloat(c).toFixed(2)};a._EPYTA_.escId=function(c){return"#"+c.replace(/(:|\.|\[|\]|,|=|@)/g,"\\$1")};a._EPYTA_.demoBackgroundColor=function(c,d){setTimeout(function(){b(".vi-story-demo--info").css("background-color",b(a._EPYTA_.escId("vi_js_settings[backgroundColor]")).val())},0)};a._EPYTA_.demoTextColor=function(c,d){setTimeout(function(){b(".vi-story-demo--info *").css("color",b(a._EPYTA_.escId("vi_js_settings[textColor]")).val())},0)};a._EPYTA_.demoFontFamily=function(){b(".vi-story-demo--title").css("font-family",b(a._EPYTA_.escId("vi_js_settings[font]")).val())};a._EPYTA_.demoFontSize=function(){b(".vi-story-demo--title").css("font-size",b(a._EPYTA_.escId("vi_js_settings[fontSize]")).val()+"px")};a._EPYTA_.onboardNext=function(c){b(".ytprefs-ob-step").removeClass("active-step");setTimeout(function(){a.scrollTo(0,0);c.next().addClass("active-step")},600)};a._EPYTA_.onboardPrev=function(c){b(".ytprefs-ob-step").removeClass("active-step");setTimeout(function(){a.scrollTo(0,0);c.prev().addClass("active-step")},600)};a._EPYTA_.selectText=function(e){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(e);c.select()}else{if(a.getSelection){var d=a.getSelection();var c=document.createRange();c.selectNode(e);d.removeAllRanges();d.addRange(c)}}};a._EPYTA_.adstxtLookup=function(){a._EPYTA_.adstxtLoading(true);b.ajax({url:location.protocol+"//"+location.hostname+"/ads.txt?c="+Date.now(),dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:true}).always(function(c,h,f){if(h==="success"){var d=f;var e=c;switch(d.status){case 200:case 301:case 302:case 304:case 307:a._EPYTA_.adstxtVerify(e);break;default:a._EPYTA_.adstxtVerify("");break}}else{var d=c;var g=f;if(d.status==404){b.ajax({url:location.protocol+"//"+location.hostname+"/ads.txt",dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:true}).always(function(i,m,l){if(m==="success"){var j=l;var k=i;switch(j.status){case 200:case 301:case 302:case 304:case 307:a._EPYTA_.adstxtVerify(k);break;default:a._EPYTA_.adstxtVerify("");break}}else{a._EPYTA_.adstxtVerify("")}})}else{a._EPYTA_.adstxtVerify("")}}})};a._EPYTA_.adstxtVerify=function(c){b.ajax({type:"post",dataType:"json",timeout:120000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_adstxt_status_soft_ajax",current_adstxt:c},success:function(d){if(d.code==2){b(".nav-tab-adstxt").addClass("nav-tab-valid")}else{if(d.code<=0){b(".nav-tab-adstxt").addClass("nav-tab-invalid")}}b(".adstxt-verify-message").html(d.message)},error:function(f,d,e){b(".nav-tab-adstxt").addClass("nav-tab-invalid");b(".adstxt-verify-message").html("Could not validate ads.txt: "+e)},complete:function(){a._EPYTA_.adstxtLoading(false)}})};a._EPYTA_.adstxtLoading=function(c){if(c){b(".nav-tab-adstxt").addClass("nav-tab-loading")}else{b(".nav-tab-adstxt").removeClass("nav-tab-loading")}};a._EPYTA_.gbPreviewSetup=function(){a._EPADashboard_.loadYTAPI();a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API GB");a._EPADashboard_.pageReady();jQuery("body").fitVidsEP()};a._EPYTA_.iabAdd=function(e,d,c){var f=b('<div class="iab-cat-tag-button" data-tag="'+e+'">'+c+" : "+d+" ×</div>");b(".iab-cat-tags-display").append(f);b(".iab-cat-tags-display .iab-cat-tag-button").sort(function(h,g){return b(h).text()>b(g).text()?1:-1}).appendTo(".iab-cat-tags-display")};b.fn.ytprefsFormJSON=function(){var d={};var c=this.serializeArray();b.each(c,function(){if(d[this.name]){if(!d[this.name].push){d[this.name]=[d[this.name]]}d[this.name].push(this.value||"")}else{d[this.name]=this.value||""}});return d};b(document).ready(function(){if(a.location.toString().indexOf("https://")===0){a._EPYTA_.wpajaxurl=a._EPYTA_.wpajaxurl.replace("http://","https://")}var g=a.addEventListener?"addEventListener":"attachEvent";var e=a[g];var d=g=="attachEvent"?"onmessage":"message";e(d,function(k){var i="";try{if(k.data.indexOf("youtubeembedplus")===0&&k.data.indexOf("clientId=")<0){i=k.data.split("|")[1];if(i.indexOf("[")!==0){i="<p>"+i+"</p>"}if(a.tinyMCE!==null&&a.tinyMCE.activeEditor!==null&&!a.tinyMCE.activeEditor.isHidden()){if(a._EPYTA_.mceBookmark){try{a.tinyMCE.activeEditor.selection.moveToBookmark(a._EPYTA_.mceBookmark)}catch(j){}}if(typeof a.tinyMCE.execInstanceCommand!=="undefined"){a.tinyMCE.execInstanceCommand(a.tinyMCE.activeEditor.id,"mceInsertContent",false,i)}else{send_to_editor(i)}setTimeout(function(){a._EPYTA_.mceBookmark=null},500)}else{i=i.replace("<p>","\n").replace("</p>","\n");if(typeof QTags.insertContent==="function"){QTags.insertContent(i)}else{send_to_editor(i)}}tb_remove()}}catch(j){}},false);b("body").on("click.tbyt","#ytprefs_wiz_button, .ytprefs_wiz_button_widget_text, .ytprefs-onboarding-launch",function(){a._EPYTA_.widen_ytprefs_wiz()});b("body").on("click.tbyt","#ytprefs_wiz_button_vi, .ytprefs_wiz_button_vi_widget_text",function(){send_to_editor("<p>[embed-vi-ad]</p>")});b(a).on("resize",a._EPYTA_.widen_ytprefs_wiz);b(document).on("wp-before-tinymce-init.ytprefs-media_button",function(i,j){$media_buttons=b(j.selector).closest(".wp-editor-wrap").find(".wp-media-buttons");if(!$media_buttons.find(".ytprefs_media_link").length){$media_buttons.append('<a href="'+encodeURI(a._EPYTA_.wizhref)+'" class="thickbox button ytprefs_media_link ytprefs_wiz_button_widget_text" title="Visual YouTube Search Tool and Wizard - For easier embedding"><span></span> YouTube</a>');if(a._EPYTA_.manage_options&&a._EPYTA_.vi_logged_in){$media_buttons.append('<a class="button ytprefs_vi_embed_shortcode" id="ytprefs_wiz_button_vi" title="Embed vi video ad"><span></span> Video Ad</a>')}}});if(b(".wrap-vi-settings").length){a._EPYTA_.adstxtLookup()}b('.wrap section a[href^="#jump"]').on("click",function(j){j.preventDefault();var i=b(this).attr("href");b('.nav-tab-wrapper a[href="'+i+'"], .nav-tab-wrapper a[rel="'+i+'"]').trigger("click")});b(".ytprefs-ajax-form").on("keypress",function(i){if(i.which==13){i.preventDefault();b(this).find(".ytprefs-ajax-form--submit:not([disabled])").trigger("click")}});b(a).on("hashchange",function(){if(a.location.hash.length>0&&false){$section=b("section"+a.location.hash);if($section.length>0){$section.find("h2").addClass("ytvi-hash-scroll");setTimeout(function(){$section.find("h2").removeClass("ytvi-hash-scroll")},2000)}$jumper=b(".jumper"+a.location.hash);if($jumper.length>0){b(".jumper"+a.location.hash+" + h3.sect").addClass("ytvi-hash-scroll");setTimeout(function(){b(".jumper"+a.location.hash+" + h3.sect").removeClass("ytvi-hash-scroll")},2000)}}});b(".vi-cover-prompt-no").on("click",function(){b.ajax({type:"post",dataType:"json",timeout:120000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_hide_feature_ajax"},success:function(i){if(!i||i.type==="error"){alertify.alert(i.message)}else{if(a!=a.top){a.location.reload()}else{a.top.location.href=i.url}}},error:function(k,i,j){alertify.alert('Sorry, there was a network error. Please try again, or turn off this feature using the "Hide Monetize Feature" checkbox on the "Defaults" tab of the YouTube settings. If the issue persists, please contact ext@embedplus.com')},complete:function(){}})});b(".vi-cover-prompt-yes").on("click",function(){b(".vi-cover-prompt, .vi-cover-clear").fadeOut(500);var i=new Date();i.setTime(i.getTime()+(365*24*60*60*1000));document.cookie="vi_cover_prompt_yes=1;expires="+i.toUTCString()+";path="+a._EPYTA_.admin_url});b(".vi-cover-prompt-maybe").on("click",function(){var i=new Date();i.setTime(i.getTime()+(365*24*60*60*1000));document.cookie="vi_cover_prompt_yes=1;expires="+i.toUTCString()+";path="+a._EPYTA_.admin_url;if(a!=a.top){a.location.reload()}else{a.top.location.href=a._EPYTA_.admin_url_ytprefs}});if(b(".vi-demo-screen").length>1){var f=setInterval(function(){b(".vi-demo-screen-2").toggleClass("demo-hide");b(".vi-demo-mobile-caption").toggleClass("demo-hide")},20000)}b(".ytvi-step-1--submit-register").on("click",function(i){var j=b.trim(b(".ytvi-register-email").val());if(!j.length){alertify.alert("Please enter your email address.")}else{b(".ytvi-step-1--submit-register").prop("disabled",true);b(".ytvi-step-1").hide("fade",{},500,function(){b(".ytvi-step-2-loading").show("fade",{},500,function(){b.ajax({type:"post",dataType:"json",timeout:120000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_cache_endpoints_ajax",email:j,domain:a.location.href},success:function(k){if(k.type=="success"){b(".ytvi-step-2 .ytvi-registration iframe").attr("src",k.signupURLParams);setTimeout(function(){b(".ytvi-step-2-loading").hide("fade",{},500,function(){b(".ytvi-step-2").show("fade",{},500)})},3000);var m=new Date(),l=new Date();l.setTime(l.getTime()+(365*24*60*60*1000));document.cookie="vi_signup_attempt="+m.toUTCString()+";expires="+l.toUTCString()+";path="+a._EPYTA_.admin_url}else{if(k.type==="error"){alertify.alert(k.message);a._EPYTA_.ytvi_cancel()}}},error:function(m,k,l){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com");a._EPYTA_.ytvi_cancel()},complete:function(){b(".ytvi-step-1--submit-register").prop("disabled",false)}})})})}});b(".ytvi-registration--cancel").on("click",function(){a._EPYTA_.ytvi_cancel()});b(".ytvi-step-1--confirm").on("change",function(){if(b(this).is(":checked")){b(".ytvi-step-1--submit-register").prop("disabled",false)}else{b(".ytvi-step-1--submit-register").prop("disabled",true)}});b(".ytvi-step-1--submit-login").on("click",function(k){var l=b.trim(b(".ytvi-login-email").val());var i=b.trim(b(".ytvi-password").val());var j="";j+=l.length?"":"Please enter your email address. ";j+=i.length?"":"Please enter your vi dashboard password.";if(j.length){alertify.alert(j)}else{b(".ytvi-step-1--submit-login").prop("disabled",true);b(".ytvi-step-1").hide("fade",{},500,function(){b(".ytvi-login-loading").show("fade",{},500,function(){b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_login_ajax",email:l,password:i},success:function(m){if(m.type==="error"){alertify.alert(m.message);a._EPYTA_.ytvi_cancel()}else{b(".ytvi-login-loading").hide("fade",{},500,function(){document.cookie="vi_signup_attempt=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";b(".ytvi-login-success-message").html(m.message);b(".ytvi-login-success").show("fade",{},500,function(){})})}},error:function(o,m,n){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com");a._EPYTA_.ytvi_cancel()},complete:function(){b(".ytvi-step-1--submit-login").prop("disabled",false)}})})})}});b("a.vi-logged-in-goto").each(function(){if(b(this).attr("href").indexOf(a.location.pathname+a.location.search)>0||a.location.search.indexOf("youtube-my-preferences")>0){b(this).removeAttr("target")}});if(b(".wrap-vi-settings").length){b(".vi-how-works").on("click",function(){var i=b(this).data("jump");b('.nav-tab-wrapper > a[href="'+i+'"]').trigger("click")});b(document).on("click",".wrap-vi-settings .nav-tab-wrapper a",function(){$a=b(this);b(".wrap-vi-settings .nav-tab-wrapper a").removeClass("nav-tab-active");$a.addClass("nav-tab-active");b(".wrap-vi-settings section").hide();b(".wrap-vi-settings section").filter($a.attr("href")).fadeIn(200);return false});var c=b(".iab-cat-tags").val();if(c.length>0){var h=c.split(",");h.forEach(function(k){var j=b('.iab-cat-child option[value="'+k+'"]').text();var i=b('.iab-cat-parent option[value="'+(k.split("-")[0])+'"]').text();a._EPYTA_.iabAdd(k,j,i)})}b(".iab-cat-parent").on("change",function(){var i=b(this).val();b(".iab-cat-child").val(i);if(i==""){b(".iab-cat-child-box").addClass("hidden");b(".iab-cat-child-box select").prop("disabled",true)}else{b(".iab-cat-child-box").removeClass("hidden");b(".iab-cat-child-box select").prop("disabled",false);b(".iab-cat-child option").addClass("hidden");b('.iab-cat-child option[value^="'+i+'-"], .iab-cat-child option[value="'+i+'"], .iab-cat-child option[value=""]').removeClass("hidden");b(".iab-cat-child-box select").val("")}});b(".iab-cat-child").on("change",function(){var l=b(".iab-cat-tags").val()?b(".iab-cat-tags").val().split(","):[];if(l.length<4){var k=b(this).val();var j=b(this).find("option:selected").text();var i=b(".iab-cat-parent").find("option:selected").text();if(k&&l.indexOf(k)==-1){l.push(k);b(".iab-cat-tags").val(l.join(","));a._EPYTA_.iabAdd(k,j,i)}}else{alertify.alert("You can choose up to 4 categories maximum. In order to add a new one, you must remove one of the existing ones.")}});b(".iab-cat-tags-display").on("click",".iab-cat-tag-button",function(){var i=b(this);var j=i.data("tag");var k=b(".iab-cat-tags").val()?b(".iab-cat-tags").val().split(","):[];k=k.filter(function(l){return l!=j});b(".iab-cat-tags").val(k.join(","));i.remove()});a._EPYTA_.demoBackgroundColor();a._EPYTA_.demoTextColor();a._EPYTA_.demoFontFamily();a._EPYTA_.demoFontSize();b(a._EPYTA_.escId("vi_js_settings[backgroundColor]")).wpColorPicker({change:a._EPYTA_.demoBackgroundColor});b(a._EPYTA_.escId("vi_js_settings[textColor]")).wpColorPicker({change:a._EPYTA_.demoTextColor});b(a._EPYTA_.escId("vi_js_settings[font]")).on("change",a._EPYTA_.demoFontFamily);b(a._EPYTA_.escId("vi_js_settings[fontSize]")).on("change",a._EPYTA_.demoFontSize);b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_reports_ajax"},success:function(l){if(l.type==="error"||!l.data.mtdReport.length||typeof(l.data.mtdReport[0].date)==="undefined"){b(".vi-report-error").removeClass("hide");b(".vi-report").addClass("hide")}else{var n=l.data.mtdReport.map(function(p,o){return{x:moment(p.date,"YYYY-MM-DD").format(),y:p.revenue}});b(".vi-total-earnings-num").text(a._EPYTA_.moneyFormat(l.data.netRevenue));var k=moment(n.length?n[0].x:new Date()).format("MMMM YYYY");var j=document.getElementById("vi-report-canvas").getContext("2d");var m={type:"line",data:{datasets:[{label:k+" Earnings (USD)",backgroundColor:"#1193aa",borderColor:"#1193aa",fill:false,data:n}]},options:{responsive:true,maintainAspectRatio:false,plugins:{deferred:{delay:1000},},title:{display:false},legend:{labels:{fontSize:15,fontColor:"#000000"}},tooltips:{position:"nearest",mode:"index",intersect:false,callbacks:{label:function(o,p){return a._EPYTA_.moneyFormat(o.yLabel)},title:function(o,p){return moment(o[0].xLabel).format("LL")}}},scales:{xAxes:[{type:"time",time:{unit:"day",unitStepSize:1,displayFormats:{day:"MMM DD"}},display:true,scaleLabel:{display:true,labelString:"Date",fontSize:15,fontColor:"#000000"},ticks:{major:{fontStyle:"bold",fontColor:"#000000"}}}],yAxes:[{display:true,scaleLabel:{display:true,labelString:"Revenue",fontSize:15,fontColor:"#000000"},ticks:{callback:function(q,p,o){return a._EPYTA_.moneyFormat(q)}}}]}}};Chart.defaults.global.defaultFontFamily="'Segoe UI', Roboto, 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif";var i=new Chart(j,m)}},error:function(k,i,j){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}});b(".ytvi-btn-logout").on("click",function(){var j="";var i=b(".iab-cat-tags").val();if(i.length>0&&i.split(",").length>1){j=" (Note: If you selected more than one video category, you must stay logged in to this settings page for your categories to automatically add variety to your ads)"}alertify.confirm().set({title:"Logout of Monetize settings",message:"Logging out won't delete your settings. However, it will require you or any other admins to re-login to change vi ad settings in the future"+j+".<br><br>To actually disable monetization, make sure the '<strong>vi ads are: On/Off</strong>' button is set to '<strong>Off</strong>.'",onok:function(){b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_logout_ajax"},success:function(k){if(k.type==="error"){alertify.alert(k.message)}else{location.href=k.url}},error:function(m,k,l){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}})}}).show()})}b(".ytvi-btn-toggle").on("click",function(){var i=b(this);alertify.confirm().set({title:(i.hasClass("ytvi-btn-active")?"Turn off":"Turn on")+" your vi ads",message:i.hasClass("ytvi-btn-active")?"Are you sure you would like to deactivate your video ads? Please note that your ads will no longer appear on the front end and your revenue will be paused. If you would like them to reappear later, simply click on this button again.":"Click OK to confirm turning on your vi ads. They will appear on your site according to your <strong>Placement</strong> settings.",onok:function(){b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_toggle_ajax"},success:function(j){if(j.type==="error"){alertify.alert(j.message)}else{i.find("strong").text(j.button_text);i.toggleClass("ytvi-btn-active ytvi-btn-inactive");if(i.hasClass("ytvi-btn-active")){b(".ytvi-msg-congrats").show(200)}else{b(".ytvi-msg-congrats").hide()}}},error:function(l,j,k){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}})}}).show()});b(".ytvi-intro-video-modal").on("click",function(k){k.preventDefault();var i=Math.min(document.body.clientWidth*0.8,800);var j=9/16*i;alertify.YoutubeDialog("BcrNPnWUkVI").set({frameless:true,resizeable:true}).resizeTo(i,j)});b("#vi_show_gdpr_authorization").on("change",function(){if(b(this).is(":checked")){b(".opt_vi_show_privacy_button").show(300)}else{b(".opt_vi_show_privacy_button").hide(300)}});if(b(".wrap-ytprefs-onboarding").length){b(".ytprefs-ob-nav-close").on("click",function(){a.parent.tb_remove();a.top.location.reload()});b(".ytprefs-ob-nav-prev").on("click",function(){a._EPYTA_.onboardPrev(b(this).closest(".ytprefs-ob-step"))});b(".ytprefs-ob-filter li").hover(function(){var i="."+b(this).find('input[type="checkbox"]').data("obfilter")+"-icon";b(i).addClass("yob-icon-visible")},function(){var i="."+b(this).find('input[type="checkbox"]').data("obfilter")+"-icon";b(i).removeClass("yob-icon-visible")});b('.ytprefs-ob-filter input[type="checkbox"]').on("change",function(){var i=b(this);var j=i.data("obfilter");var k=b('.ytprefs-ob-filter input[type="checkbox"]:checked');if(k.length&&!(k.length===1&&k.is('[data-obfilter="yob-monetize"]'))){b(".ytprefs-ob-step1 .ytprefs-ob-nav-next").prop("disabled",false)}else{b(".ytprefs-ob-step1 .ytprefs-ob-nav-next").prop("disabled",true)}if(j=="yob-monetize"){b(".ytprefs-ob-step3 .ytprefs-ob-nav-ultimate, .ytprefs-ob-step3 .ytprefs-ob-nav-penultimate").toggleClass("ytprefs-ob-nav-hide")}else{if(i.is(":checked")){b(".ytprefs-ob-step2 ."+j).addClass(j+"-visible")}else{b(".ytprefs-ob-step2 ."+j).removeClass(j+"-visible")}}});b(".ytprefs-ob-step1 .ytprefs-ob-nav-next").on("click",function(){a._EPYTA_.onboardNext(b(this).closest(".ytprefs-ob-step"))});b("#form-onboarding").on("submit",function(k){k.preventDefault();(a.tinyMCE||a.tinymce).triggerSave();var i=b(this);i.find(".ytprefs-ob-nav-next").prop("disabled",true);var j=i.ytprefsFormJSON();j.security=a._EPYTA_.security;b.ajax({type:"post",dataType:"json",timeout:30000,url:a._EPYTA_?a._EPYTA_.wpajaxurl:ajaxurl,data:j,success:function(l){if(l.type=="success"){a._EPYTA_.onboardNext(i.closest(".ytprefs-ob-step"))}else{}},error:function(n,l,m){},complete:function(){i.find(".ytprefs-ob-nav-next").prop("disabled",false)}})});b(".ytprefs-ob-step3 .ytprefs-ob-nav-skip").on("click",function(){a._EPYTA_.onboardNext(b(this).closest(".ytprefs-ob-step"))});b("#form-onboarding-apikey").on("submit",function(k){k.preventDefault();var i=b(this);i.find(".ytprefs-ob-nav-next").prop("disabled",true);var j=i.ytprefsFormJSON();j.security=a._EPYTA_.security;b.ajax({type:"post",dataType:"json",timeout:30000,url:a._EPYTA_?a._EPYTA_.wpajaxurl:ajaxurl,data:j,success:function(l){if(l.type=="success"){if(i.find(".ytprefs-ob-nav-ultimate").hasClass("ytprefs-ob-nav-hide")){a._EPYTA_.onboardNext(i.closest(".ytprefs-ob-step"))}else{a.parent.tb_remove();a.top.location.reload()}}else{}},error:function(n,l,m){},complete:function(){i.find(".ytprefs-ob-nav-next").prop("disabled",false)}})})}});b(a).on("load",function(){if(_EPYTA_.onboarded!="1"){b(".ytprefs-onboarding-launch").trigger("click")}})})(window,jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
'use strict';(function(b,a){b._EPYTA_.widen_ytprefs_wiz=b._EPYTA_.widen_ytprefs_wiz||function(){setTimeout(function(){var f=Math.min(950,a(b).width()-100),c=-1*f/2;a("#TB_window").addClass("epyt-thickbox").animate({marginLeft:c,width:f},150,"swing",function(){a("#TB_window").get(0).style.setProperty("width",f,"important")});a("#TB_overlay").addClass("epyt-thickbox");a("#TB_window iframe").animate({width:f},150)},750)};b._EPYTA_.ytvi_cancel=b._EPYTA_.ytvi_cancel||function(){a(".ytvi-step").hide("fade",
|
2 |
+
{},500,function(){a(".ytvi-step-1").show("fade",{},500)})};b._EPYTA_.moneyFormat=b._EPYTA_.moneyFormat||function(f){return"$"+parseFloat(f).toFixed(2)};b._EPYTA_.escId=function(f){return"#"+f.replace(/(:|\.|\[|\]|,|=|@)/g,"\\$1")};b._EPYTA_.demoBackgroundColor=function(f,c){setTimeout(function(){a(".vi-story-demo--info").css("background-color",a(b._EPYTA_.escId("vi_js_settings[backgroundColor]")).val())},0)};b._EPYTA_.demoTextColor=function(f,c){setTimeout(function(){a(".vi-story-demo--info *").css("color",
|
3 |
+
a(b._EPYTA_.escId("vi_js_settings[textColor]")).val())},0)};b._EPYTA_.demoFontFamily=function(){a(".vi-story-demo--title").css("font-family",a(b._EPYTA_.escId("vi_js_settings[font]")).val())};b._EPYTA_.demoFontSize=function(){a(".vi-story-demo--title").css("font-size",a(b._EPYTA_.escId("vi_js_settings[fontSize]")).val()+"px")};b._EPYTA_.onboardNext=function(f){a(".ytprefs-ob-step").removeClass("active-step");setTimeout(function(){b.scrollTo(0,0);f.next().addClass("active-step")},600)};b._EPYTA_.onboardPrev=
|
4 |
+
function(f){a(".ytprefs-ob-step").removeClass("active-step");setTimeout(function(){b.scrollTo(0,0);f.prev().addClass("active-step")},600)};b._EPYTA_.selectText=function(f){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(f);c.select()}else if(b.getSelection){var d=b.getSelection();c=document.createRange();c.selectNode(f);d.removeAllRanges();d.addRange(c)}};b._EPYTA_.adstxtLookup=function(){b._EPYTA_.adstxtLoading(!0);a.ajax({url:location.protocol+"//"+location.hostname+
|
5 |
+
"/ads.txt?c="+Date.now(),dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:!0}).always(function(f,c,d){if("success"===c)switch(d.status){case 200:case 301:case 302:case 304:case 307:b._EPYTA_.adstxtVerify(f);break;default:b._EPYTA_.adstxtVerify("")}else 404==f.status?a.ajax({url:location.protocol+"//"+location.hostname+"/ads.txt",dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:!0}).always(function(e,g,h){if("success"===g)switch(h.status){case 200:case 301:case 302:case 304:case 307:b._EPYTA_.adstxtVerify(e);
|
6 |
+
break;default:b._EPYTA_.adstxtVerify("")}else b._EPYTA_.adstxtVerify("")}):b._EPYTA_.adstxtVerify("")})};b._EPYTA_.adstxtVerify=function(f){a.ajax({type:"post",dataType:"json",timeout:12E4,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_adstxt_status_soft_ajax",current_adstxt:f},success:function(c){2==c.code?a(".nav-tab-adstxt").addClass("nav-tab-valid"):0>=c.code&&a(".nav-tab-adstxt").addClass("nav-tab-invalid");a(".adstxt-verify-message").html(c.message)},error:function(c,
|
7 |
+
d,e){a(".nav-tab-adstxt").addClass("nav-tab-invalid");a(".adstxt-verify-message").html("Could not validate ads.txt: "+e)},complete:function(){b._EPYTA_.adstxtLoading(!1)}})};b._EPYTA_.adstxtLoading=function(f){f?a(".nav-tab-adstxt").addClass("nav-tab-loading"):a(".nav-tab-adstxt").removeClass("nav-tab-loading")};b._EPYTA_.gbPreviewSetup=function(){b._EPADashboard_.loadYTAPI();b._EPADashboard_.apiInit();b._EPADashboard_.log("YT API GB");b._EPADashboard_.pageReady();a.fn.fitVidsEP&&a("body").fitVidsEP()};
|
8 |
+
b._EPYTA_.iabAdd=function(f,c,d){f=a('<div class="iab-cat-tag-button" data-tag="'+f+'">'+d+" : "+c+" ×</div>");a(".iab-cat-tags-display").append(f);a(".iab-cat-tags-display .iab-cat-tag-button").sort(function(e,g){return a(e).text()>a(g).text()?1:-1}).appendTo(".iab-cat-tags-display")};a.fn.ytprefsFormJSON=function(){var f={},c=this.serializeArray();a.each(c,function(){f[this.name]?(f[this.name].push||(f[this.name]=[f[this.name]]),f[this.name].push(this.value||"")):f[this.name]=this.value||
|
9 |
+
""});return f};a(document).ready(function(){0===b.location.toString().indexOf("https://")&&(b._EPYTA_.wpajaxurl=b._EPYTA_.wpajaxurl.replace("http://","https://"));var f=b.addEventListener?"addEventListener":"attachEvent";(0,b[f])("attachEvent"==f?"onmessage":"message",function(c){var d="";try{if(0===c.data.indexOf("youtubeembedplus")&&0>c.data.indexOf("clientId=")){d=c.data.split("|")[1];0!==d.indexOf("[")&&(d="<p>"+d+"</p>");if(null===b.tinyMCE||null===b.tinyMCE.activeEditor||b.tinyMCE.activeEditor.isHidden())d=
|
10 |
+
d.replace("<p>","\n").replace("</p>","\n"),"function"===typeof QTags.insertContent?QTags.insertContent(d):send_to_editor(d);else{if(b._EPYTA_.mceBookmark)try{b.tinyMCE.activeEditor.selection.moveToBookmark(b._EPYTA_.mceBookmark)}catch(e){}"undefined"!==typeof b.tinyMCE.execInstanceCommand?b.tinyMCE.execInstanceCommand(b.tinyMCE.activeEditor.id,"mceInsertContent",!1,d):send_to_editor(d);setTimeout(function(){b._EPYTA_.mceBookmark=null},500)}tb_remove()}}catch(e){}},!1);a("body").on("click.tbyt","#ytprefs_wiz_button, .ytprefs_wiz_button_widget_text, .ytprefs-onboarding-launch",
|
11 |
+
function(){b._EPYTA_.widen_ytprefs_wiz()});a("body").on("click.tbyt","#ytprefs_wiz_button_vi, .ytprefs_wiz_button_vi_widget_text",function(){send_to_editor("<p>[embed-vi-ad]</p>")});a(b).on("resize",b._EPYTA_.widen_ytprefs_wiz);a(document).on("wp-before-tinymce-init.ytprefs-media_button",function(c,d){$media_buttons=a(d.selector).closest(".wp-editor-wrap").find(".wp-media-buttons");$media_buttons.find(".ytprefs_media_link").length||($media_buttons.append('<a href="'+encodeURI(b._EPYTA_.wizhref)+'" class="thickbox button ytprefs_media_link ytprefs_wiz_button_widget_text" title="Visual YouTube Search Tool and Wizard - For easier embedding"><span></span> YouTube</a>'),
|
12 |
+
b._EPYTA_.manage_options&&b._EPYTA_.vi_logged_in&&$media_buttons.append('<a class="button ytprefs_vi_embed_shortcode" id="ytprefs_wiz_button_vi" title="Embed vi video ad"><span></span> Video Ad</a>'))});a(".wrap-vi-settings").length&&b._EPYTA_.adstxtLookup();a('.wrap section a[href^="#jump"]').on("click",function(c){c.preventDefault();c=a(this).attr("href");a('.nav-tab-wrapper a[href="'+c+'"], .nav-tab-wrapper a[rel="'+c+'"]').trigger("click")});a(".ytprefs-ajax-form").on("keypress",function(c){13==
|
13 |
+
c.which&&(c.preventDefault(),a(this).find(".ytprefs-ajax-form--submit:not([disabled])").trigger("click"))});a(".vi-cover-prompt-no").on("click",function(){a.ajax({type:"post",dataType:"json",timeout:12E4,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_hide_feature_ajax"},success:function(c){c&&"error"!==c.type?b!=b.top?b.location.reload():b.top.location.href=c.url:alertify.alert(c.message)},error:function(c,d,e){alertify.alert('Sorry, there was a network error. Please try again, or turn off this feature using the "Hide Monetize Feature" checkbox on the "Defaults" tab of the YouTube settings. If the issue persists, please contact ext@embedplus.com')},
|
14 |
+
complete:function(){}})});a(".vi-cover-prompt-yes").on("click",function(){a(".vi-cover-prompt, .vi-cover-clear").fadeOut(500);var c=new Date;c.setTime(c.getTime()+31536E6);document.cookie="vi_cover_prompt_yes=1;expires="+c.toUTCString()+";path="+b._EPYTA_.admin_url});a(".vi-cover-prompt-maybe").on("click",function(){var c=new Date;c.setTime(c.getTime()+31536E6);document.cookie="vi_cover_prompt_yes=1;expires="+c.toUTCString()+";path="+b._EPYTA_.admin_url;b!=b.top?b.location.reload():b.top.location.href=
|
15 |
+
b._EPYTA_.admin_url_ytprefs});1<a(".vi-demo-screen").length&&setInterval(function(){a(".vi-demo-screen-2").toggleClass("demo-hide");a(".vi-demo-mobile-caption").toggleClass("demo-hide")},2E4);a(".ytvi-step-1--submit-register").on("click",function(c){var d=a.trim(a(".ytvi-register-email").val());d.length?(a(".ytvi-step-1--submit-register").prop("disabled",!0),a(".ytvi-step-1").hide("fade",{},500,function(){a(".ytvi-step-2-loading").show("fade",{},500,function(){a.ajax({type:"post",dataType:"json",
|
16 |
+
timeout:12E4,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_cache_endpoints_ajax",email:d,domain:b.location.href},success:function(e){if("success"==e.type){a(".ytvi-step-2 .ytvi-registration iframe").attr("src",e.signupURLParams);setTimeout(function(){a(".ytvi-step-2-loading").hide("fade",{},500,function(){a(".ytvi-step-2").show("fade",{},500)})},3E3);e=new Date;var g=new Date;g.setTime(g.getTime()+31536E6);document.cookie="vi_signup_attempt="+e.toUTCString()+";expires="+
|
17 |
+
g.toUTCString()+";path="+b._EPYTA_.admin_url}else"error"===e.type&&(alertify.alert(e.message),b._EPYTA_.ytvi_cancel())},error:function(e,g,h){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com");b._EPYTA_.ytvi_cancel()},complete:function(){a(".ytvi-step-1--submit-register").prop("disabled",!1)}})})})):alertify.alert("Please enter your email address.")});a(".ytvi-registration--cancel").on("click",function(){b._EPYTA_.ytvi_cancel()});
|
18 |
+
a(".ytvi-step-1--confirm").on("change",function(){a(this).is(":checked")?a(".ytvi-step-1--submit-register").prop("disabled",!1):a(".ytvi-step-1--submit-register").prop("disabled",!0)});a(".ytvi-step-1--submit-login").on("click",function(c){var d=a.trim(a(".ytvi-login-email").val()),e=a.trim(a(".ytvi-password").val());c=d.length?"":"Please enter your email address. ";c+=e.length?"":"Please enter your vi dashboard password.";c.length?alertify.alert(c):(a(".ytvi-step-1--submit-login").prop("disabled",
|
19 |
+
!0),a(".ytvi-step-1").hide("fade",{},500,function(){a(".ytvi-login-loading").show("fade",{},500,function(){a.ajax({type:"post",dataType:"json",timeout:12E6,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_login_ajax",email:d,password:e},success:function(g){"error"===g.type?(alertify.alert(g.message),b._EPYTA_.ytvi_cancel()):a(".ytvi-login-loading").hide("fade",{},500,function(){document.cookie="vi_signup_attempt=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";a(".ytvi-login-success-message").html(g.message);
|
20 |
+
a(".ytvi-login-success").show("fade",{},500,function(){})})},error:function(g,h,k){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com");b._EPYTA_.ytvi_cancel()},complete:function(){a(".ytvi-step-1--submit-login").prop("disabled",!1)}})})}))});a("a.vi-logged-in-goto").each(function(){(0<a(this).attr("href").indexOf(b.location.pathname+b.location.search)||0<b.location.search.indexOf("youtube-my-preferences"))&&a(this).removeAttr("target")});
|
21 |
+
a(".wrap-vi-settings").length&&(a(".vi-how-works").on("click",function(){var c=a(this).data("jump");a('.nav-tab-wrapper > a[href="'+c+'"]').trigger("click")}),a(document).on("click",".wrap-vi-settings .nav-tab-wrapper a",function(){$a=a(this);a(".wrap-vi-settings .nav-tab-wrapper a").removeClass("nav-tab-active");$a.addClass("nav-tab-active");a(".wrap-vi-settings section").hide();a(".wrap-vi-settings section").filter($a.attr("href")).fadeIn(200);return!1}),f=a(".iab-cat-tags").val(),0<f.length&&f.split(",").forEach(function(c){var d=
|
22 |
+
a('.iab-cat-child option[value="'+c+'"]').text(),e=a('.iab-cat-parent option[value="'+c.split("-")[0]+'"]').text();b._EPYTA_.iabAdd(c,d,e)}),a(".iab-cat-parent").on("change",function(){var c=a(this).val();a(".iab-cat-child").val(c);""==c?(a(".iab-cat-child-box").addClass("hidden"),a(".iab-cat-child-box select").prop("disabled",!0)):(a(".iab-cat-child-box").removeClass("hidden"),a(".iab-cat-child-box select").prop("disabled",!1),a(".iab-cat-child option").addClass("hidden"),a('.iab-cat-child option[value^="'+
|
23 |
+
c+'-"], .iab-cat-child option[value="'+c+'"], .iab-cat-child option[value=""]').removeClass("hidden"),a(".iab-cat-child-box select").val(""))}),a(".iab-cat-child").on("change",function(){var c=a(".iab-cat-tags").val()?a(".iab-cat-tags").val().split(","):[];if(4>c.length){var d=a(this).val(),e=a(this).find("option:selected").text(),g=a(".iab-cat-parent").find("option:selected").text();d&&-1==c.indexOf(d)&&(c.push(d),a(".iab-cat-tags").val(c.join(",")),b._EPYTA_.iabAdd(d,e,g))}else alertify.alert("You can choose up to 4 categories maximum. In order to add a new one, you must remove one of the existing ones.")}),
|
24 |
+
a(".iab-cat-tags-display").on("click",".iab-cat-tag-button",function(){var c=a(this),d=c.data("tag"),e=a(".iab-cat-tags").val()?a(".iab-cat-tags").val().split(","):[];e=e.filter(function(g){return g!=d});a(".iab-cat-tags").val(e.join(","));c.remove()}),b._EPYTA_.demoBackgroundColor(),b._EPYTA_.demoTextColor(),b._EPYTA_.demoFontFamily(),b._EPYTA_.demoFontSize(),a(b._EPYTA_.escId("vi_js_settings[backgroundColor]")).wpColorPicker({change:b._EPYTA_.demoBackgroundColor}),a(b._EPYTA_.escId("vi_js_settings[textColor]")).wpColorPicker({change:b._EPYTA_.demoTextColor}),
|
25 |
+
a(b._EPYTA_.escId("vi_js_settings[font]")).on("change",b._EPYTA_.demoFontFamily),a(b._EPYTA_.escId("vi_js_settings[fontSize]")).on("change",b._EPYTA_.demoFontSize),a.ajax({type:"post",dataType:"json",timeout:12E6,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_reports_ajax"},success:function(c){if("error"!==c.type&&c.data.mtdReport.length&&"undefined"!==typeof c.data.mtdReport[0].date){var d=c.data.mtdReport.map(function(g,h){return{x:moment(g.date,"YYYY-MM-DD").format(),
|
26 |
+
y:g.revenue}});a(".vi-total-earnings-num").text(b._EPYTA_.moneyFormat(c.data.netRevenue));var e=moment(d.length?d[0].x:new Date).format("MMMM YYYY");c=document.getElementById("vi-report-canvas").getContext("2d");d={type:"line",data:{datasets:[{label:e+" Earnings (USD)",backgroundColor:"#1193aa",borderColor:"#1193aa",fill:!1,data:d}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{deferred:{delay:1E3}},title:{display:!1},legend:{labels:{fontSize:15,fontColor:"#000000"}},tooltips:{position:"nearest",
|
27 |
+
mode:"index",intersect:!1,callbacks:{label:function(g,h){return b._EPYTA_.moneyFormat(g.yLabel)},title:function(g,h){return moment(g[0].xLabel).format("LL")}}},scales:{xAxes:[{type:"time",time:{unit:"day",unitStepSize:1,displayFormats:{day:"MMM DD"}},display:!0,scaleLabel:{display:!0,labelString:"Date",fontSize:15,fontColor:"#000000"},ticks:{major:{fontStyle:"bold",fontColor:"#000000"}}}],yAxes:[{display:!0,scaleLabel:{display:!0,labelString:"Revenue",fontSize:15,fontColor:"#000000"},ticks:{callback:function(g,
|
28 |
+
h,k){return b._EPYTA_.moneyFormat(g)}}}]}}};Chart.defaults.global.defaultFontFamily="'Segoe UI', Roboto, 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif";new Chart(c,d)}else a(".vi-report-error").removeClass("hide"),a(".vi-report").addClass("hide")},error:function(c,d,e){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}}),a(".ytvi-btn-logout").on("click",function(){var c="",d=a(".iab-cat-tags").val();
|
29 |
+
0<d.length&&1<d.split(",").length&&(c=" (Note: If you selected more than one video category, you must stay logged in to this settings page for your categories to automatically add variety to your ads)");alertify.confirm().set({title:"Logout of Monetize settings",message:"Logging out won't delete your settings. However, it will require you or any other admins to re-login to change vi ad settings in the future"+c+".<br><br>To actually disable monetization, make sure the '<strong>vi ads are: On/Off</strong>' button is set to '<strong>Off</strong>.'",
|
30 |
+
onok:function(){a.ajax({type:"post",dataType:"json",timeout:12E6,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_logout_ajax"},success:function(e){"error"===e.type?alertify.alert(e.message):location.href=e.url},error:function(e,g,h){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}})}}).show()}));a(".ytvi-btn-toggle").on("click",function(){var c=a(this);alertify.confirm().set({title:(c.hasClass("ytvi-btn-active")?
|
31 |
+
"Turn off":"Turn on")+" your vi ads",message:c.hasClass("ytvi-btn-active")?"Are you sure you would like to deactivate your video ads? Please note that your ads will no longer appear on the front end and your revenue will be paused. If you would like them to reappear later, simply click on this button again.":"Click OK to confirm turning on your vi ads. They will appear on your site according to your <strong>Placement</strong> settings.",onok:function(){a.ajax({type:"post",dataType:"json",timeout:12E6,
|
32 |
+
url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_toggle_ajax"},success:function(d){"error"===d.type?alertify.alert(d.message):(c.find("strong").text(d.button_text),c.toggleClass("ytvi-btn-active ytvi-btn-inactive"),c.hasClass("ytvi-btn-active")?a(".ytvi-msg-congrats").show(200):a(".ytvi-msg-congrats").hide())},error:function(d,e,g){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}})}}).show()});
|
33 |
+
a(".ytvi-intro-video-modal").on("click",function(c){c.preventDefault();c=Math.min(.8*document.body.clientWidth,800);var d=.5625*c;alertify.YoutubeDialog("BcrNPnWUkVI").set({frameless:!0,resizeable:!0}).resizeTo(c,d)});a("#vi_show_gdpr_authorization").on("change",function(){a(this).is(":checked")?a(".opt_vi_show_privacy_button").show(300):a(".opt_vi_show_privacy_button").hide(300)});a(".wrap-ytprefs-onboarding").length&&(a(".ytprefs-ob-nav-close").on("click",function(){b.parent.tb_remove();b.top.location.reload()}),
|
34 |
+
a(".ytprefs-ob-nav-prev").on("click",function(){b._EPYTA_.onboardPrev(a(this).closest(".ytprefs-ob-step"))}),a(".ytprefs-ob-filter li").hover(function(){var c="."+a(this).find('input[type="checkbox"]').data("obfilter")+"-icon";a(c).addClass("yob-icon-visible")},function(){var c="."+a(this).find('input[type="checkbox"]').data("obfilter")+"-icon";a(c).removeClass("yob-icon-visible")}),a('.ytprefs-ob-filter input[type="checkbox"]').on("change",function(){var c=a(this),d=c.data("obfilter"),e=a('.ytprefs-ob-filter input[type="checkbox"]:checked');
|
35 |
+
!e.length||1===e.length&&e.is('[data-obfilter="yob-monetize"]')?a(".ytprefs-ob-step1 .ytprefs-ob-nav-next").prop("disabled",!0):a(".ytprefs-ob-step1 .ytprefs-ob-nav-next").prop("disabled",!1);"yob-monetize"==d?a(".ytprefs-ob-step3 .ytprefs-ob-nav-ultimate, .ytprefs-ob-step3 .ytprefs-ob-nav-penultimate").toggleClass("ytprefs-ob-nav-hide"):c.is(":checked")?a(".ytprefs-ob-step2 ."+d).addClass(d+"-visible"):a(".ytprefs-ob-step2 ."+d).removeClass(d+"-visible")}),a(".ytprefs-ob-step1 .ytprefs-ob-nav-next").on("click",
|
36 |
+
function(){b._EPYTA_.onboardNext(a(this).closest(".ytprefs-ob-step"))}),a("#form-onboarding").on("submit",function(c){c.preventDefault();(b.tinyMCE||b.tinymce).triggerSave();var d=a(this);d.find(".ytprefs-ob-nav-next").prop("disabled",!0);c=d.ytprefsFormJSON();c.security=b._EPYTA_.security;a.ajax({type:"post",dataType:"json",timeout:3E4,url:b._EPYTA_?b._EPYTA_.wpajaxurl:ajaxurl,data:c,success:function(e){if("success"==e.type)b._EPYTA_.onboardNext(d.closest(".ytprefs-ob-step"))},error:function(e,g,
|
37 |
+
h){},complete:function(){d.find(".ytprefs-ob-nav-next").prop("disabled",!1)}})}),a(".ytprefs-ob-step3 .ytprefs-ob-nav-skip").on("click",function(){b._EPYTA_.onboardNext(a(this).closest(".ytprefs-ob-step"))}),a("#form-onboarding-apikey").on("submit",function(c){c.preventDefault();var d=a(this);d.find(".ytprefs-ob-nav-next").prop("disabled",!0);c=d.ytprefsFormJSON();c.security=b._EPYTA_.security;a.ajax({type:"post",dataType:"json",timeout:3E4,url:b._EPYTA_?b._EPYTA_.wpajaxurl:ajaxurl,data:c,success:function(e){if("success"==
|
38 |
+
e.type)if(d.find(".ytprefs-ob-nav-ultimate").hasClass("ytprefs-ob-nav-hide"))b._EPYTA_.onboardNext(d.closest(".ytprefs-ob-step"));else b.parent.tb_remove(),b.top.location.reload()},error:function(e,g,h){},complete:function(){d.find(".ytprefs-ob-nav-next").prop("disabled",!1)}})}))});a(b).on("load",function(){"1"!=_EPYTA_.onboarded&&a(".ytprefs-onboarding-launch").trigger("click")})})(window,jQuery);
|
scripts/ytprefs.js
CHANGED
@@ -214,7 +214,7 @@
|
|
214 |
window._EPADashboard_.pageReady();
|
215 |
setTimeout(function ()
|
216 |
{
|
217 |
-
$($swapBlockParent).fitVidsEP();
|
218 |
}, 1);
|
219 |
}
|
220 |
}
|
@@ -392,11 +392,18 @@
|
|
392 |
{
|
393 |
if (window._EPYT_.not_live_on_channel && window._EPYT_.ytapi_load !== 'never')
|
394 |
{
|
395 |
-
$('.epyt-live-channel').
|
396 |
-
setTimeout(function ()
|
397 |
{
|
398 |
-
|
399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
}
|
401 |
$('.epyt-gallery').each(function ()
|
402 |
{
|
@@ -589,8 +596,9 @@
|
|
589 |
}
|
590 |
});
|
591 |
|
592 |
-
$('img.epyt-facade-poster').
|
593 |
{
|
|
|
594 |
if (this.naturalHeight < 200)
|
595 |
{
|
596 |
var facadeOldSrc = $(this).attr("src");
|
@@ -599,6 +607,10 @@
|
|
599 |
$(this).attr("src", facadeOldSrc.replace('maxresdefault', 'hqdefault'));
|
600 |
}
|
601 |
}
|
|
|
|
|
|
|
|
|
602 |
}).on('error', function ()
|
603 |
{
|
604 |
var facadeOldSrc = $(this).attr("src");
|
@@ -662,7 +674,7 @@
|
|
662 |
window._EPADashboard_.setupevents($(iframe).attr('id'));
|
663 |
setTimeout(function ()
|
664 |
{
|
665 |
-
$($(iframe).parent()).fitVidsEP();
|
666 |
}, 1);
|
667 |
});
|
668 |
}
|
@@ -686,7 +698,7 @@
|
|
686 |
}
|
687 |
};
|
688 |
|
689 |
-
if (!window._EPYT_.facade_mode)
|
690 |
{
|
691 |
window._EPADashboard_.loadYTAPI();
|
692 |
}
|
@@ -708,7 +720,7 @@
|
|
708 |
{
|
709 |
window._EPADashboard_.pageReady();
|
710 |
|
711 |
-
if (!window._EPYT_.facade_mode)
|
712 |
{
|
713 |
window._EPADashboard_.loadYTAPI();
|
714 |
}
|
214 |
window._EPADashboard_.pageReady();
|
215 |
setTimeout(function ()
|
216 |
{
|
217 |
+
$.fn.fitVidsEP && $($swapBlockParent).fitVidsEP();
|
218 |
}, 1);
|
219 |
}
|
220 |
}
|
392 |
{
|
393 |
if (window._EPYT_.not_live_on_channel && window._EPYT_.ytapi_load !== 'never')
|
394 |
{
|
395 |
+
$('.epyt-live-channel').each(function ()
|
|
|
396 |
{
|
397 |
+
if (!$(this).data('eypt-fallback'))
|
398 |
+
{
|
399 |
+
$(this).data('eypt-fallback', true);
|
400 |
+
$(this).css('opacity', 0);
|
401 |
+
setTimeout(function ()
|
402 |
+
{
|
403 |
+
$('.epyt-live-channel').css('opacity', 1);
|
404 |
+
}, 4000);
|
405 |
+
}
|
406 |
+
});
|
407 |
}
|
408 |
$('.epyt-gallery').each(function ()
|
409 |
{
|
596 |
}
|
597 |
});
|
598 |
|
599 |
+
$('img.epyt-facade-poster').on("load.epyt", function ()
|
600 |
{
|
601 |
+
this.epytFacadeCount = this.epytFacadeCount ? this.epytFacadeCount + 1 : 1;
|
602 |
if (this.naturalHeight < 200)
|
603 |
{
|
604 |
var facadeOldSrc = $(this).attr("src");
|
607 |
$(this).attr("src", facadeOldSrc.replace('maxresdefault', 'hqdefault'));
|
608 |
}
|
609 |
}
|
610 |
+
if (this.epytFacadeCount > 3)
|
611 |
+
{
|
612 |
+
$(this).off('load.epyt');
|
613 |
+
}
|
614 |
}).on('error', function ()
|
615 |
{
|
616 |
var facadeOldSrc = $(this).attr("src");
|
674 |
window._EPADashboard_.setupevents($(iframe).attr('id'));
|
675 |
setTimeout(function ()
|
676 |
{
|
677 |
+
$.fn.fitVidsEP && $($(iframe).parent()).fitVidsEP();
|
678 |
}, 1);
|
679 |
});
|
680 |
}
|
698 |
}
|
699 |
};
|
700 |
|
701 |
+
if (!window._EPYT_.facade_mode || (window._EPYT_.not_live_on_channel && $('iframe[src*="youtube.com/embed/live_stream"], iframe[data-src*="youtube.com/embed/live_stream"]').length))
|
702 |
{
|
703 |
window._EPADashboard_.loadYTAPI();
|
704 |
}
|
720 |
{
|
721 |
window._EPADashboard_.pageReady();
|
722 |
|
723 |
+
if (!window._EPYT_.facade_mode || (window._EPYT_.not_live_on_channel && $('iframe[src*="youtube.com/embed/live_stream"], iframe[data-src*="youtube.com/embed/live_stream"]').length))
|
724 |
{
|
725 |
window._EPADashboard_.loadYTAPI();
|
726 |
}
|
scripts/ytprefs.min.js
CHANGED
@@ -1,2 +1,26 @@
|
|
1 |
-
|
2 |
-
(function(a,b){a._EPYT_=a._EPYT_||{ajaxurl:"/wp-admin/admin-ajax.php",security:"",gallery_scrolloffset:100,eppathtoscripts:"/wp-content/plugins/youtube-embed-plus/scripts/",eppath:"/wp-content/plugins/youtube-embed-plus/",epresponsiveselector:["iframe.__youtube_prefs_widget__"],epdovol:true,evselector:'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',stopMobileBuffer:true,ajax_compat:false,usingdefault:true,ytapi_load:"light",pause_others:false,facade_mode:false,not_live_on_channel:false};a._EPYT_.touchmoved=false;a._EPYT_.apiVideos=a._EPYT_.apiVideos||{};if(a.location.toString().indexOf("https://")===0){a._EPYT_.ajaxurl=a._EPYT_.ajaxurl.replace("http://","https://")}a._EPYT_.pageLoaded=false;b(a).on("load._EPYT_",function(){a._EPYT_.pageLoaded=true});if(!document.querySelectorAll){document.querySelectorAll=function(d){var f=document,e=f.documentElement.firstChild,c=f.createElement("STYLE");e.appendChild(c);f.__qsaels=[];c.styleSheet.cssText=d+"{x:expression(document.__qsaels.push(this))}";a.scrollBy(0,0);return f.__qsaels}}if(typeof a._EPADashboard_==="undefined"){a._EPADashboard_={initStarted:false,checkCount:0,onPlayerReady:function(h){try{if(typeof _EPYT_.epdovol!=="undefined"&&_EPYT_.epdovol){var e=parseInt(h.target.getIframe().getAttribute("data-vol"));if(!isNaN(e)){if(e===0){h.target.mute()}else{if(h.target.isMuted()){h.target.unMute()}h.target.setVolume(e)}}}var d=parseInt(h.target.getIframe().getAttribute("data-epautoplay"));if(!isNaN(d)&&d===1){h.target.playVideo()}}catch(g){}try{var i=h.target.getIframe();var c=i.getAttribute("id");a._EPYT_.apiVideos[c]=h.target;if(a._EPYT_.not_live_on_channel&&h.target.getVideoUrl().indexOf("live_stream")>0){a._EPADashboard_.doLiveFallback(i)}}catch(f){}finally{b(h.target.getIframe()).css("opacity",1)}},onPlayerStateChange:function(f){var e=f.target.getIframe();if(a._EPYT_.pause_others&&f.data===a.YT.PlayerState.PLAYING){a._EPADashboard_.pauseOthers(f.target)}if(f.data===a.YT.PlayerState.PLAYING&&f.target.ponce!==true&&e.src.indexOf("autoplay=1")===-1){f.target.ponce=true}if(f.data===a.YT.PlayerState.ENDED&&b(e).data("relstop")=="1"){if(typeof f.target.stopVideo==="function"){f.target.stopVideo()}else{var g=b(e).clone(true).off();g.attr("src",a._EPADashboard_.cleanSrc(g.attr("src").replace("autoplay=1","autoplay=0")));b(e).replaceWith(g);a._EPADashboard_.setupevents(g.attr("id"));e=g.get(0)}}var c=b(e).closest(".epyt-gallery");if(!c.length){c=b("#"+b(e).data("epytgalleryid"))}if(c.length){var d=c.find(".epyt-pagebutton").first().data("autonext")=="1";if(d&&f.data===a.YT.PlayerState.ENDED){var h=c.find(".epyt-current-video");if(!h.length){h=c.find(".epyt-gallery-thumb").first()}var i=h.find(" ~ .epyt-gallery-thumb").first();if(i.length){i.trigger("click")}else{c.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().trigger("click")}}}},isMobile:function(){return/Mobi|Android/i.test(navigator.userAgent)},base64DecodeUnicode:function(c){c=c.replace(/\s/g,"");return decodeURIComponent(Array.prototype.map.call(atob(c),function(d){return"%"+("00"+d.charCodeAt(0).toString(16)).slice(-2)}).join(""))},doLiveFallback:function(g){var h=b(g).closest(".wp-block-embed");if(!h.length){h=b(g).closest(".epyt-live-chat-wrapper")}if(!h.length){h=b(g).closest(".epyt-video-wrapper")}if(h.length){var f=b("#epyt-live-fallback");if(f.length){var c="";try{c=a._EPADashboard_.base64DecodeUnicode(f.get(0).innerHTML)}catch(e){}if(c){var d=h.parent();a._EPADashboard_.loadYTAPI();h.replaceWith(c);a._EPADashboard_.apiInit();a._EPADashboard_.pageReady();setTimeout(function(){b(d).fitVidsEP()},1)}}}},videoEqual:function(d,c){if(d.getIframe&&c.getIframe&&d.getIframe().id===c.getIframe().id){return true}return false},pauseOthers:function(e){if(!e){return}for(var d in a._EPYT_.apiVideos){var c=a._EPYT_.apiVideos[d];if(c&&typeof c.pauseVideo==="function"&&c!=e&&!_EPADashboard_.videoEqual(c,e)&&typeof c.getPlayerState==="function"&&[YT.PlayerState.BUFFERING,a.YT.PlayerState.PLAYING].indexOf(c.getPlayerState())>=0){c.pauseVideo()}}},justid:function(c){return new RegExp("[\\?&]v=([^&#]*)").exec(c)[1]},setupevents:function(e){if(typeof(a.YT)!=="undefined"&&a.YT!==null&&a.YT.loaded){var c=document.getElementById(e);if(!c.epytsetupdone){a._EPADashboard_.log("Setting up YT API events: "+e);c.epytsetupdone=true;var d={events:{onReady:a._EPADashboard_.onPlayerReady,onStateChange:a._EPADashboard_.onPlayerStateChange},host:(c.src||"").indexOf("nocookie")>0?"https://www.youtube-nocookie.com":"https://www.youtube.com"};return new a.YT.Player(e,d)}}},apiInit:function(){if(typeof(a.YT)!=="undefined"){a._EPADashboard_.initStarted=true;var c=document.querySelectorAll(_EPYT_.evselector);for(var d=0;d<c.length;d++){if(!c[d].hasAttribute("id")){c[d].id="_dytid_"+Math.round(Math.random()*8999+1000)}a._EPADashboard_.setupevents(c[d].id)}}},log:function(d){try{console.log(d)}catch(c){}},doubleCheck:function(){a._EPADashboard_.checkInterval=setInterval(function(){a._EPADashboard_.checkCount++;if(a._EPADashboard_.checkCount>=5||a._EPADashboard_.initStarted){clearInterval(a._EPADashboard_.checkInterval)}else{a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API init check")}},1000)},selectText:function(e){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(e);c.select()}else{if(a.getSelection){var d=a.getSelection();var c=document.createRange();c.selectNode(e);d.removeAllRanges();d.addRange(c)}}},setVidSrc:function(c,d){if(c.is(".epyt-facade")){c.attr("data-facadesrc",a._EPADashboard_.cleanSrc(d));c.trigger("click")}else{c.attr("src",a._EPADashboard_.cleanSrc(d));c.get(0).epytsetupdone=false;a._EPADashboard_.setupevents(c.attr("id"))}},cleanSrc:function(d){var c=d.replace("enablejsapi=1?enablejsapi=1","enablejsapi=1");return c},loadYTAPI:function(){if(typeof a.YT==="undefined"){if(a._EPYT_.ytapi_load!=="never"&&(a._EPYT_.ytapi_load==="always"||b('iframe[src*="youtube.com/embed/"], iframe[data-src*="youtube.com/embed/"], .__youtube_prefs__').length)){var c=document.createElement("script");c.src="https://www.youtube.com/iframe_api";c.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(c)}}else{if(a.YT.loaded){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available 2")})}}}},pageReady:function(){if(a._EPYT_.not_live_on_channel&&a._EPYT_.ytapi_load!=="never"){b(".epyt-live-channel").css("opacity",0);setTimeout(function(){b(".epyt-live-channel").css("opacity",1)},4000)}b(".epyt-gallery").each(function(){var f=b(this);if(!f.data("epytevents")||!b("body").hasClass("block-editor-page")){f.data("epytevents","1");var e=b(this).find("iframe, div.__youtube_prefs_gdpr__, div.epyt-facade").first();var c=e.data("src")||e.data("facadesrc")||e.attr("src");if(!c){c=e.data("ep-src")}var d=b(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid");if(typeof(c)!=="undefined"){c=c.replace(d,"GALLERYVIDEOID");f.data("ep-gallerysrc",c)}else{if(e.hasClass("__youtube_prefs_gdpr__")){f.data("ep-gallerysrc","")}}f.on("click touchend",".epyt-gallery-list .epyt-gallery-thumb",function(k){e=f.find("iframe, div.__youtube_prefs_gdpr__, div.epyt-facade").first();if(a._EPYT_.touchmoved){return}if(!b(this).hasClass("epyt-current-video")){f.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");b(this).addClass("epyt-current-video");var g=b(this).data("videoid");f.data("currvid",g);var l=f.data("ep-gallerysrc").replace("GALLERYVIDEOID",g);var j=f.find(".epyt-pagebutton").first().data("thumbplay");if(j!=="0"&&j!==0){if(l.indexOf("autoplay")>0){l=l.replace("autoplay=0","autoplay=1")}else{l+="&autoplay=1"}e.addClass("epyt-thumbplay")}var h=Math.max(b("body").scrollTop(),b("html").scrollTop());var i=e.offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(h>i){b("html, body").animate({scrollTop:i},500,function(){a._EPADashboard_.setVidSrc(e,l)})}else{a._EPADashboard_.setVidSrc(e,l)}}}).on("touchmove",function(g){a._EPYT_.touchmoved=true}).on("touchstart",function(){a._EPYT_.touchmoved=false}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(h){var g=h.which;if((g===13)||(g===32)){h.preventDefault();b(this).trigger("click")}});f.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).addClass("hover")});f.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).removeClass("hover")});f.on("click touchend",".epyt-pagebutton",function(k){if(a._EPYT_.touchmoved){return}if(!f.find(".epyt-gallery-list").hasClass("epyt-loading")){f.find(".epyt-gallery-list").addClass("epyt-loading");var g=typeof(k.originalEvent)!=="undefined";var j={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:b(this).data("playlistid"),pageToken:b(this).data("pagetoken"),pageSize:b(this).data("pagesize"),columns:b(this).data("epcolumns"),showTitle:b(this).data("showtitle"),showPaging:b(this).data("showpaging"),autonext:b(this).data("autonext"),thumbplay:b(this).data("thumbplay")}};var h=b(this).hasClass("epyt-next");var i=parseInt(f.data("currpage")+"");i+=h?1:-1;f.data("currpage",i);b.post(_EPYT_.ajaxurl,j,function(l){f.find(".epyt-gallery-list").html(l);f.find(".epyt-current").each(function(){b(this).text(f.data("currpage"))});f.find('.epyt-gallery-thumb[data-videoid="'+f.data("currvid")+'"]').addClass("epyt-current-video");if(f.find(".epyt-pagebutton").first().data("autonext")=="1"&&!g){f.find(".epyt-gallery-thumb").first().trigger("click")}}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){f.find(".epyt-gallery-list").removeClass("epyt-loading");if(f.find(".epyt-pagebutton").first().data("autonext")!="1"){var l=Math.max(b("body").scrollTop(),b("html").scrollTop());var m=f.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(l>m){b("html, body").animate({scrollTop:m},500)}}})}}).on("touchmove",function(g){a._EPYT_.touchmoved=true}).on("touchstart",function(){a._EPYT_.touchmoved=false})}});b(".__youtube_prefs_gdpr__.epyt-is-override").each(function(){b(this).parent(".wp-block-embed__wrapper").addClass("epyt-is-override__wrapper")});b("button.__youtube_prefs_gdpr__").on("click",function(c){c.preventDefault();if(b.cookie){b.cookie("ytprefs_gdpr_consent","1",{expires:30,path:"/"});a.top.location.reload()}});b("img.epyt-facade-poster").one("load",function(){if(this.naturalHeight<200){var c=b(this).attr("src");if(c){b(this).attr("src",c.replace("maxresdefault","hqdefault"))}}}).on("error",function(){var c=b(this).attr("src");if(c){b(this).attr("src",c.replace("maxresdefault","hqdefault"))}}).each(function(){if(this.complete){b(this).trigger("load")}});b(".epyt-facade-play").each(function(){if(!b(this).find("svg").length){b(this).append('<svg data-no-lazy="1" height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-large-play-button-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"></path><path d="M 45,24 27,14 27,34" fill="#fff"></path></svg>')}});b(".epyt-facade-poster[data-facadeoembed]").each(function(){var c=b(this);var d="https://www.youtube.com/"+c.data("facadeoembed");b.get("https://youtube.com/oembed",{url:d,format:"json"},function(e){c.attr("src",e.thumbnail_url.replace("hqdefault","maxresdefault"))},"json").fail(function(){}).always(function(){})});b(document).on("click",".epyt-facade",function(j){var h=b(this);var d=h.attr("data-facadesrc");d=a._EPADashboard_.cleanSrc(d);var f=document.createElement("iframe");for(var c=0;c<this.attributes.length;c++){var g=this.attributes[c];if(["allow","class","height","id","width"].indexOf(g.name.toLowerCase())>=0||g.name.toLowerCase().indexOf("data-")==0){b(f).attr(g.name,g.value)}}b(f).removeClass("epyt-facade");b(f).attr("allowfullscreen","").attr("title",h.find("img").attr("alt")).attr("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture");a._EPADashboard_.loadYTAPI();h.replaceWith(f);b(f).attr("src",d);a._EPADashboard_.setupevents(b(f).attr("id"));setTimeout(function(){b(b(f).parent()).fitVidsEP()},1)})}}}a.onYouTubeIframeAPIReady=typeof a.onYouTubeIframeAPIReady!=="undefined"?a.onYouTubeIframeAPIReady:function(){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready 2")})}};if(!a._EPYT_.facade_mode){a._EPADashboard_.loadYTAPI()}if(a._EPYT_.pageLoaded){a._EPADashboard_.doubleCheck()}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.doubleCheck()})}b(document).ready(function(){a._EPADashboard_.pageReady();if(!a._EPYT_.facade_mode){a._EPADashboard_.loadYTAPI()}if(a._EPYT_.ajax_compat){b(a).on("load._EPYT_",function(){b(document).ajaxSuccess(function(d,f,c){if(f&&f.responseText&&(f.responseText.indexOf("<iframe ")!==-1||f.responseText.indexOf("enablejsapi")!==-1)){a._EPADashboard_.loadYTAPI();a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API AJAX");a._EPADashboard_.pageReady()}})})}})})(window,jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
'use strict';(function(b,c){b._EPYT_=b._EPYT_||{ajaxurl:"/wp-admin/admin-ajax.php",security:"",gallery_scrolloffset:100,eppathtoscripts:"/wp-content/plugins/youtube-embed-plus/scripts/",eppath:"/wp-content/plugins/youtube-embed-plus/",epresponsiveselector:["iframe.__youtube_prefs_widget__"],epdovol:!0,evselector:'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',stopMobileBuffer:!0,ajax_compat:!1,usingdefault:!0,ytapi_load:"light",pause_others:!1,
|
2 |
+
facade_mode:!1,not_live_on_channel:!1};b._EPYT_.touchmoved=!1;b._EPYT_.apiVideos=b._EPYT_.apiVideos||{};0===b.location.toString().indexOf("https://")&&(b._EPYT_.ajaxurl=b._EPYT_.ajaxurl.replace("http://","https://"));b._EPYT_.pageLoaded=!1;c(b).on("load._EPYT_",function(){b._EPYT_.pageLoaded=!0});document.querySelectorAll||(document.querySelectorAll=function(a){var d=document,e=d.documentElement.firstChild,g=d.createElement("STYLE");e.appendChild(g);d.__qsaels=[];g.styleSheet.cssText=a+"{x:expression(document.__qsaels.push(this))}";
|
3 |
+
b.scrollBy(0,0);return d.__qsaels});"undefined"===typeof b._EPADashboard_&&(b._EPADashboard_={initStarted:!1,checkCount:0,onPlayerReady:function(a){try{if("undefined"!==typeof _EPYT_.epdovol&&_EPYT_.epdovol){var d=parseInt(a.target.getIframe().getAttribute("data-vol"));isNaN(d)||(0===d?a.target.mute():(a.target.isMuted()&&a.target.unMute(),a.target.setVolume(d)))}var e=parseInt(a.target.getIframe().getAttribute("data-epautoplay"));isNaN(e)||1!==e||a.target.playVideo()}catch(h){}try{var g=a.target.getIframe(),
|
4 |
+
f=g.getAttribute("id");b._EPYT_.apiVideos[f]=a.target;b._EPYT_.not_live_on_channel&&0<a.target.getVideoUrl().indexOf("live_stream")&&b._EPADashboard_.doLiveFallback(g)}catch(h){}finally{c(a.target.getIframe()).css("opacity",1)}},onPlayerStateChange:function(a){var d=a.target.getIframe();b._EPYT_.pause_others&&a.data===b.YT.PlayerState.PLAYING&&b._EPADashboard_.pauseOthers(a.target);a.data===b.YT.PlayerState.PLAYING&&!0!==a.target.ponce&&-1===d.src.indexOf("autoplay=1")&&(a.target.ponce=!0);if(a.data===
|
5 |
+
b.YT.PlayerState.ENDED&&"1"==c(d).data("relstop"))if("function"===typeof a.target.stopVideo)a.target.stopVideo();else{var e=c(d).clone(!0).off();e.attr("src",b._EPADashboard_.cleanSrc(e.attr("src").replace("autoplay=1","autoplay=0")));c(d).replaceWith(e);b._EPADashboard_.setupevents(e.attr("id"));d=e.get(0)}e=c(d).closest(".epyt-gallery");e.length||(e=c("#"+c(d).data("epytgalleryid")));e.length&&"1"==e.find(".epyt-pagebutton").first().data("autonext")&&a.data===b.YT.PlayerState.ENDED&&(a=e.find(".epyt-current-video"),
|
6 |
+
a.length||(a=e.find(".epyt-gallery-thumb").first()),a=a.find(" ~ .epyt-gallery-thumb").first(),a.length?a.trigger("click"):e.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().trigger("click"))},isMobile:function(){return/Mobi|Android/i.test(navigator.userAgent)},base64DecodeUnicode:function(a){a=a.replace(/\s/g,"");return decodeURIComponent(Array.prototype.map.call(atob(a),function(d){return"%"+("00"+d.charCodeAt(0).toString(16)).slice(-2)}).join(""))},doLiveFallback:function(a){var d=
|
7 |
+
c(a).closest(".wp-block-embed");d.length||(d=c(a).closest(".epyt-live-chat-wrapper"));d.length||(d=c(a).closest(".epyt-video-wrapper"));if(d.length&&(a=c("#epyt-live-fallback"),a.length)){var e="";try{e=b._EPADashboard_.base64DecodeUnicode(a.get(0).innerHTML)}catch(f){}if(e){var g=d.parent();b._EPADashboard_.loadYTAPI();d.replaceWith(e);b._EPADashboard_.apiInit();b._EPADashboard_.pageReady();setTimeout(function(){c.fn.fitVidsEP&&c(g).fitVidsEP()},1)}}},videoEqual:function(a,d){return a.getIframe&&
|
8 |
+
d.getIframe&&a.getIframe().id===d.getIframe().id?!0:!1},pauseOthers:function(a){if(a)for(var d in b._EPYT_.apiVideos){var e=b._EPYT_.apiVideos[d];e&&"function"===typeof e.pauseVideo&&e!=a&&!_EPADashboard_.videoEqual(e,a)&&"function"===typeof e.getPlayerState&&0<=[YT.PlayerState.BUFFERING,b.YT.PlayerState.PLAYING].indexOf(e.getPlayerState())&&e.pauseVideo()}},justid:function(a){return/[\?&]v=([^&#]*)/.exec(a)[1]},setupevents:function(a){if("undefined"!==typeof b.YT&&null!==b.YT&&b.YT.loaded){var d=
|
9 |
+
document.getElementById(a);if(!d.epytsetupdone)return b._EPADashboard_.log("Setting up YT API events: "+a),d.epytsetupdone=!0,d={events:{onReady:b._EPADashboard_.onPlayerReady,onStateChange:b._EPADashboard_.onPlayerStateChange},host:0<(d.src||"").indexOf("nocookie")?"https://www.youtube-nocookie.com":"https://www.youtube.com"},new b.YT.Player(a,d)}},apiInit:function(){if("undefined"!==typeof b.YT){b._EPADashboard_.initStarted=!0;for(var a=document.querySelectorAll(_EPYT_.evselector),d=0;d<a.length;d++)a[d].hasAttribute("id")||
|
10 |
+
(a[d].id="_dytid_"+Math.round(8999*Math.random()+1E3)),b._EPADashboard_.setupevents(a[d].id)}},log:function(a){try{console.log(a)}catch(d){}},doubleCheck:function(){b._EPADashboard_.checkInterval=setInterval(function(){b._EPADashboard_.checkCount++;5<=b._EPADashboard_.checkCount||b._EPADashboard_.initStarted?clearInterval(b._EPADashboard_.checkInterval):(b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API init check"))},1E3)},selectText:function(a){if(document.selection){var d=document.body.createTextRange();
|
11 |
+
d.moveToElementText(a);d.select()}else if(b.getSelection){var e=b.getSelection();d=document.createRange();d.selectNode(a);e.removeAllRanges();e.addRange(d)}},setVidSrc:function(a,d){a.is(".epyt-facade")?(a.attr("data-facadesrc",b._EPADashboard_.cleanSrc(d)),a.trigger("click")):(a.attr("src",b._EPADashboard_.cleanSrc(d)),a.get(0).epytsetupdone=!1,b._EPADashboard_.setupevents(a.attr("id")))},cleanSrc:function(a){return a.replace("enablejsapi=1?enablejsapi=1","enablejsapi=1")},loadYTAPI:function(){if("undefined"===
|
12 |
+
typeof b.YT){if("never"!==b._EPYT_.ytapi_load&&("always"===b._EPYT_.ytapi_load||c('iframe[src*="youtube.com/embed/"], iframe[data-src*="youtube.com/embed/"], .__youtube_prefs__').length)){var a=document.createElement("script");a.src="https://www.youtube.com/iframe_api";a.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(a)}}else if(b.YT.loaded)if(b._EPYT_.pageLoaded)b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API available");else c(b).on("load._EPYT_",function(){b._EPADashboard_.apiInit();
|
13 |
+
b._EPADashboard_.log("YT API available 2")})},pageReady:function(){b._EPYT_.not_live_on_channel&&"never"!==b._EPYT_.ytapi_load&&c(".epyt-live-channel").each(function(){c(this).data("eypt-fallback")||(c(this).data("eypt-fallback",!0),c(this).css("opacity",0),setTimeout(function(){c(".epyt-live-channel").css("opacity",1)},4E3))});c(".epyt-gallery").each(function(){var a=c(this);if(!a.data("epytevents")||!c("body").hasClass("block-editor-page")){a.data("epytevents","1");var d=c(this).find("iframe, div.__youtube_prefs_gdpr__, div.epyt-facade").first(),
|
14 |
+
e=d.data("src")||d.data("facadesrc")||d.attr("src");e||=d.data("ep-src");var g=c(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid");"undefined"!==typeof e?(e=e.replace(g,"GALLERYVIDEOID"),a.data("ep-gallerysrc",e)):d.hasClass("__youtube_prefs_gdpr__")&&a.data("ep-gallerysrc","");a.on("click touchend",".epyt-gallery-list .epyt-gallery-thumb",function(f){d=a.find("iframe, div.__youtube_prefs_gdpr__, div.epyt-facade").first();if(!b._EPYT_.touchmoved&&!c(this).hasClass("epyt-current-video")){a.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");
|
15 |
+
c(this).addClass("epyt-current-video");f=c(this).data("videoid");a.data("currvid",f);var h=a.data("ep-gallerysrc").replace("GALLERYVIDEOID",f);f=a.find(".epyt-pagebutton").first().data("thumbplay");"0"!==f&&0!==f&&(h=0<h.indexOf("autoplay")?h.replace("autoplay=0","autoplay=1"):h+"&autoplay=1",d.addClass("epyt-thumbplay"));f=Math.max(c("body").scrollTop(),c("html").scrollTop());var k=d.offset().top-parseInt(_EPYT_.gallery_scrolloffset);f>k?c("html, body").animate({scrollTop:k},500,function(){b._EPADashboard_.setVidSrc(d,
|
16 |
+
h)}):b._EPADashboard_.setVidSrc(d,h)}}).on("touchmove",function(f){b._EPYT_.touchmoved=!0}).on("touchstart",function(){b._EPYT_.touchmoved=!1}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(f){var h=f.which;if(13===h||32===h)f.preventDefault(),c(this).trigger("click")});a.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){c(this).addClass("hover")});a.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){c(this).removeClass("hover")});
|
17 |
+
a.on("click touchend",".epyt-pagebutton",function(f){if(!b._EPYT_.touchmoved&&!a.find(".epyt-gallery-list").hasClass("epyt-loading")){a.find(".epyt-gallery-list").addClass("epyt-loading");var h="undefined"!==typeof f.originalEvent;f={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:c(this).data("playlistid"),pageToken:c(this).data("pagetoken"),pageSize:c(this).data("pagesize"),columns:c(this).data("epcolumns"),showTitle:c(this).data("showtitle"),showPaging:c(this).data("showpaging"),
|
18 |
+
autonext:c(this).data("autonext"),thumbplay:c(this).data("thumbplay")}};var k=c(this).hasClass("epyt-next"),n=parseInt(a.data("currpage")+"");a.data("currpage",n+(k?1:-1));c.post(_EPYT_.ajaxurl,f,function(l){a.find(".epyt-gallery-list").html(l);a.find(".epyt-current").each(function(){c(this).text(a.data("currpage"))});a.find('.epyt-gallery-thumb[data-videoid="'+a.data("currvid")+'"]').addClass("epyt-current-video");"1"!=a.find(".epyt-pagebutton").first().data("autonext")||h||a.find(".epyt-gallery-thumb").first().trigger("click")}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){a.find(".epyt-gallery-list").removeClass("epyt-loading");
|
19 |
+
if("1"!=a.find(".epyt-pagebutton").first().data("autonext")){var l=Math.max(c("body").scrollTop(),c("html").scrollTop()),m=a.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset);l>m&&c("html, body").animate({scrollTop:m},500)}})}}).on("touchmove",function(f){b._EPYT_.touchmoved=!0}).on("touchstart",function(){b._EPYT_.touchmoved=!1})}});c(".__youtube_prefs_gdpr__.epyt-is-override").each(function(){c(this).parent(".wp-block-embed__wrapper").addClass("epyt-is-override__wrapper")});
|
20 |
+
c("button.__youtube_prefs_gdpr__").on("click",function(a){a.preventDefault();c.cookie&&(c.cookie("ytprefs_gdpr_consent","1",{expires:30,path:"/"}),b.top.location.reload())});c("img.epyt-facade-poster").on("load.epyt",function(){this.epytFacadeCount=this.epytFacadeCount?this.epytFacadeCount+1:1;if(200>this.naturalHeight){var a=c(this).attr("src");a&&c(this).attr("src",a.replace("maxresdefault","hqdefault"))}3<this.epytFacadeCount&&c(this).off("load.epyt")}).on("error",function(){var a=c(this).attr("src");
|
21 |
+
a&&c(this).attr("src",a.replace("maxresdefault","hqdefault"))}).each(function(){this.complete&&c(this).trigger("load")});c(".epyt-facade-play").each(function(){c(this).find("svg").length||c(this).append('<svg data-no-lazy="1" height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-large-play-button-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"></path><path d="M 45,24 27,14 27,34" fill="#fff"></path></svg>')});
|
22 |
+
c(".epyt-facade-poster[data-facadeoembed]").each(function(){var a=c(this),d="https://www.youtube.com/"+a.data("facadeoembed");c.get("https://youtube.com/oembed",{url:d,format:"json"},function(e){a.attr("src",e.thumbnail_url.replace("hqdefault","maxresdefault"))},"json").fail(function(){}).always(function(){})});c(document).on("click",".epyt-facade",function(a){a=c(this);var d=a.attr("data-facadesrc");d=b._EPADashboard_.cleanSrc(d);for(var e=document.createElement("iframe"),g=0;g<this.attributes.length;g++){var f=
|
23 |
+
this.attributes[g];(0<=["allow","class","height","id","width"].indexOf(f.name.toLowerCase())||0==f.name.toLowerCase().indexOf("data-"))&&c(e).attr(f.name,f.value)}c(e).removeClass("epyt-facade");c(e).attr("allowfullscreen","").attr("title",a.find("img").attr("alt")).attr("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture");b._EPADashboard_.loadYTAPI();a.replaceWith(e);c(e).attr("src",d);b._EPADashboard_.setupevents(c(e).attr("id"));setTimeout(function(){c.fn.fitVidsEP&&
|
24 |
+
c(c(e).parent()).fitVidsEP()},1)})}});b.onYouTubeIframeAPIReady="undefined"!==typeof b.onYouTubeIframeAPIReady?b.onYouTubeIframeAPIReady:function(){if(b._EPYT_.pageLoaded)b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API ready");else c(b).on("load._EPYT_",function(){b._EPADashboard_.apiInit();b._EPADashboard_.log("YT API ready 2")})};(!b._EPYT_.facade_mode||b._EPYT_.not_live_on_channel&&c('iframe[src*="youtube.com/embed/live_stream"], iframe[data-src*="youtube.com/embed/live_stream"]').length)&&
|
25 |
+
b._EPADashboard_.loadYTAPI();if(b._EPYT_.pageLoaded)b._EPADashboard_.doubleCheck();else c(b).on("load._EPYT_",function(){b._EPADashboard_.doubleCheck()});c(document).ready(function(){b._EPADashboard_.pageReady();(!b._EPYT_.facade_mode||b._EPYT_.not_live_on_channel&&c('iframe[src*="youtube.com/embed/live_stream"], iframe[data-src*="youtube.com/embed/live_stream"]').length)&&b._EPADashboard_.loadYTAPI();if(b._EPYT_.ajax_compat)c(b).on("load._EPYT_",function(){c(document).ajaxSuccess(function(a,d,e){d&&
|
26 |
+
d.responseText&&(-1!==d.responseText.indexOf("<iframe ")||-1!==d.responseText.indexOf("enablejsapi"))&&(b._EPADashboard_.loadYTAPI(),b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API AJAX"),b._EPADashboard_.pageReady())})})})})(window,jQuery);
|
youtube.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Embed Plus Plugin for YouTube
|
4 |
Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
|
5 |
Description: YouTube Embed Plugin. Embed a YouTube channel gallery, playlist gallery, YouTube live stream. Lite embeds with defer JavaScript and facade options
|
6 |
-
Version: 14.1.
|
7 |
Author: Embed Plus for YouTube Team
|
8 |
Author URI: https://www.embedplus.com
|
9 |
Requires at least: 4.5
|
@@ -35,7 +35,7 @@ class YouTubePrefs
|
|
35 |
|
36 |
public static $folder_name = 'youtube-embed-plus';
|
37 |
public static $curltimeout = 30;
|
38 |
-
public static $version = '14.1.
|
39 |
public static $opt_version = 'version';
|
40 |
public static $optembedwidth = null;
|
41 |
public static $optembedheight = null;
|
@@ -1865,7 +1865,7 @@ class YouTubePrefs
|
|
1865 |
public static function fitvids()
|
1866 |
{
|
1867 |
$loggedin = current_user_can('edit_posts');
|
1868 |
-
if (!($loggedin && self::$alloptions[self::$opt_admin_off_scripts]))
|
1869 |
{
|
1870 |
wp_enqueue_script('__ytprefsfitvids__', plugins_url('scripts/fitvids' . self::$min . '.js', __FILE__), array('__ytprefs__'), self::$version, true);
|
1871 |
}
|
@@ -2880,7 +2880,7 @@ class YouTubePrefs
|
|
2880 |
$code_iframe1 = '<div ' . $centercode . ' id="_ytid_' . $iframe_id . '" ' . $dim_attrs . ' data-origwidth="' . self::$defaultwidth . '" data-origheight="' . self::$defaultheight . '" ' . $relstop .
|
2881 |
'data-facadesrc="https://www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
|
2882 |
$code_iframe2 = '" class="__youtube_prefs__ epyt-facade' . (!empty($finalparams['live_stream']) ? ' epyt-live-channel ' : '') . ($iscontent ? '' : ' __youtube_prefs_widget__ ') . ($isoverride ? ' epyt-is-override ' : '') . ' no-lazyload"' .
|
2883 |
-
$voloutput . $galleryid_ifm_data . $facade_autoplay . '><img class="epyt-facade-poster" loading="lazy" ' . $acctitle . $facade_img_src . ' />' .
|
2884 |
'<button class="epyt-facade-play" aria-label="Play"><svg data-no-lazy="1" height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-large-play-button-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"></path><path d="M 45,24 27,14 27,34" fill="#fff"></path></svg></button>' .
|
2885 |
'</div>';
|
2886 |
}
|
@@ -3263,7 +3263,7 @@ class YouTubePrefs
|
|
3263 |
$new_pointer_content = '<h3>' . __('New Update') . '</h3>'; // ooopointer
|
3264 |
|
3265 |
$new_pointer_content .= '<p>'; // ooopointer
|
3266 |
-
$new_pointer_content .= "This update provides
|
3267 |
if (self::vi_logged_in())
|
3268 |
{
|
3269 |
$new_pointer_content .= "<br><br><strong>Note:</strong> You are currently logged into the vi intelligence feature. vi support is being deprecated in the next version, so we recommend taking the vi ads down from your site. Please contact ext@embedplus.com for questions.";
|
@@ -8611,7 +8611,11 @@ margin: 0 auto;
|
|
8611 |
// backend styels
|
8612 |
self::ytprefsscript();
|
8613 |
self::fitvids();
|
8614 |
-
|
|
|
|
|
|
|
|
|
8615 |
if (!self::is_restrict_wizard() && current_user_can('edit_posts'))
|
8616 |
{
|
8617 |
// Scripts.
|
3 |
Plugin Name: Embed Plus Plugin for YouTube
|
4 |
Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
|
5 |
Description: YouTube Embed Plugin. Embed a YouTube channel gallery, playlist gallery, YouTube live stream. Lite embeds with defer JavaScript and facade options
|
6 |
+
Version: 14.1.3
|
7 |
Author: Embed Plus for YouTube Team
|
8 |
Author URI: https://www.embedplus.com
|
9 |
Requires at least: 4.5
|
35 |
|
36 |
public static $folder_name = 'youtube-embed-plus';
|
37 |
public static $curltimeout = 30;
|
38 |
+
public static $version = '14.1.3';
|
39 |
public static $opt_version = 'version';
|
40 |
public static $optembedwidth = null;
|
41 |
public static $optembedheight = null;
|
1865 |
public static function fitvids()
|
1866 |
{
|
1867 |
$loggedin = current_user_can('edit_posts');
|
1868 |
+
if (!($loggedin && self::$alloptions[self::$opt_admin_off_scripts]) && (self::$alloptions[self::$opt_responsive] || self::$alloptions[self::$opt_widgetfit]))
|
1869 |
{
|
1870 |
wp_enqueue_script('__ytprefsfitvids__', plugins_url('scripts/fitvids' . self::$min . '.js', __FILE__), array('__ytprefs__'), self::$version, true);
|
1871 |
}
|
2880 |
$code_iframe1 = '<div ' . $centercode . ' id="_ytid_' . $iframe_id . '" ' . $dim_attrs . ' data-origwidth="' . self::$defaultwidth . '" data-origheight="' . self::$defaultheight . '" ' . $relstop .
|
2881 |
'data-facadesrc="https://www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
|
2882 |
$code_iframe2 = '" class="__youtube_prefs__ epyt-facade' . (!empty($finalparams['live_stream']) ? ' epyt-live-channel ' : '') . ($iscontent ? '' : ' __youtube_prefs_widget__ ') . ($isoverride ? ' epyt-is-override ' : '') . ' no-lazyload"' .
|
2883 |
+
$voloutput . $galleryid_ifm_data . $facade_autoplay . '><img class="epyt-facade-poster skip-lazy" loading="lazy" ' . $acctitle . $facade_img_src . ' />' .
|
2884 |
'<button class="epyt-facade-play" aria-label="Play"><svg data-no-lazy="1" height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-large-play-button-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"></path><path d="M 45,24 27,14 27,34" fill="#fff"></path></svg></button>' .
|
2885 |
'</div>';
|
2886 |
}
|
3263 |
$new_pointer_content = '<h3>' . __('New Update') . '</h3>'; // ooopointer
|
3264 |
|
3265 |
$new_pointer_content .= '<p>'; // ooopointer
|
3266 |
+
$new_pointer_content .= "This update provides better compatibility with Jetpack, and further avoids unused javascript for facade mode in free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions</a>.";
|
3267 |
if (self::vi_logged_in())
|
3268 |
{
|
3269 |
$new_pointer_content .= "<br><br><strong>Note:</strong> You are currently logged into the vi intelligence feature. vi support is being deprecated in the next version, so we recommend taking the vi ads down from your site. Please contact ext@embedplus.com for questions.";
|
8611 |
// backend styels
|
8612 |
self::ytprefsscript();
|
8613 |
self::fitvids();
|
8614 |
+
if (!empty(self::$alloptions[self::$opt_not_live_on_channel]))
|
8615 |
+
{
|
8616 |
+
add_action("admin_print_footer_scripts", array(get_class(), 'live_fallback_template'));
|
8617 |
+
}
|
8618 |
+
|
8619 |
if (!self::is_restrict_wizard() && current_user_can('edit_posts'))
|
8620 |
{
|
8621 |
// Scripts.
|