Commit 0730102b authored by yPhil's avatar yPhil

Merge branch 'feed-item'

parents 9d8eca91 57a3852e
......@@ -23,8 +23,8 @@
"bower": "1.8.2",
"ejs": "2.5.7",
"express": "4.16.2",
"favrat": "latest",
"feedparser": "2.2.9",
"favrat": "latest",
"feedrat": "latest",
"pm2": "2.10.1"
}
......
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
PTL.dialog = {
kill:function($dialog) {
$dialog.dialog('destroy');
......
......@@ -155,7 +155,7 @@ PTL.feed = {
$feedIcon = $feed.find('.feed-toggle > i');
var l = PTL.util.getLocation(feedUrl),
feedProtocol = l.protocol + '//' || '//',
feedProtocol = l.protocol ? l.protocol + '//' : '//',
feedHost = feedProtocol + l.hostname,
subdomain = l.hostname.substr(0, l.hostname.indexOf('.'));
......@@ -318,6 +318,10 @@ PTL.feed = {
if (imageUrl) {
if (!PTL.util.isUrl(imageUrl)) {
imageUrl = feedHost + '/' + imageUrl.substring(imageUrl.indexOf("/") + 1);
}
$imageLink
.attr('href', imageUrl)
.attr('data-fancybox', 'gallery')
......
......@@ -26,8 +26,8 @@ PTL.util = {
}
},
isUrl:function(url) {
return (url.indexOf('http') === 0);
isUrl:function(u) {
return new RegExp('^(?:[a-z]+:)?//', 'i').test(u);
},
isOldPTLStruct:function(o) {
PTL.tab.empty();
......
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