diff options
Diffstat (limited to 'plugins/jetpack/_inc/build/custom-post-types/comics/comics.min.js')
-rw-r--r-- | plugins/jetpack/_inc/build/custom-post-types/comics/comics.min.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/plugins/jetpack/_inc/build/custom-post-types/comics/comics.min.js b/plugins/jetpack/_inc/build/custom-post-types/comics/comics.min.js index d254be55..fd1774ff 100644 --- a/plugins/jetpack/_inc/build/custom-post-types/comics/comics.min.js +++ b/plugins/jetpack/_inc/build/custom-post-types/comics/comics.min.js @@ -1,3 +1 @@ -/* Do not modify this file directly. It is compiled from other files. */ -/* global Jetpack_Comics_Options */ -jQuery(function(e){var o={init:function(){e(document).on("dragover.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDragOver),e(document).on("dragleave.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDragLeave),e(document).on("drop.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDrop),e("body").append(e('<div id="jetpack-comic-drop-zone"><p class="dragging" /><p class="uploading" /></div>')),e("#jetpack-comic-drop-zone").find(".dragging").text(Jetpack_Comics_Options.labels.dragging).end().find(".uploading").text(Jetpack_Comics_Options.labels.uploading).prepend(e('<span class="spinner"/>')),"FileReader"in window&&"File"in window||(e("#jetpack-comic-drop-zone .dragging").text(Jetpack_Comics_Options.labels.unsupported),e(document).off("drop.jetpack-comics").on("drop.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDragLeave))},filterImageFiles:function(e){for(var o=[],n=0,a=e.length;n<a;n++)e[n].type.match(/^image\//i)&&o.push(e[n]);return o},dragTimeout:null,onDragOver:function(n){n.preventDefault(),clearTimeout(o.dragTimeout),e("body").addClass("dragging")},onDragLeave:function(){clearTimeout(o.dragTimeout),o.dragTimeout=setTimeout(function(){e("body").removeClass("dragging")},100)},onDrop:function(n){n.preventDefault(),n.stopPropagation(),n.originalEvent.stopPropagation(),n.originalEvent.preventDefault();var a=o.filterImageFiles(n.originalEvent.dataTransfer.files);if(e("body").removeClass("dragging"),0!==a.length){e("body").addClass("uploading");for(var i=new FormData,t=0,r=a.length;t<r;t++)i.append("image_"+t,a[t]);e("#jetpack-comic-drop-zone .uploading .spinner").spin(),e.ajax({url:Jetpack_Comics_Options.writeURL+"&nonce="+Jetpack_Comics_Options.nonce,data:i,processData:!1,contentType:!1,type:"POST",dataType:"json",xhrFields:{withCredentials:!0}}).done(function(o){e("#jetpack-comic-drop-zone .uploading").text(Jetpack_Comics_Options.labels.processing),"url"in o?document.location.href=o.url:"error"in o&&(alert(o.error),e("body").removeClass("uploading"))}).fail(function(){alert(Jetpack_Comics_Options.labels.error)})}else alert(Jetpack_Comics_Options.labels.invalidUpload)}};o.init()});
\ No newline at end of file +jQuery((function(e){var o={init:function(){e(document).on("dragover.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDragOver),e(document).on("dragleave.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDragLeave),e(document).on("drop.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDrop),e("body").append(e('<div id="jetpack-comic-drop-zone"><p class="dragging" /><p class="uploading" /></div>')),e("#jetpack-comic-drop-zone").find(".dragging").text(Jetpack_Comics_Options.labels.dragging).end().find(".uploading").text(Jetpack_Comics_Options.labels.uploading).prepend(e('<span class="spinner"/>')),"FileReader"in window&&"File"in window||(e("#jetpack-comic-drop-zone .dragging").text(Jetpack_Comics_Options.labels.unsupported),e(document).off("drop.jetpack-comics").on("drop.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDragLeave))},filterImageFiles:function(e){for(var o=[],a=0,n=e.length;a<n;a++)e[a].type.match(/^image\//i)&&o.push(e[a]);return o},dragTimeout:null,onDragOver:function(a){a.preventDefault(),clearTimeout(o.dragTimeout),e("body").addClass("dragging")},onDragLeave:function(){clearTimeout(o.dragTimeout),o.dragTimeout=setTimeout((function(){e("body").removeClass("dragging")}),100)},onDrop:function(a){a.preventDefault(),a.stopPropagation(),a.originalEvent.stopPropagation(),a.originalEvent.preventDefault();var n=o.filterImageFiles(a.originalEvent.dataTransfer.files);if(e("body").removeClass("dragging"),0!==n.length){e("body").addClass("uploading");for(var i=new FormData,t=0,r=n.length;t<r;t++)i.append("image_"+t,n[t]);e.ajax({url:Jetpack_Comics_Options.writeURL+"&nonce="+Jetpack_Comics_Options.nonce,data:i,processData:!1,contentType:!1,type:"POST",dataType:"json",xhrFields:{withCredentials:!0}}).done((function(o){e("#jetpack-comic-drop-zone .uploading").text(Jetpack_Comics_Options.labels.processing),"url"in o?document.location.href=o.url:"error"in o&&(alert(o.error),e("body").removeClass("uploading"))})).fail((function(){alert(Jetpack_Comics_Options.labels.error)}))}else alert(Jetpack_Comics_Options.labels.invalidUpload)}};o.init()}));
\ No newline at end of file |