Re-arrange files, add support for classic JS Documentor, and packer
[gnome.introspection-doc-generator] / Date.js
diff --git a/Date.js b/Date.js
index bbbd93a..ceb5292 100755 (executable)
--- a/Date.js
+++ b/Date.js
@@ -8,18 +8,11 @@
  * Fork - LGPL
  * <script type="text/javascript">
  */
+// usage: Seed.include('Date.js')
 
-//imports['Date.js'].load(Date);
-if (imports) {
-    imports['String.js'].load(String);
 
-}
-
-if (imports) {
-    load = false; // declare global for gnome langs.
-}
-(function() {
+String          = imports.String.String;
+XObject         = imports.XObject.XObject;
 
 
 /**
@@ -119,7 +112,8 @@ document.write(dt.format(Date.patterns.ShortDate));
      @return {Number} The diff in milliseconds
      @member Date getElapsed
      */
-    var date = {
+Date = XObject.extend(Date,
+    {
         
         // private
         parseFunctions : {count:0},
@@ -336,7 +330,9 @@ document.write(dt.format(Date.patterns.ShortDate));
             return Date[func](input);
         },
 
-        // private
+        /**
+        * @private
+        */
         createParser : function(format) {
             var funcName = "parse" + Date.parseFunctions.count++;
             var regexNum = Date.parseRegexes.length;
@@ -523,9 +519,12 @@ document.write(dt.format(Date.patterns.ShortDate));
         }
 
         
-    };
+    
+}); // end static date..
 
-    var datePrototype = {
+// now add functions to date..
+XObject.extend(Date.prototype,
+    {
 
         getElapsed : function(date) {
             return Math.abs((date || new Date()).getTime()-this.getTime());
@@ -785,25 +784,5 @@ document.write(dt.format(Date.patterns.ShortDate));
           }
           return d;
         }
-    };
-    if (imports) {
-        load = function(ar) {
-            Date = ar;
-            imports.lang.copyPropertiesNoOverwrite( date,ar);
-            imports.lang.copyPropertiesNoOverwrite(datePrototype, ar.prototype);
-            
-        };
-    } else {
-        // non imports version.
-        for(i in datePrototype) {
-            if (!Date.prototype[i]) {
-                Date.prototype[i] = datePrototype[i];
-            }
-        }
-        for(i in date) {
-            if (!Date[i]) {
-                Date[i] = date[i];
-            }
-        }
-    }
-})();
\ No newline at end of file
+
+});
\ No newline at end of file