Commit ab6216b8 by yPhil

Merge branch 'bugs'

parents 4f66ae05 d847e29a
Pipeline #45180 passed with stage
in 44 seconds
......@@ -23,9 +23,9 @@
"bower": "1.8.2",
"ejs": "2.5.7",
"express": "4.16.2",
"favrat": "latest",
"feedparser": "2.2.9",
"feedrat": "0.1.48",
"favrat": "latest",
"feedrat": "latest",
"pm2": "2.10.2"
}
}
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
PTL.dialog = {
kill:function($dialog) {
$dialog.dialog('destroy');
......@@ -53,7 +52,7 @@ PTL.dialog = {
$dialog.dialog('open');
});
},
feedPrefs:function($button, isNewFeed, isQueryString) {
feedPrefs:function($button, isNewFeed) {
$('#dialogs').load('/static/templates/dialogs.html #feedPrefs', function() {
......
......@@ -248,7 +248,12 @@ PTL.feed = {
if (index == parseInt(feedLimit)) return false;
var $description = $.parseHTML(item.description),
imageUrl;
imageUrl,
imgTypes = ['image',
'image/jpg',
'image/jpeg',
'image/gif',
'image/png'];
var $imageLink = $('<a>').attr('target', '_blank'),
$itemLink = $('<a>').attr('target', '_blank'),
......@@ -273,22 +278,37 @@ PTL.feed = {
var $tempDom = $('<null>').append($description);
if (typeof $tempDom.find('span a').attr('href') !== 'undefined') {
console.log('item: (%s)', JSON.stringify(item));
if (item.image && typeof item.image.url !== 'undefined') {
// console.log('#### item.image: (%s)', feedHost);
imageUrl = item.image.url;
}
if (!imageUrl && typeof $tempDom.find('span a').attr('href') !== 'undefined') {
if (PTL.util.isImage($tempDom.find('span a').attr('href'))) {
imageUrl = $tempDom.find('span a').attr('href');
// console.log('#### $tempDom A: (%s)', feedHost);
}
}
if (!imageUrl && typeof $tempDom.find('img').attr('src') !== 'undefined') {
imageUrl = $tempDom.find('img').attr('src');
// console.log('#### $tempDom IMG: (%s)', feedHost);
}
// if (typeof item.image.url !== 'undefined') {
// console.log('whoa!: (%s)');
// }
if (typeof item.enclosures[0] !== 'undefined' && item.enclosures[0].url) {
// console.log('item.enclosures[0].type: (%s)', item.enclosures[0].type);
if (!imageUrl && imgTypes.indexOf(item.enclosures[0].type) > -1) {
imageUrl = item.enclosures[0].url;
// console.log('#### YESS: (%s)', feedHost);
}
// console.log('enclosures: (%s)', item.enclosures[0].url.match(/\.(jpg|png|jpeg|gif)$/));
// if (item.enclosures.url.match(/\.(jpg|png|jpeg|gif)$/)) {
......@@ -296,9 +316,12 @@ PTL.feed = {
// }
if (item.enclosures[0].url.match(/\.(jpg|png|jpeg|gif)$/)) {
imageUrl = item.enclosures[0].url;
}
// console.log('item.enclosures: %s (%s): %s', JSON.stringify(item.enclosures[0].type), feedUrl, item.enclosures[0].url.match(/\.(jpg|png|jpeg|gif)$/));
// if (item.enclosures[0].url.match(/\.(jpg|png|jpeg|gif)$/)) {
// imageUrl = item.enclosures[0].url;
// }
if (item.enclosures[0].url.match(/\.(ogg|mp3)$/)) {
$soundLink
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment