Skip to content

Commit 9889281

Browse files
enable the Title plugin in CKEditor for page contents (#467)
Co-authored-by: Copilot <[email protected]>
1 parent 51cbde3 commit 9889281

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

tools/docker-dev/sql/bootstrap.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ CREATE TABLE `pages` (
111111
--
112112

113113
INSERT INTO `pages` (`id`, `page`, `content`) VALUES
114-
(0,'home','<h3>Docmentation and FAQ</h3><p>You can find our documentation <a href=\"https://docs.unity.rc.umass.edu/\">here</a>. We also have an <a href=\"https://docs.unity.rc.umass.edu/documentation/help/faq/\">FAQ</a> page which could help answer quick questions.</p><h3>Office Hours</h3><p>We offer office hours every week on <strong>Tuesdays 2-4 PM</strong> in-person at <strong>W.E.B. DuBois Library 786</strong> or remote on <a href=\"https://github.com/\"><strong>Zoom</strong></a>. Be sure to check the <a href=\"/\">cluster notes</a> page for up-to-date information on any canceled/delayed office hours.</p><h3>Support Email</h3><p>You can create a support ticket by emailing <a href=\"mailto:[email protected]\">[email protected]</a>. We will do our best to reply as fast as possible!</p><p>&nbsp;</p>'),
115-
(1,'support','<h3>Docmentation and FAQ</h3>\r\n<p>You can find our documentation <a href=\"https://esdconfluence.it.umass.edu/confluence/display/UNITY/Unity+Cluster+Documentation+Home\" target=\"_blank\">here</a>. We also have an <a target=\"_blank\" href=\"https://esdconfluence.it.umass.edu/confluence/display/UNITY/Frequently+Asked+Questions\">FAQ</a> page which could help answer quick questions.\r\n\r\n<h3>Office Hours</h3>\r\n<p>We offer office hours every week on <strong>Tuesdays 2-4 PM</strong> in-person at <strong>W.E.B. DuBois Library 786</strong> or remote on <strong><a target=\"_blank\" href=\"https://umass-amherst.zoom.us/j/95663998309\">Zoom</a></strong>. Be sure to check the <a href=\"<?php echo $CONFIG[\"site\"][\"prefix\"]; ?>/index.php\">cluster notes</a> page for up-to-date information on any canceled/delayed office hours.</p>\r\n\r\n<h3>Support Email</h3>\r\n<p>You can create a support ticket by emailing <a target=\"_blank\" href=\"mailto:[email protected]\">[email protected]</a>. We will do our best to reply as fast as possible!</p>');
114+
(0,'home','<h1>Docmentation and FAQ</h1><p>You can find our documentation <a href=\"https://docs.unity.rc.umass.edu/\">here</a>. We also have an <a href=\"https://docs.unity.rc.umass.edu/documentation/help/faq/\">FAQ</a> page which could help answer quick questions.</p><h3>Office Hours</h3><p>We offer office hours every week on <strong>Tuesdays 2-4 PM</strong> in-person at <strong>W.E.B. DuBois Library 786</strong> or remote on <a href=\"https://github.com/\"><strong>Zoom</strong></a>. Be sure to check the <a href=\"/\">cluster notes</a> page for up-to-date information on any canceled/delayed office hours.</p><h3>Support Email</h3><p>You can create a support ticket by emailing <a href=\"mailto:[email protected]\">[email protected]</a>. We will do our best to reply as fast as possible!</p><p>&nbsp;</p>'),
115+
(1,'support','<h1>Docmentation and FAQ</h1><p>You can find our documentation <a href=\"https://esdconfluence.it.umass.edu/confluence/display/UNITY/Unity+Cluster+Documentation+Home\">here</a>. We also have an <a href=\"https://esdconfluence.it.umass.edu/confluence/display/UNITY/Frequently+Asked+Questions\">FAQ</a> page which could help answer quick questions.</p><h3>Office Hours</h3><p>We offer office hours every week on <strong>Tuesdays 2-4 PM</strong> in-person at <strong>W.E.B. DuBois Library 786</strong> or remote on <a href=\"https://umass-amherst.zoom.us/j/95663998309\"><strong>Zoom</strong></a>. Be sure to check the <a href=\"&lt;?php echo $CONFIG[\">/index.php\"&gt;cluster notes</a> page for up-to-date information on any canceled/delayed office hours.</p><h3>Support Email</h3><p>You can create a support ticket by emailing <a href=\"mailto:[email protected]\">[email protected]</a>. We will do our best to reply as fast as possible!</p>');
116+
116117
-- --------------------------------------------------------
117118

118119
--

webroot/admin/content.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747

4848
<script>
4949
const url = '<?php echo getURL("admin/ajax/get_page_contents.php"); ?>';
50-
setupCKEditor().then(mainEditor => {
50+
const {Title} = CKEDITOR;
51+
setupCKEditor(extraPlugins=[Title]).then(mainEditor => {
5152
$("#pageForm > select[name=pageSel]").change(function(e) {
5253
$.ajax({
5354
url: `${url}?pageid=` + $(this).val(),

webroot/js/global-early.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ function downloadFile(text, filename) {
1212
element.remove();
1313
}
1414

15-
function setupCKEditor() {
15+
function setupCKEditor(extraPlugins = []) {
1616
const {
1717
ClassicEditor, Essentials, Bold, Italic, Strikethrough, Underline, BlockQuote, Code, CodeBlock,
1818
Heading, HorizontalLine, Indent, Link, List, Paragraph, Undo, FontFamily, FontSize
1919
} = CKEDITOR;
20+
const plugins = [
21+
Essentials, Bold, Italic, Strikethrough, Underline, BlockQuote, Code, CodeBlock,
22+
Heading, HorizontalLine, Indent, Link, List, Paragraph, Undo, FontFamily, FontSize
23+
].concat(extraPlugins);
2024
return ClassicEditor.create(document.querySelector('#editor'), {
2125
licenseKey: 'GPL',
22-
plugins: [
23-
Essentials, Bold, Italic, Strikethrough, Underline, BlockQuote, Code, CodeBlock,
24-
Heading, HorizontalLine, Indent, Link, List, Paragraph, Undo, FontFamily, FontSize
25-
],
26+
plugins: plugins,
2627
toolbar: [
2728
'undo', 'redo',
2829
'|',

0 commit comments

Comments
 (0)