summaryrefslogtreecommitdiffstats
path: root/media/forms/cmxform.js
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2007-11-03 08:45:10 +0100
committereliott <eliott@cactuswax.net>2007-11-03 08:45:10 +0100
commit39a548fd2629f3b6383990264b2e331b3aea99fb (patch)
treef68c3156dad5f7814473ceff2461679ddf11a2e8 /media/forms/cmxform.js
downloadarchweb-39a548fd2629f3b6383990264b2e331b3aea99fb.tar.gz
archweb-39a548fd2629f3b6383990264b2e331b3aea99fb.tar.xz
Initial import for public release...
Special Note Prior to git import, approx 90% of the code was done by Judd Vinet. Thanks Judd!
Diffstat (limited to 'media/forms/cmxform.js')
-rw-r--r--media/forms/cmxform.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/media/forms/cmxform.js b/media/forms/cmxform.js
new file mode 100644
index 0000000..0b7973d
--- /dev/null
+++ b/media/forms/cmxform.js
@@ -0,0 +1,22 @@
+if( document.addEventListener ) document.addEventListener( 'DOMContentLoaded', cmxform, false );
+
+function cmxform(){
+ // Hide forms
+ $( 'form.cmxform' ).hide().end();
+
+ // Processing
+ $( 'form.cmxform' ).find( 'li/label' ).not( '.nocmx' ).each( function( i ){
+ var labelContent = this.innerHTML;
+ var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );
+ var labelSpan = document.createElement( 'span' );
+ labelSpan.style.display = 'block';
+ labelSpan.style.width = labelWidth;
+ labelSpan.innerHTML = labelContent;
+ this.style.display = '-moz-inline-box';
+ this.innerHTML = null;
+ this.appendChild( labelSpan );
+ } ).end();
+
+ // Show forms
+ $( 'form.cmxform' ).show().end();
+} \ No newline at end of file