[Git][noosfero/noosfero][master-1.x] 2 commits: Add link to video page

Rodrigo Souto gitlab at mg.gitlab.com
Wed Sep 5 14:59:31 BRT 2018


Rodrigo Souto pushed to branch master-1.x at Noosfero / noosfero


Commits:
002fd0f0 by Iasmin Mendes at 2018-08-30T12:05:30Z
Add link to video page

- - - - -
5b87ee8c by Rodrigo Souto at 2018-09-05T17:59:29Z
Merge branch 'html5-video-page-link' into 'master-1.x'

Add link to video page in html_video plugin

See merge request noosfero/noosfero!1607
- - - - -


3 changed files:

- plugins/html5_video/lib/html5_video_plugin/video_channel.rb
- plugins/html5_video/public/video-channel.js
- plugins/html5_video/views/content_viewer/video_channel.html.erb


Changes:

=====================================
plugins/html5_video/lib/html5_video_plugin/video_channel.rb
=====================================
@@ -11,7 +11,7 @@ class Html5VideoPlugin::VideoChannel < Folder
   include ActionView::Helpers::TagHelper
   def to_html(options={})
     article = self
-    lambda do |_|
+    Proc.new do |_|
       render :file => 'content_viewer/video_channel', :locals => {:article => article}
     end
   end


=====================================
plugins/html5_video/public/video-channel.js
=====================================
@@ -89,6 +89,7 @@ VideoChannel.prototype.getItemData = function(item) {
   data.videoURL = link.getAttribute('data-download');
   data.posterURL = link.getAttribute('data-poster');
   data.title = $(link).text();
+  data.url = link.getAttribute('href');
   data.abstract = $('.abstract', item)[0].innerHTML;
   data.tags = $('.vli-data-tags > div', item)[0].innerHTML;
   return data;
@@ -102,6 +103,7 @@ exports.NoosferoVideoPlayer = function NoosferoVideoPlayer(place, channel) {
   if(!this.divBase) return;
   this.info = {
     title      : $('h2',            this.divBase)[0],
+    url        : $('.page-url',     this.divBase)[0],
     quality    : $('.quality ul',   this.divBase)[0],
     tags       : $('.tags div',     this.divBase)[0],
     abstract   : $('.abstract div', this.divBase)[0],
@@ -121,6 +123,7 @@ exports.NoosferoVideoPlayer = function NoosferoVideoPlayer(place, channel) {
 
 NoosferoVideoPlayer.prototype.update = function(data, autoplay) {
   this.info.title.innerHTML = data.title;
+  this.info.url.href = data.url;
   this.videoEl.src = data.videoURL;
   this.videoEl.autoplay = autoplay;
   this.poster = data.posterURL;
@@ -232,8 +235,9 @@ $(document).ready(function() {
   })
 
   // Hide the initial zoomed video.
-  $("a[href=#video-box-anchor]").click(function() {
+  $("a.video-box-item").click(function() {
     $(".video-player, .zoom-out").css("display", "block");
+    return false;
   });
 
   $('a[href*="#"]')


=====================================
plugins/html5_video/views/content_viewer/video_channel.html.erb
=====================================
@@ -11,7 +11,7 @@
     <div class="video-player">
       <%= render :partial => 'video_player', :locals => {:video => nil} %>
       <div class="video-footer-infos">
-        <h2></h2>
+        <a class='page-url'><h2></h2></a>
         <div class="quality">
           <strong><%=_('Quality options')%>:</strong>
           <ul></ul>
@@ -40,13 +40,14 @@
                     gsub(/([a-z0-9])_+([a-z0-9])/i, '\1 \2').
                     gsub(/\.[a-z0-9]{2,4}$/i, '')
                 ),
-                "#video-box-anchor",
+                f.view_url,
                 {
                   'data-poster'      => f.image_preview(:big),
                   'data-download'    => f.public_filename,
                   'data-webversions' => CGI::escapeHTML(f.web_versions!.to_json).html_safe,
                   :style => "background-image:url(#{f.image_preview(:big)})",
-                  'id' => "video-box-anchor"
+                  'id' => "video-box-anchor",
+                  :class => 'video-box-item'
                 }) %>
           <ul>
             <li class="vli-data-tags">



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/ed402b36c0b18813085efde1baa4c03613ff690a...5b87ee8c2b62243e3677f76e47a3fe18e56fe907

-- 
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/ed402b36c0b18813085efde1baa4c03613ff690a...5b87ee8c2b62243e3677f76e47a3fe18e56fe907
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180905/8fa52958/attachment-0001.html>


More information about the Noosfero-dev mailing list