[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1608] trunk/UI/elements.html



Revision: 1608
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1608&view=rev
Author:   einhverfr
Date:     2007-09-14 21:38:10 -0700 (Fri, 14 Sep 2007)

Log Message:
-----------

Applying changes to elements.html

Modified Paths:
--------------
    trunk/UI/elements.html

Modified: trunk/UI/elements.html
===================================================================
--- trunk/UI/elements.html	2007-09-15 01:59:32 UTC (rev 1607)
+++ trunk/UI/elements.html	2007-09-15 04:38:10 UTC (rev 1608)
@@ -127,8 +127,8 @@
 
 <?lsmb # OPTION ELEMENT ?>
 <?lsmb BLOCK option ?>
-  <?lsmb  # Selected is a special case -- no attribute key, so it's handled here.
-    IF option_data.defined('selected');
+  <?lsmb  # Selected is a special case -- no attribute key, so it's handled here by looking for the option value in the default_values key.
+    IF element_data.defined('default_values') AND element_data.default_values.grep('^' _ option_data.value _ '$').size;
       option_data.selected = " selected";
     ELSE;
       option_data.selected = "";
@@ -222,9 +222,9 @@
         element_id = element_data.name;
       END;
     ?>
-    <?lsmb  # Add the id if it's been generated.  Replace underscores with dashes -- nicer CSS.
+    <?lsmb  # Add the id if it's been generated.  Replace all non alphanumeric characters with dashes -- nicer CSS.
       IF element_id;
-        element_data.id = element_id.replace('[_]', '-'); 
+        element_data.id = element_id.replace('[^\p{IsAlnum}]', '-'); 
       END;
     ?>
   <?lsmb END ?>
@@ -250,4 +250,4 @@
     ?>
     <label<?lsmb label_id ?><?lsmb label_for ?><?lsmb label_class ?>><?lsmb text(element_data.label) ?></label>
   <?lsmb END ?>
-<?lsmb END ?>
\ No newline at end of file
+<?lsmb END ?>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.