Skip to content

Commit 060bdac

Browse files
[6.x] Remove "Allow Source Mode" option from Bard (#11424)
1 parent 4ec412f commit 060bdac

30 files changed

+3
-108
lines changed

resources/js/components/fieldtypes/bard/BardFieldtype.vue

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@
111111
</floating-menu>
112112

113113
<div class="bard-error" v-if="initError" v-html="initError"></div>
114-
<editor-content :editor="editor" v-show="!showSource" :id="fieldId" />
115-
<bard-source :html="htmlWithReplacedLinks" v-if="showSource" />
114+
<editor-content :editor="editor" :id="fieldId" />
116115
</div>
117116
<div
118117
class="bard-footer-toolbar"
@@ -164,7 +163,6 @@ import Text from '@tiptap/extension-text';
164163
import TextAlign from '@tiptap/extension-text-align';
165164
import Typography from '@tiptap/extension-typography';
166165
import Underline from '@tiptap/extension-underline';
167-
import BardSource from './Source.vue';
168166
import SetPicker from '../replicator/SetPicker.vue';
169167
import { DocumentBlock, DocumentInline } from './Document';
170168
import { Set } from './Set';
@@ -186,7 +184,6 @@ export default {
186184
187185
components: {
188186
BubbleMenu,
189-
BardSource,
190187
BardToolbarButton,
191188
SetPicker,
192189
EditorContent,
@@ -206,7 +203,6 @@ export default {
206203
editor: null,
207204
html: null,
208205
json: [],
209-
showSource: false,
210206
fullScreenMode: false,
211207
buttons: [],
212208
collapsed: this.meta.collapsed,
@@ -225,10 +221,6 @@ export default {
225221
},
226222
227223
computed: {
228-
allowSource() {
229-
return this.config.allow_source === undefined ? true : this.config.allow_source;
230-
},
231-
232224
toolbarIsFixed() {
233225
return this.config.toolbar_mode === 'fixed';
234226
},
@@ -238,11 +230,11 @@ export default {
238230
},
239231
240232
showFixedToolbar() {
241-
return this.toolbarIsFixed && (this.visibleButtons.length > 0 || this.allowSource || this.hasExtraButtons);
233+
return this.toolbarIsFixed && (this.visibleButtons.length > 0 || this.hasExtraButtons);
242234
},
243235
244236
hasExtraButtons() {
245-
return this.allowSource || this.setConfigs.length > 0 || this.config.fullscreen;
237+
return this.setConfigs.length > 0 || this.config.fullscreen;
246238
},
247239
248240
readingTime() {
@@ -302,18 +294,6 @@ export default {
302294
return this.storeState ? this.storeState.site : this.$config.get('selectedSite');
303295
},
304296
305-
htmlWithReplacedLinks() {
306-
return this.html.replaceAll(/\"statamic:\/\/(.*?)\"/g, (match, ref) => {
307-
const linkData = this.meta.linkData[ref];
308-
if (!linkData) {
309-
this.$toast.error(`${__('No link data found for')} ${ref}`);
310-
return '""';
311-
}
312-
313-
return `"${linkData.permalink}"`;
314-
});
315-
},
316-
317297
setsWithErrors() {
318298
if (!this.storeState) return [];
319299
@@ -395,12 +375,6 @@ export default {
395375
visibleWhenReadOnly: true,
396376
visible: this.config.fullscreen,
397377
},
398-
{
399-
title: __('Show HTML Source'),
400-
run: () => (this.showSource = !this.showSource),
401-
visibleWhenReadOnly: true,
402-
visible: this.allowSource,
403-
},
404378
];
405379
},
406380
},

resources/js/components/fieldtypes/bard/Source.vue

Lines changed: 0 additions & 46 deletions
This file was deleted.

resources/lang/ar/fieldtypes.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
'assets.dynamic_folder_pending_field' => 'سيكون هذا الحقل متاحًا بمجرد تعيين :field .',
2323
'assets.dynamic_folder_pending_save' => 'سيكون هذا المجال متاحًا بعد الحفظ.',
2424
'assets.title' => 'أصول',
25-
'bard.config.allow_source' => 'تمكين عرض كود HTML المصدر أثناء الكتابة.',
2625
'bard.config.always_show_set_button' => 'تمكين عرض زر "إضافة مجموعة" دائمًا.',
2726
'bard.config.buttons' => 'اختر الأزرار التي تظهر في شريط الأدوات.',
2827
'bard.config.container' => 'اختر حاوية الأصول التي تريد استخدامها لهذا الحقل.',

resources/lang/az/fieldtypes.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
'assets.dynamic_folder_pending_field' => 'Bu sahə bir dəfə əlçatan olacaq :field təyin olundu.',
2323
'assets.dynamic_folder_pending_save' => 'Bu sahə yadda saxladıqdan sonra əlçatan olacaq.',
2424
'assets.title' => 'Varlıqlar',
25-
'bard.config.allow_source' => 'Yazarkən HTML mənbə kodunu görməyə imkan ver.',
2625
'bard.config.always_show_set_button' => '“Set Ekle” düyməsini həmişə göstərmək üçün aktivləşdirin.',
2726
'bard.config.buttons' => 'Alət çubuğunda hansı düymələrin göstəriləcəyini seçin.',
2827
'bard.config.container' => 'Bu sahə üçün hansı varlıq konteynerinin istifadə olunacağını seçin.',

resources/lang/cs/fieldtypes.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
'assets.dynamic_folder_pending_field' => 'Toto pole bude dostupné, jakmile bude nastaveno :field .',
2323
'assets.dynamic_folder_pending_save' => 'Toto pole bude dostupné po uložení.',
2424
'assets.title' => 'Soubory',
25-
'bard.config.allow_source' => 'Umožňuje zobrazení zdrojového kódu HTML při zápisu.',
2625
'bard.config.always_show_set_button' => 'Umožňuje trvalé zobrazení tlačítka "Přidat sadu".',
2726
'bard.config.buttons' => 'Vyberte, která tlačítka se mají zobrazit na panelu nástrojů.',
2827
'bard.config.container' => 'Pro toto pole vyberte kontejner souboru.',

resources/lang/da/fieldtypes.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
'assets.dynamic_folder_pending_field' => 'Dette felt vil være tilgængeligt, når :field er indstillet.',
2323
'assets.dynamic_folder_pending_save' => 'Dette felt vil være tilgængeligt efter lagring.',
2424
'assets.title' => 'Assets',
25-
'bard.config.allow_source' => 'Aktiver for at få vist HTML-kildekoden under skrivning.',
2625
'bard.config.always_show_set_button' => 'Aktiver for altid at vise knappen "Tilføj sæt".',
2726
'bard.config.buttons' => 'Vælg hvilke knapper der skal vises på værktøjslinjen.',
2827
'bard.config.container' => 'Vælg hvilken aktiv-beholder, der skal bruges til dette felt.',

resources/lang/de/fieldtypes.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
'assets.dynamic_folder_pending_field' => 'Dieses Feld ist verfügbar, sobald :field festgelegt ist.',
2424
'assets.dynamic_folder_pending_save' => 'Dieses Feld ist nach dem Speichern verfügbar.',
2525
'assets.title' => 'Dateien',
26-
'bard.config.allow_source' => 'Ermöglicht beim Schreiben das Anzeigen des HTML-Quellcodes.',
2726
'bard.config.always_show_set_button' => 'Ermöglicht das ständige Anzeigen des „Set hinzufügen“-Buttons.',
2827
'bard.config.buttons' => 'Auswählen, welche Buttons in der Symbolleiste angezeigt werden sollen.',
2928
'bard.config.container' => 'Datei-Container für dieses Feld auswählen.',

resources/lang/de_CH/fieldtypes.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
'assets.dynamic_folder_pending_field' => 'Dieses Feld ist verfügbar, sobald :field festgelegt ist.',
2424
'assets.dynamic_folder_pending_save' => 'Dieses Feld ist nach dem Speichern verfügbar.',
2525
'assets.title' => 'Dateien',
26-
'bard.config.allow_source' => 'Ermöglicht beim Schreiben das Anzeigen des HTML-Quellcodes.',
2726
'bard.config.always_show_set_button' => 'Ermöglicht das ständige Anzeigen des «Set hinzufügen»-Buttons.',
2827
'bard.config.buttons' => 'Auswählen, welche Buttons in der Symbolleiste angezeigt werden sollen.',
2928
'bard.config.container' => 'Datei-Container für dieses Feld auswählen.',

resources/lang/es/fieldtypes.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
'assets.dynamic_folder_pending_field' => 'Este campo estará disponible una vez que se configure :field .',
2323
'assets.dynamic_folder_pending_save' => 'Este campo estará disponible después de guardar.',
2424
'assets.title' => 'Assets',
25-
'bard.config.allow_source' => 'Activa la opción para ver el código fuente HTML mientras escribes.',
2625
'bard.config.always_show_set_button' => 'Habilita para mostrar siempre el botón "Agregar conjunto".',
2726
'bard.config.buttons' => 'Elige qué botones mostrar en la barra de herramientas.',
2827
'bard.config.container' => 'Elige qué contenedor de medios usar para este campo.',

resources/lang/fa/fieldtypes.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
'assets.dynamic_folder_pending_field' => 'پس از تنظیم :field این فیلد در دسترس خواهد بود.',
2323
'assets.dynamic_folder_pending_save' => 'این فیلد پس از ذخیره در دسترس خواهد بود.',
2424
'assets.title' => 'فایل',
25-
'bard.config.allow_source' => 'امکان مشاهده‌ی سورس محتوا (HTML) را فعال سازید.',
2625
'bard.config.always_show_set_button' => 'همواره دکمه‌ی "افزودن مجموعه" نمایان باشد.',
2726
'bard.config.buttons' => 'مشخص کنید کدامین دکمه‌ها در نوار ابزار نمایان باشند.',
2827
'bard.config.container' => 'کانتینر فایل مورد استفاده برای این فیلد را مشخص کنید.',

0 commit comments

Comments
 (0)