[xiph-commits] r4060 - in itext: javascript styles

silvia at svn.annodex.net silvia at svn.annodex.net
Thu Oct 29 18:32:37 PDT 2009


Author: silvia
Date: 2009-10-29 18:32:37 -0700 (Thu, 29 Oct 2009)
New Revision: 4060

Modified:
   itext/javascript/subtitles.js
   itext/javascript/subtitles_v2.js
   itext/styles/subtitles.css
Log:
Streamlined styling a bit.


Modified: itext/javascript/subtitles.js
===================================================================
--- itext/javascript/subtitles.js	2009-10-30 01:20:56 UTC (rev 4059)
+++ itext/javascript/subtitles.js	2009-10-30 01:32:37 UTC (rev 4060)
@@ -610,11 +610,9 @@
                     if (i === "TAD")    {
                         jQuery("#" + this.div_id + " > .itext_TAD").attr("aria-live", "assertive");
                         jQuery("#" + this.div_id + " > .itext_TAD").css("max-width", (mc_width) + "px");
-                        jQuery("#" + this.div_id + " > .itext_TAD").css("bottom", "5px");
                     }
                     if (i === "LRC") {
                         jQuery("#" + this.div_id + " > .itext_LRC").css("max-width", mc_width + "px");
-                        jQuery("#" + this.div_id + " > .itext_LRC").css("bottom", "38px");                    
                         // somehow the setting of "left" encourages the correct width to be calculated
                         // if I don't do that, the width calculation in text_half_length is too short on some elements
                         jQuery("#" + this.div_id + " > .itext_" + i).css("left",5);
@@ -629,7 +627,6 @@
                           i === "LIN") {
                         // anyone with a better idea for how to place the captions bottom center, please speak up
                         jQuery("#" + this.div_id + " > .itext_" + i).css("max-width", mc_width + "px");
-                        jQuery("#" + this.div_id + " > .itext_" + i).css("bottom", "23px");
                         // somehow the setting of "left" encourages the correct width to be calculated
                         // if I don't do that, the width calculation in text_half_length is too short on some elements
                         jQuery("#" + this.div_id + " > .itext_" + i).css("left",5);

Modified: itext/javascript/subtitles_v2.js
===================================================================
--- itext/javascript/subtitles_v2.js	2009-10-30 01:20:56 UTC (rev 4059)
+++ itext/javascript/subtitles_v2.js	2009-10-30 01:32:37 UTC (rev 4060)
@@ -642,28 +642,25 @@
           if (content) {
             if (jQuery("#" + this.div_id + " > .itext_" + i).html() !== content) {
 
-              // update content
+              // update content and make it visible
               jQuery("#" + this.div_id + " > .itext_" + i).html(content);
+              jQuery("#" + this.div_id + " > .itext_" + i).css("visibility", "visible");
 
               // update styling dependent on text length
               if (i === "CUE") {
                 jQuery("#" + this.div_id + " > .itext_" + i + " > .text").prepend("Chapter: ");
               }
               if (i === "TAD")    {
-                jQuery("#" + this.div_id + " > .itext_TAD").attr("aria-live", "assertive");
                 jQuery("#" + this.div_id + " > .itext_TAD").css("max-width", (mc_width) + "px");
-                jQuery("#" + this.div_id + " > .itext_TAD").css("bottom", "5px");
               }
               if (i === "LRC") {
                 jQuery("#" + this.div_id + " > .itext_LRC").css("max-width", mc_width + "px");
-                jQuery("#" + this.div_id + " > .itext_LRC").css("bottom", "38px");                    
                 // somehow the setting of "left" encourages the correct width to be calculated
                 // if I don't do that, the width calculation in text_half_length is too short on some elements
                 jQuery("#" + this.div_id + " > .itext_LRC").css("left",5);
                 var text_half_length = jQuery("#" + this.div_id + " > .itext_LRC > .text").css("width").substr(0, jQuery("#" + this.div_id + " > .itext_LRC > .text").css("width").length - 2) / 2;
                 jQuery("#" + this.div_id + " > .itext_LRC").css("left", ((mc_width / 2) - text_half_length - 7) + "px");
               }
-              jQuery("#" + this.div_id + " > .itext_" + i).css("visibility", "visible");
               if (i === "CC" ||
                   i === "SUB" ||
                   i === "KTV" ||
@@ -671,7 +668,6 @@
                   i === "LIN") {
                 // anyone with a better idea for how to place the captions bottom center, please speak up
                 jQuery("#" + this.div_id + " > .itext_" + i).css("max-width", mc_width + "px");
-                jQuery("#" + this.div_id + " > .itext_" + i).css("bottom", "23px");
                 // somehow the setting of "left" encourages the correct width to be calculated
                 // if I don't do that, the width calculation in text_half_length is too short on some elements
                 jQuery("#" + this.div_id + " > .itext_" + i).css("left",5);

Modified: itext/styles/subtitles.css
===================================================================
--- itext/styles/subtitles.css	2009-10-30 01:20:56 UTC (rev 4059)
+++ itext/styles/subtitles.css	2009-10-30 01:32:37 UTC (rev 4060)
@@ -84,7 +84,7 @@
     opacity:0.8;
 /*    padding: 7px 7px 4px 7px; */
     visibility: hidden;
-    bottom: 0;
+    bottom: 38px;
     position: absolute;
     z-index: 1;
 }
@@ -95,9 +95,11 @@
     float: left;
     margin: 0;
     padding: 0;
-    bottom: 0;
+    bottom: 5px;
     position: absolute;
     z-index: -100;
+    aria-live: assertive;
+    
 }
 
 div.itext_CUE {



More information about the commits mailing list