Skip to:
Content

BuddyPress.org

Changeset 2191


Ignore:
Timestamp:
12/16/2009 01:14:41 PM (17 years ago)
Author:
apeatling
Message:

Messaging interface updates, autocomplete fixes, removed left menu and placed items in header.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-templatetags.php

    r2182 r2191  
    330330                <a href="#" id="mark_as_unread"><?php _e('Mark as Unread', 'buddypress') ?></a> &nbsp;
    331331        <?php } ?>
    332                 <a href="#" id="delete_<?php echo $bp->current_action ?>_messages"><?php _e('Delete Selected', 'buddypress') ?></a> &nbsp;
     332        <a href="#" id="delete_<?php echo $bp->current_action ?>_messages"><?php _e('Delete Selected', 'buddypress') ?></a> &nbsp;
    333333<?php
    334334}
  • trunk/bp-messages/css/autocomplete/jquery.autocompletefb.css

    r1651 r2191  
    2121                margin: 0;
    2222        }
    23        
     23
    2424        .ac_results li {
    2525                margin: 0px;
     
    3232        }
    3333                .ac_results li img {
    34                         padding-right: 5px;
     34                        margin-right: 5px;
    3535                }
    36        
     36
    3737.ac_loading {
    3838        background : url('../../images/ajax-loader.gif') right center no-repeat;
     
    4848}
    4949
    50 ul.acfb-holder { 
    51         margin  : 0; 
    52         height  : auto !important; 
    53         height  : 1%; 
    54         overflow: hidden; 
     50ul.acfb-holder {
     51        margin  : 0;
     52        height  : auto !important;
     53        height  : 1%;
     54        overflow: hidden;
    5555        padding: 0;
    5656        list-style: none;
    5757}
    58         ul.acfb-holder li { 
    59                 float   : left; 
    60                 margin  : 0 5px 4px 0; 
    61                 list-style-type: none; 
     58        ul.acfb-holder li {
     59                float   : left;
     60                margin  : 0 5px 4px 0;
     61                list-style-type: none;
    6262        }
    63        
    64         ul.acfb-holder li.friend-tab { 
    65                 border-radius         : 3px; 
    66                 -moz-border-radius    : 3px; 
    67                 -webkit-border-radius : 3px; 
    68                 border     : 1px solid #ffe7c7; 
    69                 padding    : 2px 7px 2px; 
    70                 background : #FFF9DF; 
     63
     64        ul.acfb-holder li.friend-tab {
     65                border-radius         : 3px;
     66                -moz-border-radius    : 3px;
     67                -webkit-border-radius : 3px;
     68                border     : 1px solid #ffe7c7;
     69                padding    : 2px 7px 2px;
     70                background : #FFF9DF;
    7171                font-size: 1em;
    7272        }
     
    7575                        vertical-align: middle;
    7676                }
    77                
     77
    7878                li.friend-tab span.p {
    7979                        padding-left: 5px;
  • trunk/bp-messages/js/autocomplete/jquery.autocomplete.js

    r2021 r2191  
    1313
    1414;(function($) {
    15        
     15
    1616$.fn.extend({
    1717        autocomplete: function(urlOrData, options) {
     
    2323                        max: options && !options.scroll ? 10 : 150
    2424                }, options);
    25                
     25
    2626                // if highlight is set to false, replace it with a do-nothing function
    2727                options.highlight = options.highlight || function(value) { return value; };
    28                
     28
    2929                return this.each(function() {
    3030                        new $.Autocompleter(this, options);
     
    7474        };
    7575        var select = $.Autocompleter.Select(options, input, selectCurrent, config);
    76        
     76
    7777        $input.keydown(function(event) {
    7878                // track last key pressed
    7979                lastKeyPressCode = event.keyCode;
    8080                switch(event.keyCode) {
    81                
     81
    8282                        case KEY.UP:
    8383                                event.preventDefault();
     
    8888                                }
    8989                                break;
    90                                
     90
    9191                        case KEY.DOWN:
    9292                                event.preventDefault();
     
    9797                                }
    9898                                break;
    99                                
     99
    100100                        case KEY.PAGEUP:
    101101                                event.preventDefault();
     
    106106                                }
    107107                                break;
    108                                
     108
    109109                        case KEY.PAGEDOWN:
    110110                                event.preventDefault();
     
    115115                                }
    116116                                break;
    117                        
     117
    118118                        // matches also semicolon
    119119                        case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
     
    128128                                }
    129129                                break;
    130                                
     130
    131131                        case KEY.ESC:
    132132                                select.hide();
    133133                                break;
    134                                
     134
    135135                        default:
    136136                                clearTimeout(timeout);
     
    184184                $input.unbind();
    185185        });
    186        
    187        
     186
     187
    188188        function selectCurrent() {
    189189                var selected = select.selected();
    190190                if( !selected )
    191191                        return false;
    192                
     192
    193193                var v = selected.result;
    194194                previousValue = v;
    195                
     195
    196196                if ( options.multiple ) {
    197197                        var words = trimWords($input.val());
     
    201201                        v += options.multipleSeparator;
    202202                }
    203                
     203
    204204                $input.val(v);
    205205                hideResultsNow();
     
    207207                return true;
    208208        }
    209        
     209
    210210        function onChange(crap, skipPrevCheck) {
    211211                if( lastKeyPressCode == KEY.DEL ) {
     
    213213                        return;
    214214                }
    215                
     215
    216216                var currentValue = $input.val();
    217                
     217
    218218                if ( !skipPrevCheck && currentValue == previousValue )
    219219                        return;
    220                
     220
    221221                previousValue = currentValue;
    222                
     222
    223223                currentValue = lastWord(currentValue);
    224224                if ( currentValue.length >= options.minChars) {
     
    233233                }
    234234        };
    235        
     235
    236236        function trimWords(value) {
    237237                if ( !value ) {
     
    246246                return result;
    247247        }
    248        
     248
    249249        function lastWord(value) {
    250250                if ( !options.multiple )
     
    253253                return words[words.length - 1];
    254254        }
    255        
     255
    256256        // fills in the input box w/the first match (assumed to be the best match)
    257257        function autoFill(q, sValue){
     
    290290                        stopLoading();
    291291                        select.display(data, q);
    292                        
     292
    293293                        var newData = data[0].value.split(';');
    294294                        data.value = newData[0];
     
    310310                // if an AJAX url has been supplied, try loading the data now
    311311                } else if( (typeof options.url == "string") && (options.url.length > 0) ){
    312                        
     312
    313313                        var extraParams = {};
    314314                        $.each(options.extraParams, function(key, param) {
    315315                                extraParams[key] = typeof param == "function" ? param() : param;
    316316                        });
    317                        
     317
    318318                        $.ajax({
    319319                                // try to leverage ajaxQueue plugin to abort previous requests
     
    339339                }
    340340        };
    341        
     341
    342342        function parse(data) {
    343343                var parsed = [];
     
    395395        var data = {};
    396396        var length = 0;
    397        
     397
    398398        function matchSubset(s, sub) {
    399                 if (!options.matchCase) 
     399                if (!options.matchCase)
    400400                        s = s.toLowerCase();
    401401                var i = s.indexOf(sub);
     
    403403                return i == 0 || options.matchContains;
    404404        };
    405        
     405
    406406        function add(q, value) {
    407407                if (length > options.cacheLength){
    408408                        flush();
    409409                }
    410                 if (!data[q]){ 
     410                if (!data[q]){
    411411                        length++;
    412412                }
    413413                data[q] = value;
    414414        }
    415        
     415
    416416        function populate(){
    417417                if( !options.data ) return false;
     
    422422                // no url was specified, we need to adjust the cache length to make sure it fits the local data store
    423423                if( !options.url ) options.cacheLength = 1;
    424                
     424
    425425                // track all options for minChars = 0
    426426                stMatchSets[""] = [];
    427                
     427
    428428                // loop through the array and create a lookup structure
    429429                for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
     
    431431                        // if rawValue is a string, make an array otherwise just reference the array
    432432                        rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
    433                        
     433
    434434                        var value = options.formatItem(rawValue, i+1, options.data.length);
    435435                        if ( value === false )
    436436                                continue;
    437                                
     437
    438438                        var firstChar = value.charAt(0).toLowerCase();
    439439                        // if no lookup array for this character exists, look it up now
    440                         if( !stMatchSets[firstChar] ) 
     440                        if( !stMatchSets[firstChar] )
    441441                                stMatchSets[firstChar] = [];
    442442
     
    447447                                result: options.formatResult && options.formatResult(rawValue) || value
    448448                        };
    449                        
     449
    450450                        // push the current match into the set list
    451451                        stMatchSets[firstChar].push(row);
     
    465465                });
    466466        }
    467        
     467
    468468        // populate any existing data
    469469        setTimeout(populate, 25);
    470        
     470
    471471        function flush(){
    472472                data = {};
    473473                length = 0;
    474474        }
    475        
     475
    476476        return {
    477477                flush: flush,
     
    481481                        if (!options.cacheLength || !length)
    482482                                return null;
    483                         /* 
     483                        /*
    484484                         * if dealing w/local data and matchContains than we must make sure
    485485                         * to loop through all the data collections looking for matches
     
    501501                                                });
    502502                                        }
    503                                 }                               
     503                                }
    504504                                return csub;
    505                         } else 
     505                        } else
    506506                        // if the exact item exists, use it
    507507                        if (data[q]){
     
    531531                ACTIVE: "ac_over"
    532532        };
    533        
     533
    534534        var listItems,
    535535                active = -1,
     
    539539                element,
    540540                list;
    541        
     541
    542542        // Create results
    543543        function init() {
     
    549549                .css("position", "absolute")
    550550                .appendTo(options.attachTo);
    551        
     551
    552552                list = $("<ul>").appendTo(element).mouseover( function(event) {
    553553                        if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
    554554                    active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
    555                             $(target(event)).addClass(CLASSES.ACTIVE);           
     555                            $(target(event)).addClass(CLASSES.ACTIVE);
    556556                }
    557557                }).click(function(event) {
     
    565565                        config.mouseDownOnSelect = false;
    566566                });
    567                
     567
    568568                if( options.width > 0 )
    569569                        element.css("width", options.width);
    570                        
     570
    571571                needsInit = false;
    572         } 
    573        
     572        }
     573
    574574        function target(event) {
    575575                var element = event.target;
     
    598598        }
    599599        };
    600        
     600
    601601        function movePosition(step) {
    602602                active += step;
     
    607607                }
    608608        }
    609        
     609
    610610        function limitNumberOfItems(available) {
    611611                return options.max && options.max < available
     
    613613                        : available;
    614614        }
    615        
     615
    616616        function fillList() {
    617617                list.empty();
     
    633633                list.bgiframe();
    634634        }
    635        
     635
    636636        return {
    637637                display: function(d, q) {
     
    684684                                        overflow: 'auto'
    685685                                });
    686                                
     686
    687687                if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
    688688                                        var listHeight = 0;
     
    697697                                        }
    698698                }
    699                
     699
    700700            }
    701701                },
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r2170 r2191  
    519519add_action( 'wp_ajax_joinleave_group', 'bp_dtheme_ajax_joinleave_group' );
    520520
     521function bp_dtheme_ajax_messages_send_reply() {
     522        global $bp;
     523
     524        check_ajax_referer( 'messages_send_message' );
     525
     526        $result = messages_new_message( array( 'thread_id' => $_REQUEST['thread_id'], 'subject' => $_REQUEST['subject'], 'content' => $_REQUEST['content'] ) );
     527
     528        if ( $result ) { ?>
     529                <div class="message-box new-message">
     530                        <div class="message-metadata">
     531                                <?php do_action( 'bp_before_message_meta' ) ?>
     532                                <?php echo bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ); ?>
     533
     534                                <h3><a href="<?php echo $bp->loggedin_user->domain ?>"><?php echo $bp->loggedin_user->fullname ?></a> <span class="activity"><?php printf( __( 'Sent %s ago', 'buddypress' ), bp_core_time_since( time() ) ) ?></span></h3>
     535
     536                                <?php do_action( 'bp_after_message_meta' ) ?>
     537                        </div>
     538
     539                        <?php do_action( 'bp_before_message_content' ) ?>
     540
     541                        <div class="message-content">
     542                                <?php echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ) ?>
     543                        </div>
     544
     545                        <?php do_action( 'bp_after_message_content' ) ?>
     546
     547                        <div class="clear"></div>
     548                </div>
     549        <?php
     550        } else {
     551                echo "-1<div id='message' class='error'><p>" . __( 'There was a problem sending that reply. Please try again.', 'buddypress' ) . '</p></div>';
     552        }
     553}
     554add_action( 'wp_ajax_messages_send_reply', 'bp_dtheme_ajax_messages_send_reply' );
     555
     556function bp_dtheme_ajax_markunread() {
     557        global $bp;
     558
     559        if ( !isset($_POST['thread_ids']) ) {
     560                echo "-1<div id='message' class='error'><p>" . __('There was a problem marking messages as unread.', 'buddypress' ) . '</p></div>';
     561        } else {
     562                $thread_ids = explode( ',', $_POST['thread_ids'] );
     563
     564                for ( $i = 0; $i < count($thread_ids); $i++ ) {
     565                        BP_Messages_Thread::mark_as_unread($thread_ids[$i]);
     566                }
     567        }
     568}
     569add_action( 'wp_ajax_messages_markunread', 'bp_dtheme_ajax_markunread' );
     570
     571function bp_dtheme_ajax_message_markread() {
     572        global $bp;
     573
     574        if ( !isset($_POST['thread_ids']) ) {
     575                echo "-1<div id='message' class='error'><p>" . __('There was a problem marking messages as read.', 'buddypress' ) . '</p></div>';
     576        } else {
     577                $thread_ids = explode( ',', $_POST['thread_ids'] );
     578
     579                for ( $i = 0; $i < count($thread_ids); $i++ ) {
     580                        BP_Messages_Thread::mark_as_read($thread_ids[$i]);
     581                }
     582        }
     583}
     584add_action( 'wp_ajax_messages_markread', 'bp_dtheme_ajax_messages_markread' );
     585
     586function bp_dtheme_ajax_messages_delete() {
     587        global $bp;
     588
     589        if ( !isset($_POST['thread_ids']) ) {
     590                echo "-1[[split]]" . __( 'There was a problem deleting messages.', 'buddypress' );
     591        } else {
     592                $thread_ids = explode( ',', $_POST['thread_ids'] );
     593
     594                for ( $i = 0; $i < count($thread_ids); $i++ ) {
     595                        BP_Messages_Thread::delete($thread_ids[$i]);
     596                }
     597
     598                _e('Messages deleted.', 'buddypress');
     599        }
     600}
     601add_action( 'wp_ajax_messages_delete', 'bp_dtheme_ajax_messages_delete' );
     602
     603function bp_dtheme_ajax_messages_autocomplete_results() {
     604        global $bp;
     605
     606        $friends = false;
     607
     608        // Get the friend ids based on the search terms
     609        if ( function_exists( 'friends_search_friends' ) )
     610                $friends = friends_search_friends( $_GET['q'], $bp->loggedin_user->id, $_GET['limit'], 1 );
     611
     612        $friends = apply_filters( 'bp_friends_autocomplete_list', $friends, $_GET['q'], $_GET['limit'] );
     613
     614        if ( $friends['friends'] ) {
     615                foreach ( $friends['friends'] as $user_id ) {
     616                        $ud = get_userdata($user_id);
     617                        $username = $ud->user_login;
     618                        echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) ) . ' &nbsp;' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')
     619                        ';
     620                }
     621        }
     622}
     623add_action( 'wp_ajax_messages_autocomplete_results', 'bp_dtheme_ajax_messages_autocomplete_results' );
    521624
    522625?>
  • trunk/bp-themes/bp-default/_inc/css/default.css

    r2190 r2191  
    222222                }
    223223
    224         div#sidebar h3.widgettitle, div#item-menu h3 {
     224        div#sidebar h3.widgettitle {
    225225                margin: 25px -15px 10px -14px;
    226226                background: #eaeaea;
     
    304304
    305305div#item-header {
    306         padding: 15px 0 10px 15px;
    307         margin: -15px 0 0 170px;
    308         border-left: 1px solid #eaeaea;
     306        margin-bottom: 20px;
     307        overflow: hidden;
    309308}
    310309        div#item-header img.avatar {
     
    333332
    334333        div#item-header div#item-meta {
    335                 clear: right;
    336334                font-size: 14px;
    337335                color: #aaa;
     
    341339        }
    342340
     341        div#item-header div#item-actions {
     342                float: right;
     343                width: 20%;
     344                margin: 0 0 15px 15px;
     345                text-align: right;
     346        }
     347                div#item-header div#item-actions h3 {
     348                        font-size: 12px;
     349                        margin: 0 0 5px 0;
     350                }
     351
     352                div#item-header ul {
     353                        overflow: hidden;
     354                        margin-bottom: 15px;
     355                }
     356
     357                div#item-header ul h5, div#item-header ul span, div#item-header ul hr {
     358                        display: none;
     359                }
     360
     361                div#item-header ul li {
     362                        float: right;
     363                }
     364
     365                div#item-header ul img.avatar, div#item-header ul.avatars img.avatar {
     366                        width: 30px;
     367                        height: 30px;
     368                        margin: 2px;
     369                }
     370
    343371        div#item-header div.generic-button {
    344372                float: left;
    345373                margin: 10px 10px 0 0;
    346         }
    347 
    348 /* > Item Body (Profile/Group/.. content)
    349 -------------------------------------------------------------- */
    350 
    351 div#item-body {
    352         margin-left: 170px;
    353         border-left: 1px solid #f0f0f0;
    354         padding-left: 15px;
    355 }
    356 
    357 /* > Item Menu (Profile/Group/.. left menu)
    358 -------------------------------------------------------------- */
    359 
    360 div#item-menu {
    361         width: 155px;
    362         padding-right: 15px;
    363         position: absolute;
    364         top: 20px;
    365         border-right: 1px solid #f0f0f0;
    366 }
    367         div#item-menu h3 {
    368                 margin-right: -14px;
    369         }
    370 
    371         div#item-menu img.avatar {
    372                 margin-bottom: 20px;
    373         }
    374 
    375         div#item-menu ul#group-admins, div#item-menu ul#group-mods,
    376         div#item-menu ul.avatars {
    377                 overflow: hidden;
    378         }
    379 
    380         div#item-menu ul#group-admins h5, div#item-menu ul#group-mods h5,
    381         div#item-menu ul#group-admins span, div#item-menu ul#group-mods span,
    382         div#item-menu ul#group-admins hr, div#item-menu ul#group-mods hr {
    383                 display: none;
    384         }
    385 
    386         div#item-menu ul#group-admins li, div#item-menu ul#group-mods li {
    387                 float: left;
    388         }
    389 
    390         div#item-menu ul#group-admins img.avatar, div#item-menu ul#group-mods img.avatar,
    391         div#item-menu ul.avatars img.avatar {
    392                 width: 30px;
    393                 height: 30px;
    394                 margin: 2px;
    395374        }
    396375
     
    501480        div.item-list-tabs#group-subnav {
    502481                background: #fff;
    503                 margin: -10px -15px 20px -15px;
     482                margin: 0 -15px 20px -15px;
    504483                border-bottom: 1px solid #eaeaea;
    505                 min-height: 32px;
    506         }
    507 
    508         ul#messages-options-nav {
    509                 margin: 30px 0 20px;
    510                 text-align: right;
     484                min-height: 35px;
    511485        }
    512486
     
    770744        table#message-threads {
    771745                margin: 0 -15px;
     746                width: auto;
    772747        }
    773748
     
    12801255-------------------------------------------------------------- */
    12811256
     1257table#message-threads tr.unread td {
     1258        background: #FFF9DB;
     1259        border-top: 1px solid #FFE8C4;
     1260        border-bottom: 1px solid #FFE8C4;
     1261        font-weight: bold;
     1262}
     1263        table#message-threads tr.unread td span.activity {
     1264                background: #fff;
     1265        }
     1266
     1267        li span.unread-count, tr.unread span.unread-count {
     1268                background: #dd0000;
     1269                padding: 2px 8px;
     1270                color: #fff;
     1271                font-weight: bold;
     1272                -moz-border-radius: 3px;
     1273                -khtml-border-radius: 3px;
     1274                -webkit-border-radius: 3px;
     1275                border-radius: 3px;
     1276        }
     1277                div.item-list-tabs ul li a span.unread-count {
     1278                        padding: 1px 6px;
     1279                        color: #fff;
     1280                }
     1281
     1282        div.messages-options-nav {
     1283                font-size: 11px;
     1284                background: #eee;
     1285                text-align: right;
     1286                margin: 0 -15px;
     1287                padding: 5px 15px;
     1288        }
     1289
    12821290div#message-thread div.message-box {
    12831291        margin: 0 -15px;
     
    13171325                margin-left: 45px;
    13181326        }
     1327
     1328        div#message-thread div.message-options {
     1329                text-align: right;
     1330        }
     1331                a#delete_inbox_messages, .sentbox div.messages-options-nav {
     1332                        display: none;
     1333                }
    13191334
    13201335/* > Group Forum Topics
  • trunk/bp-themes/bp-default/_inc/global.js

    r2190 r2191  
    755755        });
    756756
    757         /* Auto expand textareas */
    758         j("textarea").TextAreaExpander( 80, 1000 );
     757        /** Private Messaging ******************************************/
     758
     759        j("input#send_reply_button").click(
     760                function() {
     761                        j('form#send-reply span.ajax-loader').toggle();
     762
     763                        j.post( ajaxurl, {
     764                                action: 'messages_send_reply',
     765                                'cookie': encodeURIComponent(document.cookie),
     766                                '_wpnonce': j("input#send_message_nonce").val(),
     767
     768                                'content': j("#message_content").val(),
     769                                'send_to': j("input#send_to").val(),
     770                                'subject': j("input#subject").val(),
     771                                'thread_id': j("input#thread_id").val()
     772                        },
     773                        function(response)
     774                        {
     775                                if ( response[0] + response[1] == "-1" ) {
     776                                        j('form#send-reply').prepend( response.substr( 2, response.length ) );
     777                                } else {
     778                                        j('form#send-reply div#message').remove();
     779                                        j("#message_content").val('');
     780                                        j('form#send-reply').before( response );
     781
     782                                        j("div.new-message").hide().slideDown( 200, function() {
     783                                                j('form#send-reply span.ajax-loader').toggle();
     784                                                j('div.new-message').removeClass('new-message');
     785                                        });
     786
     787                                        j('div.message-box').each( function(i) {
     788                                                j(this).removeClass('alt');
     789                                                if ( i % 2 != 1 )
     790                                                        j(this).addClass('alt');
     791                                        });
     792                                }
     793                        });
     794
     795                        return false;
     796                }
     797        );
     798
     799        j("a#mark_as_read, a#mark_as_unread").click(
     800                function() {
     801                        var checkboxes_tosend = '';
     802                        var checkboxes = j("#message-threads tr td input[type='checkbox']");
     803
     804                        if ( 'mark_as_unread' == j(this).attr('id') ) {
     805                                var currentClass = 'read'
     806                                var newClass = 'unread'
     807                                var unreadCount = 1;
     808                                var inboxCount = 0;
     809                                var unreadCountDisplay = 'inline';
     810                                var action = 'messages_markunread';
     811                        } else {
     812                                var currentClass = 'unread'
     813                                var newClass = 'read'
     814                                var unreadCount = 0;
     815                                var inboxCount = 1;
     816                                var unreadCountDisplay = 'none';
     817                                var action = 'messages_markread';
     818                        }
     819
     820                        checkboxes.each( function(i) {
     821                                if(checkboxes[i].checked) {
     822                                        if ( j('tr#m-' + checkboxes[i].value).hasClass(currentClass) ) {
     823                                                checkboxes_tosend += checkboxes[i].value;
     824                                                j('tr#m-' + checkboxes[i].value).removeClass(currentClass);
     825                                                j('tr#m-' + checkboxes[i].value).addClass(newClass);
     826                                                j('tr#m-' + checkboxes[i].value + ' td span.unread-count').html(unreadCount);
     827                                                j('tr#m-' + checkboxes[i].value + ' td span.unread-count').css('display', unreadCountDisplay);
     828                                                var inboxcount = j('.inbox-count').html();
     829
     830                                                if ( parseInt(inboxcount) == inboxCount ) {
     831                                                        j('.inbox-count').css('display', unreadCountDisplay);
     832                                                        j('.inbox-count').html(unreadCount);
     833                                                } else {
     834                                                        if ( 'read' == currentClass )
     835                                                                j('.inbox-count').html(parseInt(inboxcount) + 1);
     836                                                        else
     837                                                                j('.inbox-count').html(parseInt(inboxcount) - 1);
     838                                                }
     839
     840                                                if ( i != checkboxes.length - 1 ) {
     841                                                        checkboxes_tosend += ','
     842                                                }
     843                                        }
     844                                }
     845                        });
     846                        j.post( ajaxurl, {
     847                                action: action,
     848                                'thread_ids': checkboxes_tosend
     849                        });
     850                        return false;
     851                }
     852        );
     853
     854        j("select#message-type-select").change(
     855                function() {
     856                        var selection = j("select#message-type-select").val();
     857                        var checkboxes = j("td input[type='checkbox']");
     858                        checkboxes.each( function(i) {
     859                                checkboxes[i].checked = "";
     860                        });
     861
     862                        switch(selection) {
     863                                case 'unread':
     864                                        var checkboxes = j("tr.unread td input[type='checkbox']");
     865                                break;
     866                                case 'read':
     867                                        var checkboxes = j("tr.read td input[type='checkbox']");
     868                                break;
     869                        }
     870                        if ( selection != '' ) {
     871                                checkboxes.each( function(i) {
     872                                        checkboxes[i].checked = "checked";
     873                                });
     874                        } else {
     875                                checkboxes.each( function(i) {
     876                                        checkboxes[i].checked = "";
     877                                });
     878                        }
     879                }
     880        );
     881
    759882});
    760883
     
    795918/* jQuery Cookie plugin */
    796919eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('o.5=B(9,b,2){6(h b!=\'E\'){2=2||{};6(b===n){b=\'\';2.3=-1}4 3=\'\';6(2.3&&(h 2.3==\'j\'||2.3.k)){4 7;6(h 2.3==\'j\'){7=w u();7.t(7.q()+(2.3*r*l*l*x))}m{7=2.3}3=\'; 3=\'+7.k()}4 8=2.8?\'; 8=\'+(2.8):\'\';4 a=2.a?\'; a=\'+(2.a):\'\';4 c=2.c?\'; c\':\'\';d.5=[9,\'=\',C(b),3,8,a,c].y(\'\')}m{4 e=n;6(d.5&&d.5!=\'\'){4 g=d.5.A(\';\');s(4 i=0;i<g.f;i++){4 5=o.z(g[i]);6(5.p(0,9.f+1)==(9+\'=\')){e=D(5.p(9.f+1));v}}}F e}};',42,42,'||options|expires|var|cookie|if|date|path|name|domain|value|secure|document|cookieValue|length|cookies|typeof||number|toUTCString|60|else|null|jQuery|substring|getTime|24|for|setTime|Date|break|new|1000|join|trim|split|function|encodeURIComponent|decodeURIComponent|undefined|return'.split('|'),0,{}))
    797 
    798 /* Textarea autoexpand */
    799 eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){$.C.B=5(g,r){6 k=!($.u.A||$.u.L);5 7(e){e=e.E||e;6 4=e.z.y,9=e.D;8(4!=e.f||9!=e.b){8(k&&(4<e.f||9!=e.b))e.a.o="H";6 h=m.M(e.l,m.G(e.q,e.j));e.a.I=(e.q>h?"K":"F");e.a.o=h+"J";e.f=4;e.b=9}c x};3.Z(5(){8(3.V.X()!="N")c;6 p=3.U.T(/P(\\d+)\\-*(\\d+)*/i);3.l=g||(p?n(\'0\'+p[1],10):0);3.j=r||(p?n(\'0\'+p[2],10):S);7(3);8(!3.w){3.w=x;$(3).s("t-R",0).s("t-Q",0);$(3).v("O",7).v("W",7)}});c 3}})(Y);',62,63,'|||this|vlen|function|var|ResizeTextarea|if|ewidth|style|boxWidth|return|||valLength|minHeight|||expandMax|hCheck|expandMin|Math|parseInt|height||scrollHeight|maxHeight|css|padding|browser|bind|Initialized|true|length|value|msie|TextAreaExpander|fn|offsetWidth|target|hidden|min|0px|overflow|px|auto|opera|max|textarea|keyup|expand|bottom|top|99999|match|className|nodeName|focus|toLowerCase|jQuery|each|'.split('|'),0,{}))
  • trunk/bp-themes/bp-default/groups/single/group-header.php

    r2179 r2191  
    1 <div id="item-header">
    2         <h2><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></h2>
     1<div id="item-actions">
     2        <?php if ( bp_group_is_visible() ) : ?>
    33
    4         <span class="highlight"><?php bp_group_type() ?></span> <span class="activity"><?php printf( __( 'active %s ago', 'buddypress' ), bp_get_group_last_active() ) ?></span>
     4                <h3><?php _e( 'Group Admins', 'buddypress' ) ?></h3>
     5                <?php bp_group_list_admins() ?>
    56
    6         <div id="item-meta">
    7                 <?php bp_group_description() ?>
     7                <?php do_action( 'bp_after_group_menu_admins' ) ?>
    88
    9                 <?php bp_group_join_button() ?>
     9                <?php if ( bp_group_has_moderators() ) : ?>
     10                        <?php do_action( 'bp_before_group_menu_mods' ) ?>
    1011
    11                 <?php do_action( 'bp_group_header_content' ) ?>
    12         </div>
     12                        <h3><?php _e( 'Group Mods' , 'buddypress' ) ?></h3>
     13                        <?php bp_group_list_mods() ?>
    1314
    14         <div class="item-list-tabs no-ajax" id="user-nav">
    15                 <ul>
    16                         <?php bp_get_options_nav() ?>
     15                        <?php do_action( 'bp_after_group_menu_mods' ) ?>
     16                <?php endif; ?>
    1717
    18                         <?php do_action( 'bp_members_directory_member_types' ) ?>
    19                 </ul>
    20         </div>
     18        <?php endif; ?>
     19</div>
    2120
     21<?php bp_group_avatar() ?>
     22
     23<h2><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></h2>
     24
     25<span class="highlight"><?php bp_group_type() ?></span> <span class="activity"><?php printf( __( 'active %s ago', 'buddypress' ), bp_get_group_last_active() ) ?></span>
     26
     27<div id="item-meta">
     28        <?php bp_group_description() ?>
     29
     30        <?php bp_group_join_button() ?>
     31
     32        <?php do_action( 'bp_group_header_content' ) ?>
    2233</div>
  • trunk/bp-themes/bp-default/groups/single/home.php

    r2183 r2191  
    77                        <?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?>
    88
    9                         <?php locate_template( array( 'groups/single/group-header.php' ), true ) ?>
     9                        <div id="item-header">
     10                                <?php locate_template( array( 'groups/single/group-header.php' ), true ) ?>
     11                        </div>
     12
     13                        <div id="item-nav">
     14                                <div class="item-list-tabs no-ajax" id="user-nav">
     15                                        <ul>
     16                                                <?php bp_get_options_nav() ?>
     17
     18                                                <?php do_action( 'bp_members_directory_member_types' ) ?>
     19                                        </ul>
     20                                </div>
     21                        </div>
    1022
    1123                        <div id="item-body">
     
    3648                        </div>
    3749
    38                         <div id="item-menu">
    39                                 <?php bp_group_avatar() ?>
    40 
    41                                 <?php if ( bp_group_is_visible() ) : ?>
    42 
    43                                         <?php if ( bp_group_has_news() ) : ?>
    44                                                 <?php do_action( 'bp_before_group_news' ) ?>
    45 
    46                                                 <h3><?php _e( 'Latest News', 'buddypress' ); ?></h3>
    47                                                 <p><?php bp_group_news() ?></p>
    48 
    49                                                 <?php do_action( 'bp_after_group_news' ) ?>
    50                                         <?php endif; ?>
    51 
    52                                         <h3><?php _e( 'Group Admins', 'buddypress' ) ?></h3>
    53                                         <?php bp_group_list_admins() ?>
    54 
    55                                         <?php do_action( 'bp_after_group_menu_admins' ) ?>
    56 
    57                                         <?php if ( bp_group_has_moderators() ) : ?>
    58                                                 <?php do_action( 'bp_before_group_menu_mods' ) ?>
    59 
    60                                                 <h3><?php _e( 'Group Mods' , 'buddypress' ) ?></h3>
    61                                                 <?php bp_group_list_mods() ?>
    62 
    63                                                 <?php do_action( 'bp_after_group_menu_mods' ) ?>
    64                                         <?php endif; ?>
    65 
    66                                 <?php endif; ?>
    67                         </div>
    68 
    6950                        <?php endwhile; endif; ?>
    7051                </div><!-- .padder -->
  • trunk/bp-themes/bp-default/members/single/home.php

    r2185 r2191  
    1010                        </div>
    1111
     12                        <div id="item-nav">
     13                                <div class="item-list-tabs no-ajax" id="user-nav">
     14                                        <ul>
     15                                                <?php bp_get_user_nav() ?>
     16
     17                                                <?php do_action( 'bp_members_directory_member_types' ) ?>
     18                                        </ul>
     19                                </div>
     20                        </div>
     21
    1222                        <div id="item-body">
     23
    1324                                <?php if ( 'home' == bp_current_component() || 'activity' == bp_current_component() || !bp_current_component() ) : ?>
    1425                                        <?php locate_template( array( 'members/single/activity.php' ), true ) ?>
     
    3849                        </div><!-- #item-body -->
    3950
    40                         <div id="item-menu">
    41                                 <?php bp_displayed_user_avatar( 'type=full' ) ?>
    42 
    43                                 <?php
    44                                  /***
    45                                   * If you'd like to show specific profile fields here use:
    46                                   * bp_profile_field_data( 'field=About Me' ); -- Pass the name of the field
    47                                   */
    48                                 ?>
    49 
    50                                 <?php do_action( 'bp_before_profile_random_friends_loop' ) ?>
    51 
    52                                 <?php if ( bp_has_members( 'user_id=' . bp_displayed_user_id() . '&type=random&max=20' ) ) : ?>
    53 
    54                                         <h3><a href="<?php echo bp_displayed_user_domain() . BP_FRIENDS_SLUG ?>"><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?></a></h3>
    55 
    56                                         <ul class="avatars">
    57                                         <?php while ( bp_members() ) : bp_the_member(); ?>
    58                                                 <li>
    59                                                         <a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_avatar('width=30&height=30') ?></a>
    60                                                 </li>
    61                                         <?php endwhile; ?>
    62                                         </ul>
    63 
    64                                 <?php endif; ?>
    65 
    66                                 <?php do_action( 'bp_after_profile_random_friends_loop' ) ?>
    67                                 <?php do_action( 'bp_before_profile_random_groups_loop' ) ?>
    68 
    69                                 <?php if ( function_exists( 'bp_has_groups' ) ) : ?>
    70 
    71                                         <?php if ( bp_has_groups( 'user_id=' . bp_displayed_user_id() . '&type=random&max=20' ) ) : ?>
    72 
    73                                                 <h3><a href="<?php echo bp_displayed_user_domain() . BP_GROUPS_SLUG ?>"><?php bp_word_or_name( __( "My Groups", 'buddypress' ), __( "%s's Groups", 'buddypress' ) ) ?></a></h3>
    74 
    75                                                 <ul class="avatars">
    76                                                 <?php while ( bp_groups() ) : bp_the_group(); ?>
    77                                                         <li>
    78                                                                 <a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_avatar('width=30&height=30') ?></a>
    79                                                         </li>
    80                                                 <?php endwhile; ?>
    81                                                 </ul>
    82 
    83                                         <?php endif; ?>
    84 
    85                                 <?php endif; ?>
    86 
    87                                 <?php do_action( 'bp_after_profile_random_groups_loop' ) ?>
    88                         </div>
    89 
    9051                </div><!-- .padder -->
    9152        </div><!-- #content -->
  • trunk/bp-themes/bp-default/members/single/member-header.php

    r2184 r2191  
     1<?php bp_displayed_user_avatar( 'type=full' ) ?>
     2
    13<h2 class="fn"><a href="<?php bp_user_link() ?>"><?php bp_displayed_user_fullname() ?></a> <span class="activity"><?php bp_last_activity( bp_displayed_user_id() ) ?></span></h2>
    24
     
    2830
    2931<?php do_action( 'template_notices' ) ?>
    30 
    31 <div class="item-list-tabs no-ajax" id="user-nav">
    32         <ul>
    33                 <?php bp_get_user_nav() ?>
    34 
    35                 <?php do_action( 'bp_members_directory_member_types' ) ?>
    36         </ul>
    37 </div>
  • trunk/bp-themes/bp-default/members/single/messages/compose.php

    r2184 r2191  
    2727        <div class="submit">
    2828                <input type="submit" value="<?php _e( "Send Message", 'buddypress' ) ?> &rarr;" name="send" id="send" />
     29                <span class="ajax-loader"></span>
    2930        </div>
    3031
  • trunk/bp-themes/bp-default/members/single/messages/messages-loop.php

    r2170 r2191  
    1515        <?php do_action( 'bp_before_messages_inbox_list' ) ?>
    1616
     17        <div class="messages-options-nav">
     18                <?php bp_messages_options() ?>
     19        </div>
     20
    1721        <table id="message-threads">
    1822                <?php while ( bp_message_threads() ) : bp_message_thread(); ?>
     
    2327                                </td>
    2428                                <td width="1%" class="thread-avatar"><?php bp_message_thread_avatar() ?></td>
    25                                 <td width="27%" class="thread-from">
     29                                <td width="30%" class="thread-from">
    2630                                        <?php _e("From:", "buddypress"); ?> <?php bp_message_thread_from() ?><br />
    2731                                        <span class="activity"><?php bp_message_thread_last_post_date() ?></span>
    2832                                </td>
    29                                 <td width="40%" class="thread-info">
     33                                <td width="50%" class="thread-info">
    3034                                        <p><a href="<?php bp_message_thread_view_link() ?>" title="<?php _e( "View Message", "buddypress" ); ?>"><?php bp_message_thread_subject() ?></a></p>
    3135                                        <p class="thread-excerpt"><?php bp_message_thread_excerpt() ?></p>
     
    3438                                <?php do_action( 'bp_messages_inbox_list_item' ) ?>
    3539
    36                                 <td width="10%" class="thread-options">
    37                                         <a href="<?php bp_message_thread_delete_link() ?>" title="<?php _e("Delete Message", "buddypress"); ?>" class="delete confirm"><?php _e("Delete", "buddypress"); ?></a> &nbsp;
     40                                <td width="13%" class="thread-options">
    3841                                        <input type="checkbox" name="message_ids[]" value="<?php bp_message_thread_id() ?>" />
     42                                        <a class="button confirm" href="<?php bp_message_thread_delete_link() ?>" title="<?php _e( "Delete Message", "buddypress" ); ?>">x</a> &nbsp;
    3943                                </td>
    4044                        </tr>
     
    4347        </table>
    4448
    45         <ul id="messages-options-nav">
    46                 <li>
    47                         <?php bp_messages_options() ?>
    48                 </li>
    49         </ul>
     49        <div class="messages-options-nav">
     50                <?php bp_messages_options() ?>
     51        </div>
    5052
    5153        <?php do_action( 'bp_after_messages_inbox_list' ) ?>
  • trunk/bp-themes/bp-default/members/single/messages/single.php

    r2170 r2191  
    7878                                        <div class="submit">
    7979                                                <input type="submit" name="send" value="<?php _e( 'Send Reply', 'buddypress' ) ?> &rarr;" id="send_reply_button"/>
     80                                                <span class="ajax-loader"></span>
    8081                                        </div>
    8182
Note: See TracChangeset for help on using the changeset viewer.