├── .gitignore ├── LICENSE ├── README.md ├── composer.json ├── phpunit.xml ├── src └── Xuma │ ├── Amaran │ ├── AmaranHandler.php │ ├── AmaranServiceProvider.php │ ├── AmaranViewBinder.php │ ├── Assets │ │ ├── amaran.min.css │ │ └── jquery.amaran.min.js │ ├── Config │ │ └── amaran.php │ ├── Facades │ │ └── Amaran.php │ └── ViewBinder.php │ └── views │ └── javascript.blade.php └── travis.yml /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | composer.lock 3 | .idea 4 | .DS_Store -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Hakan ERSU 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AmaranJS Laravel 5 Package 2 | ========================== 3 | [![Laravel](https://img.shields.io/badge/Laravel-5.0-orange.svg?style=flat-square)](http://laravel.com) 4 | [![Source](http://img.shields.io/badge/source-hakanersu/amaranlaravel-blue.svg?style=flat-square)](https://github.com/hakanersu/amaran-laravel) 5 | [![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://tldrlegal.com/license/mit-license) 6 | 7 | [AmaranJS][1] L5 package is a Laravel wrapper for my jquery plugin [AmaranJS][1].You can create easy and stylish notifications with [AmaranJS][1]. 8 | 9 | Package Demo: http://ersu.me/laravel-amaranjs 10 | 11 | Installation 12 | ------------ 13 | Begin by installing the package through Composer. You can add your composer.json require section: 14 | ```json 15 | "xuma/laravel-amaran": "1.1.0" 16 | ``` 17 | Don't forget to update `composer update`. 18 | 19 | Once this operation is complete, simply add both the service provider and facade classes to your project's `config/app.php` file: 20 | 21 | #### Service Provider 22 | ```php 23 | Xuma\Amaran\AmaranServiceProvider::class, 24 | ``` 25 | #### Facade 26 | ```php 27 | 'Amaran' => Xuma\Amaran\Facades\Amaran::class, 28 | ``` 29 | 30 | #### Installing AmaranJS jQuery Plugin 31 | 32 | You can choose to install AmaranJS manually or you can publish assets. 33 | 34 | If you choose install manually, extract your [AmaranJS][1] files to public/ directory. You can find installation documentation of [AmaranJS][1] [here][1]. 35 | 36 | You can publish assets with below command and assets will be placed in /css, /js folders. 37 | 38 | ```php 39 | php artisan vendor:publish --provider="Xuma\Amaran\AmaranServiceProvider" --tag="assets" 40 | ``` 41 | 42 | #### Default configuration. 43 | 44 | If you want to use same configuration by default you can use configuration file. You can publish configuration file with below command. 45 | 46 | ```php 47 | php artisan vendor:publish --provider="Xuma\Amaran\AmaranServiceProvider" --tag="config" 48 | ``` 49 | 50 | #### Adding Output View 51 | 52 | Add required view after your jQuery and AmaranJS links. 53 | 54 | ```php 55 | @include('amaran::javascript') 56 | ``` 57 | 58 | Example: 59 | 60 | ```php 61 | 62 | 63 | @include('amaran::javascript') 64 | ``` 65 | 66 | Usage 67 | ----- 68 | 69 | Usage is very simple.If you want to use default theme; 70 | 71 | ```php 72 | Amaran::content(['message'=>'Hello World!'])->create(); 73 | ``` 74 | 75 | #### Using AmaranJS Functions 76 | 77 | You can use most [AmaranJS][1] functions as methods like : 78 | 79 | ```php 80 | Amaran::content([ 'message'=>'Hello World!']) 81 | ->position('top right') 82 | ->inEffect('slideRight') 83 | ->outEffect('slideBottom') 84 | ->sticky(true) 85 | ->create(); 86 | ``` 87 | 88 | #### Binding Javascript Events to Element 89 | You can define javascript events with `bind()` method 90 | ```php 91 | Amaran::content(['message'=>'Hello World!']) 92 | ->position('top right') 93 | ->bind('#start','click') 94 | - >create(); 95 | ``` 96 | 97 | #### Using as Flash Message 98 | Normally AmaranJS bind to current view but you can add ```->flash()``` method for bind to redirected methods view. 99 | 100 | ```php 101 | Amaran::content(['message'=>'Hello World'])->flash()->create(); 102 | ``` 103 | 104 | Theme Usage 105 | ----- 106 | 107 | Theme usage is simple just set theme name and set content as theme template array. 108 | ```php 109 | Amaran::theme('awesome ok')->content([ 110 | 'title'=>'My first funcy example!', 111 | 'message'=>'1.4 GB', 112 | 'info'=>'my_birthday.mp4', 113 | 'icon'=>'fa fa-download' 114 | ])->create(); 115 | ``` 116 | 117 | > Little note if you want to use awesome theme you have to include [font awesome][2]. 118 | 119 | [1]: https://github.com/hakanersu/AmaranJS 120 | [2]: http://fortawesome.github.io/Font-Awesome/icons/ 121 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xuma/laravel-amaran", 3 | "description": "Laravel 5 Notification", 4 | "keywords": ["stylish", "laravel", "notification"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Hakan ERSU", 9 | "email": "hakanersu@gmail.com" 10 | } 11 | ], 12 | "require": { 13 | "php": ">=5.4.0" 14 | }, 15 | "autoload": { 16 | "psr-0": { 17 | "Xuma\\Amaran": "src/" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./tests/ 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Xuma/Amaran/AmaranHandler.php: -------------------------------------------------------------------------------- 1 | 'default', 16 | 'sticky' => false 17 | ]; 18 | 19 | /** 20 | * jQuery event creator 21 | * @var array 22 | */ 23 | public $click = []; 24 | 25 | /** 26 | * Content must be filled with AmaranJS theme values. 27 | * Check documentation for AmaranJS themes. 28 | * @var array 29 | */ 30 | public $content = []; 31 | 32 | protected $viewBinder; 33 | 34 | protected $session; 35 | 36 | protected $flash = false; 37 | 38 | 39 | /** 40 | * @param ViewBinder $viewBinder 41 | * @param Store $session 42 | */ 43 | public function __construct(ViewBinder $viewBinder, Store $session) 44 | { 45 | $this->viewBinder = $viewBinder; 46 | 47 | $this->session = $session; 48 | 49 | if (file_exists(config_path('amaran.php'))) { 50 | $this->amaran = array_merge($this->amaran, config('amaran.frontend', [])); 51 | if(config('amaran.backend.flash', false)) { 52 | $this->flash(); 53 | } 54 | } 55 | } 56 | 57 | /** 58 | * Bind AmaranJS to view. 59 | */ 60 | public function create() 61 | { 62 | $script = "\n"; 66 | } else { 67 | $script .= "$.amaran(".json_encode($this->amaran)."); \n\t });\n\n"; 68 | } 69 | 70 | 71 | if ($this->flash) { 72 | $this->session->flash('amaranjs.content', $script); 73 | } else { 74 | $this->viewBinder->bind($script); 75 | } 76 | } 77 | 78 | /** 79 | * @param string $theme 80 | * @return $this 81 | */ 82 | public function theme($theme = 'default') 83 | { 84 | $this->amaran['theme'] = $theme; 85 | return $this; 86 | } 87 | 88 | /** 89 | * AmaranJS notification position 90 | * @param string $position 91 | * @return $this 92 | */ 93 | public function position($position = 'bottom right') 94 | { 95 | $this->amaran['position'] = $position; 96 | return $this; 97 | } 98 | 99 | /** 100 | * AmaranJS content for notification 101 | * @param string $content 102 | * @return $this 103 | */ 104 | public function content($content) 105 | { 106 | $this->amaran['content'] = $content; 107 | return $this; 108 | } 109 | 110 | /** 111 | * AmaranJS appear effect 112 | * @param string $ineffect 113 | * @return $this 114 | */ 115 | public function inEffect($ineffect) 116 | { 117 | $this->amaran['inEffect'] = $ineffect; 118 | return $this; 119 | } 120 | 121 | /** 122 | * AmaranJS make notification sticky 123 | * @return $this 124 | */ 125 | public function sticky() 126 | { 127 | $this->amaran['sticky'] = true; 128 | return $this; 129 | } 130 | 131 | /** 132 | * AmaranJS dissapper effect 133 | * @param $outEffect 134 | * @return $this 135 | */ 136 | public function outEffect($outEffect) 137 | { 138 | $this->amaran['outEffect'] = $outEffect; 139 | return $this; 140 | } 141 | 142 | public function flash() 143 | { 144 | $this->flash = true; 145 | return $this; 146 | } 147 | 148 | /** 149 | * @param bool $element 150 | * @param string $on 151 | * @return $this 152 | * @throws Exception 153 | */ 154 | public function bind($element = false, $on = 'click') 155 | { 156 | if (!$element) { 157 | throw new Exception("AmaranJS throwed this exception with \"Please set onClick element.( eq ->bind('#example'))\"", 1); 158 | } 159 | 160 | $this->click = [$element, $on]; 161 | 162 | return $this; 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /src/Xuma/Amaran/AmaranServiceProvider.php: -------------------------------------------------------------------------------- 1 | registerServices(); 24 | 25 | $this->registerResources(); 26 | } 27 | 28 | public function boot() 29 | { 30 | $this->publishes([ 31 | __DIR__.'/Assets/amaran.min.css' => public_path('/css/amaran.min.css'), 32 | __DIR__.'/Assets/jquery.amaran.min.js' => public_path('/js/jquery.amaran.min.js'), 33 | ], 'assets'); 34 | 35 | $this->publishes([ 36 | __DIR__.'/Config/amaran.php' => config_path('amaran.php') 37 | ], 'config'); 38 | } 39 | 40 | /** 41 | * Get the services provided by the provider. 42 | * 43 | * @return array 44 | */ 45 | public function provides() 46 | { 47 | return ['amaran']; 48 | } 49 | 50 | /** 51 | * Register the package services. 52 | * 53 | * @return void 54 | */ 55 | protected function registerServices() 56 | { 57 | $this->app->bind( 58 | 'Xuma\Amaran\ViewBinder', 59 | 'Xuma\Amaran\AmaranViewBinder' 60 | ); 61 | 62 | $this->app->singleton('amaran', function($app) { 63 | $binder = new AmaranViewBinder($app['events']); 64 | 65 | return $this->app->make('Xuma\Amaran\AmaranHandler'); 66 | }); 67 | } 68 | 69 | /** 70 | * Register the package resources. 71 | * 72 | * @return void 73 | */ 74 | protected function registerResources() 75 | { 76 | // Add a view namespace 77 | $this->app['view']->addNamespace('amaran', __DIR__.'/../views'); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/Xuma/Amaran/AmaranViewBinder.php: -------------------------------------------------------------------------------- 1 | event = $event; 17 | } 18 | 19 | /** 20 | * Bind the given JavaScript to the 21 | * view using Laravel event listeners 22 | * 23 | * @param $amaran The ready-to-go JS 24 | */ 25 | public function bind($amaran) 26 | { 27 | $this->event->listen("composing: amaran::javascript", function () use ($amaran) { 28 | echo $amaran; 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Xuma/Amaran/Assets/amaran.min.css: -------------------------------------------------------------------------------- 1 | .amaran-overlay{position:fixed;width:100%;height:100%;top:0;left:0;background:rgba(153,204,51,.9);display:block;z-index:777}.amaran-overlay .amaran-wrapper{z-index:9999} 2 | .amaran.awesome{width:300px;min-height:65px;background:#f3f3f3;color:#222;margin:15px;padding:5px 5px 5px 70px;font-family:"Open Sans",Helvetica,Arial,sans-serif;font-size:16px;font-weight:600;box-shadow:1px 1px 1px #000}.amaran.awesome .icon{width:50px;height:50px;position:absolute;top:50%;left:10px;background:#000;margin-top:-25px;border-radius:50%;text-align:center;line-height:50px;font-size:22px}.amaran.awesome p{padding:0;margin:0}.amaran.awesome p span{font-weight:300}.amaran.awesome p span.light{font-size:13px;display:block;color:#777}.amaran.awesome.ok p.bold{color:#178B13}.amaran.awesome.ok .icon{background-color:#178B13;color:#fff}.amaran.awesome.error p.bold{color:#D82222}.amaran.awesome.error .icon{background-color:#D82222;color:#fff}.amaran.awesome.warning p.bold{color:#9F6000}.amaran.awesome.warning .icon{background-color:#9F6000;color:#fff}.amaran.awesome.yellow p.bold{color:#CFA846}.amaran.awesome.yellow .icon{background-color:#CFA846;color:#fff}.amaran.awesome.blue p.bold{color:#2980b9}.amaran.awesome.blue .icon{background-color:#2980b9;color:#fff}.amaran.awesome.green p.bold{color:#27ae60}.amaran.awesome.green .icon{background-color:#27ae60;color:#fff}.amaran.awesome.purple p.bold{color:#5B54AA}.amaran.awesome.purple .icon{background-color:#5B54AA;color:#fff} 3 | .amaran.colorful{width:300px;min-height:45px;overflow:hidden;background-color:transparent;z-index:1}.amaran.colorful .colorful-inner{width:100%;min-height:45px;display:block;position:relative;background-color:#484860;padding:15px 25px 15px 15px;color:#fff;font-size:14px;border-bottom:1px solid rgba(0,0,0,.2);border-radius:4px}.amaran.colorful .amaran-close{color:#fff;z-index:2;top:8px;right:8px;text-align:center;line-height:18px}.amaran-wrapper.center .amaran.colorful{margin:0 auto} 4 | .amaran.default{width:300px;min-height:45px;background:#1B1E24;background:-webkit-linear-gradient(left,#111213,#111213 15%,#1b1e24 15%,#1b1e24);background:linear-gradient(to right,#111213,#111213 15%,#1b1e24 15%,#1b1e24);color:#fff;font-family:"Open Sans",Helvetica,Arial,sans-serif;font-size:13px;font-weight:300;margin:5px;overflow:hidden;border-bottom:1px solid #111213;border-radius:6px}.amaran.default .default-spinner{width:45px;min-height:45px;display:block;float:left;position:relative}.amaran.default .default-spinner span{width:18px;height:18px;background:#27ae60;display:block;border-radius:50%;position:absolute;top:50%;left:50%;margin-left:-11px;margin-top:-9px}.amaran.default .default-message{float:left}.amaran.default .default-message span{padding:3px;line-height:43px}.amaran.default .default-message:after{clear:both} 5 | @charset "UTF-8";.amaran-close,.amaran-sticky{height:20px;top:2px;cursor:pointer}.amaran-wrapper *{box-sizing:border-box}.amaran-wrapper{position:fixed;z-index:9999}.amaran-wrapper.top{top:0;bottom:auto}.amaran-wrapper.bottom{bottom:0;top:auto}.amaran-wrapper.left{left:0}.amaran-wrapper.right{right:0;left:auto}.amaran-wrapper.center{width:50%;height:50%;margin:auto;position:fixed;top:0;left:0;bottom:0;right:0}.amaran{width:200px;background:rgba(0,0,0,.7);padding:3px;color:#fff;border-radius:4px;display:none;font-size:13px;cursor:pointer;position:relative;text-align:left;min-height:50px;margin:10px}.amaran-close,.amaran-sticky{width:20px;display:block;position:absolute}.amaran-close{right:2px}.amaran-close:before{content:"x";color:#fff;font-weight:700;font-family:Arial,sans-serif;font-size:18px}.amaran-sticky{right:20px}.amaran-sticky:before{content:"●";color:#fff;font-weight:700;font-family:Arial,sans-serif;font-size:18px}.amaran-sticky.sticky:before{color:#27ae60} 6 | .amaran.tumblr{width:300px;min-height:45px;overflow:hidden;background-color:#fff;color:#444;border-radius:3px;box-shadow:0 1px 4px rgba(0,0,0,.3);z-index:1}.amaran.tumblr .title{position:relative;font-size:15px;line-height:15px;height:28px;padding:5px 10px;border-bottom:1px solid rgba(0,0,0,.1);font-weight:700;z-index:1}.amaran.tumblr .content{padding:5px}.amaran.tumblr .image{float:left}.amaran.tumblr .amaran-close{z-index:2}.amaran.tumblr .amaran-close:before{color:#000} 7 | .amaran.user{width:300px;min-height:100px;background:#f3f3f3;color:#222;margin:15px;font-family:"Open Sans",Helvetica,Arial,sans-serif;font-size:13px;font-weight:300;box-shadow:1px 1px 1px #000;border-radius:0;padding:0}.amaran.user .icon{width:100px;height:100px;position:relative;background:#000;float:left}.amaran.user img{max-width:100%}.amaran.user .info{padding-left:110px;padding-top:10px}.amaran.user b{display:block;font-size:16px}.amaran.user.blue{background:#2773ed;color:#fff}.amaran.user.yellow{background:#f4b300;color:#fff}.amaran.user.green{background:#78ba00;color:#fff} -------------------------------------------------------------------------------- /src/Xuma/Amaran/Assets/jquery.amaran.min.js: -------------------------------------------------------------------------------- 1 | (function(){!function(t,i,e,n){var o,a;return o=function(i){var e;e={position:"bottom right",content:" ",delay:3e3,sticky:!1,stickyButton:!1,inEffect:"fadeIn",outEffect:"fadeOut",theme:"default",themeTemplate:null,closeOnClick:!0,closeButton:!1,clearAll:!1,cssanimationIn:!1,cssanimationOut:!1,resetTimeout:!1,overlay:!1,overlayColor:"rgba(153,204,51,.9)",beforeStart:function(){},afterEnd:function(){},onClick:function(){},wrapper:".amaran-wrapper"},this.config=t.extend({},e,i),this.config.beforeStart(),this.init(),this.close()},o.prototype={init:function(){var i,e,n,o,s,r,c,h;c=null,h=null,n=this.config.position.split(" "),t(this.config.wrapper).length&&t(this.config.wrapper).hasClass(this.config.position)?(c=t(this.config.wrapper+"."+n[0]+"."+n[1]),s=c.find(".amaran-wrapper-inner")):(c=t("
",{"class":this.config.wrapper.substr(1,this.config.wrapper.length)+" "+this.config.position}).appendTo("body"),s=t("
",{"class":"amaran-wrapper-inner"}).appendTo(c)),"object"==typeof this.config.content?r=null!=this.config.themeTemplate?this.config.themeTemplate(this.config.content):a[this.config.theme.split(" ")[0]+"Theme"](this.config.content):(this.config.content={},this.config.content.message=this.config.message,this.config.content.color="#27ae60",r=a.defaultTheme(this.config.content)),i={"class":this.config.themeTemplate?"amaran "+this.config.content.themeName:this.config.theme&&!this.config.themeTemplate?"amaran "+this.config.theme:"amaran",html:this.buildHTML(r)},this.config.clearAll&&t(".amaran,.amaran-overlay").remove(),o=t("
",i).appendTo(s),"center"===n[0]&&this.centerCalculate(c,s),this.animation(this.config.inEffect,o,"show"),this.config.onClick&&(e=this,t(o).css({cursor:"default"}),t(o).on("click",function(i){return t(i.target).is(".amaran-close")||t(i.target).is(".amaran-sticky")?void i.preventDefault():void e.config.onClick()})),this.config.resetTimeout&&(e=this,t(o).on("mouseenter",function(){return e.resetTimeout()}),t(o).on("mouseleave",function(){return e.resumeTimeout(o)})),this.config.overlay&&t(".amaran-overlay").length<=0&&t("body").prepend('
'),this.config.stickyButton&&(e=this,t(o).find(".amaran-sticky").on("click",function(){return t(this).hasClass("sticky")?(e.resumeTimeout(o),t(this).removeClass("sticky")):(e.resetTimeout(),t(this).addClass("sticky"))})),this.config.sticky!==!0&&this.hideDiv(o)},resetTimeout:function(){var t;return t=this,clearTimeout(t.timeout)},resumeTimeout:function(t){var i;return i=this,i.timeout=setTimeout(function(){return i.animation(i.config.outEffect,t,"hide")},i.config.delay)},buildHTML:function(t){return this.config.closeButton&&(t=''+t),this.config.stickyButton&&(t=''+t),t},centerCalculate:function(t,i){var e,n,o;n=i.find(".amaran").length,o=i.height(),e=(t.height()-o)/2,i.find(".amaran:first-child").animate({"margin-top":e},200)},animation:function(t,i,e){return"fadeIn"===t||"fadeOut"===t?this.fade(i,e):"show"===t?this.cssanimate(i,e):this.slide(t,i,e)},fade:function(t,i){var e;return this.removeOverlay(),e=this,"show"===i?this.config.cssanimationIn?t.addClass("animated "+this.config.cssanimationIn).show():t.fadeIn():this.config.cssanimationOut?(t.addClass("animated "+this.config.cssanimationOut),t.css({"min-height":0,height:t.outerHeight()}),void t.animate({opacity:0},function(){t.animate({height:0},function(){e.removeIt(t)})})):(t.css({"min-height":0,height:t.outerHeight()}),void t.animate({opacity:0},function(){t.animate({height:0},function(){e.removeIt(t)})}))},removeIt:function(i){var e,n;clearTimeout(this.timeout),i.remove(),n=t(this.config.wrapper+"."+this.config.position.split(" ")[0]+"."+this.config.position.split(" ")[1]),e=n.find(".amaran-wrapper-inner"),"center"===this.config.position.split(" ")[0]&&this.centerCalculate(n,e),this.config.afterEnd()},getWidth:function(t){var i,e;return i=t.clone().hide().appendTo("body"),e=i.outerWidth()+i.outerWidth()/2,i.remove(),e},getInfo:function(i){var e,n;return e=i.offset(),n=t(this.config.wrapper).offset(),{t:e.top,l:e.left,h:i.height(),w:i.outerWidth(),wT:n.top,wL:n.left,wH:t(this.config.wrapper).outerHeight(),wW:t(this.config.wrapper).outerWidth()}},getPosition:function(e,n){var o,a,s;return o=this.getInfo(e),a=this.config.position.split(" ")[1],s={slideTop:{start:{top:-(o.wT+o.wH+2*o.h)},move:{top:0},hide:{top:-(o.t+2*o.h)},height:o.h},slideBottom:{start:{top:t(i).height()-o.wH+2*o.h},move:{top:0},hide:{top:t(i).height()-o.wH+2*o.h},height:o.h},slideLeft:{start:{left:"left"===a?1.5*-o.w:-t(i).width()},move:{left:0},hide:{left:"left"===a?1.5*-o.w:-t(i).width()},height:o.h},slideRight:{start:{left:"right"===a?1.5*o.w:t(i).width()},move:{left:0},hide:{left:"right"===a?1.5*o.w:t(i).width()},height:o.h}},s[n]?s[n]:0},slide:function(t,i,e){var n,o;return this.removeOverlay(),o=this.getPosition(i,t),"show"!==e?(n=this,i.animate(o.hide,function(){i.css({"min-height":0,height:o.height},function(){i.html(" ")})}).animate({height:0},function(){return n.removeIt(i)})):void i.show().css(o.start).animate(o.move)},removeOverlay:function(){return this.config.overlay&&t(".amaran").length<=1?t(".amaran-overlay").remove():void 0},close:function(){var i;return i=this,t("[data-amaran-close]").on("click",function(){i.animation(i.config.outEffect,t(this).closest("div.amaran"),"hide")}),!this.config.closeOnClick&&this.config.closeButton?void i.animation(i.config.outEffect,t(this).parent("div.amaran"),"hide"):void(this.config.closeOnClick&&t(".amaran").on("click",function(){i.animation(i.config.outEffect,t(this),"hide")}))},hideDiv:function(t){var i;i=this,i.timeout=setTimeout(function(){i.animation(i.config.outEffect,t,"hide")},i.config.delay)}},a={defaultTheme:function(t){var i;return i="","undefined"!=typeof t.color&&(i=t.color),"
"+t.message+"
"},awesomeTheme:function(t){return'

'+t.title+"

"+t.message+''+t.info+"

"},userTheme:function(t){return'
'+t.user+""+t.message+"
"},colorfulTheme:function(t){var i,e;return"undefined"!=typeof t.color&&(e=t.color),"undefined"!=typeof t.bgcolor&&(i=t.bgcolor),"
"+t.message+"
"},tumblrTheme:function(t){return'
'+t.title+'
'+t.message+"
"}},t.amaran=function(t){var i;return i=new o(t)},t.amaran.close=function(){return t(".amaran-wrapper").remove(),!1}}(jQuery,window,document)}).call(this); -------------------------------------------------------------------------------- /src/Xuma/Amaran/Config/amaran.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'theme' => 'default', 6 | 'position' => 'top right', 7 | 'inEffect' => 'slideRight', 8 | 'outEffect' => 'slideRight', 9 | 'sticky' => false 10 | ], 11 | 'backend' => [ 12 | 'flash' => false 13 | ] 14 | ]; 15 | -------------------------------------------------------------------------------- /src/Xuma/Amaran/Facades/Amaran.php: -------------------------------------------------------------------------------- 1 |