From d9db9bae0dc5eae0ad9822fc848c2db909fcc993 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 4 Sep 2013 01:46:49 +0200 Subject: Speed: jQuery optimisation of init_posts() - jQuery updated from version 1.5.2 to 1.10.2 (checked that it is ok with jQuery Migrate Plugin) - Put hide_posts() first to avoid flashing content during load - Big speed optimisation of init_img() - Use a single on() delegated event (jQuery 1.7+) instead of all per-article click events as described on http://api.jquery.com/on/ - Moved all the per-article click events to an outside function init_stream_delegates() that is called only once even when new articles are dynamically added. Much lighter approach, and does not require unbinding events and rebinding them at each dynamic load. - Side effect: corrected the bug of favourites and read/unread that were not properly unbound during dynamic loading. - Corrected a JavaScript error for auto_load_more when #load_more is not visible and therefore does not have a position() defined. --- app/App_FrontController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/App_FrontController.php') diff --git a/app/App_FrontController.php b/app/App_FrontController.php index 2a2684412..9eb3b5e1d 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -57,8 +57,8 @@ class App_FrontController extends FrontController { if (login_is_conf ($this->conf)) { View::appendScript ('https://login.persona.org/include.js'); } - View::appendScript (Url::display ('/scripts/jquery.js')); - View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js')); + View::appendScript (Url::display ('/scripts/jquery.min.js')); + View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js')); //TODO: Load only if used View::appendScript (Url::display ('/scripts/notification.js')); } -- cgit v1.2.3