.DS_Store
/resources/cubedesigners-oxygene/
/resources/css/
-/resources/pdfjs/dist/
-/resources/pdfjs/legacy/
-/resources/pdfjs/dist-min/
-/resources/pdfjs/legacy-min/
+/resources/pdfjs/
/resources/fluidbookpublication/player/
/resources/elearningpackage/dist/
/resources/quiz/dist/
Zip::extract($tmp, $path);
unlink($tmp);
copy('https://code.jquery.com/jquery-3.6.4.min.js', $path . '/web/jquery.min.js');
- copy(resource_path('pdfjs/custom/custom.js'), $path . '/web/custom.js');
+ touch($path . '/web/custom.js');
$html = file_get_contents($path . '/web/viewer.html');
- $html = str_replace('<script src="viewer.js"></script>', '<script src="jquery.min.js"></script><script src="custom.js"></script><script src="viewer.js"></script>', $html);
+ $html = str_replace('<script src="../build/pdf.js"></script>', '<script src="jquery.min.js"></script><script src="custom.js"></script><script src="../build/pdf.js"></script>', $html);
file_put_contents($path . '/web/viewer.html', $html);
+ Files::str_replace('function _isValidProtocol(url) {', 'function _isValidProtocol(url) {return true;', [$path . '/build/pdf.js', $path . '/build/pdf.worker.js']);
+
`cp -r $path $minpath`;
`/application/scripts/terser_path $minpath`;
}
$resource = resource_path('pdfjs/legacy-min');
}
$this->vdir->copyDirectory($resource, 'pdfjs');
+ $this->vdir->copy($this->assets . '/js/libs/pdfjs/custom.js', 'pdfjs/web/custom.js');
- $css = '.article #sidebarContainer, .article .toolbar {display:none !important;}';
- $css .= '.article .pdfViewer{padding:0 !important;}';
- $css .= '.article #viewerContainer{top:0 !important;overflow:visible !important;}';
- $css .= '.article{--page-border:0;--page-margin:0;--body-bg-color:transparent;}';
+
+ $css = '.seamless #sidebarContainer, .seamless .toolbar {display:none !important;}';
+ $css .= '.seamless .pdfViewer{padding:0 !important;}';
+ $css .= '.seamless #viewerContainer{top:0 !important;overflow:visible !important;}';
+ $css .= '.seamless{--page-border:0;--page-margin:0;--body-bg-color:transparent;}';
$css .= '.openFile,.rotateCw,.rotateCcw,.rotateCcw + .horizontalToolbarSeparator{display:none !important;}' . $this->fluidbookSettings->PDFJSCSS;
$this->vdir->file_put_contents('pdfjs/web/viewer.css', file_get_contents($resource . '/web/viewer.css') . $css);
}
$this->setComposedAttributes();
$this->checkHash();
if ($this->_compositionUpdated) {
- Links::addLinksFromPDF($this->id);
FluidbookImagesPreprocess::dispatch($this->id);
}
return parent::onSaved();
+++ /dev/null
-$(function () {
- PDFViewerApplication.preferences.set("externalLinkTarget", 2);
-});