forked from FancyThemes/wp-advanced-excerpt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadvanced-excerpt.min.js
1 lines (1 loc) · 1.64 KB
/
advanced-excerpt.min.js
1
!function(a){a(document).ready(function(){var b=a("#tags-table tr:eq(1) td").length,c=new Array;a("#tags-table input").each(function(b,d){c.push(a(d).val())}),a("#the-content").change(function(){a(this).is(":checked")?(a("#the-content-no-break-label").removeClass("disabled"),a("#the-content-no-break").removeAttr("disabled")):(a("#the-content-no-break-label").addClass("disabled"),a("#the-content-no-break").attr("disabled","disabled"),a("#the-content-no-break").attr("checked",!1))}),a("#add-link").change(function(){a(this).is(":checked")?a("#read-more").removeAttr("disabled"):a("#read-more").attr("disabled","disabled")}),a("input[name=allowed_tags_option]").change(function(){"dont_remove_any"==a(this).val()?(a("#tags-table tr").not(":first-child").hide(),a(".tags-control").hide()):(a("#tags-table tr").not(":first-child").show(),a(".tags-control").show())}),a("#add-tag").click(function(d){d.preventDefault();var e=a("#more-tags option:selected").val();if(!(a.inArray(e,c)>-1)){c.push(e);var f=a("#tags-table tr:last-child"),g=f.find("input").length,h=a('<td><label for="ae-'+e+'"><input name="allowed_tags[]" type="checkbox" id="ae-'+e+'" value="'+e+'" checked="checked" /><code>'+e+"</code></label></td>");if(b>g){var i=f.find("td[colspan]");i.attr("colspan")>1?(i.attr("colspan",i.attr("colspan")-1),h.insertBefore(i)):i.replaceWith(h)}else a('<tr><td colspan="'+(b-1)+'"> </td></tr>').insertAfter(f).prepend(h)}}),a("#select-all").click(function(b){b.preventDefault(),a('input[name="allowed_tags[]"]:gt(0)').attr("checked","checked")}),a("#select-none").click(function(b){b.preventDefault(),a('input[name="allowed_tags[]"]:gt(0)').removeAttr("checked")})})}(jQuery);