r9464 - in apps/gobi/trunk/code: Comment Page Page/skins

[email protected]
Newsgroups gmane.comp.java.helma.cvs
Message-ID <[email protected]>
Author: hannes
Date: 2008-12-22 16:11:33 +0100 (Mon, 22 Dec 2008)
New Revision: 9464

Modified:
   apps/gobi/trunk/code/Comment/edit.skin
   apps/gobi/trunk/code/Comment/embed.skin
   apps/gobi/trunk/code/Page/PageActions.js
   apps/gobi/trunk/code/Page/skins/javascript.skin
Log:
Make editing of comments ajaxy inlined.

Details at http://dev.helma.org/trac/helma/changeset/9464

Modified: apps/gobi/trunk/code/Comment/edit.skin
===================================================================
--- apps/gobi/trunk/code/Comment/edit.skin	2008-12-22 14:53:35 UTC (rev 9463)
+++ apps/gobi/trunk/code/Comment/edit.skin	2008-12-22 15:11:33 UTC (rev 9464)
@@ -1,4 +1,4 @@
-<form method="post" name="edit" id="editForm" enctype="multipart/form-data">
+<form action="<% this.href action='edit' %>" method="post" name="edit" id="editForm" enctype="multipart/form-data">
 
 <% this.formEditor %>
 

Modified: apps/gobi/trunk/code/Comment/embed.skin
===================================================================
--- apps/gobi/trunk/code/Comment/embed.skin	2008-12-22 14:53:35 UTC (rev 9463)
+++ apps/gobi/trunk/code/Comment/embed.skin	2008-12-22 15:11:33 UTC (rev 9464)
@@ -2,7 +2,7 @@
 <b><a href="#$cmt<% this.id %>">#<% this.number %></a>
 <% this.creator prefix=" by " %>
 <% this.createtime prefix=" at " %></b>
-<% this.actionlink action="edit" prefix="&nbsp;..." %>
+<% this.actionlink action="edit" onclick="return editCommentShow(this);" prefix="&nbsp;..." %>
 <% this.actionlink action="delete" onclick="return deleteCommentShow(this);" prefix="&nbsp;..." %>
 <div class="deleteConfirm"></div>
-<% this.body %>
\ No newline at end of file
+<div class="commentBody"><% this.body %></div>
\ No newline at end of file

Modified: apps/gobi/trunk/code/Page/PageActions.js
===================================================================
--- apps/gobi/trunk/code/Page/PageActions.js	2008-12-22 14:53:35 UTC (rev 9463)
+++ apps/gobi/trunk/code/Page/PageActions.js	2008-12-22 15:11:33 UTC (rev 9464)
@@ -289,6 +289,9 @@
             p.readEditForm(false);
             p.renderSkin("body#preview");
             return;
+        } else if (req.data.edit) {
+            this.renderSkin("edit");
+            return;
         }
     }
     res.data.body = this.renderSkinAsString("edit");

Modified: apps/gobi/trunk/code/Page/skins/javascript.skin
===================================================================
--- apps/gobi/trunk/code/Page/skins/javascript.skin	2008-12-22 14:53:35 UTC (rev 9463)
+++ apps/gobi/trunk/code/Page/skins/javascript.skin	2008-12-22 15:11:33 UTC (rev 9464)
@@ -181,6 +181,11 @@
       return true;
   }
 
+  function editCommentShow(link) {
+      $(link).nextAll('.commentBody:first').load(link.href, {edit: true});
+      return false;
+  }
+
   function pagePreview(form) {
       var input = $(form).find('[name=body]');
       var action = form.action || location.href;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.