Commit a96abfa4 authored by Abdelmoujib Megzari's avatar Abdelmoujib Megzari
Browse files

histor working better

parent 0512919f
......@@ -28,12 +28,18 @@ function showLogin() {
y.style.display = "none";
}
}
function choose(sourceid, destinationid,story_id){
function choose(sourceid, destinationid,story_id,mode,async){
if (typeof(mode)=='undefined'){
mode = mod;
}
if (typeof(sync)=='undefined'){
async = true;
}
$.ajax({
url:"LookupParagraph",
type: "POST",
async: false,
data:({ paragraph_id: destinationid,storyid: story_id, mode: "read"}),
async: async,
data:({ paragraph_id: destinationid,storyid: story_id, mode: mode}),
dataType:"text",
complete:function( data ) {
console.log(data.responseText);
......
......@@ -8,8 +8,6 @@
<meta charset="UTF-8"/>
<link rel="stylesheet" href="style.css">
<script src="index.js"></script>
<script>
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
......@@ -36,10 +34,14 @@
<div class="story_title">${empty story? "no title" :story.titre}</div>
<div class="liste_de_paragraphes">
<jsp:include page="/LookupParagraph?paragraph_id=${story.idPremierParagraphe}&storyid=${story.id}&mode=idle" />
<c:forEach items="${history[story.id].paragraphs}" var="paragraph">
<jsp:include page="/LookupParagraph?paragraph_id=${paragraph.id}&storyid=${story.id}&mode=idle" />
</c:forEach>
</div>
</div>
<script>
var last="${story.idPremierParagraphe}";
<c:forEach items="${history[story.id].paragraphs}" var="paragraph">
choose(last,${paragraph.id},${story.id},"idle");
last=${paragraph.id};
</c:forEach>
</script>
</body>
</html>
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