Improves jQuery extension in xorg.js.
[platal.git] / templates / emails / redirect.tpl
index 766a6dc..6e4512f 100644 (file)
@@ -56,7 +56,6 @@
     <a href="Xorg/SMTPSecurise">service d'envoi d'email SMTP sécurisé</a>.
   </p>
 
-  {javascript name=ajax}
   <script type="text/javascript">//<![CDATA[
     {literal}
     function activeEnable()
@@ -73,7 +72,7 @@
 
     function redirectUpdate()
     {
-        showTempMessage('redirect-msg', "Tes redirections ont été mises à jour.", true);
+        $('#redirect-msg').tmpMessage("Tes redirections ont été mises à jour.", true);
         activeEnable();
     }
 
@@ -81,7 +80,7 @@
     {
         if (confirm("Supprimer l'adresse " + email + " ?")) {
           $.get(link.href, {},function() {
-            $('tr[@id=line_' + email.replace('@', '_at_') + ']').remove();
+            $('#line_' + email.replace('@', '_at_').replace('.','\\.')).remove();
             showRemove();
             activeEnable();
           });
     function updateRedirect(checked, email)
     {
         activeEnable();
-        Ajax.update_html(null, 'emails/redirect/' + (checked ? '' : 'in') + 'active/' + email, redirectUpdate);
+        $.xget('emails/redirect/' + (checked ? '' : 'in') + 'active/' + email,
+               redirectUpdate);
     }
 
     function rewriteUpdate(mail, allow, box)
   {test_email}
   <div id="redirect-msg" style="position:absolute;"></div><br />
   <div class="center">
+    <form action="emails/redirect" method="post">
     <table class="bicol" summary="Adresses de redirection">
       <tr>
         <th>Redirection</th>
                  onchange="updateRedirect(this.checked, '{$e->email}')" /></td>
         <td style="text-align: left">
           {if $e->has_rewrite()}
-          <select onchange="Ajax.update_html(null,'emails/redirect/rewrite/{$e->email}/'+this.value, rewriteUpdate('{$e->email}', {$e->allow_rewrite|default:"0"}, this))">
+          <select onchange="$.get('emails/redirect/rewrite/{$e->email}/'+this.value, 'text',  rewriteUpdate('{$e->email}', {$e->allow_rewrite|default:"0"}, this)); return false">
             <option value=''>--- aucune ---</option>
             {assign var=dom1 value=#globals.mail.domain#}
             {assign var=dom2 value=#globals.mail.domain2#}
             {icon name=cross title="Supprimer"}
           </a>
           {else}
-          {if $e->sufficient}<span class="remove_email"></span>{/if}
+          {if $e->sufficient}<span class="remove_email"><span style="display:none">&nbsp;</span></span>{/if}
           <a href="emails/redirect#{$e->email}">{icon name=information title="Plus d'informations"}</a>
           {/if}
         </td>
       </tr>
       {/foreach}
-      <form action="emails/redirect" method="post">
         {cycle values="pair,impair" assign=class_combobox}
+        {$error_email}
         {include file="include/emails.combobox.tpl" name="email" val=$email class=$class_combobox error=$error_email i="0"}
         <tr class="{$class_combobox}"><td colspan="4"><div>
           <input type="submit" value="ajouter" name="emailop" />
           {xsrf_token_field}
         </div></td></tr>
-      </form>
     </table>
+    </form>
     <script type="text/javascript">showRemove(); activeEnable();</script>
   </div>
 <p class="smaller center">