WordPress.org

Make WordPress Core

Changeset 7854


Ignore:
Timestamp:
04/29/08 19:17:23 (7 years ago)
Author:
ryan
Message:

Word count from azaozz. see #4807

Location:
trunk
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r7794 r7854  
    158158<?php endif; ?> 
    159159<span id="autosave"></span> 
     160<span id="wp-word-count"></span> 
    160161</p> 
    161162 
  • trunk/wp-admin/edit-page-form.php

    r7794 r7854  
    141141<?php endif; ?> 
    142142<span id="autosave"></span> 
     143<span id="wp-word-count"></span> 
    143144</p> 
    144145 
  • trunk/wp-admin/page-new.php

    r6943 r7854  
    1010wp_enqueue_script('thickbox'); 
    1111wp_enqueue_script('media-upload'); 
     12wp_enqueue_script('word-count'); 
    1213 
    1314require_once('admin-header.php'); 
  • trunk/wp-admin/page.php

    r7781 r7854  
    8484    wp_enqueue_script('thickbox'); 
    8585    wp_enqueue_script('media-upload'); 
     86    wp_enqueue_script('word-count'); 
    8687 
    8788    if ( current_user_can('edit_page', $page_ID) ) { 
  • trunk/wp-admin/post-new.php

    r7282 r7854  
    1010wp_enqueue_script('thickbox'); 
    1111wp_enqueue_script('media-upload'); 
     12wp_enqueue_script('word-count'); 
    1213 
    1314require_once ('./admin-header.php'); 
  • trunk/wp-admin/post.php

    r7781 r7854  
    9191    wp_enqueue_script('thickbox'); 
    9292    wp_enqueue_script('media-upload'); 
     93    wp_enqueue_script('word-count'); 
    9394 
    9495    if ( current_user_can('edit_post', $post_ID) ) { 
  • trunk/wp-admin/wp-admin.css

    r7747 r7854  
    15041504    text-decoration: none; 
    15051505} 
     1506 
     1507#wp-word-count { 
     1508    display: block; 
     1509} 
  • trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js

    r7687 r7854  
    133133            }); 
    134134 
    135             // Add listeners to handle more break 
     135            // Word count if script is loaded 
     136            if ( 'undefined' != wpWordCount ) { 
     137                var last = 0; 
     138                ed.onKeyUp.add(function(ed, e) { 
     139                    if ( e.keyCode == last ) return; 
     140                    if ( 13 == e.keyCode || 8 == last || 46 == last ) wpWordCount.wc( ed.getContent({format : 'raw'}) ); 
     141                    last = e.keyCode; 
     142                }); 
     143            }; 
     144 
     145            // Add listeners to handle more break 
    136146            t._handleMoreBreak(ed, url); 
    137147 
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r7804 r7854  
    227227if ( $disk_cache ) { 
    228228 
    229     $cacheKey = apply_filters('tiny_mce_version', '20080414'); 
     229    $cacheKey = apply_filters('tiny_mce_version', '20080423'); 
    230230 
    231231    foreach ( $initArray as $v ) 
  • trunk/wp-includes/script-loader.php

    r7813 r7854  
    3737 
    3838        // Modify this version when tinyMCE plugins are changed. 
    39         $mce_version = apply_filters('tiny_mce_version', '20080414'); 
     39        $mce_version = apply_filters('tiny_mce_version', '20080423'); 
    4040        $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); 
    4141 
     
    194194                'cancel' => __('Cancel'), 
    195195            )); 
    196             $this->add( 'editor', '/wp-admin/js/editor.js', array('tiny_mce'), '20080221' ); 
     196 
     197            $this->add( 'word-count', '/wp-admin/js/word-count.js', array( 'jquery' ), '20080423' ); 
     198            $this->localize( 'word-count', 'wordCountL10n', array( 
     199                'count' => __('Word count: %d') 
     200            )); 
    197201        } 
    198202    } 
Note: See TracChangeset for help on using the changeset viewer.