搭建timeline js在本地服务器
|
@ -2,63 +2,15 @@
|
|||
$this->headTitle($this->config->title->site);
|
||||
$this->headTitle($this->config->title->data);
|
||||
$this->headTitle('时间轴导航');
|
||||
if (!empty($this->codename)) $this->headTitle($this->codename);
|
||||
$this->headTitle()->setSeparator(' - ');
|
||||
$this->headLink()->appendStylesheet('/css/metadata.css');
|
||||
$this->breadcrumb('<a href="/">首页</a>');
|
||||
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
|
||||
$this->breadcrumb('<a href="/data/timeline">时间轴导航</a>');
|
||||
$this->breadcrumb()->setSeparator(' > ');
|
||||
$this->headScript()->appendFile('http://simile.mit.edu/timeline/api/timeline-api.js');
|
||||
$this->headScript()->captureStart();
|
||||
?>
|
||||
var tl;
|
||||
var date = "Nov 22 2007 13:00:00";
|
||||
var theme = Timeline.ClassicTheme.create();
|
||||
theme.event.label.width = 250; // px
|
||||
theme.event.bubble.width = 250;
|
||||
theme.event.bubble.height = 200;
|
||||
|
||||
window.onload=function() {
|
||||
var eventSource = new Timeline.DefaultEventSource();
|
||||
var bandInfos = [
|
||||
Timeline.createBandInfo({
|
||||
width: "70%",
|
||||
intervalUnit: Timeline.DateTime.MONTH,
|
||||
eventSource: eventSource,
|
||||
date: date,
|
||||
intervalPixels: 100,
|
||||
theme: theme
|
||||
}),
|
||||
Timeline.createBandInfo({
|
||||
width: "30%",
|
||||
intervalUnit: Timeline.DateTime.YEAR,
|
||||
eventSource: eventSource,
|
||||
date: date,
|
||||
showEventText: false,
|
||||
intervalPixels: 200,
|
||||
theme:theme
|
||||
})
|
||||
];
|
||||
bandInfos[1].syncWith = 0;
|
||||
bandInfos[1].highlight = true;
|
||||
|
||||
|
||||
tl = Timeline.create(document.getElementById("tl"), bandInfos);
|
||||
tl.loadXML("/time.xml", function(xml, url) {
|
||||
eventSource.loadXML(xml, url);
|
||||
});
|
||||
}
|
||||
var resizeTimerID = null;
|
||||
window.onresize=function() {
|
||||
if (resizeTimerID == null) {
|
||||
resizeTimerID = window.setTimeout(function() {
|
||||
resizeTimerID = null;
|
||||
tl.layout();
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
<?php $this->headScript()->captureEnd() ?>
|
||||
|
||||
$this->headScript()->appendFile('/js/timeline_var.js');
|
||||
$this->headScript()->appendFile('/js/timeline_js/timeline-api.js');
|
||||
$this->headScript()->appendFile('/js/time.js');
|
||||
?>
|
||||
<div id='tools'><?= $this->partial('data/tools.phtml'); ?></div>
|
||||
<div id="tl" class="timeline-default" style="clear:left;height: 400px;"> </div>
|
|
@ -1,33 +1,42 @@
|
|||
var tl;
|
||||
function onLoad() {
|
||||
var eventSource = new Timeline.DefaultEventSource();
|
||||
var bandInfos = [
|
||||
Timeline.createBandInfo({
|
||||
var tl;
|
||||
var date = "Nov 22 2007 13:00:00";
|
||||
var theme = Timeline.ClassicTheme.create();
|
||||
theme.event.label.width = 250; // px
|
||||
theme.event.bubble.width = 250;
|
||||
theme.event.bubble.height = 200;
|
||||
|
||||
window.onload=function() {
|
||||
var eventSource = new Timeline.DefaultEventSource();
|
||||
var bandInfos = [
|
||||
Timeline.createBandInfo({
|
||||
width: "70%",
|
||||
intervalUnit: Timeline.DateTime.MONTH,
|
||||
eventSource: eventSource,
|
||||
date: "Jun 28 2005 00:00:00 GMT",
|
||||
intervalPixels: 100
|
||||
}),
|
||||
Timeline.createBandInfo({
|
||||
date: date,
|
||||
intervalPixels: 100,
|
||||
theme: theme
|
||||
}),
|
||||
Timeline.createBandInfo({
|
||||
width: "30%",
|
||||
intervalUnit: Timeline.DateTime.YEAR,
|
||||
eventSource: eventSource,
|
||||
date: "Jun 28 2006 00:00:00 GMT",
|
||||
intervalPixels: 200
|
||||
})
|
||||
];
|
||||
bandInfos[1].syncWith = 0;
|
||||
bandInfos[1].highlight = true;
|
||||
date: date,
|
||||
showEventText: false,
|
||||
intervalPixels: 200,
|
||||
theme:theme
|
||||
})
|
||||
];
|
||||
bandInfos[1].syncWith = 0;
|
||||
bandInfos[1].highlight = true;
|
||||
|
||||
|
||||
tl = Timeline.create(document.getElementById("tl"), bandInfos);
|
||||
tl.loadXML("/time.xml", function(xml, url) {
|
||||
eventSource.loadXML(xml, url);
|
||||
});
|
||||
}
|
||||
tl = Timeline.create(document.getElementById("tl"), bandInfos);
|
||||
tl.loadXML("/time.xml", function(xml, url) {
|
||||
eventSource.loadXML(xml, url);
|
||||
});
|
||||
}
|
||||
var resizeTimerID = null;
|
||||
function onResize() {
|
||||
window.onresize=function() {
|
||||
if (resizeTimerID == null) {
|
||||
resizeTimerID = window.setTimeout(function() {
|
||||
resizeTimerID = null;
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Dummy Page for Keeping Track of History</title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 717 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 918 B |
After Width: | Height: | Size: 1.6 KiB |
|
@ -0,0 +1,43 @@
|
|||
/*==================================================
|
||||
* This file is used to detect that all outstanding
|
||||
* javascript files have been loaded. You can put
|
||||
* a function reference into SimileAjax_onLoad
|
||||
* to have it executed once all javascript files
|
||||
* have loaded.
|
||||
*==================================================
|
||||
*/
|
||||
(function() {
|
||||
var substring = SimileAjax.urlPrefix + "scripts/signal.js";
|
||||
var heads = document.documentElement.getElementsByTagName("head");
|
||||
for (var h = 0; h < heads.length; h++) {
|
||||
var node = heads[h].firstChild;
|
||||
while (node != null) {
|
||||
if (node.nodeType == 1 && node.tagName.toLowerCase() == "script") {
|
||||
var url = node.src;
|
||||
var i = url.indexOf(substring);
|
||||
if (i >= 0) {
|
||||
heads[h].removeChild(node); // remove it so we won't hit it again
|
||||
|
||||
var count = parseInt(url.substr(url.indexOf(substring) + substring.length + 1));
|
||||
SimileAjax.loadingScriptsCount -= count;
|
||||
if (SimileAjax.loadingScriptsCount == 0) {
|
||||
var f = null;
|
||||
if (typeof SimileAjax_onLoad == "string") {
|
||||
f = eval(SimileAjax_onLoad);
|
||||
SimileAjax_onLoad = null;
|
||||
} else if (typeof SimileAjax_onLoad == "function") {
|
||||
f = SimileAjax_onLoad;
|
||||
SimileAjax_onLoad = null;
|
||||
}
|
||||
|
||||
if (f != null) {
|
||||
f();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
node = node.nextSibling;
|
||||
}
|
||||
}
|
||||
})();
|
|
@ -0,0 +1,212 @@
|
|||
/*==================================================
|
||||
* Simile Ajax API
|
||||
*
|
||||
* Include this file in your HTML file as follows:
|
||||
*
|
||||
* <script src="http://simile.mit.edu/ajax/api/simile-ajax-api.js" type="text/javascript"></script>
|
||||
*
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
if (typeof SimileAjax == "undefined") {
|
||||
var SimileAjax = {
|
||||
loaded: false,
|
||||
loadingScriptsCount: 0,
|
||||
error: null,
|
||||
params: { bundle:"true" }
|
||||
};
|
||||
|
||||
SimileAjax.Platform = new Object();
|
||||
/*
|
||||
HACK: We need these 2 things here because we cannot simply append
|
||||
a <script> element containing code that accesses SimileAjax.Platform
|
||||
to initialize it because IE executes that <script> code first
|
||||
before it loads ajax.js and platform.js.
|
||||
*/
|
||||
|
||||
var getHead = function(doc) {
|
||||
return doc.getElementsByTagName("head")[0];
|
||||
};
|
||||
|
||||
SimileAjax.findScript = function(doc, substring) {
|
||||
var heads = doc.documentElement.getElementsByTagName("head");
|
||||
for (var h = 0; h < heads.length; h++) {
|
||||
var node = heads[h].firstChild;
|
||||
while (node != null) {
|
||||
if (node.nodeType == 1 && node.tagName.toLowerCase() == "script") {
|
||||
var url = node.src;
|
||||
var i = url.indexOf(substring);
|
||||
if (i >= 0) {
|
||||
return url;
|
||||
}
|
||||
}
|
||||
node = node.nextSibling;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
SimileAjax.includeJavascriptFile = function(doc, url, onerror, charset) {
|
||||
onerror = onerror || "";
|
||||
if (doc.body == null) {
|
||||
try {
|
||||
var q = "'" + onerror.replace( /'/g, '&apos' ) + "'"; // "
|
||||
doc.write("<script src='" + url + "' onerror="+ q +
|
||||
(charset ? " charset='"+ charset +"'" : "") +
|
||||
" type='text/javascript'>"+ onerror + "</script>");
|
||||
return;
|
||||
} catch (e) {
|
||||
// fall through
|
||||
}
|
||||
}
|
||||
|
||||
var script = doc.createElement("script");
|
||||
if (onerror) {
|
||||
try { script.innerHTML = onerror; } catch(e) {}
|
||||
script.setAttribute("onerror", onerror);
|
||||
}
|
||||
if (charset) {
|
||||
script.setAttribute("charset", charset);
|
||||
}
|
||||
script.type = "text/javascript";
|
||||
script.language = "JavaScript";
|
||||
script.src = url;
|
||||
return getHead(doc).appendChild(script);
|
||||
};
|
||||
SimileAjax.includeJavascriptFiles = function(doc, urlPrefix, filenames) {
|
||||
for (var i = 0; i < filenames.length; i++) {
|
||||
SimileAjax.includeJavascriptFile(doc, urlPrefix + filenames[i]);
|
||||
}
|
||||
SimileAjax.loadingScriptsCount += filenames.length;
|
||||
SimileAjax.includeJavascriptFile(doc, SimileAjax.urlPrefix + "scripts/signal.js?" + filenames.length);
|
||||
};
|
||||
SimileAjax.includeCssFile = function(doc, url) {
|
||||
if (doc.body == null) {
|
||||
try {
|
||||
doc.write("<link rel='stylesheet' href='" + url + "' type='text/css'/>");
|
||||
return;
|
||||
} catch (e) {
|
||||
// fall through
|
||||
}
|
||||
}
|
||||
|
||||
var link = doc.createElement("link");
|
||||
link.setAttribute("rel", "stylesheet");
|
||||
link.setAttribute("type", "text/css");
|
||||
link.setAttribute("href", url);
|
||||
getHead(doc).appendChild(link);
|
||||
};
|
||||
SimileAjax.includeCssFiles = function(doc, urlPrefix, filenames) {
|
||||
for (var i = 0; i < filenames.length; i++) {
|
||||
SimileAjax.includeCssFile(doc, urlPrefix + filenames[i]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Append into urls each string in suffixes after prefixing it with urlPrefix.
|
||||
* @param {Array} urls
|
||||
* @param {String} urlPrefix
|
||||
* @param {Array} suffixes
|
||||
*/
|
||||
SimileAjax.prefixURLs = function(urls, urlPrefix, suffixes) {
|
||||
for (var i = 0; i < suffixes.length; i++) {
|
||||
urls.push(urlPrefix + suffixes[i]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse out the query parameters from a URL
|
||||
* @param {String} url the url to parse, or location.href if undefined
|
||||
* @param {Object} to optional object to extend with the parameters
|
||||
* @param {Object} types optional object mapping keys to value types
|
||||
* (String, Number, Boolean or Array, String by default)
|
||||
* @return a key/value Object whose keys are the query parameter names
|
||||
* @type Object
|
||||
*/
|
||||
SimileAjax.parseURLParameters = function(url, to, types) {
|
||||
to = to || {};
|
||||
types = types || {};
|
||||
|
||||
if (typeof url == "undefined") {
|
||||
url = location.href;
|
||||
}
|
||||
var q = url.indexOf("?");
|
||||
if (q < 0) {
|
||||
return to;
|
||||
}
|
||||
url = (url+"#").slice(q+1, url.indexOf("#")); // toss the URL fragment
|
||||
|
||||
var params = url.split("&"), param, parsed = {};
|
||||
var decode = window.decodeURIComponent || unescape;
|
||||
for (var i = 0; param = params[i]; i++) {
|
||||
var eq = param.indexOf("=");
|
||||
var name = decode(param.slice(0,eq));
|
||||
var old = parsed[name];
|
||||
if (typeof old == "undefined") {
|
||||
old = [];
|
||||
} else if (!(old instanceof Array)) {
|
||||
old = [old];
|
||||
}
|
||||
parsed[name] = old.concat(decode(param.slice(eq+1)));
|
||||
}
|
||||
for (var i in parsed) {
|
||||
if (!parsed.hasOwnProperty(i)) continue;
|
||||
var type = types[i] || String;
|
||||
var data = parsed[i];
|
||||
if (!(data instanceof Array)) {
|
||||
data = [data];
|
||||
}
|
||||
if (type === Boolean && data[0] == "false") {
|
||||
to[i] = false; // because Boolean("false") === true
|
||||
} else {
|
||||
to[i] = type.apply(this, data);
|
||||
}
|
||||
}
|
||||
return to;
|
||||
};
|
||||
|
||||
(function() {
|
||||
var javascriptFiles = [
|
||||
"jquery-1.2.6.min.js",
|
||||
"platform.js",
|
||||
"debug.js",
|
||||
"xmlhttp.js",
|
||||
"json.js",
|
||||
"dom.js",
|
||||
"graphics.js",
|
||||
"date-time.js",
|
||||
"string.js",
|
||||
"html.js",
|
||||
"data-structure.js",
|
||||
"units.js",
|
||||
|
||||
"ajax.js",
|
||||
"history.js",
|
||||
"window-manager.js"
|
||||
];
|
||||
var cssFiles = [
|
||||
"graphics.css"
|
||||
];
|
||||
|
||||
if (typeof SimileAjax_urlPrefix == "string") {
|
||||
SimileAjax.urlPrefix = SimileAjax_urlPrefix;
|
||||
} else {
|
||||
var url = SimileAjax.findScript(document, "simile-ajax-api.js");
|
||||
if (url == null) {
|
||||
SimileAjax.error = new Error("Failed to derive URL prefix for Simile Ajax API code files");
|
||||
return;
|
||||
}
|
||||
|
||||
SimileAjax.urlPrefix = url.substr(0, url.indexOf("simile-ajax-api.js"));
|
||||
}
|
||||
|
||||
SimileAjax.parseURLParameters(url, SimileAjax.params, {bundle:Boolean});
|
||||
if (SimileAjax.params.bundle) {
|
||||
SimileAjax.includeJavascriptFiles(document, SimileAjax.urlPrefix, [ "simile-ajax-bundle.js" ]);
|
||||
} else {
|
||||
SimileAjax.includeJavascriptFiles(document, SimileAjax.urlPrefix + "scripts/", javascriptFiles);
|
||||
}
|
||||
SimileAjax.includeCssFiles(document, SimileAjax.urlPrefix + "styles/", cssFiles);
|
||||
|
||||
SimileAjax.loaded = true;
|
||||
})();
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
.simileAjax-bubble-border-left-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-left.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-border-right-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-right.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-border-top-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-top.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-border-bottom-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-bottom.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-border-top-left-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-top-left.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-border-top-right-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-top-right.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-border-bottom-left-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-bottom-left.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-border-bottom-right-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-bottom-right.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-arrow-point-left-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-arrow-point-left.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-arrow-point-right-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-arrow-point-right.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-arrow-point-up-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-arrow-point-up.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-arrow-point-down-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/bubble-arrow-point-down.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
||||
|
||||
.simileAjax-bubble-close-pngNotTranslucent {
|
||||
filter: expression(
|
||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + SimileAjax.urlPrefix + "images/close-button.png', sizingMethod='crop')"
|
||||
);
|
||||
}
|
|
@ -0,0 +1,171 @@
|
|||
div.simileAjax-bubble-container {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: none;
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-innerContainer {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: none;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-contentContainer {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: none;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background: white;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-border-left {
|
||||
position: absolute;
|
||||
left: -50px;
|
||||
top: 0px;
|
||||
width: 50px;
|
||||
height: 100%;
|
||||
}
|
||||
div.simileAjax-bubble-border-left-pngTranslucent {
|
||||
background: url(../images/bubble-left.png) top right repeat-y;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-border-right {
|
||||
position: absolute;
|
||||
right: -50px;
|
||||
top: 0px;
|
||||
width: 50px;
|
||||
height: 100%;
|
||||
}
|
||||
.simileAjax-bubble-border-right-pngTranslucent {
|
||||
background: url(../images/bubble-right.png) top left repeat-y;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-border-top {
|
||||
position: absolute;
|
||||
top: -50px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
}
|
||||
.simileAjax-bubble-border-top-pngTranslucent {
|
||||
background: url(../images/bubble-top.png) bottom left repeat-x;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-border-bottom {
|
||||
position: absolute;
|
||||
bottom: -50px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
}
|
||||
.simileAjax-bubble-border-bottom-pngTranslucent {
|
||||
background: url(../images/bubble-bottom.png) top left repeat-x;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-border-top-left {
|
||||
position: absolute;
|
||||
top: -50px;
|
||||
left: -50px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
.simileAjax-bubble-border-top-left-pngTranslucent {
|
||||
background: url(../images/bubble-top-left.png) bottom right no-repeat;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-border-top-right {
|
||||
position: absolute;
|
||||
top: -50px;
|
||||
right: -50px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
.simileAjax-bubble-border-top-right-pngTranslucent {
|
||||
background: url(../images/bubble-top-right.png) bottom left no-repeat;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-border-bottom-left {
|
||||
position: absolute;
|
||||
bottom: -50px;
|
||||
left: -50px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
.simileAjax-bubble-border-bottom-left-pngTranslucent {
|
||||
background: url(../images/bubble-bottom-left.png) top right no-repeat;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-border-bottom-right {
|
||||
position: absolute;
|
||||
bottom: -50px;
|
||||
right: -50px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
.simileAjax-bubble-border-bottom-right-pngTranslucent {
|
||||
background: url(../images/bubble-bottom-right.png) top left no-repeat;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-arrow-point-left {
|
||||
position: absolute;
|
||||
left: -100px;
|
||||
width: 100px;
|
||||
height: 49px;
|
||||
}
|
||||
.simileAjax-bubble-arrow-point-left-pngTranslucent {
|
||||
background: url(../images/bubble-arrow-point-left.png) center right no-repeat;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-arrow-point-right {
|
||||
position: absolute;
|
||||
right: -100px;
|
||||
width: 100px;
|
||||
height: 49px;
|
||||
}
|
||||
.simileAjax-bubble-arrow-point-right-pngTranslucent {
|
||||
background: url(../images/bubble-arrow-point-right.png) center left no-repeat;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-arrow-point-up {
|
||||
position: absolute;
|
||||
top: -100px;
|
||||
width: 49px;
|
||||
height: 100px;
|
||||
}
|
||||
.simileAjax-bubble-arrow-point-up-pngTranslucent {
|
||||
background: url(../images/bubble-arrow-point-up.png) bottom center no-repeat;
|
||||
}
|
||||
|
||||
div.simileAjax-bubble-arrow-point-down {
|
||||
position: absolute;
|
||||
bottom: -100px;
|
||||
width: 49px;
|
||||
height: 100px;
|
||||
}
|
||||
.simileAjax-bubble-arrow-point-down-pngTranslucent {
|
||||
background: url(../images/bubble-arrow-point-down.png) bottom center no-repeat;
|
||||
}
|
||||
|
||||
|
||||
div.simileAjax-bubble-close {
|
||||
position: absolute;
|
||||
right: -10px;
|
||||
top: -12px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.simileAjax-bubble-close-pngTranslucent {
|
||||
background: url(../images/close-button.png) no-repeat;
|
||||
}
|
After Width: | Height: | Size: 534 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 754 B |
After Width: | Height: | Size: 803 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 880 B |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 941 B |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 793 B |
After Width: | Height: | Size: 560 B |
After Width: | Height: | Size: 676 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 551 B |
After Width: | Height: | Size: 513 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 539 B |
After Width: | Height: | Size: 539 B |
After Width: | Height: | Size: 532 B |
After Width: | Height: | Size: 513 B |
After Width: | Height: | Size: 544 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 717 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 918 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1002 B |
After Width: | Height: | Size: 538 B |
After Width: | Height: | Size: 5.9 KiB |
|
@ -0,0 +1,30 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["cs"] = [
|
||||
"Leden", "Únor", "Bøezen", "Duben", "Kvìten", "Èerven", "Èervenec", "Srpen", "Záøí", "Øíjen", "Listopad", "Prosinec"
|
||||
];
|
||||
|
||||
Timeline.GregorianDateLabeller.dayNames["cs"] = [
|
||||
"Ne", "Po", "Út", "St", "Èt", "Pá", "So"
|
||||
];
|
||||
|
||||
Timeline.GregorianDateLabeller.labelIntervalFunctions["cs"] = function(date, intervalUnit) {
|
||||
var text;
|
||||
var emphasized = false;
|
||||
|
||||
var date2 = Timeline.DateTime.removeTimeZoneOffset(date, this._timeZone);
|
||||
|
||||
switch(intervalUnit) {
|
||||
case Timeline.DateTime.DAY:
|
||||
case Timeline.DateTime.WEEK:
|
||||
text = date2.getUTCDate() + ". " + (date2.getUTCMonth() + 1) + ".";
|
||||
break;
|
||||
default:
|
||||
return this.defaultLabelInterval(date, intervalUnit);
|
||||
}
|
||||
|
||||
return { text: text, emphasized: emphasized };
|
||||
};
|
|
@ -0,0 +1,9 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["cs"] = {
|
||||
wikiLinkLabel: "Diskuze"
|
||||
};
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["de"] = [
|
||||
"Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"
|
||||
];
|
||||
|
||||
Timeline.GregorianDateLabeller.labelIntervalFunctions["de"] = function(date, intervalUnit) {
|
||||
var text;
|
||||
var emphasized = false;
|
||||
|
||||
var date2 = Timeline.DateTime.removeTimeZoneOffset(date, this._timeZone);
|
||||
|
||||
switch(intervalUnit) {
|
||||
case Timeline.DateTime.DAY:
|
||||
case Timeline.DateTime.WEEK:
|
||||
text = date2.getUTCDate() + ". " +
|
||||
Timeline.GregorianDateLabeller.getMonthName(date2.getUTCMonth(), this._locale);
|
||||
break;
|
||||
default:
|
||||
return this.defaultLabelInterval(date, intervalUnit);
|
||||
}
|
||||
|
||||
return { text: text, emphasized: emphasized };
|
||||
};
|
|
@ -0,0 +1,8 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["de"] = {
|
||||
wikiLinkLabel: "Diskutieren"
|
||||
};
|
|
@ -0,0 +1,12 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["en"] = [
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
];
|
||||
|
||||
Timeline.GregorianDateLabeller.dayNames["en"] = [
|
||||
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
||||
];
|
|
@ -0,0 +1,9 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["en"] = {
|
||||
wikiLinkLabel: "Discuss"
|
||||
};
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["es"] = [
|
||||
"Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"
|
||||
];
|
|
@ -0,0 +1,9 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["es"] = {
|
||||
wikiLinkLabel: "Discute"
|
||||
};
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["fr"] = [
|
||||
"jan", "fev", "mar", "avr", "mai", "jui", "jui", "aou", "sep", "oct", "nov", "dec"
|
||||
];
|
|
@ -0,0 +1,9 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["fr"] = {
|
||||
wikiLinkLabel: "Discute"
|
||||
};
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["it"] = [
|
||||
"Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"
|
||||
];
|
|
@ -0,0 +1,9 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["it"] = {
|
||||
wikiLinkLabel: "Discuti"
|
||||
};
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
/* The Dutch do not capitalize months
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["nl"] = [
|
||||
"jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"
|
||||
];
|
|
@ -0,0 +1,9 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["nl"] = {
|
||||
wikiLinkLabel: "Discussieer"
|
||||
};
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*
|
||||
* UTF-8 encoded
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["ru"] = [
|
||||
"Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"
|
||||
];
|
|
@ -0,0 +1,9 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["ru"] = {
|
||||
wikiLinkLabel: "обсудите"
|
||||
};
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["se"] = [
|
||||
"Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"
|
||||
];
|
||||
|
||||
Timeline.GregorianDateLabeller.dayNames["se"] = [
|
||||
"Sön", "Mån", "Tis", "Ons", "Tors", "Fre", "Lör"
|
||||
];
|
|
@ -0,0 +1,9 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["se"] = {
|
||||
wikiLinkLabel: "Discuss"
|
||||
};
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["tr"] = [
|
||||
"Ock", "Şbt", "Mrt", "Nsn", "Mys", "Hzr", "Tem", "Ağs", "Eyl", "Ekm", "Ksm", "Arl"
|
||||
];
|
|
@ -0,0 +1,9 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["tr"] = {
|
||||
wikiLinkLabel: "Tartış"
|
||||
};
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["vi"] = [
|
||||
"Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12"
|
||||
];
|
||||
|
||||
Timeline.GregorianDateLabeller.labelIntervalFunctions["vi"] = function(date, intervalUnit) {
|
||||
var text;
|
||||
var emphasized = false;
|
||||
|
||||
var date2 = Timeline.DateTime.removeTimeZoneOffset(date, this._timeZone);
|
||||
|
||||
switch(intervalUnit) {
|
||||
case Timeline.DateTime.DAY:
|
||||
case Timeline.DateTime.WEEK:
|
||||
text = date2.getUTCDate() + "/" + (date2.getUTCMonth() + 1);
|
||||
break;
|
||||
default:
|
||||
return this.defaultLabelInterval(date, intervalUnit);
|
||||
}
|
||||
|
||||
return { text: text, emphasized: emphasized };
|
||||
};
|
|
@ -0,0 +1,9 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["vi"] = {
|
||||
wikiLinkLabel: "Bàn luận"
|
||||
};
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["zh"] = [
|
||||
"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"
|
||||
];
|
||||
|
||||
Timeline.GregorianDateLabeller.labelIntervalFunctions["zh"] = function(date, intervalUnit) {
|
||||
var text;
|
||||
var emphasized = false;
|
||||
|
||||
var date2 = Timeline.DateTime.removeTimeZoneOffset(date, this._timeZone);
|
||||
|
||||
switch(intervalUnit) {
|
||||
case Timeline.DateTime.DAY:
|
||||
case Timeline.DateTime.WEEK:
|
||||
text = Timeline.GregorianDateLabeller.getMonthName(date2.getUTCMonth(), this._locale) +
|
||||
date2.getUTCDate() + "日";
|
||||
break;
|
||||
default:
|
||||
return this.defaultLabelInterval(date, intervalUnit);
|
||||
}
|
||||
|
||||
return { text: text, emphasized: emphasized };
|
||||
};
|
|
@ -0,0 +1,9 @@
|
|||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["zh"] = {
|
||||
wikiLinkLabel: "讨论"
|
||||
};
|
||||
|
|
@ -0,0 +1,280 @@
|
|||
/*==================================================
|
||||
* Timeline API
|
||||
*
|
||||
* This file will load all the Javascript files
|
||||
* necessary to make the standard timeline work.
|
||||
* It also detects the default locale.
|
||||
*
|
||||
* To run from the MIT copy of Timeline:
|
||||
* Include this file in your HTML file as follows:
|
||||
*
|
||||
* <script src="http://static.simile.mit.edu/timeline/api-2.3.0/timeline-api.js"
|
||||
* type="text/javascript"></script>
|
||||
*
|
||||
*
|
||||
* To host the Timeline files on your own server:
|
||||
* 1) Install the Timeline and Simile-Ajax files onto your webserver using
|
||||
* timeline_libraries.zip or timeline_source.zip
|
||||
*
|
||||
* 2) Set global js variables used to send parameters to this script:
|
||||
* Timeline_ajax_url -- url for simile-ajax-api.js
|
||||
* Timeline_urlPrefix -- url for the *directory* that contains timeline-api.js
|
||||
* Include trailing slash
|
||||
* Timeline_parameters='bundle=true'; // you must set bundle to true if you are using
|
||||
* // timeline_libraries.zip since only the
|
||||
* // bundled libraries are included
|
||||
*
|
||||
* eg your html page would include
|
||||
*
|
||||
* <script>
|
||||
* Timeline_ajax_url="http://YOUR_SERVER/javascripts/timeline/timeline_ajax/simile-ajax-api.js";
|
||||
* Timeline_urlPrefix='http://YOUR_SERVER/javascripts/timeline/timeline_js/';
|
||||
* Timeline_parameters='bundle=true';
|
||||
* </script>
|
||||
* <script src="http://YOUR_SERVER/javascripts/timeline/timeline_js/timeline-api.js"
|
||||
* type="text/javascript">
|
||||
* </script>
|
||||
*
|
||||
* SCRIPT PARAMETERS
|
||||
* This script auto-magically figures out locale and has defaults for other parameters
|
||||
* To set parameters explicity, set js global variable Timeline_parameters or include as
|
||||
* parameters on the url using GET style. Eg the two next lines pass the same parameters:
|
||||
* Timeline_parameters='bundle=true'; // pass parameter via js variable
|
||||
* <script src="http://....timeline-api.js?bundle=true" // pass parameter via url
|
||||
*
|
||||
* Parameters
|
||||
* timeline-use-local-resources --
|
||||
* bundle -- true: use the single js bundle file; false: load individual files (for debugging)
|
||||
* locales --
|
||||
* defaultLocale --
|
||||
* forceLocale -- force locale to be a particular value--used for debugging. Normally locale is determined
|
||||
* by browser's and server's locale settings.
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var useLocalResources = false;
|
||||
if (document.location.search.length > 0) {
|
||||
var params = document.location.search.substr(1).split("&");
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
if (params[i] == "timeline-use-local-resources") {
|
||||
useLocalResources = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var loadMe = function() {
|
||||
if ("Timeline" in window) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.Timeline = new Object();
|
||||
window.Timeline.DateTime = window.SimileAjax.DateTime; // for backward compatibility
|
||||
|
||||
var bundle = false;
|
||||
var javascriptFiles = [
|
||||
"timeline.js",
|
||||
"band.js",
|
||||
"themes.js",
|
||||
"ethers.js",
|
||||
"ether-painters.js",
|
||||
"event-utils.js",
|
||||
"labellers.js",
|
||||
"sources.js",
|
||||
"original-painter.js",
|
||||
"detailed-painter.js",
|
||||
"overview-painter.js",
|
||||
"compact-painter.js",
|
||||
"decorators.js",
|
||||
"units.js"
|
||||
];
|
||||
var cssFiles = [
|
||||
"timeline.css",
|
||||
"ethers.css",
|
||||
"events.css"
|
||||
];
|
||||
|
||||
var localizedJavascriptFiles = [
|
||||
"timeline.js",
|
||||
"labellers.js"
|
||||
];
|
||||
var localizedCssFiles = [
|
||||
];
|
||||
|
||||
// ISO-639 language codes, ISO-3166 country codes (2 characters)
|
||||
var supportedLocales = [
|
||||
"cs", // Czech
|
||||
"de", // German
|
||||
"en", // English
|
||||
"es", // Spanish
|
||||
"fr", // French
|
||||
"it", // Italian
|
||||
"nl", // Dutch (The Netherlands)
|
||||
"ru", // Russian
|
||||
"se", // Swedish
|
||||
"tr", // Turkish
|
||||
"vi", // Vietnamese
|
||||
"zh" // Chinese
|
||||
];
|
||||
|
||||
try {
|
||||
var desiredLocales = [ "en" ],
|
||||
defaultServerLocale = "en",
|
||||
forceLocale = null;
|
||||
|
||||
var parseURLParameters = function(parameters) {
|
||||
var params = parameters.split("&");
|
||||
for (var p = 0; p < params.length; p++) {
|
||||
var pair = params[p].split("=");
|
||||
if (pair[0] == "locales") {
|
||||
desiredLocales = desiredLocales.concat(pair[1].split(","));
|
||||
} else if (pair[0] == "defaultLocale") {
|
||||
defaultServerLocale = pair[1];
|
||||
} else if (pair[0] == "forceLocale") {
|
||||
forceLocale = pair[1];
|
||||
desiredLocales = desiredLocales.concat(pair[1].split(","));
|
||||
} else if (pair[0] == "bundle") {
|
||||
bundle = pair[1] != "false";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
(function() {
|
||||
if (typeof Timeline_urlPrefix == "string") {
|
||||
Timeline.urlPrefix = Timeline_urlPrefix;
|
||||
if (typeof Timeline_parameters == "string") {
|
||||
parseURLParameters(Timeline_parameters);
|
||||
}
|
||||
} else {
|
||||
var heads = document.documentElement.getElementsByTagName("head");
|
||||
for (var h = 0; h < heads.length; h++) {
|
||||
var scripts = heads[h].getElementsByTagName("script");
|
||||
for (var s = 0; s < scripts.length; s++) {
|
||||
var url = scripts[s].src;
|
||||
var i = url.indexOf("timeline-api.js");
|
||||
if (i >= 0) {
|
||||
Timeline.urlPrefix = url.substr(0, i);
|
||||
var q = url.indexOf("?");
|
||||
if (q > 0) {
|
||||
parseURLParameters(url.substr(q + 1));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new Error("Failed to derive URL prefix for Timeline API code files");
|
||||
}
|
||||
})();
|
||||
|
||||
var includeJavascriptFiles = function(urlPrefix, filenames) {
|
||||
SimileAjax.includeJavascriptFiles(document, urlPrefix, filenames);
|
||||
}
|
||||
var includeCssFiles = function(urlPrefix, filenames) {
|
||||
SimileAjax.includeCssFiles(document, urlPrefix, filenames);
|
||||
}
|
||||
|
||||
/*
|
||||
* Include non-localized files
|
||||
*/
|
||||
if (bundle) {
|
||||
includeJavascriptFiles(Timeline.urlPrefix, [ "timeline-bundle.js" ]);
|
||||
includeCssFiles(Timeline.urlPrefix, [ "timeline-bundle.css" ]);
|
||||
} else {
|
||||
includeJavascriptFiles(Timeline.urlPrefix + "scripts/", javascriptFiles);
|
||||
includeCssFiles(Timeline.urlPrefix + "styles/", cssFiles);
|
||||
}
|
||||
|
||||
/*
|
||||
* Include localized files
|
||||
*/
|
||||
var loadLocale = [];
|
||||
loadLocale[defaultServerLocale] = true;
|
||||
|
||||
var tryExactLocale = function(locale) {
|
||||
for (var l = 0; l < supportedLocales.length; l++) {
|
||||
if (locale == supportedLocales[l]) {
|
||||
loadLocale[locale] = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
var tryLocale = function(locale) {
|
||||
if (tryExactLocale(locale)) {
|
||||
return locale;
|
||||
}
|
||||
|
||||
var dash = locale.indexOf("-");
|
||||
if (dash > 0 && tryExactLocale(locale.substr(0, dash))) {
|
||||
return locale.substr(0, dash);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
for (var l = 0; l < desiredLocales.length; l++) {
|
||||
tryLocale(desiredLocales[l]);
|
||||
}
|
||||
|
||||
var defaultClientLocale = defaultServerLocale;
|
||||
var defaultClientLocales = ("language" in navigator ? navigator.language : navigator.browserLanguage).split(";");
|
||||
for (var l = 0; l < defaultClientLocales.length; l++) {
|
||||
var locale = tryLocale(defaultClientLocales[l]);
|
||||
if (locale != null) {
|
||||
defaultClientLocale = locale;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (var l = 0; l < supportedLocales.length; l++) {
|
||||
var locale = supportedLocales[l];
|
||||
if (loadLocale[locale]) {
|
||||
includeJavascriptFiles(Timeline.urlPrefix + "scripts/l10n/" + locale + "/", localizedJavascriptFiles);
|
||||
includeCssFiles(Timeline.urlPrefix + "styles/l10n/" + locale + "/", localizedCssFiles);
|
||||
}
|
||||
}
|
||||
|
||||
if (forceLocale == null) {
|
||||
Timeline.serverLocale = defaultServerLocale;
|
||||
Timeline.clientLocale = defaultClientLocale;
|
||||
} else {
|
||||
Timeline.serverLocale = forceLocale;
|
||||
Timeline.clientLocale = forceLocale;
|
||||
}
|
||||
} catch (e) {
|
||||
alert(e);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* Load SimileAjax if it's not already loaded
|
||||
*/
|
||||
if (typeof SimileAjax == "undefined") {
|
||||
window.SimileAjax_onLoad = loadMe;
|
||||
|
||||
var url = useLocalResources ?
|
||||
"http://127.0.0.1:9999/ajax/api/simile-ajax-api.js?bundle=false" :
|
||||
"http://static.simile.mit.edu/ajax/api-2.2.0/simile-ajax-api.js";
|
||||
if (typeof Timeline_ajax_url == "string") {
|
||||
url = Timeline_ajax_url;
|
||||
}
|
||||
var createScriptElement = function() {
|
||||
var script = document.createElement("script");
|
||||
script.type = "text/javascript";
|
||||
script.language = "JavaScript";
|
||||
script.src = url;
|
||||
document.getElementsByTagName("head")[0].appendChild(script);
|
||||
}
|
||||
if (document.body == null) {
|
||||
try {
|
||||
document.write("<script src='" + url + "' type='text/javascript'></script>");
|
||||
} catch (e) {
|
||||
createScriptElement();
|
||||
}
|
||||
} else {
|
||||
createScriptElement();
|
||||
}
|
||||
} else {
|
||||
loadMe();
|
||||
}
|
||||
})();
|
|
@ -0,0 +1,229 @@
|
|||
|
||||
|
||||
/*------------------- Horizontal / Vertical lines ----------------*/
|
||||
|
||||
/* style for ethers */
|
||||
.timeline-ether-lines{border-color:#666; border-style:dotted; position:absolute;}
|
||||
.timeline-horizontal .timeline-ether-lines{border-width:0 0 0 1px; height:100%; top: 0; width: 1px;}
|
||||
.timeline-vertical .timeline-ether-lines{border-width:1px 0 0; height:1px; left: 0; width: 100%;}
|
||||
|
||||
|
||||
|
||||
/*---------------- Weekends ---------------------------*/
|
||||
.timeline-ether-weekends{
|
||||
position:absolute;
|
||||
background-color:#FFFFE0;
|
||||
}
|
||||
|
||||
.timeline-vertical .timeline-ether-weekends{left:0;width:100%;}
|
||||
.timeline-horizontal .timeline-ether-weekends{top:0; height:100%;}
|
||||
|
||||
|
||||
/*-------------------------- HIGHLIGHT DECORATORS -------------------*/
|
||||
/* Used for decorators, not used for Timeline Highlight */
|
||||
.timeline-highlight-decorator,
|
||||
.timeline-highlight-point-decorator{
|
||||
position:absolute;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
/* Width of horizontal decorators and Height of vertical decorators is
|
||||
set in the decorator function params */
|
||||
.timeline-horizontal .timeline-highlight-point-decorator,
|
||||
.timeline-horizontal .timeline-highlight-decorator{
|
||||
top:0;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.timeline-vertical .timeline-highlight-point-decorator,
|
||||
.timeline-vertical .timeline-highlight-decorator{
|
||||
width:100%;
|
||||
left:0;
|
||||
}
|
||||
|
||||
.timeline-highlight-decorator{background-color:#FFC080;}
|
||||
.timeline-highlight-point-decorator{background-color:#ff5;}
|
||||
|
||||
|
||||
/*---------------------------- LABELS -------------------------*/
|
||||
.timeline-highlight-label {
|
||||
position:absolute; overflow:hidden; font-size:200%;
|
||||
font-weight:bold; color:#999; }
|
||||
|
||||
|
||||
/*---------------- VERTICAL LABEL -------------------*/
|
||||
.timeline-horizontal .timeline-highlight-label {top:0; height:100%;}
|
||||
.timeline-horizontal .timeline-highlight-label td {vertical-align:middle;}
|
||||
.timeline-horizontal .timeline-highlight-label-start {text-align:right;}
|
||||
.timeline-horizontal .timeline-highlight-label-end {text-align:left;}
|
||||
|
||||
|
||||
/*---------------- HORIZONTAL LABEL -------------------*/
|
||||
.timeline-vertical .timeline-highlight-label {left:0;width:100%;}
|
||||
.timeline-vertical .timeline-highlight-label td {vertical-align:top;}
|
||||
.timeline-vertical .timeline-highlight-label-start {text-align:center;}
|
||||
.timeline-vertical .timeline-highlight-label-end {text-align:center;}
|
||||
|
||||
|
||||
/*-------------------------------- DATE LABELS --------------------------------*/
|
||||
.timeline-date-label {
|
||||
position: absolute;
|
||||
border: solid #aaa;
|
||||
color: #aaa;
|
||||
width: 5em;
|
||||
height: 1.5em;}
|
||||
.timeline-date-label-em {color: #000;}
|
||||
|
||||
/* horizontal */
|
||||
.timeline-horizontal .timeline-date-label{padding-left:2px;}
|
||||
.timeline-horizontal .timeline-date-label{border-width:0 0 0 1px;}
|
||||
.timeline-horizontal .timeline-date-label-em{height:2em}
|
||||
|
||||
/* vertical */
|
||||
.timeline-vertical .timeline-date-label{padding-top:2px;}
|
||||
.timeline-vertical .timeline-date-label{border-width:1px 0 0;}
|
||||
.timeline-vertical .timeline-date-label-em{width:7em}
|
||||
|
||||
|
||||
/*------------------------------- Ether.highlight -------------------------*/
|
||||
.timeline-ether-highlight{position:absolute; background-color:#fff;}
|
||||
.timeline-horizontal .timeline-ether-highlight{top:2px;}
|
||||
.timeline-vertical .timeline-ether-highlight{left:2px;}
|
||||
|
||||
|
||||
/*------------------------------ EVENTS ------------------------------------*/
|
||||
.timeline-event-icon, .timeline-event-label,.timeline-event-tape{
|
||||
position:absolute;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.timeline-event-tape,
|
||||
.timeline-small-event-tape,
|
||||
.timeline-small-event-icon{
|
||||
background-color:#58A0DC;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.timeline-small-event-tape,
|
||||
.timeline-small-event-icon{
|
||||
position:absolute;
|
||||
}
|
||||
|
||||
.timeline-small-event-icon{width:1px; height:6px;}
|
||||
|
||||
|
||||
/*--------------------------------- TIMELINE-------------------------*/
|
||||
.timeline-ether-bg{width:100%; height:100%;}
|
||||
.timeline-band-0 .timeline-ether-bg{background-color:#eee}
|
||||
.timeline-band-1 .timeline-ether-bg{background-color:#ddd}
|
||||
.timeline-band-2 .timeline-ether-bg{background-color:#ccc}
|
||||
.timeline-band-3 .timeline-ether-bg{background-color:#aaa}
|
||||
.timeline-duration-event {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
border: 1px solid blue;
|
||||
}
|
||||
|
||||
.timeline-instant-event2 {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
border-left: 1px solid blue;
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
.timeline-instant-event {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.timeline-event-bubble-title {
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #888;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.timeline-event-bubble-body {
|
||||
}
|
||||
|
||||
.timeline-event-bubble-wiki {
|
||||
margin: 0.5em;
|
||||
text-align: right;
|
||||
color: #A0A040;
|
||||
}
|
||||
.timeline-event-bubble-wiki a {
|
||||
color: #A0A040;
|
||||
}
|
||||
|
||||
.timeline-event-bubble-time {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.timeline-event-bubble-image {
|
||||
float: right;
|
||||
padding-left: 5px;
|
||||
padding-bottom: 5px;
|
||||
}.timeline-container {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.timeline-copyright {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
z-index: 1000;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.timeline-message-container {
|
||||
position: absolute;
|
||||
top: 30%;
|
||||
left: 35%;
|
||||
right: 35%;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
}
|
||||
.timeline-message {
|
||||
font-size: 120%;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
.timeline-message img {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.timeline-band {
|
||||
position: absolute;
|
||||
background: #eee;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.timeline-band-inner {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.timeline-band-input {
|
||||
position: absolute;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
overflow: hidden;
|
||||
z-index: 0;
|
||||
}
|
||||
.timeline-band-input input{
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.timeline-band-layer {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.timeline-band-layer-inner {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
Timeline_ajax_url="/js/timeline_ajax/simile-ajax-api.js";
|
||||
Timeline_urlPrefix='/js/timeline_js/';
|
||||
Timeline_parameters='bundle=true';
|