From 4fd76e81a25db67c6c0c110d0b24073fe66287fd Mon Sep 17 00:00:00 2001 From: William Daniau Date: Fri, 18 Oct 2019 15:09:44 +0200 Subject: [PATCH] =?UTF-8?q?Prise=20en=20compte=20du=20fait=20qu'il=20n'y?= =?UTF-8?q?=20a=20pas=20forc=C3=A9ment=20de=20nextSibling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/html/common/wizefunc.js | 46 ++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/templates/html/common/wizefunc.js b/templates/html/common/wizefunc.js index ec1303b..48c186f 100644 --- a/templates/html/common/wizefunc.js +++ b/templates/html/common/wizefunc.js @@ -42,11 +42,10 @@ } } - /* Convert the two first tags into info */ - /* use tags for image/table/object attributes */ - function tagToInfo() { - /* All H5 tags */ - var atags = document.getElementsByTagName('H5'); + + function tagToInfo(s5=false) { + /* All H4 tags */ + var atags = document.getElementsByTagName('H4'); /* extract configuration tags */ tags=[]; for (var i=0; i make it display:none too */ + if (tags[i-1].nextElementSibling && tags[i-1].nextElementSibling.tagName == 'BR') { + tags[i-1].nextElementSibling.setAttribute("style","display:none;"); + } + if (s5) { + var s = tags[i-1].innerHTML; + document.getElementById("footinfo"+i).innerHTML = s; + } + } + } + + /* Convert the two first tags into info */ + /* use tags for image/table/object attributes */ + function tagToStyle() { + /* All H5 tags */ + var atags = document.getElementsByTagName('H5'); + /* extract configuration tags */ + tags=[]; + for (var i=0; i 2) { + + if (tags.length > 0) { /* Image tags */ - for (var i=1; i <= tags.length - 2; i++) { - var ctag = tags[i+1]; + for (var i=0; i < tags.length; i++) { + var ctag = tags[i]; ctag.setAttribute("style","display:none;"); + /* If next sibling is a
make it display:none too */ + if (ctag.nextElementSibling && ctag.nextElementSibling.tagName == 'BR') { + ctag.nextElementSibling.setAttribute("style","display:none;"); + } var s = ctag.innerHTML; /* find next img/table/zim-object */ ctag = findNextObject(ctag); -- 2.16.4