antville/code/SkinMgr/macros.js

43 lines
1.2 KiB
JavaScript
Raw Normal View History

2001-06-18 08:57:33 +00:00
/**
* macro renders filebased-skins as list
*/
function skins_macro(param) {
res.write(param.prefix)
2001-06-18 08:57:33 +00:00
for (var i in app.skinfiles) {
2001-07-01 18:20:46 +00:00
res.write("<b>" + i + "</b>");
2001-06-18 08:57:33 +00:00
for (var j in app.skinfiles[i]) {
2001-07-01 18:20:46 +00:00
res.write("<li>");
res.write("<a href=\"" + this.href() + "?proto=" + i + "&name=" + j + "\">");
2001-06-18 08:57:33 +00:00
res.write(j);
2001-07-01 18:20:46 +00:00
res.write("</a></li>");
2001-06-18 08:57:33 +00:00
}
2001-07-01 18:20:46 +00:00
res.write("<br>");
2001-06-18 08:57:33 +00:00
}
res.write(param.suffix);
2001-06-18 08:57:33 +00:00
}
/**
* macro calls a form-skin for editing a skin-source
*/
function skineditor_macro(param) {
res.write(param.prefix)
2001-06-18 08:57:33 +00:00
if (req.data.proto && req.data.name) {
// user wants to edit a skin, so we try to get it:
var currProto = this.__parent__.skinmanager.get(req.data.proto);
if (currProto && currProto.get(req.data.name)) {
var currSkin = currProto.get(req.data.name);
currSkin.renderSkin("edit");
} else {
var newSkin = new skin();
// since this is a new skin, we give it the source of the skinfile as default
newSkin.skin = app.skinfiles[req.data.proto][req.data.name];
2001-06-18 08:57:33 +00:00
newSkin.renderSkin("edit");
}
}
res.write(param.suffix);
}