# HG changeset patch # User Raphael Velt # Date 1342703192 -7200 # Node ID d563fda7b92822ec49e92b476518455499731735 # Parent 635a86f25fe7b0667c760f91d8a657c7a79accb7 Traces now send Protocol Level and Cookie info diff -r 635a86f25fe7 -r d563fda7b928 web/player_embed.php --- a/web/player_embed.php Wed Jul 11 18:21:43 2012 +0200 +++ b/web/player_embed.php Thu Jul 19 15:06:32 2012 +0200 @@ -24,6 +24,19 @@ } else { $metadata_url = $config['metadata']; } + +$protocol_level = ( + isset($_REQUEST['protocol_level']) + ? $_REQUEST['protocol_level'] + : ( + isset($config['protocol_level']) + ? $config['protocol_level'] + : 3 + ) +); + +$protocol_level = min(3,max(0, $protocol_level)); + ?> @@ -51,15 +64,15 @@ }, css:'', widgets: [ - 1) { - echo '{ type: "Polemic"'; - if (isset($config['protocol_level']) && $config['protocol_level'] < 3) { - echo ', polemics: []'; - } - echo '},'; - } -?> + 1): ?> + { + type: "Polemic" + + , + polemics: [] + + }, + { type: "Slider" }, { type: "Controller", diff -r 635a86f25fe7 -r d563fda7b928 web/polemicaltimeline.php --- a/web/polemicaltimeline.php Wed Jul 11 18:21:43 2012 +0200 +++ b/web/polemicaltimeline.php Thu Jul 19 15:06:32 2012 +0200 @@ -103,6 +103,9 @@ var metadatas = { metadata: {url: "_('config__metadata'));?>"} }; var metadata_key = "metadata"; + var _protocol_level = _protocol_level, + _cookiematches = document.cookie.match(/PHPSESSID=([A-Za-z0-9]+)/), + _cookie = (_cookiematches && _cookiematches.length > 1 ? _cookiematches[1] : undefined); var _tracer = tracemanager.init_trace("test", { url: "http://traces.advene.org:5000/", @@ -111,8 +114,9 @@ default_subject: "PolemicTweet" }); _tracer.trace("Pt_LoadPage", { + url: document.location.href, protocol_level: , - url: document.location.href + cookie: _cookie }); IriSP.libFiles.defaultDir = ""; @@ -124,7 +128,6 @@ url: metadatas[metadata_key].url + '?callback=?', format: 'ldt' }; - var _protocol_level = ; var _config = { gui: { width: 600, @@ -180,7 +183,12 @@ { type: "Mediafragment"}, { type: "Trace", - tracer: _tracer + tracer: _tracer, + extend: { + cookie: _cookie, + protocol_level: _protocol_level, + js_console: true + } } ] }, @@ -214,7 +222,8 @@ eventLink: _checkboxes, eMail: jQuery("#fancybox-content .eMail").val(), twitterHandle: jQuery("#fancybox-content .twitterHandle").val(), - protocolLevel: _protocol_level + cookie: _cookie, + protocol_level: _protocol_level } _tracer.trace("Pt_SendForm", _data); return false; diff -r 635a86f25fe7 -r d563fda7b928 web/res/metadataplayer/Trace.js --- a/web/res/metadataplayer/Trace.js Wed Jul 11 18:21:43 2012 +0200 +++ b/web/res/metadataplayer/Trace.js Thu Jul 19 15:06:32 2012 +0200 @@ -11,7 +11,8 @@ requestmode: 'GET', syncmode: "sync", default_subject: "IRI", - tracer: null + tracer: null, + extend: false } IriSP.Widgets.Trace.prototype.draw = function() { @@ -145,6 +146,9 @@ _traceName += _listener.replace('IriSP.','').replace('.','_'); } this.lastEvent = _traceName; + if (typeof this.extend === "object" && this.extend) { + IriSP._(_arg).extend(this.extend); + } this.tracer.trace(_traceName, _arg); if (this.js_console) { console.log("tracer.trace('" + _traceName + "', " + JSON.stringify(_arg) + ");");