Commit 92bc159f authored by Kevin Yumang's avatar Kevin Yumang

SERV-2286 - pdf viewer modal element WIP (needed publisher)

parent 52860619
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
@Limitless::SideNavMenuItem(['url' => '?page=Element.LoremIpsum', 'target' => '_self', 'icon' => 'icon-bubble-lines3', 'title' => 'Lorem Ipsum']) @Limitless::SideNavMenuItem(['url' => '?page=Element.LoremIpsum', 'target' => '_self', 'icon' => 'icon-bubble-lines3', 'title' => 'Lorem Ipsum'])
@Limitless::SideNavMenuItem(['url' => '?page=Modal', 'target' => '_self', 'icon' => 'icon-stack', 'title' => 'Modal']) @Limitless::SideNavMenuItem(['url' => '?page=Modal', 'target' => '_self', 'icon' => 'icon-stack', 'title' => 'Modal'])
@Limitless::SideNavMenuItem(['url' => '?page=Notification', 'target' => '_self', 'icon' => 'icon-popout', 'title' => 'Notification']) @Limitless::SideNavMenuItem(['url' => '?page=Notification', 'target' => '_self', 'icon' => 'icon-popout', 'title' => 'Notification'])
@Limitless::SideNavMenuItem(['url' => '?page=PdfModal', 'target' => '_self', 'icon' => 'icon-file-pdf', 'title' => 'PDF Viewer Modal'])
@Limitless::SideNavMenuItem(['url' => '?page=Element.RandomSelect', 'target' => '_self', 'icon' => 'icon-shuffle', 'title' => 'Random Select']) @Limitless::SideNavMenuItem(['url' => '?page=Element.RandomSelect', 'target' => '_self', 'icon' => 'icon-shuffle', 'title' => 'Random Select'])
@Limitless::SideNavMenuItem(['url' => '?page=Videoplayer', 'target' => '_self', 'icon' => 'icon-video-camera2', 'title' => 'Video Player']) @Limitless::SideNavMenuItem(['url' => '?page=Videoplayer', 'target' => '_self', 'icon' => 'icon-video-camera2', 'title' => 'Video Player'])
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
session()->put('info', 'Hello! I am an info message from session!'); session()->put('info', 'Hello! I am an info message from session!');
return View('Limitless::Notification.Init') return View('Limitless::Notification.Init')
->with('success', 'Hello! I am a success message from view param!'); ->with('success', 'Hello! I am a success message from controller view param!');
} }
} }
......
// Resize the modal to the right size.
$(window).on('touchstart click resize', function () {
setTimeout(function(){
$('.pdfIframe').each(function () {
var ModalDialog = $(this).parents('.modal');
$(this).height((ModalDialog.height() - 250) + 'px');
});
},300);
});
<?php
/*
|------------------------------------------------------------------------------------------------
| Information
|------------------------------------------------------------------------------------------------
|
| This file is beautified by the command "sidekick:CodebeautifierCommand" of the ceetrox
| sidekick package.
|
| Author: Kevin Almond Roe Yumang <kevin.yumang@itmax.email>
| Update: 2022-06-30 02:31:57
|
*/
namespace Ceetrox\Sidekick\Views\Limitless\PdfModal;
/*
|------------------------------------------------------------------------------------------------
| Dependencies
|------------------------------------------------------------------------------------------------
*/
use View;
/*
|------------------------------------------------------------------------------------------------
| Class "Config"
|------------------------------------------------------------------------------------------------
*/
class Config
{
public $methodAllocation = [
'Limitless::PdfModal' => 'pdfModal',
];
public $assetAllocation;
public function __construct()
{
$this->assetAllocation = [
'Limitless::PdfModal' => [
'Attachments/pdf-modal.js'
]
];
}
/*
|--------------------------------------------------------------------------------------------
| Method "pdfModal"
|--------------------------------------------------------------------------------------------
*/
public function pdfModal($parameters)
{
return View('Limitless::PdfModal.PdfModal')
->withButtonText($parameters['button-text'] ?? null)
->withTitle($parameters['title'] ?? null)
->withUrl($parameters['url'] ?? null);
}
}
{{-- Layout Reference --}}
@extends('Limitless::Help.Layout.Master')
@section('Limitless::Content')
@php
$pdfPath = secure_url("/ceetrox/sidekick/resource/public/Elements/pdfmodal/sample.pdf");
@endphp
@Limitless::CardStart(['title' => "Description", 'icon' => 'icon-info22'])
@Limitless::PdfModal(['url' => $pdfPath])
@Limitless::CardStop
@stop
<button type="button" class="LimitlessPdfViewerModalButton btn btn-secondary btn-labeled btn-labeled-left"
data-toggle="modal"
data-target="#LimitlessPdfModal"
data-backdrop="static"
data-keyboard="false"
>
<b><i class="icon-file-pdf"></i></b> {{ $buttonText ?? $title ?? 'No Text' }}
</button>
<div id="LimitlessPdfModal" class="modal fade" tabindex="-1">
<div class="modal-dialog modal-full">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ $title ?? $buttonText ?? 'No Title' }}</h5>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<iframe class="pdfIframe"
src="https://cdn.backoffice.online/pdfjs/web/viewer.html?file={{ $url }}"
style="border:1px solid #999999;" width="100%">
</iframe>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">PDF schließen</button>
</div>
</div>
</div>
</div>
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