Skip to content

Commit

Permalink
TinyMCE: Add a tooltip next to the content and comment fields in blog…
Browse files Browse the repository at this point in the history
… #857668
  • Loading branch information
tai.letan authored and sammarshallou committed Feb 10, 2025
1 parent e2438b6 commit 80a3ed6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions comment_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public function definition() {
$mform->addElement($messagetype, 'messagecomment', get_string('comment', 'oublog'),
array('cols' => 50, 'rows' => 30),
array('maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes' => $maxbytes));
if (editors_get_preferred_editor() instanceof \editor_tiny\editor) {
$mform->addHelpButton('messagecomment', 'messageshortcuts', 'oublog');
}
$mform->setType('messagecomment', PARAM_CLEANHTML);
$mform->addRule('messagecomment', null, 'required', null, 'server');

Expand Down
5 changes: 5 additions & 0 deletions lang/en/oublog.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
$string['removeblogs'] = 'Remove all blog entries';
$string['title'] = 'Title';
$string['message'] = 'Message';
$string['messageshortcuts'] = 'Keyboard shortcuts';
$string['messageshortcuts_help'] = '
Access buttons in the menu bar using Alt + F9 (Windows) or ⌥ + F9 (Mac). <br />
Access the toolbar using Alt + F10 (Windows) or ⌥ + F10 (Mac) including the help menu which contains a full list of keyboard shortcuts.
';
$string['tags'] = 'Tags';
$string['tagsfield'] = 'Tags (separated by commas)';
$string['allowcomments'] = 'Allow comments';
Expand Down
3 changes: 3 additions & 0 deletions post_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public function definition() {
$mform->addElement('editor', 'message', get_string('message', 'oublog'),
array('cols' => 50, 'rows' => 30),
array('maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes' => $maxbytes));
if (editors_get_preferred_editor() instanceof \editor_tiny\editor) {
$mform->addHelpButton('message', 'messageshortcuts', 'oublog');
}
$mform->addRule('message', null, 'required', null, 'client');

if ($this->restricttags) {
Expand Down
7 changes: 7 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -789,3 +789,10 @@ oublog-filter-tagcount {
.gecko #oublog-tags {
display: block;
}
@media only screen and (max-width: 767px),
(max-width: 1024px) and (orientation: landscape) and (pointer: coarse) {
#page-mod-oublog-editpost div[id^=fitem_id_message] .btn.btn-link[data-content*="help-popover-container"],
#page-mod-oublog-editcomment div[id^=fitem_id_messagecomment] .btn.btn-link[data-content*="help-popover-container"] {
display: none;
}
}

0 comments on commit 80a3ed6

Please sign in to comment.