function makeAlert(title, text, klass) { if(!klass) { klass = "alert-info"; } var wrap = $("
").addClass("col-md-12"); var al = $("
").addClass("alert") .addClass(klass) .html(text) .appendTo(wrap); $("
").prependTo(al); $("").text(title).prependTo(al); $("" + "" + "
"); form.append("
"); var dialog = chatDialog(div); close.click(function () { dialog.remove(); /* Implicit denial of script access */ cb("DENY"); }); $("#chanjs-allow").click(function () { var save = $("#chanjs-save-pref").is(":checked"); dialog.remove(); if (save) { JSPREF[CHANNEL.name.toLowerCase() + "_" + type] = "ALLOW"; setOpt("channel_js_pref", JSPREF); } cb("ALLOW"); }); $("#chanjs-deny").click(function () { var save = $("#chanjs-save-pref").is(":checked"); dialog.remove(); if (save) { JSPREF[CHANNEL.name.toLowerCase() + "_" + type] = "DENY"; setOpt("channel_js_pref", JSPREF); } cb("DENY"); }); } } function formatScriptAccessPrefs() { var tbl = $("#us-scriptcontrol table"); tbl.find("tbody").remove(); var channels = Object.keys(JSPREF).sort(); channels.forEach(function (channel) { var parts = channel.split("_"); if (!parts[1].match(/^(external|embedded)$/)) { return; } var pref = JSPREF[channel]; var tr = $("").appendTo(tbl); $("").text(parts[0]).appendTo(tr); $("").text(parts[1]).appendTo(tr); var pref_td = $("").appendTo(tr); var allow_label = $("