init
This commit is contained in:
236 files changed
+24692
No files matched your search
@@ -0,0 +1,57 @@
|
||||
<link rel="preload" href="{{ asset('fonts/vazirmatn.woff2') }}" as="font" type="font/woff2" crossorigin>
|
||||
|
||||
<style>
|
||||
.fi-panel-studio .fi-wi-chart .fi-wi-chart-text-color {
|
||||
color: #574c53;
|
||||
}
|
||||
|
||||
.dark .fi-panel-studio .fi-wi-chart .fi-wi-chart-text-color {
|
||||
color: #d0c7ce;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
const family = 'Vazirmatn, sans-serif';
|
||||
const font = '500 13px Vazirmatn';
|
||||
const sample = 'آذر ۱۲۳۴۵۶۷۸۹۰';
|
||||
const labelFont = ({ chart }) => chart.options.font;
|
||||
const labelColor = ({ chart }) => chart.options.color;
|
||||
|
||||
window.filamentChartJsPlugins ??= [];
|
||||
window.filamentChartJsPlugins.push({
|
||||
id: 'porint-dashboard-typography',
|
||||
beforeInit(chart) {
|
||||
const options = chart.config.options;
|
||||
const needsFont = document.fonts && !document.fonts.check(font, sample);
|
||||
|
||||
options.font = { ...options.font, family: needsFont ? 'sans-serif' : family, size: 13, weight: 500 };
|
||||
|
||||
for (const scale of Object.values(options.scales ?? {})) {
|
||||
scale.ticks = { ...scale.ticks, font: labelFont, color: labelColor, padding: 7 };
|
||||
}
|
||||
|
||||
const legend = options.plugins?.legend;
|
||||
if (legend && legend.display !== false) {
|
||||
legend.labels = { ...legend.labels, font: labelFont, color: labelColor, padding: 16 };
|
||||
}
|
||||
|
||||
const tooltip = options.plugins?.tooltip;
|
||||
if (tooltip) {
|
||||
tooltip.bodyFont = labelFont;
|
||||
tooltip.titleFont = ({ chart }) => ({ ...chart.options.font, size: 14, weight: 650 });
|
||||
}
|
||||
|
||||
if (needsFont) {
|
||||
// A different family invalidates widths measured before the webfont loaded.
|
||||
document.fonts.load(font, sample).then((faces) => {
|
||||
if (!chart.canvas || !faces.length) return;
|
||||
|
||||
options.font.family = family;
|
||||
chart.update('resize');
|
||||
}).catch(() => {});
|
||||
}
|
||||
},
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
@@ -0,0 +1,11 @@
|
||||
<x-filament-panels::page>
|
||||
<form class="fi-sc-form" wire:submit="save">
|
||||
{{ $this->form }}
|
||||
|
||||
<div>
|
||||
<x-filament::button type="submit">
|
||||
{{ __('admin.footer.save') }}
|
||||
</x-filament::button>
|
||||
</div>
|
||||
</form>
|
||||
</x-filament-panels::page>
|
||||
@@ -0,0 +1,24 @@
|
||||
<script>
|
||||
document.addEventListener('livewire:init', () => {
|
||||
let expirationShown = false;
|
||||
|
||||
Livewire.interceptRequest(({ onError }) => {
|
||||
onError(({ response, body, preventDefault }) => {
|
||||
const expired = response.status === 419;
|
||||
const emptyResponse = response.ok && body.trim() === '';
|
||||
|
||||
if (!expired && !emptyResponse) return;
|
||||
|
||||
preventDefault();
|
||||
if (expired && expirationShown) return;
|
||||
expirationShown ||= expired;
|
||||
|
||||
const message = expired
|
||||
? @js(__('admin.livewire.expired'))
|
||||
: @js(__('admin.livewire.empty_response'));
|
||||
|
||||
if (window.confirm(message)) window.location.reload();
|
||||
});
|
||||
});
|
||||
}, { once: true });
|
||||
</script>
|
||||
@@ -0,0 +1 @@
|
||||
<span class="porint-wordmark" dir="ltr" role="img" aria-label="{{ filament()->getBrandName() }}">PORINT</span>
|
||||
Reference in new issue
Block a user