MDL-21503 eliminating global Y

This commit is contained in:
Petr Skoda
2010-02-03 09:32:02 +00:00
parent 76418c143b
commit 384ab39a62
5 changed files with 6 additions and 13 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ M.core_comment = {
alert('IO FATAL');
return;
}
var data = json_decode(o.responseText);
var data = Y.JSON.parse(o.responseText);
if (data.error) {
alert(data.error);
return false;
+1 -1
View File
@@ -86,7 +86,7 @@ foreach ($string as $key=>$value) {
$lang = str_replace('_utf8', '', $lang); // use more standard language codes
$output = 'tinyMCE.addI18n({'.$lang.':'.json_encode($result).'});';
$output = 'tinyMCE.addI18n({'.$lang.':'.Y.JSON.stringify($result).'});';
$lifetime = '10'; // TODO: increase later
@header('Content-type: text/javascript; charset=utf-8');
+1 -1
View File
@@ -89,7 +89,7 @@ YUI.add('core_filemanager', function(Y) {
alert('IO FATAL');
return;
}
var data = json_decode(o.responseText);
var data = Y.JSON.parse(o.responseText);
args.callback(id,data,p);
}
},
+2 -9
View File
@@ -158,7 +158,8 @@ M.util.CollapsibleRegion.prototype.icon = null;
//=== old legacy JS code, hopefully to be replaced soon by M.xx.yy and YUI3 code ===
function launch_filemanager(options) {
Y.use('core_filemanager', function() {
// TODO: move to M.form_filemanager.init()
YUI(M.yui.loader).use('core_filemanager', function(Y) {
var client_id = options.client_id;
// filemangers defined in lib/form/filemanager.js
if (!filemanagers[client_id]) {
@@ -1213,14 +1214,6 @@ function stripHTML(str) {
return ret;
}
function json_decode(json) {
return Y.JSON.parse(json);
}
function json_encode(data) {
return Y.JSON.stringify(data);
}
/**
* Finds all help icons on the page and initiates YUI tooltips for
* each of them, which load a truncated version of the help's content
+1 -1
View File
@@ -223,7 +223,7 @@ YAHOO.moodle.chat.append_msg = function(key, msg, row) {
YAHOO.moodle.chat.update_cb = {
success: function(o){
var data = json_decode(o.responseText);
var data = Y.JSON.parse(o.responseText);
if (!data) {
return;
}