Changeset 3684
- Timestamp:
- 04/04/2006 12:16:27 AM (20 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 8 edited
-
cat-js.php (modified) (1 diff)
-
categories.js (modified) (1 diff)
-
categories.php (modified) (3 diffs)
-
custom-fields.js (modified) (2 diffs)
-
edit-link-form.php (modified) (1 diff)
-
list-manipulation-js.php (modified) (4 diffs)
-
users.js (modified) (1 diff)
-
wp-admin.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/cat-js.php
r3669 r3684 3 3 header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true); 4 4 ?> 5 addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList. clearInputs.push('newcat');catList.topAdder=1;catList.alt=0});5 addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.topAdder=1;catList.alt=0;catList.showLink=0;}); 6 6 addLoadEvent(newCatAddIn); 7 7 function newCatAddIn() { -
trunk/wp-admin/categories.js
r3660 r3684 3 3 if (!theList.theList) return false; 4 4 document.forms.addcat.submit.onclick = function(e) {return killSubmit('theList.ajaxAdder("cat", "addcat");', e); }; 5 theList.clearInputs.push('cat_name','category_parent','category_description');6 5 } -
trunk/wp-admin/categories.php
r3675 r3684 148 148 </table> 149 149 150 <div id="ajax-response"></div>151 152 150 </div> 153 151 … … 160 158 <h2><?php _e('Add New Category') ?></h2> 161 159 <form name="addcat" id="addcat" action="categories.php" method="post"> 162 163 <p><?php _e('Name:') ?><br /> 160 <div class="alignleft"><?php _e('Name:') ?><br /> 164 161 <input type="text" name="cat_name" id="cat_name" value="" /></p> 165 162 <p><?php _e('Category parent:') ?><br /> … … 167 164 <option value='0'><?php _e('None') ?></option> 168 165 <?php wp_dropdown_cats(0); ?> 169 </select></p> 166 </select> 167 </div> 168 <div id="ajax-response" class="alignleft"></div> 169 <br class="clear" /> 170 170 <p><?php _e('Description: (optional)') ?> <br /> 171 171 <textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p> -
trunk/wp-admin/custom-fields.js
r3660 r3684 1 1 addLoadEvent(customFieldsAddIn); 2 2 function customFieldsAddIn() { 3 theList.showLink=0; 3 4 if (!theList.theList) return false; 4 5 inputs = theList.theList.getElementsByTagName('input'); … … 15 16 document.getElementById('metakeyinput').onkeypress = function(e) {return killSubmit('theList.inputData+="&id="+document.getElementById("post_ID").value;theList.ajaxAdder("meta", "newmeta", customFieldsOnComplete);', e); }; 16 17 document.getElementById('updatemetasub').onclick = function(e) {return killSubmit('theList.inputData+="&id="+document.getElementById("post_ID").value;theList.ajaxAdder("meta", "newmeta", customFieldsOnComplete);', e); }; 17 theList.clearInputs.push('metakeyselect','metakeyinput','metavalue');18 18 } 19 19 function customFieldsOnComplete() { -
trunk/wp-admin/edit-link-form.php
r3570 r3684 41 41 <div class="dbx-content"> 42 42 <p id="jaxcat"></p> 43 <div id="categorychecklist"><?php dropdown_categories(get_settings('default_link_category')); ?></div></div> 43 <ul id="categorychecklist"><?php dropdown_categories(get_settings('default_link_category')); ?></ul> 44 </div> 44 45 </fieldset> 45 46 -
trunk/wp-admin/list-manipulation-js.php
r3677 r3684 8 8 9 9 function WPAjax(file, responseEl){//class WPAjax extends sack 10 this.getResponseElement=function(r){var p=document.getElementById(r+'-p');if(!p){p=document.createElement('span');p.id=r+' ajax-response-p';document.getElementById(r).appendChild(p);}this.myResponseElement=p; }10 this.getResponseElement=function(r){var p=document.getElementById(r+'-p');if(!p){p=document.createElement('span');p.id=r+'-p';document.getElementById(r).appendChild(p);}this.myResponseElement=p; } 11 11 this.parseAjaxResponse=function(){ 12 if(isNaN(this.response)){this.myResponseElement.innerHTML='<div class="error"> '+this.response+'</div>';return false;}12 if(isNaN(this.response)){this.myResponseElement.innerHTML='<div class="error"><p>'+this.response+'</p></div>';return false;} 13 13 this.response=parseInt(this.response,10); 14 if(-1==this.response){this.myResponseElement.innerHTML="< ?php _e("You don't have permission to do that."); ?>";return false;}15 else if(0==this.response){this.myResponseElement.innerHTML="< ?php _e("Something odd happened. Try refreshing the page? Either that or what you tried to change never existed in the first place."); ?>";return false;}14 if(-1==this.response){this.myResponseElement.innerHTML="<div class='error'><p><?php _e("You don't have permission to do that."); ?></p></div>";return false;} 15 else if(0==this.response){this.myResponseElement.innerHTML="<div class='error'><p><?php _e("Something odd happened. Try refreshing the page? Either that or what you tried to change never existed in the first place."); ?></p></div>";return false;} 16 16 return true; 17 17 } 18 18 this.parseAjaxResponseXML=function(){ 19 19 if(this.responseXML&&typeof this.responseXML=='object')return true; 20 if(isNaN(this.response)){this.myResponseElement.innerHTML='<div class="error"> '+this.response+'</div>';return false;}20 if(isNaN(this.response)){this.myResponseElement.innerHTML='<div class="error"><p>'+this.response+'</p></div>';return false;} 21 21 var r=parseInt(this.response,10); 22 if(-1==r){this.myResponseElement.innerHTML="< ?php _e("You don't have permission to do that."); ?>";}23 else if(0==r){this.myResponseElement.innerHTML="< ?php _e("Invalid Entry."); ?>";}22 if(-1==r){this.myResponseElement.innerHTML="<div class='error'><p><?php _e("You don't have permission to do that."); ?></p></div>";} 23 else if(0==r){this.myResponseElement.innerHTML="<div class='error'><p><?php _e("Invalid Entry."); ?></p></div>";} 24 24 return false; 25 25 } … … 37 37 this.theList=null; 38 38 this.ajaxRespEl=null; 39 this.inputData='';this.clearInputs=new Array(); 39 this.inputData='';this.clearInputs=new Array();this.showLink=1; 40 40 this.topAdder=0;this.alt='alternate';this.recolorPos;this.reg_color='#FFFFFF';this.alt_color='#F1F1F1'; 41 41 var listType;var listItems; … … 58 58 else tempObj.addListItem(getNodeValue(newItems[c],'newitem'),newItems.length); 59 59 }} 60 this.myResponseElement.innerHTML='';tempObj.inputData=''; 60 tempObj.inputData=''; 61 if(tempObj.showLink){this.myResponseElement.innerHTML='<div id="jumplink" class="updated fade"><p><a href="#'+what+'-'+id+'"><?php _e('Jump to new item'); ?></a></p></div>';} 62 else this.myResponseElement.innerHTML=''; 61 63 for(var i=0;i<tempObj.clearInputs.length;i++){try{var theI=document.getElementById(tempObj.clearInputs[i]);if(theI.tagName.match(/select/i))theI.selectedIndex=0;else theI.value='';}catch(e){}} 62 64 if(onComplete&&typeof onComplete=='function')onComplete(); 63 tempObj.recolorList(tempObj.recolorPos,1000) 65 tempObj.recolorList(tempObj.recolorPos,1000); 64 66 } 65 67 this.ajaxAdd.runAJAX('action='+(update?'update-':'add-')+what+this.inputData); … … 124 126 if('action'==inputs[a][i].name)continue; 125 127 if('text'==inputs[a][i].type||'password'==inputs[a][i].type||'hidden'==inputs[a][i].type||inputs[a][i].tagName.match(/textarea/i)){ 126 this.inputData+='&'+inputs[a][i].name+'='+encodeURIComponent(inputs[a][i].value); 128 this.inputData+='&'+inputs[a][i].name+'='+encodeURIComponent(inputs[a][i].value);if('hidden'!=inputs[a][i].type)this.clearInputs.push(inputs[a][i].id); 127 129 }else if(inputs[a][i].tagName.match(/select/i)){ 128 this.inputData+='&'+inputs[a][i].name+'='+encodeURIComponent(inputs[a][i].options[inputs[a][i].selectedIndex].value); 130 this.inputData+='&'+inputs[a][i].name+'='+encodeURIComponent(inputs[a][i].options[inputs[a][i].selectedIndex].value);this.clearInputs.push(inputs[a][i].id); 129 131 } 130 132 } -
trunk/wp-admin/users.js
r3680 r3684 17 17 var role = roleEl.options[roleEl.selectedIndex].value; 18 18 if ( !theUserLists['role-' + role] ) return true; 19 theUserLists['role-' + role].clearInputs.push('user_login', 'first_name', 'last_name', 'email', 'url', 'pass1', 'pass2', 'role');20 19 return theUserLists['role-' + role].ajaxAdder('user', 'adduser'); 21 20 } -
trunk/wp-admin/wp-admin.css
r3660 r3684 628 628 } 629 629 630 #templateside h3, #postcustom p {630 #templateside h3, #postcustom p.submit { 631 631 margin: 0; 632 632 } … … 969 969 padding: 0; 970 970 } 971 #ajax-response.alignleft { 972 margin-left: 2em; 973 }
Note: See TracChangeset
for help on using the changeset viewer.