Plugin Directory

Changeset 2301343


Ignore:
Timestamp:
05/09/2020 02:12:51 AM (6 years ago)
Author:
ERROPiX
Message:

Release 1.1.1

Location:
erropix-hydrogen-paste
Files:
5 edited
5 copied

Legend:

Unmodified
Added
Removed
  • erropix-hydrogen-paste

    • Property svn:ignore set to
      .vscode
  • erropix-hydrogen-paste/tags/1.1.1/erropix-hydrogen-paste.php

    r2291302 r2301343  
    44 * Plugin URI: https://www.erropix.com/products/hydrogen-pack/
    55 * Description: This plugin allows you to paste any elements copied using Hydrogen Pack
    6  * Version: 1.1
     6 * Version: 1.1.1
    77 * Author: ERROPiX
    88 * Author URI: https://www.erropix.com
     
    2323add_action('oxygen_enqueue_iframe_scripts', function () {
    2424    $url = plugin_dir_url(__FILE__);
    25     wp_enqueue_script("epxhydro-paste", "{$url}js/paste.js", [], '1.1', true);
     25    wp_enqueue_script("epxhydro-paste", "{$url}js/paste.js", [], '1.1.1', true);
    2626});
    2727
  • erropix-hydrogen-paste/tags/1.1.1/js

    • Property svn:ignore set to
      paste.dev.js
  • erropix-hydrogen-paste/tags/1.1.1/js/paste.js

    r2291302 r2301343  
    1 window.addEventListener("load",function(){var $body=angular.element("body");var $parentBody=parent.angular.element("body");var $scope=iframeScope;var $parentScope=iframeScope.parentScope;var activeComponent=$scope.component.active;function decode(hash){try{return JSON.parse(decodeURIComponent(escape(atob(hash))))}catch(error){console.log(error.message)}return false}function checkComponent(){if($parentScope.isActiveActionTab("contentEditing")){return false}return activeComponent.id>0?true:0}function executeCommandPaste(clipboard){var id=activeComponent.id;var data=decode(clipboard);if(data.constructor===Object){if(data.component.constructor===Object){var source=data.source;if(source){delete data.source;var json=JSON.stringify(data);$scope.addComponentFromSource(json,id,source,"hydrogen");return true}}}alert("Invalid clipboard contents")}function pasteHandler(event){var target=event.target;var excluded=["INPUT","TEXTAREA"];if(excluded.includes(target.nodeName)||target.isContentEditable){return}if(checkComponent()!==false){try{var clipboardText=event.originalEvent.clipboardData.getData("Text").trim();if(clipboardText){executeCommandPaste(clipboardText)}}catch(error){alert("Failed to read clipboard contents")}return false}}$body.on("paste","[contenteditable]",function(event){if(!this.isContentEditable){event.stopImmediatePropagation();pasteHandler(event)}});$body.on("paste",pasteHandler);$parentBody.on("paste",pasteHandler)});
     1window.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)});
  • erropix-hydrogen-paste/tags/1.1.1/readme.txt

    r2291303 r2301343  
    44Tags: Oxygen Builder, Hydrogen Pack, Copy Paste
    55Requires at least: 4.9
    6 Tested up to: 5.4
    7 Stable tag: 1.1
     6Tested up to: 5.4.1
     7Stable tag: 1.1.1
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    2626== Changelog ==
    2727
     28= 1.1.1 =
     29* Ability to paste full page
     30* Ability to paste styles
     31* Bug fixes and checked compatibility with Hydrogen Pack 1.1
     32
    2833= 1.1 =
    2934* Fixed minor bugs
  • erropix-hydrogen-paste/trunk/erropix-hydrogen-paste.php

    r2291302 r2301343  
    44 * Plugin URI: https://www.erropix.com/products/hydrogen-pack/
    55 * Description: This plugin allows you to paste any elements copied using Hydrogen Pack
    6  * Version: 1.1
     6 * Version: 1.1.1
    77 * Author: ERROPiX
    88 * Author URI: https://www.erropix.com
     
    2323add_action('oxygen_enqueue_iframe_scripts', function () {
    2424    $url = plugin_dir_url(__FILE__);
    25     wp_enqueue_script("epxhydro-paste", "{$url}js/paste.js", [], '1.1', true);
     25    wp_enqueue_script("epxhydro-paste", "{$url}js/paste.js", [], '1.1.1', true);
    2626});
    2727
  • erropix-hydrogen-paste/trunk/js

    • Property svn:ignore set to
      paste.dev.js
  • erropix-hydrogen-paste/trunk/js/paste.js

    r2291302 r2301343  
    1 window.addEventListener("load",function(){var $body=angular.element("body");var $parentBody=parent.angular.element("body");var $scope=iframeScope;var $parentScope=iframeScope.parentScope;var activeComponent=$scope.component.active;function decode(hash){try{return JSON.parse(decodeURIComponent(escape(atob(hash))))}catch(error){console.log(error.message)}return false}function checkComponent(){if($parentScope.isActiveActionTab("contentEditing")){return false}return activeComponent.id>0?true:0}function executeCommandPaste(clipboard){var id=activeComponent.id;var data=decode(clipboard);if(data.constructor===Object){if(data.component.constructor===Object){var source=data.source;if(source){delete data.source;var json=JSON.stringify(data);$scope.addComponentFromSource(json,id,source,"hydrogen");return true}}}alert("Invalid clipboard contents")}function pasteHandler(event){var target=event.target;var excluded=["INPUT","TEXTAREA"];if(excluded.includes(target.nodeName)||target.isContentEditable){return}if(checkComponent()!==false){try{var clipboardText=event.originalEvent.clipboardData.getData("Text").trim();if(clipboardText){executeCommandPaste(clipboardText)}}catch(error){alert("Failed to read clipboard contents")}return false}}$body.on("paste","[contenteditable]",function(event){if(!this.isContentEditable){event.stopImmediatePropagation();pasteHandler(event)}});$body.on("paste",pasteHandler);$parentBody.on("paste",pasteHandler)});
     1window.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)});
  • erropix-hydrogen-paste/trunk/readme.txt

    r2291303 r2301343  
    44Tags: Oxygen Builder, Hydrogen Pack, Copy Paste
    55Requires at least: 4.9
    6 Tested up to: 5.4
    7 Stable tag: 1.1
     6Tested up to: 5.4.1
     7Stable tag: 1.1.1
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    2626== Changelog ==
    2727
     28= 1.1.1 =
     29* Ability to paste full page
     30* Ability to paste styles
     31* Bug fixes and checked compatibility with Hydrogen Pack 1.1
     32
    2833= 1.1 =
    2934* Fixed minor bugs
Note: See TracChangeset for help on using the changeset viewer.