diff --git a/.htaccess b/.htaccess index 422199c..0639402 100644 --- a/.htaccess +++ b/.htaccess @@ -39,6 +39,8 @@ RewriteRule ^en/(.*)$ /$1 [QSA] RewriteRule ^fr/(.*)$ /$1 [QSA] RewriteRule ^lb/(.*)$ /$1 [QSA] +# Honeypots. (Just to fuck with automated scanners, gotta love those unsolicited emails tho...) + # Sending a 404 for git and IDEs folders just in case they ever get copied to the web server, # or if one of the honeypot files is acessed directly. # A 404 is preferred to prevent further scanning of this folder and from raising some flags. diff --git a/commons/content.php b/commons/content.php index 97e8762..f8186a5 100644 --- a/commons/content.php +++ b/commons/content.php @@ -165,19 +165,21 @@ function printErrorTextElement(string $text) : void { } } -function processStandardContentSubNode(mixed $elementNode) : void { +function processStandardContentSubNode(mixed $elementNode, string $prepend="", string $append="") : void { if(array_key_exists("content", $elementNode)) { if (array_key_exists("parts", $elementNode["content"])) { for ($iPart = 0; $iPart < count($elementNode["content"]["parts"]); $iPart++) { + echo($prepend); createElementNode($elementNode["content"]["parts"][$iPart]); + echo($append); } } else { - echo(getContentItemText($elementNode["content"], false, true)); + echo($prepend.getContentItemText($elementNode["content"], false, true).$append); } } } -function createElementNode(mixed $elementNode) : void { +function createElementNode(mixed $elementNode, string $prepend="", string $append="") : void { // Checking if we actually have a JSON object. if(!is_array($elementNode)) { echo('

Not array node !

'); @@ -199,6 +201,23 @@ function createElementNode(mixed $elementNode) : void { // Adding element. echo('
'); + break; + case "hr": + // Reading and processing the modifiers. + $_modIsSubtle = false; + if(array_key_exists("modifiers", $elementNode)) { + for ($i = 0; $i < count($elementNode["modifiers"]); $i++) { + if ($elementNode["modifiers"][$i] == "subtle") { + $_modIsSubtle = true; + } + } + } + + if($_modIsSubtle) { + echo('
'); + } else { + echo(''); + } break; case "h1": case "h2": @@ -223,8 +242,20 @@ function createElementNode(mixed $elementNode) : void { $_indentLevel = $elementNode["indent"]; } + // Reading and processing the modifiers. + $_modNoTopMargin = false; + if(array_key_exists("modifiers", $elementNode)) { + for ($i = 0; $i < count($elementNode["modifiers"]); $i++) { + switch($elementNode["modifiers"][$i]) { + case "no-top-margin": + $_modNoTopMargin = true; + break; + } + } + } + // Opening paragraph. - echo(''); + echo('

'); // Adding content. processStandardContentSubNode($elementNode); @@ -283,13 +314,19 @@ function createElementNode(mixed $elementNode) : void { } // Reading and processing the modifiers. + $_modIsCard = false; $_modNoTopMargin = false; $_modNoTopPadding = false; $_modNoBottomPadding = false; $_modNoSizePadding = false; + $_modHorizontalScroll = false; if(array_key_exists("modifiers", $elementNode)) { for ($i = 0; $i < count($elementNode["modifiers"]); $i++) { switch($elementNode["modifiers"][$i]) { + case "card": + $_modIsCard = true; + $_modNoTopMargin = true; + break; case "no-top-margin": $_modNoTopMargin = true; break; @@ -302,13 +339,17 @@ function createElementNode(mixed $elementNode) : void { case "no-side-padding": $_modNoSizePadding = true; break; + case "horizontal-scroll": + $_modHorizontalScroll = true; + break; } } } // Opening container. - echo('

'); + echo('
'); // Adding content. processStandardContentSubNode($elementNode); @@ -376,6 +417,7 @@ function createElementNode(mixed $elementNode) : void { $_modStriped = false; $_modHover = false; $_modInnerBordered = false; + $_modOuterBordered = false; if(array_key_exists("modifiers", $elementNode)) { for ($i = 0; $i < count($elementNode["modifiers"]); $i++) { switch($elementNode["modifiers"][$i]) { @@ -391,13 +433,17 @@ function createElementNode(mixed $elementNode) : void { case "inner-bordered": $_modInnerBordered = true; break; + case "outer-bordered": + $_modOuterBordered = true; + break; } } } // Preparing table. echo(''); + ($_modHover?" table-hover":"").($_modInnerBordered?" table-inner-bordered":""). + ($_modOuterBordered?' table-outer-bordered':'').'">'); // Creating "thead". if(array_key_exists("head", $elementNode)) { @@ -514,6 +560,23 @@ function createElementNode(mixed $elementNode) : void { // Ending the collapse. echo(''); + break; + case "slider": + case "glider": + case "gallery": + // Starting the gallery + echo('
'); + echo('
'); + echo('
'); + echo('
'); + + // Adding content. + processStandardContentSubNode($elementNode, "
", "
"); + + // Ending the gallery + echo('
'); + echo('
'); + break; default: printErrorTextElement(sprintf(localize("error.content.data.part.unknown"), $elementNode["type"])); diff --git a/commons/sidebar.php b/commons/sidebar.php index ea6659e..6b34efb 100644 --- a/commons/sidebar.php +++ b/commons/sidebar.php @@ -64,10 +64,10 @@ if(!isset($SIDEBAR_ID)) { - "> + "> diff --git a/content/index.php b/content/index.php index c376a30..c293b48 100644 --- a/content/index.php +++ b/content/index.php @@ -241,7 +241,7 @@ if($content_has_error) { } // New elements test zone. - START - + // New elements test zone. - END // Closing the content container. @@ -272,7 +272,7 @@ if($content_has_error) { - + diff --git a/content/items/lscom-cli.json b/content/items/lscom-cli.json index 9abc698..4fea2c7 100644 --- a/content/items/lscom-cli.json +++ b/content/items/lscom-cli.json @@ -111,9 +111,7 @@ } }, - { - "type": "spacer", "size": 2 - }, + {"type": "spacer", "size": 2}, { "type": "collapse", diff --git a/content/items/test.json b/content/items/test.json new file mode 100644 index 0000000..406a03b --- /dev/null +++ b/content/items/test.json @@ -0,0 +1,184 @@ +{ + "title": { + "icon": "fad fa-debug", + "page": {"en": "Testing page", "fr": "Page de test"}, + "card": { + "main": {"en": "Testing page", "fr": "Page de test"}, + "sub": {"en": "How did you end up here ?", "fr": "title.card.sub.fr"} + } + }, + "meta": { + "title": {"en": "Testing page", "fr": "Page de test"}, + "description": { + "en": "A test page used internally when writing new content rules and/or elements.", + "fr": "Une page de test utilisé pour écrire de nouvelles règles ou éléments pour ce site." + } + }, + "parts": [ + { + "_": "Testing the paragraph padding and margin.", + "type": "container", "padding": 10, + "modifiers": ["no-bottom-padding", "no-top-margin"], + "content": { + "parts": [ + { + "type": "paragraph", "modifiers": ["no-top-margin"], + "content": {"en": "container.p10.no-bottom-padding.no-top-margin > p.no-top-margin"} + },{ + "type": "paragraph", "modifiers": ["no-top-margin"], + "content": {"en": "Joe mama !"} + } + ] + } + }, + + {"type": "hr"}, + + { + "_": "Testing the paragraph padding and margin.", + "type": "container", "padding": 10, + "modifiers": ["no-bottom-padding", "no-top-margin"], + "content": { + "parts": [ + { + "type": "paragraph", "modifiers": ["no-top-margin"], + "content": {"en": "container.p10.no-bottom-padding.no-top-margin > gallery > ..."} + },{ + "type": "gallery", "modifiers": [], + "content": { + "parts": [ + { + "type": "paragraph", "modifiers": ["no-top-margin"], + "content": {"en": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget tempus nisl."} + }, + { + "type": "paragraph", "modifiers": ["no-top-margin"], + "content": {"en": "Donec et sollicitudin tortor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus."} + }, + { + "type": "paragraph", "modifiers": ["no-top-margin"], + "content": {"en": "Nullam iaculis nec ex quis tincidunt. Cras mattis magna magna, id laoreet elit pharetra in. Cras lacinia tempus tincidunt."} + } + ] + } + } + ] + } + }, + + {"type": "hr"}, + + { + "_": "Testing tables", + "type": "container", "padding": 10, + "modifiers": ["no-bottom-padding", "no-top-margin"], + "content": { + "parts": [ + { + "type": "paragraph", "modifiers": ["no-top-margin"], + "content": {"en": "container.p10.no-bottom-padding.no-top-margin > table.striped.inner-bordered"} + },{ + "type": "table", + "modifiers": ["striped", "inner-bordered"], + "head": [ + {"en": "Column 1"}, {"en": "Column 2"}, {"en": "Column 3"}, {"en": "Column 4"} + ], + "body": [ + [{"en": "Data 1"}, {"en": "Data 2"}, {"en": "Data 3"}, {"en": "Data 4"}], + [{"en": "Data 5"}, {"en": "Data 6"}, {"en": "Data 7"}, {"en": "Data 8"}] + ] + } + ] + } + }, + + {"type": "hr"}, + + { + "_": "Testing tables", + "type": "container", "padding": 10, + "modifiers": ["no-bottom-padding", "no-top-margin"], + "content": { + "parts": [ + { + "type": "paragraph", "modifiers": ["no-top-margin"], + "content": {"en": "container.p10.no-bottom-padding.no-top-margin > table.striped.inner-bordered.outer-bordered"} + },{ + "type": "table", + "modifiers": ["striped", "inner-bordered", "outer-bordered"], + "head": [ + {"en": "Column 1"}, {"en": "Column 2"}, {"en": "Column 3"}, {"en": "Column 4"} + ], + "body": [ + [{"en": "Data 1"}, {"en": "Data 2"}, {"en": "Data 3"}, {"en": "Data 4"}], + [{"en": "Data 5"}, {"en": "Data 6"}, {"en": "Data 7"}, {"en": "Data 8"}] + ] + } + ] + } + }, + + {"type": "hr"}, + + { + "_": "Testing tables", + "type": "container", "padding": 10, + "modifiers": ["no-bottom-padding", "no-top-margin"], + "content": { + "parts": [ + { + "type": "paragraph", "modifiers": ["no-top-margin"], + "content": {"en": "container.p10.no-bottom-padding.no-top-margin > container.p0.card?horizontal-scroll > table.striped.inner-bordered"} + }, + { + "_": "Testing tables", + "type": "container", "padding": 0, + "modifiers": ["no-bottom-padding", "no-top-margin", "card"], + "content": { + "parts": [ + { + "type": "table", + "modifiers": ["striped", "inner-bordered"], + "head": [ + {"en": "Column 1"}, {"en": "Column 2"}, {"en": "Column 3"}, {"en": "Column 4"} + ], + "body": [ + [{"en": "Data 1"}, {"en": "Data 2"}, {"en": "Data 3"}, {"en": "Data 4"}], + [{"en": "Data 5"}, {"en": "Data 6"}, {"en": "Data 7"}, {"en": "Data 8"}] + ] + } + ] + } + }, + + {"type": "spacer", "size": 2}, + + { + "_": "Testing tables", + "type": "container", "padding": 0, + "modifiers": ["no-bottom-padding", "no-top-margin", "card", "horizontal-scroll"], + "content": { + "parts": [ + { + "type": "table", + "modifiers": ["striped", "inner-bordered"], + "head": [ + {"en": "Column 1"}, {"en": "Column 2"}, {"en": "Column 3"}, {"en": "Column 4"}, {"en": "Column 5"}, {"en": "Column 6"} + ], + "body": [ + [{"en": "Data 1"}, {"en": "Data 2"}, {"en": "Data 3"}, {"en": "Data 4"}, {"en": "Data 5"}, {"en": "Data 6"}], + [{"en": "Data 7"}, {"en": "Data 8"}, {"en": "Data 9"}, {"en": "Data 10"}, {"en": "Data 11"}, {"en": "Data 12"}] + ] + } + ] + } + } + ] + } + }, + + {"type": "spacer", "size": 2} + ], + + "tags": ["test"] +} diff --git a/resources/Azias/css/nibblepoker.lu.css b/resources/Azias/css/nibblepoker.lu.css index b44bbd2..c14f527 100644 --- a/resources/Azias/css/nibblepoker.lu.css +++ b/resources/Azias/css/nibblepoker.lu.css @@ -51,6 +51,15 @@ img.no-save { .font-size-30 { font-size: 3.0rem!important; } +.font-size-30 { + font-size: 3.0rem!important; +} +.font-size-35 { + font-size: 3.5rem!important; +} +.font-size-40 { + font-size: 4.0rem!important; +} .text-super-muted { color: #89898A; } @@ -61,8 +70,8 @@ img.no-save { align-items: stretch; } .py-01 { - padding-top: 0.01rem; - padding-bottom: 0.01rem; + padding-top: 0.01rem!important; + padding-bottom: 0.01rem!important; } .hide-scrollbar::-webkit-scrollbar { display: none; @@ -71,6 +80,9 @@ img.no-save { -ms-overflow-style: none; scrollbar-width: none; } +.cursor-pointer { + cursor: pointer; +} /* Unique rules */ #copyright-text { @@ -113,6 +125,17 @@ hr, hr.dark-mde, hr.subtle { margin-bottom: 5px; } +/* Glider rules */ +.glider { + border: var(--card-border-width) solid var(--dm-card-border-color); + box-shadow: inset 1px 0 25px 5px rgba(0, 0, 0, 0.1); + border-radius: 5px; +} +.glider-nav { + cursor: pointer; + height: 100%; +} + /* Content */ /* Content > Search */ @media (max-width: 992px) { @@ -213,3 +236,17 @@ div.last-inner-collapse-border-fix { code.w-full { white-space: pre; } + +/* Temporary */ +/*.glider >div { + border: 1px solid yellow; +} +.t01 > div { + border: 1px solid cyan; +} +.glider > div > * { + border: 1px solid green; +} +.glider, .t01 { + border: 1px solid deeppink !important; +}/**/ diff --git a/resources/Azias/js/nibblepoker.lu.js b/resources/Azias/js/nibblepoker.lu.js index f9a5ac2..6ca1883 100644 --- a/resources/Azias/js/nibblepoker.lu.js +++ b/resources/Azias/js/nibblepoker.lu.js @@ -23,3 +23,35 @@ if(document.getElementById('button-copy-tox-id-backup') != null) { navigator.clipboard.writeText("01ABBD4515C8FA56231333D1022CEEE0A605F4E85F8A945365F56D196A1BBA10FB4DCE08DBE8"); }); } + +// Creating the galleries from Glider.js +window.addEventListener('load', function(){ + document.querySelectorAll(".glider").forEach(element => { + new Glider(element, { + slidesToShow: 1, + draggable: true, + scrollLock: true, + scrollLockDelay: 125, + rewind: true, + arrows: { + prev: element.previousSibling, + next: element.nextSibling + }, + responsive: [ + { + breakpoint: 768, + settings: { + slidesToShow: 2, + duration: 0.25 + } + },{ + breakpoint: 992, + settings: { + slidesToShow: 3, + slidesToScroll: 1 + } + } + ] + }); + }); +}) \ No newline at end of file