From e86d34d1daa3c52f667945422d2335edf43454e0 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 4 Sep 2024 19:03:19 +0200 Subject: [PATCH] wip #7063 @1 --- .../views/fields/external_path.blade.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/resources/views/fields/external_path.blade.php b/src/resources/views/fields/external_path.blade.php index 76dbcc6..1104e48 100644 --- a/src/resources/views/fields/external_path.blade.php +++ b/src/resources/views/fields/external_path.blade.php @@ -1,5 +1,15 @@ $server) { + $field['default'] = ['server' => $i, 'path' => '']; + } +} + $empty = ['server' => '', 'path' => '']; $value = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? $empty; if ($value == '') { @@ -20,8 +30,6 @@ if (!isset($value['path'])) { $value['path'] = ''; } -$serversClass = $field['servers_model']; -$servers = $serversClass::getAllServers(); ?> @include('crud::fields.inc.wrapper_start') @@ -107,14 +115,14 @@ $servers = $serversClass::getAllServers(); function liveslugify(text) { return text .toString()// Cast to string (optional) - .replace(/\/+/g,'fwdslash') + .replace(/\/+/g, 'fwdslash') .normalize('NFKD') // The normalize() using NFKD method returns the Unicode Normalization Form of a given string. .replace(/\s+/g, '-') // Replace spaces with - .replace(/[^\w\-]+/g, '') // Remove all non-word chars -// .replace(/\_/g, '-') // Replace _ with - + // .replace(/\_/g, '-') // Replace _ with - .replace(/\-\-+/g, '-') // Replace multiple - with single - //.replace(/\-$/g, '') // Remove trailing - - .replace(/fwdslash/g,'/'); + .replace(/fwdslash/g, '/'); } $(function () { -- 2.39.5