X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=to-be-integrated%2Fplugins%2Fpres_view%2Fstatic%2Fjs%2Fdynamic.js;fp=to-be-integrated%2Fplugins%2Fpres_view%2Fstatic%2Fjs%2Fdynamic.js;h=50ff3430ab89af9a2daec3f7a04fd39c11345e42;hb=31540dd504798e0aca69e10d8144fbedc5b16af8;hp=0000000000000000000000000000000000000000;hpb=937653fd70bbf7d95bcf870e7f2b46b4a8fec486;p=myslice.git diff --git a/to-be-integrated/plugins/pres_view/static/js/dynamic.js b/to-be-integrated/plugins/pres_view/static/js/dynamic.js new file mode 100644 index 00000000..50ff3430 --- /dev/null +++ b/to-be-integrated/plugins/pres_view/static/js/dynamic.js @@ -0,0 +1,89 @@ +function ape_initialize(){ + client = new APE.Controller(); +}; + +function ape_load(){ + client.load({ + identifier: 'action' + }) +} + + +APE.Controller = new Class({ + Extends: APE.Client, + Implements: Options, + options: { + container: null + }, + initialize: function(options){ + var j = jQuery.noConflict(); + this.setOptions(options); + this.addEvent('load',this.start); + this.onRaw('postmsg', this.onMsg); + this.addEvent('ape_join',this.ape_join); + this.addEvent('ape_leave',this.ape_leave); + this.addEvent('ape_quit',this.ape_quit); + this.addEvent('multiPipeCreate', function( pipe,options) { + console.log(pipe.getPubid()); + console.log(options.pipe.properties.name); + var myCookie = Cookie.write(options.pipe.properties.name,pipe.getPubid()); + }); + }, + + start: function(core){ + this.core.start({'name': $time().toString()}); + channel_name = []; + channel_id = []; + }, + + + + ape_join: function(channel_id){ + // il faut aussi initialier le tableau du canal + // TODO + this.core.join(channel_id); + }, + + ape_leave: function(channel_id){ + var myCookie = Cookie.read(channel_id); + this.core.left(myCookie); + Cookie.dispose(channel_id); + }, + + ape_quit: function(){ + this.core.quit(); + }, + + + onMsg: function(raw){ + /**console.log(raw); + console.log(raw.data.message); + console.log(raw.data.message['ape_position']); + console.log(raw.data.message[0].ape_position[0].latitude);**/ + recup_direct(raw,channel_id,"dynamic") + /**switch(raw.data.print_method) + { + case 'line': + j("#test").append("line"); + g_map_printLine(raw); + break; + case 'circle': + j("#test").append("circle"); + //g_map_printCircle(data.item[i]); + break; + case 'marker': + j("#test").append("marker"); + g_map_printMarker(raw); + break; + }**/ + + + + + + } + + + + +});