Commit ff8eb2be authored by Kevin Yumang's avatar Kevin Yumang

SERV-2286 - toastr changed to PNotify package. named Notification. WIP

parent f68674c6
...@@ -10,11 +10,10 @@ ...@@ -10,11 +10,10 @@
@section('Limitless::GlobalLogoDestinationUrl', 'https://google.de') @section('Limitless::GlobalLogoDestinationUrl', 'https://google.de')
@section('Limitless::Javascript') @section('Limitless::Javascript')
@Limitless::InitNotifications
<script src="{{ secure_url("/ceetrox/sidekick/resource/public/Elements/notification/notification.sample.js") }}" defer></script> <script src="{{ secure_url("/ceetrox/sidekick/resource/public/Elements/notification/notification.sample.js") }}" defer></script>
<script src="{{ secure_url("/ceetrox/sidekick/resource/public/Elements/notification/modal.sample.js") }}" defer></script> <script src="{{ secure_url("/ceetrox/sidekick/resource/public/Elements/notification/modal.sample.js") }}" defer></script>
@Limitless::InitNotifications
@stop @stop
@section('Limitless::Stylesheet') @section('Limitless::Stylesheet')
......
...@@ -2,16 +2,14 @@ class LimitlessNotification { ...@@ -2,16 +2,14 @@ class LimitlessNotification {
// returns instance. // returns instance.
set(title, msg, type, confirm = false, bar = false, pos = null, icon = null) { set(title, msg, type, confirm = false, bar = false, pos = null, icon = null) {
setTimeout(function() { if (!isModuleSet()) {
if (!isModuleSet()) { console.warn('Warning - pnotify.min.js is not loaded.');
console.warn('Warning - pnotify.min.js is not loaded.'); return;
return; }
}
let options = setOption(title, msg, type, icon, bar, pos, confirm); let options = setOption(title, msg, type, icon, bar, pos, confirm);
return new PNotify(options); return new PNotify(options);
},1);
} }
} }
......
{{--<script>--}} <script>
{{-- let limitlessNotifications = new LimitlessNotification();--}} {{--let limitlessNotifications = new LimitlessNotification();--}}
{{-- limitlessNotifications.set('Test', "Testing", 'success');--}} {{-- // Default Toasters--}}
{{--@if(isset($errors)) @foreach($errors->all() as $data) limitlessNotifications.set('', "{{ $data }}", 'error'); @endforeach @endif--}}
{{--@if(isset($infos)) @foreach($infos as $data) limitlessNotifications.set('', "{{ $data }}", 'info'); @endforeach @endif--}}
{{--@if(isset($warnings)) @foreach($warnings as $data) limitlessNotifications.set('', "{{ $data }}", 'warning'); @endforeach @endif--}}
{{--@if(isset($successes)) @foreach($successes as $data) limitlessNotifications.set('', "{{ $data }}", 'success'); @endforeach @endif--}}
{{--@if(isset($hiddens)) @foreach($hiddens as $data) console.log("{{ $data }}"); @endforeach @endif--}}
{{--@if(isset($error)) limitlessNotifications.set('', "{{ $error }}", 'error'); @endif--}}
{{--@if(isset($success))--}}
{{-- --}}{{-- Default Toasters --}} {{-- let a = limitlessNotifications.set('', "{{ $success }}", 'warning');--}}
{{-- @if(isset($errors)) @foreach($errors->all() as $data) limitlessNotifications.set('', "{{ $data }}", 'error'); @endforeach @endif--}} {{-- console.log('{{ $success }}');--}}
{{-- @if(isset($infos)) @foreach($infos as $data) limitlessNotifications.set('', "{{ $data }}", 'info'); @endforeach @endif--}} {{-- console.log(a);--}}
{{-- @if(isset($warnings)) @foreach($warnings as $data) limitlessNotifications.set('', "{{ $data }}", 'warning'); @endforeach @endif--}}
{{-- @if(isset($successes)) @foreach($successes as $data) limitlessNotifications.set('', "{{ $data }}", 'success'); @endforeach @endif--}}
{{-- @if(isset($hiddens)) @foreach($hiddens as $data) console.log("{{ $data }}"); @endforeach @endif--}}
{{-- @if(isset($error)) limitlessNotifications.set('', "{{ $error }}", 'error'); @endif--}}
{{-- @if(isset($success))--}}
{{-- let a = limitlessNotifications.set('', "{{ $success }}", 'success');--}} {{--@endif--}}
{{-- console.log('{{ $success }}');--}} {{--@if(isset($warning)) limitlessNotifications.set('', "{{ $warning }}", 'warning'); @endif--}}
{{-- console.log(a);--}} {{--@if(isset($info)) limitlessNotifications.set('', "{{ $info }}", 'info'); @endif--}}
{{--@if(isset($hidden)) console.log("{{ $hidden }}"); @endif--}}
{{-- @endif--}} {{-- // Session Toasters--}}
{{-- @if(isset($warning)) limitlessNotifications.set('', "{{ $warning }}", 'warning'); @endif--}} {{--@if(Session::has('errors')) @foreach(Session::get('errors') as $data) limitlessNotifications.set('', "{{ $data }}", 'error'); @endforeach @endif--}}
{{-- @if(isset($info)) limitlessNotifications.set('', "{{ $info }}", 'info'); @endif--}} {{--@if(Session::has('infos')) @foreach(Session::get('infos') as $data) limitlessNotifications.set('', "{{ $data }}", 'info'); @endforeach @endif--}}
{{-- @if(isset($hidden)) console.log("{{ $hidden }}"); @endif--}} {{--@if(Session::has('warnings')) @foreach(Session::get('warnings') as $data) limitlessNotifications.set('', "{{ $data }}", 'warning'); @endforeach @endif--}}
{{--@if(Session::has('successes')) @foreach(Session::get('successes') as $data) limitlessNotifications.set('', "{{ $data }}", 'success'); @endforeach @endif--}}
{{--@if(Session::has('hiddens')) @foreach(Session::get('hiddens') as $data) console.log("{{ $data }}"); @endforeach @endif--}}
{{--@if(Session::has('error')) limitlessNotifications.set('', "{{ Session::get('error') }}", 'error'); @endif--}}
{{--@if(Session::has('success')) limitlessNotifications.set('', "{{ Session::get('success') }}", 'success'); @endif--}}
{{--@if(Session::has('warning')) limitlessNotifications.set('', "{{ Session::get('warning') }}", 'warning'); @endif--}}
{{--@if(Session::has('info')) limitlessNotifications.set('', "{{ Session::get('info') }}", 'info'); @endif--}}
{{--@if(Session::has('hidden')) console.log("{{ Session::get('hidden') }}"); @endif--}}
{{-- --}}{{-- Session Toasters --}} </script>
{{-- @if(Session::has('errors')) @foreach(Session::get('errors') as $data) limitlessNotifications.set('', "{{ $data }}", 'error'); @endforeach @endif--}}
{{-- @if(Session::has('infos')) @foreach(Session::get('infos') as $data) limitlessNotifications.set('', "{{ $data }}", 'info'); @endforeach @endif--}}
{{-- @if(Session::has('warnings')) @foreach(Session::get('warnings') as $data) limitlessNotifications.set('', "{{ $data }}", 'warning'); @endforeach @endif--}}
{{-- @if(Session::has('successes')) @foreach(Session::get('successes') as $data) limitlessNotifications.set('', "{{ $data }}", 'success'); @endforeach @endif--}}
{{-- @if(Session::has('hiddens')) @foreach(Session::get('hiddens') as $data) console.log("{{ $data }}"); @endforeach @endif--}}
{{-- @if(Session::has('error')) limitlessNotifications.set('', "{{ Session::get('error') }}", 'error'); @endif--}}
{{-- @if(Session::has('success')) limitlessNotifications.set('', "{{ Session::get('success') }}", 'success'); @endif--}}
{{-- @if(Session::has('warning')) limitlessNotifications.set('', "{{ Session::get('warning') }}", 'warning'); @endif--}}
{{-- @if(Session::has('info')) limitlessNotifications.set('', "{{ Session::get('info') }}", 'info'); @endif--}}
{{-- @if(Session::has('hidden')) console.log("{{ Session::get('hidden') }}"); @endif--}}
{{--</script>--}}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment