-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
f4005a1
commit ebe2ca7
Showing
14 changed files
with
388 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
resources/js/wysiwyg/ui/framework/blocks/external-content.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
Oops, something went wrong.