Changeset 9518
- Timestamp:
- 11/04/2008 11:15:59 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r9354 r9518 422 422 ) ); 423 423 $x->send(); 424 break; 425 case 'get-tagcloud' : 426 if ( !current_user_can( 'manage_categories' ) ) 427 die('-1'); 428 429 $tags = get_tags( array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) ); 430 431 if ( empty( $tags ) ) 432 die('0'); 433 434 foreach ( $tags as $key => $tag ) { 435 $tags[ $key ]->link = '#'; 436 $tags[ $key ]->id = $tag->term_id; 437 } 438 439 $return = wp_generate_tag_cloud( $tags ); 440 441 if ( empty($return) ) 442 die('0'); 443 444 echo $return; 445 446 exit; 424 447 break; 425 448 case 'add-comment' : -
trunk/wp-admin/css/colors-fresh.css
r9436 r9518 890 890 891 891 #timestampdiv input, 892 #namediv input { 892 #namediv input, 893 #tagsdiv #the-tagcloud { 893 894 border-color: #ddd; 894 895 } -
trunk/wp-admin/css/global.css
r9428 r9518 146 146 /* styles for use by people extending the WordPress interface */ 147 147 148 body { 149 margin: 0; 150 padding: 0; 151 } 152 153 body, td { 154 font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; 155 } 156 157 form, label input { 158 margin: 0; 159 padding: 0; 160 } 161 162 img { 163 border: 0; 148 body, 149 td { 150 font: 13px/19px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; 151 } 152 153 p { 154 margin: 1em 0; 155 } 156 157 blockquote { 158 margin: 1em; 164 159 } 165 160 … … 168 163 } 169 164 170 li, dd { 165 li, 166 dd { 171 167 margin-bottom: 6px; 172 168 } 173 169 174 p, li, dl, dd, dt { 170 p, 171 li, 172 dl, 173 dd, 174 dt { 175 175 line-height: 140%; 176 176 } 177 177 178 textarea, input, select { 179 font: 13px Verdana, Arial, Helvetica, sans-serif; 178 textarea, 179 input, 180 select { 181 font: 13px/19px Verdana, Arial, Helvetica, sans-serif; 180 182 margin: 1px; 181 183 padding: 3px; … … 292 294 } 293 295 294 .widefat td, .widefat th { 296 .widefat td, 297 .widefat th { 295 298 border-bottom-width: 1px; 296 299 border-bottom-style: solid; … … 327 330 padding: 10px 0 22px; 328 331 } 329 /* 330 th.check-column + th, th.check-column + td { 331 padding-left: 5px; 332 } 333 */ 332 334 333 .widefat .num, 335 334 .widefat .column-comments { … … 341 340 } 342 341 343 .wrap, .updated, .error { 342 .wrap, 343 .updated, 344 .error { 344 345 margin: 0 15px; 345 346 padding: 0; 346 347 } 347 348 348 .updated, .error { 349 .updated, 350 .error { 349 351 border-width: 1px; 350 352 border-style: solid; … … 353 355 } 354 356 355 .updated p, .error p { 357 .updated p, 358 .error p { 356 359 margin: 0.6em 0; 357 360 } 358 361 359 .wrap .updated, .wrap .error { 362 .wrap .updated, 363 .wrap .error { 360 364 margin: auto 0 0; 361 365 } 362 366 363 .updated a, .error a { 367 .updated a, 368 .error a { 364 369 text-decoration: underline; 365 370 } -
trunk/wp-admin/edit-form-advanced.php
r9506 r9518 236 236 <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p> 237 237 <div id="tagchecklist"></div> 238 <p ><a href='#'><?php _e( 'Choose fromtags' ); ?></a></p>238 <p id="tagcloud-link" class="hide-if-no-js"><a href='#'><?php _e( 'Choose from the most popular tags' ); ?></a></p> 239 239 <?php 240 240 } -
trunk/wp-admin/edit-tags.php
r9363 r9518 243 243 wp_tag_cloud(array('link' => 'edit')); 244 244 else 245 wp_tag_cloud(); 245 wp_tag_cloud(); 246 246 ?> 247 247 </div> -
trunk/wp-admin/js/post.js
r9491 r9518 38 38 } 39 39 40 function tag_flush_to_text() { 41 var newtags = jQuery('#tags-input').val() + ',' + jQuery('#newtag').val(); 40 function tag_flush_to_text(e,a) { 41 a = a || false; 42 var text = a ? jQuery(a).text() : jQuery('#newtag').val(); 43 var newtags = jQuery('#tags-input').val(); 44 var t = text.replace( /\s*([^,]+)[\s,]*/, '$1' ); 45 46 if ( newtags.indexOf(t) != -1 ) 47 return false; 48 49 newtags += ',' + text; 50 42 51 // massage 43 52 newtags = newtags.replace( /\s+,+\s*/g, ',' ).replace( /,+/g, ',' ).replace( /,+\s+,+/g, ',' ).replace( /,+\s*$/g, '' ).replace( /^\s*,+/g, '' ); 44 53 jQuery('#tags-input').val( newtags ); 45 54 tag_update_quickclicks(); 46 jQuery('#newtag').val(''); 47 jQuery('#newtag').focus(); 55 if ( ! a ) { 56 jQuery('#newtag').val(''); 57 jQuery('#newtag').focus(); 58 } 48 59 return false; 49 60 } … … 59 70 return false; 60 71 } 61 } 72 }; 73 74 (function($){ 75 tagCloud = { 76 init : function() { 77 $('#tagcloud-link').click(function(){tagCloud.get(); return false;}); 78 }, 79 80 get : function() { 81 $.post('admin-ajax.php', {'action':'get-tagcloud'}, function(r, stat) { 82 if ( 0 == r || 'success' != stat ) 83 r = wpAjax.broken; 84 85 r = '<p id="the-tagcloud">'+r+'</p>'; 86 $('#tagcloud-link').after($(r)); 87 $('#the-tagcloud a').click(function(){ 88 tag_flush_to_text(0,this); 89 return false; 90 }); 91 }); 92 } 93 } 94 })(jQuery); 62 95 63 96 jQuery(document).ready( function($) { 97 tagCloud.init(); 98 64 99 // close postboxes that should be closed 65 100 jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); -
trunk/wp-admin/wp-admin.css
r9510 r9518 2922 2922 margin-top: 8px; 2923 2923 } 2924 2925 #tagsdiv #the-tagcloud { 2926 margin: 5px 5px 10px; 2927 padding: 8px; 2928 border-width: 1px; 2929 border-style: solid; 2930 line-height: 1.8em; 2931 word-spacing: 3px; 2932 -moz-border-radius: 6px; 2933 -khtml-border-radius: 6px; 2934 -webkit-border-radius: 6px; 2935 border-radius: 6px; 2936 } -
trunk/wp-includes/category-template.php
r9475 r9518 665 665 foreach ( $tags as $key => $tag ) { 666 666 $count = $counts[ $key ]; 667 $tag_link = clean_url( $tag->link );667 $tag_link = '#' != $tag->link ? clean_url( $tag->link ) : '#'; 668 668 $tag_id = isset($tags[ $key ]->id) ? $tags[ $key ]->id : $key; 669 669 $tag_name = $tags[ $key ]->name;
Note: See TracChangeset
for help on using the changeset viewer.