/
www
/
wwwroot
/
alo88.autos
/
wp-content
/
plugins
/
internal-links
/
admin
/
js
/
Upload File
HOME
var __webpack_exports__={};__webpack_exports__={};!function(t){var e={minimumResultsForSearch:10,width:"70%"};t.fn.applyFileImport=function(e){var i=this;return this.createLoadingText=function(){var e=t("<span></span>").html("<small>"+ilj_tools.translation.loading+" - <span>0</span>%</small>").hide();return e.setPercent=function(e){t(this).find("span").text(e)},e},this.each((function(){var e=t.extend({fileSize:0,fileType:"."},t(this).data()),s=t(this).find('form[name^="ilj-import"]'),n=s.find(".import-file"),o=s.find(".button"),a=s.find(".ilj-progress"),r=a.find(".ilj-progress-bar"),l=s.find(".hint"),d=function(){var e=t("<div/>").addClass("feedback").hide();return e.setNotice=function(i){var s=t("<p/>").html(i),n=t("<button/>").addClass("notice-dismiss");return n.on("click",(function(t){t.preventDefault(),e.hide()})),t(this).removeClass().addClass("feedback"),t(this).html(s).append(n),this},e.setSuccess=function(e){return this.setNotice(e),t(this).addClass("success"),this},e.setError=function(e){return this.setNotice(e),t(this).addClass("error"),this},e}(),c=i.createLoadingText(),p=t("<button/>").addClass("button button-primary ilj-import-settings-start").text(ilj_tools.translation.start_import).on("click",(function(i){i.preventDefault(),u.hide(),t(this).attr("disabled",!0).removeClass("button-primary");var s=t("<span/>").addClass("spinner");t(this).after(s),s.addClass("is-active"),t.ajax({url:ilj_tools.ajax_url,data:{action:"ilj_start_import",nonce:ilj_tools.nonce,file_type:e.fileType},type:"POST",success:function(t){setTimeout((function(){d.hide(),o.show(),d.setSuccess(ilj_tools.translation.import_success),p.hide().attr("disabled",!1).addClass("button-primary"),s.remove(),d.show()}),500)},error:function(t){var e=ilj_tools.translation.error;t.responseJSON.data&&(e=t.responseJSON.data),d.setError(e),setTimeout((function(){p.hide().attr("disabled",!1).addClass("button-primary"),u.hide(),d.show(),o.show(),s.remove()}),500)}})})).hide().insertAfter(l),u=t("<button/>").addClass("button").text(ilj_tools.translation.cancel_import).on("click",(function(t){t.preventDefault(),o.show(),d.hide(),p.hide(),u.hide()})).hide().insertAfter(p);r.setPercent=function(e){t(this).css("width",e+"%")},d.insertAfter(l),a.after(c),o.on("click",(function(t){t.preventDefault(),n.click()})),n.on("change",(function(i){if(i.preventDefault(),n[0].files[0].size>e.fileSize)d.setError(ilj_tools.translation.upload_error_filesize).show();else{var s=new FormData;s.append("action","ilj_upload_import"),s.append("file_type",e.fileType),s.append("file_data",n[0].files[0]),s.append("file_name",n[0].files[0].name),s.append("nonce",ilj_tools.nonce),t.ajax({url:ilj_tools.ajax_url,data:s,processData:!1,contentType:!1,dataType:"json",type:"POST",success:function(e){d.setNotice(ilj_tools.translation.upload_success),u.after(t("<div/>").addClass("clear")),setTimeout((function(){a.hide(),c.hide(),d.show(),u.show(),p.show()}),800)},error:function(t){var e=ilj_tools.translation.error;t.responseJSON.data&&(e=t.responseJSON.data),d.setError(e),setTimeout((function(){a.hide(),c.hide(),d.show(),o.show()}),800)},beforeSend:function(){d.hide(),o.hide(),r.setPercent(0),c.setPercent(0),a.show(),c.show()},xhr:function(){var e=t.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",(function(t){if(t.lengthComputable){var e=t.loaded/t.total*100;e=e.toFixed(2),r.setPercent(e),c.setPercent(e)}}),!1),e}}),t(this).val("")}}))})),this},t(document).ready((function(){t(".ilj-upload-form").applyFileImport(),t("button.ilj-export").on("click",(function(){var e=t(this).data("export"),i=t(this).parent().find(".spinner");i.addClass("is-active");var s=window.location.href+"&ilj_export="+e;"keywords"==e&&(t(this).closest(".wrap").find("input#ilj-export-empty").is(":checked")&&(s+="&empty=1"),t("#ilj-export-additional-columns").is(":checked")&&(s+="&addcols=1"));var n=t("<iframe/>").attr("src",s).css("display","none");t("body").append(n),setTimeout((function(){i.removeClass("is-active")}),500)})),jQuery("#ilj-import-intern-type-post, #ilj-import-intern-type-term").ilj_select2(e)}))}(jQuery); //# sourceMappingURL=ilj_tools.min.js.map