Commit be0a5206 authored by Sylvain Coulange's avatar Sylvain Coulange
Browse files

ajout bouton pour voir le log de toutes les modifications du dictionnaire

parent 294343bb
......@@ -219,13 +219,41 @@ var span = document.getElementsByClassName("close")[0];
// Fonction pour ouvrir le PopUp
function getLogOfEntr(entr) {
document.getElementById('popLogH2').innerHTML = 'Entrée : <i>"'+entr+'"</i>';
var logContent = '<ul>';
document.getElementById('modalBody').innerHTML = '';
var newh2 = document.createElement('h2');
newh2.innerHTML = 'Entrée : <i>"'+entr+'"</i>';
document.getElementById('modalBody').appendChild(newh2);
var newlogContent = document.createElement('div');
var newul = document.createElement('ul');
for (i in logDic[entr]) {
logContent += '<li>'+logDic[entr][i].date+' : '+logDic[entr][i].oldTransList+''+logDic[entr][i].newTransList+' ('+logDic[entr][i].Type+')</li>';
var newli = document.createElement('li');
newli.innerHTML = logDic[entr][i].date+' : '+logDic[entr][i].oldTransList+''+logDic[entr][i].newTransList+' ('+logDic[entr][i].Type+')';
newul.appendChild(newli);
}
newlogContent.appendChild(newul);
document.getElementById('modalBody').appendChild(newlogContent);
modal.style.display = "block";
}
// Fonction pour ouvrir le PopUp
function getLogOfAll() {
document.getElementById('modalBody').innerHTML = '';
for (entr in logDic) {
var newh2 = document.createElement('h2');
newh2.innerHTML = 'Entrée : <i>"'+entr+'"</i>';
document.getElementById('modalBody').appendChild(newh2);
var newlogContent = document.createElement('div');
var newul = document.createElement('ul');
for (i in logDic[entr]) {
var newli = document.createElement('li');
newli.innerHTML = logDic[entr][i].date+' : '+logDic[entr][i].oldTransList+''+logDic[entr][i].newTransList+' ('+logDic[entr][i].Type+')';
newul.appendChild(newli);
}
newlogContent.appendChild(newul);
document.getElementById('modalBody').appendChild(newlogContent);
}
logContent += '</ul>';
document.getElementById('popLogInner').innerHTML = logContent;
modal.style.display = "block";
}
......
$(document).ready(function(){
var txtarea = document.getElementById("inText");
txtarea.selectionEnd = txtarea.innerHTML.length;
txtarea.focus();
});
var tokens = document.getElementsByClassName("tokens");
var i;
for (i = 0; i < tokens.length; i++) {
......
......@@ -8,7 +8,7 @@
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
overflow: auto;
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
......@@ -123,6 +123,20 @@
/* POP LOG */
.modal2 {
display: none; /* Hidden by default */
position: fixed;
z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: scroll;
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
.modal-content2 {
position: relative;
background-color: #fefefe;
......@@ -142,10 +156,6 @@
.modal-header2 h2 {
font-size: 1.5em;
}
#popLogH2 {
font-size: 20pt;
}
.modal-footer2 {
padding: 2px 16px;
......
......@@ -28,7 +28,7 @@
<input type="hidden" id="defaultBg" name="defaultBg" value="{{ data.defaultBg }}"/>
</div>
<h2>Entrer du texte à coloriser :</h2>
<textarea name="inText">{{ data.text }}</textarea><br/>
<textarea name="inText" id="inText">{{ data.text }}</textarea><br/>
<input type="submit" value="Coloriser"/>
<button formaction="/app/0">Effacer</button>
</form>
......
......@@ -78,18 +78,20 @@
<button formaction="/app/">Retour au coloriseur</button>
</form>
</div>
<br>
<a style="cursor:pointer" onclick="getLogOfAll()">Historique complet des modifications du dictionnaire</a>
<!-- Fenêtre d'historique des modifications -->
<div id="myModal" class="modal">
<div id="myModal" class="modal2">
<!-- Modal content -->
<div class="modal-content2">
<div class="modal-header2">
<span class="close">&times;</span>
<h2>Historique des modifications</h2>
</div>
<div class="modal-body">
<h2 id="popLogH2"></h2>
<div id="popLogInner"></div>
<div id="modalBody" class="modal-body">
<h2 id="popLogH2" class="popLogH2"></h2>
<div id="popLogInner" class="popLogInner"></div>
</div>
<div class="modal-footer2">
<h3>WikiColor</h3>
......
Supports Markdown
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