mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-02-23 20:22:11 +08:00
Lexical: Added about button/view
Some checks failed
test-php / build (8.1) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled
test-php / build (8.4) (push) Has been cancelled
analyse-php / build (push) Has been cancelled
lint-js / build (push) Has been cancelled
lint-php / build (push) Has been cancelled
test-js / build (push) Has been cancelled
test-migrations / build (8.1) (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-migrations / build (8.4) (push) Has been cancelled
Some checks failed
test-php / build (8.1) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled
test-php / build (8.4) (push) Has been cancelled
analyse-php / build (push) Has been cancelled
lint-js / build (push) Has been cancelled
lint-php / build (push) Has been cancelled
test-js / build (push) Has been cancelled
test-migrations / build (8.1) (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-migrations / build (8.4) (push) Has been cancelled
Re-used existing route and moved tinymce help to its own different route. Added test to cover. Added new external-content block to support in editor UI.
This commit is contained in:
parent
f4005a139b
commit
ebe2ca7faf
@ -163,6 +163,8 @@ return [
|
|||||||
'about' => 'About the editor',
|
'about' => 'About the editor',
|
||||||
'about_title' => 'About the WYSIWYG Editor',
|
'about_title' => 'About the WYSIWYG Editor',
|
||||||
'editor_license' => 'Editor License & Copyright',
|
'editor_license' => 'Editor License & Copyright',
|
||||||
|
'editor_lexical_license' => 'This editor is built as a fork of :lexicalLink which is distributed under the MIT license.',
|
||||||
|
'editor_lexical_license_link' => 'Full license details can be found here.',
|
||||||
'editor_tiny_license' => 'This editor is built using :tinyLink which is provided under the MIT license.',
|
'editor_tiny_license' => 'This editor is built using :tinyLink which is provided under the MIT license.',
|
||||||
'editor_tiny_license_link' => 'The copyright and license details of TinyMCE can be found here.',
|
'editor_tiny_license_link' => 'The copyright and license details of TinyMCE can be found here.',
|
||||||
'save_continue' => 'Save Page & Continue',
|
'save_continue' => 'Save Page & Continue',
|
||||||
|
Before Width: | Height: | Size: 653 B After Width: | Height: | Size: 653 B |
@ -4,7 +4,7 @@
|
|||||||
function register(editor) {
|
function register(editor) {
|
||||||
const aboutDialog = {
|
const aboutDialog = {
|
||||||
title: 'About the WYSIWYG Editor',
|
title: 'About the WYSIWYG Editor',
|
||||||
url: window.baseUrl('/help/wysiwyg'),
|
url: window.baseUrl('/help/tinymce'),
|
||||||
};
|
};
|
||||||
|
|
||||||
editor.ui.registry.addButton('about', {
|
editor.ui.registry.addButton('about', {
|
||||||
|
@ -11,8 +11,9 @@ import {
|
|||||||
} from "lexical";
|
} from "lexical";
|
||||||
import redoIcon from "@icons/editor/redo.svg";
|
import redoIcon from "@icons/editor/redo.svg";
|
||||||
import sourceIcon from "@icons/editor/source-view.svg";
|
import sourceIcon from "@icons/editor/source-view.svg";
|
||||||
import {getEditorContentAsHtml} from "../../../utils/actions";
|
|
||||||
import fullscreenIcon from "@icons/editor/fullscreen.svg";
|
import fullscreenIcon from "@icons/editor/fullscreen.svg";
|
||||||
|
import aboutIcon from "@icons/editor/about.svg";
|
||||||
|
import {getEditorContentAsHtml} from "../../../utils/actions";
|
||||||
|
|
||||||
export const undo: EditorButtonDefinition = {
|
export const undo: EditorButtonDefinition = {
|
||||||
label: 'Undo',
|
label: 'Undo',
|
||||||
@ -81,3 +82,15 @@ export const fullscreen: EditorButtonDefinition = {
|
|||||||
return context.containerDOM.classList.contains('fullscreen');
|
return context.containerDOM.classList.contains('fullscreen');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const about: EditorButtonDefinition = {
|
||||||
|
label: 'About the editor',
|
||||||
|
icon: aboutIcon,
|
||||||
|
async action(context: EditorUiContext, button: EditorButton) {
|
||||||
|
const modal = context.manager.createModal('about');
|
||||||
|
modal.show({});
|
||||||
|
},
|
||||||
|
isActive(selection, context: EditorUiContext) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
@ -1,6 +1,7 @@
|
|||||||
import {EditorFormDefinition} from "../../framework/forms";
|
import {EditorFormDefinition} from "../../framework/forms";
|
||||||
import {EditorUiContext} from "../../framework/core";
|
import {EditorUiContext, EditorUiElement} from "../../framework/core";
|
||||||
import {setEditorContentFromHtml} from "../../../utils/actions";
|
import {setEditorContentFromHtml} from "../../../utils/actions";
|
||||||
|
import {ExternalContent} from "../../framework/blocks/external-content";
|
||||||
|
|
||||||
export const source: EditorFormDefinition = {
|
export const source: EditorFormDefinition = {
|
||||||
submitText: 'Save',
|
submitText: 'Save',
|
||||||
@ -16,3 +17,17 @@ export const source: EditorFormDefinition = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const about: EditorFormDefinition = {
|
||||||
|
submitText: 'Close',
|
||||||
|
async action() {
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
build(): EditorUiElement {
|
||||||
|
return new ExternalContent('/help/wysiwyg');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
};
|
@ -1,6 +1,6 @@
|
|||||||
import {EditorFormModalDefinition} from "../framework/modals";
|
import {EditorFormModalDefinition} from "../framework/modals";
|
||||||
import {details, image, link, media} from "./forms/objects";
|
import {details, image, link, media} from "./forms/objects";
|
||||||
import {source} from "./forms/controls";
|
import {about, source} from "./forms/controls";
|
||||||
import {cellProperties, rowProperties, tableProperties} from "./forms/tables";
|
import {cellProperties, rowProperties, tableProperties} from "./forms/tables";
|
||||||
|
|
||||||
export const modals: Record<string, EditorFormModalDefinition> = {
|
export const modals: Record<string, EditorFormModalDefinition> = {
|
||||||
@ -35,5 +35,9 @@ export const modals: Record<string, EditorFormModalDefinition> = {
|
|||||||
details: {
|
details: {
|
||||||
title: 'Edit collapsible block',
|
title: 'Edit collapsible block',
|
||||||
form: details,
|
form: details,
|
||||||
|
},
|
||||||
|
about: {
|
||||||
|
title: 'About the WYSIWYG Editor',
|
||||||
|
form: about,
|
||||||
}
|
}
|
||||||
};
|
};
|
@ -1,12 +1,12 @@
|
|||||||
import {EditorButton} from "./framework/buttons";
|
import {EditorButton} from "../framework/buttons";
|
||||||
import {EditorContainerUiElement, EditorSimpleClassContainer, EditorUiContext, EditorUiElement} from "./framework/core";
|
import {EditorContainerUiElement, EditorSimpleClassContainer, EditorUiContext, EditorUiElement} from "../framework/core";
|
||||||
import {EditorFormatMenu} from "./framework/blocks/format-menu";
|
import {EditorFormatMenu} from "../framework/blocks/format-menu";
|
||||||
import {FormatPreviewButton} from "./framework/blocks/format-preview-button";
|
import {FormatPreviewButton} from "../framework/blocks/format-preview-button";
|
||||||
import {EditorDropdownButton} from "./framework/blocks/dropdown-button";
|
import {EditorDropdownButton} from "../framework/blocks/dropdown-button";
|
||||||
import {EditorColorPicker} from "./framework/blocks/color-picker";
|
import {EditorColorPicker} from "../framework/blocks/color-picker";
|
||||||
import {EditorTableCreator} from "./framework/blocks/table-creator";
|
import {EditorTableCreator} from "../framework/blocks/table-creator";
|
||||||
import {EditorColorButton} from "./framework/blocks/color-button";
|
import {EditorColorButton} from "../framework/blocks/color-button";
|
||||||
import {EditorOverflowContainer} from "./framework/blocks/overflow-container";
|
import {EditorOverflowContainer} from "../framework/blocks/overflow-container";
|
||||||
import {
|
import {
|
||||||
cellProperties, clearTableFormatting,
|
cellProperties, clearTableFormatting,
|
||||||
copyColumn,
|
copyColumn,
|
||||||
@ -29,8 +29,8 @@ import {
|
|||||||
rowProperties,
|
rowProperties,
|
||||||
splitCell,
|
splitCell,
|
||||||
table, tableProperties
|
table, tableProperties
|
||||||
} from "./defaults/buttons/tables";
|
} from "./buttons/tables";
|
||||||
import {fullscreen, redo, source, undo} from "./defaults/buttons/controls";
|
import {about, fullscreen, redo, source, undo} from "./buttons/controls";
|
||||||
import {
|
import {
|
||||||
blockquote, dangerCallout,
|
blockquote, dangerCallout,
|
||||||
h2,
|
h2,
|
||||||
@ -41,7 +41,7 @@ import {
|
|||||||
paragraph,
|
paragraph,
|
||||||
successCallout,
|
successCallout,
|
||||||
warningCallout
|
warningCallout
|
||||||
} from "./defaults/buttons/block-formats";
|
} from "./buttons/block-formats";
|
||||||
import {
|
import {
|
||||||
bold, clearFormating, code,
|
bold, clearFormating, code,
|
||||||
highlightColor,
|
highlightColor,
|
||||||
@ -50,7 +50,7 @@ import {
|
|||||||
superscript,
|
superscript,
|
||||||
textColor,
|
textColor,
|
||||||
underline
|
underline
|
||||||
} from "./defaults/buttons/inline-formats";
|
} from "./buttons/inline-formats";
|
||||||
import {
|
import {
|
||||||
alignCenter,
|
alignCenter,
|
||||||
alignJustify,
|
alignJustify,
|
||||||
@ -58,14 +58,14 @@ import {
|
|||||||
alignRight,
|
alignRight,
|
||||||
directionLTR,
|
directionLTR,
|
||||||
directionRTL
|
directionRTL
|
||||||
} from "./defaults/buttons/alignments";
|
} from "./buttons/alignments";
|
||||||
import {
|
import {
|
||||||
bulletList,
|
bulletList,
|
||||||
indentDecrease,
|
indentDecrease,
|
||||||
indentIncrease,
|
indentIncrease,
|
||||||
numberList,
|
numberList,
|
||||||
taskList
|
taskList
|
||||||
} from "./defaults/buttons/lists";
|
} from "./buttons/lists";
|
||||||
import {
|
import {
|
||||||
codeBlock,
|
codeBlock,
|
||||||
details, detailsEditLabel, detailsToggle, detailsUnwrap,
|
details, detailsEditLabel, detailsToggle, detailsUnwrap,
|
||||||
@ -75,10 +75,10 @@ import {
|
|||||||
image,
|
image,
|
||||||
link, media,
|
link, media,
|
||||||
unlink
|
unlink
|
||||||
} from "./defaults/buttons/objects";
|
} from "./buttons/objects";
|
||||||
import {el} from "../utils/dom";
|
import {el} from "../../utils/dom";
|
||||||
import {EditorButtonWithMenu} from "./framework/blocks/button-with-menu";
|
import {EditorButtonWithMenu} from "../framework/blocks/button-with-menu";
|
||||||
import {EditorSeparator} from "./framework/blocks/separator";
|
import {EditorSeparator} from "../framework/blocks/separator";
|
||||||
|
|
||||||
export function getMainEditorFullToolbar(context: EditorUiContext): EditorContainerUiElement {
|
export function getMainEditorFullToolbar(context: EditorUiContext): EditorContainerUiElement {
|
||||||
|
|
||||||
@ -201,6 +201,7 @@ export function getMainEditorFullToolbar(context: EditorUiContext): EditorContai
|
|||||||
// Meta elements
|
// Meta elements
|
||||||
new EditorOverflowContainer(3, [
|
new EditorOverflowContainer(3, [
|
||||||
new EditorButton(source),
|
new EditorButton(source),
|
||||||
|
new EditorButton(about),
|
||||||
new EditorButton(fullscreen),
|
new EditorButton(fullscreen),
|
||||||
|
|
||||||
// Test
|
// Test
|
29
resources/js/wysiwyg/ui/framework/blocks/external-content.ts
Normal file
29
resources/js/wysiwyg/ui/framework/blocks/external-content.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import {EditorUiElement} from "../core";
|
||||||
|
import {el} from "../../../utils/dom";
|
||||||
|
|
||||||
|
export class ExternalContent extends EditorUiElement {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The URL for HTML to be loaded from.
|
||||||
|
*/
|
||||||
|
protected url: string = '';
|
||||||
|
|
||||||
|
constructor(url: string) {
|
||||||
|
super();
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
buildDOM(): HTMLElement {
|
||||||
|
const wrapper = el('div', {
|
||||||
|
class: 'editor-external-content',
|
||||||
|
});
|
||||||
|
|
||||||
|
window.$http.get(this.url).then(resp => {
|
||||||
|
if (typeof resp.data === 'string') {
|
||||||
|
wrapper.innerHTML = resp.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,7 @@ import {
|
|||||||
getImageToolbarContent,
|
getImageToolbarContent,
|
||||||
getLinkToolbarContent,
|
getLinkToolbarContent,
|
||||||
getMainEditorFullToolbar, getTableToolbarContent
|
getMainEditorFullToolbar, getTableToolbarContent
|
||||||
} from "./toolbars";
|
} from "./defaults/toolbars";
|
||||||
import {EditorUIManager} from "./framework/manager";
|
import {EditorUIManager} from "./framework/manager";
|
||||||
import {EditorUiContext} from "./framework/core";
|
import {EditorUiContext} from "./framework/core";
|
||||||
import {CodeBlockDecorator} from "./decorators/code-block";
|
import {CodeBlockDecorator} from "./decorators/code-block";
|
||||||
|
@ -350,6 +350,13 @@ body.editor-is-fullscreen {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 0.2em;
|
padding: 0.2em;
|
||||||
}
|
}
|
||||||
|
.editor-external-content {
|
||||||
|
min-width: 500px;
|
||||||
|
min-height: 500px;
|
||||||
|
h4:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// In-editor elements
|
// In-editor elements
|
||||||
.editor-image-wrap {
|
.editor-image-wrap {
|
||||||
|
146
resources/views/help/tinymce.blade.php
Normal file
146
resources/views/help/tinymce.blade.php
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
@extends('layouts.plain')
|
||||||
|
@section('document-class', 'bg-white ' . (setting()->getForCurrentUser('dark-mode-enabled') ? 'dark-mode ' : ''))
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="p-m">
|
||||||
|
|
||||||
|
<h4 class="mt-s">{{ trans('editor.editor_license') }}</h4>
|
||||||
|
<p>
|
||||||
|
{!! trans('editor.editor_tiny_license', ['tinyLink' => '<a href="https://www.tiny.cloud/" target="_blank" rel="noopener noreferrer">TinyMCE</a>']) !!}
|
||||||
|
<br>
|
||||||
|
<a href="{{ url('/libs/tinymce/license.txt') }}" target="_blank">{{ trans('editor.editor_tiny_license_link') }}</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h4>{{ trans('editor.shortcuts') }}</h4>
|
||||||
|
|
||||||
|
<p>{{ trans('editor.shortcuts_intro') }}</p>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ trans('editor.shortcut') }} {{ trans('editor.windows_linux') }}</th>
|
||||||
|
<th>{{ trans('editor.shortcut') }} {{ trans('editor.mac') }}</th>
|
||||||
|
<th>{{ trans('editor.description') }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><code>Ctrl</code>+<code>S</code></td>
|
||||||
|
<td><code>Cmd</code>+<code>S</code></td>
|
||||||
|
<td>{{ trans('entities.pages_edit_save_draft') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>Ctrl</code>+<code>Enter</code></td>
|
||||||
|
<td><code>Cmd</code>+<code>Enter</code></td>
|
||||||
|
<td>{{ trans('editor.save_continue') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>Ctrl</code>+<code>B</code></td>
|
||||||
|
<td><code>Cmd</code>+<code>B</code></td>
|
||||||
|
<td>{{ trans('editor.bold') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>Ctrl</code>+<code>I</code></td>
|
||||||
|
<td><code>Cmd</code>+<code>I</code></td>
|
||||||
|
<td>{{ trans('editor.italic') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>Ctrl</code>+<code>1</code><br>
|
||||||
|
<code>Ctrl</code>+<code>2</code><br>
|
||||||
|
<code>Ctrl</code>+<code>3</code><br>
|
||||||
|
<code>Ctrl</code>+<code>4</code>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code>Cmd</code>+<code>1</code><br>
|
||||||
|
<code>Cmd</code>+<code>2</code><br>
|
||||||
|
<code>Cmd</code>+<code>3</code><br>
|
||||||
|
<code>Cmd</code>+<code>4</code>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ trans('editor.header_large') }} <br>
|
||||||
|
{{ trans('editor.header_medium') }} <br>
|
||||||
|
{{ trans('editor.header_small') }} <br>
|
||||||
|
{{ trans('editor.header_tiny') }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>Ctrl</code>+<code>5</code><br>
|
||||||
|
<code>Ctrl</code>+<code>D</code>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code>Cmd</code>+<code>5</code><br>
|
||||||
|
<code>Cmd</code>+<code>D</code>
|
||||||
|
</td>
|
||||||
|
<td>{{ trans('editor.paragraph') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>Ctrl</code>+<code>6</code><br>
|
||||||
|
<code>Ctrl</code>+<code>Q</code>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code>Cmd</code>+<code>6</code><br>
|
||||||
|
<code>Cmd</code>+<code>Q</code>
|
||||||
|
</td>
|
||||||
|
<td>{{ trans('editor.blockquote') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>Ctrl</code>+<code>7</code><br>
|
||||||
|
<code>Ctrl</code>+<code>E</code>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code>Cmd</code>+<code>7</code><br>
|
||||||
|
<code>Cmd</code>+<code>E</code>
|
||||||
|
</td>
|
||||||
|
<td>{{ trans('editor.insert_code_block') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>Ctrl</code>+<code>8</code><br>
|
||||||
|
<code>Ctrl</code>+<code>Shift</code>+<code>E</code>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code>Cmd</code>+<code>8</code><br>
|
||||||
|
<code>Cmd</code>+<code>Shift</code>+<code>E</code>
|
||||||
|
</td>
|
||||||
|
<td>{{ trans('editor.inline_code') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>Ctrl</code>+<code>9</code></td>
|
||||||
|
<td><code>Cmd</code>+<code>9</code></td>
|
||||||
|
<td>
|
||||||
|
{{ trans('editor.callouts') }} <br>
|
||||||
|
<small>{{ trans('editor.callouts_cycle') }}</small>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>Ctrl</code>+<code>O</code> <br>
|
||||||
|
<code>Ctrl</code>+<code>P</code>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code>Cmd</code>+<code>O</code> <br>
|
||||||
|
<code>Cmd</code>+<code>P</code>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ trans('editor.list_numbered') }} <br>
|
||||||
|
{{ trans('editor.list_bullet') }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>Ctrl</code>+<code>Shift</code>+<code>K</code>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code>Cmd</code>+<code>Shift</code>+<code>K</code>
|
||||||
|
</td>
|
||||||
|
<td>{{ trans('editor.link_selector') }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
@ -1,20 +1,7 @@
|
|||||||
@extends('layouts.plain')
|
<h4>{{ trans('editor.shortcuts') }}</h4>
|
||||||
@section('document-class', 'bg-white ' . (setting()->getForCurrentUser('dark-mode-enabled') ? 'dark-mode ' : ''))
|
|
||||||
|
|
||||||
@section('content')
|
<p>{{ trans('editor.shortcuts_intro') }}</p>
|
||||||
<div class="p-m">
|
<table>
|
||||||
|
|
||||||
<h4 class="mt-s">{{ trans('editor.editor_license') }}</h4>
|
|
||||||
<p>
|
|
||||||
{!! trans('editor.editor_tiny_license', ['tinyLink' => '<a href="https://www.tiny.cloud/" target="_blank" rel="noopener noreferrer">TinyMCE</a>']) !!}
|
|
||||||
<br>
|
|
||||||
<a href="{{ url('/libs/tinymce/license.txt') }}" target="_blank">{{ trans('editor.editor_tiny_license_link') }}</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h4>{{ trans('editor.shortcuts') }}</h4>
|
|
||||||
|
|
||||||
<p>{{ trans('editor.shortcuts_intro') }}</p>
|
|
||||||
<table>
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ trans('editor.shortcut') }} {{ trans('editor.windows_linux') }}</th>
|
<th>{{ trans('editor.shortcut') }} {{ trans('editor.windows_linux') }}</th>
|
||||||
@ -139,8 +126,13 @@
|
|||||||
<td>{{ trans('editor.link_selector') }}</td>
|
<td>{{ trans('editor.link_selector') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
|
<h4 class="mt-s">{{ trans('editor.editor_license') }}</h4>
|
||||||
|
<p>
|
||||||
|
{!! trans('editor.editor_lexical_license', ['lexicalLink' => '<a href="https://lexical.dev/" target="_blank" rel="noopener noreferrer">Lexical</a>']) !!}
|
||||||
|
<br>
|
||||||
|
<em class="text-muted">Copyright (c) Meta Platforms, Inc. and affiliates.</em>
|
||||||
|
<br>
|
||||||
|
<a href="{{ url('/licenses') }}" target="_blank">{{ trans('editor.editor_lexical_license_link') }}</a>
|
||||||
|
</p>
|
@ -361,6 +361,7 @@ Route::get('/password/reset/{token}', [AccessControllers\ResetPasswordController
|
|||||||
Route::post('/password/reset', [AccessControllers\ResetPasswordController::class, 'reset'])->middleware('throttle:public');
|
Route::post('/password/reset', [AccessControllers\ResetPasswordController::class, 'reset'])->middleware('throttle:public');
|
||||||
|
|
||||||
// Metadata routes
|
// Metadata routes
|
||||||
|
Route::view('/help/tinymce', 'help.tinymce');
|
||||||
Route::view('/help/wysiwyg', 'help.wysiwyg');
|
Route::view('/help/wysiwyg', 'help.wysiwyg');
|
||||||
|
|
||||||
Route::fallback([MetaController::class, 'notFound'])->name('fallback');
|
Route::fallback([MetaController::class, 'notFound'])->name('fallback');
|
||||||
|
@ -6,9 +6,9 @@ use Tests\TestCase;
|
|||||||
|
|
||||||
class HelpTest extends TestCase
|
class HelpTest extends TestCase
|
||||||
{
|
{
|
||||||
public function test_wysiwyg_help_shows_tiny_and_tiny_license_link()
|
public function test_tinymce_help_shows_tiny_and_tiny_license_link()
|
||||||
{
|
{
|
||||||
$resp = $this->get('/help/wysiwyg');
|
$resp = $this->get('/help/tinymce');
|
||||||
$resp->assertOk();
|
$resp->assertOk();
|
||||||
$this->withHtml($resp)->assertElementExists('a[href="https://www.tiny.cloud/"]');
|
$this->withHtml($resp)->assertElementExists('a[href="https://www.tiny.cloud/"]');
|
||||||
$this->withHtml($resp)->assertElementExists('a[href="' . url('/libs/tinymce/license.txt') . '"]');
|
$this->withHtml($resp)->assertElementExists('a[href="' . url('/libs/tinymce/license.txt') . '"]');
|
||||||
@ -22,4 +22,12 @@ class HelpTest extends TestCase
|
|||||||
$contents = file_get_contents($expectedPath);
|
$contents = file_get_contents($expectedPath);
|
||||||
$this->assertStringContainsString('MIT License', $contents);
|
$this->assertStringContainsString('MIT License', $contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_wysiwyg_help_shows_lexical_and_licenses_link()
|
||||||
|
{
|
||||||
|
$resp = $this->get('/help/wysiwyg');
|
||||||
|
$resp->assertOk();
|
||||||
|
$this->withHtml($resp)->assertElementExists('a[href="https://lexical.dev/"]');
|
||||||
|
$this->withHtml($resp)->assertElementExists('a[href="' . url('/licenses') . '"]');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user