(function (a) { optionsframeworkMLU = {removeFile: function () { a(".mlu_remove").live("click", function (b) { a(this).hide(); a(this).parents().siblings(".input-append").children(".upload").attr("value", ""); a(this).parents(".screenshot").slideUp(); a(this).parents(".screenshot").siblings(".of-background-properties").hide(); return false }); a("a.delete-inline", "#option-1").hide() }, recreateFileField: function () { a("input.file").each(function () { var b = ''; a(this).wrap('
'); a(this).addClass("file").css("opacity", 0); a(this).parent().append(a('
').append(a('').attr("id", a(this).attr("id") + "_file")).val(a(this).val()).append(b)); a(this).bind("change", function () { a("#" + a(this).attr("id") + "_file").val(a(this).val()) }); a(this).bind("mouseout", function () { a("#" + a(this).attr("id") + "_file").val(a(this).val()) }) }) }, mediaUpload: function () { jQuery.noConflict(); a("input.upload_button").removeAttr("style"); var b, d, c = true, e; a("input.upload_button").live("click", function () { b = a(this).prev("input").attr("id"); d = a(this).attr("rel"); e = setInterval(function () { jQuery("#TB_iframeContent").contents().find(".savesend .button").val("Use This Image") }, 2000); var f = ""; if (a(this).parents(".section").find(".heading")) { f = a(this).parents(".section").find(".heading").text() } tb_show(f, "media-upload.php?post_id=" + d + "&TB_iframe=1"); return false }); window.original_send_to_editor = window.send_to_editor; window.send_to_editor = function (g) { if (b) { clearInterval(e); if (a(g).html(g).find("img").length > 0) { itemurl = a(g).html(g).find("img").attr("src") } else { var l = g.split("'"); itemurl = l[1]; var j = l[2]; j = j.replace(">", ""); j = j.replace("", "") } var k = /(^.*\.jpg|jpeg|png|gif|ico*)/gi; var f = /(^.*\.pdf|doc|docx|ppt|pptx|odt*)/gi; var i = /(^.*\.mp3|m4a|ogg|wav*)/gi; var h = /(^.*\.mp4|m4v|mov|wmv|avi|mpg|ogv|3gp|3g2*)/gi; if (itemurl.match(k)) { c = 'Remove Image' } else { g = 'View File'; c = '
' + g + 'Remove
' } a("#" + b).val(itemurl); a("#" + b).siblings(".screenshot").slideDown().html(c); a("#" + b).siblings(".of-background-properties").show(); tb_remove() } else { window.original_send_to_editor(g) } b = "" } }}; a(document).ready(function () { optionsframeworkMLU.removeFile(); optionsframeworkMLU.recreateFileField(); optionsframeworkMLU.mediaUpload() }) })(jQuery);