Author: hannes
Date: 2008-12-22 14:22:46 +0100 (Mon, 22 Dec 2008)
New Revision: 9461
Modified:
apps/gobi/trunk/code/Comment/edit.skin
apps/gobi/trunk/code/Global/Global.js
apps/gobi/trunk/code/Global/Messages.js
apps/gobi/trunk/code/Page/skins/commentForm.skin
apps/gobi/trunk/code/Page/skins/create.skin
apps/gobi/trunk/code/Page/skins/edit.skin
apps/gobi/trunk/code/Page/skins/javascript.skin
apps/gobi/trunk/code/Page/skins/stylesheet.skin
Log:
Add "continue editing" link at bottom of preview. Allow msg macro to be called with message name as positional argument. Minor style tweak.
Details at http://dev.helma.org/trac/helma/changeset/9461
Modified: apps/gobi/trunk/code/Comment/edit.skin
===================================================================
--- apps/gobi/trunk/code/Comment/edit.skin 2008-12-22 12:00:18 UTC (rev 9460)
+++ apps/gobi/trunk/code/Comment/edit.skin 2008-12-22 13:22:46 UTC (rev 9461)
@@ -1,4 +1,4 @@
-<form method="post" name="edit" enctype="multipart/form-data">
+<form method="post" name="edit" id="editForm" enctype="multipart/form-data">
<% this.formEditor %>
@@ -11,7 +11,10 @@
<input type="submit" value="<% msg name='comment_save' %>" name="save" />
<a href="<% page.href %>" class="commentLink"><% msg name='cancel' %></a>
</p>
-<div id="pagePreview"></div>
+<div class="previewToggle" style="display: none;">
+ <div id="pagePreview"></div>
+ <a href="#" onclick="return continueEditing()"><% msg 'edit_continue' %></a>
+</div>
</form>
Modified: apps/gobi/trunk/code/Global/Global.js
===================================================================
--- apps/gobi/trunk/code/Global/Global.js 2008-12-22 12:00:18 UTC (rev 9460)
+++ apps/gobi/trunk/code/Global/Global.js 2008-12-22 13:22:46 UTC (rev 9461)
@@ -454,9 +454,10 @@
/////////////////////////////////// macros //////////////////////////////
function msg_macro(param) {
- if (!param.name)
+ var name = param.name || arguments[1];
+ if (!name)
return "name missing in msg macro";
- var args = [param.name];
+ var args = [name];
// append substitution parameters to argument array
for (var i=1; i<10; i++) {
if (param["p"+i] == null)
Modified: apps/gobi/trunk/code/Global/Messages.js
===================================================================
--- apps/gobi/trunk/code/Global/Messages.js 2008-12-22 12:00:18 UTC (rev 9460)
+++ apps/gobi/trunk/code/Global/Messages.js 2008-12-22 13:22:46 UTC (rev 9461)
@@ -18,6 +18,7 @@
preview_message: "Click 'Create Page' to save the page once you are happy with it!",
edit_button: "Save Page",
edit_confirm: "Your changes to the page have been saved!",
+ edit_continue: "Continue Editing",
login_please: "Please enter your user name and password",
login_failed: "Login failed. Please check your input and try again!",
login_succeeded: "Welcome to $1, $2!",
@@ -111,6 +112,7 @@
preview_message: "Klicken Sie 'Seite Anlegen' um die Seite zu speichern!",
edit_button: "Seite Speichern",
edit_confirm: "Ihre Änderungen an der Seite wurden gespeichert!",
+ edit_continue: "Weiter bearbeiten",
login_please: "Geben Sie bitte Benutzername und Passwort ein!",
login_failed: "Anmeldung fehlgeschlagen. Bitte Überprüfen Sie Ihre Eingaben!",
login_succeeded: "Willkommen bei $1, $2!",
Modified: apps/gobi/trunk/code/Page/skins/commentForm.skin
===================================================================
--- apps/gobi/trunk/code/Page/skins/commentForm.skin 2008-12-22 12:00:18 UTC (rev 9460)
+++ apps/gobi/trunk/code/Page/skins/commentForm.skin 2008-12-22 13:22:46 UTC (rev 9461)
@@ -1,4 +1,4 @@
-<p><a href="#" onclick="return commentToggle();" class="commentLink commentToggle"><%
+<p><a href="#" onclick="return commentShowForm();" class="commentLink commentToggle"><%
msg name='comment_add' %></a></p>
<form action="<% this.href action='comment' %>" method="post"
class="commentToggle" id="commentForm" style="display: none;">
@@ -11,5 +11,8 @@
<a href="#" onclick="return commentCancel();" class="commentLink"><%
msg name='cancel' %></a>
</p>
- <div id="pagePreview"></div>
+ <div class="previewToggle" style="display: none;">
+ <div id="pagePreview"></div>
+ <a href="#" onclick="return continueEditing('#commentForm')"><% msg 'edit_continue' %></a>
+ </div>
</form>
Modified: apps/gobi/trunk/code/Page/skins/create.skin
===================================================================
--- apps/gobi/trunk/code/Page/skins/create.skin 2008-12-22 12:00:18 UTC (rev 9460)
+++ apps/gobi/trunk/code/Page/skins/create.skin 2008-12-22 13:22:46 UTC (rev 9461)
@@ -30,5 +30,8 @@
<a href="<% page.href %>" class="commentLink">
<% msg name='cancel' %></a>
</p>
-<div id="pagePreview"></div>
+<div class="previewToggle" style="display: none;">
+ <div id="pagePreview"></div>
+ <a href="#" onclick="return continueEditing()"><% msg 'edit_continue' %></a>
+</div>
</form>
\ No newline at end of file
Modified: apps/gobi/trunk/code/Page/skins/edit.skin
===================================================================
--- apps/gobi/trunk/code/Page/skins/edit.skin 2008-12-22 12:00:18 UTC (rev 9460)
+++ apps/gobi/trunk/code/Page/skins/edit.skin 2008-12-22 13:22:46 UTC (rev 9461)
@@ -1,4 +1,4 @@
-<form method="post" name="edit" enctype="multipart/form-data">
+<form method="post" name="edit" id="editForm" enctype="multipart/form-data">
<% this.input name="name" class="name horizontalFill"
prefix="<p>Name<br />" suffix="</p>" %>
@@ -19,5 +19,8 @@
<a href="<% page.href %>" class="commentLink"> <% msg name='cancel' %></a>
</p>
-<div id="pagePreview"></div>
+<div class="previewToggle" style="display: none;">
+ <div id="pagePreview"></div>
+ <a href="#" onclick="return continueEditing()"><% msg 'edit_continue' %></a>
+</div>
</form>
Modified: apps/gobi/trunk/code/Page/skins/javascript.skin
===================================================================
--- apps/gobi/trunk/code/Page/skins/javascript.skin 2008-12-22 12:00:18 UTC (rev 9460)
+++ apps/gobi/trunk/code/Page/skins/javascript.skin 2008-12-22 13:22:46 UTC (rev 9461)
@@ -147,8 +147,8 @@
return;
}
- function commentToggle() {
- $('.commentToggle').toggle();
+ function commentShowForm() {
+ $('.commentToggle').toggle('fast');
$('#commentInput').focus();
$('html,body').animate({
scrollTop: $('#commentForm').offset().top
@@ -159,7 +159,7 @@
function commentCancel() {
// $('#commentInput').val('');
$('#pagePreview').html('');
- $('.commentToggle').toggle();
+ $('.commentToggle').toggle('fast');
return false;
}
@@ -170,19 +170,24 @@
ajax: true,
name: $(form).find('[name=name]').val(),
body: input.val()
+ }, function() {
+ $('.previewToggle').show('fast', function() {
+ $('html,body').animate({
+ scrollTop: $('#pagePreview').offset().top
+ });
+ });
});
- $('html,body').animate({
- scrollTop: $('#pagePreview').offset().top
- });
- input.focus();
+ // input.focus();
return false;
}
function continueEditing(form) {
+ // $('.previewToggle').hide('fast');
+ var scrollTarget = $(form || 'html,body');
$('html,body').animate({
- scrollTop: $(form).offset().top
+ scrollTop: scrollTarget.offset().top
});
- $(form).find('[name=body]').focus();
+ scrollTarget.find('[name=body]').focus();
return false;
}
Modified: apps/gobi/trunk/code/Page/skins/stylesheet.skin
===================================================================
--- apps/gobi/trunk/code/Page/skins/stylesheet.skin 2008-12-22 12:00:18 UTC (rev 9460)
+++ apps/gobi/trunk/code/Page/skins/stylesheet.skin 2008-12-22 13:22:46 UTC (rev 9461)
@@ -417,7 +417,7 @@
.comments {
width: 80%;
font-size:0.9em;
- color: #669;
+ color: #555;
background-color: #eee;
border: thin solid #669;
padding: 0 1em;
_______________________________________________
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.