diff --git a/routes/_actions/contentWarnings.js b/routes/_actions/contentWarnings.js
new file mode 100644
index 00000000..e84fa159
--- /dev/null
+++ b/routes/_actions/contentWarnings.js
@@ -0,0 +1,6 @@
+import { store } from '../_store/store'
+
+export function toggleContentWarningShown (realm) {
+ let shown = store.getComposeData(realm, 'contentWarningShown')
+ store.setComposeData(realm, {contentWarningShown: !shown})
+}
diff --git a/routes/_components/compose/ComposeAuthor.html b/routes/_components/compose/ComposeAuthor.html
index 253a02be..2b71c799 100644
--- a/routes/_components/compose/ComposeAuthor.html
+++ b/routes/_components/compose/ComposeAuthor.html
@@ -12,7 +12,7 @@
}
.compose-box-display-name {
color: var(--deemphasized-text-color);
- grid-area: display-name;
+ grid-area: name;
min-width: 0;
white-space: nowrap;
overflow: hidden;
diff --git a/routes/_components/compose/ComposeBox.html b/routes/_components/compose/ComposeBox.html
index 3b6825c7..18a1101b 100644
--- a/routes/_components/compose/ComposeBox.html
+++ b/routes/_components/compose/ComposeBox.html
@@ -1,8 +1,11 @@
+ {{#if contentWarningShown}}
+
+ {{/if}}
-
+
@@ -14,12 +17,13 @@
display: grid;
align-items: flex-start;
grid-template-areas:
- "avatar display-name handle handle"
- "avatar input input input"
- "avatar gauge gauge gauge"
- "avatar toolbar toolbar length"
- "avatar media media media"
- "avatar button button button";
+ "avatar name handle handle"
+ "avatar cw cw cw"
+ "avatar input input input"
+ "avatar gauge gauge gauge"
+ "avatar toolbar toolbar length"
+ "avatar media media media"
+ "avatar button button button";
grid-template-columns: min-content minmax(0, max-content) 1fr 1fr;
border-bottom: 1px solid var(--main-border);
width: 560px;
@@ -42,6 +46,7 @@
import ComposeInput from './ComposeInput.html'
import ComposeButton from './ComposeButton.html'
import ComposeMedia from './ComposeMedia.html'
+ import ComposeContentWarning from './ComposeContentWarning.html'
import { measureText } from '../../_utils/measureText'
import { CHAR_LIMIT, POST_PRIVACY_OPTIONS } from '../../_static/statuses'
import { store } from '../../_store/store'
@@ -54,7 +59,8 @@
ComposeLengthIndicator,
ComposeInput,
ComposeButton,
- ComposeMedia
+ ComposeMedia,
+ ComposeContentWarning
},
store: () => store,
computed: {
@@ -65,7 +71,9 @@
defaultPostPrivacyKey: ($currentVerifyCredentials) => $currentVerifyCredentials.source.privacy,
postPrivacyKey: (composeData, defaultPostPrivacyKey) => composeData.postPrivacy || defaultPostPrivacyKey,
textLength: (text) => measureText(text),
- textOverLimit: (textLength) => textLength > CHAR_LIMIT
+ textOverLimit: (textLength) => textLength > CHAR_LIMIT,
+ contentWarningShown: (composeData) => composeData.contentWarningShown,
+ contentWarning: (composeData) => composeData.contentWarning || ''
}
}
diff --git a/routes/_components/compose/ComposeContentWarning.html b/routes/_components/compose/ComposeContentWarning.html
new file mode 100644
index 00000000..c9642cde
--- /dev/null
+++ b/routes/_components/compose/ComposeContentWarning.html
@@ -0,0 +1,49 @@
+
+
+
\ No newline at end of file
diff --git a/routes/_components/compose/ComposeToolbar.html b/routes/_components/compose/ComposeToolbar.html
index 1e669a59..d8ef1f23 100644
--- a/routes/_components/compose/ComposeToolbar.html
+++ b/routes/_components/compose/ComposeToolbar.html
@@ -17,8 +17,11 @@
on:click="onPostPrivacyClick()"
/>
{
test('removes media', async t => {
await t.useRole(foobarRole)
await (uploadKittenImage(1)())
+ await t.expect(getNthMedia(1).getAttribute('alt')).eql('kitten1.jpg')
await (uploadKittenImage(2)())
await t.expect(getNthMedia(1).getAttribute('alt')).eql('kitten1.jpg')
.expect(getNthMedia(2).getAttribute('alt')).eql('kitten2.jpg')