[cvs-annodex] commit (/annodex): AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xul

andre nobody at lists.annodex.net
Sun Feb 6 18:19:30 EST 2005


Update of /annodex (new revision 845)

Modified files:
   AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
   AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xul

Log Message:
AnnodexFirefoxExtension:
 * Display starting time of clip in the table of contents display.  Looks pretty fugly right now, but I'll fix up the appearance later.  (Uh oh, looks like my type-A UI standards are dropping ...)


Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js	2005-02-06 07:05:29 UTC (rev 844)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js	2005-02-06 07:19:28 UTC (rev 845)
@@ -361,17 +361,9 @@
   var minutes = parseInt(time / 60);
   var seconds = parseInt(time % 60);
 
-  // 0-pad, the tedious way ...
-  if (minutes < 10)
-  {
-    minutes = "0" + minutes;
-  }
+  minutes = zeroPad(minutes, 2);
+  seconds = zeroPad(seconds, 2);
 
-  if (seconds < 10)
-  {
-    seconds = "0" + seconds;
-  }
-
   return (minutes + ":" + seconds);
 }
 
@@ -1047,8 +1039,21 @@
   var minutesUnit = parseInt( (aTimeInSeconds / 60) % 60 );
   var secondsUnit = aTimeInSeconds % 60;
 
-  var timeString = hoursUnit + ":" + minutesUnit + ":" + secondsUnit;
+  minutesUnit = zeroPad(minutesUnit, 2);
+  secondsUnit = zeroPad(secondsUnit, 2);
 
+  var timeString = minutesUnit + ":" + secondsUnit;
+
   return timeString;
 }
 
+function zeroPad (aNumber, aNumberOfDesiredDigits)
+{
+  var numberAsString = new String(aNumber);
+
+  while (numberAsString.length < aNumberOfDesiredDigits)
+    numberAsString = "0" + numberAsString;
+
+  return numberAsString;
+}
+

Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xul
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xul	2005-02-06 07:05:29 UTC (rev 844)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xul	2005-02-06 07:19:28 UTC (rev 845)
@@ -157,12 +157,14 @@
 	      >
 	      
 	    <listcell height="48" width="66">
-	      <image src="rdf:http://www.annodex.net/cmml/rdf#img-src" height="48" width="64"/>
+	      <vbox flex="4" align="center" pack="center">
+		<label value="rdf:http://www.annodex.net/cmml/rdf#human-readable-time"/>
+		<image src="rdf:http://www.annodex.net/cmml/rdf#img-src" height="48" width="64"/>
+	      </vbox>
 	    </listcell>
 
 	    <listcell flex="4">
-	      <label value="rdf:http://www.annodex.net/cmml/rdf#human-readable-time"/>
-	      <description flex="4"><textnode value="rdf:http://www.annodex.net/cmml/rdf#title"/></description>
+		<description flex="4"><textnode value="rdf:http://www.annodex.net/cmml/rdf#title"/></description>
 	    </listcell>
 	  
 	  </listitem>


-- 
andre



More information about the cvs-annodex mailing list