From d8c7346492d6701fe18135fc31cb6d93b9abb628 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 4 Dec 2018 19:49:15 -0700 Subject: [PATCH 1/2] Add missing CW to PostComponent --- public/js/components.js | Bin 557836 -> 558807 bytes public/mix-manifest.json | Bin 321 -> 321 bytes .../assets/js/components/PostComponent.vue | 47 +++++++++++++++--- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/public/js/components.js b/public/js/components.js index 02c71c18d7aca78a7753a9f330ee1082b691571f..3998e2e55d80aae2e8c0734446144dcb58b45fb0 100644 GIT binary patch delta 1429 zcmeHHL2DC16sGBJ3Q|M`E$u)czt=8Jo*0u^Yon)r%G?U$Bcbhbp z5<#&CwWupB6hyr0MF}*&z=KD);eGqQH#_f}@7=it z-rfbz2hT{Ct_=hC#W(4&^Kxdq0d%LkhC$SQ@+LU$K7J;DF5K(?-YlJ(8X!*OX1Fkj z*Xx{Vsx`K&;22?<;{f(BXFA!s+wAoqmYyp^v#RMBWM7@>tP&;9!q_mVMpP4`&fZ=v zY*Ec(Hp@`BoWZ7|dyt_sPR+PYm+TW;!zhSNDjmwjv3_qGV1!Uj8KQ(?fN=R(LT${r zC5{ebLSh_SmI^k(5YB5XjcrN*L{>T7T1=<0nG@-VmjPodGo1)U6izWwW_8UDWhtAR zw?he?ixOe)2UQ)SWG!ZOKKEE2VZvhoHOW~rrP#V+&Ffhx8fW=!;V20a_9F{1h-^Q? zaD{ShArIQd4KO5LK5K<-N}SRHd9=(WRZVK{JeP+f+eP+|Sgx1rQL; z@KLVo#wPM#MPJ1$|5(Kyjb@b*o-(T$&E?J0TwV2g*8LIeYn?}d|<}9HYL@7UtBQaGf?nrIgrSN)Tai{Yj z*X)etu8V#DjZ&^y%GE90uAkzTXPp+QTg*P!kOK$Zz7O&NS6i1G_jDzWbRJD~B>-Zm zHG-B`pnE|MJe0xtj_jiQ<(<^x_I(Oob>gvx;*O@kNSpg!4jhuaug=Mtz0x^Rz1R^9 uT;3&(jxt*e&B*FnG$2;JSdv(BaV;90ds=^X@^pFbu5Ofq#f?(K#G@Y{3*HX^ delta 513 zcmccKtJKq`w87hT^KDlLX%ZLFq~TU4AKCwkjG*HYu59c1oJod6N^96;(6ALYcYgAfZgX#FCOC4W;6uWF?){XoFb2 z(xMzqoy^Irk`?6g^b!jSQu9(YGBtHdVC+22TAi}Yl+^s`7ps^=Es%}ZOH4^|&PgmT z)=&Z(U6xp+0I>_K9BLa(#dJn#W^pH=O;86U=jW9a<>wSD=>YY@MRW4=3s6O{IaCRU zLv`{}%M}80DvLBSH#??(V-+fbc_LpYO(#(&SyN|oQ(h_GWair5<~g<7=hQORbWdNv z$uyD0J3G;T^22_qX>A-_({=TjxL5)Ua|$P4Ob}%$buDq6zOR)-WqXAllc@kiVxvI$ zG(IMl?VGrmf|c9X+A#q!GZ3=?G3)lVc5Jg(F$491jD*D9K~5(1=?R=n+7g!LhN;Fz islf2h)KN6hsjdYEaH)H^3pje)8(y+)Z+OWbJ{JHSMyeJ7 diff --git a/public/mix-manifest.json b/public/mix-manifest.json index aef4edbb9d49a91a532d43e145989be1bed1d6b0..6eaeb181a9d68878143bef8a24e54087f6731ada 100644 GIT binary patch delta 30 lcmX@ebdYI+p-7UsrBPang^`i5nQ@ARX`)Grf!RdYKLCs%31k2O delta 30 lcmX@ebdYI+p-5_~sYzmzv6+E!nu(F2ahj2dk?BO&KLCz(2~z+7 diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index 6a7548a1f..41cade86f 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -199,7 +199,7 @@ pixelfed.postComponent = {}; pixelfed.presenter = { show: { - image: function(container, media) { + image: function(container, media, status) { $('.status-container') .removeClass('orientation-unknown') .addClass('orientation-' + media[0]['orientation']); @@ -209,10 +209,21 @@ pixelfed.presenter = { el.attr('src', media[0]['url']); el.attr('title', media[0]['description']); wrapper.append(el); - container.append(wrapper); + if(status.sensitive == true) { + let spoilerText = status.spoiler_text ? status.spoiler_text : 'CW / NSFW / Hidden Media'; + let cw = $('
').addClass('details-animated'); + let summary = $(''); + let text = $('

').addClass('mb-0 lead font-weight-bold').text(spoilerText); + let direction = $('

').addClass('font-weight-light').text('(click to show)'); + summary.append(text, direction); + cw.append(summary, wrapper); + container.append(cw); + } else { + container.append(wrapper); + } }, - video: function(container, media) { + video: function(container, media, status) { let wrapper = $('

'); wrapper.addClass(''); let el = $('