Sha256: 7df6ec9d5b31e73214a86f41be6f0d6816806acdf2f06dca91ea5eacded2c59a

Contents?: true

Size: 1.88 KB

Versions: 30

Compression:

Stored size: 1.88 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="{{ component.attributes.image.id ? '/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

30 entries across 30 versions & 1 rubygems

Version Path
promethee-1.8.0 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.12 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.11 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.10 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.9 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.8 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.7 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.6 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.5 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.4 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.3 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.2 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.1 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.7.0 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.63 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.62 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.61 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.60 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.59 app/views/promethee/components/slider_item/_edit.move.html.erb
promethee-1.6.58 app/views/promethee/components/slider_item/_edit.move.html.erb