Finished copy button, Improved opengraph, Updated scripts

Update sidebar.php, composer.php, and 13 more files...
This commit is contained in:
2023-12-22 08:01:17 +01:00
parent c8c59c8271
commit fe72b3a62e
15 changed files with 78 additions and 31 deletions

View File

@@ -35,15 +35,11 @@ function printSidebarEntry($url, $title, $icon, $activeId) {
?>
<hr class="subtle">
<?php
printSidebarEntry(l10n_url_abs('/content/'), localize("sidebar.text.projects"), "fad fa-briefcase", "content");
?>
<div class="ml-m">
<?php
printSidebarEntry(l10n_url_abs('/content/?tags=application'), localize("sidebar.text.applications"), "fad fa-browser", "application");
//printSidebarEntry(l10n_url_abs('/content/'), localize("sidebar.text.projects"), "fad fa-briefcase", "content");
printSidebarEntry(l10n_url_abs('/content/?tags=application;web'), localize("sidebar.text.applications"), "fad fa-browser", "application");
printSidebarEntry(l10n_url_abs('/content/?tags=library'), localize("sidebar.text.libraries"), "fad fa-puzzle-piece", "library");
printSidebarEntry(l10n_url_abs('/content/?tags=electronic'), localize("sidebar.text.electronics"), "fad fa-microchip", "electronic");
//printSidebarEntry(l10n_url_abs('/content/?tags=electronic'), localize("sidebar.text.electronics"), "fad fa-microchip", "electronic");
?>
</div>
<?php
//<hr class="subtle">
//printSidebarEntry(l10n_url_abs('/tools/'), localize("sidebar.text.tools"), "fad fa-tools", "tools");
@@ -51,14 +47,10 @@ function printSidebarEntry($url, $title, $icon, $activeId) {
<hr class="subtle">
<?php
printSidebarEntry(l10n_url_abs('/links/'), localize("sidebar.text.links"), "fad fa-link", "links");
?>
<div class="ml-m">
<?php
printSidebarEntry("https://files.nibblepoker.lu/", localize("sidebar.text.downloads"), "fad fa-download", "");
//printSidebarEntry("https://git.nibblepoker.lu/", localize("sidebar.text.gitea"), "fad fa-code", "");
//printSidebarEntry("https://wiki.nibblepoker.lu/", localize("sidebar.text.wiki"), "fad fa-books", "");
?>
</div>
<hr class="subtle">
<?php
printSidebarEntry(l10n_url_abs('/about/'), localize("sidebar.text.about"), "fad fa-user", "about");

View File

@@ -777,8 +777,11 @@ class ComposerElement {
}
if($this->codeCopyable) {
$htmlCode .= '<div class="wedge wedge-tr primary js-code-copy border border-t-0 border-r-0 rbl-m rtr-s p-xxxs px-xs wedge-shadow" hidden>';
$htmlCode .= '<i class="fad fa-copy"></i> ' . localize("common.action.copy");
//border-t-0 border-r-0
$htmlCode .= '<div class="wedge wedge-tr primary js-code-copy border rbl-m rtr-s p-xxxs px-xs" hidden>';
$htmlCode .= '<i class="fad fa-copy"></i>&nbsp;';
$htmlCode .= '<span>' . localize("common.action.copy") . '</span>';
$htmlCode .= '<span hidden>' . localize("common.action.copied") . '</span>';
$htmlCode .= '</div>';
}

View File

@@ -1,3 +1,4 @@
{
"common.action.copy": "Copy"
"common.action.copy": "Copy",
"common.action.copied": "Copied"
}

View File

@@ -1,3 +1,4 @@
{
"common.action.copy": "Copier"
"common.action.copy": "Copier",
"common.action.copied": "Copié"
}

View File

@@ -46,6 +46,9 @@ if($contentManager->hasError) {
// Remark: The 'glider' and 'highlight.js' stylesheets are included here.
include 'commons/DOM/head.php';
$content_head_image = $host_uri . "/resources/NibblePoker/images/logos/v2_opengraph.png";
$content_head_image_type = "image/png";
// Preparing values for the head's tags.
if ($contentManager->hasError) {
$content_head_title = localize("content.error.head.title");
@@ -63,6 +66,36 @@ if($contentManager->hasError) {
$content->get_head_title() .
localize("content.item.og.title.suffix");
$content_head_og_description = $content->get_head_description();
if(!is_null($content->metadata->opengraph->image)) {
$content_head_image = $host_uri . $content->metadata->opengraph->image;
}
if(!is_null($content->metadata->opengraph->image_type)) {
$content_head_image_type = $content->metadata->opengraph->image_type;
} else {
switch(pathinfo($content_head_image, PATHINFO_EXTENSION)) {
case "png":
$content_head_image_type = "image/png";
break;
case "jpg":
case "jpeg":
$content_head_image_type = "image/jpeg";
break;
case "gif":
$content_head_image_type = "image/gif";
break;
case "svg":
$content_head_image_type = "image/svg+xml";
break;
case "webp":
$content_head_image_type = "image/webp";
break;
case "apng":
$content_head_image_type = "image/apng";
break;
}
}
} elseif($contentManager->displayType == ContentDisplayType::SEARCH) {
$content_head_title = localize("content.search.head.title");
$content_head_description = localize("content.search.head.description");
@@ -77,8 +110,8 @@ if($contentManager->hasError) {
<meta property="og:title" content="<?php echo($content_head_og_title); ?>"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="<?php echo($host_uri . l10n_url_abs('/')); ?>"/>
<meta property="og:image" content="<?php echo($host_uri); ?>/resources/NibblePoker/images/logos/v2_opengraph.png"/>
<meta property="og:image:type" content="image/png"/>
<meta property="og:image" content="<?php echo($content_head_image); ?>"/>
<meta property="og:image:type" content="<?php echo($content_head_image_type); ?>"/>
<meta property="og:description" content="<?php echo($content_head_og_description); ?>"/>
</head>
<body>

View File

@@ -92,7 +92,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/circuitpython-ebyte-e32/main.png",
"image_type": null
},
"article": {

View File

@@ -44,7 +44,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/dotnet-arguments/main.png",
"image_type": null
},
"article": {

View File

@@ -42,7 +42,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/excel-password-remover/excel-password-remover.png",
"image_type": null
},
"article": {

View File

@@ -16,7 +16,7 @@
"improvements.title": "Improvements over PB-ListComPort",
"improvements.1": "Switched from PureBasic to .NET 6.0.",
"improvements.2": "Improved a lot of the program's logic.",
"improvements.3": "Added the <code>-h/--short-help</code>.",
"improvements.3": "Added the <code>-H/--short-help</code>.",
"improvements.4": "Added support for Windows ARM & ARM64.",
"improvements.5": "Support for running without a console.",
"usage.title": "Usage",
@@ -53,7 +53,7 @@
"improvements.title": "Améliorations",
"improvements.1": "Changement de PureBasic vers .NET 6.0.",
"improvements.2": "Amélioration de la logique interne du programme.",
"improvements.3": "Ajout de l'option <code>-h/--short-help</code>.",
"improvements.3": "Ajout de l'option <code>-H/--short-help</code>.",
"improvements.4": "Support pour Windows ARM et ARM64.",
"improvements.5": "Support pour le lancement sans invité de commande.",
"usage.title": "Utilisation",
@@ -85,7 +85,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/lscom/lscom-v2-text-01-bkgd-cli.png",
"image_type": null
},
"article": {

View File

@@ -36,7 +36,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/lscom/lscom-legacy-simple.png",
"image_type": null
},
"article": {

View File

@@ -62,7 +62,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/mc-expanded-iron-bundles/item-icon.png",
"image_type": null
},
"article": {

View File

@@ -66,7 +66,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/yaa/icon-final.png",
"image_type": null
},
"article": {

View File

@@ -42,7 +42,24 @@ document.addEventListener("DOMContentLoaded", () => {
});
eCodeCopyButton.onclick = function() {
const eCodeCopySpans = eCodeCopyButton.querySelectorAll("span");
navigator.clipboard.writeText(code);
if(eCodeCopySpans.length < 2) {
return;
}
const eSpanCopy = eCodeCopySpans[0];
const eSpanCopied = eCodeCopySpans[1];
eSpanCopy.hidden = true;
eSpanCopied.hidden = false;
fadeOut(eSpanCopied, 600).then(r => {
eSpanCopy.hidden = false;
eSpanCopied.hidden = true;
});
};
eCodeCopyButton.hidden = false;

View File

@@ -45,6 +45,7 @@
audioPurr.volume = 0.075;
try {
audioPurr.load();
audioPurr.loop = true;
audioPurr.play();
} catch(DOMException) {
}

View File

@@ -14,6 +14,5 @@ window.addEventListener('load', function() {
}).mount();
} catch(err) {
console.log("Unable to setup Splide !");
console.log(err);
}
});