# HG changeset patch
# User Dan
# Date 1188161295 14400
# Node ID d807dcd7aed74577e99bf46124174c427cdd557b
# Parent bb4e677a4da96cb665767ef045b6784f4e6b529c
[comments] fixed edit button (source wasn't getting filled)
[editor] fixed issue with PHP execution and preview (PHP code is executed now, ACL-permitting)
[admin] added checkbox to toggle account activation status in user manager (thanks Manoj)
diff -r bb4e677a4da9 -r d807dcd7aed7 includes/clientside/static/comments.js
--- a/includes/clientside/static/comments.js Sat Aug 25 12:53:03 2007 -0400
+++ b/includes/clientside/static/comments.js Sun Aug 26 16:48:15 2007 -0400
@@ -147,10 +147,10 @@
document.getElementById('ajaxEditContainer').innerHTML = html;
- //for ( i = 0; i < data.comments.length; i++ )
- //{
- // document.getElementById('comment_source_'+i).value = data.comments[i].comment_source;
- //}
+ for ( i = 0; i < data.comments.length; i++ )
+ {
+ document.getElementById('comment_source_'+i).value = data.comments[i].comment_source;
+ }
}
@@ -230,7 +230,7 @@
function editComment(id, link)
{
var ctr = document.getElementById('subject_'+id);
- var subj = trim(ctr.firstChild.nodeValue); // If there's a span in there that says 'unapproved', this eliminates it
+ var subj = ( ctr.firstChild ) ? trim(ctr.firstChild.nodeValue) : ''; // If there's a span in there that says 'unapproved', this eliminates it
ctr.innerHTML = '';
var ipt = document.createElement('input');
ipt.id = 'subject_edit_'+id;
@@ -273,9 +273,12 @@
function deleteComment(id)
{
- //var c = confirm('Do you really want to delete this comment?');
- //if(!c);
- // return false;
+ if ( !shift )
+ {
+ var c = confirm('Do you really want to delete this comment?');
+ if(!c)
+ return false;
+ }
var div = document.getElementById('comment_holder_'+id);
var real_id = div.getElementsByTagName('input')[0]['value'];
var req = {
@@ -301,6 +304,16 @@
var captcha_code = '';
var captcha_id = '';
}
+ if ( subj == '' )
+ {
+ new messagebox(MB_OK|MB_ICONSTOP, 'Input validation failed', 'Please enter a subject for your comment.');
+ return false;
+ }
+ if ( text == '' )
+ {
+ new messagebox(MB_OK|MB_ICONSTOP, 'Input validation failed', 'Please enter some text for the body of your comment .');
+ return false;
+ }
var req = {
'mode' : 'submit',
'name' : name,
diff -r bb4e677a4da9 -r d807dcd7aed7 includes/pageutils.php
--- a/includes/pageutils.php Sat Aug 25 12:53:03 2007 -0400
+++ b/includes/pageutils.php Sun Aug 26 16:48:15 2007 -0400
@@ -1591,7 +1591,15 @@
function genPreview($text)
{
- return '
Reminder: This is only a preview - your changes to this page have not yet been saved.