[Pieforms-commit] SF.net SVN: pieforms: [100] pieforms-php5/trunk/src/pieform/renderers/div. php
Status: Alpha
Brought to you by:
oracleshinoda
|
From: <ora...@us...> - 2006-12-17 23:26:46
|
Revision: 100
http://svn.sourceforge.net/pieforms/?rev=100&view=rev
Author: oracleshinoda
Date: 2006-12-17 15:26:45 -0800 (Sun, 17 Dec 2006)
Log Message:
-----------
Use the new, smarter way of putting messages next to the correct submit button. Also, use some of the nicer new MochiKit methods to insert divs before/after others
Modified Paths:
--------------
pieforms-php5/trunk/src/pieform/renderers/div.php
Modified: pieforms-php5/trunk/src/pieform/renderers/div.php
===================================================================
--- pieforms-php5/trunk/src/pieform/renderers/div.php 2006-12-17 23:24:49 UTC (rev 99)
+++ pieforms-php5/trunk/src/pieform/renderers/div.php 2006-12-17 23:26:45 UTC (rev 100)
@@ -77,16 +77,18 @@
return $result;
}
-function pieform_renderer_div_messages_js($id, $submitid) {
+
+// @todo needs updating again... need to replace remove_error with remove_all_errors
+function pieform_renderer_div_messages_js($id) {
$result = <<<EOF
+
// Given a message and form element name, should set an error on the element
function {$id}_set_error(message, element) {
{$id}_remove_error(element);
element += '_container';
// @todo set error class on input elements...
- $(element).parentNode.insertBefore(DIV({'id': '{$id}_error_' + element, 'class': 'errmsg'}, message), $(element).nextSibling);
+ insertSiblingNodesBefore(DIV({'id': '{$id}_error_' + element, 'class': 'errmsg'}, message), $(element));
}
-// Given a form element name, should remove an error associated with it
function {$id}_remove_error(element) {
element += '_container';
var elem = $('{$id}_error_' + element);
@@ -95,13 +97,13 @@
}
}
function {$id}_message(message, type) {
- var elem = $('{$id}_message');
- var msg = DIV({'id': '{$id}_message', 'class': type}, message);
+ var elem = $('{$id}_pieform_message');
+ var msg = DIV({'id': '{$id}_pieform_message', 'class': type}, message);
if (elem) {
swapDOM(elem, msg);
}
else {
- appendChildNodes($('{$submitid}_container').parentNode, msg);
+ insertSiblingNodesAfter($('{$id}_' + {$id}_btn + '_container'), msg);
}
}
function {$id}_remove_message() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|