[gimp-web/header-image] Add pre-caching for other header images
- From: Pat David <patdavid src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp-web/header-image] Add pre-caching for other header images
- Date: Mon, 16 Jan 2017 20:05:00 +0000 (UTC)
commit e6890be7eafde7c3c60b7533e20f861580a59b4d
Author: Pat David <patdavid gmail com>
Date: Mon Jan 16 14:04:13 2017 -0600
Add pre-caching for other header images
Just looping through all the header images and loading them
into the browser cache for later (so it'll be much faster).
content/js/rotateHeaderImg.js | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/content/js/rotateHeaderImg.js b/content/js/rotateHeaderImg.js
index 8cbd14b..c8d3937 100644
--- a/content/js/rotateHeaderImg.js
+++ b/content/js/rotateHeaderImg.js
@@ -103,3 +103,13 @@ if( typeof( image.license ) !== undefined ){
break;
}
}
+
+//
+// Pre-Cache all the header images now
+// This will allow subsequent visits to the page to
+// call the browser-cached version of these
+//
+for( var i = 0; i < imglist.length; i++ ){
+ var img = new Image();
+ img.src = imglist[i].file;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]