Version Description
Download this release
Release Info
Developer | embedplus |
Plugin | YouTube |
Version | 13.0 |
Comparing to | |
See all releases |
Code changes from version 12.2 to 13.0
- dist/blocks.build.js +1 -0
- dist/blocks.editor.build.css +1 -0
- dist/blocks.style.build.css +0 -0
- images/ss-vi-wizbutton.png +0 -0
- images/ss-wiz-classic.png +0 -0
- images/ss-wiz-gbblock.png +0 -0
- images/ss-wiz-gbclassicblock.png +0 -0
- images/ss-wiz-widget.png +0 -0
- images/vi-demand-estimates.png +0 -0
- includes/gutenberg/gutenberg_hooks.php +13 -0
- includes/vi/vi_registration_form.php +1 -1
- readme.txt +13 -7
- scripts/epyt_mce_wizard_button.js +29 -0
- scripts/epyt_mce_wizard_button.min.js +2 -0
- scripts/ytprefs-admin.js +25 -1
- scripts/ytprefs-admin.min.js +1 -1
- scripts/ytprefs-wizard.js +34 -1
- scripts/ytprefs-wizard.min.js +1 -1
- scripts/ytprefs.js +121 -116
- scripts/ytprefs.min.js +1 -1
- src/block/block.js +239 -0
- src/block/editor.scss +62 -0
- src/block/style.scss +6 -0
- src/blocks.js +13 -0
- src/common.scss +13 -0
- src/viblock/block.js +194 -0
- src/viblock/editor.scss +6 -0
- src/viblock/style.scss +6 -0
- styles/epyt_mce_wizard_button.css +7 -0
- styles/epyt_mce_wizard_button.min.css +2 -0
- styles/ytvi-admin.css +2 -2
- styles/ytvi-admin.min.css +1 -1
- youtube.php +232 -45
dist/blocks.build.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t){function n(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=n},function(e,t,n){var o=n(9),r="object"==typeof self&&self&&self.Object===Object&&self,c=o||r||Function("return this")();e.exports=c},function(e,t,n){var o=n(1),r=o.Symbol;e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(4),n(17)},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function c(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(5),l=(n.n(i),n(6)),a=(n.n(l),n(7)),s=n.n(a),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),p=wp.i18n.__,m=wp.blocks.registerBlockType,f=wp.element,d=f.Component,w=f.Fragment,v=wp.components,y=v.ServerSideRender,b=v.Button,h=v.Modal;m("epyt/youtube",{title:p("YouTube Wizard"),icon:wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 292.89 282.69"},wp.element.createElement("title",null,"YouTube Wizard Icon"),wp.element.createElement("g",{id:"Layer_2","data-name":"Layer 2"},wp.element.createElement("g",{id:"\u0421\u043b\u043e\u0439_1","data-name":"\u0421\u043b\u043e\u0439 1"},wp.element.createElement("g",{id:"g5360"},wp.element.createElement("g",{id:"g4167"},wp.element.createElement("path",{id:"path4156",className:"epytcls-1",d:"M139.27,87.65s-87.11,0-109,5.68A36,36,0,0,0,5.68,118.12C0,140,0,185.26,0,185.26s0,45.44,5.68,67A35.47,35.47,0,0,0,30.3,276.84c22,5.85,109,5.85,109,5.85s87.28,0,109.14-5.68a34.64,34.64,0,0,0,24.44-24.62c5.86-21.69,5.86-67,5.86-67s.17-45.45-5.86-67.31a34.41,34.41,0,0,0-24.44-24.45C226.55,87.65,139.27,87.65,139.27,87.65Zm-27.72,55.77L184,185.26l-72.48,41.65V143.42Z"}))),wp.element.createElement("path",{className:"epytcls-2",d:"M143.39,153.45c10.52-19.27,14.91-39.2,19.18-58.61q.68-3,1.33-6l.12-.54-.25-.48c-13.87-26.66-41.06-52.54-57.1-66.42,21,11.33,60,31.21,84,36.13l.63.13.53-.37c4.14-2.92,8.28-5.7,12.28-8.4,13.41-9,26.27-17.67,38.31-30.64-10.26,20.67-14.18,40.47-18.14,64.42l-.09.58.32.48c18.19,27.91,40.93,50.88,54.81,63.7C261.68,137.5,230,121.76,197,115.29l-.57-.12-3.83,2.35C176,127.67,159,138.08,143.39,153.45Z"}),wp.element.createElement("path",{className:"epytcls-3",d:"M237.47,25.4c-7.73,18.08-11.19,36-14.67,57l-.19,1.15.64,1c15,23,33.15,42.76,46.87,56.19-18.4-9.59-45.13-21.49-72.87-26.93l-1.15-.22-1,.61-3.33,2c-14.47,8.86-29.26,17.93-43.24,30.34,7.94-17,11.77-34.43,15.51-51.43q.66-3,1.33-6l.24-1.06-.51-1c-11.66-22.4-32.12-43.86-48-58.48C139,40,170,54.82,190.37,59l1.27.26,1.06-.74c4.12-2.91,8.25-5.69,12.25-8.38,11.27-7.59,22.16-14.91,32.52-24.74M254.86,0l-.74,1.11L254.86,0Zm-.74,1.11C235.26,28.88,213.71,40,191,56.06c-33.55-6.88-97.91-43.92-97.91-43.92s49,37.13,69.38,76.37c-6,26.61-11,54.9-31.35,80.94,19.83-25.28,42.66-38.61,65.58-52.69,50.06,9.8,96.22,40.55,96.22,40.55s-38.84-31-67.13-74.4c4.89-29.58,9.81-54,28.36-81.8Z"}),wp.element.createElement("polyline",{className:"epytcls-4",points:"102.6 133.11 102.6 133.11 192.98 185.28 102.6 237.22 102.6 133.11"})))),category:"embed",keywords:[p("gallery"),p("live"),p("video")],description:p("Embed a video, playlist, channel, gallery, or live stream."),attributes:{shortcode:{type:"string",default:""}},edit:function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return n.state={show:!1},n.showModal=function(){n.setState({show:!0})},n.hideModal=function(){n.setState({show:!1})},n.onMessage=function(e){try{if(0===e.data.indexOf("youtubeembedplus")&&e.data.indexOf(n.props.clientId)>0){var t="";t=e.data.split("|")[1],n.props.setAttributes({shortcode:t.toString()}),n.hideModal(),n.gbPreviewSetup("onMessage")}}catch(e){}},n.gbPreviewSetup=s()(function(e){setTimeout(function(){window._EPYTA_.gbPreviewSetup()},1500)},50),n.props=e,n}return c(t,e),u(t,[{key:"componentDidMount",value:function(){window.addEventListener("message",this.onMessage),this.gbPreviewSetup("componentDidMount")}},{key:"componentDidUpdate",value:function(){this.gbPreviewSetup("componentDidUpdate")}},{key:"componentWillUnmount",value:function(){window.removeEventListener("message",this.onMessage)}},{key:"render",value:function(){if(this.props.attributes.shortcode){return wp.element.createElement(y,{block:"epyt/youtube",attributes:this.props.attributes})}return wp.element.createElement("div",{className:"components-placeholder editor-media-placeholder wp-block-image epytblock"},wp.element.createElement("div",{className:"components-placeholder__label"},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 292.89 282.69",width:"20",height:"20",className:"dashicon"},wp.element.createElement("title",null,"YouTube Wizard Icon"),wp.element.createElement("g",{id:"Layer_2","data-name":"Layer 2"},wp.element.createElement("g",{id:"\u0421\u043b\u043e\u0439_1","data-name":"\u0421\u043b\u043e\u0439 1"},wp.element.createElement("g",{id:"g5360"},wp.element.createElement("g",{id:"g4167"},wp.element.createElement("path",{id:"path4156",className:"epytcls-1",d:"M139.27,87.65s-87.11,0-109,5.68A36,36,0,0,0,5.68,118.12C0,140,0,185.26,0,185.26s0,45.44,5.68,67A35.47,35.47,0,0,0,30.3,276.84c22,5.85,109,5.85,109,5.85s87.28,0,109.14-5.68a34.64,34.64,0,0,0,24.44-24.62c5.86-21.69,5.86-67,5.86-67s.17-45.45-5.86-67.31a34.41,34.41,0,0,0-24.44-24.45C226.55,87.65,139.27,87.65,139.27,87.65Zm-27.72,55.77L184,185.26l-72.48,41.65V143.42Z"}))),wp.element.createElement("path",{className:"epytcls-2",d:"M143.39,153.45c10.52-19.27,14.91-39.2,19.18-58.61q.68-3,1.33-6l.12-.54-.25-.48c-13.87-26.66-41.06-52.54-57.1-66.42,21,11.33,60,31.21,84,36.13l.63.13.53-.37c4.14-2.92,8.28-5.7,12.28-8.4,13.41-9,26.27-17.67,38.31-30.64-10.26,20.67-14.18,40.47-18.14,64.42l-.09.58.32.48c18.19,27.91,40.93,50.88,54.81,63.7C261.68,137.5,230,121.76,197,115.29l-.57-.12-3.83,2.35C176,127.67,159,138.08,143.39,153.45Z"}),wp.element.createElement("path",{className:"epytcls-3",d:"M237.47,25.4c-7.73,18.08-11.19,36-14.67,57l-.19,1.15.64,1c15,23,33.15,42.76,46.87,56.19-18.4-9.59-45.13-21.49-72.87-26.93l-1.15-.22-1,.61-3.33,2c-14.47,8.86-29.26,17.93-43.24,30.34,7.94-17,11.77-34.43,15.51-51.43q.66-3,1.33-6l.24-1.06-.51-1c-11.66-22.4-32.12-43.86-48-58.48C139,40,170,54.82,190.37,59l1.27.26,1.06-.74c4.12-2.91,8.25-5.69,12.25-8.38,11.27-7.59,22.16-14.91,32.52-24.74M254.86,0l-.74,1.11L254.86,0Zm-.74,1.11C235.26,28.88,213.71,40,191,56.06c-33.55-6.88-97.91-43.92-97.91-43.92s49,37.13,69.38,76.37c-6,26.61-11,54.9-31.35,80.94,19.83-25.28,42.66-38.61,65.58-52.69,50.06,9.8,96.22,40.55,96.22,40.55s-38.84-31-67.13-74.4c4.89-29.58,9.81-54,28.36-81.8Z"}),wp.element.createElement("polyline",{className:"epytcls-4",points:"102.6 133.11 102.6 133.11 192.98 185.28 102.6 237.22 102.6 133.11"})))),"YouTube Wizard"),wp.element.createElement("div",{className:this.props.isSelected?"":"epytblock__faded--off"},wp.element.createElement("div",{className:"components-placeholder__instructions"},"Click the button below to easily embed a video, playlist, channel, gallery, or live stream."),wp.element.createElement("div",{className:"components-placeholder__fieldset"},wp.element.createElement("div",null,wp.element.createElement(b,{isDefault:!0,onClick:this.showModal},"Open Wizard"),this.state.show?wp.element.createElement(h,{title:"YouTube Wizard",className:"epytblock epytblock__modal",onRequestClose:this.hideModal},wp.element.createElement("iframe",{title:"YouTube Wizard",src:window._EPYTA_.wizhref+"&clientId="+this.props.clientId})):null))))}}]),t}(d),save:function(e){return wp.element.createElement(w,null,e.attributes.shortcode)}})},function(e,t){},function(e,t){},function(e,t,n){function o(e,t,n){function o(t){var n=b,o=h;return b=h=void 0,j=t,_=e.apply(o,n)}function u(e){return j=e,E=setTimeout(f,t),O?o(e):_}function p(e){var n=e-x,o=e-j,r=t-n;return T?s(r,g-o):r}function m(e){var n=e-x,o=e-j;return void 0===x||n>=t||n<0||T&&o>=g}function f(){var e=c();if(m(e))return d(e);E=setTimeout(f,p(e))}function d(e){return E=void 0,C&&b?o(e):(b=h=void 0,_)}function w(){void 0!==E&&clearTimeout(E),j=0,b=x=h=E=void 0}function v(){return void 0===E?_:d(c())}function y(){var e=c(),n=m(e);if(b=arguments,h=this,x=e,n){if(void 0===E)return u(x);if(T)return E=setTimeout(f,t),o(x)}return void 0===E&&(E=setTimeout(f,t)),_}var b,h,g,_,E,x,j=0,O=!1,T=!1,C=!0;if("function"!=typeof e)throw new TypeError(l);return t=i(t)||0,r(n)&&(O=!!n.leading,T="maxWait"in n,g=T?a(i(n.maxWait)||0,t):g,C="trailing"in n?!!n.trailing:C),y.cancel=w,y.flush=v,y}var r=n(0),c=n(8),i=n(11),l="Expected a function",a=Math.max,s=Math.min;e.exports=o},function(e,t,n){var o=n(1),r=function(){return o.Date.now()};e.exports=r},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(t,n(10))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){function o(e){if("number"==typeof e)return e;if(c(e))return i;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=s.test(e);return n||u.test(e)?p(e.slice(2),n?2:8):a.test(e)?i:+e}var r=n(0),c=n(12),i=NaN,l=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,p=parseInt;e.exports=o},function(e,t,n){function o(e){return"symbol"==typeof e||c(e)&&r(e)==i}var r=n(13),c=n(16),i="[object Symbol]";e.exports=o},function(e,t,n){function o(e){return null==e?void 0===e?a:l:s&&s in Object(e)?c(e):i(e)}var r=n(2),c=n(14),i=n(15),l="[object Null]",a="[object Undefined]",s=r?r.toStringTag:void 0;e.exports=o},function(e,t,n){function o(e){var t=i.call(e,a),n=e[a];try{e[a]=void 0;var o=!0}catch(e){}var r=l.call(e);return o&&(t?e[a]=n:delete e[a]),r}var r=n(2),c=Object.prototype,i=c.hasOwnProperty,l=c.toString,a=r?r.toStringTag:void 0;e.exports=o},function(e,t){function n(e){return r.call(e)}var o=Object.prototype,r=o.toString;e.exports=n},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function c(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(18),l=(n.n(i),n(19)),a=(n.n(l),function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}()),s=wp.i18n.__,u=wp.blocks.registerBlockType,p=wp.element,m=p.Component,f=p.Fragment;u("epyt/vi",{title:s("Video Ad"),icon:wp.element.createElement("svg",{version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 485.6 485.6",style:{enableBackground:"new 0 0 485.6 485.6"},xmlSpace:"preserve"},wp.element.createElement("g",null,wp.element.createElement("g",null,wp.element.createElement("path",{fill:"#0ECAD4",d:"M301.5,368l-0.8-1.3c-6.7-10.5-5.8-23,2.3-32.7c1.2-1.4,2.4-2.8,4-4.5c4.8-4.8,12.4-11.3,23.4-11.3 c6.7,0,13.3,2.4,20,7.4c10.5,7.7,20.9,15.9,30.9,23.6c2,1.5,3.9,3,5.9,4.5c1.5-1.7,2.9-3.5,4.5-5.1c10.4-11.9,20.6-23.9,30.9-35.8 c5.6-19.2,8.7-39.5,8.7-60.6c0-119-96.6-215.6-215.6-215.6C96.6,36.8,0,133.4,0,252.4S96.6,468,215.6,468 c48.3,0,93-15.9,128.9-42.8c-11.5-15-23.2-30-34.6-45C306.7,376.2,304,372,301.5,368z M287,341.6c-10.4,12.7-24,21.2-39.9,25.5 c-7,1.9-10,5.6-9.6,12.8c0.3,7.1,0,14.2,0,21.2c0,6.3-3.2,9.6-9.4,9.9c-7.5,0.2-15.2,0.2-22.9,0c-6.6-0.1-9.7-3.9-9.9-10.4 c-0.1-5.1-0.1-10.3-0.1-15.4c-0.1-11.4-0.5-11.8-11.5-13.6c-14-2.2-27.7-5.5-40.6-11.6c-10.1-4.9-11.1-7.4-8.2-18 c2.2-7.9,4.3-15.8,6.7-23.6c2.8-9.1,5.2-10.2,13.6-5.8c14.2,7.4,29.2,11.5,45,13.5c10.2,1.3,20.1,0.2,29.6-3.8 c17.5-7.7,20.3-28.1,5.5-40.3c-5.1-4.2-10.8-7.2-16.8-9.9c-15.4-6.7-31.5-12-46.1-20.7c-23.7-14.2-38.7-33.5-36.9-62.3 c2-32.5,20.3-52.8,50.1-63.6c12.3-4.5,12.3-4.3,12.4-17.2c0-4.3,0-8.7,0-13c0.2-9.7,1.9-11.4,11.5-11.6c3-0.1,6,0,8.9,0 c20.5,0,20.5,0,20.7,20.5c0.1,14.5,0,14.6,14.5,16.8c11.1,1.7,21.7,5,31.9,9.5c5.7,2.4,7.8,6.5,6,12.4c-2.6,8.8-5,17.8-7.8,26.6 c-2.7,8.4-5.3,9.5-13.3,5.7c-16-7.8-32.8-11-50.6-10c-4.6,0.2-9.2,0.9-13.5,2.8c-15.3,6.7-17.8,23.6-4.8,34 c6.6,5.2,14.2,9.1,21.9,12.3c13.6,5.6,27.2,11,40,18.1C304.8,255,315.9,306.4,287,341.6z"}),wp.element.createElement("path",{fill:"#0ECAD4",d:"M480.3,302c-4.8-3.9-8.1-5.9-11.1-5.9c-3.4,0-6.4,2.6-11,7.9c-23.2,26.9-29.5,34.3-52.8,61.2 c-5.2,6-10.4,12-15.8,18.2c-2.7-2.1-5.2-4-7.7-6c-13.7-10.6-27.2-21.3-41-31.6c-3.1-2.3-5.7-3.5-8.1-3.5c-3,0-5.8,1.8-9.2,5.3 c-1,1-1.8,2-2.7,3.1c-2.5,3-2.9,6.2-0.8,9.5c2.5,3.9,5,7.9,7.8,11.6c18.3,23.8,36.6,47.5,55,71.3c2.2,2.9,4.8,4.4,7.4,4.4 c2.8,0,5.6-1.7,8-5.2c33.7-48.2,50.3-71.9,83.9-120.1C487.3,314.9,486.9,307.5,480.3,302z"})))),category:"embed",keywords:[s("video"),s("story"),s("ad")],description:s("Video ad powered by vi intelligence."),supports:{multiple:!1},attributes:{shortcode:{type:"string",default:"[embed-vi-ad]"}},edit:function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return n.props=e,n}return c(t,e),a(t,[{key:"render",value:function(){return this.props.attributes.shortcode?wp.element.createElement("div",{className:"vi-story-demo--box"},wp.element.createElement("div",{className:"vi-story-demo--screen"},wp.element.createElement("span",null,"AD + CONTENT")),wp.element.createElement("div",{className:"vi-story-demo--info",style:{backgroundColor:window._EPYTA_.vi_js_settings.backgroundColor}},wp.element.createElement("div",{className:"vi-story-demo--title",style:{fontFamily:window._EPYTA_.vi_js_settings.font,fontSize:window._EPYTA_.vi_js_settings.fontSize,color:window._EPYTA_.vi_js_settings.textColor}},"Example vi Story Title Text"),wp.element.createElement("div",{className:"vi-story-demo--featured",style:{color:window._EPYTA_.vi_js_settings.textColor}},wp.element.createElement("span",{style:{color:window._EPYTA_.vi_js_settings.textColor}},"featured by")," ",wp.element.createElement("img",{alt:"vi logo",src:window._EPYT_.eppath+"images/vi_logo.svg"})))):null}}]),t}(m),save:function(e){return wp.element.createElement(f,null,e.attributes.shortcode)}})},function(e,t){},function(e,t){}]);
|
dist/blocks.editor.build.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.components-modal__frame.epytblock__modal{position:absolute;top:25px;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:950px;max-width:90%;height:calc(100vh - 50px);max-height:calc(100vh - 50px)}.components-modal__frame.epytblock__modal .components-modal__header{margin:0}.components-modal__frame.epytblock__modal .components-modal__content{padding:0}.components-modal__frame.epytblock__modal iframe{width:100%;height:calc(100% - 60px);display:block}.epytblock .components-placeholder__fieldset{max-width:100%}
|
dist/blocks.style.build.css
ADDED
File without changes
|
images/ss-vi-wizbutton.png
CHANGED
Binary file
|
images/ss-wiz-classic.png
ADDED
Binary file
|
images/ss-wiz-gbblock.png
ADDED
Binary file
|
images/ss-wiz-gbclassicblock.png
ADDED
Binary file
|
images/ss-wiz-widget.png
ADDED
Binary file
|
images/vi-demand-estimates.png
DELETED
Binary file
|
includes/gutenberg/gutenberg_hooks.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Hook: Frontend assets.
|
4 |
+
add_action('enqueue_block_assets', array(get_class(), 'gb_block_assets'));
|
5 |
+
|
6 |
+
// Hook: Editor assets.
|
7 |
+
add_action('enqueue_block_editor_assets', array(get_class(), 'gb_editor_assets'));
|
8 |
+
|
9 |
+
add_action('admin_footer', array(get_class(), 'gb_svg_defs'));
|
10 |
+
|
11 |
+
add_action('init', array(get_class(), 'gb_register_block_types'));
|
12 |
+
|
13 |
+
add_action('admin_init', array(get_class(), 'gb_classic_block_setup'));
|
includes/vi/vi_registration_form.php
CHANGED
@@ -79,7 +79,7 @@
|
|
79 |
</div>
|
80 |
<div class="side-login ytprefs-ajax-form">
|
81 |
<h1>Log in to vi</h1>
|
82 |
-
<h2>Join
|
83 |
<p class="description">Already signed up? Login here using the info from your welcome email.</p>
|
84 |
<p>
|
85 |
<input class="textinput regular-text ytvi-login-email" type="text" placeholder="Your email" />
|
79 |
</div>
|
80 |
<div class="side-login ytprefs-ajax-form">
|
81 |
<h1>Log in to vi</h1>
|
82 |
+
<h2>Join 40,000+ publishers</h2>
|
83 |
<p class="description">Already signed up? Login here using the info from your welcome email.</p>
|
84 |
<p>
|
85 |
<input class="textinput regular-text ytvi-login-email" type="text" placeholder="Your email" />
|
readme.txt
CHANGED
@@ -2,18 +2,19 @@
|
|
2 |
Contributors: embedplus
|
3 |
Plugin Name: YouTube Embed
|
4 |
Tags: youtube gallery, video gallery, youtube channel, youtube live, live stream
|
5 |
-
Requires at least:
|
6 |
-
Tested up to:
|
7 |
-
Stable tag:
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, or YouTube.com live stream (with GDPR options)
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
**Your WordPress YouTube embed, YouTube gallery (channel and playlist), and even YouTube live stream can be customized in a wide variety of ways with this plugin. Here are a few recently added features
|
15 |
|
16 |
-
*
|
|
|
17 |
* YouTube gallery capability (channel and playlist) – The ability to make playlist and channel embeds have a gallery layout. By default, the plugin can generate a grid-based [responsive playlist or channel gallery >>](https://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Your visitors can browse through pages of video thumbnails and choose from videos that are pulled from an entire YouTube channel or playlist.
|
18 |
* YouTube gallery auto continuous play - embed a playlist or channel gallery and allow it to play one video after the next without requiring viewers to click a thumbnail
|
19 |
* YouTube Live Stream - Given a link to a YouTube channel, the plugin wizard automatically finds a livestream if one is active in that channel and generates the embed code for you. On the settings page, you can also set defaults of what to automatically display if a live stream is not active at a given moment. For example, you can have your site display a gallery of a channel's entire video library so that users can have something to watch in the meantime. We hope it's a time saver.
|
@@ -103,7 +104,7 @@ See more details after installing. Enjoy!
|
|
103 |
1. Use the WordPress plugin installer to install the plugin. Alternatively, you can just extract the folder in our download package and upload it to your plugin directory.
|
104 |
1. Access the Plugins admin menu to activate the YouTube embed plugin.
|
105 |
1. Make your default settings after clicking the new YouTube menu item that shows up in your admin panel.
|
106 |
-
1. To embed videos in your post,
|
107 |
1. You can also [embed a playlist and channel gallery with this plugin >>](https://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Please install the plugin and visit the settings page for instructions.
|
108 |
1. To get video SEO, an analytics dashboard and many other premium features, [sign up for one of the options here >>](https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=readme)
|
109 |
|
@@ -126,7 +127,7 @@ You can also start and end each individual video at particular times. Like the a
|
|
126 |
* start - Sets the time (in seconds) to start the video. Example: `"https://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350&start=20"`
|
127 |
* end - Sets the time (in seconds) to stop the video. Example: `"https://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350&end=100"`
|
128 |
|
129 |
-
**
|
130 |
|
131 |
* Make sure the url is really on its own line by itself. Or, if you need multiple videos on the same line, make sure each URL is wrapped properly with the shortcode. Example: `[embedyt]https://www.youtube.com/watch?v=ABCDEFGHIJK&width=400&height=250[/embedyt]`
|
132 |
* Make sure the url is not an active hyperlink (i.e., it should just be plain text). Otherwise, highlight the url and click the "unlink" button in your editor.
|
@@ -147,6 +148,11 @@ You can also start and end each individual video at particular times. Like the a
|
|
147 |
|
148 |
== Changelog ==
|
149 |
|
|
|
|
|
|
|
|
|
|
|
150 |
= WordPress YouTube Embed 12.2 =
|
151 |
* Improved ads.txt verification management
|
152 |
* Fixed gallery box-sizing bug
|
2 |
Contributors: embedplus
|
3 |
Plugin Name: YouTube Embed
|
4 |
Tags: youtube gallery, video gallery, youtube channel, youtube live, live stream
|
5 |
+
Requires at least: 4.0
|
6 |
+
Tested up to: 5.0
|
7 |
+
Stable tag: 13.0
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, or YouTube.com live stream (with GDPR options)
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
+
**Your WordPress YouTube embed, YouTube gallery (channel and playlist), and even YouTube live stream can be customized in a wide variety of ways with this plugin. Here are a few recently added features:**
|
15 |
|
16 |
+
* Compatible with the WordPress 5.0 Gutenberg block editor (it also stays backwards-compatible with the classic editor). Both the Gutenberg block selector and the Gutenberg classic block will show the YouTube wizard button. For the Gutenberg block selector, click on the (+) sign for the block editor list. The YouTube Wizard block is located under the "Embeds" category (make sure you choose "YouTube **Wizard**"). See more on [how to embed a YouTube video, gallery, or livestream with the WordPress Gutenberg block editor here >>](https://www.embedplus.com/embed-youtube-video-gallery-livestream-wordpress-gutenberg-block-editor.aspx)
|
17 |
+
* Privacy and Consent - Improved privacy and GDPR compliance options like YouTube no cookie, YouTube API restrictions, and a customizable GDPR consent message
|
18 |
* YouTube gallery capability (channel and playlist) – The ability to make playlist and channel embeds have a gallery layout. By default, the plugin can generate a grid-based [responsive playlist or channel gallery >>](https://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Your visitors can browse through pages of video thumbnails and choose from videos that are pulled from an entire YouTube channel or playlist.
|
19 |
* YouTube gallery auto continuous play - embed a playlist or channel gallery and allow it to play one video after the next without requiring viewers to click a thumbnail
|
20 |
* YouTube Live Stream - Given a link to a YouTube channel, the plugin wizard automatically finds a livestream if one is active in that channel and generates the embed code for you. On the settings page, you can also set defaults of what to automatically display if a live stream is not active at a given moment. For example, you can have your site display a gallery of a channel's entire video library so that users can have something to watch in the meantime. We hope it's a time saver.
|
104 |
1. Use the WordPress plugin installer to install the plugin. Alternatively, you can just extract the folder in our download package and upload it to your plugin directory.
|
105 |
1. Access the Plugins admin menu to activate the YouTube embed plugin.
|
106 |
1. Make your default settings after clicking the new YouTube menu item that shows up in your admin panel.
|
107 |
+
1. To embed videos in your post, uuse the wizard to embed the shortcode. Example: `[embedyt]https://www.youtube.com/watch?v=ABCDEFGHIJK&width=400&height=250[/embedyt]` If you don't know exactly which video you want to embed, use the free built-in search feature to find and insert one.
|
108 |
1. You can also [embed a playlist and channel gallery with this plugin >>](https://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Please install the plugin and visit the settings page for instructions.
|
109 |
1. To get video SEO, an analytics dashboard and many other premium features, [sign up for one of the options here >>](https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=readme)
|
110 |
|
127 |
* start - Sets the time (in seconds) to start the video. Example: `"https://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350&start=20"`
|
128 |
* end - Sets the time (in seconds) to stop the video. Example: `"https://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350&end=100"`
|
129 |
|
130 |
+
**We recommend using the wizard, but if you're manually pasting a link, always follow these rules:**
|
131 |
|
132 |
* Make sure the url is really on its own line by itself. Or, if you need multiple videos on the same line, make sure each URL is wrapped properly with the shortcode. Example: `[embedyt]https://www.youtube.com/watch?v=ABCDEFGHIJK&width=400&height=250[/embedyt]`
|
133 |
* Make sure the url is not an active hyperlink (i.e., it should just be plain text). Otherwise, highlight the url and click the "unlink" button in your editor.
|
148 |
|
149 |
== Changelog ==
|
150 |
|
151 |
+
= WordPress YouTube Embed 13.0 =
|
152 |
+
* Compatible with the new Gutenberg block editor, and stays backwards-compatible with the classic editor
|
153 |
+
* Marked deprecated features
|
154 |
+
* Improved wizard instructions
|
155 |
+
|
156 |
= WordPress YouTube Embed 12.2 =
|
157 |
* Improved ads.txt verification management
|
158 |
* Fixed gallery box-sizing bug
|
scripts/epyt_mce_wizard_button.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function ($)
|
2 |
+
{
|
3 |
+
// https://github.com/WordPress/gutenberg/issues/10509
|
4 |
+
if ($('body').hasClass('block-editor-page'))
|
5 |
+
{
|
6 |
+
tinymce.PluginManager.add('epyt_mce_wizard_button', function (editor, url)
|
7 |
+
{
|
8 |
+
editor.addButton('epyt_mce_wizard_button', {
|
9 |
+
title: 'YouTube Wizard',
|
10 |
+
icon: 'icon epyt_mce_wizard_button--icon',
|
11 |
+
onclick: function () // mousedown? touch?
|
12 |
+
{
|
13 |
+
try
|
14 |
+
{
|
15 |
+
window._EPYTA_.mceBookmark = editor.selection.getBookmark(2, true);
|
16 |
+
}
|
17 |
+
catch (err)
|
18 |
+
{
|
19 |
+
}
|
20 |
+
setTimeout(function ()
|
21 |
+
{
|
22 |
+
tb_show('YouTube Wizard', window._EPYTA_.wizhref);
|
23 |
+
window._EPYTA_.widen_ytprefs_wiz();
|
24 |
+
}, 600);
|
25 |
+
}
|
26 |
+
});
|
27 |
+
});
|
28 |
+
}
|
29 |
+
})(jQuery);
|
scripts/epyt_mce_wizard_button.min.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
|
2 |
+
(function(a){if(a("body").hasClass("block-editor-page")){tinymce.PluginManager.add("epyt_mce_wizard_button",function(c,b){c.addButton("epyt_mce_wizard_button",{title:"YouTube Wizard",icon:"icon epyt_mce_wizard_button--icon",onclick:function(){try{window._EPYTA_.mceBookmark=c.selection.getBookmark(2,true)}catch(d){}setTimeout(function(){tb_show("YouTube Wizard",window._EPYTA_.wizhref);window._EPYTA_.widen_ytprefs_wiz()},600)}})})}})(jQuery);
|
scripts/ytprefs-admin.js
CHANGED
@@ -181,6 +181,14 @@
|
|
181 |
}
|
182 |
};
|
183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
|
185 |
$.fn.ytprefsFormJSON = function ()
|
186 |
{
|
@@ -221,7 +229,7 @@
|
|
221 |
var embedcode = "";
|
222 |
try
|
223 |
{
|
224 |
-
if (e.data.indexOf("youtubeembedplus") === 0)
|
225 |
{
|
226 |
embedcode = e.data.split("|")[1];
|
227 |
if (embedcode.indexOf("[") !== 0)
|
@@ -231,6 +239,17 @@
|
|
231 |
|
232 |
if (window.tinyMCE !== null && window.tinyMCE.activeEditor !== null && !window.tinyMCE.activeEditor.isHidden())
|
233 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
if (typeof window.tinyMCE.execInstanceCommand !== 'undefined')
|
235 |
{
|
236 |
window.tinyMCE.execInstanceCommand(
|
@@ -243,6 +262,11 @@
|
|
243 |
{
|
244 |
send_to_editor(embedcode);
|
245 |
}
|
|
|
|
|
|
|
|
|
|
|
246 |
}
|
247 |
else
|
248 |
{
|
181 |
}
|
182 |
};
|
183 |
|
184 |
+
window._EPYTA_.gbPreviewSetup = function ()
|
185 |
+
{
|
186 |
+
window._EPADashboard_.loadYTAPI();
|
187 |
+
window._EPADashboard_.apiInit();
|
188 |
+
window._EPADashboard_.log("YT API GB");
|
189 |
+
window._EPADashboard_.pageReady();
|
190 |
+
jQuery('body').fitVidsEP();
|
191 |
+
};
|
192 |
|
193 |
$.fn.ytprefsFormJSON = function ()
|
194 |
{
|
229 |
var embedcode = "";
|
230 |
try
|
231 |
{
|
232 |
+
if (e.data.indexOf("youtubeembedplus") === 0 && e.data.indexOf('clientId=') < 0)
|
233 |
{
|
234 |
embedcode = e.data.split("|")[1];
|
235 |
if (embedcode.indexOf("[") !== 0)
|
239 |
|
240 |
if (window.tinyMCE !== null && window.tinyMCE.activeEditor !== null && !window.tinyMCE.activeEditor.isHidden())
|
241 |
{
|
242 |
+
if (window._EPYTA_.mceBookmark)
|
243 |
+
{
|
244 |
+
try
|
245 |
+
{
|
246 |
+
window.tinyMCE.activeEditor.selection.moveToBookmark(window._EPYTA_.mceBookmark);
|
247 |
+
}
|
248 |
+
catch (err)
|
249 |
+
{
|
250 |
+
}
|
251 |
+
}
|
252 |
+
|
253 |
if (typeof window.tinyMCE.execInstanceCommand !== 'undefined')
|
254 |
{
|
255 |
window.tinyMCE.execInstanceCommand(
|
262 |
{
|
263 |
send_to_editor(embedcode);
|
264 |
}
|
265 |
+
|
266 |
+
setTimeout(function ()
|
267 |
+
{
|
268 |
+
window._EPYTA_.mceBookmark = null;
|
269 |
+
}, 500);
|
270 |
}
|
271 |
else
|
272 |
{
|
scripts/ytprefs-admin.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
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:"",async:true}).always(function(c,g,f){if(g==="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{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")}};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 d=a[g];var c=g==="attachEvent"?"onmessage":"message";d(c,function(k){var i="";try{if(k.data.indexOf("youtubeembedplus")===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(typeof a.tinyMCE.execInstanceCommand!=="undefined"){a.tinyMCE.execInstanceCommand(a.tinyMCE.activeEditor.id,"mceInsertContent",false,i)}else{send_to_editor(i)}}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).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+'"]').click()});b(".ytprefs-ajax-form").on("keypress",function(i){if(i.which==13){i.preventDefault();b(this).find(".ytprefs-ajax-form--submit:not([disabled])").click()}});b(a).on("hashchange",function(){if(a.location.hash.length>0){$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)}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(){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+'"]').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 e=b(".iab-cat-child").val();if(e.length>0){var h=e.split("-")[0];b(".iab-cat-child-box").removeClass("hidden");b(".iab-cat-child-box select").prop("disabled",false);b('.iab-cat-parent option[value="'+h+'"]').prop("selected",true);b(".iab-cat-child option").addClass("hidden");b('.iab-cat-child option[value^="'+h+'-"], .iab-cat-child option[value="'+h+'"]').removeClass("hidden")}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+'"]').removeClass("hidden")}});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){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(){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.<br><br>To actually disable vi ads, 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(i){if(i.type==="error"){alertify.alert(i.message)}else{location.href=i.url}},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(){}})}}).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")}},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").click()}})})(window,jQuery);
|
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:"",async:true}).always(function(c,g,f){if(g==="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{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()};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 d=a[g];var c=g==="attachEvent"?"onmessage":"message";d(c,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).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+'"]').click()});b(".ytprefs-ajax-form").on("keypress",function(i){if(i.which==13){i.preventDefault();b(this).find(".ytprefs-ajax-form--submit:not([disabled])").click()}});b(a).on("hashchange",function(){if(a.location.hash.length>0){$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)}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(){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+'"]').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 e=b(".iab-cat-child").val();if(e.length>0){var h=e.split("-")[0];b(".iab-cat-child-box").removeClass("hidden");b(".iab-cat-child-box select").prop("disabled",false);b('.iab-cat-parent option[value="'+h+'"]').prop("selected",true);b(".iab-cat-child option").addClass("hidden");b('.iab-cat-child option[value^="'+h+'-"], .iab-cat-child option[value="'+h+'"]').removeClass("hidden")}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+'"]').removeClass("hidden")}});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){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(){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.<br><br>To actually disable vi ads, 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(i){if(i.type==="error"){alertify.alert(i.message)}else{location.href=i.url}},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(){}})}}).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")}},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").click()}})})(window,jQuery);
|
scripts/ytprefs-wizard.js
CHANGED
@@ -2,6 +2,38 @@ window._EPYTWIZ_ = window._EPYTWIZ_ || {};
|
|
2 |
(function ($)
|
3 |
{
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
window._EPYTWIZ_.selectText = window._EPYTWIZ_.selectText || function (ele)
|
6 |
{
|
7 |
if (document.selection)
|
@@ -123,7 +155,8 @@ window._EPYTWIZ_ = window._EPYTWIZ_ || {};
|
|
123 |
{
|
124 |
var targetdomain = window.location.toString().split("/")[0] + "//" + window.location.toString().split("/")[2];
|
125 |
var embedline = $(this).attr("rel");
|
126 |
-
|
|
|
127 |
});
|
128 |
|
129 |
$epyt_wiz_wrap.on('click', '.resultdiv .load-movie', function ()
|
2 |
(function ($)
|
3 |
{
|
4 |
|
5 |
+
$.fn.followTo = function (pos, startTop)
|
6 |
+
{
|
7 |
+
var $this = this,
|
8 |
+
$window = $(window);
|
9 |
+
|
10 |
+
$window.scroll(function (e)
|
11 |
+
{
|
12 |
+
if ($window.scrollTop() > pos)
|
13 |
+
{
|
14 |
+
$this.css({
|
15 |
+
position: 'absolute',
|
16 |
+
top: pos
|
17 |
+
});
|
18 |
+
}
|
19 |
+
else
|
20 |
+
{
|
21 |
+
$this.css({
|
22 |
+
position: 'fixed',
|
23 |
+
top: startTop
|
24 |
+
});
|
25 |
+
}
|
26 |
+
});
|
27 |
+
};
|
28 |
+
|
29 |
+
window._EPYTWIZ_.getUrlParameter = function (name)
|
30 |
+
{
|
31 |
+
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
|
32 |
+
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
|
33 |
+
var results = regex.exec(window.location.search);
|
34 |
+
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
|
35 |
+
};
|
36 |
+
|
37 |
window._EPYTWIZ_.selectText = window._EPYTWIZ_.selectText || function (ele)
|
38 |
{
|
39 |
if (document.selection)
|
155 |
{
|
156 |
var targetdomain = window.location.toString().split("/")[0] + "//" + window.location.toString().split("/")[2];
|
157 |
var embedline = $(this).attr("rel");
|
158 |
+
var gbclientId = window._EPYTWIZ_.getUrlParameter('clientId');
|
159 |
+
parent.postMessage("youtubeembedplus|" + embedline + (gbclientId ? '|clientId=' + gbclientId : ''), targetdomain);
|
160 |
});
|
161 |
|
162 |
$epyt_wiz_wrap.on('click', '.resultdiv .load-movie', function ()
|
scripts/ytprefs-wizard.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
|
2 |
-
window._EPYTWIZ_=window._EPYTWIZ_||{};(function(a){window._EPYTWIZ_.selectText=window._EPYTWIZ_.selectText||function(d){if(document.selection){var b=document.body.createTextRange();b.moveToElementText(d);b.select()}else{if(window.getSelection){var c=window.getSelection();var b=document.createRange();b.selectNode(d);c.removeAllRanges();c.addRange(b)}}};window._EPYTWIZ_.loadmovieplain=window._EPYTWIZ_.loadmovieplain||function(b){var c='<iframe width="600" height="368" src="//www.youtube.com/embed/~ytid?showinfo=0&autoplay=1" frameborder="0" allowfullscreen ></iframe>';c=c.replace(/~ytid/g,b);a("#watch"+b).html(c);a("#closeme"+b).css("display","inline");a("#moviecontainer"+b).css("display","block");if(document.getElementById("scrollwatch"+b)){setTimeout(function(){a("html, body").animate({scrollTop:a("#scrollwatch"+b).offset().top-50},250,function(){})},800)}};window._EPYTWIZ_.closeme=window._EPYTWIZ_.closeme||function(b){a("#moviecontainer"+b).css("display","none");a("#watch"+b).html("")};a(document).ready(function(){a(".wiz-accordion").accordion({header:"> h3",collapsible:true,active:false,icons:{header:"ui-icon-circle-arrow-e",activeHeader:"ui-icon-circle-arrow-s"},heightStyle:"content",autoHeight:false}).find("h3.header-go").click(function(){window.open(a(this).find("a").attr("href"),"_blank");return false});a(".playlist-tabs").tabs();if(window._EPYTWIZ_.acc_expand){a(".wiz-accordion #"+window._EPYTWIZ_.acc_expand).click()}a("form.wizform").each(function(){$thisForm=a(this);$thisForm.find(".txturlpastecustom").on("paste",function(){$thisTxtUrl=a(this);setTimeout(function(){var d=a.trim($thisTxtUrl.val());var c=/<.*/i;if(c.test(d)){var e=new RegExp("(?:https?://)?(?:www\\.)?(?:youtu\\.be/|youtube\\.com(?:/embed/|/v/|/watch\\?v=))([\\w-]{10,12})","ig");var f=e.exec(d);if(f){var g=f[1];$thisTxtUrl.val("https://www.youtube.com/watch?v="+g)}else{$thisTxtUrl.val("https://www.youtube.com/watch?v=")}$thisForm.find(".badpaste").show()}else{$thisForm.find(".badpaste").hide()}},100)})});var b=a("#epyt_wiz_wrap");b.on("click",".copycode",function(){window._EPYTWIZ_.selectText(this)});b.on("click",".inserttopost",function(){var
|
1 |
|
2 |
+
window._EPYTWIZ_=window._EPYTWIZ_||{};(function(a){a.fn.followTo=function(e,b){var c=this,d=a(window);d.scroll(function(f){if(d.scrollTop()>e){c.css({position:"absolute",top:e})}else{c.css({position:"fixed",top:b})}})};window._EPYTWIZ_.getUrlParameter=function(b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var d=new RegExp("[\\?&]"+b+"=([^&#]*)");var c=d.exec(window.location.search);return c===null?"":decodeURIComponent(c[1].replace(/\+/g," "))};window._EPYTWIZ_.selectText=window._EPYTWIZ_.selectText||function(d){if(document.selection){var b=document.body.createTextRange();b.moveToElementText(d);b.select()}else{if(window.getSelection){var c=window.getSelection();var b=document.createRange();b.selectNode(d);c.removeAllRanges();c.addRange(b)}}};window._EPYTWIZ_.loadmovieplain=window._EPYTWIZ_.loadmovieplain||function(b){var c='<iframe width="600" height="368" src="//www.youtube.com/embed/~ytid?showinfo=0&autoplay=1" frameborder="0" allowfullscreen ></iframe>';c=c.replace(/~ytid/g,b);a("#watch"+b).html(c);a("#closeme"+b).css("display","inline");a("#moviecontainer"+b).css("display","block");if(document.getElementById("scrollwatch"+b)){setTimeout(function(){a("html, body").animate({scrollTop:a("#scrollwatch"+b).offset().top-50},250,function(){})},800)}};window._EPYTWIZ_.closeme=window._EPYTWIZ_.closeme||function(b){a("#moviecontainer"+b).css("display","none");a("#watch"+b).html("")};a(document).ready(function(){a(".wiz-accordion").accordion({header:"> h3",collapsible:true,active:false,icons:{header:"ui-icon-circle-arrow-e",activeHeader:"ui-icon-circle-arrow-s"},heightStyle:"content",autoHeight:false}).find("h3.header-go").click(function(){window.open(a(this).find("a").attr("href"),"_blank");return false});a(".playlist-tabs").tabs();if(window._EPYTWIZ_.acc_expand){a(".wiz-accordion #"+window._EPYTWIZ_.acc_expand).click()}a("form.wizform").each(function(){$thisForm=a(this);$thisForm.find(".txturlpastecustom").on("paste",function(){$thisTxtUrl=a(this);setTimeout(function(){var d=a.trim($thisTxtUrl.val());var c=/<.*/i;if(c.test(d)){var e=new RegExp("(?:https?://)?(?:www\\.)?(?:youtu\\.be/|youtube\\.com(?:/embed/|/v/|/watch\\?v=))([\\w-]{10,12})","ig");var f=e.exec(d);if(f){var g=f[1];$thisTxtUrl.val("https://www.youtube.com/watch?v="+g)}else{$thisTxtUrl.val("https://www.youtube.com/watch?v=")}$thisForm.find(".badpaste").show()}else{$thisForm.find(".badpaste").hide()}},100)})});var b=a("#epyt_wiz_wrap");b.on("click",".copycode",function(){window._EPYTWIZ_.selectText(this)});b.on("click",".inserttopost",function(){var d=window.location.toString().split("/")[0]+"//"+window.location.toString().split("/")[2];var e=a(this).attr("rel");var c=window._EPYTWIZ_.getUrlParameter("clientId");parent.postMessage("youtubeembedplus|"+e+(c?"|clientId="+c:""),d)});b.on("click",".resultdiv .load-movie",function(){window._EPYTWIZ_.loadmovieplain(a(this).closest(".resultdiv").data("vid"));return false});b.on("click",".moviecontainer a.closeme",function(){window._EPYTWIZ_.closeme(a(this).data("vid"))})})})(jQuery);
|
scripts/ytprefs.js
CHANGED
@@ -5,6 +5,7 @@
|
|
5 |
security: "",
|
6 |
gallery_scrolloffset: 100,
|
7 |
eppathtoscripts: "\/wp-content\/plugins\/youtube-embed-plus\/scripts\/",
|
|
|
8 |
epresponsiveselector: ["iframe.__youtube_prefs_widget__"],
|
9 |
epdovol: true,
|
10 |
evselector: 'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',
|
@@ -241,149 +242,152 @@
|
|
241 |
$('.epyt-gallery').each(function ()
|
242 |
{
|
243 |
var $container = $(this);
|
244 |
-
|
245 |
-
|
246 |
-
var initSrc = $iframe.attr('src');
|
247 |
-
if (!initSrc)
|
248 |
-
{
|
249 |
-
initSrc = $iframe.data('ep-src');
|
250 |
-
}
|
251 |
-
var firstId = $(this).find('.epyt-gallery-list .epyt-gallery-thumb').first().data('videoid');
|
252 |
-
if (typeof (initSrc) !== 'undefined')
|
253 |
-
{
|
254 |
-
initSrc = initSrc.replace(firstId, 'GALLERYVIDEOID');
|
255 |
-
$iframe.data('ep-gallerysrc', initSrc);
|
256 |
-
}
|
257 |
-
else if ($iframe.hasClass('__youtube_prefs_gdpr__'))
|
258 |
-
{
|
259 |
-
$iframe.data('ep-gallerysrc', '');
|
260 |
-
}
|
261 |
-
$container.on('click', '.epyt-gallery-list .epyt-gallery-thumb', function ()
|
262 |
{
|
263 |
-
$container.
|
264 |
-
$(this).
|
265 |
-
var vid = $(this).data('videoid');
|
266 |
-
$container.data('currvid', vid);
|
267 |
-
var vidSrc = $iframe.data('ep-gallerysrc').replace('GALLERYVIDEOID', vid);
|
268 |
-
|
269 |
-
var thumbplay = $container.find('.epyt-pagebutton').first().data('thumbplay');
|
270 |
-
if (thumbplay !== '0' && thumbplay !== 0)
|
271 |
-
{
|
272 |
-
if (vidSrc.indexOf('autoplay') > 0)
|
273 |
-
{
|
274 |
-
vidSrc = vidSrc.replace('autoplay=0', 'autoplay=1');
|
275 |
-
}
|
276 |
-
else
|
277 |
-
{
|
278 |
-
vidSrc += '&autoplay=1';
|
279 |
-
}
|
280 |
|
281 |
-
|
|
|
|
|
|
|
282 |
}
|
283 |
-
|
284 |
-
|
285 |
-
var bodyScrollTop = Math.max($('body').scrollTop(), $('html').scrollTop());
|
286 |
-
var scrollNext = $iframe.offset().top - parseInt(_EPYT_.gallery_scrolloffset);
|
287 |
-
if (bodyScrollTop > scrollNext)
|
288 |
{
|
289 |
-
|
290 |
-
|
291 |
-
}, 500, function ()
|
292 |
-
{
|
293 |
-
window._EPADashboard_.setVidSrc($iframe, vidSrc);
|
294 |
-
});
|
295 |
}
|
296 |
-
else
|
297 |
{
|
298 |
-
|
299 |
}
|
300 |
-
|
301 |
-
}).on('keydown', '.epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton', function (e)
|
302 |
-
{
|
303 |
-
var code = e.which;
|
304 |
-
if ((code === 13) || (code === 32))
|
305 |
{
|
306 |
-
|
307 |
-
$(this).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
|
309 |
-
|
310 |
-
|
311 |
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
|
|
|
|
|
|
321 |
|
322 |
-
$container.on('click', '.epyt-pagebutton', function ()
|
323 |
-
{
|
324 |
-
var pageData = {
|
325 |
-
action: 'my_embedplus_gallery_page',
|
326 |
-
security: _EPYT_.security,
|
327 |
-
options: {
|
328 |
-
playlistId: $(this).data('playlistid'),
|
329 |
-
pageToken: $(this).data('pagetoken'),
|
330 |
-
pageSize: $(this).data('pagesize'),
|
331 |
-
columns: $(this).data('epcolumns'),
|
332 |
-
showTitle: $(this).data('showtitle'),
|
333 |
-
showPaging: $(this).data('showpaging'),
|
334 |
-
autonext: $(this).data('autonext'),
|
335 |
-
thumbplay: $(this).data('thumbplay')
|
336 |
}
|
337 |
-
};
|
338 |
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
$container.find('.epyt-gallery-list').addClass('epyt-loading');
|
344 |
|
345 |
-
|
346 |
{
|
347 |
-
$
|
348 |
-
|
349 |
-
{
|
350 |
-
$(this).text($container.data('currpage'));
|
351 |
-
});
|
352 |
-
$container.find('.epyt-gallery-thumb[data-videoid="' + $container.data('currvid') + '"]').addClass('epyt-current-video');
|
353 |
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
|
359 |
-
|
360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
{
|
362 |
-
|
363 |
-
})
|
364 |
-
.
|
|
|
|
|
365 |
{
|
366 |
-
$container.find('.epyt-gallery-
|
|
|
367 |
|
368 |
-
|
|
|
|
|
|
|
|
|
|
|
369 |
{
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
if (bodyScrollTop > scrollNext)
|
374 |
{
|
375 |
-
|
376 |
-
|
377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
}
|
379 |
-
}
|
380 |
-
|
381 |
-
});
|
382 |
|
383 |
-
|
384 |
|
|
|
|
|
385 |
});
|
386 |
-
|
387 |
$('button.__youtube_prefs_gdpr__').on('click', function (e)
|
388 |
{
|
389 |
e.preventDefault();
|
@@ -393,6 +397,7 @@
|
|
393 |
window.top.location.reload();
|
394 |
}
|
395 |
});
|
|
|
396 |
}
|
397 |
};
|
398 |
}
|
5 |
security: "",
|
6 |
gallery_scrolloffset: 100,
|
7 |
eppathtoscripts: "\/wp-content\/plugins\/youtube-embed-plus\/scripts\/",
|
8 |
+
eppath: "\/wp-content\/plugins\/youtube-embed-plus\/",
|
9 |
epresponsiveselector: ["iframe.__youtube_prefs_widget__"],
|
10 |
epdovol: true,
|
11 |
evselector: 'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',
|
242 |
$('.epyt-gallery').each(function ()
|
243 |
{
|
244 |
var $container = $(this);
|
245 |
+
if (!$container.data('epytevents') || !$('body').hasClass('block-editor-page'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
{
|
247 |
+
$container.data('epytevents', '1');
|
248 |
+
var $iframe = $(this).find('iframe, div.__youtube_prefs_gdpr__').first();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
|
250 |
+
var initSrc = $iframe.attr('src');
|
251 |
+
if (!initSrc)
|
252 |
+
{
|
253 |
+
initSrc = $iframe.data('ep-src');
|
254 |
}
|
255 |
+
var firstId = $(this).find('.epyt-gallery-list .epyt-gallery-thumb').first().data('videoid');
|
256 |
+
if (typeof (initSrc) !== 'undefined')
|
|
|
|
|
|
|
257 |
{
|
258 |
+
initSrc = initSrc.replace(firstId, 'GALLERYVIDEOID');
|
259 |
+
$iframe.data('ep-gallerysrc', initSrc);
|
|
|
|
|
|
|
|
|
260 |
}
|
261 |
+
else if ($iframe.hasClass('__youtube_prefs_gdpr__'))
|
262 |
{
|
263 |
+
$iframe.data('ep-gallerysrc', '');
|
264 |
}
|
265 |
+
$container.on('click', '.epyt-gallery-list .epyt-gallery-thumb', function ()
|
|
|
|
|
|
|
|
|
266 |
{
|
267 |
+
$container.find('.epyt-gallery-list .epyt-gallery-thumb').removeClass('epyt-current-video');
|
268 |
+
$(this).addClass('epyt-current-video');
|
269 |
+
var vid = $(this).data('videoid');
|
270 |
+
$container.data('currvid', vid);
|
271 |
+
var vidSrc = $iframe.data('ep-gallerysrc').replace('GALLERYVIDEOID', vid);
|
272 |
+
|
273 |
+
var thumbplay = $container.find('.epyt-pagebutton').first().data('thumbplay');
|
274 |
+
if (thumbplay !== '0' && thumbplay !== 0)
|
275 |
+
{
|
276 |
+
if (vidSrc.indexOf('autoplay') > 0)
|
277 |
+
{
|
278 |
+
vidSrc = vidSrc.replace('autoplay=0', 'autoplay=1');
|
279 |
+
}
|
280 |
+
else
|
281 |
+
{
|
282 |
+
vidSrc += '&autoplay=1';
|
283 |
+
}
|
284 |
|
285 |
+
$iframe.addClass('epyt-thumbplay');
|
286 |
+
}
|
287 |
|
288 |
+
// https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js
|
289 |
+
var bodyScrollTop = Math.max($('body').scrollTop(), $('html').scrollTop());
|
290 |
+
var scrollNext = $iframe.offset().top - parseInt(_EPYT_.gallery_scrolloffset);
|
291 |
+
if (bodyScrollTop > scrollNext)
|
292 |
+
{
|
293 |
+
$('html, body').animate({
|
294 |
+
scrollTop: scrollNext
|
295 |
+
}, 500, function ()
|
296 |
+
{
|
297 |
+
window._EPADashboard_.setVidSrc($iframe, vidSrc);
|
298 |
+
});
|
299 |
+
}
|
300 |
+
else
|
301 |
+
{
|
302 |
+
window._EPADashboard_.setVidSrc($iframe, vidSrc);
|
303 |
+
}
|
304 |
|
305 |
+
}).on('keydown', '.epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton', function (e)
|
306 |
+
{
|
307 |
+
var code = e.which;
|
308 |
+
if ((code === 13) || (code === 32))
|
309 |
+
{
|
310 |
+
e.preventDefault();
|
311 |
+
$(this).click();
|
312 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
}
|
314 |
+
});
|
315 |
|
316 |
+
$container.on('mouseenter', '.epyt-gallery-list .epyt-gallery-thumb', function ()
|
317 |
+
{
|
318 |
+
$(this).addClass('hover');
|
319 |
+
});
|
|
|
320 |
|
321 |
+
$container.on('mouseleave', '.epyt-gallery-list .epyt-gallery-thumb', function ()
|
322 |
{
|
323 |
+
$(this).removeClass('hover');
|
324 |
+
});
|
|
|
|
|
|
|
|
|
325 |
|
326 |
+
$container.on('click', '.epyt-pagebutton', function ()
|
327 |
+
{
|
328 |
+
var pageData = {
|
329 |
+
action: 'my_embedplus_gallery_page',
|
330 |
+
security: _EPYT_.security,
|
331 |
+
options: {
|
332 |
+
playlistId: $(this).data('playlistid'),
|
333 |
+
pageToken: $(this).data('pagetoken'),
|
334 |
+
pageSize: $(this).data('pagesize'),
|
335 |
+
columns: $(this).data('epcolumns'),
|
336 |
+
showTitle: $(this).data('showtitle'),
|
337 |
+
showPaging: $(this).data('showpaging'),
|
338 |
+
autonext: $(this).data('autonext'),
|
339 |
+
thumbplay: $(this).data('thumbplay')
|
340 |
+
}
|
341 |
+
};
|
342 |
|
343 |
+
var forward = $(this).hasClass('epyt-next');
|
344 |
+
var currpage = parseInt($container.data('currpage') + "");
|
345 |
+
currpage += forward ? 1 : -1;
|
346 |
+
$container.data('currpage', currpage);
|
347 |
+
$container.find('.epyt-gallery-list').addClass('epyt-loading');
|
348 |
+
|
349 |
+
$.post(_EPYT_.ajaxurl, pageData, function (response)
|
350 |
+
{
|
351 |
+
$container.find('.epyt-gallery-list').html(response);
|
352 |
+
$container.find('.epyt-current').each(function ()
|
353 |
{
|
354 |
+
$(this).text($container.data('currpage'));
|
355 |
+
});
|
356 |
+
$container.find('.epyt-gallery-thumb[data-videoid="' + $container.data('currvid') + '"]').addClass('epyt-current-video');
|
357 |
+
|
358 |
+
if ($container.find('.epyt-pagebutton').first().data('autonext') == '1')
|
359 |
{
|
360 |
+
$container.find('.epyt-gallery-thumb').first().click();
|
361 |
+
}
|
362 |
|
363 |
+
})
|
364 |
+
.fail(function ()
|
365 |
+
{
|
366 |
+
alert('Sorry, there was an error loading the next page.');
|
367 |
+
})
|
368 |
+
.always(function ()
|
369 |
{
|
370 |
+
$container.find('.epyt-gallery-list').removeClass('epyt-loading');
|
371 |
+
|
372 |
+
if ($container.find('.epyt-pagebutton').first().data('autonext') != '1')
|
|
|
373 |
{
|
374 |
+
// https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js
|
375 |
+
var bodyScrollTop = Math.max($('body').scrollTop(), $('html').scrollTop());
|
376 |
+
var scrollNext = $container.find('.epyt-gallery-list').offset().top - parseInt(_EPYT_.gallery_scrolloffset);
|
377 |
+
if (bodyScrollTop > scrollNext)
|
378 |
+
{
|
379 |
+
$('html, body').animate({
|
380 |
+
scrollTop: scrollNext
|
381 |
+
}, 500);
|
382 |
+
}
|
383 |
}
|
|
|
|
|
|
|
384 |
|
385 |
+
});
|
386 |
|
387 |
+
});
|
388 |
+
}
|
389 |
});
|
390 |
+
|
391 |
$('button.__youtube_prefs_gdpr__').on('click', function (e)
|
392 |
{
|
393 |
e.preventDefault();
|
397 |
window.top.location.reload();
|
398 |
}
|
399 |
});
|
400 |
+
|
401 |
}
|
402 |
};
|
403 |
}
|
scripts/ytprefs.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
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/",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"};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(f){try{if(typeof _EPYT_.epdovol!=="undefined"&&_EPYT_.epdovol){var d=parseInt(f.target.getIframe().getAttribute("data-vol"));if(!isNaN(d)){if(d===0){f.target.mute()}else{if(f.target.isMuted()){f.target.unMute()}f.target.setVolume(d)}}}var c=parseInt(f.target.getIframe().getAttribute("data-epautoplay"));if(!isNaN(c)&&c===1){f.target.playVideo()}}catch(e){}},onPlayerStateChange:function(f){var e=f.target.getIframe();if(f.data===a.YT.PlayerState.PLAYING&&f.target.ponce!==true&&e.src.indexOf("autoplay=1")===-1){f.target.ponce=true}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 g=c.find(".epyt-current-video");if(!g.length){g=c.find(".epyt-gallery-thumb").first()}var h=g.find(" ~ .epyt-gallery-thumb").first();if(h.length){h.click()}else{c.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click()}}}},justid:function(c){return new RegExp("[\\?&]v=([^&#]*)").exec(c)[1]},setupevents:function(d){if(typeof(a.YT)!=="undefined"&&a.YT!==null&&a.YT.loaded){var c=document.getElementById(d);if(!c.epytsetupdone){a._EPADashboard_.log("Setting up YT API events: "+d);c.epytsetupdone=true;return new a.YT.Player(d,{events:{onReady:a._EPADashboard_.onPlayerReady,onStateChange:a._EPADashboard_.onPlayerStateChange}})}}},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){c.attr("src",d);c.get(0).epytsetupdone=false;a._EPADashboard_.setupevents(c.attr("id"))},loadYTAPI:function(){if(typeof a.YT==="undefined"){if(a._EPYT_.ytapi_load!=="never"&&(a._EPYT_.ytapi_load==="always"||b('iframe[src*="youtube.com/embed/"]').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(){b(".epyt-gallery").each(function(){var f=b(this);var e=b(this).find("iframe, div.__youtube_prefs_gdpr__").first();var c=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");e.data("ep-gallerysrc",c)}else{if(e.hasClass("__youtube_prefs_gdpr__")){e.data("ep-gallerysrc","")}}f.on("click",".epyt-gallery-list .epyt-gallery-thumb",function(){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 k=e.data("ep-gallerysrc").replace("GALLERYVIDEOID",g);var j=f.find(".epyt-pagebutton").first().data("thumbplay");if(j!=="0"&&j!==0){if(k.indexOf("autoplay")>0){k=k.replace("autoplay=0","autoplay=1")}else{k+="&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,k)})}else{a._EPADashboard_.setVidSrc(e,k)}}).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).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",".epyt-pagebutton",function(){var i={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 g=b(this).hasClass("epyt-next");var h=parseInt(f.data("currpage")+"");h+=g?1:-1;f.data("currpage",h);f.find(".epyt-gallery-list").addClass("epyt-loading");b.post(_EPYT_.ajaxurl,i,function(j){f.find(".epyt-gallery-list").html(j);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"){f.find(".epyt-gallery-thumb").first().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 j=Math.max(b("body").scrollTop(),b("html").scrollTop());var k=f.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(j>k){b("html, body").animate({scrollTop:k},500)}}})})});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()}})}}}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")})}};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();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){a._EPADashboard_.loadYTAPI();a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API AJAX");a._EPADashboard_.pageReady()}})})}})})(window,jQuery);
|
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"};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(f){try{if(typeof _EPYT_.epdovol!=="undefined"&&_EPYT_.epdovol){var d=parseInt(f.target.getIframe().getAttribute("data-vol"));if(!isNaN(d)){if(d===0){f.target.mute()}else{if(f.target.isMuted()){f.target.unMute()}f.target.setVolume(d)}}}var c=parseInt(f.target.getIframe().getAttribute("data-epautoplay"));if(!isNaN(c)&&c===1){f.target.playVideo()}}catch(e){}},onPlayerStateChange:function(f){var e=f.target.getIframe();if(f.data===a.YT.PlayerState.PLAYING&&f.target.ponce!==true&&e.src.indexOf("autoplay=1")===-1){f.target.ponce=true}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 g=c.find(".epyt-current-video");if(!g.length){g=c.find(".epyt-gallery-thumb").first()}var h=g.find(" ~ .epyt-gallery-thumb").first();if(h.length){h.click()}else{c.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click()}}}},justid:function(c){return new RegExp("[\\?&]v=([^&#]*)").exec(c)[1]},setupevents:function(d){if(typeof(a.YT)!=="undefined"&&a.YT!==null&&a.YT.loaded){var c=document.getElementById(d);if(!c.epytsetupdone){a._EPADashboard_.log("Setting up YT API events: "+d);c.epytsetupdone=true;return new a.YT.Player(d,{events:{onReady:a._EPADashboard_.onPlayerReady,onStateChange:a._EPADashboard_.onPlayerStateChange}})}}},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){c.attr("src",d);c.get(0).epytsetupdone=false;a._EPADashboard_.setupevents(c.attr("id"))},loadYTAPI:function(){if(typeof a.YT==="undefined"){if(a._EPYT_.ytapi_load!=="never"&&(a._EPYT_.ytapi_load==="always"||b('iframe[src*="youtube.com/embed/"]').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(){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__").first();var c=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");e.data("ep-gallerysrc",c)}else{if(e.hasClass("__youtube_prefs_gdpr__")){e.data("ep-gallerysrc","")}}f.on("click",".epyt-gallery-list .epyt-gallery-thumb",function(){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 k=e.data("ep-gallerysrc").replace("GALLERYVIDEOID",g);var j=f.find(".epyt-pagebutton").first().data("thumbplay");if(j!=="0"&&j!==0){if(k.indexOf("autoplay")>0){k=k.replace("autoplay=0","autoplay=1")}else{k+="&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,k)})}else{a._EPADashboard_.setVidSrc(e,k)}}).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).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",".epyt-pagebutton",function(){var i={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 g=b(this).hasClass("epyt-next");var h=parseInt(f.data("currpage")+"");h+=g?1:-1;f.data("currpage",h);f.find(".epyt-gallery-list").addClass("epyt-loading");b.post(_EPYT_.ajaxurl,i,function(j){f.find(".epyt-gallery-list").html(j);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"){f.find(".epyt-gallery-thumb").first().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 j=Math.max(b("body").scrollTop(),b("html").scrollTop());var k=f.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(j>k){b("html, body").animate({scrollTop:k},500)}}})})}});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()}})}}}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")})}};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();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){a._EPADashboard_.loadYTAPI();a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API AJAX");a._EPADashboard_.pageReady()}})})}})})(window,jQuery);
|
src/block/block.js
ADDED
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* eslint-disable quotes */
|
2 |
+
/* eslint-disable space-in-parens */
|
3 |
+
/* eslint-disable valid-jsdoc */
|
4 |
+
/**
|
5 |
+
* BLOCK: epyt/youtube
|
6 |
+
*
|
7 |
+
* Registering a basic block with Gutenberg.
|
8 |
+
* Simple block, renders and saves the same content without any interactivity.
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Import CSS.
|
12 |
+
import "./style.scss";
|
13 |
+
import "./editor.scss";
|
14 |
+
|
15 |
+
const { __ } = wp.i18n; // Import __() from wp.i18n
|
16 |
+
const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks
|
17 |
+
const { Component, Fragment } = wp.element;
|
18 |
+
const { ServerSideRender, Button, Modal } = wp.components;
|
19 |
+
//const { withState } = wp.compose;
|
20 |
+
|
21 |
+
import debounce from "lodash/debounce";
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Register: aa Gutenberg Block.
|
25 |
+
*
|
26 |
+
* Registers a new block provided a unique name and an object defining its
|
27 |
+
* behavior. Once registered, the block is made editor as an option to any
|
28 |
+
* editor interface where blocks are implemented.
|
29 |
+
*
|
30 |
+
* @link https://wordpress.org/gutenberg/handbook/block-api/
|
31 |
+
* @param {string} name Block name.
|
32 |
+
* @param {Object} settings Block settings.
|
33 |
+
* @return {?WPBlock} The block, if it has been successfully
|
34 |
+
* registered; otherwise `undefined`.
|
35 |
+
*/
|
36 |
+
registerBlockType("epyt/youtube", {
|
37 |
+
// Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
|
38 |
+
title: __("YouTube Wizard"), // Block title.
|
39 |
+
// <defs><style>.epytcls-1{fill:red;}.epytcls-2{fill-rule:evenodd;fill:url(#radial-gradient);}.epytcls-3{fill:#31aaff;}.epytcls-4{fill:#fff;}</style><radialGradient id="radial-gradient" cx="193" cy="85.85" r="77.53" gradientUnits="userSpaceOnUse"><stop offset="0.17" stop-color="#fff"/><stop offset="0.68" stop-color="#31aaff"/></radialGradient></defs>
|
40 |
+
icon: (
|
41 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 292.89 282.69">
|
42 |
+
<title>YouTube Wizard Icon</title>
|
43 |
+
<g id="Layer_2" data-name="Layer 2">
|
44 |
+
<g id="Слой_1" data-name="Слой 1">
|
45 |
+
<g id="g5360">
|
46 |
+
<g id="g4167">
|
47 |
+
<path
|
48 |
+
id="path4156"
|
49 |
+
className="epytcls-1"
|
50 |
+
d="M139.27,87.65s-87.11,0-109,5.68A36,36,0,0,0,5.68,118.12C0,140,0,185.26,0,185.26s0,45.44,5.68,67A35.47,35.47,0,0,0,30.3,276.84c22,5.85,109,5.85,109,5.85s87.28,0,109.14-5.68a34.64,34.64,0,0,0,24.44-24.62c5.86-21.69,5.86-67,5.86-67s.17-45.45-5.86-67.31a34.41,34.41,0,0,0-24.44-24.45C226.55,87.65,139.27,87.65,139.27,87.65Zm-27.72,55.77L184,185.26l-72.48,41.65V143.42Z"
|
51 |
+
/>
|
52 |
+
</g>
|
53 |
+
</g>
|
54 |
+
<path
|
55 |
+
className="epytcls-2"
|
56 |
+
d="M143.39,153.45c10.52-19.27,14.91-39.2,19.18-58.61q.68-3,1.33-6l.12-.54-.25-.48c-13.87-26.66-41.06-52.54-57.1-66.42,21,11.33,60,31.21,84,36.13l.63.13.53-.37c4.14-2.92,8.28-5.7,12.28-8.4,13.41-9,26.27-17.67,38.31-30.64-10.26,20.67-14.18,40.47-18.14,64.42l-.09.58.32.48c18.19,27.91,40.93,50.88,54.81,63.7C261.68,137.5,230,121.76,197,115.29l-.57-.12-3.83,2.35C176,127.67,159,138.08,143.39,153.45Z"
|
57 |
+
/>
|
58 |
+
<path
|
59 |
+
className="epytcls-3"
|
60 |
+
d="M237.47,25.4c-7.73,18.08-11.19,36-14.67,57l-.19,1.15.64,1c15,23,33.15,42.76,46.87,56.19-18.4-9.59-45.13-21.49-72.87-26.93l-1.15-.22-1,.61-3.33,2c-14.47,8.86-29.26,17.93-43.24,30.34,7.94-17,11.77-34.43,15.51-51.43q.66-3,1.33-6l.24-1.06-.51-1c-11.66-22.4-32.12-43.86-48-58.48C139,40,170,54.82,190.37,59l1.27.26,1.06-.74c4.12-2.91,8.25-5.69,12.25-8.38,11.27-7.59,22.16-14.91,32.52-24.74M254.86,0l-.74,1.11L254.86,0Zm-.74,1.11C235.26,28.88,213.71,40,191,56.06c-33.55-6.88-97.91-43.92-97.91-43.92s49,37.13,69.38,76.37c-6,26.61-11,54.9-31.35,80.94,19.83-25.28,42.66-38.61,65.58-52.69,50.06,9.8,96.22,40.55,96.22,40.55s-38.84-31-67.13-74.4c4.89-29.58,9.81-54,28.36-81.8Z"
|
61 |
+
/>
|
62 |
+
<polyline
|
63 |
+
className="epytcls-4"
|
64 |
+
points="102.6 133.11 102.6 133.11 192.98 185.28 102.6 237.22 102.6 133.11"
|
65 |
+
/>
|
66 |
+
</g>
|
67 |
+
</g>
|
68 |
+
</svg>
|
69 |
+
),
|
70 |
+
category: "embed", // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
|
71 |
+
keywords: [__("gallery"), __("live"), __("video")], // playlist
|
72 |
+
description: __( 'Embed a video, playlist, channel, gallery, or live stream.' ),
|
73 |
+
attributes: {
|
74 |
+
shortcode: {
|
75 |
+
type: "string",
|
76 |
+
default: ""
|
77 |
+
}
|
78 |
+
},
|
79 |
+
|
80 |
+
/**
|
81 |
+
* The edit function describes the structure of your block in the context of the editor.
|
82 |
+
* This represents what the editor will render when the block is used.
|
83 |
+
*
|
84 |
+
* The "edit" property must be a valid function.
|
85 |
+
*
|
86 |
+
* @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
|
87 |
+
*/
|
88 |
+
edit: class extends Component {
|
89 |
+
state = { show: false };
|
90 |
+
|
91 |
+
constructor(props) {
|
92 |
+
super(...arguments);
|
93 |
+
this.props = props;
|
94 |
+
|
95 |
+
//this.onMessage = this.onMessage.bind(this);
|
96 |
+
}
|
97 |
+
|
98 |
+
componentDidMount() {
|
99 |
+
window.addEventListener("message", this.onMessage);
|
100 |
+
this.gbPreviewSetup("componentDidMount");
|
101 |
+
}
|
102 |
+
|
103 |
+
componentDidUpdate() {
|
104 |
+
this.gbPreviewSetup("componentDidUpdate");
|
105 |
+
}
|
106 |
+
|
107 |
+
componentWillUnmount() {
|
108 |
+
window.removeEventListener("message", this.onMessage);
|
109 |
+
}
|
110 |
+
|
111 |
+
showModal = () => {
|
112 |
+
this.setState({ show: true });
|
113 |
+
};
|
114 |
+
|
115 |
+
hideModal = () => {
|
116 |
+
this.setState({ show: false });
|
117 |
+
};
|
118 |
+
|
119 |
+
onMessage = e => {
|
120 |
+
try {
|
121 |
+
if (
|
122 |
+
e.data.indexOf("youtubeembedplus") === 0 &&
|
123 |
+
e.data.indexOf(this.props.clientId) > 0
|
124 |
+
) {
|
125 |
+
let embedcode = "";
|
126 |
+
embedcode = e.data.split("|")[1];
|
127 |
+
// if (embedcode.indexOf("[") !== 0)
|
128 |
+
// {
|
129 |
+
// embedcode = "<p>" + embedcode + "</p>";
|
130 |
+
// }
|
131 |
+
this.props.setAttributes({ shortcode: embedcode.toString() });
|
132 |
+
this.hideModal(); // close modal
|
133 |
+
this.gbPreviewSetup("onMessage");
|
134 |
+
}
|
135 |
+
} catch (err) {}
|
136 |
+
};
|
137 |
+
|
138 |
+
gbPreviewSetup = debounce(myContext => {
|
139 |
+
setTimeout(() => {
|
140 |
+
window._EPYTA_.gbPreviewSetup();
|
141 |
+
}, 1500);
|
142 |
+
}, 50);
|
143 |
+
|
144 |
+
render() {
|
145 |
+
if (this.props.attributes.shortcode) {
|
146 |
+
const ssr = (
|
147 |
+
<ServerSideRender
|
148 |
+
block="epyt/youtube"
|
149 |
+
attributes={this.props.attributes}
|
150 |
+
/>
|
151 |
+
);
|
152 |
+
return ssr;
|
153 |
+
}
|
154 |
+
|
155 |
+
return (
|
156 |
+
<div className="components-placeholder editor-media-placeholder wp-block-image epytblock">
|
157 |
+
<div className="components-placeholder__label">
|
158 |
+
<svg
|
159 |
+
xmlns="http://www.w3.org/2000/svg"
|
160 |
+
viewBox="0 0 292.89 282.69"
|
161 |
+
width="20"
|
162 |
+
height="20"
|
163 |
+
className="dashicon"
|
164 |
+
>
|
165 |
+
<title>YouTube Wizard Icon</title>
|
166 |
+
<g id="Layer_2" data-name="Layer 2">
|
167 |
+
<g id="Слой_1" data-name="Слой 1">
|
168 |
+
<g id="g5360">
|
169 |
+
<g id="g4167">
|
170 |
+
<path
|
171 |
+
id="path4156"
|
172 |
+
className="epytcls-1"
|
173 |
+
d="M139.27,87.65s-87.11,0-109,5.68A36,36,0,0,0,5.68,118.12C0,140,0,185.26,0,185.26s0,45.44,5.68,67A35.47,35.47,0,0,0,30.3,276.84c22,5.85,109,5.85,109,5.85s87.28,0,109.14-5.68a34.64,34.64,0,0,0,24.44-24.62c5.86-21.69,5.86-67,5.86-67s.17-45.45-5.86-67.31a34.41,34.41,0,0,0-24.44-24.45C226.55,87.65,139.27,87.65,139.27,87.65Zm-27.72,55.77L184,185.26l-72.48,41.65V143.42Z"
|
174 |
+
/>
|
175 |
+
</g>
|
176 |
+
</g>
|
177 |
+
<path
|
178 |
+
className="epytcls-2"
|
179 |
+
d="M143.39,153.45c10.52-19.27,14.91-39.2,19.18-58.61q.68-3,1.33-6l.12-.54-.25-.48c-13.87-26.66-41.06-52.54-57.1-66.42,21,11.33,60,31.21,84,36.13l.63.13.53-.37c4.14-2.92,8.28-5.7,12.28-8.4,13.41-9,26.27-17.67,38.31-30.64-10.26,20.67-14.18,40.47-18.14,64.42l-.09.58.32.48c18.19,27.91,40.93,50.88,54.81,63.7C261.68,137.5,230,121.76,197,115.29l-.57-.12-3.83,2.35C176,127.67,159,138.08,143.39,153.45Z"
|
180 |
+
/>
|
181 |
+
<path
|
182 |
+
className="epytcls-3"
|
183 |
+
d="M237.47,25.4c-7.73,18.08-11.19,36-14.67,57l-.19,1.15.64,1c15,23,33.15,42.76,46.87,56.19-18.4-9.59-45.13-21.49-72.87-26.93l-1.15-.22-1,.61-3.33,2c-14.47,8.86-29.26,17.93-43.24,30.34,7.94-17,11.77-34.43,15.51-51.43q.66-3,1.33-6l.24-1.06-.51-1c-11.66-22.4-32.12-43.86-48-58.48C139,40,170,54.82,190.37,59l1.27.26,1.06-.74c4.12-2.91,8.25-5.69,12.25-8.38,11.27-7.59,22.16-14.91,32.52-24.74M254.86,0l-.74,1.11L254.86,0Zm-.74,1.11C235.26,28.88,213.71,40,191,56.06c-33.55-6.88-97.91-43.92-97.91-43.92s49,37.13,69.38,76.37c-6,26.61-11,54.9-31.35,80.94,19.83-25.28,42.66-38.61,65.58-52.69,50.06,9.8,96.22,40.55,96.22,40.55s-38.84-31-67.13-74.4c4.89-29.58,9.81-54,28.36-81.8Z"
|
184 |
+
/>
|
185 |
+
<polyline
|
186 |
+
className="epytcls-4"
|
187 |
+
points="102.6 133.11 102.6 133.11 192.98 185.28 102.6 237.22 102.6 133.11"
|
188 |
+
/>
|
189 |
+
</g>
|
190 |
+
</g>
|
191 |
+
</svg>
|
192 |
+
YouTube Wizard
|
193 |
+
</div>
|
194 |
+
<div className={this.props.isSelected ? "" : "epytblock__faded--off"}>
|
195 |
+
<div className="components-placeholder__instructions">
|
196 |
+
Click the button below to easily embed a video, playlist, channel,
|
197 |
+
gallery, or live stream.
|
198 |
+
</div>
|
199 |
+
<div className="components-placeholder__fieldset">
|
200 |
+
<div>
|
201 |
+
<Button isDefault onClick={this.showModal}>
|
202 |
+
Open Wizard
|
203 |
+
</Button>
|
204 |
+
{this.state.show ? (
|
205 |
+
<Modal
|
206 |
+
title="YouTube Wizard"
|
207 |
+
className="epytblock epytblock__modal"
|
208 |
+
onRequestClose={this.hideModal}
|
209 |
+
>
|
210 |
+
<iframe
|
211 |
+
title="YouTube Wizard"
|
212 |
+
src={
|
213 |
+
window._EPYTA_.wizhref +
|
214 |
+
"&clientId=" +
|
215 |
+
this.props.clientId
|
216 |
+
}
|
217 |
+
/>
|
218 |
+
</Modal>
|
219 |
+
) : null}
|
220 |
+
</div>
|
221 |
+
</div>
|
222 |
+
</div>
|
223 |
+
</div>
|
224 |
+
);
|
225 |
+
}
|
226 |
+
},
|
227 |
+
|
228 |
+
/**
|
229 |
+
* The save function defines the way in which the different attributes should be combined
|
230 |
+
* into the final markup, which is then serialized by Gutenberg into post_content.
|
231 |
+
*
|
232 |
+
* The "save" property must be specified and must be a valid function.
|
233 |
+
*
|
234 |
+
* @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
|
235 |
+
*/
|
236 |
+
save: function(props) {
|
237 |
+
return <Fragment>{props.attributes.shortcode}</Fragment>;
|
238 |
+
}
|
239 |
+
});
|
src/block/editor.scss
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* #.# Editor Styles
|
3 |
+
*
|
4 |
+
* CSS for just Backend enqueued after style.scss
|
5 |
+
* which makes it higher in priority.
|
6 |
+
*/
|
7 |
+
|
8 |
+
.components-modal__frame.epytblock__modal {
|
9 |
+
position: absolute;
|
10 |
+
top: 25px;
|
11 |
+
left: 50%;
|
12 |
+
transform: translateX(-50%);
|
13 |
+
width: 950px;
|
14 |
+
max-width: 90%;
|
15 |
+
height: calc(100vh - 50px);
|
16 |
+
max-height: calc(100vh - 50px);
|
17 |
+
|
18 |
+
.components-modal__header {
|
19 |
+
margin: 0;
|
20 |
+
}
|
21 |
+
|
22 |
+
.components-modal__content {
|
23 |
+
padding: 0;
|
24 |
+
}
|
25 |
+
|
26 |
+
iframe {
|
27 |
+
width: 100%;
|
28 |
+
height: calc(100% - 60px);
|
29 |
+
display: block;
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
.epytblock{
|
34 |
+
.components-placeholder__fieldset {
|
35 |
+
max-width: 100%;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
/* .epyt-gallery-list {
|
41 |
+
&:before {
|
42 |
+
content: "Preview Only";
|
43 |
+
display: block;
|
44 |
+
width: 100%;
|
45 |
+
height: 100%;
|
46 |
+
position: absolute;
|
47 |
+
top: 0;
|
48 |
+
left: 0;
|
49 |
+
opacity: 0;
|
50 |
+
background-color: #ffffff;
|
51 |
+
z-index: 10000;
|
52 |
+
color: #888888;
|
53 |
+
font-size: 3em;
|
54 |
+
box-sizing: border-box;
|
55 |
+
padding-top: 40px;
|
56 |
+
transition: opacity .1s ease-out;
|
57 |
+
}
|
58 |
+
&:hover:before {
|
59 |
+
opacity: 0.8;
|
60 |
+
transition: opacity .2s ease-out;
|
61 |
+
}
|
62 |
+
} */
|
src/block/style.scss
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* #.# Styles
|
3 |
+
*
|
4 |
+
* CSS for both Frontend+Backend.
|
5 |
+
*/
|
6 |
+
|
src/blocks.js
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Gutenberg Blocks
|
3 |
+
*
|
4 |
+
* All blocks related JavaScript files should be imported here.
|
5 |
+
* You can create a new block folder in this dir and include code
|
6 |
+
* for that block here as well.
|
7 |
+
*
|
8 |
+
* All blocks should be included here since this is the file that
|
9 |
+
* Webpack is compiling as the input file.
|
10 |
+
*/
|
11 |
+
|
12 |
+
import './block/block.js';
|
13 |
+
import './viblock/block.js';
|
src/common.scss
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* #.# Common SCSS
|
3 |
+
*
|
4 |
+
* Can include things like variables and mixins
|
5 |
+
* that are used across the project.
|
6 |
+
*/
|
7 |
+
|
8 |
+
// Colors.
|
9 |
+
$black: rgb(41, 41, 41);
|
10 |
+
$white: #f4f4f4;
|
11 |
+
$gray: #dedede;
|
12 |
+
$green: #bada55;
|
13 |
+
$red: orangered;
|
src/viblock/block.js
ADDED
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* eslint-disable quotes */
|
2 |
+
/* eslint-disable space-in-parens */
|
3 |
+
/* eslint-disable valid-jsdoc */
|
4 |
+
/**
|
5 |
+
* BLOCK: epyt/vi
|
6 |
+
*/
|
7 |
+
|
8 |
+
// Import CSS.
|
9 |
+
import "./style.scss";
|
10 |
+
import "./editor.scss";
|
11 |
+
|
12 |
+
const { __ } = wp.i18n; // Import __() from wp.i18n
|
13 |
+
const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks
|
14 |
+
const { Component, Fragment } = wp.element;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Register: aa Gutenberg Block.
|
18 |
+
*
|
19 |
+
* Registers a new block provided a unique name and an object defining its
|
20 |
+
* behavior. Once registered, the block is made editor as an option to any
|
21 |
+
* editor interface where blocks are implemented.
|
22 |
+
*
|
23 |
+
* @link https://wordpress.org/gutenberg/handbook/block-api/
|
24 |
+
* @param {string} name Block name.
|
25 |
+
* @param {Object} settings Block settings.
|
26 |
+
* @return {?WPBlock} The block, if it has been successfully
|
27 |
+
* registered; otherwise `undefined`.
|
28 |
+
*/
|
29 |
+
registerBlockType("epyt/vi", {
|
30 |
+
// Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
|
31 |
+
title: __("Video Ad"), // Block title.
|
32 |
+
icon: (
|
33 |
+
<svg
|
34 |
+
version="1.1"
|
35 |
+
id="Capa_1"
|
36 |
+
xmlns="http://www.w3.org/2000/svg"
|
37 |
+
x="0px"
|
38 |
+
y="0px"
|
39 |
+
viewBox="0 0 485.6 485.6"
|
40 |
+
style={{ enableBackground: "new 0 0 485.6 485.6" }}
|
41 |
+
xmlSpace="preserve"
|
42 |
+
>
|
43 |
+
<g>
|
44 |
+
<g>
|
45 |
+
<path
|
46 |
+
fill="#0ECAD4"
|
47 |
+
d="M301.5,368l-0.8-1.3c-6.7-10.5-5.8-23,2.3-32.7c1.2-1.4,2.4-2.8,4-4.5c4.8-4.8,12.4-11.3,23.4-11.3
|
48 |
+
c6.7,0,13.3,2.4,20,7.4c10.5,7.7,20.9,15.9,30.9,23.6c2,1.5,3.9,3,5.9,4.5c1.5-1.7,2.9-3.5,4.5-5.1c10.4-11.9,20.6-23.9,30.9-35.8
|
49 |
+
c5.6-19.2,8.7-39.5,8.7-60.6c0-119-96.6-215.6-215.6-215.6C96.6,36.8,0,133.4,0,252.4S96.6,468,215.6,468
|
50 |
+
c48.3,0,93-15.9,128.9-42.8c-11.5-15-23.2-30-34.6-45C306.7,376.2,304,372,301.5,368z M287,341.6c-10.4,12.7-24,21.2-39.9,25.5
|
51 |
+
c-7,1.9-10,5.6-9.6,12.8c0.3,7.1,0,14.2,0,21.2c0,6.3-3.2,9.6-9.4,9.9c-7.5,0.2-15.2,0.2-22.9,0c-6.6-0.1-9.7-3.9-9.9-10.4
|
52 |
+
c-0.1-5.1-0.1-10.3-0.1-15.4c-0.1-11.4-0.5-11.8-11.5-13.6c-14-2.2-27.7-5.5-40.6-11.6c-10.1-4.9-11.1-7.4-8.2-18
|
53 |
+
c2.2-7.9,4.3-15.8,6.7-23.6c2.8-9.1,5.2-10.2,13.6-5.8c14.2,7.4,29.2,11.5,45,13.5c10.2,1.3,20.1,0.2,29.6-3.8
|
54 |
+
c17.5-7.7,20.3-28.1,5.5-40.3c-5.1-4.2-10.8-7.2-16.8-9.9c-15.4-6.7-31.5-12-46.1-20.7c-23.7-14.2-38.7-33.5-36.9-62.3
|
55 |
+
c2-32.5,20.3-52.8,50.1-63.6c12.3-4.5,12.3-4.3,12.4-17.2c0-4.3,0-8.7,0-13c0.2-9.7,1.9-11.4,11.5-11.6c3-0.1,6,0,8.9,0
|
56 |
+
c20.5,0,20.5,0,20.7,20.5c0.1,14.5,0,14.6,14.5,16.8c11.1,1.7,21.7,5,31.9,9.5c5.7,2.4,7.8,6.5,6,12.4c-2.6,8.8-5,17.8-7.8,26.6
|
57 |
+
c-2.7,8.4-5.3,9.5-13.3,5.7c-16-7.8-32.8-11-50.6-10c-4.6,0.2-9.2,0.9-13.5,2.8c-15.3,6.7-17.8,23.6-4.8,34
|
58 |
+
c6.6,5.2,14.2,9.1,21.9,12.3c13.6,5.6,27.2,11,40,18.1C304.8,255,315.9,306.4,287,341.6z"
|
59 |
+
/>
|
60 |
+
<path
|
61 |
+
fill="#0ECAD4"
|
62 |
+
d="M480.3,302c-4.8-3.9-8.1-5.9-11.1-5.9c-3.4,0-6.4,2.6-11,7.9c-23.2,26.9-29.5,34.3-52.8,61.2
|
63 |
+
c-5.2,6-10.4,12-15.8,18.2c-2.7-2.1-5.2-4-7.7-6c-13.7-10.6-27.2-21.3-41-31.6c-3.1-2.3-5.7-3.5-8.1-3.5c-3,0-5.8,1.8-9.2,5.3
|
64 |
+
c-1,1-1.8,2-2.7,3.1c-2.5,3-2.9,6.2-0.8,9.5c2.5,3.9,5,7.9,7.8,11.6c18.3,23.8,36.6,47.5,55,71.3c2.2,2.9,4.8,4.4,7.4,4.4
|
65 |
+
c2.8,0,5.6-1.7,8-5.2c33.7-48.2,50.3-71.9,83.9-120.1C487.3,314.9,486.9,307.5,480.3,302z"
|
66 |
+
/>
|
67 |
+
</g>
|
68 |
+
</g>
|
69 |
+
</svg>
|
70 |
+
|
71 |
+
/* <svg
|
72 |
+
width="66px"
|
73 |
+
height="67px"
|
74 |
+
viewBox="0 0 66 67"
|
75 |
+
version="1.1"
|
76 |
+
xmlns="http://www.w3.org/2000/svg"
|
77 |
+
>
|
78 |
+
<g
|
79 |
+
id="Page-1"
|
80 |
+
stroke="none"
|
81 |
+
strokeWidth="1"
|
82 |
+
fill="none"
|
83 |
+
fillRule="evenodd"
|
84 |
+
>
|
85 |
+
<g id="vi_logo" transform="translate(2.000000, 2.000000)">
|
86 |
+
<path
|
87 |
+
d="M31.3,62.4 C48.5,62.4 62.4,48.5 62.4,31.2 C62.4,14 48.5,0 31.3,0 C14.1,0.1 0.2,14 0.2,31.2 C0.2,48.4 14.1,62.4 31.3,62.4"
|
88 |
+
id="Fill-1"
|
89 |
+
fill="#FEF200"
|
90 |
+
/>
|
91 |
+
<path
|
92 |
+
d="M31,63 C48.1,63 62,48.9 62,31.5 C62,14.1 48.1,0 31,0 C13.9,0 0,14.1 0,31.5 C0,48.9 13.9,63 31,63 L31,63 L31,63 L31,63 L31,63 Z"
|
93 |
+
id="Stroke-2"
|
94 |
+
stroke="#000000"
|
95 |
+
strokeWidth="4"
|
96 |
+
/>
|
97 |
+
<path
|
98 |
+
d="M22,45 L28,45 L36.3,24.5 L30.1,24.5 L27.5,31 C26.7,33.1 25.8,35.5 25,37.5 L25,37.5 C24.3,35.4 23.5,33.2 22.7,31 L20.3,24.4 L13.6,24.4 L22,45 L22,45 L22,45 L22,45 L22,45 Z M38.4,45 L44.7,45 L44.7,24.5 L38.4,24.5 L38.4,45 L38.4,45 L38.4,45 L38.4,45 Z"
|
99 |
+
id="Fill-4"
|
100 |
+
fill="#000000"
|
101 |
+
/>
|
102 |
+
<polygon
|
103 |
+
id="Fill-5"
|
104 |
+
fill="#000000"
|
105 |
+
points="38.4 21.1 44.7 21.1 44.7 14.8 38.4 14.8"
|
106 |
+
/>
|
107 |
+
</g>
|
108 |
+
</g>
|
109 |
+
</svg> */
|
110 |
+
),
|
111 |
+
category: "embed", // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
|
112 |
+
keywords: [__("video"), __("story"), __("ad")],
|
113 |
+
description: __("Video ad powered by vi intelligence."),
|
114 |
+
supports: {
|
115 |
+
multiple: false,
|
116 |
+
},
|
117 |
+
attributes: {
|
118 |
+
shortcode: {
|
119 |
+
type: "string",
|
120 |
+
default: "[embed-vi-ad]"
|
121 |
+
}
|
122 |
+
},
|
123 |
+
|
124 |
+
/**
|
125 |
+
* The edit function describes the structure of your block in the context of the editor.
|
126 |
+
* This represents what the editor will render when the block is used.
|
127 |
+
*
|
128 |
+
* The "edit" property must be a valid function.
|
129 |
+
*
|
130 |
+
* @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
|
131 |
+
*/
|
132 |
+
edit: class extends Component {
|
133 |
+
constructor(props) {
|
134 |
+
super(...arguments);
|
135 |
+
this.props = props;
|
136 |
+
}
|
137 |
+
|
138 |
+
render() {
|
139 |
+
if (this.props.attributes.shortcode) {
|
140 |
+
return (
|
141 |
+
<div className="vi-story-demo--box">
|
142 |
+
<div className="vi-story-demo--screen">
|
143 |
+
<span>AD + CONTENT</span>
|
144 |
+
</div>
|
145 |
+
<div
|
146 |
+
className="vi-story-demo--info"
|
147 |
+
style={{
|
148 |
+
backgroundColor: window._EPYTA_.vi_js_settings.backgroundColor
|
149 |
+
}}
|
150 |
+
>
|
151 |
+
<div
|
152 |
+
className="vi-story-demo--title"
|
153 |
+
style={{
|
154 |
+
fontFamily: window._EPYTA_.vi_js_settings.font,
|
155 |
+
fontSize: window._EPYTA_.vi_js_settings.fontSize,
|
156 |
+
color: window._EPYTA_.vi_js_settings.textColor
|
157 |
+
}}
|
158 |
+
>
|
159 |
+
Example vi Story Title Text
|
160 |
+
</div>
|
161 |
+
<div
|
162 |
+
className="vi-story-demo--featured"
|
163 |
+
style={{ color: window._EPYTA_.vi_js_settings.textColor }}
|
164 |
+
>
|
165 |
+
<span
|
166 |
+
style={{ color: window._EPYTA_.vi_js_settings.textColor }}
|
167 |
+
>
|
168 |
+
featured by
|
169 |
+
</span>{" "}
|
170 |
+
<img
|
171 |
+
alt="vi logo"
|
172 |
+
src={window._EPYT_.eppath + "images/vi_logo.svg"}
|
173 |
+
/>
|
174 |
+
</div>
|
175 |
+
</div>
|
176 |
+
</div>
|
177 |
+
);
|
178 |
+
}
|
179 |
+
return null;
|
180 |
+
}
|
181 |
+
},
|
182 |
+
|
183 |
+
/**
|
184 |
+
* The save function defines the way in which the different attributes should be combined
|
185 |
+
* into the final markup, which is then serialized by Gutenberg into post_content.
|
186 |
+
*
|
187 |
+
* The "save" property must be specified and must be a valid function.
|
188 |
+
*
|
189 |
+
* @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
|
190 |
+
*/
|
191 |
+
save: function(props) {
|
192 |
+
return <Fragment>{props.attributes.shortcode}</Fragment>;
|
193 |
+
}
|
194 |
+
});
|
src/viblock/editor.scss
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* #.# Editor Styles
|
3 |
+
*
|
4 |
+
* CSS for just Backend enqueued after style.scss
|
5 |
+
* which makes it higher in priority.
|
6 |
+
*/
|
src/viblock/style.scss
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* #.# Styles
|
3 |
+
*
|
4 |
+
* CSS for both Frontend+Backend.
|
5 |
+
*/
|
6 |
+
|
styles/epyt_mce_wizard_button.css
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
i.epyt_mce_wizard_button--icon {
|
2 |
+
background: transparent url("../images/btnwizoff.png") no-repeat scroll center center !important;
|
3 |
+
}
|
4 |
+
|
5 |
+
i.epyt_mce_wizard_button--icon:hover {
|
6 |
+
background-image: url("../images/btnwizon.png") !important;
|
7 |
+
}
|
styles/epyt_mce_wizard_button.min.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
|
2 |
+
i.epyt_mce_wizard_button--icon{background:transparent url("../images/btnwizoff.png") no-repeat scroll center center!important}i.epyt_mce_wizard_button--icon:hover{background-image:url("../images/btnwizon.png")!important}
|
styles/ytvi-admin.css
CHANGED
@@ -152,7 +152,7 @@ sup.orange {text-transform: lowercase; font-weight: bold; color: #f85d00;}
|
|
152 |
font-style: italic;
|
153 |
}
|
154 |
|
155 |
-
.vi-adstxt-diff code, .adstxt-verify-message code {
|
156 |
white-space: pre;
|
157 |
display: block;
|
158 |
overflow: auto;
|
@@ -502,7 +502,7 @@ h2 .vi-num {
|
|
502 |
opacity: 0.5;
|
503 |
}
|
504 |
|
505 |
-
.vi-story-demo--featured img {
|
506 |
width: 20px;
|
507 |
height: 20px;
|
508 |
vertical-align: middle;
|
152 |
font-style: italic;
|
153 |
}
|
154 |
|
155 |
+
.vi-adstxt-diff code, .adstxt-verify-message code, code.adstxt-block {
|
156 |
white-space: pre;
|
157 |
display: block;
|
158 |
overflow: auto;
|
502 |
opacity: 0.5;
|
503 |
}
|
504 |
|
505 |
+
.vi-story-demo--box .vi-story-demo--featured img {
|
506 |
width: 20px;
|
507 |
height: 20px;
|
508 |
vertical-align: middle;
|
styles/ytvi-admin.min.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
|
2 |
-
.clearboth{clear:both}sup.orange{text-transform:lowercase;font-weight:bold;color:#f85d00}.align-middle{vertical-align:middle!important}.vi-registration-box{position:relative}.vi-cover-prompt{position:absolute;width:100%;height:100%;top:0;left:0;z-index:100;background-color:rgba(241,241,241,.93);text-align:center}.vi-cover-prompt::before{content:"";display:none;z-index:10000;position:absolute;width:100%;height:100%;margin:0;padding:0;-webkit-filter:url(#viblurfilter);-moz-filter:url(#viblurfilter);-o-filter:url(#viblurfilter);-ms-filter:url(#viblurfilter);filter:url(#viblurfilter)}.vi-cover-prompt-buttons button.button-primary,.vi-cover-prompt-buttons button.button-secondary{display:inline-block;margin:0 5px}.viblurfilter-svg{width:0;height:0;margin:0;padding:0;border:0}.vi-cover-prompt h1{text-align:center;margin-top:50px}.ytvi-wrap *{box-sizing:border-box}.ytvi-wrap .center{text-align:center}.ytvi-wrap input.regular-text{width:100%}.ytvi-step-1,.ytvi-step-2{text-align:left}.ytvi-step-1{width:auto;padding:0;max-width:870px;margin:0 auto}.ytvi-step-1 .button-primary{font-size:16px}.ytvi-step-1--form,.ytvi-login-success,.ytvi-step-2-loading,.ytvi-login-loading,.ytvi-login-complete{background:#fff;border:solid 1px #e5e5e5;padding:15px 0;width:100%;margin:30px auto}.ytvi-step-1--form .side-signup{width:49.5%;float:left;border-right:1px solid #ccc;padding:0 40px}.ytvi-step-1--form .side-login{width:49.5%;float:right;padding:0 40px 0 30px}.ytvi-step-1--form .side-login h2,.ytvi-step-1--form .side-signup h2{font-size:1.15em}.wrap .ytvi-step-1--form h2{margin:10px 0 15px 0;font-weight:normal}.ytvi-step-2-loading,.ytvi-step-2,.ytvi-login-loading,.ytvi-login-success{display:none}.ytvi-loading--message{text-align:center;font-size:16px}.ytvi-step-2 .ytvi-registration{max-width:870px;margin:0 auto}.ytvi-step-2 .ytvi-registration iframe{border-width:0;padding:0;margin:0 auto;width:100%;height:575px;display:block}.ytvi-step-2-msg{background-color:#d8ebf3;border:1px solid #d0d0d0;margin:0 26px}.ytvi-login-success,.ytvi-login-complete{max-width:100%;text-align:center;padding:25px 40px}.vi-adstxt-diff{text-align:left}.vi-adstxt-diff p{font-style:italic}.vi-adstxt-diff code,.adstxt-verify-message code{white-space:pre;display:block;overflow:auto;margin:25px 0}section.pattern h2{background-color:rgba(255,255,255,0);transition:background-color 2s ease-out 0s}section.pattern h2.ytvi-hash-scroll{background-color:rgba(255,255,255,1);transition:background-color 0s}h3.sect{transition:background-color 2s ease-out 0s}h3.sect.ytvi-hash-scroll{background-color:rgba(255,255,255,1);transition:background-color 0s}.vi-forgot-pw{display:inline-block;float:right;padding-top:5px}.vi-contact-support{margin-top:30px;clear:left;padding-top:20px}.vi-logo-text{height:1.2em;width:auto;vertical-align:text-bottom}.vi-demo{max-width:1360px;margin:0 auto}p.vi-demo-lede,#ytform p.vi-demo-lede{font-size:17px;line-height:1.5}.wrap-vi-settings-pre p.vi-demo-lede{padding-top:.75em}.vi-demo-col-phone{float:right;width:330px;clear:right}.vi-demo-col-content{width:calc(100% - 340px)}.vi-demo-mobile{margin:0 auto;width:300px;background:transparent url(../images/vi-mobile-phone.png) no-repeat scroll;background-size:cover}.vi-demo-mobile-caption-list{position:relative;min-height:115px}.vi-demo-mobile-caption{font-style:italic;margin:0 10px;position:absolute;top:0;left:0;opacity:1;transition:ease-in-out opacity 3s}.vi-demo-mobile-ratio{position:relative;width:100%;height:0;padding-bottom:175.89%}.vi-demo-mobile-bg{position:absolute;top:0;left:0;width:100%;height:100%}.vi-demo-screen{position:absolute;top:5.5%;left:12%;width:76%;height:auto;z-index:1;opacity:1;transition:ease-in-out opacity 4s}.vi-demo-screen.demo-hide,.vi-demo-mobile-caption.demo-hide{opacity:0;transition:ease-in-out opacity 3s}.vi-demo-screen-2{z-index:2}p.vi-ad-source-row{text-align:center;margin-top:20px}.vi-ad-source-row img{vertical-align:middle;display:inline-block;margin-bottom:13px;padding:0 13px 0 13px;max-height:20px;height:auto;width:auto}.login-expire{background-color:#d8ebf3;border:1px solid #d0d0d0;padding:25px}.wrap-vi{max-width:1064px;margin-bottom:100px}.wrap-vi h1 .yt-admin-icon{width:16px;height:16px}.wrap-vi h1 a.button-primary,.wrap-vi h1 a.button-secondary,.wrap-ytprefs h2 a.button-primary,.wrap-ytprefs h2 a.button-secondary{float:right;margin-left:15px}.wrap-vi section{margin-left:20px;display:none;padding-top:15px}.wrap-vi th label{display:block}.wrap-vi th small{font-weight:normal;font-style:italic}.wrap-vi h2.nav-tab-wrapper{margin:22px 0 0 0}.wrap-vi section#jumphowitworks{display:block}.wrap-vi .no-js section{display:block}.wrap-vi h2{margin-bottom:30px;margin-left:0}.wrap-vi h3{font-size:1.2em;font-style:italic}.save-changes-follow{position:fixed;z-index:10000;bottom:0;right:0;background-color:#fff;padding:0 20px;border-top-left-radius:20px;border:2px solid #aaa;border-right-width:0;border-bottom-width:0;-webkit-box-shadow:0 0 10px 0 rgba(0,0,0,0.75);-moz-box-shadow:0 0 10px 0 rgba(0,0,0,0.75);box-shadow:0 0 10px 0 rgba(0,0,0,0.75)}.button-primary{white-space:nowrap}p.submit{margin:0;padding:15px 0 10px 0}.wp-core-ui p.submit .button-primary{font-weight:bold;font-size:21px;height:50px;padding:0 20px 1px;background:#2ea2cc;background:-moz-linear-gradient(top,#2ea2cc 0,#007396 98%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#2ea2cc),color-stop(98%,#007396));background:-webkit-linear-gradient(top,#2ea2cc 0,#007396 98%);background:-o-linear-gradient(top,#2ea2cc 0,#007396 98%);background:-ms-linear-gradient(top,#2ea2cc 0,#007396 98%);background:linear-gradient(to bottom,#2ea2cc 0,#007396 98%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2ea2cc',endColorstr='#007396',GradientType=0)}p.submit em{display:inline-block;padding-left:20px;vertical-align:middle;width:240px;margin-top:-6px}.vi-red{color:#de1515}a.button-primary.ytvi-btn-inactive,a.button-primary.ytvi-btn-inactive:hover{background:#de1515;border-color:#a22222;box-shadow:0 1px 0 #a22222;text-shadow:0 -1px 1px #a22222,1px 0 1px #a22222,0 1px 1px #a22222,-1px 0 1px #a22222}a.button-primary.ytvi-btn-inactive:hover{background:#e51f1f}.iab-cat-parent{margin-right:15px;display:inline-block}.iab-cat-child-box{display:inline-block}.iab-cat-child-box.hidden{opacity:.3}.iab-cat-child option.hidden{display:none}.wp-picker-container.wp-picker-active .wp-color-result-text{font-weight:bold}ul.list-ul{margin:15px 30px}ul.list-ul li{list-style-type:disc}.alertify .ajs-dialog{max-width:600px}.alertify .ajs-body .ajs-content{line-height:2em}.alertify .ajs-body .ajs-content code{white-space:pre;display:block;overflow:auto;line-height:1.4em;margin:1em auto}.ajs-button{cursor:pointer}.ss-vi-img{max-width:700px;height:auto}.ss-vi-wizbutton{max-width:100%;height:auto}.vi-how-works{margin-bottom:40px;position:relative;margin-left:10px}.vi-how-works::before{clear:both}.vi-how-works p{line-height:1}.vi-how-works img{width:50px;height:50px;float:left;margin-right:15px;transition:ease-in-out transform,opacity .1s;opacity:.5}.vi-how-works:hover img{transform:scale(1.1);opacity:1;transition:ease-in-out transform,opacity .2s}.vi-how-works h3{margin-bottom:0}.vi-how-works .vi-num{position:absolute;left:-20px;font-size:22px;font-weight:bold;color:#000;opacity:.2;font-style:italic;transition:ease-in-out transform,opacity .1s}.vi-how-works:hover .vi-num{transform:scale(1.1);opacity:1;transition:ease-in-out transform,opacity .2s}h2 .vi-num{font-style:italic;opacity:.5}.form-table.form-table--vi-appearance{width:100%}.form-table td{vertical-align:top}.vi-story-demo{width:65%;position:relative;margin:20px auto}.vi-story-demo--box{border:solid 1px #e3e3e3}.vi-story-demo--screen{width:100%;padding-top:57%;background-color:#888;position:relative}.vi-story-demo--screen span{color:#ccc;position:absolute;width:100%;text-align:center;font-size:20px;top:50%;font-style:italic}.vi-story-demo--info{padding:8px}.vi-story-demo--featured{height:20px;font-size:9px;text-align:right;margin-top:8px;text-transform:uppercase;line-height:20px;font-family:Verdana,sans-serif}.vi-story-demo--title{font-weight:bold;line-height:1.33}.vi-story-demo--featured span{opacity:.5}.vi-story-demo--featured img{width:20px;height:20px;vertical-align:middle;margin:-4px 0 0 5px}@media(min-width:768px){.form-table.form-table--vi-appearance{width:53%;float:left;clear:left}.vi-story-demo{float:right;width:44%;position:relative}}.nav-tab-valid,.nav-tab-valid:focus,.adstxt-verify-message-valid{color:#00a000;font-weight:bold}.nav-tab-valid:after{content:url('../images/adstxt-valid.png')}.nav-tab-invalid,.nav-tab-invalid:focus{color:#c00}.nav-tab-invalid:after{content:url('../images/adstxt-invalid.png')}.nav-tab-loading:after{content:url('../images/ajax-loader.gif')}.vi-report-error.hide,.vi-report.hide{display:none}.vi-report,.vi-report-error{text-align:center}.vi-total-earnings,.vi-total-earnings-error{float:left;width:25%;margin-top:60px;color:#1193aa}.vi-report-graph,.vi-report-graph-error{float:right;width:75%}.vi-report-canvas-box,.vi-report-canvas-box-error{height:300px;width:100%}.vi-total-earnings-num,.vi-total-earnings-num-error{margin-top:20px;font-weight:bold;font-size:3.7vw;line-height:3.7vw}.vi-total-earnings-num-error,.vi-report-canvas-box-error{color:#ccc;font-weight:normal;font-size:45px;line-height:45px}.vi-report-canvas-box-error{background-size:10% 10%;background-image:linear-gradient(to right,#ddd 1px,transparent 1px),linear-gradient(to bottom,#ddd 1px,transparent 1px)}@media(min-width:1280px){.vi-total-earnings-num,.vi-total-earnings-num-error{font-size:45px;line-height:45px}}
|
1 |
|
2 |
+
.clearboth{clear:both}sup.orange{text-transform:lowercase;font-weight:bold;color:#f85d00}.align-middle{vertical-align:middle!important}.vi-registration-box{position:relative}.vi-cover-prompt{position:absolute;width:100%;height:100%;top:0;left:0;z-index:100;background-color:rgba(241,241,241,.93);text-align:center}.vi-cover-prompt::before{content:"";display:none;z-index:10000;position:absolute;width:100%;height:100%;margin:0;padding:0;-webkit-filter:url(#viblurfilter);-moz-filter:url(#viblurfilter);-o-filter:url(#viblurfilter);-ms-filter:url(#viblurfilter);filter:url(#viblurfilter)}.vi-cover-prompt-buttons button.button-primary,.vi-cover-prompt-buttons button.button-secondary{display:inline-block;margin:0 5px}.viblurfilter-svg{width:0;height:0;margin:0;padding:0;border:0}.vi-cover-prompt h1{text-align:center;margin-top:50px}.ytvi-wrap *{box-sizing:border-box}.ytvi-wrap .center{text-align:center}.ytvi-wrap input.regular-text{width:100%}.ytvi-step-1,.ytvi-step-2{text-align:left}.ytvi-step-1{width:auto;padding:0;max-width:870px;margin:0 auto}.ytvi-step-1 .button-primary{font-size:16px}.ytvi-step-1--form,.ytvi-login-success,.ytvi-step-2-loading,.ytvi-login-loading,.ytvi-login-complete{background:#fff;border:solid 1px #e5e5e5;padding:15px 0;width:100%;margin:30px auto}.ytvi-step-1--form .side-signup{width:49.5%;float:left;border-right:1px solid #ccc;padding:0 40px}.ytvi-step-1--form .side-login{width:49.5%;float:right;padding:0 40px 0 30px}.ytvi-step-1--form .side-login h2,.ytvi-step-1--form .side-signup h2{font-size:1.15em}.wrap .ytvi-step-1--form h2{margin:10px 0 15px 0;font-weight:normal}.ytvi-step-2-loading,.ytvi-step-2,.ytvi-login-loading,.ytvi-login-success{display:none}.ytvi-loading--message{text-align:center;font-size:16px}.ytvi-step-2 .ytvi-registration{max-width:870px;margin:0 auto}.ytvi-step-2 .ytvi-registration iframe{border-width:0;padding:0;margin:0 auto;width:100%;height:575px;display:block}.ytvi-step-2-msg{background-color:#d8ebf3;border:1px solid #d0d0d0;margin:0 26px}.ytvi-login-success,.ytvi-login-complete{max-width:100%;text-align:center;padding:25px 40px}.vi-adstxt-diff{text-align:left}.vi-adstxt-diff p{font-style:italic}.vi-adstxt-diff code,.adstxt-verify-message code,code.adstxt-block{white-space:pre;display:block;overflow:auto;margin:25px 0}section.pattern h2{background-color:rgba(255,255,255,0);transition:background-color 2s ease-out 0s}section.pattern h2.ytvi-hash-scroll{background-color:rgba(255,255,255,1);transition:background-color 0s}h3.sect{transition:background-color 2s ease-out 0s}h3.sect.ytvi-hash-scroll{background-color:rgba(255,255,255,1);transition:background-color 0s}.vi-forgot-pw{display:inline-block;float:right;padding-top:5px}.vi-contact-support{margin-top:30px;clear:left;padding-top:20px}.vi-logo-text{height:1.2em;width:auto;vertical-align:text-bottom}.vi-demo{max-width:1360px;margin:0 auto}p.vi-demo-lede,#ytform p.vi-demo-lede{font-size:17px;line-height:1.5}.wrap-vi-settings-pre p.vi-demo-lede{padding-top:.75em}.vi-demo-col-phone{float:right;width:330px;clear:right}.vi-demo-col-content{width:calc(100% - 340px)}.vi-demo-mobile{margin:0 auto;width:300px;background:transparent url(../images/vi-mobile-phone.png) no-repeat scroll;background-size:cover}.vi-demo-mobile-caption-list{position:relative;min-height:115px}.vi-demo-mobile-caption{font-style:italic;margin:0 10px;position:absolute;top:0;left:0;opacity:1;transition:ease-in-out opacity 3s}.vi-demo-mobile-ratio{position:relative;width:100%;height:0;padding-bottom:175.89%}.vi-demo-mobile-bg{position:absolute;top:0;left:0;width:100%;height:100%}.vi-demo-screen{position:absolute;top:5.5%;left:12%;width:76%;height:auto;z-index:1;opacity:1;transition:ease-in-out opacity 4s}.vi-demo-screen.demo-hide,.vi-demo-mobile-caption.demo-hide{opacity:0;transition:ease-in-out opacity 3s}.vi-demo-screen-2{z-index:2}p.vi-ad-source-row{text-align:center;margin-top:20px}.vi-ad-source-row img{vertical-align:middle;display:inline-block;margin-bottom:13px;padding:0 13px 0 13px;max-height:20px;height:auto;width:auto}.login-expire{background-color:#d8ebf3;border:1px solid #d0d0d0;padding:25px}.wrap-vi{max-width:1064px;margin-bottom:100px}.wrap-vi h1 .yt-admin-icon{width:16px;height:16px}.wrap-vi h1 a.button-primary,.wrap-vi h1 a.button-secondary,.wrap-ytprefs h2 a.button-primary,.wrap-ytprefs h2 a.button-secondary{float:right;margin-left:15px}.wrap-vi section{margin-left:20px;display:none;padding-top:15px}.wrap-vi th label{display:block}.wrap-vi th small{font-weight:normal;font-style:italic}.wrap-vi h2.nav-tab-wrapper{margin:22px 0 0 0}.wrap-vi section#jumphowitworks{display:block}.wrap-vi .no-js section{display:block}.wrap-vi h2{margin-bottom:30px;margin-left:0}.wrap-vi h3{font-size:1.2em;font-style:italic}.save-changes-follow{position:fixed;z-index:10000;bottom:0;right:0;background-color:#fff;padding:0 20px;border-top-left-radius:20px;border:2px solid #aaa;border-right-width:0;border-bottom-width:0;-webkit-box-shadow:0 0 10px 0 rgba(0,0,0,0.75);-moz-box-shadow:0 0 10px 0 rgba(0,0,0,0.75);box-shadow:0 0 10px 0 rgba(0,0,0,0.75)}.button-primary{white-space:nowrap}p.submit{margin:0;padding:15px 0 10px 0}.wp-core-ui p.submit .button-primary{font-weight:bold;font-size:21px;height:50px;padding:0 20px 1px;background:#2ea2cc;background:-moz-linear-gradient(top,#2ea2cc 0,#007396 98%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#2ea2cc),color-stop(98%,#007396));background:-webkit-linear-gradient(top,#2ea2cc 0,#007396 98%);background:-o-linear-gradient(top,#2ea2cc 0,#007396 98%);background:-ms-linear-gradient(top,#2ea2cc 0,#007396 98%);background:linear-gradient(to bottom,#2ea2cc 0,#007396 98%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2ea2cc',endColorstr='#007396',GradientType=0)}p.submit em{display:inline-block;padding-left:20px;vertical-align:middle;width:240px;margin-top:-6px}.vi-red{color:#de1515}a.button-primary.ytvi-btn-inactive,a.button-primary.ytvi-btn-inactive:hover{background:#de1515;border-color:#a22222;box-shadow:0 1px 0 #a22222;text-shadow:0 -1px 1px #a22222,1px 0 1px #a22222,0 1px 1px #a22222,-1px 0 1px #a22222}a.button-primary.ytvi-btn-inactive:hover{background:#e51f1f}.iab-cat-parent{margin-right:15px;display:inline-block}.iab-cat-child-box{display:inline-block}.iab-cat-child-box.hidden{opacity:.3}.iab-cat-child option.hidden{display:none}.wp-picker-container.wp-picker-active .wp-color-result-text{font-weight:bold}ul.list-ul{margin:15px 30px}ul.list-ul li{list-style-type:disc}.alertify .ajs-dialog{max-width:600px}.alertify .ajs-body .ajs-content{line-height:2em}.alertify .ajs-body .ajs-content code{white-space:pre;display:block;overflow:auto;line-height:1.4em;margin:1em auto}.ajs-button{cursor:pointer}.ss-vi-img{max-width:700px;height:auto}.ss-vi-wizbutton{max-width:100%;height:auto}.vi-how-works{margin-bottom:40px;position:relative;margin-left:10px}.vi-how-works::before{clear:both}.vi-how-works p{line-height:1}.vi-how-works img{width:50px;height:50px;float:left;margin-right:15px;transition:ease-in-out transform,opacity .1s;opacity:.5}.vi-how-works:hover img{transform:scale(1.1);opacity:1;transition:ease-in-out transform,opacity .2s}.vi-how-works h3{margin-bottom:0}.vi-how-works .vi-num{position:absolute;left:-20px;font-size:22px;font-weight:bold;color:#000;opacity:.2;font-style:italic;transition:ease-in-out transform,opacity .1s}.vi-how-works:hover .vi-num{transform:scale(1.1);opacity:1;transition:ease-in-out transform,opacity .2s}h2 .vi-num{font-style:italic;opacity:.5}.form-table.form-table--vi-appearance{width:100%}.form-table td{vertical-align:top}.vi-story-demo{width:65%;position:relative;margin:20px auto}.vi-story-demo--box{border:solid 1px #e3e3e3}.vi-story-demo--screen{width:100%;padding-top:57%;background-color:#888;position:relative}.vi-story-demo--screen span{color:#ccc;position:absolute;width:100%;text-align:center;font-size:20px;top:50%;font-style:italic}.vi-story-demo--info{padding:8px}.vi-story-demo--featured{height:20px;font-size:9px;text-align:right;margin-top:8px;text-transform:uppercase;line-height:20px;font-family:Verdana,sans-serif}.vi-story-demo--title{font-weight:bold;line-height:1.33}.vi-story-demo--featured span{opacity:.5}.vi-story-demo--box .vi-story-demo--featured img{width:20px;height:20px;vertical-align:middle;margin:-4px 0 0 5px}@media(min-width:768px){.form-table.form-table--vi-appearance{width:53%;float:left;clear:left}.vi-story-demo{float:right;width:44%;position:relative}}.nav-tab-valid,.nav-tab-valid:focus,.adstxt-verify-message-valid{color:#00a000;font-weight:bold}.nav-tab-valid:after{content:url('../images/adstxt-valid.png')}.nav-tab-invalid,.nav-tab-invalid:focus{color:#c00}.nav-tab-invalid:after{content:url('../images/adstxt-invalid.png')}.nav-tab-loading:after{content:url('../images/ajax-loader.gif')}.vi-report-error.hide,.vi-report.hide{display:none}.vi-report,.vi-report-error{text-align:center}.vi-total-earnings,.vi-total-earnings-error{float:left;width:25%;margin-top:60px;color:#1193aa}.vi-report-graph,.vi-report-graph-error{float:right;width:75%}.vi-report-canvas-box,.vi-report-canvas-box-error{height:300px;width:100%}.vi-total-earnings-num,.vi-total-earnings-num-error{margin-top:20px;font-weight:bold;font-size:3.7vw;line-height:3.7vw}.vi-total-earnings-num-error,.vi-report-canvas-box-error{color:#ccc;font-weight:normal;font-size:45px;line-height:45px}.vi-report-canvas-box-error{background-size:10% 10%;background-image:linear-gradient(to right,#ddd 1px,transparent 1px),linear-gradient(to bottom,#ddd 1px,transparent 1px)}@media(min-width:1280px){.vi-total-earnings-num,.vi-total-earnings-num-error{font-size:45px;line-height:45px}}
|
youtube.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: YouTube
|
4 |
Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
|
5 |
Description: YouTube Embed and YouTube Gallery WordPress Plugin. Embed a responsive video, YouTube channel, playlist gallery, or live stream
|
6 |
-
Version:
|
7 |
Author: EmbedPlus Team
|
8 |
Author URI: https://www.embedplus.com
|
9 |
*/
|
@@ -34,7 +34,7 @@ class YouTubePrefs
|
|
34 |
|
35 |
public static $folder_name = 'youtube-embed-plus';
|
36 |
public static $curltimeout = 30;
|
37 |
-
public static $version = '
|
38 |
public static $opt_version = 'version';
|
39 |
public static $optembedwidth = null;
|
40 |
public static $optembedheight = null;
|
@@ -250,6 +250,7 @@ class YouTubePrefs
|
|
250 |
add_action('admin_enqueue_scripts', array(get_class(), 'admin_enqueue_scripts'), 10, 1);
|
251 |
/////////////////////////////////////
|
252 |
include_once(EPYTVI_INCLUDES_PATH . 'vi_actions.php');
|
|
|
253 |
}
|
254 |
|
255 |
public static function separate_version_message()
|
@@ -1429,7 +1430,7 @@ class YouTubePrefs
|
|
1429 |
$txtprev = self::$alloptions[self::$opt_gallery_customarrows] ? self::$alloptions[self::$opt_gallery_customprev] : _('Prev');
|
1430 |
$pagination .= '<div tabindex="0" role="button" class="epyt-pagebutton epyt-prev ' . (empty($prevPageToken) ? ' hide ' : '') . '" data-q="' . esc_attr($options->q)
|
1431 |
. '" data-pagetoken="' . esc_attr($prevPageToken)
|
1432 |
-
. '"><div class="arrow">«</div> <div>' . $txtprev . '</div></div>';
|
1433 |
|
1434 |
|
1435 |
$pagination .= '<div class="epyt-pagenumbers ' . ($totalPages > 1 ? '' : 'hide') . '">';
|
@@ -1439,7 +1440,7 @@ class YouTubePrefs
|
|
1439 |
$txtnext = self::$alloptions[self::$opt_gallery_customarrows] ? self::$alloptions[self::$opt_gallery_customnext] : _('Next');
|
1440 |
$pagination .= '<div tabindex="0" role="button" class="epyt-pagebutton epyt-next' . (empty($nextPageToken) ? ' hide ' : '') . '" data-q="' . esc_attr($options->q)
|
1441 |
. '" data-pagetoken="' . esc_attr($nextPageToken)
|
1442 |
-
. '"><div>' . $txtnext . '</div> <div class="arrow">»</div></div>';
|
1443 |
|
1444 |
$pagination .= '<div class="epyt-loader"><img alt="loading" width="16" height="11" src="' . plugins_url('images/gallery-page-loader.gif', __FILE__) . '"></div>';
|
1445 |
$pagination .= '</div>';
|
@@ -1495,7 +1496,7 @@ class YouTubePrefs
|
|
1495 |
return false;
|
1496 |
}
|
1497 |
|
1498 |
-
public static function
|
1499 |
{
|
1500 |
$curr_user = wp_get_current_user();
|
1501 |
if (
|
@@ -1503,6 +1504,15 @@ class YouTubePrefs
|
|
1503 |
&& isset(self::$alloptions[self::$opt_restrict_wizard]) && self::$alloptions[self::$opt_restrict_wizard] == 1 // restricting
|
1504 |
&& is_array(self::$alloptions[self::$opt_restrict_wizard_roles]) && !self::user_in_roles_any($curr_user, self::$alloptions[self::$opt_restrict_wizard_roles])
|
1505 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1506 |
{
|
1507 |
return;
|
1508 |
}
|
@@ -1630,6 +1640,7 @@ class YouTubePrefs
|
|
1630 |
security: "<?php echo wp_create_nonce('embedplus-nonce'); ?>",
|
1631 |
gallery_scrolloffset: <?php echo intval(self::$alloptions[self::$opt_gallery_scrolloffset]) ?>,
|
1632 |
eppathtoscripts: "<?php echo plugins_url('scripts/', __FILE__); ?>",
|
|
|
1633 |
epresponsiveselector: <?php echo self::get_responsiveselector(); ?>,
|
1634 |
version: "<?php echo esc_attr(self::$alloptions[self::$opt_version]) ?>",
|
1635 |
epdovol: true,
|
@@ -1975,7 +1986,7 @@ class YouTubePrefs
|
|
1975 |
$currfilter = current_filter();
|
1976 |
if (preg_match(self::$justurlregex, $content))
|
1977 |
{
|
1978 |
-
return self::get_html(array($content), $currfilter
|
1979 |
}
|
1980 |
return '';
|
1981 |
}
|
@@ -2211,7 +2222,7 @@ class YouTubePrefs
|
|
2211 |
. '" data-showpaging="' . intval($options->showPaging)
|
2212 |
. '" data-autonext="' . intval($options->autonext)
|
2213 |
. '" data-thumbplay="' . intval($options->thumbplay)
|
2214 |
-
. '"><div class="arrow">«</div> <div>' . $txtprev . '</div></div>';
|
2215 |
|
2216 |
|
2217 |
$pagination .= '<div class="epyt-pagenumbers ' . ($totalPages > 1 ? '' : 'hide') . '">';
|
@@ -2227,7 +2238,7 @@ class YouTubePrefs
|
|
2227 |
. '" data-showpaging="' . intval($options->showPaging)
|
2228 |
. '" data-autonext="' . intval($options->autonext)
|
2229 |
. '" data-thumbplay="' . intval($options->thumbplay)
|
2230 |
-
. '"><div>' . $txtnext . '</div> <div class="arrow">»</div></div>';
|
2231 |
|
2232 |
$pagination .= '<div class="epyt-loader"><img alt="loading" width="16" height="11" src="' . plugins_url('images/gallery-page-loader.gif', __FILE__) . '"></div>';
|
2233 |
$pagination .= '</div>';
|
@@ -2490,8 +2501,9 @@ class YouTubePrefs
|
|
2490 |
$finalparams['autoplay'] = 0;
|
2491 |
}
|
2492 |
|
2493 |
-
$code1 = '<iframe ' . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight .
|
2494 |
-
'
|
|
|
2495 |
$code2 = '" class="__youtube_prefs__' . ($iscontent ? '' : ' __youtube_prefs_widget__') .
|
2496 |
'"' . $voloutput . $acctitle . $galleryid_ifm_data . ' allow="autoplay; encrypted-media" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>';
|
2497 |
|
@@ -2850,13 +2862,13 @@ class YouTubePrefs
|
|
2850 |
$new_pointer_content .= '<p>'; // ooopointer
|
2851 |
if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
|
2852 |
{
|
2853 |
-
$new_pointer_content .= "This
|
2854 |
-
|
2855 |
}
|
2856 |
else
|
2857 |
{
|
2858 |
-
$new_pointer_content .= "This
|
2859 |
-
$new_pointer_content .= '<strong>Important message to YouTube Pro users</strong>: From version 11.7 onward, you must <a href="https://www.embedplus.com/youtube-pro/download/?prokey=' . esc_attr(self::$alloptions[self::$opt_pro]) . '" target="_blank">download the separate plugin here</a> to regain your Pro features. All your settings will automatically migrate after installing the separate Pro download. Thank you for your support and patience during this transition.';
|
2860 |
}
|
2861 |
$new_pointer_content .= '</p>';
|
2862 |
|
@@ -2883,7 +2895,7 @@ class YouTubePrefs
|
|
2883 |
<h3 class="nav-tab-wrapper">
|
2884 |
<a class="nav-tab nav-tab-active" href="#jumpdefaults">Defaults</a>
|
2885 |
<a class="nav-tab" href="#jumpapikey">API Key</a>
|
2886 |
-
<a class="nav-tab" href="#jumpwiz">Wizard</a>
|
2887 |
<a class="nav-tab" href="#jumpgallery">Galleries</a>
|
2888 |
<a class="nav-tab href-link" style="background-color: #daebf1;" rel="#jumpupgrade" target="_blank" href="<?php echo self::$epbase . "/dashboard/pro-easy-video-analytics.aspx?ref=protab" ?>">Upgrade?</a>
|
2889 |
<?php
|
@@ -3352,6 +3364,21 @@ class YouTubePrefs
|
|
3352 |
min-height: 250px !important;
|
3353 |
}
|
3354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3355 |
</style>
|
3356 |
<div class="wrap wrap-ytprefs">
|
3357 |
<h1><img alt="YouTube Plugin Icon" src="<?php echo plugins_url('images/youtubeicon16.png', __FILE__) ?>" /> <?php echo __('YouTube Settings') ?></h1>
|
@@ -3439,11 +3466,19 @@ class YouTubePrefs
|
|
3439 |
</p>
|
3440 |
<p>
|
3441 |
<input name="<?php echo self::$opt_rel; ?>" id="<?php echo self::$opt_rel; ?>" <?php checked($all[self::$opt_rel], 1); ?> type="checkbox" class="checkbox">
|
3442 |
-
<label for="<?php echo self::$opt_rel; ?>"
|
|
|
|
|
|
|
|
|
3443 |
</p>
|
3444 |
<p>
|
3445 |
<input name="<?php echo self::$opt_showinfo; ?>" id="<?php echo self::$opt_showinfo; ?>" <?php checked($all[self::$opt_showinfo], 1); ?> type="checkbox" class="checkbox">
|
3446 |
-
<label for="<?php echo self::$opt_showinfo; ?>"
|
|
|
|
|
|
|
|
|
3447 |
</p>
|
3448 |
<p>
|
3449 |
<input name="<?php echo self::$opt_fs; ?>" id="<?php echo self::$opt_fs; ?>" <?php checked($all[self::$opt_fs], 1); ?> type="checkbox" class="checkbox">
|
@@ -3630,21 +3665,52 @@ class YouTubePrefs
|
|
3630 |
|
3631 |
<section class="pattern" id="jumpwiz">
|
3632 |
<h2>Visual YouTube Wizard Directions</h2>
|
3633 |
-
|
3634 |
<p>
|
3635 |
-
While you're writing your post or page, you have the ability to search YouTube and insert videos, playlists, and even galleries right from your editor
|
3636 |
-
|
3637 |
-
|
|
|
|
|
|
|
|
|
3638 |
Each embed code will have an "Insert Into Editor" button that you can click to directly embed the desired video link to your post without having to copy and paste.
|
3639 |
</p>
|
|
|
|
|
|
|
3640 |
<p>
|
3641 |
-
|
3642 |
-
|
3643 |
-
|
3644 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3645 |
</p>
|
3646 |
-
|
3647 |
</section>
|
|
|
3648 |
<section class="pattern" id="jumpgallery">
|
3649 |
<h2>Gallery Settings and Directions</h2>
|
3650 |
<img class="ssgallery" src="<?php echo plugins_url('images/ssgallery.png', __FILE__) ?>">
|
@@ -4861,6 +4927,7 @@ class YouTubePrefs
|
|
4861 |
'security' => wp_create_nonce('embedplus-nonce'),
|
4862 |
'gallery_scrolloffset' => intval(self::$alloptions[self::$opt_gallery_scrolloffset]),
|
4863 |
'eppathtoscripts' => plugins_url('scripts/', __FILE__),
|
|
|
4864 |
'epresponsiveselector' => self::get_responsiveselector(),
|
4865 |
'epdovol' => true,
|
4866 |
'version' => self::$alloptions[self::$opt_version],
|
@@ -4954,6 +5021,7 @@ class YouTubePrefs
|
|
4954 |
'vi_logged_in' => self::vi_logged_in(),
|
4955 |
'epbase' => self::$epbase,
|
4956 |
'admin_url' => admin_url(),
|
|
|
4957 |
'admin_url_ytprefs' => admin_url('admin.php?page=youtube-my-preferences')
|
4958 |
//'epblogwidth' => self::get_blogwidth(),
|
4959 |
//'epprokey' => self::$alloptions[self::$opt_pro],
|
@@ -5642,8 +5710,8 @@ class YouTubePrefs
|
|
5642 |
{
|
5643 |
return array(
|
5644 |
'code' => 0,
|
5645 |
-
'message' => '<h3>Almost There!</h3>
|
5646 |
-
. '
|
5647 |
. '<code>' . $user_adstxt . '</code>'
|
5648 |
);
|
5649 |
}
|
@@ -5783,10 +5851,6 @@ class YouTubePrefs
|
|
5783 |
{
|
5784 |
$messages[] = $apiResult->get_error_message();
|
5785 |
}
|
5786 |
-
// else if (wp_remote_retrieve_response_code($apiResult) >= 400)
|
5787 |
-
// {
|
5788 |
-
// $messages[] = esc_html(wp_remote_retrieve_body($apiResult)) . '(Error code ' . wp_remote_retrieve_response_code($apiResult) . ', v' . self::$version . '). Please try again later. If the problem persists, please contact support at ext@embedplus.com.';
|
5789 |
-
// }
|
5790 |
else
|
5791 |
{
|
5792 |
$jsonResult = json_decode($apiResult['body']);
|
@@ -5794,8 +5858,8 @@ class YouTubePrefs
|
|
5794 |
if (!empty($jsonResult->error))
|
5795 |
{
|
5796 |
//$messages[] = implode(': ', array('vi API - ' . self::vi_debug_json($apiResult)));
|
5797 |
-
$messages[] =
|
5798 |
-
|
5799 |
}
|
5800 |
|
5801 |
if (isset($jsonResult->status) && strcasecmp($jsonResult->status, 'ok') == 0 && isset($jsonResult->data) && strlen($jsonResult->data) > 0)
|
@@ -5917,7 +5981,7 @@ class YouTubePrefs
|
|
5917 |
}
|
5918 |
else
|
5919 |
{
|
5920 |
-
$messages[] = '
|
5921 |
$messages = array_merge($messages, $js);
|
5922 |
}
|
5923 |
}
|
@@ -6731,9 +6795,17 @@ margin: 0 auto;
|
|
6731 |
<p>
|
6732 |
Note that only one ad can appear on a page, but if you'd like more control of exactly <em>where</em> it's placed, see the "Manual" or "Theme Code" directions in the next sections.
|
6733 |
</p>
|
6734 |
-
<h3>Manual: Shortcode</h3>
|
6735 |
-
<p>
|
6736 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6737 |
|
6738 |
<h3>Theme Code (advanced)</h3>
|
6739 |
<p>You can also position the ad directly in your theme code. Copy the PHP code below and paste it where you would like it to appear in your theme.</p>
|
@@ -6749,6 +6821,13 @@ margin: 0 auto;
|
|
6749 |
<div class="adstxt-verify-message">
|
6750 |
|
6751 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6752 |
<p>
|
6753 |
Trouble with your ads.txt verification? Contact support at <strong><a href="mailto:ext@embedplus.com">ext@embedplus.com</a></strong>
|
6754 |
</p>
|
@@ -6866,9 +6945,21 @@ margin: 0 auto;
|
|
6866 |
</p>
|
6867 |
</li>
|
6868 |
<li>
|
6869 |
-
<h3>Why
|
6870 |
<p>
|
6871 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6872 |
</p>
|
6873 |
</li>
|
6874 |
<li>
|
@@ -6903,10 +6994,7 @@ margin: 0 auto;
|
|
6903 |
<li>
|
6904 |
<h3>When will I start seeing ads within the vi story?</h3>
|
6905 |
<p>
|
6906 |
-
It can vary depending on which countries the bulk of your traffic is coming from.
|
6907 |
-
</p>
|
6908 |
-
<p>
|
6909 |
-
<img src="<?php echo plugins_url(self::$folder_name . '/images/vi-demand-estimates.png') ?>"/>
|
6910 |
</p>
|
6911 |
</li>
|
6912 |
<li>
|
@@ -6945,7 +7033,7 @@ margin: 0 auto;
|
|
6945 |
public static function vi_monetize_title()
|
6946 |
{
|
6947 |
?>
|
6948 |
-
Join over
|
6949 |
<?php
|
6950 |
}
|
6951 |
|
@@ -7301,11 +7389,110 @@ margin: 0 auto;
|
|
7301 |
}
|
7302 |
}
|
7303 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7304 |
}
|
7305 |
|
7306 |
// constants
|
7307 |
define('EPYT_BASE_URL', rtrim(plugins_url('', __FILE__), "\\/") . '/');
|
7308 |
define('EPYTVI_INCLUDES_PATH', rtrim(dirname(__FILE__), "\\/") . '/includes/vi/');
|
|
|
7309 |
if (!defined('EPYTVI_ENDPOINTS_URL'))
|
7310 |
define('EPYTVI_ENDPOINTS_URL', 'https://dashboard-api.vidint.net/v1/api/widget/settings');
|
7311 |
|
3 |
Plugin Name: YouTube
|
4 |
Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
|
5 |
Description: YouTube Embed and YouTube Gallery WordPress Plugin. Embed a responsive video, YouTube channel, playlist gallery, or live stream
|
6 |
+
Version: 13.0
|
7 |
Author: EmbedPlus Team
|
8 |
Author URI: https://www.embedplus.com
|
9 |
*/
|
34 |
|
35 |
public static $folder_name = 'youtube-embed-plus';
|
36 |
public static $curltimeout = 30;
|
37 |
+
public static $version = '13.0';
|
38 |
public static $opt_version = 'version';
|
39 |
public static $optembedwidth = null;
|
40 |
public static $optembedheight = null;
|
250 |
add_action('admin_enqueue_scripts', array(get_class(), 'admin_enqueue_scripts'), 10, 1);
|
251 |
/////////////////////////////////////
|
252 |
include_once(EPYTVI_INCLUDES_PATH . 'vi_actions.php');
|
253 |
+
include_once(EPYTGB_INCLUDES_PATH . 'gutenberg_hooks.php');
|
254 |
}
|
255 |
|
256 |
public static function separate_version_message()
|
1430 |
$txtprev = self::$alloptions[self::$opt_gallery_customarrows] ? self::$alloptions[self::$opt_gallery_customprev] : _('Prev');
|
1431 |
$pagination .= '<div tabindex="0" role="button" class="epyt-pagebutton epyt-prev ' . (empty($prevPageToken) ? ' hide ' : '') . '" data-q="' . esc_attr($options->q)
|
1432 |
. '" data-pagetoken="' . esc_attr($prevPageToken)
|
1433 |
+
. '"><div class="epyt-arrow">«</div> <div>' . $txtprev . '</div></div>';
|
1434 |
|
1435 |
|
1436 |
$pagination .= '<div class="epyt-pagenumbers ' . ($totalPages > 1 ? '' : 'hide') . '">';
|
1440 |
$txtnext = self::$alloptions[self::$opt_gallery_customarrows] ? self::$alloptions[self::$opt_gallery_customnext] : _('Next');
|
1441 |
$pagination .= '<div tabindex="0" role="button" class="epyt-pagebutton epyt-next' . (empty($nextPageToken) ? ' hide ' : '') . '" data-q="' . esc_attr($options->q)
|
1442 |
. '" data-pagetoken="' . esc_attr($nextPageToken)
|
1443 |
+
. '"><div>' . $txtnext . '</div> <div class="epyt-arrow">»</div></div>';
|
1444 |
|
1445 |
$pagination .= '<div class="epyt-loader"><img alt="loading" width="16" height="11" src="' . plugins_url('images/gallery-page-loader.gif', __FILE__) . '"></div>';
|
1446 |
$pagination .= '</div>';
|
1496 |
return false;
|
1497 |
}
|
1498 |
|
1499 |
+
public static function is_restrict_wizard()
|
1500 |
{
|
1501 |
$curr_user = wp_get_current_user();
|
1502 |
if (
|
1504 |
&& isset(self::$alloptions[self::$opt_restrict_wizard]) && self::$alloptions[self::$opt_restrict_wizard] == 1 // restricting
|
1505 |
&& is_array(self::$alloptions[self::$opt_restrict_wizard_roles]) && !self::user_in_roles_any($curr_user, self::$alloptions[self::$opt_restrict_wizard_roles])
|
1506 |
)
|
1507 |
+
{
|
1508 |
+
return true;
|
1509 |
+
}
|
1510 |
+
return false;
|
1511 |
+
}
|
1512 |
+
|
1513 |
+
public static function media_button_wizard()
|
1514 |
+
{
|
1515 |
+
if (self::is_restrict_wizard())
|
1516 |
{
|
1517 |
return;
|
1518 |
}
|
1640 |
security: "<?php echo wp_create_nonce('embedplus-nonce'); ?>",
|
1641 |
gallery_scrolloffset: <?php echo intval(self::$alloptions[self::$opt_gallery_scrolloffset]) ?>,
|
1642 |
eppathtoscripts: "<?php echo plugins_url('scripts/', __FILE__); ?>",
|
1643 |
+
eppath: "<?php echo plugins_url('/', __FILE__); ?>",
|
1644 |
epresponsiveselector: <?php echo self::get_responsiveselector(); ?>,
|
1645 |
version: "<?php echo esc_attr(self::$alloptions[self::$opt_version]) ?>",
|
1646 |
epdovol: true,
|
1986 |
$currfilter = current_filter();
|
1987 |
if (preg_match(self::$justurlregex, $content))
|
1988 |
{
|
1989 |
+
return self::get_html(array($content), strpos($currfilter, 'widget_text') === 0 ? false : true);
|
1990 |
}
|
1991 |
return '';
|
1992 |
}
|
2222 |
. '" data-showpaging="' . intval($options->showPaging)
|
2223 |
. '" data-autonext="' . intval($options->autonext)
|
2224 |
. '" data-thumbplay="' . intval($options->thumbplay)
|
2225 |
+
. '"><div class="epyt-arrow">«</div> <div>' . $txtprev . '</div></div>';
|
2226 |
|
2227 |
|
2228 |
$pagination .= '<div class="epyt-pagenumbers ' . ($totalPages > 1 ? '' : 'hide') . '">';
|
2238 |
. '" data-showpaging="' . intval($options->showPaging)
|
2239 |
. '" data-autonext="' . intval($options->autonext)
|
2240 |
. '" data-thumbplay="' . intval($options->thumbplay)
|
2241 |
+
. '"><div>' . $txtnext . '</div> <div class="epyt-arrow">»</div></div>';
|
2242 |
|
2243 |
$pagination .= '<div class="epyt-loader"><img alt="loading" width="16" height="11" src="' . plugins_url('images/gallery-page-loader.gif', __FILE__) . '"></div>';
|
2244 |
$pagination .= '</div>';
|
2501 |
$finalparams['autoplay'] = 0;
|
2502 |
}
|
2503 |
|
2504 |
+
$code1 = '<iframe ' . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight . '" ' .
|
2505 |
+
' data-origwidth="' . self::$defaultwidth . '" data-origheight="' . self::$defaultheight . '" ' .
|
2506 |
+
' src="https://www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
|
2507 |
$code2 = '" class="__youtube_prefs__' . ($iscontent ? '' : ' __youtube_prefs_widget__') .
|
2508 |
'"' . $voloutput . $acctitle . $galleryid_ifm_data . ' allow="autoplay; encrypted-media" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>';
|
2509 |
|
2862 |
$new_pointer_content .= '<p>'; // ooopointer
|
2863 |
if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
|
2864 |
{
|
2865 |
+
$new_pointer_content .= "This update is compatible with the WordPress 5.0 Gutenberg block editor, for embedding YouTube videos, galleries, and livestreams in both Free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions »</a> This update also stays backwards-compatible with the classic editor.";
|
2866 |
+
//$new_pointer_content .= "This version fixes a couple gallery bugs and improves ads.txt management for the monetization feature. <a rel=\"#jumpmonetize\" class=\"epyt-jumptab\" href=\"" . admin_url('admin.php?page=youtube-my-preferences#jumpmonetize') . "\">Login here to see »</a></li></ul>";
|
2867 |
}
|
2868 |
else
|
2869 |
{
|
2870 |
+
$new_pointer_content .= "This update is compatible with the WordPress 5.0 Gutenberg block editor, for embedding YouTube videos, galleries, and livestreams in both Free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions »</a> This update also stays backwards-compatible with the classic editor.";
|
2871 |
+
$new_pointer_content .= ' <strong>Important message to YouTube Pro users</strong>: From version 11.7 onward, you must <a href="https://www.embedplus.com/youtube-pro/download/?prokey=' . esc_attr(self::$alloptions[self::$opt_pro]) . '" target="_blank">download the separate plugin here</a> to regain your Pro features. All your settings will automatically migrate after installing the separate Pro download. Thank you for your support and patience during this transition.';
|
2872 |
}
|
2873 |
$new_pointer_content .= '</p>';
|
2874 |
|
2895 |
<h3 class="nav-tab-wrapper">
|
2896 |
<a class="nav-tab nav-tab-active" href="#jumpdefaults">Defaults</a>
|
2897 |
<a class="nav-tab" href="#jumpapikey">API Key</a>
|
2898 |
+
<a class="nav-tab" href="#jumpwiz">Wizard <sup class="orange">new</sup></a>
|
2899 |
<a class="nav-tab" href="#jumpgallery">Galleries</a>
|
2900 |
<a class="nav-tab href-link" style="background-color: #daebf1;" rel="#jumpupgrade" target="_blank" href="<?php echo self::$epbase . "/dashboard/pro-easy-video-analytics.aspx?ref=protab" ?>">Upgrade?</a>
|
2901 |
<?php
|
3364 |
min-height: 250px !important;
|
3365 |
}
|
3366 |
|
3367 |
+
section#jumpwiz hr {
|
3368 |
+
margin: 20px 0 20px 0;
|
3369 |
+
}
|
3370 |
+
.wiztab-screenshots {
|
3371 |
+
float: right;
|
3372 |
+
max-width: 50%;
|
3373 |
+
height: auto;
|
3374 |
+
clear: right;
|
3375 |
+
margin-left: 30px;
|
3376 |
+
margin-bottom: 15px;
|
3377 |
+
display: block;
|
3378 |
+
border: 5px solid #dddddd;
|
3379 |
+
}
|
3380 |
+
|
3381 |
+
|
3382 |
</style>
|
3383 |
<div class="wrap wrap-ytprefs">
|
3384 |
<h1><img alt="YouTube Plugin Icon" src="<?php echo plugins_url('images/youtubeicon16.png', __FILE__) ?>" /> <?php echo __('YouTube Settings') ?></h1>
|
3466 |
</p>
|
3467 |
<p>
|
3468 |
<input name="<?php echo self::$opt_rel; ?>" id="<?php echo self::$opt_rel; ?>" <?php checked($all[self::$opt_rel], 1); ?> type="checkbox" class="checkbox">
|
3469 |
+
<label for="<?php echo self::$opt_rel; ?>">
|
3470 |
+
<b class="chktitle">Related Videos:</b>
|
3471 |
+
<strong>Turning off this feature is now <a target="_blank" href="https://developers.google.com/youtube/player_parameters#Revision_History">deprecated by YouTube</a>. Related videos will always appear.</strong>
|
3472 |
+
Show related and recommended videos during pause and at the end of playback.
|
3473 |
+
</label>
|
3474 |
</p>
|
3475 |
<p>
|
3476 |
<input name="<?php echo self::$opt_showinfo; ?>" id="<?php echo self::$opt_showinfo; ?>" <?php checked($all[self::$opt_showinfo], 1); ?> type="checkbox" class="checkbox">
|
3477 |
+
<label for="<?php echo self::$opt_showinfo; ?>">
|
3478 |
+
<b class="chktitle">Show Title:</b>
|
3479 |
+
<strong>Turning off this feature is now <a target="_blank" href="https://developers.google.com/youtube/player_parameters#Revision_History">deprecated by YouTube</a>. Title and info will always appear.</strong>
|
3480 |
+
Show the video title and other info.
|
3481 |
+
</label>
|
3482 |
</p>
|
3483 |
<p>
|
3484 |
<input name="<?php echo self::$opt_fs; ?>" id="<?php echo self::$opt_fs; ?>" <?php checked($all[self::$opt_fs], 1); ?> type="checkbox" class="checkbox">
|
3665 |
|
3666 |
<section class="pattern" id="jumpwiz">
|
3667 |
<h2>Visual YouTube Wizard Directions</h2>
|
|
|
3668 |
<p>
|
3669 |
+
While you're writing your post or page, you have the ability to search YouTube and insert videos, playlists, and even galleries right from your editor. Below are directions for each type of WordPress editor.
|
3670 |
+
</p>
|
3671 |
+
<h3>Classic Editor</h3>
|
3672 |
+
<img class="wiztab-screenshots" src="<?php echo plugins_url('images/ss-wiz-classic.png', __FILE__) ?>">
|
3673 |
+
<p>
|
3674 |
+
Simply click the YouTube wizard button found above
|
3675 |
+
your post editor to start the wizard (see image to the right to locate this button). There, you'll have several options for different types of embeds.
|
3676 |
Each embed code will have an "Insert Into Editor" button that you can click to directly embed the desired video link to your post without having to copy and paste.
|
3677 |
</p>
|
3678 |
+
<hr class="clearboth">
|
3679 |
+
<h3>Widgets</h3>
|
3680 |
+
<img class="wiztab-screenshots" src="<?php echo plugins_url('images/ss-wiz-widget.png', __FILE__) ?>">
|
3681 |
<p>
|
3682 |
+
To insert a video in a widget area, use the Text widget that comes with WordPress. Simply click the YouTube wizard button found above
|
3683 |
+
the widget textbox to start the wizard (see image to the right to locate this button). There, you'll have several options for different types of embeds.
|
3684 |
+
Each embed code will have an "Insert Into Editor" button that you can click to directly embed the desired video link to your post without having to copy and paste.
|
3685 |
+
</p>
|
3686 |
+
<hr class="clearboth"/>
|
3687 |
+
<h3>Gutenberg Block Editor</h3>
|
3688 |
+
<img class="wiztab-screenshots" src="<?php echo plugins_url('images/ss-wiz-gbblock.png', __FILE__) ?>">
|
3689 |
+
<p>
|
3690 |
+
Click on the (+) sign for the block editor list. The YouTube Wizard block is located under the "Embeds" category (make sure you choose "YouTube <strong>Wizard</strong>" not "YouTube").
|
3691 |
+
Then your page will show a placeholder where you can launch the wizard. In the wizard, you'll have several options for different types of embeds.
|
3692 |
+
Each embed code will have an "Insert Into Editor" button that you can click to directly embed the desired video link to your post without having to copy and paste.
|
3693 |
+
You'll also be able to preview and interact with your embed without having to view the page on the front end.
|
3694 |
+
</p>
|
3695 |
+
<hr class="clearboth"/>
|
3696 |
+
<h3>Gutenberg Classic Block</h3>
|
3697 |
+
<img class="wiztab-screenshots" src="<?php echo plugins_url('images/ss-wiz-gbclassicblock.png', __FILE__) ?>">
|
3698 |
+
<p>
|
3699 |
+
Are you using Gutenberg but not quite ready to start using all the blocks? Well, you can still access our wizard if you wish to continue using Gutenberg's Classic block.
|
3700 |
+
The Classic block brings back the former editor you used before WordPress, and so we've added a button to it you can use to launch the wizard (see example on the right).
|
3701 |
+
Simply click the wizard button to start the wizard. There, you'll have several options for different types of embeds.
|
3702 |
+
Each embed code will have an "Insert Into Editor" button that you can click to directly embed the desired video link to your post without having to copy and paste.
|
3703 |
+
</p>
|
3704 |
+
<hr class="clearboth"/>
|
3705 |
+
<h3>Pro Customization</h3>
|
3706 |
+
<img class="wiztab-screenshots" src="<?php echo plugins_url('images/ssprowizard.png', __FILE__) ?>">
|
3707 |
+
<p>
|
3708 |
+
<a href="<?php echo self::$epbase ?>/dashboard/pro-easy-video-analytics.aspx?ref=wizdirections" target="_blank"><b>Even more options are available to PRO users, no matter which editor you choose!</b></a>
|
3709 |
+
Simply click the "Customize" button in the wizard to further personalize each of your embeds without having to manually add special codes yourself.
|
3710 |
+
The customize button will allow you to easily override most of the above default options for that embed.
|
3711 |
</p>
|
|
|
3712 |
</section>
|
3713 |
+
|
3714 |
<section class="pattern" id="jumpgallery">
|
3715 |
<h2>Gallery Settings and Directions</h2>
|
3716 |
<img class="ssgallery" src="<?php echo plugins_url('images/ssgallery.png', __FILE__) ?>">
|
4927 |
'security' => wp_create_nonce('embedplus-nonce'),
|
4928 |
'gallery_scrolloffset' => intval(self::$alloptions[self::$opt_gallery_scrolloffset]),
|
4929 |
'eppathtoscripts' => plugins_url('scripts/', __FILE__),
|
4930 |
+
'eppath' => plugins_url('/', __FILE__),
|
4931 |
'epresponsiveselector' => self::get_responsiveselector(),
|
4932 |
'epdovol' => true,
|
4933 |
'version' => self::$alloptions[self::$opt_version],
|
5021 |
'vi_logged_in' => self::vi_logged_in(),
|
5022 |
'epbase' => self::$epbase,
|
5023 |
'admin_url' => admin_url(),
|
5024 |
+
'vi_js_settings' => self::$alloptions[self::$opt_vi_js_settings],
|
5025 |
'admin_url_ytprefs' => admin_url('admin.php?page=youtube-my-preferences')
|
5026 |
//'epblogwidth' => self::get_blogwidth(),
|
5027 |
//'epprokey' => self::$alloptions[self::$opt_pro],
|
5710 |
{
|
5711 |
return array(
|
5712 |
'code' => 0,
|
5713 |
+
'message' => '<h3>Almost There!</h3> Looks like video intelligence has just updated its ad delivery partners. To get the most revenue out of your ads, open up your '
|
5714 |
+
. ' <a href="' . self::base_url() . '/ads.txt" target="_blank">ads.txt</a> file and replace the vi lines (ending in # 41b5eef6) with the new lines you see below. Then, refresh this page.'
|
5715 |
. '<code>' . $user_adstxt . '</code>'
|
5716 |
);
|
5717 |
}
|
5851 |
{
|
5852 |
$messages[] = $apiResult->get_error_message();
|
5853 |
}
|
|
|
|
|
|
|
|
|
5854 |
else
|
5855 |
{
|
5856 |
$jsonResult = json_decode($apiResult['body']);
|
5858 |
if (!empty($jsonResult->error))
|
5859 |
{
|
5860 |
//$messages[] = implode(': ', array('vi API - ' . self::vi_debug_json($apiResult)));
|
5861 |
+
$messages[] = 'If the issue is not resolved, please contact support at ext@embedplus.com and we will get you going. (Error code ' . wp_remote_retrieve_response_code($apiResult) . ', v' . self::$version .
|
5862 |
+
' - <em>' . implode(': ', array($jsonResult->error->message, is_string($jsonResult->error->description) ? $jsonResult->error->description : json_encode($jsonResult->error->description))) . '</em>)';
|
5863 |
}
|
5864 |
|
5865 |
if (isset($jsonResult->status) && strcasecmp($jsonResult->status, 'ok') == 0 && isset($jsonResult->data) && strlen($jsonResult->data) > 0)
|
5981 |
}
|
5982 |
else
|
5983 |
{
|
5984 |
+
$messages[] = 'A quick re-authentication is required to save your most recent customizations. Simply log out of this Ads Settings page with the "Logout" button right above and then log back in with your vi login and password. ';
|
5985 |
$messages = array_merge($messages, $js);
|
5986 |
}
|
5987 |
}
|
6795 |
<p>
|
6796 |
Note that only one ad can appear on a page, but if you'd like more control of exactly <em>where</em> it's placed, see the "Manual" or "Theme Code" directions in the next sections.
|
6797 |
</p>
|
6798 |
+
<h3>Manual: Shortcode or Gutenberg Block</h3>
|
6799 |
+
<p>
|
6800 |
+
If you didn't select any of the automatic options above, you can manually insert your ad in text widgets, and in specific posts or pages.
|
6801 |
+
See the below screenshot to find the button you can use to manually embed the ad code.
|
6802 |
+
(or, use this shortcode directly: <code>[embed-vi-ad]</code>).
|
6803 |
+
<strong>We're quite happy to help you if you aren't sure what to do</strong>, especially due the newness of the new Gutenberg editor. <strong>Just email us at ext@embedplus.com</strong>
|
6804 |
+
</p>
|
6805 |
+
<p>
|
6806 |
+
By the way, if you did make an automatic selection above, do not make any manual insertions. Skip the remaining options on this page, since only one ad code/script is allowed per page and the above has got you covered.
|
6807 |
+
</p>
|
6808 |
+
<img class="ss-vi-wizbutton" src="<?php echo plugins_url(self::$folder_name . '/images/ss-vi-wizbutton.png') . '?ver=' . self::$version; ?>"/>
|
6809 |
|
6810 |
<h3>Theme Code (advanced)</h3>
|
6811 |
<p>You can also position the ad directly in your theme code. Copy the PHP code below and paste it where you would like it to appear in your theme.</p>
|
6821 |
<div class="adstxt-verify-message">
|
6822 |
|
6823 |
</div>
|
6824 |
+
|
6825 |
+
<p>
|
6826 |
+
Are you also running Google Adsense ads on your site? If so, also add the following line which is <a href="https://support.google.com/adsense/answer/7532444?hl=en" target="_blank">recommended by Google</a> for ads.txt files (replace the <code>0000000000000000</code> with your actual publisher ID as provided by Google).
|
6827 |
+
</p>
|
6828 |
+
<p>
|
6829 |
+
<code class="adstxt-block">google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0</code>
|
6830 |
+
</p>
|
6831 |
<p>
|
6832 |
Trouble with your ads.txt verification? Contact support at <strong><a href="mailto:ext@embedplus.com">ext@embedplus.com</a></strong>
|
6833 |
</p>
|
6945 |
</p>
|
6946 |
</li>
|
6947 |
<li>
|
6948 |
+
<h3>Why are there no ads, even though I added the code (manually or automatically)?</h3>
|
6949 |
<p>
|
6950 |
+
It's likely that you've added more than one ad script/code to your pages.
|
6951 |
+
Perhaps you selected the automatic placement on a post/page but also inserted a separate piece of code/script manually.
|
6952 |
+
At this time, only one ad is allowed per page. If you insert more, then no ads might be visible.
|
6953 |
+
</p>
|
6954 |
+
</li>
|
6955 |
+
<li>
|
6956 |
+
<h3>Is this video intelligence (vi) monetization feature compatible with Google Adsense?</h3>
|
6957 |
+
<p>
|
6958 |
+
Yes. Many publishers are in fact running both Adsense and vi at the same time. Like vi, Google Adsense recommends that you have an <a href="https://support.google.com/adsense/answer/7532444?hl=en" target="_blank">ads.txt in your root folder</a>.
|
6959 |
+
Therefore, you should also include the following line in your ads.txt -- either before or after the lines you inserted for vi (replace the <code>0000000000000000</code> with the actual publisher ID provided by Google):
|
6960 |
+
</p>
|
6961 |
+
<p>
|
6962 |
+
<code>google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0</code>
|
6963 |
</p>
|
6964 |
</li>
|
6965 |
<li>
|
6994 |
<li>
|
6995 |
<h3>When will I start seeing ads within the vi story?</h3>
|
6996 |
<p>
|
6997 |
+
It can vary depending on which countries the bulk of your traffic is coming from. For most countries it takes about 1 to 2 days. If you have questions, email us at ext@embedplus.com
|
|
|
|
|
|
|
6998 |
</p>
|
6999 |
</li>
|
7000 |
<li>
|
7033 |
public static function vi_monetize_title()
|
7034 |
{
|
7035 |
?>
|
7036 |
+
Join over 40,000 publishers making money embedding high quality video ads
|
7037 |
<?php
|
7038 |
}
|
7039 |
|
7389 |
}
|
7390 |
}
|
7391 |
|
7392 |
+
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
7393 |
+
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
7394 |
+
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
7395 |
+
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
7396 |
+
|
7397 |
+
|
7398 |
+
public static function gb_block_assets()
|
7399 |
+
{
|
7400 |
+
// frontend+backend styles.
|
7401 |
+
wp_enqueue_style('epytgb-style-css', plugins_url('dist/blocks.style.build.css', __FILE__), array('wp-blocks'), self::$version);
|
7402 |
+
}
|
7403 |
+
|
7404 |
+
public static function gb_editor_assets()
|
7405 |
+
{
|
7406 |
+
// backend styels
|
7407 |
+
self::ytprefsscript();
|
7408 |
+
self::fitvids();
|
7409 |
+
|
7410 |
+
if (!self::is_restrict_wizard() && current_user_can('edit_posts'))
|
7411 |
+
{
|
7412 |
+
// Scripts.
|
7413 |
+
wp_enqueue_script(
|
7414 |
+
'epytgb-block-js', // Handle.
|
7415 |
+
plugins_url('/dist/blocks.build.js', __FILE__), // Block.build.js: We register the block here. Built with Webpack.
|
7416 |
+
array('wp-blocks', 'wp-i18n', 'wp-element'), // Dependencies, defined above.
|
7417 |
+
self::$version, true // Enqueue the script in the footer.
|
7418 |
+
);
|
7419 |
+
|
7420 |
+
// Styles.
|
7421 |
+
wp_enqueue_style(
|
7422 |
+
'epytgb-block-editor-css', // Handle.
|
7423 |
+
plugins_url('dist/blocks.editor.build.css', __FILE__), // Block editor CSS.
|
7424 |
+
array('wp-edit-blocks'), // Dependency to include the CSS after it.
|
7425 |
+
self::$version
|
7426 |
+
);
|
7427 |
+
|
7428 |
+
wp_enqueue_style('__ytprefs_admin__vi_css', plugins_url('styles/ytvi-admin' . self::$min . '.css', __FILE__), array(), self::$version);
|
7429 |
+
|
7430 |
+
// Tiny MCE
|
7431 |
+
wp_enqueue_style('__ytprefs_admin__tinymce_css', plugins_url('styles/epyt_mce_wizard_button' . self::$min . '.css', __FILE__), array(), self::$version);
|
7432 |
+
}
|
7433 |
+
}
|
7434 |
+
|
7435 |
+
public static function gb_classic_block_setup()
|
7436 |
+
{
|
7437 |
+
if (!self::is_restrict_wizard() && current_user_can('edit_posts'))
|
7438 |
+
{
|
7439 |
+
add_thickbox();
|
7440 |
+
add_filter("mce_external_plugins", array(get_class(), "gb_add_tinymce_plugin"));
|
7441 |
+
add_filter('mce_buttons_2', array(get_class(), 'gb_register_tinymce_button'));
|
7442 |
+
}
|
7443 |
+
}
|
7444 |
+
|
7445 |
+
public static function gb_add_tinymce_plugin($plugin_array)
|
7446 |
+
{
|
7447 |
+
$plugin_array['epyt_mce_wizard_button'] = plugins_url('scripts/epyt_mce_wizard_button' . self::$min . '.js', __FILE__) . '?ver=' . self::$version;
|
7448 |
+
return $plugin_array;
|
7449 |
+
}
|
7450 |
+
|
7451 |
+
public static function gb_register_tinymce_button($buttons)
|
7452 |
+
{
|
7453 |
+
array_push($buttons, "epyt_mce_wizard_button");
|
7454 |
+
return $buttons;
|
7455 |
+
}
|
7456 |
+
|
7457 |
+
public static function gb_svg_defs()
|
7458 |
+
{
|
7459 |
+
?>
|
7460 |
+
<svg><defs><style>.epytcls-1{fill:red;}.epytcls-2{fill-rule:evenodd;fill:url(#radial-gradient);}.epytcls-3{fill:#31aaff;}.epytcls-4{fill:#fff;}</style><radialGradient id="radial-gradient" cx="193" cy="85.85" r="77.53" gradientUnits="userSpaceOnUse"><stop offset="0.17" stop-color="#fff"/><stop offset="0.68" stop-color="#31aaff"/></radialGradient></defs></svg>
|
7461 |
+
<?php
|
7462 |
+
}
|
7463 |
+
|
7464 |
+
public static function gb_register_block_types()
|
7465 |
+
{
|
7466 |
+
if (function_exists('register_block_type'))
|
7467 |
+
{
|
7468 |
+
register_block_type(
|
7469 |
+
'epyt/youtube', array(
|
7470 |
+
'attributes' => array(
|
7471 |
+
'shortcode' => array(
|
7472 |
+
'type' => 'string'
|
7473 |
+
)
|
7474 |
+
),
|
7475 |
+
'render_callback' => array(get_class(), 'gb_render_callback_youtube'),
|
7476 |
+
)
|
7477 |
+
);
|
7478 |
+
}
|
7479 |
+
}
|
7480 |
+
|
7481 |
+
public static function gb_render_callback_youtube($attributes, $content)
|
7482 |
+
{
|
7483 |
+
if ($attributes && $attributes['shortcode'] && strpos($attributes['shortcode'], '[') === 0)
|
7484 |
+
{
|
7485 |
+
return do_shortcode($attributes['shortcode']);
|
7486 |
+
}
|
7487 |
+
return isset($attributes['shortcode']) ? $attributes['shortcode'] : '';
|
7488 |
+
}
|
7489 |
+
|
7490 |
}
|
7491 |
|
7492 |
// constants
|
7493 |
define('EPYT_BASE_URL', rtrim(plugins_url('', __FILE__), "\\/") . '/');
|
7494 |
define('EPYTVI_INCLUDES_PATH', rtrim(dirname(__FILE__), "\\/") . '/includes/vi/');
|
7495 |
+
define('EPYTGB_INCLUDES_PATH', rtrim(dirname(__FILE__), "\\/") . '/includes/gutenberg/');
|
7496 |
if (!defined('EPYTVI_ENDPOINTS_URL'))
|
7497 |
define('EPYTVI_ENDPOINTS_URL', 'https://dashboard-api.vidint.net/v1/api/widget/settings');
|
7498 |
|