mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +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'));
|
$module = array('name'=>'core_dock', 'fullpath'=>'/blocks/dock.js', 'requires'=>array('base', 'cookie', 'dom', 'io', 'node', 'event-custom'));
|
||||||
} else if ($name === 'core_calendar') {
|
} else if ($name === 'core_calendar') {
|
||||||
$module = array('name'=>'core_calendar', 'fullpath'=>'/calendar/calendar.js', 'requires'=>array('dom', 'event', 'node', 'yui2-container','event-mouseenter'));
|
$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 {
|
} else {
|
||||||
if ($dir = get_component_directory($name, false)) {
|
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'
|
M.core_flashdetect = {};
|
||||||
function setflashversiontosession (wwwroot, sesskey) {
|
|
||||||
|
M.core_flashdetect.init = function(Y) {
|
||||||
var flashversion = swfobject.getFlashPlayerVersion();
|
var flashversion = swfobject.getFlashPlayerVersion();
|
||||||
var callback = {}; //the callback is mandatory in 2.8.0r4 because there is a bug when checking xdr attribute
|
Y.io(M.cfg.wwwroot+'/login/environment.php?sesskey='+M.cfg.sesskey+'&flashversion='+flashversion.major+'.'+flashversion.minor+'.'+flashversion.release, {method: "POST"});
|
||||||
YAHOO.util.Connect.asyncRequest('GET',wwwroot+'/login/environment.php?sesskey='+sesskey+'&flashversion='+flashversion.major+'.'+flashversion.minor+'.'+flashversion.release, callback);
|
|
||||||
}
|
}
|
@ -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.
|
// Perform a browser environment check for the flash version. Should only run once per login session.
|
||||||
if (isloggedin() && !empty($CFG->excludeoldflashclients) && empty($SESSION->flashversion)) {
|
if (isloggedin() && !empty($CFG->excludeoldflashclients) && empty($SESSION->flashversion)) {
|
||||||
$this->page->requires->yui2_lib('event');
|
$this->page->requires->js('/lib/swfobject/swfobject.js');
|
||||||
$this->page->requires->yui2_lib('connection');
|
$this->page->requires->js_init_call('M.core_flashdetect.init');
|
||||||
$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()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get any HTML from the page_requirements_manager.
|
// Get any HTML from the page_requirements_manager.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user