diff --git a/app/Lib/Utils.php b/app/Lib/Utils.php index 061afa8..d2f3bf7 100644 --- a/app/Lib/Utils.php +++ b/app/Lib/Utils.php @@ -24,7 +24,7 @@ class Utils if (\strpos($url, 'http') === false and \strpos($url, 'https') === false) { $url = sprintf('http://%s', $url); } - $fsligthbox = self::isImageFile($url) ? 'data-fslightbox' : ''; + $fsligthbox = self::isImageFile($url) ? 'data-fslightbox="gallery"' : ''; return strlen($match) ? "$match" : $match; } }, @@ -36,6 +36,6 @@ class Utils public static function isImageFile(string $url): bool { $m = []; - return \preg_match('/(.png|.jpg|.jpeg|.gif)$/', $url, $m) === 1; + return \preg_match('/(\.png|\.jpg|\.jpeg|\.gif)$/', $url, $m) === 1; } } diff --git a/package.json b/package.json index d9270d2..7a09662 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "axios": "^0.21.1", "cross-env": "^7.0", "fslightbox": "^3.2.3", - "jquery": "^3.2", "laravel-mix": "^6.0.16", "laravel-mix-polyfill": "^3.0.1", "lodash": "^4.17.19", diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index fdb2696..3997bc7 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -6,12 +6,6 @@ window._ = require('lodash'); * code may be modified to fit the specific needs of your application. */ -try { - window.$ = window.jQuery = require('jquery'); - - require('fslightbox'); -} catch (e) {} - /** * We'll load the axios HTTP library which allows us to easily issue requests * to our Laravel back-end. This library automatically handles sending the @@ -69,3 +63,5 @@ vues.keys().map(key => ); const app = new Vue(vueOptions); + +require('fslightbox'); diff --git a/resources/views/layout/app.blade.php b/resources/views/layout/app.blade.php index 5f9240b..e611d89 100644 --- a/resources/views/layout/app.blade.php +++ b/resources/views/layout/app.blade.php @@ -99,6 +99,7 @@