Author: brushed
Date: Tue Sep 30 13:57:34 2008
New Revision: 700577

URL: http://svn.apache.org/viewvc?rev=700577&view=rev
Log:
v2.8.0-beta-14: 
        [JSPWIKI-327] Going back to the search page now remembers the last 
search query.
        The query and selected pagination-page is stored in the #hash of the 
url.
        

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java
    incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-common.js
    incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXSearch.jsp

Modified: incubator/jspwiki/trunk/ChangeLog
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=700577&r1=700576&r2=700577&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Tue Sep 30 13:57:34 2008
@@ -1,3 +1,11 @@
+2008-09-30  Dirk Frederickx <[EMAIL PROTECTED]>
+
+        * 2.8.0-beta-14
+        
+        * [JSPWIKI-327] Going back to the search page now remembers the last 
search query.
+        The query and selected pagination-page is stored in the #hash of the 
url.
+        
+        
 2008-09-30  Janne Jalkanen <[EMAIL PROTECTED]>
 
         * Oops, Dutch corepages had overwritten the English corepages,

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java?rev=700577&r1=700576&r2=700577&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java Tue Sep 30 
13:57:34 2008
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "13";
+    public static final String     BUILD         = "14";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-common.js
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-common.js?rev=700577&r1=700576&r2=700577&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-common.js (original)
+++ incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-common.js Tue Sep 30 
13:57:34 2008
@@ -846,13 +846,27 @@
                        this.runfullsearch();
                }.bind(this);
                
-               q2.observe( this.runfullsearch.bind(this) );
+               q2.observe( this.runfullsearch0.bind(this) );
                
                $('scope').addEvent('change', changescope);
                $('details').addEvent('click', this.runfullsearch.bind(this));
+               
+               if(location.hash){
+                       /* hash contains query:pagination(-1=all,0,1,2...) */
+                       var s = location.hash.substr(1).match(/(.*):(-?\d+)$/);
+                       q2.value = s[1];
+                       $('start').value = s[2];
+                       changescope();
+               }
+       },
+
+       /* reset the start page before rerunning the ajax search */
+       runfullsearch0: function(){
+               $('start').value='0';
+               this.runfullsearch();
        },
 
-       runfullsearch : function(){
+       runfullsearch: function(e){
                var q2 = this.query2.value;
                if( !q2 || (q2.trim()=='')) { 
                        $('searchResult2').empty();
@@ -862,6 +876,7 @@
 
                var scope = $('scope'), 
                        match= 
q2.match(/^(?:author:|name:|contents:|attachment:)/) ||"";
+
                $each(scope.options, function(option){
                        if (option.value == match) option.selected = true;
                });
@@ -876,6 +891,8 @@
                                Wiki.prefs.set('PrevQuery', q2); 
                        } 
                }).request();
+
+               location.hash = '#'+q2+":"+$('start').value;  /* push the query 
into the url history */
        },
 
        submit: function(){ 

Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXSearch.jsp
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXSearch.jsp?rev=700577&r1=700576&r2=700577&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXSearch.jsp 
(original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXSearch.jsp Tue 
Sep 30 13:57:34 2008
@@ -98,7 +98,6 @@
 
   <wiki:SetPagination start="${param.start}" total="<%=list.size()%>" 
pagesize="20" maxlinks="9" 
                      fmtkey="info.pagination"
-                       href="#" 
                     onclick="$('start').value=%s; SearchBox.runfullsearch();" 
/>
   
     <div class="graphBars">


Reply via email to