Last active
May 5, 2016 21:07
-
-
Save zach2825/6c83c2b8e9232a174e8a9eddf995bb9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{-- | |
Author: Zach Robicahud | |
Company: Turtlebytes LLC | |
Email: Zach.Robcihaud@turtlebytes.com | |
Description: This file utilizes toastr. To generate a beautiful popup message generated using Session::flash | |
Reference link: http://codeseven.github.io/toastr/demo.html | |
--}} | |
@if ($message = Session::get('success')) | |
@if(is_array($message)) | |
@foreach ($message as $m) | |
<script type="text/javascript">$(function () { | |
toastr['success']('{{{ $m }}}') | |
});</script> | |
@endforeach | |
@else | |
<script type="text/javascript">toastr['success']('{{{ $message }}}')</script> | |
@endif | |
@endif | |
@if( isset($error) && $message = $error) | |
@if(is_array($message)) | |
@foreach ($message as $m) | |
<script type="text/javascript">toastr['error']('{{{ $m }}}', null, { | |
"closeButton": true, | |
"debug": false, | |
"newestOnTop": false, | |
"progressBar": true, | |
"positionClass": "toast-top-center", | |
"preventDuplicates": true, | |
"showDuration": "900", | |
"hideDuration": "1000", | |
"timeOut": 0, | |
"extendedTimeOut": 0, | |
"showEasing": "swing", | |
"hideEasing": "linear", | |
"showMethod": "fadeIn", | |
"hideMethod": "fadeOut", | |
"tapToDismiss": false | |
})</script> | |
@endforeach | |
@else | |
<script type="text/javascript">toastr['error']('{{{ $message }}}', null, { | |
"closeButton": true, | |
"debug": false, | |
"newestOnTop": false, | |
"progressBar": true, | |
"positionClass": "toast-top-center", | |
"preventDuplicates": true, | |
"showDuration": "900", | |
"hideDuration": "1000", | |
"timeOut": 0, | |
"extendedTimeOut": 0, | |
"showEasing": "swing", | |
"hideEasing": "linear", | |
"showMethod": "fadeIn", | |
"hideMethod": "fadeOut", | |
"tapToDismiss": false | |
})</script> | |
@endif | |
@elseif ($message = Session::get('error')) | |
@if(is_array($message)) | |
@foreach ($message as $m) | |
<script type="text/javascript"> | |
toastr['error']('{{{ $m }}}', null, { | |
"closeButton": true, | |
"debug": false, | |
"newestOnTop": false, | |
"progressBar": true, | |
"positionClass": "toast-top-center", | |
"preventDuplicates": true, | |
"showDuration": "900", | |
"hideDuration": "1000", | |
"timeOut": 0, | |
"extendedTimeOut": 0, | |
"showEasing": "swing", | |
"hideEasing": "linear", | |
"showMethod": "fadeIn", | |
"hideMethod": "fadeOut", | |
"tapToDismiss": false | |
}) | |
</script> | |
@endforeach | |
@else | |
<script type="text/javascript">toastr['error']('{{{ $message }}}', null, { | |
"closeButton": true, | |
"debug": false, | |
"newestOnTop": false, | |
"progressBar": true, | |
"positionClass": "toast-top-center", | |
"preventDuplicates": true, | |
"showDuration": "900", | |
"hideDuration": "1000", | |
"timeOut": 0, | |
"extendedTimeOut": 0, | |
"showEasing": "swing", | |
"hideEasing": "linear", | |
"showMethod": "fadeIn", | |
"hideMethod": "fadeOut", | |
"tapToDismiss": false | |
})</script> | |
@endif | |
@endif | |
@if( isset($warning) && $message = $warning) | |
@if(is_array($message)) | |
@foreach ($message as $m) | |
<script type="text/javascript">toastr['warning']('{{{ $m }}}')</script> | |
@endforeach | |
@else | |
<script type="text/javascript">toastr['warning']('{{{ $message }}}')</script> | |
@endif | |
@elseif ($message = Session::get('warning')) | |
@if(is_array($message)) | |
@foreach ($message as $m) | |
<script type="text/javascript">toastr['warning']('{{{ $m }}}')</script> | |
@endforeach | |
@else | |
<script type="text/javascript">toastr['warning']('{{{ $message }}}')</script> | |
@endif | |
@endif | |
@if( isset($notice) && $message = $notice) | |
@if(is_array($message)) | |
@foreach ($message as $m) | |
<script type="text/javascript">toastr['info']('{{{ $m }}}')</script> | |
@endforeach | |
@else | |
<script type="text/javascript">toastr['info']('{{{ $message }}}')</script> | |
@endif | |
@elseif ($message = Session::get('info', Session::get('notice'))) | |
@if(is_array($message)) | |
@foreach ($message as $m) | |
<script type="text/javascript">toastr['info']('{{{ $m }}}')</script> | |
@endforeach | |
@else | |
<script type="text/javascript">toastr['info']('{{{ $message }}}')</script> | |
@endif | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment