File: /var/www/html/wp-content/plugins/advanced-post-manager/resources/meta-box.min.js
jQuery(document).ready(function(e){function t(e){var t=RegExp("[?&]"+e+"=([^&#]*)").exec(location.href);return t&&decodeURIComponent(t[1].replace(/\+/g," "))}var i,a='<li><label><input type="checkbox" name="%name%[]" value="%val%" checked="checked" /> %title%</label></li>',n=e(".showMediaButtons");n.each(function(t){i=e("#media-buttons").clone(),e(this).before(i)}),e(".p2p-drop").change(function(){var t,i=e(this),n=i.val(),r=i.find("option[value="+n+"]");""!==n&&(t=a.replace("%name%",i.attr("name")).replace("%val%",n).replace("%title%",r.text()),i.parent().find(".p2p-connected").append(t),r.remove())}),e(".tribe-multi-text-wrap").delegate("a","click",function(t){var i=e(this),a=i.parent(),n=a.parent().children(),r=n.parent(),l="hide-remove",o=n.length;i.hasClass("tribe-add")?(newRow=a.clone(),newRow.find("input").val(""),a.after(newRow),o++):i.hasClass("tribe-remove")&&(a.remove(),o--),1==o?r.addClass(l):r.removeClass(l)}),e(".tribe-date").each(function(){var t=e(this),i=t.attr("rel");t.datepicker({showButtonPanel:!0,dateFormat:i})}),e(".tribe-time").each(function(){var t=e(this),i=t.attr("rel");t.timepicker({showSecond:!0,timeFormat:i})}),e(".tribe-color-picker").each(function(){var t=e(this),i=t.attr("rel");t.farbtastic("#"+i)}),e(".tribe-color-select").click(function(){return e(this).siblings(".tribe-color-picker").toggle(),!1}),e(".tribe-add-file").click(function(){var t=e(this).parent().find(".file-input:first");return t.clone().insertAfter(t).show(),!1}),e(".tribe-upload").delegate(".tribe-delete-file","click",function(){var t=e(this),i=t.parent(),a=t.attr("rel");return e.post(ajaxurl,{action:"tribe_delete_file",data:a},function(e){"0"==e?(alert("File has been successfully deleted."),i.remove()):alert("You do NOT have permission to delete this file.")}),!1}),e(".tribe-images").each(function(){var t,i,a=e(this);a.sortable({placeholder:"ui-state-highlight",update:function(){t=a.sortable("serialize"),i=t+"|"+a.siblings(".tribe-images-data").val(),e.post(ajaxurl,{action:"tribe_reorder_images",data:i},function(e){"0"==e?alert("Order saved"):alert("You don't have permission to reorder images.")})}})}),e(".tribe-upload-button").click(function(){var t=e(this).attr("rel").split("|"),i=t[0],a=t[1],n=window.send_to_editor;return window.send_to_editor=function(t){e("#tribe-images-"+a).append(e(t)),tb_remove(),window.send_to_editor=n},tb_show("","media-upload.php?post_id="+i+"&field_id="+a+"&type=image&TB_iframe=true"),!1}),e("#media-items .new").each(function(){var t=e(this).parent().attr("id").split("-")[2];e(this).prepend('<input type="checkbox" class="item_selection" id="attachments['+t+'][selected]" name="attachments['+t+'][selected]" value="selected" /> ')}),e(".ml-submit").live("mouseenter",function(){e("#media-items .new").each(function(){var t=e(this).parent().children('input[value="image"]').attr("id");t&&(t=t.split("-")[2],e(this).not(':has("input")').prepend('<input type="checkbox" class="item_selection" id="attachments['+t+'][selected]" name="attachments['+t+'][selected]" value="selected" /> '))})});var r=t("field_id");e(".ml-submit:first").append('<input type="hidden" name="field_id" value="'+r+'" /> <input type="submit" class="button" name="tribe-insert" value="Insert selected images" />')});