Changeset 4458 for trunk/wp-includes/js/list-manipulation-js.php
- Timestamp:
- 11/08/2006 09:23:41 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/js/list-manipulation-js.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/list-manipulation-js.php
r4424 r4458 1 <?php 2 @require_once('../../wp-config.php'); 3 cache_javascript_headers(); 4 $handler = get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php'; 5 ?> 1 <?php @require_once('../../wp-config.php'); cache_javascript_headers(); ?> 6 2 addLoadEvent(function(){theList=new listMan();}); 7 3 function deleteSomething(what,id,message,obj){if(!obj)obj=theList;if(!message)message="<?php printf(__('Are you sure you want to delete this %s?'),"'+what+'"); ?>";if(confirm(message))return obj.ajaxDelete(what,id);else return false;} … … 11 7 Object.extend(listMan.prototype, { 12 8 ajaxRespEl: 'ajax-response', 13 ajaxHandler: '<?php echo $handler; ?>',9 ajaxHandler: false, 14 10 inputData: '', 15 11 clearInputs: [], … … 52 48 tempObj.showLink = id; 53 49 }); 50 ajaxAdd.myResponseElement.update(tempObj.showLink ? ( "<div id='jumplink' class='updated fade'><p><a href='#" + what + '-' + tempObj.showLink + "'><?php _e('Jump to new item'); ?></a></p></div>" ) : ''); 54 51 } 55 ajaxAdd.myResponseElement.update(tempObj.showLink ? ( "<div id='jumplink' class='updated fade'><p><a href='#" + what + '-' + tempObj.showLink + "'><?php _e('Jump to new item'); ?></a></p></div>" ) : '');56 52 if ( tempObj.addComplete && typeof tempObj.addComplete == 'function' ) 57 53 tempObj.addComplete( what, where, update, transport ); … … 59 55 ajaxAdd.restoreInputs = null; 60 56 }); 61 ajaxAdd.addOnWPError( function(transport) { tempObj.restoreForm(ajaxAdd.restoreInputs); }); 57 if ( !update ) 58 ajaxAdd.addOnWPError( function(transport) { tempObj.restoreForm(ajaxAdd.restoreInputs); }); 62 59 ajaxAdd.request(ajaxAdd.url); 63 this.clear(); 60 if ( !update ) 61 this.clear(); 64 62 return false; 65 63 }, … … 263 261 } 264 262 } 265 //Pretty func adapted from ALA http://www.alistapart.com/articles/gettingstartedwithajax266 function getNodeValue(tree,el){try { var r = tree.getElementsByTagName(el)[0].firstChild.nodeValue; } catch(err) { var r = null; } return r; }267 263 //Generic but lame JS closure 268 264 function encloseFunc(f){var a=arguments[1];return function(){return f(a);}}
Note: See TracChangeset
for help on using the changeset viewer.