Commit a1347775 authored by Julie Blanc's avatar Julie Blanc

fichier impression indépendant + floatTop image

parent 59b97b25
This diff is collapsed.
This diff is collapsed.
......@@ -8,7 +8,7 @@
/* @import "interface/recto-verso.css"; */
/* uncomment to see the baseline : */
/* @import "interface/baseline.css"; */
@import "interface/baseline.css";
......
......@@ -115,6 +115,8 @@ body{
.fine { font-size: 6px!important; }
[data-id="la-découverte-les-fouilles"]{ padding-top: 0px!important; }
#partnull-ref10::after{ content: ","}
......@@ -124,33 +126,38 @@ body{
.citation, .sidenote{ display: none; }
#martres-tolosane{
/* #martres-tolosane{
break-before: page;
width: 300px;
height: 300px;
}
} */
/* IMG MARTRES TOLOSANE --------------------------------------------------------- */
#martres-tolosane{
width: calc(var(--pagedjs-pagebox-width) - var(--pagedjs-margin-left));
height: calc(var(--pagedjs-pagebox-height) - var(--pagedjs-margin-bottom) - var(--pagedjs-margin-top) - 1px);
position: relative;
left: calc(var(--pagedjs-margin-right)*-1);
}
#martres-tolosane img{
#martres-tolosane,
#vue-exposition {
break-inside: avoid;
width: 100%;
height: calc(100% - var(--baseline)*1.5 + 2px);
}
#martres-tolosane img,
#vue-exposition img{
width: 100%;
/* height: calc(var(--baseline)*27);
object-fit: cover;
/* object-position: -220px; */
object-position: -478px
object-position: center bottom; */
}
#martres-tolosane .figcaption {
#martres-tolosane .figcaption,
#vue-exposition .figcaption {
font-style: italic;
font-size: var(--font-size-note);
line-height: var(--baseline-note);
text-indent: 0;
padding-top: 3px;
padding-top: 6px;
margin-bottom: 25px;
}
......@@ -44,6 +44,11 @@
top: -1px;
}
#title-page h1 em{
position: relative;
left: -3px;
}
.line1, .line2 {
......
This diff is collapsed.
......@@ -33,6 +33,12 @@
}
[data-page-number="34"] .refs-biblio ul{
columns: 1;
width: 50%;
padding-right: 3mm;
}
#refs-biblio-02 ul{
columns: 1;
width: calc((100% - 6mm)/2);
......
......@@ -15,8 +15,8 @@ function clean(content) {
listnotice.querySelectorAll('[data-num-inventaire="2000.411.1"]')[0].getElementsByTagName('h1')[0].innerHTML = 'Chapiteau corinthien <br>à tête de feuillagee';
/* Déplacement d'éléments dans la liste des notices */
let move1 = listnotice.querySelectorAll('[data-num-inventaire="Ra 36 - Ra 37"]')[0]
content.querySelector("#notices-list-04-03").appendChild(move1);
// let move1 = listnotice.querySelectorAll('[data-num-inventaire="Ra 36 - Ra 37"]')[0]
// content.querySelector("#notices-list-04-03").appendChild(move1);
/* Microtypo */
let texts = content.querySelectorAll("p");
......
// floatTop variables ----------------------------------------
var classElemFloatTop = "float-top";
let tableFloatTop = [];
let tableFloatTopElem = [];
// -----------------------------------------------------------
function addcss(css){
var head = document.getElementsByTagName('head')[0];
var s = document.createElement('style');
s.setAttribute('type', 'text/css');
if (s.styleSheet) { // IE
s.styleSheet.cssText = css;
} else {// the world
s.appendChild(document.createTextNode(css));
}
head.appendChild(s);
}
class floatTop extends Paged.Handler {
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller);
this.flagPage = false;
}
beforeParsed(content){
/* Delete the element of the prev. page from calculating the layout */
var css1 = "." + classElemFloatTop + "{ box-sizing: border-box!important; height: 0!important; margin: 0!important; }";
addcss(css1);
/* Set full page CSS*/
// var css2 = ".pagedjs_float-top{ box-sizing: border-box!important; margin: 0!important; }";
// addcss(css2);
}
afterPageLayout(pageElement, page, breakToken){
let floatTop = pageElement.querySelectorAll("." + classElemFloatTop);
/* if there is an element on the page */
if(typeof(floatTop) != 'undefined' && floatTop != null){
for(let i = 0; i < floatTop.length; i++){
/* get page of element*/
let pageN = floatTop[i].closest(".pagedjs_page");
let pageNum = parseInt(pageN.getAttribute("data-page-number"));
/* add page element to table*/
tableFloatTop.push(pageNum);
/* add element to table */
tableFloatTopElem.push(floatTop[i]);
}
}
}
beforePageLayout(page) {
// FloatTop (step 2) -----------------------------------------
for(let i = 0; i < tableFloatTop.length; i++){
if (page.position === tableFloatTop[i]) {
// set flag
this.flagPage = page;
}
}
// -----------------------------------------------------------
}
layoutNode(node) {
if (this.flagPage) {
let pageContent = this.flagPage.wrapper;
let pageContentParent = pageContent.closest(".pagedjs_page");
let pageContentNum = parseInt(pageContentParent.getAttribute("data-page-number")) ;
for(let i = 0; i < tableFloatTop.length; i++){
if (pageContentNum === tableFloatTop[i] + 1) {
tableFloatTopElem[i].classList.remove(classElemFloatTop);
tableFloatTopElem[i].classList.add("pagedjs_float-top");
pageContent.appendChild(tableFloatTopElem[i]);
}
}
this.flagPage = false;
}
}
}
Paged.registerHandlers(floatTop);
\ No newline at end of file
......@@ -4,35 +4,35 @@ function movePages(pageElement){
/* -- Move a specific content in other place of the flow ---------------------------------------------- */
let imageMartres = pageElement.querySelector("#martres-tolosane");
if(typeof(imageMartres) != 'undefined' && imageMartres != null){
let shift = 5;
let numPageImg = parseInt(pageElement.getAttribute("data-page-number"));
let numNewPage = numPageImg - shift;
/* create table with content of page*/
let contents = [];
for(let i = 0; i < shift; i++){
let num = numNewPage + i;
let pageNum = document.getElementById("page-" + num);
let pageContent = pageNum.querySelectorAll('.pagedjs_area')[0].innerHTML;
contents.push(pageContent);
}
/* move image on the new page */
let contentImg = document.getElementById("page-" + numPageImg).querySelectorAll('.pagedjs_area')[0].innerHTML;
let newPageImg = document.getElementById("page-" + numNewPage).querySelectorAll('.pagedjs_area')[0];
newPageImg.innerHTML = contentImg;
/* replace content of page (+1) */
for(let i = 0; i < shift; i++){
let num = numNewPage + i + 1;
let pageNum = document.getElementById("page-" + num);
let pageContent = pageNum.querySelectorAll('.pagedjs_area')[0];
pageContent.innerHTML = contents[i];
}
}
// let imageMartres = pageElement.querySelector("#martres-tolosane");
// if(typeof(imageMartres) != 'undefined' && imageMartres != null){
// let shift = 5;
// let numPageImg = parseInt(pageElement.getAttribute("data-page-number"));
// let numNewPage = numPageImg - shift;
// /* create table with content of page*/
// let contents = [];
// for(let i = 0; i < shift; i++){
// let num = numNewPage + i;
// let pageNum = document.getElementById("page-" + num);
// let pageContent = pageNum.querySelectorAll('.pagedjs_area')[0].innerHTML;
// contents.push(pageContent);
// }
// /* move image on the new page */
// let contentImg = document.getElementById("page-" + numPageImg).querySelectorAll('.pagedjs_area')[0].innerHTML;
// let newPageImg = document.getElementById("page-" + numNewPage).querySelectorAll('.pagedjs_area')[0];
// newPageImg.innerHTML = contentImg;
// /* replace content of page (+1) */
// for(let i = 0; i < shift; i++){
// let num = numNewPage + i + 1;
// let pageNum = document.getElementById("page-" + num);
// let pageContent = pageNum.querySelectorAll('.pagedjs_area')[0];
// pageContent.innerHTML = contents[i];
// }
// }
/* -- Array of elements to move on previous page ---------------------------------------------- */
for(let i = 0; i < elemsPrev.length; i++){
......
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