From aabe6ea11bdcfc78b313346a4e32a02687335ef3 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Mon, 7 Nov 2011 11:14:17 +0100 Subject: [PATCH] Function to handle iPhone Go. Prepare for limit parameter on search --- www/iphone/example_client.js | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) 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 -- 1.7.10.4