Commit 3ab08a09 authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

remove inline css, add missing basket.js

parent f02e8699
Pipeline #134982 passed with stages
in 8 minutes and 12 seconds
/* tgrep css additions to custom.css */
/* from head.jsp */
ul { padding: 0; }
dd { margin-left: 0; }
dt { font-weight: bold; }
dd + dt { margin-top: 13px; }
/* from browse.jsp */
iframe {
width: 100%;
}
.clearboth {
clear: both;
}
.drunkenowl {
float:right; width: 30%;
}
document.addEventListener("DOMContentLoaded", function(event) {
// TODO: does this overload the binding from theme.js?
$(document).on('click', '.-remove-from-shelf', function(e) {
var $this = $(this);
var tgObjectUri = $this.attr('data-textgrid-targeturi');
$.ajax({
url: '/service/shelf/remove' ,
type: 'POST',
dataType:'json',
data: {
uri: tgObjectUri
},
success: function(data) {
$this.closest('li.tgrep.result').remove();
$this.closest('li.tgrep.gallery-item').remove();
$('.tgrep.header_count').html(data);
setBasketCount(data);
removeFromAggregatorItemString(tgObjectUri)
}
});
});
$(document).on('click', '.tgrep.header_button.-clear', function(e) {
$.ajax({
url: '/service/shelf/clear' ,
type: 'POST',
dataType:'json',
data: {
empty: 'empty'
},
success: function(data) {
$('.tgrep.results_list').empty();
$('.tgrep.results_gallery').empty();
$('.tgrep.header_count').html(0);
setBasketCount(data);
removeUselessActionsFromEmptyShelf();
}
});
});
basketItemString = document.querySelector('#basketItemString').dataset.value;
});
// set by jsp
var basketItemString;
// removes the tguri from aggregatorUrl
function removeFromAggregatorItemString(tgObjectUri) {
var basketItemStringOld = basketItemString;
var itemArr = basketItemString.split(',');
itemArr.splice(itemArr.indexOf(tgObjectUri),1);
// are there any objects left on the shelf?
if(itemArr.length > 0) {
basketItemString = itemArr.join(',');
document.querySelectorAll('.aggregator-items').forEach( elem => {
elem.href = elem.href.replace(basketItemStringOld, basketItemString);
});
} else {
removeUselessActionsFromEmptyShelf();
}
}
// disable download and voyant links if shelf is empty
function removeUselessActionsFromEmptyShelf() {
document.querySelectorAll('.remove_on_shelf_empty').forEach( elem => {
elem.remove();
});
}
\ No newline at end of file
......@@ -4,14 +4,7 @@
<title>TextGrid Repository</title>
<meta charset="utf-8">
<link rel="stylesheet" href="/css/custom.css">
<style type="text/css">
ul { padding: 0; }
dd { margin-left: 0; }
dt { font-weight: bold; }
dd + dt { margin-top: 13px; }
</style>
<link rel="stylesheet" href="/css/more.css">
</head>
<body class="html_body aui">
......
......@@ -6,12 +6,6 @@
<%@ include file="base/head.jsp" %>
<style>
iframe {
width: 100%;
}
</style>
<div class="tgrep wrap">
<c:if test="${browseRootAggregations}">
......@@ -260,7 +254,7 @@
<!-- Notes and License (e.g. for editions) -->
<c:if test="${not empty metadata.object.edition.license.value or not empty metadata.object.generic.provided.notes}">
<div style="clear:both">
<div class="clearboth">
<hr/>
<dl>
<c:if test="${not empty metadata.object.generic.provided.notes}">
......@@ -283,7 +277,7 @@
</c:if>
<!-- Citation examples -->
<div id="citation" style="clear:both">
<div id="citation" class="clearboth">
<hr/>
<%@ include file="components/citation.jsp" %>
......
......@@ -7,13 +7,13 @@
<%@ include file="base/head.jsp" %>
<img src="/images/drunk.svg" alt="drunk owl" style="float:right; width: 30%;">
<img src="/images/drunk.svg" alt="drunk owl" class="drunkenowl">
<h2>Ups, an error occured</h2>
<div>Status code: <b>${statusCode}</b></div>
<div>Exception Message: <b>${exception}</b></div>
<span style="clear:both;"></span>
<span class="clearboth"></span>
<pre>
<c:forEach items="${stacktrace}" var="stelem">
......
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