author | sylvain.thenault@logilab.fr |
Fri, 30 Jan 2009 15:26:25 +0100 | |
changeset 528 | 60bd171ecd04 |
parent 68 | c0a4be863a7d |
child 1156 | 4b920f836567 |
permissions | -rw-r--r-- |
0 | 1 |
|
2 |
var SimileAjax = { |
|
3 |
loaded: false, |
|
4 |
loadingScriptsCount: 0, |
|
5 |
error: null, |
|
6 |
params: { bundle:"true" } |
|
7 |
}; |
|
8 |
||
9 |
||
10 |
/** |
|
11 |
* Parse out the query parameters from a URL |
|
12 |
* @param {String} url the url to parse, or location.href if undefined |
|
13 |
* @param {Object} to optional object to extend with the parameters |
|
14 |
* @param {Object} types optional object mapping keys to value types |
|
15 |
* (String, Number, Boolean or Array, String by default) |
|
16 |
* @return a key/value Object whose keys are the query parameter names |
|
17 |
* @type Object |
|
18 |
*/ |
|
19 |
SimileAjax.parseURLParameters = function(url, to, types) { |
|
20 |
to = to || {}; |
|
21 |
types = types || {}; |
|
22 |
||
23 |
if (typeof url == "undefined") { |
|
24 |
url = location.href; |
|
25 |
} |
|
26 |
var q = url.indexOf("?"); |
|
27 |
if (q < 0) { |
|
28 |
return to; |
|
29 |
} |
|
30 |
url = (url+"#").slice(q+1, url.indexOf("#")); // toss the URL fragment |
|
31 |
||
32 |
var params = url.split("&"), param, parsed = {}; |
|
33 |
var decode = window.decodeURIComponent || unescape; |
|
34 |
for (var i = 0; param = params[i]; i++) { |
|
35 |
var eq = param.indexOf("="); |
|
36 |
var name = decode(param.slice(0,eq)); |
|
37 |
var old = parsed[name]; |
|
38 |
if (typeof old == "undefined") { |
|
39 |
old = []; |
|
40 |
} else if (!(old instanceof Array)) { |
|
41 |
old = [old]; |
|
42 |
} |
|
43 |
parsed[name] = old.concat(decode(param.slice(eq+1))); |
|
44 |
} |
|
45 |
for (var i in parsed) { |
|
46 |
if (!parsed.hasOwnProperty(i)) continue; |
|
47 |
var type = types[i] || String; |
|
48 |
var data = parsed[i]; |
|
49 |
if (!(data instanceof Array)) { |
|
50 |
data = [data]; |
|
51 |
} |
|
52 |
if (type === Boolean && data[0] == "false") { |
|
53 |
to[i] = false; // because Boolean("false") === true |
|
54 |
} else { |
|
55 |
to[i] = type.apply(this, data); |
|
56 |
} |
|
57 |
} |
|
58 |
return to; |
|
59 |
}; |
|
60 |
||
61 |
||
62 |
SimileAjax.Platform = new Object(); |
|
63 |
SimileAjax.urlPrefix = baseuri(); |
|
64 |
||
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
65 |
window.Timeline = new Object(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
66 |
Timeline.urlPrefix = baseuri(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
67 |
window.Timeline.DateTime = window.SimileAjax.DateTime; // for backward compatibility |
0 | 68 |
|
69 |
/* platform.js */ |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
70 |
SimileAjax.jQuery = jQuery; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
71 |
// SimileAjax.jQuery=jQuery.noConflict(true); |
0 | 72 |
if(typeof window["$"]=="undefined"){window.$=SimileAjax.jQuery; |
73 |
}SimileAjax.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false}; |
|
74 |
SimileAjax.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0}; |
|
75 |
(function(){var C=navigator.appName.toLowerCase(); |
|
76 |
var A=navigator.userAgent.toLowerCase(); |
|
77 |
SimileAjax.Platform.os.isMac=(A.indexOf("mac")!=-1); |
|
78 |
SimileAjax.Platform.os.isWin=(A.indexOf("win")!=-1); |
|
79 |
SimileAjax.Platform.os.isWin32=SimileAjax.Platform.isWin&&(A.indexOf("95")!=-1||A.indexOf("98")!=-1||A.indexOf("nt")!=-1||A.indexOf("win32")!=-1||A.indexOf("32bit")!=-1); |
|
80 |
SimileAjax.Platform.os.isUnix=(A.indexOf("x11")!=-1); |
|
81 |
SimileAjax.Platform.browser.isIE=(C.indexOf("microsoft")!=-1); |
|
82 |
SimileAjax.Platform.browser.isNetscape=(C.indexOf("netscape")!=-1); |
|
83 |
SimileAjax.Platform.browser.isMozilla=(A.indexOf("mozilla")!=-1); |
|
84 |
SimileAjax.Platform.browser.isFirefox=(A.indexOf("firefox")!=-1); |
|
85 |
SimileAjax.Platform.browser.isOpera=(C.indexOf("opera")!=-1); |
|
86 |
SimileAjax.Platform.browser.isSafari=(C.indexOf("safari")!=-1); |
|
87 |
var E=function(G){var F=G.split("."); |
|
88 |
SimileAjax.Platform.browser.majorVersion=parseInt(F[0]); |
|
89 |
SimileAjax.Platform.browser.minorVersion=parseInt(F[1]); |
|
90 |
}; |
|
91 |
var B=function(H,G,I){var F=H.indexOf(G,I); |
|
92 |
return F>=0?F:H.length; |
|
93 |
}; |
|
94 |
if(SimileAjax.Platform.browser.isMozilla){var D=A.indexOf("mozilla/"); |
|
95 |
if(D>=0){E(A.substring(D+8,B(A," ",D))); |
|
96 |
}}if(SimileAjax.Platform.browser.isIE){var D=A.indexOf("msie "); |
|
97 |
if(D>=0){E(A.substring(D+5,B(A,";",D))); |
|
98 |
}}if(SimileAjax.Platform.browser.isNetscape){var D=A.indexOf("rv:"); |
|
99 |
if(D>=0){E(A.substring(D+3,B(A,")",D))); |
|
100 |
}}if(SimileAjax.Platform.browser.isFirefox){var D=A.indexOf("firefox/"); |
|
101 |
if(D>=0){E(A.substring(D+8,B(A," ",D))); |
|
102 |
}}if(!("localeCompare" in String.prototype)){String.prototype.localeCompare=function(F){if(this<F){return -1; |
|
103 |
}else{if(this>F){return 1; |
|
104 |
}else{return 0; |
|
105 |
}}}; |
|
106 |
}})(); |
|
107 |
SimileAjax.Platform.getDefaultLocale=function(){return SimileAjax.Platform.clientLocale; |
|
108 |
}; |
|
109 |
||
110 |
||
111 |
/* ajax.js */ |
|
112 |
SimileAjax.ListenerQueue=function(A){this._listeners=[]; |
|
113 |
this._wildcardHandlerName=A; |
|
114 |
}; |
|
115 |
SimileAjax.ListenerQueue.prototype.add=function(A){this._listeners.push(A); |
|
116 |
}; |
|
117 |
SimileAjax.ListenerQueue.prototype.remove=function(C){var B=this._listeners; |
|
118 |
for(var A=0; |
|
119 |
A<B.length; |
|
120 |
A++){if(B[A]==C){B.splice(A,1); |
|
121 |
break; |
|
122 |
}}}; |
|
123 |
SimileAjax.ListenerQueue.prototype.fire=function(B,A){var D=[].concat(this._listeners); |
|
124 |
for(var C=0; |
|
125 |
C<D.length; |
|
126 |
C++){var E=D[C]; |
|
127 |
if(B in E){try{E[B].apply(E,A); |
|
128 |
}catch(F){SimileAjax.Debug.exception("Error firing event of name "+B,F); |
|
129 |
}}else{if(this._wildcardHandlerName!=null&&this._wildcardHandlerName in E){try{E[this._wildcardHandlerName].apply(E,[B]); |
|
130 |
}catch(F){SimileAjax.Debug.exception("Error firing event of name "+B+" to wildcard handler",F); |
|
131 |
}}}}}; |
|
132 |
||
133 |
||
134 |
/* data-structure.js */ |
|
135 |
SimileAjax.Set=function(A){this._hash={}; |
|
136 |
this._count=0; |
|
137 |
if(A instanceof Array){for(var B=0; |
|
138 |
B<A.length; |
|
139 |
B++){this.add(A[B]); |
|
140 |
}}else{if(A instanceof SimileAjax.Set){this.addSet(A); |
|
141 |
}}}; |
|
142 |
SimileAjax.Set.prototype.add=function(A){if(!(A in this._hash)){this._hash[A]=true; |
|
143 |
this._count++; |
|
144 |
return true; |
|
145 |
}return false; |
|
146 |
}; |
|
147 |
SimileAjax.Set.prototype.addSet=function(B){for(var A in B._hash){this.add(A); |
|
148 |
}}; |
|
149 |
SimileAjax.Set.prototype.remove=function(A){if(A in this._hash){delete this._hash[A]; |
|
150 |
this._count--; |
|
151 |
return true; |
|
152 |
}return false; |
|
153 |
}; |
|
154 |
SimileAjax.Set.prototype.removeSet=function(B){for(var A in B._hash){this.remove(A); |
|
155 |
}}; |
|
156 |
SimileAjax.Set.prototype.retainSet=function(B){for(var A in this._hash){if(!B.contains(A)){delete this._hash[A]; |
|
157 |
this._count--; |
|
158 |
}}}; |
|
159 |
SimileAjax.Set.prototype.contains=function(A){return(A in this._hash); |
|
160 |
}; |
|
161 |
SimileAjax.Set.prototype.size=function(){return this._count; |
|
162 |
}; |
|
163 |
SimileAjax.Set.prototype.toArray=function(){var A=[]; |
|
164 |
for(var B in this._hash){A.push(B); |
|
165 |
}return A; |
|
166 |
}; |
|
167 |
SimileAjax.Set.prototype.visit=function(A){for(var B in this._hash){if(A(B)==true){break; |
|
168 |
}}}; |
|
169 |
SimileAjax.SortedArray=function(B,A){this._a=(A instanceof Array)?A:[]; |
|
170 |
this._compare=B; |
|
171 |
}; |
|
172 |
SimileAjax.SortedArray.prototype.add=function(C){var A=this; |
|
173 |
var B=this.find(function(D){return A._compare(D,C); |
|
174 |
}); |
|
175 |
if(B<this._a.length){this._a.splice(B,0,C); |
|
176 |
}else{this._a.push(C); |
|
177 |
}}; |
|
178 |
SimileAjax.SortedArray.prototype.remove=function(C){var A=this; |
|
179 |
var B=this.find(function(D){return A._compare(D,C); |
|
180 |
}); |
|
181 |
while(B<this._a.length&&this._compare(this._a[B],C)==0){if(this._a[B]==C){this._a.splice(B,1); |
|
182 |
return true; |
|
183 |
}else{B++; |
|
184 |
}}return false; |
|
185 |
}; |
|
186 |
SimileAjax.SortedArray.prototype.removeAll=function(){this._a=[]; |
|
187 |
}; |
|
188 |
SimileAjax.SortedArray.prototype.elementAt=function(A){return this._a[A]; |
|
189 |
}; |
|
190 |
SimileAjax.SortedArray.prototype.length=function(){return this._a.length; |
|
191 |
}; |
|
192 |
SimileAjax.SortedArray.prototype.find=function(D){var B=0; |
|
193 |
var A=this._a.length; |
|
194 |
while(B<A){var C=Math.floor((B+A)/2); |
|
195 |
var E=D(this._a[C]); |
|
196 |
if(C==B){return E<0?B+1:B; |
|
197 |
}else{if(E<0){B=C; |
|
198 |
}else{A=C; |
|
199 |
}}}return B; |
|
200 |
}; |
|
201 |
SimileAjax.SortedArray.prototype.getFirst=function(){return(this._a.length>0)?this._a[0]:null; |
|
202 |
}; |
|
203 |
SimileAjax.SortedArray.prototype.getLast=function(){return(this._a.length>0)?this._a[this._a.length-1]:null; |
|
204 |
}; |
|
205 |
SimileAjax.EventIndex=function(B){var A=this; |
|
206 |
this._unit=(B!=null)?B:SimileAjax.NativeDateUnit; |
|
207 |
this._events=new SimileAjax.SortedArray(function(D,C){return A._unit.compare(D.getStart(),C.getStart()); |
|
208 |
}); |
|
209 |
this._idToEvent={}; |
|
210 |
this._indexed=true; |
|
211 |
}; |
|
212 |
SimileAjax.EventIndex.prototype.getUnit=function(){return this._unit; |
|
213 |
}; |
|
214 |
SimileAjax.EventIndex.prototype.getEvent=function(A){return this._idToEvent[A]; |
|
215 |
}; |
|
216 |
SimileAjax.EventIndex.prototype.add=function(A){this._events.add(A); |
|
217 |
this._idToEvent[A.getID()]=A; |
|
218 |
this._indexed=false; |
|
219 |
}; |
|
220 |
SimileAjax.EventIndex.prototype.removeAll=function(){this._events.removeAll(); |
|
221 |
this._idToEvent={}; |
|
222 |
this._indexed=false; |
|
223 |
}; |
|
224 |
SimileAjax.EventIndex.prototype.getCount=function(){return this._events.length(); |
|
225 |
}; |
|
226 |
SimileAjax.EventIndex.prototype.getIterator=function(A,B){if(!this._indexed){this._index(); |
|
227 |
}return new SimileAjax.EventIndex._Iterator(this._events,A,B,this._unit); |
|
228 |
}; |
|
229 |
SimileAjax.EventIndex.prototype.getReverseIterator=function(A,B){if(!this._indexed){this._index(); |
|
230 |
}return new SimileAjax.EventIndex._ReverseIterator(this._events,A,B,this._unit); |
|
231 |
}; |
|
232 |
SimileAjax.EventIndex.prototype.getAllIterator=function(){return new SimileAjax.EventIndex._AllIterator(this._events); |
|
233 |
}; |
|
234 |
SimileAjax.EventIndex.prototype.getEarliestDate=function(){var A=this._events.getFirst(); |
|
235 |
return(A==null)?null:A.getStart(); |
|
236 |
}; |
|
237 |
SimileAjax.EventIndex.prototype.getLatestDate=function(){var A=this._events.getLast(); |
|
238 |
if(A==null){return null; |
|
239 |
}if(!this._indexed){this._index(); |
|
240 |
}var C=A._earliestOverlapIndex; |
|
241 |
var B=this._events.elementAt(C).getEnd(); |
|
242 |
for(var D=C+1; |
|
243 |
D<this._events.length(); |
|
244 |
D++){B=this._unit.later(B,this._events.elementAt(D).getEnd()); |
|
245 |
}return B; |
|
246 |
}; |
|
247 |
SimileAjax.EventIndex.prototype._index=function(){var D=this._events.length(); |
|
248 |
for(var E=0; |
|
249 |
E<D; |
|
250 |
E++){var C=this._events.elementAt(E); |
|
251 |
C._earliestOverlapIndex=E; |
|
252 |
}var G=1; |
|
253 |
for(var E=0; |
|
254 |
E<D; |
|
255 |
E++){var C=this._events.elementAt(E); |
|
256 |
var B=C.getEnd(); |
|
257 |
G=Math.max(G,E+1); |
|
258 |
while(G<D){var A=this._events.elementAt(G); |
|
259 |
var F=A.getStart(); |
|
260 |
if(this._unit.compare(F,B)<0){A._earliestOverlapIndex=E; |
|
261 |
G++; |
|
262 |
}else{break; |
|
263 |
}}}this._indexed=true; |
|
264 |
}; |
|
265 |
SimileAjax.EventIndex._Iterator=function(B,A,D,C){this._events=B; |
|
266 |
this._startDate=A; |
|
267 |
this._endDate=D; |
|
268 |
this._unit=C; |
|
269 |
this._currentIndex=B.find(function(E){return C.compare(E.getStart(),A); |
|
270 |
}); |
|
271 |
if(this._currentIndex-1>=0){this._currentIndex=this._events.elementAt(this._currentIndex-1)._earliestOverlapIndex; |
|
272 |
}this._currentIndex--; |
|
273 |
this._maxIndex=B.find(function(E){return C.compare(E.getStart(),D); |
|
274 |
}); |
|
275 |
this._hasNext=false; |
|
276 |
this._next=null; |
|
277 |
this._findNext(); |
|
278 |
}; |
|
279 |
SimileAjax.EventIndex._Iterator.prototype={hasNext:function(){return this._hasNext; |
|
280 |
},next:function(){if(this._hasNext){var A=this._next; |
|
281 |
this._findNext(); |
|
282 |
return A; |
|
283 |
}else{return null; |
|
284 |
}},_findNext:function(){var B=this._unit; |
|
285 |
while((++this._currentIndex)<this._maxIndex){var A=this._events.elementAt(this._currentIndex); |
|
286 |
if(B.compare(A.getStart(),this._endDate)<0&&B.compare(A.getEnd(),this._startDate)>0){this._next=A; |
|
287 |
this._hasNext=true; |
|
288 |
return ; |
|
289 |
}}this._next=null; |
|
290 |
this._hasNext=false; |
|
291 |
}}; |
|
292 |
SimileAjax.EventIndex._ReverseIterator=function(B,A,D,C){this._events=B; |
|
293 |
this._startDate=A; |
|
294 |
this._endDate=D; |
|
295 |
this._unit=C; |
|
296 |
this._minIndex=B.find(function(E){return C.compare(E.getStart(),A); |
|
297 |
}); |
|
298 |
if(this._minIndex-1>=0){this._minIndex=this._events.elementAt(this._minIndex-1)._earliestOverlapIndex; |
|
299 |
}this._maxIndex=B.find(function(E){return C.compare(E.getStart(),D); |
|
300 |
}); |
|
301 |
this._currentIndex=this._maxIndex; |
|
302 |
this._hasNext=false; |
|
303 |
this._next=null; |
|
304 |
this._findNext(); |
|
305 |
}; |
|
306 |
SimileAjax.EventIndex._ReverseIterator.prototype={hasNext:function(){return this._hasNext; |
|
307 |
},next:function(){if(this._hasNext){var A=this._next; |
|
308 |
this._findNext(); |
|
309 |
return A; |
|
310 |
}else{return null; |
|
311 |
}},_findNext:function(){var B=this._unit; |
|
312 |
while((--this._currentIndex)>=this._minIndex){var A=this._events.elementAt(this._currentIndex); |
|
313 |
if(B.compare(A.getStart(),this._endDate)<0&&B.compare(A.getEnd(),this._startDate)>0){this._next=A; |
|
314 |
this._hasNext=true; |
|
315 |
return ; |
|
316 |
}}this._next=null; |
|
317 |
this._hasNext=false; |
|
318 |
}}; |
|
319 |
SimileAjax.EventIndex._AllIterator=function(A){this._events=A; |
|
320 |
this._index=0; |
|
321 |
}; |
|
322 |
SimileAjax.EventIndex._AllIterator.prototype={hasNext:function(){return this._index<this._events.length(); |
|
323 |
},next:function(){return this._index<this._events.length()?this._events.elementAt(this._index++):null; |
|
324 |
}}; |
|
325 |
||
326 |
||
327 |
/* date-time.js */ |
|
328 |
SimileAjax.DateTime=new Object(); |
|
329 |
SimileAjax.DateTime.MILLISECOND=0; |
|
330 |
SimileAjax.DateTime.SECOND=1; |
|
331 |
SimileAjax.DateTime.MINUTE=2; |
|
332 |
SimileAjax.DateTime.HOUR=3; |
|
333 |
SimileAjax.DateTime.DAY=4; |
|
334 |
SimileAjax.DateTime.WEEK=5; |
|
335 |
SimileAjax.DateTime.MONTH=6; |
|
336 |
SimileAjax.DateTime.YEAR=7; |
|
337 |
SimileAjax.DateTime.DECADE=8; |
|
338 |
SimileAjax.DateTime.CENTURY=9; |
|
339 |
SimileAjax.DateTime.MILLENNIUM=10; |
|
340 |
SimileAjax.DateTime.EPOCH=-1; |
|
341 |
SimileAjax.DateTime.ERA=-2; |
|
342 |
SimileAjax.DateTime.gregorianUnitLengths=[]; |
|
343 |
(function(){var B=SimileAjax.DateTime; |
|
344 |
var A=B.gregorianUnitLengths; |
|
345 |
A[B.MILLISECOND]=1; |
|
346 |
A[B.SECOND]=1000; |
|
347 |
A[B.MINUTE]=A[B.SECOND]*60; |
|
348 |
A[B.HOUR]=A[B.MINUTE]*60; |
|
349 |
A[B.DAY]=A[B.HOUR]*24; |
|
350 |
A[B.WEEK]=A[B.DAY]*7; |
|
351 |
A[B.MONTH]=A[B.DAY]*31; |
|
352 |
A[B.YEAR]=A[B.DAY]*365; |
|
353 |
A[B.DECADE]=A[B.YEAR]*10; |
|
354 |
A[B.CENTURY]=A[B.YEAR]*100; |
|
355 |
A[B.MILLENNIUM]=A[B.YEAR]*1000; |
|
356 |
})(); |
|
357 |
SimileAjax.DateTime._dateRegexp=new RegExp("^(-?)([0-9]{4})("+["(-?([0-9]{2})(-?([0-9]{2}))?)","(-?([0-9]{3}))","(-?W([0-9]{2})(-?([1-7]))?)"].join("|")+")?$"); |
|
358 |
SimileAjax.DateTime._timezoneRegexp=new RegExp("Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$"); |
|
359 |
SimileAjax.DateTime._timeRegexp=new RegExp("^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(.([0-9]+))?)?)?$"); |
|
360 |
SimileAjax.DateTime.setIso8601Date=function(H,F){var I=F.match(SimileAjax.DateTime._dateRegexp); |
|
361 |
if(!I){throw new Error("Invalid date string: "+F); |
|
362 |
}var B=(I[1]=="-")?-1:1; |
|
363 |
var J=B*I[2]; |
|
364 |
var G=I[5]; |
|
365 |
var C=I[7]; |
|
366 |
var E=I[9]; |
|
367 |
var A=I[11]; |
|
368 |
var M=(I[13])?I[13]:1; |
|
369 |
H.setUTCFullYear(J); |
|
370 |
if(E){H.setUTCMonth(0); |
|
371 |
H.setUTCDate(Number(E)); |
|
372 |
}else{if(A){H.setUTCMonth(0); |
|
373 |
H.setUTCDate(1); |
|
374 |
var L=H.getUTCDay(); |
|
375 |
var K=(L)?L:7; |
|
376 |
var D=Number(M)+(7*Number(A)); |
|
377 |
if(K<=4){H.setUTCDate(D+1-K); |
|
378 |
}else{H.setUTCDate(D+8-K); |
|
379 |
}}else{if(G){H.setUTCDate(1); |
|
380 |
H.setUTCMonth(G-1); |
|
381 |
}if(C){H.setUTCDate(C); |
|
382 |
}}}return H; |
|
383 |
}; |
|
384 |
SimileAjax.DateTime.setIso8601Time=function(F,C){var G=C.match(SimileAjax.DateTime._timeRegexp); |
|
385 |
if(!G){SimileAjax.Debug.warn("Invalid time string: "+C); |
|
386 |
return false; |
|
387 |
}var A=G[1]; |
|
388 |
var E=Number((G[3])?G[3]:0); |
|
389 |
var D=(G[5])?G[5]:0; |
|
390 |
var B=G[7]?(Number("0."+G[7])*1000):0; |
|
391 |
F.setUTCHours(A); |
|
392 |
F.setUTCMinutes(E); |
|
393 |
F.setUTCSeconds(D); |
|
394 |
F.setUTCMilliseconds(B); |
|
395 |
return F; |
|
396 |
}; |
|
397 |
SimileAjax.DateTime.timezoneOffset=new Date().getTimezoneOffset(); |
|
398 |
SimileAjax.DateTime.setIso8601=function(B,A){var D=null; |
|
399 |
var E=(A.indexOf("T")==-1)?A.split(" "):A.split("T"); |
|
400 |
SimileAjax.DateTime.setIso8601Date(B,E[0]); |
|
401 |
if(E.length==2){var C=E[1].match(SimileAjax.DateTime._timezoneRegexp); |
|
402 |
if(C){if(C[0]=="Z"){D=0; |
|
403 |
}else{D=(Number(C[3])*60)+Number(C[5]); |
|
404 |
D*=((C[2]=="-")?1:-1); |
|
405 |
}E[1]=E[1].substr(0,E[1].length-C[0].length); |
|
406 |
}SimileAjax.DateTime.setIso8601Time(B,E[1]); |
|
407 |
}if(D==null){D=B.getTimezoneOffset(); |
|
408 |
}B.setTime(B.getTime()+D*60000); |
|
409 |
return B; |
|
410 |
}; |
|
411 |
SimileAjax.DateTime.parseIso8601DateTime=function(A){try{return SimileAjax.DateTime.setIso8601(new Date(0),A); |
|
412 |
}catch(B){return null; |
|
413 |
}}; |
|
414 |
SimileAjax.DateTime.parseGregorianDateTime=function(G){if(G==null){return null; |
|
415 |
}else{if(G instanceof Date){return G; |
|
416 |
}}var B=G.toString(); |
|
417 |
if(B.length>0&&B.length<8){var C=B.indexOf(" "); |
|
418 |
if(C>0){var A=parseInt(B.substr(0,C)); |
|
419 |
var E=B.substr(C+1); |
|
420 |
if(E.toLowerCase()=="bc"){A=1-A; |
|
421 |
}}else{var A=parseInt(B); |
|
422 |
}var F=new Date(0); |
|
423 |
F.setUTCFullYear(A); |
|
424 |
return F; |
|
425 |
}try{return new Date(Date.parse(B)); |
|
426 |
}catch(D){return null; |
|
427 |
}}; |
|
428 |
SimileAjax.DateTime.roundDownToInterval=function(B,G,J,K,A){var D=J*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]; |
|
429 |
var I=new Date(B.getTime()+D); |
|
430 |
var E=function(L){L.setUTCMilliseconds(0); |
|
431 |
L.setUTCSeconds(0); |
|
432 |
L.setUTCMinutes(0); |
|
433 |
L.setUTCHours(0); |
|
434 |
}; |
|
435 |
var C=function(L){E(L); |
|
436 |
L.setUTCDate(1); |
|
437 |
L.setUTCMonth(0); |
|
438 |
}; |
|
439 |
switch(G){case SimileAjax.DateTime.MILLISECOND:var H=I.getUTCMilliseconds(); |
|
440 |
I.setUTCMilliseconds(H-(H%K)); |
|
441 |
break; |
|
442 |
case SimileAjax.DateTime.SECOND:I.setUTCMilliseconds(0); |
|
443 |
var H=I.getUTCSeconds(); |
|
444 |
I.setUTCSeconds(H-(H%K)); |
|
445 |
break; |
|
446 |
case SimileAjax.DateTime.MINUTE:I.setUTCMilliseconds(0); |
|
447 |
I.setUTCSeconds(0); |
|
448 |
var H=I.getUTCMinutes(); |
|
449 |
I.setTime(I.getTime()-(H%K)*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]); |
|
450 |
break; |
|
451 |
case SimileAjax.DateTime.HOUR:I.setUTCMilliseconds(0); |
|
452 |
I.setUTCSeconds(0); |
|
453 |
I.setUTCMinutes(0); |
|
454 |
var H=I.getUTCHours(); |
|
455 |
I.setUTCHours(H-(H%K)); |
|
456 |
break; |
|
457 |
case SimileAjax.DateTime.DAY:E(I); |
|
458 |
break; |
|
459 |
case SimileAjax.DateTime.WEEK:E(I); |
|
460 |
var F=(I.getUTCDay()+7-A)%7; |
|
461 |
I.setTime(I.getTime()-F*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY]); |
|
462 |
break; |
|
463 |
case SimileAjax.DateTime.MONTH:E(I); |
|
464 |
I.setUTCDate(1); |
|
465 |
var H=I.getUTCMonth(); |
|
466 |
I.setUTCMonth(H-(H%K)); |
|
467 |
break; |
|
468 |
case SimileAjax.DateTime.YEAR:C(I); |
|
469 |
var H=I.getUTCFullYear(); |
|
470 |
I.setUTCFullYear(H-(H%K)); |
|
471 |
break; |
|
472 |
case SimileAjax.DateTime.DECADE:C(I); |
|
473 |
I.setUTCFullYear(Math.floor(I.getUTCFullYear()/10)*10); |
|
474 |
break; |
|
475 |
case SimileAjax.DateTime.CENTURY:C(I); |
|
476 |
I.setUTCFullYear(Math.floor(I.getUTCFullYear()/100)*100); |
|
477 |
break; |
|
478 |
case SimileAjax.DateTime.MILLENNIUM:C(I); |
|
479 |
I.setUTCFullYear(Math.floor(I.getUTCFullYear()/1000)*1000); |
|
480 |
break; |
|
481 |
}B.setTime(I.getTime()-D); |
|
482 |
}; |
|
483 |
SimileAjax.DateTime.roundUpToInterval=function(D,F,C,A,B){var E=D.getTime(); |
|
484 |
SimileAjax.DateTime.roundDownToInterval(D,F,C,A,B); |
|
485 |
if(D.getTime()<E){D.setTime(D.getTime()+SimileAjax.DateTime.gregorianUnitLengths[F]*A); |
|
486 |
}}; |
|
487 |
SimileAjax.DateTime.incrementByInterval=function(B,E,A){A=(typeof A=="undefined")?0:A; |
|
488 |
var D=A*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]; |
|
489 |
var C=new Date(B.getTime()+D); |
|
490 |
switch(E){case SimileAjax.DateTime.MILLISECOND:C.setTime(C.getTime()+1); |
|
491 |
break; |
|
492 |
case SimileAjax.DateTime.SECOND:C.setTime(C.getTime()+1000); |
|
493 |
break; |
|
494 |
case SimileAjax.DateTime.MINUTE:C.setTime(C.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]); |
|
495 |
break; |
|
496 |
case SimileAjax.DateTime.HOUR:C.setTime(C.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]); |
|
497 |
break; |
|
498 |
case SimileAjax.DateTime.DAY:C.setUTCDate(C.getUTCDate()+1); |
|
499 |
break; |
|
500 |
case SimileAjax.DateTime.WEEK:C.setUTCDate(C.getUTCDate()+7); |
|
501 |
break; |
|
502 |
case SimileAjax.DateTime.MONTH:C.setUTCMonth(C.getUTCMonth()+1); |
|
503 |
break; |
|
504 |
case SimileAjax.DateTime.YEAR:C.setUTCFullYear(C.getUTCFullYear()+1); |
|
505 |
break; |
|
506 |
case SimileAjax.DateTime.DECADE:C.setUTCFullYear(C.getUTCFullYear()+10); |
|
507 |
break; |
|
508 |
case SimileAjax.DateTime.CENTURY:C.setUTCFullYear(C.getUTCFullYear()+100); |
|
509 |
break; |
|
510 |
case SimileAjax.DateTime.MILLENNIUM:C.setUTCFullYear(C.getUTCFullYear()+1000); |
|
511 |
break; |
|
512 |
}B.setTime(C.getTime()-D); |
|
513 |
}; |
|
514 |
SimileAjax.DateTime.removeTimeZoneOffset=function(B,A){return new Date(B.getTime()+A*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]); |
|
515 |
}; |
|
516 |
SimileAjax.DateTime.getTimezone=function(){var A=new Date().getTimezoneOffset(); |
|
517 |
return A/-60; |
|
518 |
}; |
|
519 |
||
520 |
||
521 |
/* debug.js */ |
|
522 |
SimileAjax.Debug={silent:false}; |
|
523 |
SimileAjax.Debug.log=function(B){var A; |
|
524 |
if("console" in window&&"log" in window.console){A=function(C){console.log(C); |
|
525 |
}; |
|
526 |
}else{A=function(C){if(!SimileAjax.Debug.silent){alert(C); |
|
527 |
}}; |
|
528 |
}SimileAjax.Debug.log=A; |
|
529 |
A(B); |
|
530 |
}; |
|
531 |
SimileAjax.Debug.warn=function(B){var A; |
|
532 |
if("console" in window&&"warn" in window.console){A=function(C){console.warn(C); |
|
533 |
}; |
|
534 |
}else{A=function(C){if(!SimileAjax.Debug.silent){alert(C); |
|
535 |
}}; |
|
536 |
}SimileAjax.Debug.warn=A; |
|
537 |
A(B); |
|
538 |
}; |
|
539 |
SimileAjax.Debug.exception=function(B,D){var A,C=SimileAjax.parseURLParameters(); |
|
540 |
if(C.errors=="throw"||SimileAjax.params.errors=="throw"){A=function(F,E){throw (F); |
|
541 |
}; |
|
542 |
}else{if("console" in window&&"error" in window.console){A=function(F,E){if(E!=null){console.error(E+" %o",F); |
|
543 |
}else{console.error(F); |
|
544 |
}throw (F); |
|
545 |
}; |
|
546 |
}else{A=function(F,E){if(!SimileAjax.Debug.silent){alert("Caught exception: "+E+"\n\nDetails: "+("description" in F?F.description:F)); |
|
547 |
}throw (F); |
|
548 |
}; |
|
549 |
}}SimileAjax.Debug.exception=A; |
|
550 |
A(B,D); |
|
551 |
}; |
|
552 |
SimileAjax.Debug.objectToString=function(A){return SimileAjax.Debug._objectToString(A,""); |
|
553 |
}; |
|
554 |
SimileAjax.Debug._objectToString=function(D,A){var C=A+" "; |
|
555 |
if(typeof D=="object"){var B="{"; |
|
556 |
for(E in D){B+=C+E+": "+SimileAjax.Debug._objectToString(D[E],C)+"\n"; |
|
557 |
}B+=A+"}"; |
|
558 |
return B; |
|
559 |
}else{if(typeof D=="array"){var B="["; |
|
560 |
for(var E=0; |
|
561 |
E<D.length; |
|
562 |
E++){B+=SimileAjax.Debug._objectToString(D[E],C)+"\n"; |
|
563 |
}B+=A+"]"; |
|
564 |
return B; |
|
565 |
}else{return D; |
|
566 |
}}}; |
|
567 |
||
568 |
||
569 |
/* dom.js */ |
|
570 |
SimileAjax.DOM=new Object(); |
|
571 |
SimileAjax.DOM.registerEventWithObject=function(C,A,D,B){SimileAjax.DOM.registerEvent(C,A,function(F,E,G){return D[B].call(D,F,E,G); |
|
572 |
}); |
|
573 |
}; |
|
574 |
SimileAjax.DOM.registerEvent=function(C,B,D){var A=function(E){E=(E)?E:((event)?event:null); |
|
575 |
if(E){var F=(E.target)?E.target:((E.srcElement)?E.srcElement:null); |
|
576 |
if(F){F=(F.nodeType==1||F.nodeType==9)?F:F.parentNode; |
|
577 |
}return D(C,E,F); |
|
578 |
}return true; |
|
579 |
}; |
|
580 |
if(SimileAjax.Platform.browser.isIE){C.attachEvent("on"+B,A); |
|
581 |
}else{C.addEventListener(B,A,false); |
|
582 |
}}; |
|
583 |
SimileAjax.DOM.getPageCoordinates=function(B){var E=0; |
|
584 |
var D=0; |
|
585 |
if(B.nodeType!=1){B=B.parentNode; |
|
586 |
}var C=B; |
|
587 |
while(C!=null){E+=C.offsetLeft; |
|
588 |
D+=C.offsetTop; |
|
589 |
C=C.offsetParent; |
|
590 |
}var A=document.body; |
|
591 |
while(B!=null&&B!=A){if("scrollLeft" in B){E-=B.scrollLeft; |
|
592 |
D-=B.scrollTop; |
|
593 |
}B=B.parentNode; |
|
594 |
}return{left:E,top:D}; |
|
595 |
}; |
|
596 |
SimileAjax.DOM.getSize=function(B){var A=this.getStyle(B,"width"); |
|
597 |
var C=this.getStyle(B,"height"); |
|
598 |
if(A.indexOf("px")>-1){A=A.replace("px",""); |
|
599 |
}if(C.indexOf("px")>-1){C=C.replace("px",""); |
|
600 |
}return{w:A,h:C}; |
|
601 |
}; |
|
602 |
SimileAjax.DOM.getStyle=function(B,A){if(B.currentStyle){var C=B.currentStyle[A]; |
|
603 |
}else{if(window.getComputedStyle){var C=document.defaultView.getComputedStyle(B,null).getPropertyValue(A); |
|
604 |
}else{var C=""; |
|
605 |
}}return C; |
|
606 |
}; |
|
607 |
SimileAjax.DOM.getEventRelativeCoordinates=function(A,B){if(SimileAjax.Platform.browser.isIE){if(A.type=="mousewheel"){var C=SimileAjax.DOM.getPageCoordinates(B); |
|
608 |
return{x:A.clientX-C.left,y:A.clientY-C.top}; |
|
609 |
}else{return{x:A.offsetX,y:A.offsetY}; |
|
610 |
}}else{var C=SimileAjax.DOM.getPageCoordinates(B); |
|
611 |
if((A.type=="DOMMouseScroll")&&SimileAjax.Platform.browser.isFirefox&&(SimileAjax.Platform.browser.majorVersion==2)){return{x:A.screenX-C.left,y:A.screenY-C.top}; |
|
612 |
}else{return{x:A.pageX-C.left,y:A.pageY-C.top}; |
|
613 |
}}}; |
|
614 |
SimileAjax.DOM.getEventPageCoordinates=function(A){if(SimileAjax.Platform.browser.isIE){return{x:A.clientX+document.body.scrollLeft,y:A.clientY+document.body.scrollTop}; |
|
615 |
}else{return{x:A.pageX,y:A.pageY}; |
|
616 |
}}; |
|
617 |
SimileAjax.DOM.hittest=function(A,C,B){return SimileAjax.DOM._hittest(document.body,A,C,B); |
|
618 |
}; |
|
619 |
SimileAjax.DOM._hittest=function(C,L,K,H){var M=C.childNodes; |
|
620 |
outer:for(var G=0; |
|
621 |
G<M.length; |
|
622 |
G++){var A=M[G]; |
|
623 |
for(var F=0; |
|
624 |
F<H.length; |
|
625 |
F++){if(A==H[F]){continue outer; |
|
626 |
}}if(A.offsetWidth==0&&A.offsetHeight==0){var B=SimileAjax.DOM._hittest(A,L,K,H); |
|
627 |
if(B!=A){return B; |
|
628 |
}}else{var J=0; |
|
629 |
var E=0; |
|
630 |
var D=A; |
|
631 |
while(D){J+=D.offsetTop; |
|
632 |
E+=D.offsetLeft; |
|
633 |
D=D.offsetParent; |
|
634 |
}if(E<=L&&J<=K&&(L-E)<A.offsetWidth&&(K-J)<A.offsetHeight){return SimileAjax.DOM._hittest(A,L,K,H); |
|
635 |
}else{if(A.nodeType==1&&A.tagName=="TR"){var I=SimileAjax.DOM._hittest(A,L,K,H); |
|
636 |
if(I!=A){return I; |
|
637 |
}}}}}return C; |
|
638 |
}; |
|
639 |
SimileAjax.DOM.cancelEvent=function(A){A.returnValue=false; |
|
640 |
A.cancelBubble=true; |
|
641 |
if("preventDefault" in A){A.preventDefault(); |
|
642 |
}}; |
|
643 |
SimileAjax.DOM.appendClassName=function(C,D){var B=C.className.split(" "); |
|
644 |
for(var A=0; |
|
645 |
A<B.length; |
|
646 |
A++){if(B[A]==D){return ; |
|
647 |
}}B.push(D); |
|
648 |
C.className=B.join(" "); |
|
649 |
}; |
|
650 |
SimileAjax.DOM.createInputElement=function(A){var B=document.createElement("div"); |
|
651 |
B.innerHTML="<input type='"+A+"' />"; |
|
652 |
return B.firstChild; |
|
653 |
}; |
|
654 |
SimileAjax.DOM.createDOMFromTemplate=function(B){var A={}; |
|
655 |
A.elmt=SimileAjax.DOM._createDOMFromTemplate(B,A,null); |
|
656 |
return A; |
|
657 |
}; |
|
658 |
SimileAjax.DOM._createDOMFromTemplate=function(A,I,E){if(A==null){return null; |
|
659 |
}else{if(typeof A!="object"){var D=document.createTextNode(A); |
|
660 |
if(E!=null){E.appendChild(D); |
|
661 |
}return D; |
|
662 |
}else{var C=null; |
|
663 |
if("tag" in A){var J=A.tag; |
|
664 |
if(E!=null){if(J=="tr"){C=E.insertRow(E.rows.length); |
|
665 |
}else{if(J=="td"){C=E.insertCell(E.cells.length); |
|
666 |
}}}if(C==null){C=J=="input"?SimileAjax.DOM.createInputElement(A.type):document.createElement(J); |
|
667 |
if(E!=null){E.appendChild(C); |
|
668 |
}}}else{C=A.elmt; |
|
669 |
if(E!=null){E.appendChild(C); |
|
670 |
}}for(var B in A){var G=A[B]; |
|
671 |
if(B=="field"){I[G]=C; |
|
672 |
}else{if(B=="className"){C.className=G; |
|
673 |
}else{if(B=="id"){C.id=G; |
|
674 |
}else{if(B=="title"){C.title=G; |
|
675 |
}else{if(B=="type"&&C.tagName=="input"){}else{if(B=="style"){for(n in G){var H=G[n]; |
|
676 |
if(n=="float"){n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat"; |
|
677 |
}C.style[n]=H; |
|
678 |
}}else{if(B=="children"){for(var F=0; |
|
679 |
F<G.length; |
|
680 |
F++){SimileAjax.DOM._createDOMFromTemplate(G[F],I,C); |
|
681 |
}}else{if(B!="tag"&&B!="elmt"){C.setAttribute(B,G); |
|
682 |
}}}}}}}}}return C; |
|
683 |
}}}; |
|
684 |
SimileAjax.DOM._cachedParent=null; |
|
685 |
SimileAjax.DOM.createElementFromString=function(A){if(SimileAjax.DOM._cachedParent==null){SimileAjax.DOM._cachedParent=document.createElement("div"); |
|
686 |
}SimileAjax.DOM._cachedParent.innerHTML=A; |
|
687 |
return SimileAjax.DOM._cachedParent.firstChild; |
|
688 |
}; |
|
689 |
SimileAjax.DOM.createDOMFromString=function(A,C,D){var B=typeof A=="string"?document.createElement(A):A; |
|
690 |
B.innerHTML=C; |
|
691 |
var E={elmt:B}; |
|
692 |
SimileAjax.DOM._processDOMChildrenConstructedFromString(E,B,D!=null?D:{}); |
|
693 |
return E; |
|
694 |
}; |
|
695 |
SimileAjax.DOM._processDOMConstructedFromString=function(D,A,B){var E=A.id; |
|
696 |
if(E!=null&&E.length>0){A.removeAttribute("id"); |
|
697 |
if(E in B){var C=A.parentNode; |
|
698 |
C.insertBefore(B[E],A); |
|
699 |
C.removeChild(A); |
|
700 |
D[E]=B[E]; |
|
701 |
return ; |
|
702 |
}else{D[E]=A; |
|
703 |
}}if(A.hasChildNodes()){SimileAjax.DOM._processDOMChildrenConstructedFromString(D,A,B); |
|
704 |
}}; |
|
705 |
SimileAjax.DOM._processDOMChildrenConstructedFromString=function(E,B,D){var C=B.firstChild; |
|
706 |
while(C!=null){var A=C.nextSibling; |
|
707 |
if(C.nodeType==1){SimileAjax.DOM._processDOMConstructedFromString(E,C,D); |
|
708 |
}C=A; |
|
709 |
}}; |
|
710 |
||
711 |
||
712 |
/* graphics.js */ |
|
713 |
SimileAjax.Graphics=new Object(); |
|
714 |
SimileAjax.Graphics.pngIsTranslucent=(!SimileAjax.Platform.browser.isIE)||(SimileAjax.Platform.browser.majorVersion>6); |
|
715 |
SimileAjax.Graphics._createTranslucentImage1=function(A,C){var B=document.createElement("img"); |
|
716 |
B.setAttribute("src",A); |
|
717 |
if(C!=null){B.style.verticalAlign=C; |
|
718 |
}return B; |
|
719 |
}; |
|
720 |
SimileAjax.Graphics._createTranslucentImage2=function(A,C){var B=document.createElement("img"); |
|
721 |
B.style.width="1px"; |
|
722 |
B.style.height="1px"; |
|
723 |
B.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A+"', sizingMethod='image')"; |
|
724 |
B.style.verticalAlign=(C!=null)?C:"middle"; |
|
725 |
return B; |
|
726 |
}; |
|
727 |
SimileAjax.Graphics.createTranslucentImage=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImage1:SimileAjax.Graphics._createTranslucentImage2; |
|
728 |
SimileAjax.Graphics._createTranslucentImageHTML1=function(A,B){return'<img src="'+A+'"'+(B!=null?' style="vertical-align: '+B+';"':"")+" />"; |
|
729 |
}; |
|
730 |
SimileAjax.Graphics._createTranslucentImageHTML2=function(A,C){var B="width: 1px; height: 1px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A+"', sizingMethod='image');"+(C!=null?" vertical-align: "+C+";":""); |
|
731 |
return"<img src='"+A+"' style=\""+B+'" />'; |
|
732 |
}; |
|
733 |
SimileAjax.Graphics.createTranslucentImageHTML=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImageHTML1:SimileAjax.Graphics._createTranslucentImageHTML2; |
|
734 |
SimileAjax.Graphics.setOpacity=function(B,A){if(SimileAjax.Platform.browser.isIE){B.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+A+")"; |
|
735 |
}else{var C=(A/100).toString(); |
|
736 |
B.style.opacity=C; |
|
737 |
B.style.MozOpacity=C; |
|
738 |
}}; |
|
739 |
SimileAjax.Graphics._bubbleMargins={top:33,bottom:42,left:33,right:40}; |
|
740 |
SimileAjax.Graphics._arrowOffsets={top:0,bottom:9,left:1,right:8}; |
|
741 |
SimileAjax.Graphics._bubblePadding=15; |
|
742 |
SimileAjax.Graphics._bubblePointOffset=6; |
|
743 |
SimileAjax.Graphics._halfArrowWidth=18; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
744 |
SimileAjax.Graphics.createBubbleForContentAndPoint=function(F,D,C,A,B,E){if(typeof A!="number"){A=300; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
745 |
}if(typeof E!="number"){E=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
746 |
}F.style.position="absolute"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
747 |
F.style.left="-5000px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
748 |
F.style.top="0px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
749 |
F.style.width=A+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
750 |
document.body.appendChild(F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
751 |
window.setTimeout(function(){var J=F.scrollWidth+10; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
752 |
var G=F.scrollHeight+10; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
753 |
var I=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
754 |
if(E>0&&G>E){G=E; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
755 |
I=J-25; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
756 |
}var H=SimileAjax.Graphics.createBubbleForPoint(D,C,J,G,B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
757 |
document.body.removeChild(F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
758 |
F.style.position="static"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
759 |
F.style.left=""; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
760 |
F.style.top=""; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
761 |
if(I>0){var K=document.createElement("div"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
762 |
F.style.width=""; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
763 |
K.style.width=I+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
764 |
K.appendChild(F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
765 |
H.content.appendChild(K); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
766 |
}else{F.style.width=J+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
767 |
H.content.appendChild(F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
768 |
}},200); |
0 | 769 |
}; |
770 |
SimileAjax.Graphics.createBubbleForPoint=function(C,B,N,R,F){function T(){if(typeof window.innerHeight=="number"){return{w:window.innerWidth,h:window.innerHeight}; |
|
771 |
}else{if(document.documentElement&&document.documentElement.clientHeight){return{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight}; |
|
772 |
}else{if(document.body&&document.body.clientHeight){return{w:document.body.clientWidth,h:document.body.clientHeight}; |
|
773 |
}}}}var L=function(){if(!M._closed){document.body.removeChild(M._div); |
|
774 |
M._doc=null; |
|
775 |
M._div=null; |
|
776 |
M._content=null; |
|
777 |
M._closed=true; |
|
778 |
}}; |
|
779 |
var M={_closed:false}; |
|
780 |
var O=T(); |
|
781 |
var H=O.w; |
|
782 |
var G=O.h; |
|
783 |
var D=SimileAjax.Graphics._bubbleMargins; |
|
784 |
N=parseInt(N,10); |
|
785 |
R=parseInt(R,10); |
|
786 |
var P=D.left+N+D.right; |
|
787 |
var U=D.top+R+D.bottom; |
|
788 |
var Q=SimileAjax.Graphics.pngIsTranslucent; |
|
789 |
var J=SimileAjax.urlPrefix; |
|
790 |
var A=function(Z,Y,a,X){Z.style.position="absolute"; |
|
791 |
Z.style.width=a+"px"; |
|
792 |
Z.style.height=X+"px"; |
|
793 |
if(Q){Z.style.background="url("+Y+")"; |
|
794 |
}else{Z.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+Y+"', sizingMethod='crop')"; |
|
795 |
}}; |
|
796 |
var K=document.createElement("div"); |
|
797 |
K.style.width=P+"px"; |
|
798 |
K.style.height=U+"px"; |
|
799 |
K.style.position="absolute"; |
|
800 |
K.style.zIndex=1000; |
|
801 |
var W=SimileAjax.WindowManager.pushLayer(L,true,K); |
|
802 |
M._div=K; |
|
803 |
M.close=function(){SimileAjax.WindowManager.popLayer(W); |
|
804 |
}; |
|
805 |
var I=document.createElement("div"); |
|
806 |
I.style.width="100%"; |
|
807 |
I.style.height="100%"; |
|
808 |
I.style.position="relative"; |
|
809 |
K.appendChild(I); |
|
810 |
var S=function(Z,c,b,a,Y){var X=document.createElement("div"); |
|
811 |
X.style.left=c+"px"; |
|
812 |
X.style.top=b+"px"; |
|
813 |
A(X,Z,a,Y); |
|
814 |
I.appendChild(X); |
|
815 |
}; |
|
816 |
S(J+"data/timeline/bubble-top-left.png",0,0,D.left,D.top); |
|
817 |
S(J+"data/timeline/bubble-top.png",D.left,0,N,D.top); |
|
818 |
S(J+"data/timeline/bubble-top-right.png",D.left+N,0,D.right,D.top); |
|
819 |
S(J+"data/timeline/bubble-left.png",0,D.top,D.left,R); |
|
820 |
S(J+"data/timeline/bubble-right.png",D.left+N,D.top,D.right,R); |
|
821 |
S(J+"data/timeline/bubble-bottom-left.png",0,D.top+R,D.left,D.bottom); |
|
822 |
S(J+"data/timeline/bubble-bottom.png",D.left,D.top+R,N,D.bottom); |
|
823 |
S(J+"data/timeline/bubble-bottom-right.png",D.left+N,D.top+R,D.right,D.bottom); |
|
824 |
var V=document.createElement("div"); |
|
825 |
V.style.left=(P-D.right+SimileAjax.Graphics._bubblePadding-16-2)+"px"; |
|
826 |
V.style.top=(D.top-SimileAjax.Graphics._bubblePadding+1)+"px"; |
|
827 |
V.style.cursor="pointer"; |
|
828 |
A(V,J+"data/timeline/close-button.png",16,16); |
|
829 |
SimileAjax.WindowManager.registerEventWithObject(V,"click",M,"close"); |
|
830 |
I.appendChild(V); |
|
831 |
var E=document.createElement("div"); |
|
832 |
E.style.position="absolute"; |
|
833 |
E.style.left=D.left+"px"; |
|
834 |
E.style.top=D.top+"px"; |
|
835 |
E.style.width=N+"px"; |
|
836 |
E.style.height=R+"px"; |
|
837 |
E.style.overflow="auto"; |
|
838 |
E.style.background="white"; |
|
839 |
I.appendChild(E); |
|
840 |
M.content=E; |
|
841 |
(function(){if(C-SimileAjax.Graphics._halfArrowWidth-SimileAjax.Graphics._bubblePadding>0&&C+SimileAjax.Graphics._halfArrowWidth+SimileAjax.Graphics._bubblePadding<H){var Z=C-Math.round(N/2)-D.left; |
|
842 |
Z=C<(H/2)?Math.max(Z,-(D.left-SimileAjax.Graphics._bubblePadding)):Math.min(Z,H+(D.right-SimileAjax.Graphics._bubblePadding)-P); |
|
843 |
if((F&&F=="top")||(!F&&(B-SimileAjax.Graphics._bubblePointOffset-U>0))){var X=document.createElement("div"); |
|
844 |
X.style.left=(C-SimileAjax.Graphics._halfArrowWidth-Z)+"px"; |
|
845 |
X.style.top=(D.top+R)+"px"; |
|
846 |
A(X,J+"data/timeline/bubble-bottom-arrow.png",37,D.bottom); |
|
847 |
I.appendChild(X); |
|
848 |
K.style.left=Z+"px"; |
|
849 |
K.style.top=(B-SimileAjax.Graphics._bubblePointOffset-U+SimileAjax.Graphics._arrowOffsets.bottom)+"px"; |
|
850 |
return ; |
|
851 |
}else{if((F&&F=="bottom")||(!F&&(B+SimileAjax.Graphics._bubblePointOffset+U<G))){var X=document.createElement("div"); |
|
852 |
X.style.left=(C-SimileAjax.Graphics._halfArrowWidth-Z)+"px"; |
|
853 |
X.style.top="0px"; |
|
854 |
A(X,J+"data/timeline/bubble-top-arrow.png",37,D.top); |
|
855 |
I.appendChild(X); |
|
856 |
K.style.left=Z+"px"; |
|
857 |
K.style.top=(B+SimileAjax.Graphics._bubblePointOffset-SimileAjax.Graphics._arrowOffsets.top)+"px"; |
|
858 |
return ; |
|
859 |
}}}var Y=B-Math.round(R/2)-D.top; |
|
860 |
Y=B<(G/2)?Math.max(Y,-(D.top-SimileAjax.Graphics._bubblePadding)):Math.min(Y,G+(D.bottom-SimileAjax.Graphics._bubblePadding)-U); |
|
861 |
if((F&&F=="left")||(!F&&(C-SimileAjax.Graphics._bubblePointOffset-P>0))){var X=document.createElement("div"); |
|
862 |
X.style.left=(D.left+N)+"px"; |
|
863 |
X.style.top=(B-SimileAjax.Graphics._halfArrowWidth-Y)+"px"; |
|
864 |
A(X,J+"data/timeline/bubble-right-arrow.png",D.right,37); |
|
865 |
I.appendChild(X); |
|
866 |
K.style.left=(C-SimileAjax.Graphics._bubblePointOffset-P+SimileAjax.Graphics._arrowOffsets.right)+"px"; |
|
867 |
K.style.top=Y+"px"; |
|
868 |
}else{if((F&&F=="right")||(!F&&(C-SimileAjax.Graphics._bubblePointOffset-P<H))){var X=document.createElement("div"); |
|
869 |
X.style.left="0px"; |
|
870 |
X.style.top=(B-SimileAjax.Graphics._halfArrowWidth-Y)+"px"; |
|
871 |
A(X,J+"data/timeline/bubble-left-arrow.png",D.left,37); |
|
872 |
I.appendChild(X); |
|
873 |
K.style.left=(C+SimileAjax.Graphics._bubblePointOffset-SimileAjax.Graphics._arrowOffsets.left)+"px"; |
|
874 |
K.style.top=Y+"px"; |
|
875 |
}}})(); |
|
876 |
document.body.appendChild(K); |
|
877 |
return M; |
|
878 |
}; |
|
879 |
SimileAjax.Graphics.createMessageBubble=function(H){var G=H.createElement("div"); |
|
880 |
if(SimileAjax.Graphics.pngIsTranslucent){var I=H.createElement("div"); |
|
881 |
I.style.height="33px"; |
|
882 |
I.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-top-left.png) top left no-repeat"; |
|
883 |
I.style.paddingLeft="44px"; |
|
884 |
G.appendChild(I); |
|
885 |
var C=H.createElement("div"); |
|
886 |
C.style.height="33px"; |
|
887 |
C.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-top-right.png) top right no-repeat"; |
|
888 |
I.appendChild(C); |
|
889 |
var F=H.createElement("div"); |
|
890 |
F.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-left.png) top left repeat-y"; |
|
891 |
F.style.paddingLeft="44px"; |
|
892 |
G.appendChild(F); |
|
893 |
var A=H.createElement("div"); |
|
894 |
A.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-right.png) top right repeat-y"; |
|
895 |
A.style.paddingRight="44px"; |
|
896 |
F.appendChild(A); |
|
897 |
var D=H.createElement("div"); |
|
898 |
A.appendChild(D); |
|
899 |
var B=H.createElement("div"); |
|
900 |
B.style.height="55px"; |
|
901 |
B.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-bottom-left.png) bottom left no-repeat"; |
|
902 |
B.style.paddingLeft="44px"; |
|
903 |
G.appendChild(B); |
|
904 |
var E=H.createElement("div"); |
|
905 |
E.style.height="55px"; |
|
906 |
E.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-bottom-right.png) bottom right no-repeat"; |
|
907 |
B.appendChild(E); |
|
908 |
}else{G.style.border="2px solid #7777AA"; |
|
909 |
G.style.padding="20px"; |
|
910 |
G.style.background="white"; |
|
911 |
SimileAjax.Graphics.setOpacity(G,90); |
|
912 |
var D=H.createElement("div"); |
|
913 |
G.appendChild(D); |
|
914 |
}return{containerDiv:G,contentDiv:D}; |
|
915 |
}; |
|
916 |
SimileAjax.Graphics.createAnimation=function(B,E,D,C,A){return new SimileAjax.Graphics._Animation(B,E,D,C,A); |
|
917 |
}; |
|
918 |
SimileAjax.Graphics._Animation=function(B,E,D,C,A){this.f=B; |
|
919 |
this.cont=(typeof A=="function")?A:function(){}; |
|
920 |
this.from=E; |
|
921 |
this.to=D; |
|
922 |
this.current=E; |
|
923 |
this.duration=C; |
|
924 |
this.start=new Date().getTime(); |
|
925 |
this.timePassed=0; |
|
926 |
}; |
|
927 |
SimileAjax.Graphics._Animation.prototype.run=function(){var A=this; |
|
928 |
window.setTimeout(function(){A.step(); |
|
929 |
},50); |
|
930 |
}; |
|
931 |
SimileAjax.Graphics._Animation.prototype.step=function(){this.timePassed+=50; |
|
932 |
var B=this.timePassed/this.duration; |
|
933 |
var A=-Math.cos(B*Math.PI)/2+0.5; |
|
934 |
var D=A*(this.to-this.from)+this.from; |
|
935 |
try{this.f(D,D-this.current); |
|
936 |
}catch(C){}this.current=D; |
|
937 |
if(this.timePassed<this.duration){this.run(); |
|
938 |
}else{this.f(this.to,0); |
|
939 |
this["cont"](); |
|
940 |
}}; |
|
941 |
SimileAjax.Graphics.createStructuredDataCopyButton=function(F,D,A,E){var G=document.createElement("div"); |
|
942 |
G.style.position="relative"; |
|
943 |
G.style.display="inline"; |
|
944 |
G.style.width=D+"px"; |
|
945 |
G.style.height=A+"px"; |
|
946 |
G.style.overflow="hidden"; |
|
947 |
G.style.margin="2px"; |
|
948 |
if(SimileAjax.Graphics.pngIsTranslucent){G.style.background="url("+F+") no-repeat"; |
|
949 |
}else{G.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+F+"', sizingMethod='image')"; |
|
950 |
}var C; |
|
951 |
if(SimileAjax.Platform.browser.isIE){C="filter:alpha(opacity=0)"; |
|
952 |
}else{C="opacity: 0"; |
|
953 |
}G.innerHTML="<textarea rows='1' autocomplete='off' value='none' style='"+C+"' />"; |
|
954 |
var B=G.firstChild; |
|
955 |
B.style.width=D+"px"; |
|
956 |
B.style.height=A+"px"; |
|
957 |
B.onmousedown=function(H){H=(H)?H:((event)?event:null); |
|
958 |
if(H.button==2){B.value=E(); |
|
959 |
B.select(); |
|
960 |
}}; |
|
961 |
return G; |
|
962 |
}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
963 |
SimileAjax.Graphics.getWidthHeight=function(C){var A,B; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
964 |
if(C.getBoundingClientRect==null){A=C.offsetWidth; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
965 |
B=C.offsetHeight; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
966 |
}else{var D=C.getBoundingClientRect(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
967 |
A=Math.ceil(D.right-D.left); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
968 |
B=Math.ceil(D.bottom-D.top); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
969 |
}return{width:A,height:B}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
970 |
}; |
0 | 971 |
SimileAjax.Graphics.getFontRenderingContext=function(A,B){return new SimileAjax.Graphics._FontRenderingContext(A,B); |
972 |
}; |
|
973 |
SimileAjax.Graphics._FontRenderingContext=function(A,B){this._elmt=A; |
|
974 |
this._elmt.style.visibility="hidden"; |
|
975 |
if(typeof B=="string"){this._elmt.style.width=B; |
|
976 |
}else{if(typeof B=="number"){this._elmt.style.width=B+"px"; |
|
977 |
}}}; |
|
978 |
SimileAjax.Graphics._FontRenderingContext.prototype.dispose=function(){this._elmt=null; |
|
979 |
}; |
|
980 |
SimileAjax.Graphics._FontRenderingContext.prototype.update=function(){this._elmt.innerHTML="A"; |
|
981 |
this._lineHeight=this._elmt.offsetHeight; |
|
982 |
}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
983 |
SimileAjax.Graphics._FontRenderingContext.prototype.computeSize=function(D,C){var B=this._elmt; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
984 |
B.innerHTML=D; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
985 |
B.className=C===undefined?"":C; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
986 |
var A=SimileAjax.Graphics.getWidthHeight(B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
987 |
B.className=""; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
988 |
return A; |
0 | 989 |
}; |
990 |
SimileAjax.Graphics._FontRenderingContext.prototype.getLineHeight=function(){return this._lineHeight; |
|
991 |
}; |
|
992 |
||
993 |
||
994 |
/* history.js */ |
|
995 |
SimileAjax.History={maxHistoryLength:10,historyFile:"__history__.html",enabled:true,_initialized:false,_listeners:new SimileAjax.ListenerQueue(),_actions:[],_baseIndex:0,_currentIndex:0,_plainDocumentTitle:document.title}; |
|
996 |
SimileAjax.History.formatHistoryEntryTitle=function(A){return SimileAjax.History._plainDocumentTitle+" {"+A+"}"; |
|
997 |
}; |
|
998 |
SimileAjax.History.initialize=function(){if(SimileAjax.History._initialized){return ; |
|
999 |
}if(SimileAjax.History.enabled){var A=document.createElement("iframe"); |
|
1000 |
A.id="simile-ajax-history"; |
|
1001 |
A.style.position="absolute"; |
|
1002 |
A.style.width="10px"; |
|
1003 |
A.style.height="10px"; |
|
1004 |
A.style.top="0px"; |
|
1005 |
A.style.left="0px"; |
|
1006 |
A.style.visibility="hidden"; |
|
1007 |
A.src=SimileAjax.History.historyFile+"?0"; |
|
1008 |
document.body.appendChild(A); |
|
1009 |
SimileAjax.DOM.registerEvent(A,"load",SimileAjax.History._handleIFrameOnLoad); |
|
1010 |
SimileAjax.History._iframe=A; |
|
1011 |
}SimileAjax.History._initialized=true; |
|
1012 |
}; |
|
1013 |
SimileAjax.History.addListener=function(A){SimileAjax.History.initialize(); |
|
1014 |
SimileAjax.History._listeners.add(A); |
|
1015 |
}; |
|
1016 |
SimileAjax.History.removeListener=function(A){SimileAjax.History.initialize(); |
|
1017 |
SimileAjax.History._listeners.remove(A); |
|
1018 |
}; |
|
1019 |
SimileAjax.History.addAction=function(A){SimileAjax.History.initialize(); |
|
1020 |
SimileAjax.History._listeners.fire("onBeforePerform",[A]); |
|
1021 |
window.setTimeout(function(){try{A.perform(); |
|
1022 |
SimileAjax.History._listeners.fire("onAfterPerform",[A]); |
|
1023 |
if(SimileAjax.History.enabled){SimileAjax.History._actions=SimileAjax.History._actions.slice(0,SimileAjax.History._currentIndex-SimileAjax.History._baseIndex); |
|
1024 |
SimileAjax.History._actions.push(A); |
|
1025 |
SimileAjax.History._currentIndex++; |
|
1026 |
var C=SimileAjax.History._actions.length-SimileAjax.History.maxHistoryLength; |
|
1027 |
if(C>0){SimileAjax.History._actions=SimileAjax.History._actions.slice(C); |
|
1028 |
SimileAjax.History._baseIndex+=C; |
|
1029 |
}try{SimileAjax.History._iframe.contentWindow.location.search="?"+SimileAjax.History._currentIndex; |
|
1030 |
}catch(B){var D=SimileAjax.History.formatHistoryEntryTitle(A.label); |
|
1031 |
document.title=D; |
|
1032 |
}}}catch(B){SimileAjax.Debug.exception(B,"Error adding action {"+A.label+"} to history"); |
|
1033 |
}},0); |
|
1034 |
}; |
|
1035 |
SimileAjax.History.addLengthyAction=function(C,A,B){SimileAjax.History.addAction({perform:C,undo:A,label:B,uiLayer:SimileAjax.WindowManager.getBaseLayer(),lengthy:true}); |
|
1036 |
}; |
|
1037 |
SimileAjax.History._handleIFrameOnLoad=function(){try{var B=SimileAjax.History._iframe.contentWindow.location.search; |
|
1038 |
var F=(B.length==0)?0:Math.max(0,parseInt(B.substr(1))); |
|
1039 |
var E=function(){var G=F-SimileAjax.History._currentIndex; |
|
1040 |
SimileAjax.History._currentIndex+=G; |
|
1041 |
SimileAjax.History._baseIndex+=G; |
|
1042 |
SimileAjax.History._iframe.contentWindow.location.search="?"+F; |
|
1043 |
}; |
|
1044 |
if(F<SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeUndoSeveral",[]); |
|
1045 |
window.setTimeout(function(){while(SimileAjax.History._currentIndex>F&&SimileAjax.History._currentIndex>SimileAjax.History._baseIndex){SimileAjax.History._currentIndex--; |
|
1046 |
var G=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex]; |
|
1047 |
try{G.undo(); |
|
1048 |
}catch(H){SimileAjax.Debug.exception(H,"History: Failed to undo action {"+G.label+"}"); |
|
1049 |
}}SimileAjax.History._listeners.fire("onAfterUndoSeveral",[]); |
|
1050 |
E(); |
|
1051 |
},0); |
|
1052 |
}else{if(F>SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeRedoSeveral",[]); |
|
1053 |
window.setTimeout(function(){while(SimileAjax.History._currentIndex<F&&SimileAjax.History._currentIndex-SimileAjax.History._baseIndex<SimileAjax.History._actions.length){var G=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex]; |
|
1054 |
try{G.perform(); |
|
1055 |
}catch(H){SimileAjax.Debug.exception(H,"History: Failed to redo action {"+G.label+"}"); |
|
1056 |
}SimileAjax.History._currentIndex++; |
|
1057 |
}SimileAjax.History._listeners.fire("onAfterRedoSeveral",[]); |
|
1058 |
E(); |
|
1059 |
},0); |
|
1060 |
}else{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1; |
|
1061 |
var D=(A>=0&&A<SimileAjax.History._actions.length)?SimileAjax.History.formatHistoryEntryTitle(SimileAjax.History._actions[A].label):SimileAjax.History._plainDocumentTitle; |
|
1062 |
SimileAjax.History._iframe.contentWindow.document.title=D; |
|
1063 |
document.title=D; |
|
1064 |
}}}catch(C){}}; |
|
1065 |
SimileAjax.History.getNextUndoAction=function(){try{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1; |
|
1066 |
return SimileAjax.History._actions[A]; |
|
1067 |
}catch(B){return null; |
|
1068 |
}}; |
|
1069 |
SimileAjax.History.getNextRedoAction=function(){try{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex; |
|
1070 |
return SimileAjax.History._actions[A]; |
|
1071 |
}catch(B){return null; |
|
1072 |
}}; |
|
1073 |
||
1074 |
||
1075 |
/* html.js */ |
|
1076 |
SimileAjax.HTML=new Object(); |
|
1077 |
SimileAjax.HTML._e2uHash={}; |
|
1078 |
(function(){var A=SimileAjax.HTML._e2uHash; |
|
1079 |
A["nbsp"]="\u00A0[space]"; |
|
1080 |
A["iexcl"]="\u00A1"; |
|
1081 |
A["cent"]="\u00A2"; |
|
1082 |
A["pound"]="\u00A3"; |
|
1083 |
A["curren"]="\u00A4"; |
|
1084 |
A["yen"]="\u00A5"; |
|
1085 |
A["brvbar"]="\u00A6"; |
|
1086 |
A["sect"]="\u00A7"; |
|
1087 |
A["uml"]="\u00A8"; |
|
1088 |
A["copy"]="\u00A9"; |
|
1089 |
A["ordf"]="\u00AA"; |
|
1090 |
A["laquo"]="\u00AB"; |
|
1091 |
A["not"]="\u00AC"; |
|
1092 |
A["shy"]="\u00AD"; |
|
1093 |
A["reg"]="\u00AE"; |
|
1094 |
A["macr"]="\u00AF"; |
|
1095 |
A["deg"]="\u00B0"; |
|
1096 |
A["plusmn"]="\u00B1"; |
|
1097 |
A["sup2"]="\u00B2"; |
|
1098 |
A["sup3"]="\u00B3"; |
|
1099 |
A["acute"]="\u00B4"; |
|
1100 |
A["micro"]="\u00B5"; |
|
1101 |
A["para"]="\u00B6"; |
|
1102 |
A["middot"]="\u00B7"; |
|
1103 |
A["cedil"]="\u00B8"; |
|
1104 |
A["sup1"]="\u00B9"; |
|
1105 |
A["ordm"]="\u00BA"; |
|
1106 |
A["raquo"]="\u00BB"; |
|
1107 |
A["frac14"]="\u00BC"; |
|
1108 |
A["frac12"]="\u00BD"; |
|
1109 |
A["frac34"]="\u00BE"; |
|
1110 |
A["iquest"]="\u00BF"; |
|
1111 |
A["Agrave"]="\u00C0"; |
|
1112 |
A["Aacute"]="\u00C1"; |
|
1113 |
A["Acirc"]="\u00C2"; |
|
1114 |
A["Atilde"]="\u00C3"; |
|
1115 |
A["Auml"]="\u00C4"; |
|
1116 |
A["Aring"]="\u00C5"; |
|
1117 |
A["AElig"]="\u00C6"; |
|
1118 |
A["Ccedil"]="\u00C7"; |
|
1119 |
A["Egrave"]="\u00C8"; |
|
1120 |
A["Eacute"]="\u00C9"; |
|
1121 |
A["Ecirc"]="\u00CA"; |
|
1122 |
A["Euml"]="\u00CB"; |
|
1123 |
A["Igrave"]="\u00CC"; |
|
1124 |
A["Iacute"]="\u00CD"; |
|
1125 |
A["Icirc"]="\u00CE"; |
|
1126 |
A["Iuml"]="\u00CF"; |
|
1127 |
A["ETH"]="\u00D0"; |
|
1128 |
A["Ntilde"]="\u00D1"; |
|
1129 |
A["Ograve"]="\u00D2"; |
|
1130 |
A["Oacute"]="\u00D3"; |
|
1131 |
A["Ocirc"]="\u00D4"; |
|
1132 |
A["Otilde"]="\u00D5"; |
|
1133 |
A["Ouml"]="\u00D6"; |
|
1134 |
A["times"]="\u00D7"; |
|
1135 |
A["Oslash"]="\u00D8"; |
|
1136 |
A["Ugrave"]="\u00D9"; |
|
1137 |
A["Uacute"]="\u00DA"; |
|
1138 |
A["Ucirc"]="\u00DB"; |
|
1139 |
A["Uuml"]="\u00DC"; |
|
1140 |
A["Yacute"]="\u00DD"; |
|
1141 |
A["THORN"]="\u00DE"; |
|
1142 |
A["szlig"]="\u00DF"; |
|
1143 |
A["agrave"]="\u00E0"; |
|
1144 |
A["aacute"]="\u00E1"; |
|
1145 |
A["acirc"]="\u00E2"; |
|
1146 |
A["atilde"]="\u00E3"; |
|
1147 |
A["auml"]="\u00E4"; |
|
1148 |
A["aring"]="\u00E5"; |
|
1149 |
A["aelig"]="\u00E6"; |
|
1150 |
A["ccedil"]="\u00E7"; |
|
1151 |
A["egrave"]="\u00E8"; |
|
1152 |
A["eacute"]="\u00E9"; |
|
1153 |
A["ecirc"]="\u00EA"; |
|
1154 |
A["euml"]="\u00EB"; |
|
1155 |
A["igrave"]="\u00EC"; |
|
1156 |
A["iacute"]="\u00ED"; |
|
1157 |
A["icirc"]="\u00EE"; |
|
1158 |
A["iuml"]="\u00EF"; |
|
1159 |
A["eth"]="\u00F0"; |
|
1160 |
A["ntilde"]="\u00F1"; |
|
1161 |
A["ograve"]="\u00F2"; |
|
1162 |
A["oacute"]="\u00F3"; |
|
1163 |
A["ocirc"]="\u00F4"; |
|
1164 |
A["otilde"]="\u00F5"; |
|
1165 |
A["ouml"]="\u00F6"; |
|
1166 |
A["divide"]="\u00F7"; |
|
1167 |
A["oslash"]="\u00F8"; |
|
1168 |
A["ugrave"]="\u00F9"; |
|
1169 |
A["uacute"]="\u00FA"; |
|
1170 |
A["ucirc"]="\u00FB"; |
|
1171 |
A["uuml"]="\u00FC"; |
|
1172 |
A["yacute"]="\u00FD"; |
|
1173 |
A["thorn"]="\u00FE"; |
|
1174 |
A["yuml"]="\u00FF"; |
|
1175 |
A["quot"]="\u0022"; |
|
1176 |
A["amp"]="\u0026"; |
|
1177 |
A["lt"]="\u003C"; |
|
1178 |
A["gt"]="\u003E"; |
|
1179 |
A["OElig"]=""; |
|
1180 |
A["oelig"]="\u0153"; |
|
1181 |
A["Scaron"]="\u0160"; |
|
1182 |
A["scaron"]="\u0161"; |
|
1183 |
A["Yuml"]="\u0178"; |
|
1184 |
A["circ"]="\u02C6"; |
|
1185 |
A["tilde"]="\u02DC"; |
|
1186 |
A["ensp"]="\u2002"; |
|
1187 |
A["emsp"]="\u2003"; |
|
1188 |
A["thinsp"]="\u2009"; |
|
1189 |
A["zwnj"]="\u200C"; |
|
1190 |
A["zwj"]="\u200D"; |
|
1191 |
A["lrm"]="\u200E"; |
|
1192 |
A["rlm"]="\u200F"; |
|
1193 |
A["ndash"]="\u2013"; |
|
1194 |
A["mdash"]="\u2014"; |
|
1195 |
A["lsquo"]="\u2018"; |
|
1196 |
A["rsquo"]="\u2019"; |
|
1197 |
A["sbquo"]="\u201A"; |
|
1198 |
A["ldquo"]="\u201C"; |
|
1199 |
A["rdquo"]="\u201D"; |
|
1200 |
A["bdquo"]="\u201E"; |
|
1201 |
A["dagger"]="\u2020"; |
|
1202 |
A["Dagger"]="\u2021"; |
|
1203 |
A["permil"]="\u2030"; |
|
1204 |
A["lsaquo"]="\u2039"; |
|
1205 |
A["rsaquo"]="\u203A"; |
|
1206 |
A["euro"]="\u20AC"; |
|
1207 |
A["fnof"]="\u0192"; |
|
1208 |
A["Alpha"]="\u0391"; |
|
1209 |
A["Beta"]="\u0392"; |
|
1210 |
A["Gamma"]="\u0393"; |
|
1211 |
A["Delta"]="\u0394"; |
|
1212 |
A["Epsilon"]="\u0395"; |
|
1213 |
A["Zeta"]="\u0396"; |
|
1214 |
A["Eta"]="\u0397"; |
|
1215 |
A["Theta"]="\u0398"; |
|
1216 |
A["Iota"]="\u0399"; |
|
1217 |
A["Kappa"]="\u039A"; |
|
1218 |
A["Lambda"]="\u039B"; |
|
1219 |
A["Mu"]="\u039C"; |
|
1220 |
A["Nu"]="\u039D"; |
|
1221 |
A["Xi"]="\u039E"; |
|
1222 |
A["Omicron"]="\u039F"; |
|
1223 |
A["Pi"]="\u03A0"; |
|
1224 |
A["Rho"]="\u03A1"; |
|
1225 |
A["Sigma"]="\u03A3"; |
|
1226 |
A["Tau"]="\u03A4"; |
|
1227 |
A["Upsilon"]="\u03A5"; |
|
1228 |
A["Phi"]="\u03A6"; |
|
1229 |
A["Chi"]="\u03A7"; |
|
1230 |
A["Psi"]="\u03A8"; |
|
1231 |
A["Omega"]="\u03A9"; |
|
1232 |
A["alpha"]="\u03B1"; |
|
1233 |
A["beta"]="\u03B2"; |
|
1234 |
A["gamma"]="\u03B3"; |
|
1235 |
A["delta"]="\u03B4"; |
|
1236 |
A["epsilon"]="\u03B5"; |
|
1237 |
A["zeta"]="\u03B6"; |
|
1238 |
A["eta"]="\u03B7"; |
|
1239 |
A["theta"]="\u03B8"; |
|
1240 |
A["iota"]="\u03B9"; |
|
1241 |
A["kappa"]="\u03BA"; |
|
1242 |
A["lambda"]="\u03BB"; |
|
1243 |
A["mu"]="\u03BC"; |
|
1244 |
A["nu"]="\u03BD"; |
|
1245 |
A["xi"]="\u03BE"; |
|
1246 |
A["omicron"]="\u03BF"; |
|
1247 |
A["pi"]="\u03C0"; |
|
1248 |
A["rho"]="\u03C1"; |
|
1249 |
A["sigmaf"]="\u03C2"; |
|
1250 |
A["sigma"]="\u03C3"; |
|
1251 |
A["tau"]="\u03C4"; |
|
1252 |
A["upsilon"]="\u03C5"; |
|
1253 |
A["phi"]="\u03C6"; |
|
1254 |
A["chi"]="\u03C7"; |
|
1255 |
A["psi"]="\u03C8"; |
|
1256 |
A["omega"]="\u03C9"; |
|
1257 |
A["thetasym"]="\u03D1"; |
|
1258 |
A["upsih"]="\u03D2"; |
|
1259 |
A["piv"]="\u03D6"; |
|
1260 |
A["bull"]="\u2022"; |
|
1261 |
A["hellip"]="\u2026"; |
|
1262 |
A["prime"]="\u2032"; |
|
1263 |
A["Prime"]="\u2033"; |
|
1264 |
A["oline"]="\u203E"; |
|
1265 |
A["frasl"]="\u2044"; |
|
1266 |
A["weierp"]="\u2118"; |
|
1267 |
A["image"]="\u2111"; |
|
1268 |
A["real"]="\u211C"; |
|
1269 |
A["trade"]="\u2122"; |
|
1270 |
A["alefsym"]="\u2135"; |
|
1271 |
A["larr"]="\u2190"; |
|
1272 |
A["uarr"]="\u2191"; |
|
1273 |
A["rarr"]="\u2192"; |
|
1274 |
A["darr"]="\u2193"; |
|
1275 |
A["harr"]="\u2194"; |
|
1276 |
A["crarr"]="\u21B5"; |
|
1277 |
A["lArr"]="\u21D0"; |
|
1278 |
A["uArr"]="\u21D1"; |
|
1279 |
A["rArr"]="\u21D2"; |
|
1280 |
A["dArr"]="\u21D3"; |
|
1281 |
A["hArr"]="\u21D4"; |
|
1282 |
A["forall"]="\u2200"; |
|
1283 |
A["part"]="\u2202"; |
|
1284 |
A["exist"]="\u2203"; |
|
1285 |
A["empty"]="\u2205"; |
|
1286 |
A["nabla"]="\u2207"; |
|
1287 |
A["isin"]="\u2208"; |
|
1288 |
A["notin"]="\u2209"; |
|
1289 |
A["ni"]="\u220B"; |
|
1290 |
A["prod"]="\u220F"; |
|
1291 |
A["sum"]="\u2211"; |
|
1292 |
A["minus"]="\u2212"; |
|
1293 |
A["lowast"]="\u2217"; |
|
1294 |
A["radic"]="\u221A"; |
|
1295 |
A["prop"]="\u221D"; |
|
1296 |
A["infin"]="\u221E"; |
|
1297 |
A["ang"]="\u2220"; |
|
1298 |
A["and"]="\u2227"; |
|
1299 |
A["or"]="\u2228"; |
|
1300 |
A["cap"]="\u2229"; |
|
1301 |
A["cup"]="\u222A"; |
|
1302 |
A["int"]="\u222B"; |
|
1303 |
A["there4"]="\u2234"; |
|
1304 |
A["sim"]="\u223C"; |
|
1305 |
A["cong"]="\u2245"; |
|
1306 |
A["asymp"]="\u2248"; |
|
1307 |
A["ne"]="\u2260"; |
|
1308 |
A["equiv"]="\u2261"; |
|
1309 |
A["le"]="\u2264"; |
|
1310 |
A["ge"]="\u2265"; |
|
1311 |
A["sub"]="\u2282"; |
|
1312 |
A["sup"]="\u2283"; |
|
1313 |
A["nsub"]="\u2284"; |
|
1314 |
A["sube"]="\u2286"; |
|
1315 |
A["supe"]="\u2287"; |
|
1316 |
A["oplus"]="\u2295"; |
|
1317 |
A["otimes"]="\u2297"; |
|
1318 |
A["perp"]="\u22A5"; |
|
1319 |
A["sdot"]="\u22C5"; |
|
1320 |
A["lceil"]="\u2308"; |
|
1321 |
A["rceil"]="\u2309"; |
|
1322 |
A["lfloor"]="\u230A"; |
|
1323 |
A["rfloor"]="\u230B"; |
|
1324 |
A["lang"]="\u2329"; |
|
1325 |
A["rang"]="\u232A"; |
|
1326 |
A["loz"]="\u25CA"; |
|
1327 |
A["spades"]="\u2660"; |
|
1328 |
A["clubs"]="\u2663"; |
|
1329 |
A["hearts"]="\u2665"; |
|
1330 |
A["diams"]="\u2666"; |
|
1331 |
})(); |
|
1332 |
SimileAjax.HTML.deEntify=function(C){var D=SimileAjax.HTML._e2uHash; |
|
1333 |
var B=/&(\w+?);/; |
|
1334 |
while(B.test(C)){var A=C.match(B); |
|
1335 |
C=C.replace(B,D[A[1]]); |
|
1336 |
}return C; |
|
1337 |
}; |
|
1338 |
||
1339 |
||
1340 |
/* json.js */ |
|
1341 |
SimileAjax.JSON=new Object(); |
|
1342 |
(function(){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}; |
|
1343 |
var s={array:function(x){var a=["["],b,f,i,l=x.length,v; |
|
1344 |
for(i=0; |
|
1345 |
i<l; |
|
1346 |
i+=1){v=x[i]; |
|
1347 |
f=s[typeof v]; |
|
1348 |
if(f){v=f(v); |
|
1349 |
if(typeof v=="string"){if(b){a[a.length]=","; |
|
1350 |
}a[a.length]=v; |
|
1351 |
b=true; |
|
1352 |
}}}a[a.length]="]"; |
|
1353 |
return a.join(""); |
|
1354 |
},"boolean":function(x){return String(x); |
|
1355 |
},"null":function(x){return"null"; |
|
1356 |
},number:function(x){return isFinite(x)?String(x):"null"; |
|
1357 |
},object:function(x){if(x){if(x instanceof Array){return s.array(x); |
|
1358 |
}var a=["{"],b,f,i,v; |
|
1359 |
for(i in x){v=x[i]; |
|
1360 |
f=s[typeof v]; |
|
1361 |
if(f){v=f(v); |
|
1362 |
if(typeof v=="string"){if(b){a[a.length]=","; |
|
1363 |
}a.push(s.string(i),":",v); |
|
1364 |
b=true; |
|
1365 |
}}}a[a.length]="}"; |
|
1366 |
return a.join(""); |
|
1367 |
}return"null"; |
|
1368 |
},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b]; |
|
1369 |
if(c){return c; |
|
1370 |
}c=b.charCodeAt(); |
|
1371 |
return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16); |
|
1372 |
}); |
|
1373 |
}return'"'+x+'"'; |
|
1374 |
}}; |
|
1375 |
SimileAjax.JSON.toJSONString=function(o){if(o instanceof Object){return s.object(o); |
|
1376 |
}else{if(o instanceof Array){return s.array(o); |
|
1377 |
}else{return o.toString(); |
|
1378 |
}}}; |
|
1379 |
SimileAjax.JSON.parseJSON=function(){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+this+")"); |
|
1380 |
}catch(e){return false; |
|
1381 |
}}; |
|
1382 |
})(); |
|
1383 |
||
1384 |
||
1385 |
/* string.js */ |
|
1386 |
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,""); |
|
1387 |
}; |
|
1388 |
String.prototype.startsWith=function(A){return this.length>=A.length&&this.substr(0,A.length)==A; |
|
1389 |
}; |
|
1390 |
String.prototype.endsWith=function(A){return this.length>=A.length&&this.substr(this.length-A.length)==A; |
|
1391 |
}; |
|
1392 |
String.substitute=function(B,D){var A=""; |
|
1393 |
var F=0; |
|
1394 |
while(F<B.length-1){var C=B.indexOf("%",F); |
|
1395 |
if(C<0||C==B.length-1){break; |
|
1396 |
}else{if(C>F&&B.charAt(C-1)=="\\"){A+=B.substring(F,C-1)+"%"; |
|
1397 |
F=C+1; |
|
1398 |
}else{var E=parseInt(B.charAt(C+1)); |
|
1399 |
if(isNaN(E)||E>=D.length){A+=B.substring(F,C+2); |
|
1400 |
}else{A+=B.substring(F,C)+D[E].toString(); |
|
1401 |
}F=C+2; |
|
1402 |
}}}if(F<B.length){A+=B.substring(F); |
|
1403 |
}return A; |
|
1404 |
}; |
|
1405 |
||
1406 |
||
1407 |
/* units.js */ |
|
1408 |
SimileAjax.NativeDateUnit=new Object(); |
|
1409 |
SimileAjax.NativeDateUnit.makeDefaultValue=function(){return new Date(); |
|
1410 |
}; |
|
1411 |
SimileAjax.NativeDateUnit.cloneValue=function(A){return new Date(A.getTime()); |
|
1412 |
}; |
|
1413 |
SimileAjax.NativeDateUnit.getParser=function(A){if(typeof A=="string"){A=A.toLowerCase(); |
|
1414 |
}return(A=="iso8601"||A=="iso 8601")?SimileAjax.DateTime.parseIso8601DateTime:SimileAjax.DateTime.parseGregorianDateTime; |
|
1415 |
}; |
|
1416 |
SimileAjax.NativeDateUnit.parseFromObject=function(A){return SimileAjax.DateTime.parseGregorianDateTime(A); |
|
1417 |
}; |
|
1418 |
SimileAjax.NativeDateUnit.toNumber=function(A){return A.getTime(); |
|
1419 |
}; |
|
1420 |
SimileAjax.NativeDateUnit.fromNumber=function(A){return new Date(A); |
|
1421 |
}; |
|
1422 |
SimileAjax.NativeDateUnit.compare=function(D,C){var B,A; |
|
1423 |
if(typeof D=="object"){B=D.getTime(); |
|
1424 |
}else{B=Number(D); |
|
1425 |
}if(typeof C=="object"){A=C.getTime(); |
|
1426 |
}else{A=Number(C); |
|
1427 |
}return B-A; |
|
1428 |
}; |
|
1429 |
SimileAjax.NativeDateUnit.earlier=function(B,A){return SimileAjax.NativeDateUnit.compare(B,A)<0?B:A; |
|
1430 |
}; |
|
1431 |
SimileAjax.NativeDateUnit.later=function(B,A){return SimileAjax.NativeDateUnit.compare(B,A)>0?B:A; |
|
1432 |
}; |
|
1433 |
SimileAjax.NativeDateUnit.change=function(A,B){return new Date(A.getTime()+B); |
|
1434 |
}; |
|
1435 |
||
1436 |
||
1437 |
/* window-manager.js */ |
|
1438 |
SimileAjax.WindowManager={_initialized:false,_listeners:[],_draggedElement:null,_draggedElementCallback:null,_dropTargetHighlightElement:null,_lastCoords:null,_ghostCoords:null,_draggingMode:"",_dragging:false,_layers:[]}; |
|
1439 |
SimileAjax.WindowManager.initialize=function(){if(SimileAjax.WindowManager._initialized){return ; |
|
1440 |
}SimileAjax.DOM.registerEvent(document.body,"mousedown",SimileAjax.WindowManager._onBodyMouseDown); |
|
1441 |
SimileAjax.DOM.registerEvent(document.body,"mousemove",SimileAjax.WindowManager._onBodyMouseMove); |
|
1442 |
SimileAjax.DOM.registerEvent(document.body,"mouseup",SimileAjax.WindowManager._onBodyMouseUp); |
|
1443 |
SimileAjax.DOM.registerEvent(document,"keydown",SimileAjax.WindowManager._onBodyKeyDown); |
|
1444 |
SimileAjax.DOM.registerEvent(document,"keyup",SimileAjax.WindowManager._onBodyKeyUp); |
|
1445 |
SimileAjax.WindowManager._layers.push({index:0}); |
|
1446 |
SimileAjax.WindowManager._historyListener={onBeforeUndoSeveral:function(){},onAfterUndoSeveral:function(){},onBeforeUndo:function(){},onAfterUndo:function(){},onBeforeRedoSeveral:function(){},onAfterRedoSeveral:function(){},onBeforeRedo:function(){},onAfterRedo:function(){}}; |
|
1447 |
SimileAjax.History.addListener(SimileAjax.WindowManager._historyListener); |
|
1448 |
SimileAjax.WindowManager._initialized=true; |
|
1449 |
}; |
|
1450 |
SimileAjax.WindowManager.getBaseLayer=function(){SimileAjax.WindowManager.initialize(); |
|
1451 |
return SimileAjax.WindowManager._layers[0]; |
|
1452 |
}; |
|
1453 |
SimileAjax.WindowManager.getHighestLayer=function(){SimileAjax.WindowManager.initialize(); |
|
1454 |
return SimileAjax.WindowManager._layers[SimileAjax.WindowManager._layers.length-1]; |
|
1455 |
}; |
|
1456 |
SimileAjax.WindowManager.registerEventWithObject=function(D,A,E,B,C){SimileAjax.WindowManager.registerEvent(D,A,function(G,F,H){return E[B].call(E,G,F,H); |
|
1457 |
},C); |
|
1458 |
}; |
|
1459 |
SimileAjax.WindowManager.registerEvent=function(D,B,E,C){if(C==null){C=SimileAjax.WindowManager.getHighestLayer(); |
|
1460 |
}var A=function(G,F,I){if(SimileAjax.WindowManager._canProcessEventAtLayer(C)){SimileAjax.WindowManager._popToLayer(C.index); |
|
1461 |
try{E(G,F,I); |
|
1462 |
}catch(H){SimileAjax.Debug.exception(H); |
|
1463 |
}}SimileAjax.DOM.cancelEvent(F); |
|
1464 |
return false; |
|
1465 |
}; |
|
1466 |
SimileAjax.DOM.registerEvent(D,B,A); |
|
1467 |
}; |
|
1468 |
SimileAjax.WindowManager.pushLayer=function(C,D,B){var A={onPop:C,index:SimileAjax.WindowManager._layers.length,ephemeral:(D),elmt:B}; |
|
1469 |
SimileAjax.WindowManager._layers.push(A); |
|
1470 |
return A; |
|
1471 |
}; |
|
1472 |
SimileAjax.WindowManager.popLayer=function(B){for(var A=1; |
|
1473 |
A<SimileAjax.WindowManager._layers.length; |
|
1474 |
A++){if(SimileAjax.WindowManager._layers[A]==B){SimileAjax.WindowManager._popToLayer(A-1); |
|
1475 |
break; |
|
1476 |
}}}; |
|
1477 |
SimileAjax.WindowManager.popAllLayers=function(){SimileAjax.WindowManager._popToLayer(0); |
|
1478 |
}; |
|
1479 |
SimileAjax.WindowManager.registerForDragging=function(B,C,A){SimileAjax.WindowManager.registerEvent(B,"mousedown",function(E,D,F){SimileAjax.WindowManager._handleMouseDown(E,D,C); |
|
1480 |
},A); |
|
1481 |
}; |
|
1482 |
SimileAjax.WindowManager._popToLayer=function(C){while(C+1<SimileAjax.WindowManager._layers.length){try{var A=SimileAjax.WindowManager._layers.pop(); |
|
1483 |
if(A.onPop!=null){A.onPop(); |
|
1484 |
}}catch(B){}}}; |
|
1485 |
SimileAjax.WindowManager._canProcessEventAtLayer=function(B){if(B.index==(SimileAjax.WindowManager._layers.length-1)){return true; |
|
1486 |
}for(var A=B.index+1; |
|
1487 |
A<SimileAjax.WindowManager._layers.length; |
|
1488 |
A++){if(!SimileAjax.WindowManager._layers[A].ephemeral){return false; |
|
1489 |
}}return true; |
|
1490 |
}; |
|
1491 |
SimileAjax.WindowManager.cancelPopups=function(A){var F=(A)?SimileAjax.DOM.getEventPageCoordinates(A):{x:-1,y:-1}; |
|
1492 |
var E=SimileAjax.WindowManager._layers.length-1; |
|
1493 |
while(E>0&&SimileAjax.WindowManager._layers[E].ephemeral){var D=SimileAjax.WindowManager._layers[E]; |
|
1494 |
if(D.elmt!=null){var C=D.elmt; |
|
1495 |
var B=SimileAjax.DOM.getPageCoordinates(C); |
|
1496 |
if(F.x>=B.left&&F.x<(B.left+C.offsetWidth)&&F.y>=B.top&&F.y<(B.top+C.offsetHeight)){break; |
|
1497 |
}}E--; |
|
1498 |
}SimileAjax.WindowManager._popToLayer(E); |
|
1499 |
}; |
|
1500 |
SimileAjax.WindowManager._onBodyMouseDown=function(B,A,C){if(!("eventPhase" in A)||A.eventPhase==A.BUBBLING_PHASE){SimileAjax.WindowManager.cancelPopups(A); |
|
1501 |
}}; |
|
1502 |
SimileAjax.WindowManager._handleMouseDown=function(B,A,C){SimileAjax.WindowManager._draggedElement=B; |
|
1503 |
SimileAjax.WindowManager._draggedElementCallback=C; |
|
1504 |
SimileAjax.WindowManager._lastCoords={x:A.clientX,y:A.clientY}; |
|
1505 |
SimileAjax.DOM.cancelEvent(A); |
|
1506 |
return false; |
|
1507 |
}; |
|
1508 |
SimileAjax.WindowManager._onBodyKeyDown=function(C,A,D){if(SimileAjax.WindowManager._dragging){if(A.keyCode==27){SimileAjax.WindowManager._cancelDragging(); |
|
1509 |
}else{if((A.keyCode==17||A.keyCode==16)&&SimileAjax.WindowManager._draggingMode!="copy"){SimileAjax.WindowManager._draggingMode="copy"; |
|
1510 |
var B=SimileAjax.Graphics.createTranslucentImage(SimileAjax.urlPrefix+"data/timeline/copy.png"); |
|
1511 |
B.style.position="absolute"; |
|
1512 |
B.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px"; |
|
1513 |
B.style.top=(SimileAjax.WindowManager._ghostCoords.top)+"px"; |
|
1514 |
document.body.appendChild(B); |
|
1515 |
SimileAjax.WindowManager._draggingModeIndicatorElmt=B; |
|
1516 |
}}}}; |
|
1517 |
SimileAjax.WindowManager._onBodyKeyUp=function(B,A,C){if(SimileAjax.WindowManager._dragging){if(A.keyCode==17||A.keyCode==16){SimileAjax.WindowManager._draggingMode=""; |
|
1518 |
if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt); |
|
1519 |
SimileAjax.WindowManager._draggingModeIndicatorElmt=null; |
|
1520 |
}}}}; |
|
1521 |
SimileAjax.WindowManager._onBodyMouseMove=function(A,N,H){if(SimileAjax.WindowManager._draggedElement!=null){var P=SimileAjax.WindowManager._draggedElementCallback; |
|
1522 |
var E=SimileAjax.WindowManager._lastCoords; |
|
1523 |
var M=N.clientX-E.x; |
|
1524 |
var J=N.clientY-E.y; |
|
1525 |
if(!SimileAjax.WindowManager._dragging){if(Math.abs(M)>5||Math.abs(J)>5){try{if("onDragStart" in P){P.onDragStart(); |
|
1526 |
}if("ghost" in P&&P.ghost){var K=SimileAjax.WindowManager._draggedElement; |
|
1527 |
SimileAjax.WindowManager._ghostCoords=SimileAjax.DOM.getPageCoordinates(K); |
|
1528 |
SimileAjax.WindowManager._ghostCoords.left+=M; |
|
1529 |
SimileAjax.WindowManager._ghostCoords.top+=J; |
|
1530 |
var O=K.cloneNode(true); |
|
1531 |
O.style.position="absolute"; |
|
1532 |
O.style.left=SimileAjax.WindowManager._ghostCoords.left+"px"; |
|
1533 |
O.style.top=SimileAjax.WindowManager._ghostCoords.top+"px"; |
|
1534 |
O.style.zIndex=1000; |
|
1535 |
SimileAjax.Graphics.setOpacity(O,50); |
|
1536 |
document.body.appendChild(O); |
|
1537 |
P._ghostElmt=O; |
|
1538 |
}SimileAjax.WindowManager._dragging=true; |
|
1539 |
SimileAjax.WindowManager._lastCoords={x:N.clientX,y:N.clientY}; |
|
1540 |
document.body.focus(); |
|
1541 |
}catch(G){SimileAjax.Debug.exception("WindowManager: Error handling mouse down",G); |
|
1542 |
SimileAjax.WindowManager._cancelDragging(); |
|
1543 |
}}}else{try{SimileAjax.WindowManager._lastCoords={x:N.clientX,y:N.clientY}; |
|
1544 |
if("onDragBy" in P){P.onDragBy(M,J); |
|
1545 |
}if("_ghostElmt" in P){var O=P._ghostElmt; |
|
1546 |
SimileAjax.WindowManager._ghostCoords.left+=M; |
|
1547 |
SimileAjax.WindowManager._ghostCoords.top+=J; |
|
1548 |
O.style.left=SimileAjax.WindowManager._ghostCoords.left+"px"; |
|
1549 |
O.style.top=SimileAjax.WindowManager._ghostCoords.top+"px"; |
|
1550 |
if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){var I=SimileAjax.WindowManager._draggingModeIndicatorElmt; |
|
1551 |
I.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px"; |
|
1552 |
I.style.top=SimileAjax.WindowManager._ghostCoords.top+"px"; |
|
1553 |
}if("droppable" in P&&P.droppable){var L=SimileAjax.DOM.getEventPageCoordinates(N); |
|
1554 |
var H=SimileAjax.DOM.hittest(L.x,L.y,[SimileAjax.WindowManager._ghostElmt,SimileAjax.WindowManager._dropTargetHighlightElement]); |
|
1555 |
H=SimileAjax.WindowManager._findDropTarget(H); |
|
1556 |
if(H!=SimileAjax.WindowManager._potentialDropTarget){if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement); |
|
1557 |
SimileAjax.WindowManager._dropTargetHighlightElement=null; |
|
1558 |
SimileAjax.WindowManager._potentialDropTarget=null; |
|
1559 |
}var F=false; |
|
1560 |
if(H!=null){if((!("canDropOn" in P)||P.canDropOn(H))&&(!("canDrop" in H)||H.canDrop(SimileAjax.WindowManager._draggedElement))){F=true; |
|
1561 |
}}if(F){var C=4; |
|
1562 |
var D=SimileAjax.DOM.getPageCoordinates(H); |
|
1563 |
var B=document.createElement("div"); |
|
1564 |
B.style.border=C+"px solid yellow"; |
|
1565 |
B.style.backgroundColor="yellow"; |
|
1566 |
B.style.position="absolute"; |
|
1567 |
B.style.left=D.left+"px"; |
|
1568 |
B.style.top=D.top+"px"; |
|
1569 |
B.style.width=(H.offsetWidth-C*2)+"px"; |
|
1570 |
B.style.height=(H.offsetHeight-C*2)+"px"; |
|
1571 |
SimileAjax.Graphics.setOpacity(B,30); |
|
1572 |
document.body.appendChild(B); |
|
1573 |
SimileAjax.WindowManager._potentialDropTarget=H; |
|
1574 |
SimileAjax.WindowManager._dropTargetHighlightElement=B; |
|
1575 |
}}}}}catch(G){SimileAjax.Debug.exception("WindowManager: Error handling mouse move",G); |
|
1576 |
SimileAjax.WindowManager._cancelDragging(); |
|
1577 |
}}SimileAjax.DOM.cancelEvent(N); |
|
1578 |
return false; |
|
1579 |
}}; |
|
1580 |
SimileAjax.WindowManager._onBodyMouseUp=function(B,A,C){if(SimileAjax.WindowManager._draggedElement!=null){try{if(SimileAjax.WindowManager._dragging){var E=SimileAjax.WindowManager._draggedElementCallback; |
|
1581 |
if("onDragEnd" in E){E.onDragEnd(); |
|
1582 |
}if("droppable" in E&&E.droppable){var D=false; |
|
1583 |
var C=SimileAjax.WindowManager._potentialDropTarget; |
|
1584 |
if(C!=null){if((!("canDropOn" in E)||E.canDropOn(C))&&(!("canDrop" in C)||C.canDrop(SimileAjax.WindowManager._draggedElement))){if("onDropOn" in E){E.onDropOn(C); |
|
1585 |
}C.ondrop(SimileAjax.WindowManager._draggedElement,SimileAjax.WindowManager._draggingMode); |
|
1586 |
D=true; |
|
1587 |
}}if(!D){}}}}finally{SimileAjax.WindowManager._cancelDragging(); |
|
1588 |
}SimileAjax.DOM.cancelEvent(A); |
|
1589 |
return false; |
|
1590 |
}}; |
|
1591 |
SimileAjax.WindowManager._cancelDragging=function(){var B=SimileAjax.WindowManager._draggedElementCallback; |
|
1592 |
if("_ghostElmt" in B){var A=B._ghostElmt; |
|
1593 |
document.body.removeChild(A); |
|
1594 |
delete B._ghostElmt; |
|
1595 |
}if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement); |
|
1596 |
SimileAjax.WindowManager._dropTargetHighlightElement=null; |
|
1597 |
}if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt); |
|
1598 |
SimileAjax.WindowManager._draggingModeIndicatorElmt=null; |
|
1599 |
}SimileAjax.WindowManager._draggedElement=null; |
|
1600 |
SimileAjax.WindowManager._draggedElementCallback=null; |
|
1601 |
SimileAjax.WindowManager._potentialDropTarget=null; |
|
1602 |
SimileAjax.WindowManager._dropTargetHighlightElement=null; |
|
1603 |
SimileAjax.WindowManager._lastCoords=null; |
|
1604 |
SimileAjax.WindowManager._ghostCoords=null; |
|
1605 |
SimileAjax.WindowManager._draggingMode=""; |
|
1606 |
SimileAjax.WindowManager._dragging=false; |
|
1607 |
}; |
|
1608 |
SimileAjax.WindowManager._findDropTarget=function(A){while(A!=null){if("ondrop" in A&&(typeof A.ondrop)=="function"){break; |
|
1609 |
}A=A.parentNode; |
|
1610 |
}return A; |
|
1611 |
}; |
|
1612 |
||
1613 |
||
1614 |
/* xmlhttp.js */ |
|
1615 |
SimileAjax.XmlHttp=new Object(); |
|
1616 |
SimileAjax.XmlHttp._onReadyStateChange=function(A,D,B){switch(A.readyState){case 4:try{if(A.status==0||A.status==200){if(B){B(A); |
|
1617 |
}}else{if(D){D(A.statusText,A.status,A); |
|
1618 |
}}}catch(C){SimileAjax.Debug.exception("XmlHttp: Error handling onReadyStateChange",C); |
|
1619 |
}break; |
|
1620 |
}}; |
|
1621 |
SimileAjax.XmlHttp._createRequest=function(){if(SimileAjax.Platform.browser.isIE){var A=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"]; |
|
1622 |
for(var B=0; |
|
1623 |
B<A.length; |
|
1624 |
B++){try{var C=A[B]; |
|
1625 |
var D=function(){return new ActiveXObject(C); |
|
1626 |
}; |
|
1627 |
var F=D(); |
|
1628 |
SimileAjax.XmlHttp._createRequest=D; |
|
1629 |
return F; |
|
1630 |
}catch(E){}}}try{var D=function(){return new XMLHttpRequest(); |
|
1631 |
}; |
|
1632 |
var F=D(); |
|
1633 |
SimileAjax.XmlHttp._createRequest=D; |
|
1634 |
return F; |
|
1635 |
}catch(E){throw new Error("Failed to create an XMLHttpRequest object"); |
|
1636 |
}}; |
|
1637 |
SimileAjax.XmlHttp.get=function(A,D,C){var B=SimileAjax.XmlHttp._createRequest(); |
|
1638 |
B.open("GET",A,true); |
|
1639 |
B.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(B,D,C); |
|
1640 |
}; |
|
1641 |
B.send(null); |
|
1642 |
}; |
|
1643 |
SimileAjax.XmlHttp.post=function(B,A,E,D){var C=SimileAjax.XmlHttp._createRequest(); |
|
1644 |
C.open("POST",B,true); |
|
1645 |
C.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(C,E,D); |
|
1646 |
}; |
|
1647 |
C.send(A); |
|
1648 |
}; |
|
1649 |
SimileAjax.XmlHttp._forceXML=function(A){try{A.overrideMimeType("text/xml"); |
|
1650 |
}catch(B){A.setrequestheader("Content-Type","text/xml"); |
|
1651 |
}}; |
|
1652 |
||
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1653 |
/******** end of simile-ajax-bundle.js ********/ |
0 | 1654 |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1655 |
/******** start of simile-timeline-bundle.js ********/ |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1656 |
|
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1657 |
/* band.js */ |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1658 |
Timeline._Band=function(B,C,A){if(B!==undefined){this.initialize(B,C,A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1659 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1660 |
Timeline._Band.prototype.initialize=function(F,G,B){if(F.autoWidth&&typeof G.width=="string"){G.width=G.width.indexOf("%")>-1?0:parseInt(G.width); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1661 |
}this._timeline=F; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1662 |
this._bandInfo=G; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1663 |
this._index=B; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1664 |
this._locale=("locale" in G)?G.locale:Timeline.getDefaultLocale(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1665 |
this._timeZone=("timeZone" in G)?G.timeZone:0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1666 |
this._labeller=("labeller" in G)?G.labeller:(("createLabeller" in F.getUnit())?F.getUnit().createLabeller(this._locale,this._timeZone):new Timeline.GregorianDateLabeller(this._locale,this._timeZone)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1667 |
this._theme=G.theme; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1668 |
this._zoomIndex=("zoomIndex" in G)?G.zoomIndex:0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1669 |
this._zoomSteps=("zoomSteps" in G)?G.zoomSteps:null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1670 |
this._dragging=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1671 |
this._changing=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1672 |
this._originalScrollSpeed=5; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1673 |
this._scrollSpeed=this._originalScrollSpeed; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1674 |
this._onScrollListeners=[]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1675 |
var A=this; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1676 |
this._syncWithBand=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1677 |
this._syncWithBandHandler=function(H){A._onHighlightBandScroll(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1678 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1679 |
this._selectorListener=function(H){A._onHighlightBandScroll(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1680 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1681 |
var D=this._timeline.getDocument().createElement("div"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1682 |
D.className="timeline-band-input"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1683 |
this._timeline.addDiv(D); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1684 |
this._keyboardInput=document.createElement("input"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1685 |
this._keyboardInput.type="text"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1686 |
D.appendChild(this._keyboardInput); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1687 |
SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keydown",this,"_onKeyDown"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1688 |
SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keyup",this,"_onKeyUp"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1689 |
this._div=this._timeline.getDocument().createElement("div"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1690 |
this._div.id="timeline-band-"+B; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1691 |
this._div.className="timeline-band timeline-band-"+B; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1692 |
this._timeline.addDiv(this._div); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1693 |
SimileAjax.DOM.registerEventWithObject(this._div,"mousedown",this,"_onMouseDown"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1694 |
SimileAjax.DOM.registerEventWithObject(this._div,"mousemove",this,"_onMouseMove"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1695 |
SimileAjax.DOM.registerEventWithObject(this._div,"mouseup",this,"_onMouseUp"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1696 |
SimileAjax.DOM.registerEventWithObject(this._div,"mouseout",this,"_onMouseOut"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1697 |
SimileAjax.DOM.registerEventWithObject(this._div,"dblclick",this,"_onDblClick"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1698 |
var E=this._theme!=null?this._theme.mouseWheel:"scroll"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1699 |
if(E==="zoom"||E==="scroll"||this._zoomSteps){if(SimileAjax.Platform.browser.isFirefox){SimileAjax.DOM.registerEventWithObject(this._div,"DOMMouseScroll",this,"_onMouseScroll"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1700 |
}else{SimileAjax.DOM.registerEventWithObject(this._div,"mousewheel",this,"_onMouseScroll"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1701 |
}}this._innerDiv=this._timeline.getDocument().createElement("div"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1702 |
this._innerDiv.className="timeline-band-inner"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1703 |
this._div.appendChild(this._innerDiv); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1704 |
this._ether=G.ether; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1705 |
G.ether.initialize(this,F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1706 |
this._etherPainter=G.etherPainter; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1707 |
G.etherPainter.initialize(this,F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1708 |
this._eventSource=G.eventSource; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1709 |
if(this._eventSource){this._eventListener={onAddMany:function(){A._onAddMany(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1710 |
},onClear:function(){A._onClear(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1711 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1712 |
this._eventSource.addListener(this._eventListener); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1713 |
}this._eventPainter=G.eventPainter; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1714 |
this._eventTracksNeeded=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1715 |
this._eventTrackIncrement=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1716 |
G.eventPainter.initialize(this,F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1717 |
this._decorators=("decorators" in G)?G.decorators:[]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1718 |
for(var C=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1719 |
C<this._decorators.length; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1720 |
C++){this._decorators[C].initialize(this,F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1721 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1722 |
Timeline._Band.SCROLL_MULTIPLES=5; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1723 |
Timeline._Band.prototype.dispose=function(){this.closeBubble(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1724 |
if(this._eventSource){this._eventSource.removeListener(this._eventListener); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1725 |
this._eventListener=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1726 |
this._eventSource=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1727 |
}this._timeline=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1728 |
this._bandInfo=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1729 |
this._labeller=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1730 |
this._ether=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1731 |
this._etherPainter=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1732 |
this._eventPainter=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1733 |
this._decorators=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1734 |
this._onScrollListeners=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1735 |
this._syncWithBandHandler=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1736 |
this._selectorListener=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1737 |
this._div=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1738 |
this._innerDiv=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1739 |
this._keyboardInput=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1740 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1741 |
Timeline._Band.prototype.addOnScrollListener=function(A){this._onScrollListeners.push(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1742 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1743 |
Timeline._Band.prototype.removeOnScrollListener=function(B){for(var A=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1744 |
A<this._onScrollListeners.length; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1745 |
A++){if(this._onScrollListeners[A]==B){this._onScrollListeners.splice(A,1); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1746 |
break; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1747 |
}}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1748 |
Timeline._Band.prototype.setSyncWithBand=function(B,A){if(this._syncWithBand){this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1749 |
}this._syncWithBand=B; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1750 |
this._syncWithBand.addOnScrollListener(this._syncWithBandHandler); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1751 |
this._highlight=A; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1752 |
this._positionHighlight(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1753 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1754 |
Timeline._Band.prototype.getLocale=function(){return this._locale; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1755 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1756 |
Timeline._Band.prototype.getTimeZone=function(){return this._timeZone; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1757 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1758 |
Timeline._Band.prototype.getLabeller=function(){return this._labeller; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1759 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1760 |
Timeline._Band.prototype.getIndex=function(){return this._index; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1761 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1762 |
Timeline._Band.prototype.getEther=function(){return this._ether; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1763 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1764 |
Timeline._Band.prototype.getEtherPainter=function(){return this._etherPainter; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1765 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1766 |
Timeline._Band.prototype.getEventSource=function(){return this._eventSource; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1767 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1768 |
Timeline._Band.prototype.getEventPainter=function(){return this._eventPainter; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1769 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1770 |
Timeline._Band.prototype.getTimeline=function(){return this._timeline; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1771 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1772 |
Timeline._Band.prototype.updateEventTrackInfo=function(B,A){this._eventTrackIncrement=A; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1773 |
if(B>this._eventTracksNeeded){this._eventTracksNeeded=B; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1774 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1775 |
Timeline._Band.prototype.checkAutoWidth=function(){if(!this._timeline.autoWidth){return ; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1776 |
}var A=this._eventPainter.getType()=="overview"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1777 |
var C=A?this._theme.event.overviewTrack.autoWidthMargin:this._theme.event.track.autoWidthMargin; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1778 |
var B=Math.ceil((this._eventTracksNeeded+C)*this._eventTrackIncrement); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1779 |
B+=A?this._theme.event.overviewTrack.offset:this._theme.event.track.offset; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1780 |
var D=this._bandInfo; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1781 |
if(B!=D.width){D.width=B; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1782 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1783 |
Timeline._Band.prototype.layout=function(){this.paint(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1784 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1785 |
Timeline._Band.prototype.paint=function(){this._etherPainter.paint(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1786 |
this._paintDecorators(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1787 |
this._paintEvents(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1788 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1789 |
Timeline._Band.prototype.softLayout=function(){this.softPaint(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1790 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1791 |
Timeline._Band.prototype.softPaint=function(){this._etherPainter.softPaint(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1792 |
this._softPaintDecorators(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1793 |
this._softPaintEvents(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1794 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1795 |
Timeline._Band.prototype.setBandShiftAndWidth=function(A,D){var C=this._keyboardInput.parentNode; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1796 |
var B=A+Math.floor(D/2); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1797 |
if(this._timeline.isHorizontal()){this._div.style.top=A+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1798 |
this._div.style.height=D+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1799 |
C.style.top=B+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1800 |
C.style.left="-1em"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1801 |
}else{this._div.style.left=A+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1802 |
this._div.style.width=D+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1803 |
C.style.left=B+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1804 |
C.style.top="-1em"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1805 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1806 |
Timeline._Band.prototype.getViewWidth=function(){if(this._timeline.isHorizontal()){return this._div.offsetHeight; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1807 |
}else{return this._div.offsetWidth; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1808 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1809 |
Timeline._Band.prototype.setViewLength=function(A){this._viewLength=A; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1810 |
this._recenterDiv(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1811 |
this._onChanging(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1812 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1813 |
Timeline._Band.prototype.getViewLength=function(){return this._viewLength; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1814 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1815 |
Timeline._Band.prototype.getTotalViewLength=function(){return Timeline._Band.SCROLL_MULTIPLES*this._viewLength; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1816 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1817 |
Timeline._Band.prototype.getViewOffset=function(){return this._viewOffset; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1818 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1819 |
Timeline._Band.prototype.getMinDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1820 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1821 |
Timeline._Band.prototype.getMaxDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset+Timeline._Band.SCROLL_MULTIPLES*this._viewLength); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1822 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1823 |
Timeline._Band.prototype.getMinVisibleDate=function(){return this._ether.pixelOffsetToDate(0); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1824 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1825 |
Timeline._Band.prototype.getMaxVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1826 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1827 |
Timeline._Band.prototype.getCenterVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength/2); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1828 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1829 |
Timeline._Band.prototype.setMinVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(-this._ether.dateToPixelOffset(A))); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1830 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1831 |
Timeline._Band.prototype.setMaxVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength-this._ether.dateToPixelOffset(A))); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1832 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1833 |
Timeline._Band.prototype.setCenterVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(A))); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1834 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1835 |
Timeline._Band.prototype.dateToPixelOffset=function(A){return this._ether.dateToPixelOffset(A)-this._viewOffset; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1836 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1837 |
Timeline._Band.prototype.pixelOffsetToDate=function(A){return this._ether.pixelOffsetToDate(A+this._viewOffset); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1838 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1839 |
Timeline._Band.prototype.createLayerDiv=function(D,B){var C=this._timeline.getDocument().createElement("div"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1840 |
C.className="timeline-band-layer"+(typeof B=="string"?(" "+B):""); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1841 |
C.style.zIndex=D; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1842 |
this._innerDiv.appendChild(C); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1843 |
var A=this._timeline.getDocument().createElement("div"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1844 |
A.className="timeline-band-layer-inner"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1845 |
if(SimileAjax.Platform.browser.isIE){A.style.cursor="move"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1846 |
}else{A.style.cursor="-moz-grab"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1847 |
}C.appendChild(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1848 |
return A; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1849 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1850 |
Timeline._Band.prototype.removeLayerDiv=function(A){this._innerDiv.removeChild(A.parentNode); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1851 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1852 |
Timeline._Band.prototype.scrollToCenter=function(B,C){var A=this._ether.dateToPixelOffset(B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1853 |
if(A<-this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(A+this._viewLength)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1854 |
}else{if(A>3*this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(A-this._viewLength)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1855 |
}}this._autoScroll(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(B)),C); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1856 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1857 |
Timeline._Band.prototype.showBubbleForEvent=function(C){var A=this.getEventSource().getEvent(C); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1858 |
if(A){var B=this; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1859 |
this.scrollToCenter(A.getStart(),function(){B._eventPainter.showBubble(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1860 |
}); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1861 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1862 |
Timeline._Band.prototype.zoom=function(F,A,E,C){if(!this._zoomSteps){return ; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1863 |
}A+=this._viewOffset; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1864 |
var D=this._ether.pixelOffsetToDate(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1865 |
var B=this._ether.zoom(F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1866 |
this._etherPainter.zoom(B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1867 |
this._moveEther(Math.round(-this._ether.dateToPixelOffset(D))); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1868 |
this._moveEther(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1869 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1870 |
Timeline._Band.prototype._onMouseDown=function(B,A,C){this.closeBubble(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1871 |
this._dragging=true; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1872 |
this._dragX=A.clientX; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1873 |
this._dragY=A.clientY; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1874 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1875 |
Timeline._Band.prototype._onMouseMove=function(D,A,E){if(this._dragging){var C=A.clientX-this._dragX; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1876 |
var B=A.clientY-this._dragY; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1877 |
this._dragX=A.clientX; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1878 |
this._dragY=A.clientY; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1879 |
this._moveEther(this._timeline.isHorizontal()?C:B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1880 |
this._positionHighlight(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1881 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1882 |
Timeline._Band.prototype._onMouseUp=function(B,A,C){this._dragging=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1883 |
this._keyboardInput.focus(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1884 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1885 |
Timeline._Band.prototype._onMouseOut=function(B,A,D){var C=SimileAjax.DOM.getEventRelativeCoordinates(A,B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1886 |
C.x+=this._viewOffset; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1887 |
if(C.x<0||C.x>B.offsetWidth||C.y<0||C.y>B.offsetHeight){this._dragging=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1888 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1889 |
Timeline._Band.prototype._onMouseScroll=function(G,I,E){var A=new Date(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1890 |
A=A.getTime(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1891 |
if(!this._lastScrollTime||((A-this._lastScrollTime)>50)){this._lastScrollTime=A; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1892 |
var H=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1893 |
if(I.wheelDelta){H=I.wheelDelta/120; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1894 |
}else{if(I.detail){H=-I.detail/3; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1895 |
}}var F=this._theme.mouseWheel; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1896 |
if(this._zoomSteps||F==="zoom"){var D=SimileAjax.DOM.getEventRelativeCoordinates(I,G); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1897 |
if(H!=0){var C; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1898 |
if(H>0){C=true; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1899 |
}if(H<0){C=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1900 |
}this._timeline.zoom(C,D.x,D.y,G); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1901 |
}}else{if(F==="scroll"){var B=50*(H<0?-1:1); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1902 |
this._moveEther(B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1903 |
}}}if(I.stopPropagation){I.stopPropagation(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1904 |
}I.cancelBubble=true; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1905 |
if(I.preventDefault){I.preventDefault(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1906 |
}I.returnValue=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1907 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1908 |
Timeline._Band.prototype._onDblClick=function(B,A,D){var C=SimileAjax.DOM.getEventRelativeCoordinates(A,B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1909 |
var E=C.x-(this._viewLength/2-this._viewOffset); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1910 |
this._autoScroll(-E); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1911 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1912 |
Timeline._Band.prototype._onKeyDown=function(B,A,C){if(!this._dragging){switch(A.keyCode){case 27:break; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1913 |
case 37:case 38:this._scrollSpeed=Math.min(50,Math.abs(this._scrollSpeed*1.05)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1914 |
this._moveEther(this._scrollSpeed); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1915 |
break; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1916 |
case 39:case 40:this._scrollSpeed=-Math.min(50,Math.abs(this._scrollSpeed*1.05)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1917 |
this._moveEther(this._scrollSpeed); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1918 |
break; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1919 |
default:return true; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1920 |
}this.closeBubble(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1921 |
SimileAjax.DOM.cancelEvent(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1922 |
return false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1923 |
}return true; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1924 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1925 |
Timeline._Band.prototype._onKeyUp=function(B,A,C){if(!this._dragging){this._scrollSpeed=this._originalScrollSpeed; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1926 |
switch(A.keyCode){case 35:this.setCenterVisibleDate(this._eventSource.getLatestDate()); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1927 |
break; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1928 |
case 36:this.setCenterVisibleDate(this._eventSource.getEarliestDate()); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1929 |
break; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1930 |
case 33:this._autoScroll(this._timeline.getPixelLength()); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1931 |
break; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1932 |
case 34:this._autoScroll(-this._timeline.getPixelLength()); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1933 |
break; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1934 |
default:return true; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1935 |
}this.closeBubble(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1936 |
SimileAjax.DOM.cancelEvent(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1937 |
return false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1938 |
}return true; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1939 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1940 |
Timeline._Band.prototype._autoScroll=function(D,C){var A=this; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1941 |
var B=SimileAjax.Graphics.createAnimation(function(E,F){A._moveEther(F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1942 |
},0,D,1000,C); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1943 |
B.run(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1944 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1945 |
Timeline._Band.prototype._moveEther=function(A){this.closeBubble(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1946 |
this._viewOffset+=A; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1947 |
this._ether.shiftPixels(-A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1948 |
if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1949 |
}else{this._div.style.top=this._viewOffset+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1950 |
}if(this._viewOffset>-this._viewLength*0.5||this._viewOffset<-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1.5)){this._recenterDiv(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1951 |
}else{this.softLayout(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1952 |
}this._onChanging(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1953 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1954 |
Timeline._Band.prototype._onChanging=function(){this._changing=true; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1955 |
this._fireOnScroll(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1956 |
this._setSyncWithBandDate(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1957 |
this._changing=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1958 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1959 |
Timeline._Band.prototype._fireOnScroll=function(){for(var A=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1960 |
A<this._onScrollListeners.length; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1961 |
A++){this._onScrollListeners[A](this); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1962 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1963 |
Timeline._Band.prototype._setSyncWithBandDate=function(){if(this._syncWithBand){var A=this._ether.pixelOffsetToDate(this.getViewLength()/2); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1964 |
this._syncWithBand.setCenterVisibleDate(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1965 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1966 |
Timeline._Band.prototype._onHighlightBandScroll=function(){if(this._syncWithBand){var A=this._syncWithBand.getCenterVisibleDate(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1967 |
var B=this._ether.dateToPixelOffset(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1968 |
this._moveEther(Math.round(this._viewLength/2-B)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1969 |
if(this._highlight){this._etherPainter.setHighlight(this._syncWithBand.getMinVisibleDate(),this._syncWithBand.getMaxVisibleDate()); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1970 |
}}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1971 |
Timeline._Band.prototype._onAddMany=function(){this._paintEvents(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1972 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1973 |
Timeline._Band.prototype._onClear=function(){this._paintEvents(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1974 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1975 |
Timeline._Band.prototype._positionHighlight=function(){if(this._syncWithBand){var A=this._syncWithBand.getMinVisibleDate(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1976 |
var B=this._syncWithBand.getMaxVisibleDate(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1977 |
if(this._highlight){this._etherPainter.setHighlight(A,B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1978 |
}}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1979 |
Timeline._Band.prototype._recenterDiv=function(){this._viewOffset=-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1)/2; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1980 |
if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1981 |
this._div.style.width=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1982 |
}else{this._div.style.top=this._viewOffset+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1983 |
this._div.style.height=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1984 |
}this.layout(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1985 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1986 |
Timeline._Band.prototype._paintEvents=function(){this._eventPainter.paint(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1987 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1988 |
Timeline._Band.prototype._softPaintEvents=function(){this._eventPainter.softPaint(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1989 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1990 |
Timeline._Band.prototype._paintDecorators=function(){for(var A=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1991 |
A<this._decorators.length; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1992 |
A++){this._decorators[A].paint(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1993 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1994 |
Timeline._Band.prototype._softPaintDecorators=function(){for(var A=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1995 |
A<this._decorators.length; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1996 |
A++){this._decorators[A].softPaint(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1997 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1998 |
Timeline._Band.prototype.closeBubble=function(){SimileAjax.WindowManager.cancelPopups(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1999 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2000 |
|
0 | 2001 |
|
2002 |
/* decorators.js */ |
|
2003 |
Timeline.SpanHighlightDecorator=function(A){this._unit=("unit" in A)?A.unit:SimileAjax.NativeDateUnit; |
|
2004 |
this._startDate=(typeof A.startDate=="string")?this._unit.parseFromObject(A.startDate):A.startDate; |
|
2005 |
this._endDate=(typeof A.endDate=="string")?this._unit.parseFromObject(A.endDate):A.endDate; |
|
2006 |
this._startLabel=A.startLabel; |
|
2007 |
this._endLabel=A.endLabel; |
|
2008 |
this._color=A.color; |
|
2009 |
this._cssClass=("cssClass" in A)?A.cssClass:null; |
|
2010 |
this._opacity=("opacity" in A)?A.opacity:100; |
|
2011 |
}; |
|
2012 |
Timeline.SpanHighlightDecorator.prototype.initialize=function(B,A){this._band=B; |
|
2013 |
this._timeline=A; |
|
2014 |
this._layerDiv=null; |
|
2015 |
}; |
|
2016 |
Timeline.SpanHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv); |
|
2017 |
}this._layerDiv=this._band.createLayerDiv(10); |
|
2018 |
this._layerDiv.setAttribute("name","span-highlight-decorator"); |
|
2019 |
this._layerDiv.style.display="none"; |
|
2020 |
var F=this._band.getMinDate(); |
|
2021 |
var C=this._band.getMaxDate(); |
|
2022 |
if(this._unit.compare(this._startDate,C)<0&&this._unit.compare(this._endDate,F)>0){F=this._unit.later(F,this._startDate); |
|
2023 |
C=this._unit.earlier(C,this._endDate); |
|
2024 |
var D=this._band.dateToPixelOffset(F); |
|
2025 |
var K=this._band.dateToPixelOffset(C); |
|
2026 |
var I=this._timeline.getDocument(); |
|
2027 |
var H=function(){var L=I.createElement("table"); |
|
2028 |
L.insertRow(0).insertCell(0); |
|
2029 |
return L; |
|
2030 |
}; |
|
2031 |
var B=I.createElement("div"); |
|
2032 |
B.className="timeline-highlight-decorator"; |
|
2033 |
if(this._cssClass){B.className+=" "+this._cssClass; |
|
2034 |
}if(this._opacity<100){SimileAjax.Graphics.setOpacity(B,this._opacity); |
|
2035 |
}this._layerDiv.appendChild(B); |
|
2036 |
var J=H(); |
|
2037 |
J.className="timeline-highlight-label timeline-highlight-label-start"; |
|
2038 |
var G=J.rows[0].cells[0]; |
|
2039 |
G.innerHTML=this._startLabel; |
|
2040 |
if(this._cssClass){G.className="label_"+this._cssClass; |
|
2041 |
}this._layerDiv.appendChild(J); |
|
2042 |
var A=H(); |
|
2043 |
A.className="timeline-highlight-label timeline-highlight-label-end"; |
|
2044 |
var E=A.rows[0].cells[0]; |
|
2045 |
E.innerHTML=this._endLabel; |
|
2046 |
if(this._cssClass){E.className="label_"+this._cssClass; |
|
2047 |
}this._layerDiv.appendChild(A); |
|
2048 |
if(this._timeline.isHorizontal()){B.style.left=D+"px"; |
|
2049 |
B.style.width=(K-D)+"px"; |
|
2050 |
J.style.right=(this._band.getTotalViewLength()-D)+"px"; |
|
2051 |
J.style.width=(this._startLabel.length)+"em"; |
|
2052 |
A.style.left=K+"px"; |
|
2053 |
A.style.width=(this._endLabel.length)+"em"; |
|
2054 |
}else{B.style.top=D+"px"; |
|
2055 |
B.style.height=(K-D)+"px"; |
|
2056 |
J.style.bottom=D+"px"; |
|
2057 |
J.style.height="1.5px"; |
|
2058 |
A.style.top=K+"px"; |
|
2059 |
A.style.height="1.5px"; |
|
2060 |
}}this._layerDiv.style.display="block"; |
|
2061 |
}; |
|
2062 |
Timeline.SpanHighlightDecorator.prototype.softPaint=function(){}; |
|
2063 |
Timeline.PointHighlightDecorator=function(A){this._unit=("unit" in A)?A.unit:SimileAjax.NativeDateUnit; |
|
2064 |
this._date=(typeof A.date=="string")?this._unit.parseFromObject(A.date):A.date; |
|
2065 |
this._width=("width" in A)?A.width:10; |
|
2066 |
this._color=A.color; |
|
2067 |
this._cssClass=("cssClass" in A)?A.cssClass:""; |
|
2068 |
this._opacity=("opacity" in A)?A.opacity:100; |
|
2069 |
}; |
|
2070 |
Timeline.PointHighlightDecorator.prototype.initialize=function(B,A){this._band=B; |
|
2071 |
this._timeline=A; |
|
2072 |
this._layerDiv=null; |
|
2073 |
}; |
|
2074 |
Timeline.PointHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv); |
|
2075 |
}this._layerDiv=this._band.createLayerDiv(10); |
|
2076 |
this._layerDiv.setAttribute("name","span-highlight-decorator"); |
|
2077 |
this._layerDiv.style.display="none"; |
|
2078 |
var C=this._band.getMinDate(); |
|
2079 |
var E=this._band.getMaxDate(); |
|
2080 |
if(this._unit.compare(this._date,E)<0&&this._unit.compare(this._date,C)>0){var B=this._band.dateToPixelOffset(this._date); |
|
2081 |
var A=B-Math.round(this._width/2); |
|
2082 |
var D=this._timeline.getDocument(); |
|
2083 |
var F=D.createElement("div"); |
|
2084 |
F.className="timeline-highlight-point-decorator"; |
|
2085 |
F.className+=" "+this._cssClass; |
|
2086 |
if(this._opacity<100){SimileAjax.Graphics.setOpacity(F,this._opacity); |
|
2087 |
}this._layerDiv.appendChild(F); |
|
2088 |
if(this._timeline.isHorizontal()){F.style.left=A+"px"; |
|
2089 |
}else{F.style.top=A+"px"; |
|
2090 |
}}this._layerDiv.style.display="block"; |
|
2091 |
}; |
|
2092 |
Timeline.PointHighlightDecorator.prototype.softPaint=function(){}; |
|
2093 |
||
2094 |
||
2095 |
/* detailed-painter.js */ |
|
2096 |
Timeline.DetailedEventPainter=function(A){this._params=A; |
|
2097 |
this._onSelectListeners=[]; |
|
2098 |
this._filterMatcher=null; |
|
2099 |
this._highlightMatcher=null; |
|
2100 |
this._frc=null; |
|
2101 |
this._eventIdToElmt={}; |
|
2102 |
}; |
|
2103 |
Timeline.DetailedEventPainter.prototype.initialize=function(B,A){this._band=B; |
|
2104 |
this._timeline=A; |
|
2105 |
this._backLayer=null; |
|
2106 |
this._eventLayer=null; |
|
2107 |
this._lineLayer=null; |
|
2108 |
this._highlightLayer=null; |
|
2109 |
this._eventIdToElmt=null; |
|
2110 |
}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2111 |
Timeline.DetailedEventPainter.prototype.getType=function(){return"detailed"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2112 |
}; |
0 | 2113 |
Timeline.DetailedEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A); |
2114 |
}; |
|
2115 |
Timeline.DetailedEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0; |
|
2116 |
A<this._onSelectListeners.length; |
|
2117 |
A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1); |
|
2118 |
break; |
|
2119 |
}}}; |
|
2120 |
Timeline.DetailedEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher; |
|
2121 |
}; |
|
2122 |
Timeline.DetailedEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A; |
|
2123 |
}; |
|
2124 |
Timeline.DetailedEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher; |
|
2125 |
}; |
|
2126 |
Timeline.DetailedEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A; |
|
2127 |
}; |
|
2128 |
Timeline.DetailedEventPainter.prototype.paint=function(){var B=this._band.getEventSource(); |
|
2129 |
if(B==null){return ; |
|
2130 |
}this._eventIdToElmt={}; |
|
2131 |
this._prepareForPainting(); |
|
2132 |
var I=this._params.theme.event; |
|
2133 |
var G=Math.max(I.track.height,this._frc.getLineHeight()); |
|
2134 |
var F={trackOffset:Math.round(this._band.getViewWidth()/2-G/2),trackHeight:G,trackGap:I.track.gap,trackIncrement:G+I.track.gap,icon:I.instant.icon,iconWidth:I.instant.iconWidth,iconHeight:I.instant.iconHeight,labelWidth:I.label.width}; |
|
2135 |
var C=this._band.getMinDate(); |
|
2136 |
var A=this._band.getMaxDate(); |
|
2137 |
var J=(this._filterMatcher!=null)?this._filterMatcher:function(K){return true; |
|
2138 |
}; |
|
2139 |
var E=(this._highlightMatcher!=null)?this._highlightMatcher:function(K){return -1; |
|
2140 |
}; |
|
2141 |
var D=B.getEventReverseIterator(C,A); |
|
2142 |
while(D.hasNext()){var H=D.next(); |
|
2143 |
if(J(H)){this.paintEvent(H,F,this._params.theme,E(H)); |
|
2144 |
}}this._highlightLayer.style.display="block"; |
|
2145 |
this._lineLayer.style.display="block"; |
|
2146 |
this._eventLayer.style.display="block"; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2147 |
this._band.updateEventTrackInfo(this._lowerTracks.length+this._upperTracks.length,F.trackIncrement); |
0 | 2148 |
}; |
2149 |
Timeline.DetailedEventPainter.prototype.softPaint=function(){}; |
|
2150 |
Timeline.DetailedEventPainter.prototype._prepareForPainting=function(){var B=this._band; |
|
2151 |
if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events"); |
|
2152 |
this._backLayer.style.visibility="hidden"; |
|
2153 |
var A=document.createElement("span"); |
|
2154 |
A.className="timeline-event-label"; |
|
2155 |
this._backLayer.appendChild(A); |
|
2156 |
this._frc=SimileAjax.Graphics.getFontRenderingContext(A); |
|
2157 |
}this._frc.update(); |
|
2158 |
this._lowerTracks=[]; |
|
2159 |
this._upperTracks=[]; |
|
2160 |
if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer); |
|
2161 |
}this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights"); |
|
2162 |
this._highlightLayer.style.display="none"; |
|
2163 |
if(this._lineLayer!=null){B.removeLayerDiv(this._lineLayer); |
|
2164 |
}this._lineLayer=B.createLayerDiv(110,"timeline-band-lines"); |
|
2165 |
this._lineLayer.style.display="none"; |
|
2166 |
if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer); |
|
2167 |
}this._eventLayer=B.createLayerDiv(110,"timeline-band-events"); |
|
2168 |
this._eventLayer.style.display="none"; |
|
2169 |
}; |
|
2170 |
Timeline.DetailedEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A); |
|
2171 |
}else{this.paintDurationEvent(B,C,D,A); |
|
2172 |
}}; |
|
2173 |
Timeline.DetailedEventPainter.prototype.paintInstantEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseInstantEvent(B,C,D,A); |
|
2174 |
}else{this.paintPreciseInstantEvent(B,C,D,A); |
|
2175 |
}}; |
|
2176 |
Timeline.DetailedEventPainter.prototype.paintDurationEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseDurationEvent(B,C,D,A); |
|
2177 |
}else{this.paintPreciseDurationEvent(B,C,D,A); |
|
2178 |
}}; |
|
2179 |
Timeline.DetailedEventPainter.prototype.paintPreciseInstantEvent=function(K,N,Q,O){var S=this._timeline.getDocument(); |
|
2180 |
var J=K.getText(); |
|
2181 |
var E=K.getStart(); |
|
2182 |
var C=Math.round(this._band.dateToPixelOffset(E)); |
|
2183 |
var A=Math.round(C+N.iconWidth/2); |
|
2184 |
var I=Math.round(C-N.iconWidth/2); |
|
2185 |
var G=this._frc.computeSize(J); |
|
2186 |
var D=this._findFreeTrackForSolid(A,C); |
|
2187 |
var B=this._paintEventIcon(K,D,I,N,Q); |
|
2188 |
var T=A+Q.event.label.offsetFromLine; |
|
2189 |
var P=D; |
|
2190 |
var F=this._getTrackData(D); |
|
2191 |
if(Math.min(F.solid,F.text)>=T+G.width){F.solid=I; |
|
2192 |
F.text=T; |
|
2193 |
}else{F.solid=I; |
|
2194 |
T=C+Q.event.label.offsetFromLine; |
|
2195 |
P=this._findFreeTrackForText(D,T+G.width,function(U){U.line=C-2; |
|
2196 |
}); |
|
2197 |
this._getTrackData(P).text=I; |
|
2198 |
this._paintEventLine(K,C,D,P,N,Q); |
|
2199 |
}var R=Math.round(N.trackOffset+P*N.trackIncrement+N.trackHeight/2-G.height/2); |
|
2200 |
var M=this._paintEventLabel(K,J,T,R,G.width,G.height,Q); |
|
2201 |
var L=this; |
|
2202 |
var H=function(U,V,W){return L._onClickInstantEvent(B.elmt,V,K); |
|
2203 |
}; |
|
2204 |
SimileAjax.DOM.registerEvent(B.elmt,"mousedown",H); |
|
2205 |
SimileAjax.DOM.registerEvent(M.elmt,"mousedown",H); |
|
2206 |
this._createHighlightDiv(O,B,Q); |
|
2207 |
this._eventIdToElmt[K.getID()]=B.elmt; |
|
2208 |
}; |
|
2209 |
Timeline.DetailedEventPainter.prototype.paintImpreciseInstantEvent=function(N,Q,V,R){var X=this._timeline.getDocument(); |
|
2210 |
var M=N.getText(); |
|
2211 |
var H=N.getStart(); |
|
2212 |
var S=N.getEnd(); |
|
2213 |
var E=Math.round(this._band.dateToPixelOffset(H)); |
|
2214 |
var B=Math.round(this._band.dateToPixelOffset(S)); |
|
2215 |
var A=Math.round(E+Q.iconWidth/2); |
|
2216 |
var L=Math.round(E-Q.iconWidth/2); |
|
2217 |
var J=this._frc.computeSize(M); |
|
2218 |
var F=this._findFreeTrackForSolid(B,E); |
|
2219 |
var G=this._paintEventTape(N,F,E,B,V.event.instant.impreciseColor,V.event.instant.impreciseOpacity,Q,V); |
|
2220 |
var C=this._paintEventIcon(N,F,L,Q,V); |
|
2221 |
var I=this._getTrackData(F); |
|
2222 |
I.solid=L; |
|
2223 |
var W=A+V.event.label.offsetFromLine; |
|
2224 |
var D=W+J.width; |
|
2225 |
var T; |
|
2226 |
if(D<B){T=F; |
|
2227 |
}else{W=E+V.event.label.offsetFromLine; |
|
2228 |
D=W+J.width; |
|
2229 |
T=this._findFreeTrackForText(F,D,function(Y){Y.line=E-2; |
|
2230 |
}); |
|
2231 |
this._getTrackData(T).text=L; |
|
2232 |
this._paintEventLine(N,E,F,T,Q,V); |
|
2233 |
}var U=Math.round(Q.trackOffset+T*Q.trackIncrement+Q.trackHeight/2-J.height/2); |
|
2234 |
var P=this._paintEventLabel(N,M,W,U,J.width,J.height,V); |
|
2235 |
var O=this; |
|
2236 |
var K=function(Y,Z,a){return O._onClickInstantEvent(C.elmt,Z,N); |
|
2237 |
}; |
|
2238 |
SimileAjax.DOM.registerEvent(C.elmt,"mousedown",K); |
|
2239 |
SimileAjax.DOM.registerEvent(G.elmt,"mousedown",K); |
|
2240 |
SimileAjax.DOM.registerEvent(P.elmt,"mousedown",K); |
|
2241 |
this._createHighlightDiv(R,C,V); |
|
2242 |
this._eventIdToElmt[N.getID()]=C.elmt; |
|
2243 |
}; |
|
2244 |
Timeline.DetailedEventPainter.prototype.paintPreciseDurationEvent=function(J,M,S,O){var T=this._timeline.getDocument(); |
|
2245 |
var I=J.getText(); |
|
2246 |
var D=J.getStart(); |
|
2247 |
var P=J.getEnd(); |
|
2248 |
var B=Math.round(this._band.dateToPixelOffset(D)); |
|
2249 |
var A=Math.round(this._band.dateToPixelOffset(P)); |
|
2250 |
var F=this._frc.computeSize(I); |
|
2251 |
var E=this._findFreeTrackForSolid(A); |
|
2252 |
var N=J.getColor(); |
|
2253 |
N=N!=null?N:S.event.duration.color; |
|
2254 |
var C=this._paintEventTape(J,E,B,A,N,100,M,S); |
|
2255 |
var H=this._getTrackData(E); |
|
2256 |
H.solid=B; |
|
2257 |
var U=B+S.event.label.offsetFromLine; |
|
2258 |
var Q=this._findFreeTrackForText(E,U+F.width,function(V){V.line=B-2; |
|
2259 |
}); |
|
2260 |
this._getTrackData(Q).text=B-2; |
|
2261 |
this._paintEventLine(J,B,E,Q,M,S); |
|
2262 |
var R=Math.round(M.trackOffset+Q*M.trackIncrement+M.trackHeight/2-F.height/2); |
|
2263 |
var L=this._paintEventLabel(J,I,U,R,F.width,F.height,S); |
|
2264 |
var K=this; |
|
2265 |
var G=function(V,W,X){return K._onClickDurationEvent(C.elmt,W,J); |
|
2266 |
}; |
|
2267 |
SimileAjax.DOM.registerEvent(C.elmt,"mousedown",G); |
|
2268 |
SimileAjax.DOM.registerEvent(L.elmt,"mousedown",G); |
|
2269 |
this._createHighlightDiv(O,C,S); |
|
2270 |
this._eventIdToElmt[J.getID()]=C.elmt; |
|
2271 |
}; |
|
2272 |
Timeline.DetailedEventPainter.prototype.paintImpreciseDurationEvent=function(L,P,W,S){var Z=this._timeline.getDocument(); |
|
2273 |
var K=L.getText(); |
|
2274 |
var D=L.getStart(); |
|
2275 |
var Q=L.getLatestStart(); |
|
2276 |
var T=L.getEnd(); |
|
2277 |
var X=L.getEarliestEnd(); |
|
2278 |
var B=Math.round(this._band.dateToPixelOffset(D)); |
|
2279 |
var F=Math.round(this._band.dateToPixelOffset(Q)); |
|
2280 |
var A=Math.round(this._band.dateToPixelOffset(T)); |
|
2281 |
var G=Math.round(this._band.dateToPixelOffset(X)); |
|
2282 |
var H=this._frc.computeSize(K); |
|
2283 |
var E=this._findFreeTrackForSolid(A); |
|
2284 |
var R=L.getColor(); |
|
2285 |
R=R!=null?R:W.event.duration.color; |
|
2286 |
var O=this._paintEventTape(L,E,B,A,W.event.duration.impreciseColor,W.event.duration.impreciseOpacity,P,W); |
|
2287 |
var C=this._paintEventTape(L,E,F,G,R,100,P,W); |
|
2288 |
var J=this._getTrackData(E); |
|
2289 |
J.solid=B; |
|
2290 |
var Y=F+W.event.label.offsetFromLine; |
|
2291 |
var U=this._findFreeTrackForText(E,Y+H.width,function(a){a.line=F-2; |
|
2292 |
}); |
|
2293 |
this._getTrackData(U).text=F-2; |
|
2294 |
this._paintEventLine(L,F,E,U,P,W); |
|
2295 |
var V=Math.round(P.trackOffset+U*P.trackIncrement+P.trackHeight/2-H.height/2); |
|
2296 |
var N=this._paintEventLabel(L,K,Y,V,H.width,H.height,W); |
|
2297 |
var M=this; |
|
2298 |
var I=function(a,b,c){return M._onClickDurationEvent(C.elmt,b,L); |
|
2299 |
}; |
|
2300 |
SimileAjax.DOM.registerEvent(C.elmt,"mousedown",I); |
|
2301 |
SimileAjax.DOM.registerEvent(N.elmt,"mousedown",I); |
|
2302 |
this._createHighlightDiv(S,C,W); |
|
2303 |
this._eventIdToElmt[L.getID()]=C.elmt; |
|
2304 |
}; |
|
2305 |
Timeline.DetailedEventPainter.prototype._findFreeTrackForSolid=function(B,A){for(var D=0; |
|
2306 |
true; |
|
2307 |
D++){if(D<this._lowerTracks.length){var C=this._lowerTracks[D]; |
|
2308 |
if(Math.min(C.solid,C.text)>B&&(!(A)||C.line>A)){return D; |
|
2309 |
}}else{this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY}); |
|
2310 |
return D; |
|
2311 |
}if(D<this._upperTracks.length){var C=this._upperTracks[D]; |
|
2312 |
if(Math.min(C.solid,C.text)>B&&(!(A)||C.line>A)){return -1-D; |
|
2313 |
}}else{this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY}); |
|
2314 |
return -1-D; |
|
2315 |
}}}; |
|
2316 |
Timeline.DetailedEventPainter.prototype._findFreeTrackForText=function(D,C,H){var F; |
|
2317 |
var G; |
|
2318 |
var B; |
|
2319 |
var J; |
|
2320 |
if(D<0){F=true; |
|
2321 |
B=-D; |
|
2322 |
G=this._findFreeUpperTrackForText(B,C); |
|
2323 |
J=-1-G; |
|
2324 |
}else{if(D>0){F=false; |
|
2325 |
B=D+1; |
|
2326 |
G=this._findFreeLowerTrackForText(B,C); |
|
2327 |
J=G; |
|
2328 |
}else{var A=this._findFreeUpperTrackForText(0,C); |
|
2329 |
var I=this._findFreeLowerTrackForText(1,C); |
|
2330 |
if(I-1<=A){F=false; |
|
2331 |
B=1; |
|
2332 |
G=I; |
|
2333 |
J=G; |
|
2334 |
}else{F=true; |
|
2335 |
B=0; |
|
2336 |
G=A; |
|
2337 |
J=-1-G; |
|
2338 |
}}}if(F){if(G==this._upperTracks.length){this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY}); |
|
2339 |
}for(var E=B; |
|
2340 |
E<G; |
|
2341 |
E++){H(this._upperTracks[E]); |
|
2342 |
}}else{if(G==this._lowerTracks.length){this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY}); |
|
2343 |
}for(var E=B; |
|
2344 |
E<G; |
|
2345 |
E++){H(this._lowerTracks[E]); |
|
2346 |
}}return J; |
|
2347 |
}; |
|
2348 |
Timeline.DetailedEventPainter.prototype._findFreeLowerTrackForText=function(A,C){for(; |
|
2349 |
A<this._lowerTracks.length; |
|
2350 |
A++){var B=this._lowerTracks[A]; |
|
2351 |
if(Math.min(B.solid,B.text)>=C){break; |
|
2352 |
}}return A; |
|
2353 |
}; |
|
2354 |
Timeline.DetailedEventPainter.prototype._findFreeUpperTrackForText=function(A,C){for(; |
|
2355 |
A<this._upperTracks.length; |
|
2356 |
A++){var B=this._upperTracks[A]; |
|
2357 |
if(Math.min(B.solid,B.text)>=C){break; |
|
2358 |
}}return A; |
|
2359 |
}; |
|
2360 |
Timeline.DetailedEventPainter.prototype._getTrackData=function(A){return(A<0)?this._upperTracks[-A-1]:this._lowerTracks[A]; |
|
2361 |
}; |
|
2362 |
Timeline.DetailedEventPainter.prototype._paintEventLine=function(I,C,F,A,G,D){var H=Math.round(G.trackOffset+F*G.trackIncrement+G.trackHeight/2); |
|
2363 |
var J=Math.round(Math.abs(A-F)*G.trackIncrement); |
|
2364 |
var E="1px solid "+D.event.label.lineColor; |
|
2365 |
var B=this._timeline.getDocument().createElement("div"); |
|
2366 |
B.style.position="absolute"; |
|
2367 |
B.style.left=C+"px"; |
|
2368 |
B.style.width=D.event.label.offsetFromLine+"px"; |
|
2369 |
B.style.height=J+"px"; |
|
2370 |
if(F>A){B.style.top=(H-J)+"px"; |
|
2371 |
B.style.borderTop=E; |
|
2372 |
}else{B.style.top=H+"px"; |
|
2373 |
B.style.borderBottom=E; |
|
2374 |
}B.style.borderLeft=E; |
|
2375 |
this._lineLayer.appendChild(B); |
|
2376 |
}; |
|
2377 |
Timeline.DetailedEventPainter.prototype._paintEventIcon=function(I,E,B,F,D){var H=I.getIcon(); |
|
2378 |
H=H!=null?H:F.icon; |
|
2379 |
var J=F.trackOffset+E*F.trackIncrement+F.trackHeight/2; |
|
2380 |
var G=Math.round(J-F.iconHeight/2); |
|
2381 |
var C=SimileAjax.Graphics.createTranslucentImage(H); |
|
2382 |
var A=this._timeline.getDocument().createElement("div"); |
|
2383 |
A.style.position="absolute"; |
|
2384 |
A.style.left=B+"px"; |
|
2385 |
A.style.top=G+"px"; |
|
2386 |
A.appendChild(C); |
|
2387 |
A.style.cursor="pointer"; |
|
2388 |
if(I._title!=null){A.title=I._title; |
|
2389 |
}this._eventLayer.appendChild(A); |
|
2390 |
return{left:B,top:G,width:F.iconWidth,height:F.iconHeight,elmt:A}; |
|
2391 |
}; |
|
2392 |
Timeline.DetailedEventPainter.prototype._paintEventLabel=function(H,I,B,F,A,J,D){var G=this._timeline.getDocument(); |
|
2393 |
var K=G.createElement("div"); |
|
2394 |
K.style.position="absolute"; |
|
2395 |
K.style.left=B+"px"; |
|
2396 |
K.style.width=A+"px"; |
|
2397 |
K.style.top=F+"px"; |
|
2398 |
K.style.height=J+"px"; |
|
2399 |
K.style.backgroundColor=D.event.label.backgroundColor; |
|
2400 |
SimileAjax.Graphics.setOpacity(K,D.event.label.backgroundOpacity); |
|
2401 |
this._eventLayer.appendChild(K); |
|
2402 |
var E=G.createElement("div"); |
|
2403 |
E.style.position="absolute"; |
|
2404 |
E.style.left=B+"px"; |
|
2405 |
E.style.width=A+"px"; |
|
2406 |
E.style.top=F+"px"; |
|
2407 |
E.innerHTML=I; |
|
2408 |
E.style.cursor="pointer"; |
|
2409 |
if(H._title!=null){E.title=H._title; |
|
2410 |
}var C=H.getTextColor(); |
|
2411 |
if(C==null){C=H.getColor(); |
|
2412 |
}if(C!=null){E.style.color=C; |
|
2413 |
}this._eventLayer.appendChild(E); |
|
2414 |
return{left:B,top:F,width:A,height:J,elmt:E}; |
|
2415 |
}; |
|
2416 |
Timeline.DetailedEventPainter.prototype._paintEventTape=function(L,H,E,A,C,G,I,F){var B=A-E; |
|
2417 |
var D=F.event.tape.height; |
|
2418 |
var M=I.trackOffset+H*I.trackIncrement+I.trackHeight/2; |
|
2419 |
var J=Math.round(M-D/2); |
|
2420 |
var K=this._timeline.getDocument().createElement("div"); |
|
2421 |
K.style.position="absolute"; |
|
2422 |
K.style.left=E+"px"; |
|
2423 |
K.style.width=B+"px"; |
|
2424 |
K.style.top=J+"px"; |
|
2425 |
K.style.height=D+"px"; |
|
2426 |
K.style.backgroundColor=C; |
|
2427 |
K.style.overflow="hidden"; |
|
2428 |
K.style.cursor="pointer"; |
|
2429 |
if(L._title!=null){K.title=L._title; |
|
2430 |
}SimileAjax.Graphics.setOpacity(K,G); |
|
2431 |
this._eventLayer.appendChild(K); |
|
2432 |
return{left:E,top:J,width:B,height:D,elmt:K}; |
|
2433 |
}; |
|
2434 |
Timeline.DetailedEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument(); |
|
2435 |
var G=E.event; |
|
2436 |
var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)]; |
|
2437 |
var F=D.createElement("div"); |
|
2438 |
F.style.position="absolute"; |
|
2439 |
F.style.overflow="hidden"; |
|
2440 |
F.style.left=(C.left-2)+"px"; |
|
2441 |
F.style.width=(C.width+4)+"px"; |
|
2442 |
F.style.top=(C.top-2)+"px"; |
|
2443 |
F.style.height=(C.height+4)+"px"; |
|
2444 |
F.style.background=B; |
|
2445 |
this._highlightLayer.appendChild(F); |
|
2446 |
}}; |
|
2447 |
Timeline.DetailedEventPainter.prototype._onClickInstantEvent=function(B,C,A){var D=SimileAjax.DOM.getPageCoordinates(B); |
|
2448 |
this._showBubble(D.left+Math.ceil(B.offsetWidth/2),D.top+Math.ceil(B.offsetHeight/2),A); |
|
2449 |
this._fireOnSelect(A.getID()); |
|
2450 |
C.cancelBubble=true; |
|
2451 |
SimileAjax.DOM.cancelEvent(C); |
|
2452 |
return false; |
|
2453 |
}; |
|
2454 |
Timeline.DetailedEventPainter.prototype._onClickDurationEvent=function(D,C,B){if("pageX" in C){var A=C.pageX; |
|
2455 |
var F=C.pageY; |
|
2456 |
}else{var E=SimileAjax.DOM.getPageCoordinates(D); |
|
2457 |
var A=C.offsetX+E.left; |
|
2458 |
var F=C.offsetY+E.top; |
|
2459 |
}this._showBubble(A,F,B); |
|
2460 |
this._fireOnSelect(B.getID()); |
|
2461 |
C.cancelBubble=true; |
|
2462 |
SimileAjax.DOM.cancelEvent(C); |
|
2463 |
return false; |
|
2464 |
}; |
|
2465 |
Timeline.DetailedEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()]; |
|
2466 |
if(B){var C=SimileAjax.DOM.getPageCoordinates(B); |
|
2467 |
this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,A); |
|
2468 |
}}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2469 |
Timeline.DetailedEventPainter.prototype._showBubble=function(A,E,B){var D=document.createElement("div"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2470 |
var C=this._params.theme.event.bubble; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2471 |
B.fillInfoBubble(D,this._params.theme,this._band.getLabeller()); |
0 | 2472 |
SimileAjax.WindowManager.cancelPopups(); |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2473 |
SimileAjax.Graphics.createBubbleForContentAndPoint(D,A,E,C.width,null,C.maxHeight); |
0 | 2474 |
}; |
2475 |
Timeline.DetailedEventPainter.prototype._fireOnSelect=function(B){for(var A=0; |
|
2476 |
A<this._onSelectListeners.length; |
|
2477 |
A++){this._onSelectListeners[A](B); |
|
2478 |
}}; |
|
2479 |
||
2480 |
||
2481 |
/* ether-painters.js */ |
|
2482 |
Timeline.GregorianEtherPainter=function(A){this._params=A; |
|
2483 |
this._theme=A.theme; |
|
2484 |
this._unit=A.unit; |
|
2485 |
this._multiple=("multiple" in A)?A.multiple:1; |
|
2486 |
}; |
|
2487 |
Timeline.GregorianEtherPainter.prototype.initialize=function(C,B){this._band=C; |
|
2488 |
this._timeline=B; |
|
2489 |
this._backgroundLayer=C.createLayerDiv(0); |
|
2490 |
this._backgroundLayer.setAttribute("name","ether-background"); |
|
2491 |
this._backgroundLayer.className="timeline-ether-bg"; |
|
2492 |
this._markerLayer=null; |
|
2493 |
this._lineLayer=null; |
|
2494 |
var D=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"]; |
|
2495 |
var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show; |
|
2496 |
this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A); |
|
2497 |
this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer); |
|
2498 |
}; |
|
2499 |
Timeline.GregorianEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B); |
|
2500 |
}; |
|
2501 |
Timeline.GregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer); |
|
2502 |
}this._markerLayer=this._band.createLayerDiv(100); |
|
2503 |
this._markerLayer.setAttribute("name","ether-markers"); |
|
2504 |
this._markerLayer.style.display="none"; |
|
2505 |
if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer); |
|
2506 |
}this._lineLayer=this._band.createLayerDiv(1); |
|
2507 |
this._lineLayer.setAttribute("name","ether-lines"); |
|
2508 |
this._lineLayer.style.display="none"; |
|
2509 |
var C=this._band.getMinDate(); |
|
2510 |
var F=this._band.getMaxDate(); |
|
2511 |
var B=this._band.getTimeZone(); |
|
2512 |
var E=this._band.getLabeller(); |
|
2513 |
SimileAjax.DateTime.roundDownToInterval(C,this._unit,B,this._multiple,this._theme.firstDayOfWeek); |
|
2514 |
var D=this; |
|
2515 |
var A=function(G){for(var H=0; |
|
2516 |
H<D._multiple; |
|
2517 |
H++){SimileAjax.DateTime.incrementByInterval(G,D._unit); |
|
2518 |
}}; |
|
2519 |
while(C.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(C,E,this._unit,this._markerLayer,this._lineLayer); |
|
2520 |
A(C); |
|
2521 |
}this._markerLayer.style.display="block"; |
|
2522 |
this._lineLayer.style.display="block"; |
|
2523 |
}; |
|
2524 |
Timeline.GregorianEtherPainter.prototype.softPaint=function(){}; |
|
2525 |
Timeline.GregorianEtherPainter.prototype.zoom=function(A){if(A!=0){this._unit+=A; |
|
2526 |
}}; |
|
2527 |
Timeline.HotZoneGregorianEtherPainter=function(G){this._params=G; |
|
2528 |
this._theme=G.theme; |
|
2529 |
this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,unit:G.unit,multiple:1}]; |
|
2530 |
for(var E=0; |
|
2531 |
E<G.zones.length; |
|
2532 |
E++){var B=G.zones[E]; |
|
2533 |
var D=SimileAjax.DateTime.parseGregorianDateTime(B.start).getTime(); |
|
2534 |
var F=SimileAjax.DateTime.parseGregorianDateTime(B.end).getTime(); |
|
2535 |
for(var C=0; |
|
2536 |
C<this._zones.length&&F>D; |
|
2537 |
C++){var A=this._zones[C]; |
|
2538 |
if(D<A.endTime){if(D>A.startTime){this._zones.splice(C,0,{startTime:A.startTime,endTime:D,unit:A.unit,multiple:A.multiple}); |
|
2539 |
C++; |
|
2540 |
A.startTime=D; |
|
2541 |
}if(F<A.endTime){this._zones.splice(C,0,{startTime:D,endTime:F,unit:B.unit,multiple:(B.multiple)?B.multiple:1}); |
|
2542 |
C++; |
|
2543 |
A.startTime=F; |
|
2544 |
D=F; |
|
2545 |
}else{A.multiple=B.multiple; |
|
2546 |
A.unit=B.unit; |
|
2547 |
D=A.endTime; |
|
2548 |
}}}}}; |
|
2549 |
Timeline.HotZoneGregorianEtherPainter.prototype.initialize=function(C,B){this._band=C; |
|
2550 |
this._timeline=B; |
|
2551 |
this._backgroundLayer=C.createLayerDiv(0); |
|
2552 |
this._backgroundLayer.setAttribute("name","ether-background"); |
|
2553 |
this._backgroundLayer.className="timeline-ether-bg"; |
|
2554 |
this._markerLayer=null; |
|
2555 |
this._lineLayer=null; |
|
2556 |
var D=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"]; |
|
2557 |
var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show; |
|
2558 |
this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A); |
|
2559 |
this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer); |
|
2560 |
}; |
|
2561 |
Timeline.HotZoneGregorianEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B); |
|
2562 |
}; |
|
2563 |
Timeline.HotZoneGregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer); |
|
2564 |
}this._markerLayer=this._band.createLayerDiv(100); |
|
2565 |
this._markerLayer.setAttribute("name","ether-markers"); |
|
2566 |
this._markerLayer.style.display="none"; |
|
2567 |
if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer); |
|
2568 |
}this._lineLayer=this._band.createLayerDiv(1); |
|
2569 |
this._lineLayer.setAttribute("name","ether-lines"); |
|
2570 |
this._lineLayer.style.display="none"; |
|
2571 |
var D=this._band.getMinDate(); |
|
2572 |
var A=this._band.getMaxDate(); |
|
2573 |
var K=this._band.getTimeZone(); |
|
2574 |
var I=this._band.getLabeller(); |
|
2575 |
var B=this; |
|
2576 |
var L=function(N,M){for(var O=0; |
|
2577 |
O<M.multiple; |
|
2578 |
O++){SimileAjax.DateTime.incrementByInterval(N,M.unit); |
|
2579 |
}}; |
|
2580 |
var C=0; |
|
2581 |
while(C<this._zones.length){if(D.getTime()<this._zones[C].endTime){break; |
|
2582 |
}C++; |
|
2583 |
}var E=this._zones.length-1; |
|
2584 |
while(E>=0){if(A.getTime()>this._zones[E].startTime){break; |
|
2585 |
}E--; |
|
2586 |
}for(var H=C; |
|
2587 |
H<=E; |
|
2588 |
H++){var G=this._zones[H]; |
|
2589 |
var J=new Date(Math.max(D.getTime(),G.startTime)); |
|
2590 |
var F=new Date(Math.min(A.getTime(),G.endTime)); |
|
2591 |
SimileAjax.DateTime.roundDownToInterval(J,G.unit,K,G.multiple,this._theme.firstDayOfWeek); |
|
2592 |
SimileAjax.DateTime.roundUpToInterval(F,G.unit,K,G.multiple,this._theme.firstDayOfWeek); |
|
2593 |
while(J.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(J,I,G.unit,this._markerLayer,this._lineLayer); |
|
2594 |
L(J,G); |
|
2595 |
}}this._markerLayer.style.display="block"; |
|
2596 |
this._lineLayer.style.display="block"; |
|
2597 |
}; |
|
2598 |
Timeline.HotZoneGregorianEtherPainter.prototype.softPaint=function(){}; |
|
2599 |
Timeline.HotZoneGregorianEtherPainter.prototype.zoom=function(B){if(B!=0){for(var A=0; |
|
2600 |
A<this._zones.length; |
|
2601 |
++A){if(this._zones[A]){this._zones[A].unit+=B; |
|
2602 |
}}}}; |
|
2603 |
Timeline.YearCountEtherPainter=function(A){this._params=A; |
|
2604 |
this._theme=A.theme; |
|
2605 |
this._startDate=SimileAjax.DateTime.parseGregorianDateTime(A.startDate); |
|
2606 |
this._multiple=("multiple" in A)?A.multiple:1; |
|
2607 |
}; |
|
2608 |
Timeline.YearCountEtherPainter.prototype.initialize=function(C,B){this._band=C; |
|
2609 |
this._timeline=B; |
|
2610 |
this._backgroundLayer=C.createLayerDiv(0); |
|
2611 |
this._backgroundLayer.setAttribute("name","ether-background"); |
|
2612 |
this._backgroundLayer.className="timeline-ether-bg"; |
|
2613 |
this._markerLayer=null; |
|
2614 |
this._lineLayer=null; |
|
2615 |
var D=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"]; |
|
2616 |
var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show; |
|
2617 |
this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A); |
|
2618 |
this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer); |
|
2619 |
}; |
|
2620 |
Timeline.YearCountEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B); |
|
2621 |
}; |
|
2622 |
Timeline.YearCountEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer); |
|
2623 |
}this._markerLayer=this._band.createLayerDiv(100); |
|
2624 |
this._markerLayer.setAttribute("name","ether-markers"); |
|
2625 |
this._markerLayer.style.display="none"; |
|
2626 |
if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer); |
|
2627 |
}this._lineLayer=this._band.createLayerDiv(1); |
|
2628 |
this._lineLayer.setAttribute("name","ether-lines"); |
|
2629 |
this._lineLayer.style.display="none"; |
|
2630 |
var B=new Date(this._startDate.getTime()); |
|
2631 |
var F=this._band.getMaxDate(); |
|
2632 |
var E=this._band.getMinDate().getUTCFullYear()-this._startDate.getUTCFullYear(); |
|
2633 |
B.setUTCFullYear(this._band.getMinDate().getUTCFullYear()-E%this._multiple); |
|
2634 |
var C=this; |
|
2635 |
var A=function(G){for(var H=0; |
|
2636 |
H<C._multiple; |
|
2637 |
H++){SimileAjax.DateTime.incrementByInterval(G,SimileAjax.DateTime.YEAR); |
|
2638 |
}}; |
|
2639 |
var D={labelInterval:function(G,I){var H=G.getUTCFullYear()-C._startDate.getUTCFullYear(); |
|
2640 |
return{text:H,emphasized:H==0}; |
|
2641 |
}}; |
|
2642 |
while(B.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(B,D,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer); |
|
2643 |
A(B); |
|
2644 |
}this._markerLayer.style.display="block"; |
|
2645 |
this._lineLayer.style.display="block"; |
|
2646 |
}; |
|
2647 |
Timeline.YearCountEtherPainter.prototype.softPaint=function(){}; |
|
2648 |
Timeline.QuarterlyEtherPainter=function(A){this._params=A; |
|
2649 |
this._theme=A.theme; |
|
2650 |
this._startDate=SimileAjax.DateTime.parseGregorianDateTime(A.startDate); |
|
2651 |
}; |
|
2652 |
Timeline.QuarterlyEtherPainter.prototype.initialize=function(C,B){this._band=C; |
|
2653 |
this._timeline=B; |
|
2654 |
this._backgroundLayer=C.createLayerDiv(0); |
|
2655 |
this._backgroundLayer.setAttribute("name","ether-background"); |
|
2656 |
this._backgroundLayer.className="timeline-ether-bg"; |
|
2657 |
this._markerLayer=null; |
|
2658 |
this._lineLayer=null; |
|
2659 |
var D=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"]; |
|
2660 |
var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show; |
|
2661 |
this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A); |
|
2662 |
this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer); |
|
2663 |
}; |
|
2664 |
Timeline.QuarterlyEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B); |
|
2665 |
}; |
|
2666 |
Timeline.QuarterlyEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer); |
|
2667 |
}this._markerLayer=this._band.createLayerDiv(100); |
|
2668 |
this._markerLayer.setAttribute("name","ether-markers"); |
|
2669 |
this._markerLayer.style.display="none"; |
|
2670 |
if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer); |
|
2671 |
}this._lineLayer=this._band.createLayerDiv(1); |
|
2672 |
this._lineLayer.setAttribute("name","ether-lines"); |
|
2673 |
this._lineLayer.style.display="none"; |
|
2674 |
var B=new Date(0); |
|
2675 |
var E=this._band.getMaxDate(); |
|
2676 |
B.setUTCFullYear(Math.max(this._startDate.getUTCFullYear(),this._band.getMinDate().getUTCFullYear())); |
|
2677 |
B.setUTCMonth(this._startDate.getUTCMonth()); |
|
2678 |
var C=this; |
|
2679 |
var A=function(F){F.setUTCMonth(F.getUTCMonth()+3); |
|
2680 |
}; |
|
2681 |
var D={labelInterval:function(F,H){var G=(4+(F.getUTCMonth()-C._startDate.getUTCMonth())/3)%4; |
|
2682 |
if(G!=0){return{text:"Q"+(G+1),emphasized:false}; |
|
2683 |
}else{return{text:"Y"+(F.getUTCFullYear()-C._startDate.getUTCFullYear()+1),emphasized:true}; |
|
2684 |
}}}; |
|
2685 |
while(B.getTime()<E.getTime()){this._intervalMarkerLayout.createIntervalMarker(B,D,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer); |
|
2686 |
A(B); |
|
2687 |
}this._markerLayer.style.display="block"; |
|
2688 |
this._lineLayer.style.display="block"; |
|
2689 |
}; |
|
2690 |
Timeline.QuarterlyEtherPainter.prototype.softPaint=function(){}; |
|
2691 |
Timeline.EtherIntervalMarkerLayout=function(M,L,C,E,H){var A=M.isHorizontal(); |
|
2692 |
if(A){if(E=="Top"){this.positionDiv=function(O,N){O.style.left=N+"px"; |
|
2693 |
O.style.top="0px"; |
|
2694 |
}; |
|
2695 |
}else{this.positionDiv=function(O,N){O.style.left=N+"px"; |
|
2696 |
O.style.bottom="0px"; |
|
2697 |
}; |
|
2698 |
}}else{if(E=="Left"){this.positionDiv=function(O,N){O.style.top=N+"px"; |
|
2699 |
O.style.left="0px"; |
|
2700 |
}; |
|
2701 |
}else{this.positionDiv=function(O,N){O.style.top=N+"px"; |
|
2702 |
O.style.right="0px"; |
|
2703 |
}; |
|
2704 |
}}var D=C.ether.interval.marker; |
|
2705 |
var I=C.ether.interval.line; |
|
2706 |
var B=C.ether.interval.weekend; |
|
2707 |
var K=(A?"h":"v")+E; |
|
2708 |
var G=D[K+"Styler"]; |
|
2709 |
var J=D[K+"EmphasizedStyler"]; |
|
2710 |
var F=SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY]; |
|
2711 |
this.createIntervalMarker=function(T,a,b,c,Q){var U=Math.round(L.dateToPixelOffset(T)); |
|
2712 |
if(H&&b!=SimileAjax.DateTime.WEEK){var V=M.getDocument().createElement("div"); |
|
2713 |
V.className="timeline-ether-lines"; |
|
2714 |
if(I.opacity<100){SimileAjax.Graphics.setOpacity(V,I.opacity); |
|
2715 |
}if(A){V.style.left=U+"px"; |
|
2716 |
}else{V.style.top=U+"px"; |
|
2717 |
}Q.appendChild(V); |
|
2718 |
}if(b==SimileAjax.DateTime.WEEK){var N=C.firstDayOfWeek; |
|
2719 |
var W=new Date(T.getTime()+(6-N-7)*F); |
|
2720 |
var Z=new Date(W.getTime()+2*F); |
|
2721 |
var X=Math.round(L.dateToPixelOffset(W)); |
|
2722 |
var S=Math.round(L.dateToPixelOffset(Z)); |
|
2723 |
var R=Math.max(1,S-X); |
|
2724 |
var P=M.getDocument().createElement("div"); |
|
2725 |
P.className="timeline-ether-weekends"; |
|
2726 |
if(B.opacity<100){SimileAjax.Graphics.setOpacity(P,B.opacity); |
|
2727 |
}if(A){P.style.left=X+"px"; |
|
2728 |
P.style.width=R+"px"; |
|
2729 |
}else{P.style.top=X+"px"; |
|
2730 |
P.style.height=R+"px"; |
|
2731 |
}Q.appendChild(P); |
|
2732 |
}var Y=a.labelInterval(T,b); |
|
2733 |
var O=M.getDocument().createElement("div"); |
|
2734 |
O.innerHTML=Y.text; |
|
2735 |
O.className="timeline-date-label"; |
|
2736 |
if(Y.emphasized){O.className+=" timeline-date-label-em"; |
|
2737 |
}this.positionDiv(O,U); |
|
2738 |
c.appendChild(O); |
|
2739 |
return O; |
|
2740 |
}; |
|
2741 |
}; |
|
2742 |
Timeline.EtherHighlight=function(C,E,D,B){var A=C.isHorizontal(); |
|
2743 |
this._highlightDiv=null; |
|
2744 |
this._createHighlightDiv=function(){if(this._highlightDiv==null){this._highlightDiv=C.getDocument().createElement("div"); |
|
2745 |
this._highlightDiv.setAttribute("name","ether-highlight"); |
|
2746 |
this._highlightDiv.className="timeline-ether-highlight"; |
|
2747 |
var F=D.ether.highlightOpacity; |
|
2748 |
if(F<100){SimileAjax.Graphics.setOpacity(this._highlightDiv,F); |
|
2749 |
}B.appendChild(this._highlightDiv); |
|
2750 |
}}; |
|
2751 |
this.position=function(F,I){this._createHighlightDiv(); |
|
2752 |
var J=Math.round(E.dateToPixelOffset(F)); |
|
2753 |
var H=Math.round(E.dateToPixelOffset(I)); |
|
2754 |
var G=Math.max(H-J,3); |
|
2755 |
if(A){this._highlightDiv.style.left=J+"px"; |
|
2756 |
this._highlightDiv.style.width=G+"px"; |
|
2757 |
this._highlightDiv.style.height=(E.getViewWidth()-4)+"px"; |
|
2758 |
}else{this._highlightDiv.style.top=J+"px"; |
|
2759 |
this._highlightDiv.style.height=G+"px"; |
|
2760 |
this._highlightDiv.style.width=(E.getViewWidth()-4)+"px"; |
|
2761 |
}}; |
|
2762 |
}; |
|
2763 |
||
2764 |
||
2765 |
/* ethers.js */ |
|
2766 |
Timeline.LinearEther=function(A){this._params=A; |
|
2767 |
this._interval=A.interval; |
|
2768 |
this._pixelsPerInterval=A.pixelsPerInterval; |
|
2769 |
}; |
|
2770 |
Timeline.LinearEther.prototype.initialize=function(B,A){this._band=B; |
|
2771 |
this._timeline=A; |
|
2772 |
this._unit=A.getUnit(); |
|
2773 |
if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn); |
|
2774 |
}else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn); |
|
2775 |
this.shiftPixels(-this._timeline.getPixelLength()); |
|
2776 |
}else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn); |
|
2777 |
this.shiftPixels(-this._timeline.getPixelLength()/2); |
|
2778 |
}else{this._start=this._unit.makeDefaultValue(); |
|
2779 |
this.shiftPixels(-this._timeline.getPixelLength()/2); |
|
2780 |
}}}}; |
|
2781 |
Timeline.LinearEther.prototype.setDate=function(A){this._start=this._unit.cloneValue(A); |
|
2782 |
}; |
|
2783 |
Timeline.LinearEther.prototype.shiftPixels=function(B){var A=this._interval*B/this._pixelsPerInterval; |
|
2784 |
this._start=this._unit.change(this._start,A); |
|
2785 |
}; |
|
2786 |
Timeline.LinearEther.prototype.dateToPixelOffset=function(A){var B=this._unit.compare(A,this._start); |
|
2787 |
return this._pixelsPerInterval*B/this._interval; |
|
2788 |
}; |
|
2789 |
Timeline.LinearEther.prototype.pixelOffsetToDate=function(B){var A=B*this._interval/this._pixelsPerInterval; |
|
2790 |
return this._unit.change(this._start,A); |
|
2791 |
}; |
|
2792 |
Timeline.LinearEther.prototype.zoom=function(D){var B=0; |
|
2793 |
var A=this._band._zoomIndex; |
|
2794 |
var C=A; |
|
2795 |
if(D&&(A>0)){C=A-1; |
|
2796 |
}if(!D&&(A<(this._band._zoomSteps.length-1))){C=A+1; |
|
2797 |
}this._band._zoomIndex=C; |
|
2798 |
this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[C].unit]; |
|
2799 |
this._pixelsPerInterval=this._band._zoomSteps[C].pixelsPerInterval; |
|
2800 |
B=this._band._zoomSteps[C].unit-this._band._zoomSteps[A].unit; |
|
2801 |
return B; |
|
2802 |
}; |
|
2803 |
Timeline.HotZoneEther=function(A){this._params=A; |
|
2804 |
this._interval=A.interval; |
|
2805 |
this._pixelsPerInterval=A.pixelsPerInterval; |
|
2806 |
this._theme=A.theme; |
|
2807 |
}; |
|
2808 |
Timeline.HotZoneEther.prototype.initialize=function(H,I){this._band=H; |
|
2809 |
this._timeline=I; |
|
2810 |
this._unit=I.getUnit(); |
|
2811 |
this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,magnify:1}]; |
|
2812 |
var B=this._params; |
|
2813 |
for(var D=0; |
|
2814 |
D<B.zones.length; |
|
2815 |
D++){var G=B.zones[D]; |
|
2816 |
var E=this._unit.parseFromObject(G.start); |
|
2817 |
var F=this._unit.parseFromObject(G.end); |
|
2818 |
for(var C=0; |
|
2819 |
C<this._zones.length&&this._unit.compare(F,E)>0; |
|
2820 |
C++){var A=this._zones[C]; |
|
2821 |
if(this._unit.compare(E,A.endTime)<0){if(this._unit.compare(E,A.startTime)>0){this._zones.splice(C,0,{startTime:A.startTime,endTime:E,magnify:A.magnify}); |
|
2822 |
C++; |
|
2823 |
A.startTime=E; |
|
2824 |
}if(this._unit.compare(F,A.endTime)<0){this._zones.splice(C,0,{startTime:E,endTime:F,magnify:G.magnify*A.magnify}); |
|
2825 |
C++; |
|
2826 |
A.startTime=F; |
|
2827 |
E=F; |
|
2828 |
}else{A.magnify*=G.magnify; |
|
2829 |
E=A.endTime; |
|
2830 |
}}}}if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn); |
|
2831 |
}else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn); |
|
2832 |
this.shiftPixels(-this._timeline.getPixelLength()); |
|
2833 |
}else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn); |
|
2834 |
this.shiftPixels(-this._timeline.getPixelLength()/2); |
|
2835 |
}else{this._start=this._unit.makeDefaultValue(); |
|
2836 |
this.shiftPixels(-this._timeline.getPixelLength()/2); |
|
2837 |
}}}}; |
|
2838 |
Timeline.HotZoneEther.prototype.setDate=function(A){this._start=this._unit.cloneValue(A); |
|
2839 |
}; |
|
2840 |
Timeline.HotZoneEther.prototype.shiftPixels=function(A){this._start=this.pixelOffsetToDate(A); |
|
2841 |
}; |
|
2842 |
Timeline.HotZoneEther.prototype.dateToPixelOffset=function(A){return this._dateDiffToPixelOffset(this._start,A); |
|
2843 |
}; |
|
2844 |
Timeline.HotZoneEther.prototype.pixelOffsetToDate=function(A){return this._pixelOffsetToDate(A,this._start); |
|
2845 |
}; |
|
2846 |
Timeline.HotZoneEther.prototype.zoom=function(D){var B=0; |
|
2847 |
var A=this._band._zoomIndex; |
|
2848 |
var C=A; |
|
2849 |
if(D&&(A>0)){C=A-1; |
|
2850 |
}if(!D&&(A<(this._band._zoomSteps.length-1))){C=A+1; |
|
2851 |
}this._band._zoomIndex=C; |
|
2852 |
this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[C].unit]; |
|
2853 |
this._pixelsPerInterval=this._band._zoomSteps[C].pixelsPerInterval; |
|
2854 |
B=this._band._zoomSteps[C].unit-this._band._zoomSteps[A].unit; |
|
2855 |
return B; |
|
2856 |
}; |
|
2857 |
Timeline.HotZoneEther.prototype._dateDiffToPixelOffset=function(I,D){var B=this._getScale(); |
|
2858 |
var H=I; |
|
2859 |
var C=D; |
|
2860 |
var A=0; |
|
2861 |
if(this._unit.compare(H,C)<0){var G=0; |
|
2862 |
while(G<this._zones.length){if(this._unit.compare(H,this._zones[G].endTime)<0){break; |
|
2863 |
}G++; |
|
2864 |
}while(this._unit.compare(H,C)<0){var E=this._zones[G]; |
|
2865 |
var F=this._unit.earlier(C,E.endTime); |
|
2866 |
A+=(this._unit.compare(F,H)/(B/E.magnify)); |
|
2867 |
H=F; |
|
2868 |
G++; |
|
2869 |
}}else{var G=this._zones.length-1; |
|
2870 |
while(G>=0){if(this._unit.compare(H,this._zones[G].startTime)>0){break; |
|
2871 |
}G--; |
|
2872 |
}while(this._unit.compare(H,C)>0){var E=this._zones[G]; |
|
2873 |
var F=this._unit.later(C,E.startTime); |
|
2874 |
A+=(this._unit.compare(F,H)/(B/E.magnify)); |
|
2875 |
H=F; |
|
2876 |
G--; |
|
2877 |
}}return A; |
|
2878 |
}; |
|
2879 |
Timeline.HotZoneEther.prototype._pixelOffsetToDate=function(H,C){var G=this._getScale(); |
|
2880 |
var E=C; |
|
2881 |
if(H>0){var F=0; |
|
2882 |
while(F<this._zones.length){if(this._unit.compare(E,this._zones[F].endTime)<0){break; |
|
2883 |
}F++; |
|
2884 |
}while(H>0){var A=this._zones[F]; |
|
2885 |
var D=G/A.magnify; |
|
2886 |
if(A.endTime==Number.POSITIVE_INFINITY){E=this._unit.change(E,H*D); |
|
2887 |
H=0; |
|
2888 |
}else{var B=this._unit.compare(A.endTime,E)/D; |
|
2889 |
if(B>H){E=this._unit.change(E,H*D); |
|
2890 |
H=0; |
|
2891 |
}else{E=A.endTime; |
|
2892 |
H-=B; |
|
2893 |
}}F++; |
|
2894 |
}}else{var F=this._zones.length-1; |
|
2895 |
while(F>=0){if(this._unit.compare(E,this._zones[F].startTime)>0){break; |
|
2896 |
}F--; |
|
2897 |
}H=-H; |
|
2898 |
while(H>0){var A=this._zones[F]; |
|
2899 |
var D=G/A.magnify; |
|
2900 |
if(A.startTime==Number.NEGATIVE_INFINITY){E=this._unit.change(E,-H*D); |
|
2901 |
H=0; |
|
2902 |
}else{var B=this._unit.compare(E,A.startTime)/D; |
|
2903 |
if(B>H){E=this._unit.change(E,-H*D); |
|
2904 |
H=0; |
|
2905 |
}else{E=A.startTime; |
|
2906 |
H-=B; |
|
2907 |
}}F--; |
|
2908 |
}}return E; |
|
2909 |
}; |
|
2910 |
Timeline.HotZoneEther.prototype._getScale=function(){return this._interval/this._pixelsPerInterval; |
|
2911 |
}; |
|
2912 |
||
2913 |
||
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2914 |
/* event-utils.js */ |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2915 |
Timeline.EventUtils={}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2916 |
Timeline.EventUtils.getNewEventID=function(){if(this._lastEventID==null){this._lastEventID=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2917 |
}this._lastEventID+=1; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2918 |
return"e"+this._lastEventID; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2919 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2920 |
Timeline.EventUtils.decodeEventElID=function(B){var D=B.split("-"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2921 |
if(D[1]!="tl"){alert("Internal Timeline problem 101, please consult support"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2922 |
return{band:null,evt:null}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2923 |
}var C=Timeline.getTimelineFromID(D[2]); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2924 |
var E=C.getBand(D[3]); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2925 |
var A=E.getEventSource.getEvent(D[4]); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2926 |
return{band:E,evt:A}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2927 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2928 |
Timeline.EventUtils.encodeEventElID=function(C,D,B,A){return B+"-tl-"+C.timelineID+"-"+D.getIndex()+"-"+A.getID(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2929 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2930 |
|
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2931 |
|
0 | 2932 |
/* labellers.js */ |
2933 |
Timeline.GregorianDateLabeller=function(A,B){this._locale=A; |
|
2934 |
this._timeZone=B; |
|
2935 |
}; |
|
2936 |
Timeline.GregorianDateLabeller.monthNames=[]; |
|
2937 |
Timeline.GregorianDateLabeller.dayNames=[]; |
|
2938 |
Timeline.GregorianDateLabeller.labelIntervalFunctions=[]; |
|
2939 |
Timeline.GregorianDateLabeller.getMonthName=function(B,A){return Timeline.GregorianDateLabeller.monthNames[A][B]; |
|
2940 |
}; |
|
2941 |
Timeline.GregorianDateLabeller.prototype.labelInterval=function(A,C){var B=Timeline.GregorianDateLabeller.labelIntervalFunctions[this._locale]; |
|
2942 |
if(B==null){B=Timeline.GregorianDateLabeller.prototype.defaultLabelInterval; |
|
2943 |
}return B.call(this,A,C); |
|
2944 |
}; |
|
2945 |
Timeline.GregorianDateLabeller.prototype.labelPrecise=function(A){return SimileAjax.DateTime.removeTimeZoneOffset(A,this._timeZone).toUTCString(); |
|
2946 |
}; |
|
2947 |
Timeline.GregorianDateLabeller.prototype.defaultLabelInterval=function(B,F){var C; |
|
2948 |
var E=false; |
|
2949 |
B=SimileAjax.DateTime.removeTimeZoneOffset(B,this._timeZone); |
|
2950 |
switch(F){case SimileAjax.DateTime.MILLISECOND:C=B.getUTCMilliseconds(); |
|
2951 |
break; |
|
2952 |
case SimileAjax.DateTime.SECOND:C=B.getUTCSeconds(); |
|
2953 |
break; |
|
2954 |
case SimileAjax.DateTime.MINUTE:var A=B.getUTCMinutes(); |
|
2955 |
if(A==0){C=B.getUTCHours()+":00"; |
|
2956 |
E=true; |
|
2957 |
}else{C=A; |
|
2958 |
}break; |
|
2959 |
case SimileAjax.DateTime.HOUR:C=B.getUTCHours()+"hr"; |
|
2960 |
break; |
|
2961 |
case SimileAjax.DateTime.DAY:C=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate(); |
|
2962 |
break; |
|
2963 |
case SimileAjax.DateTime.WEEK:C=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate(); |
|
2964 |
break; |
|
2965 |
case SimileAjax.DateTime.MONTH:var A=B.getUTCMonth(); |
|
2966 |
if(A!=0){C=Timeline.GregorianDateLabeller.getMonthName(A,this._locale); |
|
2967 |
break; |
|
2968 |
}case SimileAjax.DateTime.YEAR:case SimileAjax.DateTime.DECADE:case SimileAjax.DateTime.CENTURY:case SimileAjax.DateTime.MILLENNIUM:var D=B.getUTCFullYear(); |
|
2969 |
if(D>0){C=B.getUTCFullYear(); |
|
2970 |
}else{C=(1-D)+"BC"; |
|
2971 |
}E=(F==SimileAjax.DateTime.MONTH)||(F==SimileAjax.DateTime.DECADE&&D%100==0)||(F==SimileAjax.DateTime.CENTURY&&D%1000==0); |
|
2972 |
break; |
|
2973 |
default:C=B.toUTCString(); |
|
2974 |
}return{text:C,emphasized:E}; |
|
2975 |
}; |
|
2976 |
||
2977 |
||
2978 |
/* original-painter.js */ |
|
2979 |
Timeline.OriginalEventPainter=function(A){this._params=A; |
|
2980 |
this._onSelectListeners=[]; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2981 |
this._eventPaintListeners=[]; |
0 | 2982 |
this._filterMatcher=null; |
2983 |
this._highlightMatcher=null; |
|
2984 |
this._frc=null; |
|
2985 |
this._eventIdToElmt={}; |
|
2986 |
}; |
|
2987 |
Timeline.OriginalEventPainter.prototype.initialize=function(B,A){this._band=B; |
|
2988 |
this._timeline=A; |
|
2989 |
this._backLayer=null; |
|
2990 |
this._eventLayer=null; |
|
2991 |
this._lineLayer=null; |
|
2992 |
this._highlightLayer=null; |
|
2993 |
this._eventIdToElmt=null; |
|
2994 |
}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2995 |
Timeline.OriginalEventPainter.prototype.getType=function(){return"original"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2996 |
}; |
0 | 2997 |
Timeline.OriginalEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A); |
2998 |
}; |
|
2999 |
Timeline.OriginalEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0; |
|
3000 |
A<this._onSelectListeners.length; |
|
3001 |
A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1); |
|
3002 |
break; |
|
3003 |
}}}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3004 |
Timeline.OriginalEventPainter.prototype.addEventPaintListener=function(A){this._eventPaintListeners.push(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3005 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3006 |
Timeline.OriginalEventPainter.prototype.removeEventPaintListener=function(B){for(var A=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3007 |
A<this._eventPaintListeners.length; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3008 |
A++){if(this._eventPaintListeners[A]==B){this._eventPaintListeners.splice(A,1); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3009 |
break; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3010 |
}}}; |
0 | 3011 |
Timeline.OriginalEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher; |
3012 |
}; |
|
3013 |
Timeline.OriginalEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A; |
|
3014 |
}; |
|
3015 |
Timeline.OriginalEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher; |
|
3016 |
}; |
|
3017 |
Timeline.OriginalEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A; |
|
3018 |
}; |
|
3019 |
Timeline.OriginalEventPainter.prototype.paint=function(){var B=this._band.getEventSource(); |
|
3020 |
if(B==null){return ; |
|
3021 |
}this._eventIdToElmt={}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3022 |
this._fireEventPaintListeners("paintStarting",null,null); |
0 | 3023 |
this._prepareForPainting(); |
3024 |
var I=this._params.theme.event; |
|
3025 |
var G=Math.max(I.track.height,I.tape.height+this._frc.getLineHeight()); |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3026 |
var F={trackOffset:I.track.offset,trackHeight:G,trackGap:I.track.gap,trackIncrement:G+I.track.gap,icon:I.instant.icon,iconWidth:I.instant.iconWidth,iconHeight:I.instant.iconHeight,labelWidth:I.label.width,maxLabelChar:I.label.maxLabelChar,impreciseIconMargin:I.instant.impreciseIconMargin}; |
0 | 3027 |
var C=this._band.getMinDate(); |
3028 |
var A=this._band.getMaxDate(); |
|
3029 |
var J=(this._filterMatcher!=null)?this._filterMatcher:function(K){return true; |
|
3030 |
}; |
|
3031 |
var E=(this._highlightMatcher!=null)?this._highlightMatcher:function(K){return -1; |
|
3032 |
}; |
|
3033 |
var D=B.getEventReverseIterator(C,A); |
|
3034 |
while(D.hasNext()){var H=D.next(); |
|
3035 |
if(J(H)){this.paintEvent(H,F,this._params.theme,E(H)); |
|
3036 |
}}this._highlightLayer.style.display="block"; |
|
3037 |
this._lineLayer.style.display="block"; |
|
3038 |
this._eventLayer.style.display="block"; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3039 |
this._band.updateEventTrackInfo(this._tracks.length,F.trackIncrement); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3040 |
this._fireEventPaintListeners("paintEnded",null,null); |
0 | 3041 |
}; |
3042 |
Timeline.OriginalEventPainter.prototype.softPaint=function(){}; |
|
3043 |
Timeline.OriginalEventPainter.prototype._prepareForPainting=function(){var B=this._band; |
|
3044 |
if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events"); |
|
3045 |
this._backLayer.style.visibility="hidden"; |
|
3046 |
var A=document.createElement("span"); |
|
3047 |
A.className="timeline-event-label"; |
|
3048 |
this._backLayer.appendChild(A); |
|
3049 |
this._frc=SimileAjax.Graphics.getFontRenderingContext(A); |
|
3050 |
}this._frc.update(); |
|
3051 |
this._tracks=[]; |
|
3052 |
if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer); |
|
3053 |
}this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights"); |
|
3054 |
this._highlightLayer.style.display="none"; |
|
3055 |
if(this._lineLayer!=null){B.removeLayerDiv(this._lineLayer); |
|
3056 |
}this._lineLayer=B.createLayerDiv(110,"timeline-band-lines"); |
|
3057 |
this._lineLayer.style.display="none"; |
|
3058 |
if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer); |
|
3059 |
}this._eventLayer=B.createLayerDiv(115,"timeline-band-events"); |
|
3060 |
this._eventLayer.style.display="none"; |
|
3061 |
}; |
|
3062 |
Timeline.OriginalEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A); |
|
3063 |
}else{this.paintDurationEvent(B,C,D,A); |
|
3064 |
}}; |
|
3065 |
Timeline.OriginalEventPainter.prototype.paintInstantEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseInstantEvent(B,C,D,A); |
|
3066 |
}else{this.paintPreciseInstantEvent(B,C,D,A); |
|
3067 |
}}; |
|
3068 |
Timeline.OriginalEventPainter.prototype.paintDurationEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseDurationEvent(B,C,D,A); |
|
3069 |
}else{this.paintPreciseDurationEvent(B,C,D,A); |
|
3070 |
}}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3071 |
Timeline.OriginalEventPainter.prototype.paintPreciseInstantEvent=function(M,Q,S,R){var V=this._timeline.getDocument(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3072 |
var L=M.getText(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3073 |
var E=M.getStart(); |
0 | 3074 |
var C=Math.round(this._band.dateToPixelOffset(E)); |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3075 |
var A=Math.round(C+Q.iconWidth/2); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3076 |
var K=Math.round(C-Q.iconWidth/2); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3077 |
var H=this._getLabelDivClassName(M); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3078 |
var I=this._frc.computeSize(L,H); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3079 |
var W=A+S.event.label.offsetFromLine; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3080 |
var D=W+I.width; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3081 |
var U=D; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3082 |
var O=this._findFreeTrack(M,U); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3083 |
var T=Math.round(Q.trackOffset+O*Q.trackIncrement+Q.trackHeight/2-I.height/2); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3084 |
var B=this._paintEventIcon(M,O,K,Q,S,0); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3085 |
var P=this._paintEventLabel(M,L,W,T,I.width,I.height,S,H,R); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3086 |
var F=[B.elmt,P.elmt]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3087 |
var N=this; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3088 |
var J=function(X,Y,Z){return N._onClickInstantEvent(B.elmt,Y,M); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3089 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3090 |
SimileAjax.DOM.registerEvent(B.elmt,"mousedown",J); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3091 |
SimileAjax.DOM.registerEvent(P.elmt,"mousedown",J); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3092 |
var G=this._createHighlightDiv(R,B,S,M); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3093 |
if(G!=null){F.push(G); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3094 |
}this._fireEventPaintListeners("paintedEvent",M,F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3095 |
this._eventIdToElmt[M.getID()]=B.elmt; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3096 |
this._tracks[O]=K; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3097 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3098 |
Timeline.OriginalEventPainter.prototype.paintImpreciseInstantEvent=function(P,T,Y,V){var a=this._timeline.getDocument(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3099 |
var N=P.getText(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3100 |
var G=P.getStart(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3101 |
var W=P.getEnd(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3102 |
var D=Math.round(this._band.dateToPixelOffset(G)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3103 |
var B=Math.round(this._band.dateToPixelOffset(W)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3104 |
var A=Math.round(D+T.iconWidth/2); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3105 |
var M=Math.round(D-T.iconWidth/2); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3106 |
var J=this._getLabelDivClassName(P); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3107 |
var K=this._frc.computeSize(N,J); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3108 |
var b=A+Y.event.label.offsetFromLine; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3109 |
var E=b+K.width; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3110 |
var Z=Math.max(E,B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3111 |
var R=this._findFreeTrack(P,Z); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3112 |
var O=Y.event.tape.height; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3113 |
var X=Math.round(T.trackOffset+R*T.trackIncrement+O); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3114 |
var C=this._paintEventIcon(P,R,M,T,Y,O); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3115 |
var S=this._paintEventLabel(P,N,b,X,K.width,K.height,Y,J,V); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3116 |
var U=P.getColor(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3117 |
U=U!=null?U:Y.event.instant.impreciseColor; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3118 |
var F=this._paintEventTape(P,R,D,B,U,Y.event.instant.impreciseOpacity,T,Y,0); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3119 |
var H=[C.elmt,S.elmt,F.elmt]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3120 |
var Q=this; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3121 |
var L=function(c,d,e){return Q._onClickInstantEvent(C.elmt,d,P); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3122 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3123 |
SimileAjax.DOM.registerEvent(C.elmt,"mousedown",L); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3124 |
SimileAjax.DOM.registerEvent(F.elmt,"mousedown",L); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3125 |
SimileAjax.DOM.registerEvent(S.elmt,"mousedown",L); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3126 |
var I=this._createHighlightDiv(V,C,Y,P); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3127 |
if(I!=null){H.push(I); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3128 |
}this._fireEventPaintListeners("paintedEvent",P,H); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3129 |
this._eventIdToElmt[P.getID()]=C.elmt; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3130 |
this._tracks[R]=M; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3131 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3132 |
Timeline.OriginalEventPainter.prototype.paintPreciseDurationEvent=function(L,P,T,R){var W=this._timeline.getDocument(); |
0 | 3133 |
var K=L.getText(); |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3134 |
var E=L.getStart(); |
0 | 3135 |
var S=L.getEnd(); |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3136 |
var B=Math.round(this._band.dateToPixelOffset(E)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3137 |
var A=Math.round(this._band.dateToPixelOffset(S)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3138 |
var H=this._getLabelDivClassName(L); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3139 |
var I=this._frc.computeSize(K,H); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3140 |
var X=B; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3141 |
var C=X+I.width; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3142 |
var V=Math.max(C,A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3143 |
var N=this._findFreeTrack(L,V); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3144 |
var U=Math.round(P.trackOffset+N*P.trackIncrement+T.event.tape.height); |
0 | 3145 |
var Q=L.getColor(); |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3146 |
Q=Q!=null?Q:T.event.duration.color; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3147 |
var D=this._paintEventTape(L,N,B,A,Q,100,P,T,0); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3148 |
var O=this._paintEventLabel(L,K,X,U,I.width,I.height,T,H,R); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3149 |
var F=[D.elmt,O.elmt]; |
0 | 3150 |
var M=this; |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3151 |
var J=function(Y,Z,a){return M._onClickDurationEvent(D.elmt,Z,L); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3152 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3153 |
SimileAjax.DOM.registerEvent(D.elmt,"mousedown",J); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3154 |
SimileAjax.DOM.registerEvent(O.elmt,"mousedown",J); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3155 |
var G=this._createHighlightDiv(R,D,T,L); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3156 |
if(G!=null){F.push(G); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3157 |
}this._fireEventPaintListeners("paintedEvent",L,F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3158 |
this._eventIdToElmt[L.getID()]=D.elmt; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3159 |
this._tracks[N]=B; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3160 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3161 |
Timeline.OriginalEventPainter.prototype.paintImpreciseDurationEvent=function(N,S,Y,V){var b=this._timeline.getDocument(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3162 |
var M=N.getText(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3163 |
var E=N.getStart(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3164 |
var T=N.getLatestStart(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3165 |
var W=N.getEnd(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3166 |
var a=N.getEarliestEnd(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3167 |
var C=Math.round(this._band.dateToPixelOffset(E)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3168 |
var G=Math.round(this._band.dateToPixelOffset(T)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3169 |
var A=Math.round(this._band.dateToPixelOffset(W)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3170 |
var H=Math.round(this._band.dateToPixelOffset(a)); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3171 |
var J=this._getLabelDivClassName(N); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3172 |
var K=this._frc.computeSize(M,J); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3173 |
var c=G; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3174 |
var B=c+K.width; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3175 |
var Z=Math.max(B,A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3176 |
var P=this._findFreeTrack(N,Z); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3177 |
var X=Math.round(S.trackOffset+P*S.trackIncrement+Y.event.tape.height); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3178 |
var U=N.getColor(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3179 |
U=U!=null?U:Y.event.duration.color; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3180 |
var R=this._paintEventTape(N,P,C,A,Y.event.duration.impreciseColor,Y.event.duration.impreciseOpacity,S,Y,0); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3181 |
var D=this._paintEventTape(N,P,G,H,U,100,S,Y,1); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3182 |
var Q=this._paintEventLabel(N,M,c,X,K.width,K.height,Y,J,V); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3183 |
var F=[R.elmt,D.elmt,Q.elmt]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3184 |
var O=this; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3185 |
var L=function(d,e,f){return O._onClickDurationEvent(D.elmt,e,N); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3186 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3187 |
SimileAjax.DOM.registerEvent(D.elmt,"mousedown",L); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3188 |
SimileAjax.DOM.registerEvent(Q.elmt,"mousedown",L); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3189 |
var I=this._createHighlightDiv(V,D,Y,N); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3190 |
if(I!=null){F.push(I); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3191 |
}this._fireEventPaintListeners("paintedEvent",N,F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3192 |
this._eventIdToElmt[N.getID()]=D.elmt; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3193 |
this._tracks[P]=C; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3194 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3195 |
Timeline.OriginalEventPainter.prototype._encodeEventElID=function(B,A){return Timeline.EventUtils.encodeEventElID(this._timeline,this._band,B,A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3196 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3197 |
Timeline.OriginalEventPainter.prototype._findFreeTrack=function(E,A){var D=E.getTrackNum(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3198 |
if(D!=null){return D; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3199 |
}for(var C=0; |
0 | 3200 |
C<this._tracks.length; |
3201 |
C++){var B=this._tracks[C]; |
|
3202 |
if(B>A){break; |
|
3203 |
}}return C; |
|
3204 |
}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3205 |
Timeline.OriginalEventPainter.prototype._paintEventIcon=function(J,F,B,G,E,C){var I=J.getIcon(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3206 |
I=I!=null?I:G.icon; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3207 |
var H; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3208 |
if(C>0){H=G.trackOffset+F*G.trackIncrement+C+G.impreciseIconMargin; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3209 |
}else{var K=G.trackOffset+F*G.trackIncrement+G.trackHeight/2; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3210 |
H=Math.round(K-G.iconHeight/2); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3211 |
}var D=SimileAjax.Graphics.createTranslucentImage(I); |
0 | 3212 |
var A=this._timeline.getDocument().createElement("div"); |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3213 |
A.className=this._getElClassName("timeline-event-icon",J); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3214 |
A.id=this._encodeEventElID("icon",J); |
0 | 3215 |
A.style.left=B+"px"; |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3216 |
A.style.top=H+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3217 |
A.appendChild(D); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3218 |
if(J._title!=null){A.title=J._title; |
0 | 3219 |
}this._eventLayer.appendChild(A); |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3220 |
return{left:B,top:H,width:G.iconWidth,height:G.iconHeight,elmt:A}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3221 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3222 |
Timeline.OriginalEventPainter.prototype._paintEventLabel=function(J,K,C,H,A,L,E,F,B){var I=this._timeline.getDocument(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3223 |
var G=I.createElement("div"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3224 |
G.className=F; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3225 |
G.id=this._encodeEventElID("label",J); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3226 |
G.style.left=C+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3227 |
G.style.width=A+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3228 |
G.style.top=H+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3229 |
G.innerHTML=K; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3230 |
if(J._title!=null){G.title=J._title; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3231 |
}var D=J.getTextColor(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3232 |
if(D==null){D=J.getColor(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3233 |
}if(D!=null){G.style.color=D; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3234 |
}if(E.event.highlightLabelBackground&&B>=0){G.style.background=this._getHighlightColor(B,E); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3235 |
}this._eventLayer.appendChild(G); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3236 |
return{left:C,top:H,width:A,height:L,elmt:G}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3237 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3238 |
Timeline.OriginalEventPainter.prototype._paintEventTape=function(N,I,F,A,C,H,J,G,O){var B=A-F; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3239 |
var E=G.event.tape.height; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3240 |
var K=J.trackOffset+I*J.trackIncrement; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3241 |
var M=this._timeline.getDocument().createElement("div"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3242 |
M.className=this._getElClassName("timeline-event-tape",N); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3243 |
M.id=this._encodeEventElID("tape"+O,N); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3244 |
M.style.left=F+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3245 |
M.style.width=B+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3246 |
M.style.height=E+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3247 |
M.style.top=K+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3248 |
if(N._title!=null){M.title=N._title; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3249 |
}if(C!=null){M.style.backgroundColor=C; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3250 |
}var L=N.getTapeImage(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3251 |
var D=N.getTapeRepeat(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3252 |
D=D!=null?D:"repeat"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3253 |
if(L!=null){M.style.backgroundImage="url("+L+")"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3254 |
M.style.backgroundRepeat=D; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3255 |
}SimileAjax.Graphics.setOpacity(M,H); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3256 |
this._eventLayer.appendChild(M); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3257 |
return{left:F,top:K,width:B,height:E,elmt:M}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3258 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3259 |
Timeline.OriginalEventPainter.prototype._getLabelDivClassName=function(A){return this._getElClassName("timeline-event-label",A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3260 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3261 |
Timeline.OriginalEventPainter.prototype._getElClassName=function(B,A){var C=A.getClassName(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3262 |
return B+(C!=null?(" "+C):""); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3263 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3264 |
Timeline.OriginalEventPainter.prototype._getHighlightColor=function(A,C){var B=C.event.highlightColors; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3265 |
return B[Math.min(A,B.length-1)]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3266 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3267 |
Timeline.OriginalEventPainter.prototype._createHighlightDiv=function(A,D,F,B){var G=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3268 |
if(A>=0){var E=this._timeline.getDocument(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3269 |
var C=this._getHighlightColor(A,F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3270 |
G=E.createElement("div"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3271 |
G.className=this._getElClassName("timeline-event-highlight",B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3272 |
G.id=this._encodeEventElID("highlight0",B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3273 |
G.style.position="absolute"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3274 |
G.style.overflow="hidden"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3275 |
G.style.left=(D.left-2)+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3276 |
G.style.width=(D.width+4)+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3277 |
G.style.top=(D.top-2)+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3278 |
G.style.height=(D.height+4)+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3279 |
G.style.background=C; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3280 |
this._highlightLayer.appendChild(G); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3281 |
}return G; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3282 |
}; |
0 | 3283 |
Timeline.OriginalEventPainter.prototype._onClickInstantEvent=function(B,C,A){var D=SimileAjax.DOM.getPageCoordinates(B); |
3284 |
this._showBubble(D.left+Math.ceil(B.offsetWidth/2),D.top+Math.ceil(B.offsetHeight/2),A); |
|
3285 |
this._fireOnSelect(A.getID()); |
|
3286 |
C.cancelBubble=true; |
|
3287 |
SimileAjax.DOM.cancelEvent(C); |
|
3288 |
return false; |
|
3289 |
}; |
|
3290 |
Timeline.OriginalEventPainter.prototype._onClickDurationEvent=function(D,C,B){if("pageX" in C){var A=C.pageX; |
|
3291 |
var F=C.pageY; |
|
3292 |
}else{var E=SimileAjax.DOM.getPageCoordinates(D); |
|
3293 |
var A=C.offsetX+E.left; |
|
3294 |
var F=C.offsetY+E.top; |
|
3295 |
}this._showBubble(A,F,B); |
|
3296 |
this._fireOnSelect(B.getID()); |
|
3297 |
C.cancelBubble=true; |
|
3298 |
SimileAjax.DOM.cancelEvent(C); |
|
3299 |
return false; |
|
3300 |
}; |
|
3301 |
Timeline.OriginalEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()]; |
|
3302 |
if(B){var C=SimileAjax.DOM.getPageCoordinates(B); |
|
3303 |
this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,A); |
|
3304 |
}}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3305 |
Timeline.OriginalEventPainter.prototype._showBubble=function(A,E,B){var D=document.createElement("div"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3306 |
var C=this._params.theme.event.bubble; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3307 |
B.fillInfoBubble(D,this._params.theme,this._band.getLabeller()); |
0 | 3308 |
SimileAjax.WindowManager.cancelPopups(); |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3309 |
SimileAjax.Graphics.createBubbleForContentAndPoint(D,A,E,C.width,null,C.maxHeight); |
0 | 3310 |
}; |
3311 |
Timeline.OriginalEventPainter.prototype._fireOnSelect=function(B){for(var A=0; |
|
3312 |
A<this._onSelectListeners.length; |
|
3313 |
A++){this._onSelectListeners[A](B); |
|
3314 |
}}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3315 |
Timeline.OriginalEventPainter.prototype._fireEventPaintListeners=function(D,A,C){for(var B=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3316 |
B<this._eventPaintListeners.length; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3317 |
B++){this._eventPaintListeners[B](this._band,D,A,C); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3318 |
}}; |
0 | 3319 |
|
3320 |
||
3321 |
/* overview-painter.js */ |
|
3322 |
Timeline.OverviewEventPainter=function(A){this._params=A; |
|
3323 |
this._onSelectListeners=[]; |
|
3324 |
this._filterMatcher=null; |
|
3325 |
this._highlightMatcher=null; |
|
3326 |
}; |
|
3327 |
Timeline.OverviewEventPainter.prototype.initialize=function(B,A){this._band=B; |
|
3328 |
this._timeline=A; |
|
3329 |
this._eventLayer=null; |
|
3330 |
this._highlightLayer=null; |
|
3331 |
}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3332 |
Timeline.OverviewEventPainter.prototype.getType=function(){return"overview"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3333 |
}; |
0 | 3334 |
Timeline.OverviewEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A); |
3335 |
}; |
|
3336 |
Timeline.OverviewEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0; |
|
3337 |
A<this._onSelectListeners.length; |
|
3338 |
A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1); |
|
3339 |
break; |
|
3340 |
}}}; |
|
3341 |
Timeline.OverviewEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher; |
|
3342 |
}; |
|
3343 |
Timeline.OverviewEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A; |
|
3344 |
}; |
|
3345 |
Timeline.OverviewEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher; |
|
3346 |
}; |
|
3347 |
Timeline.OverviewEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A; |
|
3348 |
}; |
|
3349 |
Timeline.OverviewEventPainter.prototype.paint=function(){var B=this._band.getEventSource(); |
|
3350 |
if(B==null){return ; |
|
3351 |
}this._prepareForPainting(); |
|
3352 |
var H=this._params.theme.event; |
|
3353 |
var F={trackOffset:H.overviewTrack.offset,trackHeight:H.overviewTrack.height,trackGap:H.overviewTrack.gap,trackIncrement:H.overviewTrack.height+H.overviewTrack.gap}; |
|
3354 |
var C=this._band.getMinDate(); |
|
3355 |
var A=this._band.getMaxDate(); |
|
3356 |
var I=(this._filterMatcher!=null)?this._filterMatcher:function(J){return true; |
|
3357 |
}; |
|
3358 |
var E=(this._highlightMatcher!=null)?this._highlightMatcher:function(J){return -1; |
|
3359 |
}; |
|
3360 |
var D=B.getEventReverseIterator(C,A); |
|
3361 |
while(D.hasNext()){var G=D.next(); |
|
3362 |
if(I(G)){this.paintEvent(G,F,this._params.theme,E(G)); |
|
3363 |
}}this._highlightLayer.style.display="block"; |
|
3364 |
this._eventLayer.style.display="block"; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3365 |
this._band.updateEventTrackInfo(this._tracks.length,F.trackIncrement); |
0 | 3366 |
}; |
3367 |
Timeline.OverviewEventPainter.prototype.softPaint=function(){}; |
|
3368 |
Timeline.OverviewEventPainter.prototype._prepareForPainting=function(){var A=this._band; |
|
3369 |
this._tracks=[]; |
|
3370 |
if(this._highlightLayer!=null){A.removeLayerDiv(this._highlightLayer); |
|
3371 |
}this._highlightLayer=A.createLayerDiv(105,"timeline-band-highlights"); |
|
3372 |
this._highlightLayer.style.display="none"; |
|
3373 |
if(this._eventLayer!=null){A.removeLayerDiv(this._eventLayer); |
|
3374 |
}this._eventLayer=A.createLayerDiv(110,"timeline-band-events"); |
|
3375 |
this._eventLayer.style.display="none"; |
|
3376 |
}; |
|
3377 |
Timeline.OverviewEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A); |
|
3378 |
}else{this.paintDurationEvent(B,C,D,A); |
|
3379 |
}}; |
|
3380 |
Timeline.OverviewEventPainter.prototype.paintInstantEvent=function(C,F,G,B){var A=C.getStart(); |
|
3381 |
var H=Math.round(this._band.dateToPixelOffset(A)); |
|
3382 |
var D=C.getColor(); |
|
3383 |
D=D!=null?D:G.event.duration.color; |
|
3384 |
var E=this._paintEventTick(C,H,D,100,F,G); |
|
3385 |
this._createHighlightDiv(B,E,G); |
|
3386 |
}; |
|
3387 |
Timeline.OverviewEventPainter.prototype.paintDurationEvent=function(K,J,I,D){var A=K.getLatestStart(); |
|
3388 |
var C=K.getEarliestEnd(); |
|
3389 |
var B=Math.round(this._band.dateToPixelOffset(A)); |
|
3390 |
var E=Math.round(this._band.dateToPixelOffset(C)); |
|
3391 |
var H=0; |
|
3392 |
for(; |
|
3393 |
H<this._tracks.length; |
|
3394 |
H++){if(E<this._tracks[H]){break; |
|
3395 |
}}this._tracks[H]=E; |
|
3396 |
var G=K.getColor(); |
|
3397 |
G=G!=null?G:I.event.duration.color; |
|
3398 |
var F=this._paintEventTape(K,H,B,E,G,100,J,I); |
|
3399 |
this._createHighlightDiv(D,F,I); |
|
3400 |
}; |
|
3401 |
Timeline.OverviewEventPainter.prototype._paintEventTape=function(K,B,C,J,D,F,G,E){var H=G.trackOffset+B*G.trackIncrement; |
|
3402 |
var A=J-C; |
|
3403 |
var L=G.trackHeight; |
|
3404 |
var I=this._timeline.getDocument().createElement("div"); |
|
3405 |
I.className="timeline-small-event-tape"; |
|
3406 |
I.style.left=C+"px"; |
|
3407 |
I.style.width=A+"px"; |
|
3408 |
I.style.top=H+"px"; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3409 |
I.style.height=L+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3410 |
if(D!=null){I.style.backgroundColor=D; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3411 |
}if(F<100){SimileAjax.Graphics.setOpacity(I,F); |
0 | 3412 |
}this._eventLayer.appendChild(I); |
3413 |
return{left:C,top:H,width:A,height:L,elmt:I}; |
|
3414 |
}; |
|
3415 |
Timeline.OverviewEventPainter.prototype._paintEventTick=function(J,B,D,F,G,E){var K=E.event.overviewTrack.tickHeight; |
|
3416 |
var H=G.trackOffset-K; |
|
3417 |
var A=1; |
|
3418 |
var I=this._timeline.getDocument().createElement("div"); |
|
3419 |
I.className="timeline-small-event-icon"; |
|
3420 |
I.style.left=B+"px"; |
|
3421 |
I.style.top=H+"px"; |
|
3422 |
var C=J.getClassName(); |
|
3423 |
if(C){I.className+=" small-"+C; |
|
3424 |
}if(F<100){SimileAjax.Graphics.setOpacity(I,F); |
|
3425 |
}this._eventLayer.appendChild(I); |
|
3426 |
return{left:B,top:H,width:A,height:K,elmt:I}; |
|
3427 |
}; |
|
3428 |
Timeline.OverviewEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument(); |
|
3429 |
var G=E.event; |
|
3430 |
var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)]; |
|
3431 |
var F=D.createElement("div"); |
|
3432 |
F.style.position="absolute"; |
|
3433 |
F.style.overflow="hidden"; |
|
3434 |
F.style.left=(C.left-1)+"px"; |
|
3435 |
F.style.width=(C.width+2)+"px"; |
|
3436 |
F.style.top=(C.top-1)+"px"; |
|
3437 |
F.style.height=(C.height+2)+"px"; |
|
3438 |
F.style.background=B; |
|
3439 |
this._highlightLayer.appendChild(F); |
|
3440 |
}}; |
|
3441 |
Timeline.OverviewEventPainter.prototype.showBubble=function(A){}; |
|
3442 |
||
3443 |
||
3444 |
/* sources.js */ |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3445 |
Timeline.DefaultEventSource=function(A){this._events=(A instanceof Object)?A:new SimileAjax.EventIndex(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3446 |
this._listeners=[]; |
0 | 3447 |
}; |
3448 |
Timeline.DefaultEventSource.prototype.addListener=function(A){this._listeners.push(A); |
|
3449 |
}; |
|
3450 |
Timeline.DefaultEventSource.prototype.removeListener=function(B){for(var A=0; |
|
3451 |
A<this._listeners.length; |
|
3452 |
A++){if(this._listeners[A]==B){this._listeners.splice(A,1); |
|
3453 |
break; |
|
3454 |
}}}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3455 |
Timeline.DefaultEventSource.prototype.loadXML=function(G,A){var C=this._getBaseURL(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3456 |
var H=G.documentElement.getAttribute("wiki-url"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3457 |
var L=G.documentElement.getAttribute("wiki-section"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3458 |
var E=G.documentElement.getAttribute("date-time-format"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3459 |
var F=this._events.getUnit().getParser(E); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3460 |
var D=G.documentElement.firstChild; |
0 | 3461 |
var I=false; |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3462 |
while(D!=null){if(D.nodeType==1){var K=""; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3463 |
if(D.firstChild!=null&&D.firstChild.nodeType==3){K=D.firstChild.nodeValue; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3464 |
}var B=(D.getAttribute("isDuration")===null&&D.getAttribute("durationEvent")===null)||D.getAttribute("isDuration")=="false"||D.getAttribute("durationEvent")=="false"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3465 |
var J=new Timeline.DefaultEventSource.Event({id:D.getAttribute("id"),start:F(D.getAttribute("start")),end:F(D.getAttribute("end")),latestStart:F(D.getAttribute("latestStart")),earliestEnd:F(D.getAttribute("earliestEnd")),instant:B,text:D.getAttribute("title"),description:K,image:this._resolveRelativeURL(D.getAttribute("image"),C),link:this._resolveRelativeURL(D.getAttribute("link"),C),icon:this._resolveRelativeURL(D.getAttribute("icon"),C),color:D.getAttribute("color"),textColor:D.getAttribute("textColor"),hoverText:D.getAttribute("hoverText"),classname:D.getAttribute("classname"),tapeImage:D.getAttribute("tapeImage"),tapeRepeat:D.getAttribute("tapeRepeat"),caption:D.getAttribute("caption"),eventID:D.getAttribute("eventID"),trackNum:D.getAttribute("trackNum")}); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3466 |
J._node=D; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3467 |
J.getProperty=function(M){return this._node.getAttribute(M); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3468 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3469 |
J.setWikiInfo(H,L); |
0 | 3470 |
this._events.add(J); |
3471 |
I=true; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3472 |
}D=D.nextSibling; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3473 |
}if(I){this._fire("onAddMany",[]); |
0 | 3474 |
}}; |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3475 |
Timeline.DefaultEventSource.prototype.loadJSON=function(G,B){var D=this._getBaseURL(B); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3476 |
var J=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3477 |
if(G&&G.events){var I=("wikiURL" in G)?G.wikiURL:null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3478 |
var L=("wikiSection" in G)?G.wikiSection:null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3479 |
var E=("dateTimeFormat" in G)?G.dateTimeFormat:null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3480 |
var H=this._events.getUnit().getParser(E); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3481 |
for(var F=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3482 |
F<G.events.length; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3483 |
F++){var A=G.events[F]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3484 |
var C=A.isDuration||(A.durationEvent!=null&&!A.durationEvent); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3485 |
var K=new Timeline.DefaultEventSource.Event({id:("id" in A)?A.id:undefined,start:H(A.start),end:H(A.end),latestStart:H(A.latestStart),earliestEnd:H(A.earliestEnd),instant:C,text:A.title,description:A.description,image:this._resolveRelativeURL(A.image,D),link:this._resolveRelativeURL(A.link,D),icon:this._resolveRelativeURL(A.icon,D),color:A.color,textColor:A.textColor,hoverText:A.hoverText,classname:A.classname,tapeImage:A.tapeImage,tapeRepeat:A.tapeRepeat,caption:A.caption,eventID:A.eventID,trackNum:A.trackNum}); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3486 |
K._obj=A; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3487 |
K.getProperty=function(M){return this._obj[M]; |
0 | 3488 |
}; |
3489 |
K.setWikiInfo(I,L); |
|
3490 |
this._events.add(K); |
|
3491 |
J=true; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3492 |
}}if(J){this._fire("onAddMany",[]); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3493 |
}}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3494 |
Timeline.DefaultEventSource.prototype.loadSPARQL=function(H,A){var D=this._getBaseURL(A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3495 |
var F="iso8601"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3496 |
var G=this._events.getUnit().getParser(F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3497 |
if(H==null){return ; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3498 |
}var E=H.documentElement.firstChild; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3499 |
while(E!=null&&(E.nodeType!=1||E.nodeName!="results")){E=E.nextSibling; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3500 |
}var J=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3501 |
var M=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3502 |
if(E!=null){J=E.getAttribute("wiki-url"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3503 |
M=E.getAttribute("wiki-section"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3504 |
E=E.firstChild; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3505 |
}var K=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3506 |
while(E!=null){if(E.nodeType==1){var C={}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3507 |
var I=E.firstChild; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3508 |
while(I!=null){if(I.nodeType==1&&I.firstChild!=null&&I.firstChild.nodeType==1&&I.firstChild.firstChild!=null&&I.firstChild.firstChild.nodeType==3){C[I.getAttribute("name")]=I.firstChild.firstChild.nodeValue; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3509 |
}I=I.nextSibling; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3510 |
}if(C["start"]==null&&C["date"]!=null){C["start"]=C["date"]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3511 |
}var B=(C["isDuration"]===null&&C["durationEvent"]===null)||C["isDuration"]=="false"||C["durationEvent"]=="false"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3512 |
var L=new Timeline.DefaultEventSource.Event({id:C["id"],start:G(C["start"]),end:G(C["end"]),latestStart:G(C["latestStart"]),earliestEnd:G(C["earliestEnd"]),instant:B,text:C["title"],description:C["description"],image:this._resolveRelativeURL(C["image"],D),link:this._resolveRelativeURL(C["link"],D),icon:this._resolveRelativeURL(C["icon"],D),color:C["color"],textColor:C["textColor"],hoverText:C["hoverText"],caption:C["caption"],classname:C["classname"],tapeImage:C["tapeImage"],tapeRepeat:C["tapeRepeat"],eventID:C["eventID"],trackNum:C["trackNum"]}); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3513 |
L._bindings=C; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3514 |
L.getProperty=function(N){return this._bindings[N]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3515 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3516 |
L.setWikiInfo(J,M); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3517 |
this._events.add(L); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3518 |
K=true; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3519 |
}E=E.nextSibling; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3520 |
}if(K){this._fire("onAddMany",[]); |
0 | 3521 |
}}; |
3522 |
Timeline.DefaultEventSource.prototype.add=function(A){this._events.add(A); |
|
3523 |
this._fire("onAddOne",[A]); |
|
3524 |
}; |
|
3525 |
Timeline.DefaultEventSource.prototype.addMany=function(B){for(var A=0; |
|
3526 |
A<B.length; |
|
3527 |
A++){this._events.add(B[A]); |
|
3528 |
}this._fire("onAddMany",[]); |
|
3529 |
}; |
|
3530 |
Timeline.DefaultEventSource.prototype.clear=function(){this._events.removeAll(); |
|
3531 |
this._fire("onClear",[]); |
|
3532 |
}; |
|
3533 |
Timeline.DefaultEventSource.prototype.getEvent=function(A){return this._events.getEvent(A); |
|
3534 |
}; |
|
3535 |
Timeline.DefaultEventSource.prototype.getEventIterator=function(A,B){return this._events.getIterator(A,B); |
|
3536 |
}; |
|
3537 |
Timeline.DefaultEventSource.prototype.getEventReverseIterator=function(A,B){return this._events.getReverseIterator(A,B); |
|
3538 |
}; |
|
3539 |
Timeline.DefaultEventSource.prototype.getAllEventIterator=function(){return this._events.getAllIterator(); |
|
3540 |
}; |
|
3541 |
Timeline.DefaultEventSource.prototype.getCount=function(){return this._events.getCount(); |
|
3542 |
}; |
|
3543 |
Timeline.DefaultEventSource.prototype.getEarliestDate=function(){return this._events.getEarliestDate(); |
|
3544 |
}; |
|
3545 |
Timeline.DefaultEventSource.prototype.getLatestDate=function(){return this._events.getLatestDate(); |
|
3546 |
}; |
|
3547 |
Timeline.DefaultEventSource.prototype._fire=function(B,A){for(var C=0; |
|
3548 |
C<this._listeners.length; |
|
3549 |
C++){var D=this._listeners[C]; |
|
3550 |
if(B in D){try{D[B].apply(D,A); |
|
3551 |
}catch(E){SimileAjax.Debug.exception(E); |
|
3552 |
}}}}; |
|
3553 |
Timeline.DefaultEventSource.prototype._getBaseURL=function(A){if(A.indexOf("://")<0){var C=this._getBaseURL(document.location.href); |
|
3554 |
if(A.substr(0,1)=="/"){A=C.substr(0,C.indexOf("/",C.indexOf("://")+3))+A; |
|
3555 |
}else{A=C+A; |
|
3556 |
}}var B=A.lastIndexOf("/"); |
|
3557 |
if(B<0){return""; |
|
3558 |
}else{return A.substr(0,B+1); |
|
3559 |
}}; |
|
3560 |
Timeline.DefaultEventSource.prototype._resolveRelativeURL=function(A,B){if(A==null||A==""){return A; |
|
3561 |
}else{if(A.indexOf("://")>0){return A; |
|
3562 |
}else{if(A.substr(0,1)=="/"){return B.substr(0,B.indexOf("/",B.indexOf("://")+3))+A; |
|
3563 |
}else{return B+A; |
|
3564 |
}}}}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3565 |
Timeline.DefaultEventSource.Event=function(A){function D(E){return(A[E]!=null&&A[E]!="")?A[E]:null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3566 |
}var C=A.id?A.id.trim():""; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3567 |
this._id=C.length>0?C:Timeline.EventUtils.getNewEventID(); |
0 | 3568 |
this._instant=A.instant||(A.end==null); |
3569 |
this._start=A.start; |
|
3570 |
this._end=(A.end!=null)?A.end:A.start; |
|
3571 |
this._latestStart=(A.latestStart!=null)?A.latestStart:(A.instant?this._end:this._start); |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3572 |
this._earliestEnd=(A.earliestEnd!=null)?A.earliestEnd:this._end; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3573 |
var B=[]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3574 |
if(this._start>this._latestStart){this._latestStart=this._start; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3575 |
B.push("start is > latestStart"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3576 |
}if(this._start>this._earliestEnd){this._earliestEnd=this._latestStart; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3577 |
B.push("start is > earliestEnd"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3578 |
}if(this._start>this._end){this._end=this._earliestEnd; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3579 |
B.push("start is > end"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3580 |
}if(this._latestStart>this._earliestEnd){this._earliestEnd=this._latestStart; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3581 |
B.push("latestStart is > earliestEnd"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3582 |
}if(this._latestStart>this._end){this._end=this._earliestEnd; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3583 |
B.push("latestStart is > end"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3584 |
}if(this._earliestEnd>this._end){this._end=this._earliestEnd; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3585 |
B.push("earliestEnd is > end"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3586 |
}this._eventID=D("eventID"); |
0 | 3587 |
this._text=(A.text!=null)?SimileAjax.HTML.deEntify(A.text):""; |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3588 |
if(B.length>0){this._text+=" PROBLEM: "+B.join(", "); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3589 |
}this._description=SimileAjax.HTML.deEntify(A.description); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3590 |
this._image=D("image"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3591 |
this._link=D("link"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3592 |
this._title=D("hoverText"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3593 |
this._title=D("caption"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3594 |
this._icon=D("icon"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3595 |
this._color=D("color"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3596 |
this._textColor=D("textColor"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3597 |
this._classname=D("classname"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3598 |
this._tapeImage=D("tapeImage"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3599 |
this._tapeRepeat=D("tapeRepeat"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3600 |
this._trackNum=D("trackNum"); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3601 |
if(this._trackNum!=null){this._trackNum=parseInt(this._trackNum); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3602 |
}this._wikiURL=null; |
0 | 3603 |
this._wikiSection=null; |
3604 |
}; |
|
3605 |
Timeline.DefaultEventSource.Event.prototype={getID:function(){return this._id; |
|
3606 |
},isInstant:function(){return this._instant; |
|
3607 |
},isImprecise:function(){return this._start!=this._latestStart||this._end!=this._earliestEnd; |
|
3608 |
},getStart:function(){return this._start; |
|
3609 |
},getEnd:function(){return this._end; |
|
3610 |
},getLatestStart:function(){return this._latestStart; |
|
3611 |
},getEarliestEnd:function(){return this._earliestEnd; |
|
3612 |
},getEventID:function(){return this._eventID; |
|
3613 |
},getText:function(){return this._text; |
|
3614 |
},getDescription:function(){return this._description; |
|
3615 |
},getImage:function(){return this._image; |
|
3616 |
},getLink:function(){return this._link; |
|
3617 |
},getIcon:function(){return this._icon; |
|
3618 |
},getColor:function(){return this._color; |
|
3619 |
},getTextColor:function(){return this._textColor; |
|
3620 |
},getClassName:function(){return this._classname; |
|
3621 |
},getTapeImage:function(){return this._tapeImage; |
|
3622 |
},getTapeRepeat:function(){return this._tapeRepeat; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3623 |
},getTrackNum:function(){return this._trackNum; |
0 | 3624 |
},getProperty:function(A){return null; |
3625 |
},getWikiURL:function(){return this._wikiURL; |
|
3626 |
},getWikiSection:function(){return this._wikiSection; |
|
3627 |
},setWikiInfo:function(B,A){this._wikiURL=B; |
|
3628 |
this._wikiSection=A; |
|
3629 |
},fillDescription:function(A){A.innerHTML=this._description; |
|
3630 |
},fillWikiInfo:function(D){D.style.display="none"; |
|
3631 |
if(this._wikiURL==null||this._wikiSection==null){return ; |
|
3632 |
}var C=this.getProperty("wikiID"); |
|
3633 |
if(C==null||C.length==0){C=this.getText(); |
|
3634 |
}if(C==null||C.length==0){return ; |
|
3635 |
}D.style.display="inline"; |
|
3636 |
C=C.replace(/\s/g,"_"); |
|
3637 |
var B=this._wikiURL+this._wikiSection.replace(/\s/g,"_")+"/"+C; |
|
3638 |
var A=document.createElement("a"); |
|
3639 |
A.href=B; |
|
3640 |
A.target="new"; |
|
3641 |
A.innerHTML=Timeline.strings[Timeline.clientLocale].wikiLinkLabel; |
|
3642 |
D.appendChild(document.createTextNode("[")); |
|
3643 |
D.appendChild(A); |
|
3644 |
D.appendChild(document.createTextNode("]")); |
|
3645 |
},fillTime:function(A,B){if(this._instant){if(this.isImprecise()){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start))); |
|
3646 |
A.appendChild(A.ownerDocument.createElement("br")); |
|
3647 |
A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._end))); |
|
3648 |
}else{A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start))); |
|
3649 |
}}else{if(this.isImprecise()){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)+" ~ "+B.labelPrecise(this._latestStart))); |
|
3650 |
A.appendChild(A.ownerDocument.createElement("br")); |
|
3651 |
A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._earliestEnd)+" ~ "+B.labelPrecise(this._end))); |
|
3652 |
}else{A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start))); |
|
3653 |
A.appendChild(A.ownerDocument.createElement("br")); |
|
3654 |
A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._end))); |
|
3655 |
}}},fillInfoBubble:function(A,D,K){var L=A.ownerDocument; |
|
3656 |
var J=this.getText(); |
|
3657 |
var H=this.getLink(); |
|
3658 |
var C=this.getImage(); |
|
3659 |
if(C!=null){var E=L.createElement("img"); |
|
3660 |
E.src=C; |
|
3661 |
D.event.bubble.imageStyler(E); |
|
3662 |
A.appendChild(E); |
|
3663 |
}var M=L.createElement("div"); |
|
3664 |
var B=L.createTextNode(J); |
|
3665 |
if(H!=null){var I=L.createElement("a"); |
|
3666 |
I.href=H; |
|
3667 |
I.appendChild(B); |
|
3668 |
M.appendChild(I); |
|
3669 |
}else{M.appendChild(B); |
|
3670 |
}D.event.bubble.titleStyler(M); |
|
3671 |
A.appendChild(M); |
|
3672 |
var N=L.createElement("div"); |
|
3673 |
this.fillDescription(N); |
|
3674 |
D.event.bubble.bodyStyler(N); |
|
3675 |
A.appendChild(N); |
|
3676 |
var G=L.createElement("div"); |
|
3677 |
this.fillTime(G,K); |
|
3678 |
D.event.bubble.timeStyler(G); |
|
3679 |
A.appendChild(G); |
|
3680 |
var F=L.createElement("div"); |
|
3681 |
this.fillWikiInfo(F); |
|
3682 |
D.event.bubble.wikiStyler(F); |
|
3683 |
A.appendChild(F); |
|
3684 |
}}; |
|
3685 |
||
3686 |
||
3687 |
/* themes.js */ |
|
3688 |
Timeline.ClassicTheme=new Object(); |
|
3689 |
Timeline.ClassicTheme.implementations=[]; |
|
3690 |
Timeline.ClassicTheme.create=function(A){if(A==null){A=Timeline.getDefaultLocale(); |
|
3691 |
}var B=Timeline.ClassicTheme.implementations[A]; |
|
3692 |
if(B==null){B=Timeline.ClassicTheme._Impl; |
|
3693 |
}return new B(); |
|
3694 |
}; |
|
3695 |
Timeline.ClassicTheme._Impl=function(){this.firstDayOfWeek=0; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3696 |
this.autoWidth=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3697 |
this.autoWidthAnimationTime=1000; |
0 | 3698 |
this.ether={backgroundColors:[],highlightOpacity:50,interval:{line:{show:true,opacity:25},weekend:{opacity:30},marker:{hAlign:"Bottom",vAlign:"Right"}}}; |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3699 |
this.event={track:{height:10,gap:2,offset:2,autoWidthMargin:1.5},overviewTrack:{offset:20,tickHeight:6,height:2,gap:1,autoWidthMargin:5},tape:{height:4},instant:{icon:Timeline.urlPrefix+"data/timeline/dull-blue-circle.png",iconWidth:10,iconHeight:10,impreciseOpacity:20,impreciseIconMargin:3},duration:{impreciseOpacity:20},label:{backgroundOpacity:50,offsetFromLine:3},highlightColors:["#FFFF00","#FFC000","#FF0000","#0000FF"],highlightLabelBackground:false,bubble:{width:250,maxHeight:0,titleStyler:function(A){A.className="timeline-event-bubble-title"; |
0 | 3700 |
},bodyStyler:function(A){A.className="timeline-event-bubble-body"; |
3701 |
},imageStyler:function(A){A.className="timeline-event-bubble-image"; |
|
3702 |
},wikiStyler:function(A){A.className="timeline-event-bubble-wiki"; |
|
3703 |
},timeStyler:function(A){A.className="timeline-event-bubble-time"; |
|
3704 |
}}}; |
|
3705 |
this.mouseWheel="scroll"; |
|
3706 |
}; |
|
3707 |
||
3708 |
||
3709 |
/* timeline.js */ |
|
3710 |
Timeline.strings={}; |
|
3711 |
Timeline.HORIZONTAL=0; |
|
3712 |
Timeline.VERTICAL=1; |
|
3713 |
Timeline._defaultTheme=null; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3714 |
Timeline.getDefaultLocale=function(){return Timeline.clientLocale; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3715 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3716 |
Timeline.create=function(D,C,B,F){if(Timeline.timelines==null){Timeline.timelines=[]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3717 |
}var A=Timeline.timelines.length; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3718 |
Timeline.timelines[A]=null; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3719 |
var E=new Timeline._Impl(D,C,B,F,A); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3720 |
Timeline.timelines[A]=E; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3721 |
return E; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3722 |
}; |
0 | 3723 |
Timeline.createBandInfo=function(D){var E=("theme" in D)?D.theme:Timeline.getDefaultTheme(); |
3724 |
var B=("eventSource" in D)?D.eventSource:null; |
|
68
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3725 |
var F={interval:SimileAjax.DateTime.gregorianUnitLengths[D.intervalUnit],pixelsPerInterval:D.intervalPixels,theme:E}; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3726 |
if("startsOn" in D||"endsOn" in D){if("startsOn" in D){F.startsOn=D.startsOn; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3727 |
}if("endsOn" in D){F.endsOn=D.endsOn; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3728 |
}}else{F.centersOn=("date" in D)?D.date:new Date(); |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3729 |
}var G=new Timeline.LinearEther(F); |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3730 |
var H=new Timeline.GregorianEtherPainter({unit:D.intervalUnit,multiple:("multiple" in D)?D.multiple:1,theme:E,align:("align" in D)?D.align:undefined}); |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3731 |
var J={showText:("showEventText" in D)?D.showEventText:true,theme:E}; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3732 |
if("eventPainterParams" in D){for(var A in D.eventPainterParams){J[A]=D.eventPainterParams[A]; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3733 |
}}if("trackHeight" in D){J.trackHeight=D.trackHeight; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3734 |
}if("trackGap" in D){J.trackGap=D.trackGap; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3735 |
}var I=("overview" in D&&D.overview)?"overview":("layout" in D?D.layout:"original"); |
0 | 3736 |
var C; |
68
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3737 |
if("eventPainter" in D){C=new D.eventPainter(J); |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3738 |
}else{switch(I){case"overview":C=new Timeline.OverviewEventPainter(J); |
0 | 3739 |
break; |
68
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3740 |
case"detailed":C=new Timeline.DetailedEventPainter(J); |
0 | 3741 |
break; |
68
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3742 |
default:C=new Timeline.OriginalEventPainter(J); |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3743 |
}}return{width:D.width,eventSource:B,timeZone:("timeZone" in D)?D.timeZone:0,ether:G,etherPainter:H,eventPainter:C,theme:E,zoomIndex:("zoomIndex" in D)?D.zoomIndex:0,zoomSteps:("zoomSteps" in D)?D.zoomSteps:null}; |
0 | 3744 |
}; |
3745 |
Timeline.createHotZoneBandInfo=function(D){var E=("theme" in D)?D.theme:Timeline.getDefaultTheme(); |
|
3746 |
var B=("eventSource" in D)?D.eventSource:null; |
|
3747 |
var F=new Timeline.HotZoneEther({centersOn:("date" in D)?D.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[D.intervalUnit],pixelsPerInterval:D.intervalPixels,zones:D.zones,theme:E}); |
|
3748 |
var G=new Timeline.HotZoneGregorianEtherPainter({unit:D.intervalUnit,zones:D.zones,theme:E,align:("align" in D)?D.align:undefined}); |
|
3749 |
var I={showText:("showEventText" in D)?D.showEventText:true,theme:E}; |
|
3750 |
if("eventPainterParams" in D){for(var A in D.eventPainterParams){I[A]=D.eventPainterParams[A]; |
|
3751 |
}}if("trackHeight" in D){I.trackHeight=D.trackHeight; |
|
3752 |
}if("trackGap" in D){I.trackGap=D.trackGap; |
|
3753 |
}var H=("overview" in D&&D.overview)?"overview":("layout" in D?D.layout:"original"); |
|
3754 |
var C; |
|
3755 |
if("eventPainter" in D){C=new D.eventPainter(I); |
|
3756 |
}else{switch(H){case"overview":C=new Timeline.OverviewEventPainter(I); |
|
3757 |
break; |
|
3758 |
case"detailed":C=new Timeline.DetailedEventPainter(I); |
|
3759 |
break; |
|
3760 |
default:C=new Timeline.OriginalEventPainter(I); |
|
3761 |
}}return{width:D.width,eventSource:B,timeZone:("timeZone" in D)?D.timeZone:0,ether:F,etherPainter:G,eventPainter:C,theme:E,zoomIndex:("zoomIndex" in D)?D.zoomIndex:0,zoomSteps:("zoomSteps" in D)?D.zoomSteps:null}; |
|
3762 |
}; |
|
3763 |
Timeline.getDefaultTheme=function(){if(Timeline._defaultTheme==null){Timeline._defaultTheme=Timeline.ClassicTheme.create(Timeline.getDefaultLocale()); |
|
3764 |
}return Timeline._defaultTheme; |
|
3765 |
}; |
|
3766 |
Timeline.setDefaultTheme=function(A){Timeline._defaultTheme=A; |
|
3767 |
}; |
|
3768 |
Timeline.loadXML=function(A,C){var D=function(G,E,F){alert("Failed to load data xml from "+A+"\n"+G); |
|
3769 |
}; |
|
3770 |
var B=function(F){var E=F.responseXML; |
|
3771 |
if(!E.documentElement&&F.responseStream){E.load(F.responseStream); |
|
3772 |
}C(E,A); |
|
3773 |
}; |
|
3774 |
SimileAjax.XmlHttp.get(A,D,B); |
|
3775 |
}; |
|
3776 |
Timeline.loadJSON=function(url,f){var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText); |
|
3777 |
}; |
|
3778 |
var fDone=function(xmlhttp){f(eval("("+xmlhttp.responseText+")"),url); |
|
3779 |
}; |
|
3780 |
SimileAjax.XmlHttp.get(url,fError,fDone); |
|
3781 |
}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3782 |
Timeline.getTimelineFromID=function(A){return Timeline.timelines[A]; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3783 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3784 |
Timeline._Impl=function(D,C,B,E,A){SimileAjax.WindowManager.initialize(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3785 |
this._containerDiv=D; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3786 |
this._bandInfos=C; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3787 |
this._orientation=B==null?Timeline.HORIZONTAL:B; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3788 |
this._unit=(E!=null)?E:SimileAjax.NativeDateUnit; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3789 |
this._starting=true; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3790 |
this._autoResizing=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3791 |
this.autoWidth=C&&C[0]&&C[0].theme&&C[0].theme.autoWidth; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3792 |
this.autoWidthAnimationTime=C&&C[0]&&C[0].theme&&C[0].theme.autoWidthAnimationTime; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3793 |
this.timelineID=A; |
0 | 3794 |
this._initialize(); |
3795 |
}; |
|
3796 |
Timeline._Impl.prototype.dispose=function(){for(var A=0; |
|
3797 |
A<this._bands.length; |
|
3798 |
A++){this._bands[A].dispose(); |
|
3799 |
}this._bands=null; |
|
3800 |
this._bandInfos=null; |
|
3801 |
this._containerDiv.innerHTML=""; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3802 |
Timeline.timelines[this.timelineID]=null; |
0 | 3803 |
}; |
3804 |
Timeline._Impl.prototype.getBandCount=function(){return this._bands.length; |
|
3805 |
}; |
|
3806 |
Timeline._Impl.prototype.getBand=function(A){return this._bands[A]; |
|
3807 |
}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3808 |
Timeline._Impl.prototype.finishedEventLoading=function(){this._autoWidthCheck(true); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3809 |
this._starting=false; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3810 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3811 |
Timeline._Impl.prototype.layout=function(){this._autoWidthCheck(true); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3812 |
this._distributeWidths(); |
0 | 3813 |
}; |
3814 |
Timeline._Impl.prototype.paint=function(){for(var A=0; |
|
3815 |
A<this._bands.length; |
|
3816 |
A++){this._bands[A].paint(); |
|
3817 |
}}; |
|
3818 |
Timeline._Impl.prototype.getDocument=function(){return this._containerDiv.ownerDocument; |
|
3819 |
}; |
|
3820 |
Timeline._Impl.prototype.addDiv=function(A){this._containerDiv.appendChild(A); |
|
3821 |
}; |
|
3822 |
Timeline._Impl.prototype.removeDiv=function(A){this._containerDiv.removeChild(A); |
|
3823 |
}; |
|
3824 |
Timeline._Impl.prototype.isHorizontal=function(){return this._orientation==Timeline.HORIZONTAL; |
|
3825 |
}; |
|
3826 |
Timeline._Impl.prototype.isVertical=function(){return this._orientation==Timeline.VERTICAL; |
|
3827 |
}; |
|
3828 |
Timeline._Impl.prototype.getPixelLength=function(){return this._orientation==Timeline.HORIZONTAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight; |
|
3829 |
}; |
|
3830 |
Timeline._Impl.prototype.getPixelWidth=function(){return this._orientation==Timeline.VERTICAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight; |
|
3831 |
}; |
|
3832 |
Timeline._Impl.prototype.getUnit=function(){return this._unit; |
|
3833 |
}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3834 |
Timeline._Impl.prototype.getWidthStyle=function(){return this._orientation==Timeline.HORIZONTAL?"height":"width"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3835 |
}; |
0 | 3836 |
Timeline._Impl.prototype.loadXML=function(B,D){var A=this; |
3837 |
var E=function(H,F,G){alert("Failed to load data xml from "+B+"\n"+H); |
|
3838 |
A.hideLoadingMessage(); |
|
3839 |
}; |
|
3840 |
var C=function(G){try{var F=G.responseXML; |
|
3841 |
if(!F.documentElement&&G.responseStream){F.load(G.responseStream); |
|
3842 |
}D(F,B); |
|
3843 |
}finally{A.hideLoadingMessage(); |
|
3844 |
}}; |
|
3845 |
this.showLoadingMessage(); |
|
3846 |
window.setTimeout(function(){SimileAjax.XmlHttp.get(B,E,C); |
|
3847 |
},0); |
|
3848 |
}; |
|
3849 |
Timeline._Impl.prototype.loadJSON=function(url,f){var tl=this; |
|
3850 |
var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText); |
|
3851 |
tl.hideLoadingMessage(); |
|
3852 |
}; |
|
3853 |
var fDone=function(xmlhttp){try{f(eval("("+xmlhttp.responseText+")"),url); |
|
3854 |
}finally{tl.hideLoadingMessage(); |
|
3855 |
}}; |
|
3856 |
this.showLoadingMessage(); |
|
3857 |
window.setTimeout(function(){SimileAjax.XmlHttp.get(url,fError,fDone); |
|
3858 |
},0); |
|
3859 |
}; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3860 |
Timeline._Impl.prototype._autoWidthScrollListener=function(A){A.getTimeline()._autoWidthCheck(false); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3861 |
}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3862 |
Timeline._Impl.prototype._autoWidthCheck=function(C){var E=this; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3863 |
var B=E._starting; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3864 |
var D=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3865 |
function A(){var H=E.getWidthStyle(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3866 |
if(B){E._containerDiv.style[H]=D+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3867 |
}else{E._autoResizing=true; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3868 |
var G={}; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3869 |
G[H]=D+"px"; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3870 |
SimileAjax.jQuery(E._containerDiv).animate(G,E.autoWidthAnimationTime,"linear",function(){E._autoResizing=false; |
0 | 3871 |
}); |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3872 |
}}function F(){var I=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3873 |
var G=E.getPixelWidth(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3874 |
if(E._autoResizing){return ; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3875 |
}for(var H=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3876 |
H<E._bands.length; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3877 |
H++){E._bands[H].checkAutoWidth(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3878 |
I+=E._bandInfos[H].width; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3879 |
}if(I>G||C){D=I; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3880 |
A(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3881 |
E._distributeWidths(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3882 |
}}if(!E.autoWidth){return ; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3883 |
}F(); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3884 |
}; |
68
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3885 |
Timeline._Impl.prototype._initialize=function(){var E=this._containerDiv; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3886 |
var G=E.ownerDocument; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3887 |
E.className=E.className.split(" ").concat("timeline-container").join(" "); |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3888 |
var A=(this.isHorizontal())?"horizontal":"vertical"; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3889 |
E.className+=" timeline-"+A; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3890 |
while(E.firstChild){E.removeChild(E.firstChild); |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3891 |
}var B=SimileAjax.Graphics.createTranslucentImage(Timeline.urlPrefix+(this.isHorizontal()?"data/timeline/copyright-vertical.png":"data/timeline/copyright.png")); |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3892 |
B.className="timeline-copyright"; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3893 |
B.title="Timeline © SIMILE - http://simile.mit.edu/timeline/"; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3894 |
SimileAjax.DOM.registerEvent(B,"click",function(){window.location="http://simile.mit.edu/timeline/"; |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3895 |
}); |
68
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3896 |
E.appendChild(B); |
0 | 3897 |
this._bands=[]; |
3898 |
for(var C=0; |
|
3899 |
C<this._bandInfos.length; |
|
68
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3900 |
C++){var F=this._bandInfos[C]; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3901 |
var D=F.bandClass||Timeline._Band; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3902 |
var H=new D(this,this._bandInfos[C],C); |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3903 |
this._bands.push(H); |
0 | 3904 |
}this._distributeWidths(); |
3905 |
for(var C=0; |
|
3906 |
C<this._bandInfos.length; |
|
3907 |
C++){var F=this._bandInfos[C]; |
|
3908 |
if("syncWith" in F){this._bands[C].setSyncWithBand(this._bands[F.syncWith],("highlight" in F)?F.highlight:false); |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3909 |
}}if(this.autoWidth){for(var C=0; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3910 |
C<this._bands.length; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3911 |
C++){this._bands[C].addOnScrollListener(this._autoWidthScrollListener); |
68
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3912 |
}}var I=SimileAjax.Graphics.createMessageBubble(G); |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3913 |
I.containerDiv.className="timeline-message-container"; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3914 |
E.appendChild(I.containerDiv); |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3915 |
I.contentDiv.className="timeline-message"; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3916 |
I.contentDiv.innerHTML="<img src='"+Timeline.urlPrefix+"data/timeline/progress-running.gif' /> Loading..."; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3917 |
this.showLoadingMessage=function(){I.containerDiv.style.display="block"; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3918 |
}; |
c0a4be863a7d
regenerate timeline-bundle.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
67
diff
changeset
|
3919 |
this.hideLoadingMessage=function(){I.containerDiv.style.display="none"; |
0 | 3920 |
}; |
3921 |
}; |
|
3922 |
Timeline._Impl.prototype._distributeWidths=function(){var B=this.getPixelLength(); |
|
3923 |
var A=this.getPixelWidth(); |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3924 |
var C=0; |
0 | 3925 |
for(var E=0; |
3926 |
E<this._bands.length; |
|
3927 |
E++){var I=this._bands[E]; |
|
3928 |
var J=this._bandInfos[E]; |
|
3929 |
var F=J.width; |
|
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3930 |
var D; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3931 |
if(typeof F=="string"){var H=F.indexOf("%"); |
0 | 3932 |
if(H>0){var G=parseInt(F.substr(0,H)); |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3933 |
D=Math.round(G*A/100); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3934 |
}else{D=parseInt(F); |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3935 |
}}else{D=F; |
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3936 |
}I.setBandShiftAndWidth(C,D); |
0 | 3937 |
I.setViewLength(B); |
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3938 |
C+=D; |
0 | 3939 |
}}; |
3940 |
Timeline._Impl.prototype.zoom=function(G,B,F,D){var C=new RegExp("^timeline-band-([0-9]+)$"); |
|
3941 |
var E=null; |
|
3942 |
var A=C.exec(D.id); |
|
3943 |
if(A){E=parseInt(A[1]); |
|
3944 |
}if(E!=null){this._bands[E].zoom(G,B,F,D); |
|
3945 |
}this.paint(); |
|
3946 |
}; |
|
3947 |
||
3948 |
||
3949 |
/* units.js */ |
|
3950 |
Timeline.NativeDateUnit=new Object(); |
|
3951 |
Timeline.NativeDateUnit.createLabeller=function(A,B){return new Timeline.GregorianDateLabeller(A,B); |
|
3952 |
}; |
|
3953 |
Timeline.NativeDateUnit.makeDefaultValue=function(){return new Date(); |
|
3954 |
}; |
|
3955 |
Timeline.NativeDateUnit.cloneValue=function(A){return new Date(A.getTime()); |
|
3956 |
}; |
|
3957 |
Timeline.NativeDateUnit.getParser=function(A){if(typeof A=="string"){A=A.toLowerCase(); |
|
3958 |
}return(A=="iso8601"||A=="iso 8601")?Timeline.DateTime.parseIso8601DateTime:Timeline.DateTime.parseGregorianDateTime; |
|
3959 |
}; |
|
3960 |
Timeline.NativeDateUnit.parseFromObject=function(A){return Timeline.DateTime.parseGregorianDateTime(A); |
|
3961 |
}; |
|
3962 |
Timeline.NativeDateUnit.toNumber=function(A){return A.getTime(); |
|
3963 |
}; |
|
3964 |
Timeline.NativeDateUnit.fromNumber=function(A){return new Date(A); |
|
3965 |
}; |
|
3966 |
Timeline.NativeDateUnit.compare=function(D,C){var B,A; |
|
3967 |
if(typeof D=="object"){B=D.getTime(); |
|
3968 |
}else{B=Number(D); |
|
3969 |
}if(typeof C=="object"){A=C.getTime(); |
|
3970 |
}else{A=Number(C); |
|
3971 |
}return B-A; |
|
3972 |
}; |
|
3973 |
Timeline.NativeDateUnit.earlier=function(B,A){return Timeline.NativeDateUnit.compare(B,A)<0?B:A; |
|
3974 |
}; |
|
3975 |
Timeline.NativeDateUnit.later=function(B,A){return Timeline.NativeDateUnit.compare(B,A)>0?B:A; |
|
3976 |
}; |
|
3977 |
Timeline.NativeDateUnit.change=function(A,B){return new Date(A.getTime()+B); |
|
3978 |
}; |
|
3979 |
||
67
60a291fe7965
regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3980 |
/******** end of simile-timeline-bundle.js ********/ |