modfeedback MDL-16706 Removed inline scripts in mod feedback and added feedback.js

This commit is contained in:
samhemelryk
2009-06-22 04:11:25 +00:00
parent bb8f37595a
commit 2cc0fd76e1
3 changed files with 14 additions and 16 deletions
+2 -8
View File
@@ -228,14 +228,8 @@
// print_box_end();
if ($typ!='label') {
echo <<<EOD
<script language="javascript">
var item = document.getElementById("id_itemname");
if(item){
item.focus();
}
</script>
EOD;
$PAGE->requires->js('mod/feedback/feedback.js');
$PAGE->requires->js_function_call('set_item_focus', Array('id_itemname'));
}
/// Finish the page
+11
View File
@@ -0,0 +1,11 @@
function set_item_focus(itemid) {
var item = document.getElementById(itemid);
if(item){
item.focus();
}
}
function feedbackGo2delete(form) {
form.action = moodle_cfg.wwwroot+'/mod/feedback/delete_completed.php';
form.submit();
}
+1 -8
View File
@@ -84,15 +84,8 @@
//print the list with anonymous completeds
// print_simple_box_start("center");
print_box_start('generalbox boxaligncenter boxwidthwide');
$PAGE->requires->js('mod/feedback/feedback.js');
?>
<script type="text/javascript">
function feedbackGo2delete(form)
{
form.action = "<?php echo $CFG->wwwroot;?>/mod/feedback/delete_completed.php";
form.submit();
}
</script>
<div class="mdl-align">
<form name="frm" action="<?php echo me();?>" method="post">
<table>