Falco
(Falco)
2022 年 2 月 18 日午後 7:30
1
[「画像をソースアドレスとして貼り付けることは可能ですか?」(Is it possible to paste images as their source address? )からの議論の続きです。]
ブラウザでインターネット上にあるGIFを右クリックして「画像をコピー」を選択すると、クリップボードには2つの要素が格納されます。
GIFの静止画PNG(image/png)
GIFのソースを含むHTML img タグ(text/html)
ほとんどの場合、クリップボードからオプション1を選択し、その画像をすぐにコンポーザーにアップロードする方がユーザーエクスペリエンスははるかに優れているため、私たちは常にそうしています。しかし、アニメーションGIFの場合は、アニメーションが完全に失われないように、ロジックを反転させて画像ソースアドレスを貼り付けることを検討するかもしれません。
Google画像検索からランダムなGIFをコピーした後のクリップボードJSイベントの内容の例:
<img src="https://c.tenor.com/tX_T48A14BwAAAAd/khaby-really.gif" alt="Khaby Really GIF - Khaby Really - Discover &amp; Share GIFs" jsaction="load:XAeZkd;" jsname="HiaYvf" class="n3VNCb" data-noaft="1" style="width: 389px; height: 389px; margin: 0px;">
BBPressのコンポーザーにはこの機能があるので、追いつく必要があります!
「いいね!」 10
Falco
(Falco)
2022 年 3 月 16 日午後 5:38
3
提案された解決策を含むプルリクエストを提出しました。
main ← paste-animated-gifs
opened 05:33PM - 16 Mar 22 UTC
If a user copies a gif from a website into their clipboard and then
tries to pa… ste it into the Discourse composer, we would only paste a
static single frame of the original gif. This happens because the
browser doesn't store the original image in the clipboard, but two
entries:
1. image/png with the frame of the copy moment
2. text/html with the markup of the gif img element
This commit adds an heuristic that detects this and makes us pick the
clipboard content of text/html instead of the image/png when this
happens.
From there our existing HTML paste logic handles and converts the HTML
img tag into markdown, preserving even the alt text.
See https://meta.discourse.org/t/-/218720 for context.
I looked into adding tests, but mocking the event and clipboardData in a faithful way was non-trivial.
「いいね!」 5
danielabc
(Daniela)
2022 年 3 月 19 日午前 10:25
5
ポルトガル語を話せてよかった、笑
ちょっと迷っていますが、PRとは何ですか? パラナ州のことですか? 笑
あなたが教えてくれたこのリンクはプラグインですか? インストールする必要がありますか?
ありがとう
「いいね!」 1
プラグインは不要で、最新バージョンにアップデートするだけで大丈夫です。
「いいね!」 1
Falco
(Falco)
2022 年 3 月 19 日午後 1:49
7
同僚が言ったように、Discourseを更新するだけです。
「いいね!」 2
ai serio que modificaram o Discourse so por causa de mim? que chique kkk
o que quer dizer PR? quer dizer uma dica para eles arrumarem algo? eu posso dar dicas tbm?
Falco
(Falco)
2022 年 3 月 21 日午後 8:37
9
danielabc:
PRとはどういう意味ですか?
「変更提案」のようなものです。ソフトウェアのコードに変更を加えて、新しい機能を追加したり、バグを修正したりする際に使用されます。
この場合、私がこの機能を作成し、それをPRとして提出しました。PRは、会社の同僚によってレビューされ、最終的にソフトウェアに組み込まれます。
danielabc
(Daniela)
2022 年 3 月 23 日午前 7:29
11
ここでテストしましたが、皆さんは素晴らしいです!この変更により、フォーラムの使いやすさが大幅に向上しました。メンバーは、フォーラム自体でアップロードされた他のメンバーのGIFさえ使用できるようになりました!センセーショナルです!(以前はうまくいかず、画像がフリーズしていました(笑))本当にありがとうございます!
「いいね!」 1