Sha256: 7a4779c9545dacfb646d57a49d3a0d19fedc5bbe63a4f97278c86c0830d49d8a

Contents?: true

Size: 1.83 KB

Versions: 18

Compression:

Stored size: 1.83 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-xs-12">
          <img ng-show="component.attributes.media_type == 'image'" ng-src="/promethee/blob/{{component.attributes.image.id}}" class="img-responsive">
          <div ng-show="component.attributes.media_type == '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-xs-12 slider-item-caption" ng-show="component.attributes.searchable_caption !== ''">Caption</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.url + '';

        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

18 entries across 18 versions & 1 rubygems

Version Path
promethee-1.6.47 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.46 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.45 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.44 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.43 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.42 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.41 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.40 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.39 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.38 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.37 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.36 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.35 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.34 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.33 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.32 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.31 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.30 app/views/promethee/components/slider_item/_edit.move.html.erb