Commit 866509ce authored by Jérémie Garcia's avatar Jérémie Garcia

cleaning ongoing (Init + VIEW OK)

parent 6feefa71
WOB/qr_code.png

631 Bytes | W: | H:

WOB/qr_code.png

627 Bytes | W: | H:

WOB/qr_code.png
WOB/qr_code.png
WOB/qr_code.png
WOB/qr_code.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -983,7 +983,7 @@ var def_server = global.interface.serverRow(default_traj_server);
//global.interface.trajectoiresPage = fs.readFileSync( './server/interfaces/Trajectoires.html', ['utf-8'] );
//OLD FUNCTIONS WITH IP ADDRESS INSTEAD OF COMPUTER'S NAME
/*
var interfaces = os.networkInterfaces();
var addresses = [];
for (var k in interfaces) {
......@@ -995,9 +995,9 @@ var def_server = global.interface.serverRow(default_traj_server);
}
}
var server_ip = addresses[0];
*/
var server_ip = os.hostname();
// var server_ip = os.hostname();
var link = 'http://' + server_ip + ':8080/Trajectoires.html';
//URL DISPLAY
......@@ -1005,7 +1005,7 @@ var div_text = "<a href=\"" +link + "\" target=\"_blank\">"+ link +"</a>" ;
var target_div = $('#target-url').html( div_text );
//QR CODE
var code = qr.image(link, { type: 'png' });
var code = qr.image(link, { type: 'png' });
var code_path = 'qr_code.png';
var output = fs.createWriteStream(code_path);
code.pipe(output);
......
<!DOCTYPE html>
<html>
<string name="app_name">Trajectoires</string>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height = device-height" />
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="css/index.css" />
<link rel="stylesheet" href="libs/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css">
<script type="text/javascript" src='interface.js'></script>
<script type="text/javascript" src="libs/fastclick.min.js"></script>
<script type="text/javascript" src="libs/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="libs/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"></script>
<link type="text/css" rel="stylesheet" href="libs/jquery.nstSlider.css">
<script type="text/javascript" src="js/OSCManager.js"></script>
<script type="text/javascript" src="js/rotations.js"></script>
<title>Trajectoires</title>
</head>
<body onresize="javascript:traj_initCanvas()">
<!-- Start of first page -->
<div id="main-page" data-role="page" data-theme="a">
<div id=footer data-role="footer">
</div>
<!-- /footer -->
</div>
<!-- /page -->
<script type="text/javascript">
app.initialize();
$.mobile.loading().hide();
</script>
</body>
</html>
\ No newline at end of file
......@@ -21,7 +21,7 @@
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="js/TimedCurve.js"></script>
<script type="text/javascript" src="js/Session.js"></script>
<script type="text/javascript" src="js/OSC.js"></script>
<script type="text/javascript" src="js/OSC-spat.js"></script>
<script type="text/javascript" src="js/TrajManager.js"></script>
<script type="text/javascript" src="js/Utils.js"></script>
<script type="text/javascript" src="js/View.js"></script>
......@@ -30,8 +30,6 @@
<script type="text/javascript" src="js/HTMLFunction.js"></script>
<script type="text/javascript" src="libs/hammer.js"></script>
<title>Trajectoires</title>
</head>
......@@ -46,12 +44,6 @@
<h1>Settings</h1>
<!-- <label>Zoom: </label>
<div data-role="controlgroup" data-type="horizontal">
<a onClick="javascript:setCanvasZoom(0.8);" data-role="button" data-theme="a" data-inline="true"> - </a>
<a onClick="javascript:setCanvasZoom(1.2);" data-role="button" data-theme="a" data-inline="true"> + </a>
</div> -->
<label> Undo: </label>
<div>
<a onClick="javascript:Trajectoires.State.undo();" data-role="button" data-theme="a" data-icon="back" data-inline="true"></a>
......@@ -93,7 +85,7 @@
</form>
<form>
<label for="flip-timeSlider">Show Z Slider:</label>
<label for="flip-zSlider">Show Z Slider:</label>
<select name="flip-zSlider" id="flip-zSlider" data-role="slider" data-theme="b" onchange="javascript:setZSliderMode()">
<option value="off" selected="selected">Off</option>
<option value="on">On</option>
......@@ -156,7 +148,7 @@
<div id='drawZone' data-role="none">
<svg width="100" height="160" xmlns="http://www.w3.org/2000/svg">
<svg id="drawzoneSVG" width="100" height="160" xmlns="http://www.w3.org/2000/svg">
<g>
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
<ellipse id='drawZoneEl' ry="90" rx="61" id="svg_8" cy="86" cx="25" fill-opacity='0.6' fill="#ccf2a7" />
......@@ -165,16 +157,6 @@
<img id='drawZoneImg' src="libs/crayon.jpg" alt="image crayon" />
</div>
<div id='drawZoneRight' data-role="none">
<svg width="100" height="160" xmlns="http://www.w3.org/2000/svg">
<g>
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
<ellipse id='drawZoneElRight' ry="90" rx="61" id="svg_8" cy="86" cx="80" fill-opacity='0.6' fill="#ccf2a7" />
</g>
</svg>
<img id='drawZoneImgRight' src="libs/crayon.jpg" alt="image crayon" />
</div>
<div id="divCurveMenu" class="left">
......@@ -297,25 +279,13 @@
</div>
<!-- <div id="tapHoldMenu" data-role="controlgroup">
<FORM NAME="myform" ACTION="" METHOD="GET">
Enter something in the box: <BR>
<INPUT TYPE="text" NAME="inputbox" VALUE=" 1"><P>
<INPUT TYPE="button" NAME="button" Value="Click" onClick="testResults(this.form)">
</FORM> -->
<!-- <a href="#" class="ui-btn ui-corner-all">Options</a>
<a href="#" class="ui-btn ui-corner-all">Copy</a>
<a href="#" class="ui-btn ui-corner-all">Paste</a>
<a id="selectButton" data-role="button">Select</a>
</div>-->
<div id="contextMenu" style="position:absolute;top:100px;left 300px">
<button id="newButton"> New </button>
<button id="circularButton"> Circular </button>
<button id="concatButton"> Concat </button>
<button id="circularButton" class="contextualButton" >Circular</button>
<button id="concatButton" class="contextualButton" >Concat</button>
</div>
<div id="longTouchMenu" style="position:absolute;top:100px;left 300px">
<a href="#" onClick="javascript:deleteCurrentCurve();" data-mini="true" data-role="button" data-icon="delete">Remove</a>
<a href="#" onClick="javascript:modeSelectEdit();" data-mini="true" data-role="button" data-icon="edit">Select and redraw</a>
......
......@@ -85,31 +85,6 @@ body {
opacity: 0.7;
}
/* OLD */
/*#sourceSelect {
position: absolute;
bottom: 10px;
height: 200px;
width: 200px;
}
.buttonSource {
position:absolute;
top:20px;
left:5px;
height: 30px;
width:30px;
border-radius: 20px;
z-index: 5;
}
.sourceInput {
width: 20px;
height: 20px;
margin: 10px;
}*/
/* NEW */
.sourceButton{
margin : -3px;
......@@ -379,7 +354,12 @@ a.curveMenuButton {
}
.contextualButton{
background-color: white;
border: 1px solid black;
opacity: 0.8;
font-size: 10px;
}
.circularButton {
z-index: 5!important;
......
This diff is collapsed.
This diff is collapsed.
////////////////////////////////////////////////////////////
///////////////////////// OSC /////////////////////////////
Traj.OSC = {
//OSC Protocol
spat_address : '/spat',
traj_address : '/traj',
pos_address : '/traj/posxyz',
trajpoint_address : '/traj/trajpoint',
traj_new_address : '/traj/newtraj',
traj_suffix : '/traj',
play_address : '/traj/play',
record_address : '/traj/record',
orientation_address : '/traj/orientation',
draw_address : '/traj/draw',
// SENDING MESSAGES
isInteger : function(value) {
if ((undefined === value) || (null === value)) {
return false;
}
return value % 1 == 0;
},
getTypeForElement : function(elem){
var type = typeof elem;
switch (type) {
case 'string':
return 's';
break;
case 'boolean':
return 'b';
break;
case 'number':
return Traj.OSC.isInteger(elem) ? 'i' : 'f';;
break;
default:
return 'f';
}
},
getTypesForArgs : function(args){
var tt = '';
if(typeof args === 'string')
return 's';
for(var i = 0; i < args.length; i++) {
tt += Traj.OSC.getTypeForElement(args[i]);
}
return tt;
},
sendMessage : function(address, msg) {
var tt = Traj.OSC.getTypesForArgs(msg);
Interface.OSC.send(address, tt, msg );
},
//RECEIVING MESSAGE
processMessages : function(msg) {
var address = msg.address;
var split = address.split('/');
//test for the correct namespace
console.log(split[1]);
if(split[1].indexOf("spat") != -1 ){
console.log(split[2]);
if(split[2].indexOf("source") != -1){
var nb = (split[2].replace("source",""));
var sourcenb = Number(nb);
var curve = new TimedCurve();
for (var k =0; k<msg.parameters.length/4;k++) {
curve.addTimedPoint(msg.parameters[4*k],msg.parameters[4*k+1],msg.parameters[4*k+2],msg.parameters[4*k+3]);
}
var manager = Traj.TrajManager;
manager.trajectories.push(curve);
curve.changeSource(sourcenb); // care : to change the source of a curve, the curve need to be already pushed in trajectories
Traj.View.traj_repaint();
//manager.selectCurve(manager.trajectories.length-1);
}
}
},
//FACILITIES
sendPosxyzMsg : function(msg) {
Traj.OSC.sendMessage(Traj.OSC.pos_address, msg);
},
sendSpatMessage: function(msg){
Traj.OSC.sendMessage(Traj.OSC.spat_address,msg);
},
sendTrajPoint : function(msg) {
Traj.OSC.sendMessage(Traj.OSC.trajpoint_address, msg);
},
//OLD VERSION
// sendTraj : function(msg) {
// Traj.OSC.sendMessage(Traj.OSC.traj_address, msg);
//},
sendTraj : function(number, msg) {
Traj.OSC.sendMessage(Traj.OSC.traj_address + "/source" + number + Traj.OSC.traj_suffix, msg);
},
sendPlay : function(msg) {
Traj.OSC.sendMessage(Traj.OSC.play_address, msg);
},
sendRecord : function(msg) {
Traj.OSC.sendMessage(Traj.OSC.record_address, msg);
},
sendOrientation : function(msg){
Traj.OSC.sendMessage(Traj.OSC.orientation_address, msg);
},
sendNewTraj : function(msg){
Traj.OSC.sendMessage(Traj.OSC.traj_new_address, msg);
},
sendDraw : function(msg) {
Traj.OSC.sendMessage(Traj.OSC.draw_address, msg);
},
streamCurveLastPoint : function(curve) {
var last_index = curve.X.length - 1;
this.streamCurvePoint(curve, last_index);
},
streamNewCurve : function(index){
Traj.OSC.sendNewTraj(index);
},
streamCurvePoint : function(curve, index) {
//ussing Spat formatting source ID xyz x y z
Traj.OSC.sendSpatMessage( ['source', curve.sourceNumber, 'xyz',curve.X[index], curve.Y[index], curve.Z[index]]);
//Traj.OSC.sendPosxyzMsg([curve.sourceNumber, curve.X[index], curve.Y[index], curve.Z[index], curve.t[index]]);
},
sendCurveOSC : function(curve, id) {
var oscPoint;
for (var i = 0; i < curve.X.length; i++) {
oscPoint = [];
oscPoint.push(id);
oscPoint.push(curve.X[i]);
oscPoint.push(curve.Y[i]);
oscPoint.push(curve.Z[i]);
oscPoint.push(curve.t[i]);
Traj.OSC.sendTrajPoint(oscPoint);
}
},
sendCurveSingleMessageOSC : function(curve, id) {
var args = [];
for (var i = 0; i < curve.X.length; i++) {
args.push(curve.X[i]);
args.push(curve.Y[i]);
args.push(curve.Z[i]);
args.push(curve.t[i]);
}
Traj.OSC.sendTraj(curve.sourceNumber, args);
},
saveAntescofo : function (curve, id, sessionID){
var args = [];
args.push(1+ sessionID); //to have same labels ias in the UI
args.push(id);
for (var i = 0; i < curve.X.length; i++) {
args.push(curve.X[i]);
args.push(curve.Y[i]);
args.push(curve.Z[i]);
args.push(curve.t[i]);
}
Traj.OSC.sendMessage("/savenimtraj", args);
}
};
This diff is collapsed.
////////////////////////////////////////////////////////////
/////////////////////// SESSION ///////////////////////////
Trajectoires.Session = {
Traj.Session = {
lblCurrentSession : {},
currentSession : {},
......@@ -10,25 +10,25 @@ Trajectoires.Session = {
saveTrajSession : function(){
var idx = this.currentSession;
this.traj_dict[idx] = Trajectoires.TrajManager.trajectories;
this.playedCurves[idx] = Trajectoires.TrajManager.playedCurves;
this.traj_dict[idx] = Traj.TrajManager.trajectories;
this.playedCurves[idx] = Traj.TrajManager.playedCurves;
localStorage.trajectories = JSON.stringify(this.traj_dict);
localStorage.playedCurves = JSON.stringify(this.playedCurves);
},
appendTrajSession : function(){
Trajectoires.Session.saveTrajSession(this.traj_dict.length);
Traj.Session.saveTrajSession(this.traj_dict.length);
alert("Session Saved with ID " + (this.traj_dict.length - 1));
},
/* loadTrajSession : function(idx){
trajectories = this.traj_dict[idx];
Trajectoires.View.repaintAll();
Traj.View.repaintAll();
},
*/
loadTrajSession : function(idx){
var newTrajectories = this.traj_dict[idx];
Trajectoires.TrajManager.trajectories = [];
Traj.TrajManager.trajectories = [];
var newCurve = {};
for (var i = 0; i < newTrajectories.length; i++) {
newCurve = new TimedCurve(newTrajectories[i].sourceNumber);
......@@ -37,12 +37,12 @@ Trajectoires.Session = {
}
newCurve.sourceNumber = newTrajectories[i].sourceNumber;
newCurve.multiPlay = newTrajectories[i].multiPlay;
Trajectoires.TrajManager.trajectories.push(newCurve);
Traj.TrajManager.trajectories.push(newCurve);
}
Trajectoires.TrajManager.playedCurves = (this.playedCurves == []) ? [] : this.playedCurves[idx];
Trajectoires.TrajManager.selectCurve(0);
Trajectoires.View.repaintAll();
//Trajectoires.TrajManager.multiPlayChanged();
Traj.TrajManager.playedCurves = (this.playedCurves == []) ? [] : this.playedCurves[idx];
Traj.TrajManager.selectCurve(0);
Traj.View.repaintAll();
//Traj.TrajManager.multiPlayChanged();
},
......@@ -50,7 +50,7 @@ Trajectoires.Session = {
loadLastTrajSession : function(){
if(this.traj_dict.length > 0){
Trajectoires.Session.loadTrajSession(this.traj_dict.length -1);
Traj.Session.loadTrajSession(this.traj_dict.length -1);
}
},
......@@ -61,7 +61,7 @@ Trajectoires.Session = {
traj_initStorage : function(){
this.traj_dict = (typeof localStorage.trajectories === 'undefined') ? [] : JSON.parse( localStorage.trajectories );
this.playedCurves = (typeof localStorage.playedCurves === 'undefined') ? [[]] : JSON.parse( localStorage.playedCurves );
Trajectoires.Session.loadLastTrajSession();
Traj.Session.loadLastTrajSession();
this.currentSession = this.traj_dict.length - 1;
if (this.currentSession<0) {
this.newSession();
......@@ -92,8 +92,8 @@ Trajectoires.Session = {
},
saveInSelectedSession : function() {
this.traj_dict[this.currentSession] = Trajectoires.TrajManager.trajectories;
this.playedCurves[this.currentSession] = Trajectoires.TrajManager.playedCurves;
this.traj_dict[this.currentSession] = Traj.TrajManager.trajectories;
this.playedCurves[this.currentSession] = Traj.TrajManager.playedCurves;
this.saveTrajSession();
},
......@@ -132,11 +132,11 @@ Trajectoires.Session = {
////////////////////////////////////////////////////////////
/////////////////////// State (undo) ///////////////////////
Trajectoires.State = {
Traj.State = {
historySessions : [],
newAction : function() { // call it when you want to save the state of the app
var newState = JSON.stringify(Trajectoires.TrajManager.trajectories);
var newState = JSON.stringify(Traj.TrajManager.trajectories);
this.historySessions.unshift(newState);
var length = this.historySessions.length;
if (length>10) {
......@@ -146,7 +146,7 @@ Trajectoires.State = {
undo : function() { // load previous state saved. Problem : if you change the session and then press undo, you get all the curves from the last session...
if (this.historySessions.length>0) {
Trajectoires.TrajManager.trajectories = [];
Traj.TrajManager.trajectories = [];
var lastState = JSON.parse(this.historySessions[0]);
var newCurve = {};
for (var i = 0; i < lastState.length; i++) {
......@@ -154,10 +154,10 @@ Trajectoires.State = {
for (var j = 0; j < lastState[i].X.length; j++) {
newCurve.addTimedPoint(lastState[i].X[j],lastState[i].Y[j],lastState[i].Z[j],lastState[i].t[j]);
}
Trajectoires.TrajManager.trajectories.push(newCurve);
Traj.TrajManager.trajectories.push(newCurve);
}
Trajectoires.TrajManager.selectCurve(0);
Trajectoires.View.repaintAll();
Traj.TrajManager.selectCurve(0);
Traj.View.repaintAll();
this.historySessions.splice(0,1);
}
},
......
......@@ -6,7 +6,7 @@ function TimedCurve(source) {
this.Y = [];
this.Z = [];
this.t = [];
this.color = Trajectoires.Utils.getColorSource(source) || Trajectoires.Utils.getColorSource(1);
this.color = Traj.Utils.getColorSource(source) || Traj.Utils.getColorSource(1);
this.sourceNumber = source || Number(1);
this.multiPlay = true;
// this.xScale = 1;
......@@ -17,9 +17,9 @@ function TimedCurve(source) {
TimedCurve.prototype.changeSource = function(source) {
this.sourceNumber = Number(source);
this.color = Trajectoires.Utils.getColorSource(source);
var index = Trajectoires.TrajManager.trajectories.indexOf(this);
Trajectoires.TrajManager.multiPlayChanged(index)
this.color = Traj.Utils.getColorSource(source);
var index = Traj.TrajManager.trajectories.indexOf(this);
Traj.TrajManager.multiPlayChanged(index)
}
......@@ -31,12 +31,6 @@ TimedCurve.prototype.addTimedPoint = function (x, y, z, t) {
this.t.push(Math.floor(t));
}
// TimedCurve.prototype.addTimedPointMiddle = function(x,y,z,t) {
// var range = Trajectoires.EventManager.getSliderValue();
// var lastPoint = Trajectoires.Utils.findPointIdx(range[0],this);
// }
TimedCurve.prototype.spaceScale = function (factor) {
for (var k = 0; k < this.X.length; k++) {
this.X[k] = factor * this.X[k];
......@@ -51,8 +45,8 @@ TimedCurve.prototype.sapceScaleAxis = function(factor,vectorAxis,pointAxis) {
projectedPoint = [];
for (var k=0; k<this.X.length;k++) {
point = [this.X[k],this.Y[k]];
projectedPoint = Trajectoires.Utils.getProjectedPoint(point,vectorAxis,pointAxis);
dirVector = Trajectoires.Utils.getDirVector(point,projectedPoint);
projectedPoint = Traj.Utils.getProjectedPoint(point,vectorAxis,pointAxis);
dirVector = Traj.Utils.getDirVector(point,projectedPoint);
distance = Math.sqrt(Math.pow(point[0]-projectedPoint[0],2) + Math.pow(point[1]-projectedPoint[1],2));
this.X[k] = projectedPoint[0] + distance * factor * dirVector[0];
this.Y[k] = projectedPoint[1] + distance * factor * dirVector[1];
......@@ -67,9 +61,9 @@ TimedCurve.prototype.sapceScaleAxisRange = function(factor,vectorAxis,pointAxis,
projectedPoint = [];
for (var k=0; k<this.X.length;k++) {
point = [this.X[k],this.Y[k]];
projectedPoint = Trajectoires.Utils.getProjectedPoint(point,vectorAxis,pointAxis);
if (Trajectoires.Utils.isPointNearLine(point,pointsLine)) {
dirVector = Trajectoires.Utils.getDirVector(point,projectedPoint);
projectedPoint = Traj.Utils.getProjectedPoint(point,vectorAxis,pointAxis);
if (Traj.Utils.isPointNearLine(point,pointsLine)) {
dirVector = Traj.Utils.getDirVector(point,projectedPoint);
distance = Math.sqrt(Math.pow(point[0]-projectedPoint[0],2) + Math.pow(point[1]-projectedPoint[1],2));
this.X[k] = projectedPoint[0] + distance * factor * dirVector[0];
this.Y[k] = projectedPoint[1] + distance * factor * dirVector[1];
......@@ -158,7 +152,7 @@ TimedCurve.prototype.rotate = function(center,angle) {
for (var k=0;k<this.X.length;k++) {
X = this.X[k];
Y = this.Y[k];
newXY = Trajectoires.Utils.rotate(center[0],center[1],X,Y,angle);
newXY = Traj.Utils.rotate(center[0],center[1],X,Y,angle);
this.X[k] = newXY[0];
this.Y[k] = newXY[1];
}
......
This diff is collapsed.
Trajectoires.Utils = {
Traj.Utils = {
ongoingTouchIndexById : function(idToFind) {
var i = 0, id;
for (i = 0; i < Trajectoires.View.ongoingTouches.length; i++) {
id = Trajectoires.View.ongoingTouches[i].identifier;
for (i = 0; i < Traj.View.ongoingTouches.length; i++) {
id = Traj.View.ongoingTouches[i].identifier;
if (id === idToFind) {
return i;
......@@ -16,29 +16,29 @@ Trajectoires.Utils = {
//WARNING : SHOULD NOT ALTER THE EVT OBJ
event2CanvasPos : function(evt) {
var rel = [];
rel[0] = evt.pageX - Trajectoires.View.dyn_canvas.offsetLeft;
rel[1] = evt.pageY - Trajectoires.View.dyn_canvas.offsetTop;
rel[0] = evt.pageX - Traj.View.dyn_canvas.offsetLeft;
rel[1] = evt.pageY - Traj.View.dyn_canvas.offsetTop;
return rel;
},
//UnitConverter WARNING : SHOULD NOT ALTER THE COORDS ARRAY
convertCanvasPosIntoUnits : function(coords) {
var res = [];
var h = Number(Trajectoires.View.traj_canvas.height);
var w = Number(Trajectoires.View.traj_canvas.width);
var h = Number(Traj.View.traj_canvas.height);
var w = Number(Traj.View.traj_canvas.width);
res[1] = h - coords[1];
res[0] = (coords[0] - (w / 2)) * Trajectoires.View.pixToValue;
res[1] = (res[1] - (h / 2)) * Trajectoires.View.pixToValue;
res[0] = (coords[0] - (w / 2)) * Traj.View.pixToValue;
res[1] = (res[1] - (h / 2)) * Traj.View.pixToValue;
return res;
},
//todo
convertUnitsIntoCanvasPos : function(coords) {
var res = [];
var h = Number(Trajectoires.View.traj_canvas.height);
var w = Number(Trajectoires.View.traj_canvas.width);
res[0] = coords[0] * (1 / Trajectoires.View.pixToValue) + (w / 2);
res[1] = coords[1] * (1 / Trajectoires.View.pixToValue) + (h / 2);
var h = Number(Traj.View.traj_canvas.height);
var w = Number(Traj.View.traj_canvas.width);
res[0] = coords[0] * (1 / Traj.View.pixToValue) + (w / 2);
res[1] = coords[1] * (1 / Traj.View.pixToValue) + (h / 2);
res[1] = h - res[1];
res[0] = Math.floor(res[0]);
......@@ -83,10 +83,10 @@ Trajectoires.Utils = {
},
getColorForIndex : function(idx) {
return Trajectoires.View.default_colors[(idx + Trajectoires.View.default_colors.length) % Trajectoires.View.default_colors.length];
return Traj.View.default_colors[(idx + Traj.View.default_colors.length) % Traj.View.default_colors.length];
},
getColorSource : function(source) {
return Trajectoires.View.default_colors[(source-1)%Trajectoires.View.default_colors.length];
return Traj.View.default_colors[(source-1)%Traj.View.default_colors.length];
},
distanceBtwPoints : function(p1, p2) {
......@@ -156,7 +156,7 @@ Trajectoires.Utils = {
interpolate : function(now,curve,lastPoint) {
if (typeof(lastPoint) == 'undefined') {
var lastPoint = Trajectoires.Utils.findPointIdx(now,curve);
var lastPoint = Traj.Utils.findPointIdx(now,curve);
}
var lastTime = curve.t[lastPoint],
......@@ -210,7 +210,7 @@ Trajectoires.Utils = {
},
getClosestCurveFromTouch : function(pos) {
var trajectories = Trajectoires.TrajManager.trajectories;
var trajectories = Traj.TrajManager.trajectories;
var curve = {};
var minDistance = Infinity;
var distance = 0;
......
This diff is collapsed.
/*
* This is the Index file creating the Traj Namespace and Initializaiton functions.
*/
var logging = true;
var onmobile = false;
var Trajectoires = {
var Traj = {
// Application Constructor
initialize: function () {
if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/)) {
......@@ -11,29 +15,27 @@ var Trajectoires = {
document.addEventListener("resume", this.onResume, false);
} else {
//code specific to browser
}
Trajectoires.View.traj_initCanvas();
//storage things
Trajectoires.Session.traj_initStorage();
Trajectoires.EventManager.trajInitEvents();