-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from jonatasrs/next
Next
- Loading branch information
Showing
39 changed files
with
6,683 additions
and
435 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
function AdicionarIdentificadorSeipp(BaseName) { | ||
function AdicionarIdentificadorSeipp (BaseName) { | ||
/** inicialização do módulo */ | ||
var mconsole = new __mconsole(BaseName + ".AdicionarIdentificadorSeipp"); | ||
const mconsole = new __mconsole(BaseName + '.AdicionarIdentificadorSeipp2') | ||
|
||
/* Adiciona o indentificador ++ no logo do SEI */ | ||
$("#divInfraBarraSistemaE").append("<div id='seipp'>++</div>"); | ||
/* Adiciona o identificador ++ no logo do SEI */ | ||
console.log(seiVersion); | ||
const idLogo = seiVersion >= [4, 0, 0] ? '#divInfraBarraSistemaPadraoE' : '#divInfraBarraSistemaE' | ||
$(idLogo).append('<div id="seipp">++</div>') | ||
|
||
if (!isChrome) { | ||
browser.storage.local.get("version").then(function (params) { | ||
var version = parseInt(params.version); | ||
browser.storage.local.get('version').then(function (params) { | ||
const version = parseInt(params.version) | ||
mconsole.log(version) | ||
if (version < 68) { | ||
$("#seipp").attr("title", "Firefox " + version + " - Você está utilizando uma versão antiga do Firefox, não compativel com alguns recursos do SEI++") | ||
.css({ "font-weight": "bold", "color": "red", "filter": "none", "background-color": "black" }); | ||
$('#seipp').attr('title', 'Firefox ' + version + ' - Você está utilizando uma versão antiga do Firefox, não compativel com alguns recursos do SEI++') | ||
.css({ 'font-weight': 'bold', color: 'red', filter: 'none', 'background-color': 'black' }) | ||
} | ||
}, null); | ||
}, null) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,72 @@ | ||
function VerificarBlocoAssinatura(BaseName) { | ||
function VerificarBlocoAssinatura (BaseName) { | ||
/** inicialização do módulo */ | ||
var mconsole = new __mconsole(BaseName + ".VerificarBlocoAssinatura"); | ||
const mconsole = new __mconsole(BaseName + '.VerificarBlocoAssinatura') | ||
|
||
var bloco = localizaItemBloco(); //obtem o elemento html para o bloco de assinaturas | ||
if (bloco == undefined) return; //FIX BUG: Caso não exista o menu, retorna. | ||
var link = bloco.find("a").attr("href"); //link com hash | ||
var xmlhttpr = $.get(GetBaseUrl() + link, parseResult); | ||
const bloco = localizaItemBloco() // obtem o elemento html para o bloco de assinaturas | ||
if (bloco == undefined) return // FIX BUG: Caso não exista o menu, retorna. | ||
const link = bloco.find('a').attr('href') // link com hash | ||
const xmlhttpr = $.get(GetBaseUrl() + link, parseResult) | ||
|
||
/***Verifica a existência de blocos de assinatura e altera a cor do texto no menu, caso exista*/ | ||
function localizaItemBloco() { | ||
var element; | ||
$("#main-menu li").each(function (index) { if ($(this).text().indexOf("Assinatura") != -1) element = $(this); }); | ||
return element; | ||
/** *Verifica a existência de blocos de assinatura e altera a cor do texto no menu, caso exista */ | ||
function localizaItemBloco () { | ||
let element | ||
const menu = (seiVersion >= [4, 0, 0]) ? '#infraMenu li' : '#main-menu li' | ||
$(menu).each(function (index) { if ($(this).text().indexOf('Assinatura') !== -1) element = $(this) }) | ||
return element | ||
} | ||
function parseResult(data) { | ||
var htmldata = $($.parseHTML(data)); | ||
var tabela = $(htmldata).find("#divInfraAreaTabela > table > tbody > tr"); | ||
//console.log(tabela); | ||
var numAbertos = 0; | ||
var numDispPelaArea = 0; | ||
var numDispParaArea = 0; | ||
var numRetornado = 0; | ||
var html = ""; | ||
var numBlocos = tabela.length; //quantidade de linhas da tabela (zero, caso não tenha blocos, numero de blocos + 1 caso tenha) | ||
if (numBlocos != 0) | ||
numBlocos--; //não conta a linha de cabeçalho | ||
function parseResult (data) { | ||
const htmldata = $($.parseHTML(data)) | ||
const tabela = $(htmldata).find('#divInfraAreaTabela > table > tbody > tr') | ||
|
||
let numAbertos = 0 | ||
let numDispPelaArea = 0 | ||
let numDispParaArea = 0 | ||
let numRetornado = 0 | ||
let html = '' | ||
let numBlocos = tabela.length // quantidade de linhas da tabela (zero, caso não tenha blocos, numero de blocos + 1 caso tenha) | ||
if (numBlocos !== 0) { numBlocos-- } // não conta a linha de cabeçalho | ||
|
||
const indexRowEstado = seiVersion >= [4, 0, 0] ? 4 : 2 | ||
const indexRowDisponibilizacao = seiVersion >= [4, 0, 0] ? 6 : 4 | ||
|
||
tabela.each(function (index) { | ||
if (index > 0) { //desconsidera a linha do cabeçalho (index == 0 ) | ||
var tipo = $(this).contents().get(2).innerHTML; | ||
if (tipo == 'Disponibilizado') { | ||
var areaDisp = $(this).contents().get(4).innerHTML; //se disponibilizado, verifica a Unidade de disponibilização. | ||
if (areaDisp != '') { //se não estiver em branco, significa disponibilizado pela minha área | ||
numDispPelaArea++; | ||
} | ||
else | ||
numDispParaArea++; //disponibilizado para a minha área | ||
if (index > 0) { // desconsidera a linha do cabeçalho (index == 0 ) | ||
const tipo = $(this).children().get(indexRowEstado).innerHTML | ||
if (tipo === 'Disponibilizado') { | ||
const areaDisp = $(this).children().get(indexRowDisponibilizacao).innerHTML // se disponibilizado, verifica a Unidade de disponibilização. | ||
if (areaDisp !== '') { // se não estiver em branco, significa disponibilizado pela minha área | ||
numDispPelaArea++ | ||
} else { numDispParaArea++ } // disponibilizado para a minha área | ||
} else if (['Aberto', 'Gerado'].includes(tipo)) { | ||
numAbertos++ | ||
} else if (tipo === 'Retornado') { | ||
numRetornado++ | ||
} else if (tipo === 'Recebido') { | ||
// Situação da versão 4.0.0 | ||
numDispParaArea++ | ||
} | ||
else if (tipo == 'Aberto') { | ||
numAbertos++; | ||
} | ||
else | ||
numRetornado++; | ||
} | ||
}); | ||
}) | ||
|
||
if (numBlocos > 0) { | ||
if (numDispParaArea > 0) { | ||
html = "<img src=" + browser.extension.getURL("icons/iconRed.png") + " title='Blocos disponibilizados para minha área: " + numDispParaArea + "'>"; | ||
html = '<img src=' + browser.extension.getURL('icons/iconRed.png') + " title='Blocos disponibilizados para minha área: " + numDispParaArea + "'>" | ||
} | ||
if (numDispPelaArea > 0) { | ||
html += "<img src=" + browser.extension.getURL("icons/iconBlue.png") + " title='Blocos disponibilizados pela minha área: " + numDispPelaArea + "'>"; | ||
html += '<img src=' + browser.extension.getURL('icons/iconBlue.png') + " title='Blocos disponibilizados pela minha área: " + numDispPelaArea + "'>" | ||
} | ||
if (numRetornado > 0) { | ||
html += "<img src=" + browser.extension.getURL("icons/iconGreen.png") + " title='Blocos retornados: " + numRetornado + "'>"; | ||
html += '<img src=' + browser.extension.getURL('icons/iconGreen.png') + " title='Blocos retornados: " + numRetornado + "'>" | ||
} | ||
if (numAbertos > 0) { | ||
html += "<img src=" + browser.extension.getURL("icons/iconYellow.png") + " title='Blocos abertos: " + numAbertos + "'>"; | ||
html += '<img src=' + browser.extension.getURL('icons/iconYellow.png') + " title='Blocos abertos: " + numAbertos + "'>" | ||
} | ||
localizaItemBloco().find("a").html("<b> Blocos de Assinatura </b>" + html); | ||
localizaItemBloco().find("a").attr("class", "seipp-assinatura"); | ||
if (SavedOptions.CheckTypes.indexOf("menususp") != -1) $("#divInfraBarraSistemaE").append(" ").append($(html)); | ||
|
||
localizaItemBloco().find('a').html('<b> Blocos de Assinatura </b>' + html) | ||
localizaItemBloco().find('a').attr('class', 'seipp-assinatura') | ||
$('#seipp').append( | ||
$('<a>').attr('href', link).append($(html)) | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.