javascript-UFO MDL-19738 Stopped ufo.js being included in outputlib and included it in each place it was actually being used.

It will no only be loaded when it is being used. If something new comes along they will need to remember to require it.
At the same time cleaned up a few deprecated calls
This commit is contained in:
samhemelryk
2009-07-08 04:12:11 +00:00
parent e6f7f2b278
commit 4d49202ffc
7 changed files with 29 additions and 28 deletions
+4 -3
View File
@@ -145,7 +145,8 @@ function mediaplugin_filter_mp3_callback($link) {
$args['build'] = 40;
$args['flashvars'] = $c;
$args['quality'] = 'high';
$jsoutput = $PAGE->requires->js('filter/mediaplugin/mediaplugin.js')->asap();
$jsoutput = $PAGE->requires->js('lib/ufo.js')->asap();
$jsoutput .= $PAGE->requires->data_for_js('FO', $args)->asap();
$jsoutput .= $PAGE->requires->js_function_call('create_UFO_object', Array($id))->asap();
@@ -172,7 +173,7 @@ function mediaplugin_filter_swf_callback($link) {
$args['build'] = 40;
$args['allowscriptaccess'] = 'never';
$args['quality'] = 'high';
$jsoutput = $PAGE->requires->js('filter/mediaplugin/mediaplugin.js')->asap();
$jsoutput = $PAGE->requires->js('lib/ufo.js')->asap();
$jsoutput .= $PAGE->requires->data_for_js('FO', $args)->asap();
$jsoutput .= $PAGE->requires->js_function_call('create_UFO_object', Array($id))->asap();
@@ -201,7 +202,7 @@ function mediaplugin_filter_flv_callback($link) {
$args['allowscriptaccess'] = 'never';
$args['quality'] = 'high';
$args['allowfullscreen'] = 'true';
$jsoutput = $PAGE->requires->js('filter/mediaplugin/mediaplugin.js')->asap();
$jsoutput = $PAGE->requires->js('lib/ufo.js')->asap();
$jsoutput .= $PAGE->requires->data_for_js('FO', $args)->asap();
$jsoutput .= $PAGE->requires->js_function_call('create_UFO_object', Array($id))->asap();
-3
View File
@@ -1,3 +0,0 @@
function create_UFO_object(eid) {
UFO.create(FO, eid);
}
+4
View File
@@ -1069,3 +1069,7 @@ function cancel_scroll_to_end() {
scrolltoendtimeout = null;
}
}
function create_UFO_object(eid) {
UFO.create(FO, eid);
}
-1
View File
@@ -1569,7 +1569,6 @@ class moodle_core_renderer extends moodle_renderer_base {
$this->page->requires->js('lib/overlib/overlib.js')->in_head();
$this->page->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
$this->page->requires->js('lib/cookies.js')->in_head();
$this->page->requires->js('lib/ufo.js')->in_head();
$this->page->requires->js_function_call('setTimeout', Array('fix_column_widths()', 20));
$focus = $this->page->focuscontrol;
-4
View File
@@ -37,8 +37,4 @@ function resizeEmbeddedHtml(viewportheight) {
function file_resource_init(viewportheight) {
resizeEmbeddedHtml();
YAHOO.widget.Overlay.windowResizeEvent.subscribe(resizeEmbeddedHtml);
}
function create_UFO_object(id) {
UFO.create(FO, id);
}
+2 -2
View File
@@ -517,7 +517,7 @@ class resource_file extends resource_base {
$args['build'] = 40;
$args['flashvars'] = $c;
$args['quality'] = 'high';
echo $PAGE->requires->js('mod/resource/type/file/file.js')->asap();
echo $PAGE->requires->js('lib/ufo.js')->asap();
echo $PAGE->requires->data_for_js('FO', $args)->asap();
echo $PAGE->requires->js_function_call('create_UFO_object', Array($id))->asap();
@@ -553,7 +553,7 @@ class resource_file extends resource_base {
$args['allowscriptaccess'] = 'never';
$args['allowfullscreen'] = 'true';
$args['quality'] = 'high';
echo $PAGE->requires->js('mod/resource/type/file/file.js')->asap();
echo $PAGE->requires->js('lib/ufo.js')->asap();
echo $PAGE->requires->data_for_js('FO', $args)->asap();
echo $PAGE->requires->js_function_call('create_UFO_object', Array($id))->asap();
+19 -15
View File
@@ -1,20 +1,24 @@
<?php
require "../../../config.php";
$args['movie'] = $CFG->wwwroot.'/webservice/amf/testclient/moodleclient.swf';
$args['width'] = '100%';
$args['height'] = 500;
$args['majorversion'] = 9;
$args['build'] = 0;
$args['allowscriptaccess'] = 'never';
$args['quality'] = 'high';
$args['flashvars'] = 'amfurl='.$CFG->wwwroot.'/webservice/amf/server.php';
$args['setcontainercss'] = 'true';
$PAGE->requires->js('lib/ufo.js')->in_head();
$PAGE->requires->data_for_js('FO', $args);
$PAGE->requires->js_function_call('create_UFO_object', Array('moodletestclient'));
print_header_simple('Test Client', 'Test Client');
$url = addslashes_js("$CFG->wwwroot/webservice/amf/testclient/moodleclient.swf");
$serverurl = addslashes_js("$CFG->wwwroot/webservice/amf/server.php");
echo '<span id="moodletestclient">
echo '<div id="moodletestclient">
<p>You need to install Flash 9.0</p>
</span>';
echo <<<EOF
<script type="text/javascript">
//<![CDATA[
var FO = { movie:"$url", width:"100%", height:"500", majorversion:"9", build:"0",
allowscriptaccess:"never", quality: "high", flashvars:"amfurl=$serverurl", setcontainercss:"true"};
UFO.create(FO, "moodletestclient");
//]]>
</script>
EOF;
</div>';
print_footer();