use Favicon;
use Secure;
use Images;
+ use Sound;
protected static $uaPrefixes = array('-moz-', '-webkit-', '-o-', '-ms-', '');
public function handle()
{
$this->log('Preprocess images');
- FluidbookImagesPreprocess::dispatchSync($this->book_id);
+ (new FluidbookImagesPreprocess($this->book_id))->handle();
$this->log('Start compile process');
// Raw copy of some directories
}
}
- /**
- * @throws \Exception
- */
- protected function writeSounds()
- {
- if (!$this->fluidbookSettings->soundTheme || $this->fluidbookSettings->soundTheme === 'none') {
- return;
- }
- $dir = resource_path('fluidbookpublication/sounds/' . $this->fluidbookSettings->soundTheme);
- $this->setSetting('simpleSoundTheme', file_exists($dir . '/flip.mp3'));
- $this->vdir->copyDirectory($dir, 'data/sounds');
- }
protected function writeAccessibility()
{
return $this->config->get($k);
}
- public function getWidth()
+ public function getWidth($page = 1)
{
- return $this->getPageDimension(1)[0];
+ return $this->getPageDimension($page)[0];
}
- public function getHeight()
+ public function getHeight($page = 1)
{
- return $this->getPageDimension(1)[1];
+ return $this->getPageDimension($page)[1];
}
return $this->getFluidbook()->getPDFSplitSource($page);
}
- public function getWidthForLinks()
+ public function getWidthForLinks($page = 1)
{
- return $this->getWidth() / $this->getLinkScale();
+ return $this->getWidth($page) / $this->getLinkScale();
}
- public function getHeightForLinks()
+ public function getHeightForLinks($page = 1)
{
- return $this->getHeight() / $this->getLinkScale();
+ return $this->getHeight($page) / $this->getLinkScale();
}
/**
return (int)$this->config->JPEGQuality;
}
}
+
+
self::_fixMultimedia($links);
self::_fixCloseButton($links);
self::_fixColors($links);
+ self::_fixInline($links);
}
+ protected static function _fixInline(&$links)
+ {
+ foreach ($links as $k => $link) {
+ if (isset($link['inline'])) {
+ $links[$k]['inline'] = Link::normalizeInlineIntegration($link['inline']);
+ }
+ }
+ }
+
+
protected static function _fixColors(&$links)
{
foreach ($links as $k => $link) {
}
$link = [];
- $cols = array('page' => '', 'left' => '', 'top' => '', 'width' => '', 'height' => '', 'type' => '', 'to' => '', 'target' => '_blank', 'video_loop' => true, 'video_auto_start' => true, 'video_controls' => true, 'video_sound_on' => true, 'tooltip' => '', 'numerotation' => 'physical', "inline" => true, 'pdfjs' => 'normal');
+ $cols = array('page' => '', 'left' => '', 'top' => '', 'width' => '', 'height' => '', 'type' => '', 'to' => '', 'target' => '_blank', 'video_loop' => true, 'video_auto_start' => true, 'video_controls' => true, 'video_sound_on' => true, 'tooltip' => '', 'numerotation' => 'physical', "inline" => 'inline', 'pdfjs' => 'normal');
$k = 0;
foreach ($cols as $col => $default) {
if (isset($line[$k])) {
});
+ setInterval(function () {
+ if ($(document.activeElement).is('.sp-input')) {
+ var v = $(document.activeElement).val();
+ let main = $(document.activeElement).closest('.form-group').find('.colorpicker');
+ $(main).val(v);
+ $(main).trigger('change');
- $(document).on('change', "#linkeditor-panel-form input,#linkeditor-panel-form select,#linkeditor-panel-form textarea", function () {
+ }
+ }, 250);
+
+ $(document).on('change keyup', "#linkeditor-panel-form input,#linkeditor-panel-form select,#linkeditor-panel-form textarea", function () {
if ($this._maskChangeEvent) {
return;
}
if (f.length === 0) {
return;
}
- if(!f.is('input,textarea')){
+ if (!f.is('input,textarea')) {
return;
}
f = f.get(0);
initSpectrum: function () {
$("#linkeditor-panel-form .colorpicker:not(.init)").each(function () {
var t = $(this);
- $(this).spectrum({
+ let s = $(this).spectrum({
preferredFormat: 'hex3',
showAlpha: true,
allowEmpty: false,
let zindex = ((calcDepth + 1) * 10000) - Math.min(9999, Math.max(1, Math.round(9999 * ((linkWidth * linkHeight) / $this.linkeditor.bookSurface))));
if (isNaN(zindex) || isNaN(calcDepth)) {
- console.warn('error defining depth of link ' + $(this).attr('fb-uid'), calcDepth, linkWidth, linkHeight, $this.linkeditor.bookSurface);
+ console.warn('error defining depth of link ' + $(this).attr('fb-uid'), calcDepth, $this.findDefaultLinkDepth($(this)), linkWidth, linkHeight, $this.linkeditor.bookSurface);
}
$(this).attr('fb-calc-depth', calcDepth);
$.each(conf, function (k, v) {
let val = $(link).attr('fb-' + k);
if (k === 'alternative' || k === 'to') {
- if (key === 6) {
+ if (key == 6) {
let e = val.split('.');
let ext = e.pop().toLowerCase();
val = (['png', 'jpg', 'jpeg', 'gif', 'webp', 'avif', 'svg'].indexOf(ext) >= 0) ? 'file.jpg' : 'file.zip';
if (settings.length > 0) {
key += '/' + settings.join(',');
}
- return DEPTH.depths[key];
+
+ let res = DEPTH.depths[key];
+ if (res === undefined) {
+ console.log('undefined depth key ', key);
+ }
+ return res;
},
clear: function () {