Plugin Directory

Changeset 2291302


Ignore:
Timestamp:
04/24/2020 11:55:02 PM (6 years ago)
Author:
ERROPiX
Message:

Release 1.1

Location:
erropix-hydrogen-paste
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • erropix-hydrogen-paste/trunk/erropix-hydrogen-paste.php

    r2291297 r2291302  
    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.0
     6 * Version: 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.0', true);
     25    wp_enqueue_script("epxhydro-paste", "{$url}js/paste.js", [], '1.1', true);
    2626});
    2727
  • erropix-hydrogen-paste/trunk/js/paste.js

    r2291297 r2291302  
    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 $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)});
  • erropix-hydrogen-paste/trunk/readme.txt

    r2291297 r2291302  
    55Requires at least: 4.9
    66Tested up to: 5.4
    7 Stable tag: 1.0
     7Stable tag: 1.1
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    1111
    1212Hydrogen 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.
     13
    1314You can also paste any Oxygen elements shared by other users of the Oxygen community.
    1415
     
    2425
    2526== Changelog ==
     27
     28= 1.1 =
     29* Fixed minor bugs
    2630
    2731= 1.0 =
Note: See TracChangeset for help on using the changeset viewer.