codemirror.enable-codemirror.js Maven / Gradle / Ivy
window.addEventListener('load', ready, false);
function ready(){
enableCodeMirror('.json:not(.rest-failure)', {name: 'javascript', json: true});
enableCodeMirrorMerge('.json.rest-failure', {name: 'javascript', json: true});
enableCodeMirror('.xml:not(.rest-failure)', 'application/xml');
enableCodeMirrorMerge('.xml.rest-failure', 'application/xml');
}
function unescape(input){
var e = document.createElement('div');
e.innerHTML = input;
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
}
function enableCodeMirror(selector, mode){
var i, value, editor,
jsons = document.querySelectorAll(selector);
for(i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy