From bfeb6bc996989a69852ff6fe0814f17ee5a3affa Mon Sep 17 00:00:00 2001 From: maxgithubprofile <21055122+maxgithubprofile@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:21:20 +0300 Subject: [PATCH] feat: image gallery, longreads (#1257) * v * v * Update package.json --- css/main.css | 2 ++ css/main.less | 3 +++ js/functions.js | 2 ++ js/functionsfirst.js | 37 ++++++++++++++++++++++++++++++++++++- js/satolist.js | 30 ++++++++++++++++++++++++++++++ package.json | 4 ++-- 6 files changed, 75 insertions(+), 3 deletions(-) diff --git a/css/main.css b/css/main.css index b3db2f3475..b6a463c088 100644 --- a/css/main.css +++ b/css/main.css @@ -5784,6 +5784,7 @@ html.allcontent_application #footerWrapper { .article_body .article_image img { border-radius: 5px; display: block; + cursor: pointer; } .article_body .article_image .article_image_caption { text-align: center; @@ -5824,6 +5825,7 @@ html.allcontent_application #footerWrapper { } .article_body .article_carousel .img { background-size: contain!important; + cursor: pointer; } .article_body .article_this_embed { padding: 1.5em; diff --git a/css/main.less b/css/main.less index f77d2494e0..4ab141ce2d 100644 --- a/css/main.less +++ b/css/main.less @@ -7055,6 +7055,7 @@ html.allcontent_application{ } .article_image{ + margin-bottom: @rhythm; &.withBorder{ @@ -7085,6 +7086,7 @@ html.allcontent_application{ img{ border-radius: 5px; display: block; + cursor: pointer; } .article_image_caption{ @@ -7134,6 +7136,7 @@ html.allcontent_application{ .img{ background-size: contain!important; + cursor: pointer; } } diff --git a/js/functions.js b/js/functions.js index 35b4418c1c..8c1f7ed910 100644 --- a/js/functions.js +++ b/js/functions.js @@ -10285,6 +10285,8 @@ var connectionSpeed = function() }; replaceArchiveInImage = function(src) { + if(!src) return '' + var srcNew = src; window.project_config.archivedPeertubeServers.map(server => { diff --git a/js/functionsfirst.js b/js/functionsfirst.js index 46754da56b..975ec275ec 100644 --- a/js/functionsfirst.js +++ b/js/functionsfirst.js @@ -174,6 +174,26 @@ edjsHTMLCnt = function (a, app) { return ftext } + var im = { + image: function (e) { + + var t = e.data + + var src = checkIfAllowedImageApply(trydecode(_.escape(replaceArchiveInImage(t.file && t.file.url ? t.file.url : t.file)))) + + if(src) return [src] + + return [] + + }, + + carousel : function(e){ + return _.map(e.data, function (i) { + return _.escape(trydecode(i.url)) + }) + } + } + var e = { delimiter: function () { return '