Plugin Directory

Changeset 822609


Ignore:
Timestamp:
12/15/2013 07:27:50 PM (12 years ago)
Author:
doodlebee
Message:

Updating for WP 3.8

Location:
jquery-expandable-comments/trunk
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • jquery-expandable-comments/trunk/jQuery-comments.php

    r687061 r822609  
    33Plugin Name: jQuery Comment Replies 2
    44Plugin URI: http://wordpress.org/extend/plugins/jquery-expandable-comments/
    5 Description: Makes comment replies expandable with jQuery, and creates "valid" code.
     5Description: Make your multi-level comment replies show on demand with a slick jQuery slideToggle() action.
    66Author: Shelly Cole
    7 Version: 1.1
     7Version: 1.2
    88Author URI: http://brassblogs.com
    99
     
    2525*/
    2626
    27 
    28 /*-----------------------------------------------------------------------------
    29                 Create default options
    30 -----------------------------------------------------------------------------*/
    31 
    32 add_action('admin_init', 'bb_add_jcr_options');                                             // add the options array if it's not there
     27/**
     28 * Languages
     29 *
     30 * @since jQuery-comments 1.2
     31 */
     32function bb_jcr_languages() {
     33    load_plugin_textdomain('bb_jcr_languages', false, basename( dirname( __FILE__ ) ) . '/langs/' );
     34}
     35
     36/**
     37 * Option defaults
     38 *
     39 * @since jQuery-comments 1.0
     40 */
    3341function bb_add_jcr_options() {
    3442    $options = get_option('bb_jcr_options');
    3543
    3644    if(!$options) {
    37         $array = array('style'              => 'ul',                                        // array for all the options
     45        $array = array('style'              => 'ul',                // array for all the options
    3846                       'type'               => 'all',
    3947                       'avatar_size'        => '32',
    40                        'reply_text'         => 'Reply',
    41                        'login_text'         => 'Log in to Reply',
     48                       'reply_text'         => __('Reply', 'bb_jcr_languages'),
     49                       'login_text'         => __('Log in to Reply', 'bb_jcr_languages'),
    4250                       'callback'           => '',
    43                        'show_replies'       => 'Show Replies',
    44                        'hide_replies'       => 'Hide Replies',
     51                       'show_replies'       => __('Show Replies', 'bb_jcr_languages'),
     52                       'hide_replies'       => __('Hide Replies', 'bb_jcr_languages'),
    4553                       'reverse_children'   => 'false',
    46                        'toggle_up'          => 'fast',
    47                        'toggle_down'        => 'slow',
    48                        'easing'             => 'linear');
    49         add_option('bb_jcr_options', $array, 'yes');                                        // add the new option array
     54                       'toggle_up'          => __('fast', 'bb_jcr_languages'),
     55                       'toggle_down'        => __('slow', 'bb_jcr_languages'),
     56                       'easing'             => 'linear'
     57                       );
     58
     59        add_option('bb_jcr_options', $array, 'yes');                // add the new option array
    5060    }
    5161}
    5262
    5363
    54 /*----------------------------------------------------------------------------------------
    55                     Edits to the Walker class
    56 ----------------------------------------------------------------------------------------*/
    57 
    58 class bb_Walker_Comment extends Walker_Comment {
    59 
    60     function start_lvl(&$output, $depth = 0, $args = array()) {
    61         $GLOBALS['comment_depth'] = $depth + 1;
    62         $options = get_option('bb_jcr_options');
    63 
    64         switch ( $args['style'] ) {
    65             case 'ol':             
    66                 echo "<span class='replylink'><span class='show'>" . $options['show_replies'] . "</span>\n</span>\n";
    67                 echo "<ol class='children'>\n";
    68                 break;
    69             default:
    70             case 'ul':
    71                 echo "<span class='replylink'><span class='show'>" . $options['show_replies'] . "</span>\n</span>\n";
    72                 echo "<ul class='children'>\n";
    73                 break;
    74             }   
    75     }
    76 
    77     function end_lvl(&$output, $depth, $args) {
    78 
    79         $GLOBALS['comment_depth'] = $depth + 1;
    80 
    81         switch ( $args['style'] ) {
    82             case 'ol':
    83                 echo "<!--/children-->\n";
    84                 echo "</ol>\n";
    85                 break;
    86             default:
    87             case 'ul':
    88                 echo "<!--/children-->\n";
    89                 echo "</ul>\n";
    90                 break;
    91         }
    92     }
    93 }
    94 
    95 
    96 /*----------------------------------------------------------------------------------------
    97                 Custom comment format callback
    98 ----------------------------------------------------------------------------------------*/
    99 
     64/**
     65 * Optional custom comment format callback
     66 *
     67 * called into wp_list_comments through the options page,
     68 * or through the comments template file
     69 * via wp_list_comments( array( 'callback' => 'bb_jcr_format_comment' ) );
     70 *
     71 * @since jQuery-comments 1.0
     72 */
    10073function bb_jcr_format_comment($comment, $args, $depth) {
    10174   $GLOBALS['comment'] = $comment;
     
    11184
    11285   <?php if ($comment->comment_approved == '0') : ?>
    113    <em><?php _e('Your comment is awaiting moderation.') ?></em><br />
     86   <em><?php __('Your comment is awaiting moderation.', 'bb_jcr_languages') ?></em><br />
    11487   <?php endif; ?>
    11588   
     
    136109
    137110
    138 /*----------------------------------------------------------------------------------------
    139                     Add jQuery to the header
    140 ----------------------------------------------------------------------------------------*/
    141 
    142 add_action('init', 'bb_start_jquery');
     111/**
     112 * Localize vars
     113 *
     114 * @since jQuery-comments 1.2
     115 */
     116function bb_localize_vars() {
     117    $options     = get_option('bb_jcr_options');
     118    $scriptstuff = array('hide'         => $options['hide_replies'],
     119                         'show'         => $options['show_replies'],
     120                         'toggle_down'  => $options['toggle_down'],
     121                         'toggle_up'    => $options['toggle_up'],
     122                         'easing'       => $options['easing']);
     123    return $scriptstuff;
     124}
     125
     126
     127/**
     128 * Enqueue scripts
     129 *
     130 * @since jQuery-comments 1.0
     131 */
    143132function bb_start_jquery() {
    144133    wp_enqueue_script('jquery'); //get that jQuery started up
    145     wp_register_script('bb_toggle_kids', plugins_url('js/bb-toggle-kids.php', __FILE__));
    146     wp_register_script('easing', plugins_url('js/jquery-easing.1.3.js', __FILE__));
    147     wp_enqueue_script('easing');
    148     wp_enqueue_script('bb_toggle_kids');
    149 }
    150 
    151 
    152 /*----------------------------------------------------------------------------------------
    153                     Now make it work!
    154 ----------------------------------------------------------------------------------------*/
    155 
    156 function bb_list_comments($args = array(), $comments = null ) {
    157     global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop;
    158 
    159     //overwrite any arguments that might already be in the theme files
    160     $args = get_option('bb_jcr_options');
    161 
    162     $in_comment_loop = true;
    163 
    164     $comment_alt = $comment_thread_alt = 0;
    165     $comment_depth = 1;
    166 
    167     $defaults = array('walker' => null, 'max_depth' => '', 'style' => 'ul', 'callback' => null, 'end-callback' => null, 'type' => 'all',
    168         'page' => '', 'per_page' => '', 'avatar_size' => 32, 'reverse_top_level' => null, 'reverse_children' => '');
    169 
    170     $r = wp_parse_args( $args, $defaults );
    171 
    172     // Figure out what comments we'll be looping through ($_comments)
    173     if ( null !== $comments ) {
    174         $comments = (array) $comments;
    175         if ( empty($comments) )
    176             return;
    177         if ( 'all' != $r['type'] ) {
    178             $comments_by_type = &separate_comments($comments);
    179             if ( empty($comments_by_type[$r['type']]) )
    180                 return;
    181             $_comments = $comments_by_type[$r['type']];
    182         } else {
    183             $_comments = $comments;
    184         }
    185     } else {
    186         if ( empty($wp_query->comments) )
    187             return;
    188         if ( 'all' != $r['type'] ) {
    189             if ( empty($wp_query->comments_by_type) )
    190                 $wp_query->comments_by_type = &separate_comments($wp_query->comments);
    191             if ( empty($wp_query->comments_by_type[$r['type']]) )
    192                 return;
    193             $_comments = $wp_query->comments_by_type[$r['type']];
    194         } else {
    195             $_comments = $wp_query->comments;
    196         }
    197     }
    198 
    199     if ( '' === $r['per_page'] && get_option('page_comments') )
    200         $r['per_page'] = get_query_var('comments_per_page');
    201 
    202     if ( empty($r['per_page']) ) {
    203         $r['per_page'] = 0;
    204         $r['page'] = 0;
    205     }
    206 
    207     if ( '' === $r['max_depth'] ) {
    208         if ( get_option('thread_comments') )
    209             $r['max_depth'] = get_option('thread_comments_depth');
    210         else
    211             $r['max_depth'] = -1;
    212     }
    213 
    214     if ( '' === $r['page'] ) {
    215         if ( empty($overridden_cpage) ) {
    216             $r['page'] = get_query_var('cpage');
    217         } else {
    218             $threaded = ( -1 == $r['max_depth'] ) ? false : true;
    219             $r['page'] = ( 'newest' == get_option('default_comments_page') ) ? get_comment_pages_count($_comments, $r['per_page'], $threaded) : 1;
    220             set_query_var( 'cpage', $r['page'] );
    221         }
    222     }
    223     // Validation check
    224     $r['page'] = intval($r['page']);
    225     if ( 0 == $r['page'] && 0 != $r['per_page'] )
    226         $r['page'] = 1;
    227 
    228     if ( null === $r['reverse_top_level'] )
    229         $r['reverse_top_level'] = ( 'desc' == get_option('comment_order') ) ? TRUE : FALSE;
    230 
    231     extract( $r, EXTR_SKIP );
    232 
    233     // use our new Walker class
    234     $walker = new bb_Walker_Comment;
    235 
    236     $walker->paged_walk($_comments, $max_depth, $page, $per_page, $r);
    237     $wp_query->max_num_comment_pages = $walker->max_pages;
    238 
    239     $in_comment_loop = false;
    240 }
    241 
    242 
    243 /*-----------------------------------------------------------------------------
    244                 Set up an options page for defaults
    245 -----------------------------------------------------------------------------*/
    246 
    247 add_action('admin_menu', 'bb_jquery_comment_replies');                                      // start 'er up!
     134    wp_enqueue_script('easing', plugins_url('js/jquery-easing.1.3.js', __FILE__), array('jquery'), '', true); // easing
     135    wp_enqueue_script('bb_toggle_kids', plugins_url('js/bb-toggle-kids.js', __FILE__),  array('jquery'), '', true); // actual show/hide script
     136    wp_localize_script('bb_toggle_kids', 'bb_toggle_vars', bb_localize_vars()); // localize the script
     137}
     138
     139
     140/**
     141 * Options page setup
     142 *
     143 * @since jQuery-comments 1.0
     144 */
    248145function bb_jquery_comment_replies() {
    249     add_options_page('jQuery Comment Replies', 'jQuery Comment Replies', 'manage_options', 'bb_jcr', 'bb_jcr_options_page');
    250 }
    251 
     146    add_options_page('jQuery Comment Replies', __('jQuery Comment Replies', 'bb_jcr_languages'), 'manage_options', 'bb_jcr', 'bb_jcr_options_page');
     147}
    252148
    253149function bb_jcr_options_page() {                                                            // the actual page contents ?>
    254150<div class="wrap">
    255     <div id="icon-options-general" class="icon32"><br /></div><h2>jQuery Comment Replies</h2>
     151    <div id="icon-options-general" class="icon32"><br /></div>
     152    <h2><?php _e('jQuery Comment Replies', 'bb_jcr_languages'); ?></h2>
    256153    <form action="options.php" method="post">
    257154        <?php settings_fields('bb_jcr_options'); ?>
    258155        <?php do_settings_sections('bb_jcr'); ?>
    259         <p><input name="submit" type="submit" id="submit" class="button-primary" value="<?php esc_attr_e('Save Changes', 'bb_jcr_languages'); ?>" /></p>
     156        <p><input name="submit" type="submit" id="submit" class="button-primary" value="<?php _e('Save Changes', 'bb_jcr_languages'); ?>" /></p>
    260157    </form>
    261158</div>
    262159<?php }
    263160
    264 
    265 add_action('admin_init', 'bb_jcr_admin_init');
    266161function bb_jcr_admin_init(){                                                               // the options settings
    267     register_setting( 'bb_jcr_options', 'bb_jcr_options', 'bb_jcr_options_validate' );
    268     add_settings_section('bb_jcr_main', '', 'bb_jcr_section_text', 'bb_jcr');
    269     add_settings_field('bb_jcr_style',              'Style',                'bb_jcr_setting_string',                    'bb_jcr', 'bb_jcr_main');
    270     add_settings_field('bb_jcr_type',               'Type',                 'bb_jcr_setting_string_type',               'bb_jcr', 'bb_jcr_main');
    271     add_settings_field('bb_jcr_avatar_size',        'Avatar Size',          'bb_jcr_setting_string_avatar',             'bb_jcr', 'bb_jcr_main');
    272     add_settings_field('bb_jcr_reply_text',         'Reply Text',           'bb_jcr_setting_string_reply_text',         'bb_jcr', 'bb_jcr_main');
    273     add_settings_field('bb_jcr_login_text',         'Login Text',           'bb_jcr_setting_string_login_text',         'bb_jcr', 'bb_jcr_main');
    274     add_settings_field('bb_jcr_callback',           'Callback',             'bb_jcr_setting_string_callback',           'bb_jcr', 'bb_jcr_main');
    275     add_settings_field('bb_jcr_show_replies',       'Show Replies Text',    'bb_jcr_setting_string_show_replies',       'bb_jcr', 'bb_jcr_main');
    276     add_settings_field('bb_jcr_hide_replies',       'Hide Replies Text',    'bb_jcr_setting_string_hide_replies',       'bb_jcr', 'bb_jcr_main');
    277     add_settings_field('bb_jcr_reverse_children',   'Reverse Children?',    'bb_jcr_setting_string_reverse_children',   'bb_jcr', 'bb_jcr_main');
    278     add_settings_field('bb_jcr_toggle_down',        'Slide Speed (open)',   'bb_jcr_setting_string_toggle_down',        'bb_jcr', 'bb_jcr_main');
    279     add_settings_field('bb_jcr_toggle_up',          'Slide Speed (close)', 'bb_jcr_setting_string_toggle_up',          'bb_jcr', 'bb_jcr_main');
    280     add_settings_field('bb_jcr_easing',             'Easing Type',          'bb_jcr_setting_string_easing',             'bb_jcr', 'bb_jcr_main');
     162    register_setting(    'bb_jcr_options',          'bb_jcr_options',                                   'bb_jcr_options_validate' );
     163    add_settings_section('bb_jcr_main',             '',                                                 'bb_jcr_section_text',                      'bb_jcr');
     164    add_settings_field(  'bb_jcr_style',            __('Style', 'bb_jcr_languages'),                    'bb_jcr_setting_string',                    'bb_jcr', 'bb_jcr_main');
     165    add_settings_field(  'bb_jcr_type',             __('Type','bb_jcr_languages'),                      'bb_jcr_setting_string_type',               'bb_jcr', 'bb_jcr_main');
     166    add_settings_field(  'bb_jcr_avatar_size',      __('Avatar Size', 'bb_jcr_languages'),              'bb_jcr_setting_string_avatar',             'bb_jcr', 'bb_jcr_main');
     167    add_settings_field(  'bb_jcr_reply_text',       __('Reply Text', 'bb_jcr_languages'),               'bb_jcr_setting_string_reply_text',         'bb_jcr', 'bb_jcr_main');
     168    add_settings_field(  'bb_jcr_login_text',       __('Login Text', 'bb_jcr_languages'),               'bb_jcr_setting_string_login_text',         'bb_jcr', 'bb_jcr_main');
     169    add_settings_field(  'bb_jcr_callback',         __('Callback', 'bb_jcr_languages'),                 'bb_jcr_setting_string_callback',           'bb_jcr', 'bb_jcr_main');
     170    add_settings_field(  'bb_jcr_show_replies',     __('Show Replies Text', 'bb_jcr_languages'),        'bb_jcr_setting_string_show_replies',       'bb_jcr', 'bb_jcr_main');
     171    add_settings_field(  'bb_jcr_hide_replies',     __('Hide Replies Text', 'bb_jcr_languages'),        'bb_jcr_setting_string_hide_replies',       'bb_jcr', 'bb_jcr_main');
     172    add_settings_field(  'bb_jcr_reverse_children', __('Reverse Children?', 'bb_jcr_languages'),        'bb_jcr_setting_string_reverse_children',   'bb_jcr', 'bb_jcr_main');
     173    add_settings_field(  'bb_jcr_toggle_down',      __('Slide Speed (open)', 'bb_jcr_languages'),       'bb_jcr_setting_string_toggle_down',        'bb_jcr', 'bb_jcr_main');
     174    add_settings_field(  'bb_jcr_toggle_up',        __('Slide Speed (close)', 'bb_jcr_languages'),      'bb_jcr_setting_string_toggle_up',          'bb_jcr', 'bb_jcr_main');
     175    add_settings_field(  'bb_jcr_easing',           __('Easing Type', 'bb_jcr_languages'),              'bb_jcr_setting_string_easing',             'bb_jcr', 'bb_jcr_main');
    281176}
    282177
    283178function bb_jcr_section_text() {                                                               
    284     echo __('<p>You can read up on the details of these parameters settings in the <a href="http://codex.wordpress.org/Function_Reference/wp_list_comments#Parameters" target="_blank">WP Codex</a>.</p>', 'bb_jcr_languages');
     179    echo '<p>' . __(sprintf('You can read up on the details of these parameters settings in the %1$s WP Codex %2$s.', '<a href="http://codex.wordpress.org/Function_Reference/wp_list_comments#Parameters" target="_blank">', '</a>'), 'bb_jcr_languages') . '</p>';
    285180}
    286181
     
    289184    $options = get_option('bb_jcr_options');
    290185
    291     echo __('<span class="description" style="display:block;">The chosen format for your comments display. Note that DIV is not an option, due to the way WordPress core functions work.<br />Using DIV with this plugin, because of the addition of markup, will break your site\'s layout.</span>', 'bb_jcr_languages');
     186    echo '<span class="description" style="display:block;">' . __(sprintf("The chosen format for your comments display. Note that DIV is not an option, due to the way WordPress core functions work. %s Using DIV with this plugin, because of the addition of markup, will break your site's layout.", '<br />'), 'bb_jcr_languages') . '</span>';
    292187   
    293188    echo '<input id="bb_jcr_style" name="bb_jcr_options[style]" size="40" type="radio" value="ul" '     . (isset($options["style"]) && $options["style"] == "ul" ? 'checked="checked" ' : '')   . '/> ul<br />' . "\n";
     
    299194    $options = get_option('bb_jcr_options');
    300195
    301     echo __('<span class="description" style="display:block;">The type of comments to display. ("Ping" is trackbacks and pingbacks together.)</span>', 'bb_jcr_languages');
    302    
    303     echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="all" '          . (isset($options["type"]) && $options["type"] == "all" ? 'checked="checked" ' : '')        . '/> All<br />'        . "\n";
    304     echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="comment" '      . (isset($options["type"]) && $options["type"] == "comment" ? 'checked="checked" ' : '')    . '/> Comment<br />'    . "\n";
    305     echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="trackback" '    . (isset($options["type"]) && $options["type"] == "trackback" ? 'checked="checked" ' : '')  . '/> Trackback<br />'  . "\n";
    306     echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="pingback" '     . (isset($options["type"]) && $options["type"] == "pingback" ? 'checked="checked" ' : '')   . '/> Pingback<br />'   . "\n";
    307     echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="pings" '        . (isset($options["type"]) && $options["type"] == "pings" ? 'checked="checked" ' : '')      . '/> Pings<br />'      . "\n\n";
     196    echo '<span class="description" style="display:block;">' . __('The type of comments to display. ("Ping" is trackbacks and pingbacks together.)', 'bb_jcr_languages') . '</span>';
     197   
     198    echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="all" '          . (isset($options["type"]) && $options["type"] == "all"         ? 'checked="checked" ' : '')    . '/> ' . __('All',         'bb_jcr_languages' ) . '<br />'     . "\n";
     199    echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="comment" '      . (isset($options["type"]) && $options["type"] == "comment"     ? 'checked="checked" ' : '')    . '/> ' . __('Comment',     'bb_jcr_languages' ) . '<br />'     . "\n";
     200    echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="trackback" '    . (isset($options["type"]) && $options["type"] == "trackback"   ? 'checked="checked" ' : '')    . '/> ' . __('Trackback',   'bb_jcr_languages' ) . '<br />'     . "\n";
     201    echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="pingback" '     . (isset($options["type"]) && $options["type"] == "pingback"    ? 'checked="checked" ' : '')    . '/> ' . __('Pingback',    'bb_jcr_languages' ) . '<br />'     . "\n";
     202    echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="pings" '        . (isset($options["type"]) && $options["type"] == "pings"       ? 'checked="checked" ' : '')    . '/> ' . __('Pings',       'bb_jcr_languages' ) . '<br />'     . "\n\n";
    308203}
    309204
     
    312207    $options = get_option('bb_jcr_options');
    313208   
    314     echo __('<span class="description" style="display:block;">The desired avatar size, in pixels.  Can be between 1 and 512.  Use 0 to hide them.  Default is 32.</span>', 'bb_jcr_languages') . "\n\n";
     209    echo '<span class="description" style="display:block;">' . __('The desired avatar size, in pixels.  Can be between 1 and 512.  Use 0 to hide them.  Default is 32.', 'bb_jcr_languages') . '</span>' . "\n\n";
    315210   
    316211    echo '<input id="bb_jcr_avatar_size" name="bb_jcr_options[avatar_size]" size="40" type="text" value="' . $options["avatar_size"] . '"/>' . "\n\n"; 
     
    321216    $options = get_option('bb_jcr_options');
    322217   
    323     echo __('<span class="description" style="display:block;">Text to display for the "reply" link. Default is "Reply"</span>', 'bb_jcr_languages') . "\n\n";
     218    echo '<span class="description" style="display:block;">' . __('Text to display for the "reply" link. Default is "Reply"', 'bb_jcr_languages') . '</span>' . "\n\n";
    324219
    325220    echo '<input id="bb_jcr_reply_text" name="bb_jcr_options[reply_text]" size="40" type="text" value="' . $options["reply_text"] . '"/>' . "\n\n";
     
    330225    $options = get_option('bb_jcr_options');
    331226   
    332     echo __('<span class="description" style="display:block;">Text to display for the "login" message. Default is "Log in to Reply"</span>', 'bb_jcr_languages') . "\n\n";
     227    echo '<span class="description" style="display:block;">' . __('Text to display for the "login" message. Default is "Log in to Reply"', 'bb_jcr_languages') . '</span>' . "\n\n";
    333228
    334229    echo '<input id="bb_jcr_login_text" name="bb_jcr_options[login_text]" size="40" type="text" value="' . $options["login_text"] . '"/>' . "\n\n";
     
    339234    $options = get_option('bb_jcr_options');
    340235   
    341     echo __('<span class="description" style="display:block;">Name of the custom function you want to use to edit the HTML display of your comments.  This function must exist within<br /> your functions.php file, or within your own plugin. A custom callback function has been included with this plugin.  You may <br />choose to edit it, or use it as-is.  Please see the readme.txt file for further information.</span>', 'bb_jcr_languages') . "\n\n";
     236    echo '<span class="description" style="display:block;">' . __(sprintf('Name of the custom function you want to use to edit the HTML display of your comments.  This function must exist within %1$s your functions.php file, or within your own plugin. A custom callback function has been included with this plugin.  You may %2$s choose to edit it, or use it as-is.  Please see the readme.txt file for further information.', '<br />', '<br />'), 'bb_jcr_languages') . '</span>' . "\n";
    342237
    343238    echo '<input id="bb_jcr_callback" name="bb_jcr_options[callback]" size="40" type="text" value="' . $options["callback"] . '"/>' . "\n\n";
     
    348243    $options = get_option('bb_jcr_options');
    349244   
    350     echo __('<span class="description" style="display:block;">Text to display for the "Show Replies" link. Default is "Show Replies". Please see the readme.txt file for further information.</span>', 'bb_jcr_languages') . "\n";
     245    echo '<span class="description" style="display:block;">' . __('Text to display for the "Show Replies" link. Default is "Show Replies". Please see the readme.txt file for further information.', 'bb_jcr_languages') . '</span>' . "\n";
    351246
    352247    echo '<input id="bb_jcr_show_replies"       name="bb_jcr_options[show_replies]"       size="40" type="text"     value="'        . $options["show_replies"] . '"/>' . "\n\n";
     
    357252    $options = get_option('bb_jcr_options');
    358253   
    359     echo __('<span class="description" style="display:block;">Text to display for the "Show Replies" link. Default is "Hide Replies". Please see the readme.txt file for further information.</span>', 'bb_jcr_languages') . "\n\n";
     254    echo '<span class="description" style="display:block;">' . __('Text to display for the "Hide Replies" link. Default is "Hide Replies". Please see the readme.txt file for further information.', 'bb_jcr_languages') . '</span>' . "\n";
    360255
    361256    echo '<input id="bb_jcr_hide_replies"       name="bb_jcr_options[hide_replies]"       size="40" type="text"     value="'        . $options["hide_replies"] . '"/>' . "\n\n";
     
    366261    $options = get_option('bb_jcr_options');
    367262
    368     echo __('<span class="description" style="display:block;">Set to "Yes" to make this child comments show in reverse order (newest first).</span>', 'bb_jcr_languages');
     263    echo '<span class="description" style="display:block;">' . __('Set to "Yes" to make this child comments show in reverse order (newest first).', 'bb_jcr_languages') . '</span>';
    369264   
    370265    echo '<input id="bb_jcr_reverse_children" name="bb_jcr_options[reverse_children]" size="40" type="radio" value="false" '    . (isset($options["reverse_children"]) && $options["reverse_children"] == "false" ? 'checked="checked" ' : '')  . '/> No<br />' . "\n";
     
    376271    $options = get_option('bb_jcr_options');
    377272   
    378     echo __('<span class="description" style="display:block;">Speed of slide when opening the replies. Default is "slow". You can use "fast" or the number of milliseconds you\'d like it to take.</span>', 'bb_jcr_languages') . "\n\n";
     273    echo '<span class="description" style="display:block;">' . __('Speed of slide when opening the replies. Default is "slow". You can use "fast" or the number of milliseconds you would like it to take.', 'bb_jcr_languages') . '</span>' . "\n\n";
    379274
    380275    echo '<input id="bb_jcr_toggle_down" name="bb_jcr_options[toggle_down]" size="40" type="text" value="' . $options["toggle_down"] . '"/>' . "\n\n";
     
    385280    $options = get_option('bb_jcr_options');
    386281   
    387     echo __('<span class="description" style="display:block;">Speed of slide when opening the replies. Default is "fast". You can use "slow" or the number of milliseconds you\'d like it to take.</span>', 'bb_jcr_languages') . "\n\n";
     282    echo '<span class="description" style="display:block;">' . __('Speed of slide when closing the replies. Default is "fast". You can use "slow" or the number of milliseconds you would like it to take.', 'bb_jcr_languages') . '</span>' . "\n\n";
    388283
    389284    echo '<input id="bb_jcr_toggle_up" name="bb_jcr_options[toggle_up]" size="40" type="text" value="' . $options["toggle_up"] . '"/>' . "\n\n";
     
    394289    $options = get_option('bb_jcr_options');
    395290   
    396     echo __('<span class="description" style="display:block;">Type of easing you\'d like the slide to use.  Default is "linear". You can see visual examples of other types you can use <a href="http://matthewlein.com/experiments/easing.html" target="_blank">here</a>.</span>', 'bb_jcr_languages') . "\n\n";
     291    echo '<span class="description" style="display:block;">' . __(sprintf('Type of easing you would like the slide to use.  Default is "linear". You can see visual examples of other types you can use %1$s here %2$s.', '<a href="http://matthewlein.com/experiments/easing.html" target="_blank">', '</a>'), 'bb_jcr_languages') . '</span>' . "\n\n";
    397292
    398293    // setup array
     
    438333    return $newinput;
    439334}
     335
     336
     337/**
     338 * Start 'er up!
     339 *
     340 */
     341add_action('init',           'bb_jcr_languages');           // languages
     342add_action('admin_init',     'bb_add_jcr_options');         // options
     343add_action('init',           'bb_start_jquery');            // scripts
     344add_action('admin_menu',     'bb_jquery_comment_replies');  // options page/settings
     345add_action('admin_init',     'bb_jcr_admin_init');          // option page/settings init
     346
  • jquery-expandable-comments/trunk/readme.txt

    r687061 r822609  
    44Tags: jQuery, comments, expand, replies
    55Requires at least: 3.0
    6 Tested up to: 3.5.1
    7 Stable tag: 1.1
     6Tested up to: 3.8
     7Stable tag: 1.2
    88License: GPLv2 or later
    99
     
    1717
    1818= Features =
    19 This keeps the default "[`wp_list_comments()`](http://codex.wordpress.org/Function_Reference/wp_list_comments)" features.  The only difference is that the child comments will have the added "`<div class='children'>`" added to it (ol and ul already have this class by default). A clickable span that triggers the action to expand the replies is also added.  Pagination and level depths are not affected. 
     19This keeps the default "[`wp_list_comments()`](http://codex.wordpress.org/Function_Reference/wp_list_comments)" features.  A clickable span that triggers the action to expand the replies is also added. 
    2020
    2121New features are including easing options, as well as allowing images. An options page has been added for further customizations, making it even easier to use.
     
    27272. Upload to your plugins directory.
    28283. Go to "Plugins" and activate.
    29 4. Open up your comments.php file (in the theme you are using) and replace "`wp_list_comments()`" with "`bb_list_comments()`".
     294. Open your "comments.php" file (in your theme) and replace `wp_list_comments($args)` with `wp_list_comments( array( 'callback' => 'bb_jcr_format_comment' ) );`.  Please note: if you do NOT replace the `wp_list_cmments()` call in your theme files, some of the settings in your options page will NOT be applied.  You will have to manually add in the style, type, avatar size, reply text, and login text as directed "[here](http://codex.wordpress.org/Function_Reference/wp_list_comments)".
     305. if you'd like to use the stylesheet tha comes with this plugin, you'll need to add the following to your theme's functions.php file:
     31`add_action('init', 'jcr_start_styles');
     32function jcr_start_styles() {
     33    wp_enqueue_style('bb_toggle_comments', plugins_url('css/bb_expandable_comments.css', __FILE__));
     34}`
     35
    3036
    3137= Options Page =
     
    4753* Easing Type.  The jQuery Easing plugin has been added so you have more animation options.  Simply choose which animation you want to use, and it will be applied to both the opening and closing of replies.
    4854
    49 I'll also comment on the "callback" section - it is discussed in the codex, but there's no example of how to use it.  If you want to format the layout of your comments, then you need to use a callback function to rearrange the HTML.  This plugin comes with a callback function you can use.  It's NOT set as the default.  If you'd like to use it, enter in `bb_jcr_format_comment` to this text field, and your comment layout will use the callback supplied in the plugin.  if you still want to edit the layout, feel free to copy the function (located within jQuery-comments.php, around line 323) and paste it into your theme's functions.php file.  You WILL have to rename the function, or you'll get a fatal error.  Once you rename the function, take that name and pop it into the "callback" field on the settings page, then feel free to edit the function to get the exact layout you want to have.
     55I'll also comment on the "callback" section - it is discussed in the codex, but there's no example of how to use it.  If you want to format the layout of your comments, then you need to use a callback function to rearrange the HTML.  This plugin comes with a callback function you can use.  It's NOT set as the default.  If you'd like to use it, enter in `bb_jcr_format_comment` to this text field, and your comment layout will use the callback supplied in the plugin.  if you still want to edit the layout, feel free to copy the function (located within jQuery-comments.php, around line 73) and paste it into your theme's functions.php file.  You WILL have to rename the function, or you'll get a fatal error.  Once you rename the function, take that name and pop it into the "callback" field on the settings page, then feel free to edit the function to get the exact layout you want to have.
    5056
    5157There's several tutorials available for how to edit the comment layout, but [Jeremy Clark](http://clark-technet.com/2008/11/wordpress-27-comment-callback-function)'s is the one that actually started this plugin.
     
    5662= No questions at this time. =
    5763But if you have any, by all means, feel free to ask away.  I'd also love input on features you'd like added or things you'd like to see to improve this plugin.  See the "Other Notes" section on how to contact me.
     64
     65Please also note that, even though I have a disclaimer about my limited availability to assist, I ALWAYS try to help out as much as I can - which is evidenced by the "Support" thread.  WordPress does *not* give me any notice whensomeone leaves a support question on the forums - you have to rely on me having the time to come in and check - and these days that's not often.  I try to get in to check as often as I can, but if it's been more than a week since you've left a question on support, please email me so I can try to help you out.
     66
     67And PLEASE do not leave support questions in the "reviews" section.  If I help you out and solve your problem (which is usually the case) you *cannot* change your review.  I've found, lately, that a lot of people are having a problem, leaving a bad review and terrible rating, and then I solve the problem (and it usually turns out it's not my plugin that was the issue in the first place).  That doesn't help anyone.  Please leave support questions in the support forum section, and actual reviews in the "reviews" section.  Thank you.
    5868
    5969
     
    6676
    6777== Changelog ==
     78
     79= 1.2 =
     80* removed local jquery easing library, reverted to cdn
     81* edited script to work with TwentyThirteen (TwentyThirteen renamed the 'li.commentlist' to 'li.comment-list')
     82* added previously unavailable "div" option.
     83* fixed script localization
     84* removed the necessity of rewriting the Walker_Comment class.  This renders the use of bb_list_comments() unneccessary.
     85* previously, there were no styles set for this plugin, but due to popular demand, I've put in a default stylesheet.
     86* finally actually figured out how to set up translation correctly. Yay! pot/mo files added.
    6887
    6988= 1.1 =
     
    93112== Upgrade Notice ==
    94113
    95 = 1.0 =
    96 Revamped for 3.5, a new options age makes it easier the edit your comments.  You can also add in your own callback for display, edit the jQuery settings for animations, and has an options page to make it really easy on you.
     114= 1.2.1 =
     115** IMPORTANT ** bb_list_comments() is now deprecated.  You WILL need to switch back to wp_list_comments() in your theme files.  This should fix the old conflict issue with Spam Free Wordpress.
    97116
    98117
     
    101120= Known Issues =
    102121
    103 This plugin does NOT work with [Spam Free WordPress](http://wordpress.org/extend/plugins/spam-free-wordpress/) by [Todd Lahman](http://www.toddlahman.com/spam-free-wordpress/).  Spam Free WordPress has it's own comments template form, and when the plugin is activated, it uses the form template located within the plugin (under "spam-free-wordpress/includes/class-comment-form.php") it uses wp_list_comments() with it's own callback function, and ignores your theme's template file.
    104 
     122None at this time.
    105123
    106124[Contact Shelly](http://brassblogs.com/contact)
    107125
    108126Given that this is free, I offer limited support. If you have issues with the plugin *working* I will do whatever I can to help you fix the issue, but when it comes to customization, I'm in limited supply.  I'll do what I can, but no guarantees.  This is your standard "as is" application.  In all honesty, ask customization questions in the forums - if I can't help, perhaps someone else can.  (If you want to hire me to customize it, that's another story - feel free to contact me to do so!)
     127
     128PLEASE NOTE that the WordPress support system DOES NOT notify me when someone leaves a support question.  It requires me to come back and check manually to see if anyone has had an issue.  Sometimes, I don't get to do that for a while.  If you left a support request on the forums, and it's been at least a week since you left it with no response, please drop me an email to let me know so I can attempt to help you out.  I'm pretty good at helping out - but I'm not so good at coming to check the forums - especially when I'm busy with client work.
Note: See TracChangeset for help on using the changeset viewer.