Commit 41c0706d authored by Romain Loth's avatar Romain Loth

remove collapsible buttons in corpora view

parent 92e9c417
......@@ -69,18 +69,10 @@ function Push2Buffer( NewVal ) {
}
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
if ( (action == "click" && !isCollapsed) || (action=="changerange" && isCollapsed) ) {
if (action=="changerange") {
UpdateTable = true;
$("#corpusdisplayer").html("View by titles")
} else $("#corpusdisplayer").html("View by titles")
}
pr("update table??: "+UpdateTable)
......@@ -522,8 +514,6 @@ function Main_test(Data) {
return "OK"
}
$("#corpusdisplayer").hide()
// FIRST portion of code to be EXECUTED:
// (3) Get records and hyperdata for paginator
$.ajax({
......@@ -556,9 +546,7 @@ $.ajax({
var result = Main_test(data.records)
$("#corpusdisplayer").show()
$("#content_loader").remove()
$("#corpusdisplayer").click()
console.log( result )
},
......
......@@ -100,27 +100,15 @@ function Push2Buffer( NewVal ) {
}
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
if ( (action == "click" && !isCollapsed) || (action=="changerange" && isCollapsed) ) {
if (action=="changerange") {
UpdateTable = true;
$("#corpusdisplayer").html("Close Folder")
} else $("#corpusdisplayer").html("View by journals")
}
pr("update table??: "+UpdateTable)
if ( ! UpdateTable ) return false; //stop whatever you wanted to do.
var TimeRange = AjaxRecords;
var dataini = (TheBuffer[0])?TheBuffer[0]:oldest;
......@@ -502,8 +490,6 @@ function Main_test( data , initial) {
$("#corpusdisplayer").hide()
console.log(window.location.href)
// match corpus_id in the url
......@@ -525,13 +511,8 @@ if (rematch) {
var result = Main_test( data.by.journal , "FirstScore" )
console.log( result )
$("#corpusdisplayer").show()
$("#content_loader").remove()
$("#corpusdisplayer").click()
}
});
}
else {
}
......@@ -27,8 +27,10 @@
* Romain Loth
* - minor 2016 modifications + doc
* - 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 d3
......@@ -304,27 +306,14 @@ function Final_UpdateTable( action ) {
// 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
if ( (action == "click" && !isCollapsed) || (action=="changerange" && isCollapsed) ) {
if (action=="changerange") {
UpdateTable = true;
$("#corpusdisplayer").html("Close Term List")
} else $("#corpusdisplayer").html("View by terms")
}
pr("update table??: "+UpdateTable)
if ( ! UpdateTable ) return false; //stop whatever you wanted to do.
var TimeRange = AjaxRecords;
var dataini = (TheBuffer[0])?TheBuffer[0]:oldest;
......@@ -1893,13 +1882,6 @@ var NGrams = {
"scores" : {}
}
$("#corpusdisplayer").hide()
// if( $("#share_button").length==0 ) {
// $("#ImportList").remove()
// }
// NEW AJAX x 2
......@@ -2071,10 +2053,7 @@ function AfterAjax() {
//
// });
$("#corpusdisplayer").show()
$("#content_loader").remove()
$("#corpusdisplayer").click()
$(".nav-tabs a").click(function(e){
e.preventDefault();
......
......@@ -51,36 +51,29 @@
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
<!-- Final_UpdateTable redraws the dynatable if necessary -->
<p id="corpusdisplayer" onclick='Final_UpdateTable("click")' class="btn btn-primary btn-lg">Journals
</p>
</a>
</h4>
</div>
<div id="journal_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 Journals_dyna_chart_and_table -->
</div>
</div>
</div> <!-- /div panel-collapse -->
</div> <!-- /div panel -->
</div> <!-- /row with the dynatable panels -->
</div> <!-- /jumbotron -->
<!--
</div> Alignment
</div> (these divs are closed by the menu)
/container -->
<div class="jumbotron">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Publications by source
</h4>
</div>
<div class="panel-body">
<div id="div-table">
<!-- (table id="my-ajax-table") dynamically set by Journals_dyna_chart_and_table -->
</div>
</div>
</div> <!-- /div panel -->
</div> <!-- /jumbotron -->
</div>
......
......@@ -49,16 +49,11 @@
<input type="hidden" id="scores_id" value=""></input>
<div class="jumbotron">
<div class="row">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
<!-- Final_UpdateTable redraws the dynatable if necessary -->
<p id="corpusdisplayer" onclick='Final_UpdateTable("click")' class="btn btn-primary btn-lg">
Close term list
</p>
Extracted terms
<!-- <button title='run test function' onclick="doATest()">
TEST
</button> -->
......@@ -79,30 +74,28 @@
</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 -->
<p align="right">
<button id="Save_All" class="btn btn-primary">Save changes permanently</button>
</p>
</div>
</div> <!-- /div panel-collapse -->
<div id="terms_table" class="panel-body">
<div id="div-table">
<!-- (table id="my-ajax-table") dynamically set by Ngrams_dyna_chart_and_table -->
</div>
<!-- under the table -->
<p align="right">
<button id="Save_All" class="btn btn-primary">Save changes permanently</button>
</p>
</div>
</div> <!-- /div panel -->
</div> <!-- /row with the dynatable panels -->
</div> <!-- /jumbotron -->
<!-- Divs closed by the menu
</div> Alignment
<!--
<button id="ImportList" onclick="GetUserPortfolio();" class="btn btn-warning">
Import a Corpus-List
</button>
</div> container
--!>
-->
</div>
......
......@@ -51,50 +51,42 @@
<div class="container">
<div class="jumbotron">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-body">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
<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>
<!-- search box with custom function in Docs_dyna_chart_and_tables.js -->
<div class="pull-left" style="margin-top:1.85em; font-size: 16px;">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
Search:
<input type="search" id="doubleSearch"/>
<span style="font-size:70%;">
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<!-- Used by the #doubleSearch associated function -->
<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>
<input title="Search in Abstracts" id="searchAB" name="searchAB" type="checkbox">AB
</span>&nbsp;&nbsp;
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<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 class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Publications by title
</h4>
<!-- search box with custom function in Docs_dyna_chart_and_tables.js -->
<div class="pull-left" style="margin-top:1.85em; font-size: 16px;">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
Search:
<input type="search" id="doubleSearch"/>
<span style="font-size:70%;">
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<!-- Used by the #doubleSearch associated function -->
<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>
<input title="Search in Abstracts" id="searchAB" name="searchAB" type="checkbox">AB
</span>&nbsp;&nbsp;
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<select id="dupFilter" name="dupFilter">
<option value="filter_all">All</option>
<option value="filter_dupl">Duplicates by Title</option>
</select>
</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>
<!-- 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>
......
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