Commit 96069979 authored by Sylvain Coulange's avatar Sylvain Coulange

colorisation boutons + encadrement des tokens quand affichage du tag

parent 529c059d
...@@ -2,8 +2,8 @@ from django.shortcuts import render ...@@ -2,8 +2,8 @@ from django.shortcuts import render
from django.http import JsonResponse from django.http import JsonResponse
import re, json, spacy, subprocess import re, json, spacy, subprocess
nlpFr = spacy.load('fr_core_news_lg') nlpFr = spacy.load('fr_core_news_md')
nlpZh = spacy.load('zh_core_web_lg') nlpZh = spacy.load('zh_core_web_md')
def home(request): def home(request):
updateTimeStr = updateTime() updateTimeStr = updateTime()
......
...@@ -88,6 +88,12 @@ async function runSpacy() { ...@@ -88,6 +88,12 @@ async function runSpacy() {
var outText = document.getElementById('outText'); var outText = document.getElementById('outText');
outText.innerHTML = result; outText.innerHTML = result;
// On relance switchTags() si il était actif
if (tags) {
switchTags();
switchTags();
}
} }
...@@ -112,12 +118,14 @@ function switchTags(){ ...@@ -112,12 +118,14 @@ function switchTags(){
if (tags) { // Masque les étiquettes morphosyntaxiques if (tags) { // Masque les étiquettes morphosyntaxiques
for (i=0; i<tokens.length; i++){ for (i=0; i<tokens.length; i++){
tokens[i].title = ''; tokens[i].title = '';
tokens[i].classList = "token";
} }
divBtnTags.style.border = "1px solid transparent"; divBtnTags.style.border = "1px solid transparent";
} else { // Affiche les étiquettes morphosyntaxiques } else { // Affiche les étiquettes morphosyntaxiques
for (i=0; i<tokens.length; i++){ for (i=0; i<tokens.length; i++){
tokens[i].title = tokens[i].getAttribute('title-data'); tokens[i].title = tokens[i].getAttribute('title-data');
tokens[i].classList = "token tokenborder";
} }
divBtnTags.style.border = "1px solid green"; divBtnTags.style.border = "1px solid green";
} }
......
...@@ -25,7 +25,7 @@ var langJson = { ...@@ -25,7 +25,7 @@ var langJson = {
}, },
"sp_subtitle": { "sp_subtitle": {
"fr": "<span style='color:#00b54a'>Coloriseur</span> <span style='color:#980086'>grammatical</span> <span style='color:#fff'>et</span> <span style='color:#980086'>automatique</span> <span style='color:#c00018'>de</span> <span style='color:#00b54a'>texte</span>", "fr": "<span style='color:#00b54a'>Coloriseur</span> <span style='color:#980086'>grammatical</span> <span style='color:#fff'>et</span> <span style='color:#980086'>automatique</span> <span style='color:#c00018'>de</span> <span style='color:#00b54a'>texte</span>",
"zh": "" "zh": "<span style='color:#980086'>自動</span><span style='color:#00b54a'>語法</span><span style='color:#fff'>和</span><span style='color:#00b54a'>文本着色器</span>"
}, },
"sp_consigne": { "sp_consigne": {
"fr": "Entrez du texte à analyser :", "fr": "Entrez du texte à analyser :",
......
...@@ -24,18 +24,29 @@ body { ...@@ -24,18 +24,29 @@ body {
padding: 0px; padding: 0px;
} }
h1 {
font-size: 3em;
}
h2 { h2 {
padding: 10px; padding: 10px;
font-size: 1.5em; font-size: 2em;
font-weight: bold; font-weight: bold;
margin: auto; margin: auto;
} }
.contours { .contours {
-webkit-text-stroke-width: 0.7px; -webkit-text-stroke-width: 0.5px;
-webkit-text-stroke-color: black; -webkit-text-stroke-color: black;
} }
button {
border-radius: 5px;
margin: 5px;
padding: 2px 18px;
}
.outputParam { .outputParam {
position: absolute; position: absolute;
right: 0px; right: 0px;
...@@ -158,4 +169,10 @@ footer { ...@@ -158,4 +169,10 @@ footer {
.btntags { .btntags {
border: 1px solid transparent; border: 1px solid transparent;
}
.tokenborder:hover {
border: 1px solid rgba(255, 255, 255, 0.74);
border-radius: 5px;
padding-top: 10px;
} }
\ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
<button onclick="getExample()"><span id="sp_exemple" class="langspan"></span></button> <button onclick="getExample()"><span id="sp_exemple" class="langspan"></span></button>
</div> </div>
<textarea class="inText" id="inText"></textarea> <textarea class="inText" id="inText"></textarea>
<button onclick="runSpacy()"><span id="sp_analyser" class="langspan"></span></button> <button style="background-color: rgb(179, 247, 179);" onclick="runSpacy()"><span id="sp_analyser" class="langspan"></span></button>
<button onclick="erase()"><span id="sp_effacer" class="langspan"></span></button> <button style="background-color: rgb(221, 221, 221);" onclick="erase()"><span id="sp_effacer" class="langspan"></span></button>
</div> </div>
<div id="outputDiv" class="win-black outputMainDiv"> <div id="outputDiv" class="win-black outputMainDiv">
......
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