[cvs-annodex] commit (/annodex):
AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.xul
andre
nobody at lists.annodex.net
Sun Feb 6 22:27:02 EST 2005
Update of /annodex (new revision 850)
Modified files:
AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.xul
Log Message:
AnnodexFirefoxExtension:
* Window title now updates to display the starting time for the current location. This makes looking at the browsing history much nicer
Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js 2005-02-06 10:53:44 UTC (rev 849)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js 2005-02-06 11:27:00 UTC (rev 850)
@@ -816,6 +816,10 @@
displayMediaLoadingThrobber();
+ // Update the document title to include the start time
+ var documentTitleWithNoTime = document.title.replace(/ \(\d\d\:\d\d\:\d\d\)$/, "");
+ document.title = documentTitleWithNoTime + " (" + nptTimeString(clipStart, false) + ")";
+
// Add the current time point to the browsing history
var previousUrl = SourceURL + "#" + nptTimeString(clipStart);
document.location.href = previousUrl;
@@ -1023,7 +1027,8 @@
function sendLink (aEvent)
{
var timeInSeconds = MediaEngine.getTimeInSeconds();
- var url = SourceURL + "#" + nptTimeString(timeInSeconds);
+ var url = SourceURL + "#" + nptTimeString(timeInSeconds, false);
+
dump("Opening send link dialog box with URL: " + url + "\n");
transportPause(aEvent);
@@ -1057,16 +1062,39 @@
function nptTimeString (aTimeInSeconds)
{
- var hoursUnit = parseInt( aTimeInSeconds / 3600 );
- var minutesUnit = parseInt( (aTimeInSeconds / 60) % 60 );
- var secondsUnit = aTimeInSeconds % 60;
+ var aMapTimeToClipId;
- hoursUnit = zeroPad(hoursUnit, 2);
- minutesUnit = zeroPad(minutesUnit, 2);
- secondsUnit = zeroPad(secondsUnit, 2);
+ if (arguments.length == 2)
+ aMapTimeToClipId = arguments[1];
+ else
+ aMapTimeToClipId = true;
- var timeString = hoursUnit + ":" + minutesUnit + ":" + secondsUnit;
+ var timeString;
+ // Look for the time string in the clip list -- if it's there, use the anchor
+ // id of the clip for the time string, otherwise generate a npt hh:mm:ss time
+ // string.
+
+ var clip = activeClip(aTimeInSeconds);
+
+ if (aMapTimeToClipId && clip != undefined)
+ {
+ var clipId = clip.getAttribute("clip-id");
+ timeString = clipId;
+ }
+ else
+ {
+ var hoursUnit = parseInt( aTimeInSeconds / 3600 );
+ var minutesUnit = parseInt( (aTimeInSeconds / 60) % 60 );
+ var secondsUnit = aTimeInSeconds % 60;
+
+ hoursUnit = zeroPad(hoursUnit, 2);
+ minutesUnit = zeroPad(minutesUnit, 2);
+ secondsUnit = zeroPad(secondsUnit, 2);
+
+ timeString = hoursUnit + ":" + minutesUnit + ":" + secondsUnit;
+ }
+
return timeString;
}
Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.xul
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.xul 2005-02-06 10:53:44 UTC (rev 849)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.xul 2005-02-06 11:27:00 UTC (rev 850)
@@ -68,7 +68,7 @@
<textbox
multiline="false"
- cols="132"
+ cols="200"
flex="1"
id="media-url"
readonly="false"
@@ -97,7 +97,7 @@
<textbox
multiline="false"
- cols="132"
+ cols="200"
flex="1"
id="timed-media-url"
readonly="false"
--
andre
More information about the cvs-annodex
mailing list