[cvs-annodex] commit (/annodex):
AnnodexFirefoxExtension/trunk/chrome/afeview/content/MediaEngine.js
AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xbl
AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xul
AnnodexFirefoxExtension/trunk/chrome/afeview/content/contents.rdf
AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.js
AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.xul
AnnodexFirefoxExtension/trunk/chrome/afeview/skin/afeview.css
AnnodexFirefoxExtension/trunk/chrome/afeview/skin/contents.rdf
andre
nobody at lists.annodex.net
Sat Feb 5 01:41:07 EST 2005
Update of /annodex (new revision 829)
Modified files:
AnnodexFirefoxExtension/trunk/chrome/afeview/content/MediaEngine.js
AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xbl
AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xul
AnnodexFirefoxExtension/trunk/chrome/afeview/content/contents.rdf
AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.js
AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.xul
AnnodexFirefoxExtension/trunk/chrome/afeview/skin/afeview.css
AnnodexFirefoxExtension/trunk/chrome/afeview/skin/contents.rdf
Log Message:
AnnodexFirefoxExtension:
* Use VLC media engine on Linux
* Set svn:eol-style to native on relevant chrome files
Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/MediaEngine.js
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/MediaEngine.js 2005-02-03 19:19:49 UTC (rev 828)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/MediaEngine.js 2005-02-04 14:40:59 UTC (rev 829)
@@ -1,411 +1,411 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Annodex Firefox Extension.
- *
- * The Initial Developer of the Original Code is
- * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
- * Australia.
- * Portions created by the Initial Developer are Copyright (C) 2004-2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Andre Pang <andre.pang at csiro.au>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-// MediaEngine interface:
-// -
-// loadUrl
-// getCurrentTimeInSeconds
-// getStreamLengthInSeconds
-// setHRef
-// setTimeInSeconds
-// pause(event)
-// play(event)
-// stop(event)
-// goToBeginning(event)
-// goToEnd(event)
-
-
-VLCMediaEngine.videoViewXULElementName = "vlcview";
-function VLCMediaEngine (pluginObject)
-{
- this.pluginObject = pluginObject;
-
- this.loadUrl = function (url)
- {
- pluginObject.clear_playlist();
- pluginObject.add_item(url);
- pluginObject.play();
- return true;
- }
-
- this.getTimeInSeconds = function ()
- {
- return pluginObject.get_time();
- }
-
- this.getStreamLengthInSeconds = function ()
- {
- return pluginObject.get_length();
- }
-
- this.setHRef = function (href)
- {
- // VLC doesn't support clicking on the video view
- }
-
- this.pause = function ()
- {
- pluginObject.pause();
- }
-
- this.play = function ()
- {
- pluginObject.play();
- }
-
- this.stop = function ()
- {
- pluginObject.stop();
- }
-
- this.goToBeginning = function ()
- {
- pluginObject.seek(0, 0);
- }
-
- this.goToEnd = function ()
- {
- pluginObject.seek(pluginObject.get_length(), 0);
- }
-
- this.setTimeInSeconds = function (seconds)
- {
- pluginObject.seek(seconds, 0);
- }
-
- this.getVolume = function ()
- {
- return pluginObject.get_volume();
- }
-
- this.setVolume = function (aVolumeLevelBetween0And100)
- {
- pluginObject.set_volume(aVolumeLevelBetween0And100);
- }
-}
-
-
-DirectShowMediaEngine.videoViewXULElementName = "windowsmediaplayer7view";
-function DirectShowMediaEngine (pluginObject)
-{
- return WindowsMedia7MediaEngine(pluginObject);
-}
-
-
-WindowsMedia7MediaEngine.videoViewXULElementName = "windowsmediaplayer7view";
-function WindowsMedia7MediaEngine (pluginObject)
-{
- this.pluginObject = pluginObject;
-
- // Initialise Windows Media player window
- pluginObject.stretchToFit = true;
-
- this.loadUrl = function (url)
- {
- pluginObject.URL = url;
- return true;
- }
-
- this.getTimeInSeconds = function ()
- {
- return parseInt(pluginObject.controls.currentPosition);
- }
-
- this.getStreamLengthInSeconds = function ()
- {
- return parseInt(pluginObject.currentMedia.duration);
- }
-
- this.setHRef = function (href)
- {
- // -
- }
-
- this.pause = function ()
- {
- pluginObject.controls.pause();
- }
-
- this.play = function ()
- {
- pluginObject.controls.play();
- }
-
- this.stop = function ()
- {
- pluginObject.controls.stop();
- }
-
- this.goToBeginning = function ()
- {
- pluginObject.currentPosition = 0;
- }
-
- this.goToEnd = function ()
- {
- pluginObject.controls.currentPosition = pluginObject.currentMedia.duration;
- }
-
- this.setTimeInSeconds = function (seconds)
- {
- pluginObject.controls.currentPosition = seconds;
- }
-
- this.getVolume = function ()
- {
- return -1;
- }
-
- this.setVolume = function (aVolumeLevelBetween0And100)
- {
- return;
- }
-}
-
-
-// This constructor needs to be changed so that we use the proper Windows Media
-// Player 6.4 methods, rather than the WMP7 ones
-WindowsMedia64MediaEngine.videoViewXULElementName = "windowsmediaplayer64view";
-function WindowsMedia64MediaEngine (pluginObject)
-{
- this.pluginObject = pluginObject;
-
- // Initialise Windows Media player window
- pluginObject.stretchToFit = true;
-
- this.loadUrl = function (url)
- {
- pluginObject.Open(url);
- return true;
- }
-
- this.getTimeInSeconds = function ()
- {
- return parseInt(pluginObject.controls.currentPosition);
- }
-
- this.getStreamLengthInSeconds = function ()
- {
- return parseInt(pluginObject.currentMedia.duration);
- }
-
- this.setHRef = function (href)
- {
- // -
- }
-
- this.pause = function ()
- {
- pluginObject.controls.pause();
- }
-
- this.play = function ()
- {
- pluginObject.controls.play();
- }
-
- this.stop = function ()
- {
- pluginObject.controls.stop();
- }
-
- this.goToBeginning = function ()
- {
- pluginObject.currentPosition = 0;
- }
-
- this.goToEnd = function ()
- {
- pluginObject.controls.currentPosition = pluginObject.currentMedia.duration;
- }
-
- this.setTimeInSeconds = function (seconds)
- {
- pluginObject.controls.currentPosition = seconds;
- }
-
- this.getVolume = function ()
- {
- return -1;
- }
-
- this.setVolume = function (aVolumeLevelBetween0And100)
- {
- return;
- }
-}
-
-
-QuickTimeMediaEngine.videoViewXULElementName = "quicktimeview";
-function QuickTimeMediaEngine (pluginObject)
-{
- this.pluginObject = pluginObject;
-
- this.loadUrl = function (url)
- {
- // Replace .anx with .mpg to get the url for the MPEG
- var mpegUrl;
- mpegUrl = url.replace(/\.anx$/i, ".mpg");
- // XXX: Evil hack: get rid of -?k-?fps, for AAP-0409 media collection
- // (hooray for Perl regex syntax!)
- mpegUrl = mpegUrl.replace(/-\d+k-\d+fps/i, "");
-
- pluginObject.SetResetPropertiesOnReload(false);
- pluginObject.SetURL(mpegUrl);
- }
-
- this.getTimeInSeconds = function ()
- {
- try
- {
- return parseInt(pluginObject.GetTime() / pluginObject.GetTimeScale());
- }
- catch (error)
- {
- return undefined;
- }
- }
-
- this.getStreamLengthInSeconds = function ()
- {
- try
- {
- return parseInt(pluginObject.GetDuration() / pluginObject.GetTimeScale());
- }
- catch (error)
- {
- return undefined;
- }
- }
-
- this.setHRef = function (href)
- {
- try
- {
- pluginObject.SetHREF(href);
- }
- catch (error)
- {
- }
- }
-
- this.pause = function ()
- {
- pluginObject.Stop();
- }
-
- this.play = function ()
- {
- pluginObject.Play();
- }
-
- this.stop = function ()
- {
- pluginObject.Stop();
- pluginObject.SetTime(0);
- }
-
- this.goToBeginning = function ()
- {
- pluginObject.SetTime(0);
- }
-
- this.goToEnd = function ()
- {
- try
- {
- pluginObject.SetTime(pluginObject.GetMaxTimeLoaded() / pluginObject.GetTimeScale());
- }
- catch (error)
- {
- }
- }
-
- this.setTimeInSeconds = function (seconds)
- {
- try
- {
- var timeScale = pluginObject.GetTimeScale();
- var secondsLoaded = pluginObject.GetMaxTimeLoaded() / timeScale();
-
- if (seconds < secondsLoaded)
- {
- pluginObject.SetTime(seconds);
- }
-
- return true;
- }
- catch (error)
- {
- return false;
- }
- }
-
- this.getVolume = function ()
- {
- return -1;
- }
-
- this.setVolume = function (aVolumeLevelBetween0And100)
- {
- return;
- }
-}
-
-
-function canInstantiateMediaEngine (xulElementName)
-{
- var i;
- var foundPlugin = false;
-
- if (xulElementName == VLCMediaEngine.videoViewXULElementName)
- {
- for (i = 0; i < navigator.plugins.length; i++)
- {
- if (navigator.plugins[i].name == "VLC Annodex viewer plugin")
- {
- foundPlugin = true;
- break;
- }
- }
- }
-
- return foundPlugin;
-}
-
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Annodex Firefox Extension.
+ *
+ * The Initial Developer of the Original Code is
+ * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
+ * Australia.
+ * Portions created by the Initial Developer are Copyright (C) 2004-2005
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Andre Pang <andre.pang at csiro.au>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+// MediaEngine interface:
+// -
+// loadUrl
+// getCurrentTimeInSeconds
+// getStreamLengthInSeconds
+// setHRef
+// setTimeInSeconds
+// pause(event)
+// play(event)
+// stop(event)
+// goToBeginning(event)
+// goToEnd(event)
+
+
+VLCMediaEngine.videoViewXULElementName = "vlcview";
+function VLCMediaEngine (pluginObject)
+{
+ this.pluginObject = pluginObject;
+
+ this.loadUrl = function (url)
+ {
+ pluginObject.clear_playlist();
+ pluginObject.add_item(url);
+ pluginObject.play();
+ return true;
+ }
+
+ this.getTimeInSeconds = function ()
+ {
+ return pluginObject.get_time();
+ }
+
+ this.getStreamLengthInSeconds = function ()
+ {
+ return pluginObject.get_length();
+ }
+
+ this.setHRef = function (href)
+ {
+ // VLC doesn't support clicking on the video view
+ }
+
+ this.pause = function ()
+ {
+ pluginObject.pause();
+ }
+
+ this.play = function ()
+ {
+ pluginObject.play();
+ }
+
+ this.stop = function ()
+ {
+ pluginObject.stop();
+ }
+
+ this.goToBeginning = function ()
+ {
+ pluginObject.seek(0, 0);
+ }
+
+ this.goToEnd = function ()
+ {
+ pluginObject.seek(pluginObject.get_length(), 0);
+ }
+
+ this.setTimeInSeconds = function (seconds)
+ {
+ pluginObject.seek(seconds, 0);
+ }
+
+ this.getVolume = function ()
+ {
+ return pluginObject.get_volume();
+ }
+
+ this.setVolume = function (aVolumeLevelBetween0And100)
+ {
+ pluginObject.set_volume(aVolumeLevelBetween0And100);
+ }
+}
+
+
+DirectShowMediaEngine.videoViewXULElementName = "windowsmediaplayer7view";
+function DirectShowMediaEngine (pluginObject)
+{
+ return WindowsMedia7MediaEngine(pluginObject);
+}
+
+
+WindowsMedia7MediaEngine.videoViewXULElementName = "windowsmediaplayer7view";
+function WindowsMedia7MediaEngine (pluginObject)
+{
+ this.pluginObject = pluginObject;
+
+ // Initialise Windows Media player window
+ pluginObject.stretchToFit = true;
+
+ this.loadUrl = function (url)
+ {
+ pluginObject.URL = url;
+ return true;
+ }
+
+ this.getTimeInSeconds = function ()
+ {
+ return parseInt(pluginObject.controls.currentPosition);
+ }
+
+ this.getStreamLengthInSeconds = function ()
+ {
+ return parseInt(pluginObject.currentMedia.duration);
+ }
+
+ this.setHRef = function (href)
+ {
+ // -
+ }
+
+ this.pause = function ()
+ {
+ pluginObject.controls.pause();
+ }
+
+ this.play = function ()
+ {
+ pluginObject.controls.play();
+ }
+
+ this.stop = function ()
+ {
+ pluginObject.controls.stop();
+ }
+
+ this.goToBeginning = function ()
+ {
+ pluginObject.currentPosition = 0;
+ }
+
+ this.goToEnd = function ()
+ {
+ pluginObject.controls.currentPosition = pluginObject.currentMedia.duration;
+ }
+
+ this.setTimeInSeconds = function (seconds)
+ {
+ pluginObject.controls.currentPosition = seconds;
+ }
+
+ this.getVolume = function ()
+ {
+ return -1;
+ }
+
+ this.setVolume = function (aVolumeLevelBetween0And100)
+ {
+ return;
+ }
+}
+
+
+// This constructor needs to be changed so that we use the proper Windows Media
+// Player 6.4 methods, rather than the WMP7 ones
+WindowsMedia64MediaEngine.videoViewXULElementName = "windowsmediaplayer64view";
+function WindowsMedia64MediaEngine (pluginObject)
+{
+ this.pluginObject = pluginObject;
+
+ // Initialise Windows Media player window
+ pluginObject.stretchToFit = true;
+
+ this.loadUrl = function (url)
+ {
+ pluginObject.Open(url);
+ return true;
+ }
+
+ this.getTimeInSeconds = function ()
+ {
+ return parseInt(pluginObject.controls.currentPosition);
+ }
+
+ this.getStreamLengthInSeconds = function ()
+ {
+ return parseInt(pluginObject.currentMedia.duration);
+ }
+
+ this.setHRef = function (href)
+ {
+ // -
+ }
+
+ this.pause = function ()
+ {
+ pluginObject.controls.pause();
+ }
+
+ this.play = function ()
+ {
+ pluginObject.controls.play();
+ }
+
+ this.stop = function ()
+ {
+ pluginObject.controls.stop();
+ }
+
+ this.goToBeginning = function ()
+ {
+ pluginObject.currentPosition = 0;
+ }
+
+ this.goToEnd = function ()
+ {
+ pluginObject.controls.currentPosition = pluginObject.currentMedia.duration;
+ }
+
+ this.setTimeInSeconds = function (seconds)
+ {
+ pluginObject.controls.currentPosition = seconds;
+ }
+
+ this.getVolume = function ()
+ {
+ return -1;
+ }
+
+ this.setVolume = function (aVolumeLevelBetween0And100)
+ {
+ return;
+ }
+}
+
+
+QuickTimeMediaEngine.videoViewXULElementName = "quicktimeview";
+function QuickTimeMediaEngine (pluginObject)
+{
+ this.pluginObject = pluginObject;
+
+ this.loadUrl = function (url)
+ {
+ // Replace .anx with .mpg to get the url for the MPEG
+ var mpegUrl;
+ mpegUrl = url.replace(/\.anx$/i, ".mpg");
+ // XXX: Evil hack: get rid of -?k-?fps, for AAP-0409 media collection
+ // (hooray for Perl regex syntax!)
+ mpegUrl = mpegUrl.replace(/-\d+k-\d+fps/i, "");
+
+ pluginObject.SetResetPropertiesOnReload(false);
+ pluginObject.SetURL(mpegUrl);
+ }
+
+ this.getTimeInSeconds = function ()
+ {
+ try
+ {
+ return parseInt(pluginObject.GetTime() / pluginObject.GetTimeScale());
+ }
+ catch (error)
+ {
+ return undefined;
+ }
+ }
+
+ this.getStreamLengthInSeconds = function ()
+ {
+ try
+ {
+ return parseInt(pluginObject.GetDuration() / pluginObject.GetTimeScale());
+ }
+ catch (error)
+ {
+ return undefined;
+ }
+ }
+
+ this.setHRef = function (href)
+ {
+ try
+ {
+ pluginObject.SetHREF(href);
+ }
+ catch (error)
+ {
+ }
+ }
+
+ this.pause = function ()
+ {
+ pluginObject.Stop();
+ }
+
+ this.play = function ()
+ {
+ pluginObject.Play();
+ }
+
+ this.stop = function ()
+ {
+ pluginObject.Stop();
+ pluginObject.SetTime(0);
+ }
+
+ this.goToBeginning = function ()
+ {
+ pluginObject.SetTime(0);
+ }
+
+ this.goToEnd = function ()
+ {
+ try
+ {
+ pluginObject.SetTime(pluginObject.GetMaxTimeLoaded() / pluginObject.GetTimeScale());
+ }
+ catch (error)
+ {
+ }
+ }
+
+ this.setTimeInSeconds = function (seconds)
+ {
+ try
+ {
+ var timeScale = pluginObject.GetTimeScale();
+ var secondsLoaded = pluginObject.GetMaxTimeLoaded() / timeScale();
+
+ if (seconds < secondsLoaded)
+ {
+ pluginObject.SetTime(seconds);
+ }
+
+ return true;
+ }
+ catch (error)
+ {
+ return false;
+ }
+ }
+
+ this.getVolume = function ()
+ {
+ return -1;
+ }
+
+ this.setVolume = function (aVolumeLevelBetween0And100)
+ {
+ return;
+ }
+}
+
+
+function canInstantiateMediaEngine (xulElementName)
+{
+ var i;
+ var foundPlugin = false;
+
+ if (xulElementName == VLCMediaEngine.videoViewXULElementName)
+ {
+ for (i = 0; i < navigator.plugins.length; i++)
+ {
+ if (navigator.plugins[i].name == "VLC Annodex viewer plugin")
+ {
+ foundPlugin = true;
+ break;
+ }
+ }
+ }
+
+ return foundPlugin;
+}
+
Property changes on: AnnodexFirefoxExtension/trunk/chrome/afeview/content/MediaEngine.js
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js 2005-02-03 19:19:49 UTC (rev 828)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js 2005-02-04 14:40:59 UTC (rev 829)
@@ -1,1038 +1,1035 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Annodex Firefox Extension.
- *
- * The Initial Developer of the Original Code is
- * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
- * Australia.
- * Portions created by the Initial Developer are Copyright (C) 2004-2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Andre Pang <andre.pang at csiro.au>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-var MediaEngine;
-
-const CLIP_ID_PREFIX = "clip-start-time-";
-
-// Mozilla component names
-const RDF_SERVICE = "@mozilla.org/rdf/rdf-service;1";
-const RDF_CONTAINER_UTILITIES = "@mozilla.org/rdf/container-utils;1";
-const RDF_IN_MEMORY_DATASOURCE = "@mozilla.org/rdf/datasource;1?name=in-memory-datasource";
-const STANDARD_URL = "@mozilla.org/network/standard-url;1";
-
-var CMMLRequest; // TODO: Eliminate this global variable (how do I pass a callback with the request as a parameter to onreadystatechange?)
-
-var SourceURL;
-var MediaURL;
-
-var InterfaceUpdateTimer;
-
-var Clips;
-var LoadedAllClips = false;
-var RequestedFragment = undefined;
-
-var PreviouslyActive = undefined;
-
-function AFEViewInterfaceLoaded ()
-{
- // Use the information after the search portion of the URL (the bit after
- // '?') as the URL for the Annodex file we want to load
- SourceURL = document.location.search;
- SourceURL = SourceURL.slice(1); // Get rid of the '?' prefix
-
- dump('AFEView: document location is "' + document.location + '"\n');
-
- // Strip off the fragment from the URL if one exists, and save it for later
- // use
- if (document.location.hash.indexOf("#") != -1)
- {
- RequestedFragment = document.location.hash.slice(1);
- }
-
- if (!isCMML(SourceURL))
- {
- // Source URL isn't a CMML file -- need to set the media URL
- dump("Is not CMML\n");
- MediaURL = SourceURL;
- }
-
- dump("Source URL is " + SourceURL + "\n");
- dump("Media URL is " + MediaURL + "\n");
-
- // Use QuickTime, VLC for DirectShow media playback? (See MediaEngine.js
- // for the list of media engines)
- var videoView;
- var videoViewBox = document.getElementById("video-view-box");
- var mediaEngineConstructor;
-
- switch (navigator.platform)
- {
- case "Win32":
- mediaEngineConstructor = VLCMediaEngine;
- break;
- case "MacPPC":
- mediaEngineConstructor = VLCMediaEngine;
- //mediaEngineConstructor = QuickTimeMediaEngine;
- break;
- default:
- alert("Annodex playback is not yet supported on your operating system " +
- "(\"" + navigator.platform + "\")");
- break;
- }
-
- // Check whether we can actually instantiate our chosen media engine
- if (!canInstantiateMediaEngine(mediaEngineConstructor.videoViewXULElementName))
- {
- alert("The Annodex viewer plugin ("
- + mediaEngineConstructor.videoViewXULElementName
- + ") was not found. Please reinstall the Annodex Firefox "
- + "Extension.");
- return;
- }
-
- // Create the media engine and its associated view
- var videoViewContainer = document.createElement(mediaEngineConstructor.videoViewXULElementName);
- if (videoViewContainer == undefined)
- {
- // This should never happen
- alert("Couldn't create videoViewContainer");
- }
- videoViewBox.appendChild(videoViewContainer);
- videoView = document.getElementById("video-view");
- MediaEngine = new mediaEngineConstructor(videoView);
- updateVideoViewSize();
- window.onresize = pageDidResize;
-
- if (videoView == undefined)
- {
- // Should _never_ get here!
- alert("Couldn't instantiate a video view for the media engine: please report this as a bug to Andre.Pang at csiro.au");
- }
-
- retrieveTableOfContents();
-
- // If the source is _not_ a CMML file, then it's media: load it and play it
- // now. If the source is CMML, the CMML needs to be examined first to look
- // for the import/src tag, so cmmlRequestStatusChanged() will load the URL
- // for us.
- var urlToLoad = MediaURL;
- if (!isCMML(urlToLoad))
- {
- void(MediaEngine.loadUrl(urlToLoad));
- }
-
- // TODO: Broadcast an event which signifies the movie's been loaded
-
- // Now that the movie's loaded, start updating the interface
- InterfaceUpdateTimer = window.setTimeout("updateInterface()", 1000);
- AFEViewEnableMovieControls();
-}
-
-function updateInterface ()
-{
- var videoView = document.getElementById("video-view");
- var timeInSeconds;
- var streamLengthInSeconds;
- var active; // the active clip
-
- // Set the current time and stream length labels
-
- timeInSeconds = MediaEngine.getTimeInSeconds();
- streamLengthInSeconds = MediaEngine.getStreamLengthInSeconds();
-
- var currentTimeLabel = document.getElementById("current-time");
- var mediaLoadingThrobber = document.getElementById("media-loading-throbber-box");
-
- // Convert seconds into MM:SS display, guarding against invalid times
- const MAX_TIME_IN_SECONDS_THRESHOLD = 1000000;
-
- // TODO: This should really check whether timeInSeconds is >= 0, not > 0, but
- // the VLC media engine returns 0 instead of -1 when there's no time to
- // display. Maybe this should be fixed up in VLC?
- if (timeInSeconds != undefined
- && timeInSeconds > 0
- && streamLengthInSeconds >= 0
- && timeInSeconds < MAX_TIME_IN_SECONDS_THRESHOLD)
- {
- var timeDisplay = seconds2MMSSDisplay(timeInSeconds);
- currentTimeLabel.setAttribute("value", timeDisplay);
- currentTimeLabel.setAttribute("hidden", false);
- mediaLoadingThrobber.setAttribute("hidden", true);
- }
- else
- {
- currentTimeLabel.setAttribute("hidden", true);
- }
-
- if (streamLengthInSeconds != undefined
- && streamLengthInSeconds > 0
- && streamLengthInSeconds < MAX_TIME_IN_SECONDS_THRESHOLD)
- {
- var streamLengthDisplay = seconds2MMSSDisplay(streamLengthInSeconds);
- currentTimeLabel.setAttribute("value",
- currentTimeLabel.getAttribute("value") + " / " + streamLengthDisplay);
- }
-
- // Highlight the active clip in the table of contents display
- var clip;
- if (LoadedAllClips)
- {
- for (var i = 0; i < Clips.length; i++)
- {
- var clipStartTime = Clips[i];
- clip = document.getElementById(CLIP_ID_PREFIX + clipStartTime);
- // TODO: This should really be specified via CSS
- clip.setAttribute("style", "");
- }
-
- var followModeCheckbox = document.getElementById("follow-mode-checkbox");
- var toc = document.getElementById("clips");
-
- active = activeClip(timeInSeconds);
- if (active != undefined)
- {
- active.setAttribute("style", "color: #0000ff;");
-
- // Also select the active clip if follow mode is on
- if (followModeCheckbox.getAttribute("checked") == "true") toc.selectedItem = active;
- }
- else
- {
- if (followModeCheckbox.getAttribute("checked") == "true") toc.clearSelection();
- }
- }
-
- // Display the appropriate anchor text
-
- var activeAnchorText;
- var activeAnchorHref;
- if (active != undefined)
- {
- activeAnchorText = active.getAttribute("clip-anchor-text");
- activeAnchorHref = active.getAttribute("clip-anchor-href");
- }
- else
- {
- activeAnchorText = "";
- activeAnchorHref = "";
- }
-
- if (active != PreviouslyActive)
- {
- var activeAnchorTextDescription = document.getElementById("active-anchor-text");
- var hyperlink = createHyperlink(activeAnchorHref, activeAnchorText);
- activeAnchorTextDescription.replaceChild(hyperlink, activeAnchorTextDescription.firstChild);
- PreviouslyActive = active;
- }
-
- // Update media engine's HRef parameter, so that we can go to a new
- // hyperlink if we click on the movie view itself (if the media engine
- // supports this capability, anyway)
- if (active != undefined)
- {
- if (activeAnchorHref.indexOf(".anx") != -1)
- MediaEngine.setHRef("chrome://afeview/content/afeview.xul?"
- + resolveURL(SourceURL, activeAnchorHref));
- else
- MediaEngine.setHRef(activeAnchorHref);
- }
-
- // If the user asked to go to a particular fragment, try to go to it
- if (LoadedAllClips && RequestedFragment != undefined)
- {
- var secondsToGoTo = parseInt(parseTime(RequestedFragment));
-
- if (isNaN(secondsToGoTo))
- {
- // The fragment is not a number, so look it up and find out the
- // start time of that clip
- for (var j = 0; j < Clips.length; j++)
- {
- clip = document.getElementById(CLIP_ID_PREFIX + Clips[j]);
- var clipId = clip.getAttribute("clip-id");
-
- if (clipId == RequestedFragment)
- {
- secondsToGoTo = clip.getAttribute("start");
- break;
- }
- }
-
- // If, after iterating through the clip list, we still haven't managed
- // a matching clip, then the URL referred to a non-existent clip or
- // something else weirdass. Don't try searching any more!
- if (isNaN(secondsToGoTo))
- {
- RequestedFragment = undefined;
- }
- }
-
- // After looking through the clip list, let's see if our search for a
- // clip's start time was successful. If so, jump to it!
- if (!isNaN(secondsToGoTo))
- {
- if (seekTo(secondsToGoTo))
- {
- RequestedFragment = undefined;
- }
- }
- }
-
- // All to happen again 500ms later ...
-
- // Update status bar to indicate everything's OK
- //window.status = "Done";
-
- InterfaceUpdateTimer = window.setTimeout("updateInterface()", 500);
-}
-
-function activeClip (timeInSeconds)
-{
- var clipIndex;
-
- clipIndex = activeClipIndex(timeInSeconds);
- if (clipIndex == undefined)
- {
- return undefined;
- }
- else
- {
- var clipStartTime = Clips[clipIndex];
-
- return document.getElementById(CLIP_ID_PREFIX + clipStartTime);
- }
-}
-
-function activeClipIndex (timeInSeconds)
-{
- var activeClipIndex;
-
- if (!LoadedAllClips || timeInSeconds == undefined)
- return undefined;
-
- // We iterate _backward_ through the Clips array, comparing the current time
- // against every clip. If the current time is greater than or equal to than
- // the time of the current clip being compared again, then it's the active one
- // -
- // TODO: this should really be O(1) instead of O(n), since it's often called
- // in loops which are O(n), thereby making total performance O(n^2) ... but
- // eh, we'll leave optimisation for later, huh?
- // -
- for (var i = Clips.length - 1; i >= 0; i--)
- {
- var clipStartTime = Clips[i];
-
- if (parseInt(timeInSeconds) >= parseInt(clipStartTime))
- {
- activeClipIndex = i;
- break;
- }
- }
-
- return activeClipIndex;
-}
-
-function seconds2MMSSDisplay (time)
-{
- var minutes = parseInt(time / 60);
- var seconds = parseInt(time % 60);
-
- // 0-pad, the tedious way ...
- if (minutes < 10)
- {
- minutes = "0" + minutes;
- }
-
- if (seconds < 10)
- {
- seconds = "0" + seconds;
- }
-
- return (minutes + ":" + seconds);
-}
-
-function retrieveTableOfContents ()
-{
- // Create a HTTP request for the CMML content
- CMMLRequest = new XMLHttpRequest();
- CMMLRequest.multiPart = false;
- CMMLRequest.onreadystatechange = cmmlRequestStatusChanged;
-
- CMMLRequest.open("GET", SourceURL);
- CMMLRequest.setRequestHeader("Accept", "text/x-cmml");
-
- CMMLRequest.send("");
-}
-
-function cmmlRequestStatusChanged ()
-{
- // N.B. readyState can be 0:uninitialised, 1:loading, 2:loaded, 3:interactive, 4:complete
-
- // If the request for the CMML is complete ...
- if (CMMLRequest.readyState >= 3)
- {
- var clipDescription = document.getElementById("toc-clip-description");
-
- // ... and the request loaded succesfully (HTTP 200 "OK" response)
- if (CMMLRequest.status == 200)
- {
- // At this point, CMMLRequest.responseXML is null -- we seem to need to
- // parse it manually from the responseText ...
-
- // Transform the CMML to CMML in RDF
- cmml2RDF(CMMLRequest.responseText);
- }
-
- if (!LoadedAllClips)
- {
- var boohooOutput = ("There was a problem retrieving this movie file's " +
- "table of contents. The server returned an HTTP error code of " +
- CMMLRequest.status + " (" + CMMLRequest.statusText + ").");
- clipDescription.firstChild.nodeValue = boohooOutput;
- }
-
- // Turn the progress meter off
- var tableOfContentsIsActiveBroadcaster = document.getElementById("tableOfContentsIsActive");
- tableOfContentsIsActiveBroadcaster.setAttribute("isActive", "true");
- enableTableOfContentsDisplay();
-
- // Load the media if this is the source URL
- if (isCMML(SourceURL))
- {
- dump(".......... Loading MediaURL: " + MediaURL + "\n");
- void(MediaEngine.loadUrl(MediaURL));
- }
- }
-}
-
-function cmml2RDF (cmmlString)
-{
- var parser = new DOMParser();
- var cmmlXML = parser.parseFromString(cmmlString, "text/xml");
-
- // Pivot cmmlXML DOM so that we begin with the <cmml> node
- cmmlXML = cmmlXML.childNodes[0];
-
- // Create RDF services objects
- var rdfService = Components.classes[RDF_SERVICE].getService(Components.interfaces.nsIRDFService);
- var rdfContainerUtilities = Components.classes[RDF_CONTAINER_UTILITIES].getService(Components.interfaces.nsIRDFContainerUtils);
-
- // Create the clips datasource
- var clips = Components.classes[RDF_IN_MEMORY_DATASOURCE].createInstance(Components.interfaces.nsIRDFDataSource);
-
- // Create a root note, a url:clips-root sequence container for it, and insert
- // it into the clips datasource
- var root = rdfService.GetResource("urn:root");
- var clipsSequenceResource = rdfService.GetResource("urn:clips-root");
- var clipsSequence = rdfContainerUtilities.MakeSeq(clips, clipsSequenceResource);
- clips.Assert(root, rdfService.GetAnonymousResource(), clipsSequenceResource, true);
-
- // Create an empty Clips array
- Clips = new Array();
-
- // Iterate over the nodes in the CMML/XML document, and create the RDF
- // datasource from that
- var child;
- for (var i = 0; i < cmmlXML.childNodes.length; i++)
- {
- child = cmmlXML.childNodes[i];
-
- var j;
- if (child.tagName == "head")
- {
- // Found a <head> tag: search for <title>
- for (j = 0; j < child.childNodes.length; j++)
- {
- var subchild = child.childNodes[j];
-
- if (subchild.tagName == "title")
- {
- var title = subchild.firstChild.nodeValue;
- document.title = title;
- }
- }
- }
- else if (child.tagName == "clip")
- {
- var descriptionNode = cmmlClipNode2RdfNode(child, clips, rdfService);
- clipsSequence.AppendElement(descriptionNode);
- }
- else if (child.tagName == "stream" && isCMML(SourceURL))
- {
- // n.b. We need the isCMML(SourceURL) check above, because if we request
- // a .anx resource with the "Accept: text/x-cmml" HTTP header set,
- // mod_annodex will serve out the original CMML file -- with the stream
- // and import tags included! This really should be fixed in mod_annodex,
- // but it's prudent to ignore the stream tag if we ever receive it in the
- // Annodex stream anyway, since it's really not meant to be there.
-
- // Look for an <import> tag
- for (j = 0; j < child.childNodes.length; j++)
- {
- var subchild = child.childNodes[j];
- var foundAtLeastOneImportSrc = false;
-
- if (subchild.tagName == "import")
- {
- // Found an <import> tag -- ensure we've found only one
- if (foundAtLeastOneImportSrc)
- {
- // We've found more than one <import> tag
- var errorOutput = "There is more than one <import> tag in the "
- + "CMML file. The Annodex Viewer for Firefox can currently "
- + "only process CMML files with exactly one <import> tag."
- var clipDescription = document
- .getElementById("toc-clip-description");
- clipDescription.firstChild.nodeValue = errorOutput;
-
- // Return early: callers of this function should check the
- // LoadedAllClips global variable to see whether we were
- // successful or not. TODO: Maybe we should make this function
- // return a boolean instead, indicating success or failure?
- return;
- }
-
- var importSrc = subchild.getAttribute("src");
- MediaURL = resolveURL(SourceURL, importSrc);
-
- dump("***** Resolved MediaURL to " + MediaURL + "\n");
-
- foundAtLeastOneImportSrc = true;
- }
- }
- }
- }
-
- // Add our data source to the clip list
- var clipsList = document.getElementById("clips");
- clipsList.database.AddDataSource(clips);
- clipsList.builder.rebuild();
-
- LoadedAllClips = true;
-}
-
-function cmmlClipNode2RdfNode (clipNode, clips)
-{
- var id, start, anchorText, anchorHRef, imageSource, description, title;
-
- // Get "start" attribute
- start = clipNode.getAttribute("start");
-
- start = parseTime (start);
-
- // Get "id" attribute
- id = clipNode.getAttribute("id");
-
- // Look for "a", "desc", "img", "meta" tags
- for (var i = 0; i < clipNode.childNodes.length; i++)
- {
- var subchild = clipNode.childNodes[i];
-
- if (subchild.tagName == "a")
- {
- anchorText = subchild.firstChild.nodeValue;
- anchorHRef = subchild.getAttribute("href");
- }
- else if (subchild.tagName == "desc")
- {
- description = subchild.firstChild.nodeValue;
- }
- else if (subchild.tagName == "img")
- {
- imageSource = resolveURL(SourceURL, subchild.getAttribute("src"));
- }
- else if (subchild.tagName == "meta")
- {
- if (subchild.getAttribute("name") == "title")
- {
- title = subchild.getAttribute("content");
- }
- }
- }
-
- // Create an anonymous description node
- var rdfService = Components.classes[RDF_SERVICE].getService(Components.interfaces.nsIRDFService);
- var descriptionNode = rdfService.GetResource(CLIP_ID_PREFIX + start);
-
- function createNamedResource(key, value)
- {
- if (value != undefined)
- {
- // Create named resource and link it to the description node
- var resource = rdfService.GetResource("http://www.annodex.net/cmml/rdf#" + key);
- var lit = rdfService.GetLiteral(value);
- clips.Assert(descriptionNode, resource, lit, true);
- }
- }
-
- // createNamedResource("id", CLIP_ID_PREFIX + start);
- createNamedResource("clip-id", id);
- createNamedResource("start", start);
- createNamedResource("anchor-text", anchorText);
- createNamedResource("anchor-href", anchorHRef);
- createNamedResource("img-src", imageSource);
- createNamedResource("description", description);
-
- if (title != undefined)
- {
- createNamedResource("title", title);
- }
- else
- {
- // No title found: use a shortened version of the clip description
- if (description != undefined)
- {
- const MAX_TITLE_LENGTH = 65;
-
- if (description.length > MAX_TITLE_LENGTH)
- {
- var shortenedDescription = description.slice(0, MAX_TITLE_LENGTH)
- + "\u2026" // ellipsis
- createNamedResource("title", shortenedDescription);
- }
- else
- {
- createNamedResource("title", description);
- }
- }
- }
-
- // Add the start time of the clip to the global Clips array, so it's easy to
- // iterate and search for clips by time. This can also be used to look up
- // the clip id tag (via CLIP_ID_PREFIX)
- Clips.push(start);
-
- return descriptionNode;
-}
-
-function AFEViewEnableMovieControls ()
-{
- var movieIsActiveBroadcaster = document.getElementById("movieIsActive");
- movieIsActiveBroadcaster.setAttribute("isActive", "true");
- movieIsActiveBroadcaster.setAttribute("isPlaying", "true");
- movieIsActiveBroadcaster.setAttribute("disabled", "false");
-}
-
-function clipContextShowHyperlink ()
-{
- var activeDescriptionLabel = document.getElementById("active-description");
- activeDescriptionLabel.setAttribute("hidden", "true");
- var activeAnchorTextLabel = document.getElementById("active-anchor-text");
- activeAnchorTextLabel.setAttribute("hidden", "false");
-
- var hyperlinkOrClipInfoMenu = document.getElementById("hyperlink_or_clip_description_menu");
- hyperlinkOrClipInfoMenu.setAttribute("label", "Hyperlink"); // TODO: i18n this
-}
-
-function clipContextViewShowCurrentClipInformation ()
-{
- var activeDescriptionLabel = document.getElementById("active-description");
- activeDescriptionLabel.setAttribute("hidden", "false");
- var activeAnchorTextLabel = document.getElementById("active-anchor-text");
- activeAnchorTextLabel.setAttribute("hidden", "true");
-
- var hyperlinkOrClipInfoMenu = document.getElementById("hyperlink_or_clip_description_menu");
- hyperlinkOrClipInfoMenu.setAttribute("label", "Clip Info"); // TODO: i18n this
-}
-
-function clipSelected (event)
-{
- var toc = document.getElementById("clips");
- var clipDescription = document.getElementById("toc-clip-description");
- var clipAnchorText = document.getElementById("toc-clip-anchor-text");
-
- if (toc.selectedItem == null)
- {
- clipDescription.firstChild.nodeValue = "";
- clipAnchorText.firstChild.nodeValue = "";
- clipAnchorText.setAttribute("tooltiptext", "");
-
- return;
- }
-
- // Get the currently selected clip in the TOC
- var selectedClip = toc.selectedItem;
-
- // Update the clip description to reflect the currently selected clip
- clipDescription.firstChild.nodeValue = selectedClip.getAttribute("clip-description");
-
- // Update the clip anchor text to reflect the currently selected clip
- var hyperlink = createHyperlink(selectedClip.getAttribute("clip-anchor-href"),
- selectedClip.getAttribute("clip-anchor-text"));
- clipAnchorText.replaceChild(hyperlink, clipAnchorText.firstChild);
-
- // If the clip selected is not the currently active one, turn off follow mode
- var followModeCheckbox = document.getElementById("follow-mode-checkbox");
-
- var theActiveClip = activeClip(MediaEngine.getTimeInSeconds());
- if (selectedClip != theActiveClip)
- {
- followModeCheckbox.setAttribute("checked", "false");
- }
-}
-
-function updatePlayPauseButtons ()
-{
- var playButton = document.getElementById("transport-play-button");
- var pauseButton = document.getElementById("transport-pause-button");
-
- var isPlaying = document.getElementById("movieIsPlaying").getAttribute("isPlaying");
-
- if (isPlaying == "true")
- {
- // Movie is playing: hide the play button, and unhide the pause button
- playButton.setAttribute("hidden", "true");
- pauseButton.setAttribute("hidden", "false");
- }
- else
- {
- // Movie is paused: hide the pause button, and unhide the play button
- playButton.setAttribute("hidden", "false");
- pauseButton.setAttribute("hidden", "true");
- }
-}
-
-// -
-// Transport functions
-// -
-
-function transportPause (event)
-{
- var movieIsPlayingBroadcaster = document.getElementById("movieIsPlaying");
- movieIsPlayingBroadcaster.setAttribute("isPlaying", "false");
-
- MediaEngine.pause();
-}
-
-function transportPlay (event)
-{
- var movieIsPlayingBroadcaster = document.getElementById("movieIsPlaying");
- movieIsPlayingBroadcaster.setAttribute("isPlaying", "true");
-
- MediaEngine.play();
-}
-
-function transportStop (event)
-{
- var movieIsPlayingBroadcaster = document.getElementById("movieIsPlaying");
- movieIsPlayingBroadcaster.setAttribute("isPlaying", "false");
-
- MediaEngine.stop();
-}
-
-function transportGoToBeginning (event)
-{
- MediaEngine.goToBeginning();
- transportPlay(event);
-}
-
-function transportGoToEnd (event)
-{
- MediaEngine.goToEnd();
-}
-
-function transportGoToPreviousClip (event)
-{
- var timeInSeconds = MediaEngine.getTimeInSeconds();
-
- var currentClipIndex = activeClipIndex(timeInSeconds);
- if (currentClipIndex > 0)
- {
- var previousClipStartTime = Clips[currentClipIndex - 1];
-
- displayMediaLoadingThrobber();
-
- // TODO: Should probably use the followHyperlink() function to do this ...
- void(seekTo(previousClipStartTime));
- }
- else
- {
- transportGoToBeginning(event);
- }
-}
-
-function transportGoToNextClip (event)
-{
- var timeInSeconds = MediaEngine.getTimeInSeconds();
-
- var currentClipIndex = activeClipIndex(timeInSeconds);
- if (currentClipIndex < Clips.length - 1)
- {
- var nextClipStartTime = Clips[currentClipIndex + 1];
-
- displayMediaLoadingThrobber();
-
- void(seekTo(nextClipStartTime));
- }
- else
- {
- transportGoToEnd(event);
- }
-}
-
-function transportGoToClip (event)
-{
- var clipStart = event.target.getAttribute("clip-start");
-
- displayMediaLoadingThrobber();
-
- void(seekTo(clipStart));
-
- var followModeCheckbox = document.getElementById("follow-mode-checkbox");
- followModeCheckbox.setAttribute("checked", "true");
-}
-
-function enableTableOfContentsDisplay ()
-{
- var progressMeter = document.getElementById("toc-loading-progress");
- var clipDescriptionBox = document.getElementById("toc-clip-info-box");
- // var clipDescription = document.getElementById("toc-clip-description");
-
- var isPlaying = document.getElementById("tableOfContentsIsActive").getAttribute("isActive");
-
- if (isPlaying == "true")
- {
- progressMeter.setAttribute("hidden", "true");
- clipDescriptionBox.setAttribute("hidden", "false");
- // clipDescription.setAttribute("hidden", "false");
- }
- else
- {
- progressMeter.setAttribute("hidden", "false");
- // clipDescription.setAttribute("hidden", "true");
- }
-}
-
-function activateSelectedClipHyperlink (event)
-{
- // Ignore the event unless we clicked the mouse with button 0
- // and the Ctrl key wasn't pressed
- if (!(event.button == 0 && event.ctrlKey == false)) return false;
-
- // Get the currently selected clip in the TOC
- var toc = document.getElementById("clips");
- var selectedClip = toc.currentItem;
-
- followHyperlink(selectedClip.getAttribute("clip-anchor-href"));
-
- return true;
-}
-
-function activateActiveHyperlink (event)
-{
- // Ignore the event unless we clicked the mouse with button 0
- // and the Ctrl key wasn't pressed
- if (!(event.button == 0 && event.ctrlKey == false)) return false;
-
- var timeInSeconds = MediaEngine.getTimeInSeconds();
- followHyperlink(activeClip(timeInSeconds).getAttribute("clip-anchor-href"));
-
- return true;
-}
-
-function followHyperlink (aHref)
-{
- var href = resolveURL(SourceURL, aHref);
-
- // Change any server-side ?t= time URI schemes to a client-side # scheme
- href = href.replace(/\?t\=/, "#");
-
- // Store a URL with a timed URI 2 seconds before the user followed the
- // hyperlink, so we get a bit of context back. (This improves usability
- // for me, anyway ...)
- var timeInSeconds = MediaEngine.getTimeInSeconds() - 2;
- if (timeInSeconds < 0) timeInSeconds = 0;
- var currentURL = document.location.href.replace(/#.*$/, "") + "#" + timeInSeconds;
-
- // Ooo looky here, evil hack! Mozilla's content loading doesn't actually
- // re-load the XUL interface if you replace the current URL with exactly the
- // same one, but with only the fragment changed. So, we just replace
- // the current history entry with the new URL containing the time, _then_
- // follow the hyperlink. Much, much easier than playing around with
- // nsIHistory and friends!
- document.location.replace(currentURL);
-
- displayMediaLoadingThrobber();
-
- document.location.href = href;
-}
-
-function pageDidResize ()
-{
- updateVideoViewSize();
-}
-
-function updateVideoViewSize ()
-{
- var videoViewBox = document.getElementById("video-view-box");
- var videoView = document.getElementById("video-view");
-
- videoView.setAttribute("height", videoViewBox.boxObject.height);
- videoView.setAttribute("width", videoViewBox.boxObject.width);
-}
-
-function resolveURL (baseURL, url)
-{
- // Get Mozilla's URI component to resolve the path for us. Yay for not
- // reinventing the wheel!
-
- var uriComponent = Components.classes[STANDARD_URL]
- .getService(Components.interfaces.nsIURI);
- uriComponent.spec = baseURL;
- return uriComponent.resolve(url);
-}
-
-function hideOrShowClipList ()
-{
- var tableOfContentsBox = document.getElementById("table-of-contents-box");
-
- var tableOfContentsIsHidden = tableOfContentsBox.getAttribute("collapsed");
- if (tableOfContentsIsHidden)
- {
- tableOfContentsBox.setAttribute("collapsed", "false");
- }
- else
- {
- tableOfContentsBox.setAttribute("collapsed", "true");
- }
-}
-
-function displayMediaLoadingThrobber ()
-{
- var currentTimeLabel = document.getElementById("current-time");
- currentTimeLabel.setAttribute("hidden", true);
-
- var mediaLoadingThrobber = document.getElementById("media-loading-throbber-box");
- mediaLoadingThrobber.setAttribute("hidden", false);
-}
-
-// TODO: Can we check the document's MIME type to see whether it's CMML,
-// rather than checking by the file extension?
-function isCMML (aURL)
-{
- return (SourceURL.indexOf(".cmml") == (SourceURL.length - 5));
-}
-
-function seekTo (aTimeInSeconds)
-{
- if (useServerSideSeeking(MediaURL))
- {
- return MediaEngine.loadUrl(MediaURL + "?t=" + aTimeInSeconds);
- }
- else
- {
- MediaEngine.setTimeInSeconds(aTimeInSeconds);
- }
-}
-
-function useServerSideSeeking (aURL)
-{
- // Use server-side seeking if we're playing back an Annodex file over http.
- // We should really be more accurate than this, but for now, it's the only
- // indicator we've got ...
-
- return ( aURL.indexOf("http" == 0)
- && ( aURL.indexOf(".anx") == aURL.length - 4
- || aURL.indexOf(".axv") == aURL.length - 4
- || aURL.indexOf(".axa") == aURL.length - 4
- )
- );
-}
-
-function createHyperlink (aHref, aAnchorText)
-{
- var domNode;
-
- if (aAnchorText != "")
- {
- domNode = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
- var anchorText = document.createTextNode(aAnchorText);
-
- // Note that we need to resolve the given URL against the Source URL,
- // otherwise the target URL will end up being relative to the
- // chrome://afeview/content/afeview.xul URL!
- domNode.setAttribute("href", resolveURL(SourceURL, aHref));
- domNode.setAttribute("tooltip", aHref);
- domNode.appendChild(anchorText);
-
- return domNode;
- }
- else
- {
- // Put a non-breaking space (" " in HTML) into the active anchor text, so that
- // the active anchor text field always takes up at least one line vertically
- var fakeAnchorText = document.createTextNode("\u00a0");
-
- return fakeAnchorText;
- }
-}
-
-function volumeDown (aEvent)
-{
- var currentVolume = MediaEngine.getVolume()
- dump("Current volume is " + currentVolume + "\n");
- currentVolume--;
- dump("New volume is " + currentVolume + "\n");
- MediaEngine.setVolume(currentVolume);
-}
-
-function sendLink (aEvent)
-{
- var timeInSeconds = MediaEngine.getTimeInSeconds();
- var url = SourceURL + "#" + timeInSeconds;
-
- transportPause(aEvent);
-
- open("chrome://afeview/content/sendlink.xul?" + url,
- "Send Link",
- "titlebar,close,chrome,dependent,dialog,resize");
-}
-
-function parseTime (aTime)
-{
- var time = aTime.replace(/npt:/i, ""); // Get rid of npt: prefix if it exists
-
- // Andre's patented dodgy (hh:)mm:ss time parser (God have mercy on me)
- hhmmssArray = time.split(/:/);
- if (hhmmssArray.length == 2)
- {
- // Two elements, so it's MM:SS
- time = parseInt(hhmmssArray[0] * 60) + parseInt(parseFloat(hhmmssArray[1]));
- }
- else if (hhmmssArray.length == 3)
- {
- // Three elements, so it's HH:MM:SS
- time = parseInt(hhmmssArray[0] * 3600) + parseInt(hhmmssArray[1] * 60) +
- parseInt(parseFloat(hhmmssArray[2]));
- }
-
- return time;
-}
-
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Annodex Firefox Extension.
+ *
+ * The Initial Developer of the Original Code is
+ * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
+ * Australia.
+ * Portions created by the Initial Developer are Copyright (C) 2004-2005
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Andre Pang <andre.pang at csiro.au>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+var MediaEngine;
+
+const CLIP_ID_PREFIX = "clip-start-time-";
+
+// Mozilla component names
+const RDF_SERVICE = "@mozilla.org/rdf/rdf-service;1";
+const RDF_CONTAINER_UTILITIES = "@mozilla.org/rdf/container-utils;1";
+const RDF_IN_MEMORY_DATASOURCE = "@mozilla.org/rdf/datasource;1?name=in-memory-datasource";
+const STANDARD_URL = "@mozilla.org/network/standard-url;1";
+
+var CMMLRequest; // TODO: Eliminate this global variable (how do I pass a callback with the request as a parameter to onreadystatechange?)
+
+var SourceURL;
+var MediaURL;
+
+var InterfaceUpdateTimer;
+
+var Clips;
+var LoadedAllClips = false;
+var RequestedFragment = undefined;
+
+var PreviouslyActive = undefined;
+
+function AFEViewInterfaceLoaded ()
+{
+ // Use the information after the search portion of the URL (the bit after
+ // '?') as the URL for the Annodex file we want to load
+ SourceURL = document.location.search;
+ SourceURL = SourceURL.slice(1); // Get rid of the '?' prefix
+
+ dump('AFEView: document location is "' + document.location + '"\n');
+
+ // Strip off the fragment from the URL if one exists, and save it for later
+ // use
+ if (document.location.hash.indexOf("#") != -1)
+ {
+ RequestedFragment = document.location.hash.slice(1);
+ }
+
+ if (!isCMML(SourceURL))
+ {
+ // Source URL isn't a CMML file -- need to set the media URL
+ dump("Is not CMML\n");
+ MediaURL = SourceURL;
+ }
+
+ dump("Source URL is " + SourceURL + "\n");
+ dump("Media URL is " + MediaURL + "\n");
+
+ // Use QuickTime, VLC for DirectShow media playback? (See MediaEngine.js
+ // for the list of media engines)
+ var videoView;
+ var videoViewBox = document.getElementById("video-view-box");
+ var mediaEngineConstructor;
+
+ if (navigator.platform == "Win32")
+ mediaEngineConstructor = VLCMediaEngine;
+ else if (navigator.platform == "MacPPC")
+ mediaEngineConstructor = VLCMediaEngine;
+ else if (navigator.platform.match(/^Linux i.86/))
+ mediaEngineConstructor = VLCMediaEngine;
+ else
+ {
+ alert("Annodex playback is not yet supported on your operating system " +
+ "(\"" + navigator.platform + "\")");
+ }
+
+ // Check whether we can actually instantiate our chosen media engine
+ if (!canInstantiateMediaEngine(mediaEngineConstructor.videoViewXULElementName))
+ {
+ alert("The Annodex viewer plugin ("
+ + mediaEngineConstructor.videoViewXULElementName
+ + ") was not found. Please reinstall the Annodex Firefox "
+ + "Extension.");
+ return;
+ }
+
+ // Create the media engine and its associated view
+ var videoViewContainer = document.createElement(mediaEngineConstructor.videoViewXULElementName);
+ if (videoViewContainer == undefined)
+ {
+ // This should never happen
+ alert("Couldn't create videoViewContainer");
+ }
+ videoViewBox.appendChild(videoViewContainer);
+ videoView = document.getElementById("video-view");
+ MediaEngine = new mediaEngineConstructor(videoView);
+ updateVideoViewSize();
+ window.onresize = pageDidResize;
+
+ if (videoView == undefined)
+ {
+ // Should _never_ get here!
+ alert("Couldn't instantiate a video view for the media engine: please report this as a bug to Andre.Pang at csiro.au");
+ }
+
+ retrieveTableOfContents();
+
+ // If the source is _not_ a CMML file, then it's media: load it and play it
+ // now. If the source is CMML, the CMML needs to be examined first to look
+ // for the import/src tag, so cmmlRequestStatusChanged() will load the URL
+ // for us.
+ var urlToLoad = MediaURL;
+ if (!isCMML(urlToLoad))
+ {
+ void(MediaEngine.loadUrl(urlToLoad));
+ }
+
+ // TODO: Broadcast an event which signifies the movie's been loaded
+
+ // Now that the movie's loaded, start updating the interface
+ InterfaceUpdateTimer = window.setTimeout("updateInterface()", 1000);
+ AFEViewEnableMovieControls();
+}
+
+function updateInterface ()
+{
+ var videoView = document.getElementById("video-view");
+ var timeInSeconds;
+ var streamLengthInSeconds;
+ var active; // the active clip
+
+ // Set the current time and stream length labels
+
+ timeInSeconds = MediaEngine.getTimeInSeconds();
+ streamLengthInSeconds = MediaEngine.getStreamLengthInSeconds();
+
+ var currentTimeLabel = document.getElementById("current-time");
+ var mediaLoadingThrobber = document.getElementById("media-loading-throbber-box");
+
+ // Convert seconds into MM:SS display, guarding against invalid times
+ const MAX_TIME_IN_SECONDS_THRESHOLD = 1000000;
+
+ // TODO: This should really check whether timeInSeconds is >= 0, not > 0, but
+ // the VLC media engine returns 0 instead of -1 when there's no time to
+ // display. Maybe this should be fixed up in VLC?
+ if (timeInSeconds != undefined
+ && timeInSeconds > 0
+ && streamLengthInSeconds >= 0
+ && timeInSeconds < MAX_TIME_IN_SECONDS_THRESHOLD)
+ {
+ var timeDisplay = seconds2MMSSDisplay(timeInSeconds);
+ currentTimeLabel.setAttribute("value", timeDisplay);
+ currentTimeLabel.setAttribute("hidden", false);
+ mediaLoadingThrobber.setAttribute("hidden", true);
+ }
+ else
+ {
+ currentTimeLabel.setAttribute("hidden", true);
+ }
+
+ if (streamLengthInSeconds != undefined
+ && streamLengthInSeconds > 0
+ && streamLengthInSeconds < MAX_TIME_IN_SECONDS_THRESHOLD)
+ {
+ var streamLengthDisplay = seconds2MMSSDisplay(streamLengthInSeconds);
+ currentTimeLabel.setAttribute("value",
+ currentTimeLabel.getAttribute("value") + " / " + streamLengthDisplay);
+ }
+
+ // Highlight the active clip in the table of contents display
+ var clip;
+ if (LoadedAllClips)
+ {
+ for (var i = 0; i < Clips.length; i++)
+ {
+ var clipStartTime = Clips[i];
+ clip = document.getElementById(CLIP_ID_PREFIX + clipStartTime);
+ // TODO: This should really be specified via CSS
+ clip.setAttribute("style", "");
+ }
+
+ var followModeCheckbox = document.getElementById("follow-mode-checkbox");
+ var toc = document.getElementById("clips");
+
+ active = activeClip(timeInSeconds);
+ if (active != undefined)
+ {
+ active.setAttribute("style", "color: #0000ff;");
+
+ // Also select the active clip if follow mode is on
+ if (followModeCheckbox.getAttribute("checked") == "true") toc.selectedItem = active;
+ }
+ else
+ {
+ if (followModeCheckbox.getAttribute("checked") == "true") toc.clearSelection();
+ }
+ }
+
+ // Display the appropriate anchor text
+
+ var activeAnchorText;
+ var activeAnchorHref;
+ if (active != undefined)
+ {
+ activeAnchorText = active.getAttribute("clip-anchor-text");
+ activeAnchorHref = active.getAttribute("clip-anchor-href");
+ }
+ else
+ {
+ activeAnchorText = "";
+ activeAnchorHref = "";
+ }
+
+ if (active != PreviouslyActive)
+ {
+ var activeAnchorTextDescription = document.getElementById("active-anchor-text");
+ var hyperlink = createHyperlink(activeAnchorHref, activeAnchorText);
+ activeAnchorTextDescription.replaceChild(hyperlink, activeAnchorTextDescription.firstChild);
+ PreviouslyActive = active;
+ }
+
+ // Update media engine's HRef parameter, so that we can go to a new
+ // hyperlink if we click on the movie view itself (if the media engine
+ // supports this capability, anyway)
+ if (active != undefined)
+ {
+ if (activeAnchorHref.indexOf(".anx") != -1)
+ MediaEngine.setHRef("chrome://afeview/content/afeview.xul?"
+ + resolveURL(SourceURL, activeAnchorHref));
+ else
+ MediaEngine.setHRef(activeAnchorHref);
+ }
+
+ // If the user asked to go to a particular fragment, try to go to it
+ if (LoadedAllClips && RequestedFragment != undefined)
+ {
+ var secondsToGoTo = parseInt(parseTime(RequestedFragment));
+
+ if (isNaN(secondsToGoTo))
+ {
+ // The fragment is not a number, so look it up and find out the
+ // start time of that clip
+ for (var j = 0; j < Clips.length; j++)
+ {
+ clip = document.getElementById(CLIP_ID_PREFIX + Clips[j]);
+ var clipId = clip.getAttribute("clip-id");
+
+ if (clipId == RequestedFragment)
+ {
+ secondsToGoTo = clip.getAttribute("start");
+ break;
+ }
+ }
+
+ // If, after iterating through the clip list, we still haven't managed
+ // a matching clip, then the URL referred to a non-existent clip or
+ // something else weirdass. Don't try searching any more!
+ if (isNaN(secondsToGoTo))
+ {
+ RequestedFragment = undefined;
+ }
+ }
+
+ // After looking through the clip list, let's see if our search for a
+ // clip's start time was successful. If so, jump to it!
+ if (!isNaN(secondsToGoTo))
+ {
+ if (seekTo(secondsToGoTo))
+ {
+ RequestedFragment = undefined;
+ }
+ }
+ }
+
+ // All to happen again 500ms later ...
+
+ // Update status bar to indicate everything's OK
+ //window.status = "Done";
+
+ InterfaceUpdateTimer = window.setTimeout("updateInterface()", 500);
+}
+
+function activeClip (timeInSeconds)
+{
+ var clipIndex;
+
+ clipIndex = activeClipIndex(timeInSeconds);
+ if (clipIndex == undefined)
+ {
+ return undefined;
+ }
+ else
+ {
+ var clipStartTime = Clips[clipIndex];
+
+ return document.getElementById(CLIP_ID_PREFIX + clipStartTime);
+ }
+}
+
+function activeClipIndex (timeInSeconds)
+{
+ var activeClipIndex;
+
+ if (!LoadedAllClips || timeInSeconds == undefined)
+ return undefined;
+
+ // We iterate _backward_ through the Clips array, comparing the current time
+ // against every clip. If the current time is greater than or equal to than
+ // the time of the current clip being compared again, then it's the active one
+ // -
+ // TODO: this should really be O(1) instead of O(n), since it's often called
+ // in loops which are O(n), thereby making total performance O(n^2) ... but
+ // eh, we'll leave optimisation for later, huh?
+ // -
+ for (var i = Clips.length - 1; i >= 0; i--)
+ {
+ var clipStartTime = Clips[i];
+
+ if (parseInt(timeInSeconds) >= parseInt(clipStartTime))
+ {
+ activeClipIndex = i;
+ break;
+ }
+ }
+
+ return activeClipIndex;
+}
+
+function seconds2MMSSDisplay (time)
+{
+ var minutes = parseInt(time / 60);
+ var seconds = parseInt(time % 60);
+
+ // 0-pad, the tedious way ...
+ if (minutes < 10)
+ {
+ minutes = "0" + minutes;
+ }
+
+ if (seconds < 10)
+ {
+ seconds = "0" + seconds;
+ }
+
+ return (minutes + ":" + seconds);
+}
+
+function retrieveTableOfContents ()
+{
+ // Create a HTTP request for the CMML content
+ CMMLRequest = new XMLHttpRequest();
+ CMMLRequest.multiPart = false;
+ CMMLRequest.onreadystatechange = cmmlRequestStatusChanged;
+
+ CMMLRequest.open("GET", SourceURL);
+ CMMLRequest.setRequestHeader("Accept", "text/x-cmml");
+
+ CMMLRequest.send("");
+}
+
+function cmmlRequestStatusChanged ()
+{
+ // N.B. readyState can be 0:uninitialised, 1:loading, 2:loaded, 3:interactive, 4:complete
+
+ // If the request for the CMML is complete ...
+ if (CMMLRequest.readyState >= 3)
+ {
+ var clipDescription = document.getElementById("toc-clip-description");
+
+ // ... and the request loaded succesfully (HTTP 200 "OK" response)
+ if (CMMLRequest.status == 200)
+ {
+ // At this point, CMMLRequest.responseXML is null -- we seem to need to
+ // parse it manually from the responseText ...
+
+ // Transform the CMML to CMML in RDF
+ cmml2RDF(CMMLRequest.responseText);
+ }
+
+ if (!LoadedAllClips)
+ {
+ var boohooOutput = ("There was a problem retrieving this movie file's " +
+ "table of contents. The server returned an HTTP error code of " +
+ CMMLRequest.status + " (" + CMMLRequest.statusText + ").");
+ clipDescription.firstChild.nodeValue = boohooOutput;
+ }
+
+ // Turn the progress meter off
+ var tableOfContentsIsActiveBroadcaster = document.getElementById("tableOfContentsIsActive");
+ tableOfContentsIsActiveBroadcaster.setAttribute("isActive", "true");
+ enableTableOfContentsDisplay();
+
+ // Load the media if this is the source URL
+ if (isCMML(SourceURL))
+ {
+ dump(".......... Loading MediaURL: " + MediaURL + "\n");
+ void(MediaEngine.loadUrl(MediaURL));
+ }
+ }
+}
+
+function cmml2RDF (cmmlString)
+{
+ var parser = new DOMParser();
+ var cmmlXML = parser.parseFromString(cmmlString, "text/xml");
+
+ // Pivot cmmlXML DOM so that we begin with the <cmml> node
+ cmmlXML = cmmlXML.childNodes[0];
+
+ // Create RDF services objects
+ var rdfService = Components.classes[RDF_SERVICE].getService(Components.interfaces.nsIRDFService);
+ var rdfContainerUtilities = Components.classes[RDF_CONTAINER_UTILITIES].getService(Components.interfaces.nsIRDFContainerUtils);
+
+ // Create the clips datasource
+ var clips = Components.classes[RDF_IN_MEMORY_DATASOURCE].createInstance(Components.interfaces.nsIRDFDataSource);
+
+ // Create a root note, a url:clips-root sequence container for it, and insert
+ // it into the clips datasource
+ var root = rdfService.GetResource("urn:root");
+ var clipsSequenceResource = rdfService.GetResource("urn:clips-root");
+ var clipsSequence = rdfContainerUtilities.MakeSeq(clips, clipsSequenceResource);
+ clips.Assert(root, rdfService.GetAnonymousResource(), clipsSequenceResource, true);
+
+ // Create an empty Clips array
+ Clips = new Array();
+
+ // Iterate over the nodes in the CMML/XML document, and create the RDF
+ // datasource from that
+ var child;
+ for (var i = 0; i < cmmlXML.childNodes.length; i++)
+ {
+ child = cmmlXML.childNodes[i];
+
+ var j;
+ if (child.tagName == "head")
+ {
+ // Found a <head> tag: search for <title>
+ for (j = 0; j < child.childNodes.length; j++)
+ {
+ var subchild = child.childNodes[j];
+
+ if (subchild.tagName == "title")
+ {
+ var title = subchild.firstChild.nodeValue;
+ document.title = title;
+ }
+ }
+ }
+ else if (child.tagName == "clip")
+ {
+ var descriptionNode = cmmlClipNode2RdfNode(child, clips, rdfService);
+ clipsSequence.AppendElement(descriptionNode);
+ }
+ else if (child.tagName == "stream" && isCMML(SourceURL))
+ {
+ // n.b. We need the isCMML(SourceURL) check above, because if we request
+ // a .anx resource with the "Accept: text/x-cmml" HTTP header set,
+ // mod_annodex will serve out the original CMML file -- with the stream
+ // and import tags included! This really should be fixed in mod_annodex,
+ // but it's prudent to ignore the stream tag if we ever receive it in the
+ // Annodex stream anyway, since it's really not meant to be there.
+
+ // Look for an <import> tag
+ for (j = 0; j < child.childNodes.length; j++)
+ {
+ var subchild = child.childNodes[j];
+ var foundAtLeastOneImportSrc = false;
+
+ if (subchild.tagName == "import")
+ {
+ // Found an <import> tag -- ensure we've found only one
+ if (foundAtLeastOneImportSrc)
+ {
+ // We've found more than one <import> tag
+ var errorOutput = "There is more than one <import> tag in the "
+ + "CMML file. The Annodex Viewer for Firefox can currently "
+ + "only process CMML files with exactly one <import> tag."
+ var clipDescription = document
+ .getElementById("toc-clip-description");
+ clipDescription.firstChild.nodeValue = errorOutput;
+
+ // Return early: callers of this function should check the
+ // LoadedAllClips global variable to see whether we were
+ // successful or not. TODO: Maybe we should make this function
+ // return a boolean instead, indicating success or failure?
+ return;
+ }
+
+ var importSrc = subchild.getAttribute("src");
+ MediaURL = resolveURL(SourceURL, importSrc);
+
+ dump("***** Resolved MediaURL to " + MediaURL + "\n");
+
+ foundAtLeastOneImportSrc = true;
+ }
+ }
+ }
+ }
+
+ // Add our data source to the clip list
+ var clipsList = document.getElementById("clips");
+ clipsList.database.AddDataSource(clips);
+ clipsList.builder.rebuild();
+
+ LoadedAllClips = true;
+}
+
+function cmmlClipNode2RdfNode (clipNode, clips)
+{
+ var id, start, anchorText, anchorHRef, imageSource, description, title;
+
+ // Get "start" attribute
+ start = clipNode.getAttribute("start");
+
+ start = parseTime (start);
+
+ // Get "id" attribute
+ id = clipNode.getAttribute("id");
+
+ // Look for "a", "desc", "img", "meta" tags
+ for (var i = 0; i < clipNode.childNodes.length; i++)
+ {
+ var subchild = clipNode.childNodes[i];
+
+ if (subchild.tagName == "a")
+ {
+ anchorText = subchild.firstChild.nodeValue;
+ anchorHRef = subchild.getAttribute("href");
+ }
+ else if (subchild.tagName == "desc")
+ {
+ description = subchild.firstChild.nodeValue;
+ }
+ else if (subchild.tagName == "img")
+ {
+ imageSource = resolveURL(SourceURL, subchild.getAttribute("src"));
+ }
+ else if (subchild.tagName == "meta")
+ {
+ if (subchild.getAttribute("name") == "title")
+ {
+ title = subchild.getAttribute("content");
+ }
+ }
+ }
+
+ // Create an anonymous description node
+ var rdfService = Components.classes[RDF_SERVICE].getService(Components.interfaces.nsIRDFService);
+ var descriptionNode = rdfService.GetResource(CLIP_ID_PREFIX + start);
+
+ function createNamedResource(key, value)
+ {
+ if (value != undefined)
+ {
+ // Create named resource and link it to the description node
+ var resource = rdfService.GetResource("http://www.annodex.net/cmml/rdf#" + key);
+ var lit = rdfService.GetLiteral(value);
+ clips.Assert(descriptionNode, resource, lit, true);
+ }
+ }
+
+ // createNamedResource("id", CLIP_ID_PREFIX + start);
+ createNamedResource("clip-id", id);
+ createNamedResource("start", start);
+ createNamedResource("anchor-text", anchorText);
+ createNamedResource("anchor-href", anchorHRef);
+ createNamedResource("img-src", imageSource);
+ createNamedResource("description", description);
+
+ if (title != undefined)
+ {
+ createNamedResource("title", title);
+ }
+ else
+ {
+ // No title found: use a shortened version of the clip description
+ if (description != undefined)
+ {
+ const MAX_TITLE_LENGTH = 65;
+
+ if (description.length > MAX_TITLE_LENGTH)
+ {
+ var shortenedDescription = description.slice(0, MAX_TITLE_LENGTH)
+ + "\u2026" // ellipsis
+ createNamedResource("title", shortenedDescription);
+ }
+ else
+ {
+ createNamedResource("title", description);
+ }
+ }
+ }
+
+ // Add the start time of the clip to the global Clips array, so it's easy to
+ // iterate and search for clips by time. This can also be used to look up
+ // the clip id tag (via CLIP_ID_PREFIX)
+ Clips.push(start);
+
+ return descriptionNode;
+}
+
+function AFEViewEnableMovieControls ()
+{
+ var movieIsActiveBroadcaster = document.getElementById("movieIsActive");
+ movieIsActiveBroadcaster.setAttribute("isActive", "true");
+ movieIsActiveBroadcaster.setAttribute("isPlaying", "true");
+ movieIsActiveBroadcaster.setAttribute("disabled", "false");
+}
+
+function clipContextShowHyperlink ()
+{
+ var activeDescriptionLabel = document.getElementById("active-description");
+ activeDescriptionLabel.setAttribute("hidden", "true");
+ var activeAnchorTextLabel = document.getElementById("active-anchor-text");
+ activeAnchorTextLabel.setAttribute("hidden", "false");
+
+ var hyperlinkOrClipInfoMenu = document.getElementById("hyperlink_or_clip_description_menu");
+ hyperlinkOrClipInfoMenu.setAttribute("label", "Hyperlink"); // TODO: i18n this
+}
+
+function clipContextViewShowCurrentClipInformation ()
+{
+ var activeDescriptionLabel = document.getElementById("active-description");
+ activeDescriptionLabel.setAttribute("hidden", "false");
+ var activeAnchorTextLabel = document.getElementById("active-anchor-text");
+ activeAnchorTextLabel.setAttribute("hidden", "true");
+
+ var hyperlinkOrClipInfoMenu = document.getElementById("hyperlink_or_clip_description_menu");
+ hyperlinkOrClipInfoMenu.setAttribute("label", "Clip Info"); // TODO: i18n this
+}
+
+function clipSelected (event)
+{
+ var toc = document.getElementById("clips");
+ var clipDescription = document.getElementById("toc-clip-description");
+ var clipAnchorText = document.getElementById("toc-clip-anchor-text");
+
+ if (toc.selectedItem == null)
+ {
+ clipDescription.firstChild.nodeValue = "";
+ clipAnchorText.firstChild.nodeValue = "";
+ clipAnchorText.setAttribute("tooltiptext", "");
+
+ return;
+ }
+
+ // Get the currently selected clip in the TOC
+ var selectedClip = toc.selectedItem;
+
+ // Update the clip description to reflect the currently selected clip
+ clipDescription.firstChild.nodeValue = selectedClip.getAttribute("clip-description");
+
+ // Update the clip anchor text to reflect the currently selected clip
+ var hyperlink = createHyperlink(selectedClip.getAttribute("clip-anchor-href"),
+ selectedClip.getAttribute("clip-anchor-text"));
+ clipAnchorText.replaceChild(hyperlink, clipAnchorText.firstChild);
+
+ // If the clip selected is not the currently active one, turn off follow mode
+ var followModeCheckbox = document.getElementById("follow-mode-checkbox");
+
+ var theActiveClip = activeClip(MediaEngine.getTimeInSeconds());
+ if (selectedClip != theActiveClip)
+ {
+ followModeCheckbox.setAttribute("checked", "false");
+ }
+}
+
+function updatePlayPauseButtons ()
+{
+ var playButton = document.getElementById("transport-play-button");
+ var pauseButton = document.getElementById("transport-pause-button");
+
+ var isPlaying = document.getElementById("movieIsPlaying").getAttribute("isPlaying");
+
+ if (isPlaying == "true")
+ {
+ // Movie is playing: hide the play button, and unhide the pause button
+ playButton.setAttribute("hidden", "true");
+ pauseButton.setAttribute("hidden", "false");
+ }
+ else
+ {
+ // Movie is paused: hide the pause button, and unhide the play button
+ playButton.setAttribute("hidden", "false");
+ pauseButton.setAttribute("hidden", "true");
+ }
+}
+
+// -
+// Transport functions
+// -
+
+function transportPause (event)
+{
+ var movieIsPlayingBroadcaster = document.getElementById("movieIsPlaying");
+ movieIsPlayingBroadcaster.setAttribute("isPlaying", "false");
+
+ MediaEngine.pause();
+}
+
+function transportPlay (event)
+{
+ var movieIsPlayingBroadcaster = document.getElementById("movieIsPlaying");
+ movieIsPlayingBroadcaster.setAttribute("isPlaying", "true");
+
+ MediaEngine.play();
+}
+
+function transportStop (event)
+{
+ var movieIsPlayingBroadcaster = document.getElementById("movieIsPlaying");
+ movieIsPlayingBroadcaster.setAttribute("isPlaying", "false");
+
+ MediaEngine.stop();
+}
+
+function transportGoToBeginning (event)
+{
+ MediaEngine.goToBeginning();
+ transportPlay(event);
+}
+
+function transportGoToEnd (event)
+{
+ MediaEngine.goToEnd();
+}
+
+function transportGoToPreviousClip (event)
+{
+ var timeInSeconds = MediaEngine.getTimeInSeconds();
+
+ var currentClipIndex = activeClipIndex(timeInSeconds);
+ if (currentClipIndex > 0)
+ {
+ var previousClipStartTime = Clips[currentClipIndex - 1];
+
+ displayMediaLoadingThrobber();
+
+ // TODO: Should probably use the followHyperlink() function to do this ...
+ void(seekTo(previousClipStartTime));
+ }
+ else
+ {
+ transportGoToBeginning(event);
+ }
+}
+
+function transportGoToNextClip (event)
+{
+ var timeInSeconds = MediaEngine.getTimeInSeconds();
+
+ var currentClipIndex = activeClipIndex(timeInSeconds);
+ if (currentClipIndex < Clips.length - 1)
+ {
+ var nextClipStartTime = Clips[currentClipIndex + 1];
+
+ displayMediaLoadingThrobber();
+
+ void(seekTo(nextClipStartTime));
+ }
+ else
+ {
+ transportGoToEnd(event);
+ }
+}
+
+function transportGoToClip (event)
+{
+ var clipStart = event.target.getAttribute("clip-start");
+
+ displayMediaLoadingThrobber();
+
+ void(seekTo(clipStart));
+
+ var followModeCheckbox = document.getElementById("follow-mode-checkbox");
+ followModeCheckbox.setAttribute("checked", "true");
+}
+
+function enableTableOfContentsDisplay ()
+{
+ var progressMeter = document.getElementById("toc-loading-progress");
+ var clipDescriptionBox = document.getElementById("toc-clip-info-box");
+ // var clipDescription = document.getElementById("toc-clip-description");
+
+ var isPlaying = document.getElementById("tableOfContentsIsActive").getAttribute("isActive");
+
+ if (isPlaying == "true")
+ {
+ progressMeter.setAttribute("hidden", "true");
+ clipDescriptionBox.setAttribute("hidden", "false");
+ // clipDescription.setAttribute("hidden", "false");
+ }
+ else
+ {
+ progressMeter.setAttribute("hidden", "false");
+ // clipDescription.setAttribute("hidden", "true");
+ }
+}
+
+function activateSelectedClipHyperlink (event)
+{
+ // Ignore the event unless we clicked the mouse with button 0
+ // and the Ctrl key wasn't pressed
+ if (!(event.button == 0 && event.ctrlKey == false)) return false;
+
+ // Get the currently selected clip in the TOC
+ var toc = document.getElementById("clips");
+ var selectedClip = toc.currentItem;
+
+ followHyperlink(selectedClip.getAttribute("clip-anchor-href"));
+
+ return true;
+}
+
+function activateActiveHyperlink (event)
+{
+ // Ignore the event unless we clicked the mouse with button 0
+ // and the Ctrl key wasn't pressed
+ if (!(event.button == 0 && event.ctrlKey == false)) return false;
+
+ var timeInSeconds = MediaEngine.getTimeInSeconds();
+ followHyperlink(activeClip(timeInSeconds).getAttribute("clip-anchor-href"));
+
+ return true;
+}
+
+function followHyperlink (aHref)
+{
+ var href = resolveURL(SourceURL, aHref);
+
+ // Change any server-side ?t= time URI schemes to a client-side # scheme
+ href = href.replace(/\?t\=/, "#");
+
+ // Store a URL with a timed URI 2 seconds before the user followed the
+ // hyperlink, so we get a bit of context back. (This improves usability
+ // for me, anyway ...)
+ var timeInSeconds = MediaEngine.getTimeInSeconds() - 2;
+ if (timeInSeconds < 0) timeInSeconds = 0;
+ var currentURL = document.location.href.replace(/#.*$/, "") + "#" + timeInSeconds;
+
+ // Ooo looky here, evil hack! Mozilla's content loading doesn't actually
+ // re-load the XUL interface if you replace the current URL with exactly the
+ // same one, but with only the fragment changed. So, we just replace
+ // the current history entry with the new URL containing the time, _then_
+ // follow the hyperlink. Much, much easier than playing around with
+ // nsIHistory and friends!
+ document.location.replace(currentURL);
+
+ displayMediaLoadingThrobber();
+
+ document.location.href = href;
+}
+
+function pageDidResize ()
+{
+ updateVideoViewSize();
+}
+
+function updateVideoViewSize ()
+{
+ var videoViewBox = document.getElementById("video-view-box");
+ var videoView = document.getElementById("video-view");
+
+ videoView.setAttribute("height", videoViewBox.boxObject.height);
+ videoView.setAttribute("width", videoViewBox.boxObject.width);
+}
+
+function resolveURL (baseURL, url)
+{
+ // Get Mozilla's URI component to resolve the path for us. Yay for not
+ // reinventing the wheel!
+
+ var uriComponent = Components.classes[STANDARD_URL]
+ .getService(Components.interfaces.nsIURI);
+ uriComponent.spec = baseURL;
+ return uriComponent.resolve(url);
+}
+
+function hideOrShowClipList ()
+{
+ var tableOfContentsBox = document.getElementById("table-of-contents-box");
+
+ var tableOfContentsIsHidden = tableOfContentsBox.getAttribute("collapsed");
+ if (tableOfContentsIsHidden)
+ {
+ tableOfContentsBox.setAttribute("collapsed", "false");
+ }
+ else
+ {
+ tableOfContentsBox.setAttribute("collapsed", "true");
+ }
+}
+
+function displayMediaLoadingThrobber ()
+{
+ var currentTimeLabel = document.getElementById("current-time");
+ currentTimeLabel.setAttribute("hidden", true);
+
+ var mediaLoadingThrobber = document.getElementById("media-loading-throbber-box");
+ mediaLoadingThrobber.setAttribute("hidden", false);
+}
+
+// TODO: Can we check the document's MIME type to see whether it's CMML,
+// rather than checking by the file extension?
+function isCMML (aURL)
+{
+ return (SourceURL.indexOf(".cmml") == (SourceURL.length - 5));
+}
+
+function seekTo (aTimeInSeconds)
+{
+ if (useServerSideSeeking(MediaURL))
+ {
+ return MediaEngine.loadUrl(MediaURL + "?t=" + aTimeInSeconds);
+ }
+ else
+ {
+ MediaEngine.setTimeInSeconds(aTimeInSeconds);
+ }
+}
+
+function useServerSideSeeking (aURL)
+{
+ // Use server-side seeking if we're playing back an Annodex file over http.
+ // We should really be more accurate than this, but for now, it's the only
+ // indicator we've got ...
+
+ return ( aURL.indexOf("http" == 0)
+ && ( aURL.indexOf(".anx") == aURL.length - 4
+ || aURL.indexOf(".axv") == aURL.length - 4
+ || aURL.indexOf(".axa") == aURL.length - 4
+ )
+ );
+}
+
+function createHyperlink (aHref, aAnchorText)
+{
+ var domNode;
+
+ if (aAnchorText != "")
+ {
+ domNode = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
+ var anchorText = document.createTextNode(aAnchorText);
+
+ // Note that we need to resolve the given URL against the Source URL,
+ // otherwise the target URL will end up being relative to the
+ // chrome://afeview/content/afeview.xul URL!
+ domNode.setAttribute("href", resolveURL(SourceURL, aHref));
+ domNode.setAttribute("tooltip", aHref);
+ domNode.appendChild(anchorText);
+
+ return domNode;
+ }
+ else
+ {
+ // Put a non-breaking space (" " in HTML) into the active anchor text, so that
+ // the active anchor text field always takes up at least one line vertically
+ var fakeAnchorText = document.createTextNode("\u00a0");
+
+ return fakeAnchorText;
+ }
+}
+
+function volumeDown (aEvent)
+{
+ var currentVolume = MediaEngine.getVolume()
+ dump("Current volume is " + currentVolume + "\n");
+ currentVolume--;
+ dump("New volume is " + currentVolume + "\n");
+ MediaEngine.setVolume(currentVolume);
+}
+
+function sendLink (aEvent)
+{
+ var timeInSeconds = MediaEngine.getTimeInSeconds();
+ var url = SourceURL + "#" + timeInSeconds;
+
+ transportPause(aEvent);
+
+ open("chrome://afeview/content/sendlink.xul?" + url,
+ "Send Link",
+ "titlebar,close,chrome,dependent,dialog,resize");
+}
+
+function parseTime (aTime)
+{
+ var time = aTime.replace(/npt:/i, ""); // Get rid of npt: prefix if it exists
+
+ // Andre's patented dodgy (hh:)mm:ss time parser (God have mercy on me)
+ hhmmssArray = time.split(/:/);
+ if (hhmmssArray.length == 2)
+ {
+ // Two elements, so it's MM:SS
+ time = parseInt(hhmmssArray[0] * 60) + parseInt(parseFloat(hhmmssArray[1]));
+ }
+ else if (hhmmssArray.length == 3)
+ {
+ // Three elements, so it's HH:MM:SS
+ time = parseInt(hhmmssArray[0] * 3600) + parseInt(hhmmssArray[1] * 60) +
+ parseInt(parseFloat(hhmmssArray[2]));
+ }
+
+ return time;
+}
+
Property changes on: AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xbl
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xbl 2005-02-03 19:19:49 UTC (rev 828)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xbl 2005-02-04 14:40:59 UTC (rev 829)
@@ -1,126 +1,126 @@
-<?xml version="1.0"?>
-
-<!-- ***** BEGIN LICENSE BLOCK *****
- - Version: MPL 1.1/GPL 2.0/LGPL 2.1
- -
- - The contents of this file are subject to the Mozilla Public License Version
- - 1.1 (the "License"); you may not use this file except in compliance with
- - the License. You may obtain a copy of the License at
- - http://www.mozilla.org/MPL/
- -
- - Software distributed under the License is distributed on an "AS IS" basis,
- - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- - for the specific language governing rights and limitations under the
- - License.
- -
- - The Original Code is the Annodex Firefox Extension.
- -
- - The Initial Developer of the Original Code is
- - Commonwealth Scientific and Industrial Research Organisation (CSIRO)
- - Australia.
- - Portions created by the Initial Developer are Copyright (C) 2004-2005
- - the Initial Developer. All Rights Reserved.
- -
- - Contributor(s):
- - Andre Pang <andre.pang at csiro.au>
- -
- - Alternatively, the contents of this file may be used under the terms of
- - either the GNU General Public License Version 2 or later (the "GPL"), or
- - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- - in which case the provisions of the GPL or the LGPL are applicable instead
- - of those above. If you wish to allow use of your version of this file only
- - under the terms of either the GPL or the LGPL, and not to allow others to
- - use your version of this file under the terms of the MPL, indicate your
- - decision by deleting the provisions above and replace them with the notice
- - and other provisions required by the LGPL or the GPL. If you do not delete
- - the provisions above, a recipient may use your version of this file under
- - the terms of any one of the MPL, the GPL or the LGPL.
- -
- - ***** END LICENSE BLOCK *****
--->
-
-<bindings
- xmlns="http://www.mozilla.org/xbl"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- note that we hardcode the id attribute here as "video-view",
- otherwise it's absolutely impossible for for us to find the
- video view in the DOM tree (using xbl:inherits=... doesn't seem to
- work). yeah, this means we can only have one video-view per XUL
- document, but that's OK for us ...
- -->
-
- <binding id="windows-media-player-7-video-view" xul:flex="50">
- <content flex="50">
-
- <html:object
- flex="50"
- width="60"
- height="45"
- classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
- id="video-view">
- <html:param name="uiMode" value="none"/>
- <html:param name="enableContextMenu" value="false"/>
- </html:object>
-
- </content>
- </binding>
-
- <binding id="windows-media-player-6-4-video-view" xul:flex="50">
- <content flex="50">
-
- <html:object
- flex="50"
- width="60"
- height="45"
- classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
- codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"
- id="video-view">
- <html:param name="uiMode" value="none"/>
- <html:param name="enableContextMenu" value="false"/>
- </html:object>
-
- </content>
- </binding>
-
- <binding id="vlc-video-view" xul:flex="50">
- <content flex="50">
-
- <html:embed
- type="application/x-annodex-vlc-viewer-plugin"
- autoplay="no"
- loop="no"
- hidden="no"
- width="60"
- id="video-view"
- />
-
- </content>
- </binding>
-
- <binding id="quicktime-video-view">
- <content flex="50">
-
- <html:embed
- flex="50"
- width="60"
- height="45"
- bgcolor="black"
- controller="false"
- scale="aspect"
- kioskmode="true"
- pluginspace="http://www.apple.com/quicktime/download/"
- type="application/x-mpeg"
- looping="yes"
- autoplay="true"
- id="video-view"
- src="/"
- enablejavascript="true"
- />
- </content>
- </binding>
-
-
-</bindings>
-
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+ - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ -
+ - The contents of this file are subject to the Mozilla Public License Version
+ - 1.1 (the "License"); you may not use this file except in compliance with
+ - the License. You may obtain a copy of the License at
+ - http://www.mozilla.org/MPL/
+ -
+ - Software distributed under the License is distributed on an "AS IS" basis,
+ - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ - for the specific language governing rights and limitations under the
+ - License.
+ -
+ - The Original Code is the Annodex Firefox Extension.
+ -
+ - The Initial Developer of the Original Code is
+ - Commonwealth Scientific and Industrial Research Organisation (CSIRO)
+ - Australia.
+ - Portions created by the Initial Developer are Copyright (C) 2004-2005
+ - the Initial Developer. All Rights Reserved.
+ -
+ - Contributor(s):
+ - Andre Pang <andre.pang at csiro.au>
+ -
+ - Alternatively, the contents of this file may be used under the terms of
+ - either the GNU General Public License Version 2 or later (the "GPL"), or
+ - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ - in which case the provisions of the GPL or the LGPL are applicable instead
+ - of those above. If you wish to allow use of your version of this file only
+ - under the terms of either the GPL or the LGPL, and not to allow others to
+ - use your version of this file under the terms of the MPL, indicate your
+ - decision by deleting the provisions above and replace them with the notice
+ - and other provisions required by the LGPL or the GPL. If you do not delete
+ - the provisions above, a recipient may use your version of this file under
+ - the terms of any one of the MPL, the GPL or the LGPL.
+ -
+ - ***** END LICENSE BLOCK *****
+-->
+
+<bindings
+ xmlns="http://www.mozilla.org/xbl"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <!-- note that we hardcode the id attribute here as "video-view",
+ otherwise it's absolutely impossible for for us to find the
+ video view in the DOM tree (using xbl:inherits=... doesn't seem to
+ work). yeah, this means we can only have one video-view per XUL
+ document, but that's OK for us ...
+ -->
+
+ <binding id="windows-media-player-7-video-view" xul:flex="50">
+ <content flex="50">
+
+ <html:object
+ flex="50"
+ width="60"
+ height="45"
+ classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
+ id="video-view">
+ <html:param name="uiMode" value="none"/>
+ <html:param name="enableContextMenu" value="false"/>
+ </html:object>
+
+ </content>
+ </binding>
+
+ <binding id="windows-media-player-6-4-video-view" xul:flex="50">
+ <content flex="50">
+
+ <html:object
+ flex="50"
+ width="60"
+ height="45"
+ classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
+ codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"
+ id="video-view">
+ <html:param name="uiMode" value="none"/>
+ <html:param name="enableContextMenu" value="false"/>
+ </html:object>
+
+ </content>
+ </binding>
+
+ <binding id="vlc-video-view" xul:flex="50">
+ <content flex="50">
+
+ <html:embed
+ type="application/x-annodex-vlc-viewer-plugin"
+ autoplay="no"
+ loop="no"
+ hidden="no"
+ width="60"
+ id="video-view"
+ />
+
+ </content>
+ </binding>
+
+ <binding id="quicktime-video-view">
+ <content flex="50">
+
+ <html:embed
+ flex="50"
+ width="60"
+ height="45"
+ bgcolor="black"
+ controller="false"
+ scale="aspect"
+ kioskmode="true"
+ pluginspace="http://www.apple.com/quicktime/download/"
+ type="application/x-mpeg"
+ looping="yes"
+ autoplay="true"
+ id="video-view"
+ src="/"
+ enablejavascript="true"
+ />
+ </content>
+ </binding>
+
+
+</bindings>
+
Property changes on: AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xbl
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xul
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xul 2005-02-03 19:19:49 UTC (rev 828)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xul 2005-02-04 14:40:59 UTC (rev 829)
@@ -1,407 +1,407 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://afeview/skin" type="text/css"?>
-
-<!-- ***** BEGIN LICENSE BLOCK *****
- - Version: MPL 1.1/GPL 2.0/LGPL 2.1
- -
- - The contents of this file are subject to the Mozilla Public License Version
- - 1.1 (the "License"); you may not use this file except in compliance with
- - the License. You may obtain a copy of the License at
- - http://www.mozilla.org/MPL/
- -
- - Software distributed under the License is distributed on an "AS IS" basis,
- - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- - for the specific language governing rights and limitations under the
- - License.
- -
- - The Original Code is the Annodex Firefox Extension.
- -
- - The Initial Developer of the Original Code is
- - Commonwealth Scientific and Industrial Research Organisation (CSIRO)
- - Australia.
- - Portions created by the Initial Developer are Copyright (C) 2004-2005
- - the Initial Developer. All Rights Reserved.
- -
- - Contributor(s):
- - Andre Pang <andre.pang at csiro.au>
- -
- - Alternatively, the contents of this file may be used under the terms of
- - either the GNU General Public License Version 2 or later (the "GPL"), or
- - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- - in which case the provisions of the GPL or the LGPL are applicable instead
- - of those above. If you wish to allow use of your version of this file only
- - under the terms of either the GPL or the LGPL, and not to allow others to
- - use your version of this file under the terms of the MPL, indicate your
- - decision by deleting the provisions above and replace them with the notice
- - and other provisions required by the LGPL or the GPL. If you do not delete
- - the provisions above, a recipient may use your version of this file under
- - the terms of any one of the MPL, the GPL or the LGPL.
- -
- - ***** END LICENSE BLOCK ***** -->
-
-<page
- align="stretch"
- orient="horizontal"
- pack="center"
- title="Annodex Extension for Firefox"
- onload="AFEViewInterfaceLoaded()"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- >
-
- <script type="application/x-javascript" src="chrome://afeview/content/MediaEngine.js"/>
- <script type="application/x-javascript" src="chrome://afeview/content/afeview.js"/>
-
- <!-- commands -->
-
- <!-- transport controls: only enabled when the movie is loaded (active) -->
- <commandset
- commandupdater="true"
- events="AFEViewMovieActive"
- oncommandupdate="EnableMovieControls">
-
- <!-- transport controls -->
- <command id="AFEView_transport_go_to_beginning" oncommand="transportGoToBeginning(event);"/>
- <command id="AFEView_transport_go_to_previous_clip" oncommand="transportGoToPreviousClip(event);"/>
- <command id="AFEView_transport_stop" oncommand="transportStop(event);"/>
- <command id="AFEView_transport_play" oncommand="transportPlay(event);"/>
- <command id="AFEView_transport_pause" oncommand="transportPause(event);"/>
- <command id="AFEView_transport_go_to_next_clip" oncommand="transportGoToNextClip(event);"/>
- <command id="AFEView_transport_go_to_end" oncommand="transportGoToEnd(event);"/>
-
- <!-- view switching -->
- <command id="AFEView_clip_context_show_hyperlink" oncommand="clipContextShowHyperlink(event);"/>
- <command id="AFEView_clip_context_show_current_clip_information" oncommand="clipContextViewShowCurrentClipInformation(event);"/>
-
- <!-- volume control -->
- <command id="AFEView_volume_down" oncommand="volumeDown(event);"/>
- <command id="AFEView_volume_up" oncommand="volumeUp(event);"/>
-
- <!-- send link -->
- <command id="AFEView_send_link" oncommand="sendLink(event);"/>s
- </commandset>
-
- <!-- TOC controls: only enabled when there's at least one TOC item -->
- <commandset
- commandupdater="true"
- events="AFEViewTOCHasAtLeastOneClip"
- oncommandupdate="EnableTOCControls">
- <command id="AFEView_view_show_selected_clip_description" oncommand="viewShowSelectedClipInformation(event);"/>
- <command id="AFEView_transport_go_to_clip" oncommand="transportGoToClip(event);"/>
- </commandset>
-
- <!-- broadcasters -->
-
- <broadcasterset>
- <broadcaster id="clipSelection"/>
-
- <!-- movie has been loaded -->
- <broadcaster id="movieIsActive" isActive="false"/>
-
- <!-- table of contents has been loaded -->
- <broadcaster id="tableOfContentsIsActive" isActive="false"/>
-
- <!-- paused or playing? -->
- <broadcaster id="movieIsPlaying" isPlaying="true"/>
-
- <!-- clip view context changed -->
- <broadcaster id="clipViewContext"/>
- </broadcasterset>
-
- <!-- table of contents -->
-
- <vbox id="table-of-contents-box" orient="vertical" pack="justify" flex="1" class="inset" maxwidth="300">
-
- <!-- clip list -->
-
- <vbox flex="1">
-
- <!-- we encapsulate the listbox and the "follow mode" checkbox in a vbox,
- so that when they're resized, they're kept together. (otherwise
- there's a great ugly big space between them) -->
-
- <listbox
- id="clips"
- flex="1"
- onselect="clipSelected(event)"
- command="AFEView_transport_go_to_clip"
- ondblclick="transportGoToClip(event)"
- datasources="urn:null"
- ref="urn:clips-root">
-
- <listcols>
- <listcol width="66"/>
- <listcol flex="4"/>
- </listcols>
-
- <listhead flex="5">
- <listheader label="Clips"/>
- <listheader label="" flex="5"/>
- </listhead>
-
- <template>
- <!-- we really should do better than hardcoding to 64x48, but I'm not
- sure how to make it scale properly -->
- <listitem uri="rdf:*"
- id="rdf:http://www.annodex.net/cmml/rdf#id"
- label="rdf:http://www.annodex.net/cmml/rdf#title"
-
- clip-id="rdf:http://www.annodex.net/cmml/rdf#clip-id"
- clip-start="rdf:http://www.annodex.net/cmml/rdf#start"
- clip-anchor-text="rdf:http://www.annodex.net/cmml/rdf#anchor-text"
- clip-anchor-href="rdf:http://www.annodex.net/cmml/rdf#anchor-href"
- clip-img-src="rdf:http://www.annodex.net/cmml/rdf#img-src"
- clip-description="rdf:http://www.annodex.net/cmml/rdf#description"
- clip-title="rdf:http://www.annodex.net/cmml/rdf#title"
- >
-
- <listcell height="48" width="66">
- <image src="rdf:http://www.annodex.net/cmml/rdf#img-src" height="48" width="64"/>
- </listcell>
-
- <listcell flex="4">
- <description flex="4"><textnode value="rdf:http://www.annodex.net/cmml/rdf#title"/></description>
- </listcell>
-
- </listitem>
- </template>
-
- </listbox>
-
- <checkbox id="follow-mode-checkbox" checked="true" label="Selected clip follows movie time"
- oncommand="updateInterface()"/>
-
- </vbox>
-
- <!-- draw a thin line to separate the clip list from the clip description (this is probably
- a total violation of the non-existent firefox UI guidelines or something, but it just looks
- really ... bad ... without _some_ sort of separator there) -->
-
- <separator maxheight="4"/>
- <splitter collapse="after"/>
- <separator maxheight="4"/>
-
- <!-- description for the currently selected clip in the clip list:
- this is initially hidden since the progress meter will be displayed
- in its place while the table of contents is loading -->
-
- <vbox id="toc-clip-info-box" flex="1" hidden="true">
-
- <label value="Hyperlink:"/>
-
- <box flex="0" pack="left">
- <box flex="1" id="toc-clip-anchor-text-box">
- <description id="toc-clip-anchor-text" onclick="activateSelectedClipHyperlink(event)" flex="1">
- </description>
- </box>
- </box>
-
- <separator maxheight="8"/>
-
- <label value="Description:"/>
-
- <box id="toc-clip-description-box" class="box-inset" flex="6">
- <description id="toc-clip-description" flex="1"
- observes="tableOfContentsIsActive" onbroadcast="updateTableOfContentsDisplay()"> </description>
- </box>
-
- </vbox>
-
- <vbox id="toc-loading-progress" flex="1" observes="tableOfContentsIsActive"
- onbroadcast="updateTableOfContentsDisplay()">
- <progressmeter id="toc_loading_progressmeter" mode="undetermined"/>
- <description id="toc_loading_progress_message" flex="1">
- Downloading the table of contents, please wait …
- </description>
- </vbox>
-
- </vbox>
-
- <!-- seperator between clip list and main view -->
-
- <separator/>
-
- <!-- note that Firefox doesn't have a grippy (and thus doesn't have
- double-click behaviour for splitters), so we implement collapsing
- the splitter ourselves. the splitter isn't currently enabled, because
- of various resizing problems and general ugly-looking-ness. -->
- <splitter id="clip-list-view-splitter" state="open" collapse="before"
- ondblclick="hideOrShowClipList()" hidden="true">
- <grippy/>
- </splitter>
-
- <!-- main view -->
-
- <vbox align="stretch" pack="center" flex="50">
-
- <!-- movie view goes here -->
-
- <hbox class="box-inset" pack="center" flex="50" type="content-primary" id="video-view-box">
- </hbox>
-
- <separator/>
-
- <hbox class="inset" pack="center">
-
- <!-- clip description or anchor text -->
-
- <hbox align="center" pack="justify" flex="50">
-
- <!-- we put a non-breaking space (" " in HTML) into the active anchor text, so that
- the active anchor text field always takes up at least one line vertically -->
- <description id="active-anchor-text" onclick="activateActiveHyperlink(event)" flex="1">
-  
- </description>
-
- </hbox>
-
- <hbox align="center" pack="right">
-
- <label hidden="true" id="current-time" value="--:--" class="time-display"/>
-
- <hbox id="media-loading-throbber-box">
-
- <image
- src="chrome://afeview/skin/Throbber-small.gif"
- height="16" width="16"/>
-
- <separator minwidth="8" maxwidth="8"/>
-
- </hbox>
-
- </hbox>
-
- </hbox>
-
- <separator/>
-
- <!-- transport controls: note that all buttons are initially disabled;
- they'll be enabled programmatically later when the movie's loaded -->
-
- <hbox pack="justify" align="stretch">
-
- <space flex="1"/>
-
- <hbox pack="center">
-
- <toolbox align="center" class="boxed">
-
- <toolbar id="transport-toolbar"
- tbautostretch="always" grippyhidden="true">
-
- <toolbarseparator class="noline"/>
-
- <toolbarbutton
- class="toolbarbutton-text"
- disabled="true"
- id="transport-go-to-beginning-button"
- observes="movieIsActive"
- tooltiptext="Go to the beginning of the movie"
- command="AFEView_transport_go_to_beginning"/>
-
- <toolbarseparator class="noline" minwidth="12"/>
-
- <toolbarbutton
- disabled="true"
- id="transport-previous-clip-button"
- observes="movieIsActive"
- tooltiptext="Go to the previous clip"
- command="AFEView_transport_go_to_previous_clip"/>
-
- <toolbarseparator class="noline"/>
-
- <toolbarbutton
- disabled="true"
- id="transport-stop-button"
- observes="movieIsActive"
- tooltiptext="Stop"
- command="AFEView_transport_stop"/>
-
- <toolbarseparator class="noline"/>
-
- <toolbarbutton
- command="AFEView_transport_pause"
- disabled="true"
- id="transport-pause-button"
- onbroadcast="updatePlayPauseButtons()"
- tooltiptext="Pause">
- <observes element="movieIsPlaying" attribute="*"/>
- <observes element="movieIsActive" attribute="disabled"/>
- </toolbarbutton>
-
- <toolbarbutton
- command="AFEView_transport_play"
- disabled="true"
- hidden="true"
- id="transport-play-button"
- onbroadcast="updatePlayPauseButtons()"
- tooltiptext="Play">
- <observes element="movieIsPlaying" attribute="*"/>
- <observes element="movieIsActive" attribute="disabled"/>
- </toolbarbutton>
-
- <toolbarseparator class="noline"/>
-
- <toolbarbutton
- disabled="true"
- id="transport-next-clip-button"
- observes="movieIsActive"
- tooltiptext="Go to the next clip"
- command="AFEView_transport_go_to_next_clip"/>
-
- <toolbarseparator class="noline"/>
-
- <toolbarbutton
- disabled="true"
- hidden="true"
- id="transport-go-to-end-button"
- observes="movieIsActive"
- tooltiptext="Go to the end of the movie"
- command="AFEView_transport_go_to_end"/>
-
- <space flex="1"/>
-
- <toolbarseparator class="noline" minwidth="16" maxwidth="16"/>
-
- <!-- "send link" button -->
-
- <button label="Send Link…" command="AFEView_send_link"/>
-
- <hbox hidden="true">
-
- <toolbarseparator class="noline" minwidth="16" maxwidth="16"/>
-
- <toolbarbutton id="volume-down-button" class="no-border" command="AFEView_volume_down"/>
-
- <vbox id="foxytunes-volume-slider-widget">
- <spacer flex="2"/>
- <slider id="foxytunes-volume-slider"
- curpos="50"
- dirty="0"
- onmouseover="refreshVolumeSliderPosition();">
- <thumb id="foxytunes-volume-thumb"/>
- </slider>
- <spacer flex="2"/>
- </vbox>
-
- <toolbarbutton id="volume-up-button" class="no-border" command="AFEView_volume_up"/>
-
- </hbox>
-
- <toolbarseparator class="noline"/>
-
- </toolbar>
-
- </toolbox>
-
- </hbox>
-
- <space flex="1"/>
-
- </hbox>
-
- </vbox>
-
-</page>
-
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://afeview/skin" type="text/css"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+ - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ -
+ - The contents of this file are subject to the Mozilla Public License Version
+ - 1.1 (the "License"); you may not use this file except in compliance with
+ - the License. You may obtain a copy of the License at
+ - http://www.mozilla.org/MPL/
+ -
+ - Software distributed under the License is distributed on an "AS IS" basis,
+ - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ - for the specific language governing rights and limitations under the
+ - License.
+ -
+ - The Original Code is the Annodex Firefox Extension.
+ -
+ - The Initial Developer of the Original Code is
+ - Commonwealth Scientific and Industrial Research Organisation (CSIRO)
+ - Australia.
+ - Portions created by the Initial Developer are Copyright (C) 2004-2005
+ - the Initial Developer. All Rights Reserved.
+ -
+ - Contributor(s):
+ - Andre Pang <andre.pang at csiro.au>
+ -
+ - Alternatively, the contents of this file may be used under the terms of
+ - either the GNU General Public License Version 2 or later (the "GPL"), or
+ - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ - in which case the provisions of the GPL or the LGPL are applicable instead
+ - of those above. If you wish to allow use of your version of this file only
+ - under the terms of either the GPL or the LGPL, and not to allow others to
+ - use your version of this file under the terms of the MPL, indicate your
+ - decision by deleting the provisions above and replace them with the notice
+ - and other provisions required by the LGPL or the GPL. If you do not delete
+ - the provisions above, a recipient may use your version of this file under
+ - the terms of any one of the MPL, the GPL or the LGPL.
+ -
+ - ***** END LICENSE BLOCK ***** -->
+
+<page
+ align="stretch"
+ orient="horizontal"
+ pack="center"
+ title="Annodex Extension for Firefox"
+ onload="AFEViewInterfaceLoaded()"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ >
+
+ <script type="application/x-javascript" src="chrome://afeview/content/MediaEngine.js"/>
+ <script type="application/x-javascript" src="chrome://afeview/content/afeview.js"/>
+
+ <!-- commands -->
+
+ <!-- transport controls: only enabled when the movie is loaded (active) -->
+ <commandset
+ commandupdater="true"
+ events="AFEViewMovieActive"
+ oncommandupdate="EnableMovieControls">
+
+ <!-- transport controls -->
+ <command id="AFEView_transport_go_to_beginning" oncommand="transportGoToBeginning(event);"/>
+ <command id="AFEView_transport_go_to_previous_clip" oncommand="transportGoToPreviousClip(event);"/>
+ <command id="AFEView_transport_stop" oncommand="transportStop(event);"/>
+ <command id="AFEView_transport_play" oncommand="transportPlay(event);"/>
+ <command id="AFEView_transport_pause" oncommand="transportPause(event);"/>
+ <command id="AFEView_transport_go_to_next_clip" oncommand="transportGoToNextClip(event);"/>
+ <command id="AFEView_transport_go_to_end" oncommand="transportGoToEnd(event);"/>
+
+ <!-- view switching -->
+ <command id="AFEView_clip_context_show_hyperlink" oncommand="clipContextShowHyperlink(event);"/>
+ <command id="AFEView_clip_context_show_current_clip_information" oncommand="clipContextViewShowCurrentClipInformation(event);"/>
+
+ <!-- volume control -->
+ <command id="AFEView_volume_down" oncommand="volumeDown(event);"/>
+ <command id="AFEView_volume_up" oncommand="volumeUp(event);"/>
+
+ <!-- send link -->
+ <command id="AFEView_send_link" oncommand="sendLink(event);"/>s
+ </commandset>
+
+ <!-- TOC controls: only enabled when there's at least one TOC item -->
+ <commandset
+ commandupdater="true"
+ events="AFEViewTOCHasAtLeastOneClip"
+ oncommandupdate="EnableTOCControls">
+ <command id="AFEView_view_show_selected_clip_description" oncommand="viewShowSelectedClipInformation(event);"/>
+ <command id="AFEView_transport_go_to_clip" oncommand="transportGoToClip(event);"/>
+ </commandset>
+
+ <!-- broadcasters -->
+
+ <broadcasterset>
+ <broadcaster id="clipSelection"/>
+
+ <!-- movie has been loaded -->
+ <broadcaster id="movieIsActive" isActive="false"/>
+
+ <!-- table of contents has been loaded -->
+ <broadcaster id="tableOfContentsIsActive" isActive="false"/>
+
+ <!-- paused or playing? -->
+ <broadcaster id="movieIsPlaying" isPlaying="true"/>
+
+ <!-- clip view context changed -->
+ <broadcaster id="clipViewContext"/>
+ </broadcasterset>
+
+ <!-- table of contents -->
+
+ <vbox id="table-of-contents-box" orient="vertical" pack="justify" flex="1" class="inset" maxwidth="300">
+
+ <!-- clip list -->
+
+ <vbox flex="1">
+
+ <!-- we encapsulate the listbox and the "follow mode" checkbox in a vbox,
+ so that when they're resized, they're kept together. (otherwise
+ there's a great ugly big space between them) -->
+
+ <listbox
+ id="clips"
+ flex="1"
+ onselect="clipSelected(event)"
+ command="AFEView_transport_go_to_clip"
+ ondblclick="transportGoToClip(event)"
+ datasources="urn:null"
+ ref="urn:clips-root">
+
+ <listcols>
+ <listcol width="66"/>
+ <listcol flex="4"/>
+ </listcols>
+
+ <listhead flex="5">
+ <listheader label="Clips"/>
+ <listheader label="" flex="5"/>
+ </listhead>
+
+ <template>
+ <!-- we really should do better than hardcoding to 64x48, but I'm not
+ sure how to make it scale properly -->
+ <listitem uri="rdf:*"
+ id="rdf:http://www.annodex.net/cmml/rdf#id"
+ label="rdf:http://www.annodex.net/cmml/rdf#title"
+
+ clip-id="rdf:http://www.annodex.net/cmml/rdf#clip-id"
+ clip-start="rdf:http://www.annodex.net/cmml/rdf#start"
+ clip-anchor-text="rdf:http://www.annodex.net/cmml/rdf#anchor-text"
+ clip-anchor-href="rdf:http://www.annodex.net/cmml/rdf#anchor-href"
+ clip-img-src="rdf:http://www.annodex.net/cmml/rdf#img-src"
+ clip-description="rdf:http://www.annodex.net/cmml/rdf#description"
+ clip-title="rdf:http://www.annodex.net/cmml/rdf#title"
+ >
+
+ <listcell height="48" width="66">
+ <image src="rdf:http://www.annodex.net/cmml/rdf#img-src" height="48" width="64"/>
+ </listcell>
+
+ <listcell flex="4">
+ <description flex="4"><textnode value="rdf:http://www.annodex.net/cmml/rdf#title"/></description>
+ </listcell>
+
+ </listitem>
+ </template>
+
+ </listbox>
+
+ <checkbox id="follow-mode-checkbox" checked="true" label="Selected clip follows movie time"
+ oncommand="updateInterface()"/>
+
+ </vbox>
+
+ <!-- draw a thin line to separate the clip list from the clip description (this is probably
+ a total violation of the non-existent firefox UI guidelines or something, but it just looks
+ really ... bad ... without _some_ sort of separator there) -->
+
+ <separator maxheight="4"/>
+ <splitter collapse="after"/>
+ <separator maxheight="4"/>
+
+ <!-- description for the currently selected clip in the clip list:
+ this is initially hidden since the progress meter will be displayed
+ in its place while the table of contents is loading -->
+
+ <vbox id="toc-clip-info-box" flex="1" hidden="true">
+
+ <label value="Hyperlink:"/>
+
+ <box flex="0" pack="left">
+ <box flex="1" id="toc-clip-anchor-text-box">
+ <description id="toc-clip-anchor-text" onclick="activateSelectedClipHyperlink(event)" flex="1">
+ </description>
+ </box>
+ </box>
+
+ <separator maxheight="8"/>
+
+ <label value="Description:"/>
+
+ <box id="toc-clip-description-box" class="box-inset" flex="6">
+ <description id="toc-clip-description" flex="1"
+ observes="tableOfContentsIsActive" onbroadcast="updateTableOfContentsDisplay()"> </description>
+ </box>
+
+ </vbox>
+
+ <vbox id="toc-loading-progress" flex="1" observes="tableOfContentsIsActive"
+ onbroadcast="updateTableOfContentsDisplay()">
+ <progressmeter id="toc_loading_progressmeter" mode="undetermined"/>
+ <description id="toc_loading_progress_message" flex="1">
+ Downloading the table of contents, please wait …
+ </description>
+ </vbox>
+
+ </vbox>
+
+ <!-- seperator between clip list and main view -->
+
+ <separator/>
+
+ <!-- note that Firefox doesn't have a grippy (and thus doesn't have
+ double-click behaviour for splitters), so we implement collapsing
+ the splitter ourselves. the splitter isn't currently enabled, because
+ of various resizing problems and general ugly-looking-ness. -->
+ <splitter id="clip-list-view-splitter" state="open" collapse="before"
+ ondblclick="hideOrShowClipList()" hidden="true">
+ <grippy/>
+ </splitter>
+
+ <!-- main view -->
+
+ <vbox align="stretch" pack="center" flex="50">
+
+ <!-- movie view goes here -->
+
+ <hbox class="box-inset" pack="center" flex="50" type="content-primary" id="video-view-box">
+ </hbox>
+
+ <separator/>
+
+ <hbox class="inset" pack="center">
+
+ <!-- clip description or anchor text -->
+
+ <hbox align="center" pack="justify" flex="50">
+
+ <!-- we put a non-breaking space (" " in HTML) into the active anchor text, so that
+ the active anchor text field always takes up at least one line vertically -->
+ <description id="active-anchor-text" onclick="activateActiveHyperlink(event)" flex="1">
+  
+ </description>
+
+ </hbox>
+
+ <hbox align="center" pack="right">
+
+ <label hidden="true" id="current-time" value="--:--" class="time-display"/>
+
+ <hbox id="media-loading-throbber-box">
+
+ <image
+ src="chrome://afeview/skin/Throbber-small.gif"
+ height="16" width="16"/>
+
+ <separator minwidth="8" maxwidth="8"/>
+
+ </hbox>
+
+ </hbox>
+
+ </hbox>
+
+ <separator/>
+
+ <!-- transport controls: note that all buttons are initially disabled;
+ they'll be enabled programmatically later when the movie's loaded -->
+
+ <hbox pack="justify" align="stretch">
+
+ <space flex="1"/>
+
+ <hbox pack="center">
+
+ <toolbox align="center" class="boxed">
+
+ <toolbar id="transport-toolbar"
+ tbautostretch="always" grippyhidden="true">
+
+ <toolbarseparator class="noline"/>
+
+ <toolbarbutton
+ class="toolbarbutton-text"
+ disabled="true"
+ id="transport-go-to-beginning-button"
+ observes="movieIsActive"
+ tooltiptext="Go to the beginning of the movie"
+ command="AFEView_transport_go_to_beginning"/>
+
+ <toolbarseparator class="noline" minwidth="12"/>
+
+ <toolbarbutton
+ disabled="true"
+ id="transport-previous-clip-button"
+ observes="movieIsActive"
+ tooltiptext="Go to the previous clip"
+ command="AFEView_transport_go_to_previous_clip"/>
+
+ <toolbarseparator class="noline"/>
+
+ <toolbarbutton
+ disabled="true"
+ id="transport-stop-button"
+ observes="movieIsActive"
+ tooltiptext="Stop"
+ command="AFEView_transport_stop"/>
+
+ <toolbarseparator class="noline"/>
+
+ <toolbarbutton
+ command="AFEView_transport_pause"
+ disabled="true"
+ id="transport-pause-button"
+ onbroadcast="updatePlayPauseButtons()"
+ tooltiptext="Pause">
+ <observes element="movieIsPlaying" attribute="*"/>
+ <observes element="movieIsActive" attribute="disabled"/>
+ </toolbarbutton>
+
+ <toolbarbutton
+ command="AFEView_transport_play"
+ disabled="true"
+ hidden="true"
+ id="transport-play-button"
+ onbroadcast="updatePlayPauseButtons()"
+ tooltiptext="Play">
+ <observes element="movieIsPlaying" attribute="*"/>
+ <observes element="movieIsActive" attribute="disabled"/>
+ </toolbarbutton>
+
+ <toolbarseparator class="noline"/>
+
+ <toolbarbutton
+ disabled="true"
+ id="transport-next-clip-button"
+ observes="movieIsActive"
+ tooltiptext="Go to the next clip"
+ command="AFEView_transport_go_to_next_clip"/>
+
+ <toolbarseparator class="noline"/>
+
+ <toolbarbutton
+ disabled="true"
+ hidden="true"
+ id="transport-go-to-end-button"
+ observes="movieIsActive"
+ tooltiptext="Go to the end of the movie"
+ command="AFEView_transport_go_to_end"/>
+
+ <space flex="1"/>
+
+ <toolbarseparator class="noline" minwidth="16" maxwidth="16"/>
+
+ <!-- "send link" button -->
+
+ <button label="Send Link…" command="AFEView_send_link"/>
+
+ <hbox hidden="true">
+
+ <toolbarseparator class="noline" minwidth="16" maxwidth="16"/>
+
+ <toolbarbutton id="volume-down-button" class="no-border" command="AFEView_volume_down"/>
+
+ <vbox id="foxytunes-volume-slider-widget">
+ <spacer flex="2"/>
+ <slider id="foxytunes-volume-slider"
+ curpos="50"
+ dirty="0"
+ onmouseover="refreshVolumeSliderPosition();">
+ <thumb id="foxytunes-volume-thumb"/>
+ </slider>
+ <spacer flex="2"/>
+ </vbox>
+
+ <toolbarbutton id="volume-up-button" class="no-border" command="AFEView_volume_up"/>
+
+ </hbox>
+
+ <toolbarseparator class="noline"/>
+
+ </toolbar>
+
+ </toolbox>
+
+ </hbox>
+
+ <space flex="1"/>
+
+ </hbox>
+
+ </vbox>
+
+</page>
+
Property changes on: AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.xul
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/contents.rdf
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/contents.rdf 2005-02-03 19:19:49 UTC (rev 828)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/contents.rdf 2005-02-04 14:40:59 UTC (rev 829)
@@ -1,57 +1,57 @@
-<?xml version="1.0"?>
-
-<!-- ***** BEGIN LICENSE BLOCK *****
- - Version: MPL 1.1/GPL 2.0/LGPL 2.1
- -
- - The contents of this file are subject to the Mozilla Public License Version
- - 1.1 (the "License"); you may not use this file except in compliance with
- - the License. You may obtain a copy of the License at
- - http://www.mozilla.org/MPL/
- -
- - Software distributed under the License is distributed on an "AS IS" basis,
- - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- - for the specific language governing rights and limitations under the
- - License.
- -
- - The Original Code is the Annodex Firefox Extension.
- -
- - The Initial Developer of the Original Code is
- - Commonwealth Scientific and Industrial Research Organisation (CSIRO)
- - Australia.
- - Portions created by the Initial Developer are Copyright (C) 2004-2005
- - the Initial Developer. All Rights Reserved.
- -
- - Contributor(s):
- - Andre Pang <andre.pang at csiro.au>
- -
- - Alternatively, the contents of this file may be used under the terms of
- - either the GNU General Public License Version 2 or later (the "GPL"), or
- - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- - in which case the provisions of the GPL or the LGPL are applicable instead
- - of those above. If you wish to allow use of your version of this file only
- - under the terms of either the GPL or the LGPL, and not to allow others to
- - use your version of this file under the terms of the MPL, indicate your
- - decision by deleting the provisions above and replace them with the notice
- - and other provisions required by the LGPL or the GPL. If you do not delete
- - the provisions above, a recipient may use your version of this file under
- - the terms of any one of the MPL, the GPL or the LGPL.
- -
- - ***** END LICENSE BLOCK ***** -->
-
-<RDF:RDF
- xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
- <RDF:Seq about="urn:mozilla:package:root">
- <RDF:li resource="urn:mozilla:package:afeview"/>
- </RDF:Seq>
-
- <RDF:Description
- about="urn:mozilla:package:afeview"
- chrome:displayName="AFEView"
- chrome:author="www.annodex.net"
- chrome:name="afeview">
- </RDF:Description>
-
-</RDF:RDF>
-
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+ - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ -
+ - The contents of this file are subject to the Mozilla Public License Version
+ - 1.1 (the "License"); you may not use this file except in compliance with
+ - the License. You may obtain a copy of the License at
+ - http://www.mozilla.org/MPL/
+ -
+ - Software distributed under the License is distributed on an "AS IS" basis,
+ - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ - for the specific language governing rights and limitations under the
+ - License.
+ -
+ - The Original Code is the Annodex Firefox Extension.
+ -
+ - The Initial Developer of the Original Code is
+ - Commonwealth Scientific and Industrial Research Organisation (CSIRO)
+ - Australia.
+ - Portions created by the Initial Developer are Copyright (C) 2004-2005
+ - the Initial Developer. All Rights Reserved.
+ -
+ - Contributor(s):
+ - Andre Pang <andre.pang at csiro.au>
+ -
+ - Alternatively, the contents of this file may be used under the terms of
+ - either the GNU General Public License Version 2 or later (the "GPL"), or
+ - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ - in which case the provisions of the GPL or the LGPL are applicable instead
+ - of those above. If you wish to allow use of your version of this file only
+ - under the terms of either the GPL or the LGPL, and not to allow others to
+ - use your version of this file under the terms of the MPL, indicate your
+ - decision by deleting the provisions above and replace them with the notice
+ - and other provisions required by the LGPL or the GPL. If you do not delete
+ - the provisions above, a recipient may use your version of this file under
+ - the terms of any one of the MPL, the GPL or the LGPL.
+ -
+ - ***** END LICENSE BLOCK ***** -->
+
+<RDF:RDF
+ xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
+
+ <RDF:Seq about="urn:mozilla:package:root">
+ <RDF:li resource="urn:mozilla:package:afeview"/>
+ </RDF:Seq>
+
+ <RDF:Description
+ about="urn:mozilla:package:afeview"
+ chrome:displayName="AFEView"
+ chrome:author="www.annodex.net"
+ chrome:name="afeview">
+ </RDF:Description>
+
+</RDF:RDF>
+
Property changes on: AnnodexFirefoxExtension/trunk/chrome/afeview/content/contents.rdf
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.js
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.js 2005-02-03 19:19:49 UTC (rev 828)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.js 2005-02-04 14:40:59 UTC (rev 829)
@@ -1,94 +1,94 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Annodex Firefox Extension.
- *
- * The Initial Developer of the Original Code is
- * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
- * Australia.
- * Portions created by the Initial Developer are Copyright (C) 2004-2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Andre Pang <andre.pang at csiro.au>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-var ClipboardHelper =
- Components.classes["@mozilla.org/widget/clipboardhelper;1"]
- .getService(Components.interfaces.nsIClipboardHelper);
-
-
-function sendLinkWindowLoaded()
-{
- var mediaURL = document.location.search;
- mediaURL = mediaURL.slice(1); // Get rid of the '?' prefix
-
- if (document.location.hash.indexOf("#") != -1)
- {
- // Found a timed URL
-
- var timeOffset = document.location.hash.slice(1);
- if (timeOffset > 0)
- {
- var timedMediaURL = mediaURL + "#" + timeOffset;
-
- var timedMediaURLTextBox = document.getElementById("timed-media-url");
- timedMediaURLTextBox.setAttribute("value", timedMediaURL);
-
- var timedURLHelpText = document.getElementById("timed-url-helptext");
- timedURLHelpText.firstChild.nodeValue =
- "If you send the following hyperlink to other people, they can start "
- + "watching the video at " + timeOffset + " seconds:"
-
- var timedURLBox = document.getElementById("timed-url-box");
- timedURLBox.setAttribute("hidden", "false");
- }
- }
- else
- {
- // No timed URL
- }
-
- var mediaURLTextBox = document.getElementById("media-url");
- mediaURLTextBox.setAttribute("value", mediaURL);
-}
-
-function copyMediaURL()
-{
- var mediaUrlString = document.getElementById("media-url")
- .getAttribute("value");
- ClipboardHelper.copyString(mediaUrlString);
-}
-
-function copyTimedMediaURL()
-{
- var timedMediaUrlString = document.getElementById("timed-media-url")
- .getAttribute("value");
- ClipboardHelper.copyString(timedMediaUrlString);
-}
-
-
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Annodex Firefox Extension.
+ *
+ * The Initial Developer of the Original Code is
+ * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
+ * Australia.
+ * Portions created by the Initial Developer are Copyright (C) 2004-2005
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Andre Pang <andre.pang at csiro.au>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+var ClipboardHelper =
+ Components.classes["@mozilla.org/widget/clipboardhelper;1"]
+ .getService(Components.interfaces.nsIClipboardHelper);
+
+
+function sendLinkWindowLoaded()
+{
+ var mediaURL = document.location.search;
+ mediaURL = mediaURL.slice(1); // Get rid of the '?' prefix
+
+ if (document.location.hash.indexOf("#") != -1)
+ {
+ // Found a timed URL
+
+ var timeOffset = document.location.hash.slice(1);
+ if (timeOffset > 0)
+ {
+ var timedMediaURL = mediaURL + "#" + timeOffset;
+
+ var timedMediaURLTextBox = document.getElementById("timed-media-url");
+ timedMediaURLTextBox.setAttribute("value", timedMediaURL);
+
+ var timedURLHelpText = document.getElementById("timed-url-helptext");
+ timedURLHelpText.firstChild.nodeValue =
+ "If you send the following hyperlink to other people, they can start "
+ + "watching the video at " + timeOffset + " seconds:"
+
+ var timedURLBox = document.getElementById("timed-url-box");
+ timedURLBox.setAttribute("hidden", "false");
+ }
+ }
+ else
+ {
+ // No timed URL
+ }
+
+ var mediaURLTextBox = document.getElementById("media-url");
+ mediaURLTextBox.setAttribute("value", mediaURL);
+}
+
+function copyMediaURL()
+{
+ var mediaUrlString = document.getElementById("media-url")
+ .getAttribute("value");
+ ClipboardHelper.copyString(mediaUrlString);
+}
+
+function copyTimedMediaURL()
+{
+ var timedMediaUrlString = document.getElementById("timed-media-url")
+ .getAttribute("value");
+ ClipboardHelper.copyString(timedMediaUrlString);
+}
+
+
Property changes on: AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.js
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.xul
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.xul 2005-02-03 19:19:49 UTC (rev 828)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.xul 2005-02-04 14:40:59 UTC (rev 829)
@@ -1,123 +1,123 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://afeview/skin" type="text/css"?>
-
-<!-- ***** BEGIN LICENSE BLOCK *****
- - Version: MPL 1.1/GPL 2.0/LGPL 2.1
- -
- - The contents of this file are subject to the Mozilla Public License Version
- - 1.1 (the "License"); you may not use this file except in compliance with
- - the License. You may obtain a copy of the License at
- - http://www.mozilla.org/MPL/
- -
- - Software distributed under the License is distributed on an "AS IS" basis,
- - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- - for the specific language governing rights and limitations under the
- - License.
- -
- - The Original Code is the Annodex Firefox Extension.
- -
- - The Initial Developer of the Original Code is
- - Commonwealth Scientific and Industrial Research Organisation (CSIRO)
- - Australia.
- - Portions created by the Initial Developer are Copyright (C) 2004-2005
- - the Initial Developer. All Rights Reserved.
- -
- - Contributor(s):
- - Andre Pang <andre.pang at csiro.au>
- -
- - Alternatively, the contents of this file may be used under the terms of
- - either the GNU General Public License Version 2 or later (the "GPL"), or
- - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- - in which case the provisions of the GPL or the LGPL are applicable instead
- - of those above. If you wish to allow use of your version of this file only
- - under the terms of either the GPL or the LGPL, and not to allow others to
- - use your version of this file under the terms of the MPL, indicate your
- - decision by deleting the provisions above and replace them with the notice
- - and other provisions required by the LGPL or the GPL. If you do not delete
- - the provisions above, a recipient may use your version of this file under
- - the terms of any one of the MPL, the GPL or the LGPL.
- -
- - ***** END LICENSE BLOCK ***** -->
-
-<page
- align="stretch"
- orient="horizontal"
- pack="center"
- title="Timed URL Link"
- onload="sendLinkWindowLoaded()"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- >
-
- <script type="application/x-javascript" src="chrome://afeview/content/sendlink.js"/>
-
- <vbox align="stretch" pack="justify" flex="1">
-
- <html:h2>Media URL</html:h2>
-
- <description id="url-helptext">
- If you send the following hyperlink to other people, they can watch
- the video from the beginning:
- </description>
-
- <separator class="thin"/>
-
- <hbox pack="center">
-
- <textbox
- multiline="false"
- cols="132"
- flex="1"
- id="media-url"
- readonly="false"
- rows="1"
- value=""/>
-
- <button label="Copy to Clipboard" oncommand="copyMediaURL()"/>
-
- </hbox>
-
- <separator/>
-
- <vbox id="timed-url-box" hidden="true">
-
- <html:h2>Timed URL</html:h2>
-
- <description id="timed-url-helptext">
- ...
- </description>
-
- <separator class="thin"/>
-
- <hbox pack="center">
-
- <textbox
- multiline="false"
- cols="132"
- flex="1"
- id="timed-media-url"
- readonly="false"
- rows="1"
- value=""/>
-
- <button label="Copy to Clipboard" oncommand="copyTimedMediaURL()"/>
-
- </hbox>
-
- </vbox>
-
- <separator/>
-
- <hbox pack="end">
-
- <button label="OK" oncommand="window.close()"/>
-
- <separator/>
-
- </hbox>
-
- </vbox>
-
-</page>
-
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://afeview/skin" type="text/css"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+ - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ -
+ - The contents of this file are subject to the Mozilla Public License Version
+ - 1.1 (the "License"); you may not use this file except in compliance with
+ - the License. You may obtain a copy of the License at
+ - http://www.mozilla.org/MPL/
+ -
+ - Software distributed under the License is distributed on an "AS IS" basis,
+ - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ - for the specific language governing rights and limitations under the
+ - License.
+ -
+ - The Original Code is the Annodex Firefox Extension.
+ -
+ - The Initial Developer of the Original Code is
+ - Commonwealth Scientific and Industrial Research Organisation (CSIRO)
+ - Australia.
+ - Portions created by the Initial Developer are Copyright (C) 2004-2005
+ - the Initial Developer. All Rights Reserved.
+ -
+ - Contributor(s):
+ - Andre Pang <andre.pang at csiro.au>
+ -
+ - Alternatively, the contents of this file may be used under the terms of
+ - either the GNU General Public License Version 2 or later (the "GPL"), or
+ - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ - in which case the provisions of the GPL or the LGPL are applicable instead
+ - of those above. If you wish to allow use of your version of this file only
+ - under the terms of either the GPL or the LGPL, and not to allow others to
+ - use your version of this file under the terms of the MPL, indicate your
+ - decision by deleting the provisions above and replace them with the notice
+ - and other provisions required by the LGPL or the GPL. If you do not delete
+ - the provisions above, a recipient may use your version of this file under
+ - the terms of any one of the MPL, the GPL or the LGPL.
+ -
+ - ***** END LICENSE BLOCK ***** -->
+
+<page
+ align="stretch"
+ orient="horizontal"
+ pack="center"
+ title="Timed URL Link"
+ onload="sendLinkWindowLoaded()"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ >
+
+ <script type="application/x-javascript" src="chrome://afeview/content/sendlink.js"/>
+
+ <vbox align="stretch" pack="justify" flex="1">
+
+ <html:h2>Media URL</html:h2>
+
+ <description id="url-helptext">
+ If you send the following hyperlink to other people, they can watch
+ the video from the beginning:
+ </description>
+
+ <separator class="thin"/>
+
+ <hbox pack="center">
+
+ <textbox
+ multiline="false"
+ cols="132"
+ flex="1"
+ id="media-url"
+ readonly="false"
+ rows="1"
+ value=""/>
+
+ <button label="Copy to Clipboard" oncommand="copyMediaURL()"/>
+
+ </hbox>
+
+ <separator/>
+
+ <vbox id="timed-url-box" hidden="true">
+
+ <html:h2>Timed URL</html:h2>
+
+ <description id="timed-url-helptext">
+ ...
+ </description>
+
+ <separator class="thin"/>
+
+ <hbox pack="center">
+
+ <textbox
+ multiline="false"
+ cols="132"
+ flex="1"
+ id="timed-media-url"
+ readonly="false"
+ rows="1"
+ value=""/>
+
+ <button label="Copy to Clipboard" oncommand="copyTimedMediaURL()"/>
+
+ </hbox>
+
+ </vbox>
+
+ <separator/>
+
+ <hbox pack="end">
+
+ <button label="OK" oncommand="window.close()"/>
+
+ <separator/>
+
+ </hbox>
+
+ </vbox>
+
+</page>
+
Property changes on: AnnodexFirefoxExtension/trunk/chrome/afeview/content/sendlink.xul
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/skin/afeview.css
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/skin/afeview.css 2005-02-03 19:19:49 UTC (rev 828)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/skin/afeview.css 2005-02-04 14:40:59 UTC (rev 829)
@@ -1,261 +1,261 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Annodex Firefox Extension.
- *
- * The Initial Developer of the Original Code is
- * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
- * Australia.
- * Portions created by the Initial Developer are Copyright (C) 2004-2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Andre Pang <andre.pang at csiro.au>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-.inset
-{
- padding: 5px;
-}
-
-page
-{
- padding: 10px;
-}
-
-#toc-clip-description-box
-{
- overflow: -moz-scrollbars-vertical;
-}
-
-#toc-clip-description
-{
- -moz-user-focus: normal;
-}
-
-/* transport controls */
-
-#transport-go-to-beginning-button
-{
- list-style-image: url("GoToBeginning.png");
-}
-
-#transport-previous-clip-button
-{
- list-style-image: url("PreviousClip.png");
-}
-
-#transport-stop-button
-{
- list-style-image: url("Stop.png");
-}
-
-#transport-pause-button
-{
- list-style-image: url("Pause.png");
-}
-
-#transport-play-button
-{
- list-style-image: url("Play.png");
-}
-
-#transport-next-clip-button
-{
- list-style-image: url("NextClip.png");
-}
-
-#transport-go-to-end-button
-{
- list-style-image: url("GoToEnd.png");
-}
-
-#volume-down-button
-{
- list-style-image: url("VolumeDown.png");
- max-width: 22px;
-}
-
-#volume-up-button
-{
- list-style-image: url("VolumeUp.png");
- max-width: 22px;
-}
-
-#active-anchor-text
-{
- font-size: 250%;
-}
-
-/* video displays */
-
-directshowview
-{
- -moz-binding: url('chrome://afeview/content/afeview.xbl#directshow-video-view');
-}
-
-windowsmediaplayer7view
-{
- -moz-binding: url('chrome://afeview/content/afeview.xbl#windows-media-player-7-video-view');
-}
-
-windowsmediaplayer64view
-{
- -moz-binding: url('chrome://afeview/content/afeview.xbl#windows-media-player-6-4-video-view');
-}
-
-quicktimeview
-{
- -moz-binding: url('chrome://afeview/content/afeview.xbl#quicktime-video-view');
-}
-
-vlcview
-{
- -moz-binding: url('chrome://afeview/content/afeview.xbl#vlc-video-view');
- -moz-box-sizing: content-box;
-}
-
-label.time-display
-{
- font-family: monospace;
- font-size: 150%;
- font-weight: bold;
-}
-
-#video-view-box
-{
- background-color: #000000;
-}
-
-/* the default mozilla/firefox splitter is just far too ugly -- all we want is
- * a thin line! */
-splitter[orient="vertical"]
-{
- /* same as a menuseparator */
- margin: 2px 0;
- border-top: 1px solid ThreeDShadow;
- border-bottom: 1px solid ThreeDHighlight;
- -moz-border-left-colors: ThreeDFace ThreeDFace;
- -moz-border-right-colors: ThreeDFace ThreeDFace;
- -moz-border-bottom-colors: ThreeDFace ThreeDFace;
-}
-
-splitter[orient="horizontal"]
-{
- /* same as a menuseparator */
- margin: 2px 0;
- border-left: 1px solid ThreeDShadow;
- border-right: 1px solid ThreeDHighlight;
- -moz-border-top-colors: ThreeDFace ThreeDFace;
- -moz-border-bottom-colors: ThreeDFace ThreeDFace;
- -moz-border-right-colors: ThreeDFace ThreeDFace;
-}
-
-listcell.listcell-iconic
-{
- width: 10%;
-}
-
-#volume-slider
-{
- min-width: 120px;
-}
-
-scrollbar.noarrows
-{
- -moz-appearance: none !important;
- background-color: -moz-Dialog;
-}
-
-/* volume slider, stolen from foxytunes */
-
-#foxytunes-volume-slider-widget {
- margin-right: 3px;
-}
-
-#foxytunes-volume-slider {
- background-image: url("chrome://afeview/skin/sliderBack.png") !important;
- -moz-appearance: none !important;
- background-repeat: repeat-x;
- width: 60px;
- height: 10px !important;
-}
-
-#foxytunes-volume-thumb {
- -moz-appearance: none !important;
- width: 14px;
- height: 10px !important;
- background: none;
- background-color: #EFF5FB;
- -moz-border-bottom-colors: rgb(113, 111, 100) rgb(172, 168, 153);
- -moz-border-left-colors: rgb(241, 239, 226) rgb(255, 255, 255);
- -moz-border-right-colors: rgb(113, 111, 100) rgb(172, 168, 153);
- -moz-border-top-colors: rgb(241, 239, 226) rgb(255, 255, 255);
- border-top-width: 2px;
- border-bottom-width: 2px;
- border-left-width: 2px;
- border-right-width: 2px;
- border-top-style: solid;
- border-bottom-style: solid;
- border-left-style: solid;
- border-right-style: solid;
-
- min-height: 8px !important;
- min-width: 0px !important;
-}
-
-#foxytunes-volume-thumb[orient="horizontal"] {
- min-height: 8px !important;
- min-width: 0px !important;
-}
-
-#foxytunes-volume-thumb > gripper {
- -moz-appearance: none !important;
- background-color: #EFF5FB;
- border: none;
-}
-
-button.no-border
-{
- -moz-appearance: none !important;
- border: none !important;
- padding: 0;
- margin: 0;
- -moz-image-region: auto;
- -moz-user-focus: ignore;
-}
-
-toolbarseparator.noline
-{
- border: none !important;
-}
-
-toolbox.boxed
-{
- border-left: 1px solid ThreeDShadow !important;
- border-right: 1px solid ThreeDHighlight !important;
-}
-
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Annodex Firefox Extension.
+ *
+ * The Initial Developer of the Original Code is
+ * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
+ * Australia.
+ * Portions created by the Initial Developer are Copyright (C) 2004-2005
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Andre Pang <andre.pang at csiro.au>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+.inset
+{
+ padding: 5px;
+}
+
+page
+{
+ padding: 10px;
+}
+
+#toc-clip-description-box
+{
+ overflow: -moz-scrollbars-vertical;
+}
+
+#toc-clip-description
+{
+ -moz-user-focus: normal;
+}
+
+/* transport controls */
+
+#transport-go-to-beginning-button
+{
+ list-style-image: url("GoToBeginning.png");
+}
+
+#transport-previous-clip-button
+{
+ list-style-image: url("PreviousClip.png");
+}
+
+#transport-stop-button
+{
+ list-style-image: url("Stop.png");
+}
+
+#transport-pause-button
+{
+ list-style-image: url("Pause.png");
+}
+
+#transport-play-button
+{
+ list-style-image: url("Play.png");
+}
+
+#transport-next-clip-button
+{
+ list-style-image: url("NextClip.png");
+}
+
+#transport-go-to-end-button
+{
+ list-style-image: url("GoToEnd.png");
+}
+
+#volume-down-button
+{
+ list-style-image: url("VolumeDown.png");
+ max-width: 22px;
+}
+
+#volume-up-button
+{
+ list-style-image: url("VolumeUp.png");
+ max-width: 22px;
+}
+
+#active-anchor-text
+{
+ font-size: 250%;
+}
+
+/* video displays */
+
+directshowview
+{
+ -moz-binding: url('chrome://afeview/content/afeview.xbl#directshow-video-view');
+}
+
+windowsmediaplayer7view
+{
+ -moz-binding: url('chrome://afeview/content/afeview.xbl#windows-media-player-7-video-view');
+}
+
+windowsmediaplayer64view
+{
+ -moz-binding: url('chrome://afeview/content/afeview.xbl#windows-media-player-6-4-video-view');
+}
+
+quicktimeview
+{
+ -moz-binding: url('chrome://afeview/content/afeview.xbl#quicktime-video-view');
+}
+
+vlcview
+{
+ -moz-binding: url('chrome://afeview/content/afeview.xbl#vlc-video-view');
+ -moz-box-sizing: content-box;
+}
+
+label.time-display
+{
+ font-family: monospace;
+ font-size: 150%;
+ font-weight: bold;
+}
+
+#video-view-box
+{
+ background-color: #000000;
+}
+
+/* the default mozilla/firefox splitter is just far too ugly -- all we want is
+ * a thin line! */
+splitter[orient="vertical"]
+{
+ /* same as a menuseparator */
+ margin: 2px 0;
+ border-top: 1px solid ThreeDShadow;
+ border-bottom: 1px solid ThreeDHighlight;
+ -moz-border-left-colors: ThreeDFace ThreeDFace;
+ -moz-border-right-colors: ThreeDFace ThreeDFace;
+ -moz-border-bottom-colors: ThreeDFace ThreeDFace;
+}
+
+splitter[orient="horizontal"]
+{
+ /* same as a menuseparator */
+ margin: 2px 0;
+ border-left: 1px solid ThreeDShadow;
+ border-right: 1px solid ThreeDHighlight;
+ -moz-border-top-colors: ThreeDFace ThreeDFace;
+ -moz-border-bottom-colors: ThreeDFace ThreeDFace;
+ -moz-border-right-colors: ThreeDFace ThreeDFace;
+}
+
+listcell.listcell-iconic
+{
+ width: 10%;
+}
+
+#volume-slider
+{
+ min-width: 120px;
+}
+
+scrollbar.noarrows
+{
+ -moz-appearance: none !important;
+ background-color: -moz-Dialog;
+}
+
+/* volume slider, stolen from foxytunes */
+
+#foxytunes-volume-slider-widget {
+ margin-right: 3px;
+}
+
+#foxytunes-volume-slider {
+ background-image: url("chrome://afeview/skin/sliderBack.png") !important;
+ -moz-appearance: none !important;
+ background-repeat: repeat-x;
+ width: 60px;
+ height: 10px !important;
+}
+
+#foxytunes-volume-thumb {
+ -moz-appearance: none !important;
+ width: 14px;
+ height: 10px !important;
+ background: none;
+ background-color: #EFF5FB;
+ -moz-border-bottom-colors: rgb(113, 111, 100) rgb(172, 168, 153);
+ -moz-border-left-colors: rgb(241, 239, 226) rgb(255, 255, 255);
+ -moz-border-right-colors: rgb(113, 111, 100) rgb(172, 168, 153);
+ -moz-border-top-colors: rgb(241, 239, 226) rgb(255, 255, 255);
+ border-top-width: 2px;
+ border-bottom-width: 2px;
+ border-left-width: 2px;
+ border-right-width: 2px;
+ border-top-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-right-style: solid;
+
+ min-height: 8px !important;
+ min-width: 0px !important;
+}
+
+#foxytunes-volume-thumb[orient="horizontal"] {
+ min-height: 8px !important;
+ min-width: 0px !important;
+}
+
+#foxytunes-volume-thumb > gripper {
+ -moz-appearance: none !important;
+ background-color: #EFF5FB;
+ border: none;
+}
+
+button.no-border
+{
+ -moz-appearance: none !important;
+ border: none !important;
+ padding: 0;
+ margin: 0;
+ -moz-image-region: auto;
+ -moz-user-focus: ignore;
+}
+
+toolbarseparator.noline
+{
+ border: none !important;
+}
+
+toolbox.boxed
+{
+ border-left: 1px solid ThreeDShadow !important;
+ border-right: 1px solid ThreeDHighlight !important;
+}
+
Property changes on: AnnodexFirefoxExtension/trunk/chrome/afeview/skin/afeview.css
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: AnnodexFirefoxExtension/trunk/chrome/afeview/skin/contents.rdf
___________________________________________________________________
Name: svn:eol-style
+ native
--
andre
More information about the cvs-annodex
mailing list