From: Michael Date: Mon, 3 Oct 2022 21:23:04 +0000 (+0000) Subject: Issue 11880: Provide "alt" description from uploaded file X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4d39ec8b6365e47814142c2a51e038d25edd6792;p=friendica.git Issue 11880: Provide "alt" description from uploaded file --- diff --git a/mod/fbrowser.php b/mod/fbrowser.php index 60b290850a..2f1181a856 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 d35e4866fa..24b4d904fd 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 7afcad3903..8082355d1d 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 bebb279078..359c6636eb 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 e8c03cf386..13c4790487 100644 --- a/view/theme/frio/templates/filebrowser.tpl +++ b/view/theme/frio/templates/filebrowser.tpl @@ -42,7 +42,7 @@
{{foreach $files as $f}}