mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-21400 migrated falsh detection to YUI3
This commit is contained in:
parent
0a7b1f11cf
commit
4abd5b9b2a
@ -347,6 +347,10 @@ class page_requirements_manager {
|
||||
$module = array('name'=>'core_dock', 'fullpath'=>'/blocks/dock.js', 'requires'=>array('base', 'cookie', 'dom', 'io', 'node', 'event-custom'));
|
||||
} else if ($name === 'core_calendar') {
|
||||
$module = array('name'=>'core_calendar', 'fullpath'=>'/calendar/calendar.js', 'requires'=>array('dom', 'event', 'node', 'yui2-container','event-mouseenter'));
|
||||
} else if ($name === 'core_message') {
|
||||
$module = array('name'=>'core_message', 'fullpath'=>'/message/module.js');
|
||||
} else if ($name === 'core_flashdetect') {
|
||||
$module = array('name'=>'core_flashdetect', 'fullpath'=>'/lib/flashdetect/flashdetect.js', 'requires'=>array('io'));
|
||||
}
|
||||
} else {
|
||||
if ($dir = get_component_directory($name, false)) {
|
||||
|
@ -19,12 +19,12 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
* Library for flash destection
|
||||
* Library for flash player version detection
|
||||
*/
|
||||
|
||||
//WARNING: before to use this function you need to load lib/swfobject/swfobject.js + YUI: 'yahoo-min.js', 'event-min.js', 'connection-min.js'
|
||||
function setflashversiontosession (wwwroot, sesskey) {
|
||||
M.core_flashdetect = {};
|
||||
|
||||
M.core_flashdetect.init = function(Y) {
|
||||
var flashversion = swfobject.getFlashPlayerVersion();
|
||||
var callback = {}; //the callback is mandatory in 2.8.0r4 because there is a bug when checking xdr attribute
|
||||
YAHOO.util.Connect.asyncRequest('GET',wwwroot+'/login/environment.php?sesskey='+sesskey+'&flashversion='+flashversion.major+'.'+flashversion.minor+'.'+flashversion.release, callback);
|
||||
Y.io(M.cfg.wwwroot+'/login/environment.php?sesskey='+M.cfg.sesskey+'&flashversion='+flashversion.major+'.'+flashversion.minor+'.'+flashversion.release, {method: "POST"});
|
||||
}
|
@ -343,11 +343,8 @@ class core_renderer extends renderer_base {
|
||||
|
||||
// Perform a browser environment check for the flash version. Should only run once per login session.
|
||||
if (isloggedin() && !empty($CFG->excludeoldflashclients) && empty($SESSION->flashversion)) {
|
||||
$this->page->requires->yui2_lib('event');
|
||||
$this->page->requires->yui2_lib('connection');
|
||||
$this->page->requires->js('/lib/swfobject/swfobject.js')->in_head();
|
||||
$this->page->requires->js('/lib/flashdetect/flashdetect.js')->in_head();
|
||||
$this->page->requires->js_function_call('setflashversiontosession', array($CFG->wwwroot, sesskey()));
|
||||
$this->page->requires->js('/lib/swfobject/swfobject.js');
|
||||
$this->page->requires->js_init_call('M.core_flashdetect.init');
|
||||
}
|
||||
|
||||
// Get any HTML from the page_requirements_manager.
|
||||
|
Loading…
x
Reference in New Issue
Block a user