From 158e3eb2df95331af780ebd52385c09d5ecb2877 Mon Sep 17 00:00:00 2001 From: aina-esokia Date: Thu, 10 Jan 2019 18:29:47 +0400 Subject: [PATCH 1/3] port fix preview pdf in pdfjs --- lib/classes/media/subdef.php | 2 ++ templates/web/common/thumbnail.html.twig | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/classes/media/subdef.php b/lib/classes/media/subdef.php index 45eaa4cdbe..53b8b290bc 100644 --- a/lib/classes/media/subdef.php +++ b/lib/classes/media/subdef.php @@ -89,6 +89,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface const TYPE_AUDIO_MP3 = 'AUDIO_MP3'; const TYPE_IMAGE = 'IMAGE'; const TYPE_NO_PLAYER = 'UNKNOWN'; + const TYPE_PDF = 'PDF'; /* * Technical datas types constants @@ -407,6 +408,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface { static $types = [ 'application/x-shockwave-flash' => self::TYPE_FLEXPAPER, + 'application/pdf' => self::TYPE_PDF, 'audio/mp3' => self::TYPE_AUDIO_MP3, 'audio/mpeg' => self::TYPE_AUDIO_MP3, 'image/gif' => self::TYPE_IMAGE, diff --git a/templates/web/common/thumbnail.html.twig b/templates/web/common/thumbnail.html.twig index b6529ec052..45a31dfb05 100644 --- a/templates/web/common/thumbnail.html.twig +++ b/templates/web/common/thumbnail.html.twig @@ -19,7 +19,7 @@ src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}" frameborder="0" allowfullscreen> - {% elseif record_type == 'FLEXPAPER' %} + {% elseif record_type == 'FLEXPAPER' or record_type == 'PDF' %}
Date: Fri, 25 Jan 2019 15:37:11 +0400 Subject: [PATCH 2/3] update alchemy/embed-bundle to 0.3.8 --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 80ccaa0827..8a41ac8dfc 100644 --- a/composer.lock +++ b/composer.lock @@ -131,16 +131,16 @@ }, { "name": "alchemy/embed-bundle", - "version": "0.3.7", + "version": "0.3.8", "source": { "type": "git", "url": "https://github.com/alchemy-fr/embed-bundle.git", - "reference": "ce7408c7a47387eed3df2a743577d6e0e25f991f" + "reference": "8a9699bc51e2b2997ccfd357bb2892f3702c33ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/embed-bundle/zipball/ce7408c7a47387eed3df2a743577d6e0e25f991f", - "reference": "ce7408c7a47387eed3df2a743577d6e0e25f991f", + "url": "https://api.github.com/repos/alchemy-fr/embed-bundle/zipball/8a9699bc51e2b2997ccfd357bb2892f3702c33ef", + "reference": "8a9699bc51e2b2997ccfd357bb2892f3702c33ef", "shasum": "" }, "require-dev": { @@ -178,10 +178,10 @@ ], "description": "Embed resources bundle", "support": { - "source": "https://github.com/alchemy-fr/embed-bundle/tree/0.3.7", + "source": "https://github.com/alchemy-fr/embed-bundle/tree/0.3.8", "issues": "https://github.com/alchemy-fr/embed-bundle/issues" }, - "time": "2017-05-30T13:18:21+00:00" + "time": "2019-01-11T10:35:41+00:00" }, { "name": "alchemy/geonames-api-consumer", From 1fb82d730cc9badfc9e63875b2596dd4cf2e9639 Mon Sep 17 00:00:00 2001 From: aina-esokia Date: Mon, 11 Feb 2019 11:07:48 +0400 Subject: [PATCH 3/3] change database template to use pdf in default document preview --- lib/conf.d/data_templates/DublinCore.xml | 2 +- lib/conf.d/data_templates/en-simple.xml | 2 +- lib/conf.d/data_templates/fr-simple.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/conf.d/data_templates/DublinCore.xml b/lib/conf.d/data_templates/DublinCore.xml index aada9b2258..e50bf58612 100644 --- a/lib/conf.d/data_templates/DublinCore.xml +++ b/lib/conf.d/data_templates/DublinCore.xml @@ -148,7 +148,7 @@ {{datapathnoweb}}{{basename}}/subdefs - flexpaper + pdf no screen diff --git a/lib/conf.d/data_templates/en-simple.xml b/lib/conf.d/data_templates/en-simple.xml index e42b18a490..d4a00c347b 100644 --- a/lib/conf.d/data_templates/en-simple.xml +++ b/lib/conf.d/data_templates/en-simple.xml @@ -148,7 +148,7 @@ {{datapathnoweb}}{{basename}}/subdefs - flexpaper + pdf no screen diff --git a/lib/conf.d/data_templates/fr-simple.xml b/lib/conf.d/data_templates/fr-simple.xml index 6af9a072f3..3ada8adaa6 100644 --- a/lib/conf.d/data_templates/fr-simple.xml +++ b/lib/conf.d/data_templates/fr-simple.xml @@ -148,7 +148,7 @@ {{datapathnoweb}}{{basename}}/subdefs - flexpaper + pdf no screen