PK
l68 chrome/UT k7Gk7GUx PK
l688 chrome/controledescripts.jarUT k7Gk7GUx PK
v7 content/UT EGk7GUx PK
|68&O' ' content/classes.jsUT f*G NGUx function Arvore (itens) {
this.itens = itens;
}
function Politica (nome, sites, permissoes) {
this.nome = nome;
this.sites = sites ? sites : null;
this.permissoes = permissoes ? permissoes : new Array();
}
Arvore.prototype = {
QueryInterface: function (aIID) {
if (aIID.equals(Components.interfaces.nsITreeView) ||
aIID.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
},
getCellText: function (linha, coluna) {
var texto = null;
if (coluna.id == "avancado-propriedade")
texto = this.itens[linha].propriedade;
else
switch (this.itens[linha].status) {
case "noAccess": texto = CdS.stringset.getString("controledescripts.block");break;
case "allAccess": texto = CdS.stringset.getString("controledescripts.allow");break;
case "sameOrigin": texto = CdS.stringset.getString("controledescripts.sameOrigin");break;
}
return texto;
},
get rowCount() {return this.itens.length;},
cycleHeader: function(coluna) {},
getCellProperties: function(linha, coluna, props) {},
getColumnProperties: function(colid, coluna, props) {},
getImageSrc: function(linha, coluna) {return null;},
getLevel: function(linha) {return 0;},
getRowProperties: function(linha, props) {},
isContainer: function(linha) {return false;},
isSeparator: function(linha) {return false;},
isSorted: function() {return false;},
setTree: function(treebox) {this.treebox = treebox;}
}
Politica.prototype = {
adicionarPermissao: function (permissao) {
if (permissao) {
this.permissoes.push(permissao);
this.ordenarPermissoes();
return true;
}
return false;
},
editarPermissao: function (indice, permissao) {
if (permissao && indice >= 0 && indice <= this.permissoes.length) {
this.permissoes[indice] = permissao;
this.ordenarPermissoes();
return true;
}
return false;
},
ordenarPermissoes: function () {
var ordenador = function (a, b) {
if (a.propriedade > b.propriedade)
return 1;
else if (a.propriedade < b.propriedade)
return -1;
else
return 0;
}
this.permissoes.sort(ordenador);
},
removerPermissao: function (indice) {
this.permissoes.splice(indice, 1);
return true;
},
renomear: function (nomeNovo) {
if (nomeNovo) {
this.nome = nomeNovo;
return true;
}
return false;
}
}
PK
*8_Y content/contents.rdfUT FlG NGUx
chrome://controledescripts/content/overlay/sm-navigator.xul
chrome://controledescripts/content/overlay/sm-scripts.xul
chrome://controledescripts/content/overlay/geral.xul
PK
7]/ / content/prefs.xulUT fhXG NGUx
%controledescriptsDTD;
]>
PK
|68w7' content/util.jsUT 2*G NGUx var CdSUtil = {
sBranch: Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch),
sPreferencias: Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService),
mac: function() {return top.window.navigator.platform.toLowerCase().indexOf("mac") >= 0;},
flock: function() {return top.window.navigator.userAgent.toLowerCase().indexOf("flock") >= 0;},
iceape: function() {return top.window.navigator.userAgent.toLowerCase().indexOf("iceape") >= 0;},
iceweasel: function() {return top.window.navigator.userAgent.toLowerCase().indexOf("iceweasel") >= 0;},
netscape: function() {return top.window.navigator.userAgent.toLowerCase().indexOf("netscape") >= 0;},
fx: function() {return this.firefox() || this.iceweasel() || this.flock() || this.netscape();},
sm: function() {return this.seamonkey() || this.iceape();},
firefox: function () {
var release = top.window.navigator.userAgent.toLowerCase().indexOf("firefox") >= 0;
var nightly = top.window.navigator.userAgent.toLowerCase().indexOf("minefield") >= 0;
return (release || nightly) && !this.iceweasel() && !this.netscape() && !this.flock();
},
seamonkey: function () {
var release = top.window.navigator.userAgent.toLowerCase().indexOf("seamonkey") >= 0;
return release && !this.iceape();
},
abrirURL: function (url) {
var janela = null;
try {
var sJanelas = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
janela = sJanelas.getMostRecentWindow("navigator:browser");
}
catch(erro) {
dump("** CdS error: couldn't get Window Mediator:\n"+erro+"\n\n");
}
if (janela) {
janela.getBrowser().selectedTab = janela.getBrowser().addTab(url);
janela.focus();
}
else
openDialog(this.obterString("browser.chromeURL"), "_blank", "chrome,all,dialog=no", url, null, null);
},
existePreferencia: function (preferencia) {
return this.sBranch.prefHasUserValue(preferencia);
},
limparPreferencia: function (preferencia) {
if (this.existePreferencia(preferencia))
try {
this.sBranch.clearUserPref(preferencia);
return true;
}
catch(erro) {
dump("** CdS error: couldn't clear user pref \""+preferencia+"\"\n\n");
}
else
dump("** CdS error: no user pref found for \""+preferencia+"\"\n\n");
return false;
},
listaEstaVazia: function (lista) {
if (lista[0])
return false;
return true;
},
obterBooleana: function (preferencia, valorPadrao) {
try {
return this.sBranch.getBoolPref(preferencia);
}
catch(erro) {
dump("** CdS error: couldn't get bool pref \""+preferencia+"\"\n\n");
}
return valorPadrao != undefined ? valorPadrao : null;
},
obterInteiro: function (preferencia, valorPadrao) {
try {
return this.sBranch.getIntPref(preferencia);
}
catch(erro) {
dump("** CdS error: couldn't get int pref \""+preferencia+"\"\n\n");
}
return valorPadrao != undefined ? valorPadrao : null;
},
obterPosicao: function (elemento, lista) {
for (i in lista)
if (lista[i] == elemento)
return parseInt(i);
return -1;
},
obterPosicaoPol: function (politica, lista) {
for (i in lista)
if (lista[i].nome == politica)
return parseInt(i);
return -1;
},
obterString: function (preferencia, valorPadrao) {
try {
return this.sBranch.getComplexValue(preferencia, Components.interfaces.nsISupportsString).data;
}
catch(erro) {
dump("** CdS error: couldn't get string pref \""+preferencia+"\"\n\n");
}
return valorPadrao != undefined ? valorPadrao : null;
},
salvarBooleana: function (preferencia, valor) {
try {
this.sBranch.setBoolPref(preferencia, valor);
return true;
}
catch(erro) {
dump("** CdS error: couldn't set bool pref \""+preferencia+"\"\n\n");
}
return false;
},
salvarInteiro: function (preferencia, valor) {
try {
this.sBranch.setIntPref(preferencia, valor);
return true;
}
catch(erro) {
dump("** CdS error: couldn't set int pref \""+preferencia+"\"\n\n");
}
return false;
},
salvarString: function (preferencia, valor) {
try {
var str = Components.classes["@mozilla.org/supports-string;1"]
.createInstance(Components.interfaces.nsISupportsString);
str.data = valor;
this.sBranch.setComplexValue(preferencia, Components.interfaces.nsISupportsString, str);
return true;
}
catch(erro) {
dump("** CdS error: couldn't set string pref \""+preferencia+"\"\n\n");
}
return false;
}
}
PK
Pn7 content/overlay/UT n:Gk7GUx PK
%8E content/overlay/fx.xulUT G NGUx
%controledescriptsDTD;
]>
PK
$}685 content/overlay/geral.jsUT *G NGUx function CdSIniciar () {
var ferramentasFx = document.getElementById("menu_ToolsPopup");
var ferramentasSm = document.getElementById("taskPopup");
var contexto = document.getElementById("contentAreaContextMenu");
if (ferramentasFx)
ferramentasFx.addEventListener("popupshowing", CdSAtualizarMenu, false);
if (ferramentasSm)
ferramentasSm.addEventListener("popupshowing", CdSAtualizarMenu, false);
if (contexto)
contexto.addEventListener("popupshowing", CdSAtualizarMenu, false);
if (CdSUtil.obterBooleana("extensions.controledescripts.shortcut.enabled")) {
var key = document.createElement("key");
key.id = "key_openCdS";
key.setAttribute("command", "cmd_openCdS");
key.setAttribute("modifiers", CdSUtil.obterString("extensions.controledescripts.shortcut.modifiers"));
key.setAttribute("key", CdSUtil.obterString("extensions.controledescripts.shortcut.key"));
document.getElementById("controledescripts-keyset").appendChild(key);
}
CdSAtualizarPrefs(false);
CdSObservador.atualizarComando();
}
function CdSAbrirPrefs () {
var recursos = "centerscreen,chrome,resizable";
openDialog("chrome://controledescripts/content/prefs.xul", "controledescripts-prefs", recursos);
}
function CdSAtualizarBotao () {
var sep = document.getElementById("navegacao-sep");
var item = document.getElementById("navegacao-item");
var menu = document.getElementById("navegacao-menu");
var politicas = null;
if (CdSUtil.existePreferencia("capability.policy.policynames"))
politicas = CdSUtil.obterString("capability.policy.policynames");
if (politicas) {
item.setAttribute("class", "default");
sep.hidden = menu.hidden = false;
}
else {
item.removeAttribute("class");
sep.hidden = menu.hidden = true;
}
}
function CdSAtualizarIcone () {
var broadcaster = document.getElementById("brd_menuCdS");
var exibirIcone = CdSUtil.obterBooleana("extensions.controledescripts.showIcons");
broadcaster.setAttribute("class", (exibirIcone ? broadcaster.getAttribute("menuclass") : ""));
}
function CdSAtualizarMenu () {
var item = document.getElementById("ferramentas-item");
var menu = document.getElementById("ferramentas-menu");
var jsAtivado = CdSUtil.obterBooleana("javascript.enabled");
var exibirMenu = CdSUtil.obterBooleana("extensions.controledescripts.showMenuitem.tools");
var conteudoValido = true;
if (gContextMenu) {
item = document.getElementById("contexto-item");
menu = document.getElementById("contexto-menu");
exibirMenu = CdSUtil.obterBooleana("extensions.controledescripts.showMenuitem.context") && jsAtivado;
conteudoValido = !gContextMenu.onImage && !gContextMenu.onTextInput &&
!gContextMenu.isTextSelected && !gContextMenu.isContentSelected &&
!gContextMenu.onMathML && (!gContextMenu.onLink || gContextMenu.onSaveableLink);
}
if (exibirMenu && conteudoValido) {
var politicas = null;
if (CdSUtil.existePreferencia("capability.policy.policynames"))
politicas = CdSUtil.obterString("capability.policy.policynames");
if (politicas && jsAtivado) {
item.hidden = !(menu.hidden = false);
if (gContextMenu) {
document.getElementById("menu-site").hidden = gContextMenu.onSaveableLink;
document.getElementById("menu-link").hidden = !gContextMenu.onSaveableLink;
}
}
else
item.hidden = !(menu.hidden = true);
}
else
item.hidden = menu.hidden = true;
CdSAtualizarIcone();
}
function CdSAtualizarPrefs (manterCompatibilidade) {
if (CdSUtil.existePreferencia("controledescripts.ocultarmenu")) {
CdSUtil.salvarString("extensions.controledescripts.showMenuitem.tools", !CdSUtil.obterBooleana("controledescripts.ocultarmenu"));
if (!manterCompatibilidade)
CdSUtil.limparPreferencia("controledescripts.ocultarmenu");
}
if (CdSUtil.existePreferencia("controledescripts.exibiricones")) {
CdSUtil.salvarString("extensions.controledescripts.showIcons", CdSUtil.obterBooleana("controledescripts.exibiricones"));
if (!manterCompatibilidade)
CdSUtil.limparPreferencia("controledescripts.exibiricones");
}
}
function CdSEditarSites (nomePol, salvar, sites) {
if (salvar)
CdSUtil.salvarString("capability.policy."+nomePol+".sites", sites);
else {
var endereco = (gContextMenu && gContextMenu.onSaveableLink) ? gContextMenu.link.href : window._content.document.location.href;
var lista = CdSUtil.obterString("capability.policy."+nomePol+".sites");
openDialog("chrome://controledescripts/content/dialogs/sites.xul",
"controledescripts-sites", "chrome,centerscreen",
{nomePol: nomePol, sites: lista, siteP: endereco});
}
}
function CdSPreencherPoliticas (popup) {
var politicas = null;
if (CdSUtil.existePreferencia("capability.policy.policynames"))
politicas = CdSUtil.obterString("capability.policy.policynames");
if (politicas) {
var itens = popup.childNodes;
politicas = politicas.split(/\s|,/);
for (var i = itens.length; i > 0; i--)
popup.removeChild(popup.lastChild);
for (i in politicas) {
var menuitem = document.createElement("menuitem");
menuitem.setAttribute("label", decodeURIComponent(politicas[i]));
menuitem.setAttribute("oncommand", "CdSEditarSites('"+politicas[i]+"', false);");
popup.appendChild(menuitem);
}
}
}
function CdSSair () {
window.removeEventListener("load", CdSIniciar, false);
window.removeEventListener("unload", CdSSair, false);
CdSUtil.sBranch.QueryInterface(Components.interfaces.nsIPrefBranchInternal)
.removeObserver(CdSObservador.preferencia, CdSObservador);
}
var CdSObservador = {
preferencia: "javascript.enabled",
observe: function (assunto, topico, preferencia) {
if (topico == "nsPref:changed" && preferencia == this.preferencia)
this.atualizarComando();
},
atualizarComando: function () {
var comando = document.getElementById("cmd_openCdS");
if (CdSUtil.obterBooleana(this.preferencia))
comando.removeAttribute("disabled");
else
comando.setAttribute("disabled", true);
}
}
////////////////////////////////////////////////////////////////////////////////
window.addEventListener("load", CdSIniciar, false);
window.addEventListener("unload", CdSSair, false);
CdSUtil.sBranch.QueryInterface(Components.interfaces.nsIPrefBranchInternal)
.addObserver(CdSObservador.preferencia, CdSObservador, false);
PK
v74 content/overlay/geral.xulUT EG NGUx
%controledescriptsDTD;
]>
PK
0P7-UK> > content/overlay/sm-scripts.xulUT 6YG NGUx
%controledescriptsDTD;
]>
PK
µ(8YD content/overlay/sm-navigator.xulUT LG NGUx
%controledescriptsDTD;
]>
PK
Pn7 content/icons/UT n:Gk7GUx PK
66 content/icons/icone_16.pngUT H́F NGUx PNG
IHDR a gAMA 7 tEXtSoftware Adobe ImageReadyqe<