linterna-magica-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linterna-magica-commit] [214] This should be the final fix for bugs #34


From: Ivaylo Valkov
Subject: [linterna-magica-commit] [214] This should be the final fix for bugs #34465.
Date: Fri, 25 Nov 2011 14:13:17 +0000

Revision: 214
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=214
Author:   valkov
Date:     2011-11-25 14:13:17 +0000 (Fri, 25 Nov 2011)
Log Message:
-----------
This should be the final fix for bugs #34465. Shorter labels for links. All the 
information is showed in a hint/tooltip. The list renders at the left of the 
vide player.

Ticket Links:
------------
    http://savannah.gnu.org/bugs/?34465

Modified Paths:
--------------
    trunk/src/lm_create_video_object.js
    trunk/src/lm_interface_hd_links.js
    trunk/src/lm_site_youtube.js

Modified: trunk/src/lm_create_video_object.js
===================================================================
--- trunk/src/lm_create_video_object.js 2011-11-25 12:37:34 UTC (rev 213)
+++ trunk/src/lm_create_video_object.js 2011-11-25 14:13:17 UTC (rev 214)
@@ -181,6 +181,7 @@
            var li = document.createElement("li");
            var button = document.createElement("a");
            button.setAttribute("href",object_data.hd_links[link].url);
+           button.setAttribute("title", object_data.hd_links[link].more_info);
            button.textContent = object_data.hd_links[link].label;
 
            var button_click_function = function(ev)

Modified: trunk/src/lm_interface_hd_links.js
===================================================================
--- trunk/src/lm_interface_hd_links.js  2011-11-25 12:37:34 UTC (rev 213)
+++ trunk/src/lm_interface_hd_links.js  2011-11-25 14:13:17 UTC (rev 214)
@@ -119,51 +119,23 @@
 
            if (hd_list.clientHeight > top_offset)
            {
-               // Force every li to 300px width
-               var li_predefined_w = 300;
-               // Force div with the HD list to 120px height
-               var h = 120;
+               // Move the HD list to the left so it is not over the
+               // video. Epiphany (or WbKit keeps video plugins above
+               // all).
+               var w = parseInt(hd_list.clientWidth) + 5;
+               hd_list.style.setProperty("left","-"+w+"px",
+                                         "important");
 
-               var links = hd_list.getElementsByTagName("li");
+               // Set the height of the HD list to the height of the
+               // <ul> that holds all <li> elemens. Somehow the <ul>
+               // has height but the div does not.
+               var ul_height = 
+                   hd_list.getElementsByTagName("ul")[0].clientHeight;
 
-               // Calculate the width of the HD list holder div
-               // according to the expected columns.  More than 6 li
-               // elements per column usualy do not fit.
-               var w = Math.ceil(links.length / 6) * li_predefined_w;
-               
-               var is_set = links[0].style.getPropertyValue("width");
-               is_set = parseInt(is_set);
+               hd_list.style.setProperty("height", ul_height+"px", 
"important");
 
-               if (!is_set)
-               {
-                   for (var i=0,l=links.length;i<l;i++)
-                   {
-                       var li = links[i];
-                       li.style.setProperty("float", "left", "important");
-                       li.style.setProperty("width", li_predefined_w+"px",
-                                            "important");
-                   }
-               }
-
-               hd_list.style.setProperty("height", h+"px", "important");
-               hd_list.style.setProperty("width", w+"px", "important");
-
-               // Without hiding and showing again the div,
-               // scrollbars are visible and some of the <li>
-               // elements have weird sizes.
-               hd_list.style.setProperty("display", "none", "important");
-               var redraw_timeout_function = function(ev)
-               {
-                   var hd_list = 
-                       document.getElementById("linterna-magica-hd-"+
-                                               "links-list-"+id);
-                   hd_list.style.removeProperty("display");
-               }
-
-               // We must wait a while for the redrawing/calculating
-               // to take effect. Immediate showing is not having the
-               // desired effect.
-               setTimeout(redraw_timeout_function, 15);
+               // Align with the top line of LM
+               hd_list.style.setProperty("top", "-2px", "important");
            }
 
            var hd_list_blur_function = function(ev)

Modified: trunk/src/lm_site_youtube.js
===================================================================
--- trunk/src/lm_site_youtube.js        2011-11-25 12:37:34 UTC (rev 213)
+++ trunk/src/lm_site_youtube.js        2011-11-25 14:13:17 UTC (rev 214)
@@ -73,22 +73,9 @@
            // http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs
 
            var label="";
+           var more_info = "";
            var fmt_id = link_data[0];
 
-           switch (fmt_id)
-           {
-           case '82':
-           case '83':
-           case '84':
-           case '85':
-           case '100':
-           case '101':
-           case '102':
-               label += "3D ";
-               break;
-           default:
-               "";
-           }
            // Set container
            switch (fmt_id)
            {
@@ -124,11 +111,26 @@
                label += this._("Unkown container");
            }
 
+           switch (fmt_id)
+           {
+           case '82':
+           case '83':
+           case '84':
+           case '85':
+           case '100':
+           case '101':
+           case '102':
+               label += " 3D";
+               break;
+           default:
+               "";
+           }
+
            // Set video and audio encodings
            switch (fmt_id)
            {
            case '5':
-               label += " Sorenson H.263, MP3";
+               more_info += "Sorenson H.263, MP3";
                break;
            case '18':
            case '22':
@@ -140,7 +142,7 @@
            case '83':
            case '84':
            case '85':
-               label += " MPEG-4 AVC (H.264), AAC";
+               more_info += "MPEG-4 AVC (H.264), AAC";
                break;
            case '43':
            case '44':
@@ -149,17 +151,18 @@
            case '100':
            case '101':
            case '102':
-               label += " VP8, Vorbis";
+               more_info += "VP8, Vorbis";
                break;
            case '13':
            case '17':
-               label += " MPEG-4 Visual, AAC";
+               nore_info += "MPEG-4 Visual, AAC";
                break;
            default:
-               label += " " + this._("Unkown encoding");
+               more_info += " " + this._("Unkown encoding");
            }
 
            link.label  = link_data[1] + " " +label;
+           link.more_info = link.label + " " + more_info;
 
            if (!fmt_url_map[fmt_id])
            {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]