Skip to main content

TR Memescape

  • TalkRational: home of the A- community.

Topic: Zombie forum is a 404 / Current forum upgrade discussion (Read 671 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • ravenscape
  • Administrator
  • Triggered
Re: Zombie forum is a 404 / Current forum upgrade discussion
Reply #50

  • ravenscape
  • Administrator
  • Triggered
Re: Zombie forum is a 404 / Current forum upgrade discussion
Reply #51
Oi Raven. There's a setting for the embedding of twits javascript which loads the buggers before you get to them, and after testing it on local I think it's much less annoying than the default behaviour.

The "Setting Threshold" section on this page describes it: http://www.appelsiini.net/projects/lazyload

Code change for the Elk file (sauces/subs/TwitterEmbedder.integrate.php) is:

Code: (Find) [Select]
		if (self::$load_js === true)
{
loadJavascriptFile('twitter_embed.jquery.js', array('defer' => true));
addInlineJavascript('
$(document).ready(function() {
$(".twitter_embed").lazyload();
});', true);
self::$load_js = false;
}
Code: (Replace) [Select]
		if (self::$load_js === true)
{
loadJavascriptFile('twitter_embed.jquery.js', array('defer' => true));
addInlineJavascript('
$(document).ready(function() {
$(".twitter_embed").lazyload({
threshold : 800
});
});', true);
self::$load_js = false;
}
That loads up the twittery 800 px before you get to it, which is enough to have it sitting there happily by the time you want it, without making all the twits on the entire page load all at once.

It's not a perfect solution, because if you go straight to a post infested with twits it will still do the jumpy in yer face loading shiz, but it'll make a lot of them far less annoying.
 

done!

  • osmanthus
  • Administrator
  • Fingerer of piglets
Re: Zombie forum is a 404 / Current forum upgrade discussion
Reply #52
Bonzer. :parrot:
Truth is out of style