How to convert this script which use deprecadted E4X ?
i am not a programmer, but if you explain to me where i need to start, i do my best.
In first , it seems not a problem of CDATA ...
Here a link, in Buggzilla , where i describe my problem : Firefox 17 breaks a Greasemonkey script that relies on E4X (New : Firefox 21 delete totally its support)
I obtain here a first indice where E4x is in use (search in the code "ricCB") :
requestImageComments: function( id ) {
if (!id) return;
var tkey = 'getComments';
// Set up ticket status queue if needed
if (!this.ticketStatus[tkey]) this.ticketStatus[tkey] = new Object();
return this.flickrApi
( { method: 'flickr.photos.comments.getList', photo_id: id },
'ricCB', {ticktype: tkey} );
},
ricCB: function(rsp) {
var hash = this.objects.comments;
for each (comments in rsp.comments) {
// for (var cs = 0; cs < rsp.comments.length; cs++) {
// var comments = rsp.comments[cs];
var pid = comments.@photo_id;
for each (com in comments.comment) {
var uname = com.@authorname;
var nsid = com.@author;
this.setTranslation( { uname: uname, nsid: nsid } );
// var create = new Date( com.@datecreate );
var ctxt = com + '';
// Strip out HTML tags:
ctxt = ctxt.replace(/(\<|\<\;).+?(\>|\>\;)/g,'');
// Collapse all whitespace runs to single spaces:
ctxt = ctxt.replace(/[\s\n\r\t]+/g, ' ');
// Store data under both authorname and photo ID (hash
// will collide only if someone is using a pure
// integer as a name AND a photo has same integer).
var info = { txt: ctxt, uname: uname, photo: pid };
if (!hash[uname]) hash[uname] = new Array();
if (!hash[pid]) hash[pid] = new Array();
hash[uname].push(info);
hash[pid].push(info);
}
}
Initially posted here : My Greasemonkey script stopped working after something updated