From d3b465ad38e9ab1a184d3ce35835f712170308aa Mon Sep 17 00:00:00 2001 From: William Daniau Date: Tue, 15 Oct 2019 21:41:20 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20fonction=20permettant=20de=20r?= =?UTF-8?q?=C3=A9cup=C3=A9rer=20les=20deux=20premiers=20tags=20pour=20affi?= =?UTF-8?q?cher=20des=20infos=20dans=20le=20footer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/html/common/wizefunc.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/templates/html/common/wizefunc.js b/templates/html/common/wizefunc.js index 4299f93..ab8d565 100644 --- a/templates/html/common/wizefunc.js +++ b/templates/html/common/wizefunc.js @@ -41,3 +41,15 @@ logodiv.setAttribute("style","display:none;"); } } + + /* Convert the two first tags into info */ + function tagToInfo() { + var tags = document.getElementsByClassName('zim-tag'); + var n = tags.length < 3 ? tags.length : 2; + for (var i=1; i <= n; i++) { + var s = tags[i-1].innerHTML; + s = s.replace('@',''); + s = s.replace(/_/g,' '); + document.getElementById("footinfo"+i).innerHTML = s; + } + } -- 2.16.4