Save workspace changes
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<script>
|
||||
(() => {
|
||||
const forms = document.querySelectorAll('[data-bot-form]');
|
||||
if (!forms.length || !window.crypto?.subtle) {
|
||||
return;
|
||||
}
|
||||
|
||||
const readWebglVendor = () => {
|
||||
try {
|
||||
const canvas = document.createElement('canvas');
|
||||
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
||||
if (!gl) {
|
||||
return 'no-webgl';
|
||||
}
|
||||
|
||||
const extension = gl.getExtension('WEBGL_debug_renderer_info');
|
||||
if (!extension) {
|
||||
return 'webgl-hidden';
|
||||
}
|
||||
|
||||
return [
|
||||
gl.getParameter(extension.UNMASKED_VENDOR_WEBGL),
|
||||
gl.getParameter(extension.UNMASKED_RENDERER_WEBGL),
|
||||
].join(':');
|
||||
} catch {
|
||||
return 'webgl-error';
|
||||
}
|
||||
};
|
||||
|
||||
const fingerprintPayload = [
|
||||
navigator.userAgent || 'unknown-ua',
|
||||
navigator.language || 'unknown-language',
|
||||
navigator.platform || 'unknown-platform',
|
||||
Intl.DateTimeFormat().resolvedOptions().timeZone || 'unknown-timezone',
|
||||
`${window.screen?.width || 0}x${window.screen?.height || 0}x${window.devicePixelRatio || 1}`,
|
||||
readWebglVendor(),
|
||||
].join('|');
|
||||
|
||||
const encodeHex = (buffer) => Array.from(new Uint8Array(buffer))
|
||||
.map((part) => part.toString(16).padStart(2, '0'))
|
||||
.join('');
|
||||
|
||||
window.crypto.subtle.digest('SHA-256', new TextEncoder().encode(fingerprintPayload))
|
||||
.then((buffer) => {
|
||||
const fingerprint = encodeHex(buffer);
|
||||
forms.forEach((form) => {
|
||||
const input = form.querySelector('input[name="_bot_fingerprint"]');
|
||||
if (input) {
|
||||
input.value = fingerprint;
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
})();
|
||||
</script>
|
||||
@@ -0,0 +1,61 @@
|
||||
@php
|
||||
$resolvedSeo = ($seo ?? null) instanceof \App\Support\Seo\SeoData
|
||||
? $seo->toArray()
|
||||
: (is_array($seo ?? null)
|
||||
? $seo
|
||||
: app(\App\Support\Seo\SeoFactory::class)->fromViewData(get_defined_vars()));
|
||||
|
||||
$jsonLdEntries = collect($resolvedSeo['json_ld'] ?? [])->filter(fn ($schema) => is_array($schema) && $schema !== [])->values();
|
||||
@endphp
|
||||
<title>{{ $resolvedSeo['title'] ?? config('seo.default_title', 'Skinbase') }}</title>
|
||||
@if(!empty($resolvedSeo['description']))
|
||||
<meta name="description" content="{{ $resolvedSeo['description'] }}" />
|
||||
@endif
|
||||
@if(config('seo.keywords_enabled', true) && !empty($resolvedSeo['keywords']))
|
||||
<meta name="keywords" content="{{ $resolvedSeo['keywords'] }}" />
|
||||
@endif
|
||||
@if(!empty($resolvedSeo['robots']))
|
||||
<meta name="robots" content="{{ $resolvedSeo['robots'] }}" />
|
||||
@endif
|
||||
@if(!empty($resolvedSeo['canonical']))
|
||||
<link rel="canonical" href="{{ $resolvedSeo['canonical'] }}" />
|
||||
@endif
|
||||
@if(!empty($resolvedSeo['prev']))
|
||||
<link rel="prev" href="{{ $resolvedSeo['prev'] }}" />
|
||||
@endif
|
||||
@if(!empty($resolvedSeo['next']))
|
||||
<link rel="next" href="{{ $resolvedSeo['next'] }}" />
|
||||
@endif
|
||||
|
||||
<meta property="og:site_name" content="{{ $resolvedSeo['og_site_name'] ?? config('seo.site_name', 'Skinbase') }}" />
|
||||
<meta property="og:type" content="{{ $resolvedSeo['og_type'] ?? 'website' }}" />
|
||||
@if(!empty($resolvedSeo['og_title']))
|
||||
<meta property="og:title" content="{{ $resolvedSeo['og_title'] }}" />
|
||||
@endif
|
||||
@if(!empty($resolvedSeo['og_description']))
|
||||
<meta property="og:description" content="{{ $resolvedSeo['og_description'] }}" />
|
||||
@endif
|
||||
@if(!empty($resolvedSeo['og_url']))
|
||||
<meta property="og:url" content="{{ $resolvedSeo['og_url'] }}" />
|
||||
@endif
|
||||
@if(!empty($resolvedSeo['og_image']))
|
||||
<meta property="og:image" content="{{ $resolvedSeo['og_image'] }}" />
|
||||
@endif
|
||||
@if(!empty($resolvedSeo['og_image_alt']))
|
||||
<meta property="og:image:alt" content="{{ $resolvedSeo['og_image_alt'] }}" />
|
||||
@endif
|
||||
|
||||
<meta name="twitter:card" content="{{ $resolvedSeo['twitter_card'] ?? config('seo.twitter_card', 'summary_large_image') }}" />
|
||||
@if(!empty($resolvedSeo['twitter_title']))
|
||||
<meta name="twitter:title" content="{{ $resolvedSeo['twitter_title'] }}" />
|
||||
@endif
|
||||
@if(!empty($resolvedSeo['twitter_description']))
|
||||
<meta name="twitter:description" content="{{ $resolvedSeo['twitter_description'] }}" />
|
||||
@endif
|
||||
@if(!empty($resolvedSeo['twitter_image']))
|
||||
<meta name="twitter:image" content="{{ $resolvedSeo['twitter_image'] }}" />
|
||||
@endif
|
||||
|
||||
@foreach($jsonLdEntries as $schema)
|
||||
<script type="application/ld+json">{!! json_encode($schema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG) !!}</script>
|
||||
@endforeach
|
||||
Reference in New Issue
Block a user