diff --git a/js/classes/images.js b/js/classes/images.js index 5632ad4..01bff36 100644 --- a/js/classes/images.js +++ b/js/classes/images.js @@ -7,75 +7,7 @@ define(['jquery', 'backbone'], function ($, Backbone) { - var Images = { - prefix: "images", - getThumb: function (id) { - var val = this._get(id); - if(val.thumb !== "") - return val.thumb; - - var response = $.ajax({ - url: myManifest.Settings.DefaultURL + "/api/photo/thumbnail/" + id + "/1", - type: 'GET', - async: false - }).responseText; - val.thumb = response; - this._set(id, val); - return val.thumb; - }, - getMedium: function (id) { - var val = this._get(id); - if(val.medium !== "") - return val.medium; - - var response = $.ajax({ - url: myManifest.Settings.DefaultURL + "/api/photo/medium/" + id + "/1", - type: 'GET', - async: false - }).responseText; - val.medium = response; - this._set(id, val); - return val.medium; - }, - getFull: function (id) { - var val = this._get(id); - if(val.full !== "") - return val.full; - - var response = $.ajax({ - url: myManifest.Settings.DefaultURL + "/api/photo/" + id + "/1", - type: 'GET', - async: false - }).responseText; - val.full = response; - this._set(id, val); - return val.full; - }, - _set:function(id, item){ - var list = JSON.parse(window.localStorage.getItem(this.prefix)); - if(list !== null) - { - list[id] = item; - window.localStorage.setItem(this.prefix, JSON.stringify(list)); - } - }, - _get:function(id){ - var ret = null; - var item = JSON.parse(window.localStorage.getItem(this.prefix)); - if(item === null){ - item = {}; - window.localStorage.setItem(this.prefix, JSON.stringify(item)); - ret = { thumb: "", medium: "", full:""}; - } - else if(item[id] === undefined){ - ret = { thumb: "", medium: "", full:""}; - } - else{ - ret = item[id]; - } - - return ret; - } + var Images = { }; return Images; diff --git a/js/modules/category/category.js b/js/modules/category/category.js index 7767cc5..4e6624e 100644 --- a/js/modules/category/category.js +++ b/js/modules/category/category.js @@ -39,7 +39,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/category/categoryViewT });*/ html = this.itemtemplate({ items: this.collection.toJSON(), - images: Images + myManifest: myManifest }); $(html).appendTo($ul).enhanceWithin(); diff --git a/js/modules/category/categoryItemTemplate.html b/js/modules/category/categoryItemTemplate.html index 2dd1295..56a58f7 100644 --- a/js/modules/category/categoryItemTemplate.html +++ b/js/modules/category/categoryItemTemplate.html @@ -6,7 +6,7 @@ <% if(item.firstImage === ""){ %> <%}else{%> - + <%}%>
<%= unescape(item.titolo) %>
<%= unescape(item.autore) %>
diff --git a/js/modules/item/item.js b/js/modules/item/item.js index a6e1191..382e178 100644 --- a/js/modules/item/item.js +++ b/js/modules/item/item.js @@ -69,8 +69,6 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate. } }); - var imgurl = Images.getThumb(48); - var images = this.galleryWall.container.find('.brick'); images.find('img').load(function() { self.galleryWall.fitWidth(); diff --git a/js/modules/item/itemViewTemplate.html b/js/modules/item/itemViewTemplate.html index b4550d4..f45e0e0 100644 --- a/js/modules/item/itemViewTemplate.html +++ b/js/modules/item/itemViewTemplate.html @@ -38,7 +38,8 @@

Foto