Merge
authorrougeronj
Fri, 23 Jan 2015 09:58:21 +0100
changeset 134 119b6193c493
parent 133 12f782a13fa2 (diff)
parent 132 16c2ba3b02c3 (current diff)
child 135 d3066fa80a81
Merge
client/annotviz/app/js/annotsvizview.js
--- a/client/annotviz/app/annotstimeline.html	Fri Jan 23 09:46:12 2015 +0100
+++ b/client/annotviz/app/annotstimeline.html	Fri Jan 23 09:58:21 2015 +0100
@@ -28,7 +28,8 @@
     <script>
 
         var annotationChannel = 'ANNOT';
-        var eventCode = 'test_1';
+        var eventCode = 'atelier2';
+        var eventCodeSessionDay1 = 'atelier2_jour2';
         var wsUri;
         if (window.location.protocol === 'file:') {
             wsUri = 'ws://127.0.0.1:8090/broadcast';
@@ -68,6 +69,7 @@
         var annotstimeline = new annotviz.AnnotsTimeLine({
         	stageView : stageView,
             logger: logger,
+            serverUrl: serverUrl,
             ws: new annotviz.WsWrapper(wsUriAnnotation, logger),
             xInit: 0,
             yInit: 0,
@@ -82,6 +84,7 @@
             circleX:500,
             circleY:450,
             eventCode: eventCode,
+            eventCodeSessionDay1: eventCodeSessionDay1,
             channel: annotationChannel,
             annotCategories: annotCategories
         });
--- a/client/annotviz/app/js/annotsvizview.js	Fri Jan 23 09:46:12 2015 +0100
+++ b/client/annotviz/app/js/annotsvizview.js	Fri Jan 23 09:58:21 2015 +0100
@@ -4,16 +4,15 @@
 * This is the starting point for your application.
 * Take a look at http://browserify.org/ for more info
 */
-/*jshint unused:false */
 
 'use strict';
 
 var PIXI = require('pixi');
 var _ = require('lodash');
-var DoubleRoll = require('./doubleroll');
-var AnnotsTimeLine = require('./annotstimeline');
-var AnnotsRoll = require('./annotsroll');
-var Utils = require('./utils');
+var DoubleRoll = require('./doubleroll.js');
+var AnnotsTimeLine = require('./annotstimeline.js');
+var AnnotsRoll = require('./annotsroll.js');
+var Utils = require('./utils.js');
 
 var defaultOptions = {
     xInit: 0,
@@ -23,31 +22,33 @@
 };
 
 function AnnotsVizView(options){
-    var _this = this;
+	var _this = this;
     var opts = _(options).defaults(defaultOptions).value();
 
     this.container = new PIXI.DisplayObjectContainer();
     this.container.x = opts.xInit;
     this.container.y = opts.yInit;
-    this.width = opts.width;
-    this.height= opts.height;
+	this.width = opts.width;
+	this.height= opts.height;
     this.timeBegin = opts.timeBegin;
     this.timeEnd = opts.timeEnd;
     this.annotCategories = [];
-
+    
     Utils.getAnnotCategories(opts.urlCategories, this.annotCategories);
+    
+	var wsPianoroll = opts.wsPianoroll;
+	var wsAnnot = opts.wsAnnot;
+	var stageView = opts.stageView;
+	var currentTime = Date.now() + 3600*1000;
+	var eventCode = opts.eventCode;
+	var eventCodeSessionDay1 = opts.eventCodeSessionDay1;
+    var channel = opts.channel;
+    var serverUrl = opts.serverUrl;
 
-    var wsPianoroll = opts.wsPianoroll;
-    var wsAnnot = opts.wsAnnot;
-    var stageView = opts.stageView;
-    var eventCode = opts.eventCode;
-    var channel = opts.channel;
-    var logger = opts.logger;
+	stageView.registerComponent(this);
 
-    stageView.registerComponent(this);
-
-    var timeLineDay2 = new AnnotsTimeLine.AnnotsTimeLine({
-        stageView : stageView,
+	var timeLineDay2 = new AnnotsTimeLine.AnnotsTimeLine({
+    	stageView : stageView,
         logger: logger,
         ws: wsAnnot,
         xInit: 0,
@@ -62,20 +63,20 @@
         radius: 200,
         eventCode: eventCode,
         channel: channel,
+        serverUrl: serverUrl,
         annotCategories: this.annotCategories
     });
-
+	
     //Archive day 1
-    /*jshint -W098 */
     var timeLineDay1 = new AnnotsTimeLine.AnnotsTimeLine({
-        stageView : stageView,
+    	stageView : stageView,
         archive: true,
         xInit: 0,
         yInit: 0,
         width: 1024 - 200 - 200,
         height: 768-200,
-        timeBegin: Date.parse('2015-01-22T09:30:00+01:00'),
-        timeEnd: Date.parse('2015-01-22T18:30:00+01:00'),
+        timeBegin: Date.parse("2015-01-22T09:30:00+01:00"),
+        timeEnd: Date.parse("2015-01-22T18:30:00+01:00"),
         circleX: timeLineDay2.circleX,
         circleY: timeLineDay2.circleY,
         intervalWidth: (timeLineDay2.radius*2/3)* timeLineDay2.intervalWidth / timeLineDay2.radius,
@@ -83,26 +84,26 @@
         maxCellHeight: (timeLineDay2.radius - timeLineDay2.radius*2/3)/4,
         radius: timeLineDay2.radius*2/3,
         annotCategories: this.annotCategories,
-        eventCode: eventCode,
+        eventCode: eventCodeSessionDay1,
         channel: channel,
+        serverUrl: serverUrl,
         showClockGraphics:false
     });
-
-    var currentTimeText = new PIXI.Text('-- : -- : --', { font: '18pt Gothic Standard', fill: '#646464' });
+    
+    var currentTimeText = new PIXI.Text("-- : -- : --", { font: '18pt Gothic Standard', fill: '#646464' });
     currentTimeText.x = timeLineDay2.circleX - currentTimeText.width/2;
     currentTimeText.y = timeLineDay2.circleY - currentTimeText.height/2;
     this.container.addChild(currentTimeText);
 
     var timeLineDay3 = new PIXI.Graphics();
     timeLineDay3.lineStyle(1, 0x646464)
-        .drawCircle(timeLineDay2.circleX, timeLineDay2.circleY, timeLineDay2.radius/3)
-        .endFill();
+    	.drawCircle(timeLineDay2.circleX, timeLineDay2.circleY, timeLineDay2.radius/3)
+    	.endFill()
     this.container.addChild(timeLineDay3);
-
-    /*jshint -W098 */
-    var doubleRollH = new DoubleRoll.DoubleRoll({
+    
+	var doubleRollH = new DoubleRoll.DoubleRoll({
         stageView : stageView,
-        logger: logger,
+    	logger: logger,
         ws: wsPianoroll,
         yInit: (this.height - 200),
         sceneHeight: 200,
@@ -116,9 +117,9 @@
         ]
     });
 
-    var doubleRollV = new DoubleRoll.DoubleRoll({
+	var doubleRollV = new DoubleRoll.DoubleRoll({
         stageView : stageView,
-        logger: logger,
+    	logger: logger,
         ws: wsPianoroll,
         orientation: 'vertical',
         sceneHeight: 768-200,
@@ -132,8 +133,8 @@
         ]
     });
 
-    var annotsRoll = new AnnotsRoll.AnnotsRoll({
-        stageView : stageView,
+	var annotsRoll = new AnnotsRoll.AnnotsRoll({
+    	stageView : stageView,
         logger: logger,
         ws: wsAnnot,
         parentContainer: doubleRollV.stage,
@@ -147,31 +148,31 @@
         annotColors: this.annotCategories
     });
 
-    var limiters = new PIXI.Graphics()
-        .lineStyle(1, 0x646464)
-        .moveTo(annotsRoll.container.x, annotsRoll.container.y)
-        .lineTo(annotsRoll.container.x, annotsRoll.container.y - annotsRoll.height)
-        .moveTo(annotsRoll.container.x + annotsRoll.widthRoll, annotsRoll.container.y)
-        .lineTo(annotsRoll.container.x + annotsRoll.widthRoll, annotsRoll.container.y - annotsRoll.height)
-        .moveTo(0, this.height - 200)
-        .lineTo(this.width, this.height - 200)
-        .drawRect(0, 0, this.width -1, this.height -1)
-        .beginFill(0xECECEC)
-        .drawRect(1024 - 200, 0, 200, 768-200)
-        .endFill();
-    this.container.addChild(limiters);
+	var limiters = new PIXI.Graphics()
+		.lineStyle(1, 0x646464)
+		.moveTo(annotsRoll.container.x, annotsRoll.container.y)
+		.lineTo(annotsRoll.container.x, annotsRoll.container.y - annotsRoll.height)
+		.moveTo(annotsRoll.container.x + annotsRoll.widthRoll, annotsRoll.container.y)
+		.lineTo(annotsRoll.container.x + annotsRoll.widthRoll, annotsRoll.container.y - annotsRoll.height)
+		.moveTo(0, this.height - 200)
+		.lineTo(this.width, this.height - 200)
+		.drawRect(0, 0, this.width -1, this.height -1)
+		.beginFill(0xECECEC)
+		.drawRect(1024 - 200, 0, 200, 768-200)
+		.endFill();
+	this.container.addChild(limiters);
 
-    this.init = function(){
-    };
+	this.init = function(){
+	};
 
-    this.updateTime = function(){
+	this.updateTime = function(){
         currentTimeText.setText(Utils.formatTime(Date.now()));
     };
 
     var refreshTimeInterval;
-
-    this.start = function() {
-        refreshTimeInterval = setInterval(function() {_this.updateTime();}, 1000);
+    
+	this.start = function() {
+		refreshTimeInterval = setInterval(function() {_this.updateTime();}, 1000);
     };
 
     this.refresh = function() {
@@ -185,5 +186,5 @@
 }
 
 module.exports = {
-    AnnotsVizView: AnnotsVizView
+	AnnotsVizView: AnnotsVizView
 };