mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5852 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
/*
|
|
* Prerequisites: mootools.v1.1.js
|
|
* office_addin.js
|
|
*/
|
|
var OfficeSearch =
|
|
{
|
|
init: function()
|
|
{
|
|
$("searchText").addEvent("keydown", function(event)
|
|
{
|
|
event = new Event(event);
|
|
if (event.key == 'enter')
|
|
{
|
|
$("simpleSearchButton").click();
|
|
}
|
|
});
|
|
},
|
|
|
|
/* AJAX call to perform server-side search */
|
|
runSearch: function(useTemplate, argPath)
|
|
{
|
|
OfficeAddin.showStatusText("Searching...", "ajax_anim.gif", false);
|
|
|
|
var searchString = $("searchText").value;
|
|
var maxResults = $("maxResults").value;
|
|
|
|
var actionURL = useTemplate + "?p=" + argPath + "&search=" + searchString + "&maxresults=" + maxResults;
|
|
var myAjax = new Ajax(actionURL, {
|
|
method: 'get',
|
|
headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
|
|
onComplete: function(textResponse, xmlResponse)
|
|
{
|
|
OfficeAddin.hideStatusText();
|
|
$("searchResultsList").innerHTML = textResponse;
|
|
}
|
|
});
|
|
myAjax.request();
|
|
}
|
|
};
|
|
|
|
window.addEvent('domready', OfficeSearch.init); |