From 70826f489a4f063c82ff0dc4896fadceca940a12 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 11 Jul 2012 16:42:09 +0200 Subject: [PATCH] add a store parameter to response.html and to callbacks, in order to notify which store responded when launching many requests --- discoquery.js | 13 +++++++------ response.html | 4 +++- test.html | 14 ++++++++++---- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/discoquery.js b/discoquery.js index 2964609..39a858c 100644 --- a/discoquery.js +++ b/discoquery.js @@ -5,6 +5,7 @@ var C_RETURNIDPARAM = "returnIDParam"; var C_IS_PASSIVE = "isPassive"; var C_IDP_ENTITY_ID = "IdPentityID"; + var C_STORE = "store"; var COOKIE_TIMEOUT_DAYS = 730; $.disco_query = function (entity_id, url, response_url, callback) { @@ -17,14 +18,14 @@ } var param = {}; param[C_ENTITY_ID] = entity_id; - param[C_RETURN] = response_url; + param[C_RETURN] = response_url + '?' + C_STORE + '=' + escape(url); param[C_IS_PASSIVE] = 'true'; query_url = query_url + $.param(param); debug_alert('query_url '+query_url); iframe.attr('src', query_url); if (callback) { - var disco_callback = function (entity_id, auth) { - callback(entity_id, auth); + var disco_callback = function (entity_id, store, auth) { + callback(entity_id, store, auth); $(iframe).remove(); }; window.disco_callback = disco_callback; @@ -43,14 +44,14 @@ } var param = {}; param[C_ENTITY_ID] = entity_id; - param[C_RETURN] = response_url; + param[C_RETURN] = response_url + '?' + C_STORE + '=' + escape(url); param[C_IDP_ENTITY_ID] = idp_entity_id; query_url = query_url + $.param(param); debug_alert('query_url '+query_url); iframe.attr('src', query_url); if (callback) { - var disco_callback = function (entity_id, auth) { - callback(entity_id, auth); + var disco_callback = function (entity_id, store, auth) { + callback(entity_id, store, auth); $(iframe).remove(); }; window.disco_callback = disco_callback; diff --git a/response.html b/response.html index 006276f..e659543 100644 --- a/response.html +++ b/response.html @@ -11,13 +11,15 @@ diff --git a/test.html b/test.html index 33c60a9..015a809 100644 --- a/test.html +++ b/test.html @@ -9,12 +9,18 @@