-
-
Notifications
You must be signed in to change notification settings - Fork 60
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 #161 from jonatasrs/fixs
Correções - Versão 5.1
- Loading branch information
Showing
32 changed files
with
506 additions
and
502 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
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,14 +1,16 @@ | ||
/* global SavedOptions, seiVersionCompare, novoDocumento */ | ||
/* global seiVersionCompare, novoDocumento */ | ||
const BaseName = 'arvore_visualizar' | ||
|
||
SavedOptions.CheckTypes.forEach(function (element) { | ||
switch (element) { | ||
case 'atalhonovodoc': | ||
if (seiVersionCompare('<', '4')) { | ||
novoDocumento(BaseName) | ||
} | ||
break | ||
default: | ||
break | ||
} | ||
}, this) | ||
ModuleInit(BaseName).then((options) => { | ||
options.CheckTypes.forEach(function (element) { | ||
switch (element) { | ||
case 'atalhonovodoc': | ||
if (seiVersionCompare('<', '4')) { | ||
novoDocumento(BaseName) | ||
} | ||
break | ||
default: | ||
break | ||
} | ||
}, this) | ||
}).catch(e => console.log(e.message)) |
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
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,24 +1,21 @@ | ||
/* global ModuleInit, GetBaseUrl, redirecionarPagina, seiVersionCompare, theme */ | ||
/** Roda quando a o carregamento do html termina */ | ||
const ModNameEnd = 'core.d_end' | ||
|
||
function mainModEnd () { | ||
Init(ModNameEnd) | ||
/** Pega a versão atual do SEI */ | ||
const seiVersion = getSeiVersion(ModNameEnd) | ||
|
||
ModuleInit(ModNameEnd).then((options) => { | ||
/** Redireciona para controle de processos */ | ||
if (window.location.href === GetBaseUrl()) { | ||
redirecionarPagina(ModName_start) | ||
redirecionarPagina(ModNameEnd) | ||
} | ||
|
||
if (SavedOptions.theme !== 'white') { | ||
if (SavedOptions.theme === 'super-black' && seiVersionCompare('>=', '4')) { | ||
theme(ModNameEnd, SavedOptions.theme) | ||
} else if (SavedOptions.theme === 'black' && seiVersionCompare('<', '4')) { | ||
theme(ModNameEnd, SavedOptions.theme) | ||
if (options.theme !== 'white') { | ||
if (options.theme === 'super-black' && seiVersionCompare('>=', '4')) { | ||
theme(ModNameEnd, options.theme) | ||
} else if (options.theme === 'black' && seiVersionCompare('<', '4')) { | ||
theme(ModNameEnd, options.theme) | ||
} | ||
} | ||
} | ||
|
||
/** Pega a versão atual do SEI */ | ||
const seiVersion = getSeiVersion(ModNameEnd) | ||
|
||
mainModEnd() | ||
}).catch(e => console.log(e.message)) |
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,46 @@ | ||
/* eslint-disable no-global-assign */ | ||
/* global seiVersionCompare, CompName, SavedOptions */ | ||
|
||
async function ModuleInit (BaseName, PageReload = false) { | ||
try { | ||
const storageData = await getLocalStorage() | ||
const defaultOptions = await loadDefaultOptions(storageData) | ||
|
||
const ModName = CompName + '.' + BaseName | ||
const IsModExec = $("head meta[name='" + ModName + "'").attr('value') | ||
|
||
if (seiVersionCompare('<', '3')) { | ||
throw new Error('SEI/SUPER não encontrado.') | ||
} | ||
if (IsModExec !== 'true') { | ||
$('head').append("<meta name='" + ModName + "' value='true'>") | ||
console.log('[' + CompName + ' ' + Date.now() + ']' + BaseName) | ||
return defaultOptions | ||
} else if (IsModExec === 'true' && PageReload) { | ||
window.location.assign(window.location.href) | ||
console.log('[' + CompName + ' ' + Date.now() + ']' + BaseName + 'Reload page') | ||
throw new Error('Reload page') | ||
} else { | ||
throw new Error('Not init') | ||
} | ||
} catch (e) { | ||
const message = `[${CompName} ${Date.now()}] ${BaseName} ${e.message}` | ||
throw new Error(message) | ||
} | ||
} | ||
|
||
async function loadDefaultOptions (storageData) { | ||
SavedOptions = { ...SavedOptions, ...storageData } | ||
return SavedOptions | ||
} | ||
|
||
function getLocalStorage (params = null) { | ||
return new Promise((resolve, reject) => { | ||
browser.storage.local.get(params, (storage) => { | ||
if (browser.runtime.lastError) { | ||
reject(browser.runtime.lastError) | ||
} | ||
resolve(storage) | ||
}) | ||
}) | ||
} |
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
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,47 +1,48 @@ | ||
/*** MENU SUSPENSO ************************************************************/ | ||
function MenuSuspenso(BaseName) { | ||
/* global __mconsole */ | ||
/** * MENU SUSPENSO ************************************************************/ | ||
function MenuSuspenso (BaseName) { | ||
/** inicialização do módulo */ | ||
var mconsole = new __mconsole(BaseName + ".MenuSuspenso"); | ||
const mconsole = new __mconsole(BaseName + '.MenuSuspenso') | ||
|
||
if ($("body").attr("onload").indexOf("infraMenuSistemaEsquema") != -1){ | ||
$("body").attr("onload", $("body").attr("onload") + "infraOcultarMenuSistemaEsquema();"); | ||
if ($('body').attr('onload').indexOf('infraMenuSistemaEsquema') !== -1) { | ||
$('body').attr('onload', $('body').attr('onload') + 'infraOcultarMenuSistemaEsquema();') | ||
} | ||
if (!$("#main-menu").length) return; | ||
$("#main-menu, #divInfraAreaTelaE").hide(); | ||
if (!$('#main-menu').length) return | ||
$('#main-menu, #divInfraAreaTelaE').hide() | ||
|
||
if ($("#lnkInfraMenuSistema").attr("title").indexOf("Ocultar") != -1) { | ||
$("#divInfraAreaTelaD").width("99%"); | ||
if ($('#lnkInfraMenuSistema').attr('title').indexOf('Ocultar') !== -1) { | ||
$('#divInfraAreaTelaD').width('99%') | ||
} | ||
/* Oculta o botao de exibir menu */ | ||
$("#lnkInfraMenuSistema").hide(); | ||
$("#divInfraAreaTelaE > div > p").hide(); | ||
$("#divInfraAreaTelaE > div > img").attr("title", $("#divInfraAreaTelaE > div > p").text()); | ||
$("#divInfraAreaTelaE > div > div").hide(); | ||
$('#lnkInfraMenuSistema').hide() | ||
$('#divInfraAreaTelaE > div > p').hide() | ||
$('#divInfraAreaTelaE > div > img').attr('title', $('#divInfraAreaTelaE > div > p').text()) | ||
$('#divInfraAreaTelaE > div > div').hide() | ||
|
||
$("#divInfraAreaTelaE").css({ | ||
"position": "absolute", | ||
"display": "block", | ||
"width": "auto", | ||
"background-color": "#d7d7d7" | ||
}); | ||
$('#divInfraAreaTelaE').css({ | ||
position: 'absolute', | ||
display: 'block', | ||
width: 'auto', | ||
'background-color': '#d7d7d7' | ||
}) | ||
|
||
$("#divInfraAreaTelaE > div").css({ "border-bottom": "5px solid" }).hide(); | ||
$('#divInfraAreaTelaE > div').css({ 'border-bottom': '5px solid' }).hide() | ||
|
||
$("#divInfraBarraSistemaE img").click(function (e) { | ||
e.stopPropagation(); /* impede a propagação do evento click */ | ||
if ($("#main-menu").attr("style") != undefined) { | ||
$("#main-menu").removeAttr("style"); | ||
$("#divInfraAreaTelaE").hide(); | ||
$('#divInfraBarraSistemaE img').click(function (e) { | ||
e.stopPropagation() /* impede a propagação do evento click */ | ||
if ($('#main-menu').attr('style') !== undefined) { | ||
$('#main-menu').removeAttr('style') | ||
$('#divInfraAreaTelaE').hide() | ||
} | ||
$("#divInfraAreaTelaE").toggle("fast"); | ||
$("#divInfraAreaTelaE > div").show(); | ||
}); | ||
$('#divInfraAreaTelaE').toggle('fast') | ||
$('#divInfraAreaTelaE > div').show() | ||
}) | ||
|
||
$("#divInfraAreaTelaE").addClass("seipp-menu"); | ||
$("#main-menu ul").addClass("seipp-menu"); | ||
$("#divInfraAreaTelaE *").click(function (e) { e.stopPropagation(); }) | ||
$('#divInfraAreaTelaE').addClass('seipp-menu') | ||
$('#main-menu ul').addClass('seipp-menu') | ||
$('#divInfraAreaTelaE *').click(function (e) { e.stopPropagation() }) | ||
/* Oculta o menu ao clicar fora */ | ||
$('body').click(function () { | ||
if (!$("#divInfraAreaTelaE").is(':hidden')) { $("#divInfraAreaTelaE").toggle("fast"); } | ||
}); | ||
if (!$('#divInfraAreaTelaE').is(':hidden')) { $('#divInfraAreaTelaE').toggle('fast') } | ||
}) | ||
} |
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,21 +1,22 @@ | ||
function PontoControleCores(BaseName) { | ||
/* global __mconsole, AdicionarLinkCss */ | ||
function PontoControleCores (BaseName) { | ||
/** inicialização do módulo */ | ||
var mconsole = new __mconsole(BaseName + ".PontoControleCores"); | ||
var AplicarNestasPaginas = [ | ||
"procedimento_visualizar", | ||
"procedimento_controlar" | ||
]; | ||
const mconsole = new __mconsole(BaseName + '.PontoControleCores') | ||
const AplicarNestasPaginas = [ | ||
'procedimento_visualizar', | ||
'procedimento_controlar' | ||
] | ||
|
||
if (AplicarLinkCss()) { | ||
mconsole.log(document.baseURI); | ||
AdicionarLinkCss(document, "seipp-pontocores-anatel", "cs_modules/themes/PontoControleCores_Anatel.css"); | ||
mconsole.log(document.baseURI) | ||
AdicionarLinkCss(document, 'seipp-pontocores-anatel', 'cs_modules/themes/PontoControleCores_Anatel.css') | ||
} | ||
|
||
function AplicarLinkCss() { | ||
var Aplicar = false; | ||
function AplicarLinkCss () { | ||
let Aplicar = false | ||
AplicarNestasPaginas.forEach(function (item) { | ||
if (document.baseURI.indexOf("acao=" + item) != -1) { Aplicar = true; } | ||
}); | ||
return Aplicar; | ||
if (document.baseURI.indexOf('acao=' + item) !== -1) { Aplicar = true } | ||
}) | ||
return Aplicar | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.