major overhaul of the manage app's api-documentation functions.

things can now be rendered to static html, new helma features are
supported (prototype extension), everyhting is done in a nice and
clean way with skins.
This commit is contained in:
stefanp 2002-11-21 18:36:03 +00:00
parent 76bbe4053b
commit 7633e98eea
59 changed files with 1052 additions and 578 deletions

View file

@ -1,3 +1,4 @@
/**
* macro rendering a skin
* @param name name of skin
@ -8,43 +9,33 @@ function skin_macro(par) {
}
}
/**
* macro-wrapper for href-function
* @param action name of action to call on this prototype, default main
*/
function href_macro(par) {
return this.href( (par&&par.action)?par.action:"main" );
function href_macro(param) { return this.href ((param && param.action) ? param.action : "main"); }
function comment_macro (param) { return renderComment (this, param); }
function content_macro (param) { return this.getContent (); }
function tags_macro (param) { return renderTags (this, param); }
function location_macro (param) { return renderLocation (this, param); }
function link_macro (param) { return renderLink (this, param); }
//// END OF COPIED FUNCTIONS
function headline_macro (param) {
res.write (this.getName ());
}
/**
* macro rendering page head
*/
function head_macro(par) {
var obj = new Object();
obj.path = this.getPath();
this.renderSkin("head",obj);
}
/**
* utility function for head_macro, rendering link to app
*/
function getPath() {
return( '<a href="' + this.href("main") + '">' + this.name + '</a>' );
}
/**
* link to the "real" application object (ie not the DocApplication)
*/
function parentlink_macro(par) {
var url = getProperty("baseURI");
url = (url==null || url=="null") ? "" : url;
url += this.name + "/";
url += (par&&par.action)?par.action:"main";
return url;
function hrefRoot_macro (param) {
var obj = this.getChildElement ("prototype_root");
if (obj!=null) {
var action = (param.action) ? param.action : "main";
return obj.href (action);
}
}
@ -53,40 +44,33 @@ function parentlink_macro(par) {
* @param skin name of skin to render on prototype
*/
function prototypes_macro(par) {
var skin = (par && par.skin&&par.skin!="")?par.skin:"appList";
var arr = this.listPrototypes();
var skin = (par && par.skin&&par.skin!="") ? par.skin : "asPrototypeList";
var arr = this.listChildren ();
for ( var i=0; i<arr.length; i++ ) {
arr[i].renderSkin(skin);
}
}
/**
* list all methods of all prototypes, sort and separate them alphabetically
* @param skin name of skin to render on method
* @param skinSeparator name of skin to render separator between start-letters
*/
function index_macro(par) {
var skin = (par && par.skin && par.skin!="") ? par.skin : "indexList";
var skinSeparator = (par && par.skinSeparator && par.skinSeparator!="") ? par.skinSeparator : "indexListSeparator";
var arr = this.listFunctions();
var lastLetter = '';
for ( var i=0; i<arr.length; i++ ) {
if ( arr[i].name.substring(0,1)!=lastLetter ) {
lastLetter = arr[i].name.substring(0,1);
var obj = new Object();
obj.letter = lastLetter.toUpperCase();
arr[i].renderSkin(skinSeparator,obj);
}
arr[i].renderSkin(skin);
}
}
///**
// * list all methods of all prototypes, sort and separate them alphabetically
// * @param skin name of skin to render on method
// * @param skinSeparator name of skin to render separator between start-letters
// */
//function index_macro(par) {
// var skin = (par && par.skin && par.skin!="") ? par.skin : "indexList";
// var skinSeparator = (par && par.skinSeparator && par.skinSeparator!="") ? par.skinSeparator : "indexListSeparator";
// var arr = this.listFunctions();
// var lastLetter = '';
// for ( var i=0; i<arr.length; i++ ) {
// if ( arr[i].name.substring(0,1)!=lastLetter ) {
// lastLetter = arr[i].name.substring(0,1);
// var obj = new Object();
// obj.letter = lastLetter.toUpperCase();
// arr[i].renderSkin(skinSeparator,obj);
// }
// arr[i].renderSkin(skin);
// }
//}
/**
* macro escaping the request-path, used for handing over redirect urls
*/
function requestpath_macro(par) {
res.write( escape(req.path) );
}