JsTemplate/Link.js
authorAlan Knowles <alan@akbkhome.com>
Fri, 16 Jul 2010 06:32:04 +0000 (14:32 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 16 Jul 2010 06:32:04 +0000 (14:32 +0800)
JsTemplate/Link.js

index d4cec0d..913d72d 100644 (file)
@@ -13,47 +13,61 @@ XObject  = imports.XObject.XObject;
        @constructor
 */
 Link = XObject.define(
+    /*
+    * constructor
+    */ 
     function () {
-        this.alias = "";
-        this.src = "";
-        this.file = "";
-        this.text = "";
-        this.innerName = "";
-        this.classLink = false;
-        this.targetName = "";
         
-        this.target = function(targetName) {
+    }, 
+    Object,
+    {
+        
+        alias : "",
+        src : "",
+        file : "",
+        text : "",
+        innerName : "",
+        classLink : false,
+        targetName : "",
+        srcReplace : false, 
+        
+        
+        
+        target : function(targetName) {
             if (typeof(targetName) != 'undefined') this.targetName = targetName;
             return this;
-        }
-        this.inner = function(inner) {
+        },
+        inner : function(inner) {
             if (typeof(inner) != 'undefined') this.innerName = inner;
             return this;
-        }
-        this.withText = function(text) {
+        },
+        withText : function(text) {
             if (typeof(text) != 'undefined') this.text = text;
             return this;
-        }
-        this.toSrc = function(filename) {
+        },
+        toSrc : function(filename) {
             if (typeof(filename) != 'undefined') this.src = filename;
+            if (this.srcReplace(
+            
+            
             return this;
-        }
-        this.toSymbol = function(alias) {
+        },
+        toSymbol : function(alias) {
             if (typeof(alias) != 'undefined') {
                 this.alias = new String(alias);
             }
             return this;
-        }
-        this.toClass = function(alias) {
+        },
+        toClass : function(alias) {
             this.classLink = true;
             return this.toSymbol(alias);
-        }
-        this.toFile = function(file) {
+        },
+        toFile : function(file) {
             if (typeof(file) != 'undefined') this.file = file;
             return this;
-        }
+        },
         
-        this.toString = function() {
+        toString : function() {
             var linkString;
             var thisLink = this;
 
@@ -78,10 +92,13 @@ Link = XObject.define(
             }
 
             return linkString;
-        }
-    }, 
-    Object,
-    {
+        },
+        
+        
+        
+        
+        
+        
         
         /** Create a link to a snother symbol. */
         _makeSymbolLink : function(alias) {