r9452 - in apps/gobi/trunk/code: Comment Global Page/skins

[email protected]
Newsgroups gmane.comp.java.helma.cvs
Message-ID <[email protected]>
Author: hannes
Date: 2008-12-19 16:12:14 +0100 (Fri, 19 Dec 2008)
New Revision: 9452

Modified:
   apps/gobi/trunk/code/Comment/edit.skin
   apps/gobi/trunk/code/Global/Messages.js
   apps/gobi/trunk/code/Page/skins/commentForm.skin
   apps/gobi/trunk/code/Page/skins/javascript.skin
   apps/gobi/trunk/code/Page/skins/page.skin
Log:
Add cancel button to comment form, start transition to jquery.

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

Modified: apps/gobi/trunk/code/Comment/edit.skin
===================================================================
--- apps/gobi/trunk/code/Comment/edit.skin	2008-12-19 15:10:21 UTC (rev 9451)
+++ apps/gobi/trunk/code/Comment/edit.skin	2008-12-19 15:12:14 UTC (rev 9452)
@@ -8,5 +8,6 @@
 <p>
   <input type="submit" value="<% msg name='comment_preview' %>" name="preview" />
   <input type="submit" value="<% msg name='comment_save' %>" name="save" />
+  <a href="<% page.href %>" class="commentLink"><% msg name='cancel' %></a>
 </p>
 </form>

Modified: apps/gobi/trunk/code/Global/Messages.js
===================================================================
--- apps/gobi/trunk/code/Global/Messages.js	2008-12-19 15:10:21 UTC (rev 9451)
+++ apps/gobi/trunk/code/Global/Messages.js	2008-12-19 15:12:14 UTC (rev 9452)
@@ -1,4 +1,7 @@
 var MESSAGES_en = {
+    ok: "OK",
+    save: "Save",
+    cancel: "Cancel",
     comment_header: "Comments",
     comment_add: "Add Comment",
     comment_preview: "Preview Comment",
@@ -88,6 +91,9 @@
 }
 
 var MESSAGES_de = {
+    ok: "OK",
+    save: "Speichern",
+    cancel: "Abbrechen",
     comment_header: "Kommentare",
     comment_add: "Kommentar Hinzufügen",
     comment_preview: "Voransicht",

Modified: apps/gobi/trunk/code/Page/skins/commentForm.skin
===================================================================
--- apps/gobi/trunk/code/Page/skins/commentForm.skin	2008-12-19 15:10:21 UTC (rev 9451)
+++ apps/gobi/trunk/code/Page/skins/commentForm.skin	2008-12-19 15:12:14 UTC (rev 9452)
@@ -1,10 +1,12 @@
-<p><a href="#" onclick="return toggleCommentForm(this);" class="commentLink"><%
+<p><a href="#" onclick="return toggleCommentForm();" class="commentLink commentToggle"><%
     msg name='comment_add' %></a></p>
 <form action="<% this.href action='comment' %>" method="post"
-      id="commentForm" style="display:none;">
+      class="commentToggle" style="display: none;">
     <p>
     <textarea name="body" id="commentInput"></textarea>
     </p>
     <input type="submit" value="<% msg name='comment_preview' %>" name="preview" />
     <input type="submit" value="<% msg name='comment_save' %>" name="save" />
+    <a href="#" onclick="return toggleCommentForm();" class="commentLink"><%
+        msg name='cancel' %></a>
 </form>
\ No newline at end of file

Modified: apps/gobi/trunk/code/Page/skins/javascript.skin
===================================================================
--- apps/gobi/trunk/code/Page/skins/javascript.skin	2008-12-19 15:10:21 UTC (rev 9451)
+++ apps/gobi/trunk/code/Page/skins/javascript.skin	2008-12-19 15:12:14 UTC (rev 9452)
@@ -90,14 +90,9 @@
       return toggleElement(id);
   }
 
-  function toggleCommentForm(link) {
-      try{
-          link.style.display = "none";
-          getElement("commentForm").style.display = "";
-          getElement("commentInput").focus();
-      } catch (error) {
-          alert("Error in toggleCommentForm: " + error);
-      }
+  function toggleCommentForm() {
+      $('.commentToggle').toggle();
+      $('#commentInput').focus();
       return false;
   }
 

Modified: apps/gobi/trunk/code/Page/skins/page.skin
===================================================================
--- apps/gobi/trunk/code/Page/skins/page.skin	2008-12-19 15:10:21 UTC (rev 9451)
+++ apps/gobi/trunk/code/Page/skins/page.skin	2008-12-19 15:12:14 UTC (rev 9452)
@@ -5,7 +5,8 @@
 <html>
 <head>
 <title><% page.name %></title>
-    <link rel="stylesheet" media="screen" href="<% this.href action='stylesheet.css' %>" />
+    <link rel="stylesheet" media="screen" href="<% this.href action='stylesheet.css' %>"></link>
+    <script type="text/javascript" src="/static/jquery-1.2.6.pack.js"></script>
     <% page.javascript %>
     <% response.javascript prefix='<script type="text/javascript">' suffix='</script>' %>
 </head>

_______________________________________________
Helma-CVS mailing list
[email protected]
http://helma.org/mailman/listinfo/helma-cvs
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.