Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
DispatchCode authored and github-actions[bot] committed Dec 1, 2022
1 parent 5583dc1 commit d7fbd3c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
4 changes: 3 additions & 1 deletion src/Http/Livewire/Modals/ModalImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
class ModalImage extends Component
{
public $show;

public $path;

public $title;

protected $listeners = [
'showImageModal' => 'showImageModal',
'doCloseModal' => 'doCloseModal'
'doCloseModal' => 'doCloseModal',
];

public function mount($path = null, $title = null)
Expand Down
6 changes: 2 additions & 4 deletions src/LaravelShortcodePlusServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ public function configurePackage(Package $package): void

public function packageRegistered()
{
Route::prefix('shortcode-plus')->name('shortcode-plus.')->group(function ()
{
Route::get('/style.css', function ()
{
Route::prefix('shortcode-plus')->name('shortcode-plus.')->group(function () {
Route::get('/style.css', function () {
$contents = view('shortcode-plus::css.shortcodes')->render();

return response($contents, 200)->header('Content-Type', 'text/css');
Expand Down
5 changes: 2 additions & 3 deletions src/Parsers/Gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Murdercode\LaravelShortcodePlus\Parsers;

use Murdercode\LaravelShortcodePlus\Helpers\ConfigHelper;
use Murdercode\LaravelShortcodePlus\Helpers\ModelHelper;
use Murdercode\LaravelShortcodePlus\Helpers\Sanitizer;
use Murdercode\LaravelShortcodePlus\Helpers\ConfigHelper;

class Gallery
{
Expand All @@ -14,8 +14,7 @@ public static function parse(string $content): string

return preg_replace_callback(
'/\[gallery title="(.*?)" images="(.*?)"\]/',
function ($matches) use ($enable_modal)
{
function ($matches) use ($enable_modal) {
$title = Sanitizer::escapeQuotes($matches[1]);

$imagesArray = explode(',', $matches[2]);
Expand Down
9 changes: 3 additions & 6 deletions src/Parsers/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

namespace Murdercode\LaravelShortcodePlus\Parsers;

use Murdercode\LaravelShortcodePlus\Helpers\ConfigHelper;
use Murdercode\LaravelShortcodePlus\Helpers\ModelHelper;
use Murdercode\LaravelShortcodePlus\Helpers\Sanitizer;

use Murdercode\LaravelShortcodePlus\Helpers\ConfigHelper;

class Image
{
public static function parse(string $content): string
Expand All @@ -15,16 +14,14 @@ public static function parse(string $content): string

return preg_replace_callback(
'/\[image id="(\d+)"(?:\scaption="(.*?)")?(?:(.*?))\]/',
function ($matches) use ($enable_modal)
{
function ($matches) use ($enable_modal) {
$id_image = $matches[1];
$caption = $matches[2] ? Sanitizer::escapeQuotes($matches[2]) : null;

$model = new ModelHelper('image');
$image = $model->getModelClass()::find($id_image);

if (!$image)
{
if (! $image) {
return 'Image not found';
}

Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ protected function setUp(): void
parent::setUp();

Factory::guessFactoryNamesUsing(
fn (string $modelName) => 'Murdercode\\LaravelShortcodePlus\\Database\\Factories\\' . class_basename($modelName) . 'Factory'
fn (string $modelName) => 'Murdercode\\LaravelShortcodePlus\\Database\\Factories\\'.class_basename($modelName).'Factory'
);

$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}

protected function getPackageProviders($app)
Expand Down

0 comments on commit d7fbd3c

Please sign in to comment.