From 7a0dc34cad955fecba8072f5ed3c179ba5a3fd98 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 18 May 2019 13:03:36 -0500 Subject: reimplement monsterpit bbcode and markdown extensions on top of new glitch-soc formatting system + bbcode feature parity + new `i:am` footer + set content type from `format` bangtag --- .../glitch/features/compose/components/options.js | 30 ++++++-- app/javascript/flavours/glitch/styles/bbcode.scss | 56 +++++++++++++++ app/javascript/flavours/glitch/styles/index.scss | 2 + .../flavours/glitch/styles/monsterpit.scss | 80 ++++++++++++++++++++++ 4 files changed, 163 insertions(+), 5 deletions(-) create mode 100644 app/javascript/flavours/glitch/styles/bbcode.scss create mode 100644 app/javascript/flavours/glitch/styles/monsterpit.scss (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/compose/components/options.js b/app/javascript/flavours/glitch/features/compose/components/options.js index 0c94f5514..46b32b4a3 100644 --- a/app/javascript/flavours/glitch/features/compose/components/options.js +++ b/app/javascript/flavours/glitch/features/compose/components/options.js @@ -25,6 +25,14 @@ const messages = defineMessages({ defaultMessage: 'Attach...', id: 'compose.attach', }, + bbcode: { + defaultMessage: 'BBCode', + id: 'compose.content-type.bbcode', + }, + bbdown: { + defaultMessage: 'BBdown', + id: 'compose.content-type.bbdown', + }, change_privacy: { defaultMessage: 'Adjust status privacy', id: 'privacy.change', @@ -232,7 +240,7 @@ class ComposerOptions extends ImmutablePureComponent { const contentTypeItems = { plain: { - icon: 'align-left', + icon: 'file-text', name: 'text/plain', text: , }, @@ -242,10 +250,20 @@ class ComposerOptions extends ImmutablePureComponent { text: , }, markdown: { - icon: 'arrow-circle-down', + icon: 'hashtag', name: 'text/markdown', text: , }, + xbbcode: { + icon: 'thumb-tack', + name: 'text/x-bbcode', + text: , + }, + xbbcodemarkdown: { + icon: 'arrow-circle-down', + name: 'text/x-bbcode+markdown', + text: , + }, }; // The result. @@ -315,11 +333,13 @@ class ComposerOptions extends ImmutablePureComponent { {showContentTypeChoice && ( &__spoiler, + &__spoiler-wrapper:active > &__spoiler + { color: white; visibility: visible; } +} diff --git a/app/javascript/flavours/glitch/styles/index.scss b/app/javascript/flavours/glitch/styles/index.scss index e1c25ac0d..90152c65c 100644 --- a/app/javascript/flavours/glitch/styles/index.scss +++ b/app/javascript/flavours/glitch/styles/index.scss @@ -24,3 +24,5 @@ @import 'accessibility'; @import 'rtl'; @import 'dashboard'; +@import 'bbcode'; +@import 'monsterpit'; diff --git a/app/javascript/flavours/glitch/styles/monsterpit.scss b/app/javascript/flavours/glitch/styles/monsterpit.scss new file mode 100644 index 000000000..7dccd81a4 --- /dev/null +++ b/app/javascript/flavours/glitch/styles/monsterpit.scss @@ -0,0 +1,80 @@ +.status__content__text, +.reply-indicator__content, +.composer--reply > .content, +.account__header__content, +{ + s { text-decoration: line-through; } + del { text-decoration: line-through; } + h6 { font-size: 8px; font-weight: bold; } + hr { border-color: lighten($dark-text-color, 10%); } + sub { + vertical-align: sub; + font-size: smaller; + } + sup { + vertical-align: super; + font-size: smaller; + } + pre, code { + color: lighten($dark-text-color, 33%); + } + mark { + background-color: #ccff15; + color: black; + } + blockquote { + font-style: italic; + } + .caption { + display: block; + margin: auto; + font-size: 12px !important; + padding-top: 0; + text-align: center; + max-width: 80%; + } + .caption-hidden { + display: none; + } + p.signature { + color: lighten($dark-text-color, 20%); + font-style: italic; + font-size: 12px; + text-align: right; + } +} + +div.media-caption { + p { + font-size: 12px !important; + margin-bottom: 0; + text-align: center; + } + a { + color: $secondary-text-color; + text-decoration: none; + font-weight: bold; + + &:hover { + text-decoration: underline; + + .fa { + color: lighten($dark-text-color, 7%); + } + } + + &.mention { + &:hover { + text-decoration: none; + + span { + text-decoration: underline; + } + } + } + + .fa { + color: $dark-text-color; + } + } +} -- cgit