Skip to content

Commit

Permalink
Revert icon embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Sep 24, 2019
1 parent 9c37220 commit 21ebebd
Show file tree
Hide file tree
Showing 7 changed files with 1,032 additions and 340 deletions.
340 changes: 340 additions & 0 deletions panel/dist/img/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion panel/dist/js/app.js

Large diffs are not rendered by default.

340 changes: 340 additions & 0 deletions panel/public/img/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
345 changes: 342 additions & 3 deletions panel/public/index.html

Large diffs are not rendered by default.

336 changes: 0 additions & 336 deletions panel/src/components/Misc/Icons.vue

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/Cms/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Exception;
use Kirby\Http\Response;
use Kirby\Http\Uri;
use Kirby\Toolkit\F;
use Kirby\Toolkit\Dir;
use Kirby\Toolkit\View;
use Throwable;
Expand Down Expand Up @@ -36,6 +37,11 @@ public static function customCss(App $kirby)
return false;
}

public static function icons(App $kirby): string
{
return F::read($kirby->root('kirby') . '/panel/dist/img/icons.svg');
}

/**
* Links all dist files in the media folder
* and returns the link to the requested asset
Expand Down Expand Up @@ -97,6 +103,7 @@ public static function render(App $kirby)
'config' => $kirby->option('panel'),
'assetUrl' => $kirby->url('media') . '/panel/' . $kirby->versionHash(),
'customCss' => static::customCss($kirby),
'icons' => static::icons($kirby),
'pluginCss' => $plugins->url('css'),
'pluginJs' => $plugins->url('js'),
'panelUrl' => $uri->path()->toString(true) . '/',
Expand Down
2 changes: 2 additions & 0 deletions views/panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
Please enable JavaScript in your browser
</noscript>

<?= $icons ?>

<script>window.panel = <?= json_encode($options, JSON_UNESCAPED_SLASHES) ?></script>

<script src="<?= $assetUrl ?>/js/plugins.js" defer></script>
Expand Down

0 comments on commit 21ebebd

Please sign in to comment.