Skip to:
Content

BuddyPress.org

Changeset 671


Ignore:
Timestamp:
12/14/2008 05:02:03 AM (18 years ago)
Author:
apeatling
Message:

Modifying core code submit buttons to disable and display "loading" when pressed. Stops duplicate submissions.

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r662 r671  
    266266                        $post = BP_Blogs_Post::fetch_post_content($post);
    267267                       
    268                         if ( $post->post_type != 'post' || $post->post_status != 'publish' || $post->post_password != '' )
     268                        if ( !$post || $post->post_type != 'post' || $post->post_status != 'publish' || $post->post_password != '' )
    269269                                return false;
    270270
     
    289289
    290290                        $comment = BP_Blogs_Comment::fetch_comment_content($comment);
     291                       
     292                        if ( !$comment )
     293                                return false;
     294                               
    291295                        $post_link = bp_post_get_permalink( $comment->post, $comment->blog_id );
    292                         $content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink($user_id), '<a href="' . $post_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ) . ' <span class="time-since">%s</span>';               
     296                        $content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink($user_id), '<a href="' . $post_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ) . ' <span class="time-since">%s</span>';                      
    293297                        $content .= '<blockquote>' . bp_create_excerpt($comment->comment_content) . '</blockquote>';
    294298
  • trunk/bp-blogs/bp-blogs-templatetags.php

    r666 r671  
    686686                        <?php bp_blogs_signup_blog($blogname, $blog_title, $errors); ?>
    687687                        <p>
    688                                 <input id="submit" type="submit" name="submit" class="submit" value="<?php _e('Create Blog &raquo;', 'buddypress') ?>" />
     688                                <input id="submit" type="submit" name="submit" class="submit" value="<?php _e('Create Blog &raquo;', 'buddypress') ?>" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    689689                        </p>
    690690                </form>
  • trunk/bp-core/bp-core-activation.php

    r667 r671  
    2626                                </p>
    2727                                <p class="submit">
    28                                     <input id="submit" type="submit" name="Submit" class="submit" value="<?php _e('Activate &raquo;') ?>" />
     28                                    <input id="submit" type="submit" name="Submit" class="submit" value="<?php _e('Activate &raquo;') ?>" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    2929                                </p>
    3030                        </form>
  • trunk/bp-core/bp-core-admin.php

    r666 r671  
    6666       
    6767                        <p class="submit">
    68                                 <input type="submit" name="bp-admin-submit" id="bp-admin-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>" />
     68                                <input type="submit" name="bp-admin-submit" id="bp-admin-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    6969                        </p>
    7070               
  • trunk/bp-core/bp-core-avatars.php

    r667 r671  
    437437                <input type="hidden" name="nonce" value="<?php echo wp_create_nonce('slick_avatars'); ?>" />
    438438                <input type="file" name="file" id="file" />
    439                 <input type="submit" name="upload" id="upload" value="Upload Photo" />
     439                <input type="submit" name="upload" id="upload" value="Upload Photo" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    440440<?php if ( !$no_form_tag ) { ?>
    441441        </form>
  • trunk/bp-core/bp-core-settings.php

    r636 r671  
    7878                <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> &nbsp;Repeat New Password
    7979       
    80                 <p><input type="submit" name="submit" value="Save Changes" id="submit" class="auto" /></p>
     80                <p><input type="submit" name="submit" value="Save Changes" id="submit" class="auto" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" /></p>
    8181                <?php wp_nonce_field('bp_settings_general') ?>
    8282        </form>
     
    126126                <?php do_action( 'bp_notification_settings' ) ?>
    127127               
    128                 <p class="submit"><input type="submit" name="submit" value="Save Changes" id="submit" class="auto" /></p>               
     128                <p class="submit"><input type="submit" name="submit" value="Save Changes" id="submit" class="auto" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" /></p>             
    129129               
    130130                <?php wp_nonce_field('bp_settings_notifications') ?>
  • trunk/bp-core/bp-core-signup.php

    r648 r671  
    152152                <?php bp_core_signup_show_blog_form($blogname, $blog_title, $errors); ?>
    153153                <p>
    154                         <input id="submit" type="submit" name="submit" class="submit" value="<?php _e('Create Blog &raquo;') ?>" /></p>
     154                        <input id="submit" type="submit" name="submit" class="submit" value="<?php _e('Create Blog &raquo;') ?>" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
     155                </p>
    155156        </form>
    156157        <?php
     
    239240                <?php } ?>
    240241
    241                 <input id="submit" type="submit" name="submit" class="submit" value="<?php _e('Next &raquo;') ?>" />
     242                <input id="submit" type="submit" name="submit" class="submit" value="<?php _e('Next &raquo;') ?>" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    242243        </form>
    243244        <?php
     
    297298                <?php bp_core_signup_show_blog_form($blogname, $blog_title, $errors); ?>
    298299                <p>
    299                         <input id="submit" type="submit" name="submit" class="submit" value="<?php _e('Signup &raquo;') ?>" /></p>
     300                        <input id="submit" type="submit" name="submit" class="submit" value="<?php _e('Signup &raquo;') ?>" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" /></p>
    300301        </form>
    301302        <?php
  • trunk/bp-forums/bp-forums-admin.php

    r641 r671  
    9595                        <br />
    9696                        <p class="submit">
    97                                 <input type="submit" name="submit" value="<?php _e('Save Settings', 'buddypress') ?>" />
     97                                <input type="submit" name="submit" value="<?php _e('Save Settings', 'buddypress') ?>" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    9898                        </p>
    9999                        <?php wp_nonce_field('bbpress-settings') ?>
  • trunk/bp-groups/bp-groups-admin.php

    r663 r671  
    3535                <form id="wpmu-search" method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
    3636                        <input type="text" size="17" value="<?php echo $_REQUEST['s'] ?>" name="s" />
    37                         <input id="post-query-submit" class="button" type="submit" value="Search Groups"/>
     37                        <input id="post-query-submit" class="button" type="submit" value="Search Groups" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    3838                </form>
    3939               
     
    4545                                        </div>
    4646                                        <div class="alignleft">
    47                                                 <input class="button-secondary delete" type="submit" name="groups_admin_delete" value="Delete" onclick="if ( !confirm('<?php _e( 'Are you sure?', 'buddypress' ) ?>') ) return false"/>
     47                                                <input class="button-secondary delete" type="submit" name="groups_admin_delete" value="Delete" onclick="if ( !confirm('<?php _e( 'Are you sure?', 'buddypress' ) ?>') ) return false" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    4848                                                <?php wp_nonce_field('bp-groups-admin') ?>
    4949                                                <br class="clear"/>
  • trunk/bp-groups/bp-groups-templatetags.php

    r664 r671  
    785785                        <textarea name="group-news" id="group-news"><?php echo ( $group_obj ) ? $group_obj->news : $_POST['group-news']; ?></textarea>
    786786                       
    787                         <p><input type="submit" value="<?php _e('Create Group and Continue', 'buddypress') ?> &raquo;" id="save" name="save" /></p>
     787                        <p><input type="submit" value="<?php _e('Create Group and Continue', 'buddypress') ?> &raquo;" id="save" name="save" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" /></p>
    788788                <?php break; ?>
    789789               
     
    820820                                </div>
    821821
    822                                 <p><input type="submit" value="<?php _e('Save and Continue', 'buddypress') ?> &raquo;" id="save" name="save" /></p>
     822                                <p><input type="submit" value="<?php _e('Save and Continue', 'buddypress') ?> &raquo;" id="save" name="save" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" /></p>
    823823                        <?php } else { ?>
    824824                                <div id="message" class="info">
     
    850850                                       
    851851                                        <div id="skip-continue">
    852                                                 <input type="submit" value="<?php _e('Skip', 'buddypress') ?> &raquo;" id="skip" name="skip" />
     852                                                <input type="submit" value="<?php _e('Skip', 'buddypress') ?> &raquo;" id="skip" name="skip" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    853853                                        </div>
    854854                                </div>
     
    10421042                </ul>
    10431043
    1044                 <input type="submit" value="<?php _e('Finish', 'buddypress') ?> &raquo;" id="save" name="save" />
     1044                <input type="submit" value="<?php _e('Finish', 'buddypress') ?> &raquo;" id="save" name="save" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    10451045
    10461046        </div>
  • trunk/bp-messages.php

    r662 r671  
    620620                                                        </div>
    621621                                                        <p class="submit">
    622                                                                 <input type="submit" name="send" value="Send Reply &raquo;" id="send_reply_button" />
     622                                                                <input type="submit" name="send" value="Send Reply &raquo;" id="send_reply_button" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    623623                                                        </p>
    624624                                                        <input type="hidden" id="thread_id" name="thread_id" value="<?php echo $thread->thread_id ?>" />
  • trunk/bp-xprofile/admin-mods/bp-xprofile-account-tab.php

    r580 r671  
    189189        <input type="hidden" name="action" value="update" />
    190190        <input type="hidden" name="user_id" id="user_id" value="<?php echo $user_id; ?>" />
    191         <input type="submit" value="<?php $is_profile_page? _e('Update Profile', 'buddypress') : _e('Update User', 'buddypress') ?>" name="submit" />
     191        <input type="submit" value="<?php $is_profile_page? _e('Update Profile', 'buddypress') : _e('Update User', 'buddypress') ?>" name="submit" onclick="this.disabled = true; this.value = '<?php _e( 'Loading...', 'buddypress' ) ?>';" />
    192192 </p>
    193193</form>
Note: See TracChangeset for help on using the changeset viewer.