first tweaks for colibris
This commit is contained in:
parent
9e71a743e2
commit
92cdca0d49
29 changed files with 3176 additions and 1199 deletions
|
@ -1162,3 +1162,32 @@ $(document).ready(function(){
|
|||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
const url = 'https://colibris-lemouvement.org/archipel-markup?domain=colibris-outilslibres.org'
|
||||
var getJSON = function (url, callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
xhr.responseType = 'json';
|
||||
xhr.onload = function () {
|
||||
var status = xhr.status;
|
||||
if (status === 200) {
|
||||
callback(null, xhr.response);
|
||||
} else {
|
||||
callback(status, xhr.response);
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
};
|
||||
|
||||
getJSON(url,
|
||||
function (err, data) {
|
||||
if (err !== null) {
|
||||
console.log('Something went wrong: ' + err);
|
||||
} else {
|
||||
document.getElementById('colibris-menu').innerHTML = data.markup;
|
||||
var styleElement = document.createElement("style");
|
||||
styleElement.innerHTML = data.style;
|
||||
document.getElementById('colibris-menu').appendChild(styleElement);
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue