clean up code

This commit is contained in:
KHOUBZA Younes
2021-04-16 20:08:36 +02:00
parent 6d68aba671
commit 0b87deac73
6 changed files with 17 additions and 74 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
.idea/
vendor/
.idea
vendor
composer.lock
.phpunit.result.cache
.phpcs-cache
+2 -23
View File
@@ -2,31 +2,10 @@
return array(
'scripts' => array(
'https://cdnjs.cloudflare.com/ajax/libs/noty/3.1.4/noty.min.js',
'/vendor/flasher/flasher-noty.js',
),
'styles' => array(
'https://cdnjs.cloudflare.com/ajax/libs/noty/3.1.4/noty.min.css',
'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@0.1.3/dist/flasher-noty.min.js',
),
'styles' => array(),
'options' => array(
'layout' => 'topRight',
'theme' => 'mint',
'timeout' => 5000,
'progressBar' => true,
'animation.open' => 'noty_effects_open',
'animation.close' => 'noty_effects_close',
'sounds.sources' => array(),
'closeWith' => array('click'),
'sounds.volume' => 1,
'sounds.conditions' => array(),
'docTitle.conditions' => array(),
'modal' => false,
'id' => false,
'force' => false,
'queue' => 'global',
'killer' => false,
'container' => false,
'buttons' => array(),
'visibilityControl' => false,
),
);
-22
View File
@@ -1,22 +0,0 @@
PHPFlasher.addFactory('noty', (function () {
'use strict';
var exports = {};
exports.render = function (data) {
var notification = data.notification;
var options = {
text: notification.message,
type: notification.type,
...notification.options
}
new Noty(options).show();
};
exports.renderOptions = function (options) {
Noty.overrideDefaults(options);
};
return exports;
})());
+8 -1
View File
@@ -2,9 +2,11 @@
namespace Flasher\Noty\Laravel\ServiceProvider\Providers;
use Flasher\Laravel\ServiceProvider\ResourceManagerHelper;
use Flasher\Prime\Flasher;
use Flasher\Noty\Laravel\FlasherNotyServiceProvider;
use Flasher\Noty\Prime\NotyFactory;
use Flasher\Prime\Response\Resource\ResourceManager;
use Illuminate\Container\Container;
use Illuminate\Foundation\Application;
@@ -37,7 +39,6 @@ class Laravel implements ServiceProviderInterface
public function boot(FlasherNotyServiceProvider $provider)
{
$provider->publishes(array(flasher_path(__DIR__.'/../../Resources/config/config.php') => config_path('flasher_noty.php')), 'flasher-config');
$provider->publishes(array(flasher_path(__DIR__.'/../../Resources/public') => public_path(flasher_path('vendor/flasher'))), 'flasher-public');
}
/**
@@ -64,6 +65,12 @@ class Laravel implements ServiceProviderInterface
return $flasher;
});
$this->app->extend('flasher.resource_manager', function (ResourceManager $resourceManager) {
ResourceManagerHelper::process($resourceManager, 'noty');
return $resourceManager;
});
}
protected function appendToFlasherConfig()
+3 -24
View File
@@ -24,32 +24,11 @@ class FlasherNotyServiceProviderTest extends TestCase
$expected = array(
'scripts' => array(
'https://cdnjs.cloudflare.com/ajax/libs/noty/3.1.4/noty.min.js',
'/vendor/flasher/flasher-noty.js',
),
'styles' => array(
'https://cdnjs.cloudflare.com/ajax/libs/noty/3.1.4/noty.min.css',
'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@0.1.3/dist/flasher-noty.min.js',
),
'styles' => array(),
'options' => array(
'layout' => 'topRight',
'theme' => 'mint',
'timeout' => 5000,
'progressBar' => true,
'animation.open' => 'noty_effects_open',
'animation.close' => 'noty_effects_close',
'sounds.sources' => array(),
'closeWith' => array('click'),
'sounds.volume' => 1,
'sounds.conditions' => array(),
'docTitle.conditions' => array(),
'modal' => false,
'id' => false,
'force' => false,
'queue' => 'global',
'killer' => false,
'container' => false,
'buttons' => array(),
'visibilityControl' => false,
'timeout' => 5000,
),
);
+2 -2
View File
@@ -28,8 +28,8 @@
"license": "MIT",
"require": {
"php": ">=5.3",
"php-flasher/flasher-laravel": "^0.1",
"php-flasher/flasher-noty": "^0.1"
"php-flasher/flasher-laravel": "@dev",
"php-flasher/flasher-noty": "@dev"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.0|^6.0|^7.0|^8.0|^9.0",