From 0be86304d24a5f11a64e9120c8ae1ce9121e64e8 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 6 Oct 2019 23:28:30 +0300 Subject: Fix tests, more replacing with mergedConfig --- src/components/style_switcher/style_switcher.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/components/style_switcher') diff --git a/src/components/style_switcher/style_switcher.js b/src/components/style_switcher/style_switcher.js index 8c3d4861..c19aaaec 100644 --- a/src/components/style_switcher/style_switcher.js +++ b/src/components/style_switcher/style_switcher.js @@ -27,7 +27,7 @@ export default { data () { return { availableStyles: [], - selected: this.$store.state.config.theme, + selected: this.$store.getters.mergedConfig.theme, previewShadows: {}, previewColors: {}, @@ -111,7 +111,7 @@ export default { }) }, mounted () { - this.normalizeLocalState(this.$store.state.config.customTheme) + this.normalizeLocalState(this.$store.getters.mergedConfig.customTheme) if (typeof this.shadowSelected === 'undefined') { this.shadowSelected = this.shadowsAvailable[0] } @@ -365,9 +365,9 @@ export default { return version >= 1 || version <= 2 }, clearAll () { - const state = this.$store.state.config.customTheme + const state = this.$store.getters.mergedConfig.customTheme const version = state.colors ? 2 : 'l1' - this.normalizeLocalState(this.$store.state.config.customTheme, version) + this.normalizeLocalState(this.$store.getters.mergedConfig.customTheme, version) }, // Clears all the extra stuff when loading V1 theme -- cgit v1.2.3-70-g09d2 From e7532464e386b908321c8c202249c3855e83d722 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 7 Oct 2019 20:43:23 +0300 Subject: Replaced most trivial checkboxes with Checkbox component --- src/components/checkbox/checkbox.vue | 8 +- src/components/emoji_picker/emoji_picker.js | 4 +- src/components/emoji_picker/emoji_picker.scss | 4 - src/components/emoji_picker/emoji_picker.vue | 20 +- .../post_status_form/post_status_form.js | 4 +- .../post_status_form/post_status_form.vue | 9 +- src/components/settings/settings.js | 4 +- src/components/settings/settings.vue | 266 +++++++-------------- src/components/style_switcher/style_switcher.js | 4 +- src/components/style_switcher/style_switcher.vue | 45 ++-- 10 files changed, 122 insertions(+), 246 deletions(-) (limited to 'src/components/style_switcher') diff --git a/src/components/checkbox/checkbox.vue b/src/components/checkbox/checkbox.vue index 441f815c..6e164c1b 100644 --- a/src/components/checkbox/checkbox.vue +++ b/src/components/checkbox/checkbox.vue @@ -40,12 +40,16 @@ export default { .checkbox { position: relative; display: inline-block; - padding-left: 1.2em; min-height: 1.2em; + &-indicator { + position: relative; + padding-left: 1.2em; + } + &-indicator::before { position: absolute; - left: 0; + right: 0; top: 0; display: block; content: '✔'; diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index 824412dd..f300a6b8 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -1,3 +1,4 @@ +import Checkbox from '../checkbox/checkbox.vue' const filterByKeyword = (list, keyword = '') => { return list.filter(x => x.displayText.includes(keyword)) @@ -22,7 +23,8 @@ const EmojiPicker = { } }, components: { - StickerPicker: () => import('../sticker_picker/sticker_picker.vue') + StickerPicker: () => import('../sticker_picker/sticker_picker.vue'), + Checkbox }, methods: { onEmoji (emoji) { diff --git a/src/components/emoji_picker/emoji_picker.scss b/src/components/emoji_picker/emoji_picker.scss index b0ed00e9..d99539b0 100644 --- a/src/components/emoji_picker/emoji_picker.scss +++ b/src/components/emoji_picker/emoji_picker.scss @@ -14,10 +14,6 @@ padding: 7px; line-height: normal; } - .keep-open-label { - padding: 0 7px; - display: flex; - } .heading { display: flex; diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue index 42f20130..b974fce9 100644 --- a/src/components/emoji_picker/emoji_picker.vue +++ b/src/components/emoji_picker/emoji_picker.vue @@ -75,22 +75,10 @@ -
- - +
+ + {{ $t('emoji.keep_open') }} +
{ let allAttentions = [...attentions] @@ -36,7 +37,8 @@ const PostStatusForm = { MediaUpload, EmojiInput, PollForm, - ScopeSelector + ScopeSelector, + Checkbox }, mounted () { this.resize(this.$refs.textarea) diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 4916d988..237ed725 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -261,12 +261,9 @@ v-if="newStatus.files.length > 0" class="upload_settings" > - - + + {{ $t('post_status.attachments_sensitive') }} +
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 98ceb164..c49083f9 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -6,6 +6,7 @@ import StyleSwitcher from '../style_switcher/style_switcher.vue' import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue' import { extractCommit } from '../../services/version/version.service' import { instanceDefaultProperties, defaultState as configDefaultState } from '../../modules/config.js' +import Checkbox from '../checkbox/checkbox.vue' const pleromaFeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma-fe/commit/' const pleromaBeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma/commit/' @@ -35,7 +36,8 @@ const settings = { components: { TabSwitcher, StyleSwitcher, - InterfaceLanguageSwitcher + InterfaceLanguageSwitcher, + Checkbox }, computed: { user () { diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index e1a06fe2..a83489d2 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -36,12 +36,9 @@
  • - - + + {{ $t('settings.hide_isp') }} +
  • @@ -49,58 +46,42 @@

    {{ $t('nav.timeline') }}

    • - - + + {{ $t('settings.hide_muted_posts') }} {{ $t('settings.instance_default', { value: hideMutedPostsLocalizedValue }) }} +
    • - - + + {{ $t('settings.collapse_subject') }} {{ $t('settings.instance_default', { value: collapseMessageWithSubjectLocalizedValue }) }} +
    • - - + + {{ $t('settings.streaming') }} +
      • - - + {{ $t('settings.pause_on_unfocused') }} +
    • - - + + {{ $t('settings.autoload') }} +
    • - - + + {{ $t('settings.reply_link_preview') }} +
    @@ -109,24 +90,14 @@

    {{ $t('settings.composing') }}

    • - - +
    • - - +
    • @@ -181,30 +152,19 @@
    • - - +
    • - - + + {{ $t('settings.autohide_floating_post_button') }} +
    • - - + + {{ $t('settings.pad_emoji') }} +
    @@ -213,23 +173,19 @@

    {{ $t('settings.attachments') }}

    • - - + + {{ $t('settings.hide_attachments_in_tl') }} +
    • - - + + {{ $t('settings.hide_attachments_in_convo') }} +
    • - +
    • - - + + {{ $t('settings.nsfw_clickthrough') }} +
      • - - + {{ $t('settings.preload_images') }} +
      • - - + {{ $t('settings.use_one_click_nsfw') }} +
    • - - + + {{ $t('settings.stop_gifs') }} +
    • - - + + {{ $t('settings.loop_video') }} +
      • - - + {{ $t('settings.loop_video_silent_only') }} +
      • - - + + {{ $t('settings.play_videos_in_modal') }} +
      • - - + + {{ $t('settings.use_contain_fit') }} +
      @@ -326,14 +264,9 @@

      {{ $t('settings.notifications') }}

      • - - +
      @@ -351,44 +284,24 @@ {{ $t('settings.notification_visibility') }}
      • - - +
      • - - +
      • - - +
      • - - +
      @@ -413,24 +326,14 @@
      - - +
      - - +
      @@ -442,14 +345,9 @@ />
      - - +
      diff --git a/src/components/style_switcher/style_switcher.js b/src/components/style_switcher/style_switcher.js index c19aaaec..6e2a1d7b 100644 --- a/src/components/style_switcher/style_switcher.js +++ b/src/components/style_switcher/style_switcher.js @@ -10,6 +10,7 @@ import ContrastRatio from '../contrast_ratio/contrast_ratio.vue' import TabSwitcher from '../tab_switcher/tab_switcher.js' import Preview from './preview.vue' import ExportImport from '../export_import/export_import.vue' +import Checkbox from '../checkbox/checkbox.vue' // List of color values used in v1 const v1OnlyNames = [ @@ -338,7 +339,8 @@ export default { FontControl, TabSwitcher, Preview, - ExportImport + ExportImport, + Checkbox }, methods: { setCustomTheme () { diff --git a/src/components/style_switcher/style_switcher.vue b/src/components/style_switcher/style_switcher.vue index d24394a4..944debab 100644 --- a/src/components/style_switcher/style_switcher.vue +++ b/src/components/style_switcher/style_switcher.vue @@ -42,44 +42,29 @@
      - - + + {{ $t('settings.style.switcher.keep_color') }} + - - + + {{ $t('settings.style.switcher.keep_shadows') }} + - - + + {{ $t('settings.style.switcher.keep_opacity') }} + - - + + {{ $t('settings.style.switcher.keep_roundness') }} + - - + + {{ $t('settings.style.switcher.keep_fonts') }} +

      {{ $t('settings.style.switcher.save_load_hint') }}

      -- cgit v1.2.3-70-g09d2