mirror of
https://github.com/moodle/moodle.git
synced 2025-07-11 09:26:34 +02:00
"MDL-13766, move common functions to javascript-static.js"
This commit is contained in:
@ -1125,6 +1125,31 @@ function build_querystring(obj) {
|
||||
}
|
||||
return list.join('&');
|
||||
}
|
||||
|
||||
function stripHTML(str) {
|
||||
var re = /<\S[^><]*>/g;
|
||||
var ret = str.replace(re, "");
|
||||
return ret;
|
||||
}
|
||||
|
||||
function json_decode(json) {
|
||||
try {
|
||||
var obj = YAHOO.lang.JSON.parse(json);
|
||||
} catch (e) {
|
||||
alert(e.toString());
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
function json_encode(data) {
|
||||
try {
|
||||
var json = YAHOO.lang.JSON.stringify(data);
|
||||
} catch (e) {
|
||||
alert(e.toString());
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
Reference in New Issue
Block a user