Skip to content
Snippets Groups Projects
Commit 462ffc38 authored by julientaq's avatar julientaq
Browse files

add dist file

parent 6aaa309d
No related branches found
No related tags found
No related merge requests found
(() => {
// js/modules/config.js
var pagedMakerConfig2 = window.pagedMakerConfig || {
var config;
var config_default = config = window.pagedMakerConfig || {
content: void 0,
stylesheet: void 0,
hooks: void 0,
......@@ -253,7 +254,7 @@ iframe {
.modal .form {
padding: 2em;
background: ${pagedMakerConfig2.ui ? pagedMakerConfig2.ui.color : "white"};
background: ${config_default.ui ? config_default.uicolor : "white"};
}
.pagedMaker-hyde {
......@@ -270,7 +271,7 @@ iframe {
<div class="form">
<img class="logo" src="img/pagedjsLogo.svg" alt="Logo type of Paged.js: a sheet of paper in the shape of the letter P">
<div class="item pagesize ${pagedMakerConfig.features.includes("pagedSize") ? "" : "pagedMaker-hyde"}">
<div class="item pagesize ${config_default.features.includes("pagedSize") ? "" : "pagedMaker-hyde"}">
<label class="pagedSize" for="page-size">page size</label>
<select name="page-size" id="page-size" class="pagedSize">
......@@ -281,7 +282,7 @@ iframe {
</select>
</div>
<div class="item margins ${pagedMakerConfig.features.includes("pagedMargins") ? "" : "pagedMaker-hyde"}">
<div class="item margins ${config_default.features.includes("pagedMargins") ? "" : "pagedMaker-hyde"}">
<label for="marginTop">margin-top</label>
<input class="marginUpdate" id="margin-top" name="marginTop" value="10" data-sizing="mm">
<label for="marginRight">margin-right</label>
......@@ -293,7 +294,7 @@ iframe {
</div>
<div class="item ${pagedMakerConfig.features.includes("fontFamily") ? "" : "pagedMaker-hyde"}">
<div class="item ${config_default.features.includes("fontFamily") ? "" : "pagedMaker-hyde"}">
<label for="fontFamily">font-family</label>
<select id="fontFamily" name="fontfamily" data-css-prop="--fontBody">
<option value="Spectral" selected>Spectral</option>
......@@ -301,17 +302,17 @@ iframe {
<option value="sans-serif">sans serif</option>
</select>
</div>
<div class="item ${pagedMakerConfig.features.includes("fontSize") ? "" : "pagedMaker-hyde"}">
<div class="item ${config_default.features.includes("fontSize") ? "" : "pagedMaker-hyde"}">
<label for="fontSize">font-size</label>
<input class="cssVarUpdate" id="fontSize" name="fontSize" data-css-prop="--fontSize" type="range" min="12" max="20"
data-sizing="px">
</div>
<div class="item ${pagedMakerConfig.features.includes("fontLineHeight") ? "" : "pagedMaker-hyde"}">
<div class="item ${config_default.features.includes("fontLineHeight") ? "" : "pagedMaker-hyde"}">
<label for="lineHeight">line-height</label>
<input class="cssVarUpdate" id="lineHeight" step="0.1" name="lineHeight" data-css-prop="--lineHeight" type="range" min=".8" max="2" >
</div>
<div class="item ${pagedMakerConfig.features.includes("backgroundColor") ? "" : "pagedMaker-hyde"}">
<div class="item ${config_default.features.includes("backgroundColor") ? "" : "pagedMaker-hyde"}">
<label for="background-color">background color</label>
<input class="cssVarUpdate" id="background-color" type="color" name="color" data-css-prop="--background-color"
value="#ffffff">
......@@ -334,7 +335,7 @@ iframe {
}
});
var uicsscontent = document.createElement("style");
uicsscontent.innerText = uicss_default;
uicsscontent.textContent = uicss_default;
document.head.append(uicsscontent);
var inputs = document.querySelectorAll(".cssVarUpdate");
var selects = document.querySelectorAll("select");
......@@ -364,21 +365,21 @@ iframe {
createFrame();
await delay(100);
let interfacecss = document.createElement("style");
interfacecss.innerText = pagedmakerCSS_default;
interfacecss.textContent = pagedmakerCSS_default;
document.querySelector(".previewFrame").contentDocument.head.appendChild(interfacecss);
if (pagedMakerConfig2.stylesheet.length > 1) {
if (config_default.stylesheet != void 0) {
let stylesheetConf = document.createElement("link");
stylesheetConf.href = `${pagedMakerConfig2.stylesheet}`;
stylesheetConf.href = `${config_default.stylesheet}`;
stylesheetConf.rel = "stylesheet";
document.querySelector(".previewFrame").contentDocument.head.appendChild(stylesheetConf);
}
let styleElement = document.querySelector(".previewFrame").contentDocument.createElement("style");
styleElement.innerText = baseStylesheet_default + getMargins() + getPageSize();
styleElement.textContent = baseStylesheet_default + getMargins() + getPageSize();
let articleContent = document.querySelector(".previewFrame").contentDocument.createElement("article");
if (pagedMakerConfig2.content == void 0) {
if (config_default.content == void 0) {
articleContent.innerHTML = document.body.innerHTML;
} else {
articleContent.innerHTML = document.querySelector(`${pagedMakerConfig2.content}`).innerHTML;
articleContent.innerHTML = document.querySelector(`${config_default.content}`).innerHTML;
}
document.querySelector(".previewFrame").contentDocument.body.appendChild(articleContent);
getAllValues(styleElement);
......@@ -400,7 +401,7 @@ iframe {
}
});
values = `body {${values}}`;
return styleElement.innerText = styleElement.innerText + values;
return styleElement.textContent = styleElement.textContent + values;
}
function createFrame() {
const pagedMaker = document.createElement("iframe");
......
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