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

SF.net SVN: ledger-smb:[6084] trunk/UI/lib



Revision: 6084
          http://sourceforge.net/p/ledger-smb/code/6084
Author:   einhverfr
Date:     2013-09-26 04:04:15 +0000 (Thu, 26 Sep 2013)
Log Message:
-----------
Moved date class elements over to lsmb/lib/DateTextBox wrapper

Modified Paths:
--------------
    trunk/UI/lib/DateTextBox.js
    trunk/UI/lib/setup.js
    trunk/UI/lib/ui-header.html

Modified: trunk/UI/lib/DateTextBox.js
===================================================================
--- trunk/UI/lib/DateTextBox.js	2013-09-26 03:15:34 UTC (rev 6083)
+++ trunk/UI/lib/DateTextBox.js	2013-09-26 04:04:15 UTC (rev 6084)
@@ -7,7 +7,7 @@
         [DateTextBox],
         {
           postMixInProperties: function() {
-            this.constraints.datePattern = this.constraints.datePattern.replace(/m/g, 'M');
+            this.constraints.datePattern = lsmbConfig.dateformat;
             this.inherited(arguments);
           }
         });

Modified: trunk/UI/lib/setup.js
===================================================================
--- trunk/UI/lib/setup.js	2013-09-26 03:15:34 UTC (rev 6083)
+++ trunk/UI/lib/setup.js	2013-09-26 04:04:15 UTC (rev 6084)
@@ -21,25 +21,21 @@
                 // I have now changed it to a DateTextBox, but apparently we 
                 // also have a wrapped version which we should use.  Will move 
                 // that over shortly. --CT
-                var df = lsmbConfig.dateformat;
-                df.replace('mm', 'MM');
-                var val = input.value;
-                var style = {};
-                if (val == undefined || val == ''){
-                   val = null;
-                }
-                
-                if (input.size !== undefined && input.size !== ''){
-                   style['width'] = (input.size * 0.6) + 'em';
-                }
-                return new datebox({
-                    "label": input.title,
-                    "value": val,
-                     "name": input.name,
-                       "id": input.id,
-                    "style": style,
-              "constraints": { "datePattern": df }
-                }, input);
+                return require(['lsmb/lib/DateTextBox', 'dojo/domReady!'],
+                  function(datebox){
+                    var val = input.value;
+                    if (val == ''){
+                        val = undefined;
+                    }
+                    new datebox({
+                        "label": input.title,
+                        "value": val,
+                         "name": input.name,
+                           "id": input.id,
+                        "style": style,
+                    }, input);
+                  }
+                );
              } else if (cls.contains(input, 'AccountBox')){
                 return require(['lsmb/accounts/AccountSelector'],
                             function(accountselector){
@@ -174,6 +170,7 @@
       function(query, registry, cls, construct, table, textbox, checkbox, datebox, 
                radio, select, button, textarea, contentpane)
       {
+             lsmbConfig.dateformat = lsmbConfig.dateformat.replace('m', 'M');
              query('.tabular').forEach(
                   function(node){
                       var tabparams = {

Modified: trunk/UI/lib/ui-header.html
===================================================================
--- trunk/UI/lib/ui-header.html	2013-09-26 03:15:34 UTC (rev 6083)
+++ trunk/UI/lib/ui-header.html	2013-09-26 04:04:15 UTC (rev 6084)
@@ -30,7 +30,7 @@
 	       async: 1,
 	       parseOnLoad: 0,
 	       packages: [{"name":"lsmb","location":"../../.."}]
-	   }
+	   };
            var lsmbConfig = { "dateformat": '<?lsmb USER.dateformat ?>' };
         </script>
        <script type="text/javascript" language="JavaScript" src="UI/lib/dojo/dojo/dojo.js"></script>

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


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits