PK
Y8 defaults/PK
Y8 defaults/preferences/PK
|68 ) defaults/preferences/controledescripts.jspref("extensions.{75e19832-90c0-4553-91a0-e5d0ac5d99fd}.description", "chrome://controledescripts/locale/controledescripts.properties");
pref("extensions.controledescripts.shortcut.enabled", true);
pref("extensions.controledescripts.shortcut.key", "M");
pref("extensions.controledescripts.shortcut.modifiers", "accel,shift");
pref("extensions.controledescripts.showIcons", true);
pref("extensions.controledescripts.showMenuitem.context", true);
pref("extensions.controledescripts.showMenuitem.tools", true);
PK
8(~r chrome.manifestoverlay chrome://browser/content/preferences/preferences.xul chrome://controledescripts/content/overlay/fx.xul
overlay chrome://browser/content/browser.xul chrome://controledescripts/content/overlay/geral.xul
style chrome://global/content/customizeToolbar.xul chrome://controledescripts/skin/overlay.css
content controledescripts jar:chrome/controledescripts.jar!/content/
skin controledescripts classic/1.0 jar:chrome/controledescripts.jar!/skin/classic/
locale controledescripts de-DE jar:chrome/controledescripts.jar!/locale/de-DE/
locale controledescripts en-US jar:chrome/controledescripts.jar!/locale/en-US/
locale controledescripts es-AR jar:chrome/controledescripts.jar!/locale/es-AR/
locale controledescripts es-ES jar:chrome/controledescripts.jar!/locale/es-ES/
locale controledescripts fi-FI jar:chrome/controledescripts.jar!/locale/fi-FI/
locale controledescripts fr-FR jar:chrome/controledescripts.jar!/locale/fr-FR/
locale controledescripts it-IT jar:chrome/controledescripts.jar!/locale/it-IT/
locale controledescripts nl-NL jar:chrome/controledescripts.jar!/locale/nl-NL/
locale controledescripts pl-PL jar:chrome/controledescripts.jar!/locale/pl-PL/
locale controledescripts pt-BR jar:chrome/controledescripts.jar!/locale/pt-BR/
locale controledescripts zh-CN jar:chrome/controledescripts.jar!/locale/zh-CN/
locale controledescripts zh-TW jar:chrome/controledescripts.jar!/locale/zh-TW/
PK
+8*l@aG G
install.js/*
* XPInstall script by Fernando Pereira Silveira
* Feel free to copy/modify this script!
*
* This install script can deny extension updates, if you decide so. In case you
* set it to deny extension updates, don't forget to customize the error message
* located on lines 63 and 64.
*
* If you have any doubt, send it to fernandopsilveira@yahoo.com.br
*
*/
// --- EDITABLE DATA BEGIN ---
const displayName = "Controle de Scripts";
const name = "controledescripts";
const version = "1.0.3";
const package = "/fps/controledescripts";
const skins = ["classic", "modern"];
const locales = ["en-US", "de-DE", "es-AR", "es-ES", "fi-FI", "fr-FR", "it-IT",
"nl-NL", "pl-PL", "pt-BR", "zh-CN", "zh-TW"];
const preferenceFilesPath = "defaults/preferences";
const jarName = "controledescripts.jar";
const jarHasSubfolder = false;
const allowUpdate = true;
const silentInstall = false;
var profileInstall = true;
// --- EDITABLE DATA END -----
// *** Auxiliar data ***
const appFolder = getFolder("Chrome");
const profileFolder = getFolder("Profile", "chrome");
const appUpdate = File.exists(getFolder(appFolder, jarName));
const profileUpdate = File.exists(getFolder(profileFolder, jarName));
const jarSubfolder = jarHasSubfolder ? name+"/" : "";
var chromeType = null;
var installFolder = null;
var jarFile = null;
// *** Auxiliar routines ***
if (silentInstall) logComment("silent install mode");
if (appUpdate || profileUpdate) {
if (allowUpdate) {
profileInstall = profileUpdate;
logComment("previous version detected: updating "+(profileInstall ? "user profile" : "app folder"));
if (!silentInstall)
alert("Updating "+displayName+" to version "+version+" on "+(profileInstall ? "user profile" : "application folder")+".");
setEnvironment();
doInstall();
}
else {
if (!silentInstall)
alert("Cannot install "+displayName+" "+version+". Please uninstall your previous version first.\n"
+ "(If you don't know how to uninstall it, visit controledescripts.mozdev.org/help/)");
logComment("cancelling install: extension update denied");
cancelInstall();
}
}
else {
if (!silentInstall)
profileInstall = confirm("Do you want to install "+displayName+" "+version+" just for this profile?\n"
+ "Cancel will install it globally (all profiles).\n\n"
+ "(If you don't know what does this mean, click OK)");
setEnvironment();
doInstall();
}
// *** Installer ***
function setEnvironment() {
chromeType = profileInstall ? PROFILE_CHROME : DELAYED_CHROME;
installFolder = profileInstall ? profileFolder : appFolder;
jarFile = getFolder(installFolder, jarName);
}
function doInstall() {
var error;
// Begin install
error = initInstall(displayName, package, version);
logComment("installing to "+(profileInstall ? "user profile" : "app folder")+": "+installFolder);
logComment("initInstall: "+error);
// Copy JAR file
if (error == SUCCESS) {
error = addFile("package", version, "chrome/"+jarName, installFolder, null);
logComment("addFile() for JAR package returned: "+error);
}
// Copy preferences files
if (error == SUCCESS && preferenceFilesPath) {
error = addDirectory("preferences", version, preferenceFilesPath, getFolder("Program","defaults/pref/"), null);
logComment("addDirectory() for Defaults returned: "+error);
}
if (error == SUCCESS) {
// Register content
registerChrome(CONTENT | chromeType, jarFile, "content/"+jarSubfolder);
// Register locales
for (thisOne in locales)
registerChrome(LOCALE | chromeType, jarFile, "locale/"+locales[thisOne]+"/"+jarSubfolder);
// Register skins
for (var thisOne in skins)
registerChrome(SKIN | chromeType, jarFile, "skin/"+skins[thisOne]+"/"+jarSubfolder);
// Finish install
error = performInstall();
logComment("performInstall() returned: "+error);
if (!silentInstall)
alert((error == SUCCESS || error == REBOOT_NEEDED) ? displayName+" "+version+" has been"+(profileInstall ? "" : " globally")+" installed successfully!"+(error == REBOOT_NEEDED ? "\nRestart SeaMonkey to complete the process." : "") : "Failed to install "+displayName+"!\n\nPlease, contact the author and inform the following error code: "+error+"x1.");
}
else {
if (!silentInstall) {
var msg = "Couldn't install "+displayName+"!";
switch (error) {
case -202: msg += "\nCause: Access Denied. You probably have no write access to chrome."; break;
case -215: msg += "\nCause: Read-only. You probably have no write access to chrome."; break;
case -235: msg += "\nCause: Not enough disk space to install."; break;
case -299: msg += "\nCause: Insufficient memory for operation."; break;
default: msg += "\n\nPlease, contact the author and inform the following error code: "+error+"x0.";
}
alert(msg);
}
logComment("cancelInstall due to error: "+error);
cancelInstall(error);
}
}
PK
082~ install.rdf
Hugo Sena Ribeiro
Peter-Paul Koch (www.quirksmode.org)
efdur
de-DE - ReinekeFux (erweiterungen.de)
es-AR - acushnir
es-ES - chuzo (Proyecto Nave)
fi-FI - Akilles
fr-FR - Tibox
it-IT - MatrixIsAllOver
nl-NL - Alf
pl-PL - Wacław Jacek
zh-CN - fiag
zh-TW - winiah
PK
8 chrome/PK
8h h chrome/controledescripts.jarPK
[8 content/PK
SO80O;d
d
content/classes.jsfunction 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) {
var posicao = this.buscarPermissao(permissao.propriedade);
if (posicao >= 0)
this.editarPermissao(posicao, permissao);
else {
this.permissoes.push(permissao);
this.ordenarPermissoes();
}
return true;
}
return false;
},
buscarPermissao: function (propriedade) {
for (i in this.permissoes)
if (this.permissoes[i].propriedade == propriedade)
return parseInt(i);
return -1;
},
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.rdf
chrome://controledescripts/content/overlay/sm-navigator.xul
chrome://controledescripts/content/overlay/sm-scripts.xul
chrome://controledescripts/content/overlay/geral.xul
PK
[8 content/dialogs/PK
,7\N N content/dialogs/evento.xul
%controledescriptsDTD;
]>
PK
C8- - content/dialogs/permissao.jsvar controledescripts = {
iniciar: function () {
this.iniciarItens();
this.edicao = window.arguments[0].edicao;
this.nomePol = window.arguments[0].nomePol;
if (this.edicao) {
document.title = this.stringset.getString("controledescripts.editPermission");
this.propriedade.value = this.edicao.propriedade;
switch (this.edicao.status) {
case "sameOrigin": this.status.selectedIndex = 2; break;
case "allAccess": this.status.selectedIndex = 1; break;
default: this.status.selectedIndex = 0;
}
this.verificarAcesso(true);
}
else
document.title = this.stringset.getString("controledescripts.addPermission");
},
iniciarItens: function () {
this.acesso = document.getElementById("permissao-acesso");
this.propriedade = document.getElementById("permissao-propriedade");
this.status = document.getElementById("permissao-status");
this.stringset = document.getElementById("permissao-strings");
},
salvar: function () {
if (this.propriedade.value) {
if (this.edicao)
opener.CdS.editarPermissao(this.nomePol, {propriedade: this.propriedade.value, status: this.status.value});
else
opener.CdS.adicionarPermissao(this.nomePol, {propriedade: this.propriedade.value, status: this.status.value});
return true;
}
else {
alert(this.stringset.getString("controledescripts.emptyProperty"));
this.propriedade.focus();
return false;
}
},
selecionarAcesso: function () {
var novo = this.acesso.value;
var anterior = this.verificarAcesso(false);
if (novo != anterior)
switch (anterior) {
case ".get":
this.propriedade.value = this.propriedade.value.replace(/\.get$/, "");
this.propriedade.value += novo;
break;
case ".set":
this.propriedade.value = this.propriedade.value.replace(/\.set$/, "");
this.propriedade.value += novo;
break;
default:
this.propriedade.value += novo;
}
},
verificarAcesso: function (alterar) {
var sufixo = this.propriedade.value.substring(this.propriedade.value.length - 4, this.propriedade.value.length);
if (alterar)
switch (sufixo) {
case ".get": this.acesso.selectedIndex = 1; break;
case ".set": this.acesso.selectedIndex = 2; break;
default: this.acesso.selectedIndex = 0;
}
if (sufixo == ".get" || sufixo == ".set")
return sufixo;
return "";
}
}
PK
uu7Y7"( ( content/dialogs/permissao.xul
%controledescriptsDTD;
]>
PK
v7Ρx[ [ content/dialogs/politica.jsvar controledescripts = {
iniciar: function () {
this.iniciarItens();
this.renomear = window.arguments[0].renomear;
this.lista = window.arguments[0].lista;
this.nomeValido = true;
if (this.renomear) {
document.title = this.stringset.getString("controledescripts.renamePolicy");
this.rotulo.appendChild(document.createTextNode(this.stringset.getString("controledescripts.renameLabel")));
this.nome.value = decodeURIComponent(this.renomear);
}
else {
document.title = this.stringset.getString("controledescripts.newPolicy");
this.rotulo.appendChild(document.createTextNode(this.stringset.getString("controledescripts.newLabel")));
}
sizeToContent();
},
iniciarItens: function () {
this.alerta = document.getElementById("politica-alerta");
this.nome = document.getElementById("politica-nome");
this.rotulo = document.getElementById("politica-rotulo");
this.stringset = document.getElementById("politica-strings");
},
salvar: function () {
var nomeAlterado = this.renomear != encodeURIComponent(this.nome.value);
var nomeExiste = CdSUtil.obterPosicaoPol(encodeURIComponent(this.nome.value), this.lista) >= 0;
var valido = this.nome.value && this.nomeValido &&
this.nome.value.toLowerCase() != "default" &&
(!nomeExiste || !nomeAlterado);
if (valido) {
if (this.renomear) {
if (nomeAlterado)
opener.CdS.renomearPolitica(encodeURIComponent(this.nome.value));
}
else
opener.CdS.criarPolitica(encodeURIComponent(this.nome.value));
}
else if (!this.nome.value)
alert(this.stringset.getString("controledescripts.emptyName"));
else if (!this.nomeValido)
alert(this.stringset.getString("controledescripts.invalidName"));
else if (nomeExiste)
alert(this.stringset.getString("controledescripts.nameOnList"));
else
alert(this.stringset.getString("controledescripts.defaultName"));
this.nome.focus();
return valido;
},
verificarValidade: function () {
this.nomeValido =
this.alerta.hidden =
this.nome.value?/^[a-zA-Z]/.test(this.nome.value) && !/\.+/.test(this.nome.value):true;
sizeToContent();
}
}
PK
x}73ወ content/dialogs/politica.xul
%controledescriptsDTD;
]>
PK
}688 content/dialogs/sites.jsvar controledescripts = {
iniciar: function () {
this.iniciarItens();
this.nomeP = window.arguments[0].nomePol;
this.siteP = window.arguments[0].siteP;
this.sites = new Array();
if (window.arguments[0].sites)
this.sites = window.arguments[0].sites.split(" ");
document.title = this.stringset.getFormattedString("controledescripts.sitesTitle", [decodeURIComponent(this.nomeP)]);
if (this.siteP)
this.endereco.value = this.siteP;
this.carregarSites();
this.atualizarBotoes();
this.endereco.focus();
},
adicionarSite: function (protPadrao) {
var url = this.endereco.value.replace(/^\s+|\s+$/g,"");
if (!protPadrao)
protPadrao = "http://";
if (!/^\w+:$/.test(url)) {
if (/^\w+:\/+$/.test(url))
url = url.replace(/\/+/, "");
else {
if (!/^\w+:/.test(url))
url = protPadrao+url;
try {
var sES = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var uri = sES.newURI(url, null, null);
switch (uri.userPass || uri.scheme) {
case "file": url = "file:"; break;
default: url = uri.prePath;
}
}
catch (erro) {
var mensagem = null, titulo = null;
var sPrompt = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
if (CdSUtil.fx()) {
var stringset = document.getElementById("sites-strings-fx");
mensagem = stringset.getString("invalidURI");
titulo = stringset.getString("invalidURITitle");
}
else if (CdSUtil.sm()) {
var stringset = document.getElementById("sites-strings-sm");
mensagem = stringset.getFormattedString("alertInvalid", [url]);
titulo = stringset.getString("alertInvalidTitle");
}
sPrompt.alert(window, titulo, mensagem);
this.endereco.focus();
return;
}
}
}
if (url && CdSUtil.obterPosicao(url, this.sites) < 0) {
this.sites.push(url);
this.sites = this.sites.sort();
this.carregarSites();
}
this.endereco.value = "";
this.atualizarBotoes();
this.endereco.focus();
},
atualizarBotoes: function () {
if (this.endereco.value)
this.botaoAdicionar.disabled = false;
else
this.botaoAdicionar.disabled = true;
if (this.lista.selectedItem)
this.botaoExcluir.disabled = false;
else
this.botaoExcluir.disabled = true;
this.botaoExcluirtd.disabled = CdSUtil.listaEstaVazia(this.sites);
},
carregarSites: function () {
for (var i = this.lista.childNodes.length; i > 2; i--)
this.lista.removeChild(this.lista.lastChild);
for (i in this.sites)
this.lista.appendItem(this.sites[i]);
this.atualizarBotoes();
},
detectarTeclado: function (evento) {
if (evento.target.id == "sites-endereco" && (evento.keyCode == 13 || evento.keyCode == 10))
this.adicionarSite();
else if (evento.target.id == "sites-lista" && evento.keyCode == 46)
this.excluirSite();
},
excluirSite: function () {
if (this.lista.selectedItem) {
this.sites.splice(this.lista.selectedIndex, 1);
this.carregarSites();
}
},
excluirTd: function () {
this.sites = new Array();
this.carregarSites();
},
iniciarItens: function () {
this.endereco = document.getElementById("sites-endereco");
this.lista = document.getElementById("sites-lista");
this.botaoAdicionar = document.getElementById("sites-adicionar");
this.botaoExcluir = document.getElementById("sites-excluir");
this.botaoExcluirtd = document.getElementById("sites-excluirtd");
this.stringset = document.getElementById("sites-strings");
},
salvar: function () {
if (this.siteP) {
try {
opener.CdSEditarSites(this.nomeP, true, this.sites.join(" "));
return true;
}
catch (erro) {
dump("** CdS error: couldn't find opener window script\n\n");
}
return false;
}
else {
try {
opener.CdS.editarSites(this.nomeP, true, this.sites.join(" "));
return true;
}
catch (erro) {
dump("** CdS error: couldn't find opener window script\n\n");
}
return false;
}
}
}
PK
s7n' ' content/dialogs/sites.xul
%controledescriptsDTD;
]>
&sites.descricao;
PK
[8 content/icons/PK
66 content/icons/icone_16.pngPNG
IHDR a gAMA 7 tEXtSoftware Adobe ImageReadyqe<