I've worked out an answer. For anyone else wishing to prevent a dialog from being dismissable through clicking outside of it, here's what I did.
The main thing to focus on is the 'if/else' block in the first (JavaScript) code section. It toggles the user's ability to dismiss the popup by clicking outside of it.
JavaScript code:
Macro.add("popLink", { tags : null, handler: function()
{
var a = $("<a/>");
a.html(this.args[0]);
a.data("title", this.args[1]);
a.data("content", this.payload[0].contents);
a.data("undismissable", this.args[2]);
Dialog.addClickHandler(a, null, onPopLinkClicked);
$(this.output).append(a);
}});
function onPopLinkClicked(evt)
{
var $target = $(evt.target);
Dialog.setup($target.data("title"));
Dialog.wiki($target.data("content"));
if ($target.data("undismissable"))
{
$("#ui-overlay").removeClass("ui-close");
$("#ui-dialog").addClass("closeBlocked");
}
else
{
$("#ui-overlay").addClass("ui-close");
$("#ui-dialog").removeClass("closeBlocked");
}
}
Passage code:
<<popLink "Click me for normal dialog" "My title" false>><a onclick='SugarCube.Dialog.close();'>Close</a><</popLink>>
<<popLink "Click me for undismissable dialog" "My title" true>><a onclick='SugarCube.Dialog.close();'>Close</a><</popLink>>