2002-11-21 18:36:03 +00:00
|
|
|
|
2002-03-11 13:49:50 +00:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2002-11-21 18:36:03 +00:00
|
|
|
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-11-22 11:39:11 +00:00
|
|
|
|
2002-11-21 18:36:03 +00:00
|
|
|
function headline_macro (param) {
|
|
|
|
var p = this.getParentElement ();
|
|
|
|
var handler = (p!=null) ? p.getName () : "";
|
|
|
|
if (this.getType () == this.ACTION) {
|
|
|
|
res.write ("/" + this.getName ());
|
|
|
|
} else if (this.getType () == this.FUNCTION) {
|
|
|
|
if (handler!="" && handler!="global")
|
|
|
|
res.write (handler + ".");
|
|
|
|
res.write (this.getName () + " (");
|
|
|
|
var arr = this.listParameters ();
|
|
|
|
for (var i=0; i<arr.length; i++) {
|
|
|
|
res.write (arr[i]);
|
|
|
|
if (i<arr.length-1) {
|
|
|
|
res.write (", ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
res.write (")");
|
|
|
|
} else if (this.getType () == this.MACRO) {
|
|
|
|
res.write ("<% ");
|
|
|
|
if (handler!="" && handler!="global")
|
|
|
|
res.write (handler + ".");
|
|
|
|
var name = this.getName ();
|
|
|
|
if (name.indexOf("_macro")>-1)
|
|
|
|
name = name.substring (0, name.length-6);
|
|
|
|
res.write (name);
|
|
|
|
res.write (" %>");
|
|
|
|
} else if (this.getType () == this.SKIN) {
|
|
|
|
if (handler!="" && handler!="global")
|
|
|
|
res.write (handler + "/");
|
|
|
|
res.write (this.getName ());
|
|
|
|
res.write (".skin");
|
|
|
|
}
|
2002-03-11 13:49:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-11-21 18:36:03 +00:00
|
|
|
function skinparameters_macro (param) {
|
|
|
|
if (this.getType () == this.SKIN) {
|
|
|
|
this.parameters_macro (param);
|
2002-03-11 13:49:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-11-21 18:36:03 +00:00
|
|
|
function parameters_macro (param) {
|
|
|
|
var separator = (param.separator) ? param.separator : ", ";
|
|
|
|
var arr = this.listParameters ();
|
|
|
|
for (var i=0; i<arr.length ;i++) {
|
|
|
|
res.write (arr[i]);
|
|
|
|
if (i<arr.length-1)
|
|
|
|
res.write (separator);
|
2002-03-11 13:49:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-11-22 11:39:11 +00:00
|
|
|
function type_macro (param) {
|
|
|
|
return this.getTypeName ();
|
|
|
|
}
|
2002-03-11 13:49:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* macro returning nicely formatted sourcecode of this method.
|
|
|
|
* code is encoded, >% %<-tags are colorcoded, line numbers are added
|
|
|
|
*/
|
|
|
|
function source_macro(par) {
|
2002-11-21 18:36:03 +00:00
|
|
|
var str = this.getContent ();
|
2002-03-11 13:49:50 +00:00
|
|
|
var arr = str.split("<%");
|
|
|
|
var str2 = "";
|
|
|
|
for ( var i=0; i<arr.length; i++ ) {
|
|
|
|
str2 += encode(arr[i]);
|
|
|
|
if ( i<arr.length-1 )
|
|
|
|
str2 += '<font color="#aa3300"><%';
|
|
|
|
}
|
|
|
|
var arr = str2.split("%>");
|
|
|
|
var str3 = "";
|
|
|
|
for ( var i=0; i<arr.length; i++ ) {
|
|
|
|
str3 += arr[i];
|
|
|
|
if ( i<arr.length-1 )
|
|
|
|
str3 += '%></font>';
|
|
|
|
}
|
2002-06-20 17:20:38 +00:00
|
|
|
var arr = str3.split("<br />");
|
2002-03-11 13:49:50 +00:00
|
|
|
var str4 = "";
|
|
|
|
for ( var i=0; i<arr.length; i++ ) {
|
|
|
|
str4 += '<font color="#aaaaaa">' + (i+1) + ':</font> '
|
2002-11-21 18:36:03 +00:00
|
|
|
if (i<99) str4+=' ';
|
|
|
|
if (i<9) str4+=' ';
|
2003-11-06 15:09:36 +00:00
|
|
|
// Hack: remove leading returns/line feeds in each line
|
|
|
|
while (arr[i].length>0 &&
|
|
|
|
(arr[i][0] == '\n' || arr[i][0] == '\r'))
|
|
|
|
arr[i] = arr[i].substring(1);
|
|
|
|
str4 += arr[i] + "<br />";
|
2002-03-11 13:49:50 +00:00
|
|
|
}
|
|
|
|
return ( str4 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|