Changeset 685151
- Timestamp:
- 03/21/2013 11:33:29 AM (13 years ago)
- Location:
- bracketpress/trunk
- Files:
-
- 5 edited
-
bracketpress.php (modified) (1 diff)
-
lib/bracketpress-shortcodes.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
templates/bracket_edit.js (modified) (21 diffs)
-
templates/bracket_edit.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bracketpress/trunk/bracketpress.php
r683488 r685151 5 5 Author: Scott Hack and Nick Temple 6 6 Author URI: http://www.bracketpress.com 7 Version: 1.4. 07 Version: 1.4.1 8 8 */ 9 9 -
bracketpress/trunk/lib/bracketpress-shortcodes.php
r677166 r685151 152 152 } 153 153 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> 160 160 </tr>"; 161 161 -
bracketpress/trunk/readme.txt
r683488 r685151 51 51 52 52 == 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 53 57 54 58 = 1.4.0 = … … 129 133 * Charles Griffin 130 134 * Jason Melgoza ( CSS of Bracket ) 135 * Brandon Kraft 131 136 -
bracketpress/trunk/templates/bracket_edit.js
r683488 r685151 1 //code for removal of value from checkbox of round 3 and so on. 1 2 2 (function($) { // Undo noConflict() 3 3 … … 104 104 $("#tabs").tabs(); 105 105 106 /* NLT Manually filling in the items for the final 4107 * What's the better way?108 */109 106 var sel_match; 110 107 … … 192 189 var this_match_id = prnt; 193 190 194 // if (prnt != 'match15' && prnt != 'match30' && prnt != 'match45' && prnt != 'match60' && prnt != 'match61' && prnt != 'match62' && prnt != 'match63') {195 196 191 var d = ''; 197 /*198 Process to fill up next dropdowns199 */200 //change_next_dds_on_change_current_round_dd($(this));201 192 202 193 var match_id_div = $(this).parent('p').parent('div'); … … 205 196 var num_more_rounds = match_id_div.parent('div').nextAll().length;//how many more rounds 206 197 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 209 199 for (var m = 0; m < num_more_rounds; m++) { 210 200 211 201 var match_id = match_id_div.attr('id'); 212 //alert(match_id);213 202 214 203 //get the current region … … 230 219 break; 231 220 } 232 //alert(next_round_dd_id); 221 233 222 var next_round_div = match_id_div.parent('div').next(); 223 234 224 //check if there are more rounds or this is the last round 235 225 if (next_round_div) { … … 241 231 switch (current_selected_index) { 242 232 case 0: 243 //=======================244 233 245 234 if ($(this).find('option')[1]) { … … 252 241 data:'action=bracketpress&task=save_selection&mid=' + match_id + '&winner=0&bracket=' + post_id, 253 242 success:function (res) { 254 //alert(res);255 243 } 256 244 }); … … 269 257 data:'action=bracketpress&task=save_selection&mid=' + match_id + '&winner=0&banner=' + post_id, 270 258 success:function (res) { 271 // alert(res);272 259 } 273 260 }); … … 277 264 } 278 265 break; 279 // ====================================================================================== 266 267 280 268 case 1: 281 269 if ($(this).find('option')[2]) { … … 287 275 288 276 var d = 'task=save_selection&mid=' + match_id; 277 289 278 //do this only for the last matches of each region 290 279 if (match_id == 'match15' || match_id == 'match30' || match_id == 'match45' || match_id == 'match60') { 291 280 var prev_winner = other_option; 292 //alert('case 1');293 281 var other_option_index = $('#' + next_round_dd_id + ' > option[value="' + other_option + '"]').index(); 294 //alert(other_option_index); 282 295 283 switch (other_option_index) { 296 284 case 1: … … 313 301 data:d + '&action=bracketpress&&winner=' + current_selected_value + '&bracket='+ post_id, 314 302 success:function (res) { 315 //alert(res);316 303 } 317 304 }); … … 339 326 if (match_id == 'match15' || match_id == 'match30' || match_id == 'match45' || match_id == 'match60') { 340 327 var prev_winner = other_option; 341 //alert('case 2'); 328 342 329 var other_option_index = $('#' + next_round_dd_id + ' > option[value="' + other_option + '"]').index(); 343 //alert(other_option_index); 330 344 331 switch (other_option_index) { 345 332 case 1: … … 362 349 data:d + '&action=bracketpress&&winner=' + current_selected_value + '&bracket=' + post_id, 363 350 success:function (res) { 364 //alert(res);365 351 } 366 352 }); … … 379 365 } 380 366 381 //check if next round has this current value in it382 383 367 } 384 //$(this).parent('p').parent('div') 368 385 369 $('#' + match_id + ' select').each(function (i, v) { 386 370 if ($(this).find('option[value=' + current_selected_value + ']').length) { … … 390 374 data:'action=bracketpress&task=change_team&bracket=' + post_id + '&mid=' + match_id + '&team_num=' + (i + 1) + '&val=' + current_selected_value, 391 375 success:function (res) { 392 //alert(res);393 376 } 394 377 }); 395 378 } 396 379 }); 397 //reinitialize variables 380 381 398 382 match_id_div = $('#' + next_round_dd_id).parent('p').parent('div'); 399 383 400 384 } 401 //end for loop 402 403 404 /* 405 Process to fill up previous dropdowns 406 */ 385 407 386 if (current_selected_index > 0) { 408 387 for (var n = 0; n < num_prev_rounds - 1; n++) { … … 414 393 if (prev_round_div_id) { 415 394 416 $('#' + prev_round_div_id + ' select').each(function (i, value) { //alert('here'+i);395 $('#' + prev_round_div_id + ' select').each(function (i, value) { 417 396 var t = $(this); 418 397 var opts = t.children('option'); 419 398 for (var l = 0; l < opts.length; l++) { 420 399 if (opts[l].value == current_selected_value) { 421 //t.children('option').eq(3).attr('selected','selected'); 422 //alert(opts[l].value); 400 423 401 t.val(opts[l].value); 424 402 $.ajax({ … … 427 405 data:'action=bracketpress&task=save_selection&mid=' + $(this).parent('p').attr('rel') + '&winner=' + opts[l].value + '&bracket=' + post_id, 428 406 success:function (res) { 429 //alert(res);430 407 } 431 408 }); … … 437 414 }); 438 415 439 //check if next round has this current value in it440 441 416 } 442 417 … … 445 420 } 446 421 447 // }448 449 //save the selected value450 422 var myOpts = this.options; 451 423 if (myOpts.length == '2') { … … 470 442 }); 471 443 472 473 // Handle Final 4474 /**475 * NLT 2013/01/26476 * Functionality specific to the final four. This has been477 * brute-forced with internal knowledge of the structure of the brackets478 * 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 4484 */485 486 444 var winner; 487 445 … … 509 467 set_team(63, 2, $('#get_team_selector_match62').val(), winner); 510 468 511 /*** End one-off functionality **/512 513 469 }); 514 470 //onchange code ends -
bracketpress/trunk/templates/bracket_edit.php
r683488 r685151 216 216 217 217 <div id="table"> 218 219 <!-- Table Dates -->220 218 <table class="gridtable"> 221 219 <tr> … … 236 234 <li><a href="#reg-5">FINALS</a></li> 237 235 </ul> 236 238 237 <?php 239 238 bracketpress_partial_show_region(1, 'south', 1); … … 241 240 bracketpress_partial_show_region(3, 'east', 31); 242 241 bracketpress_partial_show_region(4, 'midwest', 46); 243 ?>242 ?> 244 243 245 244 <div id="reg-5"> 246 245 <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 -->251 246 <div id="bracket" style="left: 200; top:50"> 252 247 <div id="round1" class="round"> … … 283 278 </div> 284 279 </div> 285 286 </div> 287 288 280 </div> 289 281 </div> 290 282 </div> … … 293 285 </div> 294 286 295 </div> <!-- Page -->287 </div>
Note: See TracChangeset
for help on using the changeset viewer.