Make WordPress Core

Changeset 14337


Ignore:
Timestamp:
05/02/2010 07:09:10 PM (17 years ago)
Author:
nacin
Message:

Alot of drag/drop/sortable improvements to nav menu admin UI. props koopersmith, fixes #12675.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/nav-menu.css

    r14314 r14337  
    1 #nav-menus-frame{margin-left:300px;}#menu-settings-column{display:block;width:281px;margin-left:-300px;clear:both;float:left;}#menu-settings-column .inside{padding:0 10px;}#menu-settings-column .handlediv{background:url("../images/menu-bits.gif") no-repeat scroll 0 -110px;}#wpbody{position:relative;}#menu-management-liquid{float:left;min-width:100%;}#menu-management{position:relative;margin-right:20px;margin-top:-3px;width:100%;}#menu-management .menu-edit{margin-bottom:20px;}#nav-menu-header,#post-body{border-color:#ccc;border-style:solid;}#nav-menu-header{background:url("../images/gray-grad.png") repeat-x scroll left top #dfdfdf;border-width:1px 1px 0 1px;-moz-border-radius-topleft:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-topright:6px;-webkit-border-top-right-radius:6px;-khtml-border-top-right-radius:6px;border-top-right-radius:6px;}#post-body{background:#fff;padding:0 0 10px 10px;border-width:0 1px 1px 1px;-moz-border-radius-bottomleft:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-moz-border-radius-bottomright:6px;-webkit-border-bottom-right-radius:6px;-khtml-border-bottom-right-radius:6px;border-bottom-right-radius:6px;}.post-body-plain{padding:10px 10px 0 0;}#menu-management .menu-add-new abbr{font-weight:bold;}#menu-management .nav-tabs{padding-left:30px;}#menu-management .nav-tab{background:#f4f4f4;font-weight:bold;border-color:#dfdfdf;}#menu-management .nav-tab-active{background:#ececec;border-color:#ccc;border-bottom-color:#ececec;}#menu-management #major-publishing-actions #delete-action{float:right;margin-right:10px;}#menu-name-label{margin-top:-2px;}#wpbody .open-label{display:inline-block;}#wpbody .open-label span{padding-right:10px;}.js .label-with-default-title{color:#aaa;font-style:italic;}#menu-management .inside{padding:0 10px;}.postbox .howto input{width:180px;float:right;}.customlinkdiv .howto input{width:210px;}#menu-container .submit{margin:0 0 10px;padding:0;}.submitdelete,.submitclose{font-size:11px;}#cancel-save{color:#f00;text-decoration:underline;font-size:11px;margin-left:20px;margin-top:5px;}#cancel-save:hover{background-color:#F00;color:#fff;}.list-controls{float:left;}.add-to-menu{float:right;}.postbox img.waiting{display:none;vertical-align:middle;}form.processing .postbox img.waiting{display:inline;}.button-controls{margin:10px 0;}.show-all,.hide-all{cursor:pointer;}.hide-all{display:none;}#create-menu-name{width:159px;}#manage-menu .inside{padding:0;}#available-links dt{display:block;}#add-custom-link .howto{font-size:11px;}#add-custom-link label span{display:block;float:left;margin-top:5px;padding-right:5px;}.menu-item-textbox{width:180px;}.howto span{margin-top:4px;display:block;float:left;}.quick-search{width:190px;}.list-wrap{display:none;clear:both;margin-bottom:10px;}.list-container{max-height:200px;overflow-y:auto;padding:10px 10px 5px;border:1px solid #DFDFDF;-moz-border-radius:4px;}.postbox p.submit{margin-bottom:0;}.list li{display:none;margin:0;margin-bottom:5px;}.list li .menu-item-title{cursor:pointer;display:block;}.list li .menu-item-title input{margin-right:3px;margin-top:-3px;}.list li li .menu-item-title{margin-left:14px;}.list li li li .menu-item-title{margin-left:28px;}.list li li li li .menu-item-title{margin-left:42px;}.list li li li li li .menu-item-title{margin-left:56px;}.list li li li li li li .menu-item-title{margin-left:70px;}.list li li li li li li li .menu-item-title{margin-left:84px;}.list li li li li li li li li .menu-item-title{margin-left:98px;}.list li li li li li li li li li .menu-item-title{margin-left:112px;}#menu-container .inside{padding-bottom:10px;}.menu{padding-top:1em;}.menu ul{width:100%;}.menu li{margin:0;}.menu li dl{clear:both;line-height:1.5em;position:relative;}.menu li dl dt{background:url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF;border:1px solid #E6E6E6;clear:both;position:relative;padding-left:10px;height:auto;width:400px;line-height:35px;text-shadow:0 1px 0 #FFF;font-weight:bold;overflow:hidden;}.menu li.deleting dl dt{background-color:#f66;background-image:none;text-shadow:0 0 0 #ccc;}.menu li dl.menu-item-edit-inactive dt{border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;-khtml-border-radius:6px;}.menu li dl.menu-item-edit-active dt{-moz-border-radius:6px 6px 0 0;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-right-radius:6px;-khtml-border-top-left-radius:6px;border-top-right-radius:6px;border-top-left-radius:6px;}.js .menu li dl dt{cursor:move;}.no-js .menu li dl{margin-top:13px;}.menu li .item-title{padding:7px 0;line-height:20px;display:block;margin-right:13em;}.menu li .sortable-placeholder{width:430px;}.menu li div.sortable-placeholder{background:#f5f5f5;border:1px dashed #bbb;margin:10px 0;padding-top:40px;}.menu li dl.sortable-placeholder{background:#f5f5f5;padding-bottom:40px;}.menu li li{margin-left:20px;}.dropzone{height:7px;margin:3px 0 3px 0;}.item-type{text-transform:uppercase;font-size:11px;color:#999;padding-right:10px;}.item-controls{font-size:11px;position:absolute;right:20px;top:-1px;}.item-controls a{text-decoration:none;}.item-controls a:hover{cursor:pointer;}.item-controls .item-order{padding-right:10px;}.item-controls .item-order a{font-weight:bold;}body.js .item-order{display:none;}.item-controls .menu-item-delete:hover{color:#f00;}.item-edit{background:url("../images/menu-bits.gif") no-repeat scroll 0 -105px;position:absolute;right:-20px;top:0;display:block;width:23px;height:36px;overflow:hidden;text-indent:-999em;border-bottom:1px solid #eee;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}.menu-item-settings{background:#F9F9F9;width:400px;padding:10px 0 10px 10px;border:solid #E6E6E6;border-width:0 1px 1px 1px;-moz-border-radius:0 0 6px 6px;-webkit-border-bottom-right-radius:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-right-radius:6px;-khtml-border-bottom-left-radius:6px;}.menu-item-settings.menu-item-edit-active{display:block;}.menu-item-settings.menu-item-edit-inactive{display:none;}.add-menu-item-pagelinks{margin:.5em auto;text-align:center;}.link-to-original{display:block;margin:0 0 10px;padding:3px 5px 5px;font-size:11px;color:#777;font-style:italic;border:1px solid #dfdfdf;border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;-khtml-border-radius:6px;}.link-to-original a{padding-left:4px;font-style:normal;}.hidden-field{display:none;}.menu-item-settings .description-thin,.menu-item-settings .description-wide{margin-right:10px;float:left;}.description-thin{width:190px;height:40px;}.description-wide{width:390px;}.menu-item-actions{padding-top:15px;line-height:25px;}.save-menu-item{padding-left:10px;float:right;}#cancel-save{cursor:pointer;}#cancel-save:hover{color:#fff!important;}#update-menu-item{color:#fff!important;}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important;}.major-publishing-actions{padding:5px 10px;border-bottom:1px solid #eee;}.major-publishing-actions .publishing-action{text-align:right;float:right;line-height:23px;}.major-publishing-actions .delete-action{line-height:25px;vertical-align:middle;text-align:left;float:right;padding-right:15px;}.menu-name-label span{font-size:11px;font-style:normal;}.submitbox .submitclose{color:#21759B;border-bottom:1px solid #21759B;padding:1px 2px;text-decoration:none;}.submitbox .submitclose:hover{background:#21759B;color:#fff;}.menu-item-settings:after,.button-controls:after,#menu-item-url-wrap:after,#menu-item-name-wrap:after{content:".";display:block;height:0;clear:both;visibility:hidden;}.menu-item-settings,.button-controls,#menu-item-url-wrap,#menu-item-name-wrap{display:block;}
     1#nav-menus-frame{margin-left:300px;}#menu-settings-column{display:block;width:281px;margin-left:-300px;clear:both;float:left;}#menu-settings-column .inside{padding:0 10px;}#menu-settings-column .handlediv{background:url("../images/menu-bits.gif") no-repeat scroll 0 -110px;}#wpbody{position:relative;}#menu-management-liquid{float:left;min-width:100%;}#menu-management{position:relative;margin-right:20px;margin-top:-3px;width:100%;}#menu-management .menu-edit{margin-bottom:20px;}#nav-menu-header,#post-body{border-color:#ccc;border-style:solid;}#nav-menu-header{background:url("../images/gray-grad.png") repeat-x scroll left top #dfdfdf;border-width:1px 1px 0 1px;-moz-border-radius-topleft:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-topright:6px;-webkit-border-top-right-radius:6px;-khtml-border-top-right-radius:6px;border-top-right-radius:6px;}#post-body{background:#fff;padding:0 0 10px 10px;border-width:0 1px 1px 1px;-moz-border-radius-bottomleft:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-moz-border-radius-bottomright:6px;-webkit-border-bottom-right-radius:6px;-khtml-border-bottom-right-radius:6px;border-bottom-right-radius:6px;}#post-body-content{position:relative;}.post-body-plain{padding:10px 10px 0 0;}#menu-management .menu-add-new abbr{font-weight:bold;}#menu-management .nav-tabs{padding-left:30px;}#menu-management .nav-tab{background:#f4f4f4;font-weight:bold;border-color:#dfdfdf;}#menu-management .nav-tab-active{background:#ececec;border-color:#ccc;border-bottom-color:#ececec;}#menu-management #major-publishing-actions #delete-action{float:right;margin-right:10px;}#menu-name-label{margin-top:-2px;}#wpbody .open-label{display:inline-block;}#wpbody .open-label span{padding-right:10px;}.js .input-with-default-title{color:#aaa;font-style:italic;}#menu-management .inside{padding:0 10px;}.postbox .howto input{width:180px;float:right;}.customlinkdiv .howto input{width:210px;}#menu-container .submit{margin:0 0 10px;padding:0;}.submitdelete,.submitclose{font-size:11px;}#cancel-save{color:#f00;text-decoration:underline;font-size:11px;margin-left:20px;margin-top:5px;}#cancel-save:hover{background-color:#F00;color:#fff;}.list-controls{float:left;}.add-to-menu{float:right;}.postbox img.waiting{display:none;vertical-align:middle;}form.processing .postbox img.waiting{display:inline;}.button-controls{margin:10px 0;}.show-all,.hide-all{cursor:pointer;}.hide-all{display:none;}#create-menu-name{width:159px;}#manage-menu .inside{padding:0;}#available-links dt{display:block;}#add-custom-link .howto{font-size:11px;}#add-custom-link label span{display:block;float:left;margin-top:5px;padding-right:5px;}.menu-item-textbox{width:180px;}.howto span{margin-top:4px;display:block;float:left;}.quick-search{width:190px;}.list-wrap{display:none;clear:both;margin-bottom:10px;}.list-container{max-height:200px;overflow-y:auto;padding:10px 10px 5px;border:1px solid #DFDFDF;-moz-border-radius:4px;}.postbox p.submit{margin-bottom:0;}.list li{display:none;margin:0;margin-bottom:5px;}.list li .menu-item-title{cursor:pointer;display:block;}.list li .menu-item-title input{margin-right:3px;margin-top:-3px;}.list li li .menu-item-title{margin-left:14px;}.list li li li .menu-item-title{margin-left:28px;}.list li li li li .menu-item-title{margin-left:42px;}.list li li li li li .menu-item-title{margin-left:56px;}.list li li li li li li .menu-item-title{margin-left:70px;}.list li li li li li li li .menu-item-title{margin-left:84px;}.list li li li li li li li li .menu-item-title{margin-left:98px;}.list li li li li li li li li li .menu-item-title{margin-left:112px;}#menu-container .inside{padding-bottom:10px;}.menu{padding-top:1em;}.menu ul{width:100%;}.menu li{margin-bottom:0;}.menu li dl{clear:both;line-height:1.5em;position:relative;margin-top:13px;}.menu li dl dt{background:url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF;border:1px solid #E6E6E6;clear:both;position:relative;padding-left:10px;height:auto;width:400px;line-height:35px;text-shadow:0 1px 0 #FFF;font-weight:bold;overflow:hidden;}.menu li dl.menu-item-edit-inactive dt{border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;-khtml-border-radius:6px;}.menu li dl.menu-item-edit-active dt{-moz-border-radius:6px 6px 0 0;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-right-radius:6px;-khtml-border-top-left-radius:6px;border-top-right-radius:6px;border-top-left-radius:6px;}.js .menu li dl dt{cursor:move;}.menu li.deleting dl dt{background-color:#faa;}.menu li .item-title{padding:7px 0;line-height:20px;display:block;margin-right:13em;}li.menu-item.ui-sortable-helper dl{margin-top:0;}li.menu-item.ui-sortable-helper .menu-item-transport dl{margin-top:13px;}.menu .sortable-placeholder{height:35px;width:410px;margin-top:13px;}.menu-item-depth-0{margin-left:0;}.menu-item-depth-1{margin-left:30px;}.menu-item-depth-2{margin-left:60px;}.menu-item-depth-3{margin-left:90px;}.menu-item-depth-4{margin-left:120px;}.menu-item-depth-5{margin-left:150px;}.menu-item-depth-6{margin-left:180px;}.menu-item-depth-7{margin-left:210px;}.menu-item-depth-8{margin-left:240px;}.menu-item-depth-9{margin-left:270px;}.menu-item-depth-10{margin-left:300px;}.menu-item-depth-11{margin-left:330px;}.menu-item-depth-0 .menu-item-transport{margin-left:0;}.menu-item-depth-1 .menu-item-transport{margin-left:-30px;}.menu-item-depth-2 .menu-item-transport{margin-left:-60px;}.menu-item-depth-3 .menu-item-transport{margin-left:-90px;}.menu-item-depth-4 .menu-item-transport{margin-left:-120px;}.menu-item-depth-5 .menu-item-transport{margin-left:-150px;}.menu-item-depth-6 .menu-item-transport{margin-left:-180px;}.menu-item-depth-7 .menu-item-transport{margin-left:-210px;}.menu-item-depth-8 .menu-item-transport{margin-left:-240px;}.menu-item-depth-9 .menu-item-transport{margin-left:-270px;}.menu-item-depth-10 .menu-item-transport{margin-left:-300px;}.menu-item-depth-11 .menu-item-transport{margin-left:-330px;}.item-type{text-transform:uppercase;font-size:11px;color:#999;padding-right:10px;}.item-controls{font-size:11px;position:absolute;right:20px;top:-1px;}.item-controls a{text-decoration:none;}.item-controls a:hover{cursor:pointer;}.item-controls .item-order{padding-right:10px;}.item-controls .item-order a{font-weight:bold;}body.js .item-order{display:none;}.item-controls .menu-item-delete:hover{color:#f00;}.item-edit{background:url("../images/menu-bits.gif") no-repeat scroll 0 -105px;position:absolute;right:-20px;top:0;display:block;width:23px;height:36px;overflow:hidden;text-indent:-999em;border-bottom:1px solid #eee;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}.menu-item-settings{background:#F9F9F9;width:400px;padding:10px 0 10px 10px;border:solid #E6E6E6;border-width:0 1px 1px 1px;-moz-border-radius:0 0 6px 6px;-webkit-border-bottom-right-radius:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-right-radius:6px;-khtml-border-bottom-left-radius:6px;}.menu-item-settings.menu-item-edit-active{display:block;}.menu-item-settings.menu-item-edit-inactive{display:none;}.add-menu-item-pagelinks{margin:.5em auto;text-align:center;}.link-to-original{display:block;margin:0 0 10px;padding:3px 5px 5px;font-size:11px;color:#777;font-style:italic;border:1px solid #dfdfdf;border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;-khtml-border-radius:6px;}.link-to-original a{padding-left:4px;font-style:normal;}.hidden-field{display:none;}.menu-item-settings .description-thin,.menu-item-settings .description-wide{margin-right:10px;float:left;}.description-thin{width:190px;height:40px;}.description-wide{width:390px;}.menu-item-actions{padding-top:15px;line-height:25px;}.save-menu-item{padding-left:10px;float:right;}#cancel-save{cursor:pointer;}#cancel-save:hover{color:#fff!important;}#update-menu-item{color:#fff!important;}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important;}.major-publishing-actions{padding:5px 10px;border-bottom:1px solid #eee;}.major-publishing-actions .publishing-action{text-align:right;float:right;line-height:23px;}.major-publishing-actions .delete-action{line-height:25px;vertical-align:middle;text-align:left;float:right;padding-right:15px;}.menu-name-label span{font-size:11px;font-style:normal;}.submitbox .submitclose{color:#21759B;border-bottom:1px solid #21759B;padding:1px 2px;text-decoration:none;}.submitbox .submitclose:hover{background:#21759B;color:#fff;}.menu-item-settings:after,.button-controls:after,#menu-item-url-wrap:after,#menu-item-name-wrap:after{content:".";display:block;height:0;clear:both;visibility:hidden;}.menu-item-settings,.button-controls,#menu-item-url-wrap,#menu-item-name-wrap{display:block;}
  • trunk/wp-admin/css/nav-menu.dev.css

    r14314 r14337  
    8080        }
    8181       
     82        #post-body-content {
     83                position: relative;
     84        }
     85       
    8286        .post-body-plain {
    8387                padding: 10px 10px 0 0;
    … …  
    120124        }
    121125       
    122         .js .label-with-default-title {
     126        .js .input-with-default-title {
    123127                color: #aaa;
    124128                font-style: italic;
    … …  
    204208}
    205209.menu li {
    206         margin: 0;
     210        margin-bottom: 0;
    207211}
    208212.menu li dl {
    … …  
    210214        line-height:1.5em;
    211215        position:relative;
     216        margin-top: 13px;
    212217}
    213218.menu li dl dt {
    … …  
    224229        overflow: hidden;
    225230}
    226         .menu li.deleting dl dt {
    227                 background-color:#f66;
    228                 background-image: none;
    229                 text-shadow: 0 0 0 #ccc;
    230         }
    231 
    232231.menu li dl.menu-item-edit-inactive dt {
    233232        border-radius: 6px;
    … …  
    248247        cursor: move;
    249248}
    250 .no-js .menu li dl {
    251         margin-top: 13px;
     249.menu li dl dt:hover {
     250}
     251.menu li.deleting dl dt {
     252        background-color:#faa;
    252253}
    253254
    … …  
    259260}
    260261
    261 .menu li .sortable-placeholder {
    262         width: 430px;
    263 }
    264 .menu li div.sortable-placeholder {
    265         background: #f5f5f5;
    266         border: 1px dashed #bbb;
    267         margin: 10px 0;
    268         padding-top:40px;
    269 }
    270 
    271 .menu li dl.sortable-placeholder {
    272         background: #f5f5f5;
    273         padding-bottom:40px;
    274 }
    275 
    276 .menu li li { margin-left: 20px; }
    277 
    278 /* Drag and Drop */
    279 .dropzone { height: 7px; margin: 3px 0 3px 0; }
     262/* Sortables */
     263li.menu-item.ui-sortable-helper dl {
     264        margin-top: 0;
     265}
     266        li.menu-item.ui-sortable-helper .menu-item-transport dl {
     267                margin-top: 13px;
     268        }
     269.menu .sortable-placeholder {
     270        height: 35px;
     271        width: 410px;
     272        margin-top: 13px;
     273}
     274
     275/* WARNING: The factor of 30px is hardcoded into the nav-menus javascript. */
     276.menu-item-depth-0 { margin-left: 0px; }
     277.menu-item-depth-1 { margin-left: 30px; }
     278.menu-item-depth-2 { margin-left: 60px; }
     279.menu-item-depth-3 { margin-left: 90px; }
     280.menu-item-depth-4 { margin-left: 120px; }
     281.menu-item-depth-5 { margin-left: 150px; }
     282.menu-item-depth-6 { margin-left: 180px; }
     283.menu-item-depth-7 { margin-left: 210px; }
     284.menu-item-depth-8 { margin-left: 240px; }
     285.menu-item-depth-9 { margin-left: 270px; }
     286.menu-item-depth-10 { margin-left: 300px; }
     287.menu-item-depth-11 { margin-left: 330px; }
     288
     289.menu-item-depth-0 .menu-item-transport { margin-left: 0px; }
     290.menu-item-depth-1 .menu-item-transport { margin-left: -30px; }
     291.menu-item-depth-2 .menu-item-transport { margin-left: -60px; }
     292.menu-item-depth-3 .menu-item-transport { margin-left: -90px; }
     293.menu-item-depth-4 .menu-item-transport { margin-left: -120px; }
     294.menu-item-depth-5 .menu-item-transport { margin-left: -150px; }
     295.menu-item-depth-6 .menu-item-transport { margin-left: -180px; }
     296.menu-item-depth-7 .menu-item-transport { margin-left: -210px; }
     297.menu-item-depth-8 .menu-item-transport { margin-left: -240px; }
     298.menu-item-depth-9 .menu-item-transport { margin-left: -270px; }
     299.menu-item-depth-10 .menu-item-transport { margin-left: -300px; }
     300.menu-item-depth-11 .menu-item-transport { margin-left: -330px; }
    280301
    281302/* Menu item controls */
  • trunk/wp-admin/includes/nav-menu.php

    r14306 r14337  
    99 */
    1010class Walker_Nav_Menu_Edit extends Walker_Nav_Menu  {
    11 
     11        /**
     12         * @see Walker_Nav_Menu::start_lvl()
     13         * @since 3.0.0
     14         *
     15         * @param string $output Passed by reference.
     16         * @param int $depth Depth of page.
     17         */
     18        function start_lvl(&$output, $depth) {}
     19       
     20        /**
     21         * @see Walker_Nav_Menu::end_lvl()
     22         * @since 3.0.0
     23         *
     24         * @param string $output Passed by reference.
     25         * @param int $depth Depth of page.
     26         */
     27        function end_lvl(&$output, $depth) {}
     28       
    1229        /**
    1330         * @see Walker::start_el()
    … …  
    4259                }
    4360                ?>
    44                 <li id="menu-item-<?php echo $item_id; ?>" class="menu-item-<?php echo strtolower(esc_attr( $item->append )); ?>">
     61                <li id="menu-item-<?php echo $item_id; ?>" class="menu-item menu-item-depth-<?php echo $depth; ?> menu-item-<?php echo strtolower(esc_attr( $item->append )); ?>">
    4562                        <dl class="<?php
    4663                                if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] )
    … …  
    167184                                </span>
    168185                               
    169                                 <input type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" />
    170                                 <input type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" />
    171                                 <input type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" />
    172                                 <input type="hidden" name="menu-item-object[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object ); ?>" />
    173                                 <input type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_parent ); ?>" />
    174                                 <input type="hidden" class="menu-item-position" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" />
    175                                 <input type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" />
    176                         </div><!-- .menu-item-settings-->
     186                                <input class="menu-item-data-append" type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" />
     187                                <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" />
     188                                <input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" />
     189                                <input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object ); ?>" />
     190                                <input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_parent ); ?>" />
     191                                <input class="menu-item-data-position" type="hidden" class="menu-item-position" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" />
     192                                <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" />
     193                        </div><!-- .menu-item-settings-->       
     194                        <ul class="menu-item-transport"></ul>
    177195                <?php
    178196                $output .= ob_get_clean();
    … …  
    427445                                <label class="howto" for="custom-menu-item-name">
    428446                                        <span><?php _e('Text'); ?></span>
    429                                         <input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text" class="regular-text menu-item-textbox label-with-default-title" title="<?php esc_attr_e('Menu Item'); ?>" />
     447                                        <input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text" class="regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e('Menu Item'); ?>" />
    430448                                </label>
    431449                        </p>
  • trunk/wp-admin/js/nav-menu.dev.js

    r14332 r14337  
    99 */
    1010
    11 var WPNavMenuHandler = function () {
    12         var $ = jQuery,
    13         activeHovering = false,
    14         currentDropzone = null,
     11var WPNavMenuHandler = function ($) {
     12        var autoCompleteData = {},
    1513       
    16         customLinkNameInput,
    17         customLinkURLInput,
    18         customLinkNameDefault,
    19         customLinkURLDefault,
    20 
    21         autoCompleteData = {},
     14        menuItemDepthPerLevel = 30, // Do not use directly. Use depthToPx and pxToDepth instead.
     15        globalMaxDepth = 11,
    2216
    2317        formatAutocompleteResponse = function( resultRow, pos, total, queryTerm ) {
    … …  
    8175                return itemData;
    8276        },
    83 
    84         getParentMenuItemDBId = function() {
    85                 var allInputs = this.getElementsByTagName('input'),
    86                 i = allInputs.length,
    87                 j,
    88                 parentEl,
    89                 parentInputs;
    90 
    91                 while( i-- ) {
    92                         if ( -1 != allInputs[i].name.indexOf('menu-item-parent-id[' + parseInt(this.id.replace('menu-item-', ''), 10) + ']') ) {
    93                                 /*  This LI element is not in a submenu */
    94                                 if ( ! this.parentNode.className || -1 == this.parentNode.className.indexOf('sub-menu') ) {
    95                                         allInputs[i].value = 0;
    96 
    97                                 /* This LI is in a submenu, so need to get the parent's object ID (which is different from the parent's DB ID, the ID in its attributes) */
    98                                 } else if ( 'LI' == this.parentNode.parentNode.nodeName && -1 != this.parentNode.parentNode.id.indexOf('menu-item-') )  {
    99                                          parentEl = this.parentNode.parentNode;
    100                                          parentInputs = parentEl.getElementsByTagName('input');
    101                                          j = parentInputs.length;
    102                                          while ( j-- ) {
    103                                                 if ( parentInputs[j].name && -1 != parentInputs[j].name.indexOf('menu-item-object-id[' + parseInt(parentEl.id.replace('menu-item-', ''), 10) + ']') ) {
    104                                                         allInputs[i].value = parseInt(parentInputs[j].value, 10);
    105                                                         break;
    106                                                 }
    107                                          }
    108                                 }
    109                                 break;
    110                         }
    111                 }
     77       
     78        recalculateMenuItemPositions = function() {
     79                menuList.find('.menu-item-data-position').val( function(index) { return index + 1; } );
    11280        },
    113 
    114         makeDroppable = function(el) {
    115                 var that = this;
    116 
    117                 $(el).droppable({
    118                         accept: '.menu li',
    119                         tolerance: 'pointer',
    120                         drop: function(e, ui) {
    121                                 that.eventOnDrop(ui.draggable[0], this, ui, e);
    122                         },
    123 
    124                         over: function(e,ui) {
    125                                 that.eventOnDragOver(ui.draggable[0], this, ui, e);
    126                         },
    127 
    128                         out: function(e, ui) {
    129                                 that.eventOnDragOut(ui.draggable[0], this, ui, e);
    130                         }
    131                 });
     81       
     82        depthToPx = function(depth) {
     83                return depth * menuItemDepthPerLevel;
    13284        },
    133 
    134         menuList,
    135 
    136         setupListItemsDragAndDrop = function(list) {
    137                 if ( ! list )
    138                         return;
    139 
    140                 var dummyListItem = document.getElementById(list.id + '-dummy-list-item'),
    141                 menuListItems = list.getElementsByTagName('li'),
    142                 i = menuListItems.length;
    143 
    144                 if ( ! dummyListItem ) {
    145                         dummyListItem = document.createElement('li');
    146                         dummyListItem.id = list.id + '-dummy-list-item';
    147                         list.appendChild(dummyListItem);
    148                         this.setupListItemDragAndDrop(dummyListItem);
    149                 }
    150                
    151                 while ( i-- )
    152                         this.setupListItemDragAndDrop(menuListItems[i]);
    153         };
     85       
     86        pxToDepth = function(px) {
     87                return Math.floor(px / menuItemDepthPerLevel);
     88        },
     89
     90        menuList;
     91       
     92        // jQuery extensions
     93        $.fn.extend({
     94                menuItemDepth : function() {
     95                        return pxToDepth( this.eq(0).css('margin-left').slice(0, -2) );
     96                },
     97                updateDepthClass : function(current, prev) {
     98                        return this.each(function(){
     99                                var t = $(this);
     100                                prev = prev || t.menuItemDepth();
     101                                $(this).removeClass('menu-item-depth-'+ prev )
     102                                        .addClass('menu-item-depth-'+ current );
     103                        });
     104                },
     105                shiftDepthClass : function(change) {
     106                        return this.each(function(){
     107                                var t = $(this),
     108                                        depth = t.menuItemDepth();
     109                                $(this).removeClass('menu-item-depth-'+ depth )
     110                                        .addClass('menu-item-depth-'+ (depth + change) );
     111                        });
     112                },
     113                childMenuItems : function() {
     114                        var result = $();
     115                        this.each(function(){
     116                                var t = $(this), depth = t.menuItemDepth(), next = t.next();
     117                                while( next.length && next.menuItemDepth() > depth ) {
     118                                        result = result.add( next );
     119                                        next = next.next();
     120                                }
     121                        });
     122                        return result;
     123                },
     124                updateParentMenuItemDBId : function() {
     125                        return this.each(function(){
     126                                var item = $(this),
     127                                        input = item.find('.menu-item-data-parent-id'),
     128                                        depth = item.menuItemDepth(),
     129                                        parent = item.prev();
     130
     131                                if( depth == 0 ) { // Item is on the top level, has no parent
     132                                        input.val(0);
     133                                } else { // Find the parent item, and retrieve its object id.
     134                                        while( parent.menuItemDepth() != depth - 1 ) {
     135                                                parent = parent.prev();
     136                                        }
     137                                        input.val( parent.find('.menu-item-data-object-id').val() );
     138                                }
     139                        });
     140                },
     141                hideAdvancedMenuItemFields : function() {
     142                        return this.each(function(){
     143                                var that = $(this);
     144                                $('.hide-column-tog').not(':checked').each(function(){
     145                                        that.find('.field-' + $(this).val() ).addClass('hidden-field');
     146                                });
     147                        });
     148                },
     149        });
    154150
    155151        return {
    … …  
    157153                // Functions that run on init.
    158154                init : function() {
    159                         menuList = document.getElementById('menu-to-edit');
     155                        menuList = $('#menu-to-edit');
    160156                       
    161157                        this.attachMenuEditListeners();
    … …  
    165161                        this.attachTabsPanelListeners();
    166162                       
    167                         // init drag and drop
    168                         setupListItemsDragAndDrop.call(this, menuList);
     163                        if( menuList.length ) // If no menu, we're in the + tab.
     164                                this.initSortables();
    169165
    170166                        this.initToggles();
    … …  
    184180                        }
    185181                        // hide fields
    186                         this.hideAdvancedMenuItemFields();
     182                        menuList.hideAdvancedMenuItemFields();
    187183                },
    188184               
    189                 hideAdvancedMenuItemFields : function(container) {
    190                         container = container || '.menu';
    191                         $('.hide-column-tog').not(':checked').each(function(){
    192                                 $(container).find('.field-' + $(this).val() ).addClass('hidden-field');
    193                         });
     185                initSortables : function() {
     186                        var currentDepth = 0, originalDepth, minDepth, maxDepth,
     187                                menuLeft = menuList.offset().left;
     188                       
     189                        menuList.sortable({
     190                                handle: ' > dl',
     191                                placeholder: 'sortable-placeholder',
     192                                start: function(e, ui) {
     193                                        var next, height, width, parent, children, maxChildDepth,
     194                                                transport = ui.item.children('.menu-item-transport');
     195                                       
     196                                        // Set depths
     197                                        originalDepth = ui.item.menuItemDepth();
     198                                        updateCurrentDepth(ui, originalDepth);
     199                                       
     200                                        // Attach child elements to parent
     201                                        // Skip the placeholder
     202                                        parent = ( ui.item.next()[0] == ui.placeholder[0] ) ? ui.item.next() : ui.item;
     203                                        children = parent.childMenuItems();
     204                                        transport.append( children );
     205
     206                                        // Now that the element is complete, we can update...
     207                                        updateDepthRange(ui);
     208                                       
     209                                        // Update the height of the placeholder to match the moving item.
     210                                        height = transport.outerHeight();
     211                                        // If there are children, account for distance between top of children and parent
     212                                        height += ( height > 0 ) ? (ui.placeholder.css('margin-top').slice(0, -2) * 1) : 0;
     213                                        height += ui.item.outerHeight();
     214                                        height -= 2; // Subtract 2 for borders
     215                                        ui.placeholder.height(height);
     216                                       
     217                                        // Update the width of the placeholder to match the moving item.
     218                                        maxChildDepth = originalDepth;
     219                                        children.each(function(){
     220                                                var depth = $(this).menuItemDepth();
     221                                                maxChildDepth = (depth > maxChildDepth) ? depth : maxChildDepth;
     222                                        });
     223                                        width = ui.item.find('dl dt').outerWidth(); // Get original width
     224                                        width += depthToPx(maxChildDepth - originalDepth); // Account for children
     225                                        width -= 2; // Subtract 2 for borders
     226                                        ui.placeholder.width(width);
     227                                },
     228                                stop: function(e, ui) {
     229                                        var children, depthChange = currentDepth - originalDepth;
     230                                       
     231                                        // Return child elements to the list
     232                                        children = ui.item.children('.menu-item-transport').children().insertAfter(ui.item);
     233                                       
     234                                        // Update depth classes
     235                                        if( depthChange != 0 ) {
     236                                                ui.item.updateDepthClass( currentDepth );
     237                                                children.shiftDepthClass( depthChange );
     238                                        }
     239                                        // Finally, update the item/menu data.
     240                                        ui.item.updateParentMenuItemDBId();
     241                                        recalculateMenuItemPositions();
     242                                },
     243                                change: function(e, ui) {
     244                                        // Make sure the placeholder is inside the menu.
     245                                        // Otherwise fix it, or we're in trouble.
     246                                        if( ! ui.placeholder.parent().hasClass('menu') )
     247                                                ui.placeholder.appendTo(menuList);
     248                                               
     249                                        updateDepthRange(ui);
     250                                },
     251                                sort: function(e, ui) {
     252                                        var depth = pxToDepth(ui.item.offset().left - menuLeft);
     253                                        // Check and correct if depth is not within range.
     254                                        if ( depth < minDepth ) depth = minDepth;
     255                                        else if ( depth > maxDepth ) depth = maxDepth;
     256                                       
     257                                        if( depth != currentDepth )
     258                                                updateCurrentDepth(ui, depth);
     259                                }
     260                        });
     261                       
     262                        function updateDepthRange(ui) {
     263                                var prev = ui.placeholder.prev(),
     264                                        next = ui.placeholder.next(), depth;
     265                                       
     266                                // Make sure we don't select the moving item.
     267                                if( prev[0] == ui.item[0] ) prev = prev.prev();
     268                                if( next[0] == ui.item[0] ) next = next.next();
     269                               
     270                                minDepth = (next.length) ? next.menuItemDepth() : 0;
     271                               
     272                                if( prev.length )
     273                                        maxDepth = ( (depth = prev.menuItemDepth() + 1) > globalMaxDepth ) ? globalMaxDepth : depth;
     274                                else
     275                                        maxDepth = 0;
     276                        }
     277                       
     278                        function updateCurrentDepth(ui, depth) {
     279                                ui.placeholder.updateDepthClass( depth, currentDepth );
     280                                currentDepth = depth;
     281                        }
    194282                },
    195283               
    … …  
    210298                        });
    211299                },
     300               
     301                /**
     302                 * An interface for managing default values for input elements
     303                 * that is both JS and accessibility-friendly.
     304                 *
     305                 * Input elements that add the class 'input-with-default-title'
     306                 * will have their values set to the provided HTML title when empty.
     307                 */
     308                setupInputWithDefaultTitle : function() {
     309                        var name = 'input-with-default-title';
     310                       
     311                        $('.' + name).each( function(){
     312                                var $t = $(this), title = $t.attr('title'), val = $t.val();
     313                                $t.data( name, title );
     314                               
     315                                if( '' == val ) $t.val( title );
     316                                else if ( title == val ) return;
     317                                else $t.removeClass( name );
     318                        }).focus( function(){
     319                                var $t = $(this);
     320                                if( $t.val() == $t.data(name) )
     321                                        $t.val('').removeClass( name );
     322                        }).blur( function(){
     323                                var $t = $(this);
     324                                if( '' == $t.val() )
     325                                        $t.val( $t.data(name) ).addClass( name );
     326                        });
     327                },
    212328
    213329                attachMenuMetaListeners : function(formEL) {
    … …  
    215331                                return;
    216332
    217                         var that = this, lwd = 'label-with-default-title';
    218                        
    219                         $('.'+lwd).each(function(){
    220                                 var $t = $(this), title = $t.attr('title'), val = $t.val();
    221                                 $t.data(lwd, title);
    222                                 if( '' == val ) $t.val(title);
    223                                 else if ( title == val ) return;
    224                                 else $t.removeClass(lwd);
    225                         }).focus(function(){
    226                                 var $t = $(this);
    227                                 if( $t.val() == $t.data(lwd) )
    228                                         $t.val('').removeClass(lwd);
    229                         }).blur(function(){
    230                                 var $t = $(this);
    231                                 if( '' == $t.val() )
    232                                         $t.val( $t.data(lwd) ).addClass(lwd);
    233                         });
    234 
     333                        var that = this;
     334                        this.setupInputWithDefaultTitle();
     335                       
    235336                        // auto-suggest for the quick-search boxes
    236337                        $('input.quick-search').each(function(i, el) {
    … …  
    240341                        $(formEL).bind('submit', function(e) {
    241342                                return that.eventSubmitMetaForm.call(that, this, e);
    242                         });
    243                         $(formEL).find('input:submit').click(function() {
    244                                 $(this).siblings('img.waiting').show();
    245343                        });
    246344                },
    … …  
    287385                                }
    288386                        });
    289                 },
    290 
    291                 setupListItemDragAndDrop : function(el) {
    292                         var defLists = el.getElementsByTagName('dl'),
    293                         dropZone = this.makeListItemDropzone(el),
    294                         i = defLists.length;
    295 
    296                         makeDroppable.call(this, dropZone);
    297                         this.makeListItemDraggable(el);
    298 
    299                         while( i-- ) {
    300                                 makeDroppable.call(this, defLists[i]);
    301                         }
    302387                },
    303388
    … …  
    400485
    401486                /**
    402                  * Callback for the drag over action when dragging a list item.
    403                  *
    404                  * @param object draggedEl The DOM element being dragged
    405                  * @param object dropEl The DOM element on top of which we're dropping.
    406                  */
    407                 eventOnDragOver : function(draggedEl, dropEl) {
    408                         activeHovering = true;
    409                         currentDropzone = dropEl;
    410                         dropEl.className += ' sortable-placeholder';
    411                 },
    412 
    413                 /**
    414                  * Callback for the drag out action when dragging a list item.
    415                  *
    416                  * @param object draggedEl The DOM element being dragged
    417                  * @param object dropEl The DOM element on top of which we're dropping.
    418                  */
    419                 eventOnDragOut : function(draggedEl, dropEl) {
    420                         activeHovering = false;
    421 
    422                         /* delay the disappearance of the droppable area so it doesn't flicker in and out */
    423                         (function(that) {
    424                                 setTimeout(function() {
    425                                         if ( that != currentDropzone || ( ! activeHovering && that.className && -1 != that.className.indexOf('sortable-placeholder') ) ) {
    426                                                 that.className = that.className.replace(/sortable-placeholder/g, '');
    427                                         }
    428                                 }, 800);
    429                         })(dropEl);
    430                 },
    431 
    432                 /**
    433                  * Callback for the drop action when dragging and dropping a list item.
    434                  *
    435                  * @param object draggedEl The DOM element being dragged (and now dropped)
    436                  * @param object dropEl The DOM element on top of which we're dropping.
    437                  */
    438                 eventOnDrop : function(draggedEl, dropEl) {
    439                         var dropIntoSublist = !! ( -1 == dropEl.className.indexOf('dropzone') ),
    440                         subLists = dropEl.parentNode.getElementsByTagName('ul'),
    441                         hasSublist = false,
    442                         i = subLists.length,
    443                         subList;
    444 
    445                         activeHovering = false;
    446                        
    447                         dropEl.className = dropEl.className.replace(/sortable-placeholder/g, '');
    448 
    449                         if ( dropIntoSublist ) {
    450                                 while ( i-- ) {
    451                                         if ( subLists[i] && 1 != subLists[i].className.indexOf('sub-menu') ) {
    452                                                 hasSublist = true;
    453                                                 subList = subLists[i];
    454                                         }
    455                                 }
    456 
    457                                 if ( ! hasSublist ) {
    458                                         subList = document.createElement('ul');
    459                                         subList.className = 'sub-menu';
    460                                         dropEl.parentNode.appendChild(subList);
    461                                 }
    462 
    463                                 subList.appendChild(draggedEl);
    464                         } else {
    465                                 dropEl.parentNode.parentNode.insertBefore(draggedEl, dropEl.parentNode);
    466                         }
    467 
    468                         this.recalculateSortOrder(menuList);
    469 
    470                         getParentMenuItemDBId.call(draggedEl);
    471                 },
    472 
    473                 /**
    474487                 * Callback for the meta form submit action listener.
    475488                 *
    … …  
    488501                        re = new RegExp('menu-item\\[(\[^\\]\]*)');
    489502
     503                        thisForm.className = thisForm.className + ' processing',
    490504                        that = this;
    491505                        params['action'] = '';
    … …  
    535549                        $.post( ajaxurl, params, function(menuMarkup) {
    536550                                processMethod.call(that, menuMarkup, params);   
    537                                 $(thisForm).find('img.waiting').hide();
     551                                thisForm.className = thisForm.className.replace(/processing/g, '');
    538552                        });
    539553
    540554                        return false;
    541                 },
    542 
    543                 makeListItemDraggable : function(el) {
    544                         // make menu item draggable
    545                         $(el).draggable({
    546                                 handle: ' > dl',
    547                                 opacity: .8,
    548                                 addClasses: false,
    549                                 helper: 'clone',
    550                                 zIndex: 100
    551                         });
    552                 },
    553 
    554                 /**
    555                  * Add the child element that acts as the dropzone for drag-n-drop.
    556                  *
    557                  * @param object el The parent object to which we'll prepend the dropzone.
    558                  * @return object The dropzone DOM element.
    559                  */
    560                 makeListItemDropzone : function(el) {
    561                         if ( ! el )
    562                                 return false;
    563                         var divs = el.getElementsByTagName('div'),
    564                         i = divs.length,
    565                         dropZone = document.createElement('div');
    566 
    567                         while( i-- ) {
    568                                 if ( divs[i].className && -1 != divs[i].className.indexOf('dropzone') && ( el == divs[i].parentNode ) )
    569                                         return divs[i];
    570                         }
    571 
    572                         dropZone.className = 'dropzone';
    573                         el.insertBefore(dropZone, el.firstChild);
    574                         return dropZone;
    575555                },
    576556
    … …  
    582562                 */
    583563                processAddMenuItemResponse : function( menuMarkup, req ) {
    584                         if ( ! req )
    585                                 req = {};
    586                         var dropZone,
    587                         dummyListItem = document.getElementById(menuList.id + '-dummy-list-item'),
    588                         i,
    589                         listElements,
    590                         wrap = document.createElement('ul');
    591 
    592                         wrap.innerHTML = menuMarkup;
    593                         listElements = wrap.getElementsByTagName('li');
    594                         i = listElements.length;
    595                         while ( i-- ) {
    596                                 this.setupListItemDragAndDrop(listElements[i]);
    597                                 if ( dummyListItem )
    598                                         menuList.insertBefore(listElements[i], dummyListItem);
    599                                 else
    600                                         menuList.appendChild(listElements[i]);
    601                         }
    602 
    603                         this.recalculateSortOrder(menuList);
    604                         this.hideAdvancedMenuItemFields(menuList);
     564                        $(menuMarkup).hideAdvancedMenuItemFields().appendTo( menuList );
    605565
    606566                        /* set custom link form back to defaults */
    … …  
    669629                },
    670630
    671                 recalculateSortOrder : function(parentEl) {
    672                         var allInputs = parentEl.getElementsByTagName('input'),
    673                         i,
    674                         j = 0;
    675 
    676                         for( i = 0; i < allInputs.length; i++ ) {
    677                                 if ( allInputs[i].name && -1 != allInputs[i].name.indexOf('menu-item-position') ) {
    678                                         allInputs[i].value = ++j;
    679                                 }
    680                         }
    681                 },
    682 
    683631                removeMenuItem : function(el) {
    684                         if ( ! el )
    685                                 return false;
    686 
    687                         var subMenus = el.getElementsByTagName('ul'),
    688                         subs,
    689                         i;
    690 
    691                         if ( subMenus[0] ) {
    692                                 subs = subMenus[0].getElementsByTagName('li');
    693                                 for ( i = 0; i < subs.length; i++ ) {
    694                                         if ( subs[i].id && -1 != subs[i].id.indexOf('menu-item-') && subs[i].parentNode == subMenus[0] ) {
    695                                                 el.parentNode.insertBefore(subs[i], el);
    696                                         }
    697                                 }
    698                         }
    699 
    700                         el.className += ' deleting';
    701                         $(el).fadeOut( 350 , function() {
    702                                 this.parentNode.removeChild(this);     
    703                         });
    704                        
    705                         this.recalculateSortOrder(menuList);
     632                        el = $(el)
     633                        var children = el.childMenuItems();
     634                       
     635                        el.addClass('deleting').fadeOut( 350 , function() {
     636                                el.remove();
     637                                children.shiftDepthClass(-1).updateParentMenuItemDBId();
     638                                recalculateMenuItemPositions();
     639                        });
    706640                }
    707641        }
    708642}
    709643
    710 var wpNavMenu = new WPNavMenuHandler();
     644var wpNavMenu = new WPNavMenuHandler(jQuery);
    711645
    712646jQuery(function() {
  • trunk/wp-admin/js/nav-menu.js

    r14333 r14337  
    1 var WPNavMenuHandler=function(){var h=jQuery,a=false,j=null,g,d,m,i,l={},n=function(p,t,q,s){if(p&&p[0]){var r=h.parseJSON(p[0]);if(r.post_title){if(r.ID&&r.post_type){l[r.post_title]={ID:r.ID,object_type:r.post_type}}return r.post_title}}},o=function(p,t,q,s){if(p&&p[0]){var r=h.parseJSON(p[0]);if(r.post_title){return r.post_title}}},b=function(v,u){if(!v){return false}u=u||document;var q=["menu-item-db-id","menu-item-object-id","menu-item-object","menu-item-parent-id","menu-item-position","menu-item-type","menu-item-append","menu-item-title","menu-item-url","menu-item-description","menu-item-attr-title","menu-item-target","menu-item-classes","menu-item-xfn"],p={},r=u.getElementsByTagName("input"),t=r.length,s,w=document.getElementById("nav-menu-meta-object-id").value;while(t--){s=q.length;while(s--){if(r[t]&&r[t].name&&"menu-item["+v+"]["+q[s]+"]"==r[t].name){p[q[s]]=r[t].value}}}return p},c=function(){var t=this.getElementsByTagName("input"),q=t.length,p,s,r;while(q--){if(-1!=t[q].name.indexOf("menu-item-parent-id["+parseInt(this.id.replace("menu-item-",""),10)+"]")){if(!this.parentNode.className||-1==this.parentNode.className.indexOf("sub-menu")){t[q].value=0}else{if("LI"==this.parentNode.parentNode.nodeName&&-1!=this.parentNode.parentNode.id.indexOf("menu-item-")){s=this.parentNode.parentNode;r=s.getElementsByTagName("input");p=r.length;while(p--){if(r[p].name&&-1!=r[p].name.indexOf("menu-item-object-id["+parseInt(s.id.replace("menu-item-",""),10)+"]")){t[q].value=parseInt(r[p].value,10);break}}}}break}}},e=function(p){var q=this;h(p).droppable({accept:".menu li",tolerance:"pointer",drop:function(s,r){q.eventOnDrop(r.draggable[0],this,r,s)},over:function(s,r){q.eventOnDragOver(r.draggable[0],this,r,s)},out:function(s,r){q.eventOnDragOut(r.draggable[0],this,r,s)}})},k,f=function(s){if(!s){return}var q=document.getElementById(s.id+"-dummy-list-item"),p=s.getElementsByTagName("li"),r=p.length;if(!q){q=document.createElement("li");q.id=s.id+"-dummy-list-item";s.appendChild(q);this.setupListItemDragAndDrop(q)}while(r--){this.setupListItemDragAndDrop(p[r])}};return{init:function(){k=document.getElementById("menu-to-edit");this.attachMenuEditListeners();this.attachMenuMetaListeners(document.getElementById("nav-menu-meta"));this.attachTabsPanelListeners();f.call(this,k);this.initToggles()},initToggles:function(){postboxes.add_postbox_toggles("nav-menus");columns.useCheckboxesForHidden();columns.checked=function(p){h(".field-"+p).removeClass("hidden-field")};columns.unchecked=function(p){h(".field-"+p).addClass("hidden-field")};this.hideAdvancedMenuItemFields()},hideAdvancedMenuItemFields:function(p){p=p||".menu";h(".hide-column-tog").not(":checked").each(function(){h(p).find(".field-"+h(this).val()).addClass("hidden-field")})},attachMenuEditListeners:function(){var p=this;h("#update-nav-menu").bind("click",function(q){if(q.target&&q.target.className){if(-1!=q.target.className.indexOf("item-edit")){return p.eventOnClickEditLink(q.target)}else{if(-1!=q.target.className.indexOf("menu-delete")){return p.eventOnClickMenuDelete(q.target)}else{if(-1!=q.target.className.indexOf("item-delete")){return p.eventOnClickMenuItemDelete(q.target)}else{if(-1!=q.target.className.indexOf("item-close")){return p.eventOnClickCloseLink(q.target)}}}}}})},attachMenuMetaListeners:function(q){if(!q){return}var r=this,p="label-with-default-title";h("."+p).each(function(){var u=h(this),t=u.attr("title"),s=u.val();u.data(p,t);if(""==s){u.val(t)}else{if(t==s){return}else{u.removeClass(p)}}}).focus(function(){var s=h(this);if(s.val()==s.data(p)){s.val("").removeClass(p)}}).blur(function(){var s=h(this);if(""==s.val()){s.val(s.data(p)).addClass(p)}});h("input.quick-search").each(function(s,t){r.setupQuickSearchEventListeners(t)});h(q).bind("submit",function(s){return r.eventSubmitMetaForm.call(r,this,s)});h(q).find("input:submit").click(function(){h(this).siblings("img.waiting").show()})},attachTabsPanelListeners:function(){h("#menu-settings-column").bind("click",function(u){if(u.target&&u.target.className&&-1!=u.target.className.indexOf("nav-tab-link")){var v,q=/#(.*)$/.exec(u.target.href),t,w=h(u.target).parents(".inside").first()[0],p=w?w.getElementsByTagName("input"):[],r=p.length;while(r--){p[r].checked=false}h(".tabs-panel",w).each(function(){if(this.className){this.className=this.className.replace("tabs-panel-active","tabs-panel-inactive")}});h(".tabs",w).each(function(){this.className=this.className.replace("tabs","")});u.target.parentNode.className+=" tabs";if(q&&q[1]){v=document.getElementById(q[1]);if(v){v.className=v.className.replace("tabs-panel-inactive","tabs-panel-active")}}return false}else{if(u.target&&u.target.className&&-1!=u.target.className.indexOf("select-all")){var s=/#(.*)$/.exec(u.target.href);if(s&&s[1]){h("#"+s[1]+" .tabs-panel-active input[type=checkbox]").attr("checked","checked");return false}}}})},setupListItemDragAndDrop:function(r){var p=r.getElementsByTagName("dl"),s=this.makeListItemDropzone(r),q=p.length;e.call(this,s);this.makeListItemDraggable(r);while(q--){e.call(this,p[q])}},setupQuickSearchEventListeners:function(p){var q=this;h(p).autocomplete(ajaxurl+"?action=menu-quick-search&type="+p.name,{delay:500,formatItem:n,formatResult:o,minchars:2,multiple:false}).bind("blur",function(t){var r=l[this.value],s=this;if(r){h.post(ajaxurl+"?action=menu-quick-search&type=get-post-item&response-format=markup",r,function(u){q.processQuickSearchQueryResponse.call(q,u,r);l[s.value]=false})}})},eventOnClickEditLink:function(p){var r,q=/#(.*)$/.exec(p.href);if(q&&q[1]){r=h("#"+q[1]);if(0!=r.length){if(r.hasClass("menu-item-edit-inactive")){r.slideDown("fast").siblings("dl").andSelf().removeClass("menu-item-edit-inactive").addClass("menu-item-edit-active")}else{r.slideUp("fast").siblings("dl").andSelf().removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive")}return false}}},eventOnClickCloseLink:function(p){h(p).closest(".menu-item-settings").siblings("dl").find(".item-edit").click();return false},eventOnClickMenuDelete:function(p){if(confirm(navMenuL10n.warnDeleteMenu)){return true}else{return false}},eventOnClickMenuItemDelete:function(p){var s,r,q=this;if(confirm(navMenuL10n.warnDeleteMenuItem)){r=/_wpnonce=([a-zA-Z0-9]*)$/.exec(p.href);if(r&&r[1]){s=parseInt(p.id.replace("delete-",""),10);h.post(ajaxurl,{action:"delete-menu-item","menu-item":s,_wpnonce:r[1]},function(t){if("1"==t){q.removeMenuItem(document.getElementById("menu-item-"+s))}});return false}return true}else{return false}},eventOnDragOver:function(p,q){a=true;j=q;q.className+=" sortable-placeholder"},eventOnDragOut:function(p,q){a=false;(function(r){setTimeout(function(){if(r!=j||(!a&&r.className&&-1!=r.className.indexOf("sortable-placeholder"))){r.className=r.className.replace(/sortable-placeholder/g,"")}},800)})(q)},eventOnDrop:function(s,v){var t=!!(-1==v.className.indexOf("dropzone")),q=v.parentNode.getElementsByTagName("ul"),u=false,r=q.length,p;a=false;v.className=v.className.replace(/sortable-placeholder/g,"");if(t){while(r--){if(q[r]&&1!=q[r].className.indexOf("sub-menu")){u=true;p=q[r]}}if(!u){p=document.createElement("ul");p.className="sub-menu";v.parentNode.appendChild(p)}p.appendChild(s)}else{v.parentNode.parentNode.insertBefore(s,v.parentNode)}this.recalculateSortOrder(k);c.call(s)},eventSubmitMetaForm:function(q,w){var u=q.getElementsByTagName("input"),t=u.length,s,y,p,v,r={},x=function(){},z=new RegExp("menu-item\\[([^\\]]*)");that=this;r.action="";while(t--){if(u[t].name&&-1!=u[t].name.indexOf("menu-item-object-id")&&u[t].checked||("undefined"!=typeof u[t].id&&"custom-menu-item-url"==u[t].id&&""!=u[t].value&&"http://"!=u[t].value)){r.action="add-menu-item";x=that.processAddMenuItemResponse;v=z.exec(u[t].name);p="undefined"==typeof v[1]?0:parseInt(v[1],10);y=b(p);for(s in y){r["menu-item["+p+"]["+s+"]"]=y[s]}u[t].checked=false}else{if(""==r.action&&""!=u[t].value&&u[t].className&&-1!=u[t].className.search(/quick-search\b[^-]/)){r.action="menu-quick-search";r.q=u[t].value;r["response-format"]="markup";r.type=u[t].name;x=that.processQuickSearchQueryResponse}}}r.menu=q.elements.menu.value;r["menu-settings-column-nonce"]=q.elements["menu-settings-column-nonce"].value;h.post(ajaxurl,r,function(A){x.call(that,A,r);h(q).find("img.waiting").hide()});return false},makeListItemDraggable:function(p){h(p).draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100})},makeListItemDropzone:function(r){if(!r){return false}var q=r.getElementsByTagName("div"),p=q.length,s=document.createElement("div");while(p--){if(q[p].className&&-1!=q[p].className.indexOf("dropzone")&&(r==q[p].parentNode)){return q[p]}}s.className="dropzone";r.insertBefore(s,r.firstChild);return s},processAddMenuItemResponse:function(p,u){if(!u){u={}}var v,q=document.getElementById(k.id+"-dummy-list-item"),s,r,t=document.createElement("ul");t.innerHTML=p;r=t.getElementsByTagName("li");s=r.length;while(s--){this.setupListItemDragAndDrop(r[s]);if(q){k.insertBefore(r[s],q)}else{k.appendChild(r[s])}}this.recalculateSortOrder(k);this.hideAdvancedMenuItemFields(k);h("#custom-menu-item-name").val("").blur();h("#custom-menu-item-url").val("http://")},processQuickSearchQueryResponse:function(t,y){if(!y){y={}}var q=document.createElement("ul"),p=document.getElementById("nav-menu-meta"),u,x,r,z,v,w=new RegExp("menu-item\\[([^\\]]*)"),s;r=w.exec(t);if(r&&r[1]){v=r[1];while(p.elements["menu-item["+v+"][menu-item-type]"]){v--}if(v!=r[1]){t=t.replace(new RegExp("menu-item\\["+r[1]+"\\]","g"),"menu-item["+v+"]")}}q.innerHTML=t;x=q.getElementsByTagName("li");if(x[0]&&y.object_type){s=document.getElementById(y.object_type+"-search-checklist");if(s){s.appendChild(x[0])}}else{if(y.type){r=/quick-search-(posttype|taxonomy)-([a-zA-Z_-]*)/.exec(y.type);if(r&&r[2]){s=document.getElementById(r[2]+"-search-checklist");if(s){u=x.length;if(!u){z=document.createElement("li");z.appendChild(document.createTextNode(navMenuL10n.noResultsFound));s.appendChild(z)}while(u--){s.appendChild(x[u])}}}}}},recalculateSortOrder:function(r){var s=r.getElementsByTagName("input"),q,p=0;for(q=0;q<s.length;q++){if(s[q].name&&-1!=s[q].name.indexOf("menu-item-position")){s[q].value=++p}}},removeMenuItem:function(r){if(!r){return false}var s=r.getElementsByTagName("ul"),q,p;if(s[0]){q=s[0].getElementsByTagName("li");for(p=0;p<q.length;p++){if(q[p].id&&-1!=q[p].id.indexOf("menu-item-")&&q[p].parentNode==s[0]){r.parentNode.insertBefore(q[p],r)}}}r.className+=" deleting";h(r).fadeOut(350,function(){this.parentNode.removeChild(this)});this.recalculateSortOrder(k)}}};var wpNavMenu=new WPNavMenuHandler();jQuery(function(){wpNavMenu.init()});
     1var WPNavMenuHandler=function(d){var h={},f=30,c=11,j=function(l,p,m,o){if(l&&l[0]){var n=d.parseJSON(l[0]);if(n.post_title){if(n.ID&&n.post_type){h[n.post_title]={ID:n.ID,object_type:n.post_type}}return n.post_title}}},k=function(l,p,m,o){if(l&&l[0]){var n=d.parseJSON(l[0]);if(n.post_title){return n.post_title}}},b=function(r,q){if(!r){return false}q=q||document;var m=["menu-item-db-id","menu-item-object-id","menu-item-object","menu-item-parent-id","menu-item-position","menu-item-type","menu-item-append","menu-item-title","menu-item-url","menu-item-description","menu-item-attr-title","menu-item-target","menu-item-classes","menu-item-xfn"],l={},n=q.getElementsByTagName("input"),p=n.length,o,s=document.getElementById("nav-menu-meta-object-id").value;while(p--){o=m.length;while(o--){if(n[p]&&n[p].name&&"menu-item["+r+"]["+m[o]+"]"==n[p].name){l[m[o]]=n[p].value}}}return l},a=function(){g.find(".menu-item-data-position").val(function(l){return l+1})},e=function(l){return l*f},i=function(l){return Math.floor(l/f)},g;d.fn.extend({menuItemDepth:function(){return i(this.eq(0).css("margin-left").slice(0,-2))},updateDepthClass:function(m,l){return this.each(function(){var n=d(this);l=l||n.menuItemDepth();d(this).removeClass("menu-item-depth-"+l).addClass("menu-item-depth-"+m)})},shiftDepthClass:function(l){return this.each(function(){var m=d(this),n=m.menuItemDepth();d(this).removeClass("menu-item-depth-"+n).addClass("menu-item-depth-"+(n+l))})},childMenuItems:function(){var l=d();this.each(function(){var m=d(this),o=m.menuItemDepth(),n=m.next();while(n.length&&n.menuItemDepth()>o){l=l.add(n);n=n.next()}});return l},updateParentMenuItemDBId:function(){return this.each(function(){var n=d(this),l=n.find(".menu-item-data-parent-id"),o=n.menuItemDepth(),m=n.prev();if(o==0){l.val(0)}else{while(m.menuItemDepth()!=o-1){m=m.prev()}l.val(m.find(".menu-item-data-object-id").val())}})},hideAdvancedMenuItemFields:function(){return this.each(function(){var l=d(this);d(".hide-column-tog").not(":checked").each(function(){l.find(".field-"+d(this).val()).addClass("hidden-field")})})},});return{init:function(){g=d("#menu-to-edit");this.attachMenuEditListeners();this.attachMenuMetaListeners(document.getElementById("nav-menu-meta"));this.attachTabsPanelListeners();if(g.length){this.initSortables()}this.initToggles()},initToggles:function(){postboxes.add_postbox_toggles("nav-menus");columns.useCheckboxesForHidden();columns.checked=function(l){d(".field-"+l).removeClass("hidden-field")};columns.unchecked=function(l){d(".field-"+l).addClass("hidden-field")};g.hideAdvancedMenuItemFields()},initSortables:function(){var o=0,m,p,r,n=g.offset().left;g.sortable({handle:" > dl",placeholder:"sortable-placeholder",start:function(w,x){var v,z,s,y,t,A,u=x.item.children(".menu-item-transport");m=x.item.menuItemDepth();l(x,m);y=(x.item.next()[0]==x.placeholder[0])?x.item.next():x.item;t=y.childMenuItems();u.append(t);q(x);z=u.outerHeight();z+=(z>0)?(x.placeholder.css("margin-top").slice(0,-2)*1):0;z+=x.item.outerHeight();z-=2;x.placeholder.height(z);A=m;t.each(function(){var B=d(this).menuItemDepth();A=(B>A)?B:A});s=x.item.find("dl dt").outerWidth();s+=e(A-m);s-=2;x.placeholder.width(s)},stop:function(v,u){var t,s=o-m;t=u.item.children(".menu-item-transport").children().insertAfter(u.item);if(s!=0){u.item.updateDepthClass(o);t.shiftDepthClass(s)}u.item.updateParentMenuItemDBId();a()},change:function(t,s){if(!s.placeholder.parent().hasClass("menu")){s.placeholder.appendTo(g)}q(s)},sort:function(t,s){var u=i(s.item.offset().left-n);if(u<p){u=p}else{if(u>r){u=r}}if(u!=o){l(s,u)}}});function q(u){var t=u.placeholder.prev(),s=u.placeholder.next(),v;if(t[0]==u.item[0]){t=t.prev()}if(s[0]==u.item[0]){s=s.next()}p=(s.length)?s.menuItemDepth():0;if(t.length){r=((v=t.menuItemDepth()+1)>c)?c:v}else{r=0}}function l(s,t){s.placeholder.updateDepthClass(t,o);o=t}},attachMenuEditListeners:function(){var l=this;d("#update-nav-menu").bind("click",function(m){if(m.target&&m.target.className){if(-1!=m.target.className.indexOf("item-edit")){return l.eventOnClickEditLink(m.target)}else{if(-1!=m.target.className.indexOf("menu-delete")){return l.eventOnClickMenuDelete(m.target)}else{if(-1!=m.target.className.indexOf("item-delete")){return l.eventOnClickMenuItemDelete(m.target)}else{if(-1!=m.target.className.indexOf("item-close")){return l.eventOnClickCloseLink(m.target)}}}}}})},setupInputWithDefaultTitle:function(){var l="input-with-default-title";d("."+l).each(function(){var o=d(this),n=o.attr("title"),m=o.val();o.data(l,n);if(""==m){o.val(n)}else{if(n==m){return}else{o.removeClass(l)}}}).focus(function(){var m=d(this);if(m.val()==m.data(l)){m.val("").removeClass(l)}}).blur(function(){var m=d(this);if(""==m.val()){m.val(m.data(l)).addClass(l)}})},attachMenuMetaListeners:function(l){if(!l){return}var m=this;this.setupInputWithDefaultTitle();d("input.quick-search").each(function(n,o){m.setupQuickSearchEventListeners(o)});d(l).bind("submit",function(n){return m.eventSubmitMetaForm.call(m,this,n)})},attachTabsPanelListeners:function(){d("#menu-settings-column").bind("click",function(q){if(q.target&&q.target.className&&-1!=q.target.className.indexOf("nav-tab-link")){var r,m=/#(.*)$/.exec(q.target.href),p,s=d(q.target).parents(".inside").first()[0],l=s?s.getElementsByTagName("input"):[],n=l.length;while(n--){l[n].checked=false}d(".tabs-panel",s).each(function(){if(this.className){this.className=this.className.replace("tabs-panel-active","tabs-panel-inactive")}});d(".tabs",s).each(function(){this.className=this.className.replace("tabs","")});q.target.parentNode.className+=" tabs";if(m&&m[1]){r=document.getElementById(m[1]);if(r){r.className=r.className.replace("tabs-panel-inactive","tabs-panel-active")}}return false}else{if(q.target&&q.target.className&&-1!=q.target.className.indexOf("select-all")){var o=/#(.*)$/.exec(q.target.href);if(o&&o[1]){d("#"+o[1]+" .tabs-panel-active input[type=checkbox]").attr("checked","checked");return false}}}})},setupQuickSearchEventListeners:function(l){var m=this;d(l).autocomplete(ajaxurl+"?action=menu-quick-search&type="+l.name,{delay:500,formatItem:j,formatResult:k,minchars:2,multiple:false}).bind("blur",function(p){var n=h[this.value],o=this;if(n){d.post(ajaxurl+"?action=menu-quick-search&type=get-post-item&response-format=markup",n,function(q){m.processQuickSearchQueryResponse.call(m,q,n);h[o.value]=false})}})},eventOnClickEditLink:function(l){var n,m=/#(.*)$/.exec(l.href);if(m&&m[1]){n=d("#"+m[1]);if(0!=n.length){if(n.hasClass("menu-item-edit-inactive")){n.slideDown("fast").siblings("dl").andSelf().removeClass("menu-item-edit-inactive").addClass("menu-item-edit-active")}else{n.slideUp("fast").siblings("dl").andSelf().removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive")}return false}}},eventOnClickCloseLink:function(l){d(l).closest(".menu-item-settings").siblings("dl").find(".item-edit").click();return false},eventOnClickMenuDelete:function(l){if(confirm(navMenuL10n.warnDeleteMenu)){return true}else{return false}},eventOnClickMenuItemDelete:function(l){var o,n,m=this;if(confirm(navMenuL10n.warnDeleteMenuItem)){n=/_wpnonce=([a-zA-Z0-9]*)$/.exec(l.href);if(n&&n[1]){o=parseInt(l.id.replace("delete-",""),10);d.post(ajaxurl,{action:"delete-menu-item","menu-item":o,_wpnonce:n[1]},function(p){if("1"==p){m.removeMenuItem(document.getElementById("menu-item-"+o))}});return false}return true}else{return false}},eventSubmitMetaForm:function(m,s){var q=m.getElementsByTagName("input"),p=q.length,o,u,l,r,n={},t=function(){},v=new RegExp("menu-item\\[([^\\]]*)");m.className=m.className+" processing",that=this;n.action="";while(p--){if(q[p].name&&-1!=q[p].name.indexOf("menu-item-object-id")&&q[p].checked||("undefined"!=typeof q[p].id&&"custom-menu-item-url"==q[p].id&&""!=q[p].value&&"http://"!=q[p].value)){n.action="add-menu-item";t=that.processAddMenuItemResponse;r=v.exec(q[p].name);l="undefined"==typeof r[1]?0:parseInt(r[1],10);u=b(l);for(o in u){n["menu-item["+l+"]["+o+"]"]=u[o]}q[p].checked=false}else{if(""==n.action&&""!=q[p].value&&q[p].className&&-1!=q[p].className.search(/quick-search\b[^-]/)){n.action="menu-quick-search";n.q=q[p].value;n["response-format"]="markup";n.type=q[p].name;t=that.processQuickSearchQueryResponse}}}n.menu=m.elements.menu.value;n["menu-settings-column-nonce"]=m.elements["menu-settings-column-nonce"].value;d.post(ajaxurl,n,function(w){t.call(that,w,n);m.className=m.className.replace(/processing/g,"")});return false},processAddMenuItemResponse:function(l,m){d(l).hideAdvancedMenuItemFields().appendTo(g);d("#custom-menu-item-name").val("").blur();d("#custom-menu-item-url").val("http://")},processQuickSearchQueryResponse:function(p,u){if(!u){u={}}var m=document.createElement("ul"),l=document.getElementById("nav-menu-meta"),q,t,n,v,r,s=new RegExp("menu-item\\[([^\\]]*)"),o;n=s.exec(p);if(n&&n[1]){r=n[1];while(l.elements["menu-item["+r+"][menu-item-type]"]){r--}if(r!=n[1]){p=p.replace(new RegExp("menu-item\\["+n[1]+"\\]","g"),"menu-item["+r+"]")}}m.innerHTML=p;t=m.getElementsByTagName("li");if(t[0]&&u.object_type){o=document.getElementById(u.object_type+"-search-checklist");if(o){o.appendChild(t[0])}}else{if(u.type){n=/quick-search-(posttype|taxonomy)-([a-zA-Z_-]*)/.exec(u.type);if(n&&n[2]){o=document.getElementById(n[2]+"-search-checklist");if(o){q=t.length;if(!q){v=document.createElement("li");v.appendChild(document.createTextNode(navMenuL10n.noResultsFound));o.appendChild(v)}while(q--){o.appendChild(t[q])}}}}}},removeMenuItem:function(m){m=d(m);var l=m.childMenuItems();m.addClass("deleting").fadeOut(350,function(){m.remove();l.shiftDepthClass(-1).updateParentMenuItemDBId();a()})}}};var wpNavMenu=new WPNavMenuHandler(jQuery);jQuery(function(){wpNavMenu.init()});
  • trunk/wp-admin/nav-menus.php

    r14333 r14337  
    385385                                                                <label class="menu-name-label howto open-label" for="menu-name">
    386386                                                                        <span><?php _e('Menu Name'); ?></span>
    387                                                                         <input name="menu-name" type="text" class="menu-name regular-text menu-item-textbox label-with-default-title" title="Enter menu name here." value="<?php echo esc_attr( $nav_menu_selected_title  ); ?>" />
     387                                                                        <input name="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="Enter menu name here." value="<?php echo esc_attr( $nav_menu_selected_title  ); ?>" />
    388388                                                                        <br class="clear" />
    389389                                                                </label>
  • trunk/wp-includes/script-loader.php

    r14333 r14337  
    394394
    395395                // Custom Navigation
    396                 $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100502' );
     396                $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100502a' );
    397397                $scripts->localize( 'nav-menu', 'navMenuL10n', array(
    398398                        'custom' => _x('Custom', 'menu nav item type'),
    … …  
    475475        $styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
    476476        $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
    477         $styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100429a' );
     477        $styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100501a' );
    478478
    479479        foreach ( $rtl_styles as $rtl_style ) {
Note: See TracChangeset for help on using the changeset viewer.