client/annotviz/app/annotsvizview.html
changeset 121 df6b39f962bc
parent 117 c0034b35c44e
child 122 3b11017a76a4
--- a/client/annotviz/app/annotsvizview.html	Thu Jan 22 15:02:54 2015 +0100
+++ b/client/annotviz/app/annotsvizview.html	Thu Jan 22 15:03:58 2015 +0100
@@ -23,7 +23,6 @@
     <script>
 
         var PIXI = require('pixi');
-        var annotCategories = [];
 
         function colorToHex(input) {
             if (input.substring(0, 1) === '#') {
@@ -36,44 +35,12 @@
             }
         }
 
-        function getAnnotCategories(ecode, serverUrl) {
-
-            var url = serverUrl+"/p/api/v1/event/" + ecode;
-
-            var jsonLoader = new PIXI.JsonLoader(url, true);
-            jsonLoader.on('loaded', function(res) {
-                var data = res.target.json;
-
-                while(annotCategories.length > 0) {
-                    annotCategories.pop();
-                }
-
-                data.sessions.forEach(function(session) {
-                    var annotCat = {
-                        ts: session.start_ts === null ? new Date(0) : Date.parse(session.start_ts),
-                        colors: {}
-                    }
-                    var categoriesJson = session.categories_json;
-                    annotCat.order = categoriesJson.order;
-                    categoriesJson.categories.forEach(function(cat) {
-                        annotCat.colors[cat.code] = colorToHex(cat.color);
-                    });
-                    annotCat.defaultColor = categoriesJson.defaultColor || "#536991";
-                    annotCategories.push(annotCat);
-                });
-                console.log(annotCategories);
-            });
-
-            jsonLoader.load();
-        }
-
-
-
 	    var pianorollChannel  = 'PIANOROLL';
 	    var annotationChannel = 'ANNOT';
-	    var eventCode = 'test_1';
-        getAnnotCategories(eventCode, "http://127.0.0.1:8080");
+	    var eventCode = 'atelier2';
+	    var serverUrl = "http://172.16.0.20:8080";
 	    var wsUri;
+	    
 	    if (window.location.protocol === 'file:') {
 	        wsUri = 'ws://172.16.0.20:8090/broadcast';
 	    }
@@ -91,6 +58,7 @@
 
 
         var annotsvizview = new annotviz.AnnotsVizView({
+        	urlCategories: serverUrl + "/p/api/v1/event/" + eventCode,
         	logger: logger,
         	stageView: stageView,
         	wsPianoroll: new annotviz.WsWrapper(wsUriPianoroll, logger),