China Video Block - Version 0.2.1

Version Description

  • added compiled build file
Download this release

Release Info

Developer cjyabraham
Plugin Icon wp plugin China Video Block
Version 0.2.1
Comparing to
See all releases

Code changes from version 0.2.0 to 0.2.1

Files changed (3) hide show
  1. dist/blocks.build.js +1 -1
  2. plugin.php +1 -1
  3. readme.txt +3 -0
dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},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=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var r=n(2),i=(n.n(r),n(3)),o=(n.n(i),wp.i18n.__),c=wp.blocks.registerBlockType,l=wp.editor.PlainText;c("cvb/block-china-video-block",{title:o("China Video Block"),icon:"welcome-view-site",category:"common",keywords:[o("china video block")],attributes:{chinavid:{type:"string"},worldvid:{type:"string"}},edit:function(e){var t=e.setAttributes,n=e.attributes,r=n.chinavid,i=n.worldvid;return wp.element.createElement("div",{className:e.className},wp.element.createElement("p",null,"This block will show the Chinese video to users in China and the World video to everyone else. You must have a valid IPInfo.io token in ",wp.element.createElement("a",{href:cvbPHPVars.settingsURL},"the settings")," for this to work."),wp.element.createElement("p",null,'Chinese video (iframe "src" attribute):',wp.element.createElement(l,{value:r,onChange:function(e){return t({chinavid:e})},placeholder:"https://v.qq.com/iframe/player.html?vid=f0718z01vwl&tiny=0&auto=0"})),wp.element.createElement("p",null,'World video (iframe "src" attribute):',wp.element.createElement(l,{value:i,onChange:function(e){return t({worldvid:e})},placeholder:"https://www.youtube.com/embed/1JAXMGqzMxs"})))},save:function(e){var t=(e.setAttributes,e.attributes),n=t.chinavid,r=t.worldvid,i=cvbPHPVars.frontScriptURL;return wp.element.createElement("div",null,wp.element.createElement("script",{type:"text/javascript"},"var chinavid = '",n,"'; var cvbIPInfoToken = '",cvbPHPVars.cvbIPInfoToken,"';"),wp.element.createElement("iframe",{width:"560",height:"315",src:r,frameborder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:!0}),wp.element.createElement("script",{type:"text/javascript",src:i}))}})},function(e,t){},function(e,t){}]);
1
+ !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},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=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var r=n(2),i=(n.n(r),n(3)),o=(n.n(i),wp.i18n.__),l=wp.blocks.registerBlockType,c=wp.editor.PlainText;l("cvb/block-china-video-block",{title:o("China Video Block"),icon:"welcome-view-site",category:"common",keywords:[o("china video block")],attributes:{chinavid:{type:"string"},worldvid:{type:"string"}},edit:function(e){var t=e.setAttributes,n=e.attributes,r=n.chinavid,i=n.worldvid;return wp.element.createElement("div",{className:e.className},wp.element.createElement("p",null,"This block will show the Chinese video to users in China and the World video to everyone else. You must have a valid IPInfo.io token in ",wp.element.createElement("a",{href:cvbPHPVars.settingsURL},"the settings")," for this to work."),wp.element.createElement("p",null,'Chinese video (iframe "src" attribute):',wp.element.createElement(c,{value:r,onChange:function(e){return t({chinavid:e})},placeholder:"https://v.qq.com/iframe/player.html?vid=f0718z01vwl&tiny=0&auto=0"})),wp.element.createElement("p",null,'World video (iframe "src" attribute):',wp.element.createElement(c,{value:i,onChange:function(e){return t({worldvid:e})},placeholder:"https://www.youtube.com/embed/1JAXMGqzMxs"})))},save:function(e){var t=(e.setAttributes,e.attributes),n=t.chinavid,r=t.worldvid,i=cvbPHPVars.frontScriptURL;return wp.element.createElement("div",null,wp.element.createElement("script",{type:"text/javascript"},"var worldvid = '",r,"'; var cvbIPInfoToken = '",cvbPHPVars.cvbIPInfoToken,"';"),wp.element.createElement("iframe",{width:"560",height:"315",src:n,frameborder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:!0}),wp.element.createElement("script",{type:"text/javascript",src:i}))}})},function(e,t){},function(e,t){}]);
plugin.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://github.com/cncf/china-video-block
5
  * Description: Gutenberg block that embeds one video for users in China, another for everyone else. Useful to accomodate video sites that are blocked in China.
6
  * Author: cjyabraham
7
- * Version: 0.2.0
8
  * License: GPLv2
9
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
  *
4
  * Plugin URI: https://github.com/cncf/china-video-block
5
  * Description: Gutenberg block that embeds one video for users in China, another for everyone else. Useful to accomodate video sites that are blocked in China.
6
  * Author: cjyabraham
7
+ * Version: 0.2.1
8
  * License: GPLv2
9
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
  *
readme.txt CHANGED
@@ -31,6 +31,9 @@ The plugin has been developed for [CNCF](https://www.cncf.io/) and [The Linux Fo
31
 
32
  == Changelog ==
33
 
 
 
 
34
  = 0.2.0 =
35
  * rewrite of the code to favor the China video; the problem was that, when favoring the non-China video, it would produce a failed request for users in China since it was loaded on page load before being changed to the China video
36
  * when the ipinfo call produces and error, no cookie value is now set so that the call can be tried again during a subsequent page load
31
 
32
  == Changelog ==
33
 
34
+ = 0.2.1 =
35
+ * added compiled build file
36
+
37
  = 0.2.0 =
38
  * rewrite of the code to favor the China video; the problem was that, when favoring the non-China video, it would produce a failed request for users in China since it was loaded on page load before being changed to the China video
39
  * when the ipinfo call produces and error, no cookie value is now set so that the call can be tried again during a subsequent page load