WordPress.org

Plugin Directory

Changeset 1760790


Ignore:
Timestamp:
11/08/17 14:09:21 (6 weeks ago)
Author:
podpirate
Message:

Release Version 1.0.2 for good

Location:
the-paste
Files:
1 deleted
6 edited
16 copied

Legend:

Unmodified
Added
Removed
  • the-paste/tags/1.0.2/index.php

    r1760781 r1760790  
    66Description: Paste Images in WordPress from many applications md upload them to the media library. 
    77Author: Jörn Lund 
    8 Version: 1.0.1 
     8Version: 1.0.2 
    99Author URI: https://github.com/mcguffin/ 
    1010License: GPL2 
     11Text Domain: the-paste 
     12Domain Path: /languages 
    1113*/ 
    1214 
     
    1517 
    1618define( 'THE_PASTE_FILE', __FILE__ ); 
    17 define( 'THE_PASTE_VERSION', '1.0.1' ); 
     19define( 'THE_PASTE_VERSION', '1.0.2' ); 
    1820define( 'THE_PASTE_DIRECTORY', plugin_dir_path(__FILE__) ); 
    1921 
  • the-paste/tags/1.0.2/js/admin/mce/the-paste-plugin.js

    r1760781 r1760790  
    417417        thepaste.options.editor.auto_upload = localStorage.getItem( 'thepaste.auto_upload' ) !== 'false'; 
    418418 
     419        // enable / disable autoupload 
    419420        editor.addCommand( 'cmd_thepaste', function() { 
    420421            thepaste.options.editor.auto_upload = ! thepaste.options.editor.auto_upload; 
     
    424425        }); 
    425426 
    426  
     427        // enable / disable autoupload button 
    427428        editor.addButton('thepaste', { 
    428429            icon: 'thepaste', 
     
    435436        }); 
    436437 
     438        // upload button in media toolbar flyout 
    437439        editor.addButton('wp_img_thepaste_upload', { 
    438440            icon: 'dashicon dashicons dashicons-upload thepaste-upload', 
     
    447449        }); 
    448450 
     451        // init media toolbar flyout 
    449452        editor.once( 'preinit', function() { 
    450453            if ( editor.wp && editor.wp._createToolbar ) { 
     
    461464        } ); 
    462465 
     466        // setup media toolbar flyout on node change 
    463467        editor.on( 'wptoolbar', function( event ) { 
    464468            var uploadBtn; 
     
    475479        } ); 
    476480 
     481        // tru if data source or blob image 
    477482        function canUpload( img ) { 
    478483            var sub = img.src.substring(0,5); 
     
    480485        } 
    481486 
    482         function execCommandUploadPastedImage(a){ 
    483             if ( thepaste.options.editor.auto_upload && 
    484                 a.command == 'mceInsertContent' && 
    485                 !! a.value && !! a.value.content && 
    486                 "<img" === a.value.content.substring(0,4).toLowerCase() 
    487             ) { 
    488                 $img = $(editor.getBody()).find('.'+pasted_image_tmp_class); 
    489                 if ( canUpload( $img.get(0) ) ) { 
    490                     thepaste.uploadImage( $img.get(0), editor ); 
    491                     $img.removeClass(pasted_image_tmp_class); 
    492                 } 
    493             } 
    494         } 
     487        // setup media toolbar flyout 
    495488        editor 
    496 //          .on( 'init', setupEditorDom ) 
    497             .on( 'PastePostProcess', function(e){ 
    498                 var $firstChild; 
    499                 if ( thepaste.options.editor.auto_upload ) { 
    500                     $firstChild = $(e.node).children().first(); 
    501                     if ( $firstChild.is('img') && canUpload( $firstChild.get(0) ) ) { 
    502                         pasted_image_tmp_class = pasted_image_tmp_prefix + Date.now(); 
    503                         $firstChild.addClass( pasted_image_tmp_class ); 
    504                         editor.once( 'ExecCommand', execCommandUploadPastedImage ); 
    505                     } 
    506                 } 
    507             }) 
    508489            .on( 'BeforePastePreProcess', function(e){ 
    509                 // remove svg data from illustrator 
     490                // remove svg data 
    510491                if (  e.content.match( /&lt;svg[\s\S.]*&lt;\/svg&gt;/i ) ) { 
    511492                    e.preventDefault(); 
     
    515496 
    516497            } ) 
     498            .on( 'PastePostProcess', function(e){ 
     499                // upload image 
     500                var $firstChild, $uploadBox; 
     501 
     502                if ( thepaste.options.editor.auto_upload ) { 
     503                    $firstChild = $(e.node).children().first(); 
     504                    if ( $firstChild.is('img') && canUpload( $firstChild.get(0) ) ) { 
     505                        $uploadBox = thepaste.uploadImage( $firstChild.get(0), editor ); 
     506                        $firstChild.remove(); 
     507                        $(e.node).append( $uploadBox ); 
     508                    } 
     509                } 
     510            }) 
    517511            ; 
    518512 
  • the-paste/tags/1.0.2/js/admin/mce/the-paste-plugin.min.js

    r1760781 r1760790  
    1 (function(){var t,e,n,a,o;t=window.jQuery,t.paste=function(t){var n;return"undefined"!=typeof console&&null!==console&&console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead."),n=e.mountNonInputable(t),n._container},t.fn.pastableNonInputable=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is("textarea, input:text, [contenteditable]")||(e.mountNonInputable(n),n._pastable=!0);return this},t.fn.pastableTextarea=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is(":not(textarea, input:text)")||(e.mountTextarea(n),n._pastable=!0);return this},t.fn.pastableContenteditable=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is(":not([contenteditable])")||(e.mountContenteditable(n),n._pastable=!0);return this},a=function(t,e){var n,a,o,r,i,u,s,l,c,d,p;if(null==e&&(e=512),!(l=t.match(/^data\:([^\;]+)\;base64\,(.+)$/)))return null;for(d=l,l=d[0],u=d[1],n=d[2],r=atob(n),o=[],c=0;c<r.length;){for(p=r.slice(c,c+e),i=new Array(p.length),s=0;s<p.length;)i[s]=p.charCodeAt(s),s++;a=new Uint8Array(i),o.push(a),c+=e}return new Blob(o,{type:u})},n=function(){return t(document.createElement("div")).attr("contenteditable",!0).attr("aria-hidden",!0).attr("tabindex",-1).css({width:1,height:1,position:"fixed",left:-100,overflow:"hidden"})},o=function(e,n){var a,o,r,i,u,s;return i=void 0,u=void 0,r=void 0,o=void 0,a=void 0,"area"===(s=e.nodeName.toLowerCase())?(i=e.parentNode,u=i.name,!(!e.href||!u||"map"!==i.nodeName.toLowerCase())&&(r=t("img[usemap='#"+u+"']"),r.length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(s)?(o=!e.disabled)&&(a=t(e).closest("fieldset")[0])&&(o=!a.disabled):o="a"===s?e.href||n:n,(o=o||t(e).is("[contenteditable]"))&&t(e).is(":visible"))},e=function(){function e(e,n){this._container=e,this._target=n,this._container=t(this._container),this._target=t(this._target).addClass("pastable"),this._container.on("paste",function(t){return function(e){var n,a,o,r,i,u,s,l,c,d,p,g,f;if(e.currentTarget!==e.target)return e.preventDefault();if(t._paste_event_fired=!0,null!=(null!=(c=e.originalEvent)?c.clipboardData:void 0))if(n=e.originalEvent.clipboardData,n.items)for(d=n.items,r=0,u=d.length;r<u;r++){if(o=d[r],o.type.match(/^image\//)){l=new FileReader,l.onload=function(e){return t._handleImage(e.target.result)};try{l.readAsDataURL(o.getAsFile())}catch(t){}e.preventDefault();break}"text/plain"===o.type&&o.getAsString(function(e){return t._target.trigger("pasteText",{text:e})})}else-1!==Array.prototype.indexOf.call(n.types,"text/plain")&&(f=n.getData("Text"),setTimeout(function(){return t._target.trigger("pasteText",{text:f})},1)),t._checkImagesInContainer(function(e){return t._handleImage(e)});if(n=window.clipboardData)if(null!=(p=f=n.getData("Text"))?p.length:void 0)setTimeout(function(){return t._target.trigger("pasteText",{text:f}),t._target.trigger("_pasteCheckContainerDone")},1);else{for(g=n.files,i=0,s=g.length;i<s;i++)a=g[i],t._handleImage(URL.createObjectURL(a));t._checkImagesInContainer(function(t){})}return null}}(this))}return e.prototype._target=null,e.prototype._container=null,e.mountNonInputable=function(a){var r;return r=new e(n().appendTo(a),a),t(a).on("click",function(t){return function(t){if(!o(t.target,!1))return r._container.focus()}}()),r._container.on("focus",function(e){return function(){return t(a).addClass("pastable-focus")}}()),r._container.on("blur",function(e){return function(){return t(a).removeClass("pastable-focus")}}())},e.mountTextarea=function(a){var o,r,i,u;return("undefined"!=typeof DataTransfer&&null!==DataTransfer?DataTransfer.prototype:void 0)&&(null!=(i=Object.getOwnPropertyDescriptor)&&null!=(u=i.call(Object,DataTransfer.prototype,"items"))?u.get:void 0)?this.mountContenteditable(a):(r=new e(n().insertBefore(a),a),o=!1,t(a).on("keyup",function(t){var e;return 17!==(e=t.keyCode)&&224!==e||(o=!1),null}),t(a).on("keydown",function(e){var n;return 17!==(n=e.keyCode)&&224!==n||(o=!0),null!=e.ctrlKey&&null!=e.metaKey&&(o=e.ctrlKey||e.metaKey),o&&86===e.keyCode&&(r._textarea_focus_stolen=!0,r._container.focus(),r._paste_event_fired=!1,setTimeout(function(e){return function(){if(!r._paste_event_fired)return t(a).focus(),r._textarea_focus_stolen=!1}}(),1)),null}),t(a).on("paste",function(t){return function(){}}()),t(a).on("focus",function(e){return function(){if(!r._textarea_focus_stolen)return t(a).addClass("pastable-focus")}}()),t(a).on("blur",function(e){return function(){if(!r._textarea_focus_stolen)return t(a).removeClass("pastable-focus")}}()),t(r._target).on("_pasteCheckContainerDone",function(e){return function(){return t(a).focus(),r._textarea_focus_stolen=!1}}()),t(r._target).on("pasteText",function(e){return function(e,n){var o,r,i;return i=t(a).prop("selectionStart"),r=t(a).prop("selectionEnd"),o=t(a).val(),t(a).val(""+o.slice(0,i)+n.text+o.slice(r)),t(a)[0].setSelectionRange(i+n.text.length,i+n.text.length),t(a).trigger("change")}}()))},e.mountContenteditable=function(n){return new e(n,n),t(n).on("focus",function(e){return function(){return t(n).addClass("pastable-focus")}}()),t(n).on("blur",function(e){return function(){return t(n).removeClass("pastable-focus")}}())},e.prototype._handleImage=function(t){var e;return t.match(/^webkit\-fake\-url\:\/\//)?this._target.trigger("pasteImageError",{message:"You are trying to paste an image in Safari, however we are unable to retieve its data."}):(this._target.trigger("pasteImageStart"),e=new Image,e.crossOrigin="anonymous",e.onload=function(t){return function(){var n,o,r,i;o=document.createElement("canvas"),o.width=e.width,o.height=e.height,r=o.getContext("2d"),r.drawImage(e,0,0,o.width,o.height),i=null;try{i=o.toDataURL("image/png"),n=a(i)}catch(t){}return i&&t._target.trigger("pasteImage",{blob:n,dataURL:i,width:e.width,height:e.height}),t._target.trigger("pasteImageEnd")}}(this),e.onerror=function(e){return function(){return e._target.trigger("pasteImageError",{message:"Failed to get image from: "+t,url:t}),e._target.trigger("pasteImageEnd")}}(this),e.src=t)},e.prototype._checkImagesInContainer=function(e){var n,a,o,r,i;for(i=Math.floor(1e3*Math.random()),r=this._container.find("img"),a=0,o=r.length;a<o;a++)n=r[a],n["_paste_marked_"+i]=!0;return setTimeout(function(a){return function(){var o,r,u;for(u=a._container.find("img"),o=0,r=u.length;o<r;o++)n=u[o],n["_paste_marked_"+i]||(e(n.src),t(n).remove());return a._target.trigger("_pasteCheckContainerDone")}}(this),1)},e}()}).call(this);var thepastePluginCallback;!function(t){thepastePluginCallback=function(e){function n(t){var e=t.src.substring(0,5);return"blob:"===e||"data:"===e}function a(a){i.options.editor.auto_upload&&"mceInsertContent"==a.command&&a.value&&a.value.content&&"<img"===a.value.content.substring(0,4).toLowerCase()&&($img=t(e.getBody()).find("."+u),n($img.get(0))&&(i.uploadImage($img.get(0),e),$img.removeClass(u)))}var o,r,i=wp.media.thepaste,u="";i.options.editor.auto_upload="false"!==localStorage.getItem("thepaste.auto_upload"),e.addCommand("cmd_thepaste",function(){i.options.editor.auto_upload=!i.options.editor.auto_upload,localStorage.setItem("thepaste.auto_upload",i.options.editor.auto_upload.toString()),o.active(i.options.editor.auto_upload)}),e.addButton("thepaste",{icon:"thepaste",tooltip:i.l10n.upload_pasted_images,cmd:"cmd_thepaste",onPostRender:function(){o=this},active:i.options.editor.auto_upload}),e.addButton("wp_img_thepaste_upload",{icon:"dashicon dashicons dashicons-upload thepaste-upload",tooltip:i.l10n.upload_image,onclick:function(){var t;t=e.selection.getNode(),i.uploadImage(t,e)}}),e.once("preinit",function(){e.wp&&e.wp._createToolbar&&(r=e.wp._createToolbar(["wp_img_alignleft","wp_img_aligncenter","wp_img_alignright","wp_img_alignnone","wp_img_thepaste_upload","wp_img_edit","wp_img_remove"]))}),e.on("wptoolbar",function(t){var a;"IMG"!==t.element.nodeName||e.wp.isPlaceholder(t.element)||(t.toolbar=r,a=r.$el.find(".thepaste-upload").closest(".mce-btn"),n(t.element)?a.show():a.hide())}),e.on("PastePostProcess",function(o){var r;i.options.editor.auto_upload&&(r=t(o.node).children().first(),r.is("img")&&n(r.get(0))&&(u="__pasted_image_tmp_"+Date.now(),r.addClass(u),e.once("ExecCommand",a)))}).on("BeforePastePreProcess",function(t){return t.content.match(/&lt;svg[\s\S.]*&lt;\/svg&gt;/i)&&(t.preventDefault(),t.content=""),t})},tinymce.PluginManager.add("thepaste",thepastePluginCallback)}(jQuery); 
    2 //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRoZS1wYXN0ZS1wbHVnaW4uanMiXSwibmFtZXMiOlsiJCIsIlBhc3RlIiwiY3JlYXRlSGlkZGVuRWRpdGFibGUiLCJkYXRhVVJMdG9CbG9iIiwiaXNGb2N1c2FibGUiLCJ3aW5kb3ciLCJqUXVlcnkiLCJwYXN0ZSIsInBhc3RlQ29udGFpbmVyIiwicG0iLCJjb25zb2xlIiwibG9nIiwibW91bnROb25JbnB1dGFibGUiLCJfY29udGFpbmVyIiwiZm4iLCJwYXN0YWJsZU5vbklucHV0YWJsZSIsImVsIiwiaiIsImxlbiIsInJlZiIsInRoaXMiLCJsZW5ndGgiLCJfcGFzdGFibGUiLCJpcyIsInBhc3RhYmxlVGV4dGFyZWEiLCJtb3VudFRleHRhcmVhIiwicGFzdGFibGVDb250ZW50ZWRpdGFibGUiLCJtb3VudENvbnRlbnRlZGl0YWJsZSIsImRhdGFVUkwiLCJzbGljZVNpemUiLCJiNjREYXRhIiwiYnl0ZUFycmF5IiwiYnl0ZUFycmF5cyIsImJ5dGVDaGFyYWN0ZXJzIiwiYnl0ZU51bWJlcnMiLCJjb250ZW50VHlwZSIsImkiLCJtIiwib2Zmc2V0Iiwic2xpY2UiLCJtYXRjaCIsImF0b2IiLCJBcnJheSIsImNoYXJDb2RlQXQiLCJVaW50OEFycmF5IiwicHVzaCIsIkJsb2IiLCJ0eXBlIiwiZG9jdW1lbnQiLCJjcmVhdGVFbGVtZW50IiwiYXR0ciIsImNzcyIsIndpZHRoIiwiaGVpZ2h0IiwicG9zaXRpb24iLCJsZWZ0Iiwib3ZlcmZsb3ci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YyID0gZXYua2V5Q29kZSkgPT09IDE3IHx8IHJlZjIgPT09IDIyNCkge1xuICAgICAgICAgIGN0bERvd24gPSBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgIH0pO1xuICAgICAgJCh0ZXh0YXJlYSkub24oJ2tleWRvd24nLCBmdW5jdGlvbihldikge1xuICAgICAgICB2YXIgcmVmMjtcbiAgICAgICAgaWYgKChyZWYyID0gZXYua2V5Q29kZSkgPT09IDE3IHx8IHJlZjIgPT09IDIyNCkge1xuICAgICAgICAgIGN0bERvd24gPSB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGlmICgoZXYuY3RybEtleSAhPSBudWxsKSAmJiAoZXYubWV0YUtleSAhPSBudWxsKSkge1xuICAgICAgICAgIGN0bERvd24gPSBldi5jdHJsS2V5IHx8IGV2Lm1ldGFLZXk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGN0bERvd24gJiYgZXYua2V5Q29kZSA9PT0gODYpIHtcbiAgICAgICAgICBwYXN0ZS5fdGV4dGFyZWFfZm9jdXNfc3RvbGVuID0gdHJ1ZTtcbiAgICAgICAgICBwYXN0ZS5fY29udGFpbmVyLmZvY3VzKCk7XG4gICAgICAgICAgcGFzdGUuX3Bhc3RlX2V2ZW50X2ZpcmVkID0gZmFsc2U7XG4gICAgICAgICAgc2V0VGltZW91dCgoZnVuY3Rpb24oX3RoaXMpIHtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgaWYgKCFwYXN0ZS5fcGFzdGVfZXZlbnRfZmlyZWQpIHtcbiAgICAgICAgICAgICAgICAkKHRleHRhcmVhKS5mb2N1cygpO1xuICAgICAgICAgICAgICAgIHJldHVybiBwYXN0ZS5fdGV4dGFyZWFfZm9jdXNfc3RvbGVuID0gZmFsc2U7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSkodGhpcyksIDEpO1xuIC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W5hbEV2ZW50KSAhPSBudWxsID8gcmVmLmNsaXBib2FyZERhdGEgOiB2b2lkIDApICE9IG51bGwpIHtcbiAgICAgICAgICAgIGNsaXBib2FyZERhdGEgPSBldi5vcmlnaW5hbEV2ZW50LmNsaXBib2FyZERhdGE7XG4gICAgICAgICAgICBpZiAoY2xpcGJvYXJkRGF0YS5pdGVtcykge1xuICAgICAgICAgICAgICByZWYxID0gY2xpcGJvYXJkRGF0YS5pdGVtcztcbiAgICAgICAgICAgICAgZm9yIChqID0gMCwgbGVuID0gcmVmMS5sZW5ndGg7IGogPCBsZW47IGorKykge1xuICAgICAgICAgICAgICAgIGl0ZW0gPSByZWYxW2pdO1xuICAgICAgICAgICAgICAgIGlmIChpdGVtLnR5cGUubWF0Y2goL15pbWFnZVxcLy8pKSB7XG4gICAgICAgICAgICAgICAgICByZWFkZXIgPSBuZXcgRmlsZVJlYWRlcigpO1xuICAgICAgICAgICAgICAgICAgcmVhZGVyLm9ubG9hZCA9IGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5faGFuZGxlSW1hZ2UoZXZlbnQudGFyZ2V0LnJlc3VsdCk7XG4gICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgcmVhZGVyLnJlYWRBc0RhdGFVUkwoaXRlbS5nZXRBc0ZpbGUoKSk7XG4gICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge31cbiAgICAgICAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGl0ZW0udHlwZSA9PT0gJ3RleHQvcGxhaW4nKSB7XG4gICAgICAgICAgICAgICAgICBpdGVtLmdldEFzU3RyaW5nKGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX3RhcmdldC50cmlnZ2VyKCdwYXN0ZVRleHQnLCB7XG4gICAgICAgICAgICAgICAgICAgICAgdGV4dDogc3RyaW5nXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoLTEgIT09IEFycmF5LnByb3RvdHlwZS5pbmRleE9mLmNhbGwoY2xpcGJvYXJkRGF0YS50eXBlcywgJ3RleHQvcGxhaW4nKSkge1xuICAgICAgICAgICAgICAgIHRleHQgPSBjbGlwYm9hcmREYXRhLmdldERhdGEoJ1RleHQnKTtcbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVUZXh0Jywge1xuICAgICAgICAgICAgICAgICAgICB0ZXh0OiB0ZXh0XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9LCAxKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBfdGhpcy5fY2hlY2tJbWFnZXNJbkNvbnRhaW5lcihmdW5jdGlvbihzcmMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX2hhbmRsZUltYWdlKHNyYyk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoY2xpcGJvYXJkRGF0YSA9IHdpbmRvdy5jbGlwYm9hcmREYXRhKSB7XG4gICAgICAgICAgICBpZiAoKHJlZjIgPSAodGV4dCA9IGNsaXBib2FyZERhdGEuZ2V0RGF0YSgnVGV4dCcpKSkgIT0gbnVsbCA/IHJlZjIubGVuZ3RoIDogdm9pZCAwKSB7XG4gICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgX3RoaXMuX3RhcmdldC50cmlnZ2VyKCdwYXN0ZVRleHQnLCB7XG4gICAgICAgICAgICAgICAgICB0ZXh0OiB0ZXh0XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl90YXJnZXQudHJpZ2dlcignX3Bhc3RlQ2hlY2tDb250YWluZXJEb25lJyk7XG4gICAgICAgICAgICAgIH0sIDEpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmVmMyA9IGNsaXBib2FyZERhdGEuZmlsZXM7XG4gICAgICAgICAgICAgIGZvciAoayA9IDAsIGxlbjEgPSByZWYzLmxlbmd0aDsgayA8IGxlbjE7IGsrKykge1xuICAgICAgICAgICAgICAgIGZpbGUgPSByZWYzW2tdO1xuICAgICAgICAgICAgICAgIF90aGlzLl9oYW5kbGVJbWFnZShVUkwuY3JlYXRlT2JqZWN0VVJMKGZpbGUpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBfdGhpcy5fY2hlY2tJbWFnZXNJbkNvbnRhaW5lcihmdW5jdGlvbihzcmMpIHt9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH07XG4gICAgICB9KSh0aGlzKSk7XG4gICAgfVxuXG4gICAgUGFzdGUucHJvdG90eXBlLl9oYW5kbGVJbWFnZSA9IGZ1bmN0aW9uKHNyYykge1xuICAgICAgdmFyIGxvYWRlcjtcbiAgICAgIGlmIChzcmMubWF0Y2goL153ZWJraXRcXC1mYWtlXFwtdXJsXFw6XFwvXFwvLykpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX3RhcmdldC50cmlnZ2VyKCdwYXN0ZUltYWdlRXJyb3InLCB7XG4gICAgICAgICAgbWVzc2FnZTogXCJZb3UgYXJlIHRyeWluZyB0byBwYXN0ZSBh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jQ29tbWFuZCcsIGV4ZWNDb21tYW5kVXBsb2FkUGFzdGVkSW1hZ2UgKTtcblx0XHRcdFx0XHR9XG5cdFx0XHRcdH1cblx0XHRcdH0pXG5cdFx0XHQub24oICdCZWZvcmVQYXN0ZVByZVByb2Nlc3MnLCBmdW5jdGlvbihlKXtcblx0XHRcdFx0Ly8gcmVtb3ZlIHN2ZyBkYXRhIGZyb20gaWxsdXN0cmF0b3Jcblx0XHRcdFx0aWYgKCAgZS5jb250ZW50Lm1hdGNoKCAvJmx0O3N2Z1tcXHNcXFMuXSombHQ7XFwvc3ZnJmd0Oy9pICkgKSB7XG5cdFx0XHRcdFx0ZS5wcmV2ZW50RGVmYXVsdCgpO1xuXHRcdFx0XHRcdGUuY29udGVudCA9ICcnO1xuXHRcdFx0XHR9XG5cdFx0XHRcdHJldHVybiBlO1xuXG5cdFx0XHR9IClcblx0XHRcdDtcblxuXHR9O1xuXG5cdHRpbnltY2UuUGx1Z2luTWFuYWdlci5hZGQoICd0aGVwYXN0ZScsIHRoZXBhc3RlUGx1Z2luQ2FsbGJhY2sgKTtcblxufSApKGpRdWVyeSk7XG4iXX0= 
     1(function(){var t,e,n,a,o;t=window.jQuery,t.paste=function(t){var n;return"undefined"!=typeof console&&null!==console&&console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead."),n=e.mountNonInputable(t),n._container},t.fn.pastableNonInputable=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is("textarea, input:text, [contenteditable]")||(e.mountNonInputable(n),n._pastable=!0);return this},t.fn.pastableTextarea=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is(":not(textarea, input:text)")||(e.mountTextarea(n),n._pastable=!0);return this},t.fn.pastableContenteditable=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is(":not([contenteditable])")||(e.mountContenteditable(n),n._pastable=!0);return this},a=function(t,e){var n,a,o,r,i,u,s,l,c,p,d;if(null==e&&(e=512),!(l=t.match(/^data\:([^\;]+)\;base64\,(.+)$/)))return null;for(p=l,l=p[0],u=p[1],n=p[2],r=atob(n),o=[],c=0;c<r.length;){for(d=r.slice(c,c+e),i=new Array(d.length),s=0;s<d.length;)i[s]=d.charCodeAt(s),s++;a=new Uint8Array(i),o.push(a),c+=e}return new Blob(o,{type:u})},n=function(){return t(document.createElement("div")).attr("contenteditable",!0).attr("aria-hidden",!0).attr("tabindex",-1).css({width:1,height:1,position:"fixed",left:-100,overflow:"hidden"})},o=function(e,n){var a,o,r,i,u,s;return i=void 0,u=void 0,r=void 0,o=void 0,a=void 0,"area"===(s=e.nodeName.toLowerCase())?(i=e.parentNode,u=i.name,!(!e.href||!u||"map"!==i.nodeName.toLowerCase())&&(r=t("img[usemap='#"+u+"']"),r.length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(s)?(o=!e.disabled)&&(a=t(e).closest("fieldset")[0])&&(o=!a.disabled):o="a"===s?e.href||n:n,(o=o||t(e).is("[contenteditable]"))&&t(e).is(":visible"))},e=function(){function e(e,n){this._container=e,this._target=n,this._container=t(this._container),this._target=t(this._target).addClass("pastable"),this._container.on("paste",function(t){return function(e){var n,a,o,r,i,u,s,l,c,p,d,g,f;if(e.currentTarget!==e.target)return e.preventDefault();if(t._paste_event_fired=!0,null!=(null!=(c=e.originalEvent)?c.clipboardData:void 0))if(n=e.originalEvent.clipboardData,n.items)for(p=n.items,r=0,u=p.length;r<u;r++){if(o=p[r],o.type.match(/^image\//)){l=new FileReader,l.onload=function(e){return t._handleImage(e.target.result)};try{l.readAsDataURL(o.getAsFile())}catch(t){}e.preventDefault();break}"text/plain"===o.type&&o.getAsString(function(e){return t._target.trigger("pasteText",{text:e})})}else-1!==Array.prototype.indexOf.call(n.types,"text/plain")&&(f=n.getData("Text"),setTimeout(function(){return t._target.trigger("pasteText",{text:f})},1)),t._checkImagesInContainer(function(e){return t._handleImage(e)});if(n=window.clipboardData)if(null!=(d=f=n.getData("Text"))?d.length:void 0)setTimeout(function(){return t._target.trigger("pasteText",{text:f}),t._target.trigger("_pasteCheckContainerDone")},1);else{for(g=n.files,i=0,s=g.length;i<s;i++)a=g[i],t._handleImage(URL.createObjectURL(a));t._checkImagesInContainer(function(t){})}return null}}(this))}return e.prototype._target=null,e.prototype._container=null,e.mountNonInputable=function(a){var r;return r=new e(n().appendTo(a),a),t(a).on("click",function(t){return function(t){if(!o(t.target,!1))return r._container.focus()}}()),r._container.on("focus",function(e){return function(){return t(a).addClass("pastable-focus")}}()),r._container.on("blur",function(e){return function(){return t(a).removeClass("pastable-focus")}}())},e.mountTextarea=function(a){var o,r,i,u;return("undefined"!=typeof DataTransfer&&null!==DataTransfer?DataTransfer.prototype:void 0)&&(null!=(i=Object.getOwnPropertyDescriptor)&&null!=(u=i.call(Object,DataTransfer.prototype,"items"))?u.get:void 0)?this.mountContenteditable(a):(r=new e(n().insertBefore(a),a),o=!1,t(a).on("keyup",function(t){var e;return 17!==(e=t.keyCode)&&224!==e||(o=!1),null}),t(a).on("keydown",function(e){var n;return 17!==(n=e.keyCode)&&224!==n||(o=!0),null!=e.ctrlKey&&null!=e.metaKey&&(o=e.ctrlKey||e.metaKey),o&&86===e.keyCode&&(r._textarea_focus_stolen=!0,r._container.focus(),r._paste_event_fired=!1,setTimeout(function(e){return function(){if(!r._paste_event_fired)return t(a).focus(),r._textarea_focus_stolen=!1}}(),1)),null}),t(a).on("paste",function(t){return function(){}}()),t(a).on("focus",function(e){return function(){if(!r._textarea_focus_stolen)return t(a).addClass("pastable-focus")}}()),t(a).on("blur",function(e){return function(){if(!r._textarea_focus_stolen)return t(a).removeClass("pastable-focus")}}()),t(r._target).on("_pasteCheckContainerDone",function(e){return function(){return t(a).focus(),r._textarea_focus_stolen=!1}}()),t(r._target).on("pasteText",function(e){return function(e,n){var o,r,i;return i=t(a).prop("selectionStart"),r=t(a).prop("selectionEnd"),o=t(a).val(),t(a).val(""+o.slice(0,i)+n.text+o.slice(r)),t(a)[0].setSelectionRange(i+n.text.length,i+n.text.length),t(a).trigger("change")}}()))},e.mountContenteditable=function(n){return new e(n,n),t(n).on("focus",function(e){return function(){return t(n).addClass("pastable-focus")}}()),t(n).on("blur",function(e){return function(){return t(n).removeClass("pastable-focus")}}())},e.prototype._handleImage=function(t){var e;return t.match(/^webkit\-fake\-url\:\/\//)?this._target.trigger("pasteImageError",{message:"You are trying to paste an image in Safari, however we are unable to retieve its data."}):(this._target.trigger("pasteImageStart"),e=new Image,e.crossOrigin="anonymous",e.onload=function(t){return function(){var n,o,r,i;o=document.createElement("canvas"),o.width=e.width,o.height=e.height,r=o.getContext("2d"),r.drawImage(e,0,0,o.width,o.height),i=null;try{i=o.toDataURL("image/png"),n=a(i)}catch(t){}return i&&t._target.trigger("pasteImage",{blob:n,dataURL:i,width:e.width,height:e.height}),t._target.trigger("pasteImageEnd")}}(this),e.onerror=function(e){return function(){return e._target.trigger("pasteImageError",{message:"Failed to get image from: "+t,url:t}),e._target.trigger("pasteImageEnd")}}(this),e.src=t)},e.prototype._checkImagesInContainer=function(e){var n,a,o,r,i;for(i=Math.floor(1e3*Math.random()),r=this._container.find("img"),a=0,o=r.length;a<o;a++)n=r[a],n["_paste_marked_"+i]=!0;return setTimeout(function(a){return function(){var o,r,u;for(u=a._container.find("img"),o=0,r=u.length;o<r;o++)n=u[o],n["_paste_marked_"+i]||(e(n.src),t(n).remove());return a._target.trigger("_pasteCheckContainerDone")}}(this),1)},e}()}).call(this);var thepastePluginCallback;!function(t){thepastePluginCallback=function(e){function n(t){var e=t.src.substring(0,5);return"blob:"===e||"data:"===e}var a,o,r=wp.media.thepaste;r.options.editor.auto_upload="false"!==localStorage.getItem("thepaste.auto_upload"),e.addCommand("cmd_thepaste",function(){r.options.editor.auto_upload=!r.options.editor.auto_upload,localStorage.setItem("thepaste.auto_upload",r.options.editor.auto_upload.toString()),a.active(r.options.editor.auto_upload)}),e.addButton("thepaste",{icon:"thepaste",tooltip:r.l10n.upload_pasted_images,cmd:"cmd_thepaste",onPostRender:function(){a=this},active:r.options.editor.auto_upload}),e.addButton("wp_img_thepaste_upload",{icon:"dashicon dashicons dashicons-upload thepaste-upload",tooltip:r.l10n.upload_image,onclick:function(){var t;t=e.selection.getNode(),r.uploadImage(t,e)}}),e.once("preinit",function(){e.wp&&e.wp._createToolbar&&(o=e.wp._createToolbar(["wp_img_alignleft","wp_img_aligncenter","wp_img_alignright","wp_img_alignnone","wp_img_thepaste_upload","wp_img_edit","wp_img_remove"]))}),e.on("wptoolbar",function(t){var a;"IMG"!==t.element.nodeName||e.wp.isPlaceholder(t.element)||(t.toolbar=o,a=o.$el.find(".thepaste-upload").closest(".mce-btn"),n(t.element)?a.show():a.hide())}),e.on("BeforePastePreProcess",function(t){return t.content.match(/&lt;svg[\s\S.]*&lt;\/svg&gt;/i)&&(t.preventDefault(),t.content=""),t}).on("PastePostProcess",function(a){var o,i;r.options.editor.auto_upload&&(o=t(a.node).children().first(),o.is("img")&&n(o.get(0))&&(i=r.uploadImage(o.get(0),e),o.remove(),t(a.node).append(i)))})},tinymce.PluginManager.add("thepaste",thepastePluginCallback)}(jQuery); 
     2//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRoZS1wYXN0ZS1wbHVnaW4uanMiXSwibmFtZXMiOlsiJCIsIlBhc3RlIiwiY3JlYXRlSGlkZGVuRWRpdGFibGUiLCJkYXRhVVJMdG9CbG9iIiwiaXNGb2N1c2FibGUiLCJ3aW5kb3ciLCJqUXVlcnkiLCJwYXN0ZSIsInBhc3RlQ29udGFpbmVyIiwicG0iLCJjb25zb2xlIiwibG9nIiwibW91bnROb25JbnB1dGFibGUiLCJfY29udGFpbmVyIiwiZm4iLCJwYXN0YWJsZU5vbklucHV0YWJsZSIsImVsIiwiaiIsImxlbiIsInJlZiIsInRoaXMiLCJsZW5ndGgiLCJfcGFzdGFibGUiLCJpcyIsInBh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09PSAxNyB8fCByZWYyID09PSAyMjQpIHtcbiAgICAgICAgICBjdGxEb3duID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICB9KTtcbiAgICAgICQodGV4dGFyZWEpLm9uKCdrZXlkb3duJywgZnVuY3Rpb24oZXYpIHtcbiAgICAgICAgdmFyIHJlZjI7XG4gICAgICAgIGlmICgocmVmMiA9IGV2LmtleUNvZGUpID09PSAxNyB8fCByZWYyID09PSAyMjQpIHtcbiAgICAgICAgICBjdGxEb3duID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoKGV2LmN0cmxLZXkgIT0gbnVsbCkgJiYgKGV2Lm1ldGFLZXkgIT0gbnVsbCkpIHtcbiAgICAgICAgICBjdGxEb3duID0gZXYuY3RybEtleSB8fCBldi5tZXRhS2V5O1xuICAgICAgICB9XG4gICAgICAgIGlmIChjdGxEb3duICYmIGV2LmtleUNvZGUgPT09IDg2KSB7XG4gICAgICAgICAgcGFzdGUuX3RleHRhcmVhX2ZvY3VzX3N0b2xlbiA9IHRydWU7XG4gICAgICAgICAgcGFzdGUuX2NvbnRhaW5lci5mb2N1cygpO1xuICAgICAgICAgIHBhc3RlLl9wYXN0ZV9ldmVudF9maXJlZCA9IGZhbHNlO1xuICAgICAgICAgIHNldFRpbWVvdXQoKGZ1bmN0aW9uKF90aGlzKSB7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIGlmICghcGFzdGUuX3Bhc3RlX2V2ZW50X2ZpcmVkKSB7XG4gICAgICAgICAgICAgICAgJCh0ZXh0YXJlYSkuZm9jdXMoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFzdGUuX3RleHRhcmVhX2ZvY3VzX3N0b2xlbiA9IGZhbHNlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0pKHRoaXMpLCAxKTtcbiAgICAgICAgfVxuICA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IT0gbnVsbCA/IHJlZi5jbGlwYm9hcmREYXRhIDogdm9pZCAwKSAhPSBudWxsKSB7XG4gICAgICAgICAgICBjbGlwYm9hcmREYXRhID0gZXYub3JpZ2luYWxFdmVudC5jbGlwYm9hcmREYXRhO1xuICAgICAgICAgICAgaWYgKGNsaXBib2FyZERhdGEuaXRlbXMpIHtcbiAgICAgICAgICAgICAgcmVmMSA9IGNsaXBib2FyZERhdGEuaXRlbXM7XG4gICAgICAgICAgICAgIGZvciAoaiA9IDAsIGxlbiA9IHJlZjEubGVuZ3RoOyBqIDwgbGVuOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpdGVtID0gcmVmMVtqXTtcbiAgICAgICAgICAgICAgICBpZiAoaXRlbS50eXBlLm1hdGNoKC9eaW1hZ2VcXC8vKSkge1xuICAgICAgICAgICAgICAgICAgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKTtcbiAgICAgICAgICAgICAgICAgIHJlYWRlci5vbmxvYWQgPSBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX2hhbmRsZUltYWdlKGV2ZW50LnRhcmdldC5yZXN1bHQpO1xuICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHJlYWRlci5yZWFkQXNEYXRhVVJMKGl0ZW0uZ2V0QXNGaWxlKCkpO1xuICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHt9XG4gICAgICAgICAgICAgICAgICBldi5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpdGVtLnR5cGUgPT09ICd0ZXh0L3BsYWluJykge1xuICAgICAgICAgICAgICAgICAgaXRlbS5nZXRBc1N0cmluZyhmdW5jdGlvbihzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVUZXh0Jywge1xuICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IHN0cmluZ1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKC0xICE9PSBBcnJheS5wcm90b3R5cGUuaW5kZXhPZi5jYWxsKGNsaXBib2FyZERhdGEudHlwZXMsICd0ZXh0L3BsYWluJykpIHtcbiAgICAgICAgICAgICAgICB0ZXh0ID0gY2xpcGJvYXJkRGF0YS5nZXREYXRhKCdUZXh0Jyk7XG4gICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ3Bhc3RlVGV4dCcsIHtcbiAgICAgICAgICAgICAgICAgICAgdGV4dDogdGV4dFxuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSwgMSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgX3RoaXMuX2NoZWNrSW1hZ2VzSW5Db250YWluZXIoZnVuY3Rpb24oc3JjKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl9oYW5kbGVJbWFnZShzcmMpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGNsaXBib2FyZERhdGEgPSB3aW5kb3cuY2xpcGJvYXJkRGF0YSkge1xuICAgICAgICAgICAgaWYgKChyZWYyID0gKHRleHQgPSBjbGlwYm9hcmREYXRhLmdldERhdGEoJ1RleHQnKSkpICE9IG51bGwgPyByZWYyLmxlbmd0aCA6IHZvaWQgMCkge1xuICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIF90aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVUZXh0Jywge1xuICAgICAgICAgICAgICAgICAgdGV4dDogdGV4dFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ19wYXN0ZUNoZWNrQ29udGFpbmVyRG9uZScpO1xuICAgICAgICAgICAgICB9LCAxKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJlZjMgPSBjbGlwYm9hcmREYXRhLmZpbGVzO1xuICAgICAgICAgICAgICBmb3IgKGsgPSAwLCBsZW4xID0gcmVmMy5sZW5ndGg7IGsgPCBsZW4xOyBrKyspIHtcbiAgICAgICAgICAgICAgICBmaWxlID0gcmVmM1trXTtcbiAgICAgICAgICAgICAgICBfdGhpcy5faGFuZGxlSW1hZ2UoVVJMLmNyZWF0ZU9iamVjdFVSTChmaWxlKSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgX3RoaXMuX2NoZWNrSW1hZ2VzSW5Db250YWluZXIoZnVuY3Rpb24oc3JjKSB7fSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9O1xuICAgICAgfSkodGhpcykpO1xuICAgIH1cblxuICAgIFBhc3RlLnByb3RvdHlwZS5faGFuZGxlSW1hZ2UgPSBmdW5jdGlvbihzcmMpIHtcbiAgICAgIHZhciBsb2FkZXI7XG4gICAgICBpZiAoc3JjLm1hdGNoKC9ed2Via2l0XFwtZmFrZVxcLXVybFxcOlxcL1xcLy8pKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVJbWFnZUVycm9yJywge1xuICAgICAgICAgIG1lc3NhZ2U6IFwiWW91IGFyZSB0cnlpbmcgdG8gcGFzdGUgYW4gaW1hZ2Ug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dFx0XHRcdCQoZS5ub2RlKS5hcHBlbmQoICR1cGxvYWRCb3ggKTtcblx0XHRcdFx0XHR9XG5cdFx0XHRcdH1cblx0XHRcdH0pXG5cdFx0XHQ7XG5cblx0fTtcblxuXHR0aW55bWNlLlBsdWdpbk1hbmFnZXIuYWRkKCAndGhlcGFzdGUnLCB0aGVwYXN0ZVBsdWdpbkNhbGxiYWNrICk7XG5cbn0gKShqUXVlcnkpO1xuIl19 
  • the-paste/tags/1.0.2/js/admin/the-paste.js

    r1760781 r1760790  
    412412        view:{}, 
    413413 
    414         insertImage:function( dataURL, type, editor ) { 
    415             var id = '__thepaste_img_'+(counter++), 
    416                 imageHtml = '<img id="'+id+'" class="alignnone size-full" src="'+dataURL+'" />', 
    417                 $container; 
    418  
    419  
    420             editor.insertContent( imageHtml ); 
    421  
    422             return editor.$('#'+id)[0]; 
    423         }, 
    424  
    425         uploadImage: function( image, editor ) { 
     414        uploadImage: function( image, editor, upload_placeholder ) { 
     415 
     416            var id = '__thepaste_box_'+(counter++), 
     417                $container = $(image) 
     418                    .wrap('<div id="'+id+'" data-progress="0" class="thepaste-image-placeholder" contenteditable="false"></div>') 
     419                    .parent(); 
     420 
     421                // set $container size once known 
     422                image.onload = function() { 
     423                    $( editor.$('#'+id) ).width( this.naturalWidth ); 
     424                    $( editor.$('#'+id) ).height( this.naturalHeight ); 
     425                } 
    426426 
    427427            var xhr, 
    428428                workflow, 
    429                 $container, 
    430429                src = image.src, 
    431430                upload = function( dataURL ){ 
    432                     var id = '__thepaste_box_'+(counter++), 
    433                         type = dataURL.match(/^data\:([^\;]+)\;/)[1] 
     431                    var type = dataURL.match(/^data\:([^\;]+)\;/)[1] 
    434432                        file = new o.Blob( null, { data: dataURL } ) 
    435433                        suffix = thepaste.options.mime_types.convert[ type ]; 
    436434                    if ( 'undefined' === typeof suffix ) { 
    437                         console.trace( 'bad type: ' + type ); 
     435                        console.trace( 'Won\'t upload, bad mime type: ' + type ); 
    438436                    } 
    439                     $(image).wrap('<div id="'+id+'" data-progress="0" class="thepaste-image-placeholder" contenteditable="false"></div>'); 
    440                     $container = editor.$('#'+id); 
    441437 
    442438                    file.name = thepaste.l10n.pasted + '.' + suffix; 
     
    466462                    } 
    467463                    workflow.uploader.uploader.uploader.bind('UploadProgress',function( e ){ 
    468                         $container.attr('data-progress',e.total.percent); 
     464                        editor.$('#'+id).attr('data-progress',e.total.percent); 
    469465                    }); 
    470466                    workflow.uploader.uploader.uploader.bind('FileUploaded',function( up, args ){ 
    471                         var imgHTML = '<img class="alignnone wp-image-'+args.attachment.id+' size-full" src="'+args.attachment.changed.url+'" />'; 
     467 
     468                        var $container = editor.$('#'+id), 
     469                            imgHTML = '<img class="alignnone wp-image-'+args.attachment.id+' size-full" src="'+args.attachment.changed.url+'" />'; 
     470 
    472471                        // replace image 
    473472                        $container.replaceWith( imgHTML ); 
     473 
    474474                        // replace other instances 
    475475                        editor.$('img[src="'+src+'"]').each(function(){ 
     
    502502                upload( src ); 
    503503            } 
    504  
     504            return $container; 
    505505        }, 
    506506 
     
    708708        $discardBtn : null, 
    709709        $uploadBtn : null, 
    710          
     710 
    711711        uploader : null, 
    712          
     712 
    713713        events : { 
    714714            'click [data-action="upload"]'  : 'uploadImage', 
     
    739739                format = this.options.defaultFileFormat; 
    740740            } 
    741              
     741 
    742742            if ( this.image ) { 
    743743                this.image.destroy(); 
     
    908908        template: wp.template('thepaste-grabber'), 
    909909        className : 'thepaste-grabber', 
    910          
     910 
    911911        grabber : null, 
    912912        uploader : null, 
    913          
     913 
    914914        initialize : function() { 
    915915            var ret = wp.media.View.prototype.initialize.apply( this, arguments ); 
     
    919919                defaultFileName : l10n.pasted, 
    920920                defaultFileFormat : 'image/png', 
    921                 title           : l10n.copy_paste  
     921                title           : l10n.copy_paste 
    922922            }); 
    923923 
    924924            this.grabber  = new this.options.grabber( { controller  : this.controller } ); 
    925925 
    926             this.uploader = new wp.media.thepaste.view.DataSourceImageUploader( {    
     926            this.uploader = new wp.media.thepaste.view.DataSourceImageUploader( { 
    927927                                    controller          : this.controller, 
    928928                                    uploder             : this.options.wpuploader, 
  • the-paste/tags/1.0.2/js/admin/the-paste.min.js

    r1760781 r1760790  
    1 (function(){var e,t,a,i,n;e=window.jQuery,e.paste=function(e){var a;return"undefined"!=typeof console&&null!==console&&console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead."),a=t.mountNonInputable(e),a._container},e.fn.pastableNonInputable=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is("textarea, input:text, [contenteditable]")||(t.mountNonInputable(a),a._pastable=!0);return this},e.fn.pastableTextarea=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is(":not(textarea, input:text)")||(t.mountTextarea(a),a._pastable=!0);return this},e.fn.pastableContenteditable=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is(":not([contenteditable])")||(t.mountContenteditable(a),a._pastable=!0);return this},i=function(e,t){var a,i,n,r,o,s,l,p,d,u,c;if(null==t&&(t=512),!(p=e.match(/^data\:([^\;]+)\;base64\,(.+)$/)))return null;for(u=p,p=u[0],s=u[1],a=u[2],r=atob(a),n=[],d=0;d<r.length;){for(c=r.slice(d,d+t),o=new Array(c.length),l=0;l<c.length;)o[l]=c.charCodeAt(l),l++;i=new Uint8Array(o),n.push(i),d+=t}return new Blob(n,{type:s})},a=function(){return e(document.createElement("div")).attr("contenteditable",!0).attr("aria-hidden",!0).attr("tabindex",-1).css({width:1,height:1,position:"fixed",left:-100,overflow:"hidden"})},n=function(t,a){var i,n,r,o,s,l;return o=void 0,s=void 0,r=void 0,n=void 0,i=void 0,"area"===(l=t.nodeName.toLowerCase())?(o=t.parentNode,s=o.name,!(!t.href||!s||"map"!==o.nodeName.toLowerCase())&&(r=e("img[usemap='#"+s+"']"),r.length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(l)?(n=!t.disabled)&&(i=e(t).closest("fieldset")[0])&&(n=!i.disabled):n="a"===l?t.href||a:a,(n=n||e(t).is("[contenteditable]"))&&e(t).is(":visible"))},t=function(){function t(t,a){this._container=t,this._target=a,this._container=e(this._container),this._target=e(this._target).addClass("pastable"),this._container.on("paste",function(e){return function(t){var a,i,n,r,o,s,l,p,d,u,c,h,g;if(t.currentTarget!==t.target)return t.preventDefault();if(e._paste_event_fired=!0,null!=(null!=(d=t.originalEvent)?d.clipboardData:void 0))if(a=t.originalEvent.clipboardData,a.items)for(u=a.items,r=0,s=u.length;r<s;r++){if(n=u[r],n.type.match(/^image\//)){p=new FileReader,p.onload=function(t){return e._handleImage(t.target.result)};try{p.readAsDataURL(n.getAsFile())}catch(e){}t.preventDefault();break}"text/plain"===n.type&&n.getAsString(function(t){return e._target.trigger("pasteText",{text:t})})}else-1!==Array.prototype.indexOf.call(a.types,"text/plain")&&(g=a.getData("Text"),setTimeout(function(){return e._target.trigger("pasteText",{text:g})},1)),e._checkImagesInContainer(function(t){return e._handleImage(t)});if(a=window.clipboardData)if(null!=(c=g=a.getData("Text"))?c.length:void 0)setTimeout(function(){return e._target.trigger("pasteText",{text:g}),e._target.trigger("_pasteCheckContainerDone")},1);else{for(h=a.files,o=0,l=h.length;o<l;o++)i=h[o],e._handleImage(URL.createObjectURL(i));e._checkImagesInContainer(function(e){})}return null}}(this))}return t.prototype._target=null,t.prototype._container=null,t.mountNonInputable=function(i){var r;return r=new t(a().appendTo(i),i),e(i).on("click",function(e){return function(e){if(!n(e.target,!1))return r._container.focus()}}()),r._container.on("focus",function(t){return function(){return e(i).addClass("pastable-focus")}}()),r._container.on("blur",function(t){return function(){return e(i).removeClass("pastable-focus")}}())},t.mountTextarea=function(i){var n,r,o,s;return("undefined"!=typeof DataTransfer&&null!==DataTransfer?DataTransfer.prototype:void 0)&&(null!=(o=Object.getOwnPropertyDescriptor)&&null!=(s=o.call(Object,DataTransfer.prototype,"items"))?s.get:void 0)?this.mountContenteditable(i):(r=new t(a().insertBefore(i),i),n=!1,e(i).on("keyup",function(e){var t;return 17!==(t=e.keyCode)&&224!==t||(n=!1),null}),e(i).on("keydown",function(t){var a;return 17!==(a=t.keyCode)&&224!==a||(n=!0),null!=t.ctrlKey&&null!=t.metaKey&&(n=t.ctrlKey||t.metaKey),n&&86===t.keyCode&&(r._textarea_focus_stolen=!0,r._container.focus(),r._paste_event_fired=!1,setTimeout(function(t){return function(){if(!r._paste_event_fired)return e(i).focus(),r._textarea_focus_stolen=!1}}(),1)),null}),e(i).on("paste",function(e){return function(){}}()),e(i).on("focus",function(t){return function(){if(!r._textarea_focus_stolen)return e(i).addClass("pastable-focus")}}()),e(i).on("blur",function(t){return function(){if(!r._textarea_focus_stolen)return e(i).removeClass("pastable-focus")}}()),e(r._target).on("_pasteCheckContainerDone",function(t){return function(){return e(i).focus(),r._textarea_focus_stolen=!1}}()),e(r._target).on("pasteText",function(t){return function(t,a){var n,r,o;return o=e(i).prop("selectionStart"),r=e(i).prop("selectionEnd"),n=e(i).val(),e(i).val(""+n.slice(0,o)+a.text+n.slice(r)),e(i)[0].setSelectionRange(o+a.text.length,o+a.text.length),e(i).trigger("change")}}()))},t.mountContenteditable=function(a){return new t(a,a),e(a).on("focus",function(t){return function(){return e(a).addClass("pastable-focus")}}()),e(a).on("blur",function(t){return function(){return e(a).removeClass("pastable-focus")}}())},t.prototype._handleImage=function(e){var t;return e.match(/^webkit\-fake\-url\:\/\//)?this._target.trigger("pasteImageError",{message:"You are trying to paste an image in Safari, however we are unable to retieve its data."}):(this._target.trigger("pasteImageStart"),t=new Image,t.crossOrigin="anonymous",t.onload=function(e){return function(){var a,n,r,o;n=document.createElement("canvas"),n.width=t.width,n.height=t.height,r=n.getContext("2d"),r.drawImage(t,0,0,n.width,n.height),o=null;try{o=n.toDataURL("image/png"),a=i(o)}catch(e){}return o&&e._target.trigger("pasteImage",{blob:a,dataURL:o,width:t.width,height:t.height}),e._target.trigger("pasteImageEnd")}}(this),t.onerror=function(t){return function(){return t._target.trigger("pasteImageError",{message:"Failed to get image from: "+e,url:e}),t._target.trigger("pasteImageEnd")}}(this),t.src=e)},t.prototype._checkImagesInContainer=function(t){var a,i,n,r,o;for(o=Math.floor(1e3*Math.random()),r=this._container.find("img"),i=0,n=r.length;i<n;i++)a=r[i],a["_paste_marked_"+o]=!0;return setTimeout(function(i){return function(){var n,r,s;for(s=i._container.find("img"),n=0,r=s.length;n<r;n++)a=s[n],a["_paste_marked_"+o]||(t(a.src),e(a).remove());return i._target.trigger("_pasteCheckContainerDone")}}(this),1)},t}()}).call(this),function(e,t){var a=(navigator.userAgent.indexOf("Chrome"),0);thepaste=t.thepaste=e.extend({supports:{paste:"paste"in document||"onpaste"in document||"object"==typeof window.onpaste||"onpaste"in document.createElement("DIV")},view:{},insertImage:function(e,t,i){var n="__thepaste_img_"+a++,r='<img id="'+n+'" class="alignnone size-full" src="'+e+'" />';return i.insertContent(r),i.$("#"+n)[0]},uploadImage:function(t,i){var n,r,s,l=t.src,p=function(n){var p="__thepaste_box_"+a++,d=n.match(/^data\:([^\;]+)\;/)[1];file=new o.Blob(null,{data:n}),suffix=thepaste.options.mime_types.convert[d],"undefined"==typeof suffix&&console.trace("bad type: "+d),e(t).wrap('<div id="'+p+'" data-progress="0" class="thepaste-image-placeholder" contenteditable="false"></div>'),s=i.$("#"+p),file.name=thepaste.l10n.pasted+"."+suffix,file.type=d;var u=function(){r.uploader.uploader.uploader.addFile(file)};r?(r.state().reset(),u()):(r=wp.media.editor.open(window.wpActiveEditor,{frame:"post",state:"insert",title:thepaste.l10n.copy_paste,multiple:!1}),r.close(),r.uploader.uploader&&r.uploader.uploader.ready?u():r.on("uploader:ready",u)),r.uploader.uploader.uploader.bind("UploadProgress",function(e){s.attr("data-progress",e.total.percent)}),r.uploader.uploader.uploader.bind("FileUploaded",function(t,a){var n='<img class="alignnone wp-image-'+a.attachment.id+' size-full" src="'+a.attachment.changed.url+'" />';s.replaceWith(n),i.$('img[src="'+l+'"]').each(function(){e(this).replaceWith(n)})}),r.uploader.uploader.uploader.bind("Error",function(e,t){console.log(e,t)})};"blob:"===l.substr(0,5)?(n=new XMLHttpRequest,n.responseType="blob",n.onreadystatechange=function(){var e;4==n.readyState&&(e=new FileReader,e.onload=function(){p(e.result)},e.readAsDataURL(new Blob([n.response],{type:"image/png"})))},n.open("GET",l),n.send(null)):"data:"===l.substr(0,5)&&p(l)},clipboardHasImage:function(t){var a=!1;return t.items?(e.each(t.items,function(e,t){if(t.type in thepaste.options.mime_types.paste)return a=!0,!1}),a):t.types?(e.each(thepaste.options.mime_types.paste,function(e,i){if(t.types.indexOf(e)>-1)return a=!0,!1}),a):null}},thepaste)}(jQuery,wp.media),function(e,t){var a=wp.media.thepaste.l10n;e.extend(wp.Uploader.prototype,{success:function(e){}}),_.extend(wp.media.view.MediaFrame.Select.prototype,{_parentInitialize:wp.media.view.MediaFrame.Select.prototype.initialize,initialize:function(){this._parentInitialize.apply(this,arguments),this.bindPasteHandlers()},_parentBrowseRouter:wp.media.view.MediaFrame.Select.prototype.browseRouter,browseRouter:function(e){this._parentBrowseRouter.apply(this,arguments),wp.media.thepaste.supports.paste&&e.set({pasteboard:{text:a.copy_paste,priority:35}})},bindPasteHandlers:function(){var e=!1;this.on("content:render close",function(t){e&&"function"==typeof e.dismiss&&e.dismiss(),void 0!==t&&(e=t)},this),this.on("content:create:pasteboard",this.contentCreatePasteboard,this),this.on("content:render:pasteboard",this.contentRenderGrabber,this),frame=this},contentCreatePasteboard:function(e){this.state();this.currentPasteView=e.view=new wp.media.thepaste.view.DataSourceImageGrabber({controller:this,grabber:wp.media.thepaste.view.Pasteboard}),this.listenTo(this.currentPasteView.uploader,"action:uploaded:dataimage",this.uploadedDataImage)},contentRenderGrabber:function(e){e.startGrabbing()},uploadedDataImage:function(e){this.stopListening(this.currentPasteView.uploader,"action:uploaded:dataimage");var t={view:null};this.browseContent(t),this.content.set(t.view),this.router.get().select("browse")}}),_.extend(wp.media.view.AttachmentsBrowser.prototype,{_parentInitialize:wp.media.view.AttachmentsBrowser.prototype.initialize,initialize:function(){var e,t=this;this._parentInitialize.apply(this,arguments),this.thepaste={paste:{grabber:!1,modal:!1,mode:"paste"},current:!1},this.controller instanceof wp.media.view.MediaFrame.Select||wp.media.thepaste.supports.paste&&(e=new wp.media.view.Button({text:a.copy_paste,className:"grabber-button",priority:-64,click:function(){t.thepaste.active=t.thepaste.paste,t.thepasteOpen(a.copy_paste)}}),this.thepaste.paste.grabber=new wp.media.thepaste.view.DataSourceImageGrabber({controller:this.controller,grabber:wp.media.thepaste.view.Pasteboard,wpuploader:this.controller.uploader.uploader.uploader}),this.toolbar.set("pasteModeButton",e.render()))},thepasteUploaded:function(e){this.thepaste.active.grabber.dismiss(),this.thepaste.modal.close(),this.thepasteClose()},thepasteError:function(e){console.log("error",e)},thepasteOpen:function(e){var t=this;this.thepaste.modal=new wp.media.view.Modal({controller:this,title:e}),this.thepaste.modal.content(this.thepaste.active.grabber),this.thepaste.modal.open(),this.thepaste.modal.on("close",function(){t.thepasteClose.apply(t),t.thepaste.active.grabber.stopGrabbing()}),this.thepaste.active.grabber.startGrabbing(),this.listenTo(this.thepaste.active.grabber.uploader,"action:uploaded:dataimage",this.thepasteUploaded),this.listenTo(this.thepaste.active.grabber.uploader,"error:uploaded:dataimage",this.thepasteError)},thepasteClose:function(){this.controller.deactivateMode(this.thepaste.active.mode).activateMode("edit"),this.stopListening(this.thepaste.active.grabber.uploader,"action:uploaded:dataimage"),this.stopListening(this.thepaste.active.grabber.uploader,"error:uploaded:dataimage")}})}(jQuery,window),function(e,t,a){var i=wp.media.thepaste,n=(wp.media.view.Button,wp.media.view.Modal,i.l10n);wp.media.thepaste.view.DataSourceImageUploader=wp.media.View.extend({template:wp.template("thepaste-uploader"),className:"thepaste-uploader",controller:null,image:null,$discardBtn:null,$uploadBtn:null,uploader:null,events:{'click [data-action="upload"]':"uploadImage",'click [data-action="discard"]':"discardImage"},initialize:function(){wp.media.View.prototype.initialize.apply(this,arguments),_.defaults(this.options,{defaultFileName:n.image});new wp.media.View({tagName:"div",className:"instruments",controller:this.controller});this.uploader=this.options.uploder},setImageData:function(e){var t=this.$imageContainer.html("").get(0),n=this,r=e.match(/data:(image\/(\w+));/)[1];return i.options.mime_types.convert[r]||(r=this.options.defaultFileFormat),this.image&&this.image.destroy(),this.image=new a.Image,this.image.onload=function(){var e=n.getUploader().getOption("resize"),a=Math.max(e.width/this.width,e.height/this.height);!!e&&a<1&&this.downsize(this.width*a,this.height*a),this.embed(t)},this.image.load(e),this.$imageContainer&&this.$imageContainer.append(this.image),this.$('[data-setting="format"] input[value="'+r+'"]').prop("checked",!0),this.disabled(!1),this},render:function(){return wp.media.View.prototype.render.apply(this,arguments),this.$imageContainer=this.$(".image-container"),this.$discardBtn=this.$('[data-action="discard"]'),this.$uploadBtn=this.$('[data-action="upload"]'),this.$('[data-setting="title"]').val(this.options.defaultFileName),this},discardImage:function(){this.trigger("action:discard:dataimage",this),this.unbindUploaderEvents()},uploadImage:function(){var e=this.$('[data-setting="format"] :checked').val(),t=i.options.mime_types.convert[e],a=this.$('input[data-setting="title"]').val()+"."+t,n=this.image.getAsBlob(e,i.options.jpeg_quality);this.bindUploaderEvents(),n.detach(n.getSource()),n.name=a,n.type=e,this.getUploader().addFile(n,a),this.disabled(!0),this.trigger("action:upload:dataimage",this)},show:function(){return this.$el.show(),this},hide:function(){return this.$el.hide(),this},disabled:function(e){this.$discardBtn.prop("disabled",e),this.$uploadBtn.prop("disabled",e)},_uploadSuccessHandler:function(){this.trigger("action:uploaded:dataimage"),this.disabled(!1),this.unbindUploaderEvents()},_uploadErrorHandler:function(){this.trigger("error:uploaded:dataimage"),this.disabled(!1),this.unbindUploaderEvents()},bindUploaderEvents:function(){this.getUploader().bind("FileUploaded",this._uploadSuccessHandler,this),this.getUploader().bind("Error",this._uploadErrorHandler,this)},unbindUploaderEvents:function(){this.getUploader().unbind("FileUploaded",this._uploadSuccessHandler,this),this.getUploader().unbind("Error",this._uploadErrorHandler,this)},getUploader:function(){return this.controller.uploader.uploader.uploader}}),wp.media.thepaste.view.Pasteboard=wp.media.View.extend({template:wp.template("thepaste-pasteboard"),className:"thepaste-pasteboard",controller:null,action:"paste",$pasteboard:null,render:function(){var e=this;return wp.media.View.prototype.render.apply(this,arguments),this.$pasteboard=this.$(".injector").pastableContenteditable(),this.$message=this.$(".message"),this.$pasteboard.on("click",function(){e.show_message("")}),this},start:function(){var t,a=this;return this.imagePasted=!1,this.$pasteboard.on("paste",function(e){t=wp.media.thepaste.clipboardHasImage(e.originalEvent.clipboardData)}).on("pasteText",function(i,r){t||a.imagePasted||(a.show_message(n.paste_error_no_image),e(this).html(""))}).on("pasteImage",function(e,t){a.imagePasted||(a.trigger("action:create:dataimage",this,t.dataURL),a.imagePasted=!0)}).on("pasteImageError",function(t,i){a.show_message(n.paste_error),e(this).html("")}),setTimeout(function(){a.$pasteboard.get(0).focus()},1),this},stop:function(){return this.$pasteboard.off("pasteImage").off("pasteImageError").off("pasteText"),this},show:function(){return this.$el.show(),this},hide:function(){return this.$el.hide(),this},show_message:function(e){this.$message.text(e)}}),wp.media.thepaste.view.DataSourceImageGrabber=wp.media.View.extend({template:wp.template("thepaste-grabber"),className:"thepaste-grabber",grabber:null,uploader:null,initialize:function(){var e=wp.media.View.prototype.initialize.apply(this,arguments);return _.defaults(this.options,{wpuploader:null,defaultFileName:n.pasted,defaultFileFormat:"image/png",title:n.copy_paste}),this.grabber=new this.options.grabber({controller:this.controller}),this.uploader=new wp.media.thepaste.view.DataSourceImageUploader({controller:this.controller,uploder:this.options.wpuploader,defaultFileName:this.options.defaultFileName,defaultFileFormat:this.options.defaultFileFormat}),this.render(),this.listenTo(this.grabber,"action:create:dataimage",this.imageCreated),this.listenTo(this.uploader,"action:discard:dataimage",this.startGrabbing),e},render:function(){return wp.media.View.prototype.render.apply(this,arguments),this.$(".content").append(this.grabber.render().$el).append(this.uploader.render().$el),this},imageCreated:function(e,t){this.grabber.stop().hide(),this.uploader.show().setImageData(t)},startGrabbing:function(){return this.uploader.hide(),this.grabber.show().start(),this},stopGrabbing:function(){return this.grabber.stop(),this},getAction:function(){return this.grabber.action},dismiss:function(){return this.grabber.stop(),this}})}(jQuery,window,mOxie); 
    2 //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRoZS1wYXN0ZS5qcyJdLCJuYW1lcyI6WyIkIiwiUGFzdGUiLCJjcmVhdGVIaWRkZW5FZGl0YWJsZSIsImRhdGFVUkx0b0Jsb2IiLCJpc0ZvY3VzYWJsZSIsIndpbmRvdyIsImpRdWVyeSIsInBhc3RlIiwicGFzdGVDb250YWluZXIiLCJwbSIsImNvbnNvbGUiLCJsb2ciLCJtb3VudE5vbklucHV0YWJsZSIsIl9jb250YWluZXIiLCJmbiIsInBhc3RhYmxlTm9uSW5wdXRhYmxlIiwiZWwiLCJqIiwibGVuIiwicmVmIiwidGhpcyIsImxlbmd0aCIsIl9wYXN0YWJsZSIsImlzIiwicGFzdGFibGVUZXh0YXJlYSIsIm1vdW50VGV4dGFyZWEiLCJwYXN0YWJsZUNvbnRlbnRlZGl0YWJsZSIsIm1vdW50Q29udGVudGVkaXRhYmxlIiwiZGF0YVVSTCIsInNsaWNlU2l6ZSIsImI2NERhdGEiLCJieXRlQXJyYXkiLCJieXRlQXJyYXlzIiwiYnl0ZUNoYXJhY3RlcnMiLCJieXRlTnVtYmVycyIsImNvbnRlbnRUeXBlIiwiaSIsIm0iLCJvZmZzZXQiLCJzbGljZSIsIm1hdGNoIiwiYXRvYiIsIkFycmF5IiwiY2hhckNvZGVBdCIsIlVpbnQ4QXJyYXkiLCJwdXNoIiwiQmxvYiIsInR5cGUiLCJkb2N1bWVudCIsImNyZWF0ZUVsZW1lbnQiLCJhdHRyIiwiY3NzIiwid2lkdGgiLCJoZWlnaHQiLCJwb3NpdGlvbiIsImxlZnQiLCJvdmVyZmxvdyIsImVsZW1lbnQiLCJoYXNUYWJpbmRleCIsImZpZW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JvdG90eXBlLl9jb250YWluZXIgPSBudWxsO1xuXG4gICAgUGFzdGUubW91bnROb25JbnB1dGFibGUgPSBmdW5jdGlvbihub25JbnB1dGFibGUpIHtcbiAgICAgIHZhciBwYXN0ZTtcbiAgICAgIHBhc3RlID0gbmV3IFBhc3RlKGNyZWF0ZUhpZGRlbkVkaXRhYmxlKCkuYXBwZW5kVG8obm9uSW5wdXRhYmxlKSwgbm9uSW5wdXRhYmxlKTtcbiAgICAgICQobm9uSW5wdXRhYmxlKS5vbignY2xpY2snLCAoZnVuY3Rpb24oX3RoaXMpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKGV2KSB7XG4gICAgICAgICAgaWYgKCFpc0ZvY3VzYWJsZShldi50YXJnZXQsIGZhbHNlKSkge1xuICAgICAgICAgICAgcmV0dXJuIHBhc3RlLl9jb250YWluZXIuZm9jdXMoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9KSh0aGlzKSk7XG4gICAgICBwYXN0ZS5fY29udGFpbmVyLm9uKCdmb2N1cycsIChmdW5jdGlvbihfdGhpcykge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuICQobm9uSW5wdXRhYmxlKS5hZGRDbGFzcygncGFzdGFibGUtZm9jdXMnKTtcbiAgICAgICAgfTtcbiAgICAgIH0pKHRoaXMpKTtcbiAgICAgIHJldHVybiBwYXN0ZS5fY29udGFpbmVyLm9uKCdibHVyJywgKGZ1bmN0aW9uKF90aGlzKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gJChub25JbnB1dGFibGUpLnJlbW92ZUNsYXNzKCdwYXN0YWJsZS1mb2N1cycpO1xuICAgICAgICB9O1xuICAgICAgfSkodGhpcykpO1xuICAgIH07XG5cbiAgICBQYXN0ZS5tb3VudFRleHRhcmVhID0gZnVuY3Rpb24odGV4dGFyZWEpIHtcbiAgICAgIHZhciBjdG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jdHJsS2V5ICE9IG51bGwpICYmIChldi5tZXRhS2V5ICE9IG51bGwpKSB7XG4gICAgICAgICAgY3RsRG93biA9IGV2LmN0cmxLZXkgfHwgZXYubWV0YUtleTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY3RsRG93biAmJiBldi5rZXlDb2RlID09PSA4Nikge1xuICAgICAgICAgIHBhc3RlLl90ZXh0YXJlYV9mb2N1c19zdG9sZW4gPSB0cnVlO1xuICAgICAgICAgIHBhc3RlLl9jb250YWluZXIuZm9jdXMoKTtcbiAgICAgICAgICBwYXN0ZS5fcGFzdGVfZXZlbnRfZmlyZWQgPSBmYWxzZTtcbiAgICAgICAgICBzZXRUaW1lb3V0KChmdW5jdGlvbihfdGhpcykge1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAoIXBhc3RlLl9wYXN0ZV9ldmVudF9maXJlZCkge1xuICAgICAgICAgICAgICAgICQodGV4dGFyZWEpLmZvY3VzKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhc3RlLl90ZXh0YXJlYV9mb2N1c19zdG9sZW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KSh0aGlzKSwgMSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICB9KTtcbiAgICAgICQodGV4dGFyZWEpLm9uKCdwYXN0ZScsIChmdW5jdGlvbihfdGhpcykge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7fTtcbiAgICAgIH0pKHRoaXMpKTtcbiAgICAgICQodGV4dGFyZWEpLm9uKCdmb2N1cycsIChmdW5jdGlvbihfdGhpcykge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgaWYgKCFwYXN0ZS5fdGV4dGFyZWFfZm9jdXNfc3RvbGVuKSB7XG4gICAgICAgICAgICByZXR1cm4gJCh0ZXh0Y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GFyZWEpLnZhbChcIlwiICsgY29udGVudC5zbGljZSgwLCBjdXJTdGFydCkgKyBkYXRhLnRleHQgKyBjb250ZW50LnNsaWNlKGN1ckVuZCkpO1xuICAgICAgICAgICQodGV4dGFyZWEpWzBdLnNldFNlbGVjdGlvblJhbmdlKGN1clN0YXJ0ICsgZGF0YS50ZXh0Lmxlbmd0aCwgY3VyU3RhcnQgKyBkYXRhLnRleHQubGVuZ3RoKTtcbiAgICAgICAgICByZXR1cm4gJCh0ZXh0YXJlYSkudHJpZ2dlcignY2hhbmdlJyk7XG4gICAgICAgIH07XG4gICAgICB9KSh0aGlzKSk7XG4gICAgfTtcblxuICAgIFBhc3RlLm1vdW50Q29udGVudGVkaXRhYmxlID0gZnVuY3Rpb24oY29udGVudGVkaXRhYmxlKSB7XG4gICAgICB2YXIgcGFzdGU7XG4gICAgICBwYXN0ZSA9IG5ldyBQYXN0ZShjb250ZW50ZWRpdGFibGUsIGNvbnRlbnRlZGl0YWJsZSk7XG4gICAgICAkKGNvbnRlbnRlZGl0YWJsZSkub24oJ2ZvY3VzJywgKGZ1bmN0aW9uKF90aGlzKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gJChjb250ZW50ZWRpdGFibGUpLmFkZENsYXNzKCdwYXN0YWJsZS1mb2N1cycpO1xuICAgICAgICB9O1xuICAgICAgfSkodGhpcykpO1xuICAgICAgcmV0dXJuICQoY29udGVudGVkaXRhYmxlKS5vbignYmx1cicsIChmdW5jdGlvbihfdGhpcykge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuICQoY29udGVudGVkaXRhYmxlKS5yZW1vdmVDbGFzcygncGFzdGFibGUtZm9jdXMnKTtcbiAgICAgICAgfTtcbiAgICAgIH0pKHRoaXMpKTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gUGFzdGUoX2NvbnRhaW5lciwgX3RhcmdldCkge1xuICAgICAg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ICAgaWYgKGl0ZW0udHlwZS5tYXRjaCgvXmltYWdlXFwvLykpIHtcbiAgICAgICAgICAgICAgICAgIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKCk7XG4gICAgICAgICAgICAgICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl9oYW5kbGVJbWFnZShldmVudC50YXJnZXQucmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICByZWFkZXIucmVhZEFzRGF0YVVSTChpdGVtLmdldEFzRmlsZSgpKTtcbiAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7fVxuICAgICAgICAgICAgICAgICAgZXYucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXRlbS50eXBlID09PSAndGV4dC9wbGFpbicpIHtcbiAgICAgICAgICAgICAgICAgIGl0ZW0uZ2V0QXNTdHJpbmcoZnVuY3Rpb24oc3RyaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ3Bhc3RlVGV4dCcsIHtcbiAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiBzdHJpbmdcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmICgtMSAhPT0gQXJyYXkucHJvdG90eXBlLmluZGV4T2YuY2FsbChjbGlwYm9hcmREYXRhLnR5cGVzLCAndGV4dC9wbGFpbicpKSB7XG4gICAgICAgICAgICAgICAgdGV4dCA9IGNsaXBib2FyZERhdGEuZ2V0RGF0YSgnVGV4dCcpO1xuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX3RhcmdldC50cmlnZ2VyKCdwYXN0ZVRleHQnLCB7XG4gICAgICAgICAgICAgICAgICAgIHRleHQ6IHRleHRcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0sIDEpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIF90aGlzLl9jaGVja0ltYWdlc0luQ29udGFpbmVyKGZ1bmN0aW9uKHNyYykge1xuICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5faGFuZGxlSW1hZ2Uoc3JjKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChjbGlwYm9hcmREYXRhID0gd2luZG93LmNsaXBib2FyZERhdGEpIHtcbiAgICAgICAgICAgIGlmICgocmVmMiA9ICh0ZXh0ID0gY2xpcGJvYXJkRGF0YS5nZXREYXRhKCdUZXh0JykpKSAhPSBudWxsID8gcmVmMi5sZW5ndGggOiB2b2lkIDApIHtcbiAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ3Bhc3RlVGV4dCcsIHtcbiAgICAgICAgICAgICAgICAgIHRleHQ6IHRleHRcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX3RhcmdldC50cmlnZ2VyKCdfcGFzdGVDaGVja0NvbnRhaW5lckRvbmUnKTtcbiAgICAgICAgICAgICAgfSwgMSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZWYzID0gY2xpcGJvYXJkRGF0YS5maWxlcztcbiAgICAgICAgICAgICAgZm9yIChrID0gMCwgbGVuM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udmFzLCBjdHgsIGRhdGFVUkw7XG4gICAgICAgICAgY2FudmFzID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgICAgY2FudmFzLndpZHRoID0gbG9hZGVyLndpZHRoO1xuICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSBsb2FkZXIuaGVpZ2h0O1xuICAgICAgICAgIGN0eCA9IGNhbnZhcy5nZXRDb250ZXh0KCcyZCcpO1xuICAgICAgICAgIGN0eC5kcmF3SW1hZ2UobG9hZGVyLCAwLCAwLCBjYW52YXMud2lkdGgsIGNhbnZhcy5oZWlnaHQpO1xuICAgICAgICAgIGRhdGFVUkwgPSBudWxsO1xuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICBkYXRhVVJMID0gY2FudmFzLnRvRGF0YVVSTCgnaW1hZ2UvcG5nJyk7XG4gICAgICAgICAgICBibG9iID0gZGF0YVVSTHRvQmxvYihkYXRhVVJMKTtcbiAgICAgICAgICB9IGNhdGNoIChlcnJvcikge31cbiAgICAgICAgICBpZiAoZGF0YVVSTCkge1xuICAgICAgICAgICAgX3RoaXMuX3RhcmdldC50cmlnZ2VyKCdwYXN0ZUltYWdlJywge1xuICAgICAgICAgICAgICBibG9iOiBibG9iLFxuICAgICAgICAgICAgICBkYXRhVVJMOiBkYXRhVVJMLFxuICAgICAgICAgICAgICB3aWR0aDogbG9hZGVyLndpZHRoLFxuICAgICAgICAgICAgICBoZWlnaHQ6IGxvYWRlci5oZWlnaHRcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gX3RoaXMuX3RhcmdldC50cmlnZ2VyKCdwYXN0ZUltYWdlRW5kJyk7XG4gICAgICAgIH07XG4gICAgICB9KSh0aGlzKTtcbiAgICAgIGxvYWRlci5vbmVycm9yID0gKGZ1bmN0aW9uKF90aGlzKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBfdGhpcy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0LmFwcGVuZCggdGhpcy51cGxvYWRlci5yZW5kZXIoKS4kZWwgKTtcblxuXHRcdFx0cmV0dXJuIHRoaXM7XG5cdFx0fSxcblx0XHRpbWFnZUNyZWF0ZWQgOiBmdW5jdGlvbiggZ3JhYmJlciAsIGltYWdlRGF0YSApIHtcblx0XHRcdHRoaXMuZ3JhYmJlci5zdG9wKCkuaGlkZSgpO1xuXHRcdFx0dGhpcy51cGxvYWRlci5zaG93KCkuc2V0SW1hZ2VEYXRhKCBpbWFnZURhdGEgKTtcblx0XHR9LFxuXHRcdHN0YXJ0R3JhYmJpbmc6ZnVuY3Rpb24oKSB7XG5cdFx0XHR0aGlzLnVwbG9hZGVyLmhpZGUoKTtcblx0XHRcdHRoaXMuZ3JhYmJlci5zaG93KCkuc3RhcnQoKTtcblx0XHRcdHJldHVybiB0aGlzO1xuXHRcdH0sXG5cdFx0c3RvcEdyYWJiaW5nOmZ1bmN0aW9uKCkge1xuXHRcdFx0dGhpcy5ncmFiYmVyLnN0b3AoKTtcblx0XHRcdHJldHVybiB0aGlzO1xuXHRcdH0sXG5cdFx0Z2V0QWN0aW9uIDogZnVuY3Rpb24oKSB7XG5cdFx0XHRyZXR1cm4gdGhpcy5ncmFiYmVyLmFjdGlvbjtcblx0XHR9LFxuXHRcdGRpc21pc3M6ZnVuY3Rpb24oKSB7XG5cdFx0XHR0aGlzLmdyYWJiZXIuc3RvcCgpO1xuXHRcdFx0cmV0dXJuIHRoaXM7XG5cdFx0fVxuXHR9KTtcblxufSkoalF1ZXJ5LHdpbmRvdyxtT3hpZSk7XG4iXX0= 
     1(function(){var e,t,a,i,n;e=window.jQuery,e.paste=function(e){var a;return"undefined"!=typeof console&&null!==console&&console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead."),a=t.mountNonInputable(e),a._container},e.fn.pastableNonInputable=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is("textarea, input:text, [contenteditable]")||(t.mountNonInputable(a),a._pastable=!0);return this},e.fn.pastableTextarea=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is(":not(textarea, input:text)")||(t.mountTextarea(a),a._pastable=!0);return this},e.fn.pastableContenteditable=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is(":not([contenteditable])")||(t.mountContenteditable(a),a._pastable=!0);return this},i=function(e,t){var a,i,n,r,o,s,l,p,d,u,h;if(null==t&&(t=512),!(p=e.match(/^data\:([^\;]+)\;base64\,(.+)$/)))return null;for(u=p,p=u[0],s=u[1],a=u[2],r=atob(a),n=[],d=0;d<r.length;){for(h=r.slice(d,d+t),o=new Array(h.length),l=0;l<h.length;)o[l]=h.charCodeAt(l),l++;i=new Uint8Array(o),n.push(i),d+=t}return new Blob(n,{type:s})},a=function(){return e(document.createElement("div")).attr("contenteditable",!0).attr("aria-hidden",!0).attr("tabindex",-1).css({width:1,height:1,position:"fixed",left:-100,overflow:"hidden"})},n=function(t,a){var i,n,r,o,s,l;return o=void 0,s=void 0,r=void 0,n=void 0,i=void 0,"area"===(l=t.nodeName.toLowerCase())?(o=t.parentNode,s=o.name,!(!t.href||!s||"map"!==o.nodeName.toLowerCase())&&(r=e("img[usemap='#"+s+"']"),r.length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(l)?(n=!t.disabled)&&(i=e(t).closest("fieldset")[0])&&(n=!i.disabled):n="a"===l?t.href||a:a,(n=n||e(t).is("[contenteditable]"))&&e(t).is(":visible"))},t=function(){function t(t,a){this._container=t,this._target=a,this._container=e(this._container),this._target=e(this._target).addClass("pastable"),this._container.on("paste",function(e){return function(t){var a,i,n,r,o,s,l,p,d,u,h,c,g;if(t.currentTarget!==t.target)return t.preventDefault();if(e._paste_event_fired=!0,null!=(null!=(d=t.originalEvent)?d.clipboardData:void 0))if(a=t.originalEvent.clipboardData,a.items)for(u=a.items,r=0,s=u.length;r<s;r++){if(n=u[r],n.type.match(/^image\//)){p=new FileReader,p.onload=function(t){return e._handleImage(t.target.result)};try{p.readAsDataURL(n.getAsFile())}catch(e){}t.preventDefault();break}"text/plain"===n.type&&n.getAsString(function(t){return e._target.trigger("pasteText",{text:t})})}else-1!==Array.prototype.indexOf.call(a.types,"text/plain")&&(g=a.getData("Text"),setTimeout(function(){return e._target.trigger("pasteText",{text:g})},1)),e._checkImagesInContainer(function(t){return e._handleImage(t)});if(a=window.clipboardData)if(null!=(h=g=a.getData("Text"))?h.length:void 0)setTimeout(function(){return e._target.trigger("pasteText",{text:g}),e._target.trigger("_pasteCheckContainerDone")},1);else{for(c=a.files,o=0,l=c.length;o<l;o++)i=c[o],e._handleImage(URL.createObjectURL(i));e._checkImagesInContainer(function(e){})}return null}}(this))}return t.prototype._target=null,t.prototype._container=null,t.mountNonInputable=function(i){var r;return r=new t(a().appendTo(i),i),e(i).on("click",function(e){return function(e){if(!n(e.target,!1))return r._container.focus()}}()),r._container.on("focus",function(t){return function(){return e(i).addClass("pastable-focus")}}()),r._container.on("blur",function(t){return function(){return e(i).removeClass("pastable-focus")}}())},t.mountTextarea=function(i){var n,r,o,s;return("undefined"!=typeof DataTransfer&&null!==DataTransfer?DataTransfer.prototype:void 0)&&(null!=(o=Object.getOwnPropertyDescriptor)&&null!=(s=o.call(Object,DataTransfer.prototype,"items"))?s.get:void 0)?this.mountContenteditable(i):(r=new t(a().insertBefore(i),i),n=!1,e(i).on("keyup",function(e){var t;return 17!==(t=e.keyCode)&&224!==t||(n=!1),null}),e(i).on("keydown",function(t){var a;return 17!==(a=t.keyCode)&&224!==a||(n=!0),null!=t.ctrlKey&&null!=t.metaKey&&(n=t.ctrlKey||t.metaKey),n&&86===t.keyCode&&(r._textarea_focus_stolen=!0,r._container.focus(),r._paste_event_fired=!1,setTimeout(function(t){return function(){if(!r._paste_event_fired)return e(i).focus(),r._textarea_focus_stolen=!1}}(),1)),null}),e(i).on("paste",function(e){return function(){}}()),e(i).on("focus",function(t){return function(){if(!r._textarea_focus_stolen)return e(i).addClass("pastable-focus")}}()),e(i).on("blur",function(t){return function(){if(!r._textarea_focus_stolen)return e(i).removeClass("pastable-focus")}}()),e(r._target).on("_pasteCheckContainerDone",function(t){return function(){return e(i).focus(),r._textarea_focus_stolen=!1}}()),e(r._target).on("pasteText",function(t){return function(t,a){var n,r,o;return o=e(i).prop("selectionStart"),r=e(i).prop("selectionEnd"),n=e(i).val(),e(i).val(""+n.slice(0,o)+a.text+n.slice(r)),e(i)[0].setSelectionRange(o+a.text.length,o+a.text.length),e(i).trigger("change")}}()))},t.mountContenteditable=function(a){return new t(a,a),e(a).on("focus",function(t){return function(){return e(a).addClass("pastable-focus")}}()),e(a).on("blur",function(t){return function(){return e(a).removeClass("pastable-focus")}}())},t.prototype._handleImage=function(e){var t;return e.match(/^webkit\-fake\-url\:\/\//)?this._target.trigger("pasteImageError",{message:"You are trying to paste an image in Safari, however we are unable to retieve its data."}):(this._target.trigger("pasteImageStart"),t=new Image,t.crossOrigin="anonymous",t.onload=function(e){return function(){var a,n,r,o;n=document.createElement("canvas"),n.width=t.width,n.height=t.height,r=n.getContext("2d"),r.drawImage(t,0,0,n.width,n.height),o=null;try{o=n.toDataURL("image/png"),a=i(o)}catch(e){}return o&&e._target.trigger("pasteImage",{blob:a,dataURL:o,width:t.width,height:t.height}),e._target.trigger("pasteImageEnd")}}(this),t.onerror=function(t){return function(){return t._target.trigger("pasteImageError",{message:"Failed to get image from: "+e,url:e}),t._target.trigger("pasteImageEnd")}}(this),t.src=e)},t.prototype._checkImagesInContainer=function(t){var a,i,n,r,o;for(o=Math.floor(1e3*Math.random()),r=this._container.find("img"),i=0,n=r.length;i<n;i++)a=r[i],a["_paste_marked_"+o]=!0;return setTimeout(function(i){return function(){var n,r,s;for(s=i._container.find("img"),n=0,r=s.length;n<r;n++)a=s[n],a["_paste_marked_"+o]||(t(a.src),e(a).remove());return i._target.trigger("_pasteCheckContainerDone")}}(this),1)},t}()}).call(this),function(e,t){var a=(navigator.userAgent.indexOf("Chrome"),0);thepaste=t.thepaste=e.extend({supports:{paste:"paste"in document||"onpaste"in document||"object"==typeof window.onpaste||"onpaste"in document.createElement("DIV")},view:{},uploadImage:function(t,i,n){var r="__thepaste_box_"+a++,s=e(t).wrap('<div id="'+r+'" data-progress="0" class="thepaste-image-placeholder" contenteditable="false"></div>').parent();t.onload=function(){e(i.$("#"+r)).width(this.naturalWidth),e(i.$("#"+r)).height(this.naturalHeight)};var l,p,d=t.src,u=function(t){var a=t.match(/^data\:([^\;]+)\;/)[1];file=new o.Blob(null,{data:t}),suffix=thepaste.options.mime_types.convert[a],"undefined"==typeof suffix&&console.trace("Won't upload, bad mime type: "+a),file.name=thepaste.l10n.pasted+"."+suffix,file.type=a;var n=function(){p.uploader.uploader.uploader.addFile(file)};p?(p.state().reset(),n()):(p=wp.media.editor.open(window.wpActiveEditor,{frame:"post",state:"insert",title:thepaste.l10n.copy_paste,multiple:!1}),p.close(),p.uploader.uploader&&p.uploader.uploader.ready?n():p.on("uploader:ready",n)),p.uploader.uploader.uploader.bind("UploadProgress",function(e){i.$("#"+r).attr("data-progress",e.total.percent)}),p.uploader.uploader.uploader.bind("FileUploaded",function(t,a){var n=i.$("#"+r),o='<img class="alignnone wp-image-'+a.attachment.id+' size-full" src="'+a.attachment.changed.url+'" />';n.replaceWith(o),i.$('img[src="'+d+'"]').each(function(){e(this).replaceWith(o)})}),p.uploader.uploader.uploader.bind("Error",function(e,t){console.log(e,t)})};return"blob:"===d.substr(0,5)?(l=new XMLHttpRequest,l.responseType="blob",l.onreadystatechange=function(){var e;4==l.readyState&&(e=new FileReader,e.onload=function(){u(e.result)},e.readAsDataURL(new Blob([l.response],{type:"image/png"})))},l.open("GET",d),l.send(null)):"data:"===d.substr(0,5)&&u(d),s},clipboardHasImage:function(t){var a=!1;return t.items?(e.each(t.items,function(e,t){if(t.type in thepaste.options.mime_types.paste)return a=!0,!1}),a):t.types?(e.each(thepaste.options.mime_types.paste,function(e,i){if(t.types.indexOf(e)>-1)return a=!0,!1}),a):null}},thepaste)}(jQuery,wp.media),function(e,t){var a=wp.media.thepaste.l10n;e.extend(wp.Uploader.prototype,{success:function(e){}}),_.extend(wp.media.view.MediaFrame.Select.prototype,{_parentInitialize:wp.media.view.MediaFrame.Select.prototype.initialize,initialize:function(){this._parentInitialize.apply(this,arguments),this.bindPasteHandlers()},_parentBrowseRouter:wp.media.view.MediaFrame.Select.prototype.browseRouter,browseRouter:function(e){this._parentBrowseRouter.apply(this,arguments),wp.media.thepaste.supports.paste&&e.set({pasteboard:{text:a.copy_paste,priority:35}})},bindPasteHandlers:function(){var e=!1;this.on("content:render close",function(t){e&&"function"==typeof e.dismiss&&e.dismiss(),void 0!==t&&(e=t)},this),this.on("content:create:pasteboard",this.contentCreatePasteboard,this),this.on("content:render:pasteboard",this.contentRenderGrabber,this),frame=this},contentCreatePasteboard:function(e){this.state();this.currentPasteView=e.view=new wp.media.thepaste.view.DataSourceImageGrabber({controller:this,grabber:wp.media.thepaste.view.Pasteboard}),this.listenTo(this.currentPasteView.uploader,"action:uploaded:dataimage",this.uploadedDataImage)},contentRenderGrabber:function(e){e.startGrabbing()},uploadedDataImage:function(e){this.stopListening(this.currentPasteView.uploader,"action:uploaded:dataimage");var t={view:null};this.browseContent(t),this.content.set(t.view),this.router.get().select("browse")}}),_.extend(wp.media.view.AttachmentsBrowser.prototype,{_parentInitialize:wp.media.view.AttachmentsBrowser.prototype.initialize,initialize:function(){var e,t=this;this._parentInitialize.apply(this,arguments),this.thepaste={paste:{grabber:!1,modal:!1,mode:"paste"},current:!1},this.controller instanceof wp.media.view.MediaFrame.Select||wp.media.thepaste.supports.paste&&(e=new wp.media.view.Button({text:a.copy_paste,className:"grabber-button",priority:-64,click:function(){t.thepaste.active=t.thepaste.paste,t.thepasteOpen(a.copy_paste)}}),this.thepaste.paste.grabber=new wp.media.thepaste.view.DataSourceImageGrabber({controller:this.controller,grabber:wp.media.thepaste.view.Pasteboard,wpuploader:this.controller.uploader.uploader.uploader}),this.toolbar.set("pasteModeButton",e.render()))},thepasteUploaded:function(e){this.thepaste.active.grabber.dismiss(),this.thepaste.modal.close(),this.thepasteClose()},thepasteError:function(e){console.log("error",e)},thepasteOpen:function(e){var t=this;this.thepaste.modal=new wp.media.view.Modal({controller:this,title:e}),this.thepaste.modal.content(this.thepaste.active.grabber),this.thepaste.modal.open(),this.thepaste.modal.on("close",function(){t.thepasteClose.apply(t),t.thepaste.active.grabber.stopGrabbing()}),this.thepaste.active.grabber.startGrabbing(),this.listenTo(this.thepaste.active.grabber.uploader,"action:uploaded:dataimage",this.thepasteUploaded),this.listenTo(this.thepaste.active.grabber.uploader,"error:uploaded:dataimage",this.thepasteError)},thepasteClose:function(){this.controller.deactivateMode(this.thepaste.active.mode).activateMode("edit"),this.stopListening(this.thepaste.active.grabber.uploader,"action:uploaded:dataimage"),this.stopListening(this.thepaste.active.grabber.uploader,"error:uploaded:dataimage")}})}(jQuery,window),function(e,t,a){var i=wp.media.thepaste,n=(wp.media.view.Button,wp.media.view.Modal,i.l10n);wp.media.thepaste.view.DataSourceImageUploader=wp.media.View.extend({template:wp.template("thepaste-uploader"),className:"thepaste-uploader",controller:null,image:null,$discardBtn:null,$uploadBtn:null,uploader:null,events:{'click [data-action="upload"]':"uploadImage",'click [data-action="discard"]':"discardImage"},initialize:function(){wp.media.View.prototype.initialize.apply(this,arguments),_.defaults(this.options,{defaultFileName:n.image});new wp.media.View({tagName:"div",className:"instruments",controller:this.controller});this.uploader=this.options.uploder},setImageData:function(e){var t=this.$imageContainer.html("").get(0),n=this,r=e.match(/data:(image\/(\w+));/)[1];return i.options.mime_types.convert[r]||(r=this.options.defaultFileFormat),this.image&&this.image.destroy(),this.image=new a.Image,this.image.onload=function(){var e=n.getUploader().getOption("resize"),a=Math.max(e.width/this.width,e.height/this.height);!!e&&a<1&&this.downsize(this.width*a,this.height*a),this.embed(t)},this.image.load(e),this.$imageContainer&&this.$imageContainer.append(this.image),this.$('[data-setting="format"] input[value="'+r+'"]').prop("checked",!0),this.disabled(!1),this},render:function(){return wp.media.View.prototype.render.apply(this,arguments),this.$imageContainer=this.$(".image-container"),this.$discardBtn=this.$('[data-action="discard"]'),this.$uploadBtn=this.$('[data-action="upload"]'),this.$('[data-setting="title"]').val(this.options.defaultFileName),this},discardImage:function(){this.trigger("action:discard:dataimage",this),this.unbindUploaderEvents()},uploadImage:function(){var e=this.$('[data-setting="format"] :checked').val(),t=i.options.mime_types.convert[e],a=this.$('input[data-setting="title"]').val()+"."+t,n=this.image.getAsBlob(e,i.options.jpeg_quality);this.bindUploaderEvents(),n.detach(n.getSource()),n.name=a,n.type=e,this.getUploader().addFile(n,a),this.disabled(!0),this.trigger("action:upload:dataimage",this)},show:function(){return this.$el.show(),this},hide:function(){return this.$el.hide(),this},disabled:function(e){this.$discardBtn.prop("disabled",e),this.$uploadBtn.prop("disabled",e)},_uploadSuccessHandler:function(){this.trigger("action:uploaded:dataimage"),this.disabled(!1),this.unbindUploaderEvents()},_uploadErrorHandler:function(){this.trigger("error:uploaded:dataimage"),this.disabled(!1),this.unbindUploaderEvents()},bindUploaderEvents:function(){this.getUploader().bind("FileUploaded",this._uploadSuccessHandler,this),this.getUploader().bind("Error",this._uploadErrorHandler,this)},unbindUploaderEvents:function(){this.getUploader().unbind("FileUploaded",this._uploadSuccessHandler,this),this.getUploader().unbind("Error",this._uploadErrorHandler,this)},getUploader:function(){return this.controller.uploader.uploader.uploader}}),wp.media.thepaste.view.Pasteboard=wp.media.View.extend({template:wp.template("thepaste-pasteboard"),className:"thepaste-pasteboard",controller:null,action:"paste",$pasteboard:null,render:function(){var e=this;return wp.media.View.prototype.render.apply(this,arguments),this.$pasteboard=this.$(".injector").pastableContenteditable(),this.$message=this.$(".message"),this.$pasteboard.on("click",function(){e.show_message("")}),this},start:function(){var t,a=this;return this.imagePasted=!1,this.$pasteboard.on("paste",function(e){t=wp.media.thepaste.clipboardHasImage(e.originalEvent.clipboardData)}).on("pasteText",function(i,r){t||a.imagePasted||(a.show_message(n.paste_error_no_image),e(this).html(""))}).on("pasteImage",function(e,t){a.imagePasted||(a.trigger("action:create:dataimage",this,t.dataURL),a.imagePasted=!0)}).on("pasteImageError",function(t,i){a.show_message(n.paste_error),e(this).html("")}),setTimeout(function(){a.$pasteboard.get(0).focus()},1),this},stop:function(){return this.$pasteboard.off("pasteImage").off("pasteImageError").off("pasteText"),this},show:function(){return this.$el.show(),this},hide:function(){return this.$el.hide(),this},show_message:function(e){this.$message.text(e)}}),wp.media.thepaste.view.DataSourceImageGrabber=wp.media.View.extend({template:wp.template("thepaste-grabber"),className:"thepaste-grabber",grabber:null,uploader:null,initialize:function(){var e=wp.media.View.prototype.initialize.apply(this,arguments);return _.defaults(this.options,{wpuploader:null,defaultFileName:n.pasted,defaultFileFormat:"image/png",title:n.copy_paste}),this.grabber=new this.options.grabber({controller:this.controller}),this.uploader=new wp.media.thepaste.view.DataSourceImageUploader({controller:this.controller,uploder:this.options.wpuploader,defaultFileName:this.options.defaultFileName,defaultFileFormat:this.options.defaultFileFormat}),this.render(),this.listenTo(this.grabber,"action:create:dataimage",this.imageCreated),this.listenTo(this.uploader,"action:discard:dataimage",this.startGrabbing),e},render:function(){return wp.media.View.prototype.render.apply(this,arguments),this.$(".content").append(this.grabber.render().$el).append(this.uploader.render().$el),this},imageCreated:function(e,t){this.grabber.stop().hide(),this.uploader.show().setImageData(t)},startGrabbing:function(){return this.uploader.hide(),this.grabber.show().start(),this},stopGrabbing:function(){return this.grabber.stop(),this},getAction:function(){return this.grabber.action},dismiss:function(){return this.grabber.stop(),this}})}(jQuery,window,mOxie); 
     2//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRoZS1wYXN0ZS5qcyJdLCJuYW1lcyI6WyIkIiwiUGFzdGUiLCJjcmVhdGVIaWRkZW5FZGl0YWJsZSIsImRhdGFVUkx0b0Jsb2IiLCJpc0ZvY3VzYWJsZSIsIndpbmRvdyIsImp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GFibGUoKS5hcHBlbmRUbyhub25JbnB1dGFibGUpLCBub25JbnB1dGFibGUpO1xuICAgICAgJChub25JbnB1dGFibGUpLm9uKCdjbGljaycsIChmdW5jdGlvbihfdGhpcykge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oZXYpIHtcbiAgICAgICAgICBpZiAoIWlzRm9jdXNhYmxlKGV2LnRhcmdldCwgZmFsc2UpKSB7XG4gICAgICAgICAgICByZXR1cm4gcGFzdGUuX2NvbnRhaW5lci5mb2N1cygpO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH0pKHRoaXMpKTtcbiAgICAgIHBhc3RlLl9jb250YWluZXIub24oJ2ZvY3VzJywgKGZ1bmN0aW9uKF90aGlzKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gJChub25JbnB1dGFibGUpLmFkZENsYXNzKCdwYXN0YWJsZS1mb2N1cycpO1xuICAgICAgICB9O1xuICAgICAgfSkodGhpcykpO1xuICAgICAgcmV0dXJuIHBhc3RlLl9jb250YWluZXIub24oJ2JsdXInLCAoZnVuY3Rpb24oX3RoaXMpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiAkKG5vbklucHV0YWJsZSkucmVtb3ZlQ2xhc3MoJ3Bhc3RhYmxlLWZvY3VzJyk7XG4gICAgICAgIH07XG4gICAgICB9KSh0aGlzKSk7XG4gICAgfTtcblxuICAgIFBhc3RlLm1vdW50VGV4dGFyZWEgPSBmdW5jdGlvbih0ZXh0YXJlYSkge1xuICAgICAgdmFyIGN0bERvd24sIHBhc3RlLCByZWYsIHJlZjE7XG4gICAgICBpZiAoKHR5cGVvZiBEYXRhVHJhbnNmZXIgIT09IFwidW5kZWZpbmVkXCIgJiYgRGF0YVRyYW5zZmVyICE9PSBudWxsID8gRGF0YVRyYW5zZmVyLnByb3RvdHlwZSA6IHZvaWQgMCkgJiYgKChyZWYgP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ICAgICAgcGFzdGUuX3RleHRhcmVhX2ZvY3VzX3N0b2xlbiA9IHRydWU7XG4gICAgICAgICAgcGFzdGUuX2NvbnRhaW5lci5mb2N1cygpO1xuICAgICAgICAgIHBhc3RlLl9wYXN0ZV9ldmVudF9maXJlZCA9IGZhbHNlO1xuICAgICAgICAgIHNldFRpbWVvdXQoKGZ1bmN0aW9uKF90aGlzKSB7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIGlmICghcGFzdGUuX3Bhc3RlX2V2ZW50X2ZpcmVkKSB7XG4gICAgICAgICAgICAgICAgJCh0ZXh0YXJlYSkuZm9jdXMoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFzdGUuX3RleHRhcmVhX2ZvY3VzX3N0b2xlbiA9IGZhbHNlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0pKHRoaXMpLCAxKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgIH0pO1xuICAgICAgJCh0ZXh0YXJlYSkub24oJ3Bhc3RlJywgKGZ1bmN0aW9uKF90aGlzKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHt9O1xuICAgICAgfSkodGhpcykpO1xuICAgICAgJCh0ZXh0YXJlYSkub24oJ2ZvY3VzJywgKGZ1bmN0aW9uKF90aGlzKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBpZiAoIXBhc3RlLl90ZXh0YXJlYV9mb2N1c19zdG9sZW4pIHtcbiAgICAgICAgICAgIHJldHVybiAkKHRleHRhcmVhKS5hZGRDbGFzcygncGFzdGFibGUtZm9jdXMnKTtcbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9KSh0aGlzKSk7XG4gICAgICAkKHRleHRhcmVhKS5vbignYmx1cicsIChmdW5jdGlvbihfdGhpcykge1xuICAgICAgICByZXR1cm4gZnVuY3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lvbihldmVudCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX2hhbmRsZUltYWdlKGV2ZW50LnRhcmdldC5yZXN1bHQpO1xuICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHJlYWRlci5yZWFkQXNEYXRhVVJMKGl0ZW0uZ2V0QXNGaWxlKCkpO1xuICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHt9XG4gICAgICAgICAgICAgICAgICBldi5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpdGVtLnR5cGUgPT09ICd0ZXh0L3BsYWluJykge1xuICAgICAgICAgICAgICAgICAgaXRlbS5nZXRBc1N0cmluZyhmdW5jdGlvbihzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVUZXh0Jywge1xuICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IHN0cmluZ1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKC0xICE9PSBBcnJheS5wcm90b3R5cGUuaW5kZXhPZi5jYWxsKGNsaXBib2FyZERhdGEudHlwZXMsICd0ZXh0L3BsYWluJykpIHtcbiAgICAgICAgICAgICAgICB0ZXh0ID0gY2xpcGJvYXJkRGF0YS5nZXREYXRhKCdUZXh0Jyk7XG4gICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ3Bhc3RlVGV4dCcsIHtcbiAgICAgICAgICAgICAgICAgICAgdGV4dDogdGV4dFxuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSwgMSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgX3RoaXMuX2NoZWNrSW1hZ2VzSW5Db250YWluZXIoZnVuY3Rpb24oc3JjKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl9oYW5kbGVJbWFnZShzcmMpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGNsaXBib2FyZERhdGEgPSB3aW5kb3cuY2xpcGJvYXJkRGF0YSkge1xuICAgICAgICAgICAgaWYgKChyZWYyID0gKHRleHQgPSBjbGlwYm9hcmREYXRhLmdldERhdGEoJ1RleHQnKSkpICE9IG51bGwgPyByZWYyLmxlbmd0aCA6IHZvaWQgMCkge1xuICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIF90aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVUZXh0Jywge1xuICAgICAgICAgICAgICAgICAgdGV4dDogdGV4dFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ19wYXN0ZUNoZWNrQ29udGFpbmVyRG9uZScpO1xuICAgICAgICAgICAgICB9LCAxKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJlZjMgPSBjbGlwYm9hcmREYXRhLmZpbGVzO1xuICAgICAgICAgICAgICBmb3IgKGsgPSAwLCBsZW4xID0gcmVmMy5sZW5ndGg7IGsgPCBsZW4xOyBrKyspIHtcbiAgICAgICAgICAgICAgICBmaWxlID0gcmVmM1trXTtcbiAgICAgICAgICAgICAgICBfdGhpcy5faGFuZGxlSW1hZ2UoVVJMLmNyZWF0ZU9iamVjdFVST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wKCkuaGlkZSgpO1xuXHRcdFx0dGhpcy51cGxvYWRlci5zaG93KCkuc2V0SW1hZ2VEYXRhKCBpbWFnZURhdGEgKTtcblx0XHR9LFxuXHRcdHN0YXJ0R3JhYmJpbmc6ZnVuY3Rpb24oKSB7XG5cdFx0XHR0aGlzLnVwbG9hZGVyLmhpZGUoKTtcblx0XHRcdHRoaXMuZ3JhYmJlci5zaG93KCkuc3RhcnQoKTtcblx0XHRcdHJldHVybiB0aGlzO1xuXHRcdH0sXG5cdFx0c3RvcEdyYWJiaW5nOmZ1bmN0aW9uKCkge1xuXHRcdFx0dGhpcy5ncmFiYmVyLnN0b3AoKTtcblx0XHRcdHJldHVybiB0aGlzO1xuXHRcdH0sXG5cdFx0Z2V0QWN0aW9uIDogZnVuY3Rpb24oKSB7XG5cdFx0XHRyZXR1cm4gdGhpcy5ncmFiYmVyLmFjdGlvbjtcblx0XHR9LFxuXHRcdGRpc21pc3M6ZnVuY3Rpb24oKSB7XG5cdFx0XHR0aGlzLmdyYWJiZXIuc3RvcCgpO1xuXHRcdFx0cmV0dXJuIHRoaXM7XG5cdFx0fVxuXHR9KTtcblxufSkoalF1ZXJ5LHdpbmRvdyxtT3hpZSk7XG4iXX0= 
  • the-paste/tags/1.0.2/readme.txt

    r1760781 r1760790  
    22Contributors: podpirate 
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=F8NKC6TCASUXE 
    4 Tags: copy & paste, paste, clipboard, image, editor, rte, tinymce, wysiwyg, media, media library, upload 
    5 Requires at least: 3.0.1 
     4Tags: paste, clipboard, image, editor, media 
     5Requires at least: 4.5.0 
    66Tested up to: 4.8.1 
    77Requires PHP: 5.3.0 
    8 Stable tag: 1.0.1 
     8Stable tag: 1.0.2 
    99License: GPLv2 or later 
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html 
    1111 
    12 Paste Images in WordPress from many applications md upload them to the media library. 
     12Paste Images in WordPress from many applications and upload them to the media library. 
    1313 
    1414== Description == 
    1515 
    16 Speed up your workflow by pasting images to the WordPress text editor. 
     16Speed up your workflow by pasting images directly to the WordPress text editor 
     17and upload them to the media library. 
    1718 
    1819Copy image data from many desktop applications: 
     
    2324* LibreOffice 
    2425* Word 
    25 * [See a detailed list](https://github.com/mcguffin/the-paste#applications-tested-so-far) 
     26* [And some more...](https://github.com/mcguffin/the-paste#applications-tested-so-far) 
    2627 
    2728The most recent Desktop versions of Chrome, Firefox, IE, Edge and Safari are supported. 
    2829 
    2930[The paste at GitHub](https://github.com/mcguffin/the-paste) 
     31 
    3032 
    3133== Installation == 
     
    4042 
    4143== Changelog == 
     44 
     45= 1.0.3 = 
     46* Performance improvements 
     47* Add Textdomain to plugin header 
    4248 
    4349= 1.0.2 = 
  • the-paste/trunk/index.php

    r1760781 r1760790  
    66Description: Paste Images in WordPress from many applications md upload them to the media library. 
    77Author: Jörn Lund 
    8 Version: 1.0.1 
     8Version: 1.0.2 
    99Author URI: https://github.com/mcguffin/ 
    1010License: GPL2 
     11Text Domain: the-paste 
     12Domain Path: /languages 
    1113*/ 
    1214 
     
    1517 
    1618define( 'THE_PASTE_FILE', __FILE__ ); 
    17 define( 'THE_PASTE_VERSION', '1.0.1' ); 
     19define( 'THE_PASTE_VERSION', '1.0.2' ); 
    1820define( 'THE_PASTE_DIRECTORY', plugin_dir_path(__FILE__) ); 
    1921 
  • the-paste/trunk/js/admin/mce/the-paste-plugin.js

    r1760781 r1760790  
    417417        thepaste.options.editor.auto_upload = localStorage.getItem( 'thepaste.auto_upload' ) !== 'false'; 
    418418 
     419        // enable / disable autoupload 
    419420        editor.addCommand( 'cmd_thepaste', function() { 
    420421            thepaste.options.editor.auto_upload = ! thepaste.options.editor.auto_upload; 
     
    424425        }); 
    425426 
    426  
     427        // enable / disable autoupload button 
    427428        editor.addButton('thepaste', { 
    428429            icon: 'thepaste', 
     
    435436        }); 
    436437 
     438        // upload button in media toolbar flyout 
    437439        editor.addButton('wp_img_thepaste_upload', { 
    438440            icon: 'dashicon dashicons dashicons-upload thepaste-upload', 
     
    447449        }); 
    448450 
     451        // init media toolbar flyout 
    449452        editor.once( 'preinit', function() { 
    450453            if ( editor.wp && editor.wp._createToolbar ) { 
     
    461464        } ); 
    462465 
     466        // setup media toolbar flyout on node change 
    463467        editor.on( 'wptoolbar', function( event ) { 
    464468            var uploadBtn; 
     
    475479        } ); 
    476480 
     481        // tru if data source or blob image 
    477482        function canUpload( img ) { 
    478483            var sub = img.src.substring(0,5); 
     
    480485        } 
    481486 
    482         function execCommandUploadPastedImage(a){ 
    483             if ( thepaste.options.editor.auto_upload && 
    484                 a.command == 'mceInsertContent' && 
    485                 !! a.value && !! a.value.content && 
    486                 "<img" === a.value.content.substring(0,4).toLowerCase() 
    487             ) { 
    488                 $img = $(editor.getBody()).find('.'+pasted_image_tmp_class); 
    489                 if ( canUpload( $img.get(0) ) ) { 
    490                     thepaste.uploadImage( $img.get(0), editor ); 
    491                     $img.removeClass(pasted_image_tmp_class); 
    492                 } 
    493             } 
    494         } 
     487        // setup media toolbar flyout 
    495488        editor 
    496 //          .on( 'init', setupEditorDom ) 
    497             .on( 'PastePostProcess', function(e){ 
    498                 var $firstChild; 
    499                 if ( thepaste.options.editor.auto_upload ) { 
    500                     $firstChild = $(e.node).children().first(); 
    501                     if ( $firstChild.is('img') && canUpload( $firstChild.get(0) ) ) { 
    502                         pasted_image_tmp_class = pasted_image_tmp_prefix + Date.now(); 
    503                         $firstChild.addClass( pasted_image_tmp_class ); 
    504                         editor.once( 'ExecCommand', execCommandUploadPastedImage ); 
    505                     } 
    506                 } 
    507             }) 
    508489            .on( 'BeforePastePreProcess', function(e){ 
    509                 // remove svg data from illustrator 
     490                // remove svg data 
    510491                if (  e.content.match( /&lt;svg[\s\S.]*&lt;\/svg&gt;/i ) ) { 
    511492                    e.preventDefault(); 
     
    515496 
    516497            } ) 
     498            .on( 'PastePostProcess', function(e){ 
     499                // upload image 
     500                var $firstChild, $uploadBox; 
     501 
     502                if ( thepaste.options.editor.auto_upload ) { 
     503                    $firstChild = $(e.node).children().first(); 
     504                    if ( $firstChild.is('img') && canUpload( $firstChild.get(0) ) ) { 
     505                        $uploadBox = thepaste.uploadImage( $firstChild.get(0), editor ); 
     506                        $firstChild.remove(); 
     507                        $(e.node).append( $uploadBox ); 
     508                    } 
     509                } 
     510            }) 
    517511            ; 
    518512 
  • the-paste/trunk/js/admin/mce/the-paste-plugin.min.js

    r1760781 r1760790  
    1 (function(){var t,e,n,a,o;t=window.jQuery,t.paste=function(t){var n;return"undefined"!=typeof console&&null!==console&&console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead."),n=e.mountNonInputable(t),n._container},t.fn.pastableNonInputable=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is("textarea, input:text, [contenteditable]")||(e.mountNonInputable(n),n._pastable=!0);return this},t.fn.pastableTextarea=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is(":not(textarea, input:text)")||(e.mountTextarea(n),n._pastable=!0);return this},t.fn.pastableContenteditable=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is(":not([contenteditable])")||(e.mountContenteditable(n),n._pastable=!0);return this},a=function(t,e){var n,a,o,r,i,u,s,l,c,d,p;if(null==e&&(e=512),!(l=t.match(/^data\:([^\;]+)\;base64\,(.+)$/)))return null;for(d=l,l=d[0],u=d[1],n=d[2],r=atob(n),o=[],c=0;c<r.length;){for(p=r.slice(c,c+e),i=new Array(p.length),s=0;s<p.length;)i[s]=p.charCodeAt(s),s++;a=new Uint8Array(i),o.push(a),c+=e}return new Blob(o,{type:u})},n=function(){return t(document.createElement("div")).attr("contenteditable",!0).attr("aria-hidden",!0).attr("tabindex",-1).css({width:1,height:1,position:"fixed",left:-100,overflow:"hidden"})},o=function(e,n){var a,o,r,i,u,s;return i=void 0,u=void 0,r=void 0,o=void 0,a=void 0,"area"===(s=e.nodeName.toLowerCase())?(i=e.parentNode,u=i.name,!(!e.href||!u||"map"!==i.nodeName.toLowerCase())&&(r=t("img[usemap='#"+u+"']"),r.length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(s)?(o=!e.disabled)&&(a=t(e).closest("fieldset")[0])&&(o=!a.disabled):o="a"===s?e.href||n:n,(o=o||t(e).is("[contenteditable]"))&&t(e).is(":visible"))},e=function(){function e(e,n){this._container=e,this._target=n,this._container=t(this._container),this._target=t(this._target).addClass("pastable"),this._container.on("paste",function(t){return function(e){var n,a,o,r,i,u,s,l,c,d,p,g,f;if(e.currentTarget!==e.target)return e.preventDefault();if(t._paste_event_fired=!0,null!=(null!=(c=e.originalEvent)?c.clipboardData:void 0))if(n=e.originalEvent.clipboardData,n.items)for(d=n.items,r=0,u=d.length;r<u;r++){if(o=d[r],o.type.match(/^image\//)){l=new FileReader,l.onload=function(e){return t._handleImage(e.target.result)};try{l.readAsDataURL(o.getAsFile())}catch(t){}e.preventDefault();break}"text/plain"===o.type&&o.getAsString(function(e){return t._target.trigger("pasteText",{text:e})})}else-1!==Array.prototype.indexOf.call(n.types,"text/plain")&&(f=n.getData("Text"),setTimeout(function(){return t._target.trigger("pasteText",{text:f})},1)),t._checkImagesInContainer(function(e){return t._handleImage(e)});if(n=window.clipboardData)if(null!=(p=f=n.getData("Text"))?p.length:void 0)setTimeout(function(){return t._target.trigger("pasteText",{text:f}),t._target.trigger("_pasteCheckContainerDone")},1);else{for(g=n.files,i=0,s=g.length;i<s;i++)a=g[i],t._handleImage(URL.createObjectURL(a));t._checkImagesInContainer(function(t){})}return null}}(this))}return e.prototype._target=null,e.prototype._container=null,e.mountNonInputable=function(a){var r;return r=new e(n().appendTo(a),a),t(a).on("click",function(t){return function(t){if(!o(t.target,!1))return r._container.focus()}}()),r._container.on("focus",function(e){return function(){return t(a).addClass("pastable-focus")}}()),r._container.on("blur",function(e){return function(){return t(a).removeClass("pastable-focus")}}())},e.mountTextarea=function(a){var o,r,i,u;return("undefined"!=typeof DataTransfer&&null!==DataTransfer?DataTransfer.prototype:void 0)&&(null!=(i=Object.getOwnPropertyDescriptor)&&null!=(u=i.call(Object,DataTransfer.prototype,"items"))?u.get:void 0)?this.mountContenteditable(a):(r=new e(n().insertBefore(a),a),o=!1,t(a).on("keyup",function(t){var e;return 17!==(e=t.keyCode)&&224!==e||(o=!1),null}),t(a).on("keydown",function(e){var n;return 17!==(n=e.keyCode)&&224!==n||(o=!0),null!=e.ctrlKey&&null!=e.metaKey&&(o=e.ctrlKey||e.metaKey),o&&86===e.keyCode&&(r._textarea_focus_stolen=!0,r._container.focus(),r._paste_event_fired=!1,setTimeout(function(e){return function(){if(!r._paste_event_fired)return t(a).focus(),r._textarea_focus_stolen=!1}}(),1)),null}),t(a).on("paste",function(t){return function(){}}()),t(a).on("focus",function(e){return function(){if(!r._textarea_focus_stolen)return t(a).addClass("pastable-focus")}}()),t(a).on("blur",function(e){return function(){if(!r._textarea_focus_stolen)return t(a).removeClass("pastable-focus")}}()),t(r._target).on("_pasteCheckContainerDone",function(e){return function(){return t(a).focus(),r._textarea_focus_stolen=!1}}()),t(r._target).on("pasteText",function(e){return function(e,n){var o,r,i;return i=t(a).prop("selectionStart"),r=t(a).prop("selectionEnd"),o=t(a).val(),t(a).val(""+o.slice(0,i)+n.text+o.slice(r)),t(a)[0].setSelectionRange(i+n.text.length,i+n.text.length),t(a).trigger("change")}}()))},e.mountContenteditable=function(n){return new e(n,n),t(n).on("focus",function(e){return function(){return t(n).addClass("pastable-focus")}}()),t(n).on("blur",function(e){return function(){return t(n).removeClass("pastable-focus")}}())},e.prototype._handleImage=function(t){var e;return t.match(/^webkit\-fake\-url\:\/\//)?this._target.trigger("pasteImageError",{message:"You are trying to paste an image in Safari, however we are unable to retieve its data."}):(this._target.trigger("pasteImageStart"),e=new Image,e.crossOrigin="anonymous",e.onload=function(t){return function(){var n,o,r,i;o=document.createElement("canvas"),o.width=e.width,o.height=e.height,r=o.getContext("2d"),r.drawImage(e,0,0,o.width,o.height),i=null;try{i=o.toDataURL("image/png"),n=a(i)}catch(t){}return i&&t._target.trigger("pasteImage",{blob:n,dataURL:i,width:e.width,height:e.height}),t._target.trigger("pasteImageEnd")}}(this),e.onerror=function(e){return function(){return e._target.trigger("pasteImageError",{message:"Failed to get image from: "+t,url:t}),e._target.trigger("pasteImageEnd")}}(this),e.src=t)},e.prototype._checkImagesInContainer=function(e){var n,a,o,r,i;for(i=Math.floor(1e3*Math.random()),r=this._container.find("img"),a=0,o=r.length;a<o;a++)n=r[a],n["_paste_marked_"+i]=!0;return setTimeout(function(a){return function(){var o,r,u;for(u=a._container.find("img"),o=0,r=u.length;o<r;o++)n=u[o],n["_paste_marked_"+i]||(e(n.src),t(n).remove());return a._target.trigger("_pasteCheckContainerDone")}}(this),1)},e}()}).call(this);var thepastePluginCallback;!function(t){thepastePluginCallback=function(e){function n(t){var e=t.src.substring(0,5);return"blob:"===e||"data:"===e}function a(a){i.options.editor.auto_upload&&"mceInsertContent"==a.command&&a.value&&a.value.content&&"<img"===a.value.content.substring(0,4).toLowerCase()&&($img=t(e.getBody()).find("."+u),n($img.get(0))&&(i.uploadImage($img.get(0),e),$img.removeClass(u)))}var o,r,i=wp.media.thepaste,u="";i.options.editor.auto_upload="false"!==localStorage.getItem("thepaste.auto_upload"),e.addCommand("cmd_thepaste",function(){i.options.editor.auto_upload=!i.options.editor.auto_upload,localStorage.setItem("thepaste.auto_upload",i.options.editor.auto_upload.toString()),o.active(i.options.editor.auto_upload)}),e.addButton("thepaste",{icon:"thepaste",tooltip:i.l10n.upload_pasted_images,cmd:"cmd_thepaste",onPostRender:function(){o=this},active:i.options.editor.auto_upload}),e.addButton("wp_img_thepaste_upload",{icon:"dashicon dashicons dashicons-upload thepaste-upload",tooltip:i.l10n.upload_image,onclick:function(){var t;t=e.selection.getNode(),i.uploadImage(t,e)}}),e.once("preinit",function(){e.wp&&e.wp._createToolbar&&(r=e.wp._createToolbar(["wp_img_alignleft","wp_img_aligncenter","wp_img_alignright","wp_img_alignnone","wp_img_thepaste_upload","wp_img_edit","wp_img_remove"]))}),e.on("wptoolbar",function(t){var a;"IMG"!==t.element.nodeName||e.wp.isPlaceholder(t.element)||(t.toolbar=r,a=r.$el.find(".thepaste-upload").closest(".mce-btn"),n(t.element)?a.show():a.hide())}),e.on("PastePostProcess",function(o){var r;i.options.editor.auto_upload&&(r=t(o.node).children().first(),r.is("img")&&n(r.get(0))&&(u="__pasted_image_tmp_"+Date.now(),r.addClass(u),e.once("ExecCommand",a)))}).on("BeforePastePreProcess",function(t){return t.content.match(/&lt;svg[\s\S.]*&lt;\/svg&gt;/i)&&(t.preventDefault(),t.content=""),t})},tinymce.PluginManager.add("thepaste",thepastePluginCallback)}(jQuery); 
    2 //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRoZS1wYXN0ZS1wbHVnaW4uanMiXSwibmFtZXMiOlsiJCIsIlBhc3RlIiwiY3JlYXRlSGlkZGVuRWRpdGFibGUiLCJkYXRhVVJMdG9CbG9iIiwiaXNGb2N1c2FibGUiLCJ3aW5kb3ciLCJqUXVlcnkiLCJwYXN0ZSIsInBhc3RlQ29udGFpbmVyIiwicG0iLCJjb25zb2xlIiwibG9nIiwibW91bnROb25JbnB1dGFibGUiLCJfY29udGFpbmVyIiwiZm4iLCJwYXN0YWJsZU5vbklucHV0YWJsZSIsImVsIiwiaiIsImxlbiIsInJlZiIsInRoaXMiLCJsZW5ndGgiLCJfcGFzdGFibGUiLCJpcyIsInBhc3RhYmxlVGV4dGFyZWEiLCJtb3VudFRleHRhcmVhIiwicGFzdGFibGVDb250ZW50ZWRpdGFibGUiLCJtb3VudENvbnRlbnRlZGl0YWJsZSIsImRhdGFVUkwiLCJzbGljZVNpemUiLCJiNjREYXRhIiwiYnl0ZUFycmF5IiwiYnl0ZUFycmF5cyIsImJ5dGVDaGFyYWN0ZXJzIiwiYnl0ZU51bWJlcnMiLCJjb250ZW50V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uICAgICAgfVxuICAgICAgcGFzdGUgPSBuZXcgUGFzdGUoY3JlYXRlSGlkZGVuRWRpdGFibGUoKS5pbnNlcnRCZWZvcmUodGV4dGFyZWEpLCB0ZXh0YXJlYSk7XG4gICAgICBjdGxEb3duID0gZmFsc2U7XG4gICAgICAkKHRleHRhcmVhKS5vbigna2V5dXAnLCBmdW5jdGlvbihldikge1xuICAgICAgICB2YXIgcmVmMjtcbiAgICAgICAgaWYgKChyZWYyID0gZXYua2V5Q29kZSkgPT09IDE3IHx8IHJlZjIgPT09IDIyNCkge1xuICAgICAgICAgIGN0bERvd24gPSBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgIH0pO1xuICAgICAgJCh0ZXh0YXJlYSkub24oJ2tleWRvd24nLCBmdW5jdGlvbihldikge1xuICAgICAgICB2YXIgcmVmMjtcbiAgICAgICAgaWYgKChyZWYyID0gZXYua2V5Q29kZSkgPT09IDE3IHx8IHJlZjIgPT09IDIyNCkge1xuICAgICAgICAgIGN0bERvd24gPSB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGlmICgoZXYuY3RybEtleSAhPSBudWxsKSAmJiAoZXYubWV0YUtleSAhPSBudWxsKSkge1xuICAgICAgICAgIGN0bERvd24gPSBldi5jdHJsS2V5IHx8IGV2Lm1ldGFLZXk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGN0bERvd24gJiYgZXYua2V5Q29kZSA9PT0gODYpIHtcbiAgICAgICAgICBwYXN0ZS5fdGV4dGFyZWFfZm9jdXNfc3RvbGVuID0gdHJ1ZTtcbiAgICAgICAgICBwYXN0ZS5fY29udGFpbmVyLmZvY3VzKCk7XG4gICAgICAgICAgcGFzdGUuX3Bhc3RlX2V2ZW50X2ZpcmVkID0gZmFsc2U7XG4gICAgICAgICAgc2V0VGltZW91dCgoZnVuY3Rpb24oX3RoaXMpIHtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgaWYgKCFwYXN0ZS5fcGFzdGVfZXZlbnRfZmlyZWQpIHtcbiAgICAgICAgICAgICAgICAkKHRleHRhcmVhKS5mb2N1cygpO1xuICAgICAgICAgICAgICAgIHJldHVybiBwYXN0ZS5fdGV4dGFyZWFfZm9jdXNfc3RvbGVuID0gZmFsc2U7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSkodGhpcyksIDEpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgICAgfSk7XG4gICAgICAkKHRleHRhcmVhKS5vbigncGFzdGUnLCAoZnVuY3Rpb24oX3RoaXMpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge307XG4gICAgICB9KSh0aGlzKSk7XG4gICAgICAkKHRleHRhcmVhKS5vbignZm9jdXMnLCAoZnVuY3Rpb24oX3RoaXMpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmICghcGFzdGUuX3RleHRhcmVhX2ZvY3VzX3N0b2xlbikge1xuICAgICAgICAgICAgcmV0dXJuICQodGV4dGFyZWEpLmFkZENsYXNzKCdwYXN0YWJsZS1mb2N1cycpO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH0pKHRoaXMpKTtcbiAgICAgICQodGV4dGFyZWEpLm9uKCdibHVyJywgKGZ1bmN0aW9uKF90aGlzKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBpZiAoIXBhc3RlLl90ZXh0YXJlYV9mb2N1c19zdG9sZW4pIHtcbiAgICAgICAgICAgIHJldHVybiAkKHRleHRhcmVhKS5yZW1vdmVDbGFzcygncGFzdGFibGUtZm9jdXMnKTtcbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9KSh0aGlzKSk7XG4gICAgICAkKHBhc3RlLl90YXJnZXQpLm9uKCdfcGFzdGVDaGVja0NvbnRhaW5lckR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wgcmVmMiwgcmVmMywgdGV4dDtcbiAgICAgICAgICBpZiAoZXYuY3VycmVudFRhcmdldCAhPT0gZXYudGFyZ2V0KSB7XG4gICAgICAgICAgICByZXR1cm4gZXYucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgX3RoaXMuX3Bhc3RlX2V2ZW50X2ZpcmVkID0gdHJ1ZTtcbiAgICAgICAgICBpZiAoKChyZWYgPSBldi5vcmlnaW5hbEV2ZW50KSAhPSBudWxsID8gcmVmLmNsaXBib2FyZERhdGEgOiB2b2lkIDApICE9IG51bGwpIHtcbiAgICAgICAgICAgIGNsaXBib2FyZERhdGEgPSBldi5vcmlnaW5hbEV2ZW50LmNsaXBib2FyZERhdGE7XG4gICAgICAgICAgICBpZiAoY2xpcGJvYXJkRGF0YS5pdGVtcykge1xuICAgICAgICAgICAgICByZWYxID0gY2xpcGJvYXJkRGF0YS5pdGVtcztcbiAgICAgICAgICAgICAgZm9yIChqID0gMCwgbGVuID0gcmVmMS5sZW5ndGg7IGogPCBsZW47IGorKykge1xuICAgICAgICAgICAgICAgIGl0ZW0gPSByZWYxW2pdO1xuICAgICAgICAgICAgICAgIGlmIChpdGVtLnR5cGUubWF0Y2goL15pbWFnZVxcLy8pKSB7XG4gICAgICAgICAgICAgICAgICByZWFkZXIgPSBuZXcgRmlsZVJlYWRlcigpO1xuICAgICAgICAgICAgICAgICAgcmVhZGVyLm9ubG9hZCA9IGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5faGFuZGxlSW1hZ2UoZXZlbnQudGFyZ2V0LnJlc3VsdCk7XG4gICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgcmVhZGVyLnJlYWRBc0RhdGFVUkwoaXRlbS5nZXRBc0ZpbGUoKSk7XG4gICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge31cbiAgICAgICAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGl0ZW0udHlwZSA9PT0gJ3RleHQvcGxhaW4nKSB7XG4gICAgICAgICAgICAgICAgICBpdGVtLmdldEFzU3RyaW5nKGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX3RhcmdldC50cmlnZ2VyKCdwYXN0ZVRleHQnLCB7XG4gICAgICAgICAgICAgICAgICAgICAgdGV4dDogc3RyaW5nXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoLTEgIT09IEFycmF5LnByb3RvdHlwZS5pbmRleE9mLmNhbGwoY2xpcGJvYXJkRGF0YS50eXBlcywgJ3RleHQvcGxhaW4nKSkge1xuICAgICAgICAgICAgICAgIHRleHQgPSBjbGlwYm9hcmREYXRhLmdldERhdGEoJ1RleHQnKTtcbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVUZXh0Jywge1xuICAgICAgICAgICAgICAgICAgICB0ZXh0OiB0ZXh0XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9LCAxKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBfdGhpcy5fY2hlY2tJbWFnZXNJbkNvbnRhaW5lcihmdW5jdGlvbihzcmMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX2hhbmRsZUltYWdlKHNyYyk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoY2xpcGJvYXJkRGF0YSA9IHdpbmRvdy5jbGlwYm9hcmREYXRhKSB7XG4gICAgICAgICAgICBpZiAoKHJlZjIgPSAodGV4dCA9IGNsaXBib2FyZERhdGEuZ2V0RGF0YSgnVGV4dCcpKSkgIT0gbnVsbCA/IHJlZjIubGVuZ3RoIDogdm9pZCAwKSB7XG4gICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgX3RoaXMuX3RhcmdldC50cmlnZ2VyKCdwYXN0ZVRleHQnLCB7XG4gICAgICAgICAgICAgICAgICB0ZXh0OiB0ZXh0XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl90YXJnZXQudHJpZ2dlcignX3Bhc3RlQ2hlY2tDb250YWluZXJEb25lJyk7XG4gICAgICAgICAgICAgIH0sIDEpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmVmMyA9IGNsaXBib2FyZERhdGEuZmlsZXM7XG4gICAgICAgICAgICAgIGZvciAoayA9IDAsIGxlbjEgPSByZWYzLmxlbmd0aDsgayA8IGxlbjE7IGsrKykge1xuICAgICAgICAgICAgICAgIGZpbGUgPSByZWYzW2tdO1xuICAgICAgICAgICAgICAgIF90aGlzLl9oYW5kbGVJbWFnZShVUkwuY3JlYXRlT2JqZWN0VVJMKGZpbGUpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBfdGhpcy5fY2hlY2tJbWFnZXNJbkNvbnRhaW5lcihmdW5jdGlvbihzcmMpIHt9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH07XG4gICAgICB9KSh0aGlzKSk7XG4gICAgfVxuXG4gICAgUGFzdGUucHJvdG90eXBlLl9oYW5kbGVJbWFnZSA9IGZ1bm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GlsZC5nZXQoMCkgKSApIHtcblx0XHRcdFx0XHRcdHBhc3RlZF9pbWFnZV90bXBfY2xhc3MgPSBwYXN0ZWRfaW1hZ2VfdG1wX3ByZWZpeCArIERhdGUubm93KCk7XG5cdFx0XHRcdFx0XHQkZmlyc3RDaGlsZC5hZGRDbGFzcyggcGFzdGVkX2ltYWdlX3RtcF9jbGFzcyApO1xuXHRcdFx0XHRcdFx0ZWRpdG9yLm9uY2UoICdFeGVjQ29tbWFuZCcsIGV4ZWNDb21tYW5kVXBsb2FkUGFzdGVkSW1hZ2UgKTtcblx0XHRcdFx0XHR9XG5cdFx0XHRcdH1cblx0XHRcdH0pXG5cdFx0XHQub24oICdCZWZvcmVQYXN0ZVByZVByb2Nlc3MnLCBmdW5jdGlvbihlKXtcblx0XHRcdFx0Ly8gcmVtb3ZlIHN2ZyBkYXRhIGZyb20gaWxsdXN0cmF0b3Jcblx0XHRcdFx0aWYgKCAgZS5jb250ZW50Lm1hdGNoKCAvJmx0O3N2Z1tcXHNcXFMuXSombHQ7XFwvc3ZnJmd0Oy9pICkgKSB7XG5cdFx0XHRcdFx0ZS5wcmV2ZW50RGVmYXVsdCgpO1xuXHRcdFx0XHRcdGUuY29udGVudCA9ICcnO1xuXHRcdFx0XHR9XG5cdFx0XHRcdHJldHVybiBlO1xuXG5cdFx0XHR9IClcblx0XHRcdDtcblxuXHR9O1xuXG5cdHRpbnltY2UuUGx1Z2luTWFuYWdlci5hZGQoICd0aGVwYXN0ZScsIHRoZXBhc3RlUGx1Z2luQ2FsbGJhY2sgKTtcblxufSApKGpRdWVyeSk7XG4iXX0= 
     1(function(){var t,e,n,a,o;t=window.jQuery,t.paste=function(t){var n;return"undefined"!=typeof console&&null!==console&&console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead."),n=e.mountNonInputable(t),n._container},t.fn.pastableNonInputable=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is("textarea, input:text, [contenteditable]")||(e.mountNonInputable(n),n._pastable=!0);return this},t.fn.pastableTextarea=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is(":not(textarea, input:text)")||(e.mountTextarea(n),n._pastable=!0);return this},t.fn.pastableContenteditable=function(){var n,a,o,r;for(r=this,a=0,o=r.length;a<o;a++)n=r[a],n._pastable||t(n).is(":not([contenteditable])")||(e.mountContenteditable(n),n._pastable=!0);return this},a=function(t,e){var n,a,o,r,i,u,s,l,c,p,d;if(null==e&&(e=512),!(l=t.match(/^data\:([^\;]+)\;base64\,(.+)$/)))return null;for(p=l,l=p[0],u=p[1],n=p[2],r=atob(n),o=[],c=0;c<r.length;){for(d=r.slice(c,c+e),i=new Array(d.length),s=0;s<d.length;)i[s]=d.charCodeAt(s),s++;a=new Uint8Array(i),o.push(a),c+=e}return new Blob(o,{type:u})},n=function(){return t(document.createElement("div")).attr("contenteditable",!0).attr("aria-hidden",!0).attr("tabindex",-1).css({width:1,height:1,position:"fixed",left:-100,overflow:"hidden"})},o=function(e,n){var a,o,r,i,u,s;return i=void 0,u=void 0,r=void 0,o=void 0,a=void 0,"area"===(s=e.nodeName.toLowerCase())?(i=e.parentNode,u=i.name,!(!e.href||!u||"map"!==i.nodeName.toLowerCase())&&(r=t("img[usemap='#"+u+"']"),r.length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(s)?(o=!e.disabled)&&(a=t(e).closest("fieldset")[0])&&(o=!a.disabled):o="a"===s?e.href||n:n,(o=o||t(e).is("[contenteditable]"))&&t(e).is(":visible"))},e=function(){function e(e,n){this._container=e,this._target=n,this._container=t(this._container),this._target=t(this._target).addClass("pastable"),this._container.on("paste",function(t){return function(e){var n,a,o,r,i,u,s,l,c,p,d,g,f;if(e.currentTarget!==e.target)return e.preventDefault();if(t._paste_event_fired=!0,null!=(null!=(c=e.originalEvent)?c.clipboardData:void 0))if(n=e.originalEvent.clipboardData,n.items)for(p=n.items,r=0,u=p.length;r<u;r++){if(o=p[r],o.type.match(/^image\//)){l=new FileReader,l.onload=function(e){return t._handleImage(e.target.result)};try{l.readAsDataURL(o.getAsFile())}catch(t){}e.preventDefault();break}"text/plain"===o.type&&o.getAsString(function(e){return t._target.trigger("pasteText",{text:e})})}else-1!==Array.prototype.indexOf.call(n.types,"text/plain")&&(f=n.getData("Text"),setTimeout(function(){return t._target.trigger("pasteText",{text:f})},1)),t._checkImagesInContainer(function(e){return t._handleImage(e)});if(n=window.clipboardData)if(null!=(d=f=n.getData("Text"))?d.length:void 0)setTimeout(function(){return t._target.trigger("pasteText",{text:f}),t._target.trigger("_pasteCheckContainerDone")},1);else{for(g=n.files,i=0,s=g.length;i<s;i++)a=g[i],t._handleImage(URL.createObjectURL(a));t._checkImagesInContainer(function(t){})}return null}}(this))}return e.prototype._target=null,e.prototype._container=null,e.mountNonInputable=function(a){var r;return r=new e(n().appendTo(a),a),t(a).on("click",function(t){return function(t){if(!o(t.target,!1))return r._container.focus()}}()),r._container.on("focus",function(e){return function(){return t(a).addClass("pastable-focus")}}()),r._container.on("blur",function(e){return function(){return t(a).removeClass("pastable-focus")}}())},e.mountTextarea=function(a){var o,r,i,u;return("undefined"!=typeof DataTransfer&&null!==DataTransfer?DataTransfer.prototype:void 0)&&(null!=(i=Object.getOwnPropertyDescriptor)&&null!=(u=i.call(Object,DataTransfer.prototype,"items"))?u.get:void 0)?this.mountContenteditable(a):(r=new e(n().insertBefore(a),a),o=!1,t(a).on("keyup",function(t){var e;return 17!==(e=t.keyCode)&&224!==e||(o=!1),null}),t(a).on("keydown",function(e){var n;return 17!==(n=e.keyCode)&&224!==n||(o=!0),null!=e.ctrlKey&&null!=e.metaKey&&(o=e.ctrlKey||e.metaKey),o&&86===e.keyCode&&(r._textarea_focus_stolen=!0,r._container.focus(),r._paste_event_fired=!1,setTimeout(function(e){return function(){if(!r._paste_event_fired)return t(a).focus(),r._textarea_focus_stolen=!1}}(),1)),null}),t(a).on("paste",function(t){return function(){}}()),t(a).on("focus",function(e){return function(){if(!r._textarea_focus_stolen)return t(a).addClass("pastable-focus")}}()),t(a).on("blur",function(e){return function(){if(!r._textarea_focus_stolen)return t(a).removeClass("pastable-focus")}}()),t(r._target).on("_pasteCheckContainerDone",function(e){return function(){return t(a).focus(),r._textarea_focus_stolen=!1}}()),t(r._target).on("pasteText",function(e){return function(e,n){var o,r,i;return i=t(a).prop("selectionStart"),r=t(a).prop("selectionEnd"),o=t(a).val(),t(a).val(""+o.slice(0,i)+n.text+o.slice(r)),t(a)[0].setSelectionRange(i+n.text.length,i+n.text.length),t(a).trigger("change")}}()))},e.mountContenteditable=function(n){return new e(n,n),t(n).on("focus",function(e){return function(){return t(n).addClass("pastable-focus")}}()),t(n).on("blur",function(e){return function(){return t(n).removeClass("pastable-focus")}}())},e.prototype._handleImage=function(t){var e;return t.match(/^webkit\-fake\-url\:\/\//)?this._target.trigger("pasteImageError",{message:"You are trying to paste an image in Safari, however we are unable to retieve its data."}):(this._target.trigger("pasteImageStart"),e=new Image,e.crossOrigin="anonymous",e.onload=function(t){return function(){var n,o,r,i;o=document.createElement("canvas"),o.width=e.width,o.height=e.height,r=o.getContext("2d"),r.drawImage(e,0,0,o.width,o.height),i=null;try{i=o.toDataURL("image/png"),n=a(i)}catch(t){}return i&&t._target.trigger("pasteImage",{blob:n,dataURL:i,width:e.width,height:e.height}),t._target.trigger("pasteImageEnd")}}(this),e.onerror=function(e){return function(){return e._target.trigger("pasteImageError",{message:"Failed to get image from: "+t,url:t}),e._target.trigger("pasteImageEnd")}}(this),e.src=t)},e.prototype._checkImagesInContainer=function(e){var n,a,o,r,i;for(i=Math.floor(1e3*Math.random()),r=this._container.find("img"),a=0,o=r.length;a<o;a++)n=r[a],n["_paste_marked_"+i]=!0;return setTimeout(function(a){return function(){var o,r,u;for(u=a._container.find("img"),o=0,r=u.length;o<r;o++)n=u[o],n["_paste_marked_"+i]||(e(n.src),t(n).remove());return a._target.trigger("_pasteCheckContainerDone")}}(this),1)},e}()}).call(this);var thepastePluginCallback;!function(t){thepastePluginCallback=function(e){function n(t){var e=t.src.substring(0,5);return"blob:"===e||"data:"===e}var a,o,r=wp.media.thepaste;r.options.editor.auto_upload="false"!==localStorage.getItem("thepaste.auto_upload"),e.addCommand("cmd_thepaste",function(){r.options.editor.auto_upload=!r.options.editor.auto_upload,localStorage.setItem("thepaste.auto_upload",r.options.editor.auto_upload.toString()),a.active(r.options.editor.auto_upload)}),e.addButton("thepaste",{icon:"thepaste",tooltip:r.l10n.upload_pasted_images,cmd:"cmd_thepaste",onPostRender:function(){a=this},active:r.options.editor.auto_upload}),e.addButton("wp_img_thepaste_upload",{icon:"dashicon dashicons dashicons-upload thepaste-upload",tooltip:r.l10n.upload_image,onclick:function(){var t;t=e.selection.getNode(),r.uploadImage(t,e)}}),e.once("preinit",function(){e.wp&&e.wp._createToolbar&&(o=e.wp._createToolbar(["wp_img_alignleft","wp_img_aligncenter","wp_img_alignright","wp_img_alignnone","wp_img_thepaste_upload","wp_img_edit","wp_img_remove"]))}),e.on("wptoolbar",function(t){var a;"IMG"!==t.element.nodeName||e.wp.isPlaceholder(t.element)||(t.toolbar=o,a=o.$el.find(".thepaste-upload").closest(".mce-btn"),n(t.element)?a.show():a.hide())}),e.on("BeforePastePreProcess",function(t){return t.content.match(/&lt;svg[\s\S.]*&lt;\/svg&gt;/i)&&(t.preventDefault(),t.content=""),t}).on("PastePostProcess",function(a){var o,i;r.options.editor.auto_upload&&(o=t(a.node).children().first(),o.is("img")&&n(o.get(0))&&(i=r.uploadImage(o.get(0),e),o.remove(),t(a.node).append(i)))})},tinymce.PluginManager.add("thepaste",thepastePluginCallback)}(jQuery); 
     2//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRoZS1wYXN0ZS1wbHVnaW4uanMiXSwibmFtZXMiOlsiJCIsIlBhc3RlIiwiY3JlYXRlSGlkZGVuRWRpdGFibGUiLCJkYXRhVVJMdG9CbG9iIiwiaX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HJlZjMsIHRleHQ7XG4gICAgICAgICAgaWYgKGV2LmN1cnJlbnRUYXJnZXQgIT09IGV2LnRhcmdldCkge1xuICAgICAgICAgICAgcmV0dXJuIGV2LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIF90aGlzLl9wYXN0ZV9ldmVudF9maXJlZCA9IHRydWU7XG4gICAgICAgICAgaWYgKCgocmVmID0gZXYub3JpZ2luYWxFdmVudCkgIT0gbnVsbCA/IHJlZi5jbGlwYm9hcmREYXRhIDogdm9pZCAwKSAhPSBudWxsKSB7XG4gICAgICAgICAgICBjbGlwYm9hcmREYXRhID0gZXYub3JpZ2luYWxFdmVudC5jbGlwYm9hcmREYXRhO1xuICAgICAgICAgICAgaWYgKGNsaXBib2FyZERhdGEuaXRlbXMpIHtcbiAgICAgICAgICAgICAgcmVmMSA9IGNsaXBib2FyZERhdGEuaXRlbXM7XG4gICAgICAgICAgICAgIGZvciAoaiA9IDAsIGxlbiA9IHJlZjEubGVuZ3RoOyBqIDwgbGVuOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpdGVtID0gcmVmMVtqXTtcbiAgICAgICAgICAgICAgICBpZiAoaXRlbS50eXBlLm1hdGNoKC9eaW1hZ2VcXC8vKSkge1xuICAgICAgICAgICAgICAgICAgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKTtcbiAgICAgICAgICAgICAgICAgIHJlYWRlci5vbmxvYWQgPSBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX2hhbmRsZUltYWdlKGV2ZW50LnRhcmdldC5yZXN1bHQpO1xuICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHJlYWRlci5yZWFkQXNEYXRhVVJMKGl0ZW0uZ2V0QXNGaWxlKCkpO1xuICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHt9XG4gICAgICAgICAgICAgICAgICBldi5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpdGVtLnR5cGUgPT09ICd0ZXh0L3BsYWluJykge1xuICAgICAgICAgICAgICAgICAgaXRlbS5nZXRBc1N0cmluZyhmdW5jdGlvbihzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVUZXh0Jywge1xuICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IHN0cmluZ1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKC0xICE9PSBBcnJheS5wcm90b3R5cGUuaW5kZXhPZi5jYWxsKGNsaXBib2FyZERhdGEudHlwZXMsICd0ZXh0L3BsYWluJykpIHtcbiAgICAgICAgICAgICAgICB0ZXh0ID0gY2xpcGJvYXJkRGF0YS5nZXREYXRhKCdUZXh0Jyk7XG4gICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ3Bhc3RlVGV4dCcsIHtcbiAgICAgICAgICAgICAgICAgICAgdGV4dDogdGV4dFxuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSwgMSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgX3RoaXMuX2NoZWNrSW1hZ2VzSW5Db250YWluZXIoZnVuY3Rpb24oc3JjKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl9oYW5kbGVJbWFnZShzcmMpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGNsaXBib2FyZERhdGEgPSB3aW5kb3cuY2xpcGJvYXJkRGF0YSkge1xuICAgICAgICAgICAgaWYgKChyZWYyID0gKHRleHQgPSBjbGlwYm9hcmREYXRhLmdldERhdGEoJ1RleHQnKSkpICE9IG51bGwgPyByZWYyLmxlbmd0aCA6IHZvaWQgMCkge1xuICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIF90aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVUZXh0Jywge1xuICAgICAgICAgICAgICAgICAgdGV4dDogdGV4dFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ19wYXN0ZUNoZWNrQ29udGFpbmVyRG9uZScpO1xuICAgICAgICAgICAgICB9LCAxKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJlZjMgPSBjbGlwYm9hcmREYXRhLmZpbGVzO1xuICAgICAgICAgICAgICBmb3IgKGsgPSAwLCBsZW4xID0gcmVmMy5sZW5ndGg7IGsgPCBsZW4xOyBrKyspIHtcbiAgICAgICAgICAgICAgICBmaWxlID0gcmVmM1trXTtcbiAgICAgICAgICAgICAgICBfdGhpcy5faGFuZGxlSW1hZ2UoVVJMLmNyZWF0ZU9iamVjdFVSTChmaWxlKSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgX3RoaXMuX2NoZWNrSW1hZ2VzSW5Db250YWluZXIoZnVuY3Rpb24oc3JjKSB7fSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9O1xuICAgICAgfSkodGhpcykpO1xuICAgIH1cblxuICAgIFBhc3RlLnByb3RvdHlwZS5faGFuZGxlSW1hZ2UgPSBmdW5jdGlvbihzcmM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cdGlmICggJGZpcnN0Q2hpbGQuaXMoJ2ltZycpICYmIGNhblVwbG9hZCggJGZpcnN0Q2hpbGQuZ2V0KDApICkgKSB7XG5cdFx0XHRcdFx0XHQkdXBsb2FkQm94ID0gdGhlcGFzdGUudXBsb2FkSW1hZ2UoICRmaXJzdENoaWxkLmdldCgwKSwgZWRpdG9yICk7XG5cdFx0XHRcdFx0XHQkZmlyc3RDaGlsZC5yZW1vdmUoKTtcblx0XHRcdFx0XHRcdCQoZS5ub2RlKS5hcHBlbmQoICR1cGxvYWRCb3ggKTtcblx0XHRcdFx0XHR9XG5cdFx0XHRcdH1cblx0XHRcdH0pXG5cdFx0XHQ7XG5cblx0fTtcblxuXHR0aW55bWNlLlBsdWdpbk1hbmFnZXIuYWRkKCAndGhlcGFzdGUnLCB0aGVwYXN0ZVBsdWdpbkNhbGxiYWNrICk7XG5cbn0gKShqUXVlcnkpO1xuIl19 
  • the-paste/trunk/js/admin/the-paste.js

    r1760781 r1760790  
    412412        view:{}, 
    413413 
    414         insertImage:function( dataURL, type, editor ) { 
    415             var id = '__thepaste_img_'+(counter++), 
    416                 imageHtml = '<img id="'+id+'" class="alignnone size-full" src="'+dataURL+'" />', 
    417                 $container; 
    418  
    419  
    420             editor.insertContent( imageHtml ); 
    421  
    422             return editor.$('#'+id)[0]; 
    423         }, 
    424  
    425         uploadImage: function( image, editor ) { 
     414        uploadImage: function( image, editor, upload_placeholder ) { 
     415 
     416            var id = '__thepaste_box_'+(counter++), 
     417                $container = $(image) 
     418                    .wrap('<div id="'+id+'" data-progress="0" class="thepaste-image-placeholder" contenteditable="false"></div>') 
     419                    .parent(); 
     420 
     421                // set $container size once known 
     422                image.onload = function() { 
     423                    $( editor.$('#'+id) ).width( this.naturalWidth ); 
     424                    $( editor.$('#'+id) ).height( this.naturalHeight ); 
     425                } 
    426426 
    427427            var xhr, 
    428428                workflow, 
    429                 $container, 
    430429                src = image.src, 
    431430                upload = function( dataURL ){ 
    432                     var id = '__thepaste_box_'+(counter++), 
    433                         type = dataURL.match(/^data\:([^\;]+)\;/)[1] 
     431                    var type = dataURL.match(/^data\:([^\;]+)\;/)[1] 
    434432                        file = new o.Blob( null, { data: dataURL } ) 
    435433                        suffix = thepaste.options.mime_types.convert[ type ]; 
    436434                    if ( 'undefined' === typeof suffix ) { 
    437                         console.trace( 'bad type: ' + type ); 
     435                        console.trace( 'Won\'t upload, bad mime type: ' + type ); 
    438436                    } 
    439                     $(image).wrap('<div id="'+id+'" data-progress="0" class="thepaste-image-placeholder" contenteditable="false"></div>'); 
    440                     $container = editor.$('#'+id); 
    441437 
    442438                    file.name = thepaste.l10n.pasted + '.' + suffix; 
     
    466462                    } 
    467463                    workflow.uploader.uploader.uploader.bind('UploadProgress',function( e ){ 
    468                         $container.attr('data-progress',e.total.percent); 
     464                        editor.$('#'+id).attr('data-progress',e.total.percent); 
    469465                    }); 
    470466                    workflow.uploader.uploader.uploader.bind('FileUploaded',function( up, args ){ 
    471                         var imgHTML = '<img class="alignnone wp-image-'+args.attachment.id+' size-full" src="'+args.attachment.changed.url+'" />'; 
     467 
     468                        var $container = editor.$('#'+id), 
     469                            imgHTML = '<img class="alignnone wp-image-'+args.attachment.id+' size-full" src="'+args.attachment.changed.url+'" />'; 
     470 
    472471                        // replace image 
    473472                        $container.replaceWith( imgHTML ); 
     473 
    474474                        // replace other instances 
    475475                        editor.$('img[src="'+src+'"]').each(function(){ 
     
    502502                upload( src ); 
    503503            } 
    504  
     504            return $container; 
    505505        }, 
    506506 
     
    708708        $discardBtn : null, 
    709709        $uploadBtn : null, 
    710          
     710 
    711711        uploader : null, 
    712          
     712 
    713713        events : { 
    714714            'click [data-action="upload"]'  : 'uploadImage', 
     
    739739                format = this.options.defaultFileFormat; 
    740740            } 
    741              
     741 
    742742            if ( this.image ) { 
    743743                this.image.destroy(); 
     
    908908        template: wp.template('thepaste-grabber'), 
    909909        className : 'thepaste-grabber', 
    910          
     910 
    911911        grabber : null, 
    912912        uploader : null, 
    913          
     913 
    914914        initialize : function() { 
    915915            var ret = wp.media.View.prototype.initialize.apply( this, arguments ); 
     
    919919                defaultFileName : l10n.pasted, 
    920920                defaultFileFormat : 'image/png', 
    921                 title           : l10n.copy_paste  
     921                title           : l10n.copy_paste 
    922922            }); 
    923923 
    924924            this.grabber  = new this.options.grabber( { controller  : this.controller } ); 
    925925 
    926             this.uploader = new wp.media.thepaste.view.DataSourceImageUploader( {    
     926            this.uploader = new wp.media.thepaste.view.DataSourceImageUploader( { 
    927927                                    controller          : this.controller, 
    928928                                    uploder             : this.options.wpuploader, 
  • the-paste/trunk/js/admin/the-paste.min.js

    r1760781 r1760790  
    1 (function(){var e,t,a,i,n;e=window.jQuery,e.paste=function(e){var a;return"undefined"!=typeof console&&null!==console&&console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead."),a=t.mountNonInputable(e),a._container},e.fn.pastableNonInputable=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is("textarea, input:text, [contenteditable]")||(t.mountNonInputable(a),a._pastable=!0);return this},e.fn.pastableTextarea=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is(":not(textarea, input:text)")||(t.mountTextarea(a),a._pastable=!0);return this},e.fn.pastableContenteditable=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is(":not([contenteditable])")||(t.mountContenteditable(a),a._pastable=!0);return this},i=function(e,t){var a,i,n,r,o,s,l,p,d,u,c;if(null==t&&(t=512),!(p=e.match(/^data\:([^\;]+)\;base64\,(.+)$/)))return null;for(u=p,p=u[0],s=u[1],a=u[2],r=atob(a),n=[],d=0;d<r.length;){for(c=r.slice(d,d+t),o=new Array(c.length),l=0;l<c.length;)o[l]=c.charCodeAt(l),l++;i=new Uint8Array(o),n.push(i),d+=t}return new Blob(n,{type:s})},a=function(){return e(document.createElement("div")).attr("contenteditable",!0).attr("aria-hidden",!0).attr("tabindex",-1).css({width:1,height:1,position:"fixed",left:-100,overflow:"hidden"})},n=function(t,a){var i,n,r,o,s,l;return o=void 0,s=void 0,r=void 0,n=void 0,i=void 0,"area"===(l=t.nodeName.toLowerCase())?(o=t.parentNode,s=o.name,!(!t.href||!s||"map"!==o.nodeName.toLowerCase())&&(r=e("img[usemap='#"+s+"']"),r.length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(l)?(n=!t.disabled)&&(i=e(t).closest("fieldset")[0])&&(n=!i.disabled):n="a"===l?t.href||a:a,(n=n||e(t).is("[contenteditable]"))&&e(t).is(":visible"))},t=function(){function t(t,a){this._container=t,this._target=a,this._container=e(this._container),this._target=e(this._target).addClass("pastable"),this._container.on("paste",function(e){return function(t){var a,i,n,r,o,s,l,p,d,u,c,h,g;if(t.currentTarget!==t.target)return t.preventDefault();if(e._paste_event_fired=!0,null!=(null!=(d=t.originalEvent)?d.clipboardData:void 0))if(a=t.originalEvent.clipboardData,a.items)for(u=a.items,r=0,s=u.length;r<s;r++){if(n=u[r],n.type.match(/^image\//)){p=new FileReader,p.onload=function(t){return e._handleImage(t.target.result)};try{p.readAsDataURL(n.getAsFile())}catch(e){}t.preventDefault();break}"text/plain"===n.type&&n.getAsString(function(t){return e._target.trigger("pasteText",{text:t})})}else-1!==Array.prototype.indexOf.call(a.types,"text/plain")&&(g=a.getData("Text"),setTimeout(function(){return e._target.trigger("pasteText",{text:g})},1)),e._checkImagesInContainer(function(t){return e._handleImage(t)});if(a=window.clipboardData)if(null!=(c=g=a.getData("Text"))?c.length:void 0)setTimeout(function(){return e._target.trigger("pasteText",{text:g}),e._target.trigger("_pasteCheckContainerDone")},1);else{for(h=a.files,o=0,l=h.length;o<l;o++)i=h[o],e._handleImage(URL.createObjectURL(i));e._checkImagesInContainer(function(e){})}return null}}(this))}return t.prototype._target=null,t.prototype._container=null,t.mountNonInputable=function(i){var r;return r=new t(a().appendTo(i),i),e(i).on("click",function(e){return function(e){if(!n(e.target,!1))return r._container.focus()}}()),r._container.on("focus",function(t){return function(){return e(i).addClass("pastable-focus")}}()),r._container.on("blur",function(t){return function(){return e(i).removeClass("pastable-focus")}}())},t.mountTextarea=function(i){var n,r,o,s;return("undefined"!=typeof DataTransfer&&null!==DataTransfer?DataTransfer.prototype:void 0)&&(null!=(o=Object.getOwnPropertyDescriptor)&&null!=(s=o.call(Object,DataTransfer.prototype,"items"))?s.get:void 0)?this.mountContenteditable(i):(r=new t(a().insertBefore(i),i),n=!1,e(i).on("keyup",function(e){var t;return 17!==(t=e.keyCode)&&224!==t||(n=!1),null}),e(i).on("keydown",function(t){var a;return 17!==(a=t.keyCode)&&224!==a||(n=!0),null!=t.ctrlKey&&null!=t.metaKey&&(n=t.ctrlKey||t.metaKey),n&&86===t.keyCode&&(r._textarea_focus_stolen=!0,r._container.focus(),r._paste_event_fired=!1,setTimeout(function(t){return function(){if(!r._paste_event_fired)return e(i).focus(),r._textarea_focus_stolen=!1}}(),1)),null}),e(i).on("paste",function(e){return function(){}}()),e(i).on("focus",function(t){return function(){if(!r._textarea_focus_stolen)return e(i).addClass("pastable-focus")}}()),e(i).on("blur",function(t){return function(){if(!r._textarea_focus_stolen)return e(i).removeClass("pastable-focus")}}()),e(r._target).on("_pasteCheckContainerDone",function(t){return function(){return e(i).focus(),r._textarea_focus_stolen=!1}}()),e(r._target).on("pasteText",function(t){return function(t,a){var n,r,o;return o=e(i).prop("selectionStart"),r=e(i).prop("selectionEnd"),n=e(i).val(),e(i).val(""+n.slice(0,o)+a.text+n.slice(r)),e(i)[0].setSelectionRange(o+a.text.length,o+a.text.length),e(i).trigger("change")}}()))},t.mountContenteditable=function(a){return new t(a,a),e(a).on("focus",function(t){return function(){return e(a).addClass("pastable-focus")}}()),e(a).on("blur",function(t){return function(){return e(a).removeClass("pastable-focus")}}())},t.prototype._handleImage=function(e){var t;return e.match(/^webkit\-fake\-url\:\/\//)?this._target.trigger("pasteImageError",{message:"You are trying to paste an image in Safari, however we are unable to retieve its data."}):(this._target.trigger("pasteImageStart"),t=new Image,t.crossOrigin="anonymous",t.onload=function(e){return function(){var a,n,r,o;n=document.createElement("canvas"),n.width=t.width,n.height=t.height,r=n.getContext("2d"),r.drawImage(t,0,0,n.width,n.height),o=null;try{o=n.toDataURL("image/png"),a=i(o)}catch(e){}return o&&e._target.trigger("pasteImage",{blob:a,dataURL:o,width:t.width,height:t.height}),e._target.trigger("pasteImageEnd")}}(this),t.onerror=function(t){return function(){return t._target.trigger("pasteImageError",{message:"Failed to get image from: "+e,url:e}),t._target.trigger("pasteImageEnd")}}(this),t.src=e)},t.prototype._checkImagesInContainer=function(t){var a,i,n,r,o;for(o=Math.floor(1e3*Math.random()),r=this._container.find("img"),i=0,n=r.length;i<n;i++)a=r[i],a["_paste_marked_"+o]=!0;return setTimeout(function(i){return function(){var n,r,s;for(s=i._container.find("img"),n=0,r=s.length;n<r;n++)a=s[n],a["_paste_marked_"+o]||(t(a.src),e(a).remove());return i._target.trigger("_pasteCheckContainerDone")}}(this),1)},t}()}).call(this),function(e,t){var a=(navigator.userAgent.indexOf("Chrome"),0);thepaste=t.thepaste=e.extend({supports:{paste:"paste"in document||"onpaste"in document||"object"==typeof window.onpaste||"onpaste"in document.createElement("DIV")},view:{},insertImage:function(e,t,i){var n="__thepaste_img_"+a++,r='<img id="'+n+'" class="alignnone size-full" src="'+e+'" />';return i.insertContent(r),i.$("#"+n)[0]},uploadImage:function(t,i){var n,r,s,l=t.src,p=function(n){var p="__thepaste_box_"+a++,d=n.match(/^data\:([^\;]+)\;/)[1];file=new o.Blob(null,{data:n}),suffix=thepaste.options.mime_types.convert[d],"undefined"==typeof suffix&&console.trace("bad type: "+d),e(t).wrap('<div id="'+p+'" data-progress="0" class="thepaste-image-placeholder" contenteditable="false"></div>'),s=i.$("#"+p),file.name=thepaste.l10n.pasted+"."+suffix,file.type=d;var u=function(){r.uploader.uploader.uploader.addFile(file)};r?(r.state().reset(),u()):(r=wp.media.editor.open(window.wpActiveEditor,{frame:"post",state:"insert",title:thepaste.l10n.copy_paste,multiple:!1}),r.close(),r.uploader.uploader&&r.uploader.uploader.ready?u():r.on("uploader:ready",u)),r.uploader.uploader.uploader.bind("UploadProgress",function(e){s.attr("data-progress",e.total.percent)}),r.uploader.uploader.uploader.bind("FileUploaded",function(t,a){var n='<img class="alignnone wp-image-'+a.attachment.id+' size-full" src="'+a.attachment.changed.url+'" />';s.replaceWith(n),i.$('img[src="'+l+'"]').each(function(){e(this).replaceWith(n)})}),r.uploader.uploader.uploader.bind("Error",function(e,t){console.log(e,t)})};"blob:"===l.substr(0,5)?(n=new XMLHttpRequest,n.responseType="blob",n.onreadystatechange=function(){var e;4==n.readyState&&(e=new FileReader,e.onload=function(){p(e.result)},e.readAsDataURL(new Blob([n.response],{type:"image/png"})))},n.open("GET",l),n.send(null)):"data:"===l.substr(0,5)&&p(l)},clipboardHasImage:function(t){var a=!1;return t.items?(e.each(t.items,function(e,t){if(t.type in thepaste.options.mime_types.paste)return a=!0,!1}),a):t.types?(e.each(thepaste.options.mime_types.paste,function(e,i){if(t.types.indexOf(e)>-1)return a=!0,!1}),a):null}},thepaste)}(jQuery,wp.media),function(e,t){var a=wp.media.thepaste.l10n;e.extend(wp.Uploader.prototype,{success:function(e){}}),_.extend(wp.media.view.MediaFrame.Select.prototype,{_parentInitialize:wp.media.view.MediaFrame.Select.prototype.initialize,initialize:function(){this._parentInitialize.apply(this,arguments),this.bindPasteHandlers()},_parentBrowseRouter:wp.media.view.MediaFrame.Select.prototype.browseRouter,browseRouter:function(e){this._parentBrowseRouter.apply(this,arguments),wp.media.thepaste.supports.paste&&e.set({pasteboard:{text:a.copy_paste,priority:35}})},bindPasteHandlers:function(){var e=!1;this.on("content:render close",function(t){e&&"function"==typeof e.dismiss&&e.dismiss(),void 0!==t&&(e=t)},this),this.on("content:create:pasteboard",this.contentCreatePasteboard,this),this.on("content:render:pasteboard",this.contentRenderGrabber,this),frame=this},contentCreatePasteboard:function(e){this.state();this.currentPasteView=e.view=new wp.media.thepaste.view.DataSourceImageGrabber({controller:this,grabber:wp.media.thepaste.view.Pasteboard}),this.listenTo(this.currentPasteView.uploader,"action:uploaded:dataimage",this.uploadedDataImage)},contentRenderGrabber:function(e){e.startGrabbing()},uploadedDataImage:function(e){this.stopListening(this.currentPasteView.uploader,"action:uploaded:dataimage");var t={view:null};this.browseContent(t),this.content.set(t.view),this.router.get().select("browse")}}),_.extend(wp.media.view.AttachmentsBrowser.prototype,{_parentInitialize:wp.media.view.AttachmentsBrowser.prototype.initialize,initialize:function(){var e,t=this;this._parentInitialize.apply(this,arguments),this.thepaste={paste:{grabber:!1,modal:!1,mode:"paste"},current:!1},this.controller instanceof wp.media.view.MediaFrame.Select||wp.media.thepaste.supports.paste&&(e=new wp.media.view.Button({text:a.copy_paste,className:"grabber-button",priority:-64,click:function(){t.thepaste.active=t.thepaste.paste,t.thepasteOpen(a.copy_paste)}}),this.thepaste.paste.grabber=new wp.media.thepaste.view.DataSourceImageGrabber({controller:this.controller,grabber:wp.media.thepaste.view.Pasteboard,wpuploader:this.controller.uploader.uploader.uploader}),this.toolbar.set("pasteModeButton",e.render()))},thepasteUploaded:function(e){this.thepaste.active.grabber.dismiss(),this.thepaste.modal.close(),this.thepasteClose()},thepasteError:function(e){console.log("error",e)},thepasteOpen:function(e){var t=this;this.thepaste.modal=new wp.media.view.Modal({controller:this,title:e}),this.thepaste.modal.content(this.thepaste.active.grabber),this.thepaste.modal.open(),this.thepaste.modal.on("close",function(){t.thepasteClose.apply(t),t.thepaste.active.grabber.stopGrabbing()}),this.thepaste.active.grabber.startGrabbing(),this.listenTo(this.thepaste.active.grabber.uploader,"action:uploaded:dataimage",this.thepasteUploaded),this.listenTo(this.thepaste.active.grabber.uploader,"error:uploaded:dataimage",this.thepasteError)},thepasteClose:function(){this.controller.deactivateMode(this.thepaste.active.mode).activateMode("edit"),this.stopListening(this.thepaste.active.grabber.uploader,"action:uploaded:dataimage"),this.stopListening(this.thepaste.active.grabber.uploader,"error:uploaded:dataimage")}})}(jQuery,window),function(e,t,a){var i=wp.media.thepaste,n=(wp.media.view.Button,wp.media.view.Modal,i.l10n);wp.media.thepaste.view.DataSourceImageUploader=wp.media.View.extend({template:wp.template("thepaste-uploader"),className:"thepaste-uploader",controller:null,image:null,$discardBtn:null,$uploadBtn:null,uploader:null,events:{'click [data-action="upload"]':"uploadImage",'click [data-action="discard"]':"discardImage"},initialize:function(){wp.media.View.prototype.initialize.apply(this,arguments),_.defaults(this.options,{defaultFileName:n.image});new wp.media.View({tagName:"div",className:"instruments",controller:this.controller});this.uploader=this.options.uploder},setImageData:function(e){var t=this.$imageContainer.html("").get(0),n=this,r=e.match(/data:(image\/(\w+));/)[1];return i.options.mime_types.convert[r]||(r=this.options.defaultFileFormat),this.image&&this.image.destroy(),this.image=new a.Image,this.image.onload=function(){var e=n.getUploader().getOption("resize"),a=Math.max(e.width/this.width,e.height/this.height);!!e&&a<1&&this.downsize(this.width*a,this.height*a),this.embed(t)},this.image.load(e),this.$imageContainer&&this.$imageContainer.append(this.image),this.$('[data-setting="format"] input[value="'+r+'"]').prop("checked",!0),this.disabled(!1),this},render:function(){return wp.media.View.prototype.render.apply(this,arguments),this.$imageContainer=this.$(".image-container"),this.$discardBtn=this.$('[data-action="discard"]'),this.$uploadBtn=this.$('[data-action="upload"]'),this.$('[data-setting="title"]').val(this.options.defaultFileName),this},discardImage:function(){this.trigger("action:discard:dataimage",this),this.unbindUploaderEvents()},uploadImage:function(){var e=this.$('[data-setting="format"] :checked').val(),t=i.options.mime_types.convert[e],a=this.$('input[data-setting="title"]').val()+"."+t,n=this.image.getAsBlob(e,i.options.jpeg_quality);this.bindUploaderEvents(),n.detach(n.getSource()),n.name=a,n.type=e,this.getUploader().addFile(n,a),this.disabled(!0),this.trigger("action:upload:dataimage",this)},show:function(){return this.$el.show(),this},hide:function(){return this.$el.hide(),this},disabled:function(e){this.$discardBtn.prop("disabled",e),this.$uploadBtn.prop("disabled",e)},_uploadSuccessHandler:function(){this.trigger("action:uploaded:dataimage"),this.disabled(!1),this.unbindUploaderEvents()},_uploadErrorHandler:function(){this.trigger("error:uploaded:dataimage"),this.disabled(!1),this.unbindUploaderEvents()},bindUploaderEvents:function(){this.getUploader().bind("FileUploaded",this._uploadSuccessHandler,this),this.getUploader().bind("Error",this._uploadErrorHandler,this)},unbindUploaderEvents:function(){this.getUploader().unbind("FileUploaded",this._uploadSuccessHandler,this),this.getUploader().unbind("Error",this._uploadErrorHandler,this)},getUploader:function(){return this.controller.uploader.uploader.uploader}}),wp.media.thepaste.view.Pasteboard=wp.media.View.extend({template:wp.template("thepaste-pasteboard"),className:"thepaste-pasteboard",controller:null,action:"paste",$pasteboard:null,render:function(){var e=this;return wp.media.View.prototype.render.apply(this,arguments),this.$pasteboard=this.$(".injector").pastableContenteditable(),this.$message=this.$(".message"),this.$pasteboard.on("click",function(){e.show_message("")}),this},start:function(){var t,a=this;return this.imagePasted=!1,this.$pasteboard.on("paste",function(e){t=wp.media.thepaste.clipboardHasImage(e.originalEvent.clipboardData)}).on("pasteText",function(i,r){t||a.imagePasted||(a.show_message(n.paste_error_no_image),e(this).html(""))}).on("pasteImage",function(e,t){a.imagePasted||(a.trigger("action:create:dataimage",this,t.dataURL),a.imagePasted=!0)}).on("pasteImageError",function(t,i){a.show_message(n.paste_error),e(this).html("")}),setTimeout(function(){a.$pasteboard.get(0).focus()},1),this},stop:function(){return this.$pasteboard.off("pasteImage").off("pasteImageError").off("pasteText"),this},show:function(){return this.$el.show(),this},hide:function(){return this.$el.hide(),this},show_message:function(e){this.$message.text(e)}}),wp.media.thepaste.view.DataSourceImageGrabber=wp.media.View.extend({template:wp.template("thepaste-grabber"),className:"thepaste-grabber",grabber:null,uploader:null,initialize:function(){var e=wp.media.View.prototype.initialize.apply(this,arguments);return _.defaults(this.options,{wpuploader:null,defaultFileName:n.pasted,defaultFileFormat:"image/png",title:n.copy_paste}),this.grabber=new this.options.grabber({controller:this.controller}),this.uploader=new wp.media.thepaste.view.DataSourceImageUploader({controller:this.controller,uploder:this.options.wpuploader,defaultFileName:this.options.defaultFileName,defaultFileFormat:this.options.defaultFileFormat}),this.render(),this.listenTo(this.grabber,"action:create:dataimage",this.imageCreated),this.listenTo(this.uploader,"action:discard:dataimage",this.startGrabbing),e},render:function(){return wp.media.View.prototype.render.apply(this,arguments),this.$(".content").append(this.grabber.render().$el).append(this.uploader.render().$el),this},imageCreated:function(e,t){this.grabber.stop().hide(),this.uploader.show().setImageData(t)},startGrabbing:function(){return this.uploader.hide(),this.grabber.show().start(),this},stopGrabbing:function(){return this.grabber.stop(),this},getAction:function(){return this.grabber.action},dismiss:function(){return this.grabber.stop(),this}})}(jQuery,window,mOxie); 
    2 //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRoZS1wYXN0ZS5qcyJdLCJuYW1lcyI6WyIkIiwiUGFzdGUiLCJjcmVhdGVIaWRkZW5FZGl0YWJsZSIsImRhdGFVUkx0b0Jsb2IiLCJpc0ZvY3VzYWJsZSIsIndpbmRvdyIsImpRdWVyeSIsInBhc3RlIiwicGFzdGVDb250YWluZXIiLCJwbSIsImNvbnNvbGUiLCJsb2ciLCJtb3VudE5vbklucHV0YWJsZSIsIl9jb250YWluZXIiLCJmbiIsInBhc3RhYmxlTm9uSW5wdXRhYmxlIiwiZWwiLCJqIiwibGVuIiwicmVmIiwidGhpcyIsImxlbmd0aCIsIl9wYXN0YWJsZSIsImlzIiwicGFzdGFibGVUZXh0YXJlYSIsIm1vdW50VGV4dGFyZWEiLCJwYXN0YWJsZUNvbnRlbnRlZGl0YWJsZSIsIm1vdW50Q29udGVudGVkaXRhYmxlIiwiZGF0YVVSTCIsInNsaWNlU2l6ZSIsImI2NERhdGEiLCJieXRlQXJyYXkiLCJieXRlQXJyYXlzIiwiYnl0ZUNoYXJhY3RlcnMiLCJieXRlTnVtYmVycyIsImNvbnRlbnRUeXBlIiwiaSIsIm0iLCJvZmZzZXQiLCJzbGljZSIsIm1hdGNoI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uICAgICAgfSk7XG4gICAgICAkKHRleHRhcmVhKS5vbigna2V5ZG93bicsIGZ1bmN0aW9uKGV2KSB7XG4gICAgICAgIHZhciByZWYyO1xuICAgICAgICBpZiAoKHJlZjIgPSBldi5rZXlDb2RlKSA9PT0gMTcgfHwgcmVmMiA9PT0gMjI0KSB7XG4gICAgICAgICAgY3RsRG93biA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKChldi5jdHJsS2V5ICE9IG51bGwpICYmIChldi5tZXRhS2V5ICE9IG51bGwpKSB7XG4gICAgICAgICAgY3RsRG93biA9IGV2LmN0cmxLZXkgfHwgZXYubWV0YUtleTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY3RsRG93biAmJiBldi5rZXlDb2RlID09PSA4Nikge1xuICAgICAgICAgIHBhc3RlLl90ZXh0YXJlYV9mb2N1c19zdG9sZW4gPSB0cnVlO1xuICAgICAgICAgIHBhc3RlLl9jb250YWluZXIuZm9jdXMoKTtcbiAgICAgICAgICBwYXN0ZS5fcGFzdGVfZXZlbnRfZmlyZWQgPSBmYWxzZTtcbiAgICAgICAgICBzZXRUaW1lb3V0KChmdW5jdGlvbihfdGhpcykge1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAoIXBhc3RlLl9wYXN0ZV9ldmVudF9maXJlZCkge1xuICAgICAgICAgICAgICAgICQodGV4dGFyZWEpLmZvY3VzKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhc3RlLl90ZXh0YXJlYV9mb2N1c19zdG9sZW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KSh0aGlzKSwgMSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICB9KTtcbiAgICAgICQodGV4dGFyZWEpLm9uKCdwYXN0ZScsIChmdW5jdGlvbihfdGhpcykge1xuICAgICAgICByZXR1cm4gZ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tcbiAgICAgICAgICAgIGlmIChjbGlwYm9hcmREYXRhLml0ZW1zKSB7XG4gICAgICAgICAgICAgIHJlZjEgPSBjbGlwYm9hcmREYXRhLml0ZW1zO1xuICAgICAgICAgICAgICBmb3IgKGogPSAwLCBsZW4gPSByZWYxLmxlbmd0aDsgaiA8IGxlbjsgaisrKSB7XG4gICAgICAgICAgICAgICAgaXRlbSA9IHJlZjFbal07XG4gICAgICAgICAgICAgICAgaWYgKGl0ZW0udHlwZS5tYXRjaCgvXmltYWdlXFwvLykpIHtcbiAgICAgICAgICAgICAgICAgIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKCk7XG4gICAgICAgICAgICAgICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl9oYW5kbGVJbWFnZShldmVudC50YXJnZXQucmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICByZWFkZXIucmVhZEFzRGF0YVVSTChpdGVtLmdldEFzRmlsZSgpKTtcbiAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7fVxuICAgICAgICAgICAgICAgICAgZXYucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXRlbS50eXBlID09PSAndGV4dC9wbGFpbicpIHtcbiAgICAgICAgICAgICAgICAgIGl0ZW0uZ2V0QXNTdHJpbmcoZnVuY3Rpb24oc3RyaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ3Bhc3RlVGV4dCcsIHtcbiAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiBzdHJpbmdcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmICgtMSAhPT0gQXJyYXkucHJvdG90eXBlLmluZGV4T2YuY2FsbChjbGlwYm9hcmREYXRhLnR5cGVzLCAndGV4dC9wbGFpbicpKSB7XG4gICAgICAgICAgICAgICAgdGV4dCA9IGNsaXBib2FyZERhdGEuZ2V0RGF0YSgnVGV4dCcpO1xuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX3RhcmdldC50cmlnZ2VyKCdwYXN0ZVRleHQnLCB7XG4gICAgICAgICAgICAgICAgICAgIHRleHQ6IHRleHRcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0sIDEpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIF90aGlzLl9jaGVja0ltYWdlc0luQ29udGFpbmVyKGZ1bmN0aW9uKHNyYykge1xuICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5faGFuZGxlSW1hZ2Uoc3JjKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChjbGlwYm9hcmREYXRhID0gd2luZG93LmNsaXBib2FyZERhdGEpIHtcbiAgICAgICAgICAgIGlmICgocmVmMiA9ICh0ZXh0ID0gY2xpcGJvYXJkRGF0YS5nZXREYXRhKCdUZXh0JykpKSAhPSBudWxsID8gcmVmMi5sZW5ndGggOiB2b2lkIDApIHtcbiAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ3Bhc3RlVGV4dCcsIHtcbiAgICAgICAgICAgICAgICAgIHRleHQ6IHRleHRcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX3RhcmdldC50cmlnZ2VyKCdfcGFzdGVDaGVja0NvbnRhaW5lckRvbmUnKTtcbiAgICAgICAgICAgICAgfSwgMSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZWYzID0gY2xpcGJvYXJkRGF0YS5maWxlcztcbiAgICAgICAgICAgICAgZm9yIChrID0gMCwgbGVuMSA9IHJlZjMubGVuZ3RoOyBrIDwgbGVuMTsgaysrKSB7XG4gICAgICAgICAgICAgICAgZmlsZSA9IHJlZjNba107XG4gICAgICAgICAgICAgICAgX3RoaXMuX2hhbmRsZUltYWdlKFVSTC5jcmVhdGVPYmplY3RVUkwoZmlsZSkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIF90aGlzLl9jaGVja0ltYWdlc0luQ29udGFpbmVyKGZ1bmN0aW9uKHNyYykge30pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfTtcbiAgICAgIH0pKHRoaXMpKTtcbiAgICB9XG5cbiAgICBQYXN0ZS5wcm90b3R5cGUuX2hhbmRsZUltYWdlID0gZnVuY3Rpb24oc3JjKSB7XG4gICAgICB2YXIgbG9hZGVyO1xuICAgICAgaWYgKHNyYy5tYXRjaCgvXndlYmtpdFxcLWZha2VcXC11cmxcXDpcXC9cXC8vKSkge1xuICAgICAgICByZXR1cm4gdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ3Bhc3RlSW1hZ2VFcnJvcicsIHtcbiAgICAgICAgICBtZXNzYWdlOiBcIllvdSBhcmUgdHJ5aW5nIHRvIHBhc3RlIGFuIGltYWdlIGluIFNhZmFyaSwgaG93ZXZlciB3ZSBhcmUgdW5hYmxlIHRvIHJldGlldmUgaXRzIGRhdGEuXCJcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICB0aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVJbWFnZVN0YXJ0Jyk7XG4gICAgICBsb2FkZXIgPSBuZXcgSW1hZ2UoKTtcbiAgICAgIGxvYWRlci5jcm9zc09yaWdpbiA9IFwiYW5vbnltb3VzXCI7XG4gICAgICBsb2FkZXIub25sb2FkID0gKGZ1bmN0aW9uKF90aGlzKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgYmxvYiwgY2FudmFzLCBjdHgsIGRhdGFVUkw7XG4gICAgICAgICAgY2FudmFzID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgICAgY2FudmFzLndpZHRoID0gbG9hZGVyLndpZHRoO1xuICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSBsb2FkZXIuaGVpZ2h0O1xuICAgICAgICAgIGN0eCA9IGNhbnZhcy5nZXRDb250ZXh0KCcyZCcpO1xuICAgICAgICAgIGN0eC5kcmF3SW1hZ2UobG9hZGVyLCAwLCAwLCBjYW52YXMud2lkdGgsIGNhbnZhcy5oZWlnaHQpO1xuICAgICAgICAgIGRhdGFVUkwgPSBudWxsO1xuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICBkYXRhVVJMID0gY2FudmFzLnRvRGF0YVVSTCgnaW1hZ2UvcG5nJyk7XG4gICAgICAgICAgICBibG9iID0gZGF0YVVSTHRvQmxvYihkYXRhVVJMKTtcbiAgICAgICAgICB9IGNhdGNoIChlcnJvcikge31cbiAgICAgICAgICBpZiAoZGF0YVVSTCkge1xuICAgICAgICAgICAgX3RoaXMuX3RhcmdldC50cmlnZ2VyKCdwYXN0ZUltYWdlJywge1xuICAgICAgICAgICAgICBibG9iOiBibG9iLFxuICAgICAgICAgICAgICBkYXRhVVJMOiBkYXRhVVJMLFxuICAgICAgICAgICAgICB3aWR0aDogbG9hZGVyLndpZHRoLFxuICAgICAgICAgICAgICBoZWlnaHQ6IGxvYWRlci5oZWlnaHRcbiAgICAgICAgICAgIH0p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RvdyxtT3hpZSk7XG4iXX0= 
     1(function(){var e,t,a,i,n;e=window.jQuery,e.paste=function(e){var a;return"undefined"!=typeof console&&null!==console&&console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead."),a=t.mountNonInputable(e),a._container},e.fn.pastableNonInputable=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is("textarea, input:text, [contenteditable]")||(t.mountNonInputable(a),a._pastable=!0);return this},e.fn.pastableTextarea=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is(":not(textarea, input:text)")||(t.mountTextarea(a),a._pastable=!0);return this},e.fn.pastableContenteditable=function(){var a,i,n,r;for(r=this,i=0,n=r.length;i<n;i++)a=r[i],a._pastable||e(a).is(":not([contenteditable])")||(t.mountContenteditable(a),a._pastable=!0);return this},i=function(e,t){var a,i,n,r,o,s,l,p,d,u,h;if(null==t&&(t=512),!(p=e.match(/^data\:([^\;]+)\;base64\,(.+)$/)))return null;for(u=p,p=u[0],s=u[1],a=u[2],r=atob(a),n=[],d=0;d<r.length;){for(h=r.slice(d,d+t),o=new Array(h.length),l=0;l<h.length;)o[l]=h.charCodeAt(l),l++;i=new Uint8Array(o),n.push(i),d+=t}return new Blob(n,{type:s})},a=function(){return e(document.createElement("div")).attr("contenteditable",!0).attr("aria-hidden",!0).attr("tabindex",-1).css({width:1,height:1,position:"fixed",left:-100,overflow:"hidden"})},n=function(t,a){var i,n,r,o,s,l;return o=void 0,s=void 0,r=void 0,n=void 0,i=void 0,"area"===(l=t.nodeName.toLowerCase())?(o=t.parentNode,s=o.name,!(!t.href||!s||"map"!==o.nodeName.toLowerCase())&&(r=e("img[usemap='#"+s+"']"),r.length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(l)?(n=!t.disabled)&&(i=e(t).closest("fieldset")[0])&&(n=!i.disabled):n="a"===l?t.href||a:a,(n=n||e(t).is("[contenteditable]"))&&e(t).is(":visible"))},t=function(){function t(t,a){this._container=t,this._target=a,this._container=e(this._container),this._target=e(this._target).addClass("pastable"),this._container.on("paste",function(e){return function(t){var a,i,n,r,o,s,l,p,d,u,h,c,g;if(t.currentTarget!==t.target)return t.preventDefault();if(e._paste_event_fired=!0,null!=(null!=(d=t.originalEvent)?d.clipboardData:void 0))if(a=t.originalEvent.clipboardData,a.items)for(u=a.items,r=0,s=u.length;r<s;r++){if(n=u[r],n.type.match(/^image\//)){p=new FileReader,p.onload=function(t){return e._handleImage(t.target.result)};try{p.readAsDataURL(n.getAsFile())}catch(e){}t.preventDefault();break}"text/plain"===n.type&&n.getAsString(function(t){return e._target.trigger("pasteText",{text:t})})}else-1!==Array.prototype.indexOf.call(a.types,"text/plain")&&(g=a.getData("Text"),setTimeout(function(){return e._target.trigger("pasteText",{text:g})},1)),e._checkImagesInContainer(function(t){return e._handleImage(t)});if(a=window.clipboardData)if(null!=(h=g=a.getData("Text"))?h.length:void 0)setTimeout(function(){return e._target.trigger("pasteText",{text:g}),e._target.trigger("_pasteCheckContainerDone")},1);else{for(c=a.files,o=0,l=c.length;o<l;o++)i=c[o],e._handleImage(URL.createObjectURL(i));e._checkImagesInContainer(function(e){})}return null}}(this))}return t.prototype._target=null,t.prototype._container=null,t.mountNonInputable=function(i){var r;return r=new t(a().appendTo(i),i),e(i).on("click",function(e){return function(e){if(!n(e.target,!1))return r._container.focus()}}()),r._container.on("focus",function(t){return function(){return e(i).addClass("pastable-focus")}}()),r._container.on("blur",function(t){return function(){return e(i).removeClass("pastable-focus")}}())},t.mountTextarea=function(i){var n,r,o,s;return("undefined"!=typeof DataTransfer&&null!==DataTransfer?DataTransfer.prototype:void 0)&&(null!=(o=Object.getOwnPropertyDescriptor)&&null!=(s=o.call(Object,DataTransfer.prototype,"items"))?s.get:void 0)?this.mountContenteditable(i):(r=new t(a().insertBefore(i),i),n=!1,e(i).on("keyup",function(e){var t;return 17!==(t=e.keyCode)&&224!==t||(n=!1),null}),e(i).on("keydown",function(t){var a;return 17!==(a=t.keyCode)&&224!==a||(n=!0),null!=t.ctrlKey&&null!=t.metaKey&&(n=t.ctrlKey||t.metaKey),n&&86===t.keyCode&&(r._textarea_focus_stolen=!0,r._container.focus(),r._paste_event_fired=!1,setTimeout(function(t){return function(){if(!r._paste_event_fired)return e(i).focus(),r._textarea_focus_stolen=!1}}(),1)),null}),e(i).on("paste",function(e){return function(){}}()),e(i).on("focus",function(t){return function(){if(!r._textarea_focus_stolen)return e(i).addClass("pastable-focus")}}()),e(i).on("blur",function(t){return function(){if(!r._textarea_focus_stolen)return e(i).removeClass("pastable-focus")}}()),e(r._target).on("_pasteCheckContainerDone",function(t){return function(){return e(i).focus(),r._textarea_focus_stolen=!1}}()),e(r._target).on("pasteText",function(t){return function(t,a){var n,r,o;return o=e(i).prop("selectionStart"),r=e(i).prop("selectionEnd"),n=e(i).val(),e(i).val(""+n.slice(0,o)+a.text+n.slice(r)),e(i)[0].setSelectionRange(o+a.text.length,o+a.text.length),e(i).trigger("change")}}()))},t.mountContenteditable=function(a){return new t(a,a),e(a).on("focus",function(t){return function(){return e(a).addClass("pastable-focus")}}()),e(a).on("blur",function(t){return function(){return e(a).removeClass("pastable-focus")}}())},t.prototype._handleImage=function(e){var t;return e.match(/^webkit\-fake\-url\:\/\//)?this._target.trigger("pasteImageError",{message:"You are trying to paste an image in Safari, however we are unable to retieve its data."}):(this._target.trigger("pasteImageStart"),t=new Image,t.crossOrigin="anonymous",t.onload=function(e){return function(){var a,n,r,o;n=document.createElement("canvas"),n.width=t.width,n.height=t.height,r=n.getContext("2d"),r.drawImage(t,0,0,n.width,n.height),o=null;try{o=n.toDataURL("image/png"),a=i(o)}catch(e){}return o&&e._target.trigger("pasteImage",{blob:a,dataURL:o,width:t.width,height:t.height}),e._target.trigger("pasteImageEnd")}}(this),t.onerror=function(t){return function(){return t._target.trigger("pasteImageError",{message:"Failed to get image from: "+e,url:e}),t._target.trigger("pasteImageEnd")}}(this),t.src=e)},t.prototype._checkImagesInContainer=function(t){var a,i,n,r,o;for(o=Math.floor(1e3*Math.random()),r=this._container.find("img"),i=0,n=r.length;i<n;i++)a=r[i],a["_paste_marked_"+o]=!0;return setTimeout(function(i){return function(){var n,r,s;for(s=i._container.find("img"),n=0,r=s.length;n<r;n++)a=s[n],a["_paste_marked_"+o]||(t(a.src),e(a).remove());return i._target.trigger("_pasteCheckContainerDone")}}(this),1)},t}()}).call(this),function(e,t){var a=(navigator.userAgent.indexOf("Chrome"),0);thepaste=t.thepaste=e.extend({supports:{paste:"paste"in document||"onpaste"in document||"object"==typeof window.onpaste||"onpaste"in document.createElement("DIV")},view:{},uploadImage:function(t,i,n){var r="__thepaste_box_"+a++,s=e(t).wrap('<div id="'+r+'" data-progress="0" class="thepaste-image-placeholder" contenteditable="false"></div>').parent();t.onload=function(){e(i.$("#"+r)).width(this.naturalWidth),e(i.$("#"+r)).height(this.naturalHeight)};var l,p,d=t.src,u=function(t){var a=t.match(/^data\:([^\;]+)\;/)[1];file=new o.Blob(null,{data:t}),suffix=thepaste.options.mime_types.convert[a],"undefined"==typeof suffix&&console.trace("Won't upload, bad mime type: "+a),file.name=thepaste.l10n.pasted+"."+suffix,file.type=a;var n=function(){p.uploader.uploader.uploader.addFile(file)};p?(p.state().reset(),n()):(p=wp.media.editor.open(window.wpActiveEditor,{frame:"post",state:"insert",title:thepaste.l10n.copy_paste,multiple:!1}),p.close(),p.uploader.uploader&&p.uploader.uploader.ready?n():p.on("uploader:ready",n)),p.uploader.uploader.uploader.bind("UploadProgress",function(e){i.$("#"+r).attr("data-progress",e.total.percent)}),p.uploader.uploader.uploader.bind("FileUploaded",function(t,a){var n=i.$("#"+r),o='<img class="alignnone wp-image-'+a.attachment.id+' size-full" src="'+a.attachment.changed.url+'" />';n.replaceWith(o),i.$('img[src="'+d+'"]').each(function(){e(this).replaceWith(o)})}),p.uploader.uploader.uploader.bind("Error",function(e,t){console.log(e,t)})};return"blob:"===d.substr(0,5)?(l=new XMLHttpRequest,l.responseType="blob",l.onreadystatechange=function(){var e;4==l.readyState&&(e=new FileReader,e.onload=function(){u(e.result)},e.readAsDataURL(new Blob([l.response],{type:"image/png"})))},l.open("GET",d),l.send(null)):"data:"===d.substr(0,5)&&u(d),s},clipboardHasImage:function(t){var a=!1;return t.items?(e.each(t.items,function(e,t){if(t.type in thepaste.options.mime_types.paste)return a=!0,!1}),a):t.types?(e.each(thepaste.options.mime_types.paste,function(e,i){if(t.types.indexOf(e)>-1)return a=!0,!1}),a):null}},thepaste)}(jQuery,wp.media),function(e,t){var a=wp.media.thepaste.l10n;e.extend(wp.Uploader.prototype,{success:function(e){}}),_.extend(wp.media.view.MediaFrame.Select.prototype,{_parentInitialize:wp.media.view.MediaFrame.Select.prototype.initialize,initialize:function(){this._parentInitialize.apply(this,arguments),this.bindPasteHandlers()},_parentBrowseRouter:wp.media.view.MediaFrame.Select.prototype.browseRouter,browseRouter:function(e){this._parentBrowseRouter.apply(this,arguments),wp.media.thepaste.supports.paste&&e.set({pasteboard:{text:a.copy_paste,priority:35}})},bindPasteHandlers:function(){var e=!1;this.on("content:render close",function(t){e&&"function"==typeof e.dismiss&&e.dismiss(),void 0!==t&&(e=t)},this),this.on("content:create:pasteboard",this.contentCreatePasteboard,this),this.on("content:render:pasteboard",this.contentRenderGrabber,this),frame=this},contentCreatePasteboard:function(e){this.state();this.currentPasteView=e.view=new wp.media.thepaste.view.DataSourceImageGrabber({controller:this,grabber:wp.media.thepaste.view.Pasteboard}),this.listenTo(this.currentPasteView.uploader,"action:uploaded:dataimage",this.uploadedDataImage)},contentRenderGrabber:function(e){e.startGrabbing()},uploadedDataImage:function(e){this.stopListening(this.currentPasteView.uploader,"action:uploaded:dataimage");var t={view:null};this.browseContent(t),this.content.set(t.view),this.router.get().select("browse")}}),_.extend(wp.media.view.AttachmentsBrowser.prototype,{_parentInitialize:wp.media.view.AttachmentsBrowser.prototype.initialize,initialize:function(){var e,t=this;this._parentInitialize.apply(this,arguments),this.thepaste={paste:{grabber:!1,modal:!1,mode:"paste"},current:!1},this.controller instanceof wp.media.view.MediaFrame.Select||wp.media.thepaste.supports.paste&&(e=new wp.media.view.Button({text:a.copy_paste,className:"grabber-button",priority:-64,click:function(){t.thepaste.active=t.thepaste.paste,t.thepasteOpen(a.copy_paste)}}),this.thepaste.paste.grabber=new wp.media.thepaste.view.DataSourceImageGrabber({controller:this.controller,grabber:wp.media.thepaste.view.Pasteboard,wpuploader:this.controller.uploader.uploader.uploader}),this.toolbar.set("pasteModeButton",e.render()))},thepasteUploaded:function(e){this.thepaste.active.grabber.dismiss(),this.thepaste.modal.close(),this.thepasteClose()},thepasteError:function(e){console.log("error",e)},thepasteOpen:function(e){var t=this;this.thepaste.modal=new wp.media.view.Modal({controller:this,title:e}),this.thepaste.modal.content(this.thepaste.active.grabber),this.thepaste.modal.open(),this.thepaste.modal.on("close",function(){t.thepasteClose.apply(t),t.thepaste.active.grabber.stopGrabbing()}),this.thepaste.active.grabber.startGrabbing(),this.listenTo(this.thepaste.active.grabber.uploader,"action:uploaded:dataimage",this.thepasteUploaded),this.listenTo(this.thepaste.active.grabber.uploader,"error:uploaded:dataimage",this.thepasteError)},thepasteClose:function(){this.controller.deactivateMode(this.thepaste.active.mode).activateMode("edit"),this.stopListening(this.thepaste.active.grabber.uploader,"action:uploaded:dataimage"),this.stopListening(this.thepaste.active.grabber.uploader,"error:uploaded:dataimage")}})}(jQuery,window),function(e,t,a){var i=wp.media.thepaste,n=(wp.media.view.Button,wp.media.view.Modal,i.l10n);wp.media.thepaste.view.DataSourceImageUploader=wp.media.View.extend({template:wp.template("thepaste-uploader"),className:"thepaste-uploader",controller:null,image:null,$discardBtn:null,$uploadBtn:null,uploader:null,events:{'click [data-action="upload"]':"uploadImage",'click [data-action="discard"]':"discardImage"},initialize:function(){wp.media.View.prototype.initialize.apply(this,arguments),_.defaults(this.options,{defaultFileName:n.image});new wp.media.View({tagName:"div",className:"instruments",controller:this.controller});this.uploader=this.options.uploder},setImageData:function(e){var t=this.$imageContainer.html("").get(0),n=this,r=e.match(/data:(image\/(\w+));/)[1];return i.options.mime_types.convert[r]||(r=this.options.defaultFileFormat),this.image&&this.image.destroy(),this.image=new a.Image,this.image.onload=function(){var e=n.getUploader().getOption("resize"),a=Math.max(e.width/this.width,e.height/this.height);!!e&&a<1&&this.downsize(this.width*a,this.height*a),this.embed(t)},this.image.load(e),this.$imageContainer&&this.$imageContainer.append(this.image),this.$('[data-setting="format"] input[value="'+r+'"]').prop("checked",!0),this.disabled(!1),this},render:function(){return wp.media.View.prototype.render.apply(this,arguments),this.$imageContainer=this.$(".image-container"),this.$discardBtn=this.$('[data-action="discard"]'),this.$uploadBtn=this.$('[data-action="upload"]'),this.$('[data-setting="title"]').val(this.options.defaultFileName),this},discardImage:function(){this.trigger("action:discard:dataimage",this),this.unbindUploaderEvents()},uploadImage:function(){var e=this.$('[data-setting="format"] :checked').val(),t=i.options.mime_types.convert[e],a=this.$('input[data-setting="title"]').val()+"."+t,n=this.image.getAsBlob(e,i.options.jpeg_quality);this.bindUploaderEvents(),n.detach(n.getSource()),n.name=a,n.type=e,this.getUploader().addFile(n,a),this.disabled(!0),this.trigger("action:upload:dataimage",this)},show:function(){return this.$el.show(),this},hide:function(){return this.$el.hide(),this},disabled:function(e){this.$discardBtn.prop("disabled",e),this.$uploadBtn.prop("disabled",e)},_uploadSuccessHandler:function(){this.trigger("action:uploaded:dataimage"),this.disabled(!1),this.unbindUploaderEvents()},_uploadErrorHandler:function(){this.trigger("error:uploaded:dataimage"),this.disabled(!1),this.unbindUploaderEvents()},bindUploaderEvents:function(){this.getUploader().bind("FileUploaded",this._uploadSuccessHandler,this),this.getUploader().bind("Error",this._uploadErrorHandler,this)},unbindUploaderEvents:function(){this.getUploader().unbind("FileUploaded",this._uploadSuccessHandler,this),this.getUploader().unbind("Error",this._uploadErrorHandler,this)},getUploader:function(){return this.controller.uploader.uploader.uploader}}),wp.media.thepaste.view.Pasteboard=wp.media.View.extend({template:wp.template("thepaste-pasteboard"),className:"thepaste-pasteboard",controller:null,action:"paste",$pasteboard:null,render:function(){var e=this;return wp.media.View.prototype.render.apply(this,arguments),this.$pasteboard=this.$(".injector").pastableContenteditable(),this.$message=this.$(".message"),this.$pasteboard.on("click",function(){e.show_message("")}),this},start:function(){var t,a=this;return this.imagePasted=!1,this.$pasteboard.on("paste",function(e){t=wp.media.thepaste.clipboardHasImage(e.originalEvent.clipboardData)}).on("pasteText",function(i,r){t||a.imagePasted||(a.show_message(n.paste_error_no_image),e(this).html(""))}).on("pasteImage",function(e,t){a.imagePasted||(a.trigger("action:create:dataimage",this,t.dataURL),a.imagePasted=!0)}).on("pasteImageError",function(t,i){a.show_message(n.paste_error),e(this).html("")}),setTimeout(function(){a.$pasteboard.get(0).focus()},1),this},stop:function(){return this.$pasteboard.off("pasteImage").off("pasteImageError").off("pasteText"),this},show:function(){return this.$el.show(),this},hide:function(){return this.$el.hide(),this},show_message:function(e){this.$message.text(e)}}),wp.media.thepaste.view.DataSourceImageGrabber=wp.media.View.extend({template:wp.template("thepaste-grabber"),className:"thepaste-grabber",grabber:null,uploader:null,initialize:function(){var e=wp.media.View.prototype.initialize.apply(this,arguments);return _.defaults(this.options,{wpuploader:null,defaultFileName:n.pasted,defaultFileFormat:"image/png",title:n.copy_paste}),this.grabber=new this.options.grabber({controller:this.controller}),this.uploader=new wp.media.thepaste.view.DataSourceImageUploader({controller:this.controller,uploder:this.options.wpuploader,defaultFileName:this.options.defaultFileName,defaultFileFormat:this.options.defaultFileFormat}),this.render(),this.listenTo(this.grabber,"action:create:dataimage",this.imageCreated),this.listenTo(this.uploader,"action:discard:dataimage",this.startGrabbing),e},render:function(){return wp.media.View.prototype.render.apply(this,arguments),this.$(".content").append(this.grabber.render().$el).append(this.uploader.render().$el),this},imageCreated:function(e,t){this.grabber.stop().hide(),this.uploader.show().setImageData(t)},startGrabbing:function(){return this.uploader.hide(),this.grabber.show().start(),this},stopGrabbing:function(){return this.grabber.stop(),this},getAction:function(){return this.grabber.action},dismiss:function(){return this.grabber.stop(),this}})}(jQuery,window,mOxie); 
     2//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRoZS1wYXN0ZS5qcyJdLCJuYW1lcyI6WyIkIiwiUGFzdGUiLCJjcmVhdGVIaWRkZW5FZGl0YWJsZSIsImRhdGFVUkx0b0Jsb2IiLCJpc0ZvY3VzYWJsZSIsIndpbmRvdyIsImpRdWVyeSIsInBhc3RlIiwicGFzdGVDb250YWluZXIiLCJwbSIsImNvbnNvbGUiLCJsb2ciLCJtb3VudE5vbklucHV0YWJsZSIsIl9jb250YWluZXIiLCJmbiIsInBhc3RhYmxlTm9uSW5wdXRhYmxlIiwiZWwiLCJqIiwibGVuIiwicmVmIiwidGhpcyIsImxlbmd0aCIsIl9wYXN0YWJsZSIsImlzIiwicGFzdGFibGVUZXh0YXJlYSIsIm1vdW50VGV4dGFyZWEiLCJwYXN0YWJsZUNvbnRlbnRlZGl0YWJsZSIsIm1vdW50Q29udGVudGVkaXRhYmxlIiwiZGF0YVVSTCIsInNsaWNlU2l6ZSIsImI2NERhdGEiLCJieXRlQXJyYXkiLCJieXRlQXJyYXlzIiwiYnl0ZUNoYXJhY3RlcnMiLCJieXRlTnVtYmVycyIsImNvbnRlbnRUeXBlIiwiaSIsIm0iLCJvZmZzZXQiLCJzbGljZSIsIm1hdGNoIiwiYXRvYiIsIkFycmF5IiwiY2hhckNvZGVBdCIsIlVpbnQ4QXJyYXkiLCJwdXNoIiwiQmxvYiIsInR5cGUiLCJkb2N1bWVudCIsImNyZWF0ZUVsZW1lbnQiLCJhdHRyIiwiY3NzIiwid2lkdGgiLCJoZWlnaHQiLCJwb3NpdGlvbiIsImxlZnQiLCJvdmVyZmxvdyIsImVsZW1lbnQiLCJoYXNUYWJpbmRleCIsImZpZWxkc2V0IiwiZm9jdXNhYmxlSWZWaXNpYmxlIiwiaW1nIiwibWFwIiwibWFwTmFtZSIsIm5vZGVOYW1lIiwidG9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m90b3R5cGUuX3RhcmdldCA9IG51bGw7XG5cbiAgICBQYXN0ZS5wcm90b3R5cGUuX2NvbnRhaW5lciA9IG51bGw7XG5cbiAgICBQYXN0ZS5tb3VudE5vbklucHV0YWJsZSA9IGZ1bmN0aW9uKG5vbklucHV0YWJsZSkge1xuICAgICAgdmFyIHBhc3RlO1xuICAgICAgcGFzdGUgPSBuZXcgUGFzdGUoY3JlYXRlSGlkZGVuRWRpdGFibGUoKS5hcHBlbmRUbyhub25JbnB1dGFibGUpLCBub25JbnB1dGFibGUpO1xuICAgICAgJChub25JbnB1dGFibGUpLm9uKCdjbGljaycsIChmdW5jdGlvbihfdGhpcykge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24oZXYpIHtcbiAgICAgICAgICBpZiAoIWlzRm9jdXNhYmxlKGV2LnRhcmdldCwgZmFsc2UpKSB7XG4gICAgICAgICAgICByZXR1cm4gcGFzdGUuX2NvbnRhaW5lci5mb2N1cygpO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH0pKHRoaXMpKTtcbiAgICAgIHBhc3RlLl9jb250YWluZXIub24oJ2ZvY3VzJywgKGZ1bmN0aW9uKF90aGlzKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gJChub25JbnB1dGFibGUpLmFkZENsYXNzKCdwYXN0YWJsZS1mb2N1cycpO1xuICAgICAgICB9O1xuICAgICAgfSkodGhpcykpO1xuICAgICAgcmV0dXJuIHBhc3RlLl9jb250YWluZXIub24oJ2JsdXInLCAoZnVuY3Rpb24oX3RoaXMpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiAkKG5vbklucHV0YWJsZSkucmVtb3ZlQ2xhc3MoJ3Bhc3RhYmxlLWZvY3VzJyk7XG4gICAgICAgIH07XG4gICAgICB9KSh0aGlzKSk7XG4gICAgfTtcblxuICAgIFBhc3RlLm1vdW50VGV4dGFyZ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oOyBqIDwgbGVuOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpdGVtID0gcmVmMVtqXTtcbiAgICAgICAgICAgICAgICBpZiAoaXRlbS50eXBlLm1hdGNoKC9eaW1hZ2VcXC8vKSkge1xuICAgICAgICAgICAgICAgICAgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKTtcbiAgICAgICAgICAgICAgICAgIHJlYWRlci5vbmxvYWQgPSBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuX2hhbmRsZUltYWdlKGV2ZW50LnRhcmdldC5yZXN1bHQpO1xuICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHJlYWRlci5yZWFkQXNEYXRhVVJMKGl0ZW0uZ2V0QXNGaWxlKCkpO1xuICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHt9XG4gICAgICAgICAgICAgICAgICBldi5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpdGVtLnR5cGUgPT09ICd0ZXh0L3BsYWluJykge1xuICAgICAgICAgICAgICAgICAgaXRlbS5nZXRBc1N0cmluZyhmdW5jdGlvbihzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVUZXh0Jywge1xuICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IHN0cmluZ1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKC0xICE9PSBBcnJheS5wcm90b3R5cGUuaW5kZXhPZi5jYWxsKGNsaXBib2FyZERhdGEudHlwZXMsICd0ZXh0L3BsYWluJykpIHtcbiAgICAgICAgICAgICAgICB0ZXh0ID0gY2xpcGJvYXJkRGF0YS5nZXREYXRhKCdUZXh0Jyk7XG4gICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ3Bhc3RlVGV4dCcsIHtcbiAgICAgICAgICAgICAgICAgICAgdGV4dDogdGV4dFxuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSwgMSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgX3RoaXMuX2NoZWNrSW1hZ2VzSW5Db250YWluZXIoZnVuY3Rpb24oc3JjKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLl9oYW5kbGVJbWFnZShzcmMpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGNsaXBib2FyZERhdGEgPSB3aW5kb3cuY2xpcGJvYXJkRGF0YSkge1xuICAgICAgICAgICAgaWYgKChyZWYyID0gKHRleHQgPSBjbGlwYm9hcmREYXRhLmdldERhdGEoJ1RleHQnKSkpICE9IG51bGwgPyByZWYyLmxlbmd0aCA6IHZvaWQgMCkge1xuICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIF90aGlzLl90YXJnZXQudHJpZ2dlcigncGFzdGVUZXh0Jywge1xuICAgICAgICAgICAgICAgICAgdGV4dDogdGV4dFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5fdGFyZ2V0LnRyaWdnZXIoJ19wYXN0ZUNoZWNrQ29udGFpbmVyRG9uZScpO1xuICAgICAgICAgICAgICB9LCAxKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgIC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zLmdyYWJiZXIucmVuZGVyKCkuJGVsIClcblx0XHRcdFx0LmFwcGVuZCggdGhpcy51cGxvYWRlci5yZW5kZXIoKS4kZWwgKTtcblxuXHRcdFx0cmV0dXJuIHRoaXM7XG5cdFx0fSxcblx0XHRpbWFnZUNyZWF0ZWQgOiBmdW5jdGlvbiggZ3JhYmJlciAsIGltYWdlRGF0YSApIHtcblx0XHRcdHRoaXMuZ3JhYmJlci5zdG9wKCkuaGlkZSgpO1xuXHRcdFx0dGhpcy51cGxvYWRlci5zaG93KCkuc2V0SW1hZ2VEYXRhKCBpbWFnZURhdGEgKTtcblx0XHR9LFxuXHRcdHN0YXJ0R3JhYmJpbmc6ZnVuY3Rpb24oKSB7XG5cdFx0XHR0aGlzLnVwbG9hZGVyLmhpZGUoKTtcblx0XHRcdHRoaXMuZ3JhYmJlci5zaG93KCkuc3RhcnQoKTtcblx0XHRcdHJldHVybiB0aGlzO1xuXHRcdH0sXG5cdFx0c3RvcEdyYWJiaW5nOmZ1bmN0aW9uKCkge1xuXHRcdFx0dGhpcy5ncmFiYmVyLnN0b3AoKTtcblx0XHRcdHJldHVybiB0aGlzO1xuXHRcdH0sXG5cdFx0Z2V0QWN0aW9uIDogZnVuY3Rpb24oKSB7XG5cdFx0XHRyZXR1cm4gdGhpcy5ncmFiYmVyLmFjdGlvbjtcblx0XHR9LFxuXHRcdGRpc21pc3M6ZnVuY3Rpb24oKSB7XG5cdFx0XHR0aGlzLmdyYWJiZXIuc3RvcCgpO1xuXHRcdFx0cmV0dXJuIHRoaXM7XG5cdFx0fVxuXHR9KTtcblxufSkoalF1ZXJ5LHdpbmRvdyxtT3hpZSk7XG4iXX0= 
  • the-paste/trunk/readme.txt

    r1760781 r1760790  
    22Contributors: podpirate 
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=F8NKC6TCASUXE 
    4 Tags: copy & paste, paste, clipboard, image, editor, rte, tinymce, wysiwyg, media, media library, upload 
    5 Requires at least: 3.0.1 
     4Tags: paste, clipboard, image, editor, media 
     5Requires at least: 4.5.0 
    66Tested up to: 4.8.1 
    77Requires PHP: 5.3.0 
    8 Stable tag: 1.0.1 
     8Stable tag: 1.0.2 
    99License: GPLv2 or later 
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html 
    1111 
    12 Paste Images in WordPress from many applications md upload them to the media library. 
     12Paste Images in WordPress from many applications and upload them to the media library. 
    1313 
    1414== Description == 
    1515 
    16 Speed up your workflow by pasting images to the WordPress text editor. 
     16Speed up your workflow by pasting images directly to the WordPress text editor 
     17and upload them to the media library. 
    1718 
    1819Copy image data from many desktop applications: 
     
    2324* LibreOffice 
    2425* Word 
    25 * [See a detailed list](https://github.com/mcguffin/the-paste#applications-tested-so-far) 
     26* [And some more...](https://github.com/mcguffin/the-paste#applications-tested-so-far) 
    2627 
    2728The most recent Desktop versions of Chrome, Firefox, IE, Edge and Safari are supported. 
    2829 
    2930[The paste at GitHub](https://github.com/mcguffin/the-paste) 
     31 
    3032 
    3133== Installation == 
     
    4042 
    4143== Changelog == 
     44 
     45= 1.0.3 = 
     46* Performance improvements 
     47* Add Textdomain to plugin header 
    4248 
    4349= 1.0.2 = 
Note: See TracChangeset for help on using the changeset viewer.