Author: ajaquith
Date: Wed Feb  3 05:21:54 2010
New Revision: 905895

URL: http://svn.apache.org/viewvc?rev=905895&view=rev
Log:
Preview is now a tab, and its contents refresh automatically when it is clicked 
based on the editor's contents. This replaces "live" or "sneak" preview. It 
looks good and works well. Related: a new EventResolution class now exists to 
help events methods return AJAX that stripes-support.js understands.

Modified:
    
incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default.properties
    incubator/jspwiki/trunk/src/WebContent/scripts/stripes-support.js

Modified: 
incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default.properties
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default.properties?rev=905895&r1=905894&r2=905895&view=diff
==============================================================================
--- 
incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default.properties
 (original)
+++ 
incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default.properties
 Wed Feb  3 05:21:54 2010
@@ -351,7 +351,7 @@
 fact.submitter=Submitter
 #  PreviewContent.jsp
 preview.tab=Preview
-preview.info=This is a <strong>preview</strong>!  Hit &#8220;Keep 
Editing&#8221; to go back to the editor, or hit &#8220;Save&#8221; if 
you&#8217;re happy with what you see.
+preview.info=This is a preview of what the page would look like if you saved 
your changes. Click on the &#8220;Edit&#8221; tab to go back to the editor.
 #  SearchBox.jsp
 sbox.search.submit=Quick Navigation
 sbox.view=view

Modified: incubator/jspwiki/trunk/src/WebContent/scripts/stripes-support.js
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/scripts/stripes-support.js?rev=905895&r1=905894&r2=905895&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/scripts/stripes-support.js (original)
+++ incubator/jspwiki/trunk/src/WebContent/scripts/stripes-support.js Wed Feb  
3 05:21:54 2010
@@ -46,24 +46,23 @@
        Fixme: update to mootool 1.2.3
 */
 var Stripes = {
-       executeEvent: function( form, event, divTarget ){
-               params = event + "=&" + $(form).toQueryString();
-
-               new Request(form.action, {
-                       postBody: params,
-                       method: 'post',
-                       onComplete: function(response){
-                               // Clear the results div
-                               $(divTarget).empty();
-                               // Build new results if we got a response
-                               if(response) var results = eval(response);
-                               if(results){
-                                       var target = 
$(divTarget).addClass("warning");
-                                       results.each(function(result,i) {
-                                               var p = new 
Element('p').setHTML(result).injectInside(divTarget);
-                                       });
-                               }
-                       }
-               }).send();
-       }
+  executeEvent: function( formName, event, divTarget ){
+    var form = $(formName);
+    var url = form.action;
+    var params = event + "=&" + form.toQueryString();
+    var request = new Request( {
+      url: url,
+      data: params,
+      method: 'post',
+      evalResponse: true,
+      onComplete: function(response) {
+        // Clear the results div
+        $(divTarget).empty();
+        if (eventResponse.html) {
+          $(divTarget).set('html',eventResponse.results);
+        }
+      }
+    });
+    request.send();
+  }
 }


Reply via email to