Feature #30486
openConvert all jQuery to ECMA Script
0%
Description
I am going to just create this ticket, it's sounds quite general, but I would like to see how many will agree with me here, so in the future, it could be branched up into separate issues.
1. I think java script in Redmine is inconsistent, many things are written in bare JS and many other things are written in bare jQuery.
2. ECMA Script brings new functions for easy DOM manipulation, please see You Dont Need jQuery by nefe[[https://github.com/nefe/You-Dont-Need-jQuery]]
3. I think the set of front end functions deserves a good rethinking, in order to redesign most of them with re usability in mind as much is possible, so plugins developers could reuse them when necessary, the set of functions will however need to be documented.
For example, quite a versatile HTTP request function I made for my WebGL plugin:
function httpRequest(method, url, body, callback) { let request = new XMLHttpRequest(); request.open(method, url, true); request.setRequestHeader('Content-type','application/json'); request.onload = function () { if (request.status < 200 || request.status > 299) callback("Error: Status " + request.status + " on resource " + url); else callback(null, request.responseText); } request.send(body); }
etc etc :)