annot-server/webapp/templates/pianoroll.html
changeset 108 082b64a5c699
parent 84 d7c5bffdd2d8
child 151 8468703ef93c
equal deleted inserted replaced
107:6d41506f9482 108:082b64a5c699
     1 <html>
     1 <html>
     2 <head>
     2 <head>
     3     <meta charset="UTF-8">
     3     <meta charset="UTF-8">
     4     <title>Piano Roll {{event.label}}</title>
     4     <title>Piano Roll {{event.label}}</title>
     5     <style>
     5     <link href="{{ config['STATIC_URL'] }}/css/annotviz.min.css" rel="stylesheet">
     6         body {
       
     7             margin: 0;
       
     8             padding: 0;
       
     9             background-color: #FFF;
       
    10         }
       
    11         #log {
       
    12             height: 20em;
       
    13             overflow-y: scroll;
       
    14             background-color: #faa;
       
    15         }
       
    16     </style>
       
    17 </head>
     6 </head>
    18 <body>
     7 <body>
    19     <h1>Piano Roll {{event.label}}</h1>
     8     <h1>Piano Roll {{event.label}}</h1>
    20     <noscript>You must enable JavaScript</noscript>
     9     <noscript>You must enable JavaScript</noscript>
    21     <div id="canvasContainer"></div>
    10     <div id="canvasContainer"></div>
    22     <p>
    11     <p>
    23         <a href="#" onclick="clearInterval(moveInterval); clearInterval(verticalLinesInterval); return false;">stop intervals</a>
    12         <a href="#" onclick="stop(); return false;">stop intervals</a> -
    24          - temps écoulé : <span id="myspan"></span>
    13         <a href="#" onclick="start(); return false;">start intervals</a> -
    25      </p>
    14         temps écoulé : <span id="timeStarted"></span>
       
    15     </p>
    26     <pre id="log"></pre>
    16     <pre id="log"></pre>
    27     <script src="{{ config['STATIC_URL'] }}/js/libs-pianoroll.min.js"></script>
    17     <script src="{{ config['STATIC_URL'] }}/js/libs-annotviz.min.js"></script>
       
    18     <script src="{{ config['STATIC_URL'] }}/js/annotviz.min.js"></script>
    28     <script>
    19     <script>
    29         var eventCode = "{{event.code}}";
    20     var annotationChannel = 'PIANOROLL';
       
    21     var eventCode = '{{event.code}}';
       
    22     var wsUri;
       
    23     if (window.location.protocol === 'file:') {
       
    24         wsUri = 'ws://127.0.0.1:8090/broadcast';
       
    25     }
       
    26     else {
       
    27         wsUri = 'ws://' + window.location.hostname + ':8090/broadcast';
       
    28     }
       
    29     wsUri += '?channel='+annotationChannel+'&event_code='+eventCode;
       
    30 
       
    31     var logger = new annotviz.HtmlLogger(false, 'log');
       
    32 
       
    33     var stageView = new annotviz.StageView({
       
    34         logger: logger
       
    35     });
       
    36 
       
    37     var doubleroll = new annotviz.DoubleRoll({
       
    38         logger: logger,
       
    39         stageView: stageView,
       
    40         ws: new annotviz.WsWrapper(wsUri)
       
    41     });
       
    42 
       
    43     function stop() { stageView.stop(); }
       
    44     function start() { stageView.start(); }
       
    45 
       
    46     window.onload = function() {
       
    47         stageView.init();
       
    48         start();
       
    49     }
    30     </script>
    50     </script>
    31     <script src="{{ config['STATIC_URL'] }}/js/pianoroll.min.js"></script>
       
    32     <script>
       
    33         var moveInterval = pianoroll.moveInterval;
       
    34         var verticalLinesInterval = pianoroll.verticalLinesInterval;
       
    35     </script>
       
    36 
       
    37 </body>
    51 </body>
    38 </html>
    52 </html>