/** * function to intercept project issue search form * see http://drupal.org/node/69626 for details */ var projectIssueInterceptSearchSubmit = function() { // get the form if (typeof projectIssue.searchFormId != 'undefined') { var form = $(projectIssue.searchFormId); } else { return; } // attach an onsubmit to the form form.onsubmit = function() { // find the project uri var project = ''; if ($('edit-projects').value != '0') { for (var i = 0; i < projectIssue.uriMap.length; i++) { if (projectIssue.uriMap[i].pid == $('edit-projects').value) { project = projectIssue.uriMap[i].uri; break; } } } // we set this to '1' so the server knows that js is enabled $('edit-js').value = 1; // add the project to the action and submit form.action = projectIssue.searchFormActionBase + project; form.submit(); return false; }; } // Global Killswitch if (isJsEnabled()) { addLoadEvent(projectIssueInterceptSearchSubmit); }