Changeset 2456645
- Timestamp:
- 01/14/2021 10:26:18 PM (5 years ago)
- Location:
- erropix-hydrogen-paste
- Files:
-
- 4 edited
- 4 copied
-
tags/1.2 (copied) (copied from erropix-hydrogen-paste/trunk)
-
tags/1.2/erropix-hydrogen-paste.php (copied) (copied from erropix-hydrogen-paste/trunk/erropix-hydrogen-paste.php) (1 diff)
-
tags/1.2/js (copied) (copied from erropix-hydrogen-paste/trunk/js)
-
tags/1.2/js/paste.js (modified) (1 diff)
-
tags/1.2/readme.txt (copied) (copied from erropix-hydrogen-paste/trunk/readme.txt) (3 diffs)
-
trunk/erropix-hydrogen-paste.php (modified) (1 diff)
-
trunk/js/paste.js (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
erropix-hydrogen-paste/tags/1.2/erropix-hydrogen-paste.php
r2301343 r2456645 1 1 <?php 2 2 /** 3 * Plugin Name: ERROPiXHydrogen Paste4 * Plugin URI: https://www. erropix.com/products/hydrogen-pack/3 * Plugin Name: Hydrogen Paste 4 * Plugin URI: https://www.cleanplugins.com/products/hydrogen-pack/ 5 5 * Description: This plugin allows you to paste any elements copied using Hydrogen Pack 6 * Version: 1. 1.17 * Author: ERROPiX8 * Author URI: https://www. erropix.com6 * Version: 1.2 7 * Author: Clean Plugins 8 * Author URI: https://www.cleanplugins.com/ 9 9 **/ 10 10 11 11 // Do not load directly 12 if (!defined( 'ABSPATH')) {13 header( 'HTTP/1.0 403 Forbidden');12 if (!defined("ABSPATH")) { 13 header("HTTP/1.0 403 Forbidden"); 14 14 exit; 15 15 } 16 16 17 17 // Do not load if the full plugin is active 18 if (defined( 'EPXHYDRO_VER')) {18 if (defined("EPXHYDRO_VER")) { 19 19 return; 20 20 } 21 21 22 // Add directive 23 add_action("wp_footer", function () { 24 if (defined("SHOW_CT_BUILDER")) { 25 echo "<div hydrogen-paste></div>"; 26 } 27 }); 28 22 29 // add the paste script to Oxygen iframe 23 add_action( 'oxygen_enqueue_iframe_scripts', function () {30 add_action("oxygen_enqueue_iframe_scripts", function () { 24 31 $url = plugin_dir_url(__FILE__); 25 wp_enqueue_script(" epxhydro-paste", "{$url}js/paste.js", [], '1.1.1', true);32 wp_enqueue_script("hydrogen-paste", "{$url}js/paste.js", [], "1.2", true); 26 33 }); 27 34 28 35 // Add plugin's action links 29 add_filter( 'plugin_action_links', function ($actions, $file) {36 add_filter("plugin_action_links", function ($actions, $file) { 30 37 $basename = plugin_basename(__FILE__); 31 38 if ($basename == $file) { 32 39 $plugin_actions = [ 33 "upgrade" => "<a href='https://www. erropix.com/products/hydrogen-pack/' target='_blank'>Upgrade to PRO</a>",40 "upgrade" => "<a href='https://www.cleanplugins.com/products/hydrogen-pack/' target='_blank'>Upgrade to PRO</a>", 34 41 ]; 35 42 $actions = array_merge($plugin_actions, $actions); -
erropix-hydrogen-paste/tags/1.2/js/paste.js
r2301343 r2456645 1 window.addEventListener("load",function(){var e=angular.element("body"),t=parent.angular.element("body"),p=iframeScope,u=iframeScope.parentScope,h=p.component.active,m=["ct_id","ct_parent","ct_content","nicename","selector","activeselector"],f=["href","url","target","globalConditionsResult","globalconditions","use-custom","custom-code","code-php","code-css","code-js","full_shortcode","embed_src","src","image_type","attachment_height","attachment_id","attachment_size","attachment_url","attachment_width"];function y(e,t){for(key in"object"!=typeof p.styleFolders[t]&&(p.styleFolders[t]={status:1,key:t}),e)e[key].parent=t;p.classes=Object.assign(e,p.classes),p.classesCached=!1}function b(e,t,o,n){var r={},c=p.globalColorSets,s=_.findWhere(c.sets,{name:n});function i(e,t){return"color("+r[parseInt(t)]+")"}function a(n){_.each(n,function(e,t){var o=/color\((\d*)\)/g;"string"==typeof e&&o.test(e)?n[t]=e.replace(o,i):"object"==typeof e&&a(n[t])})}return"object"!=typeof s&&(s={id:++c.setsIncrement,name:n},c.sets.push(s)),_.each(e,function(e){var t=_.findWhere(c.colors,{name:e.name,set:s.id});"object"!=typeof t&&(t={id:++c.colorsIncrement,name:e.name,value:e.value,set:s.id},c.colors.push(t)),r[e.id]=t.id}),a(t),a(o),r}function n(e){var t=h.id,o=function(e){try{return JSON.parse(decodeURIComponent(escape(atob(e))))}catch(e){console.error(e)}return!1}(e),n=!u.isActiveActionTab("contentEditing")&&(0<h.id||0),r="Imported";if(o.constructor!==Object)throw new Error("Invalid clipboard contents");if("object"==typeof o.component){var c=o.component,s=o.classes;b(o.colors,c,s,r),y(s,r);var i={id:0,depth:0,name:"root",children:[]};Array.isArray(c)?i.children=c:i.children.push(c),u.showLoadingOverlay(),setTimeout(function(){try{p.addReusableChildren(i,null,t)}catch(e){console.error(e)}u.hideLoadingOverlay()})}if("object"==typeof o.style){if(!0!==n)throw new error("Can not apply styles to the selected element");if(c=function(o){var n=null;return function e(t){void 0!==t.id&&t.id==o?n=t:t.children&&t.children.forEach(e)}(p.componentsTree),n}(t)){var a=c.options,l=o.style,d=l.currentClass;s=o.classes;b(o.colors,l,s,r),y(s,r),_.extend(l.original,_.pick(a.original,f)),_.extend(l,_.pick(a,m)),delete l.currentClass,c.options=l,p.componentsClasses[t]=l.classes,p.component.options[t]=_.pick(p.component.options[t],m),p.rebuildDOM(t),d?p.setCurrentClass(d):p.switchEditToId(!0),p.adjustResizeBox()}}}function o(e){var t=e.target;if(!["INPUT","TEXTAREA"].includes(t.nodeName)&&!t.isContentEditable){try{var o=e.originalEvent.clipboardData.getData("Text").trim();if(!o)throw new Error("The clipboard is empty");n(o)}catch(e){console.error(e),setTimeout(function(){!function(e){setTimeout(function(){p.showNoticeModal("<div>"+e+"</div>"),p.$$phase||p.$digest()},100)}("Failed to process the clipboard contents<br/>"+e)},100)}return!1}}e.on("paste","[contenteditable]",function(e){this.isContentEditable||(e.stopImmediatePropagation(),o(e))}),e.on("paste",o),t.on("paste",o)});1 !function(){function e(e,t){var o=angular.element("body"),n=parent.angular.element("body"),i=e.component.active,r=["ct_id","ct_parent","ct_content","nicename","selector","activeselector"],c=["href","url","target","globalConditionsResult","globalconditions","use-custom","custom-code","code-php","code-css","code-js","full_shortcode","embed_src","src","image_type","attachment_height","attachment_id","attachment_size","attachment_url","attachment_width"];function s(t){var o=null;return function e(n){void 0!==n.id&&n.id==t?o=n:n.children&&n.children.forEach(e)}(e.componentsTree),o}function a(t,o){for(key in"object"!=typeof e.styleFolders[o]&&(e.styleFolders[o]={status:1,key:o}),t)t[key].parent=o;e.classes=Object.assign(t,e.classes),e.classesCached=!1}function l(t,o,n,i){var r={},c=e.globalColorSets,s=_.findWhere(c.sets,{name:i});function a(e,t){return"color("+r[parseInt(t)]+")"}function l(e){_.each(e,(function(t,o){var n=/color\((\d*)\)/g;"string"==typeof t&&n.test(t)?e[o]=t.replace(n,a):"object"==typeof t&&l(e[o])}))}return"object"!=typeof s&&(s={id:++c.setsIncrement,name:i},c.sets.push(s)),_.each(t,(function(e){var t=_.findWhere(c.colors,{name:e.name,set:s.id});"object"!=typeof t&&(t={id:++c.colorsIncrement,name:e.name,value:e.value,set:s.id},c.colors.push(t)),r[e.id]=t.id})),l(o),l(n),r}function d(o){var n=i.id,d=function(e){try{return JSON.parse(decodeURIComponent(escape(atob(e))))}catch(e){console.error(e)}return!1}(o),p=!t.isActiveActionTab("contentEditing")&&(i.id>0||0),u="Imported";if(d.constructor!==Object)throw new Error("Invalid clipboard contents");if("object"==typeof d.component){var h=d.component,f=d.classes;l(d.colors,h,f,u),a(f,u);var m={id:0,depth:0,name:"root",children:[]};Array.isArray(h)?m.children=h:m.children.push(h),t.showLoadingOverlay(),setTimeout((function(){try{e.addReusableChildren(m,null,n)}catch(e){console.error(e)}t.hideLoadingOverlay()}))}if("object"==typeof d.style){if(!0!==p)throw new error("Can not apply styles to the selected element");if(h=s(n)){var y=h.options,b=d.style,v=b.currentClass;f=d.classes;l(d.colors,b,f,u),a(f,u),_.extend(b.original,_.pick(y.original,c)),_.extend(b,_.pick(y,r)),delete b.currentClass,h.options=b,e.componentsClasses[n]=b.classes,e.component.options[n]=_.pick(e.component.options[n],r),e.rebuildDOM(n),v?e.setCurrentClass(v):e.switchEditToId(!0),e.adjustResizeBox()}}if("object"==typeof d.conditions){if(!0!==p)throw new Error("Can not apply conditions! The selected element is invalid");(h=s(n))&&(e.setOptionModel("globalconditions",d.conditions,n,name),e.setOptionModel("conditionstype",d.conditionstype,n,name))}}function p(t){var o=t.target;if(!["INPUT","TEXTAREA"].includes(o.nodeName)&&!o.isContentEditable){try{var n=t.originalEvent.clipboardData.getData("Text").trim();if(!n)throw new Error("The clipboard is empty");d(n)}catch(t){console.error(t),setTimeout((function(){var o;o="Failed to process the clipboard contents<br/>"+t,setTimeout((function(){e.showNoticeModal("<div>"+o+"</div>"),e.$$phase||e.$digest()}),100)}),100)}return!1}}o.on("paste","[contenteditable]",(function(e){this.isContentEditable||(e.stopImmediatePropagation(),p(e))})),o.on("paste",p),n.on("paste",p)}CTFrontendBuilder.directive("hydrogenPaste",["$parentScope",function(t){return{restrict:"A",link:function(o){e(o,t)}}}])}(); -
erropix-hydrogen-paste/tags/1.2/readme.txt
r2301343 r2456645 1 === ERROPiXHydrogen Paste ===1 === Hydrogen Paste === 2 2 Contributors: erropix 3 3 Donate link: https://www.paypal.me/erropix 4 4 Tags: Oxygen Builder, Hydrogen Pack, Copy Paste 5 Requires at least: 4.96 Tested up to: 5. 4.17 Stable tag: 1. 1.15 Requires at least: 5.0 6 Tested up to: 5.6 7 Stable tag: 1.2 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 14 14 == Description == 15 15 16 Hydrogen Paste allows you to paste any elements copied using [Hydrogen Pack](https://www. erropix.com/products/hydrogen-pack/ "The premium version") across all your websites.16 Hydrogen Paste allows you to paste any elements copied using [Hydrogen Pack](https://www.cleanplugins.com/products/hydrogen-pack/ "The premium version") across all your websites. 17 17 18 18 You can also paste any Oxygen elements shared by other users of the Oxygen community. … … 25 25 26 26 == Changelog == 27 28 = 1.2 = 29 * Ability to paste conditions 30 * Bug fixes and checked compatibility with Hydrogen Pack 1.2 27 31 28 32 = 1.1.1 = -
erropix-hydrogen-paste/trunk/erropix-hydrogen-paste.php
r2301343 r2456645 1 1 <?php 2 2 /** 3 * Plugin Name: ERROPiXHydrogen Paste4 * Plugin URI: https://www. erropix.com/products/hydrogen-pack/3 * Plugin Name: Hydrogen Paste 4 * Plugin URI: https://www.cleanplugins.com/products/hydrogen-pack/ 5 5 * Description: This plugin allows you to paste any elements copied using Hydrogen Pack 6 * Version: 1. 1.17 * Author: ERROPiX8 * Author URI: https://www. erropix.com6 * Version: 1.2 7 * Author: Clean Plugins 8 * Author URI: https://www.cleanplugins.com/ 9 9 **/ 10 10 11 11 // Do not load directly 12 if (!defined( 'ABSPATH')) {13 header( 'HTTP/1.0 403 Forbidden');12 if (!defined("ABSPATH")) { 13 header("HTTP/1.0 403 Forbidden"); 14 14 exit; 15 15 } 16 16 17 17 // Do not load if the full plugin is active 18 if (defined( 'EPXHYDRO_VER')) {18 if (defined("EPXHYDRO_VER")) { 19 19 return; 20 20 } 21 21 22 // Add directive 23 add_action("wp_footer", function () { 24 if (defined("SHOW_CT_BUILDER")) { 25 echo "<div hydrogen-paste></div>"; 26 } 27 }); 28 22 29 // add the paste script to Oxygen iframe 23 add_action( 'oxygen_enqueue_iframe_scripts', function () {30 add_action("oxygen_enqueue_iframe_scripts", function () { 24 31 $url = plugin_dir_url(__FILE__); 25 wp_enqueue_script(" epxhydro-paste", "{$url}js/paste.js", [], '1.1.1', true);32 wp_enqueue_script("hydrogen-paste", "{$url}js/paste.js", [], "1.2", true); 26 33 }); 27 34 28 35 // Add plugin's action links 29 add_filter( 'plugin_action_links', function ($actions, $file) {36 add_filter("plugin_action_links", function ($actions, $file) { 30 37 $basename = plugin_basename(__FILE__); 31 38 if ($basename == $file) { 32 39 $plugin_actions = [ 33 "upgrade" => "<a href='https://www. erropix.com/products/hydrogen-pack/' target='_blank'>Upgrade to PRO</a>",40 "upgrade" => "<a href='https://www.cleanplugins.com/products/hydrogen-pack/' target='_blank'>Upgrade to PRO</a>", 34 41 ]; 35 42 $actions = array_merge($plugin_actions, $actions); -
erropix-hydrogen-paste/trunk/js/paste.js
r2301343 r2456645 1 window.addEventListener("load",function(){var e=angular.element("body"),t=parent.angular.element("body"),p=iframeScope,u=iframeScope.parentScope,h=p.component.active,m=["ct_id","ct_parent","ct_content","nicename","selector","activeselector"],f=["href","url","target","globalConditionsResult","globalconditions","use-custom","custom-code","code-php","code-css","code-js","full_shortcode","embed_src","src","image_type","attachment_height","attachment_id","attachment_size","attachment_url","attachment_width"];function y(e,t){for(key in"object"!=typeof p.styleFolders[t]&&(p.styleFolders[t]={status:1,key:t}),e)e[key].parent=t;p.classes=Object.assign(e,p.classes),p.classesCached=!1}function b(e,t,o,n){var r={},c=p.globalColorSets,s=_.findWhere(c.sets,{name:n});function i(e,t){return"color("+r[parseInt(t)]+")"}function a(n){_.each(n,function(e,t){var o=/color\((\d*)\)/g;"string"==typeof e&&o.test(e)?n[t]=e.replace(o,i):"object"==typeof e&&a(n[t])})}return"object"!=typeof s&&(s={id:++c.setsIncrement,name:n},c.sets.push(s)),_.each(e,function(e){var t=_.findWhere(c.colors,{name:e.name,set:s.id});"object"!=typeof t&&(t={id:++c.colorsIncrement,name:e.name,value:e.value,set:s.id},c.colors.push(t)),r[e.id]=t.id}),a(t),a(o),r}function n(e){var t=h.id,o=function(e){try{return JSON.parse(decodeURIComponent(escape(atob(e))))}catch(e){console.error(e)}return!1}(e),n=!u.isActiveActionTab("contentEditing")&&(0<h.id||0),r="Imported";if(o.constructor!==Object)throw new Error("Invalid clipboard contents");if("object"==typeof o.component){var c=o.component,s=o.classes;b(o.colors,c,s,r),y(s,r);var i={id:0,depth:0,name:"root",children:[]};Array.isArray(c)?i.children=c:i.children.push(c),u.showLoadingOverlay(),setTimeout(function(){try{p.addReusableChildren(i,null,t)}catch(e){console.error(e)}u.hideLoadingOverlay()})}if("object"==typeof o.style){if(!0!==n)throw new error("Can not apply styles to the selected element");if(c=function(o){var n=null;return function e(t){void 0!==t.id&&t.id==o?n=t:t.children&&t.children.forEach(e)}(p.componentsTree),n}(t)){var a=c.options,l=o.style,d=l.currentClass;s=o.classes;b(o.colors,l,s,r),y(s,r),_.extend(l.original,_.pick(a.original,f)),_.extend(l,_.pick(a,m)),delete l.currentClass,c.options=l,p.componentsClasses[t]=l.classes,p.component.options[t]=_.pick(p.component.options[t],m),p.rebuildDOM(t),d?p.setCurrentClass(d):p.switchEditToId(!0),p.adjustResizeBox()}}}function o(e){var t=e.target;if(!["INPUT","TEXTAREA"].includes(t.nodeName)&&!t.isContentEditable){try{var o=e.originalEvent.clipboardData.getData("Text").trim();if(!o)throw new Error("The clipboard is empty");n(o)}catch(e){console.error(e),setTimeout(function(){!function(e){setTimeout(function(){p.showNoticeModal("<div>"+e+"</div>"),p.$$phase||p.$digest()},100)}("Failed to process the clipboard contents<br/>"+e)},100)}return!1}}e.on("paste","[contenteditable]",function(e){this.isContentEditable||(e.stopImmediatePropagation(),o(e))}),e.on("paste",o),t.on("paste",o)});1 !function(){function e(e,t){var o=angular.element("body"),n=parent.angular.element("body"),i=e.component.active,r=["ct_id","ct_parent","ct_content","nicename","selector","activeselector"],c=["href","url","target","globalConditionsResult","globalconditions","use-custom","custom-code","code-php","code-css","code-js","full_shortcode","embed_src","src","image_type","attachment_height","attachment_id","attachment_size","attachment_url","attachment_width"];function s(t){var o=null;return function e(n){void 0!==n.id&&n.id==t?o=n:n.children&&n.children.forEach(e)}(e.componentsTree),o}function a(t,o){for(key in"object"!=typeof e.styleFolders[o]&&(e.styleFolders[o]={status:1,key:o}),t)t[key].parent=o;e.classes=Object.assign(t,e.classes),e.classesCached=!1}function l(t,o,n,i){var r={},c=e.globalColorSets,s=_.findWhere(c.sets,{name:i});function a(e,t){return"color("+r[parseInt(t)]+")"}function l(e){_.each(e,(function(t,o){var n=/color\((\d*)\)/g;"string"==typeof t&&n.test(t)?e[o]=t.replace(n,a):"object"==typeof t&&l(e[o])}))}return"object"!=typeof s&&(s={id:++c.setsIncrement,name:i},c.sets.push(s)),_.each(t,(function(e){var t=_.findWhere(c.colors,{name:e.name,set:s.id});"object"!=typeof t&&(t={id:++c.colorsIncrement,name:e.name,value:e.value,set:s.id},c.colors.push(t)),r[e.id]=t.id})),l(o),l(n),r}function d(o){var n=i.id,d=function(e){try{return JSON.parse(decodeURIComponent(escape(atob(e))))}catch(e){console.error(e)}return!1}(o),p=!t.isActiveActionTab("contentEditing")&&(i.id>0||0),u="Imported";if(d.constructor!==Object)throw new Error("Invalid clipboard contents");if("object"==typeof d.component){var h=d.component,f=d.classes;l(d.colors,h,f,u),a(f,u);var m={id:0,depth:0,name:"root",children:[]};Array.isArray(h)?m.children=h:m.children.push(h),t.showLoadingOverlay(),setTimeout((function(){try{e.addReusableChildren(m,null,n)}catch(e){console.error(e)}t.hideLoadingOverlay()}))}if("object"==typeof d.style){if(!0!==p)throw new error("Can not apply styles to the selected element");if(h=s(n)){var y=h.options,b=d.style,v=b.currentClass;f=d.classes;l(d.colors,b,f,u),a(f,u),_.extend(b.original,_.pick(y.original,c)),_.extend(b,_.pick(y,r)),delete b.currentClass,h.options=b,e.componentsClasses[n]=b.classes,e.component.options[n]=_.pick(e.component.options[n],r),e.rebuildDOM(n),v?e.setCurrentClass(v):e.switchEditToId(!0),e.adjustResizeBox()}}if("object"==typeof d.conditions){if(!0!==p)throw new Error("Can not apply conditions! The selected element is invalid");(h=s(n))&&(e.setOptionModel("globalconditions",d.conditions,n,name),e.setOptionModel("conditionstype",d.conditionstype,n,name))}}function p(t){var o=t.target;if(!["INPUT","TEXTAREA"].includes(o.nodeName)&&!o.isContentEditable){try{var n=t.originalEvent.clipboardData.getData("Text").trim();if(!n)throw new Error("The clipboard is empty");d(n)}catch(t){console.error(t),setTimeout((function(){var o;o="Failed to process the clipboard contents<br/>"+t,setTimeout((function(){e.showNoticeModal("<div>"+o+"</div>"),e.$$phase||e.$digest()}),100)}),100)}return!1}}o.on("paste","[contenteditable]",(function(e){this.isContentEditable||(e.stopImmediatePropagation(),p(e))})),o.on("paste",p),n.on("paste",p)}CTFrontendBuilder.directive("hydrogenPaste",["$parentScope",function(t){return{restrict:"A",link:function(o){e(o,t)}}}])}(); -
erropix-hydrogen-paste/trunk/readme.txt
r2301343 r2456645 1 === ERROPiXHydrogen Paste ===1 === Hydrogen Paste === 2 2 Contributors: erropix 3 3 Donate link: https://www.paypal.me/erropix 4 4 Tags: Oxygen Builder, Hydrogen Pack, Copy Paste 5 Requires at least: 4.96 Tested up to: 5. 4.17 Stable tag: 1. 1.15 Requires at least: 5.0 6 Tested up to: 5.6 7 Stable tag: 1.2 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 14 14 == Description == 15 15 16 Hydrogen Paste allows you to paste any elements copied using [Hydrogen Pack](https://www. erropix.com/products/hydrogen-pack/ "The premium version") across all your websites.16 Hydrogen Paste allows you to paste any elements copied using [Hydrogen Pack](https://www.cleanplugins.com/products/hydrogen-pack/ "The premium version") across all your websites. 17 17 18 18 You can also paste any Oxygen elements shared by other users of the Oxygen community. … … 25 25 26 26 == Changelog == 27 28 = 1.2 = 29 * Ability to paste conditions 30 * Bug fixes and checked compatibility with Hydrogen Pack 1.2 27 31 28 32 = 1.1.1 =
Note: See TracChangeset
for help on using the changeset viewer.