Sha256: 099e655113c37e0c79cab8e9ec57f28e5689907aacad16dfbf3300412982609d
Contents?: true
Size: 1.98 KB
Versions: 38
Compression:
Stored size: 1.98 KB
Contents
<script type="text/ng-template" id="promethee/components/slider_item/edit/move"> <%= render 'promethee/edit/move.header', type: 'slider_item' %> <div class="header">Slider Item</div> <div class="row"> <div class="col-12 col-xs-12"> <img ng-show="component.attributes.media_type.value == 'image'" ng-if="component.attributes.image.value.id != undefined" ng-src="/promethee/blob/{{component.attributes.image.value.id}}" class="img-fluid img-responsive"> <div ng-show="component.attributes.media_type.value == 'video'" ng-controller="SliderItemVideoController"> <div class="embed-responsive embed-responsive-16by9"> <iframe ng-if="embed" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" ng-src="{{embed | urlSafe}}"></iframe> <div class="video-neutralizing-overlay"></div> </div> </div> </div> </div> <div class="row"> <div class="col-12 col-xs-12 slider-item-caption" ng-show="component.attributes.caption.value !== ''" ng-bind-html="component.attributes.caption.value | htmlSafe"></div> </div> </div> </div> </script> <script> promethee.controller('SliderItemVideoController', ['$scope', function($scope) { Object.defineProperty($scope, 'embed', { get: function() { var embed = null; var url = this.component.attributes.video.value + ''; if (url.includes('vimeo')) { var id = url.replace(/^(?:https?:)?\/\/(?:(?:www|player)\.)?vimeo\.com\/(?:video\/)?(\d+).*?$/, '$1'); embed = 'https://player.vimeo.com/video/' + id + '?color=ffffff&title=0&byline=0&portrait=0'; } else if (url.includes('youtube')) { var parts = url.split('watch?v='); var id = parts[parts.length - 1]; embed = 'https://www.youtube.com/embed/' + id; } elseĀ { var embed = url; } return embed; } }) }]); </script>
Version data entries
38 entries across 38 versions & 1 rubygems