annot-server/webapp/templates/annotviz.html
author ymh <ymh.work@gmail.com>
Fri, 23 Jan 2015 02:00:19 +0100
changeset 131 0bb70072a56f
parent 119 e6605fecb175
child 132 16c2ba3b02c3
permissions -rw-r--r--
some quick cleaning

<html>
<head>
    <meta charset="UTF-8">
    <title>Piano Roll {{event.label}}</title>
    <link href="{{ config['STATIC_URL'] }}/css/annotviz.min.css" rel="stylesheet">
</head>
<body>
    <h1>Piano Roll {{event.label}}</h1>
    <noscript>You must enable JavaScript</noscript>
    <div id="canvasContainer"></div>
    <p>
        <a href="#" onclick="stop(); return false;">stop intervals</a> -
        <a href="#" onclick="start(); return false;">start intervals</a> -
        temps écoulé : <span id="timeStarted"></span>
    </p>
    <pre id="log"></pre>
    <script src="{{ config['STATIC_URL'] }}/js/libs-annotviz.min.js"></script>
    <script src="{{ config['STATIC_URL'] }}/js/annotviz.min.js"></script>
    <script>

    var pianorollChannel  = 'PIANOROLL';
    var annotationChannel = 'ANNOT';
    var eventCode = '{{event.code}}';
    var wsUri = 'ws://' + window.location.hostname + ':8090/broadcast';

    wsUriPianoroll = wsUri + '?channel=' + pianorollChannel + '&event_code=' + eventCode;
    wsUriAnnotation = wsUri + '?channel=' + annotationChannel + '&event_code=' + eventCode;

    var logger = new annotviz.ConsoleLogger(true);

    var stageView = new annotviz.StageView({
        logger: logger
    });


    var annotsvizview = new annotviz.AnnotsVizView({
        urlCategories: serverUrl + "/p/api/v1/event/" + eventCode,
        logger: logger,
        stageView: stageView,
        wsPianoroll: new annotviz.WsWrapper(wsUriPianoroll, logger),
        wsAnnot: new annotviz.WsWrapper(wsUriAnnotation, logger),
        timeBegin: Date.parse("2015-01-23T09:30:00+01:00"),
        timeEnd: Date.parse("2015-01-23T18:30:00+01:00"),
        eventCode: eventCode,
        channel: annotationChannel        
    });


    function stop() {
        stageView.stop();
    }
    function start() {
        stageView.start();
    }

    window.onload = function() {
        stageView.init();
        start();
    }
</script>
</body>
</html>