Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Studentquiz: TinyMCE Implementation of customized Button Set for Stud… #507

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -858,3 +858,34 @@
body.cm-type-studentquiz.path-question-type #fitem_id_status {
display: none;
}

/* Hide all the toolbars and buttons by default.
The child represents the following:
1: Edit in menubar
2: View in menubar
3: Insert in menubar
6: Table in menubar
7: Help in menubar
*/
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role="menubar"] button:nth-child(1),
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role="menubar"] button:nth-child(2),
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role="menubar"] button:nth-child(3),
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role="menubar"] button:nth-child(6),
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role="menubar"] button:nth-child(7),
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role='toolbar'],
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role='toolbar'] button {
display: none;
}

/* Show only the custom toolbar and button. */
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role='toolbar'] button[aria-label="Bold"],
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role='toolbar'] button[aria-label="Italic"],
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role='toolbar'] button[aria-label="Link"],
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role='toolbar'] button[aria-label="Unlink"],
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role='toolbar'] button[aria-label="Bullet list"],
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[role='toolbar'] button[aria-label="Numbered list"],
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[title="formatting"],
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[title="content"],
.path-mod-studentquiz .studentquiz-comment-container .tox-tinymce div[title="lists"] {
display: flex;
}
4 changes: 4 additions & 0 deletions tests/behat/comment_area_create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Feature: Create comment as an user
And I press "Check"
# Wait for comment area init.
And I wait until the page is ready
# Check the custom toolbar and menubar.
And I should see "Format"
And I should see "Tools"
And "button[aria-label='Undo']" "css_element" should not be visible
# Enter "Comment 1".
And I set the field "Add public comment" to "Comment 1"
And I press "Add comment"
Expand Down
Loading