MDL-41030 JavaScript: Convert remaining YUI2 IO calls to YUI3
This commit is contained in:
committed by
David Monllao
parent
6e2c417c1f
commit
a42791cb90
+10
-6
@@ -91,7 +91,7 @@ function UpdatableMembersCombo(wwwRoot, courseId) {
|
||||
this.courseId = courseId;
|
||||
|
||||
this.connectCallback = {
|
||||
success: function(o) {
|
||||
success: function(t, o) {
|
||||
|
||||
if (o.responseText !== undefined) {
|
||||
var selectEl = document.getElementById("members");
|
||||
@@ -124,7 +124,7 @@ function UpdatableMembersCombo(wwwRoot, courseId) {
|
||||
removeLoaderImgs("membersloader", "memberslabel");
|
||||
},
|
||||
|
||||
failure: function(o) {
|
||||
failure: function() {
|
||||
removeLoaderImgs("membersloader", "memberslabel");
|
||||
}
|
||||
|
||||
@@ -185,9 +185,13 @@ UpdatableMembersCombo.prototype.refreshMembers = function () {
|
||||
|
||||
if(singleSelection) {
|
||||
var sUrl = this.wwwRoot+"/group/index.php?id="+this.courseId+"&group="+groupId+"&act_ajax_getmembersingroup";
|
||||
var callback = this.connectCallback;
|
||||
YUI().use('yui2-connection', function (Y) {
|
||||
Y.YUI2.util.Connect.asyncRequest("GET", sUrl, callback, null);
|
||||
var self = this;
|
||||
YUI().use('io', function (Y) {
|
||||
Y.io(sUrl, {
|
||||
method: 'GET',
|
||||
context: this,
|
||||
on: self.connectCallback
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -271,4 +275,4 @@ function init_add_remove_members_page(Y) {
|
||||
|
||||
addselect = document.getElementById('addselect');
|
||||
addselect.onchange = updateUserSummary;
|
||||
}
|
||||
}
|
||||
|
||||
+16
-14
@@ -38,21 +38,23 @@ M.mod_wiki.init = function(Y, args) {
|
||||
});
|
||||
new WikiHelper(args);
|
||||
};
|
||||
M.mod_wiki.renew_lock = function(Y, args) {
|
||||
function renewLock() {
|
||||
var args = {};
|
||||
args['sesskey'] = M.cfg.sesskey;
|
||||
args['pageid'] = wiki.pageid;
|
||||
if (wiki.section) {
|
||||
args['section'] = wiki.section;
|
||||
}
|
||||
var callback = {};
|
||||
Y.use('yui2-connection', function(Y) {
|
||||
Y.YUI2.util.Connect.asyncRequest('GET', 'lock.php?' + build_querystring(args), callback);
|
||||
});
|
||||
M.mod_wiki.renew_lock = function() {
|
||||
var args = {
|
||||
sesskey: M.cfg.sesskey,
|
||||
pageid: wiki.pageid
|
||||
};
|
||||
if (wiki.section) {
|
||||
args.section = wiki.section;
|
||||
}
|
||||
setInterval(renewLock, wiki.renew_lock_timeout * 1000);
|
||||
}
|
||||
YUI().use('io', function(Y) {
|
||||
function renewLock() {
|
||||
Y.io('lock.php?' + build_querystring(args), {
|
||||
method: 'POST'
|
||||
});
|
||||
}
|
||||
setInterval(renewLock, wiki.renew_lock_timeout * 1000);
|
||||
});
|
||||
};
|
||||
M.mod_wiki.history = function(Y, args) {
|
||||
var compare = false;
|
||||
var comparewith = false;
|
||||
|
||||
Reference in New Issue
Block a user