projects
/
gnome.introspection-doc-generator
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JsTemplate/Link.js
[gnome.introspection-doc-generator]
/
JsTemplate
/
Link.js
diff --git
a/JsTemplate/Link.js
b/JsTemplate/Link.js
index
383ee91
..
1eb9c34
100644
(file)
--- a/
JsTemplate/Link.js
+++ b/
JsTemplate/Link.js
@@
-38,7
+38,7
@@
Link = XObject.define(
*/
alias : "",
/**
*/
alias : "",
/**
- *
alias
{String} not sure?
+ *
src
{String} not sure?
*/
src : "",
file : "",
*/
src : "",
file : "",
@@
-82,11
+82,11
@@
Link = XObject.define(
},
toString : function() {
},
toString : function() {
- var linkString;
+
var thisLink = this;
if (this.alias) {
var thisLink = this;
if (this.alias) {
-
linkString =
this.alias.replace(/(^|[^a-z$0-9_#.:-])([|a-z$0-9_#.:-]+)($|[^a-z$0-9_#.:-])/i,
+
return
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 = [];
function(match, prematch, symbolName, postmatch) {
var symbolNames = symbolName.split("|");
var links = [];
@@
-98,14
+98,16
@@
Link = XObject.define(
}
);
}
}
);
}
- else if (this.src) {
- linkString = thisLink._makeSrcLink(this.src);
+ if (this.url) {
+ return thisLink._makeLink(this.url);
+ }
+ if (this.src) {
+ return thisLink._makeSrcLink(this.src);
}
}
-
else
if (this.file) {
-
linkString =
thisLink._makeFileLink(this.file);
+ if (this.file) {
+
return
thisLink._makeFileLink(this.file);
}
}
- return linkString;
},
},
@@
-115,8
+117,9
@@
Link = XObject.define(
/** Create a link to a snother symbol. */
/** Create a link to a snother symbol. */
- _makeSymbolLink : function(alias) {
-
+ _makeSymbolLink : function(alias)
+ {
+ //print(JSON.stringify(alias));
// look for '/' in alias..
if (/\//.test(alias)) {
var bits = alias.split('/');
// look for '/' in alias..
if (/\//.test(alias)) {
var bits = alias.split('/');
@@
-133,8
+136,9
@@
Link = XObject.define(
- var linkBase =
Link.base+ imports.JSDOC.BuildDocs.BuildDocs.symbolsDir
;
+ var linkBase =
'./'
;
var linkTo = Link.symbolSet.getSymbol(alias);
var linkTo = Link.symbolSet.getSymbol(alias);
+
var linkPath;
var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
var linkPath;
var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
@@
-158,11
+162,11
@@
Link = XObject.define(
if (!linkTo.is("CONSTRUCTOR") && !linkTo.isNamespace) { // it's a method or property
linkPath = escape(linkTo.memberOf) || "_global_";
if (!linkTo.is("CONSTRUCTOR") && !linkTo.isNamespace) { // it's a method or property
linkPath = escape(linkTo.memberOf) || "_global_";
- linkPath +=
imports.JSDOC.Options.Options.ext + "#"
+ Link.symbolNameToLinkName(linkTo);
+ linkPath +=
'.html#'
+ Link.symbolNameToLinkName(linkTo);
}
else {
linkPath = escape(linkTo.alias);
}
else {
linkPath = escape(linkTo.alias);
- linkPath +=
imports.JSDOC.Options.Options.ext
+ (this.classLink? "":"#" + Link.hashPrefix + "constructor");
+ linkPath +=
'.html'
+ (this.classLink? "":"#" + Link.hashPrefix + "constructor");
}
//linkPath = linkBase + linkPath;
fullLinkPath = linkBase + linkPath;
}
//linkPath = linkBase + linkPath;
fullLinkPath = linkBase + linkPath;
@@
-202,7
+206,16
@@
Link = XObject.define(
if (!this.text) this.text = filePath;
return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
if (!this.text) this.text = filePath;
return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
+ },
+
+ /** very basic link... */
+ _makeLink : function(url) {
+ var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
+
+ if (!this.text) this.text = url;
+ return "<a href=\""+url+"\""+target+">"+this.text+"</a>";
}
}
+
});
});