Changeset 1856
- Timestamp:
- 11/15/2004 08:52:34 PM (21 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
-
admin-header.php (modified) (1 diff)
-
link-manager.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r1837 r1856 9 9 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" /> 10 10 11 <?php if ( isset($xfn)) : ?>11 <?php if ( isset($xfn) ) : ?> 12 12 <script type="text/javascript"> 13 13 //<![CDATA[ 14 15 14 function GetElementsWithClassName(elementName, className) { 16 15 var allElements = document.getElementsByTagName(elementName); 17 16 var elemColl = new Array(); 18 17 for (i = 0; i < allElements.length; i++) { 19 if (allElements[i].className == className) {20 elemColl[elemColl.length] = allElements[i];21 }18 if (allElements[i].className == className) { 19 elemColl[elemColl.length] = allElements[i]; 20 } 22 21 } 23 22 return elemColl; 24 23 } 25 24 25 function meChecked() { 26 var undefined; 27 var eMe = document.getElementById('me'); 28 if (eMe == undefined) return false; 29 else return eMe.checked; 30 } 31 32 function upit() { 33 var isMe = meChecked(); //document.getElementById('me').checked; 34 var inputColl = GetElementsWithClassName('input', 'valinp'); 35 var results = document.getElementById('rel'); 36 var linkText, linkUrl, inputs = ''; 37 for (i = 0; i < inputColl.length; i++) { 38 inputColl[i].disabled = isMe; 39 inputColl[i].parentNode.className = isMe ? 'disabled' : ''; 40 if (!isMe && inputColl[i].checked && inputColl[i].value != '') { 41 inputs += inputColl[i].value + ' '; 42 } 43 } 44 inputs = inputs.substr(0,inputs.length - 1); 45 if (isMe) inputs='me'; 46 results.value = inputs; 47 } 48 26 49 function blurry() { 27 50 if (!document.getElementById) return; 28 51 29 52 var aInputs = document.getElementsByTagName('input'); 30 31 for (var i = 0; i < aInputs.length; i++) { 32 aInputs[i].onclick = function() { 33 var inputColl = GetElementsWithClassName('input','valinp'); 34 var rel = document.getElementById('rel'); 35 var inputs = ''; 36 for (i = 0; i < inputColl.length; i++) { 37 if (inputColl[i].checked) { 38 if (inputColl[i].value != '') inputs += inputColl[i].value + ' '; 39 } 40 } 41 inputs = inputs.substr(0,inputs.length - 1); 42 if (rel != null) { 43 rel.value = inputs; 44 } 45 } 46 47 aInputs[i].onkeyup = function() { 48 var inputColl = GetElementsWithClassName('input','valinp'); 49 var rel = document.getElementById('rel'); 50 var inputs = ''; 51 for (i = 0; i < inputColl.length; i++) { 52 if (inputColl[i].checked) { 53 inputs += inputColl[i].value + ' '; 54 } 55 } 56 inputs = inputs.substr(0,inputs.length - 1); 57 if (rel != null) { 58 rel.value = inputs; 59 } 60 } 61 53 54 for (var i = 0; i < aInputs.length; i++) { 55 aInputs[i].onclick = aInputs[i].onkeyup = upit; 62 56 } 63 57 } -
trunk/wp-admin/link-manager.php
r1818 r1856 10 10 function xfn_check($class, $value = '', $type = 'check') { 11 11 global $link_rel; 12 if ('' != $value && strstr($link_rel, $value)) { 12 $rels = preg_split('/\s+/', $link_rel); 13 14 if ('' != $value && in_array($value, $rels) ) { 13 15 echo ' checked="checked"'; 14 16 } 17 15 18 if ('' == $value) { 16 19 if ('family' == $class && !strstr($link_rel, 'child') && !strstr($link_rel, 'parent') && !strstr($link_rel, 'sibling') && !strstr($link_rel, 'spouse') && !strstr($link_rel, 'kin')) echo ' checked="checked"'; 17 20 if ('friendship' == $class && !strstr($link_rel, 'friend') && !strstr($link_rel, 'acquaintance') && !strstr($link_rel, 'contact') ) echo ' checked="checked"'; 18 21 if ('geographical' == $class && !strstr($link_rel, 'co-resident') && !strstr($link_rel, 'neighbor') ) echo ' checked="checked"'; 19 if ('identity' == $class && !strstr($link_rel, 'me') ) echo ' checked="checked"';22 if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"'; 20 23 } 21 24 } … … 332 335 <tr> 333 336 <th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th> 334 <td><table cellpadding="3" cellspacing="5"> 337 <td> 338 <table cellpadding="3" cellspacing="5"> 339 <tr> 340 <th scope="row"> <?php _e('identity') ?> </th> 341 <td> 342 <label for="me"> 343 <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> /> 344 <?php _e('another web address of mine') ?></label> 345 </td> 346 </tr> 335 347 <tr> 336 348 <th scope="row"> <?php _e('friendship') ?> </th> … … 419 431 </td> 420 432 </tr> 421 <tr> 422 <th scope="row"> <?php _e('identity') ?> </th> 423 <td> 424 <label for="label60"> 425 <input class="valinp" type="checkbox" name="identity" value="me" id="label60" <?php xfn_check('identity', 'me'); ?> /> 426 <?php _e('me') ?></label> 427 </td> 428 </tr> 429 </table></td> 433 </table> 434 </td> 430 435 </tr> 431 436 </table>
Note: See TracChangeset
for help on using the changeset viewer.