web/data/cubicweb.timeline-bundle.js
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--
give row when selecting/dispatching content navigation component
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     1
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
var SimileAjax = {
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     3
    loaded:                 false,
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     4
    loadingScriptsCount:    0,
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     5
    error:                  null,
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     6
    params:                 { bundle:"true" }
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     7
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     8
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     9
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    10
/**
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    11
 * Parse out the query parameters from a URL
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    12
 * @param {String} url    the url to parse, or location.href if undefined
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    13
 * @param {Object} to     optional object to extend with the parameters
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    14
 * @param {Object} types  optional object mapping keys to value types
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    15
 *        (String, Number, Boolean or Array, String by default)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    16
 * @return a key/value Object whose keys are the query parameter names
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    17
 * @type Object
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    18
 */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    19
SimileAjax.parseURLParameters = function(url, to, types) {
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    20
    to = to || {};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    21
    types = types || {};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    22
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    23
    if (typeof url == "undefined") {
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    24
        url = location.href;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    25
    }
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    26
    var q = url.indexOf("?");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    27
    if (q < 0) {
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    28
        return to;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    29
    }
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    30
    url = (url+"#").slice(q+1, url.indexOf("#")); // toss the URL fragment
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    31
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    32
    var params = url.split("&"), param, parsed = {};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    33
    var decode = window.decodeURIComponent || unescape;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    34
    for (var i = 0; param = params[i]; i++) {
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    35
        var eq = param.indexOf("=");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    36
        var name = decode(param.slice(0,eq));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    37
        var old = parsed[name];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    38
        if (typeof old == "undefined") {
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    39
            old = [];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    40
        } else if (!(old instanceof Array)) {
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    41
            old = [old];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    42
        }
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    43
        parsed[name] = old.concat(decode(param.slice(eq+1)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    44
    }
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    45
    for (var i in parsed) {
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    46
        if (!parsed.hasOwnProperty(i)) continue;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    47
        var type = types[i] || String;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    48
        var data = parsed[i];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    49
        if (!(data instanceof Array)) {
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    50
            data = [data];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    51
        }
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    52
        if (type === Boolean && data[0] == "false") {
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    53
            to[i] = false; // because Boolean("false") === true
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    54
        } else {
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    55
            to[i] = type.apply(this, data);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    56
        }
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    57
    }
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    58
    return to;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    59
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    60
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    61
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    62
SimileAjax.Platform = new Object();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    63
SimileAjax.urlPrefix = baseuri();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    68
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    72
if(typeof window["$"]=="undefined"){window.$=SimileAjax.jQuery;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    73
}SimileAjax.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    74
SimileAjax.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    75
(function(){var C=navigator.appName.toLowerCase();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    76
var A=navigator.userAgent.toLowerCase();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    77
SimileAjax.Platform.os.isMac=(A.indexOf("mac")!=-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    78
SimileAjax.Platform.os.isWin=(A.indexOf("win")!=-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    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);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    80
SimileAjax.Platform.os.isUnix=(A.indexOf("x11")!=-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    81
SimileAjax.Platform.browser.isIE=(C.indexOf("microsoft")!=-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    82
SimileAjax.Platform.browser.isNetscape=(C.indexOf("netscape")!=-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    83
SimileAjax.Platform.browser.isMozilla=(A.indexOf("mozilla")!=-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    84
SimileAjax.Platform.browser.isFirefox=(A.indexOf("firefox")!=-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    85
SimileAjax.Platform.browser.isOpera=(C.indexOf("opera")!=-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    86
SimileAjax.Platform.browser.isSafari=(C.indexOf("safari")!=-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    87
var E=function(G){var F=G.split(".");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    88
SimileAjax.Platform.browser.majorVersion=parseInt(F[0]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    89
SimileAjax.Platform.browser.minorVersion=parseInt(F[1]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    90
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    91
var B=function(H,G,I){var F=H.indexOf(G,I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    92
return F>=0?F:H.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    93
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    94
if(SimileAjax.Platform.browser.isMozilla){var D=A.indexOf("mozilla/");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    95
if(D>=0){E(A.substring(D+8,B(A," ",D)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    96
}}if(SimileAjax.Platform.browser.isIE){var D=A.indexOf("msie ");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    97
if(D>=0){E(A.substring(D+5,B(A,";",D)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    98
}}if(SimileAjax.Platform.browser.isNetscape){var D=A.indexOf("rv:");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    99
if(D>=0){E(A.substring(D+3,B(A,")",D)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   100
}}if(SimileAjax.Platform.browser.isFirefox){var D=A.indexOf("firefox/");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   101
if(D>=0){E(A.substring(D+8,B(A," ",D)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   102
}}if(!("localeCompare" in String.prototype)){String.prototype.localeCompare=function(F){if(this<F){return -1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   103
}else{if(this>F){return 1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   104
}else{return 0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   105
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   106
}})();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   107
SimileAjax.Platform.getDefaultLocale=function(){return SimileAjax.Platform.clientLocale;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   108
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   109
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   110
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   111
/* ajax.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   112
SimileAjax.ListenerQueue=function(A){this._listeners=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   113
this._wildcardHandlerName=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   114
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   115
SimileAjax.ListenerQueue.prototype.add=function(A){this._listeners.push(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   116
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   117
SimileAjax.ListenerQueue.prototype.remove=function(C){var B=this._listeners;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   118
for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   119
A<B.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   120
A++){if(B[A]==C){B.splice(A,1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   121
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   122
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   123
SimileAjax.ListenerQueue.prototype.fire=function(B,A){var D=[].concat(this._listeners);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   124
for(var C=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   125
C<D.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   126
C++){var E=D[C];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   127
if(B in E){try{E[B].apply(E,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   128
}catch(F){SimileAjax.Debug.exception("Error firing event of name "+B,F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   129
}}else{if(this._wildcardHandlerName!=null&&this._wildcardHandlerName in E){try{E[this._wildcardHandlerName].apply(E,[B]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   130
}catch(F){SimileAjax.Debug.exception("Error firing event of name "+B+" to wildcard handler",F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   131
}}}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   132
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   133
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   134
/* data-structure.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   135
SimileAjax.Set=function(A){this._hash={};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   136
this._count=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   137
if(A instanceof Array){for(var B=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   138
B<A.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   139
B++){this.add(A[B]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   140
}}else{if(A instanceof SimileAjax.Set){this.addSet(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   141
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   142
SimileAjax.Set.prototype.add=function(A){if(!(A in this._hash)){this._hash[A]=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   143
this._count++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   144
return true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   145
}return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   146
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   147
SimileAjax.Set.prototype.addSet=function(B){for(var A in B._hash){this.add(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   148
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   149
SimileAjax.Set.prototype.remove=function(A){if(A in this._hash){delete this._hash[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   150
this._count--;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   151
return true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   152
}return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   153
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   154
SimileAjax.Set.prototype.removeSet=function(B){for(var A in B._hash){this.remove(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   155
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   156
SimileAjax.Set.prototype.retainSet=function(B){for(var A in this._hash){if(!B.contains(A)){delete this._hash[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   157
this._count--;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   158
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   159
SimileAjax.Set.prototype.contains=function(A){return(A in this._hash);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   160
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   161
SimileAjax.Set.prototype.size=function(){return this._count;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   162
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   163
SimileAjax.Set.prototype.toArray=function(){var A=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   164
for(var B in this._hash){A.push(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   165
}return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   166
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   167
SimileAjax.Set.prototype.visit=function(A){for(var B in this._hash){if(A(B)==true){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   168
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   169
SimileAjax.SortedArray=function(B,A){this._a=(A instanceof Array)?A:[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   170
this._compare=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   171
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   172
SimileAjax.SortedArray.prototype.add=function(C){var A=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   173
var B=this.find(function(D){return A._compare(D,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   174
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   175
if(B<this._a.length){this._a.splice(B,0,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   176
}else{this._a.push(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   177
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   178
SimileAjax.SortedArray.prototype.remove=function(C){var A=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   179
var B=this.find(function(D){return A._compare(D,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   180
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   181
while(B<this._a.length&&this._compare(this._a[B],C)==0){if(this._a[B]==C){this._a.splice(B,1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   182
return true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   183
}else{B++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   184
}}return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   185
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   186
SimileAjax.SortedArray.prototype.removeAll=function(){this._a=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   187
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   188
SimileAjax.SortedArray.prototype.elementAt=function(A){return this._a[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   189
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   190
SimileAjax.SortedArray.prototype.length=function(){return this._a.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   191
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   192
SimileAjax.SortedArray.prototype.find=function(D){var B=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   193
var A=this._a.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   194
while(B<A){var C=Math.floor((B+A)/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   195
var E=D(this._a[C]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   196
if(C==B){return E<0?B+1:B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   197
}else{if(E<0){B=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   198
}else{A=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   199
}}}return B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   200
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   201
SimileAjax.SortedArray.prototype.getFirst=function(){return(this._a.length>0)?this._a[0]:null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   202
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   203
SimileAjax.SortedArray.prototype.getLast=function(){return(this._a.length>0)?this._a[this._a.length-1]:null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   204
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   205
SimileAjax.EventIndex=function(B){var A=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   206
this._unit=(B!=null)?B:SimileAjax.NativeDateUnit;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   207
this._events=new SimileAjax.SortedArray(function(D,C){return A._unit.compare(D.getStart(),C.getStart());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   208
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   209
this._idToEvent={};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   210
this._indexed=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   211
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   212
SimileAjax.EventIndex.prototype.getUnit=function(){return this._unit;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   213
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   214
SimileAjax.EventIndex.prototype.getEvent=function(A){return this._idToEvent[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   215
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   216
SimileAjax.EventIndex.prototype.add=function(A){this._events.add(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   217
this._idToEvent[A.getID()]=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   218
this._indexed=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   219
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   220
SimileAjax.EventIndex.prototype.removeAll=function(){this._events.removeAll();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   221
this._idToEvent={};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   222
this._indexed=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   223
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   224
SimileAjax.EventIndex.prototype.getCount=function(){return this._events.length();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   225
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   226
SimileAjax.EventIndex.prototype.getIterator=function(A,B){if(!this._indexed){this._index();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   227
}return new SimileAjax.EventIndex._Iterator(this._events,A,B,this._unit);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   228
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   229
SimileAjax.EventIndex.prototype.getReverseIterator=function(A,B){if(!this._indexed){this._index();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   230
}return new SimileAjax.EventIndex._ReverseIterator(this._events,A,B,this._unit);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   231
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   232
SimileAjax.EventIndex.prototype.getAllIterator=function(){return new SimileAjax.EventIndex._AllIterator(this._events);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   233
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   234
SimileAjax.EventIndex.prototype.getEarliestDate=function(){var A=this._events.getFirst();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   235
return(A==null)?null:A.getStart();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   236
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   237
SimileAjax.EventIndex.prototype.getLatestDate=function(){var A=this._events.getLast();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   238
if(A==null){return null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   239
}if(!this._indexed){this._index();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   240
}var C=A._earliestOverlapIndex;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   241
var B=this._events.elementAt(C).getEnd();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   242
for(var D=C+1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   243
D<this._events.length();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   244
D++){B=this._unit.later(B,this._events.elementAt(D).getEnd());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   245
}return B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   246
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   247
SimileAjax.EventIndex.prototype._index=function(){var D=this._events.length();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   248
for(var E=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   249
E<D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   250
E++){var C=this._events.elementAt(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   251
C._earliestOverlapIndex=E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   252
}var G=1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   253
for(var E=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   254
E<D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   255
E++){var C=this._events.elementAt(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   256
var B=C.getEnd();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   257
G=Math.max(G,E+1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   258
while(G<D){var A=this._events.elementAt(G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   259
var F=A.getStart();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   260
if(this._unit.compare(F,B)<0){A._earliestOverlapIndex=E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   261
G++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   262
}else{break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   263
}}}this._indexed=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   264
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   265
SimileAjax.EventIndex._Iterator=function(B,A,D,C){this._events=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   266
this._startDate=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   267
this._endDate=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   268
this._unit=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   269
this._currentIndex=B.find(function(E){return C.compare(E.getStart(),A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   270
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   271
if(this._currentIndex-1>=0){this._currentIndex=this._events.elementAt(this._currentIndex-1)._earliestOverlapIndex;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   272
}this._currentIndex--;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   273
this._maxIndex=B.find(function(E){return C.compare(E.getStart(),D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   274
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   275
this._hasNext=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   276
this._next=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   277
this._findNext();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   278
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   279
SimileAjax.EventIndex._Iterator.prototype={hasNext:function(){return this._hasNext;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   280
},next:function(){if(this._hasNext){var A=this._next;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   281
this._findNext();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   282
return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   283
}else{return null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   284
}},_findNext:function(){var B=this._unit;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   285
while((++this._currentIndex)<this._maxIndex){var A=this._events.elementAt(this._currentIndex);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   286
if(B.compare(A.getStart(),this._endDate)<0&&B.compare(A.getEnd(),this._startDate)>0){this._next=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   287
this._hasNext=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   288
return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   289
}}this._next=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   290
this._hasNext=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   291
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   292
SimileAjax.EventIndex._ReverseIterator=function(B,A,D,C){this._events=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   293
this._startDate=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   294
this._endDate=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   295
this._unit=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   296
this._minIndex=B.find(function(E){return C.compare(E.getStart(),A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   297
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   298
if(this._minIndex-1>=0){this._minIndex=this._events.elementAt(this._minIndex-1)._earliestOverlapIndex;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   299
}this._maxIndex=B.find(function(E){return C.compare(E.getStart(),D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   300
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   301
this._currentIndex=this._maxIndex;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   302
this._hasNext=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   303
this._next=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   304
this._findNext();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   305
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   306
SimileAjax.EventIndex._ReverseIterator.prototype={hasNext:function(){return this._hasNext;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   307
},next:function(){if(this._hasNext){var A=this._next;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   308
this._findNext();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   309
return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   310
}else{return null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   311
}},_findNext:function(){var B=this._unit;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   312
while((--this._currentIndex)>=this._minIndex){var A=this._events.elementAt(this._currentIndex);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   313
if(B.compare(A.getStart(),this._endDate)<0&&B.compare(A.getEnd(),this._startDate)>0){this._next=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   314
this._hasNext=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   315
return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   316
}}this._next=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   317
this._hasNext=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   318
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   319
SimileAjax.EventIndex._AllIterator=function(A){this._events=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   320
this._index=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   321
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   322
SimileAjax.EventIndex._AllIterator.prototype={hasNext:function(){return this._index<this._events.length();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   323
},next:function(){return this._index<this._events.length()?this._events.elementAt(this._index++):null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   324
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   325
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   326
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   327
/* date-time.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   328
SimileAjax.DateTime=new Object();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   329
SimileAjax.DateTime.MILLISECOND=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   330
SimileAjax.DateTime.SECOND=1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   331
SimileAjax.DateTime.MINUTE=2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   332
SimileAjax.DateTime.HOUR=3;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   333
SimileAjax.DateTime.DAY=4;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   334
SimileAjax.DateTime.WEEK=5;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   335
SimileAjax.DateTime.MONTH=6;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   336
SimileAjax.DateTime.YEAR=7;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   337
SimileAjax.DateTime.DECADE=8;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   338
SimileAjax.DateTime.CENTURY=9;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   339
SimileAjax.DateTime.MILLENNIUM=10;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   340
SimileAjax.DateTime.EPOCH=-1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   341
SimileAjax.DateTime.ERA=-2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   342
SimileAjax.DateTime.gregorianUnitLengths=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   343
(function(){var B=SimileAjax.DateTime;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   344
var A=B.gregorianUnitLengths;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   345
A[B.MILLISECOND]=1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   346
A[B.SECOND]=1000;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   347
A[B.MINUTE]=A[B.SECOND]*60;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   348
A[B.HOUR]=A[B.MINUTE]*60;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   349
A[B.DAY]=A[B.HOUR]*24;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   350
A[B.WEEK]=A[B.DAY]*7;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   351
A[B.MONTH]=A[B.DAY]*31;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   352
A[B.YEAR]=A[B.DAY]*365;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   353
A[B.DECADE]=A[B.YEAR]*10;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   354
A[B.CENTURY]=A[B.YEAR]*100;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   355
A[B.MILLENNIUM]=A[B.YEAR]*1000;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   356
})();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   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("|")+")?$");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   358
SimileAjax.DateTime._timezoneRegexp=new RegExp("Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   359
SimileAjax.DateTime._timeRegexp=new RegExp("^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(.([0-9]+))?)?)?$");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   360
SimileAjax.DateTime.setIso8601Date=function(H,F){var I=F.match(SimileAjax.DateTime._dateRegexp);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   361
if(!I){throw new Error("Invalid date string: "+F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   362
}var B=(I[1]=="-")?-1:1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   363
var J=B*I[2];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   364
var G=I[5];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   365
var C=I[7];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   366
var E=I[9];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   367
var A=I[11];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   368
var M=(I[13])?I[13]:1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   369
H.setUTCFullYear(J);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   370
if(E){H.setUTCMonth(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   371
H.setUTCDate(Number(E));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   372
}else{if(A){H.setUTCMonth(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   373
H.setUTCDate(1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   374
var L=H.getUTCDay();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   375
var K=(L)?L:7;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   376
var D=Number(M)+(7*Number(A));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   377
if(K<=4){H.setUTCDate(D+1-K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   378
}else{H.setUTCDate(D+8-K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   379
}}else{if(G){H.setUTCDate(1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   380
H.setUTCMonth(G-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   381
}if(C){H.setUTCDate(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   382
}}}return H;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   383
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   384
SimileAjax.DateTime.setIso8601Time=function(F,C){var G=C.match(SimileAjax.DateTime._timeRegexp);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   385
if(!G){SimileAjax.Debug.warn("Invalid time string: "+C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   386
return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   387
}var A=G[1];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   388
var E=Number((G[3])?G[3]:0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   389
var D=(G[5])?G[5]:0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   390
var B=G[7]?(Number("0."+G[7])*1000):0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   391
F.setUTCHours(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   392
F.setUTCMinutes(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   393
F.setUTCSeconds(D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   394
F.setUTCMilliseconds(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   395
return F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   396
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   397
SimileAjax.DateTime.timezoneOffset=new Date().getTimezoneOffset();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   398
SimileAjax.DateTime.setIso8601=function(B,A){var D=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   399
var E=(A.indexOf("T")==-1)?A.split(" "):A.split("T");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   400
SimileAjax.DateTime.setIso8601Date(B,E[0]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   401
if(E.length==2){var C=E[1].match(SimileAjax.DateTime._timezoneRegexp);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   402
if(C){if(C[0]=="Z"){D=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   403
}else{D=(Number(C[3])*60)+Number(C[5]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   404
D*=((C[2]=="-")?1:-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   405
}E[1]=E[1].substr(0,E[1].length-C[0].length);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   406
}SimileAjax.DateTime.setIso8601Time(B,E[1]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   407
}if(D==null){D=B.getTimezoneOffset();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   408
}B.setTime(B.getTime()+D*60000);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   409
return B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   410
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   411
SimileAjax.DateTime.parseIso8601DateTime=function(A){try{return SimileAjax.DateTime.setIso8601(new Date(0),A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   412
}catch(B){return null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   413
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   414
SimileAjax.DateTime.parseGregorianDateTime=function(G){if(G==null){return null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   415
}else{if(G instanceof Date){return G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   416
}}var B=G.toString();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   417
if(B.length>0&&B.length<8){var C=B.indexOf(" ");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   418
if(C>0){var A=parseInt(B.substr(0,C));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   419
var E=B.substr(C+1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   420
if(E.toLowerCase()=="bc"){A=1-A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   421
}}else{var A=parseInt(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   422
}var F=new Date(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   423
F.setUTCFullYear(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   424
return F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   425
}try{return new Date(Date.parse(B));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   426
}catch(D){return null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   427
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   428
SimileAjax.DateTime.roundDownToInterval=function(B,G,J,K,A){var D=J*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   429
var I=new Date(B.getTime()+D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   430
var E=function(L){L.setUTCMilliseconds(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   431
L.setUTCSeconds(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   432
L.setUTCMinutes(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   433
L.setUTCHours(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   434
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   435
var C=function(L){E(L);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   436
L.setUTCDate(1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   437
L.setUTCMonth(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   438
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   439
switch(G){case SimileAjax.DateTime.MILLISECOND:var H=I.getUTCMilliseconds();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   440
I.setUTCMilliseconds(H-(H%K));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   441
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   442
case SimileAjax.DateTime.SECOND:I.setUTCMilliseconds(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   443
var H=I.getUTCSeconds();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   444
I.setUTCSeconds(H-(H%K));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   445
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   446
case SimileAjax.DateTime.MINUTE:I.setUTCMilliseconds(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   447
I.setUTCSeconds(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   448
var H=I.getUTCMinutes();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   449
I.setTime(I.getTime()-(H%K)*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   450
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   451
case SimileAjax.DateTime.HOUR:I.setUTCMilliseconds(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   452
I.setUTCSeconds(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   453
I.setUTCMinutes(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   454
var H=I.getUTCHours();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   455
I.setUTCHours(H-(H%K));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   456
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   457
case SimileAjax.DateTime.DAY:E(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   458
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   459
case SimileAjax.DateTime.WEEK:E(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   460
var F=(I.getUTCDay()+7-A)%7;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   461
I.setTime(I.getTime()-F*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   462
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   463
case SimileAjax.DateTime.MONTH:E(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   464
I.setUTCDate(1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   465
var H=I.getUTCMonth();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   466
I.setUTCMonth(H-(H%K));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   467
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   468
case SimileAjax.DateTime.YEAR:C(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   469
var H=I.getUTCFullYear();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   470
I.setUTCFullYear(H-(H%K));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   471
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   472
case SimileAjax.DateTime.DECADE:C(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   473
I.setUTCFullYear(Math.floor(I.getUTCFullYear()/10)*10);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   474
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   475
case SimileAjax.DateTime.CENTURY:C(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   476
I.setUTCFullYear(Math.floor(I.getUTCFullYear()/100)*100);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   477
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   478
case SimileAjax.DateTime.MILLENNIUM:C(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   479
I.setUTCFullYear(Math.floor(I.getUTCFullYear()/1000)*1000);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   480
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   481
}B.setTime(I.getTime()-D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   482
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   483
SimileAjax.DateTime.roundUpToInterval=function(D,F,C,A,B){var E=D.getTime();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   484
SimileAjax.DateTime.roundDownToInterval(D,F,C,A,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   485
if(D.getTime()<E){D.setTime(D.getTime()+SimileAjax.DateTime.gregorianUnitLengths[F]*A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   486
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   487
SimileAjax.DateTime.incrementByInterval=function(B,E,A){A=(typeof A=="undefined")?0:A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   488
var D=A*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   489
var C=new Date(B.getTime()+D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   490
switch(E){case SimileAjax.DateTime.MILLISECOND:C.setTime(C.getTime()+1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   491
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   492
case SimileAjax.DateTime.SECOND:C.setTime(C.getTime()+1000);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   493
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   494
case SimileAjax.DateTime.MINUTE:C.setTime(C.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   495
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   496
case SimileAjax.DateTime.HOUR:C.setTime(C.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   497
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   498
case SimileAjax.DateTime.DAY:C.setUTCDate(C.getUTCDate()+1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   499
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   500
case SimileAjax.DateTime.WEEK:C.setUTCDate(C.getUTCDate()+7);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   501
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   502
case SimileAjax.DateTime.MONTH:C.setUTCMonth(C.getUTCMonth()+1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   503
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   504
case SimileAjax.DateTime.YEAR:C.setUTCFullYear(C.getUTCFullYear()+1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   505
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   506
case SimileAjax.DateTime.DECADE:C.setUTCFullYear(C.getUTCFullYear()+10);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   507
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   508
case SimileAjax.DateTime.CENTURY:C.setUTCFullYear(C.getUTCFullYear()+100);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   509
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   510
case SimileAjax.DateTime.MILLENNIUM:C.setUTCFullYear(C.getUTCFullYear()+1000);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   511
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   512
}B.setTime(C.getTime()-D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   513
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   514
SimileAjax.DateTime.removeTimeZoneOffset=function(B,A){return new Date(B.getTime()+A*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   515
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   516
SimileAjax.DateTime.getTimezone=function(){var A=new Date().getTimezoneOffset();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   517
return A/-60;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   518
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   519
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   520
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   521
/* debug.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   522
SimileAjax.Debug={silent:false};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   523
SimileAjax.Debug.log=function(B){var A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   524
if("console" in window&&"log" in window.console){A=function(C){console.log(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   525
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   526
}else{A=function(C){if(!SimileAjax.Debug.silent){alert(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   527
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   528
}SimileAjax.Debug.log=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   529
A(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   530
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   531
SimileAjax.Debug.warn=function(B){var A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   532
if("console" in window&&"warn" in window.console){A=function(C){console.warn(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   533
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   534
}else{A=function(C){if(!SimileAjax.Debug.silent){alert(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   535
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   536
}SimileAjax.Debug.warn=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   537
A(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   538
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   539
SimileAjax.Debug.exception=function(B,D){var A,C=SimileAjax.parseURLParameters();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   540
if(C.errors=="throw"||SimileAjax.params.errors=="throw"){A=function(F,E){throw (F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   541
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   542
}else{if("console" in window&&"error" in window.console){A=function(F,E){if(E!=null){console.error(E+" %o",F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   543
}else{console.error(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   544
}throw (F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   545
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   546
}else{A=function(F,E){if(!SimileAjax.Debug.silent){alert("Caught exception: "+E+"\n\nDetails: "+("description" in F?F.description:F));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   547
}throw (F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   548
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   549
}}SimileAjax.Debug.exception=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   550
A(B,D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   551
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   552
SimileAjax.Debug.objectToString=function(A){return SimileAjax.Debug._objectToString(A,"");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   553
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   554
SimileAjax.Debug._objectToString=function(D,A){var C=A+" ";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   555
if(typeof D=="object"){var B="{";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   556
for(E in D){B+=C+E+": "+SimileAjax.Debug._objectToString(D[E],C)+"\n";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   557
}B+=A+"}";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   558
return B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   559
}else{if(typeof D=="array"){var B="[";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   560
for(var E=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   561
E<D.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   562
E++){B+=SimileAjax.Debug._objectToString(D[E],C)+"\n";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   563
}B+=A+"]";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   564
return B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   565
}else{return D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   566
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   567
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   568
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   569
/* dom.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   570
SimileAjax.DOM=new Object();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   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);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   572
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   573
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   574
SimileAjax.DOM.registerEvent=function(C,B,D){var A=function(E){E=(E)?E:((event)?event:null);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   575
if(E){var F=(E.target)?E.target:((E.srcElement)?E.srcElement:null);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   576
if(F){F=(F.nodeType==1||F.nodeType==9)?F:F.parentNode;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   577
}return D(C,E,F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   578
}return true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   579
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   580
if(SimileAjax.Platform.browser.isIE){C.attachEvent("on"+B,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   581
}else{C.addEventListener(B,A,false);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   582
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   583
SimileAjax.DOM.getPageCoordinates=function(B){var E=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   584
var D=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   585
if(B.nodeType!=1){B=B.parentNode;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   586
}var C=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   587
while(C!=null){E+=C.offsetLeft;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   588
D+=C.offsetTop;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   589
C=C.offsetParent;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   590
}var A=document.body;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   591
while(B!=null&&B!=A){if("scrollLeft" in B){E-=B.scrollLeft;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   592
D-=B.scrollTop;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   593
}B=B.parentNode;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   594
}return{left:E,top:D};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   595
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   596
SimileAjax.DOM.getSize=function(B){var A=this.getStyle(B,"width");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   597
var C=this.getStyle(B,"height");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   598
if(A.indexOf("px")>-1){A=A.replace("px","");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   599
}if(C.indexOf("px")>-1){C=C.replace("px","");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   600
}return{w:A,h:C};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   601
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   602
SimileAjax.DOM.getStyle=function(B,A){if(B.currentStyle){var C=B.currentStyle[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   603
}else{if(window.getComputedStyle){var C=document.defaultView.getComputedStyle(B,null).getPropertyValue(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   604
}else{var C="";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   605
}}return C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   606
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   607
SimileAjax.DOM.getEventRelativeCoordinates=function(A,B){if(SimileAjax.Platform.browser.isIE){if(A.type=="mousewheel"){var C=SimileAjax.DOM.getPageCoordinates(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   608
return{x:A.clientX-C.left,y:A.clientY-C.top};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   609
}else{return{x:A.offsetX,y:A.offsetY};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   610
}}else{var C=SimileAjax.DOM.getPageCoordinates(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   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};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   612
}else{return{x:A.pageX-C.left,y:A.pageY-C.top};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   613
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   614
SimileAjax.DOM.getEventPageCoordinates=function(A){if(SimileAjax.Platform.browser.isIE){return{x:A.clientX+document.body.scrollLeft,y:A.clientY+document.body.scrollTop};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   615
}else{return{x:A.pageX,y:A.pageY};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   616
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   617
SimileAjax.DOM.hittest=function(A,C,B){return SimileAjax.DOM._hittest(document.body,A,C,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   618
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   619
SimileAjax.DOM._hittest=function(C,L,K,H){var M=C.childNodes;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   620
outer:for(var G=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   621
G<M.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   622
G++){var A=M[G];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   623
for(var F=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   624
F<H.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   625
F++){if(A==H[F]){continue outer;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   626
}}if(A.offsetWidth==0&&A.offsetHeight==0){var B=SimileAjax.DOM._hittest(A,L,K,H);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   627
if(B!=A){return B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   628
}}else{var J=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   629
var E=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   630
var D=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   631
while(D){J+=D.offsetTop;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   632
E+=D.offsetLeft;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   633
D=D.offsetParent;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   634
}if(E<=L&&J<=K&&(L-E)<A.offsetWidth&&(K-J)<A.offsetHeight){return SimileAjax.DOM._hittest(A,L,K,H);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   635
}else{if(A.nodeType==1&&A.tagName=="TR"){var I=SimileAjax.DOM._hittest(A,L,K,H);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   636
if(I!=A){return I;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   637
}}}}}return C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   638
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   639
SimileAjax.DOM.cancelEvent=function(A){A.returnValue=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   640
A.cancelBubble=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   641
if("preventDefault" in A){A.preventDefault();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   642
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   643
SimileAjax.DOM.appendClassName=function(C,D){var B=C.className.split(" ");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   644
for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   645
A<B.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   646
A++){if(B[A]==D){return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   647
}}B.push(D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   648
C.className=B.join(" ");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   649
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   650
SimileAjax.DOM.createInputElement=function(A){var B=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   651
B.innerHTML="<input type='"+A+"' />";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   652
return B.firstChild;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   653
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   654
SimileAjax.DOM.createDOMFromTemplate=function(B){var A={};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   655
A.elmt=SimileAjax.DOM._createDOMFromTemplate(B,A,null);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   656
return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   657
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   658
SimileAjax.DOM._createDOMFromTemplate=function(A,I,E){if(A==null){return null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   659
}else{if(typeof A!="object"){var D=document.createTextNode(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   660
if(E!=null){E.appendChild(D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   661
}return D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   662
}else{var C=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   663
if("tag" in A){var J=A.tag;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   664
if(E!=null){if(J=="tr"){C=E.insertRow(E.rows.length);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   665
}else{if(J=="td"){C=E.insertCell(E.cells.length);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   666
}}}if(C==null){C=J=="input"?SimileAjax.DOM.createInputElement(A.type):document.createElement(J);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   667
if(E!=null){E.appendChild(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   668
}}}else{C=A.elmt;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   669
if(E!=null){E.appendChild(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   670
}}for(var B in A){var G=A[B];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   671
if(B=="field"){I[G]=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   672
}else{if(B=="className"){C.className=G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   673
}else{if(B=="id"){C.id=G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   674
}else{if(B=="title"){C.title=G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   675
}else{if(B=="type"&&C.tagName=="input"){}else{if(B=="style"){for(n in G){var H=G[n];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   676
if(n=="float"){n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   677
}C.style[n]=H;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   678
}}else{if(B=="children"){for(var F=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   679
F<G.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   680
F++){SimileAjax.DOM._createDOMFromTemplate(G[F],I,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   681
}}else{if(B!="tag"&&B!="elmt"){C.setAttribute(B,G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   682
}}}}}}}}}return C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   683
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   684
SimileAjax.DOM._cachedParent=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   685
SimileAjax.DOM.createElementFromString=function(A){if(SimileAjax.DOM._cachedParent==null){SimileAjax.DOM._cachedParent=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   686
}SimileAjax.DOM._cachedParent.innerHTML=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   687
return SimileAjax.DOM._cachedParent.firstChild;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   688
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   689
SimileAjax.DOM.createDOMFromString=function(A,C,D){var B=typeof A=="string"?document.createElement(A):A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   690
B.innerHTML=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   691
var E={elmt:B};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   692
SimileAjax.DOM._processDOMChildrenConstructedFromString(E,B,D!=null?D:{});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   693
return E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   694
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   695
SimileAjax.DOM._processDOMConstructedFromString=function(D,A,B){var E=A.id;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   696
if(E!=null&&E.length>0){A.removeAttribute("id");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   697
if(E in B){var C=A.parentNode;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   698
C.insertBefore(B[E],A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   699
C.removeChild(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   700
D[E]=B[E];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   701
return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   702
}else{D[E]=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   703
}}if(A.hasChildNodes()){SimileAjax.DOM._processDOMChildrenConstructedFromString(D,A,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   704
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   705
SimileAjax.DOM._processDOMChildrenConstructedFromString=function(E,B,D){var C=B.firstChild;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   706
while(C!=null){var A=C.nextSibling;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   707
if(C.nodeType==1){SimileAjax.DOM._processDOMConstructedFromString(E,C,D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   708
}C=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   709
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   710
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   711
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   712
/* graphics.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   713
SimileAjax.Graphics=new Object();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   714
SimileAjax.Graphics.pngIsTranslucent=(!SimileAjax.Platform.browser.isIE)||(SimileAjax.Platform.browser.majorVersion>6);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   715
SimileAjax.Graphics._createTranslucentImage1=function(A,C){var B=document.createElement("img");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   716
B.setAttribute("src",A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   717
if(C!=null){B.style.verticalAlign=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   718
}return B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   719
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   720
SimileAjax.Graphics._createTranslucentImage2=function(A,C){var B=document.createElement("img");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   721
B.style.width="1px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   722
B.style.height="1px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   723
B.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A+"', sizingMethod='image')";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   724
B.style.verticalAlign=(C!=null)?C:"middle";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   725
return B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   726
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   727
SimileAjax.Graphics.createTranslucentImage=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImage1:SimileAjax.Graphics._createTranslucentImage2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   728
SimileAjax.Graphics._createTranslucentImageHTML1=function(A,B){return'<img src="'+A+'"'+(B!=null?' style="vertical-align: '+B+';"':"")+" />";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   729
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   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+";":"");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   731
return"<img src='"+A+"' style=\""+B+'" />';
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   732
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   733
SimileAjax.Graphics.createTranslucentImageHTML=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImageHTML1:SimileAjax.Graphics._createTranslucentImageHTML2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   734
SimileAjax.Graphics.setOpacity=function(B,A){if(SimileAjax.Platform.browser.isIE){B.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+A+")";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   735
}else{var C=(A/100).toString();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   736
B.style.opacity=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   737
B.style.MozOpacity=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   738
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   739
SimileAjax.Graphics._bubbleMargins={top:33,bottom:42,left:33,right:40};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   740
SimileAjax.Graphics._arrowOffsets={top:0,bottom:9,left:1,right:8};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   741
SimileAjax.Graphics._bubblePadding=15;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   742
SimileAjax.Graphics._bubblePointOffset=6;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   769
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   770
SimileAjax.Graphics.createBubbleForPoint=function(C,B,N,R,F){function T(){if(typeof window.innerHeight=="number"){return{w:window.innerWidth,h:window.innerHeight};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   771
}else{if(document.documentElement&&document.documentElement.clientHeight){return{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   772
}else{if(document.body&&document.body.clientHeight){return{w:document.body.clientWidth,h:document.body.clientHeight};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   773
}}}}var L=function(){if(!M._closed){document.body.removeChild(M._div);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   774
M._doc=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   775
M._div=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   776
M._content=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   777
M._closed=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   778
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   779
var M={_closed:false};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   780
var O=T();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   781
var H=O.w;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   782
var G=O.h;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   783
var D=SimileAjax.Graphics._bubbleMargins;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   784
N=parseInt(N,10);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   785
R=parseInt(R,10);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   786
var P=D.left+N+D.right;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   787
var U=D.top+R+D.bottom;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   788
var Q=SimileAjax.Graphics.pngIsTranslucent;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   789
var J=SimileAjax.urlPrefix;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   790
var A=function(Z,Y,a,X){Z.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   791
Z.style.width=a+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   792
Z.style.height=X+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   793
if(Q){Z.style.background="url("+Y+")";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   794
}else{Z.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+Y+"', sizingMethod='crop')";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   795
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   796
var K=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   797
K.style.width=P+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   798
K.style.height=U+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   799
K.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   800
K.style.zIndex=1000;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   801
var W=SimileAjax.WindowManager.pushLayer(L,true,K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   802
M._div=K;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   803
M.close=function(){SimileAjax.WindowManager.popLayer(W);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   804
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   805
var I=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   806
I.style.width="100%";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   807
I.style.height="100%";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   808
I.style.position="relative";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   809
K.appendChild(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   810
var S=function(Z,c,b,a,Y){var X=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   811
X.style.left=c+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   812
X.style.top=b+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   813
A(X,Z,a,Y);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   814
I.appendChild(X);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   815
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   816
S(J+"data/timeline/bubble-top-left.png",0,0,D.left,D.top);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   817
S(J+"data/timeline/bubble-top.png",D.left,0,N,D.top);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   818
S(J+"data/timeline/bubble-top-right.png",D.left+N,0,D.right,D.top);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   819
S(J+"data/timeline/bubble-left.png",0,D.top,D.left,R);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   820
S(J+"data/timeline/bubble-right.png",D.left+N,D.top,D.right,R);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   821
S(J+"data/timeline/bubble-bottom-left.png",0,D.top+R,D.left,D.bottom);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   822
S(J+"data/timeline/bubble-bottom.png",D.left,D.top+R,N,D.bottom);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   823
S(J+"data/timeline/bubble-bottom-right.png",D.left+N,D.top+R,D.right,D.bottom);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   824
var V=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   825
V.style.left=(P-D.right+SimileAjax.Graphics._bubblePadding-16-2)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   826
V.style.top=(D.top-SimileAjax.Graphics._bubblePadding+1)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   827
V.style.cursor="pointer";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   828
A(V,J+"data/timeline/close-button.png",16,16);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   829
SimileAjax.WindowManager.registerEventWithObject(V,"click",M,"close");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   830
I.appendChild(V);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   831
var E=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   832
E.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   833
E.style.left=D.left+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   834
E.style.top=D.top+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   835
E.style.width=N+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   836
E.style.height=R+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   837
E.style.overflow="auto";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   838
E.style.background="white";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   839
I.appendChild(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   840
M.content=E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   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;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   842
Z=C<(H/2)?Math.max(Z,-(D.left-SimileAjax.Graphics._bubblePadding)):Math.min(Z,H+(D.right-SimileAjax.Graphics._bubblePadding)-P);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   843
if((F&&F=="top")||(!F&&(B-SimileAjax.Graphics._bubblePointOffset-U>0))){var X=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   844
X.style.left=(C-SimileAjax.Graphics._halfArrowWidth-Z)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   845
X.style.top=(D.top+R)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   846
A(X,J+"data/timeline/bubble-bottom-arrow.png",37,D.bottom);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   847
I.appendChild(X);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   848
K.style.left=Z+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   849
K.style.top=(B-SimileAjax.Graphics._bubblePointOffset-U+SimileAjax.Graphics._arrowOffsets.bottom)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   850
return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   851
}else{if((F&&F=="bottom")||(!F&&(B+SimileAjax.Graphics._bubblePointOffset+U<G))){var X=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   852
X.style.left=(C-SimileAjax.Graphics._halfArrowWidth-Z)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   853
X.style.top="0px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   854
A(X,J+"data/timeline/bubble-top-arrow.png",37,D.top);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   855
I.appendChild(X);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   856
K.style.left=Z+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   857
K.style.top=(B+SimileAjax.Graphics._bubblePointOffset-SimileAjax.Graphics._arrowOffsets.top)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   858
return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   859
}}}var Y=B-Math.round(R/2)-D.top;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   860
Y=B<(G/2)?Math.max(Y,-(D.top-SimileAjax.Graphics._bubblePadding)):Math.min(Y,G+(D.bottom-SimileAjax.Graphics._bubblePadding)-U);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   861
if((F&&F=="left")||(!F&&(C-SimileAjax.Graphics._bubblePointOffset-P>0))){var X=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   862
X.style.left=(D.left+N)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   863
X.style.top=(B-SimileAjax.Graphics._halfArrowWidth-Y)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   864
A(X,J+"data/timeline/bubble-right-arrow.png",D.right,37);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   865
I.appendChild(X);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   866
K.style.left=(C-SimileAjax.Graphics._bubblePointOffset-P+SimileAjax.Graphics._arrowOffsets.right)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   867
K.style.top=Y+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   868
}else{if((F&&F=="right")||(!F&&(C-SimileAjax.Graphics._bubblePointOffset-P<H))){var X=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   869
X.style.left="0px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   870
X.style.top=(B-SimileAjax.Graphics._halfArrowWidth-Y)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   871
A(X,J+"data/timeline/bubble-left-arrow.png",D.left,37);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   872
I.appendChild(X);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   873
K.style.left=(C+SimileAjax.Graphics._bubblePointOffset-SimileAjax.Graphics._arrowOffsets.left)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   874
K.style.top=Y+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   875
}}})();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   876
document.body.appendChild(K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   877
return M;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   878
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   879
SimileAjax.Graphics.createMessageBubble=function(H){var G=H.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   880
if(SimileAjax.Graphics.pngIsTranslucent){var I=H.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   881
I.style.height="33px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   882
I.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-top-left.png) top left no-repeat";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   883
I.style.paddingLeft="44px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   884
G.appendChild(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   885
var C=H.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   886
C.style.height="33px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   887
C.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-top-right.png) top right no-repeat";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   888
I.appendChild(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   889
var F=H.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   890
F.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-left.png) top left repeat-y";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   891
F.style.paddingLeft="44px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   892
G.appendChild(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   893
var A=H.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   894
A.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-right.png) top right repeat-y";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   895
A.style.paddingRight="44px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   896
F.appendChild(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   897
var D=H.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   898
A.appendChild(D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   899
var B=H.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   900
B.style.height="55px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   901
B.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-bottom-left.png) bottom left no-repeat";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   902
B.style.paddingLeft="44px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   903
G.appendChild(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   904
var E=H.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   905
E.style.height="55px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   906
E.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-bottom-right.png) bottom right no-repeat";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   907
B.appendChild(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   908
}else{G.style.border="2px solid #7777AA";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   909
G.style.padding="20px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   910
G.style.background="white";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   911
SimileAjax.Graphics.setOpacity(G,90);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   912
var D=H.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   913
G.appendChild(D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   914
}return{containerDiv:G,contentDiv:D};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   915
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   916
SimileAjax.Graphics.createAnimation=function(B,E,D,C,A){return new SimileAjax.Graphics._Animation(B,E,D,C,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   917
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   918
SimileAjax.Graphics._Animation=function(B,E,D,C,A){this.f=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   919
this.cont=(typeof A=="function")?A:function(){};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   920
this.from=E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   921
this.to=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   922
this.current=E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   923
this.duration=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   924
this.start=new Date().getTime();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   925
this.timePassed=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   926
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   927
SimileAjax.Graphics._Animation.prototype.run=function(){var A=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   928
window.setTimeout(function(){A.step();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   929
},50);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   930
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   931
SimileAjax.Graphics._Animation.prototype.step=function(){this.timePassed+=50;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   932
var B=this.timePassed/this.duration;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   933
var A=-Math.cos(B*Math.PI)/2+0.5;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   934
var D=A*(this.to-this.from)+this.from;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   935
try{this.f(D,D-this.current);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   936
}catch(C){}this.current=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   937
if(this.timePassed<this.duration){this.run();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   938
}else{this.f(this.to,0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   939
this["cont"]();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   940
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   941
SimileAjax.Graphics.createStructuredDataCopyButton=function(F,D,A,E){var G=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   942
G.style.position="relative";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   943
G.style.display="inline";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   944
G.style.width=D+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   945
G.style.height=A+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   946
G.style.overflow="hidden";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   947
G.style.margin="2px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   948
if(SimileAjax.Graphics.pngIsTranslucent){G.style.background="url("+F+") no-repeat";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   949
}else{G.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+F+"', sizingMethod='image')";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   950
}var C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   951
if(SimileAjax.Platform.browser.isIE){C="filter:alpha(opacity=0)";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   952
}else{C="opacity: 0";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   953
}G.innerHTML="<textarea rows='1' autocomplete='off' value='none' style='"+C+"' />";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   954
var B=G.firstChild;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   955
B.style.width=D+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   956
B.style.height=A+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   957
B.onmousedown=function(H){H=(H)?H:((event)?event:null);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   958
if(H.button==2){B.value=E();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   959
B.select();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   960
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   961
return G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   971
SimileAjax.Graphics.getFontRenderingContext=function(A,B){return new SimileAjax.Graphics._FontRenderingContext(A,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   972
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   973
SimileAjax.Graphics._FontRenderingContext=function(A,B){this._elmt=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   974
this._elmt.style.visibility="hidden";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   975
if(typeof B=="string"){this._elmt.style.width=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   976
}else{if(typeof B=="number"){this._elmt.style.width=B+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   977
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   978
SimileAjax.Graphics._FontRenderingContext.prototype.dispose=function(){this._elmt=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   979
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   980
SimileAjax.Graphics._FontRenderingContext.prototype.update=function(){this._elmt.innerHTML="A";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   981
this._lineHeight=this._elmt.offsetHeight;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   989
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   990
SimileAjax.Graphics._FontRenderingContext.prototype.getLineHeight=function(){return this._lineHeight;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   991
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   992
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   993
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   994
/* history.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   995
SimileAjax.History={maxHistoryLength:10,historyFile:"__history__.html",enabled:true,_initialized:false,_listeners:new SimileAjax.ListenerQueue(),_actions:[],_baseIndex:0,_currentIndex:0,_plainDocumentTitle:document.title};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   996
SimileAjax.History.formatHistoryEntryTitle=function(A){return SimileAjax.History._plainDocumentTitle+" {"+A+"}";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   997
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   998
SimileAjax.History.initialize=function(){if(SimileAjax.History._initialized){return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   999
}if(SimileAjax.History.enabled){var A=document.createElement("iframe");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1000
A.id="simile-ajax-history";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1001
A.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1002
A.style.width="10px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1003
A.style.height="10px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1004
A.style.top="0px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1005
A.style.left="0px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1006
A.style.visibility="hidden";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1007
A.src=SimileAjax.History.historyFile+"?0";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1008
document.body.appendChild(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1009
SimileAjax.DOM.registerEvent(A,"load",SimileAjax.History._handleIFrameOnLoad);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1010
SimileAjax.History._iframe=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1011
}SimileAjax.History._initialized=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1012
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1013
SimileAjax.History.addListener=function(A){SimileAjax.History.initialize();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1014
SimileAjax.History._listeners.add(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1015
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1016
SimileAjax.History.removeListener=function(A){SimileAjax.History.initialize();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1017
SimileAjax.History._listeners.remove(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1018
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1019
SimileAjax.History.addAction=function(A){SimileAjax.History.initialize();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1020
SimileAjax.History._listeners.fire("onBeforePerform",[A]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1021
window.setTimeout(function(){try{A.perform();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1022
SimileAjax.History._listeners.fire("onAfterPerform",[A]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1023
if(SimileAjax.History.enabled){SimileAjax.History._actions=SimileAjax.History._actions.slice(0,SimileAjax.History._currentIndex-SimileAjax.History._baseIndex);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1024
SimileAjax.History._actions.push(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1025
SimileAjax.History._currentIndex++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1026
var C=SimileAjax.History._actions.length-SimileAjax.History.maxHistoryLength;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1027
if(C>0){SimileAjax.History._actions=SimileAjax.History._actions.slice(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1028
SimileAjax.History._baseIndex+=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1029
}try{SimileAjax.History._iframe.contentWindow.location.search="?"+SimileAjax.History._currentIndex;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1030
}catch(B){var D=SimileAjax.History.formatHistoryEntryTitle(A.label);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1031
document.title=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1032
}}}catch(B){SimileAjax.Debug.exception(B,"Error adding action {"+A.label+"} to history");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1033
}},0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1034
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1035
SimileAjax.History.addLengthyAction=function(C,A,B){SimileAjax.History.addAction({perform:C,undo:A,label:B,uiLayer:SimileAjax.WindowManager.getBaseLayer(),lengthy:true});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1036
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1037
SimileAjax.History._handleIFrameOnLoad=function(){try{var B=SimileAjax.History._iframe.contentWindow.location.search;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1038
var F=(B.length==0)?0:Math.max(0,parseInt(B.substr(1)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1039
var E=function(){var G=F-SimileAjax.History._currentIndex;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1040
SimileAjax.History._currentIndex+=G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1041
SimileAjax.History._baseIndex+=G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1042
SimileAjax.History._iframe.contentWindow.location.search="?"+F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1043
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1044
if(F<SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeUndoSeveral",[]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1045
window.setTimeout(function(){while(SimileAjax.History._currentIndex>F&&SimileAjax.History._currentIndex>SimileAjax.History._baseIndex){SimileAjax.History._currentIndex--;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1046
var G=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1047
try{G.undo();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1048
}catch(H){SimileAjax.Debug.exception(H,"History: Failed to undo action {"+G.label+"}");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1049
}}SimileAjax.History._listeners.fire("onAfterUndoSeveral",[]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1050
E();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1051
},0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1052
}else{if(F>SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeRedoSeveral",[]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1054
try{G.perform();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1055
}catch(H){SimileAjax.Debug.exception(H,"History: Failed to redo action {"+G.label+"}");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1056
}SimileAjax.History._currentIndex++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1057
}SimileAjax.History._listeners.fire("onAfterRedoSeveral",[]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1058
E();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1059
},0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1060
}else{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1061
var D=(A>=0&&A<SimileAjax.History._actions.length)?SimileAjax.History.formatHistoryEntryTitle(SimileAjax.History._actions[A].label):SimileAjax.History._plainDocumentTitle;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1062
SimileAjax.History._iframe.contentWindow.document.title=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1063
document.title=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1064
}}}catch(C){}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1065
SimileAjax.History.getNextUndoAction=function(){try{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1066
return SimileAjax.History._actions[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1067
}catch(B){return null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1068
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1069
SimileAjax.History.getNextRedoAction=function(){try{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1070
return SimileAjax.History._actions[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1071
}catch(B){return null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1072
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1073
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1074
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1075
/* html.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1076
SimileAjax.HTML=new Object();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1077
SimileAjax.HTML._e2uHash={};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1078
(function(){var A=SimileAjax.HTML._e2uHash;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1079
A["nbsp"]="\u00A0[space]";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1080
A["iexcl"]="\u00A1";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1081
A["cent"]="\u00A2";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1082
A["pound"]="\u00A3";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1083
A["curren"]="\u00A4";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1084
A["yen"]="\u00A5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1085
A["brvbar"]="\u00A6";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1086
A["sect"]="\u00A7";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1087
A["uml"]="\u00A8";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1088
A["copy"]="\u00A9";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1089
A["ordf"]="\u00AA";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1090
A["laquo"]="\u00AB";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1091
A["not"]="\u00AC";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1092
A["shy"]="\u00AD";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1093
A["reg"]="\u00AE";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1094
A["macr"]="\u00AF";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1095
A["deg"]="\u00B0";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1096
A["plusmn"]="\u00B1";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1097
A["sup2"]="\u00B2";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1098
A["sup3"]="\u00B3";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1099
A["acute"]="\u00B4";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1100
A["micro"]="\u00B5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1101
A["para"]="\u00B6";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1102
A["middot"]="\u00B7";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1103
A["cedil"]="\u00B8";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1104
A["sup1"]="\u00B9";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1105
A["ordm"]="\u00BA";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1106
A["raquo"]="\u00BB";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1107
A["frac14"]="\u00BC";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1108
A["frac12"]="\u00BD";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1109
A["frac34"]="\u00BE";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1110
A["iquest"]="\u00BF";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1111
A["Agrave"]="\u00C0";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1112
A["Aacute"]="\u00C1";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1113
A["Acirc"]="\u00C2";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1114
A["Atilde"]="\u00C3";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1115
A["Auml"]="\u00C4";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1116
A["Aring"]="\u00C5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1117
A["AElig"]="\u00C6";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1118
A["Ccedil"]="\u00C7";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1119
A["Egrave"]="\u00C8";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1120
A["Eacute"]="\u00C9";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1121
A["Ecirc"]="\u00CA";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1122
A["Euml"]="\u00CB";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1123
A["Igrave"]="\u00CC";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1124
A["Iacute"]="\u00CD";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1125
A["Icirc"]="\u00CE";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1126
A["Iuml"]="\u00CF";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1127
A["ETH"]="\u00D0";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1128
A["Ntilde"]="\u00D1";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1129
A["Ograve"]="\u00D2";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1130
A["Oacute"]="\u00D3";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1131
A["Ocirc"]="\u00D4";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1132
A["Otilde"]="\u00D5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1133
A["Ouml"]="\u00D6";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1134
A["times"]="\u00D7";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1135
A["Oslash"]="\u00D8";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1136
A["Ugrave"]="\u00D9";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1137
A["Uacute"]="\u00DA";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1138
A["Ucirc"]="\u00DB";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1139
A["Uuml"]="\u00DC";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1140
A["Yacute"]="\u00DD";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1141
A["THORN"]="\u00DE";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1142
A["szlig"]="\u00DF";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1143
A["agrave"]="\u00E0";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1144
A["aacute"]="\u00E1";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1145
A["acirc"]="\u00E2";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1146
A["atilde"]="\u00E3";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1147
A["auml"]="\u00E4";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1148
A["aring"]="\u00E5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1149
A["aelig"]="\u00E6";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1150
A["ccedil"]="\u00E7";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1151
A["egrave"]="\u00E8";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1152
A["eacute"]="\u00E9";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1153
A["ecirc"]="\u00EA";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1154
A["euml"]="\u00EB";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1155
A["igrave"]="\u00EC";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1156
A["iacute"]="\u00ED";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1157
A["icirc"]="\u00EE";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1158
A["iuml"]="\u00EF";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1159
A["eth"]="\u00F0";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1160
A["ntilde"]="\u00F1";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1161
A["ograve"]="\u00F2";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1162
A["oacute"]="\u00F3";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1163
A["ocirc"]="\u00F4";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1164
A["otilde"]="\u00F5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1165
A["ouml"]="\u00F6";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1166
A["divide"]="\u00F7";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1167
A["oslash"]="\u00F8";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1168
A["ugrave"]="\u00F9";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1169
A["uacute"]="\u00FA";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1170
A["ucirc"]="\u00FB";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1171
A["uuml"]="\u00FC";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1172
A["yacute"]="\u00FD";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1173
A["thorn"]="\u00FE";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1174
A["yuml"]="\u00FF";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1175
A["quot"]="\u0022";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1176
A["amp"]="\u0026";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1177
A["lt"]="\u003C";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1178
A["gt"]="\u003E";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1179
A["OElig"]="";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1180
A["oelig"]="\u0153";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1181
A["Scaron"]="\u0160";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1182
A["scaron"]="\u0161";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1183
A["Yuml"]="\u0178";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1184
A["circ"]="\u02C6";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1185
A["tilde"]="\u02DC";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1186
A["ensp"]="\u2002";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1187
A["emsp"]="\u2003";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1188
A["thinsp"]="\u2009";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1189
A["zwnj"]="\u200C";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1190
A["zwj"]="\u200D";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1191
A["lrm"]="\u200E";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1192
A["rlm"]="\u200F";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1193
A["ndash"]="\u2013";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1194
A["mdash"]="\u2014";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1195
A["lsquo"]="\u2018";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1196
A["rsquo"]="\u2019";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1197
A["sbquo"]="\u201A";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1198
A["ldquo"]="\u201C";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1199
A["rdquo"]="\u201D";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1200
A["bdquo"]="\u201E";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1201
A["dagger"]="\u2020";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1202
A["Dagger"]="\u2021";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1203
A["permil"]="\u2030";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1204
A["lsaquo"]="\u2039";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1205
A["rsaquo"]="\u203A";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1206
A["euro"]="\u20AC";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1207
A["fnof"]="\u0192";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1208
A["Alpha"]="\u0391";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1209
A["Beta"]="\u0392";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1210
A["Gamma"]="\u0393";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1211
A["Delta"]="\u0394";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1212
A["Epsilon"]="\u0395";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1213
A["Zeta"]="\u0396";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1214
A["Eta"]="\u0397";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1215
A["Theta"]="\u0398";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1216
A["Iota"]="\u0399";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1217
A["Kappa"]="\u039A";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1218
A["Lambda"]="\u039B";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1219
A["Mu"]="\u039C";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1220
A["Nu"]="\u039D";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1221
A["Xi"]="\u039E";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1222
A["Omicron"]="\u039F";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1223
A["Pi"]="\u03A0";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1224
A["Rho"]="\u03A1";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1225
A["Sigma"]="\u03A3";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1226
A["Tau"]="\u03A4";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1227
A["Upsilon"]="\u03A5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1228
A["Phi"]="\u03A6";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1229
A["Chi"]="\u03A7";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1230
A["Psi"]="\u03A8";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1231
A["Omega"]="\u03A9";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1232
A["alpha"]="\u03B1";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1233
A["beta"]="\u03B2";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1234
A["gamma"]="\u03B3";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1235
A["delta"]="\u03B4";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1236
A["epsilon"]="\u03B5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1237
A["zeta"]="\u03B6";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1238
A["eta"]="\u03B7";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1239
A["theta"]="\u03B8";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1240
A["iota"]="\u03B9";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1241
A["kappa"]="\u03BA";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1242
A["lambda"]="\u03BB";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1243
A["mu"]="\u03BC";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1244
A["nu"]="\u03BD";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1245
A["xi"]="\u03BE";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1246
A["omicron"]="\u03BF";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1247
A["pi"]="\u03C0";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1248
A["rho"]="\u03C1";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1249
A["sigmaf"]="\u03C2";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1250
A["sigma"]="\u03C3";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1251
A["tau"]="\u03C4";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1252
A["upsilon"]="\u03C5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1253
A["phi"]="\u03C6";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1254
A["chi"]="\u03C7";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1255
A["psi"]="\u03C8";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1256
A["omega"]="\u03C9";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1257
A["thetasym"]="\u03D1";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1258
A["upsih"]="\u03D2";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1259
A["piv"]="\u03D6";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1260
A["bull"]="\u2022";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1261
A["hellip"]="\u2026";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1262
A["prime"]="\u2032";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1263
A["Prime"]="\u2033";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1264
A["oline"]="\u203E";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1265
A["frasl"]="\u2044";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1266
A["weierp"]="\u2118";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1267
A["image"]="\u2111";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1268
A["real"]="\u211C";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1269
A["trade"]="\u2122";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1270
A["alefsym"]="\u2135";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1271
A["larr"]="\u2190";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1272
A["uarr"]="\u2191";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1273
A["rarr"]="\u2192";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1274
A["darr"]="\u2193";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1275
A["harr"]="\u2194";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1276
A["crarr"]="\u21B5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1277
A["lArr"]="\u21D0";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1278
A["uArr"]="\u21D1";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1279
A["rArr"]="\u21D2";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1280
A["dArr"]="\u21D3";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1281
A["hArr"]="\u21D4";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1282
A["forall"]="\u2200";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1283
A["part"]="\u2202";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1284
A["exist"]="\u2203";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1285
A["empty"]="\u2205";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1286
A["nabla"]="\u2207";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1287
A["isin"]="\u2208";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1288
A["notin"]="\u2209";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1289
A["ni"]="\u220B";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1290
A["prod"]="\u220F";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1291
A["sum"]="\u2211";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1292
A["minus"]="\u2212";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1293
A["lowast"]="\u2217";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1294
A["radic"]="\u221A";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1295
A["prop"]="\u221D";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1296
A["infin"]="\u221E";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1297
A["ang"]="\u2220";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1298
A["and"]="\u2227";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1299
A["or"]="\u2228";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1300
A["cap"]="\u2229";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1301
A["cup"]="\u222A";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1302
A["int"]="\u222B";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1303
A["there4"]="\u2234";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1304
A["sim"]="\u223C";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1305
A["cong"]="\u2245";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1306
A["asymp"]="\u2248";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1307
A["ne"]="\u2260";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1308
A["equiv"]="\u2261";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1309
A["le"]="\u2264";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1310
A["ge"]="\u2265";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1311
A["sub"]="\u2282";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1312
A["sup"]="\u2283";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1313
A["nsub"]="\u2284";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1314
A["sube"]="\u2286";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1315
A["supe"]="\u2287";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1316
A["oplus"]="\u2295";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1317
A["otimes"]="\u2297";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1318
A["perp"]="\u22A5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1319
A["sdot"]="\u22C5";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1320
A["lceil"]="\u2308";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1321
A["rceil"]="\u2309";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1322
A["lfloor"]="\u230A";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1323
A["rfloor"]="\u230B";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1324
A["lang"]="\u2329";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1325
A["rang"]="\u232A";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1326
A["loz"]="\u25CA";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1327
A["spades"]="\u2660";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1328
A["clubs"]="\u2663";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1329
A["hearts"]="\u2665";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1330
A["diams"]="\u2666";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1331
})();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1332
SimileAjax.HTML.deEntify=function(C){var D=SimileAjax.HTML._e2uHash;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1333
var B=/&(\w+?);/;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1334
while(B.test(C)){var A=C.match(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1335
C=C.replace(B,D[A[1]]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1336
}return C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1337
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1338
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1339
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1340
/* json.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1341
SimileAjax.JSON=new Object();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1342
(function(){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1343
var s={array:function(x){var a=["["],b,f,i,l=x.length,v;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1344
for(i=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1345
i<l;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1346
i+=1){v=x[i];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1347
f=s[typeof v];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1348
if(f){v=f(v);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1349
if(typeof v=="string"){if(b){a[a.length]=",";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1350
}a[a.length]=v;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1351
b=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1352
}}}a[a.length]="]";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1353
return a.join("");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1354
},"boolean":function(x){return String(x);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1355
},"null":function(x){return"null";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1356
},number:function(x){return isFinite(x)?String(x):"null";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1357
},object:function(x){if(x){if(x instanceof Array){return s.array(x);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1358
}var a=["{"],b,f,i,v;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1359
for(i in x){v=x[i];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1360
f=s[typeof v];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1361
if(f){v=f(v);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1362
if(typeof v=="string"){if(b){a[a.length]=",";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1363
}a.push(s.string(i),":",v);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1364
b=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1365
}}}a[a.length]="}";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1366
return a.join("");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1367
}return"null";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1368
},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1369
if(c){return c;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1370
}c=b.charCodeAt();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1371
return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1372
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1373
}return'"'+x+'"';
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1374
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1375
SimileAjax.JSON.toJSONString=function(o){if(o instanceof Object){return s.object(o);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1376
}else{if(o instanceof Array){return s.array(o);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1377
}else{return o.toString();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1378
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1379
SimileAjax.JSON.parseJSON=function(){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+this+")");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1380
}catch(e){return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1381
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1382
})();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1383
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1384
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1385
/* string.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1386
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1387
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1388
String.prototype.startsWith=function(A){return this.length>=A.length&&this.substr(0,A.length)==A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1389
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1390
String.prototype.endsWith=function(A){return this.length>=A.length&&this.substr(this.length-A.length)==A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1391
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1392
String.substitute=function(B,D){var A="";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1393
var F=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1394
while(F<B.length-1){var C=B.indexOf("%",F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1395
if(C<0||C==B.length-1){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1396
}else{if(C>F&&B.charAt(C-1)=="\\"){A+=B.substring(F,C-1)+"%";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1397
F=C+1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1398
}else{var E=parseInt(B.charAt(C+1));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1399
if(isNaN(E)||E>=D.length){A+=B.substring(F,C+2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1400
}else{A+=B.substring(F,C)+D[E].toString();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1401
}F=C+2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1402
}}}if(F<B.length){A+=B.substring(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1403
}return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1404
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1405
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1406
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1407
/* units.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1408
SimileAjax.NativeDateUnit=new Object();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1409
SimileAjax.NativeDateUnit.makeDefaultValue=function(){return new Date();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1410
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1411
SimileAjax.NativeDateUnit.cloneValue=function(A){return new Date(A.getTime());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1412
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1413
SimileAjax.NativeDateUnit.getParser=function(A){if(typeof A=="string"){A=A.toLowerCase();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1414
}return(A=="iso8601"||A=="iso 8601")?SimileAjax.DateTime.parseIso8601DateTime:SimileAjax.DateTime.parseGregorianDateTime;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1415
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1416
SimileAjax.NativeDateUnit.parseFromObject=function(A){return SimileAjax.DateTime.parseGregorianDateTime(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1417
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1418
SimileAjax.NativeDateUnit.toNumber=function(A){return A.getTime();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1419
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1420
SimileAjax.NativeDateUnit.fromNumber=function(A){return new Date(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1421
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1422
SimileAjax.NativeDateUnit.compare=function(D,C){var B,A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1423
if(typeof D=="object"){B=D.getTime();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1424
}else{B=Number(D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1425
}if(typeof C=="object"){A=C.getTime();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1426
}else{A=Number(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1427
}return B-A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1428
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1429
SimileAjax.NativeDateUnit.earlier=function(B,A){return SimileAjax.NativeDateUnit.compare(B,A)<0?B:A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1430
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1431
SimileAjax.NativeDateUnit.later=function(B,A){return SimileAjax.NativeDateUnit.compare(B,A)>0?B:A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1432
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1433
SimileAjax.NativeDateUnit.change=function(A,B){return new Date(A.getTime()+B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1434
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1435
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1436
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1437
/* window-manager.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1438
SimileAjax.WindowManager={_initialized:false,_listeners:[],_draggedElement:null,_draggedElementCallback:null,_dropTargetHighlightElement:null,_lastCoords:null,_ghostCoords:null,_draggingMode:"",_dragging:false,_layers:[]};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1439
SimileAjax.WindowManager.initialize=function(){if(SimileAjax.WindowManager._initialized){return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1440
}SimileAjax.DOM.registerEvent(document.body,"mousedown",SimileAjax.WindowManager._onBodyMouseDown);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1441
SimileAjax.DOM.registerEvent(document.body,"mousemove",SimileAjax.WindowManager._onBodyMouseMove);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1442
SimileAjax.DOM.registerEvent(document.body,"mouseup",SimileAjax.WindowManager._onBodyMouseUp);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1443
SimileAjax.DOM.registerEvent(document,"keydown",SimileAjax.WindowManager._onBodyKeyDown);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1444
SimileAjax.DOM.registerEvent(document,"keyup",SimileAjax.WindowManager._onBodyKeyUp);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1445
SimileAjax.WindowManager._layers.push({index:0});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1446
SimileAjax.WindowManager._historyListener={onBeforeUndoSeveral:function(){},onAfterUndoSeveral:function(){},onBeforeUndo:function(){},onAfterUndo:function(){},onBeforeRedoSeveral:function(){},onAfterRedoSeveral:function(){},onBeforeRedo:function(){},onAfterRedo:function(){}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1447
SimileAjax.History.addListener(SimileAjax.WindowManager._historyListener);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1448
SimileAjax.WindowManager._initialized=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1449
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1450
SimileAjax.WindowManager.getBaseLayer=function(){SimileAjax.WindowManager.initialize();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1451
return SimileAjax.WindowManager._layers[0];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1452
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1453
SimileAjax.WindowManager.getHighestLayer=function(){SimileAjax.WindowManager.initialize();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1454
return SimileAjax.WindowManager._layers[SimileAjax.WindowManager._layers.length-1];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1455
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1457
},C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1458
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1459
SimileAjax.WindowManager.registerEvent=function(D,B,E,C){if(C==null){C=SimileAjax.WindowManager.getHighestLayer();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1460
}var A=function(G,F,I){if(SimileAjax.WindowManager._canProcessEventAtLayer(C)){SimileAjax.WindowManager._popToLayer(C.index);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1461
try{E(G,F,I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1462
}catch(H){SimileAjax.Debug.exception(H);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1463
}}SimileAjax.DOM.cancelEvent(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1464
return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1465
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1466
SimileAjax.DOM.registerEvent(D,B,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1467
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1468
SimileAjax.WindowManager.pushLayer=function(C,D,B){var A={onPop:C,index:SimileAjax.WindowManager._layers.length,ephemeral:(D),elmt:B};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1469
SimileAjax.WindowManager._layers.push(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1470
return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1471
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1472
SimileAjax.WindowManager.popLayer=function(B){for(var A=1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1473
A<SimileAjax.WindowManager._layers.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1474
A++){if(SimileAjax.WindowManager._layers[A]==B){SimileAjax.WindowManager._popToLayer(A-1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1475
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1476
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1477
SimileAjax.WindowManager.popAllLayers=function(){SimileAjax.WindowManager._popToLayer(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1478
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1479
SimileAjax.WindowManager.registerForDragging=function(B,C,A){SimileAjax.WindowManager.registerEvent(B,"mousedown",function(E,D,F){SimileAjax.WindowManager._handleMouseDown(E,D,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1480
},A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1481
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1482
SimileAjax.WindowManager._popToLayer=function(C){while(C+1<SimileAjax.WindowManager._layers.length){try{var A=SimileAjax.WindowManager._layers.pop();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1483
if(A.onPop!=null){A.onPop();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1484
}}catch(B){}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1485
SimileAjax.WindowManager._canProcessEventAtLayer=function(B){if(B.index==(SimileAjax.WindowManager._layers.length-1)){return true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1486
}for(var A=B.index+1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1487
A<SimileAjax.WindowManager._layers.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1488
A++){if(!SimileAjax.WindowManager._layers[A].ephemeral){return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1489
}}return true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1490
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1491
SimileAjax.WindowManager.cancelPopups=function(A){var F=(A)?SimileAjax.DOM.getEventPageCoordinates(A):{x:-1,y:-1};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1492
var E=SimileAjax.WindowManager._layers.length-1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1493
while(E>0&&SimileAjax.WindowManager._layers[E].ephemeral){var D=SimileAjax.WindowManager._layers[E];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1494
if(D.elmt!=null){var C=D.elmt;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1495
var B=SimileAjax.DOM.getPageCoordinates(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1496
if(F.x>=B.left&&F.x<(B.left+C.offsetWidth)&&F.y>=B.top&&F.y<(B.top+C.offsetHeight)){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1497
}}E--;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1498
}SimileAjax.WindowManager._popToLayer(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1499
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1500
SimileAjax.WindowManager._onBodyMouseDown=function(B,A,C){if(!("eventPhase" in A)||A.eventPhase==A.BUBBLING_PHASE){SimileAjax.WindowManager.cancelPopups(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1501
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1502
SimileAjax.WindowManager._handleMouseDown=function(B,A,C){SimileAjax.WindowManager._draggedElement=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1503
SimileAjax.WindowManager._draggedElementCallback=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1504
SimileAjax.WindowManager._lastCoords={x:A.clientX,y:A.clientY};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1505
SimileAjax.DOM.cancelEvent(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1506
return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1507
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1508
SimileAjax.WindowManager._onBodyKeyDown=function(C,A,D){if(SimileAjax.WindowManager._dragging){if(A.keyCode==27){SimileAjax.WindowManager._cancelDragging();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1509
}else{if((A.keyCode==17||A.keyCode==16)&&SimileAjax.WindowManager._draggingMode!="copy"){SimileAjax.WindowManager._draggingMode="copy";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1510
var B=SimileAjax.Graphics.createTranslucentImage(SimileAjax.urlPrefix+"data/timeline/copy.png");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1511
B.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1512
B.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1513
B.style.top=(SimileAjax.WindowManager._ghostCoords.top)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1514
document.body.appendChild(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1515
SimileAjax.WindowManager._draggingModeIndicatorElmt=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1516
}}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1517
SimileAjax.WindowManager._onBodyKeyUp=function(B,A,C){if(SimileAjax.WindowManager._dragging){if(A.keyCode==17||A.keyCode==16){SimileAjax.WindowManager._draggingMode="";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1518
if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1519
SimileAjax.WindowManager._draggingModeIndicatorElmt=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1520
}}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1521
SimileAjax.WindowManager._onBodyMouseMove=function(A,N,H){if(SimileAjax.WindowManager._draggedElement!=null){var P=SimileAjax.WindowManager._draggedElementCallback;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1522
var E=SimileAjax.WindowManager._lastCoords;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1523
var M=N.clientX-E.x;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1524
var J=N.clientY-E.y;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1525
if(!SimileAjax.WindowManager._dragging){if(Math.abs(M)>5||Math.abs(J)>5){try{if("onDragStart" in P){P.onDragStart();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1526
}if("ghost" in P&&P.ghost){var K=SimileAjax.WindowManager._draggedElement;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1527
SimileAjax.WindowManager._ghostCoords=SimileAjax.DOM.getPageCoordinates(K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1528
SimileAjax.WindowManager._ghostCoords.left+=M;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1529
SimileAjax.WindowManager._ghostCoords.top+=J;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1530
var O=K.cloneNode(true);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1531
O.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1532
O.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1533
O.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1534
O.style.zIndex=1000;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1535
SimileAjax.Graphics.setOpacity(O,50);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1536
document.body.appendChild(O);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1537
P._ghostElmt=O;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1538
}SimileAjax.WindowManager._dragging=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1539
SimileAjax.WindowManager._lastCoords={x:N.clientX,y:N.clientY};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1540
document.body.focus();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1541
}catch(G){SimileAjax.Debug.exception("WindowManager: Error handling mouse down",G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1542
SimileAjax.WindowManager._cancelDragging();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1543
}}}else{try{SimileAjax.WindowManager._lastCoords={x:N.clientX,y:N.clientY};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1544
if("onDragBy" in P){P.onDragBy(M,J);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1545
}if("_ghostElmt" in P){var O=P._ghostElmt;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1546
SimileAjax.WindowManager._ghostCoords.left+=M;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1547
SimileAjax.WindowManager._ghostCoords.top+=J;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1548
O.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1549
O.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1550
if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){var I=SimileAjax.WindowManager._draggingModeIndicatorElmt;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1551
I.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1552
I.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1553
}if("droppable" in P&&P.droppable){var L=SimileAjax.DOM.getEventPageCoordinates(N);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1554
var H=SimileAjax.DOM.hittest(L.x,L.y,[SimileAjax.WindowManager._ghostElmt,SimileAjax.WindowManager._dropTargetHighlightElement]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1555
H=SimileAjax.WindowManager._findDropTarget(H);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1556
if(H!=SimileAjax.WindowManager._potentialDropTarget){if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1557
SimileAjax.WindowManager._dropTargetHighlightElement=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1558
SimileAjax.WindowManager._potentialDropTarget=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1559
}var F=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1560
if(H!=null){if((!("canDropOn" in P)||P.canDropOn(H))&&(!("canDrop" in H)||H.canDrop(SimileAjax.WindowManager._draggedElement))){F=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1561
}}if(F){var C=4;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1562
var D=SimileAjax.DOM.getPageCoordinates(H);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1563
var B=document.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1564
B.style.border=C+"px solid yellow";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1565
B.style.backgroundColor="yellow";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1566
B.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1567
B.style.left=D.left+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1568
B.style.top=D.top+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1569
B.style.width=(H.offsetWidth-C*2)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1570
B.style.height=(H.offsetHeight-C*2)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1571
SimileAjax.Graphics.setOpacity(B,30);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1572
document.body.appendChild(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1573
SimileAjax.WindowManager._potentialDropTarget=H;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1574
SimileAjax.WindowManager._dropTargetHighlightElement=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1575
}}}}}catch(G){SimileAjax.Debug.exception("WindowManager: Error handling mouse move",G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1576
SimileAjax.WindowManager._cancelDragging();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1577
}}SimileAjax.DOM.cancelEvent(N);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1578
return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1579
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1580
SimileAjax.WindowManager._onBodyMouseUp=function(B,A,C){if(SimileAjax.WindowManager._draggedElement!=null){try{if(SimileAjax.WindowManager._dragging){var E=SimileAjax.WindowManager._draggedElementCallback;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1581
if("onDragEnd" in E){E.onDragEnd();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1582
}if("droppable" in E&&E.droppable){var D=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1583
var C=SimileAjax.WindowManager._potentialDropTarget;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1585
}C.ondrop(SimileAjax.WindowManager._draggedElement,SimileAjax.WindowManager._draggingMode);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1586
D=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1587
}}if(!D){}}}}finally{SimileAjax.WindowManager._cancelDragging();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1588
}SimileAjax.DOM.cancelEvent(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1589
return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1590
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1591
SimileAjax.WindowManager._cancelDragging=function(){var B=SimileAjax.WindowManager._draggedElementCallback;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1592
if("_ghostElmt" in B){var A=B._ghostElmt;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1593
document.body.removeChild(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1594
delete B._ghostElmt;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1595
}if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1596
SimileAjax.WindowManager._dropTargetHighlightElement=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1597
}if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1598
SimileAjax.WindowManager._draggingModeIndicatorElmt=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1599
}SimileAjax.WindowManager._draggedElement=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1600
SimileAjax.WindowManager._draggedElementCallback=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1601
SimileAjax.WindowManager._potentialDropTarget=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1602
SimileAjax.WindowManager._dropTargetHighlightElement=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1603
SimileAjax.WindowManager._lastCoords=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1604
SimileAjax.WindowManager._ghostCoords=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1605
SimileAjax.WindowManager._draggingMode="";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1606
SimileAjax.WindowManager._dragging=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1607
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1608
SimileAjax.WindowManager._findDropTarget=function(A){while(A!=null){if("ondrop" in A&&(typeof A.ondrop)=="function"){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1609
}A=A.parentNode;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1610
}return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1611
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1612
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1613
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1614
/* xmlhttp.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1615
SimileAjax.XmlHttp=new Object();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1617
}}else{if(D){D(A.statusText,A.status,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1618
}}}catch(C){SimileAjax.Debug.exception("XmlHttp: Error handling onReadyStateChange",C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1619
}break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1620
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1621
SimileAjax.XmlHttp._createRequest=function(){if(SimileAjax.Platform.browser.isIE){var A=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1622
for(var B=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1623
B<A.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1624
B++){try{var C=A[B];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1625
var D=function(){return new ActiveXObject(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1626
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1627
var F=D();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1628
SimileAjax.XmlHttp._createRequest=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1629
return F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1630
}catch(E){}}}try{var D=function(){return new XMLHttpRequest();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1631
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1632
var F=D();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1633
SimileAjax.XmlHttp._createRequest=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1634
return F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1635
}catch(E){throw new Error("Failed to create an XMLHttpRequest object");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1636
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1637
SimileAjax.XmlHttp.get=function(A,D,C){var B=SimileAjax.XmlHttp._createRequest();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1638
B.open("GET",A,true);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1639
B.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(B,D,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1640
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1641
B.send(null);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1642
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1643
SimileAjax.XmlHttp.post=function(B,A,E,D){var C=SimileAjax.XmlHttp._createRequest();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1644
C.open("POST",B,true);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1645
C.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(C,E,D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1646
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1647
C.send(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1648
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1649
SimileAjax.XmlHttp._forceXML=function(A){try{A.overrideMimeType("text/xml");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1650
}catch(B){A.setrequestheader("Content-Type","text/xml");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  1651
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2001
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2002
/* decorators.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2003
Timeline.SpanHighlightDecorator=function(A){this._unit=("unit" in A)?A.unit:SimileAjax.NativeDateUnit;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2004
this._startDate=(typeof A.startDate=="string")?this._unit.parseFromObject(A.startDate):A.startDate;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2005
this._endDate=(typeof A.endDate=="string")?this._unit.parseFromObject(A.endDate):A.endDate;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2006
this._startLabel=A.startLabel;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2007
this._endLabel=A.endLabel;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2008
this._color=A.color;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2009
this._cssClass=("cssClass" in A)?A.cssClass:null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2010
this._opacity=("opacity" in A)?A.opacity:100;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2011
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2012
Timeline.SpanHighlightDecorator.prototype.initialize=function(B,A){this._band=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2013
this._timeline=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2014
this._layerDiv=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2015
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2016
Timeline.SpanHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2017
}this._layerDiv=this._band.createLayerDiv(10);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2018
this._layerDiv.setAttribute("name","span-highlight-decorator");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2019
this._layerDiv.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2020
var F=this._band.getMinDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2021
var C=this._band.getMaxDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2022
if(this._unit.compare(this._startDate,C)<0&&this._unit.compare(this._endDate,F)>0){F=this._unit.later(F,this._startDate);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2023
C=this._unit.earlier(C,this._endDate);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2024
var D=this._band.dateToPixelOffset(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2025
var K=this._band.dateToPixelOffset(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2026
var I=this._timeline.getDocument();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2027
var H=function(){var L=I.createElement("table");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2028
L.insertRow(0).insertCell(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2029
return L;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2030
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2031
var B=I.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2032
B.className="timeline-highlight-decorator";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2033
if(this._cssClass){B.className+=" "+this._cssClass;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2034
}if(this._opacity<100){SimileAjax.Graphics.setOpacity(B,this._opacity);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2035
}this._layerDiv.appendChild(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2036
var J=H();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2037
J.className="timeline-highlight-label timeline-highlight-label-start";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2038
var G=J.rows[0].cells[0];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2039
G.innerHTML=this._startLabel;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2040
if(this._cssClass){G.className="label_"+this._cssClass;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2041
}this._layerDiv.appendChild(J);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2042
var A=H();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2043
A.className="timeline-highlight-label timeline-highlight-label-end";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2044
var E=A.rows[0].cells[0];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2045
E.innerHTML=this._endLabel;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2046
if(this._cssClass){E.className="label_"+this._cssClass;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2047
}this._layerDiv.appendChild(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2048
if(this._timeline.isHorizontal()){B.style.left=D+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2049
B.style.width=(K-D)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2050
J.style.right=(this._band.getTotalViewLength()-D)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2051
J.style.width=(this._startLabel.length)+"em";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2052
A.style.left=K+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2053
A.style.width=(this._endLabel.length)+"em";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2054
}else{B.style.top=D+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2055
B.style.height=(K-D)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2056
J.style.bottom=D+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2057
J.style.height="1.5px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2058
A.style.top=K+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2059
A.style.height="1.5px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2060
}}this._layerDiv.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2061
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2062
Timeline.SpanHighlightDecorator.prototype.softPaint=function(){};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2063
Timeline.PointHighlightDecorator=function(A){this._unit=("unit" in A)?A.unit:SimileAjax.NativeDateUnit;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2064
this._date=(typeof A.date=="string")?this._unit.parseFromObject(A.date):A.date;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2065
this._width=("width" in A)?A.width:10;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2066
this._color=A.color;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2067
this._cssClass=("cssClass" in A)?A.cssClass:"";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2068
this._opacity=("opacity" in A)?A.opacity:100;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2069
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2070
Timeline.PointHighlightDecorator.prototype.initialize=function(B,A){this._band=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2071
this._timeline=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2072
this._layerDiv=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2073
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2074
Timeline.PointHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2075
}this._layerDiv=this._band.createLayerDiv(10);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2076
this._layerDiv.setAttribute("name","span-highlight-decorator");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2077
this._layerDiv.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2078
var C=this._band.getMinDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2079
var E=this._band.getMaxDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2080
if(this._unit.compare(this._date,E)<0&&this._unit.compare(this._date,C)>0){var B=this._band.dateToPixelOffset(this._date);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2081
var A=B-Math.round(this._width/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2082
var D=this._timeline.getDocument();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2083
var F=D.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2084
F.className="timeline-highlight-point-decorator";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2085
F.className+=" "+this._cssClass;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2086
if(this._opacity<100){SimileAjax.Graphics.setOpacity(F,this._opacity);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2087
}this._layerDiv.appendChild(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2088
if(this._timeline.isHorizontal()){F.style.left=A+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2089
}else{F.style.top=A+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2090
}}this._layerDiv.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2091
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2092
Timeline.PointHighlightDecorator.prototype.softPaint=function(){};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2093
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2094
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2095
/* detailed-painter.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2096
Timeline.DetailedEventPainter=function(A){this._params=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2097
this._onSelectListeners=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2098
this._filterMatcher=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2099
this._highlightMatcher=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2100
this._frc=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2101
this._eventIdToElmt={};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2102
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2103
Timeline.DetailedEventPainter.prototype.initialize=function(B,A){this._band=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2104
this._timeline=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2105
this._backLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2106
this._eventLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2107
this._lineLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2108
this._highlightLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2109
this._eventIdToElmt=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2113
Timeline.DetailedEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2114
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2115
Timeline.DetailedEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2116
A<this._onSelectListeners.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2117
A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2118
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2119
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2120
Timeline.DetailedEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2121
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2122
Timeline.DetailedEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2123
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2124
Timeline.DetailedEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2125
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2126
Timeline.DetailedEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2127
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2128
Timeline.DetailedEventPainter.prototype.paint=function(){var B=this._band.getEventSource();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2129
if(B==null){return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2130
}this._eventIdToElmt={};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2131
this._prepareForPainting();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2132
var I=this._params.theme.event;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2133
var G=Math.max(I.track.height,this._frc.getLineHeight());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2135
var C=this._band.getMinDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2136
var A=this._band.getMaxDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2137
var J=(this._filterMatcher!=null)?this._filterMatcher:function(K){return true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2138
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2139
var E=(this._highlightMatcher!=null)?this._highlightMatcher:function(K){return -1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2140
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2141
var D=B.getEventReverseIterator(C,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2142
while(D.hasNext()){var H=D.next();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2143
if(J(H)){this.paintEvent(H,F,this._params.theme,E(H));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2144
}}this._highlightLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2145
this._lineLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2148
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2149
Timeline.DetailedEventPainter.prototype.softPaint=function(){};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2150
Timeline.DetailedEventPainter.prototype._prepareForPainting=function(){var B=this._band;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2151
if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2152
this._backLayer.style.visibility="hidden";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2153
var A=document.createElement("span");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2154
A.className="timeline-event-label";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2155
this._backLayer.appendChild(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2156
this._frc=SimileAjax.Graphics.getFontRenderingContext(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2157
}this._frc.update();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2158
this._lowerTracks=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2159
this._upperTracks=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2160
if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2161
}this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2162
this._highlightLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2163
if(this._lineLayer!=null){B.removeLayerDiv(this._lineLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2164
}this._lineLayer=B.createLayerDiv(110,"timeline-band-lines");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2165
this._lineLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2166
if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2167
}this._eventLayer=B.createLayerDiv(110,"timeline-band-events");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2168
this._eventLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2169
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2170
Timeline.DetailedEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2171
}else{this.paintDurationEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2172
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2173
Timeline.DetailedEventPainter.prototype.paintInstantEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseInstantEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2174
}else{this.paintPreciseInstantEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2175
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2176
Timeline.DetailedEventPainter.prototype.paintDurationEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseDurationEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2177
}else{this.paintPreciseDurationEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2178
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2179
Timeline.DetailedEventPainter.prototype.paintPreciseInstantEvent=function(K,N,Q,O){var S=this._timeline.getDocument();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2180
var J=K.getText();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2181
var E=K.getStart();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2182
var C=Math.round(this._band.dateToPixelOffset(E));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2183
var A=Math.round(C+N.iconWidth/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2184
var I=Math.round(C-N.iconWidth/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2185
var G=this._frc.computeSize(J);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2186
var D=this._findFreeTrackForSolid(A,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2187
var B=this._paintEventIcon(K,D,I,N,Q);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2188
var T=A+Q.event.label.offsetFromLine;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2189
var P=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2190
var F=this._getTrackData(D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2191
if(Math.min(F.solid,F.text)>=T+G.width){F.solid=I;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2192
F.text=T;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2193
}else{F.solid=I;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2194
T=C+Q.event.label.offsetFromLine;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2195
P=this._findFreeTrackForText(D,T+G.width,function(U){U.line=C-2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2196
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2197
this._getTrackData(P).text=I;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2198
this._paintEventLine(K,C,D,P,N,Q);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2199
}var R=Math.round(N.trackOffset+P*N.trackIncrement+N.trackHeight/2-G.height/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2200
var M=this._paintEventLabel(K,J,T,R,G.width,G.height,Q);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2201
var L=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2202
var H=function(U,V,W){return L._onClickInstantEvent(B.elmt,V,K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2203
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2204
SimileAjax.DOM.registerEvent(B.elmt,"mousedown",H);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2205
SimileAjax.DOM.registerEvent(M.elmt,"mousedown",H);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2206
this._createHighlightDiv(O,B,Q);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2207
this._eventIdToElmt[K.getID()]=B.elmt;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2208
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2209
Timeline.DetailedEventPainter.prototype.paintImpreciseInstantEvent=function(N,Q,V,R){var X=this._timeline.getDocument();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2210
var M=N.getText();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2211
var H=N.getStart();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2212
var S=N.getEnd();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2213
var E=Math.round(this._band.dateToPixelOffset(H));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2214
var B=Math.round(this._band.dateToPixelOffset(S));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2215
var A=Math.round(E+Q.iconWidth/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2216
var L=Math.round(E-Q.iconWidth/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2217
var J=this._frc.computeSize(M);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2218
var F=this._findFreeTrackForSolid(B,E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2219
var G=this._paintEventTape(N,F,E,B,V.event.instant.impreciseColor,V.event.instant.impreciseOpacity,Q,V);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2220
var C=this._paintEventIcon(N,F,L,Q,V);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2221
var I=this._getTrackData(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2222
I.solid=L;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2223
var W=A+V.event.label.offsetFromLine;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2224
var D=W+J.width;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2225
var T;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2226
if(D<B){T=F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2227
}else{W=E+V.event.label.offsetFromLine;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2228
D=W+J.width;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2229
T=this._findFreeTrackForText(F,D,function(Y){Y.line=E-2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2230
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2231
this._getTrackData(T).text=L;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2232
this._paintEventLine(N,E,F,T,Q,V);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2233
}var U=Math.round(Q.trackOffset+T*Q.trackIncrement+Q.trackHeight/2-J.height/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2234
var P=this._paintEventLabel(N,M,W,U,J.width,J.height,V);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2235
var O=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2236
var K=function(Y,Z,a){return O._onClickInstantEvent(C.elmt,Z,N);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2237
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2238
SimileAjax.DOM.registerEvent(C.elmt,"mousedown",K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2239
SimileAjax.DOM.registerEvent(G.elmt,"mousedown",K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2240
SimileAjax.DOM.registerEvent(P.elmt,"mousedown",K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2241
this._createHighlightDiv(R,C,V);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2242
this._eventIdToElmt[N.getID()]=C.elmt;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2243
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2244
Timeline.DetailedEventPainter.prototype.paintPreciseDurationEvent=function(J,M,S,O){var T=this._timeline.getDocument();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2245
var I=J.getText();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2246
var D=J.getStart();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2247
var P=J.getEnd();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2248
var B=Math.round(this._band.dateToPixelOffset(D));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2249
var A=Math.round(this._band.dateToPixelOffset(P));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2250
var F=this._frc.computeSize(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2251
var E=this._findFreeTrackForSolid(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2252
var N=J.getColor();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2253
N=N!=null?N:S.event.duration.color;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2254
var C=this._paintEventTape(J,E,B,A,N,100,M,S);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2255
var H=this._getTrackData(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2256
H.solid=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2257
var U=B+S.event.label.offsetFromLine;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2258
var Q=this._findFreeTrackForText(E,U+F.width,function(V){V.line=B-2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2259
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2260
this._getTrackData(Q).text=B-2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2261
this._paintEventLine(J,B,E,Q,M,S);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2262
var R=Math.round(M.trackOffset+Q*M.trackIncrement+M.trackHeight/2-F.height/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2263
var L=this._paintEventLabel(J,I,U,R,F.width,F.height,S);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2264
var K=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2265
var G=function(V,W,X){return K._onClickDurationEvent(C.elmt,W,J);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2266
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2267
SimileAjax.DOM.registerEvent(C.elmt,"mousedown",G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2268
SimileAjax.DOM.registerEvent(L.elmt,"mousedown",G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2269
this._createHighlightDiv(O,C,S);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2270
this._eventIdToElmt[J.getID()]=C.elmt;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2271
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2272
Timeline.DetailedEventPainter.prototype.paintImpreciseDurationEvent=function(L,P,W,S){var Z=this._timeline.getDocument();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2273
var K=L.getText();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2274
var D=L.getStart();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2275
var Q=L.getLatestStart();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2276
var T=L.getEnd();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2277
var X=L.getEarliestEnd();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2278
var B=Math.round(this._band.dateToPixelOffset(D));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2279
var F=Math.round(this._band.dateToPixelOffset(Q));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2280
var A=Math.round(this._band.dateToPixelOffset(T));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2281
var G=Math.round(this._band.dateToPixelOffset(X));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2282
var H=this._frc.computeSize(K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2283
var E=this._findFreeTrackForSolid(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2284
var R=L.getColor();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2285
R=R!=null?R:W.event.duration.color;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2286
var O=this._paintEventTape(L,E,B,A,W.event.duration.impreciseColor,W.event.duration.impreciseOpacity,P,W);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2287
var C=this._paintEventTape(L,E,F,G,R,100,P,W);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2288
var J=this._getTrackData(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2289
J.solid=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2290
var Y=F+W.event.label.offsetFromLine;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2291
var U=this._findFreeTrackForText(E,Y+H.width,function(a){a.line=F-2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2292
});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2293
this._getTrackData(U).text=F-2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2294
this._paintEventLine(L,F,E,U,P,W);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2295
var V=Math.round(P.trackOffset+U*P.trackIncrement+P.trackHeight/2-H.height/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2296
var N=this._paintEventLabel(L,K,Y,V,H.width,H.height,W);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2297
var M=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2298
var I=function(a,b,c){return M._onClickDurationEvent(C.elmt,b,L);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2299
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2300
SimileAjax.DOM.registerEvent(C.elmt,"mousedown",I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2301
SimileAjax.DOM.registerEvent(N.elmt,"mousedown",I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2302
this._createHighlightDiv(S,C,W);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2303
this._eventIdToElmt[L.getID()]=C.elmt;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2304
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2305
Timeline.DetailedEventPainter.prototype._findFreeTrackForSolid=function(B,A){for(var D=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2306
true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2307
D++){if(D<this._lowerTracks.length){var C=this._lowerTracks[D];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2308
if(Math.min(C.solid,C.text)>B&&(!(A)||C.line>A)){return D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2309
}}else{this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2310
return D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2311
}if(D<this._upperTracks.length){var C=this._upperTracks[D];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2312
if(Math.min(C.solid,C.text)>B&&(!(A)||C.line>A)){return -1-D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2313
}}else{this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2314
return -1-D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2315
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2316
Timeline.DetailedEventPainter.prototype._findFreeTrackForText=function(D,C,H){var F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2317
var G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2318
var B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2319
var J;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2320
if(D<0){F=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2321
B=-D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2322
G=this._findFreeUpperTrackForText(B,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2323
J=-1-G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2324
}else{if(D>0){F=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2325
B=D+1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2326
G=this._findFreeLowerTrackForText(B,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2327
J=G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2328
}else{var A=this._findFreeUpperTrackForText(0,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2329
var I=this._findFreeLowerTrackForText(1,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2330
if(I-1<=A){F=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2331
B=1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2332
G=I;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2333
J=G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2334
}else{F=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2335
B=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2336
G=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2337
J=-1-G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2338
}}}if(F){if(G==this._upperTracks.length){this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2339
}for(var E=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2340
E<G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2341
E++){H(this._upperTracks[E]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2342
}}else{if(G==this._lowerTracks.length){this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2343
}for(var E=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2344
E<G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2345
E++){H(this._lowerTracks[E]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2346
}}return J;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2347
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2348
Timeline.DetailedEventPainter.prototype._findFreeLowerTrackForText=function(A,C){for(;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2349
A<this._lowerTracks.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2350
A++){var B=this._lowerTracks[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2351
if(Math.min(B.solid,B.text)>=C){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2352
}}return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2353
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2354
Timeline.DetailedEventPainter.prototype._findFreeUpperTrackForText=function(A,C){for(;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2355
A<this._upperTracks.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2356
A++){var B=this._upperTracks[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2357
if(Math.min(B.solid,B.text)>=C){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2358
}}return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2359
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2360
Timeline.DetailedEventPainter.prototype._getTrackData=function(A){return(A<0)?this._upperTracks[-A-1]:this._lowerTracks[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2361
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2362
Timeline.DetailedEventPainter.prototype._paintEventLine=function(I,C,F,A,G,D){var H=Math.round(G.trackOffset+F*G.trackIncrement+G.trackHeight/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2363
var J=Math.round(Math.abs(A-F)*G.trackIncrement);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2364
var E="1px solid "+D.event.label.lineColor;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2365
var B=this._timeline.getDocument().createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2366
B.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2367
B.style.left=C+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2368
B.style.width=D.event.label.offsetFromLine+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2369
B.style.height=J+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2370
if(F>A){B.style.top=(H-J)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2371
B.style.borderTop=E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2372
}else{B.style.top=H+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2373
B.style.borderBottom=E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2374
}B.style.borderLeft=E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2375
this._lineLayer.appendChild(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2376
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2377
Timeline.DetailedEventPainter.prototype._paintEventIcon=function(I,E,B,F,D){var H=I.getIcon();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2378
H=H!=null?H:F.icon;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2379
var J=F.trackOffset+E*F.trackIncrement+F.trackHeight/2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2380
var G=Math.round(J-F.iconHeight/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2381
var C=SimileAjax.Graphics.createTranslucentImage(H);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2382
var A=this._timeline.getDocument().createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2383
A.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2384
A.style.left=B+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2385
A.style.top=G+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2386
A.appendChild(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2387
A.style.cursor="pointer";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2388
if(I._title!=null){A.title=I._title;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2389
}this._eventLayer.appendChild(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2390
return{left:B,top:G,width:F.iconWidth,height:F.iconHeight,elmt:A};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2391
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2392
Timeline.DetailedEventPainter.prototype._paintEventLabel=function(H,I,B,F,A,J,D){var G=this._timeline.getDocument();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2393
var K=G.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2394
K.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2395
K.style.left=B+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2396
K.style.width=A+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2397
K.style.top=F+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2398
K.style.height=J+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2399
K.style.backgroundColor=D.event.label.backgroundColor;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2400
SimileAjax.Graphics.setOpacity(K,D.event.label.backgroundOpacity);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2401
this._eventLayer.appendChild(K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2402
var E=G.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2403
E.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2404
E.style.left=B+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2405
E.style.width=A+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2406
E.style.top=F+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2407
E.innerHTML=I;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2408
E.style.cursor="pointer";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2409
if(H._title!=null){E.title=H._title;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2410
}var C=H.getTextColor();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2411
if(C==null){C=H.getColor();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2412
}if(C!=null){E.style.color=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2413
}this._eventLayer.appendChild(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2414
return{left:B,top:F,width:A,height:J,elmt:E};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2415
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2416
Timeline.DetailedEventPainter.prototype._paintEventTape=function(L,H,E,A,C,G,I,F){var B=A-E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2417
var D=F.event.tape.height;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2418
var M=I.trackOffset+H*I.trackIncrement+I.trackHeight/2;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2419
var J=Math.round(M-D/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2420
var K=this._timeline.getDocument().createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2421
K.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2422
K.style.left=E+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2423
K.style.width=B+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2424
K.style.top=J+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2425
K.style.height=D+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2426
K.style.backgroundColor=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2427
K.style.overflow="hidden";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2428
K.style.cursor="pointer";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2429
if(L._title!=null){K.title=L._title;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2430
}SimileAjax.Graphics.setOpacity(K,G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2431
this._eventLayer.appendChild(K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2432
return{left:E,top:J,width:B,height:D,elmt:K};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2433
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2434
Timeline.DetailedEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2435
var G=E.event;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2436
var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2437
var F=D.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2438
F.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2439
F.style.overflow="hidden";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2440
F.style.left=(C.left-2)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2441
F.style.width=(C.width+4)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2442
F.style.top=(C.top-2)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2443
F.style.height=(C.height+4)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2444
F.style.background=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2445
this._highlightLayer.appendChild(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2446
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2447
Timeline.DetailedEventPainter.prototype._onClickInstantEvent=function(B,C,A){var D=SimileAjax.DOM.getPageCoordinates(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2448
this._showBubble(D.left+Math.ceil(B.offsetWidth/2),D.top+Math.ceil(B.offsetHeight/2),A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2449
this._fireOnSelect(A.getID());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2450
C.cancelBubble=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2451
SimileAjax.DOM.cancelEvent(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2452
return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2453
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2454
Timeline.DetailedEventPainter.prototype._onClickDurationEvent=function(D,C,B){if("pageX" in C){var A=C.pageX;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2455
var F=C.pageY;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2456
}else{var E=SimileAjax.DOM.getPageCoordinates(D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2457
var A=C.offsetX+E.left;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2458
var F=C.offsetY+E.top;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2459
}this._showBubble(A,F,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2460
this._fireOnSelect(B.getID());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2461
C.cancelBubble=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2462
SimileAjax.DOM.cancelEvent(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2463
return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2464
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2465
Timeline.DetailedEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2466
if(B){var C=SimileAjax.DOM.getPageCoordinates(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2467
this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2474
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2475
Timeline.DetailedEventPainter.prototype._fireOnSelect=function(B){for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2476
A<this._onSelectListeners.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2477
A++){this._onSelectListeners[A](B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2478
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2479
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2480
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2481
/* ether-painters.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2482
Timeline.GregorianEtherPainter=function(A){this._params=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2483
this._theme=A.theme;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2484
this._unit=A.unit;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2485
this._multiple=("multiple" in A)?A.multiple:1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2486
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2487
Timeline.GregorianEtherPainter.prototype.initialize=function(C,B){this._band=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2488
this._timeline=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2489
this._backgroundLayer=C.createLayerDiv(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2490
this._backgroundLayer.setAttribute("name","ether-background");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2491
this._backgroundLayer.className="timeline-ether-bg";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2492
this._markerLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2493
this._lineLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2494
var D=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2495
var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2496
this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2497
this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2498
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2499
Timeline.GregorianEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2500
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2501
Timeline.GregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2502
}this._markerLayer=this._band.createLayerDiv(100);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2503
this._markerLayer.setAttribute("name","ether-markers");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2504
this._markerLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2505
if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2506
}this._lineLayer=this._band.createLayerDiv(1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2507
this._lineLayer.setAttribute("name","ether-lines");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2508
this._lineLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2509
var C=this._band.getMinDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2510
var F=this._band.getMaxDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2511
var B=this._band.getTimeZone();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2512
var E=this._band.getLabeller();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2513
SimileAjax.DateTime.roundDownToInterval(C,this._unit,B,this._multiple,this._theme.firstDayOfWeek);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2514
var D=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2515
var A=function(G){for(var H=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2516
H<D._multiple;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2517
H++){SimileAjax.DateTime.incrementByInterval(G,D._unit);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2518
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2519
while(C.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(C,E,this._unit,this._markerLayer,this._lineLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2520
A(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2521
}this._markerLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2522
this._lineLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2523
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2524
Timeline.GregorianEtherPainter.prototype.softPaint=function(){};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2525
Timeline.GregorianEtherPainter.prototype.zoom=function(A){if(A!=0){this._unit+=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2526
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2527
Timeline.HotZoneGregorianEtherPainter=function(G){this._params=G;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2528
this._theme=G.theme;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2529
this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,unit:G.unit,multiple:1}];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2530
for(var E=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2531
E<G.zones.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2532
E++){var B=G.zones[E];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2533
var D=SimileAjax.DateTime.parseGregorianDateTime(B.start).getTime();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2534
var F=SimileAjax.DateTime.parseGregorianDateTime(B.end).getTime();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2535
for(var C=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2536
C<this._zones.length&&F>D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2537
C++){var A=this._zones[C];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2539
C++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2540
A.startTime=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2541
}if(F<A.endTime){this._zones.splice(C,0,{startTime:D,endTime:F,unit:B.unit,multiple:(B.multiple)?B.multiple:1});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2542
C++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2543
A.startTime=F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2544
D=F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2545
}else{A.multiple=B.multiple;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2546
A.unit=B.unit;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2547
D=A.endTime;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2548
}}}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2549
Timeline.HotZoneGregorianEtherPainter.prototype.initialize=function(C,B){this._band=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2550
this._timeline=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2551
this._backgroundLayer=C.createLayerDiv(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2552
this._backgroundLayer.setAttribute("name","ether-background");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2553
this._backgroundLayer.className="timeline-ether-bg";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2554
this._markerLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2555
this._lineLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2556
var D=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2557
var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2558
this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2559
this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2560
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2561
Timeline.HotZoneGregorianEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2562
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2563
Timeline.HotZoneGregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2564
}this._markerLayer=this._band.createLayerDiv(100);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2565
this._markerLayer.setAttribute("name","ether-markers");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2566
this._markerLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2567
if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2568
}this._lineLayer=this._band.createLayerDiv(1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2569
this._lineLayer.setAttribute("name","ether-lines");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2570
this._lineLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2571
var D=this._band.getMinDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2572
var A=this._band.getMaxDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2573
var K=this._band.getTimeZone();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2574
var I=this._band.getLabeller();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2575
var B=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2576
var L=function(N,M){for(var O=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2577
O<M.multiple;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2578
O++){SimileAjax.DateTime.incrementByInterval(N,M.unit);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2579
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2580
var C=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2581
while(C<this._zones.length){if(D.getTime()<this._zones[C].endTime){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2582
}C++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2583
}var E=this._zones.length-1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2584
while(E>=0){if(A.getTime()>this._zones[E].startTime){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2585
}E--;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2586
}for(var H=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2587
H<=E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2588
H++){var G=this._zones[H];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2589
var J=new Date(Math.max(D.getTime(),G.startTime));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2590
var F=new Date(Math.min(A.getTime(),G.endTime));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2591
SimileAjax.DateTime.roundDownToInterval(J,G.unit,K,G.multiple,this._theme.firstDayOfWeek);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2592
SimileAjax.DateTime.roundUpToInterval(F,G.unit,K,G.multiple,this._theme.firstDayOfWeek);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2593
while(J.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(J,I,G.unit,this._markerLayer,this._lineLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2594
L(J,G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2595
}}this._markerLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2596
this._lineLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2597
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2598
Timeline.HotZoneGregorianEtherPainter.prototype.softPaint=function(){};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2599
Timeline.HotZoneGregorianEtherPainter.prototype.zoom=function(B){if(B!=0){for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2600
A<this._zones.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2601
++A){if(this._zones[A]){this._zones[A].unit+=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2602
}}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2603
Timeline.YearCountEtherPainter=function(A){this._params=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2604
this._theme=A.theme;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2605
this._startDate=SimileAjax.DateTime.parseGregorianDateTime(A.startDate);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2606
this._multiple=("multiple" in A)?A.multiple:1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2607
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2608
Timeline.YearCountEtherPainter.prototype.initialize=function(C,B){this._band=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2609
this._timeline=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2610
this._backgroundLayer=C.createLayerDiv(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2611
this._backgroundLayer.setAttribute("name","ether-background");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2612
this._backgroundLayer.className="timeline-ether-bg";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2613
this._markerLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2614
this._lineLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2615
var D=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2616
var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2617
this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2618
this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2619
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2620
Timeline.YearCountEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2621
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2622
Timeline.YearCountEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2623
}this._markerLayer=this._band.createLayerDiv(100);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2624
this._markerLayer.setAttribute("name","ether-markers");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2625
this._markerLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2626
if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2627
}this._lineLayer=this._band.createLayerDiv(1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2628
this._lineLayer.setAttribute("name","ether-lines");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2629
this._lineLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2630
var B=new Date(this._startDate.getTime());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2631
var F=this._band.getMaxDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2632
var E=this._band.getMinDate().getUTCFullYear()-this._startDate.getUTCFullYear();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2633
B.setUTCFullYear(this._band.getMinDate().getUTCFullYear()-E%this._multiple);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2634
var C=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2635
var A=function(G){for(var H=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2636
H<C._multiple;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2637
H++){SimileAjax.DateTime.incrementByInterval(G,SimileAjax.DateTime.YEAR);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2638
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2639
var D={labelInterval:function(G,I){var H=G.getUTCFullYear()-C._startDate.getUTCFullYear();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2640
return{text:H,emphasized:H==0};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2641
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2642
while(B.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(B,D,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2643
A(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2644
}this._markerLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2645
this._lineLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2646
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2647
Timeline.YearCountEtherPainter.prototype.softPaint=function(){};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2648
Timeline.QuarterlyEtherPainter=function(A){this._params=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2649
this._theme=A.theme;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2650
this._startDate=SimileAjax.DateTime.parseGregorianDateTime(A.startDate);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2651
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2652
Timeline.QuarterlyEtherPainter.prototype.initialize=function(C,B){this._band=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2653
this._timeline=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2654
this._backgroundLayer=C.createLayerDiv(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2655
this._backgroundLayer.setAttribute("name","ether-background");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2656
this._backgroundLayer.className="timeline-ether-bg";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2657
this._markerLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2658
this._lineLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2659
var D=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2660
var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2661
this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2662
this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2663
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2664
Timeline.QuarterlyEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2665
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2666
Timeline.QuarterlyEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2667
}this._markerLayer=this._band.createLayerDiv(100);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2668
this._markerLayer.setAttribute("name","ether-markers");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2669
this._markerLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2670
if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2671
}this._lineLayer=this._band.createLayerDiv(1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2672
this._lineLayer.setAttribute("name","ether-lines");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2673
this._lineLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2674
var B=new Date(0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2675
var E=this._band.getMaxDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2676
B.setUTCFullYear(Math.max(this._startDate.getUTCFullYear(),this._band.getMinDate().getUTCFullYear()));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2677
B.setUTCMonth(this._startDate.getUTCMonth());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2678
var C=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2679
var A=function(F){F.setUTCMonth(F.getUTCMonth()+3);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2680
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2681
var D={labelInterval:function(F,H){var G=(4+(F.getUTCMonth()-C._startDate.getUTCMonth())/3)%4;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2682
if(G!=0){return{text:"Q"+(G+1),emphasized:false};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2683
}else{return{text:"Y"+(F.getUTCFullYear()-C._startDate.getUTCFullYear()+1),emphasized:true};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2684
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2685
while(B.getTime()<E.getTime()){this._intervalMarkerLayout.createIntervalMarker(B,D,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2686
A(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2687
}this._markerLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2688
this._lineLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2689
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2690
Timeline.QuarterlyEtherPainter.prototype.softPaint=function(){};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2691
Timeline.EtherIntervalMarkerLayout=function(M,L,C,E,H){var A=M.isHorizontal();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2692
if(A){if(E=="Top"){this.positionDiv=function(O,N){O.style.left=N+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2693
O.style.top="0px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2694
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2695
}else{this.positionDiv=function(O,N){O.style.left=N+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2696
O.style.bottom="0px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2697
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2698
}}else{if(E=="Left"){this.positionDiv=function(O,N){O.style.top=N+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2699
O.style.left="0px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2700
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2701
}else{this.positionDiv=function(O,N){O.style.top=N+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2702
O.style.right="0px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2703
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2704
}}var D=C.ether.interval.marker;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2705
var I=C.ether.interval.line;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2706
var B=C.ether.interval.weekend;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2707
var K=(A?"h":"v")+E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2708
var G=D[K+"Styler"];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2709
var J=D[K+"EmphasizedStyler"];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2710
var F=SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2711
this.createIntervalMarker=function(T,a,b,c,Q){var U=Math.round(L.dateToPixelOffset(T));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2712
if(H&&b!=SimileAjax.DateTime.WEEK){var V=M.getDocument().createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2713
V.className="timeline-ether-lines";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2714
if(I.opacity<100){SimileAjax.Graphics.setOpacity(V,I.opacity);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2715
}if(A){V.style.left=U+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2716
}else{V.style.top=U+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2717
}Q.appendChild(V);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2718
}if(b==SimileAjax.DateTime.WEEK){var N=C.firstDayOfWeek;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2719
var W=new Date(T.getTime()+(6-N-7)*F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2720
var Z=new Date(W.getTime()+2*F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2721
var X=Math.round(L.dateToPixelOffset(W));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2722
var S=Math.round(L.dateToPixelOffset(Z));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2723
var R=Math.max(1,S-X);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2724
var P=M.getDocument().createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2725
P.className="timeline-ether-weekends";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2726
if(B.opacity<100){SimileAjax.Graphics.setOpacity(P,B.opacity);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2727
}if(A){P.style.left=X+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2728
P.style.width=R+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2729
}else{P.style.top=X+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2730
P.style.height=R+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2731
}Q.appendChild(P);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2732
}var Y=a.labelInterval(T,b);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2733
var O=M.getDocument().createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2734
O.innerHTML=Y.text;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2735
O.className="timeline-date-label";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2736
if(Y.emphasized){O.className+=" timeline-date-label-em";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2737
}this.positionDiv(O,U);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2738
c.appendChild(O);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2739
return O;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2740
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2741
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2742
Timeline.EtherHighlight=function(C,E,D,B){var A=C.isHorizontal();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2743
this._highlightDiv=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2744
this._createHighlightDiv=function(){if(this._highlightDiv==null){this._highlightDiv=C.getDocument().createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2745
this._highlightDiv.setAttribute("name","ether-highlight");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2746
this._highlightDiv.className="timeline-ether-highlight";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2747
var F=D.ether.highlightOpacity;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2748
if(F<100){SimileAjax.Graphics.setOpacity(this._highlightDiv,F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2749
}B.appendChild(this._highlightDiv);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2750
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2751
this.position=function(F,I){this._createHighlightDiv();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2752
var J=Math.round(E.dateToPixelOffset(F));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2753
var H=Math.round(E.dateToPixelOffset(I));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2754
var G=Math.max(H-J,3);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2755
if(A){this._highlightDiv.style.left=J+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2756
this._highlightDiv.style.width=G+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2757
this._highlightDiv.style.height=(E.getViewWidth()-4)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2758
}else{this._highlightDiv.style.top=J+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2759
this._highlightDiv.style.height=G+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2760
this._highlightDiv.style.width=(E.getViewWidth()-4)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2761
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2762
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2763
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2764
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2765
/* ethers.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2766
Timeline.LinearEther=function(A){this._params=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2767
this._interval=A.interval;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2768
this._pixelsPerInterval=A.pixelsPerInterval;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2769
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2770
Timeline.LinearEther.prototype.initialize=function(B,A){this._band=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2771
this._timeline=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2772
this._unit=A.getUnit();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2773
if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2774
}else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2775
this.shiftPixels(-this._timeline.getPixelLength());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2776
}else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2777
this.shiftPixels(-this._timeline.getPixelLength()/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2778
}else{this._start=this._unit.makeDefaultValue();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2779
this.shiftPixels(-this._timeline.getPixelLength()/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2780
}}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2781
Timeline.LinearEther.prototype.setDate=function(A){this._start=this._unit.cloneValue(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2782
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2783
Timeline.LinearEther.prototype.shiftPixels=function(B){var A=this._interval*B/this._pixelsPerInterval;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2784
this._start=this._unit.change(this._start,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2785
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2786
Timeline.LinearEther.prototype.dateToPixelOffset=function(A){var B=this._unit.compare(A,this._start);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2787
return this._pixelsPerInterval*B/this._interval;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2788
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2789
Timeline.LinearEther.prototype.pixelOffsetToDate=function(B){var A=B*this._interval/this._pixelsPerInterval;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2790
return this._unit.change(this._start,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2791
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2792
Timeline.LinearEther.prototype.zoom=function(D){var B=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2793
var A=this._band._zoomIndex;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2794
var C=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2795
if(D&&(A>0)){C=A-1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2796
}if(!D&&(A<(this._band._zoomSteps.length-1))){C=A+1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2797
}this._band._zoomIndex=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2798
this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[C].unit];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2799
this._pixelsPerInterval=this._band._zoomSteps[C].pixelsPerInterval;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2800
B=this._band._zoomSteps[C].unit-this._band._zoomSteps[A].unit;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2801
return B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2802
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2803
Timeline.HotZoneEther=function(A){this._params=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2804
this._interval=A.interval;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2805
this._pixelsPerInterval=A.pixelsPerInterval;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2806
this._theme=A.theme;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2807
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2808
Timeline.HotZoneEther.prototype.initialize=function(H,I){this._band=H;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2809
this._timeline=I;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2810
this._unit=I.getUnit();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2811
this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,magnify:1}];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2812
var B=this._params;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2813
for(var D=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2814
D<B.zones.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2815
D++){var G=B.zones[D];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2816
var E=this._unit.parseFromObject(G.start);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2817
var F=this._unit.parseFromObject(G.end);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2818
for(var C=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2819
C<this._zones.length&&this._unit.compare(F,E)>0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2820
C++){var A=this._zones[C];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2822
C++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2823
A.startTime=E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2824
}if(this._unit.compare(F,A.endTime)<0){this._zones.splice(C,0,{startTime:E,endTime:F,magnify:G.magnify*A.magnify});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2825
C++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2826
A.startTime=F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2827
E=F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2828
}else{A.magnify*=G.magnify;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2829
E=A.endTime;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2830
}}}}if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2831
}else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2832
this.shiftPixels(-this._timeline.getPixelLength());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2833
}else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2834
this.shiftPixels(-this._timeline.getPixelLength()/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2835
}else{this._start=this._unit.makeDefaultValue();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2836
this.shiftPixels(-this._timeline.getPixelLength()/2);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2837
}}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2838
Timeline.HotZoneEther.prototype.setDate=function(A){this._start=this._unit.cloneValue(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2839
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2840
Timeline.HotZoneEther.prototype.shiftPixels=function(A){this._start=this.pixelOffsetToDate(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2841
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2842
Timeline.HotZoneEther.prototype.dateToPixelOffset=function(A){return this._dateDiffToPixelOffset(this._start,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2843
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2844
Timeline.HotZoneEther.prototype.pixelOffsetToDate=function(A){return this._pixelOffsetToDate(A,this._start);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2845
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2846
Timeline.HotZoneEther.prototype.zoom=function(D){var B=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2847
var A=this._band._zoomIndex;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2848
var C=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2849
if(D&&(A>0)){C=A-1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2850
}if(!D&&(A<(this._band._zoomSteps.length-1))){C=A+1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2851
}this._band._zoomIndex=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2852
this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[C].unit];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2853
this._pixelsPerInterval=this._band._zoomSteps[C].pixelsPerInterval;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2854
B=this._band._zoomSteps[C].unit-this._band._zoomSteps[A].unit;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2855
return B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2856
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2857
Timeline.HotZoneEther.prototype._dateDiffToPixelOffset=function(I,D){var B=this._getScale();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2858
var H=I;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2859
var C=D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2860
var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2861
if(this._unit.compare(H,C)<0){var G=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2862
while(G<this._zones.length){if(this._unit.compare(H,this._zones[G].endTime)<0){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2863
}G++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2864
}while(this._unit.compare(H,C)<0){var E=this._zones[G];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2865
var F=this._unit.earlier(C,E.endTime);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2866
A+=(this._unit.compare(F,H)/(B/E.magnify));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2867
H=F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2868
G++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2869
}}else{var G=this._zones.length-1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2870
while(G>=0){if(this._unit.compare(H,this._zones[G].startTime)>0){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2871
}G--;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2872
}while(this._unit.compare(H,C)>0){var E=this._zones[G];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2873
var F=this._unit.later(C,E.startTime);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2874
A+=(this._unit.compare(F,H)/(B/E.magnify));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2875
H=F;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2876
G--;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2877
}}return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2878
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2879
Timeline.HotZoneEther.prototype._pixelOffsetToDate=function(H,C){var G=this._getScale();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2880
var E=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2881
if(H>0){var F=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2882
while(F<this._zones.length){if(this._unit.compare(E,this._zones[F].endTime)<0){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2883
}F++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2884
}while(H>0){var A=this._zones[F];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2885
var D=G/A.magnify;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2886
if(A.endTime==Number.POSITIVE_INFINITY){E=this._unit.change(E,H*D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2887
H=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2888
}else{var B=this._unit.compare(A.endTime,E)/D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2889
if(B>H){E=this._unit.change(E,H*D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2890
H=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2891
}else{E=A.endTime;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2892
H-=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2893
}}F++;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2894
}}else{var F=this._zones.length-1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2895
while(F>=0){if(this._unit.compare(E,this._zones[F].startTime)>0){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2896
}F--;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2897
}H=-H;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2898
while(H>0){var A=this._zones[F];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2899
var D=G/A.magnify;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2900
if(A.startTime==Number.NEGATIVE_INFINITY){E=this._unit.change(E,-H*D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2901
H=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2902
}else{var B=this._unit.compare(E,A.startTime)/D;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2903
if(B>H){E=this._unit.change(E,-H*D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2904
H=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2905
}else{E=A.startTime;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2906
H-=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2907
}}F--;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2908
}}return E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2909
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2910
Timeline.HotZoneEther.prototype._getScale=function(){return this._interval/this._pixelsPerInterval;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2911
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2912
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2932
/* labellers.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2933
Timeline.GregorianDateLabeller=function(A,B){this._locale=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2934
this._timeZone=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2935
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2936
Timeline.GregorianDateLabeller.monthNames=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2937
Timeline.GregorianDateLabeller.dayNames=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2938
Timeline.GregorianDateLabeller.labelIntervalFunctions=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2939
Timeline.GregorianDateLabeller.getMonthName=function(B,A){return Timeline.GregorianDateLabeller.monthNames[A][B];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2940
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2941
Timeline.GregorianDateLabeller.prototype.labelInterval=function(A,C){var B=Timeline.GregorianDateLabeller.labelIntervalFunctions[this._locale];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2942
if(B==null){B=Timeline.GregorianDateLabeller.prototype.defaultLabelInterval;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2943
}return B.call(this,A,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2944
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2945
Timeline.GregorianDateLabeller.prototype.labelPrecise=function(A){return SimileAjax.DateTime.removeTimeZoneOffset(A,this._timeZone).toUTCString();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2946
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2947
Timeline.GregorianDateLabeller.prototype.defaultLabelInterval=function(B,F){var C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2948
var E=false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2949
B=SimileAjax.DateTime.removeTimeZoneOffset(B,this._timeZone);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2950
switch(F){case SimileAjax.DateTime.MILLISECOND:C=B.getUTCMilliseconds();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2951
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2952
case SimileAjax.DateTime.SECOND:C=B.getUTCSeconds();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2953
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2954
case SimileAjax.DateTime.MINUTE:var A=B.getUTCMinutes();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2955
if(A==0){C=B.getUTCHours()+":00";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2956
E=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2957
}else{C=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2958
}break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2959
case SimileAjax.DateTime.HOUR:C=B.getUTCHours()+"hr";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2960
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2961
case SimileAjax.DateTime.DAY:C=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2962
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2963
case SimileAjax.DateTime.WEEK:C=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2964
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2965
case SimileAjax.DateTime.MONTH:var A=B.getUTCMonth();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2966
if(A!=0){C=Timeline.GregorianDateLabeller.getMonthName(A,this._locale);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2967
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2968
}case SimileAjax.DateTime.YEAR:case SimileAjax.DateTime.DECADE:case SimileAjax.DateTime.CENTURY:case SimileAjax.DateTime.MILLENNIUM:var D=B.getUTCFullYear();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2969
if(D>0){C=B.getUTCFullYear();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2970
}else{C=(1-D)+"BC";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2971
}E=(F==SimileAjax.DateTime.MONTH)||(F==SimileAjax.DateTime.DECADE&&D%100==0)||(F==SimileAjax.DateTime.CENTURY&&D%1000==0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2972
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2973
default:C=B.toUTCString();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2974
}return{text:C,emphasized:E};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2975
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2976
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2977
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2978
/* original-painter.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2979
Timeline.OriginalEventPainter=function(A){this._params=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2980
this._onSelectListeners=[];
67
60a291fe7965 regenerated cubicweb.timeline*.js
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
  2981
this._eventPaintListeners=[];
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2982
this._filterMatcher=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2983
this._highlightMatcher=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2984
this._frc=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2985
this._eventIdToElmt={};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2986
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2987
Timeline.OriginalEventPainter.prototype.initialize=function(B,A){this._band=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2988
this._timeline=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2989
this._backLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2990
this._eventLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2991
this._lineLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2992
this._highlightLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2993
this._eventIdToElmt=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2997
Timeline.OriginalEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2998
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  2999
Timeline.OriginalEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3000
A<this._onSelectListeners.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3001
A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3002
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3011
Timeline.OriginalEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3012
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3013
Timeline.OriginalEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3014
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3015
Timeline.OriginalEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3016
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3017
Timeline.OriginalEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3018
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3019
Timeline.OriginalEventPainter.prototype.paint=function(){var B=this._band.getEventSource();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3020
if(B==null){return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3023
this._prepareForPainting();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3024
var I=this._params.theme.event;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3027
var C=this._band.getMinDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3028
var A=this._band.getMaxDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3029
var J=(this._filterMatcher!=null)?this._filterMatcher:function(K){return true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3030
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3031
var E=(this._highlightMatcher!=null)?this._highlightMatcher:function(K){return -1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3032
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3033
var D=B.getEventReverseIterator(C,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3034
while(D.hasNext()){var H=D.next();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3035
if(J(H)){this.paintEvent(H,F,this._params.theme,E(H));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3036
}}this._highlightLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3037
this._lineLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3041
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3042
Timeline.OriginalEventPainter.prototype.softPaint=function(){};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3043
Timeline.OriginalEventPainter.prototype._prepareForPainting=function(){var B=this._band;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3044
if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3045
this._backLayer.style.visibility="hidden";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3046
var A=document.createElement("span");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3047
A.className="timeline-event-label";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3048
this._backLayer.appendChild(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3049
this._frc=SimileAjax.Graphics.getFontRenderingContext(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3050
}this._frc.update();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3051
this._tracks=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3052
if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3053
}this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3054
this._highlightLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3055
if(this._lineLayer!=null){B.removeLayerDiv(this._lineLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3056
}this._lineLayer=B.createLayerDiv(110,"timeline-band-lines");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3057
this._lineLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3058
if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3059
}this._eventLayer=B.createLayerDiv(115,"timeline-band-events");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3060
this._eventLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3061
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3062
Timeline.OriginalEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3063
}else{this.paintDurationEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3064
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3065
Timeline.OriginalEventPainter.prototype.paintInstantEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseInstantEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3066
}else{this.paintPreciseInstantEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3067
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3068
Timeline.OriginalEventPainter.prototype.paintDurationEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseDurationEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3069
}else{this.paintPreciseDurationEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3200
C<this._tracks.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3201
C++){var B=this._tracks[C];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3202
if(B>A){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3203
}}return C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3283
Timeline.OriginalEventPainter.prototype._onClickInstantEvent=function(B,C,A){var D=SimileAjax.DOM.getPageCoordinates(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3284
this._showBubble(D.left+Math.ceil(B.offsetWidth/2),D.top+Math.ceil(B.offsetHeight/2),A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3285
this._fireOnSelect(A.getID());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3286
C.cancelBubble=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3287
SimileAjax.DOM.cancelEvent(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3288
return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3289
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3290
Timeline.OriginalEventPainter.prototype._onClickDurationEvent=function(D,C,B){if("pageX" in C){var A=C.pageX;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3291
var F=C.pageY;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3292
}else{var E=SimileAjax.DOM.getPageCoordinates(D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3293
var A=C.offsetX+E.left;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3294
var F=C.offsetY+E.top;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3295
}this._showBubble(A,F,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3296
this._fireOnSelect(B.getID());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3297
C.cancelBubble=true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3298
SimileAjax.DOM.cancelEvent(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3299
return false;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3300
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3301
Timeline.OriginalEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3302
if(B){var C=SimileAjax.DOM.getPageCoordinates(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3303
this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3310
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3311
Timeline.OriginalEventPainter.prototype._fireOnSelect=function(B){for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3312
A<this._onSelectListeners.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3313
A++){this._onSelectListeners[A](B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3319
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3320
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3321
/* overview-painter.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3322
Timeline.OverviewEventPainter=function(A){this._params=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3323
this._onSelectListeners=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3324
this._filterMatcher=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3325
this._highlightMatcher=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3326
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3327
Timeline.OverviewEventPainter.prototype.initialize=function(B,A){this._band=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3328
this._timeline=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3329
this._eventLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3330
this._highlightLayer=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3334
Timeline.OverviewEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3335
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3336
Timeline.OverviewEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3337
A<this._onSelectListeners.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3338
A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3339
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3340
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3341
Timeline.OverviewEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3342
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3343
Timeline.OverviewEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3344
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3345
Timeline.OverviewEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3346
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3347
Timeline.OverviewEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3348
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3349
Timeline.OverviewEventPainter.prototype.paint=function(){var B=this._band.getEventSource();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3350
if(B==null){return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3351
}this._prepareForPainting();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3352
var H=this._params.theme.event;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3353
var F={trackOffset:H.overviewTrack.offset,trackHeight:H.overviewTrack.height,trackGap:H.overviewTrack.gap,trackIncrement:H.overviewTrack.height+H.overviewTrack.gap};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3354
var C=this._band.getMinDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3355
var A=this._band.getMaxDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3356
var I=(this._filterMatcher!=null)?this._filterMatcher:function(J){return true;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3357
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3358
var E=(this._highlightMatcher!=null)?this._highlightMatcher:function(J){return -1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3359
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3360
var D=B.getEventReverseIterator(C,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3361
while(D.hasNext()){var G=D.next();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3362
if(I(G)){this.paintEvent(G,F,this._params.theme,E(G));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3363
}}this._highlightLayer.style.display="block";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3366
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3367
Timeline.OverviewEventPainter.prototype.softPaint=function(){};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3368
Timeline.OverviewEventPainter.prototype._prepareForPainting=function(){var A=this._band;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3369
this._tracks=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3370
if(this._highlightLayer!=null){A.removeLayerDiv(this._highlightLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3371
}this._highlightLayer=A.createLayerDiv(105,"timeline-band-highlights");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3372
this._highlightLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3373
if(this._eventLayer!=null){A.removeLayerDiv(this._eventLayer);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3374
}this._eventLayer=A.createLayerDiv(110,"timeline-band-events");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3375
this._eventLayer.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3376
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3377
Timeline.OverviewEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3378
}else{this.paintDurationEvent(B,C,D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3379
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3380
Timeline.OverviewEventPainter.prototype.paintInstantEvent=function(C,F,G,B){var A=C.getStart();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3381
var H=Math.round(this._band.dateToPixelOffset(A));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3382
var D=C.getColor();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3383
D=D!=null?D:G.event.duration.color;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3384
var E=this._paintEventTick(C,H,D,100,F,G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3385
this._createHighlightDiv(B,E,G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3386
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3387
Timeline.OverviewEventPainter.prototype.paintDurationEvent=function(K,J,I,D){var A=K.getLatestStart();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3388
var C=K.getEarliestEnd();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3389
var B=Math.round(this._band.dateToPixelOffset(A));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3390
var E=Math.round(this._band.dateToPixelOffset(C));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3391
var H=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3392
for(;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3393
H<this._tracks.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3394
H++){if(E<this._tracks[H]){break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3395
}}this._tracks[H]=E;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3396
var G=K.getColor();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3397
G=G!=null?G:I.event.duration.color;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3398
var F=this._paintEventTape(K,H,B,E,G,100,J,I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3399
this._createHighlightDiv(D,F,I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3400
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3401
Timeline.OverviewEventPainter.prototype._paintEventTape=function(K,B,C,J,D,F,G,E){var H=G.trackOffset+B*G.trackIncrement;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3402
var A=J-C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3403
var L=G.trackHeight;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3404
var I=this._timeline.getDocument().createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3405
I.className="timeline-small-event-tape";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3406
I.style.left=C+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3407
I.style.width=A+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3412
}this._eventLayer.appendChild(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3413
return{left:C,top:H,width:A,height:L,elmt:I};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3414
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3415
Timeline.OverviewEventPainter.prototype._paintEventTick=function(J,B,D,F,G,E){var K=E.event.overviewTrack.tickHeight;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3416
var H=G.trackOffset-K;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3417
var A=1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3418
var I=this._timeline.getDocument().createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3419
I.className="timeline-small-event-icon";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3420
I.style.left=B+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3421
I.style.top=H+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3422
var C=J.getClassName();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3423
if(C){I.className+=" small-"+C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3424
}if(F<100){SimileAjax.Graphics.setOpacity(I,F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3425
}this._eventLayer.appendChild(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3426
return{left:B,top:H,width:A,height:K,elmt:I};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3427
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3428
Timeline.OverviewEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3429
var G=E.event;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3430
var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3431
var F=D.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3432
F.style.position="absolute";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3433
F.style.overflow="hidden";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3434
F.style.left=(C.left-1)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3435
F.style.width=(C.width+2)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3436
F.style.top=(C.top-1)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3437
F.style.height=(C.height+2)+"px";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3438
F.style.background=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3439
this._highlightLayer.appendChild(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3440
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3441
Timeline.OverviewEventPainter.prototype.showBubble=function(A){};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3442
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3443
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3447
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3448
Timeline.DefaultEventSource.prototype.addListener=function(A){this._listeners.push(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3449
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3450
Timeline.DefaultEventSource.prototype.removeListener=function(B){for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3451
A<this._listeners.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3452
A++){if(this._listeners[A]==B){this._listeners.splice(A,1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3453
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3470
this._events.add(J);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3488
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3489
K.setWikiInfo(I,L);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3490
this._events.add(K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3521
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3522
Timeline.DefaultEventSource.prototype.add=function(A){this._events.add(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3523
this._fire("onAddOne",[A]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3524
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3525
Timeline.DefaultEventSource.prototype.addMany=function(B){for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3526
A<B.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3527
A++){this._events.add(B[A]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3528
}this._fire("onAddMany",[]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3529
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3530
Timeline.DefaultEventSource.prototype.clear=function(){this._events.removeAll();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3531
this._fire("onClear",[]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3532
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3533
Timeline.DefaultEventSource.prototype.getEvent=function(A){return this._events.getEvent(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3534
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3535
Timeline.DefaultEventSource.prototype.getEventIterator=function(A,B){return this._events.getIterator(A,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3536
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3537
Timeline.DefaultEventSource.prototype.getEventReverseIterator=function(A,B){return this._events.getReverseIterator(A,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3538
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3539
Timeline.DefaultEventSource.prototype.getAllEventIterator=function(){return this._events.getAllIterator();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3540
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3541
Timeline.DefaultEventSource.prototype.getCount=function(){return this._events.getCount();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3542
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3543
Timeline.DefaultEventSource.prototype.getEarliestDate=function(){return this._events.getEarliestDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3544
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3545
Timeline.DefaultEventSource.prototype.getLatestDate=function(){return this._events.getLatestDate();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3546
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3547
Timeline.DefaultEventSource.prototype._fire=function(B,A){for(var C=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3548
C<this._listeners.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3549
C++){var D=this._listeners[C];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3550
if(B in D){try{D[B].apply(D,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3551
}catch(E){SimileAjax.Debug.exception(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3552
}}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3553
Timeline.DefaultEventSource.prototype._getBaseURL=function(A){if(A.indexOf("://")<0){var C=this._getBaseURL(document.location.href);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3554
if(A.substr(0,1)=="/"){A=C.substr(0,C.indexOf("/",C.indexOf("://")+3))+A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3555
}else{A=C+A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3556
}}var B=A.lastIndexOf("/");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3557
if(B<0){return"";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3558
}else{return A.substr(0,B+1);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3559
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3560
Timeline.DefaultEventSource.prototype._resolveRelativeURL=function(A,B){if(A==null||A==""){return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3561
}else{if(A.indexOf("://")>0){return A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3562
}else{if(A.substr(0,1)=="/"){return B.substr(0,B.indexOf("/",B.indexOf("://")+3))+A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3563
}else{return B+A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3568
this._instant=A.instant||(A.end==null);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3569
this._start=A.start;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3570
this._end=(A.end!=null)?A.end:A.start;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3603
this._wikiSection=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3604
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3605
Timeline.DefaultEventSource.Event.prototype={getID:function(){return this._id;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3606
},isInstant:function(){return this._instant;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3607
},isImprecise:function(){return this._start!=this._latestStart||this._end!=this._earliestEnd;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3608
},getStart:function(){return this._start;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3609
},getEnd:function(){return this._end;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3610
},getLatestStart:function(){return this._latestStart;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3611
},getEarliestEnd:function(){return this._earliestEnd;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3612
},getEventID:function(){return this._eventID;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3613
},getText:function(){return this._text;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3614
},getDescription:function(){return this._description;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3615
},getImage:function(){return this._image;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3616
},getLink:function(){return this._link;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3617
},getIcon:function(){return this._icon;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3618
},getColor:function(){return this._color;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3619
},getTextColor:function(){return this._textColor;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3620
},getClassName:function(){return this._classname;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3621
},getTapeImage:function(){return this._tapeImage;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3624
},getProperty:function(A){return null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3625
},getWikiURL:function(){return this._wikiURL;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3626
},getWikiSection:function(){return this._wikiSection;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3627
},setWikiInfo:function(B,A){this._wikiURL=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3628
this._wikiSection=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3629
},fillDescription:function(A){A.innerHTML=this._description;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3630
},fillWikiInfo:function(D){D.style.display="none";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3631
if(this._wikiURL==null||this._wikiSection==null){return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3632
}var C=this.getProperty("wikiID");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3633
if(C==null||C.length==0){C=this.getText();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3634
}if(C==null||C.length==0){return ;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3635
}D.style.display="inline";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3636
C=C.replace(/\s/g,"_");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3637
var B=this._wikiURL+this._wikiSection.replace(/\s/g,"_")+"/"+C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3638
var A=document.createElement("a");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3639
A.href=B;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3640
A.target="new";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3641
A.innerHTML=Timeline.strings[Timeline.clientLocale].wikiLinkLabel;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3642
D.appendChild(document.createTextNode("["));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3643
D.appendChild(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3644
D.appendChild(document.createTextNode("]"));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3645
},fillTime:function(A,B){if(this._instant){if(this.isImprecise()){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3646
A.appendChild(A.ownerDocument.createElement("br"));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3647
A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._end)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3648
}else{A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3649
}}else{if(this.isImprecise()){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)+" ~ "+B.labelPrecise(this._latestStart)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3650
A.appendChild(A.ownerDocument.createElement("br"));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3651
A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._earliestEnd)+" ~ "+B.labelPrecise(this._end)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3652
}else{A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3653
A.appendChild(A.ownerDocument.createElement("br"));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3654
A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._end)));
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3655
}}},fillInfoBubble:function(A,D,K){var L=A.ownerDocument;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3656
var J=this.getText();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3657
var H=this.getLink();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3658
var C=this.getImage();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3659
if(C!=null){var E=L.createElement("img");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3660
E.src=C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3661
D.event.bubble.imageStyler(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3662
A.appendChild(E);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3663
}var M=L.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3664
var B=L.createTextNode(J);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3665
if(H!=null){var I=L.createElement("a");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3666
I.href=H;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3667
I.appendChild(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3668
M.appendChild(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3669
}else{M.appendChild(B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3670
}D.event.bubble.titleStyler(M);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3671
A.appendChild(M);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3672
var N=L.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3673
this.fillDescription(N);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3674
D.event.bubble.bodyStyler(N);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3675
A.appendChild(N);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3676
var G=L.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3677
this.fillTime(G,K);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3678
D.event.bubble.timeStyler(G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3679
A.appendChild(G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3680
var F=L.createElement("div");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3681
this.fillWikiInfo(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3682
D.event.bubble.wikiStyler(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3683
A.appendChild(F);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3684
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3685
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3686
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3687
/* themes.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3688
Timeline.ClassicTheme=new Object();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3689
Timeline.ClassicTheme.implementations=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3690
Timeline.ClassicTheme.create=function(A){if(A==null){A=Timeline.getDefaultLocale();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3691
}var B=Timeline.ClassicTheme.implementations[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3692
if(B==null){B=Timeline.ClassicTheme._Impl;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3693
}return new B();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3694
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3700
},bodyStyler:function(A){A.className="timeline-event-bubble-body";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3701
},imageStyler:function(A){A.className="timeline-event-bubble-image";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3702
},wikiStyler:function(A){A.className="timeline-event-bubble-wiki";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3703
},timeStyler:function(A){A.className="timeline-event-bubble-time";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3704
}}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3705
this.mouseWheel="scroll";
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3706
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3707
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3708
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3709
/* timeline.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3710
Timeline.strings={};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3711
Timeline.HORIZONTAL=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3712
Timeline.VERTICAL=1;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3723
Timeline.createBandInfo=function(D){var E=("theme" in D)?D.theme:Timeline.getDefaultTheme();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3744
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3745
Timeline.createHotZoneBandInfo=function(D){var E=("theme" in D)?D.theme:Timeline.getDefaultTheme();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3746
var B=("eventSource" in D)?D.eventSource:null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3748
var G=new Timeline.HotZoneGregorianEtherPainter({unit:D.intervalUnit,zones:D.zones,theme:E,align:("align" in D)?D.align:undefined});
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3749
var I={showText:("showEventText" in D)?D.showEventText:true,theme:E};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3750
if("eventPainterParams" in D){for(var A in D.eventPainterParams){I[A]=D.eventPainterParams[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3751
}}if("trackHeight" in D){I.trackHeight=D.trackHeight;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3752
}if("trackGap" in D){I.trackGap=D.trackGap;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3753
}var H=("overview" in D&&D.overview)?"overview":("layout" in D?D.layout:"original");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3754
var C;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3755
if("eventPainter" in D){C=new D.eventPainter(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3756
}else{switch(H){case"overview":C=new Timeline.OverviewEventPainter(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3757
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3758
case"detailed":C=new Timeline.DetailedEventPainter(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3759
break;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3760
default:C=new Timeline.OriginalEventPainter(I);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3762
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3763
Timeline.getDefaultTheme=function(){if(Timeline._defaultTheme==null){Timeline._defaultTheme=Timeline.ClassicTheme.create(Timeline.getDefaultLocale());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3764
}return Timeline._defaultTheme;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3765
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3766
Timeline.setDefaultTheme=function(A){Timeline._defaultTheme=A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3767
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3768
Timeline.loadXML=function(A,C){var D=function(G,E,F){alert("Failed to load data xml from "+A+"\n"+G);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3769
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3770
var B=function(F){var E=F.responseXML;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3771
if(!E.documentElement&&F.responseStream){E.load(F.responseStream);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3772
}C(E,A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3773
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3774
SimileAjax.XmlHttp.get(A,D,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3775
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3776
Timeline.loadJSON=function(url,f){var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3777
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3778
var fDone=function(xmlhttp){f(eval("("+xmlhttp.responseText+")"),url);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3779
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3780
SimileAjax.XmlHttp.get(url,fError,fDone);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3794
this._initialize();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3795
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3796
Timeline._Impl.prototype.dispose=function(){for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3797
A<this._bands.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3798
A++){this._bands[A].dispose();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3799
}this._bands=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3800
this._bandInfos=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3803
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3804
Timeline._Impl.prototype.getBandCount=function(){return this._bands.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3805
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3806
Timeline._Impl.prototype.getBand=function(A){return this._bands[A];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3813
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3814
Timeline._Impl.prototype.paint=function(){for(var A=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3815
A<this._bands.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3816
A++){this._bands[A].paint();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3817
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3818
Timeline._Impl.prototype.getDocument=function(){return this._containerDiv.ownerDocument;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3819
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3820
Timeline._Impl.prototype.addDiv=function(A){this._containerDiv.appendChild(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3821
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3822
Timeline._Impl.prototype.removeDiv=function(A){this._containerDiv.removeChild(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3823
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3824
Timeline._Impl.prototype.isHorizontal=function(){return this._orientation==Timeline.HORIZONTAL;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3825
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3826
Timeline._Impl.prototype.isVertical=function(){return this._orientation==Timeline.VERTICAL;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3827
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3828
Timeline._Impl.prototype.getPixelLength=function(){return this._orientation==Timeline.HORIZONTAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3829
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3830
Timeline._Impl.prototype.getPixelWidth=function(){return this._orientation==Timeline.VERTICAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3831
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3832
Timeline._Impl.prototype.getUnit=function(){return this._unit;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3836
Timeline._Impl.prototype.loadXML=function(B,D){var A=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3837
var E=function(H,F,G){alert("Failed to load data xml from "+B+"\n"+H);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3838
A.hideLoadingMessage();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3839
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3840
var C=function(G){try{var F=G.responseXML;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3841
if(!F.documentElement&&G.responseStream){F.load(G.responseStream);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3842
}D(F,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3843
}finally{A.hideLoadingMessage();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3844
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3845
this.showLoadingMessage();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3846
window.setTimeout(function(){SimileAjax.XmlHttp.get(B,E,C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3847
},0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3848
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3849
Timeline._Impl.prototype.loadJSON=function(url,f){var tl=this;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3850
var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3851
tl.hideLoadingMessage();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3852
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3853
var fDone=function(xmlhttp){try{f(eval("("+xmlhttp.responseText+")"),url);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3854
}finally{tl.hideLoadingMessage();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3855
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3856
this.showLoadingMessage();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3857
window.setTimeout(function(){SimileAjax.XmlHttp.get(url,fError,fDone);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3858
},0);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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 &copy; 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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3897
this._bands=[];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3898
for(var C=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3904
}this._distributeWidths();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3905
for(var C=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3906
C<this._bandInfos.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3907
C++){var F=this._bandInfos[C];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3920
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3921
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3922
Timeline._Impl.prototype._distributeWidths=function(){var B=this.getPixelLength();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3925
for(var E=0;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3926
E<this._bands.length;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3927
E++){var I=this._bands[E];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3928
var J=this._bandInfos[E];
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3939
}};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3940
Timeline._Impl.prototype.zoom=function(G,B,F,D){var C=new RegExp("^timeline-band-([0-9]+)$");
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3941
var E=null;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3942
var A=C.exec(D.id);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3943
if(A){E=parseInt(A[1]);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3944
}if(E!=null){this._bands[E].zoom(G,B,F,D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3945
}this.paint();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3946
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3947
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3948
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3949
/* units.js */
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3950
Timeline.NativeDateUnit=new Object();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3951
Timeline.NativeDateUnit.createLabeller=function(A,B){return new Timeline.GregorianDateLabeller(A,B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3952
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3953
Timeline.NativeDateUnit.makeDefaultValue=function(){return new Date();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3954
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3955
Timeline.NativeDateUnit.cloneValue=function(A){return new Date(A.getTime());
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3956
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3957
Timeline.NativeDateUnit.getParser=function(A){if(typeof A=="string"){A=A.toLowerCase();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3958
}return(A=="iso8601"||A=="iso 8601")?Timeline.DateTime.parseIso8601DateTime:Timeline.DateTime.parseGregorianDateTime;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3959
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3960
Timeline.NativeDateUnit.parseFromObject=function(A){return Timeline.DateTime.parseGregorianDateTime(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3961
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3962
Timeline.NativeDateUnit.toNumber=function(A){return A.getTime();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3963
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3964
Timeline.NativeDateUnit.fromNumber=function(A){return new Date(A);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3965
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3966
Timeline.NativeDateUnit.compare=function(D,C){var B,A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3967
if(typeof D=="object"){B=D.getTime();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3968
}else{B=Number(D);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3969
}if(typeof C=="object"){A=C.getTime();
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3970
}else{A=Number(C);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3971
}return B-A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3972
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3973
Timeline.NativeDateUnit.earlier=function(B,A){return Timeline.NativeDateUnit.compare(B,A)<0?B:A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3974
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3975
Timeline.NativeDateUnit.later=function(B,A){return Timeline.NativeDateUnit.compare(B,A)>0?B:A;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3976
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3977
Timeline.NativeDateUnit.change=function(A,B){return new Date(A.getTime()+B);
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  3978
};
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
  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 ********/