Changeset 2291302
- Timestamp:
- 04/24/2020 11:55:02 PM (6 years ago)
- Location:
- erropix-hydrogen-paste
- Files:
-
- 5 added
- 3 edited
-
tags/1.1 (added)
-
tags/1.1/erropix-hydrogen-paste.php (added)
-
tags/1.1/js (added)
-
tags/1.1/js/paste.js (added)
-
tags/1.1/readme.txt (added)
-
trunk/erropix-hydrogen-paste.php (modified) (2 diffs)
-
trunk/js/paste.js (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
erropix-hydrogen-paste/trunk/erropix-hydrogen-paste.php
r2291297 r2291302 4 4 * Plugin URI: https://www.erropix.com/products/hydrogen-pack/ 5 5 * Description: This plugin allows you to paste any elements copied using Hydrogen Pack 6 * Version: 1. 06 * Version: 1.1 7 7 * Author: ERROPiX 8 8 * Author URI: https://www.erropix.com … … 23 23 add_action('oxygen_enqueue_iframe_scripts', function () { 24 24 $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); 26 26 }); 27 27 -
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)});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)}); -
erropix-hydrogen-paste/trunk/readme.txt
r2291297 r2291302 5 5 Requires at least: 4.9 6 6 Tested up to: 5.4 7 Stable tag: 1. 07 Stable tag: 1.1 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 11 11 12 12 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. 13 13 14 You can also paste any Oxygen elements shared by other users of the Oxygen community. 14 15 … … 24 25 25 26 == Changelog == 27 28 = 1.1 = 29 * Fixed minor bugs 26 30 27 31 = 1.0 =
Note: See TracChangeset
for help on using the changeset viewer.