Bug 406492 Accept title and text as arguments while creating permission manager dialog p=asrail (Caio Tiago Oliveira) r=IanN sr=me

This commit is contained in:
neil%parkwaycc.co.uk 2008-01-13 21:22:01 +00:00
Родитель 9d7c695387
Коммит c78f5d9579
1 изменённых файлов: 14 добавлений и 8 удалений

Просмотреть файл

@ -76,6 +76,8 @@ var permissionType = "popup";
var permissionsBundle;
function Startup() {
var introText, windowTitle;
permissionManager = Components.classes["@mozilla.org/permissionmanager;1"]
.getService(nsIPermissionManager);
@ -87,17 +89,21 @@ function Startup() {
sortColumn = permissionsTree.getAttribute("sortColumn");
if (window.arguments && window.arguments[0]) {
document.getElementById("btnBlock").hidden = !window.arguments[0].blockVisible;
document.getElementById("btnSession").hidden = !window.arguments[0].sessionVisible;
document.getElementById("btnAllow").hidden = !window.arguments[0].allowVisible;
setHost(window.arguments[0].prefilledHost);
permissionType = window.arguments[0].permissionType;
var params = window.arguments[0];
document.getElementById("btnBlock").hidden = !params.blockVisible;
document.getElementById("btnSession").hidden = !params.sessionVisible;
document.getElementById("btnAllow").hidden = !params.allowVisible;
setHost(params.prefilledHost);
permissionType = params.permissionType;
introText = params.introText;
windowTitle = params.windowTitle;
}
var introString = permissionsBundle.getString(permissionType + "permissionstext");
document.getElementById("permissionsText").textContent = introString;
document.getElementById("permissionsText").textContent = introText ||
permissionsBundle.getString(permissionType + "permissionstext");
document.title = permissionsBundle.getString(permissionType + "permissionstitle");
document.title = windowTitle ||
permissionsBundle.getString(permissionType + "permissionstitle");
var dialogElement = document.getElementById("permissionsManager");
dialogElement.setAttribute("windowtype", "permissions-" + permissionType);