mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 23:42:11 +02:00
MDL-22605 - Shift the debugger activation code, so that it gets access to the DOM.
This commit is contained in:
parent
5a884a49a8
commit
33f54da3cc
@ -1,4 +1,4 @@
|
||||
// hopefully fool ie IE proof way of getting DOM element
|
||||
<!--// hopefully fool ie IE proof way of getting DOM element
|
||||
function safeGetElement(doc, el) {
|
||||
return doc.ids ? doc.ids[el] : doc.getElementById ? doc.getElementById(el) : doc.all[el];
|
||||
}
|
||||
@ -23,21 +23,6 @@ function getElementsByClassName( strClassName, obj ) {
|
||||
}
|
||||
}
|
||||
|
||||
// Add in a JS controlled link for toggling the Debug logging
|
||||
var logButton = document.createElement('a');
|
||||
logButton.id = 'mod-scorm-log-toggle';
|
||||
logButton.name = 'logToggle';
|
||||
logButton.href = 'javascript:toggleLog();';
|
||||
if (getLoggingActive() == "A") {
|
||||
logButton.innerHTML = '<?php print_string('scormloggingon','scorm') ?>';
|
||||
} else {
|
||||
logButton.innerHTML = '<?php print_string('scormloggingoff','scorm') ?>';
|
||||
}
|
||||
var content = safeGetElement(document, 'region-main');
|
||||
content = getElementsByClassName( 'region-content', content );
|
||||
|
||||
content.appendChild(logButton);
|
||||
|
||||
// retrieve cookie data
|
||||
function getCookie (cookie_name){
|
||||
var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
|
||||
@ -67,7 +52,7 @@ function toggleLog () {
|
||||
if (getLoggingActive() == "A") {
|
||||
AppendToLog("Moodle Logging Deactivated", 0);
|
||||
setLoggingActive('N');
|
||||
logButton.innerHTML = '<?php print_string('scormloggingoff','scorm') ?>';
|
||||
logButton.innerHTML = '--><?php print_string('scormloggingoff','scorm') ?>';
|
||||
} else {
|
||||
setLoggingActive('A');
|
||||
AppendToLog("Moodle Logging Activated", 0);
|
||||
|
@ -299,7 +299,26 @@
|
||||
<![if !IE]>
|
||||
<object id="scoframe1" class="scoframe" type="text/html" data="<?php echo $fullurl; ?>"></object>
|
||||
<![endif]>
|
||||
|
||||
<?php
|
||||
if (scorm_debugging($scorm)) {
|
||||
?>
|
||||
<script>
|
||||
// Add in a JS controlled link for toggling the Debug logging
|
||||
var logButton = document.createElement('a');
|
||||
logButton.id = 'mod-scorm-log-toggle';
|
||||
logButton.name = 'logToggle';
|
||||
logButton.href = 'javascript:toggleLog();';
|
||||
if (getLoggingActive() == "A") {
|
||||
logButton.innerHTML = '<?php print_string('scormloggingon','scorm') ?>';
|
||||
} else {
|
||||
logButton.innerHTML = '<?php print_string('scormloggingoff','scorm') ?>';
|
||||
}
|
||||
var content = safeGetElement(document, 'scormpage');
|
||||
content.insertBefore(logButton, content.firstChild);
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
$PAGE->requires->js_function_call('scorm_resize');
|
||||
} else {
|
||||
// Clean the name for the window as IE is fussy
|
||||
|
Loading…
x
Reference in New Issue
Block a user