From 078f750c412bb9963e32ce6ba224ba6b435fe92d Mon Sep 17 00:00:00 2001
From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com>
Date: Thu, 22 Jun 2023 21:47:42 +0200
Subject: [PATCH] Added option to open links in new tab for text fields
---
.../components/pageitems/text-form.blade.php | 82 +++++++-------
resources/views/studio/page.blade.php | 102 ++++++++++--------
2 files changed, 102 insertions(+), 82 deletions(-)
diff --git a/resources/views/components/pageitems/text-form.blade.php b/resources/views/components/pageitems/text-form.blade.php
index 6aec50e..81a9216 100644
--- a/resources/views/components/pageitems/text-form.blade.php
+++ b/resources/views/components/pageitems/text-form.blade.php
@@ -5,49 +5,59 @@
@endif
diff --git a/resources/views/studio/page.blade.php b/resources/views/studio/page.blade.php
index 9dc9197..edb424f 100755
--- a/resources/views/studio/page.blade.php
+++ b/resources/views/studio/page.blade.php
@@ -266,52 +266,62 @@
@if(env('ALLOW_USER_HTML') === true)
+ ClassicEditor
+ .create(document.querySelector('.ckeditor'), {
+ toolbar: {
+ items: [
+ 'exportPDF', 'exportWord', '|',
+ 'findAndReplace', 'selectAll', '|',
+ 'heading', '|',
+ 'bold', 'italic', 'strikethrough', 'underline', 'code', 'subscript', 'superscript', 'removeFormat', '|',
+ 'bulletedList', 'numberedList', 'todoList', '|',
+ 'outdent', 'indent', '|',
+ 'undo', 'redo',
+ 'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor', 'highlight', '|',
+ 'alignment', '|',
+ 'link', 'blockQuote', '|',
+ 'specialCharacters', 'horizontalLine', '|',
+ 'textPartLanguage', '|',
+ ],
+ shouldNotGroupWhenFull: true
+ },
+ fontFamily: {
+ options: [
+ 'default',
+ 'Arial, Helvetica, sans-serif',
+ 'Courier New, Courier, monospace',
+ 'Georgia, serif',
+ 'Lucida Sans Unicode, Lucida Grande, sans-serif',
+ 'Tahoma, Geneva, sans-serif',
+ 'Times New Roman, Times, serif',
+ 'Trebuchet MS, Helvetica, sans-serif',
+ 'Verdana, Geneva, sans-serif'
+ ],
+ supportAllValues: true
+ },
+ fontSize: {
+ options: [10, 12, 14, 'default', 18, 20, 22],
+ supportAllValues: true
+ },
+ link: {
+ addTargetToExternalLinks: true, // Add this option to open external links in a new tab
+ defaultProtocol: 'http://',
+ decorators: {
+ addTargetToExternalLinks: {
+ mode: 'manual',
+ label: 'Open in new tab',
+ attributes: {
+ target: '_blank',
+ rel: 'noopener noreferrer'
+ }
+ }
+ }
+ }
+ })
+ .catch(error => {
+ console.error(error);
+ });
+
@endif