diff --git a/resources/static/include_js/include.js b/resources/static/include_js/include.js index 9b162426e9c80638446676142bf8a7c57bb9cba4..3516f7af707e0fc15aa87f1f4140ec8b68b34539 100644 --- a/resources/static/include_js/include.js +++ b/resources/static/include_js/include.js @@ -1027,13 +1027,29 @@ _open_hidden_iframe(); + // back compat support for loggedInEmail + if (typeof options.loggedInEmail !== 'undefined' && + typeof options.loggedInUser !== 'undefined') { + throw "you cannot supply *both* loggedInEmail and loggedInUser"; + } + else if(typeof options.loggedInEmail !== 'undefined') { + try { + console.log("loggedInEmail has been deprecated"); + } catch(e) { + /* ignore error */ + } + + options.loggedInUser = options.loggedInEmail; + delete options.loggedInEmail; + } + // check that the commChan was properly initialized before interacting with it. // on unsupported browsers commChan might still be undefined, in which case // we let the dialog display the "unsupported browser" message upon spawning. - if (typeof options.loggedInEmail !== 'undefined' && commChan) { + if (typeof options.loggedInUser !== 'undefined' && commChan) { commChan.notify({ method: 'loggedInUser', - params: options.loggedInEmail + params: options.loggedInUser }); } }