File "redux-import-export.min.js"

Full Path: /home/elegucvf/public_html/video/wp-content/plugins/atlas-core/framework/redux-core/inc/extensions/import_export/import_export/redux-import-export.min.js
File size: 3.16 KB
MIME-type: text/plain
Charset: utf-8

!function(n){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.import_export=redux.field_objects.import_export||{},redux.field_objects.import_export.copy_text=function(e){var t=document.createElement("textarea");document.body.appendChild(t),t.textContent=e,t.select(),document.execCommand("copy"),t.remove()},redux.field_objects.import_export.get_options=function(e){var t=n("#redux-export-code-copy"),e=ajaxurl+"?download=0&action=redux_download_options-"+redux.optName.args.opt_name+"&secret="+e;t.addClass("disabled").attr("disabled","disabled"),t.text(t.data("copy")),n.get(e,function(e){redux.field_objects.import_export.copy_text(e),t.removeClass("disabled"),t.text(t.data("copied")),setTimeout(function(){t.text(t.data("copy")).removeClass("disabled").prop("disabled",!1)},2e3)})},redux.field_objects.import_export.init=function(e){e=n.redux.getSelector(e,"import_export"),n(e).each(function(){var e,t,o=n(this),i=o;(i=o.hasClass("redux-field-container")?i:o.parents(".redux-field-container:first")).is(":hidden")||i.hasClass("redux-field-init")&&(i.removeClass("redux-field-init"),o.each(function(){n("#redux-import").on("click",function(e){if(""===n("#import-code-value").val()&&""===n("#import-link-value").val())return e.preventDefault(),!1}),n(this).find("#redux-import-code-button").on("click",function(){var e=n("#redux-import-code-wrapper");e.is(":visible")?(n("#import-link-value").val(""),n("#redux-import-link-wrapper").fadeOut("fast",function(){e.fadeIn("fast",function(){n("#import-code-value").trigger("focus")})})):e.is(":visible")?e.fadeOut():e.fadeIn("medium",function(){n("#import-code-value").trigger("focus")})}),n(this).find("#redux-export-code-dl").on("click",function(e){e.preventDefault(),window.onbeforeunload?confirm(ImportExport.unchanged_values)&&(n("#redux_top_save").on("click"),setTimeout(function(){window.open(n(this).attr("href"))},2e3)):window.open(n(this).attr("href"))}),n(this).find("#redux-import-upload").on("click",function(){n("#redux-import-upload-file").trigger("click")}),document.getElementById("redux-import-upload-file").addEventListener("change",function(){var e=document.getElementById("redux-import-upload-file").files[0],t=new FileReader;n("#redux-import-upload span").text(": "+e.name),t.onload=function(){var e=t.result;n("#import-code-value").val(e)},t.readAsText(e)}),n(this).find("#redux-export-code-copy").on("click",function(e){var t=n("#redux-export-code"),o=n(this).data("secret");e.preventDefault(),window.onbeforeunload?confirm(ImportExport.unchanged_values)&&(n("#redux_top_save").trigger("click"),setTimeout(function(){redux.field_objects.import_export.get_options(o,t)},2e3)):redux.field_objects.import_export.get_options(o,t)}),n(this).find("textarea").on("focusout",function(){var e=n(this).attr("id"),t=n(this);("import-link-value"!==e&&"import-code-value"!==e?t:n(this).parent()).fadeOut("medium",function(){"redux-export-link-value"!==e&&t.text("")})}),(e=document.getElementById("redux-export-code")).onfocus=function(){e.select(),e.onmouseup=function(){return e.onmouseup=null,!1}},(t=document.getElementById("import-code-value")).onfocus=function(){t.select(),t.onmouseup=function(){return t.onmouseup=null,!1}}}))})}}(jQuery);