From 6c2a20290c2df2afca32221c1df283c3b456fd7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no> Date: Tue, 27 Sep 2011 11:44:21 +0000 Subject: [PATCH] prepare for hosted at discojuice.org git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2929 44740490-163a-0410-bde0-09ae8108e29a --- .../www/discojuice/discojuice.hosted.js | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 modules/discojuice/www/discojuice/discojuice.hosted.js diff --git a/modules/discojuice/www/discojuice/discojuice.hosted.js b/modules/discojuice/www/discojuice/discojuice.hosted.js new file mode 100644 index 000000000..f426cd265 --- /dev/null +++ b/modules/discojuice/www/discojuice/discojuice.hosted.js @@ -0,0 +1,46 @@ +/* + * DiscoJuice + * Author: Andreas Ă…kre Solberg, UNINETT, andreas.solberg@uninett.no + * Licence undecided. + */ +if (typeof DiscoJuice == "undefined") var DiscoJuice = {}; + +DiscoJuice.Hosted = { + + "setup": function (target, title, spentityid, responseurl, feeds, redirectURL) { + var options, i; + + options = { + "title": "Sign in to <strong>" + title + "</strong>", + "subtitle": "Select your Provider", + "disco": { + "spentityid": spentityid, + "url": responseurl, + "stores": ["https://store.discojuice.org/"], + "writableStore": "https://store.discojuice.org/" + }, + "cookie": true, + "country": true, + "location": true, + "countryAPI": "https://store.discojuice.org/country", + "discoPath": "https://static.discojuice.org/", + "callback": function (e, djc) { + var returnto = window.location.href; + window.location = redirectURL + escape(e.entityID); + }, + "metadata": [] + }; + + for(i = 0; i < feeds.length; i++) { + options.metadata.push("https://static.discojuice.org/feeds/" + feeds[i]); + } + + $(document).ready(function() { + $(target).DiscoJuice(options); + console.log("SETUP completed"); + console.log(options); + }); + + } + +}; \ No newline at end of file -- GitLab