I am using the <<popup>> custom macro and I would like to know how to give it a maximum size. Currently, many passages do not look very good when displayed inside a popup; any way to make sure it cannot take up more than maybe 60% of the screen in either direction?
Code for <<popup>> macro:
Macro.add("popup", {
version : { major: 1, minor: 0, revision: 0 },
handler : function () {
if (this.args.length < 2) {
var errors = [];
if (this.args.length < 1) { errors.push("link text"); }
if (this.args.length < 2) { errors.push("passage name"); }
return this.error("no " + errors.join(" or ") + " specified");
}
var el = document.createElement("a"),
passage = this.args[1],
title;
el.innerHTML = this.args[0];
el.className = "link-internal macro-popup";
el.setAttribute("data-passage", passage);
title = el.textContent;
UI.addClickHandler(el, null, function (evt) {
var dialog = UI.setup(title, "popup");
new Wikifier(dialog, tale.get(passage).processText().trim());
});
this.output.appendChild(el);
}
});