jquery-bracket icon indicating copy to clipboard operation
jquery-bracket copied to clipboard

Question: Best of. Similar to #53

Open Garet1337 opened this issue 8 years ago • 4 comments

Hello, I'm new to the programming world. I have only started learning HTML and CSS. This was my first experience with javascript.

Is there a way to add make the next round not populate unless the score is greater than or equal to a number? Example, currently if I put in "1" in the score field, it assumes they win and they go the the next bracket. Is there a script or code I could use to only let them advance if their score is greater than or equal to 2?

Garet1337 avatar Sep 07 '17 17:09 Garet1337

Hi, and welcome to the programming world. :)

It's not supported at the moment out of the box. You would need to modify the library code to get the behaviour you're looking for.

What's your use case for this requirement? Maybe it can be solved in some other way?

teijo avatar Sep 07 '17 20:09 teijo

I am making a website to host StarCraft Remastered tournaments =] I'm hoping I can find a way to modify the brackets so I can have "best of 3" or "best of 5" matches (so basically the first person to reach a certain amount of points advances to the next round).

Garet1337 avatar Sep 08 '17 04:09 Garet1337

So what you're looking for is to show results of BO3/BO5 during the matchup, instead of just showing the final result?

One trap that came in my mind is that often the best-of tournaments use e.g. BO3 until the final and then the final is played BO5 or BO7. It's something to remember when working on this.

Making it might take quite a bit of tinkering if you haven't touched JavaScript before (the library is written in TypeScript to add an extra challenge too) 😬

teijo avatar Sep 09 '17 22:09 teijo

I had the same case and here is how you solve it:

First you can't just expect to pass a score of 1-0 to the plugin and have the team NOT advance. That's just not how the plugin works. What you have to do is "mock" the score behind the scenes into something the plugin can use, basically no score until the BO3 is over, and a "fake" score that makes the winner advance when the BO3 is over, for example, simply 1-0.

Now, of course you don't want to show or "0-0 or "1-0" but the actual result of the BO3, for example 2-0 or 1-2. You can just do this by iterating through the matches and via JS create some HTML element on the right spot to show the real current score.

kpagcha avatar Oct 04 '17 10:10 kpagcha