1 var SimileAjax_urlPrefix = baseuri() + 'data/'; |
1 var SimileAjax_urlPrefix = baseuri() + 'data/'; |
2 var Timeline_urlPrefix = baseuri() + 'data/'; |
2 var Timeline_urlPrefix = baseuri() + 'data/'; |
3 |
3 |
4 /*================================================== |
4 /* |
5 * Simile Ajax API |
5 * Simile Ajax API |
6 * |
6 * |
7 * Include this file in your HTML file as follows: |
7 * Include this file in your HTML file as follows: |
8 * |
8 * |
9 * <script src="http://simile.mit.edu/ajax/api/simile-ajax-api.js" type="text/javascript"></script> |
9 * <script src="http://simile.mit.edu/ajax/api/simile-ajax-api.js" type="text/javascript"></script> |
10 * |
10 * |
11 *================================================== |
11 * |
12 */ |
12 */ |
13 |
13 |
14 if (typeof SimileAjax == "undefined") { |
14 if (typeof SimileAjax == "undefined") { |
15 var SimileAjax = { |
15 var SimileAjax = { |
16 loaded: false, |
16 loaded: false, |
211 // SimileAjax.includeCssFiles(document, SimileAjax.urlPrefix + "styles/", cssFiles); |
211 // SimileAjax.includeCssFiles(document, SimileAjax.urlPrefix + "styles/", cssFiles); |
212 |
212 |
213 SimileAjax.loaded = true; |
213 SimileAjax.loaded = true; |
214 })(); |
214 })(); |
215 } |
215 } |
216 /*================================================== |
216 /* |
217 * Platform Utility Functions and Constants |
217 * Platform Utility Functions and Constants |
218 *================================================== |
218 * |
219 */ |
219 */ |
220 |
220 |
221 /* This must be called after our jQuery has been loaded |
221 /* This must be called after our jQuery has been loaded |
222 but before control returns to user-code. |
222 but before control returns to user-code. |
223 */ |
223 */ |
676 } catch (e) { |
677 } catch (e) { |
677 return false; |
678 return false; |
678 } |
679 } |
679 }; |
680 }; |
680 })(); |
681 })(); |
681 /*================================================== |
682 /* |
682 * DOM Utility Functions |
683 * DOM Utility Functions |
683 *================================================== |
684 * |
684 */ |
685 */ |
685 |
686 |
686 SimileAjax.DOM = new Object(); |
687 SimileAjax.DOM = new Object(); |
687 |
688 |
688 SimileAjax.DOM.registerEventWithObject = function(elmt, eventName, obj, handlerName) { |
689 SimileAjax.DOM.registerEventWithObject = function(elmt, eventName, obj, handlerName) { |
1038 SimileAjax.Graphics.pngIsTranslucent = (!SimileAjax.Platform.browser.isIE) || (SimileAjax.Platform.browser.majorVersion > 6); |
1039 SimileAjax.Graphics.pngIsTranslucent = (!SimileAjax.Platform.browser.isIE) || (SimileAjax.Platform.browser.majorVersion > 6); |
1039 if (!SimileAjax.Graphics.pngIsTranslucent) { |
1040 if (!SimileAjax.Graphics.pngIsTranslucent) { |
1040 SimileAjax.includeCssFile(document, SimileAjax.urlPrefix + "styles/graphics-ie6.css"); |
1041 SimileAjax.includeCssFile(document, SimileAjax.urlPrefix + "styles/graphics-ie6.css"); |
1041 } |
1042 } |
1042 |
1043 |
1043 /*================================================== |
1044 /* |
1044 * Opacity, translucency |
1045 * Opacity, translucency |
1045 *================================================== |
1046 * |
1046 */ |
1047 */ |
1047 SimileAjax.Graphics._createTranslucentImage1 = function(url, verticalAlign) { |
1048 SimileAjax.Graphics._createTranslucentImage1 = function(url, verticalAlign) { |
1048 var elmt = document.createElement("img"); |
1049 var elmt = document.createElement("img"); |
1049 elmt.setAttribute("src", url); |
1050 elmt.setAttribute("src", url); |
1050 if (verticalAlign != null) { |
1051 if (verticalAlign != null) { |
1117 elmt.style.opacity = o; |
1118 elmt.style.opacity = o; |
1118 elmt.style.MozOpacity = o; |
1119 elmt.style.MozOpacity = o; |
1119 } |
1120 } |
1120 }; |
1121 }; |
1121 |
1122 |
1122 /*================================================== |
1123 /* |
1123 * Bubble |
1124 * Bubble |
1124 *================================================== |
1125 * |
1125 */ |
1126 */ |
1126 |
1127 |
1127 SimileAjax.Graphics.bubbleConfig = { |
1128 SimileAjax.Graphics.bubbleConfig = { |
1128 containerCSSClass: "simileAjax-bubble-container", |
1129 containerCSSClass: "simileAjax-bubble-container", |
1129 innerContainerCSSClass: "simileAjax-bubble-innerContainer", |
1130 innerContainerCSSClass: "simileAjax-bubble-innerContainer", |
1477 containerDiv: containerDiv, |
1478 containerDiv: containerDiv, |
1478 contentDiv: contentDiv |
1479 contentDiv: contentDiv |
1479 }; |
1480 }; |
1480 }; |
1481 }; |
1481 |
1482 |
1482 /*================================================== |
1483 /* |
1483 * Animation |
1484 * Animation |
1484 *================================================== |
1485 * |
1485 */ |
1486 */ |
1486 |
1487 |
1487 /** |
1488 /** |
1488 * Creates an animation for a function, and an interval of values. The word |
1489 * Creates an animation for a function, and an interval of values. The word |
1489 * "animation" here is used in the sense of repeatedly calling a function with |
1490 * "animation" here is used in the sense of repeatedly calling a function with |
2125 */ |
2126 */ |
2126 SimileAjax.DateTime.getTimezone = function() { |
2127 SimileAjax.DateTime.getTimezone = function() { |
2127 var d = new Date().getTimezoneOffset(); |
2128 var d = new Date().getTimezoneOffset(); |
2128 return d / -60; |
2129 return d / -60; |
2129 }; |
2130 }; |
2130 /*================================================== |
2131 /* |
2131 * String Utility Functions and Constants |
2132 * String Utility Functions and Constants |
2132 *================================================== |
2133 * |
2133 */ |
2134 */ |
2134 |
2135 |
2135 String.prototype.trim = function() { |
2136 String.prototype.trim = function() { |
2136 return this.replace(/^\s+|\s+$/g, ''); |
2137 return this.replace(/^\s+|\s+$/g, ''); |
2137 }; |
2138 }; |
2168 if (start < s.length) { |
2169 if (start < s.length) { |
2169 result += s.substring(start); |
2170 result += s.substring(start); |
2170 } |
2171 } |
2171 return result; |
2172 return result; |
2172 }; |
2173 }; |
2173 /*================================================== |
2174 /* |
2174 * HTML Utility Functions |
2175 * HTML Utility Functions |
2175 *================================================== |
2176 * |
2176 */ |
2177 */ |
2177 |
2178 |
2178 SimileAjax.HTML = new Object(); |
2179 SimileAjax.HTML = new Object(); |
2179 |
2180 |
2180 SimileAjax.HTML._e2uHash = {}; |
2181 SimileAjax.HTML._e2uHash = {}; |
2951 |
2952 |
2952 SimileAjax.NativeDateUnit.change = function(v, n) { |
2953 SimileAjax.NativeDateUnit.change = function(v, n) { |
2953 return new Date(v.getTime() + n); |
2954 return new Date(v.getTime() + n); |
2954 }; |
2955 }; |
2955 |
2956 |
2956 /*================================================== |
2957 /* |
2957 * General, miscellaneous SimileAjax stuff |
2958 * General, miscellaneous SimileAjax stuff |
2958 *================================================== |
2959 * |
2959 */ |
2960 */ |
2960 |
2961 |
2961 SimileAjax.ListenerQueue = function(wildcardHandlerName) { |
2962 SimileAjax.ListenerQueue = function(wildcardHandlerName) { |
2962 this._listeners = []; |
2963 this._listeners = []; |
2963 this._wildcardHandlerName = wildcardHandlerName; |
2964 this._wildcardHandlerName = wildcardHandlerName; |
3018 * SimileAjax.History.maxHistoryLength |
3019 * SimileAjax.History.maxHistoryLength |
3019 * to a different number. |
3020 * to a different number. |
3020 * |
3021 * |
3021 * An iframe is inserted into the document's body element to track |
3022 * An iframe is inserted into the document's body element to track |
3022 * onload events. |
3023 * onload events. |
3023 *====================================================================== |
3024 * |
3024 */ |
3025 */ |
3025 |
3026 |
3026 SimileAjax.History = { |
3027 SimileAjax.History = { |
3027 maxHistoryLength: 10, |
3028 maxHistoryLength: 10, |
3028 historyFile: "__history__.html", |
3029 historyFile: "__history__.html", |
3694 * <script src="http://api.simile-widgets.org/timeline/2.3.1/api/timeline-api.js?bundle=false" type="text/javascript"></script> |
3695 * <script src="http://api.simile-widgets.org/timeline/2.3.1/api/timeline-api.js?bundle=false" type="text/javascript"></script> |
3695 * |
3696 * |
3696 * Note that the Ajax version is usually NOT the same as the Timeline version. |
3697 * Note that the Ajax version is usually NOT the same as the Timeline version. |
3697 * See variable simile_ajax_ver below for the current version |
3698 * See variable simile_ajax_ver below for the current version |
3698 * |
3699 * |
3699 *================================================== |
3700 * |
3700 */ |
3701 */ |
3701 |
3702 |
3702 (function() { |
3703 (function() { |
3703 |
3704 |
3704 var simile_ajax_ver = "2.2.1"; // ===========>>> current Simile-Ajax version |
3705 var simile_ajax_ver = "2.2.1"; // ===========>>> current Simile-Ajax version |
3948 * which enforce privacy in objects. |
3949 * which enforce privacy in objects. |
3949 * |
3950 * |
3950 * We also want to use jslint: http://www.jslint.com/ |
3951 * We also want to use jslint: http://www.jslint.com/ |
3951 * |
3952 * |
3952 * |
3953 * |
3953 *================================================== |
3954 * |
3954 */ |
3955 */ |
3955 |
3956 |
3956 |
3957 |
3957 |
3958 |
3958 /*================================================== |
3959 /* |
3959 * Timeline VERSION |
3960 * Timeline VERSION |
3960 *================================================== |
3961 * |
3961 */ |
3962 */ |
3962 // Note: version is also stored in the build.xml file |
3963 // Note: version is also stored in the build.xml file |
3963 Timeline.version = 'pre 2.4.0'; // use format 'pre 1.2.3' for trunk versions |
3964 Timeline.version = 'pre 2.4.0'; // use format 'pre 1.2.3' for trunk versions |
3964 Timeline.ajax_lib_version = SimileAjax.version; |
3965 Timeline.ajax_lib_version = SimileAjax.version; |
3965 Timeline.display_version = Timeline.version + ' (with Ajax lib ' + Timeline.ajax_lib_version + ')'; |
3966 Timeline.display_version = Timeline.version + ' (with Ajax lib ' + Timeline.ajax_lib_version + ')'; |
3966 // cf method Timeline.writeVersion |
3967 // cf method Timeline.writeVersion |
3967 |
3968 |
3968 /*================================================== |
3969 /* |
3969 * Timeline |
3970 * Timeline |
3970 *================================================== |
3971 * |
3971 */ |
3972 */ |
3972 Timeline.strings = {}; // localization string tables |
3973 Timeline.strings = {}; // localization string tables |
3973 Timeline.HORIZONTAL = 0; |
3974 Timeline.HORIZONTAL = 0; |
3974 Timeline.VERTICAL = 1; |
3975 Timeline.VERTICAL = 1; |
3975 Timeline._defaultTheme = null; |
3976 Timeline._defaultTheme = null; |
4181 document.getElementById(el_id).innerHTML = this.display_version; |
4182 document.getElementById(el_id).innerHTML = this.display_version; |
4182 }; |
4183 }; |
4183 |
4184 |
4184 |
4185 |
4185 |
4186 |
4186 /*================================================== |
4187 /* |
4187 * Timeline Implementation object |
4188 * Timeline Implementation object |
4188 *================================================== |
4189 * |
4189 */ |
4190 */ |
4190 Timeline._Impl = function(elmt, bandInfos, orientation, unit, timelineID) { |
4191 Timeline._Impl = function(elmt, bandInfos, orientation, unit, timelineID) { |
4191 SimileAjax.WindowManager.initialize(); |
4192 SimileAjax.WindowManager.initialize(); |
4192 |
4193 |
4193 this._containerDiv = elmt; |
4194 this._containerDiv = elmt; |
4605 * which enforce privacy in objects. |
4606 * which enforce privacy in objects. |
4606 * |
4607 * |
4607 * We also want to use jslint: http://www.jslint.com/ |
4608 * We also want to use jslint: http://www.jslint.com/ |
4608 * |
4609 * |
4609 * |
4610 * |
4610 *================================================== |
4611 * |
4611 */ |
4612 */ |
4612 |
4613 |
4613 |
4614 |
4614 |
4615 |
4615 /*================================================== |
4616 /* |
4616 * Band |
4617 * Band |
4617 *================================================== |
4618 * |
4618 */ |
4619 */ |
4619 Timeline._Band = function(timeline, bandInfo, index) { |
4620 Timeline._Band = function(timeline, bandInfo, index) { |
4620 // hack for easier subclassing |
4621 // hack for easier subclassing |
4621 if (timeline !== undefined) { |
4622 if (timeline !== undefined) { |
4622 this.initialize(timeline, bandInfo, index); |
4623 this.initialize(timeline, bandInfo, index); |
5521 } |
5522 } |
5522 } |
5523 } |
5523 }; |
5524 }; |
5524 |
5525 |
5525 this.mouseWheel = 'scroll'; // 'default', 'zoom', 'scroll' |
5526 this.mouseWheel = 'scroll'; // 'default', 'zoom', 'scroll' |
5526 };/*================================================== |
5527 };/* |
5527 * An "ether" is a object that maps date/time to pixel coordinates. |
5528 * An "ether" is a object that maps date/time to pixel coordinates. |
5528 *================================================== |
5529 * |
5529 */ |
5530 */ |
5530 |
5531 |
5531 /*================================================== |
5532 /* |
5532 * Linear Ether |
5533 * Linear Ether |
5533 *================================================== |
5534 * |
5534 */ |
5535 */ |
5535 |
5536 |
5536 Timeline.LinearEther = function(params) { |
5537 Timeline.LinearEther = function(params) { |
5537 this._params = params; |
5538 this._params = params; |
5538 this._interval = params.interval; |
5539 this._interval = params.interval; |
5826 }; |
5827 }; |
5827 |
5828 |
5828 Timeline.HotZoneEther.prototype._getScale = function() { |
5829 Timeline.HotZoneEther.prototype._getScale = function() { |
5829 return this._interval / this._pixelsPerInterval; |
5830 return this._interval / this._pixelsPerInterval; |
5830 }; |
5831 }; |
5831 /*================================================== |
5832 /* |
5832 * Gregorian Ether Painter |
5833 * Gregorian Ether Painter |
5833 *================================================== |
5834 * |
5834 */ |
5835 */ |
5835 |
5836 |
5836 Timeline.GregorianEtherPainter = function(params) { |
5837 Timeline.GregorianEtherPainter = function(params) { |
5837 this._params = params; |
5838 this._params = params; |
5838 this._theme = params.theme; |
5839 this._theme = params.theme; |
5917 this._unit += netIntervalChange; |
5918 this._unit += netIntervalChange; |
5918 } |
5919 } |
5919 }; |
5920 }; |
5920 |
5921 |
5921 |
5922 |
5922 /*================================================== |
5923 /* |
5923 * Hot Zone Gregorian Ether Painter |
5924 * Hot Zone Gregorian Ether Painter |
5924 *================================================== |
5925 * |
5925 */ |
5926 */ |
5926 |
5927 |
5927 Timeline.HotZoneGregorianEtherPainter = function(params) { |
5928 Timeline.HotZoneGregorianEtherPainter = function(params) { |
5928 this._params = params; |
5929 this._params = params; |
5929 this._theme = params.theme; |
5930 this._theme = params.theme; |
6167 }; |
6168 }; |
6168 |
6169 |
6169 Timeline.YearCountEtherPainter.prototype.softPaint = function() { |
6170 Timeline.YearCountEtherPainter.prototype.softPaint = function() { |
6170 }; |
6171 }; |
6171 |
6172 |
6172 /*================================================== |
6173 /* |
6173 * Quarterly Ether Painter |
6174 * Quarterly Ether Painter |
6174 *================================================== |
6175 * |
6175 */ |
6176 */ |
6176 |
6177 |
6177 Timeline.QuarterlyEtherPainter = function(params) { |
6178 Timeline.QuarterlyEtherPainter = function(params) { |
6178 this._params = params; |
6179 this._params = params; |
6179 this._theme = params.theme; |
6180 this._theme = params.theme; |
6255 }; |
6256 }; |
6256 |
6257 |
6257 Timeline.QuarterlyEtherPainter.prototype.softPaint = function() { |
6258 Timeline.QuarterlyEtherPainter.prototype.softPaint = function() { |
6258 }; |
6259 }; |
6259 |
6260 |
6260 /*================================================== |
6261 /* |
6261 * Ether Interval Marker Layout |
6262 * Ether Interval Marker Layout |
6262 *================================================== |
6263 * |
6263 */ |
6264 */ |
6264 |
6265 |
6265 Timeline.EtherIntervalMarkerLayout = function(timeline, band, theme, align, showLine) { |
6266 Timeline.EtherIntervalMarkerLayout = function(timeline, band, theme, align, showLine) { |
6266 var horizontal = timeline.isHorizontal(); |
6267 var horizontal = timeline.isHorizontal(); |
6267 if (horizontal) { |
6268 if (horizontal) { |
6402 this._highlightDiv.style.height = length + "px"; |
6403 this._highlightDiv.style.height = length + "px"; |
6403 this._highlightDiv.style.width = (band.getViewWidth() - 4) + "px"; |
6404 this._highlightDiv.style.width = (band.getViewWidth() - 4) + "px"; |
6404 } |
6405 } |
6405 } |
6406 } |
6406 }; |
6407 }; |
6407 /*================================================== |
6408 /* |
6408 * Event Utils |
6409 * Event Utils |
6409 *================================================== |
6410 * |
6410 */ |
6411 */ |
6411 Timeline.EventUtils = {}; |
6412 Timeline.EventUtils = {}; |
6412 |
6413 |
6413 Timeline.EventUtils.getNewEventID = function() { |
6414 Timeline.EventUtils.getNewEventID = function() { |
6414 // global across page |
6415 // global across page |
6419 this._lastEventID += 1; |
6420 this._lastEventID += 1; |
6420 return "e" + this._lastEventID; |
6421 return "e" + this._lastEventID; |
6421 }; |
6422 }; |
6422 |
6423 |
6423 Timeline.EventUtils.decodeEventElID = function(elementID) { |
6424 Timeline.EventUtils.decodeEventElID = function(elementID) { |
6424 /*================================================== |
6425 /* |
6425 * |
6426 * |
6426 * Use this function to decode an event element's id on a band (label div, |
6427 * Use this function to decode an event element's id on a band (label div, |
6427 * tape div or icon img). |
6428 * tape div or icon img). |
6428 * |
6429 * |
6429 * Returns {band: <bandObj>, evt: <eventObj>} |
6430 * Returns {band: <bandObj>, evt: <eventObj>} |
6445 * |
6446 * |
6446 * You can then retrieve the timeline object and event object |
6447 * You can then retrieve the timeline object and event object |
6447 * by using Timeline.getTimeline, Timeline.getBand, or |
6448 * by using Timeline.getTimeline, Timeline.getBand, or |
6448 * Timeline.getEvent and passing in the element's id |
6449 * Timeline.getEvent and passing in the element's id |
6449 * |
6450 * |
6450 *================================================== |
6451 * |
6451 */ |
6452 */ |
6452 |
6453 |
6453 var parts = elementID.split('-'); |
6454 var parts = elementID.split('-'); |
6454 if (parts[1] != 'tl') { |
6455 if (parts[1] != 'tl') { |
6455 alert("Internal Timeline problem 101, please consult support"); |
6456 alert("Internal Timeline problem 101, please consult support"); |
6465 |
6466 |
6466 Timeline.EventUtils.encodeEventElID = function(timeline, band, elType, evt) { |
6467 Timeline.EventUtils.encodeEventElID = function(timeline, band, elType, evt) { |
6467 // elType should be one of {label | icon | tapeN | highlightN} |
6468 // elType should be one of {label | icon | tapeN | highlightN} |
6468 return elType + "-tl-" + timeline.timelineID + |
6469 return elType + "-tl-" + timeline.timelineID + |
6469 "-" + band.getIndex() + "-" + evt.getID(); |
6470 "-" + band.getIndex() + "-" + evt.getID(); |
6470 };/*================================================== |
6471 };/* |
6471 * Gregorian Date Labeller |
6472 * Gregorian Date Labeller |
6472 *================================================== |
6473 * |
6473 */ |
6474 */ |
6474 |
6475 |
6475 Timeline.GregorianDateLabeller = function(locale, timeZone) { |
6476 Timeline.GregorianDateLabeller = function(locale, timeZone) { |
6476 this._locale = locale; |
6477 this._locale = locale; |
6477 this._timeZone = timeZone; |
6478 this._timeZone = timeZone; |
6556 text = date.toUTCString(); |
6557 text = date.toUTCString(); |
6557 } |
6558 } |
6558 return { text: text, emphasized: emphasized }; |
6559 return { text: text, emphasized: emphasized }; |
6559 } |
6560 } |
6560 |
6561 |
6561 /*================================================== |
6562 /* |
6562 * Default Event Source |
6563 * Default Event Source |
6563 *================================================== |
6564 * |
6564 */ |
6565 */ |
6565 |
6566 |
6566 |
6567 |
6567 Timeline.DefaultEventSource = function(eventIndex) { |
6568 Timeline.DefaultEventSource = function(eventIndex) { |
6568 this._events = (eventIndex instanceof Object) ? eventIndex : new SimileAjax.EventIndex(); |
6569 this._events = (eventIndex instanceof Object) ? eventIndex : new SimileAjax.EventIndex(); |
7123 elmt.appendChild(divWiki); |
7124 elmt.appendChild(divWiki); |
7124 } |
7125 } |
7125 }; |
7126 }; |
7126 |
7127 |
7127 |
7128 |
7128 /*================================================== |
7129 /* |
7129 * Original Event Painter |
7130 * Original Event Painter |
7130 *================================================== |
7131 * |
7131 */ |
7132 */ |
7132 |
7133 |
7133 /*================================================== |
7134 /* |
7134 * |
7135 * |
7135 * To enable a single event listener to monitor everything |
7136 * To enable a single event listener to monitor everything |
7136 * on a Timeline, we need a way to map from an event's icon, |
7137 * on a Timeline, we need a way to map from an event's icon, |
7137 * label or tape element to the associated timeline, band and |
7138 * label or tape element to the associated timeline, band and |
7138 * specific event. |
7139 * specific event. |
7150 * highlight2-tl-<timelineID>-<band_index>-<evt.id> |
7151 * highlight2-tl-<timelineID>-<band_index>-<evt.id> |
7151 * // some events have more than one highlight div (future) |
7152 * // some events have more than one highlight div (future) |
7152 * You can then retrieve the band/timeline objects and event object |
7153 * You can then retrieve the band/timeline objects and event object |
7153 * by using Timeline.EventUtils.decodeEventElID |
7154 * by using Timeline.EventUtils.decodeEventElID |
7154 * |
7155 * |
7155 *================================================== |
7156 * |
7156 */ |
7157 */ |
7157 |
7158 |
7158 /* |
7159 /* |
7159 * eventPaintListener functions receive calls about painting. |
7160 * eventPaintListener functions receive calls about painting. |
7160 * function(band, op, evt, els) |
7161 * function(band, op, evt, els) |
7816 Timeline.OriginalEventPainter.prototype._fireEventPaintListeners = function(op, evt, els) { |
7817 Timeline.OriginalEventPainter.prototype._fireEventPaintListeners = function(op, evt, els) { |
7817 for (var i = 0; i < this._eventPaintListeners.length; i++) { |
7818 for (var i = 0; i < this._eventPaintListeners.length; i++) { |
7818 this._eventPaintListeners[i](this._band, op, evt, els); |
7819 this._eventPaintListeners[i](this._band, op, evt, els); |
7819 } |
7820 } |
7820 }; |
7821 }; |
7821 /*================================================== |
7822 /* |
7822 * Detailed Event Painter |
7823 * Detailed Event Painter |
7823 *================================================== |
7824 * |
7824 */ |
7825 */ |
7825 |
7826 |
7826 // Note: a number of features from original-painter |
7827 // Note: a number of features from original-painter |
7827 // are not yet implemented in detailed painter. |
7828 // are not yet implemented in detailed painter. |
7828 // Eg classname, id attributes for icons, labels, tapes |
7829 // Eg classname, id attributes for icons, labels, tapes |
8507 Timeline.DetailedEventPainter.prototype._fireOnSelect = function(eventID) { |
8508 Timeline.DetailedEventPainter.prototype._fireOnSelect = function(eventID) { |
8508 for (var i = 0; i < this._onSelectListeners.length; i++) { |
8509 for (var i = 0; i < this._onSelectListeners.length; i++) { |
8509 this._onSelectListeners[i](eventID); |
8510 this._onSelectListeners[i](eventID); |
8510 } |
8511 } |
8511 }; |
8512 }; |
8512 /*================================================== |
8513 /* |
8513 * Overview Event Painter |
8514 * Overview Event Painter |
8514 *================================================== |
8515 * |
8515 */ |
8516 */ |
8516 |
8517 |
8517 Timeline.OverviewEventPainter = function(params) { |
8518 Timeline.OverviewEventPainter = function(params) { |
8518 this._params = params; |
8519 this._params = params; |
8519 this._onSelectListeners = []; |
8520 this._onSelectListeners = []; |
8765 }; |
8766 }; |
8766 |
8767 |
8767 Timeline.OverviewEventPainter.prototype.showBubble = function(evt) { |
8768 Timeline.OverviewEventPainter.prototype.showBubble = function(evt) { |
8768 // not implemented |
8769 // not implemented |
8769 }; |
8770 }; |
8770 /*================================================== |
8771 /* |
8771 * Compact Event Painter |
8772 * Compact Event Painter |
8772 *================================================== |
8773 * |
8773 */ |
8774 */ |
8774 |
8775 |
8775 Timeline.CompactEventPainter = function(params) { |
8776 Timeline.CompactEventPainter = function(params) { |
8776 this._params = params; |
8777 this._params = params; |
8777 this._onSelectListeners = []; |
8778 this._onSelectListeners = []; |
9829 Timeline.CompactEventPainter.prototype._fireOnSelect = function(eventIDs) { |
9830 Timeline.CompactEventPainter.prototype._fireOnSelect = function(eventIDs) { |
9830 for (var i = 0; i < this._onSelectListeners.length; i++) { |
9831 for (var i = 0; i < this._onSelectListeners.length; i++) { |
9831 this._onSelectListeners[i](eventIDs); |
9832 this._onSelectListeners[i](eventIDs); |
9832 } |
9833 } |
9833 }; |
9834 }; |
9834 /*================================================== |
9835 /* |
9835 * Span Highlight Decorator |
9836 * Span Highlight Decorator |
9836 *================================================== |
9837 * |
9837 */ |
9838 */ |
9838 |
9839 |
9839 Timeline.SpanHighlightDecorator = function(params) { |
9840 Timeline.SpanHighlightDecorator = function(params) { |
9840 // When evaluating params, test against null. Not "p in params". Testing against |
9841 // When evaluating params, test against null. Not "p in params". Testing against |
9841 // null enables caller to explicitly request the default. Testing against "in" means |
9842 // null enables caller to explicitly request the default. Testing against "in" means |
9946 }; |
9947 }; |
9947 |
9948 |
9948 Timeline.SpanHighlightDecorator.prototype.softPaint = function() { |
9949 Timeline.SpanHighlightDecorator.prototype.softPaint = function() { |
9949 }; |
9950 }; |
9950 |
9951 |
9951 /*================================================== |
9952 /* |
9952 * Point Highlight Decorator |
9953 * Point Highlight Decorator |
9953 *================================================== |
9954 * |
9954 */ |
9955 */ |
9955 |
9956 |
9956 Timeline.PointHighlightDecorator = function(params) { |
9957 Timeline.PointHighlightDecorator = function(params) { |
9957 this._unit = params.unit != null ? params.unit : SimileAjax.NativeDateUnit; |
9958 this._unit = params.unit != null ? params.unit : SimileAjax.NativeDateUnit; |
9958 this._date = (typeof params.date == "string") ? |
9959 this._date = (typeof params.date == "string") ? |
10013 this._layerDiv.style.display = "block"; |
10014 this._layerDiv.style.display = "block"; |
10014 }; |
10015 }; |
10015 |
10016 |
10016 Timeline.PointHighlightDecorator.prototype.softPaint = function() { |
10017 Timeline.PointHighlightDecorator.prototype.softPaint = function() { |
10017 }; |
10018 }; |
10018 /*================================================== |
10019 /* |
10019 * Default Unit |
10020 * Default Unit |
10020 *================================================== |
10021 * |
10021 */ |
10022 */ |
10022 |
10023 |
10023 Timeline.NativeDateUnit = new Object(); |
10024 Timeline.NativeDateUnit = new Object(); |
10024 |
10025 |
10025 Timeline.NativeDateUnit.createLabeller = function(locale, timeZone) { |
10026 Timeline.NativeDateUnit.createLabeller = function(locale, timeZone) { |
10081 |
10082 |
10082 Timeline.NativeDateUnit.change = function(v, n) { |
10083 Timeline.NativeDateUnit.change = function(v, n) { |
10083 return new Date(v.getTime() + n); |
10084 return new Date(v.getTime() + n); |
10084 }; |
10085 }; |
10085 |
10086 |
10086 /*================================================== |
10087 /* |
10087 * Common localization strings |
10088 * Common localization strings |
10088 *================================================== |
10089 * |
10089 */ |
10090 */ |
10090 |
10091 |
10091 Timeline.strings["fr"] = { |
10092 Timeline.strings["fr"] = { |
10092 wikiLinkLabel: "Discute" |
10093 wikiLinkLabel: "Discute" |
10093 }; |
10094 }; |
10094 |
10095 |
10095 /*================================================== |
10096 /* |
10096 * Localization of labellers.js |
10097 * Localization of labellers.js |
10097 *================================================== |
10098 * |
10098 */ |
10099 */ |
10099 |
10100 |
10100 Timeline.GregorianDateLabeller.monthNames["fr"] = [ |
10101 Timeline.GregorianDateLabeller.monthNames["fr"] = [ |
10101 "jan", "fev", "mar", "avr", "mai", "jui", "jui", "aou", "sep", "oct", "nov", "dec" |
10102 "jan", "fev", "mar", "avr", "mai", "jui", "jui", "aou", "sep", "oct", "nov", "dec" |
10102 ]; |
10103 ]; |
10103 /*================================================== |
10104 /* |
10104 * Common localization strings |
10105 * Common localization strings |
10105 *================================================== |
10106 * |
10106 */ |
10107 */ |
10107 |
10108 |
10108 Timeline.strings["en"] = { |
10109 Timeline.strings["en"] = { |
10109 wikiLinkLabel: "Discuss" |
10110 wikiLinkLabel: "Discuss" |
10110 }; |
10111 }; |
10111 |
10112 |
10112 /*================================================== |
10113 /* |
10113 * Localization of labellers.js |
10114 * Localization of labellers.js |
10114 *================================================== |
10115 * |
10115 */ |
10116 */ |
10116 |
10117 |
10117 Timeline.GregorianDateLabeller.monthNames["en"] = [ |
10118 Timeline.GregorianDateLabeller.monthNames["en"] = [ |
10118 "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" |
10119 "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" |
10119 ]; |
10120 ]; |