Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
ZahraMousavi committed May 16, 2019
2 parents 45f5d0d + aae5547 commit 3db26ab
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
"use strict";

function show_relevant_text_possibilities() {
let types = ['quote', 'comment', 'translation', 'modernized', 'info', 'person', 'place', 'title'];

let pageBreaks = document.querySelectorAll('.symbol.pagination.edition');
pageBreaks.forEach(function(pageBreak) {
pageBreak.parentElement.style.display = 'inline';
pageBreak.innerHTML = '<span class="hidden">&#128463;</span> ' + pageBreak.innerHTML;
});

pageBreaks = document.querySelectorAll('.symbol.pagination.other');
pageBreaks.forEach(function(pageBreak) {
pageBreak.innerHTML = '&#128463; ' + pageBreak.innerHTML;
});

let types = ['quote', 'comment', 'translation', 'modernized', 'info', 'person', 'place', 'title', 'pagination.other'];
types.forEach(function(type)
{
var symbols = document.querySelectorAll('span.symbol.' + type);
var symbols = document.querySelectorAll('.symbol.' + type);
if (symbols.length != 0){
var button = document.getElementById(type);
button.classList.remove("hidden");
Expand Down
34 changes: 34 additions & 0 deletions app/assets/javascripts/text_service/toggle_pagebreaks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict";

function toggle_pagebreak() {
let text_pagebreaks = document.querySelectorAll(".symbol.pagination.other");
if (this.checked) {
for (i = 0; i < text_pagebreaks.length; i++) {
text_pagebreaks[i].style.display = 'inline';
text_pagebreaks[i].parentElement.style.display = 'inline';
}
} else {
for (i = 0; i < text_pagebreaks.length; i++) {
text_pagebreaks[i].style.display = 'none';
text_pagebreaks[i].parentElement.style.display = 'none';
}
}

text_pagebreaks = document.querySelectorAll(".symbol.pagination.edition");
if (this.checked) {
for (i = 0; i < text_pagebreaks.length; i++) {
text_pagebreaks[i].style.position = 'static';
text_pagebreaks[i].firstChild.classList.remove('hidden');
}
} else {
for (i = 0; i < text_pagebreaks.length; i++) {
text_pagebreaks[i].style.position = 'absolute';
text_pagebreaks[i].firstChild.classList.add('hidden');
}
}
}

let show_pagebreaks = document.getElementById('Show_pagebreaks');
if (show_pagebreaks) {
show_pagebreaks.addEventListener('click', toggle_pagebreak, false);
}
44 changes: 33 additions & 11 deletions app/assets/stylesheets/General/_landingPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -236,24 +236,46 @@ main .document {
position: relative;
}

.pageBreak {
a > small {
visibility: visible;
//a.pagination{
// display: inline;
//}
//.symbol.pagination.edition {
// display: inline ;
// //a > small {
// // visibility: visible;
// position: absolute;
// left: 5px;
// //}
//
// margin-left: 0;
// width: 0;
// height: 0;
// padding: 0;
//
// &:after {
// content: "\007C";
// color: $secondary;
// }
//}
a.pagination{
display: none;
font-family: 'nowayregular', sans-serif;
.symbol.pagination{
display: inline;
font-size: 14px;
font-weight: normal;
}
}
.pageBreak, a.pagination {
small.edition {
position: absolute;
left: 5px;
}

a {
visibility: hidden;
margin-left: 0;
width: 0;
height: 0;
padding: 0;
}

&:after {
content: "\007C";
color: $secondary;
font-size: large;
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_text_possibilities_toolbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<%= render :partial => 'shared/components/atoms/checkbox/index.html.erb', locals: {label: '<span class="icon person">&nbsp;</span>Person', selected: '', disabled: '', id: 'Show_persons', name: 'Show_persons', type:'person', classes: 'hidden'} %>
<%= render :partial => 'shared/components/atoms/checkbox/index.html.erb', locals: {label: '<span class="icon location_on">&nbsp;</span>Beliggenhed', selected: '', disabled: '', id: 'Show_locations', name: 'Show_locations', type:'place', classes: 'hidden'} %>
<%= render :partial => 'shared/components/atoms/checkbox/index.html.erb', locals: {label: '<span class="icon title">&nbsp;</span>Title', selected: '', disabled: '', id: 'Show_titles', name: 'Show_titles', type:'title', classes: 'hidden'} %>

<%= render :partial => 'shared/components/atoms/checkbox/index.html.erb', locals: {label: '<span>&#128463;</span> Andre sidetal', selected: '', disabled: '', id: 'Show_pagebreaks', name: 'Show_pagebreaks', type:'pagination.other', classes: 'hidden'} %>
</fieldset>
</span>

0 comments on commit 3db26ab

Please sign in to comment.