biganthony / Markdown as UMMoodle editor by default

// ==UserScript==
// @name         Markdown as UMMoodle editor by default
// @version      1.11
// @description  Choose markdown as default editor by default
// @author       Anthony T
// @email        stifire@163.com
// @icon         https://ummoodle.um.edu.mo/theme/image.php/boost/theme/1546050157/favicon
// @noframes
// @include        https://ummoodle.um.edu.mo/course/modedit.php*
// @include        https://ummoodle.um.edu.mo/course/editsection.php*
// @license      MIT
// @run-at      document-start
// ==/UserScript==
'use strict';



//To-do: detect default editor setting and notify if not plaintext

//Thing to do when loading is done
document.addEventListener('DOMContentLoaded', function() {
    //appear when adding a label
    document.getElementById('menuintroeditorformat').getElementsByTagName('option')[3].selected = 'selected';
    //appear when adding a page
    document.getElementById('menupageformat').getElementsByTagName('option')[3].selected = 'selected';
    //appear when adding a summary, does NOT work yet!
    document.getElementById('menusummary_editorformat').getElementsByTagName('option')[3].selected = 'selected';
}, false);