diff options
author | alecpl <alec@alec.pl> | 2010-04-21 08:21:33 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-04-21 08:21:33 +0000 |
commit | 8e211adb01bd6145eb250edabff38db449f34d92 (patch) | |
tree | 814af34e0983e3b6b572f0bc71b333a26c54ba35 | |
parent | dd51b73a9be093a86125519562a8ee238e134aeb (diff) |
- Add images pre-loading on login page (#1451160)
-rw-r--r-- | CHANGELOG | 1 | ||||
-rwxr-xr-x | program/include/rcube_template.php | 25 | ||||
-rw-r--r-- | skins/default/templates/login.html | 20 |
3 files changed, 46 insertions, 0 deletions
@@ -1,6 +1,7 @@ CHANGELOG RoundCube Webmail =========================== +- Add images pre-loading on login page (#1451160) - Add HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR to successful logins log (#1486441) - Fix setting spellcheck languages with extended codes (#1486605) - Fix messages list scrolling in FF3.6 (#1486472) diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index ad498c9c5..c62238057 100755 --- a/program/include/rcube_template.php +++ b/program/include/rcube_template.php @@ -80,6 +80,7 @@ class rcube_template extends rcube_html_page // register common UI objects $this->add_handlers(array( 'loginform' => array($this, 'login_form'), + 'preloader' => array($this, 'preloader'), 'username' => array($this, 'current_username'), 'message' => array($this, 'message_container'), 'charsetselector' => array($this, 'charset_selector'), @@ -1073,6 +1074,30 @@ class rcube_template extends rcube_html_page /** + * GUI object 'preloader' + * Loads javascript code for images preloading + * + * @param array Named parameters + * @return void + */ + private function preloader($attrib) + { + $images = preg_split('/[\s\t\n,]+/', $attrib['images'], -1, PREG_SPLIT_NO_EMPTY); + $images = array_map(array($this, 'abs_url'), $images); + + if (empty($images) || $this->app->task == 'logout') + return; + + $this->add_script('$(document).ready(function(){ + var images = ' . json_serialize($images) .'; + for (var i=0; i<images.length; i++) { + img = new Image(); + img.src = images[i]; + }});', 'foot'); + } + + + /** * GUI object 'searchform' * Returns code for search function * diff --git a/skins/default/templates/login.html b/skins/default/templates/login.html index a61e70c0b..8300a23bc 100644 --- a/skins/default/templates/login.html +++ b/skins/default/templates/login.html @@ -24,5 +24,25 @@ </div> </div> +<roundcube:object name="preloader" images=" + /images/icons/folders.png + /images/mail_footer.png + /images/taskicons.gif + /images/display/loading.gif + /images/pagenav.gif + /images/mail_toolbar.png + /images/searchfield.gif + /images/icons/glass_roll.png + /images/icons/reset.gif + /images/icons/attachment.png + /images/icons/dot.png + /images/icons/unread.png + + /images/abook_toolbar.png + /images/icons/glass.png + /images/icons/groupactions.png + /images/watermark.gif +" /> + </body> </html> |