Commit 5ac19e79 authored by antoine's avatar antoine
Browse files

rsync + versionningnav

parent 6d479a69
meta-elastique.*
*.log
*.svg
rsync.sh
var testing, pad, inReload, inText, inScale, inPad, iframe, group
var testing, inReload, inText, inScale, iframe, group, versions, link_pad
function nav_versions() {
// let response = fetch('index.txt');
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var index = this.response.split('\n')
index.forEach(function(item, i){
versions = document.querySelector('#versions')
var name = item.split('-')
name = name[name.length-1]
versions.innerHTML += '<option data-href="'+item+'" value="'+name+'">'+name+'</option>'
});
versions.onchange = function (e) {
group = this.value;
loadLetters(document.querySelector('#inText').value)
location.hash = group
link_pad.innerHTML = this.getAttribute('data-href')
};
group = versions.value;
}
};
xhttp.open("GET", "index.txt", true);
xhttp.send();
}
function scale(value){
console.log(testing.style)
......@@ -15,31 +44,28 @@ function loadLetters(letters){
tabLetters.forEach(function(item, i){
var itemCode = item.charCodeAt(0)
var ra = rand()
testing.innerHTML += '<img src="Caslongue/Caslongue-' + group + '/svg/' + itemCode + '.svg?rand=' + ra + '" />'
testing.innerHTML += '<img src="projects/' + group + '/svg/' + itemCode + '.svg?rand=' + ra + '" />'
})
}
document.addEventListener("DOMContentLoaded", (event) => {
var url = "https://annuel.framapad.org/p/meta-elastique"
group = location.hash.replace('#', '')
group = location.hash.replace('#', '')
testing = document.querySelector('#testing')
pad = document.querySelector('#pad')
link_pad = document.getElementById('link_pad')
console.log(link_pad)
inReload = document.querySelector('#inReload')
inText = document.querySelector('#inText')
inScale = document.querySelector('#inScale')
inPad= document.querySelector('#inPad')
inReload.addEventListener('click', (event) => {
loadLetters(inText.value)
})
inScale.addEventListener('change', (event) => {
console.log(inScale.value)
scale(inScale.value)
})
inPad.addEventListener('click', (event) => {
pad.classList.toggle("hide")
})
nav_versions()
})
......@@ -12,6 +12,8 @@
<input id="inReload" type="button" value="reload">
<input id="inText" type="text" value="">
<input id="inScale" type="range" min="0.1" max="2" value="1" step=".1">
<select name="versions" id="versions">
</select>
</section>
</main>
</body>
......
Welcome to OSP's Etherpad!
This pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!
Get involved with Etherpad at http://etherpad.org
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment