Commit a099b3dc authored by Romain Loth's avatar Romain Loth

remove collapsible buttons in corpora view

parent 806eb8f8
...@@ -69,18 +69,10 @@ function Push2Buffer( NewVal ) { ...@@ -69,18 +69,10 @@ function Push2Buffer( NewVal ) {
} }
function Final_UpdateTable( action ) { function Final_UpdateTable( action ) {
// (1) Identifying if the button is collapsed:
var isCollapsed=false;
var accordiontext = $("#collapseOne").attr("class")
if(accordiontext.indexOf("collapse in")>-1)
isCollapsed=true;
var UpdateTable = false var UpdateTable = false
if ( (action == "click" && !isCollapsed) || (action=="changerange" && isCollapsed) ) { if (action=="changerange") {
UpdateTable = true; UpdateTable = true;
$("#corpusdisplayer").html("View by titles") }
} else $("#corpusdisplayer").html("View by titles")
pr("update table??: "+UpdateTable) pr("update table??: "+UpdateTable)
...@@ -522,8 +514,6 @@ function Main_test(Data) { ...@@ -522,8 +514,6 @@ function Main_test(Data) {
return "OK" return "OK"
} }
$("#corpusdisplayer").hide()
// FIRST portion of code to be EXECUTED: // FIRST portion of code to be EXECUTED:
// (3) Get records and hyperdata for paginator // (3) Get records and hyperdata for paginator
$.ajax({ $.ajax({
...@@ -556,9 +546,7 @@ $.ajax({ ...@@ -556,9 +546,7 @@ $.ajax({
var result = Main_test(data.records) var result = Main_test(data.records)
$("#corpusdisplayer").show()
$("#content_loader").remove() $("#content_loader").remove()
$("#corpusdisplayer").click()
console.log( result ) console.log( result )
}, },
......
...@@ -100,27 +100,15 @@ function Push2Buffer( NewVal ) { ...@@ -100,27 +100,15 @@ function Push2Buffer( NewVal ) {
} }
function Final_UpdateTable( action ) { function Final_UpdateTable( action ) {
// (1) Identifying if the button is collapsed:
var isCollapsed=false;
var tableClass = $("#journal_table").attr("class")
//\bcollapse\b
if(tableClass.indexOf(" collapse ")>-1) {
isCollapsed=true;
}
var UpdateTable = false var UpdateTable = false
if ( (action == "click" && !isCollapsed) || (action=="changerange" && isCollapsed) ) { if (action=="changerange") {
UpdateTable = true; UpdateTable = true;
$("#corpusdisplayer").html("Close Folder") }
} else $("#corpusdisplayer").html("View by journals")
pr("update table??: "+UpdateTable) pr("update table??: "+UpdateTable)
if ( ! UpdateTable ) return false; //stop whatever you wanted to do. if ( ! UpdateTable ) return false; //stop whatever you wanted to do.
var TimeRange = AjaxRecords; var TimeRange = AjaxRecords;
var dataini = (TheBuffer[0])?TheBuffer[0]:oldest; var dataini = (TheBuffer[0])?TheBuffer[0]:oldest;
...@@ -502,8 +490,6 @@ function Main_test( data , initial) { ...@@ -502,8 +490,6 @@ function Main_test( data , initial) {
$("#corpusdisplayer").hide()
console.log(window.location.href) console.log(window.location.href)
// match corpus_id in the url // match corpus_id in the url
...@@ -525,13 +511,8 @@ if (rematch) { ...@@ -525,13 +511,8 @@ if (rematch) {
var result = Main_test( data.by.journal , "FirstScore" ) var result = Main_test( data.by.journal , "FirstScore" )
console.log( result ) console.log( result )
$("#corpusdisplayer").show()
$("#content_loader").remove() $("#content_loader").remove()
$("#corpusdisplayer").click()
} }
}); });
} }
else {
}
...@@ -27,8 +27,10 @@ ...@@ -27,8 +27,10 @@
* Romain Loth * Romain Loth
* - minor 2016 modifications + doc * - minor 2016 modifications + doc
* - unify table ids with ngram ids * - unify table ids with ngram ids
* - new api routes + prefetch maplist terms
* - simplify UpdateTable
* *
* @version 1.0 beta * @version 1.1
* *
* @requires jquery.dynatable * @requires jquery.dynatable
* @requires d3 * @requires d3
...@@ -304,27 +306,14 @@ function Final_UpdateTable( action ) { ...@@ -304,27 +306,14 @@ function Final_UpdateTable( action ) {
// console.log("AjaxRecords") // console.log("AjaxRecords")
// console.log(AjaxRecords) // console.log(AjaxRecords)
// (1) Identifying if the button is collapsed:
var isCollapsed=false;
var tableClass = $("#terms_table").attr("class")
//\bcollapse\b
if(tableClass.indexOf(" collapse ")>-1) {
isCollapsed=true;
}
var UpdateTable = false var UpdateTable = false
if ( (action == "click" && !isCollapsed) || (action=="changerange" && isCollapsed) ) { if (action=="changerange") {
UpdateTable = true; UpdateTable = true;
$("#corpusdisplayer").html("Close Term List") }
} else $("#corpusdisplayer").html("View by terms")
pr("update table??: "+UpdateTable) pr("update table??: "+UpdateTable)
if ( ! UpdateTable ) return false; //stop whatever you wanted to do. if ( ! UpdateTable ) return false; //stop whatever you wanted to do.
var TimeRange = AjaxRecords; var TimeRange = AjaxRecords;
var dataini = (TheBuffer[0])?TheBuffer[0]:oldest; var dataini = (TheBuffer[0])?TheBuffer[0]:oldest;
...@@ -1893,13 +1882,6 @@ var NGrams = { ...@@ -1893,13 +1882,6 @@ var NGrams = {
"scores" : {} "scores" : {}
} }
$("#corpusdisplayer").hide()
// if( $("#share_button").length==0 ) {
// $("#ImportList").remove()
// }
// NEW AJAX x 2 // NEW AJAX x 2
...@@ -2071,10 +2053,7 @@ function AfterAjax() { ...@@ -2071,10 +2053,7 @@ function AfterAjax() {
// //
// }); // });
$("#corpusdisplayer").show()
$("#content_loader").remove() $("#content_loader").remove()
$("#corpusdisplayer").click()
$(".nav-tabs a").click(function(e){ $(".nav-tabs a").click(function(e){
e.preventDefault(); e.preventDefault();
......
...@@ -52,35 +52,28 @@ ...@@ -52,35 +52,28 @@
<div class="container"> <div class="container">
<div class="jumbotron"> <div class="jumbotron">
<div class="row">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> Publications by source
<!-- Final_UpdateTable redraws the dynatable if necessary -->
<p id="corpusdisplayer" onclick='Final_UpdateTable("click")' class="btn btn-primary btn-lg">Journals
</p>
</a>
</h4> </h4>
</div> </div>
<div id="journal_table" class="panel-collapse collapse in no-transition" role="tabpanel">
<div class="panel-body"> <div class="panel-body">
<div id="div-table"> <div id="div-table">
<!-- (table id="my-ajax-table") dynamically set by Journals_dyna_chart_and_table --> <!-- (table id="my-ajax-table") dynamically set by Journals_dyna_chart_and_table -->
</div> </div>
</div> </div>
</div> <!-- /div panel-collapse -->
</div> <!-- /div panel --> </div> <!-- /div panel -->
</div> <!-- /row with the dynatable panels -->
</div> <!-- /jumbotron --> </div> <!-- /jumbotron -->
<!--
</div> Alignment </div>
</div> (these divs are closed by the menu)
/container -->
......
...@@ -49,16 +49,11 @@ ...@@ -49,16 +49,11 @@
<input type="hidden" id="scores_id" value=""></input> <input type="hidden" id="scores_id" value=""></input>
<div class="jumbotron"> <div class="jumbotron">
<div class="row">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> Extracted terms
<!-- Final_UpdateTable redraws the dynatable if necessary -->
<p id="corpusdisplayer" onclick='Final_UpdateTable("click")' class="btn btn-primary btn-lg">
Close term list
</p>
<!-- <button title='run test function' onclick="doATest()"> <!-- <button title='run test function' onclick="doATest()">
TEST TEST
</button> --> </button> -->
...@@ -79,8 +74,8 @@ ...@@ -79,8 +74,8 @@
</div> </div>
<div id="terms_table" class="panel-collapse collapse in no-transition" role="tabpanel">
<div class="panel-body"> <div id="terms_table" class="panel-body">
<div id="div-table"> <div id="div-table">
<!-- (table id="my-ajax-table") dynamically set by Ngrams_dyna_chart_and_table --> <!-- (table id="my-ajax-table") dynamically set by Ngrams_dyna_chart_and_table -->
</div> </div>
...@@ -90,19 +85,17 @@ ...@@ -90,19 +85,17 @@
<button id="Save_All" class="btn btn-primary">Save changes permanently</button> <button id="Save_All" class="btn btn-primary">Save changes permanently</button>
</p> </p>
</div> </div>
</div> <!-- /div panel-collapse -->
</div> <!-- /div panel --> </div> <!-- /div panel -->
</div> <!-- /row with the dynatable panels -->
</div> <!-- /jumbotron --> </div> <!-- /jumbotron -->
<!-- Divs closed by the menu <!--
</div> Alignment
<button id="ImportList" onclick="GetUserPortfolio();" class="btn btn-warning"> <button id="ImportList" onclick="GetUserPortfolio();" class="btn btn-warning">
Import a Corpus-List Import a Corpus-List
</button> </button>
</div> container -->
--!> </div>
......
...@@ -51,15 +51,11 @@ ...@@ -51,15 +51,11 @@
<div class="container"> <div class="container">
<div class="jumbotron"> <div class="jumbotron">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <div class="panel panel-default">
<div class="panel panel-body">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> Publications by title
<p id="corpusdisplayer" onclick='Final_UpdateTable("click")' class="btn btn-primary btn-lg" style="width:200px; margin:0 auto; display:block;">Titles</h2></p>
</a>
</h4> </h4>
<!-- search box with custom function in Docs_dyna_chart_and_tables.js --> <!-- search box with custom function in Docs_dyna_chart_and_tables.js -->
<div class="pull-left" style="margin-top:1.85em; font-size: 16px;"> <div class="pull-left" style="margin-top:1.85em; font-size: 16px;">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span> <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
...@@ -78,10 +74,7 @@ ...@@ -78,10 +74,7 @@
<option value="filter_dupl">Duplicates by Title</option> <option value="filter_dupl">Duplicates by Title</option>
</select> </select>
</div> </div>
</div> </div>
<div id="collapseOne" class="panel-collapse collapse no-transition" role="tabpanel">
<div class="panel-body"> <div class="panel-body">
<div id="div-table"></div> <div id="div-table"></div>
<p align="right"> <p align="right">
...@@ -93,8 +86,7 @@ ...@@ -93,8 +86,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- here goes import script js/bootstrap/bootstrap-multiselect.js, mais ca marche pas--> <!-- here goes import script js/bootstrap/bootstrap-multiselect.js, mais ca marche pas-->
<script type="text/javascript" src="{% static "js/jquery/jquery.dynatable.js" %}"></script> <script type="text/javascript" src="{% static "js/jquery/jquery.dynatable.js" %}"></script>
......
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