Word Add-in web scripts - fixed for AWC-1337, exception when no results returned from search. Also removed unnecessary server-side javascript files.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6205 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2007-07-09 20:35:19 +00:00
parent 8773d4b4a0
commit ccf25a67d9
6 changed files with 12 additions and 5 deletions

View File

@@ -16,10 +16,11 @@
<#assign maxresults=10> <#assign maxresults=10>
</#if> </#if>
<#assign resCount=0> <#assign resCount=0>
<#assign totalResults=0>
<#assign results = companyhome.childrenByLuceneSearch[queryString] > <#assign results = companyhome.childrenByLuceneSearch[queryString] >
<#if results?size = 0> <#if results?size = 0>
<div> <div class="noItems">
<span class="noItems">(No results found)</span> <span>(No results found)</span>
</div> </div>
<#else> <#else>
<#assign totalResults = results?size> <#assign totalResults = results?size>

View File

@@ -20,14 +20,20 @@ var OfficeSearch =
itemsFound: function(shownResults, totalResults) itemsFound: function(shownResults, totalResults)
{ {
if (shownResults < totalResults) var strFound;
if (totalResults == 0)
{ {
$('itemsFound').innerHTML = "Showing first " + shownResults + " of " + totalResults + " total items found"; strFound = "No items found";
}
else if (shownResults < totalResults)
{
strFound = "Showing first " + shownResults + " of " + totalResults + " total items found";
} }
else else
{ {
$('itemsFound').innerHTML = "Showing all " + shownResults + " items found"; strFound = "Showing all " + shownResults + " items found";
} }
$('itemsFound').innerHTML = strFound;
}, },
/* AJAX call to perform server-side search */ /* AJAX call to perform server-side search */