From: Mike Taylor Date: Thu, 5 Dec 2013 11:43:35 +0000 (+0000) Subject: Rename unused mkws property "service_proxy_auth" to "authenticated". X-Git-Tag: 0.9.1~134 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=7eb3ec5aa9b558216fc06205a4085d875f554a7c Rename unused mkws property "service_proxy_auth" to "authenticated". (Better describes what it does, and avoids confusion with the mkws_config property of the same name.) Check before running a search whether we're authenticated. (It's because we were not that auto-searches were failing on the first call of a new session -- the search was being sent before the authentication response was received.) --- diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index b5c1b34..62fed9a 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -5,6 +5,7 @@ // Set up namespace and some state. var mkws = { + authenticated: false, filters: [], }; @@ -416,6 +417,11 @@ function onFormSubmitEventHandler() function newSearch(query) { + if (!mkws.authenticated) { + alert("searching before authentication"); + return; + } + mkws.filters = [] redraw_navi(); resetPage(); @@ -1009,7 +1015,7 @@ function mkws_service_proxy_auth(auth_url, auth_domain) { } debug("Service proxy auth successfully done"); - mkws.service_proxy_auth = true; + mkws.authenticated = true; }); }