Changeset 2776 for trunk/wp-admin/admin-header.php
- Timestamp:
- 08/10/2005 11:39:15 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r2767 r2776 101 101 <script type="text/javascript" src="dbx.js"></script> 102 102 <script type="text/javascript" src="dbx-key.js"></script> 103 104 <?php if ( current_user_can('manage_categories') ) : ?> 103 105 <script type="text/javascript" src="tw-sack.js"></script> 104 106 <script type="text/javascript"> 105 107 var ajaxCat = new sack(); 108 var newcat; 109 110 function newCatAddIn() { 111 var ajaxcat = document.createElement('p'); 112 ajaxcat.id = 'ajaxcat'; 113 114 newcat = document.createElement('input'); 115 newcat.type = 'text'; 116 newcat.name = 'newcat'; 117 newcat.id = 'newcat'; 118 newcat.size = '16'; 119 newcat.setAttribute('autocomplete', 'off'); 120 newcat.setAttribute('onkeypress', 'return ajaxNewCatKeyPress(event);'); 121 122 var newcatSub = document.createElement('input'); 123 newcatSub.type = 'button'; 124 newcatSub.name = 'Button'; 125 newcatSub.value = '+'; 126 newcatSub.setAttribute('onclick', 'ajaxNewCat();'); 127 128 ajaxcat.appendChild(newcat); 129 ajaxcat.appendChild(newcatSub); 130 document.getElementById('categorychecklist').parentNode.appendChild(ajaxcat); 131 } 132 133 addLoadEvent(newCatAddIn); 106 134 107 135 function getResponseElement() { 108 var p = document.getElementById('ajaxcatresponse');136 var p = document.getElementById('ajaxcatresponse'); 109 137 if (!p) { 110 138 p = document.createElement('p'); … … 166 194 newCheck.id = 'category-' + id; 167 195 168 var newLabelText = document.createTextNode(' ' + document.getElementById('newcat').value);196 var newLabelText = document.createTextNode(' ' + newcat.value); 169 197 newLabel.appendChild(newLabelText); 170 198 Fat.fade_all(); 171 199 newLabel.setAttribute('class', 'selectit'); 172 200 } 173 } 174 175 function ajaxNewCatKeyUp(e) { 201 newcat.value = ''; 202 } 203 204 function ajaxNewCatKeyPress(e) { 176 205 if (!e) { 177 206 if (window.event) { … … 183 212 if (e.keyCode == 13) { 184 213 ajaxNewCat(); 214 e.returnValue = false; 215 e.cancelBubble = true; 216 return false; 185 217 } 186 218 } … … 200 232 <?php endif; ?> 201 233 234 <?php endif; ?> 235 202 236 <?php do_action('admin_head'); ?> 203 237 </head>
Note: See TracChangeset
for help on using the changeset viewer.