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

Version Path
promethee-4.1.28 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.27 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.26 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.25 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.24 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.23 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.22 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.21 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.20 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.19 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.18 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.17 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.16 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.15 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.14 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.13 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.12 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.11 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.10 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-4.1.9 app/views/promethee/components/slider_item/_edit.move.html.erb