diff -r c84f8401d36e -r 9578d3ddce17 web/res/metadataplayer.polemic/src/js/polemic.js --- a/web/res/metadataplayer.polemic/src/js/polemic.js Wed Apr 27 15:40:01 2011 +0200 +++ b/web/res/metadataplayer.polemic/src/js/polemic.js Wed Apr 27 18:54:31 2011 +0200 @@ -1,311 +1,311 @@ -/* - * - * Copyright 2010 Institut de recherche et d'innovation - * contributor(s) : Samuel Huron - * - * contact@iri.centrepompidou.fr - * http://www.iri.centrepompidou.fr - * - * This software is a computer program whose purpose is to show and add annotations on a video . - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. -*/ -// CHART TIMELINE / VERSION PROTOTYPE :: - - - var yMax = config.height; - var PaperSlider; - var heightOfChart; - // Make and define the Raphael area - //var paper = Raphael(document.getElementById(config.target),config.width, config.height); - - function ChartTimeLine (){ - - // variable - // yMax - var yCoef = 2; // coef for height of 1 tweet - var frameSize = 5; // frame size - var margin = 1; // marge between frame - var lineSize = config.width; // timeline pixel width - var nbrframes = lineSize/frameSize; // frame numbers - var numberOfTweet = 0; // number of tweet overide later - var duration = config.duration; // timescale width - var frameLenght = lineSize/frameSize; // frame timescale - var timeline; - var colors = new Array("","#1D973D","#C5A62D","#CE0A15","#036AAE","#585858"); - - // array - var tweets = new Array(); - var element = new Array(); - var cluster = new Array(); - var frames = new Array(frameLenght); - var slices = new Array(); - - - // Classes ======================================================================= - var Frames = function(){ - - var Myclusters; - var x; - var y; - var width; - var height; - }; - Frames = function(json){ - // make my clusters - // ou Frame vide - }; - Frames.prototype.draw = function(){ - }; - Frames.prototype.zoom = function(){ - }; - Frames.prototype.inside = function(){ - }; - var Clusters = function(){ - var Object; - var yDist; - var x; - var y; - var width; - var height; - }; - Clusters = function(json){ - // make my object - }; - var Tweet = function(){ - }; - // Classes ======================================================================= - - // trace function - var traceNum = 0; - function trace(msg,value){ - traceNum += 1; - __IriSP.jQuery("
"+traceNum+" - "+msg+" : "+value+"
").appendTo("#output"); - } - - // Refactoring (parametere) ************************************************************ - // color translastion - function colorTranslation(value){ - if(value == "Q"){ - return 2; - }else if(value =="REF"){ - return 4; - }else if(value =="OK"){ - return 1; - }else if(value =="KO"){ - return 3; - }else if(value ==""){ - return 5; - } - } - - - // Refactoring (parametere) ************************************************************ - // load tweets send in parameters - __IriSP.jQuery.ajax({ - dataType: "jsonp", - url:config.metadata, - success : function(json){ - trace("load",""); - __IriSP.jQuery.each(json.annotations, function(i,item) { - - var MyTime = Math.floor(item.begin/duration*lineSize); - var Myframe = Math.floor(MyTime/lineSize*frameLenght); - - if (item.content['polemics'] != undefined) { - if (item.content['polemics'][0] != null) { - - for(var j=0; jmax){max=moy;} - } - - var tweetDrawed = new Array(); - var TweetHeight = 5; - // DRAW TWEETS ============================================ - for(var i=0; i"+traceNum+" - "+msg+" : "+value+"").appendTo("#output"); + } + + // Refactoring (parametere) ************************************************************ + // color translastion + function colorTranslation(value){ + if(value == "Q"){ + return 2; + }else if(value =="REF"){ + return 4; + }else if(value =="OK"){ + return 1; + }else if(value =="KO"){ + return 3; + }else if(value ==""){ + return 5; + } + } + + + // Refactoring (parametere) ************************************************************ + // load tweets send in parameters + __IriSP.jQuery.ajax({ + dataType: "jsonp", + url:config.metadata, + success : function(json){ + trace("load",""); + __IriSP.jQuery.each(json.annotations, function(i,item) { + + var MyTime = Math.floor(item.begin/duration*lineSize); + var Myframe = Math.floor(MyTime/lineSize*frameLenght); + + if (item.content['polemics'] != undefined) { + if (item.content['polemics'][0] != null) { + + for(var j=0; jmax){max=moy;} + } + + var tweetDrawed = new Array(); + var TweetHeight = 5; + // DRAW TWEETS ============================================ + for(var i=0; i