b0y-101 Mini Shell


Current Path : E:/www3/chiangrai/wp-content/plugins/embed-any-document/js/
File Upload :
Current File : E:/www3/chiangrai/wp-content/plugins/embed-any-document/js/embed.min.js

jQuery(document).ready(function(f){var a,d=f("#awsm-url"),b=f("#shortcode"),t=f("#embed-message p"),i=(f(".mceActionPanel"),f(".ead-container")),h="",n=emebeder.msextension;emebeder.drextension;function v(e){return-1==e.indexOf("%")?(e=e.replace(/[^0-9]/g,""),e+="px"):(e=e.replace(/[^0-9]/g,""),e+="%"),e}function o(){var e=f("#TB_window"),d=f(window).width(),o=f(window).height(),a=1080<d?1080:d;e.size()&&(e.width(a-50).height(o-45),f("#TB_ajaxContent").css({width:"100%",height:"100%",padding:"0"}),e.css({"margin-left":"-"+parseInt((a-50)/2,10)+"px"}),void 0!==document.body.style.maxWidth&&e.css({top:"20px","margin-top":"0"}),f("#TB_title").css({"background-color":"#fff",color:"#cfcfcf"}))}function w(e,d){var o=f("#ead-"+e).val();return o&&("ead-"+e==d||o!=emebeder[e])}function u(e){var d,o,a,t,i,n,u,r,l,F,s,c,p,m;e=void 0!==e&&e,h?b.text((d=h,o=e,a=v(f("#ead-height").val()),t=v(f("#ead-width").val()),i=f("#ead-download").val(),n=f("#ead-provider").val(),u=f("#ead-text").val(),r=f("#ead-cache").is(":checked"),m=p=c=s=F=l="",w("height",o)&&(l=' height="'+a+'"'),w("width",o)&&(F=' width="'+t+'"'),w("download",o)&&(s=' download="'+i+'"'),w("provider",o)&&(c=' viewer="'+n+'"'),w("text",o)&&"none"!=i&&(p=' text="'+u+'"'),"google"==n?(f("#eadcachemain").show(),r&&(m=' cache="off"')):f("#eadcachemain").hide(),"browser"===n?f(".ead-browser-viewer-note").show():f(".ead-browser-viewer-note").hide(),'[embeddoc url="'+d+'"'+F+l+s+c+m+p+"]")):b.text("")}function r(e){f(".uploaded-doccument").removeClass("ead-link ead-upload ead-dropbox ead-drive ead-box"),f(".uploaded-doccument").addClass("ead-"+e)}function l(){tb_remove(),setTimeout(function(){f("body").removeClass("ead-popup-on")},800)}function F(e,d){var o=n.split(","),a=e.filename;"link"==d&&(a=e.url);var t="."+a.split(".").pop();f.each(["built-in","browser","microsoft"],function(e,d){f("#new-provider option[value='"+d+"']").attr({disabled:!1,hidden:!1})}),f(".ead-browser-viewer-note").hide(),-1!==f.inArray(d,["link","upload"])&&(-1===f.inArray(t,o)?(f("#new-provider option[value='google']").attr("selected","selected"),f("#new-provider option[value='microsoft']").attr({disabled:!0,hidden:!0})):f("#new-provider option[value='microsoft']").attr("selected","selected"),".pdf"!=t&&f("#new-provider option[value='browser']").attr({disabled:!0,hidden:!0}),(".pdf"!=t||"link"===d&&-1===a.indexOf(emebeder.site_url))&&f("#new-provider option[value='built-in']").attr({disabled:!0,hidden:!0}))}function s(){"none"==f("#ead-download").val()?f("#ead-download-text").hide():f("#ead-download-text").show()}f("body").on("click",".awsm-embed",function(e){i.show(),d.val(""),f(".ead-options").fadeIn(),f(".addurl-box").hide(),f(".upload-success").hide(),f("#embed-message").hide(),f("#insert-doc").attr("disabled","disabled"),f("#new-provider").show(),f("#ead-pseudo").hide(),f("#new-provider  option[value='microsoft']").attr("disabled",!1),f("#ead-downloadc").show(),s(),e.preventDefault(),f("body").addClass("ead-popup-on"),tb_show("Embed Any Document","#TB_inline?inlineId=embed-popup-wrap&amp;width=1030&amp;modal=true",null),o(),f("#upload-doc").focus()}),f(".ead-usc").change(function(){u(f(this).attr("id")),s()}),f(".embedval").keyup(function(){u(f(this).attr("id"))}),f("#upload-doc").click(function(){if(a)return void a.open();(a=wp.media({title:"Embed Any Document",multiple:!1,library:{type:emebeder.validtypes},button:{text:emebeder.select_button}})).on("select",function(){var e,d,o=a.state().get("selection").first().toJSON();d="upload",h=(e=o).url,F(e,d),u(),function(e,d){f("#insert-doc").removeAttr("disabled"),f("#ead-filename").html(e.filename),e.filesizeHumanReadable?f("#ead-filesize").html(e.filesizeHumanReadable):f("#ead-filesize").html("&nbsp;");f(".upload-success").fadeIn(),i.hide(),r(d)}(e,d)}),a.open()}),f("#ead-add-url").click(function(){var e=d.val();""!==e?function(e){{var d,o;f("#embed-message").hide(),function(e){return/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)}(e)?(d=(d=(h=e).split("/").pop())||emebeder.from_url,o={url:h,filename:d},f("#insert-doc").removeAttr("disabled"),f("#ead-filename").html(emebeder.from_url),f("#ead-filesize").html("&nbsp;"),f(".upload-success").fadeIn(),i.hide(),r("link"),F(o,"link"),u()):function(e){f("#embed-message").fadeIn(),t.text(e)}(emebeder.invalidurl)}}(e):(d.addClass("urlerror"),u())}),f("#insert-doc").click(function(){{var e;h?(e=!0,void 0!==wp.blocks&&void 0!==wp.blocks.getBlockType("embed-any-document/document")&&(e=!1),e&&wp.media.editor.insert(b.text()),l()):showmsg(emebeder.nocontent)}}),f("#add-ead-document").on("click",function(e){e.preventDefault(),f(".addurl-box").fadeIn(),f(".ead-options").hide()}),f(".go-back").on("click",function(e){e.preventDefault(),f(".addurl-box").hide(),f(".ead-options").fadeIn()}),f("#embed-popup").on("click",".cancel-embed,.ead-close",function(e){e.preventDefault(),l()}),f(window).resize(function(){o()})});

Copyright © 2019 by b0y-101