Added scripts for content, Improved tables and buttons

Update scripts.php, sidebar.php, and 20 more files...
This commit is contained in:
2023-05-24 07:04:00 +02:00
parent 3cadb29be5
commit d5ea7e369b
22 changed files with 302 additions and 130 deletions

View File

@@ -12,7 +12,15 @@ if($enable_glider) {
if($enable_code_highlight) {
echo('<script src="/resources/HighlightJS/11.6.0/highlight.min.js"></script>');
echo('<script src="/resources/HighlightJS/11.6.0/languages/csharp.min.js"></script>');
//echo('<script src="/resources/Azias/js/code-highlighter.js"></script>');
}
?>
<script src="/resources/NibblePoker/js/nibblepoker.min.js"></script>
<script src="/resources/NibblePoker/js/nibblepoker.min.js"></script>
<?php
if($enable_glider) {
// FIXME: Find out why the minified version is broken. (Only displays 1 pic per scroll position)
echo('<script src="/resources/NibblePoker/js/nibblepoker-glider.js"></script>');
}
if($enable_code_highlight) {
echo('<script src="/resources/NibblePoker/js/nibblepoker-code.min.js"></script>');
}
?>

View File

@@ -12,8 +12,8 @@ if(!isset($SIDEBAR_ID)) {
}
function printSidebarEntry($url, $title, $icon) {
echo('<a class="bland-link" href="' . $url . '" title="HTML5 anchor element"><p class="t-size-18 t-w-500 py-xs sidebar-entry">');
echo('<i class="' . $icon . ' pr-xs t-size-12"></i><span class="t-size-12">' . $title . '</span></p></a>');
echo('<a class="bland-link" href="' . $url . '"><p class="t-size-18 t-w-500 py-xs sidebar-entry">');
echo('<i class="' . $icon . ' pr-xs t-size-12 t-half-muted"></i><span class="t-size-12">' . $title . '</span></p></a>');
}
?>

View File

@@ -113,8 +113,9 @@ abstract class ComposerElementModifiers {
const TABLE_HOVER = ["hover", "table-hover"];
const TABLE_INNER_BORDER = ["inner-bordered", "table-inner-bordered"];
const TABLE_OUTER_BORDER = ["outer-bordered", "table-outer-bordered"];
const TABLE_V2_STYLISH = ["stylish", "stylish"];
const TABLE_V2_STYLISH = ["stylish", "stylish r-s border o-hidden"];
const TABLE_V2_CELL_PADDING = ["auto-cell-padding", "table-p-xs"];
const TABLE_V2_VERTICAL_ALIGN = ["v-center-cells", "table-v-center"];
// Code
const CODE_BLOCK = ["code-block", "w-full d-inline-block"];
@@ -646,7 +647,7 @@ class ComposerElement {
// Setting up the link and its title if needed.
if(!is_null($this->link)) {
$htmlCode .= '<a href="' . $this->link . '"' .
($this->type == ComposerElementTypes::BUTTON ? 'class="button-link"' : '') .'>';
($this->type == ComposerElementTypes::BUTTON ? 'class="bland-link button-link"' : '') .'>';
}
switch($this->type) {
@@ -726,7 +727,7 @@ class ComposerElement {
case ComposerElementTypes::BUTTON:
// Composing the button.
$htmlCode .= '<button class="btn ' . (is_null($this->color) ? '' : 'btn-' . $this->color . ' ') .
$htmlCode .= '<button class="p-mxs r-s border b-light ' . (is_null($this->color) ? '' : 'btn-' . $this->color . ' ') .
$this->get_modifiers_classes() . '">' . $this->get_inner_html($content_root) . '</button>';
break;

View File

@@ -93,6 +93,20 @@ if($requested_content_display_type == ContentDisplayType::SEARCH) {
$content_error_message_key = "content.error.message.detect.empty";
goto content_end;
}
// Sorting entries based on their priority
for($i = 0; $i < count($filtered_content_index_data); $i++) {
if(!isset($filtered_content_index_data[$i]["priority"])) {
$filtered_content_index_data[$i]["priority"] = 0;
}
}
usort($filtered_content_index_data, function ($a, $b) {
if($a["priority"] == $b["priority"]) {
return 0;
}
return ($a["priority"] > $b["priority"]) ? -1 : 1;
});
} else if($requested_content_display_type == ContentDisplayType::CONTENT) {
// Sanitizing the requested ID.
if(!ctype_alnum(str_replace("-", "", $content_requested_url_part))) {
@@ -128,62 +142,4 @@ content_end:
// TODO: Create error thingy
$content_error_message = localize($content_error_message_key);
// These functions are placed here to prevent the main file from becoming impossible to read.
function start_content_card($iconClasses, $title, $subTitle) {
echo('<div class="card p-0 mx-0"><div class="px-card py-10 border-bottom px-20"><div class="container-fluid">');
echo('<h2 class="card-title font-size-18 m-0"><i class="'.$iconClasses.'"></i>&nbsp;&nbsp;'.localize($title));
echo('<span class="card-title font-size-18 m-0 text-super-muted float-right hidden-xs-and-down">'.$subTitle.'</span></h2>');
echo('</div></div>');
}
function end_content_card() {
echo('</div>');
}
// FIXME: What is this, should it be removed ?
/*
switch($elementNode["type"]) {
case "image":
// Parsing properties.
$_imgAlt = "";
$_imgSource = "/resources/Azias/imgs/placeholder.png";
if(array_key_exists("alt", $elementNode)) {
$_imgAlt = $elementNode["alt"];
}
if(array_key_exists("src", $elementNode)) {
$_imgSource = $elementNode["src"];
}
// Reading and processing the modifiers.
$_modFillHeight = false;
if(array_key_exists("modifiers", $elementNode)) {
for ($i = 0; $i < count($elementNode["modifiers"]); $i++) {
if ($elementNode["modifiers"][$i] == "fill-height") {
$_modFillHeight = true;
}
}
}
// Adding element.
echo('<img class="'.($_modFillHeight?'fill-height':'').'" src="'.$_imgSource.'" alt="'.$_imgAlt.'">');
break;
case "slider":
case "glider":
case "gallery":
// Starting the gallery
echo('<div class="glider-container d-flex">');
echo('<div class="align-self-stretch font-size-40 mr-5 my-auto glider-nav" aria-label="Previous">');
echo('<i class="fad fa-angle-left"></i></div>');
echo('<div class="glider align-self-stretch flex-fill">');
// Adding content.
processStandardContentSubNode($elementNode, "<div>", "</div>");
// Ending the gallery
echo('</div><div class="align-self-stretch font-size-40 ml-5 my-auto glider-nav" aria-label="Next">');
echo('<i class="fad fa-angle-right"></i></div></div>');
break;
}/**/
?>

File diff suppressed because one or more lines are too long

View File

@@ -9,7 +9,12 @@
"content.search.count.single": "result",
"content.search.count.multiple": "results",
"content.header.base" : "Content",
"content.search.header" : "Search",
"content.error.header" : "Error",
"_content.item.header" : "",
"content.error.head.title": "Content error - NibblePoker",
"_content.error.head.description": "Done via the '$content_error_message' variable",
"content.error.og.title": "NibblePoker - Content error",