Changeset 2536
- Timestamp:
- 04/16/2005 04:31:38 PM (20 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-footer.php
r1664 r2536 10 10 <?php do_action('admin_footer', ''); ?> 11 11 12 <?php if ( isset( $editing ) ) : ?> 13 <script type="text/javascript"> 14 WhenLoaded(); 15 </script> 16 <?php endif; ?> 17 12 18 </body> 13 19 </html> -
trunk/wp-admin/admin-header.php
r2406 r2536 79 79 <?php endif; ?> 80 80 81 <?php if ( isset( $editing ) ) : ?> 82 var elem; 83 var eID = 'content'; 84 var cID = 'twWPAutoSave'; 85 86 function createCookie(name,value,days){ 87 if (days) 88 { 89 var date = new Date(); 90 date.setTime(date.getTime()+(days*24*60*60*1000)); 91 var expires = "; expires="+date.toGMTString(); 92 } 93 else var expires = ""; 94 document.cookie = name + "=" + escape(value ) + expires + "; path=/"; 95 } 96 97 function eraseCookie(name){ 98 createCookie(name,"",-1); 99 } 100 101 function readCookie(name) 102 { 103 var dc = document.cookie; 104 var prefix = name + "="; 105 var begin = dc.indexOf("; " + prefix); 106 if (begin == -1) 107 { 108 begin = dc.indexOf(prefix); 109 if (begin != 0) return null; 110 } 111 else 112 { 113 begin += 2; 114 } 115 var end = document.cookie.indexOf(";", begin); 116 if (end == -1) 117 { 118 end = dc.length; 119 } 120 return unescape(dc.substring(begin + prefix.length, end)); 121 } 122 123 function KeyPressEvent(event){ 124 if (document.all) { 125 event = window.event; 126 } 127 if (event.which){ 128 key = event.which; 129 } else { 130 key = event.keyCode; 131 } 132 createCookie(cID,elem.value, 7) 133 } 134 135 function WhenLoaded(){ 136 var postdiv; 137 if (postdiv = document.getElementById('poststuff')){ 138 var data = postdiv.innerHTML 139 var index = data.indexOf('<p class="submit">') + 18; 140 var after = data.substring(index); 141 var before = data.substring(0, index); 142 postdiv.innerHTML = before + '<input type="submit" id="AutoRestore" value="Restore" onclick="restoreData(); return false;" />' + after; 143 144 edCanvas = document.getElementById('content'); //re-enable quicktags with correct element (original content element was overwritten). 145 146 elem = document.getElementById('content'); 147 elem.onkeyup = KeyPressEvent; 148 } 149 } 150 151 function restoreData(){ 152 elem.value = readCookie(cID); 153 } 154 <?php endif; ?> 81 155 //]]> 82 156 </script> -
trunk/wp-admin/post.php
r2524 r2536 25 25 // Fix submenu highlighting for pages. 26 26 if (false !== strpos($_SERVER['HTTP_REFERER'], 'edit-pages.php')) $submenu_file = 'page-new.php'; 27 28 $editing = true; 27 29 28 30 switch($action) {
Note: See TracChangeset
for help on using the changeset viewer.