Fixed code copy button scrolling, Added build script

Update .gitignore, composer.php, and compress.bat
This commit is contained in:
2023-12-22 04:21:23 +01:00
parent 446d6e529a
commit 96e1674937
3 changed files with 75 additions and 4 deletions

3
.gitignore vendored
View File

@@ -19,6 +19,9 @@ resources/NibblePoker/css/*.css
tools/items/formula-wizard/*.js
tools/items/formula-wizard/src/*.js
# Build artifacts
build*.7z
# ???
# Source: https://github.com/sjmulder/nbt-js
tools/items/mc-art-viewer/nbt.js

View File

@@ -756,9 +756,9 @@ class ComposerElement {
// Defining the highlight language.
$_language_class = is_null($this->codeLanguage) ? "nohighlight" : "language-" . $this->codeLanguage;
if($this->codeCopyable) {
$_language_class .= ' p-relative';
}
// Parent container with a relative position to handle the wedge when the code itself is
// horizontally scrollable.
$htmlCode .= '<div class="p-relative">';
// Opening the code element.
// Note: The "mt-10" may have to be removed if it clashes with 'no-margin-top' !
@@ -776,7 +776,7 @@ class ComposerElement {
}
if($this->codeCopyable) {
$htmlCode .= '<div class="wedge wedge-tr primary js-code-copy border border-t-0 border-r-0 rbl-m p-xxxs px-xs wedge-shadow" hidden>';
$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");
$htmlCode .= '</div>';
}
@@ -784,6 +784,9 @@ class ComposerElement {
// Closing code element.
$htmlCode .= '</div>';
// Closing super container.
$htmlCode .= '</div>';
break;
case ComposerElementTypes::HR:

65
compress.bat Normal file
View File

@@ -0,0 +1,65 @@
@echo off
setlocal enabledelayedexpansion
:: Going into the script's directory
cd /D "%~dp0"
:compile
::call "%~dp0compile.bat"
:compile-end
:: Source: https://stackoverflow.com/q/1192476
set NP_ZIP_NAME=build_%date:~-4%-%date:~3,2%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%
::echo %NP_ZIP_NAME%
::goto end
:: TMP
del /Q /S /F tmp01.7z 2> nul 1> nul
:archive
echo.
echo Handling the 'Formula Wizard'
echo -----------------------------
:archive-env
echo Preparing environment variable...
set NP_ZIP_CONTENT=
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "about/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "commons/*.php" "commons/strings.json" "commons/DOM/" "commons/content/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "content/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "contributors/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "links/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "privacy/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/HighlightJS/highlight.min.js" "resources/HighlightJS/src/styles/atom-one-dark.min.css"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/css/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*.png"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*.jpg"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*.jpeg"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*.svg"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*.webp"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*/*.png"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*/*.jpg"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*/*.jpeg"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*/*.svg"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*/*.webp"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*/*/*.png"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*/*/*.jpg"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*/*/*.jpeg"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*/*/*.svg"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/images/*/*/*.webp"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/js/*.min.js"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/NibblePoker/sounds/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/Quantum/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/SplideJs/dist/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "./.htaccess" "./*.php" "./favicon.*"
echo ^>%NP_ZIP_CONTENT%
:archive-7z
echo Making '.7z' archive...
7z a -mx9 "./%NP_ZIP_NAME%.7z" %NP_ZIP_CONTENT%
:archive-end
:end