Carregant...
[\\s\\S]*?', 'gi');
while(html !== (html = html.replace(tagOrComment, ''))){}
return html.replace(/max ? t.substring(0,max-1)+'…' : t; }
switch(d && d.type){
case 'html': return stripHTML(d.$t);
case 'text': default: return d.$t;
}
}
var entries = [];
(function main() {
getFeed(d.url, d.maxPosts, entries.length, function(json){
var currentEntries = json.feed.entry;
if(currentEntries) {
[].push.apply(entries, currentEntries);
d.maxPosts -= currentEntries.length;
if(d.maxPosts) {
return main(); // Get more
}
}
var wrap = document.createElement('div'),
t = '';
wrap.className = d.className;
if(d.order==='alphabetical'){
var comp = d.collator && typeof Intl !== 'undefined' ? new Intl.Collator(d.collator.locales, d.collator.options) : {compare: function(a,b){ return ab ? 1 : 0; }};
entries.sort(function(a,b){return comp.compare(a.title.$t, b.title.$t);});
}
for(var i=0; i';
if(thumb){
t += img(thumb.url, d.imageHeight || thumb.height, d.imageWidth || thumb.width);
}else if(d.showRandomImage && d.defaultImages && d.defaultImages.length){
t += img(d.defaultImages[Math.random()*d.defaultImages.length|0], d.imageHeight, d.imageWidth);
}
t += ''+parse(entry.title)+'';
if(d.content) t+= ''+parse(entry.summary||entry.content,d.maxContentLength)+'';
t += '
';
}
if(d.maxHeight){ wrap.style.maxHeight = typeof d.maxHeight==='number' ? d.maxHeight+'px' : d.maxHeight; wrap.style.overflow='auto';}
wrap.innerHTML = t;
if(d.style){
var sheet = document.createElement('style'); sheet.type = 'text/css';
sheet.styleSheet ? sheet.styleSheet.cssText=d.style : sheet.innerHTML=d.style;
(document.head || document.getElementsByTagName('head')[0]).appendChild(sheet);
}
if(d.insertion==='replace') d.target.innerHTML = '';
d.target.appendChild(wrap);
});
})();
};
displayFeed({
url: "http://cat.elmondelacuina.com/",
target: document.getElementById('receptari'),
insertion: 'replace',
maxPosts: 999999,
defaultImages: [
"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUlycQ0eHtDRrZrdmKBn24lWTJ86uJ4GxWQMOKTAn2QIgUzYOrn5-jKyJmlq-UqJVIPGH-qW128nkHjy6EggXu6af2nug6qzOFiX9OHEhcMzOhPWVm8draXJU9Oz6jnmQNE8jv94_YA24/s320/fb.JPG"
],
showRandomImage: true,
imageWidth: 70,
imageHeight: 70,
maxHeight: 600,
order: 'alphabetical',
collator: {locales:'ca', options:{sensivity:'base', numeric:true, ignorePunctuation:true}},
content: false,
maxContentLength: 300,
style: '.feed-list > div{overflow:auto;} .feed-list img{vertical-align:middle; box-sizing:content-box; padding:0; margin-right:.5em} .feed-list .content{display:block;overflow: hidden;}',
className: 'feed-list',
});
//]]>
Cap comentari:
Publica un comentari a l'entrada