WordPress/wp-admin/js/nav-menu-default-items.js
2010-03-10 20:27:42 +00:00

1 line
2.5 KiB
JavaScript

jQuery(document).ready(function(a){wp_drag_and_drop();wp_update_post_data();a("#save_menu").click(function(){return wp_update_post_data()});a(".quick-search").click(function(){a(this).attr("value","")});a(".quick-search-submit").click(function(){a(this).siblings(".quick-search").search()});a("#menu-container .item-edit").click(function(){return wp_edit_menu_item(a(this).attr("value"))});a("#menu-container .item-delete").live("click",function(){return wp_remove_menu_item(a(this).attr("value"))});a("#update-menu-item").click(function(){wp_update_menu_item();tb_remove();var b=a("#edit-item-id").val();a("#menu-"+b+" dt:first").animate({backgroundColor:"#FFFF33"},{duration:"normal",complete:function(){jQuery(this).css("backgroundColor","")}})});a("#cancel-save").click(function(){return tb_remove()});a(".show-all").click(function(){a(this).offsetParent().find("#add-buttons-actions").attr("style","margin-bottom: 10px;");a(this).offsetParent().find(".list-wrap").css("display","block");a(this).siblings(".quick-search").attr("value","");a(this).offsetParent().find(".list-wrap li").css("display","block");a(this).hide();a(this).siblings(".hide-all").show()});a(".hide-all").click(function(){a(this).offsetParent().find("#add-buttons-actions").attr("style","margin-bottom: 0px;");a(this).offsetParent().find(".list-wrap").css("display","none");a(this).siblings(".quick-search").attr("value","Search");a(this).offsetParent().find(".list-wrap li").css("display","none");a(this).hide();a(this).siblings(".show-all").show()});a(".list input").click(function(){var d=jQuery(this).parent().siblings(".item-type").val();var g=jQuery(this).parent().siblings(".item-title").val();var c=jQuery(this).parent().siblings(".item-url").val();var e=jQuery(this).parent().siblings(".item-dbid").val();var b=jQuery(this).parent().siblings(".item-parent").val();var f=jQuery(this).parent().siblings(".item-description").val();return wp_update_queue(a(this),d,g,c,e,b,f)});a(".enqueue a").click(function(){return wp_add_queued_items_to_menu(this)});a("#add-custom-link .add-to-menu a").click(function(){var b=a(this).offsetParent().find("#menu-item-url").val();var c=a(this).offsetParent().find("#menu-item-name").val();wp_add_queued_items_to_menu(this);if("http://"==b||"Menu Item"==c){return}params={action:"add-menu-link",link_url:b,link_name:c,};a.post(ajaxurl,params,function(d){if(null==d||"-1"==d){return false}params.link_id=d;wp_add_item_to_menu("Custom",params.link_name,params.link_url,params.link_id,0,"")},"json")})});