Plugin Directory

Changeset 685151


Ignore:
Timestamp:
03/21/2013 11:33:29 AM (13 years ago)
Author:
ntemple
Message:

minor update to 1.4.1

Location:
bracketpress/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • bracketpress/trunk/bracketpress.php

    r683488 r685151  
    55Author: Scott Hack and Nick Temple
    66Author URI: http://www.bracketpress.com
    7 Version: 1.4.0
     7Version: 1.4.1
    88*/
    99
  • bracketpress/trunk/lib/bracketpress-shortcodes.php

    r677166 r685151  
    152152            }
    153153            print "
    154             <tr>
    155               <td width='30%'><a href='{$link}'>{$post->post_title}</a></td>
    156               <td width='25%'>{$author->display_name}</td>
    157               <td width='25%'>{$author->first_name}</td>
    158               <td width='10%'>{$author->last_name[0]}</td>
    159               <td width='10%'>{$score}</td>
     154            <tr class='brackets'>
     155              <td width='30%' class='bracket_title'><a href='{$link}'>{$post->post_title}</a></td>
     156              <td width='25%' class='bracket_user'>{$author->display_name}</td>
     157              <td width='25%' class='bracket_fname'>{$author->first_name}</td>
     158              <td width='10%' class='bracket_lname'>{$author->last_name[0]}</td>
     159              <td width='10%' class='bracket_score'>{$score}</td>
    160160            </tr>";
    161161
  • bracketpress/trunk/readme.txt

    r683488 r685151  
    5151
    5252== Changelog ==
     53
     54= 1.4.4 =
     55* Add class to bracketpress shortcode for easier styling (Brandon Kraft)
     56* Cleaned up commented out HTML that IE seems to be choking on
    5357
    5458= 1.4.0 =
     
    129133* Charles Griffin
    130134* Jason Melgoza ( CSS of Bracket )
     135* Brandon Kraft
    131136
  • bracketpress/trunk/templates/bracket_edit.js

    r683488 r685151  
    1 //code for removal of value from checkbox of round 3 and so on.
     1
    22(function($) { // Undo noConflict()
    33
     
    104104    $("#tabs").tabs();
    105105
    106     /* NLT Manually filling in the items for the final 4
    107     *  What's the better way?
    108     */
    109106    var sel_match;
    110107
     
    192189        var this_match_id = prnt;
    193190
    194 //        if (prnt != 'match15' && prnt != 'match30' && prnt != 'match45' && prnt != 'match60' && prnt != 'match61' && prnt != 'match62' && prnt != 'match63') {
    195 
    196191            var d = '';
    197             /*
    198              Process to fill up next dropdowns
    199              */
    200             //change_next_dds_on_change_current_round_dd($(this));
    201192
    202193            var match_id_div = $(this).parent('p').parent('div');
     
    205196            var num_more_rounds = match_id_div.parent('div').nextAll().length;//how many more rounds
    206197            var num_prev_rounds = match_id_div.parent('div').prevAll().length;//how many prev rounds
    207             //alert(num_more_rounds);
    208             //begin for loop
     198
    209199            for (var m = 0; m < num_more_rounds; m++) {
    210200
    211201                var match_id = match_id_div.attr('id');
    212                 //alert(match_id);
    213202
    214203                //get the current region
     
    230219                        break;
    231220                }
    232                 //alert(next_round_dd_id);
     221
    233222                var next_round_div = match_id_div.parent('div').next();
     223
    234224                //check if there are more rounds or this is the last round
    235225                if (next_round_div) {
     
    241231                    switch (current_selected_index) {
    242232                        case 0:
    243                             //=======================
    244233
    245234                            if ($(this).find('option')[1]) {
     
    252241                                            data:'action=bracketpress&task=save_selection&mid=' + match_id + '&winner=0&bracket=' + post_id,
    253242                                            success:function (res) {
    254                                                 //alert(res);
    255243                                            }
    256244                                        });
     
    269257                                            data:'action=bracketpress&task=save_selection&mid=' + match_id + '&winner=0&banner=' + post_id,
    270258                                            success:function (res) {
    271                                                 // alert(res);
    272259                                            }
    273260                                        });
     
    277264                            }
    278265                            break;
    279                         // ======================================================================================
     266
     267
    280268                        case 1:
    281269                            if ($(this).find('option')[2]) {
     
    287275
    288276                                    var d = 'task=save_selection&mid=' + match_id;
     277
    289278                                    //do this only for the last matches of each region
    290279                                    if (match_id == 'match15' || match_id == 'match30' || match_id == 'match45' || match_id == 'match60') {
    291280                                        var prev_winner = other_option;
    292                                         //alert('case 1');
    293281                                        var other_option_index = $('#' + next_round_dd_id + ' > option[value="' + other_option + '"]').index();
    294                                         //alert(other_option_index);
     282
    295283                                        switch (other_option_index) {
    296284                                            case 1:
     
    313301                                        data:d + '&action=bracketpress&&winner=' + current_selected_value + '&bracket='+ post_id,
    314302                                        success:function (res) {
    315                                             //alert(res);
    316303                                        }
    317304                                    });
     
    339326                                    if (match_id == 'match15' || match_id == 'match30' || match_id == 'match45' || match_id == 'match60') {
    340327                                        var prev_winner = other_option;
    341                                         //alert('case 2');
     328
    342329                                        var other_option_index = $('#' + next_round_dd_id + ' > option[value="' + other_option + '"]').index();
    343                                         //alert(other_option_index);
     330
    344331                                        switch (other_option_index) {
    345332                                            case 1:
     
    362349                                        data:d + '&action=bracketpress&&winner=' + current_selected_value + '&bracket=' + post_id,
    363350                                        success:function (res) {
    364                                             //alert(res);
    365351                                        }
    366352                                    });
     
    379365                    }
    380366
    381                     //check if next round has this current value in it
    382 
    383367                }
    384                 //$(this).parent('p').parent('div')
     368
    385369                $('#' + match_id + ' select').each(function (i, v) {
    386370                    if ($(this).find('option[value=' + current_selected_value + ']').length) {
     
    390374                            data:'action=bracketpress&task=change_team&bracket=' + post_id + '&mid=' + match_id + '&team_num=' + (i + 1) + '&val=' + current_selected_value,
    391375                            success:function (res) {
    392                                 //alert(res);
    393376                            }
    394377                        });
    395378                    }
    396379                });
    397                 //reinitialize variables
     380
     381
    398382                match_id_div = $('#' + next_round_dd_id).parent('p').parent('div');
    399383
    400384            }
    401             //end for loop
    402 
    403 
    404             /*
    405              Process to fill up previous dropdowns
    406              */
     385
    407386            if (current_selected_index > 0) {
    408387                for (var n = 0; n < num_prev_rounds - 1; n++) {
     
    414393                    if (prev_round_div_id) {
    415394
    416                         $('#' + prev_round_div_id + ' select').each(function (i, value) {//alert('here'+i);
     395                        $('#' + prev_round_div_id + ' select').each(function (i, value) {
    417396                            var t = $(this);
    418397                            var opts = t.children('option');
    419398                            for (var l = 0; l < opts.length; l++) {
    420399                                if (opts[l].value == current_selected_value) {
    421                                     //t.children('option').eq(3).attr('selected','selected');
    422                                     //alert(opts[l].value);
     400
    423401                                    t.val(opts[l].value);
    424402                                    $.ajax({
     
    427405                                        data:'action=bracketpress&task=save_selection&mid=' + $(this).parent('p').attr('rel') + '&winner=' + opts[l].value + '&bracket=' + post_id,
    428406                                        success:function (res) {
    429                                             //alert(res);
    430407                                        }
    431408                                    });
     
    437414                        });
    438415
    439                         //check if next round has this current value in it
    440 
    441416                    }
    442417
     
    445420            }
    446421
    447 //        }
    448 
    449         //save the selected value
    450422        var myOpts = this.options;
    451423        if (myOpts.length == '2') {
     
    470442        });
    471443
    472 
    473         // Handle Final 4
    474         /**
    475          * NLT 2013/01/26
    476          * Functionality specific to the final four. This has been
    477          * brute-forced with internal knowledge of the structure of the brackets
    478          * Needs to be refactored into a more elegant system.
    479          *
    480          * This is completely brute force. Any change could affect the final 4,
    481          * this really only needs to be run on specific changes.
    482          * For now, we rebuild on every update.
    483          * @todo: optimize javascript for final 4
    484          */
    485 
    486444        var winner;
    487445
     
    509467        set_team(63, 2, $('#get_team_selector_match62').val(), winner);
    510468
    511         /*** End one-off functionality **/
    512 
    513469    });
    514470    //onchange code ends
  • bracketpress/trunk/templates/bracket_edit.php

    r683488 r685151  
    216216
    217217<div id="table">
    218 
    219     <!-- Table Dates -->
    220218    <table class="gridtable">
    221219        <tr>
     
    236234        <li><a href="#reg-5">FINALS</a></li>
    237235    </ul>
     236
    238237    <?php
    239238    bracketpress_partial_show_region(1, 'south',   1);
     
    241240    bracketpress_partial_show_region(3, 'east',    31);
    242241    bracketpress_partial_show_region(4, 'midwest', 46);
    243 ?>
     242    ?>
    244243
    245244    <div id="reg-5">
    246245        <h2>Final Four</h2>
    247         <!--
    248         Team 1 Score <input type="text" size="10"><br>
    249         Team 2 Score: <input type="text" size="10">
    250         -->
    251246        <div id="bracket" style="left: 200; top:50">
    252247            <div id="round1" class="round">
     
    283278                </div>
    284279            </div>
    285 
    286         </div>
    287 
    288 
     280        </div>
    289281    </div>
    290282</div>
     
    293285</div>
    294286
    295 </div> <!-- Page -->
     287</div>
Note: See TracChangeset for help on using the changeset viewer.