Sha256: 86b89a39793b8fe0590e3bf63a0a53adaa82caf9bc201f03ee7140bcd59a28fa

Contents?: true

Size: 1.6 KB

Versions: 20

Compression:

Stored size: 1.6 KB

Contents

<script type="text/ng-template" id="promethee/components/video/edit/write">
  <div  ng-controller="VideoController"
        ng-click="inspect(component, $event)"
        class=" promethee-edit__component
                promethee-edit__component--video">
    <div class="promethee-edit__component-selected" ng-class="{'promethee-edit__component-selected--visible': promethee.inspected === component}">
      <div class="promethee-edit__toolbar promethee-edit__toolbar--transparent">
        <ng-include src="'promethee/write/toolbar'"></ng-include>
      </div>
      <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>
</script>

<script>
  promethee.controller('VideoController', ['$scope', function($scope) {
    Object.defineProperty($scope, 'embed', {
      get: function() {
        var embed = null;
        var url = this.component.attributes.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 = 'http://www.youtube.com/embed/' + id;
        }

        return embed;
      }
    })
  }]);
</script>

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
promethee-1.2.31 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.30 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.29 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.28 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.27 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.26 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.25 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.24 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.23 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.22 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.21 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.20 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.19 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.18 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.17 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.16 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.15 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.14 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.13 app/views/promethee/components/video/_edit.write.html.erb
promethee-1.2.12 app/views/promethee/components/video/_edit.write.html.erb