From 4d39ec8b6365e47814142c2a51e038d25edd6792 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 3 Oct 2022 21:23:04 +0000 Subject: [PATCH] Issue 11880: Provide "alt" description from uploaded file --- mod/fbrowser.php | 3 ++- view/js/filebrowser.js | 2 +- view/templates/filebrowser.tpl | 2 +- view/theme/frio/js/filebrowser.js | 2 +- view/theme/frio/templates/filebrowser.tpl | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mod/fbrowser.php b/mod/fbrowser.php index 60b290850..2f1181a85 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -103,7 +103,8 @@ function fbrowser_content(App $a) return [ DI::baseUrl() . '/photos/' . $a->getLoggedInUserNickname() . '/image/' . $rr['resource-id'], $filename_e, - DI::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext + DI::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext, + $rr['desc'] ]; } $files = array_map("_map_files1", $r); diff --git a/view/js/filebrowser.js b/view/js/filebrowser.js index d35e4866f..24b4d904f 100644 --- a/view/js/filebrowser.js +++ b/view/js/filebrowser.js @@ -85,7 +85,7 @@ var FileBrowser = { var embed = ""; if (FileBrowser.type == "image") { - embed = "[url="+this.dataset.link+"][img="+this.dataset.img+"][/img][/url]"; + embed = "[url="+this.dataset.link+"][img="+this.dataset.img+"]"+this.dataset.alt+"[/img][/url]"; } if (FileBrowser.type=="file") { // attachment links are "baseurl/attach/id"; we need id diff --git a/view/templates/filebrowser.tpl b/view/templates/filebrowser.tpl index 7afcad390..8082355d1 100644 --- a/view/templates/filebrowser.tpl +++ b/view/templates/filebrowser.tpl @@ -32,7 +32,7 @@
{{foreach $files as $f}}
- +

{{$f.1}}

diff --git a/view/theme/frio/js/filebrowser.js b/view/theme/frio/js/filebrowser.js index bebb27907..359c6636e 100644 --- a/view/theme/frio/js/filebrowser.js +++ b/view/theme/frio/js/filebrowser.js @@ -116,7 +116,7 @@ var FileBrowser = { var embed = ""; if (FileBrowser.type === "image") { - embed = "[url=" + this.dataset.link + "][img=" + this.dataset.img + "][/img][/url]"; + embed = "[url=" + this.dataset.link + "][img=" + this.dataset.img + "]" + this.dataset.alt + "[/img][/url]"; } if (FileBrowser.type === "file") { // attachment links are "baseurl/attach/id"; we need id diff --git a/view/theme/frio/templates/filebrowser.tpl b/view/theme/frio/templates/filebrowser.tpl index e8c03cf38..13c479048 100644 --- a/view/theme/frio/templates/filebrowser.tpl +++ b/view/theme/frio/templates/filebrowser.tpl @@ -42,7 +42,7 @@
{{foreach $files as $f}}