Changeset 2020 for WAeUP_SRP


Ignore:
Timestamp:
16 Jul 2007, 14:17:45 (17 years ago)
Author:
joachim
Message:

ajaxifying finished works for personal_edit

Location:
WAeUP_SRP/trunk/skins/waeup_default
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_default/external_edit_buttons.pt

    r805 r2020  
    99         id="external_close_button"
    1010         i18n:attributes="value" />
     11  <tal:block define="
     12  use_ajax use_ajax|python:True;
     13  content_changed python:cpsmcat('psm_content_changed');
     14  content_error python:cpsmcat('psm_content_error');
     15  working python:cpsmcat('psm_ajax_working')"
     16  condition="python:use_ajax">
     17    <script type="text/javascript"
     18            tal:content="string:
     19            // unobtrusive form controller, that leaves the form accessible
     20            var editor = new CPSDocumentEditor(
     21            'editForm',
     22            $$('editForm').action,
     23            'editForm',
     24            new Array('external_edit_button'),
     25            null,
     26            'page_title',
     27            {content_changed: '${content_changed}',
     28            working: '${working}',
     29            content_error: '${content_error}'},
     30            null,
     31            new Array('addwidget_button'));"
     32            >
     33    </script>
     34  </tal:block>
    1135</metal:block>
    1236
  • WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_ajax.py

    r2017 r2020  
    1010# cleaning incoming params
    1111cleanAjaxParams(REQUEST)
     12# from Products.zdb import set_trace
     13# set_trace()
    1214
    1315doc = context.getContent()
     
    2224# At this time we do XML-RPC answers.
    2325# We'll see later how to automate it to avoid a manual serialization here.
    24 #from Products.zdb import set_trace
    25 #set_trace()
    2626
    2727if is_valid:
  • WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_form.pt

    r2013 r2020  
    1212           ">
    1313<metal:block define-macro="edit_form">
    14 <metal:block use-macro=template>
     14  <metal:block use-macro=template>
     15      <metal:block fill-slot="style_slot">
     16      <script type="text/javascript" src="prototype.js"
     17              tal:attributes="src string:${base_url}prototype.js"></script>
     18      <script type="text/javascript" src="effects.js"
     19              tal:attributes="src string:${base_url}effects.js"></script>
     20      <script type="text/javascript" src="controls.js"
     21              tal:attributes="src string:${base_url}controls.js"></script>
     22      <script type="text/javascript" src="cpsdocument.js"
     23              tal:attributes="src string:${base_url}cpsdocument.js"></script>
     24      <script type="text/javascript" src="cpsschemas.js"
     25              tal:attributes="src string:${base_url}cpsschemas.js"></script>
    1526
    16 
    17   <metal:block fill-slot="style_slot">
    18     <link rel="Stylesheet" type="text/css" href=""
    19       tal:attributes="href string:${base_url}document.css" />
    20 
    21     <metal:block define-macro="widgets_javascript">
    22 
    23     <tal:block condition="python:modules['Products.CPSUtil.integration'].isProductPresent('Products.FCKeditor')">
    24       <script type="text/javascript">
    25         var popup_editor_form = 'popup_fckeditor_form';
    26         var width = 640;
    27         var height = 520;
    28       </script>
    29     </tal:block>
    30 
    31     <script type="text/javascript">
    32      function popup_rte(input_id, label_edit) {
    33        var args, value;
    34        value = document.getElementById(input_id).value;
    35        args = '?input_id='+input_id+'&amp;label_edit='+escape(label_edit);
    36        str_window_features = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,dependent=1,width=' + width + ',height=' + height;
    37        popup = window.open(popup_editor_form + args, input_id, str_window_features);
    38        if (!popup.opener) {
    39          popup.opener = window;
    40        }
    41        return false;
    42      }
    43    </script>
    44    </metal:block>
    45   </metal:block>
    46 
    47  
     27    </metal:block>
    4828  <metal:block fill-slot="header">
    4929    <span tal:condition="not: is_allowed">
     
    8060 
    8161  <metal:block fill-slot="main" tal:condition="is_allowed">
    82     <form action="waeup_edit" method="post" id="editForm"
     62    <form id=editForm action="waeup_edit" method="post" id="editForm"
    8363          enctype="multipart/form-data" class="workflow"
     64          tal:attributes="action string:${context/absolute_url}/waeup_edit"
    8465          >
    8566        <input type="hidden" id="came_from" name="came_from" value=""
     
    11798              </textarea>
    11899            </dd>
    119           </dl>
     100          </dl>         
    120101        </tal:block>
     102        <metal:block use-macro="python:path('context/%s_edit_buttons/macros/buttons' % form_type)"/>
    121103
    122         <metal:block use-macro="python:path('context/%s_edit_buttons/macros/buttons' % form_type)"/>
     104          <tal:block define="
     105          use_ajax use_ajax|python:True;
     106          content_changed python:cpsmcat('psm_content_changed');
     107          content_error python:cpsmcat('psm_content_error');
     108          working python:cpsmcat('psm_ajax_working')"
     109          condition="python:use_ajax">
     110            <script type="text/javascript"
     111                    tal:content="string:
     112                    // unobtrusive form controller, that leaves the form accessible
     113                    var editor = new CPSDocumentEditor(
     114                    'editForm',
     115                    $$('editForm').action,
     116                    'editForm',
     117                    new Array('cpsdocument_edit_button'),
     118                    new Array('cpsdocument_edit_and_view_button'),
     119                    'page_title',
     120                    {content_changed: '${content_changed}',
     121                    working: '${working}',
     122                    content_error: '${content_error}'},
     123                    null,
     124                    new Array('addwidget_button'));"
     125                    >
     126            </script>
     127          </tal:block>
     128        </div>
     129      </form>
     130      <div id="ajax_psm" style="display:none">
     131        ajax feedback
    123132      </div>
    124     </form>
    125133  </metal:block>
    126134
Note: See TracChangeset for help on using the changeset viewer.