Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added functionality to start caching icons, full functinality blocks …

…on ticket #767260
  • Loading branch information...
commit 5d5af9ad6ddcddca4c2994c8417274a0c6a558af 1 parent 8a526f6
Nick Desaulniers nickdesaulniers authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 site/js/jibe.js
15 site/js/jibe.js
View
@@ -35,6 +35,20 @@ function getIconForSize(targetSize, app)
return DEFAULT_ICON;
}
+function cacheIcons () {
+ if (typeof window.applicationCache.mozAdd === 'function') {
+ Array.prototype.slice.call(document.getElementsByClassName('icon')).forEach(
+ function (icon_div) {
+ try {
+ window.applicationCache.mozAdd(icon_div.firstElementChild.src);
+ } catch (err) {
+ console.log(err);
+ }
+ }
+ );
+ }
+}
+
$(document).ready(function() {
/* IconGrid */
var appCount = 0;
@@ -64,6 +78,7 @@ $(document).ready(function() {
var pending = navigator.mozApps.mgmt.getAll();
pending.onsuccess = function () {
gotApps(this.result);
+ cacheIcons();
};
pending.onerror = function () {
$('#help').hide();
Please sign in to comment.
Something went wrong with that request. Please try again.