Login

russian armor

Few minor bugs in livestreams page

8 Dec 2012, 22:21 PM
#1
avatar of JAnx
Coder Red Badge

Posts: 487 | Subs: 1

1) For some odd reason going straight to the http://www.coh2.org/livestreams/list will not show javascript graphs. However, if i click on the list view tab, they will become visible.

It's probably because of

Code
$('.sparkline span').sparkline();

will not be runned

Code
$(document).ready(function() {});

event.

http://www.coh2.org/livestreams/mixed works though

Some kind of racing condition?

2) Fade effect on switching between live stream views (Mixed and Grid) makes weird flickering in the tab content. It is probably because previous contents fadeOut is ongoing while new content with fadeIn runs into it.

Both on bugs on Google Chrome 23.0.1271.95 m
10 Dec 2012, 16:08 PM
#2
avatar of hicksi
Admin Black Badge

Posts: 983 | Subs: 3

Yep noticed it too, they just work properly in Firefox.

I had quick fix with double init the sparkline functions, but forget to look for the real reason. If you go in http://www.coh2.org/livestreams/list click through the tab menu and switch back to the list view they are working. Not sure yet why they aren't initialised on first behave in others browsers than Firefox.

this works
Code
$('.sparkline span').sparkline();
$('.sparkline span').sparkline();


but not this
Code
$('.sparkline span').sparkline();



Fade effects are at the moments just the "normal" ones, I didn't spend any time on making it look better. Feel free to make them look good and post code here :)
11 Dec 2012, 19:29 PM
#3
avatar of JAnx
Coder Red Badge

Posts: 487 | Subs: 1

I think i found the cause of the issue:
Code
<span values="461,332,465,639,168,465,0,573"><span>

Looks like we are opening 2 spans :)

Should be of course:
Code
<span values="461,332,465,639,168,465,0,573"></span>


And the reason why it is probably working in Firefox is that seems like Firefox is trying to fix unclosed html tags by closing them automagically.

True, Chrome tries to also fix this automagically, only thing is that it is closing both open tags instead of trying to match.

Go figure which automagic is better :)

Fade effect on switching between live stream views (Mixed and Grid) makes weird flickering in the tab content. It is probably because previous contents fadeOut is ongoing while new content with fadeIn runs into it.

That one is easy, i would suggest using hide() instead of fadeOut(). I believe it looks as good ;)
12 Dec 2012, 15:00 PM
#4
avatar of hicksi
Admin Black Badge

Posts: 983 | Subs: 3

oh lol yea, thanks. saves me time for looking after it :thumbsup:. that would explain why firefox behaves not like that, because firefox is clever and good in things like autocorrecting wrong/missing close elements.

i think i used hide() on test purpose earlier, but changed to fadeOut because i liked it more. but i will check that out later.

12 Dec 2012, 16:30 PM
#5
avatar of JAnx
Coder Red Badge

Posts: 487 | Subs: 1

jump backJump back to quoted post12 Dec 2012, 15:00 PMhicksi
i think i used hide() on test purpose earlier, but changed to fadeOut because i liked it more. but i will check that out later.

Sure, i guess that's one of those things that need to be tested out. It's just, i stopped using fadeOut() in similar situations because i figured that user needs to see content, not my fancy fade effect :)

One method would be to call a callback function on the fadeOut() complete. Callback function could be anonymous function which will just fadeIn() releavant content.

Code
$('.somethingSomething').fadeOut(function() {
$('.newTabContent').fadeIn();
});
13 Dec 2012, 16:57 PM
#6
avatar of JAnx
Coder Red Badge

Posts: 487 | Subs: 1

For the tab issue, i made a fast, in my opinion, a bit hack-ish solution (the hack part is that 200ms delay - which is the time fadeOut('fast') lasts.

Replace this:
Code
$('#livestream_viewContainer div.toggleContent').fadeOut();
$('#livestream_viewContainer div.toggleContent:eq(' + index + ')').fadeIn();

with this:
Code
$('#livestream_viewContainer div.toggleContent').stop(true, true).fadeOut('fast');
$('#livestream_viewContainer div.toggleContent:eq(' + index + ')').stop().delay(200).fadeIn('fast');


This tab changing could be simplified imo, but i am not gonna judge here :)
13 Dec 2012, 18:58 PM
#7
avatar of hicksi
Admin Black Badge

Posts: 983 | Subs: 3

Feel free to judge, as far as I'm not doing this on professional base and even if I would do, constructive criticism is the best you can get.

replaced :)
1 user is browsing this thread: 1 guest

SHOUT IT OUT!

No ProfanityNumber of ShoutsRefresh Shout Box
Osinyagov: Suddenly, coh2 is slowly dying, but you can play it, playerbase still big enough
Last Wednesday, 17:00 PM
Osinyagov: Wow, i remember you from zansi and vali videos, good old memories
Last Wednesday, 16:58 PM
Beinhard: o7 miss this game and zansi
Last Wednesday, 14:09 PM
Lady Xenarra: @Willy Pete The lack of April Fools this year is odd lol
02 Apr 2025, 01:34 AM
Willy Pete: @Rosbone not dead yet. when that happens the font will switch to Papyrus :*(
02 Apr 2025, 00:16 AM
dasheepeh: it was an honor guys :guyokay:
01 Apr 2025, 20:34 PM
aerafield: yeah I already prepared my "Can't believe there's comic mode for the 10 daily visitors even on this April 1st" :guyokay:
01 Apr 2025, 20:29 PM
Rosbone: @dasheepeh I guess that means this site is officially dead :guyokay:
01 Apr 2025, 20:19 PM
dasheepeh: no comic sans font for april 1st this year?
01 Apr 2025, 19:56 PM
Willy Pete: @Lady Xenarra this you? https://i.imgflip.com/3e4thi.jpg
01 Apr 2025, 02:53 AM
Lady Xenarra: Does anyone else think that USF needs buffs? It feels like they’re on life support sometimes
01 Apr 2025, 02:36 AM
Willy Pete: @Rosbone Ahh I missed that memo. I still think its a bad decision though. Adds frustration for players and isnt gonna make them that much money
27 Mar 2025, 15:46 PM
Rosbone: It is also good they left it free until after the free to play weekend. Points for that.
27 Mar 2025, 09:34 AM
Rosbone: But I agree, the cost to get a full decent Coh game pushing $115 US is not the best idea. Especially when it needs so much more work for casuals.
27 Mar 2025, 09:32 AM
Rosbone: To be fair, it was a thank you to early fans right? They said it was not free for long and it would become a pay DLC at some point.
27 Mar 2025, 09:30 AM
Willy Pete: Re-releasing free DLC so they can charge new players money for it. Brilliant marketing strategy :clap:
27 Mar 2025, 04:31 AM
Soheil: Coh2 still broken server ?
25 Mar 2025, 18:27 PM
Rosbone: Congrats to Relic. Looks like Coh3 has finally usurped Coh2 s the popular Coh. You smell terrific. :snfQuinn:.
24 Mar 2025, 02:46 AM

Livestreams

unknown 2

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

167 users are online: 167 guests
0 post in the last 24h
2 posts in the last week
49 posts in the last month
Registered members: 53643
Welcome our newest member, purilegalservices
Most online: 2043 users on 29 Oct 2023, 01:04 AM