Fixup datafile embed

This commit is contained in:
Benoît Burnichon
2016-01-13 13:23:14 +01:00
parent b9a8f1e82a
commit 8ef94dd5a7
4 changed files with 16 additions and 16 deletions

View File

@@ -74,6 +74,7 @@ use Alchemy\Phrasea\Core\Provider\UnicodeServiceProvider;
use Alchemy\Phrasea\Core\Provider\ZippyServiceProvider;
use Alchemy\Phrasea\Exception\InvalidArgumentException;
use Alchemy\Phrasea\Form\Extension\HelpTypeExtension;
use Alchemy\Phrasea\Media\DatafilesResolver;
use Alchemy\Phrasea\Media\MediaAccessorResolver;
use Alchemy\Phrasea\Media\PermalinkMediaResolver;
use Alchemy\Phrasea\Model\Entities\User;
@@ -376,7 +377,7 @@ class Application extends SilexApplication
}
$resolvers = $this['alchemy_embed.resource_resolvers'];
$resolvers['datafiles'] = $resolvers->share(function () {
$resolvers['datafile'] = $resolvers->share(function () {
return new DatafilesResolver($this->getApplicationBox(), $this['url_generator']);
});
$resolvers['permalinks_permalink'] = $resolvers->share(function () {

View File

@@ -11,7 +11,6 @@
namespace Alchemy\Phrasea\Http\StaticFile;
use Alchemy\Phrasea\Http\AbstractServerMode;
use Alchemy\Phrasea\Http\StaticFile\Symlink\SymLinker;
use Guzzle\Http\Url;
@@ -26,10 +25,10 @@ class StaticMode
/**
* @param $pathFile
* @param null $etag
* @param null|string $etag
* @return Url
*/
public function getUrl($pathFile, $etag=null)
public function getUrl($pathFile, $etag = null)
{
$this->ensureSymlink($pathFile);

View File

@@ -33,20 +33,20 @@
{% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %}
<iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
frameborder="0" allowfullscreen></iframe>
{% elseif record_type == 'FLEXPAPER' %}
<iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
frameborder="0" allowfullscreen></iframe>
{% elseif record_type == 'AUDIO_MP3' %}
<iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
frameborder="0" allowfullscreen></iframe>
{% else %}
<img class="record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
style="width:{{d_width|round}}px;height:{{d_height|round}}px;top:{{top|round}}px;"
src="{{thumbnail.get_url()}}" ondragstart="return false;">
src="{{thumbnail.get_url()|trim}}" ondragstart="return false;">
<input type="hidden" name="width" value="{{thumbnail_width}}"/>
<input type="hidden" name="height" value="{{thumbnail_height}}"/>
{% endif %}
@@ -58,18 +58,18 @@
{% set record_type = thumbnail.get_type() %}
{% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %}
<iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
frameborder="0" allowfullscreen></iframe>
{% elseif record_type == 'FLEXPAPER' %}
<iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
frameborder="0" allowfullscreen></iframe>
{% elseif record_type == 'AUDIO_MP3' %}
<iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
frameborder="0" allowfullscreen></iframe>
{% else %}
<img style="max-height: 100%;max-width:100%" class="record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
src="{{thumbnail.get_url()}}" ondragstart="return false;" />
src="{{thumbnail.get_url()|trim}}" ondragstart="return false;" />
{% endif %}
{% endmacro %}

View File

@@ -13,16 +13,16 @@
<div style="width:{{original_w}}px;height: {{ original_h }}px" class="videoTips">
<iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
frameborder="0" allowfullscreen></iframe>
</div>
{% elseif record_type == 'FLEXPAPER' %}
<iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
frameborder="0" allowfullscreen></iframe>
{% elseif record_type == 'AUDIO_MP3' %}
<iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
frameborder="0" allowfullscreen></iframe>
{% else %}
{% set fit_size = fitIn(
@@ -32,7 +32,7 @@
<img class="{% if lazyload %}lazyload{% endif %} record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
style="width:{{fit_size.width}}px;height:{{fit_size.height}}px;top:{{fit_size.top}}px;"
src="{% if lazyload %}/assets/common/images/grey.gif{% else %}{{ url }}{% endif %}" data-original="{{ url }}" ondragstart="return false;">
src="{% if lazyload %}/assets/common/images/grey.gif{% else %}{{ url|trim }}{% endif %}" data-original="{{ url|trim }}" ondragstart="return false;">
<input type="hidden" name="width" value="{{original_w}}"/>
<input type="hidden" name="height" value="{{original_h}}"/>