mirror of
https://github.com/moodle/moodle.git
synced 2025-03-13 20:26:32 +01:00
MDL-33041 eliminate core TinyMCE moodlemedia hack
This commit is contained in:
parent
fb7bcc1396
commit
e4ad5d8a5e
@ -11,7 +11,7 @@ if (url = tinyMCEPopup.getParam("media_external_list_url")) {
|
||||
|
||||
function init() {
|
||||
ed = tinyMCEPopup.editor;
|
||||
document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
|
||||
document.getElementById('filebrowsercontainer').innerHTML = getFileBrowserHTML('filebrowser','src','media','media');
|
||||
}
|
||||
|
||||
function insertMedia() {
|
||||
|
@ -15,6 +15,22 @@
|
||||
editor_tinymce_include('utils/validate.js');
|
||||
editor_tinymce_include('utils/form_utils.js');
|
||||
editor_tinymce_include('utils/editable_selects.js');
|
||||
|
||||
var getFileBrowserHTML = function(id, target_form_element, type, prefix) {
|
||||
var option = prefix + "_" + type + "_browser_callback", cb, html;
|
||||
|
||||
cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
|
||||
|
||||
if (!cb)
|
||||
return "";
|
||||
|
||||
html = '<a class="moodlebutton" id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;">';
|
||||
html += tinyMCEPopup.getLang('browsemedia');
|
||||
html += '</a>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
</script>
|
||||
<script type="text/javascript" src="js/media.js"></script>
|
||||
<link href="css/media.css" rel="stylesheet" type="text/css" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user