MDL-20534 lti: A9. Fixing issues with the course tool popup not disappearing.

This commit is contained in:
Chris Scribner
2011-11-11 13:31:09 -05:00
parent 4febc0a013
commit 89b7bbe9ee
2 changed files with 29 additions and 20 deletions
+19 -13
View File
@@ -46,8 +46,6 @@ if (!empty($typeid)) {
}
}
echo $OUTPUT->header();
$data = data_submitted();
if (isset($data->submitbutton) && confirm_sesskey()) {
@@ -64,10 +62,12 @@ if (isset($data->submitbutton) && confirm_sesskey()) {
//Output script to update the calling window.
$script = "
<script type=\"text/javascript\">
window.opener.M.mod_lti.editor.updateToolType({$json});
window.close();
</script>
<html>
<script type=\"text/javascript\">
window.opener.M.mod_lti.editor.updateToolType({$json});
window.close();
</script>
</html>
";
echo $script;
@@ -83,10 +83,12 @@ if (isset($data->submitbutton) && confirm_sesskey()) {
//Output script to update the calling window.
$script = "
<script type=\"text/javascript\">
window.opener.M.mod_lti.editor.addToolType({$json});
window.close();
</script>
<html>
<script type=\"text/javascript\">
window.opener.M.mod_lti.editor.addToolType({$json});
window.close();
</script>
</html>
";
echo $script;
@@ -95,9 +97,11 @@ if (isset($data->submitbutton) && confirm_sesskey()) {
}
} else if (isset($data->cancel)) {
$script = "
<script type=\"text/javascript\">
window.close();
</script>
<html>
<script type=\"text/javascript\">
window.close();
</script>
</html>
";
echo $script;
@@ -110,6 +114,8 @@ if ($action == 'delete') {
die;
}
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('toolsetup', 'lti'));
if ($action == 'add') {
+10 -7
View File
@@ -107,9 +107,9 @@
}
var selectedToolType = typeSelector.get('value');
var selectedOption = typeSelector.one('option[value=' + selectedToolType + ']');
var selectedOption = typeSelector.one('option[value="' + selectedToolType + '"]');
//A specific tool type is selected (not "auto")"
//A specific tool type is selected (not "auto")
if(selectedToolType > 0){
//If the entered domain matches the domain of the tool configuration...
var domainRegex = /(?:https?:\/\/)?(?:www\.)?([^\/]+)(?:\/|$)/i;
@@ -158,7 +158,7 @@
getSelectedToolTypeOption: function(){
var typeSelector = Y.one('#id_typeid');
return typeSelector.one('option[value=' + typeSelector.get('value') + ']');
return typeSelector.one('option[value="' + typeSelector.get('value') + '"]');
},
/**
@@ -285,19 +285,21 @@
//Adding the new tool may affect which tool gets matched automatically
this.clearToolCache();
this.updateAutomaticToolMatch();
this.updateAutomaticToolMatch(Y.one('#id_toolurl'));
this.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
},
updateToolType: function(toolType){
var typeSelector = Y.one('#id_typeid');
var option = typeSelector.one('option[value=' + toolType.id + ']');
var option = typeSelector.one('option[value="' + toolType.id + '"]');
option.set('text', toolType.name)
.set('domain', toolType.tooldomain);
//Editing the tool may affect which tool gets matched automatically
this.clearToolCache();
this.updateAutomaticToolMatch();
this.updateAutomaticToolMatch(Y.one('#id_toolurl'));
this.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
},
deleteTool: function(toolTypeId){
@@ -310,7 +312,8 @@
//Editing the tool may affect which tool gets matched automatically
self.clearToolCache();
self.updateAutomaticToolMatch();
self.updateAutomaticToolMatch(Y.one('#id_toolurl'));
self.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
},
failure: function(){