tools/jsdoc-toolkit-2.4.0/app/frame/Link.js
function Link() {
	this.alias = "";
	this.src = "";
	this.file = "";
	this.text = "";
	this.innerName = "";
	this.classLink = false;
	this.targetName = "";
	
	this.target = function(targetName) {
		if (defined(targetName)) this.targetName = targetName;
		return this;
	}
	this.inner = function(inner) {
		if (defined(inner)) this.innerName = inner;
		return this;
	}
	this.withText = function(text) {
		if (defined(text)) this.text = text;
		return this;
	}
	this.toSrc = function(filename) {
		if (defined(filename)) this.src = filename;
		return this;
	}
	this.toSymbol = function(alias) {
		if (defined(alias)) this.alias = new String(alias);
		return this;
	}
	this.toClass = function(alias) {
		this.classLink = true;
		return this.toSymbol(alias);
	}
	this.toFile = function(file) {
		if (defined(file)) this.file = file;
		return this;
	}
	
	this.toString = function() {
		var linkString;
		var thisLink = this;

		if (this.alias) {
			linkString = this.alias.replace(/(^|[^a-z$0-9_#.:^-])([|a-z$0-9_#.:^-]+)($|[^a-z$0-9_#.:^-])/i,
				function(match, prematch, symbolName, postmatch) {
					var symbolNames = symbolName.split("|");
					var links = [];
					for (var i = 0, l = symbolNames.length; i < l; i++) {
						thisLink.alias = symbolNames[i];
						links.push(thisLink._makeSymbolLink(symbolNames[i]));
					}
					return prematch+links.join("|")+postmatch;
				}
			);
		}
		else if (this.src) {
			linkString = thisLink._makeSrcLink(this.src);
		}
		else if (this.file) {
			linkString = thisLink._makeFileLink(this.file);
		}

		return linkString;
	}
}
function Link() {
	this.alias = "";
	this.src = "";
	this.file = "";
	this.text = "";
	this.innerName = "";
	this.classLink = false;
	this.targetName = "";
	
	this.target = function(targetName) {
		if (defined(targetName)) this.targetName = targetName;
		return this;
	}
	this.inner = function(inner) {
		if (defined(inner)) this.innerName = inner;
		return this;
	}
	this.withText = function(text) {
		if (defined(text)) this.text = text;
		return this;
	}
	this.toSrc = function(filename) {
		if (defined(filename)) this.src = filename;
		return this;
	}
	this.toSymbol = function(alias) {
		if (defined(alias)) this.alias = new String(alias);
		return this;
	}
	this.toClass = function(alias) {
		this.classLink = true;
		return this.toSymbol(alias);
	}
	this.toFile = function(file) {
		if (defined(file)) this.file = file;
		return this;
	}
	
	this.toString = function() {
		var linkString;
		var thisLink = this;

		if (this.alias) {
			linkString = this.alias.replace(/(^|[^a-z$0-9_#.:^-])([|a-z$0-9_#.:^-]+)($|[^a-z$0-9_#.:^-])/i,
				function(match, prematch, symbolName, postmatch) {
					var symbolNames = symbolName.split("|");
					var links = [];
					for (var i = 0, l = symbolNames.length; i < l; i++) {
						thisLink.alias = symbolNames[i];
						links.push(thisLink._makeSymbolLink(symbolNames[i]));
					}
					return prematch+links.join("|")+postmatch;
				}
			);
		}
		else if (this.src) {
			linkString = thisLink._makeSrcLink(this.src);
		}
		else if (this.file) {
			linkString = thisLink._makeFileLink(this.file);
		}

		return linkString;
	}
}
function Link ( ) { this . alias = "" ; this . src = "" ; this . file = "" ; this . text = "" ; this . innerName = "" ; this . classLink = false ; this . targetName = "" ; this . target = function ( targetName ) { if ( defined ( targetName ) ) this . targetName = targetName ; return this ; } this . inner = function ( inner ) { if ( defined ( inner ) ) this . innerName = inner ; return this ; } this . withText = function ( text ) { if ( defined ( text ) ) this . text = text ; return this ; } this . toSrc = function ( filename ) { if ( defined ( filename ) ) this . src = filename ; return this ; } this . toSymbol = function ( alias ) { if ( defined ( alias ) ) this . alias = new String ( alias ) ; return this ; } this . toClass = function ( alias ) { this . classLink = true ; return this . toSymbol ( alias ) ; } this . toFile = function ( file ) { if ( defined ( file ) ) this . file = file ; return this ; } this . toString = function ( ) { var linkString ; var thisLink = this ; if ( this . alias ) { linkString = this . alias . replace ( / (^|[^a-z$0-9_#.:^-])([|a-z$0-9_#.:^-]+)($|[^a-z$0-9_#.:^-]) / i , function ( match , prematch , symbolName , postmatch ) { var symbolNames = symbolName . split ( "|" ) ; var links = [ ] ; for ( var i = 0 , l = symbolNames . length ; i < l ; i ++ ) { thisLink . alias = symbolNames [ i ] ; links . push ( thisLink . _makeSymbolLink ( symbolNames [ i ] ) ) ; } return prematch + links . join ( "|" ) + postmatch ; } ) ; } else if ( this . src ) { linkString = thisLink . _makeSrcLink ( this . src ) ; } else if ( this . file ) { linkString = thisLink . _makeFileLink ( this . file ) ; } return linkString ; } }
Handle the creation of HTML links to documented symbols.
@constructor
Handle the creation of HTML links to documented symbols .