}
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
return str;
}
-repository_client.stripHTML = function(str){
- var re= /<\S[^><]*>/g
- var ret = str.replace(re, "")
- return ret;
-}
repository_client.popup = function(client_id, url) {
window.open(url,'repo_auth', 'location=0,status=0,scrollbars=0,width=500,height=300');
cached_client_id = client_id;
try {
var ret = YAHOO.lang.JSON.parse(txt);
} catch(e) {
- alert(fp_lang.invalidjson+' - |'+source+'| -'+this.stripHTML(txt));
+ alert(fp_lang.invalidjson+' - |'+source+'| -'+stripHTML(txt));
}
return ret;
}