WordPress/wp-admin/js/media-upload.min.js

1 line
1.1 KiB
JavaScript

var wpActiveEditor,tb_position,send_to_editor=function(t){var i,e="undefined"!=typeof tinymce,n="undefined"!=typeof QTags;if(wpActiveEditor)e&&(i=tinymce.get(wpActiveEditor));else if(e&&tinymce.activeEditor)i=tinymce.activeEditor,wpActiveEditor=i.id;else if(!n)return!1;if(i&&!i.isHidden()?i.execCommand("mceInsertContent",!1,t):n?QTags.insertContent(t):document.getElementById(wpActiveEditor).value+=t,window.tb_remove)try{window.tb_remove()}catch(t){}};!function(d){tb_position=function(){var t=d("#TB_window"),i=d(window).width(),e=d(window).height(),n=833<i?833:i,o=0;return d("#wpadminbar").length&&(o=parseInt(d("#wpadminbar").css("height"),10)),t.size()&&(t.width(n-50).height(e-45-o),d("#TB_iframeContent").width(n-50).height(e-75-o),t.css({"margin-left":"-"+parseInt((n-50)/2,10)+"px"}),void 0!==document.body.style.maxWidth&&t.css({top:20+o+"px","margin-top":"0"})),d("a.thickbox").each(function(){var t=d(this).attr("href");t&&(t=(t=t.replace(/&width=[0-9]+/g,"")).replace(/&height=[0-9]+/g,""),d(this).attr("href",t+"&width="+(n-80)+"&height="+(e-85-o)))})},d(window).resize(function(){tb_position()})}(jQuery);