From: Dennis Schafroth Date: Mon, 7 Nov 2011 10:14:17 +0000 (+0100) Subject: Function to handle iPhone Go. Prepare for limit parameter on search X-Git-Tag: mobile-beta-1~3^2~6^2~1 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=aabe6ea11bdcfc78b313346a4e32a02687335ef3;p=pazpar2-moved-to-github.git Function to handle iPhone Go. Prepare for limit parameter on search --- diff --git a/www/iphone/example_client.js b/www/iphone/example_client.js index e6af70c..4fe0836 100644 --- a/www/iphone/example_client.js +++ b/www/iphone/example_client.js @@ -52,6 +52,26 @@ function loginFormSubmit() { authCb, authCb); } +function handleKeyPress(e, formId, focusId) +{ + var key; + if(window.event) + key = window.event.keyCode; + else + key = e.which; + + if(key == 13 || key == 10) + { + document.getElementById(formId).submit(); + focusElement = document.getElementById(focusId); + if (focusElement) + focusElement.focus(); + return false; + } + else + return true; +} + function authCb(authData) { if (!authData.loginFailed) { triedUser = ""; @@ -383,6 +403,13 @@ function resetPage() function triggerSearch () { my_paz.search(document.search.query.value, recPerPage, curSort, curFilter); +/* + , startWith, + { + "limit" : getFacets() + } + ); +*/ } function loadSelect () @@ -394,11 +421,11 @@ function loadSelect () // limit the query after clicking the facet function limitQuery(field, value) { - var newQuery = ' and ' + field + '="' + value + '"'; - querys[field] += newQuery; - document.search.query.value += newQuery; - onFormSubmitEventHandler(); - showhide("recordview"); + var newQuery = ' and ' + field + '="' + value + '"'; + querys[field] += newQuery; + document.search.query.value += newQuery; + onFormSubmitEventHandler(); + showhide("recordview"); } // limit the query after clicking the facet