Skip to content

Commit

Permalink
Format HTML and update extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
puleeno committed Sep 17, 2023
1 parent 5267385 commit 3a1a042
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/Constracts/Assets/AssetConstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public function isEnqueue(): bool;

public function enqueue();

public function renderTabCharacter($size = 1);

public function renderHtml();

public function isRendered(): bool;
Expand Down
6 changes: 6 additions & 0 deletions app/Core/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,14 @@ public function isRendered(): bool
return $this->isRendered;
}

public function renderTabCharacter($size = 1)
{
echo str_repeat("\t", $size);
}

public function renderHtml()
{
echo PHP_EOL;
$this->isRendered = true;
}
}
8 changes: 8 additions & 0 deletions app/Core/AssetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ function (AssetScriptConstract $item) {
if ($initScript->isRendered()) {
continue;
}
$initScript->renderTabCharacter(2);
$initScript->renderHtml();
}
}
Expand All @@ -222,13 +223,15 @@ public function printHeadAssets()
if ($css->isRendered()) {
continue;
}
$css->renderTabCharacter(2);
$css->renderHtml();
}

foreach ($this->getActiveBucket()->getJs(false, true) as $js) {
if ($js->isRendered()) {
continue;
}
$js->renderTabCharacter(2);
$js->renderHtml();
}
}
Expand All @@ -239,6 +242,7 @@ public function printExecuteHeadScripts()
if ($interalStyle->isRendered()) {
continue;
}
$interalStyle->renderTabCharacter(2);
$interalStyle->renderHtml();
}
$headExecScripts = $this->getEnqueueAssetsByType(
Expand All @@ -252,6 +256,7 @@ function (AssetScriptConstract $item) {
if ($executeScript->isRendered()) {
continue;
}
$executeScript->renderTabCharacter(2);
$executeScript->renderHtml();
}
}
Expand All @@ -269,6 +274,7 @@ function (AssetScriptConstract $item) {
if ($initScript->isRendered()) {
continue;
}
$initScript->renderTabCharacter(2);
$initScript->renderHtml();
}
}
Expand All @@ -279,6 +285,7 @@ public function printFooterAssets()
if ($js->isRendered()) {
continue;
}
$js->renderTabCharacter(2);
$js->renderHtml();
}
}
Expand All @@ -296,6 +303,7 @@ function (AssetScriptConstract $item) {
if ($executeScript->isRendered()) {
continue;
}
$executeScript->renderTabCharacter(2);
$executeScript->renderHtml();
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public static function createExtensionAssetUrl($extensionDirectory, $path, $minP
$extensionDirectoryUrl = str_replace(ROOT_PATH, '', $extensionDirectory);

return new AssetUrl(
sprintf('%s/%s', $extensionDirectoryUrl, $path),
!empty($minPath) ? sprintf('%s/%s', $extensionDirectoryUrl, $minPath) : null
implode(DIRECTORY_SEPARATOR, [$extensionDirectoryUrl, 'assets', $path]),
!empty($minPath) ? implode(DIRECTORY_SEPARATOR, [$extensionDirectoryUrl, 'assets', $minPath]) : null
);
}

Expand Down
2 changes: 1 addition & 1 deletion extensions/dashboard
2 changes: 1 addition & 1 deletion extensions/react
Submodule react updated from e7aab6 to 2ef5f8

0 comments on commit 3a1a042

Please sign in to comment.