Index: WAeUP_SRP/trunk/skins/waeup_default/external_edit_buttons.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/external_edit_buttons.pt	(revision 2019)
+++ WAeUP_SRP/trunk/skins/waeup_default/external_edit_buttons.pt	(revision 2020)
@@ -9,4 +9,28 @@
          id="external_close_button"
          i18n:attributes="value" />
+  <tal:block define="
+  use_ajax use_ajax|python:True;
+  content_changed python:cpsmcat('psm_content_changed');
+  content_error python:cpsmcat('psm_content_error');
+  working python:cpsmcat('psm_ajax_working')"
+  condition="python:use_ajax">
+    <script type="text/javascript"
+            tal:content="string:
+            // unobtrusive form controller, that leaves the form accessible
+            var editor = new CPSDocumentEditor(
+            'editForm',
+            $$('editForm').action,
+            'editForm',
+            new Array('external_edit_button'),
+            null,
+            'page_title',
+            {content_changed: '${content_changed}',
+            working: '${working}',
+            content_error: '${content_error}'},
+            null,
+            new Array('addwidget_button'));"
+            >
+    </script>
+  </tal:block>
 </metal:block>
 
Index: WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_ajax.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_ajax.py	(revision 2019)
+++ WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_ajax.py	(revision 2020)
@@ -10,4 +10,6 @@
 # cleaning incoming params
 cleanAjaxParams(REQUEST)
+# from Products.zdb import set_trace
+# set_trace()
 
 doc = context.getContent()
@@ -22,6 +24,4 @@
 # At this time we do XML-RPC answers.
 # We'll see later how to automate it to avoid a manual serialization here.
-#from Products.zdb import set_trace
-#set_trace()
 
 if is_valid:
Index: WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_form.pt	(revision 2019)
+++ WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_form.pt	(revision 2020)
@@ -12,38 +12,18 @@
            ">
 <metal:block define-macro="edit_form">
-<metal:block use-macro=template>
+  <metal:block use-macro=template>
+      <metal:block fill-slot="style_slot">
+      <script type="text/javascript" src="prototype.js"
+              tal:attributes="src string:${base_url}prototype.js"></script>
+      <script type="text/javascript" src="effects.js"
+              tal:attributes="src string:${base_url}effects.js"></script>
+      <script type="text/javascript" src="controls.js"
+              tal:attributes="src string:${base_url}controls.js"></script>
+      <script type="text/javascript" src="cpsdocument.js"
+              tal:attributes="src string:${base_url}cpsdocument.js"></script>
+      <script type="text/javascript" src="cpsschemas.js"
+              tal:attributes="src string:${base_url}cpsschemas.js"></script>
 
-
-  <metal:block fill-slot="style_slot">
-    <link rel="Stylesheet" type="text/css" href=""
-      tal:attributes="href string:${base_url}document.css" />
-
-    <metal:block define-macro="widgets_javascript">
-
-    <tal:block condition="python:modules['Products.CPSUtil.integration'].isProductPresent('Products.FCKeditor')">
-      <script type="text/javascript">
-        var popup_editor_form = 'popup_fckeditor_form';
-        var width = 640;
-        var height = 520;
-      </script>
-    </tal:block>
-
-    <script type="text/javascript">
-     function popup_rte(input_id, label_edit) {
-       var args, value;
-       value = document.getElementById(input_id).value;
-       args = '?input_id='+input_id+'&amp;label_edit='+escape(label_edit);
-       str_window_features = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,dependent=1,width=' + width + ',height=' + height;
-       popup = window.open(popup_editor_form + args, input_id, str_window_features);
-       if (!popup.opener) {
-         popup.opener = window;
-       }
-       return false;
-     }
-   </script>
-   </metal:block>
-  </metal:block>
-
-  
+    </metal:block>
   <metal:block fill-slot="header">
     <span tal:condition="not: is_allowed">
@@ -80,6 +60,7 @@
  
   <metal:block fill-slot="main" tal:condition="is_allowed">
-    <form action="waeup_edit" method="post" id="editForm"
+    <form id=editForm action="waeup_edit" method="post" id="editForm"
           enctype="multipart/form-data" class="workflow"
+          tal:attributes="action string:${context/absolute_url}/waeup_edit"
           >
         <input type="hidden" id="came_from" name="came_from" value="" 
@@ -117,10 +98,37 @@
               </textarea>
             </dd>
-          </dl>
+          </dl>          
         </tal:block>
+        <metal:block use-macro="python:path('context/%s_edit_buttons/macros/buttons' % form_type)"/>
 
-        <metal:block use-macro="python:path('context/%s_edit_buttons/macros/buttons' % form_type)"/>
+          <tal:block define="
+          use_ajax use_ajax|python:True;
+          content_changed python:cpsmcat('psm_content_changed');
+          content_error python:cpsmcat('psm_content_error');
+          working python:cpsmcat('psm_ajax_working')"
+          condition="python:use_ajax">
+            <script type="text/javascript"
+                    tal:content="string:
+                    // unobtrusive form controller, that leaves the form accessible
+                    var editor = new CPSDocumentEditor(
+                    'editForm',
+                    $$('editForm').action,
+                    'editForm',
+                    new Array('cpsdocument_edit_button'),
+                    new Array('cpsdocument_edit_and_view_button'),
+                    'page_title',
+                    {content_changed: '${content_changed}',
+                    working: '${working}',
+                    content_error: '${content_error}'},
+                    null,
+                    new Array('addwidget_button'));"
+                    >
+            </script>
+          </tal:block>
+        </div>
+      </form>
+      <div id="ajax_psm" style="display:none">
+        ajax feedback
       </div>
-    </form>
   </metal:block>
 
