Yes, I've just started playing around with the same idea.
This is how I've done it.
Create your timeline as a stand alone HTML page as usual:
<html>
<head>
<link rel='stylesheet' href='styles.css' type='text/css' />
<script src="http://simile.mit.edu/timeline/api/timeline-api.js"
type="text/javascript"></script>
</head>
<body onload="onLoad();">
<div class="timeline-default timeline-container" id="my-timeline"
style="height: 350px; border: 1px solid #aaa"></div>
</body>
<script type="text/javascript">
var tl;
function onLoad() {
var eventSource = new Timeline.DefaultEventSource();
...
Timeline.loadXML("jfk.xml", function(xml, url) { eventSource.loadXML
(xml, url); });
}
</script>
</html>
Create a new web part, as a content editor web part (HTML document
basically).
Edit it with the source editor and past the whole code.
You need to make a couple of changes.
First obviously all references to the XML event file, CSS files, ect
have to be dealt with properly (I just put them as documents in a
hidden document library and refer to them with absolute URL.
Second, there is a problem with the main timeline script :
http://simile.mit.edu/timeline/api/timeline-api.js because it tries to
derive the URL prefix for the Timeline API code files, based on a
<script> tag in the <head> section. But once your HTML is incorporated
in a Sharepoint web part, that <script> tag is NOT in the document's
head. So I basically have a local copy of the timeline-api.js where
I've hard-coded the URL prefix:
(function() {
Timeline.urlPrefix =
"http://simile.mit.edu/timeline/api/";
})();
(I know it is dirty but I am just playing around).
Finally, you need to fix the onLoad() issue because, even if it seems
to work in Firefox, in IE it does not. The reason seems to be that IE
call the onLoad before the page content is define (including the
reference to the DIV anchor. So you need to use the Sharepoint
javascript for delaying onload calls (_spBodyOnLoadFunctionNames):
<script type="text/javascript">
var tl;
function onLoad() {
var eventSource = new Timeline.DefaultEventSource();
...
Timeline.loadXML("jfk.xml", function(xml, url) { eventSource.loadXML
(xml, url); });
}
_spBodyOnLoadFunctionNames.push("onLoad");
</script>
And that's it. You have a fine timeline as a web part in sharepoint.
Now, obviously, if you need parameters (for the event file for
example), you need a bit more the above. But that is a different
story....
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---