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();
......
...@@ -51,36 +51,29 @@ ...@@ -51,36 +51,29 @@
<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"> Publications by source
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> </h4>
<!-- Final_UpdateTable redraws the dynatable if necessary --> </div>
<p id="corpusdisplayer" onclick='Final_UpdateTable("click")' class="btn btn-primary btn-lg">Journals
</p>
</a> <div class="panel-body">
</h4> <div id="div-table">
</div> <!-- (table id="my-ajax-table") dynamically set by Journals_dyna_chart_and_table -->
</div>
<div id="journal_table" class="panel-collapse collapse in no-transition" role="tabpanel"> </div>
<div class="panel-body">
<div id="div-table">
<!-- (table id="my-ajax-table") dynamically set by Journals_dyna_chart_and_table --> </div> <!-- /div panel -->
</div>
</div> </div> <!-- /jumbotron -->
</div> <!-- /div panel-collapse -->
</div>
</div> <!-- /div panel -->
</div> <!-- /row with the dynatable panels -->
</div> <!-- /jumbotron -->
<!--
</div> Alignment
</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,30 +74,28 @@ ...@@ -79,30 +74,28 @@
</div> </div>
<div id="terms_table" class="panel-collapse collapse in no-transition" role="tabpanel">
<div class="panel-body">
<div id="div-table">
<!-- (table id="my-ajax-table") dynamically set by Ngrams_dyna_chart_and_table -->
</div>
<!-- under the table --> <div id="terms_table" class="panel-body">
<p align="right"> <div id="div-table">
<button id="Save_All" class="btn btn-primary">Save changes permanently</button> <!-- (table id="my-ajax-table") dynamically set by Ngrams_dyna_chart_and_table -->
</p> </div>
</div>
</div> <!-- /div panel-collapse --> <!-- under the table -->
<p align="right">
<button id="Save_All" class="btn btn-primary">Save changes permanently</button>
</p>
</div>
</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,50 +51,42 @@ ...@@ -51,50 +51,42 @@
<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"> Publications by title
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> </h4>
<p id="corpusdisplayer" onclick='Final_UpdateTable("click")' class="btn btn-primary btn-lg" style="width:200px; margin:0 auto; display:block;">Titles</h2></p> <!-- search box with custom function in Docs_dyna_chart_and_tables.js -->
</a> <div class="pull-left" style="margin-top:1.85em; font-size: 16px;">
</h4> <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
Search:
<!-- search box with custom function in Docs_dyna_chart_and_tables.js --> <input type="search" id="doubleSearch"/>
<div class="pull-left" style="margin-top:1.85em; font-size: 16px;"> <span style="font-size:70%;">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span> <span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
Search: <!-- Used by the #doubleSearch associated function -->
<input type="search" id="doubleSearch"/> <input title="Search in Titles" id="searchTI" name="searchTI" type="checkbox" checked onclick="return false">TI&nbsp;
<span style="font-size:70%;"> <span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span> <input title="Search in Abstracts" id="searchAB" name="searchAB" type="checkbox">AB
<!-- Used by the #doubleSearch associated function --> </span>&nbsp;&nbsp;
<input title="Search in Titles" id="searchTI" name="searchTI" type="checkbox" checked onclick="return false">TI&nbsp; <span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span> <select id="dupFilter" name="dupFilter">
<input title="Search in Abstracts" id="searchAB" name="searchAB" type="checkbox">AB <option value="filter_all">All</option>
</span>&nbsp;&nbsp; <option value="filter_dupl">Duplicates by Title</option>
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span> </select>
<select id="dupFilter" name="dupFilter">
<option value="filter_all">All</option>
<option value="filter_dupl">Duplicates by Title</option>
</select>
</div>
</div>
<div id="collapseOne" class="panel-collapse collapse no-transition" role="tabpanel">
<div class="panel-body">
<div id="div-table"></div>
<p align="right">
<button id="move2trash" class="btn btn-primary btn-lg" >
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
Trash It!
</button>
</p>
</div>
</div>
</div> </div>
</div> </div>
<div class="panel-body">
<div id="div-table"></div>
<p align="right">
<button id="move2trash" class="btn btn-primary btn-lg" >
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
Trash It!
</button>
</p>
</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