summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rwxr-xr-xprogram/include/rcube_template.php25
-rw-r--r--skins/default/templates/login.html20
3 files changed, 46 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 31063e7ce..09d715fd0 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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>