helma/DocApplication/macros.js

77 lines
2.1 KiB
JavaScript
Raw Normal View History

/**
* macro rendering a skin
* @param name name of skin
*/
function skin_macro(par) {
if ( par && par.name ) {
this.renderSkin(par.name);
}
}
/**
* macro-wrapper for href-function
* @param action name of action to call on this prototype, default 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
2002-03-11 14:46:30 +00:00
function headline_macro (param) {
res.write (this.getName ());
2002-03-11 14:46:30 +00:00
}
function hrefRoot_macro (param) {
var obj = this.getChildElement ("prototype_root");
if (obj!=null) {
var action = (param.action) ? param.action : "main";
return obj.href (action);
}
}
/**
* list all prototypes of this application
* @param skin name of skin to render on prototype
*/
function prototypes_macro(par) {
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);
// }
//}