From 429dd37701b9cf99a999169911b11f56bc0bf632 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 31 Oct 2012 13:27:33 +0000 Subject: [PATCH] add experimental support for setting user.ui via #?k=v&l=w --- static/js/pandora/URL.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 2e5806cb..cda04fa7 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -8,7 +8,7 @@ pandora.URL = (function() { function getState() { - Ox.Log('', 'GET STATE, UI', pandora.user.ui) + Ox.Log('URL', 'getState:, UI', pandora.user.ui) if (pandora.user.ui.page) { return {page: pandora.user.ui.page}; @@ -132,6 +132,16 @@ pandora.URL = (function() { } } + if (state.hash && state.hash.query) { + state.hash.query.forEach(function(kv) { + try { + set[kv.key] = JSON.parse(kv.value); + } catch(e) { + set[kv.key] = kv.value; + } + }); + } + Ox.Request.cancel(); $('video').each(function() { $(this).trigger('stop');