Commit 04c213bb authored by c24b's avatar c24b

Inversion des boutons help for #graph navigation toolbar + exploration toolbar

parent 27db91f0
...@@ -23,7 +23,7 @@ help = { "#project":{ ...@@ -23,7 +23,7 @@ help = { "#project":{
"<li>Click on 'Chose a file...'</li>"+ "<li>Click on 'Chose a file...'</li>"+
"<li>And give a name to your corpus</li>"+ "<li>And give a name to your corpus</li>"+
"<li>Click on 'Process this!'</li></ol>"+ "<li>Click on 'Process this!'</li></ol>"+
"<b><span class='glyphicon glyphicon-hand-right'> If you want to import a corpus from an open database (only supported by PubMed, IsTex or SCOAP3 right now):</b>"+ "<b><span class='glyphicon glyphicon-hand-right'></span> If you want to import a corpus from an open database <small>(only supported by PubMed, IsTex or SCOAP3 right now)</small>:</b>"+
"<ol>"+ "<ol>"+
"<li>Select No option to the question 'Do you have a file already?'</li>"+ "<li>Select No option to the question 'Do you have a file already?'</li>"+
"<li>Enter your query (syntax of the database is still the same)</li>"+ "<li>Enter your query (syntax of the database is still the same)</li>"+
...@@ -42,7 +42,7 @@ help = { "#project":{ ...@@ -42,7 +42,7 @@ help = { "#project":{
"<li>Cliquez sur 'Choisir un fichier...'</li>"+ "<li>Cliquez sur 'Choisir un fichier...'</li>"+
"<li>Puis donnez un nom à votre corpus</li>"+ "<li>Puis donnez un nom à votre corpus</li>"+
"<li>Cliquez sur 'Process this!'</li></ol>"+ "<li>Cliquez sur 'Process this!'</li></ol>"+
"<b><span class='glyphicon glyphicon-hand-right'></span> Si vous souhaitez importer un corpus directement depuis une base de donnée ouverte (PubMed ou IsTex pour le moment):</b>"+ "<b><span class='glyphicon glyphicon-hand-right'></span> Si vous souhaitez importer un corpus directement depuis une base de donnée ouverte <small>(SCOAP3, PubMed ou IsTex pour le moment)</small>:</b>"+
"<ol>"+ "<ol>"+
"<li>Sélectionnez l'option No à la question Do you have a file already?</li>"+ "<li>Sélectionnez l'option No à la question Do you have a file already?</li>"+
"<li>Entrez votre requête (la syntaxe de la base de donnée cible est conservée)</li>"+ "<li>Entrez votre requête (la syntaxe de la base de donnée cible est conservée)</li>"+
...@@ -65,7 +65,7 @@ help = { "#project":{ ...@@ -65,7 +65,7 @@ help = { "#project":{
"content": "En selectionnant l'option correspondante dans le menu déroulant, vous pouvez afficher ici tous les documents, uniquement vos favoris ou encore rechercher les doublons pour les supprimer", "content": "En selectionnant l'option correspondante dans le menu déroulant, vous pouvez afficher ici tous les documents, uniquement vos favoris ou encore rechercher les doublons pour les supprimer",
}, },
"placement":"right", "placement":"right",
"position": "after", "position": "inside",
}, },
'#titles_time':{ '#titles_time':{
"en":{ "en":{
...@@ -130,13 +130,7 @@ help = { "#project":{ ...@@ -130,13 +130,7 @@ help = { "#project":{
"placement": "right", "placement": "right",
"position": "inside", "position": "inside",
}, },
// '#export_terms':{
// "title": "Exporter",
// "content": "Vous pouvez exporter votre liste de sources <a href=''>format CSV</a>",
// "placement": "right",
// "position": "after",
// "class":"push-right"
// }
"#filter_analytics":{ "#filter_analytics":{
"en":{"title":"Filter documents", "en":{"title":"Filter documents",
"content":"You can filter the documents containing a certain type of data (words, authors, etc.) and see the changes in their number over time", "content":"You can filter the documents containing a certain type of data (words, authors, etc.) and see the changes in their number over time",
...@@ -177,13 +171,6 @@ help = { "#project":{ ...@@ -177,13 +171,6 @@ help = { "#project":{
"title":"Graph Edition and Manipulation Toolbar", "title":"Graph Edition and Manipulation Toolbar",
"content":"Manipulate and edit your graph using this toolbar"+ "content":"Manipulate and edit your graph using this toolbar"+
"<ul>"+ "<ul>"+
"<li>Node sizes maps (on a log scale) the number of documents that"+
"mention its label and its associated terms (if any ).</li>"+
"<li>When according to the chosen proximity measure, the proximity"+
"between two terms is strong enough, a link is displayed.</li>"+
"<li>You can filter links by strength using the 'edges filter' slider"+
"(this will fold/unfold the graph):"+
"</li>"+
"<img src='/static/img/slider_edges.png'/>"+ "<img src='/static/img/slider_edges.png'/>"+
"<li>You can decide to remove small nodes or large nodes using the"+ "<li>You can decide to remove small nodes or large nodes using the"+
"'nodes filter' slider (e.g. to get only the most popular"+ "'nodes filter' slider (e.g. to get only the most popular"+
...@@ -202,13 +189,6 @@ help = { "#project":{ ...@@ -202,13 +189,6 @@ help = { "#project":{
"title":"Outil d'édition et de manipulation du graph", "title":"Outil d'édition et de manipulation du graph",
"content":"Manipuler and éditer le graph grace à cette barre d'outil"+ "content":"Manipuler and éditer le graph grace à cette barre d'outil"+
"<ul>"+ "<ul>"+
"<li>Node sizes maps (on a log scale) the number of documents that"+
"mention its label and its associated terms (if any ).</li>"+
"<li>When according to the chosen proximity measure, the proximity"+
"between two terms is strong enough, a link is displayed.</li>"+
"<li>You can filter links by strength using the 'edges filter' slider"+
"(this will fold/unfold the graph):"+
"</li>"+
"<img src='/static/img/slider_edges.png'/>"+ "<img src='/static/img/slider_edges.png'/>"+
"<li>You can decide to remove small nodes or large nodes using the"+ "<li>You can decide to remove small nodes or large nodes using the"+
"'nodes filter' slider (e.g. to get only the most popular"+ "'nodes filter' slider (e.g. to get only the most popular"+
...@@ -278,7 +258,7 @@ function updateLang(old_lang, new_lang){ ...@@ -278,7 +258,7 @@ function updateLang(old_lang, new_lang){
console.log("Old", old_lang) console.log("Old", old_lang)
console.log("Updating to", new_lang) console.log("Updating to", new_lang)
//update lang in db //update lang in db via API
$.ajax({ $.ajax({
url: '/api/user/parameters/', url: '/api/user/parameters/',
type: 'PUT', type: 'PUT',
...@@ -331,7 +311,7 @@ function loadHelp(lang){ ...@@ -331,7 +311,7 @@ function loadHelp(lang){
console.log(info[lang]["content"]) console.log(info[lang]["content"])
help_btn = '<img src="/static/img/question-mark.png" width="20px" height="20px" class="help-btn" data-html="true" tab-index=0 data-container="body" data-toggle="popover" data-placement="'+info["placement"]+'" title="'+info[lang]["title"]+'" data-content="'+info[lang]["content"]+'"></i>' help_btn = '<img src="/static/img/question-mark.png" width="20px" height="20px" class="help-btn" data-html="true" tab-index=0 data-container="body" data-toggle="popover" data-placement="'+info["placement"]+'" title="'+info[lang]["title"]+'" data-content="'+info[lang]["content"]+'"></i>'
console.log("position of the btn", info["position"])
if (info["position"] == "inside"){ if (info["position"] == "inside"){
$(help_btn).appendTo(el); $(help_btn).appendTo(el);
} }
...@@ -339,16 +319,13 @@ function loadHelp(lang){ ...@@ -339,16 +319,13 @@ function loadHelp(lang){
$(help_btn).insertAfter(el); $(help_btn).insertAfter(el);
} }
else if (info["position"] == "before"){ else if (info["position"] == "before"){
console.log("position", info["position"])
//parent = $(el).parent()
//help = $(help_btn).appendTo(el)
//parent.prependTo(help)
//console.log(">>>>>", $(this))
$(help_btn).insertBefore(el); $(help_btn).insertBefore(el);
} }
else if (info["position"] == "dup_child"){
//copy the first child inside the element and create a custom one with btn
console.log(el.children())
}
else if (info["position"] == "dup_parent"){
//copy the element and create a copy with btn
console.log(el.parent())
}
else{ else{
//duplicate element and insert the button //duplicate element and insert the button
//$(help_btn).insertBefore(el); //$(help_btn).insertBefore(el);
......
...@@ -997,6 +997,41 @@ function camaraButton(){ ...@@ -997,6 +997,41 @@ function camaraButton(){
*/ */
}); });
} }
function updateLang(old_lang, new_lang){
console.log("Old", old_lang)
console.log("Updating to", new_lang)
//update lang in db
$.ajax({
url: '/api/user/parameters/',
type: 'PUT',
data: {"language":new_lang},
beforeSend: function(xhr) {
xhr.setRequestHeader("X-CSRFToken", getCookie("csrftoken"));
},
success: function(response, data) {
console.log(data)
var old_lang = $("a#lang").data("lang")
//var new_lang = data["language"]
//change active langue
$("a#lang").attr("data-lang", new_lang);
$("a#lang > img").attr({"value":new_lang, "src":"/static/img/"+new_lang+".png"})
$("a#lang > span").text(new_lang)
//switch lang to option
$("a.new_lang").attr("data-lang", old_lang);
$("a.new_lang > img").attr({"value":old_lang, "src":"/static/img/"+lang+".png"})
$("a.new_lang > span").text(old_lang)
console.log(response, data)
},
error: function(xhr) {
console.log("EDIT FAIL!")
},
});
console.log("defaut lang is now", $("a#lang").data("lang"))
};
......
...@@ -62,6 +62,8 @@ ...@@ -62,6 +62,8 @@
<div id="left" class="col-sm-8 col-md-8 col-lg-7"> <div id="left" class="col-sm-8 col-md-8 col-lg-7">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li class="basicitem"><a class="help" style="display:inline-block;padding:15px;" id="edition">
</a></li>
<!-- <!--
<li> <li>
<a> <a>
...@@ -122,8 +124,7 @@ ...@@ -122,8 +124,7 @@
</a> </a>
</li> </li>
--> -->
<li class="basicitem"><a class="help" id="edition">
</a></li>
</ul> </ul>
</div><!-- /div#left --> </div><!-- /div#left -->
...@@ -207,6 +208,9 @@ ...@@ -207,6 +208,9 @@
<ul id="ctlzoom"> <ul id="ctlzoom">
<li >
<a style="display:inline-block;padding:5px;" id="exploration" class="help"></a>
</li>
<!-- <div class="content-header"> <!-- <div class="content-header">
<button id="menu-toggle">X</button> <button id="menu-toggle">X</button>
</div> --> </div> -->
...@@ -250,10 +254,7 @@ ...@@ -250,10 +254,7 @@
<img width="30px" title="Save As..." src="{% static "img/save.png" %}" ></img> <img width="30px" title="Save As..." src="{% static "img/save.png" %}" ></img>
</a> </a>
</li> </li>
<li>
<a id="exploration" class="help">
</a>
</li>
</ul> </ul>
</div> </div>
......
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