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

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

[linterna-magica-commit] [359] Switching to HD list in the boundaries of


From: Ivaylo Valkov
Subject: [linterna-magica-commit] [359] Switching to HD list in the boundaries of the video object.
Date: Sat, 22 Dec 2012 19:44:44 +0000

Revision: 359
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=359
Author:   valkov
Date:     2012-12-22 19:44:43 +0000 (Sat, 22 Dec 2012)
Log Message:
-----------
Switching to HD list in the boundaries of the video object. Mainly
part of the interface changes in tasks #12203. 

This change is mandated by the interface changes in YouTube that
caused the HD list to be overlapped by the website elements. The
solution in 0.0.12-5 and 0.0.12-6 (hiding website elements) was
temporary anyway. #future_release_0.0.13

Ticket Links:
------------
    http://savannah.gnu.org/task/?12203

Modified Paths:
--------------
    trunk/data/style/template.css
    trunk/src/lm_interface_hd_links.js
    trunk/src/lm_site_youtube.js
    trunk/src/lm_sites.js

Modified: trunk/data/style/template.css
===================================================================
--- trunk/data/style/template.css       2012-12-22 12:29:55 UTC (rev 358)
+++ trunk/data/style/template.css       2012-12-22 19:44:43 UTC (rev 359)
@@ -409,8 +409,8 @@
     height: auto !important;
     /* ^^^Fix height and width in dailymotion: The site sets them to */
     /* 100% but the list shows partly under the header */
-    bottom: -2px !important;
-    left: 28px !important;
+    bottom: 35px !important;
+    left: -270% !important;
     overflow-y: auto !important;
     /* Hide scrollbars for HD links in YouTube */
     overflow-x: hidden !important;
@@ -709,8 +709,6 @@
 .linterna-magica-video-object-wrapper,
 .linterna-magica-video-object,
 .linterna-magica-video-object p {
-    /* Above HD button and logo at the right */
-    z-index: 999999 !important;
     display:block !important;
     position:relative !important;
     background-color: black !important;

Modified: trunk/src/lm_interface_hd_links.js
===================================================================
--- trunk/src/lm_interface_hd_links.js  2012-12-22 12:29:55 UTC (rev 358)
+++ trunk/src/lm_interface_hd_links.js  2012-12-22 19:44:43 UTC (rev 359)
@@ -124,18 +124,28 @@
     var id = element.getAttribute("id").split(/-/);
     id = id[id.length-1];
 
+    var lm_video = this.get_video_object(id);
     var hd_list = element.nextSibling;
+   
     if (hd_list)
     {
        var display = hd_list.style.getPropertyValue("display");
        if (display)
        {
            hd_list.style.removeProperty("display");
-           var self = this;
-           this.call_site_function_at_position.apply(self,[
-               "post_show_hd_links_list",
-               window.location.hostname]);
-               
+
+           var hd_list_width = hd_list.clientWidth ? 
+               hd_list.clientWidth : hd_list.offsetWidth ? 
+               hd_list.offsetWidth : 120;
+               
+           lm_video.normal_width = 
+               parseInt(lm_video.style.getPropertyValue("width"));
+
+           // 20 = offset from the right to the middle
+           lm_video.reduced_width = lm_video.normal_width - hd_list_width - 20;
+
+           lm_video.style.setProperty("width", lm_video.reduced_width+"px",
+                                      "important");
            var hd_list_blur_function = function(ev)
            {
                var timeout_function = function()
@@ -148,9 +158,9 @@
                    {
                        hd_list.style.setProperty("display", 
                                                  "none", "important");
-                       self.call_site_function_at_position.apply(self,[
-                           "post_hide_hd_links_list",
-                           window.location.hostname]);
+                       lm_video.style.setProperty("width",
+                                                  lm_video.normal_width+"px",
+                                                  "important");
                    }
                    element.removeEventListener("blur",
                                                hd_list_blur_function,
@@ -167,10 +177,8 @@
        else
        {
            hd_list.style.setProperty("display", "none", "important");
-           var self = this;
-           this.call_site_function_at_position.apply(self,[
-               "post_hide_hd_links_list",
-               window.location.hostname]);
+           lm_video.style.setProperty("width", lm_video.normal_width+"px",
+                                      "important");
        }
     }
     return true;

Modified: trunk/src/lm_site_youtube.js
===================================================================
--- trunk/src/lm_site_youtube.js        2012-12-22 12:29:55 UTC (rev 358)
+++ trunk/src/lm_site_youtube.js        2012-12-22 19:44:43 UTC (rev 359)
@@ -693,40 +693,3 @@
     return false;
 }
 
-// Fixes the overlapping of the HD links list in YouTube's new design
-// See bug #37881
-// http://savannah.nongnu.org/bugs/?37881
-LinternaMagica.prototype.sites["youtube.com"].post_show_hd_links_list =
-function()
-{
-    var play_list= document.getElementById("watch7-playlist-tray-container");
-    if (play_list)
-    {
-       play_list.style.setProperty("display", "none", "important");
-    }
-
-    var side_bar= document.getElementById("watch7-sidebar");
-    if (side_bar)
-    {
-       side_bar.style.setProperty("display", "none", "important");
-    }
-}
-
-// Fixes the overlapping of the HD links list in YouTube's new design
-// See bug #37881
-// http://savannah.nongnu.org/bugs/?37881
-LinternaMagica.prototype.sites["youtube.com"].post_hide_hd_links_list =
-function()
-{
-    var play_list= document.getElementById("watch7-playlist-tray-container");
-    if (play_list)
-    {
-       play_list.style.removeProperty("display");
-    }
-
-    var side_bar= document.getElementById("watch7-sidebar");
-    if (side_bar)
-    {
-       side_bar.style.removeProperty("display");
-    }
-}

Modified: trunk/src/lm_sites.js
===================================================================
--- trunk/src/lm_sites.js       2012-12-22 12:29:55 UTC (rev 358)
+++ trunk/src/lm_sites.js       2012-12-22 19:44:43 UTC (rev 359)
@@ -314,21 +314,6 @@
     return true;
 }
 
-// Execute an action after the HD link list is shown.
-LinternaMagica.prototype.sites.__post_show_hd_links_list = 
-function()
-{
-    return true;
-}
-
-// Execute an action after the HD link list is hidden.
-LinternaMagica.prototype.sites.__post_hide_hd_links_list = 
-function()
-{
-    return true;
-}
-
-
 // Check if site specific config and function exists and call it. If
 // it doesn't, call the general/default function.  A function returns
 // false/null, if the calling function should exit/return after this




reply via email to

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