Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-csg committed Oct 9, 2024
1 parent 59c46fc commit f84857b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:

- name: Grunt
if: ${{ !cancelled() && matrix.runchecks == 'all' }}
run: moodle-plugin-ci grunt --max-lint-warnings 0
run: moodle-plugin-ci grunt --max-lint-warnings 5

- name: PHPUnit tests
if: ${{ !cancelled() }}
Expand Down
14 changes: 9 additions & 5 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

/**
* Class editor
*
Expand All @@ -36,6 +34,8 @@ class codemirror_texteditor extends texteditor {
public const FORMAT_CSS = 90;
/** @var int FORMAT_JS Format constant for JavaScript */
public const FORMAT_JS = 91;
/** @var int FORMAT_HTML Format constant for HTML */
public const FORMAT_HTML = 92;

/**
* This plugin only supports the FORMAT_CODE format.
Expand All @@ -45,6 +45,7 @@ public function get_supported_formats() {
return [
self::FORMAT_CSS => self::FORMAT_CSS,
self::FORMAT_JS => self::FORMAT_JS,
self::FORMAT_HTML => self::FORMAT_HTML,
FORMAT_HTML => FORMAT_HTML,
];
}
Expand All @@ -53,7 +54,7 @@ public function get_supported_formats() {
* This editor prefers the FORMAT_CSS format.
* @return int
*/
public function get_preferred_format(){
public function get_preferred_format() {
return FORMAT_HTML;
}

Expand All @@ -70,12 +71,15 @@ public function supported_by_browser() {
* This editor supports repositories.
* @return bool
*/
public function supports_repositories(){
public function supports_repositories() {
return true;
}

/**
*
* Load JS for the editor.
* @param string $elementid The ID of the element to attach the editor to.
* @param array|null $options Options for the editor.
* @param mixed $fpoptions Options for the filepicker.
*/
public function use_editor($elementid, ?array $options = null, $fpoptions = null) {
global $PAGE;
Expand Down

0 comments on commit f84857b

Please sign in to comment.