* Bring manage app up to date with current Helma.

This commit is contained in:
hns 2005-08-31 13:16:21 +00:00
parent c632c8f8bd
commit 437dfb94d3
33 changed files with 1185 additions and 1152 deletions

View file

@ -1,10 +1,10 @@
function main_action () {
if (checkAddress()==false)
return;
if (checkAuth()==false)
return;
res.data.body = this.renderSkinAsString ("main");
renderSkin ("api");
function main_action() {
if (checkAddress() == false)
return;
if (checkAuth() == false)
return;
res.data.body = this.renderSkinAsString("main");
renderSkin("api");
}

View file

@ -1,85 +1,97 @@
/**
* macro rendering a skin
* @param name name of skin
*/
function skin_macro(par) {
if ( par && par.name ) {
this.renderSkin(par.name);
}
* 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 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); }
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) {
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 (",&nbsp");
}
}
res.write (")");
} else if (this.getType () == this.MACRO) {
res.write ("&lt;%&nbsp;");
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 ("&nbsp;%&gt;");
} else if (this.getType () == this.SKIN) {
if (handler!="" && handler!="global")
res.write (handler + "/");
res.write (this.getName ());
res.write (".skin");
}
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() + "&nbsp;(");
var arr = this.listParameters();
for (var i = 0; i < arr.length; i++) {
res.write(arr[i]);
if (i < arr.length - 1) {
res.write(",&nbsp;");
}
}
res.write(")");
} else if (this.getType() == this.MACRO) {
res.write("&lt;%&nbsp;");
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("&nbsp;%&gt;");
} else if (this.getType() == this.SKIN) {
if (handler != "" && handler != "global")
res.write(handler + "/");
res.write(this.getName());
res.write(".skin");
} else if (this.getType() == this.PROPERTIES) {
res.write(this.getName());
}
}
function skinparameters_macro (param) {
if (this.getType () == this.SKIN) {
this.parameters_macro (param);
}
function skinparameters_macro(param) {
if (this.getType() == this.SKIN) {
this.parameters_macro(param);
}
}
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);
}
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);
}
}
function type_macro (param) {
return this.getTypeName ();
function type_macro(param) {
return this.getTypeName();
}
@ -89,15 +101,15 @@ function type_macro (param) {
*/
function source_macro(param) {
var sourcecode = this.getContent();
if (param.as=="highlighted") {
if (param.as == "highlighted") {
sourcecode = encode(sourcecode);
// highlight macro tags
r = new RegExp("&lt;%","gim");
r = new RegExp("&lt;%", "gim");
sourcecode = sourcecode.replace(r, '<font color="#aa3300">&lt;%');
r = new RegExp("%&gt;","gim");
r = new RegExp("%&gt;", "gim");
sourcecode = sourcecode.replace(r, '%&gt;</font>');
// highlight js-comments
@ -113,24 +125,24 @@ function source_macro(param) {
}
// remove all CR and LF, just <br> remains
var r = new RegExp("[\\r\\n]","gm");
var r = new RegExp("[\\r\\n]", "gm");
sourcecode = sourcecode.replace(r, "");
var arr = sourcecode.split("<br />");
for (var i=0; i<arr.length; i++) {
res.write('<font color="#aaaaaa">' + (i+1) + ':</font> ');
if (i<99) {
res.write(' ');
}
if (i<9) {
res.write(' ');
}
res.write(arr[i] + "\n");
}
var arr = sourcecode.split("<br />");
for (var i = 0; i < arr.length; i++) {
res.write('<font color="#aaaaaa">' + (i + 1) + ':</font> ');
if (i < 99) {
res.write(' ');
}
if (i < 9) {
res.write(' ');
}
res.write(arr[i] + "\n");
}
} else {
res.write(sourcecode);
}
} else {
res.write(sourcecode);
}
}