Merge branch 'MDL-43243-master' of git://github.com/andrewnicols/moodle

This commit is contained in:
Sam Hemelryk 2013-12-24 11:56:01 +13:00
commit 946e770ede
3 changed files with 23 additions and 12 deletions

View file

@ -1159,8 +1159,11 @@ function insertAtCursor(myField, myValue) {
Call instead of setting window.onload directly or setting body onload=.
Adds your function to a chain of functions rather than overwriting anything
that exists.
@deprecated Since Moodle 2.7. This will be removed in Moodle 2.9.
*/
function addonload(fn) {
Y.log('addonload has been deprecated since Moodle 2.7 and will be removed in Moodle 2.9',
'warn', 'javascript-static.js');
var oldhandler=window.onload;
window.onload=function() {
if(oldhandler) oldhandler();
@ -1181,8 +1184,11 @@ function addonload(fn) {
* document, use `document`.
* @param {String} strTagName filter by tag names
* @param {String} name same as HTML5 spec
* @deprecated Since Moodle 2.7. This will be removed in Moodle 2.9.
*/
function getElementsByClassName(oElm, strTagName, name) {
Y.log('getElementsByClassName has been deprecated since Moodle 2.7 and will be removed in Moodle 2.9',
'warn', 'javascript-static.js');
// for backwards compatibility
if(typeof name == "object") {
var names = new Array();
@ -1354,19 +1360,24 @@ function close_window(e) {
/**
* Used in a couple of modules to hide navigation areas when using AJAX
* @deprecated since Moodle 2.7. This function will be removed in Moodle 2.9.
*/
function show_item(itemid) {
var item = document.getElementById(itemid);
Y.log('show_item has been deprecated since Moodle 2.7 and will be removed in Moodle 2.9',
'warn', 'javascript-static.js');
var item = Y.one('#' + itemid);
if (item) {
item.style.display = "";
item.show();
}
}
// Deprecated since Moodle 2.7. This function will be removed in Moodle 2.9.
function destroy_item(itemid) {
var item = document.getElementById(itemid);
Y.log('destroy_item has been deprecated since Moodle 2.7 and will be removed in Moodle 2.9',
'warn', 'javascript-static.js');
var item = Y.one('#' + itemid);
if (item) {
item.parentNode.removeChild(item);
item.remove(true);
}
}
/**
@ -1459,12 +1470,14 @@ function update_progress_bar (id, width, pt, msg, es){
/**
* Used in a couple of modules to hide navigation areas when using AJAX
* @deprecated since Moodle 2.7. This function will be removed in Moodle 2.9.
*/
function hide_item(itemid) {
// use class='hiddenifjs' instead
var item = document.getElementById(itemid);
Y.log('hide_item has been deprecated since Moodle 2.7 and will be removed in Moodle 2.9',
'warn', 'javascript-static.js');
var item = Y.one('#' + itemid);
if (item) {
item.style.display = "none";
item.hide();
}
}