Revision: 1447
http://gatewiki.svn.sourceforge.net/gatewiki/?rev=1447&view=revAuthor: nirajaswani
Date: 2009-07-03 14:58:14 +0000 (Fri, 03 Jul 2009)
Log Message:
-----------
multiple things: 1) for wikiid 1 resulting links start with /help. for wikiid 2 resulting links start with /. and for all other wiki areas it uses /page/show/wikiid/path-to-file style. 2) focus defaults to the search box only if solr is enabled 3) on the results page, search box is prefilled with the query string
Modified Paths:
--------------
trunk/cow/grails-app/controllers/SearchController.groovy
trunk/cow/grails-app/views/layouts/cowpage.gsp
trunk/cow/grails-app/views/search/results.gsp
Modified: trunk/cow/grails-app/controllers/SearchController.groovy
===================================================================
--- trunk/cow/grails-app/controllers/SearchController.groovy 2009-07-03 12:01:33 UTC (rev 1446)
+++ trunk/cow/grails-app/controllers/SearchController.groovy 2009-07-03 14:58:14 UTC (rev 1447)
@@ -202,7 +202,12 @@
// obtain cutPoint for parent folder
// e.g. /help or /main
def cutPoint = wikipath.length() + 1
- def wikiAreaURI = "/page/show/${wiki.id}"
+ def wikiAreaURI = ""
+ if(params.id.equals("1")) {
+ wikiAreaURI = "/help"
+ } else if(!params.id.equals("2")) {
+ wikiAreaURI = "/page/show/${wiki.id}"
+ }
// replace urls with cow relative urls and generate appropriate html
for(doc in jsonArray.response.docs) {
Modified: trunk/cow/grails-app/views/layouts/cowpage.gsp
===================================================================
--- trunk/cow/grails-app/views/layouts/cowpage.gsp 2009-07-03 12:01:33 UTC (rev 1446)
+++ trunk/cow/grails-app/views/layouts/cowpage.gsp 2009-07-03 14:58:14 UTC (rev 1447)
@@ -19,8 +19,16 @@
<g:layoutHead />
<g:javascript library="application" />
+ <script type="text/javascript">
+ function focusOnSearch(setFocus)
+ {
+ if(setFocus)
+ document.searchForm.searchBox.focus();
+ }
+ </script>
</head>
- <body>
+ <body
+ onload="focusOnSearch(${gate.cow.CowUtils.getConfig().gate.cow.solr.run})">
<div id="topBar">
<span id="topLogo">
<a href="${createLinkTo(dir:'/')}"><g:cowLogo/></a>
@@ -32,9 +40,16 @@
<!-- If admin area, id will be null; don't show search box in admin area -->
<g:if test="${id}">
<g:if test="${gate.cow.CowUtils.getConfig().gate.cow.solr.run}">
- <g:form controller="search" method="post" class="inlineForm">
+ <g:form name="searchForm" controller="search" method="post"
+ class="inlineForm">
<label class="pageLink" for="searchBox">Search:</label>
- <input type="text" name="searchBox" id="searchBox" tabindex="1"/>
+ <g:if test="${parameters?.searchBox}">
+ <input type="text" name="searchBox" id="searchBox" tabindex="1"
+ value="${parameters.searchBox}"/>
+ </g:if>
+ <g:else>
+ <input type="text" name="searchBox" id="searchBox" tabindex="1"/>
+ </g:else>
<input type="hidden" name="id" value="${id}" id="id"/>
</g:form>
Modified: trunk/cow/grails-app/views/search/results.gsp
===================================================================
--- trunk/cow/grails-app/views/search/results.gsp 2009-07-03 12:01:33 UTC (rev 1446)
+++ trunk/cow/grails-app/views/search/results.gsp 2009-07-03 14:58:14 UTC (rev 1447)
@@ -15,7 +15,7 @@
<b>${startOffset+1}-${startOffset+hits.size()}</b>
of
<g:if test="${partial}">
- <a title="there might be many more results">about</a>
+ <a title="there might be many more results">atleast</a>
</g:if>
<b>${numOfHits}</b>
for "<b>${parameters.searchBox}</b>"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
gatewiki-commits mailing list
gatewiki-commits@...
https://lists.sourceforge.net/lists/listinfo/gatewiki-commits