Sha256: 5b4dacc1191e3aa766b94dba7cc2b709483ea5160f010886e42a1508a510267e

Contents?: true

Size: 1.86 KB

Versions: 18

Compression:

Stored size: 1.86 KB

Contents

<script type="text/ng-template" id="promethee/components/collection_item/edit/move">
  <%= render 'promethee/edit/move.header', type: 'collection_item' %>
      <div class="header">Collection 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="CollectionItemVideoController">
            <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 collection-item-caption" ng-show="component.attributes.searchable_caption !== ''">Caption</div>
      </div>
    </div>
  </div>
</script>

<script>
  promethee.controller('CollectionItemVideoController', ['$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/collection_item/_edit.move.html.erb
promethee-1.6.46 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.45 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.44 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.43 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.42 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.41 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.40 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.39 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.38 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.37 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.36 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.35 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.34 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.33 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.32 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.31 app/views/promethee/components/collection_item/_edit.move.html.erb
promethee-1.6.30 app/views/promethee/components/collection_item/_edit.move.html.erb