diff --git a/.gitignore b/.gitignore
index 66317d6..7cb0589 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,3 +40,5 @@ dist/icons/petrvs/petrvs.png
dist/manifest_antaq_v2.json
dist/manifest_seipro_v2.json
dist/manifest_v2.json
+dist/manifest_antt.json
+dist/manifest_antt_v2.json
diff --git a/dist/css/sei-pro.css b/dist/css/sei-pro.css
index cfa0c8b..7badef7 100644
--- a/dist/css/sei-pro.css
+++ b/dist/css/sei-pro.css
@@ -877,6 +877,21 @@ div.selectProgressoBar {
background: #4285F4 !important;
border: 1px solid #365ea0 !important;
}
+div.progressPrescricao {
+ height: 8px !important;
+ border: none !important;
+ margin: 10px 0;
+ width: 95%;
+ background: #ccc;
+}
+.progressPrescricao .ui-progressbar-value {
+ background: #9ece4e !important;
+ border: 1px solid #78a135 !important;
+}
+.progressPrescricao.urgente .ui-progressbar-value {
+ background: #e46e65 !important;
+ border: 1px solid #b44c44 !important;
+}
div.atividadesProgressoBar {
height: 4px !important;
border: none !important;
@@ -1817,6 +1832,9 @@ table.moreInfoBox td:first-child,
padding-right: 10px;
color: #747474;
}
+#processosKanban .kanban-description span.sub[data-type="especificacao"] {
+ font-size: 11pt;
+}
.kanban-container .kanban-board .proc_tags .kanban-title-board::before {
content: "\f02b";
}
@@ -2484,6 +2502,9 @@ a.newLink.filterTableProcessos.newLink_active i {
#atividadesPro.minView .modulesActions:has(.iconLabel) {
margin-top: 20px;
}
+#atividadesPro.minView .panelInfoHome:not(.panelInfoHomeAtividade) {
+ margin-top: 50px;
+}
#divInfraAreaTelaD {
position: relative;
}
@@ -3741,4 +3762,43 @@ input[type="currency"]{
}
.cke_dialog_ui_labeled_content:has(select.cke_dialog_ui_input_select) {
min-height: 30px;
+}
+i.fas.fa-spinner.fa-spin.fa-pulse {
+ height: 13px;
+ padding: 0 !important;
+}
+.tabelaControle a[href*="acao=procedimento_trabalhar"] {
+ white-space: nowrap;
+}
+.dialogBoxDiv .ui-accordion .ui-accordion-header {
+ text-indent: 20px;
+}
+h3.ui-accordion-header span.counter {
+ width: 18px;
+ border-radius: 50%;
+ text-indent: initial;
+ height: 18px;
+ background-color: #e4e9e9;
+ float: right;
+ color: #666;
+ font-size: 80%;
+ text-align: center;
+}
+div[id*="boxConfiguracoes"] .tag-input {
+ height: 22px !important;
+}
+#configEntidade_acoes_dados_externos td,
+#configEntidade_acoes_dados_externos tr {
+ height: auto;
+ margin: 0 !important;
+ padding: 0 !important;
+}
+.tableOptionConfig .editCellSelect.inEdit .chosen-container {
+ width: calc(100% - 30px) !important;
+}
+#cache_demandas_time_chosen {
+ width: 40% !important;
+}
+.fa-spinner:before {
+ content: "\f110" !important;
}
\ No newline at end of file
diff --git a/dist/css/sei-slim.css b/dist/css/sei-slim.css
index 9ece5a5..4090897 100644
--- a/dist/css/sei-slim.css
+++ b/dist/css/sei-slim.css
@@ -1694,6 +1694,7 @@ a[href*="andamento_marcador_gerenciar"][data-color],
.seiSlim a.botaoSEI[onclick*="saveAtividade("],
.seiSlim a.botaoSEI[onclick*="selectAtividadeBox("],
.seiSlim a.botaoSEI[onclick*="addControlePrazo("],
+.seiSlim a.botaoSEI[onclick*="getProcessoNaoLido("],
.seiSlim a.botaoSEI[onclick*="dialogChangeTypeProc("],
.seiSlim a.botaoSEI[onclick*="initUploadFilesInProcess("],
.seiSlim a.botaoSEI[onclick*="checkDadosAcompEspecial("],
@@ -1702,6 +1703,7 @@ a[href*="andamento_marcador_gerenciar"][data-color],
.seiSlim a.botaoSEI[onclick*="getDosimetria("],
.seiSlim a.botaoSEI[onclick*="dialogRelatoriosSFIS("],
.seiSlim a.botaoSEI[onclick*="getDocumentosActions("],
+.seiSlim a.botaoSEI[onclick*="getCtrPrescricao("],
.seiSlim a[id*="anchorImg"][data-img],
.seiSlim span.infraImgPro[data-img],
.seiSlim a[href*="javascript:alert('Assinado por:"],
@@ -1754,6 +1756,8 @@ a[href*="andamento_marcador_gerenciar"][data-color],
.seiSlim a.botaoSEI[onclick*="selectAtividadeBox("] img:hover,
.seiSlim a.botaoSEI[onclick*="addControlePrazo("] img,
.seiSlim a.botaoSEI[onclick*="addControlePrazo("] img:hover,
+.seiSlim a.botaoSEI[onclick*="getProcessoNaoLido("] img,
+.seiSlim a.botaoSEI[onclick*="getProcessoNaoLido("] img:hover,
.seiSlim a.botaoSEI[onclick*="dialogChangeTypeProc("] img,
.seiSlim a.botaoSEI[onclick*="dialogChangeTypeProc("] img:hover,
.seiSlim a.botaoSEI[onclick*="initUploadFilesInProcess("] img,
@@ -1770,6 +1774,8 @@ a[href*="andamento_marcador_gerenciar"][data-color],
.seiSlim a.botaoSEI[onclick*="dialogRelatoriosSFIS("] img:hover,
.seiSlim a.botaoSEI[onclick*="getDocumentosActions("] img,
.seiSlim a.botaoSEI[onclick*="getDocumentosActions("] img:hover,
+.seiSlim a.botaoSEI[onclick*="getCtrPrescricao("] img,
+.seiSlim a.botaoSEI[onclick*="getCtrPrescricao("] img:hover,
.seiSlim a.botaoSEI[href*="?acao=procedimento_atribuicao_cadastrar"] img,
.seiSlim a.botaoSEI[href*="?acao=procedimento_atribuicao_cadastrar"] img:hover,
.seiSlim a.botaoSEI[onclick*="?acao=procedimento_atribuicao_cadastrar"] img,
@@ -1987,6 +1993,7 @@ span.tagUserColorPro[data-color] img:hover,
.seiSlim a.botaoSEI[onclick*="saveAtividade("]:before,
.seiSlim a.botaoSEI[onclick*="selectAtividadeBox("]:before,
.seiSlim a.botaoSEI[onclick*="addControlePrazo("]:before,
+.seiSlim a.botaoSEI[onclick*="getProcessoNaoLido("]:before,
.seiSlim a.botaoSEI[onclick*="dialogChangeTypeProc("]:before,
.seiSlim a.botaoSEI[onclick*="initUploadFilesInProcess("]:before,
.seiSlim a.botaoSEI[onclick*="checkDadosAcompEspecial("]:before,
@@ -1995,6 +2002,7 @@ span.tagUserColorPro[data-color] img:hover,
.seiSlim a.botaoSEI[onclick*="getDosimetria("]:before,
.seiSlim a.botaoSEI[onclick*="dialogRelatoriosSFIS("]:before,
.seiSlim a.botaoSEI[onclick*="getDocumentosActions("]:before,
+.seiSlim a.botaoSEI[onclick*="getCtrPrescricao("]:before,
.seiSlim a.botaoSEI[href*="?acao=procedimento_credencial_gerenciar"]:before,
.seiSlim a.botaoSEI[href*="?acao=credencial_assinatura_gerenciar"]:before,
.seiSlim a.botaoSEI[href*="?acao=procedimento_atualizar_andamento"]:before,
@@ -2437,6 +2445,11 @@ a[href*="andamento_marcador_gerenciar"][data-color]:before {
content: "\f085";
color: #7562d8;
}
+.seiSlim a.botaoSEI[onclick*="getCtrPrescricao("]:after,
+.seiSlim a.botaoSEI[onclick*="getCtrPrescricao("]:before {
+ content: "\f252";
+ color: #7562d8;
+}
.seiSlim a.botaoSEI[onclick*="getDocCertidao("]:after,
.seiSlim a.botaoSEI[onclick*="getDocCertidao("]:before {
content: "\f5bf";
@@ -2497,6 +2510,11 @@ a[href*="andamento_marcador_gerenciar"][data-color]:before {
content: "\f017";
color: #4285f4;
}
+.seiSlim a.botaoSEI[onclick*="getProcessoNaoLido("]:after,
+.seiSlim a.botaoSEI[onclick*="getProcessoNaoLido("]:before {
+ content: "\f070";
+ color: #4285f4;
+}
.seiSlim a.botaoSEI[onclick*="initUploadFilesInProcess("]:after,
.seiSlim a.botaoSEI[onclick*="initUploadFilesInProcess("]:before {
content: "\f574";
@@ -3138,6 +3156,9 @@ td .linhaNumerada:after {
.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__boxsigilo_icon,
.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__ctr_review_icon,
.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__review_icon,
+.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__ditado_icon,
+.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__ctr_ditado_icon,
+.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__newstyle_icon,
.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__natjus_icon,
.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__tablestyles_icon,
.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__quicktable_icon,
@@ -3418,6 +3439,21 @@ td .linhaNumerada:after {
content: "\f4ff";
color: #4285f4;
}
+.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__ditado_icon:before {
+ content: "\f3c9";
+ color: #ea48cc;
+}
+.seiSlim.seiSlim_parent.seiSlim_view .cke_button_on span.cke_button_icon.cke_button__ditado_icon:before {
+ animation: pulser 2s infinite;
+}
+.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__ctr_ditado_icon:before {
+ content: "\f085";
+ color: #ea48cc;
+}
+.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__newstyle_icon:before {
+ content: "\f53f";
+ color: #ea48cc;
+}
.seiSlim.seiSlim_parent.seiSlim_view span.cke_button_icon.cke_button__natjus_icon:before {
content: "\f46b";
color: #34caef;
@@ -3860,4 +3896,10 @@ strong.title-reviewtip {
}
#uploadListPro .dz-preview.dz-file-preview {
margin: 10px;
+}
+.editorTextDisclaimer p {
+ font-size: 120%;
+ line-height: 30px;
+ width: 800px;
+ white-space: break-spaces;
}
\ No newline at end of file
diff --git a/dist/css/tableselection.css b/dist/css/tableselection.css
new file mode 100644
index 0000000..83b24bb
--- /dev/null
+++ b/dist/css/tableselection.css
@@ -0,0 +1,36 @@
+.cke_table-faked-selection-editor *::selection, table[data-cke-table-faked-selection-table] *::selection {
+ background: transparent;
+}
+
+.cke_table-faked-selection {
+ background: darkgray !important;
+ color: black;
+}
+.cke_table-faked-selection a {
+ color: black;
+}
+.cke_editable:focus .cke_table-faked-selection {
+ /* We have to use !important here, as td might specify it's own background, thus table selection
+ would not be visible. */
+ background: #0076cb !important;
+ color: white;
+}
+.cke_editable:focus .cke_table-faked-selection a {
+ color: white;
+}
+.cke_table-faked-selection::-moz-selection, .cke_table-faked-selection ::-moz-selection {
+ background: transparent;
+}
+.cke_table-faked-selection::selection, .cke_table-faked-selection ::selection {
+ background: transparent;
+}
+
+/* Change the cursor when selecting cells (#706).
+ *
+ * This solution does not work in IE, Edge and Safari due to upstream isues:
+ * https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/3419602/
+ * https://bugs.webkit.org/show_bug.cgi?id=53341
+ */
+table[data-cke-table-faked-selection-table] {
+ cursor: cell;
+}
\ No newline at end of file
diff --git a/dist/html/options.html b/dist/html/options.html
index 745e445..6fdb060 100644
--- a/dist/html/options.html
+++ b/dist/html/options.html
@@ -21,7 +21,7 @@
Salvar
diff --git a/dist/html/options.js b/dist/html/options.js
index 039437b..6676b60 100755
--- a/dist/html/options.js
+++ b/dist/html/options.js
@@ -389,9 +389,11 @@ function getManifestExtension() {
function setNamePage() {
var manifest = getManifestExtension();
var NAMESPACE_SPRO = manifest.short_name;
+ var ICONSPACE_SPRO = manifest.icons['32'];
var URLPages_SPRO = manifest.homepage_url;
// var title = 'Configura\u00E7\u00F5es Gerais | '+NAMESPACE_SPRO;
$('.title .name-space').text(NAMESPACE_SPRO);
+ $('.icon-space').attr('src','../'+ICONSPACE_SPRO);
$('a.manual').each(function(){
$(this).attr('href', URLPages_SPRO+$(this).attr('href'));
});
@@ -402,6 +404,7 @@ function setNamePage() {
} else if (NAMESPACE_SPRO == 'ANTT Pro') {
$('body').addClass('ANTAQ_Pro');
}
+ console.log(manifest);
}
$('#options-functions').find('input[type="text"]').on("keyup", function () {
if ($(this).val() != '') {
diff --git a/dist/icons/antt/icon-128.png b/dist/icons/antt/icon-128.png
new file mode 100644
index 0000000..8453dd7
Binary files /dev/null and b/dist/icons/antt/icon-128.png differ
diff --git a/dist/icons/antt/icon-16.png b/dist/icons/antt/icon-16.png
new file mode 100644
index 0000000..8225335
Binary files /dev/null and b/dist/icons/antt/icon-16.png differ
diff --git a/dist/icons/antt/icon-256.png b/dist/icons/antt/icon-256.png
new file mode 100644
index 0000000..ede6c2b
Binary files /dev/null and b/dist/icons/antt/icon-256.png differ
diff --git a/dist/icons/antt/icon-32.png b/dist/icons/antt/icon-32.png
new file mode 100644
index 0000000..d2f6d40
Binary files /dev/null and b/dist/icons/antt/icon-32.png differ
diff --git a/dist/icons/antt/icon-48.png b/dist/icons/antt/icon-48.png
new file mode 100644
index 0000000..f466df9
Binary files /dev/null and b/dist/icons/antt/icon-48.png differ
diff --git a/dist/icons/addestilotabela.png b/dist/icons/editor/addestilotabela.png
similarity index 100%
rename from dist/icons/addestilotabela.png
rename to dist/icons/editor/addestilotabela.png
diff --git a/dist/icons/blockedition.png b/dist/icons/editor/blockedition.png
similarity index 100%
rename from dist/icons/blockedition.png
rename to dist/icons/editor/blockedition.png
diff --git a/dist/icons/copiarformatacao.png b/dist/icons/editor/copiarformatacao.png
similarity index 100%
rename from dist/icons/copiarformatacao.png
rename to dist/icons/editor/copiarformatacao.png
diff --git a/dist/icons/duplicartabela.png b/dist/icons/editor/duplicartabela.png
similarity index 100%
rename from dist/icons/duplicartabela.png
rename to dist/icons/editor/duplicartabela.png
diff --git a/dist/icons/editarimagem.png b/dist/icons/editor/editarimagem.png
similarity index 100%
rename from dist/icons/editarimagem.png
rename to dist/icons/editor/editarimagem.png
diff --git a/dist/icons/ferramentasia.png b/dist/icons/editor/ferramentasia.png
similarity index 100%
rename from dist/icons/ferramentasia.png
rename to dist/icons/editor/ferramentasia.png
diff --git a/dist/icons/formatarimagem.png b/dist/icons/editor/formatarimagem.png
similarity index 100%
rename from dist/icons/formatarimagem.png
rename to dist/icons/editor/formatarimagem.png
diff --git a/dist/icons/editor/speech.gif b/dist/icons/editor/speech.gif
new file mode 100644
index 0000000..c645b97
Binary files /dev/null and b/dist/icons/editor/speech.gif differ
diff --git a/dist/icons/editor/webspeech-enable.gif b/dist/icons/editor/webspeech-enable.gif
new file mode 100644
index 0000000..99ccada
Binary files /dev/null and b/dist/icons/editor/webspeech-enable.gif differ
diff --git a/dist/icons/editor/webspeech-settings.png b/dist/icons/editor/webspeech-settings.png
new file mode 100644
index 0000000..47b75a4
Binary files /dev/null and b/dist/icons/editor/webspeech-settings.png differ
diff --git a/dist/icons/editor/webspeech.png b/dist/icons/editor/webspeech.png
new file mode 100644
index 0000000..3323f2e
Binary files /dev/null and b/dist/icons/editor/webspeech.png differ
diff --git a/dist/icons/lab/icon-32.png b/dist/icons/lab/icon-32.png
new file mode 100644
index 0000000..18374bb
Binary files /dev/null and b/dist/icons/lab/icon-32.png differ
diff --git a/dist/js/init.js b/dist/js/init.js
index 844c22a..748fa83 100644
--- a/dist/js/init.js
+++ b/dist/js/init.js
@@ -217,7 +217,7 @@ function loadDataBaseProStorage(items) {
}
}
function loadFontIcons(elementTo, target = $('html')) {
- var iconBoxSlim = (localStorage.getItem('seiSlim')) ? true : false;
+ var iconBoxSlim = (localStorage.getItem('seiSlim') || localStorage.getItem('seiSlim_editor')) ? true : false;
var pathExtension = pathExtensionSEIPro();
if (target.find('link[data-style="seipro-fonticon"]').length == 0 && target.find('style[data-style="seipro-fonticon"]').length == 0) {
$(" ", {
diff --git a/dist/js/init_all.js b/dist/js/init_all.js
index 44e927a..0134bc6 100644
--- a/dist/js/init_all.js
+++ b/dist/js/init_all.js
@@ -1,3 +1,5 @@
+var isNewSEI = $('#divInfraSidebarMenu ul#infraMenu').length ? true : false;
+
if ($('#frmEditor').length == 0) {
$.getScript(getUrlExtension("js/sei-functions-pro.js"));
}
@@ -103,7 +105,7 @@ function _P() { // get Session Name Space
}
function loadStyleDesign() {
var body = document.body;
- if (localStorage.getItem('seiSlim')) {
+ if (localStorage.getItem('seiSlim') && !isNewSEI) {
body.classList.add("seiSlim");
body.classList.add("seiSlim_parent");
if (document.getElementById("divInfraAreaTelaE") === null) body.classList.add("seiSlim_view");
diff --git a/dist/js/lib/_chosen.jquery.min.js b/dist/js/lib/_chosen.jquery.min.js
new file mode 100755
index 0000000..b05b5c9
--- /dev/null
+++ b/dist/js/lib/_chosen.jquery.min.js
@@ -0,0 +1,44 @@
+/* Chosen v1.8.7 | (c) 2011-2018 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
+
+(function(){var t,e,s,i,n=function(t,e){return function(){return t.apply(e,arguments)}},r=function(t,e){function s(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype,t},o={}.hasOwnProperty;(i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s"+this.escape_html(t.group_label)+""+t.html:t.html},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout(function(t){return function(){return t.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(t){return function(){return t.blur_test()}}(this),100)},t.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},t.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",h=0,n=0,r=(o=this.results_data).length;n=this.max_shown_results));n++);return e},t.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),t.style&&(s.style.cssText=t.style),s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&t.active_options>0?((e=[]).push("group-result"),t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},t.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t"+this.escape_html(s)+""+this.escape_html(p)),null!=a&&(a.group_match=!0)):null!=r.group_array_index&&this.results_data[r.group_array_index].search_match&&(r.search_match=!0)));return this.result_clear_highlight(),_<1&&h.length?(this.update_results_content(""),this.no_results(h)):(this.update_results_content(this.results_option_build()),(null!=t?t.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},t.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},t.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},t.prototype.clipboard_event_checker=function(t){if(!this.is_disabled)return setTimeout(function(t){return function(){return t.results_search()}}(this),50)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},t.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},t.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},t.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},t.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},t.prototype.get_single_html=function(){return'\n '+this.default_text+' \n
\n \n'},t.prototype.get_multi_html=function(){return'\n'},t.prototype.get_no_results_html=function(t){return'\n '+this.results_none_found+" "+this.escape_html(t)+" \n "},t.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),(t=jQuery).fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var n,r;r=(n=t(this)).data("chosen"),"destroy"!==i?r instanceof s||n.data("chosen",new s(this,i)):r instanceof s&&r.destroy()}):this}}),s=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return r(n,e),n.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},n.prototype.set_up_html=function(){var e,s;return(e=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),s={"class":e.join(" "),title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
",s),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){return this.container.on("touchstart.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("touchend.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mousedown.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("mouseup.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mouseenter.chosen",function(t){return function(e){t.mouse_enter(e)}}(this)),this.container.on("mouseleave.chosen",function(t){return function(e){t.mouse_leave(e)}}(this)),this.search_results.on("mouseup.chosen",function(t){return function(e){t.search_results_mouseup(e)}}(this)),this.search_results.on("mouseover.chosen",function(t){return function(e){t.search_results_mouseover(e)}}(this)),this.search_results.on("mouseout.chosen",function(t){return function(e){t.search_results_mouseout(e)}}(this)),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",function(t){return function(e){t.search_results_mousewheel(e)}}(this)),this.search_results.on("touchstart.chosen",function(t){return function(e){t.search_results_touchstart(e)}}(this)),this.search_results.on("touchmove.chosen",function(t){return function(e){t.search_results_touchmove(e)}}(this)),this.search_results.on("touchend.chosen",function(t){return function(e){t.search_results_touchend(e)}}(this)),this.form_field_jq.on("chosen:updated.chosen",function(t){return function(e){t.results_update_field(e)}}(this)),this.form_field_jq.on("chosen:activate.chosen",function(t){return function(e){t.activate_field(e)}}(this)),this.form_field_jq.on("chosen:open.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.form_field_jq.on("chosen:close.chosen",function(t){return function(e){t.close_field(e)}}(this)),this.search_field.on("blur.chosen",function(t){return function(e){t.input_blur(e)}}(this)),this.search_field.on("keyup.chosen",function(t){return function(e){t.keyup_checker(e)}}(this)),this.search_field.on("keydown.chosen",function(t){return function(e){t.keydown_checker(e)}}(this)),this.search_field.on("focus.chosen",function(t){return function(e){t.input_focus(e)}}(this)),this.search_field.on("cut.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.search_field.on("paste.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.is_multiple?this.search_choices.on("click.chosen",function(t){return function(e){t.choices_click(e)}}(this)):this.container.on("click.chosen",function(t){t.preventDefault()})},n.prototype.destroy=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},n.prototype.container_mousedown=function(e){var s;if(!this.is_disabled)return!e||"mousedown"!==(s=e.type)&&"touchstart"!==s||this.results_showing||e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},n.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},n.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},n.prototype.close_field=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},n.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(e){var s;return(s=t(e.target).closest(".chosen-container")).length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(t){var e,s,i,n,r;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),r=this.search_results.scrollTop(),n=i+r,s=this.result_highlight.position().top+this.search_results.scrollTop(),(e=s+this.result_highlight.outerHeight())>=n)return this.search_results.scrollTop(e-i>0?e-i:0);if(s0)return this.form_field_label.on("click.chosen",this.label_click_handler)},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},n.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},n.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result")||t(e.target).parents(".active-result").first())return this.result_clear_highlight()},n.prototype.choice_build=function(e){var s,i;return s=t(" ",{"class":"search-choice"}).html(""+this.choice_label(e)+" "),e.disabled?s.addClass("search-choice-disabled"):((i=t(" ",{"class":"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",function(t){return function(e){return t.choice_destroy_link_click(e)}}(this)),s.append(i)),this.search_container.before(s)},n.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},n.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),s=this.results_data[e[0].getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?t.metaKey||t.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},n.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(t)},n.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(' '),this.selected_item.addClass("chosen-single-with-deselect")},n.prototype.get_search_field_value=function(){return this.search_field.val()},n.prototype.get_search_text=function(){return t.trim(this.get_search_field_value())},n.prototype.escape_html=function(e){return t("
").text(e).html()},n.prototype.winnow_results_set_highlight=function(){var t,e;if(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),null!=(t=e.length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},n.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.search_field_scale=function(){var e,s,i,n,r,o,h;if(this.is_multiple){for(r={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s ").css(r)).text(this.get_search_field_value()),t("body").append(e),h=e.width()+25,e.remove(),this.container.is(":visible")&&(h=Math.min(this.container.outerWidth()-10,h)),this.search_field.width(h)}},n.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},n}()}).call(this);
+
+(function($) {
+ $.fn.chosenImage = function(options) {
+ return this.each(function() {
+ var $select = $(this);
+ var imgMap = {};
+
+ // 1. Retrieve img-src from data attribute and build object of image sources for each list item.
+ $select.find('option').filter(function(){
+ return $(this).text();
+ }).each(function(i) {
+ imgMap[i] = $(this).attr('data-img-src');
+ });
+
+ // 2. Execute chosen plugin and get the newly created chosen container.
+ $select.chosen(options);
+ var $chosen = $select.next('.chosen-container').addClass('chosenImage-container');
+
+ // 3. Style lis with image sources.
+ $chosen.on('click.chosen, mousedown.chosen, keyup.chosen', function(event){
+ $chosen.find('.chosen-results li').each(function() {
+ var imgIndex = $(this).attr('data-option-array-index');
+ $(this).css(cssObj(imgMap[imgIndex]));
+ });
+ });
+
+ // 4. Change image on chosen selected element when form changes.
+ $select.change(function() {
+ var imgSrc = $select.find('option:selected').attr('data-img-src') || '';
+ $chosen.find('.chosen-single span').css(cssObj(imgSrc));
+ });
+ $select.trigger('change');
+
+ // Utilties
+ function cssObj(imgSrc) {
+ var bgImg = (imgSrc) ? 'url(' + imgSrc + ')' : 'none';
+ return { 'background-image' : bgImg };
+ }
+ });
+ };
+})(jQuery);
\ No newline at end of file
diff --git a/dist/js/lib/chosen.jquery.min.js b/dist/js/lib/chosen.jquery.min.js
old mode 100755
new mode 100644
index b05b5c9..df56cea
--- a/dist/js/lib/chosen.jquery.min.js
+++ b/dist/js/lib/chosen.jquery.min.js
@@ -1,6 +1,6 @@
-/* Chosen v1.8.7 | (c) 2011-2018 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
+/* Chosen v1.8.2-hanoii | (c) 2011-2017 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
-(function(){var t,e,s,i,n=function(t,e){return function(){return t.apply(e,arguments)}},r=function(t,e){function s(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype,t},o={}.hasOwnProperty;(i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s"+this.escape_html(t.group_label)+""+t.html:t.html},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout(function(t){return function(){return t.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(t){return function(){return t.blur_test()}}(this),100)},t.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},t.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",h=0,n=0,r=(o=this.results_data).length;n=this.max_shown_results));n++);return e},t.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),t.style&&(s.style.cssText=t.style),s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&t.active_options>0?((e=[]).push("group-result"),t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},t.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t"+this.escape_html(s)+""+this.escape_html(p)),null!=a&&(a.group_match=!0)):null!=r.group_array_index&&this.results_data[r.group_array_index].search_match&&(r.search_match=!0)));return this.result_clear_highlight(),_<1&&h.length?(this.update_results_content(""),this.no_results(h)):(this.update_results_content(this.results_option_build()),(null!=t?t.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},t.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},t.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},t.prototype.clipboard_event_checker=function(t){if(!this.is_disabled)return setTimeout(function(t){return function(){return t.results_search()}}(this),50)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},t.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},t.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},t.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},t.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},t.prototype.get_single_html=function(){return'\n '+this.default_text+' \n
\n \n'},t.prototype.get_multi_html=function(){return'\n'},t.prototype.get_no_results_html=function(t){return'\n '+this.results_none_found+" "+this.escape_html(t)+" \n "},t.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),(t=jQuery).fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var n,r;r=(n=t(this)).data("chosen"),"destroy"!==i?r instanceof s||n.data("chosen",new s(this,i)):r instanceof s&&r.destroy()}):this}}),s=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return r(n,e),n.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},n.prototype.set_up_html=function(){var e,s;return(e=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),s={"class":e.join(" "),title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
",s),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){return this.container.on("touchstart.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("touchend.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mousedown.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("mouseup.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mouseenter.chosen",function(t){return function(e){t.mouse_enter(e)}}(this)),this.container.on("mouseleave.chosen",function(t){return function(e){t.mouse_leave(e)}}(this)),this.search_results.on("mouseup.chosen",function(t){return function(e){t.search_results_mouseup(e)}}(this)),this.search_results.on("mouseover.chosen",function(t){return function(e){t.search_results_mouseover(e)}}(this)),this.search_results.on("mouseout.chosen",function(t){return function(e){t.search_results_mouseout(e)}}(this)),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",function(t){return function(e){t.search_results_mousewheel(e)}}(this)),this.search_results.on("touchstart.chosen",function(t){return function(e){t.search_results_touchstart(e)}}(this)),this.search_results.on("touchmove.chosen",function(t){return function(e){t.search_results_touchmove(e)}}(this)),this.search_results.on("touchend.chosen",function(t){return function(e){t.search_results_touchend(e)}}(this)),this.form_field_jq.on("chosen:updated.chosen",function(t){return function(e){t.results_update_field(e)}}(this)),this.form_field_jq.on("chosen:activate.chosen",function(t){return function(e){t.activate_field(e)}}(this)),this.form_field_jq.on("chosen:open.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.form_field_jq.on("chosen:close.chosen",function(t){return function(e){t.close_field(e)}}(this)),this.search_field.on("blur.chosen",function(t){return function(e){t.input_blur(e)}}(this)),this.search_field.on("keyup.chosen",function(t){return function(e){t.keyup_checker(e)}}(this)),this.search_field.on("keydown.chosen",function(t){return function(e){t.keydown_checker(e)}}(this)),this.search_field.on("focus.chosen",function(t){return function(e){t.input_focus(e)}}(this)),this.search_field.on("cut.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.search_field.on("paste.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.is_multiple?this.search_choices.on("click.chosen",function(t){return function(e){t.choices_click(e)}}(this)):this.container.on("click.chosen",function(t){t.preventDefault()})},n.prototype.destroy=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},n.prototype.container_mousedown=function(e){var s;if(!this.is_disabled)return!e||"mousedown"!==(s=e.type)&&"touchstart"!==s||this.results_showing||e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},n.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},n.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},n.prototype.close_field=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},n.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(e){var s;return(s=t(e.target).closest(".chosen-container")).length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(t){var e,s,i,n,r;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),r=this.search_results.scrollTop(),n=i+r,s=this.result_highlight.position().top+this.search_results.scrollTop(),(e=s+this.result_highlight.outerHeight())>=n)return this.search_results.scrollTop(e-i>0?e-i:0);if(s0)return this.form_field_label.on("click.chosen",this.label_click_handler)},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},n.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},n.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result")||t(e.target).parents(".active-result").first())return this.result_clear_highlight()},n.prototype.choice_build=function(e){var s,i;return s=t(" ",{"class":"search-choice"}).html(""+this.choice_label(e)+" "),e.disabled?s.addClass("search-choice-disabled"):((i=t(" ",{"class":"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",function(t){return function(e){return t.choice_destroy_link_click(e)}}(this)),s.append(i)),this.search_container.before(s)},n.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},n.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),s=this.results_data[e[0].getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?t.metaKey||t.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},n.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(t)},n.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(' '),this.selected_item.addClass("chosen-single-with-deselect")},n.prototype.get_search_field_value=function(){return this.search_field.val()},n.prototype.get_search_text=function(){return t.trim(this.get_search_field_value())},n.prototype.escape_html=function(e){return t("
").text(e).html()},n.prototype.winnow_results_set_highlight=function(){var t,e;if(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),null!=(t=e.length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},n.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.search_field_scale=function(){var e,s,i,n,r,o,h;if(this.is_multiple){for(r={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s ").css(r)).text(this.get_search_field_value()),t("body").append(e),h=e.width()+25,e.remove(),this.container.is(":visible")&&(h=Math.min(this.container.outerWidth()-10,h)),this.search_field.width(h)}},n.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},n}()}).call(this);
+(function(){var t,e,s,i,n=function(t,e){return function(){return t.apply(e,arguments)}},r=function(t,e){function s(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype,t},o={}.hasOwnProperty;(i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s"+t.group_label+""+t.html:t.html},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout(function(t){return function(){return t.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(t){return function(){return t.blur_test()}}(this),100)},t.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},t.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",h=0,n=0,r=(o=this.results_data).length;n=this.max_shown_results));n++);return e},t.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),s.style.cssText=t.style,s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&t.active_options>0?((e=[]).push("group-result"),t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},t.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t"+this.escape_html(s)+""+this.escape_html(k)}null!=b&&(b.group_match=!0)}else null!=a.group_array_index&&this.results_data[a.group_array_index].search_match&&(a.search_match=!0);return this.result_clear_highlight(),v<1&&d.length?(this.update_results_content(""),this.no_results(d)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},t.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},t.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},t.prototype.clipboard_event_checker=function(t){if(!this.is_disabled)return setTimeout(function(t){return function(){return t.results_search()}}(this),50)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},t.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},t.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},t.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},t.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},t.prototype.get_single_html=function(){return'\n '+this.default_text+' \n
\n \n'},t.prototype.get_multi_html=function(){return'\n'},t.prototype.get_no_results_html=function(t){return'\n '+this.results_none_found+" "+this.escape_html(t)+" \n "},t.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),(t=jQuery).fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var n,r;r=(n=t(this)).data("chosen"),"destroy"!==i?r instanceof s||n.data("chosen",new s(this,i)):r instanceof s&&r.destroy()}):this}}),s=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return r(n,e),n.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},n.prototype.set_up_html=function(){var e,s;return(e=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),s={"class":e.join(" "),title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
",s),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){return this.container.on("touchstart.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("touchend.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mousedown.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("mouseup.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mouseenter.chosen",function(t){return function(e){t.mouse_enter(e)}}(this)),this.container.on("mouseleave.chosen",function(t){return function(e){t.mouse_leave(e)}}(this)),this.search_results.on("mouseup.chosen",function(t){return function(e){t.search_results_mouseup(e)}}(this)),this.search_results.on("mouseover.chosen",function(t){return function(e){t.search_results_mouseover(e)}}(this)),this.search_results.on("mouseout.chosen",function(t){return function(e){t.search_results_mouseout(e)}}(this)),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",function(t){return function(e){t.search_results_mousewheel(e)}}(this)),this.search_results.on("touchstart.chosen",function(t){return function(e){t.search_results_touchstart(e)}}(this)),this.search_results.on("touchmove.chosen",function(t){return function(e){t.search_results_touchmove(e)}}(this)),this.search_results.on("touchend.chosen",function(t){return function(e){t.search_results_touchend(e)}}(this)),this.form_field_jq.on("chosen:updated.chosen",function(t){return function(e){t.results_update_field(e)}}(this)),this.form_field_jq.on("chosen:activate.chosen",function(t){return function(e){t.activate_field(e)}}(this)),this.form_field_jq.on("chosen:open.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.form_field_jq.on("chosen:close.chosen",function(t){return function(e){t.close_field(e)}}(this)),this.search_field.on("blur.chosen",function(t){return function(e){t.input_blur(e)}}(this)),this.search_field.on("keyup.chosen",function(t){return function(e){t.keyup_checker(e)}}(this)),this.search_field.on("keydown.chosen",function(t){return function(e){t.keydown_checker(e)}}(this)),this.search_field.on("focus.chosen",function(t){return function(e){t.input_focus(e)}}(this)),this.search_field.on("cut.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.search_field.on("paste.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.is_multiple?this.search_choices.on("click.chosen",function(t){return function(e){t.choices_click(e)}}(this)):this.container.on("click.chosen",function(t){t.preventDefault()})},n.prototype.destroy=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},n.prototype.container_mousedown=function(e){var s;if(!this.is_disabled)return!e||"mousedown"!==(s=e.type)&&"touchstart"!==s||this.results_showing||e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},n.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},n.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},n.prototype.close_field=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},n.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(e){var s;return(s=t(e.target).closest(".chosen-container")).length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(t){var e,s,i,n,r;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),r=this.search_results.scrollTop(),n=i+r,s=this.result_highlight.position().top+this.search_results.scrollTop(),(e=s+this.result_highlight.outerHeight())>=n)return this.search_results.scrollTop(e-i>0?e-i:0);if(s0)return this.form_field_label.on("click.chosen",this.label_click_handler)},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},n.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},n.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result")||t(e.target).parents(".active-result").first())return this.result_clear_highlight()},n.prototype.choice_build=function(e){var s,i;return s=t(" ",{"class":"search-choice"}).html(""+this.choice_label(e)+" "),e.disabled?s.addClass("search-choice-disabled"):((i=t(" ",{"class":"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",function(t){return function(e){return t.choice_destroy_link_click(e)}}(this)),s.append(i)),this.search_container.before(s)},n.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},n.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),s=this.results_data[e[0].getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.search_field.val(""),this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?this.winnow_results():(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},n.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(t)},n.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(' '),this.selected_item.addClass("chosen-single-with-deselect")},n.prototype.get_search_field_value=function(){return this.search_field.val()},n.prototype.get_search_text=function(){return t.trim(this.get_search_field_value())},n.prototype.escape_html=function(e){return t("
").text(e).html()},n.prototype.winnow_results_set_highlight=function(){var t,e;if(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),null!=(t=e.length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},n.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.search_field_scale=function(){var e,s,i,n,r,o,h;if(this.is_multiple){for(r={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s ").css(r)).text(this.get_search_field_value()),t("body").append(e),h=e.width()+25,e.remove(),this.container.is(":visible")&&(h=Math.min(this.container.outerWidth()-10,h)),this.search_field.width(h)}},n.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},n}()}).call(this);
(function($) {
$.fn.chosenImage = function(options) {
diff --git a/dist/js/lib/jquery-visible.min.js b/dist/js/lib/jquery-visible.min.js
new file mode 100644
index 0000000..51f75b5
--- /dev/null
+++ b/dist/js/lib/jquery-visible.min.js
@@ -0,0 +1,13 @@
+
+/**
+ * Copyright 2012, Digital Fusion
+ * Licensed under the MIT license.
+ * http://teamdf.com/jquery-plugins/license/
+ *
+ * @author Sam Sehnert
+ * @desc A small plugin that checks whether elements are within
+ * the user visible viewport of a web browser.
+ * can accounts for vertical position, horizontal, or both
+ * https://github.com/customd/jquery-visible
+ */
+!function(t){var i=t(window);t.fn.visible=function(t,e,o){if(!(this.length<1)){var r=this.length>1?this.eq(0):this,n=r.get(0),f=i.width(),h=i.height(),o=o?o:"both",l=e===!0?n.offsetWidth*n.offsetHeight:!0;if("function"==typeof n.getBoundingClientRect){var g=n.getBoundingClientRect(),u=g.top>=0&&g.top0&&g.bottom<=h,c=g.left>=0&&g.left0&&g.right<=f,v=t?u||s:u&&s,b=t?c||a:c&&a;if("both"===o)return l&&v&&b;if("vertical"===o)return l&&v;if("horizontal"===o)return l&&b}else{var d=i.scrollTop(),p=d+h,w=i.scrollLeft(),m=w+f,y=r.offset(),z=y.top,B=z+r.height(),C=y.left,R=C+r.width(),j=t===!0?B:z,q=t===!0?z:B,H=t===!0?R:C,L=t===!0?C:R;if("both"===o)return!!l&&p>=q&&j>=d&&m>=L&&H>=w;if("vertical"===o)return!!l&&p>=q&&j>=d;if("horizontal"===o)return!!l&&m>=L&&H>=w}}}}(jQuery);
diff --git a/dist/js/sei-functions-pro.js b/dist/js/sei-functions-pro.js
index 829b4c6..02977dc 100644
--- a/dist/js/sei-functions-pro.js
+++ b/dist/js/sei-functions-pro.js
@@ -28,7 +28,7 @@ var fileSystemContentPro = false;
var delayCrash = false;
var unidade = isNewSEI ? $('#lnkInfraUnidade').text() : $('#selInfraUnidades').find('option:selected').text().trim();
var isProcUrgente = false;
-var isNewSEI = $('#divInfraSidebarMenu ul#infraMenu').length ? true : false;
+var isNewSEI = getIsNewSEI();
var divInformacao = isNewSEI ? '#divArvoreInformacao' : '#divInformacao';
var mainMenu = isNewSEI ? '#infraMenu' : '#main-menu';
var ancoraArvoreDownload = isNewSEI ? 'a.ancoraVisualizacaoArvore' : 'a.ancoraArvoreDownload';
@@ -145,23 +145,6 @@ var listIconsFontAwesome = ["ad","address-book","address-card","adjust","air-fre
var html_initContentPro = '
';
if ( $('#sheetsCompleteEtapaForm').length == 0 ) { $('#divInfraBarraSistema').append(html_initContentPro) }
-
-/**
- * Copyright 2012, Digital Fusion
- * Licensed under the MIT license.
- * http://teamdf.com/jquery-plugins/license/
- *
- * @author Sam Sehnert
- * @desc A small plugin that checks whether elements are within
- * the user visible viewport of a web browser.
- * can accounts for vertical position, horizontal, or both
- */
-!function(t){var i=t(window);t.fn.visible=function(t,e,o){if(!(this.length<1)){var r=this.length>1?this.eq(0):this,n=r.get(0),f=i.width(),h=i.height(),o=o?o:"both",l=e===!0?n.offsetWidth*n.offsetHeight:!0;if("function"==typeof n.getBoundingClientRect){var g=n.getBoundingClientRect(),u=g.top>=0&&g.top0&&g.bottom<=h,c=g.left>=0&&g.left0&&g.right<=f,v=t?u||s:u&&s,b=t?c||a:c&&a;if("both"===o)return l&&v&&b;if("vertical"===o)return l&&v;if("horizontal"===o)return l&&b}else{var d=i.scrollTop(),p=d+h,w=i.scrollLeft(),m=w+f,y=r.offset(),z=y.top,B=z+r.height(),C=y.left,R=C+r.width(),j=t===!0?B:z,q=t===!0?z:B,H=t===!0?R:C,L=t===!0?C:R;if("both"===o)return!!l&&p>=q&&j>=d&&m>=L&&H>=w;if("vertical"===o)return!!l&&p>=q&&j>=d;if("horizontal"===o)return!!l&&m>=L&&H>=w}}}}(jQuery);
-
-function _P() { // get Session Name Space
- return JSON.parse(sessionStorage.getItem('new_extension'));
-}
-
function _G() { // get Session Google Name Space
var _return = localStorage.getItem('SEIPro_google_projetos');
_return = (_return === null) ? localStorage.getItem('SEIPro_google_processos') : _return;
@@ -170,6 +153,9 @@ function _G() { // get Session Google Name Space
return _return ? JSON.parse(_return) : false;
}
+function _P() { // get Session Name Space
+ return JSON.parse(sessionStorage.getItem('new_extension'));
+}
function loadAPIGooglePro() {
if (!!URL_SPRO) $.getScript(URL_SPRO+"js/lib/google_api.js");
/*
@@ -180,6 +166,11 @@ function loadAPIGooglePro() {
}
*/
}
+function getIsNewSEI() {
+ var isNewSEI = $('#divInfraSidebarMenu ul#infraMenu').length ? true : false;
+ if (isNewSEI) setOptionsPro('isNewSEI', true);
+ return getOptionsPro('isNewSEI') ? true : isNewSEI;
+}
function setCaretPosition(elem, caretPos) {
if (elem != null) {
if (elem.createTextRange) {
@@ -301,9 +292,9 @@ function filterTextExtractDate(elem, table, cellIndex) {
return text;
}
function insertFontIcon(elementTo, target = $('html')) {
- var iconBoxSlim = (localStorage.getItem('seiSlim')) ? true : false;
+ var iconBoxSlim = (localStorage.getItem('seiSlim') || localStorage.getItem('seiSlim_editor')) ? true : false;
var pathExtension = URL_SPRO;
- if ( target, target.find('link[datastyle="seipro-fonticon"]').length == 0 && target.find('style[data-style="seipro-fonticon"]').length == 0) {
+ if ( target, target.find('link[data-style="seipro-fonticon"]').length == 0 && target.find('style[data-style="seipro-fonticon"]').length == 0) {
$(" ", {
rel: "stylesheet",
type: "text/css",
@@ -349,6 +340,9 @@ function insertFontIcon(elementTo, target = $('html')) {
'';
target.find('head').append(htmlStyleFont);
}
+ if (localStorage.getItem('seiSlim_editor')) {
+ $('body').addClass('seiSlim seiSlim_parent seiSlim_view');
+ }
}
function numberToLetter(number) {
return (parseInt(number) + 9).toString(36).toUpperCase();
@@ -403,6 +397,14 @@ function isJson(str) {
}
return true;
}
+function tryParseJSONObject(jsonString){
+ try {
+ var o = JSON.parse(jsonString);
+ if (o && typeof o === "object") { return o; }
+ }
+ catch (e) { }
+ return false;
+}
function avgArray(array) {
var sum = 0;
for( var i = 0; i < array.length; i++ ){
@@ -1010,7 +1012,7 @@ function getBrightnessColor(value) {
}
function setIconLoadinBtnSEI(elem, display = true) {
if (display) {
- elem.find('img').css('opacity','0').end().append(' ');
+ elem.find('img').css('opacity','0').end().append(' ');
} else {
elem.find('img').css('opacity','1').end().find('.botaoSEI_loading').remove();
}
@@ -2202,6 +2204,176 @@ function updateDadosArvoreIframe(nameLink, idElement, value, ifrArvore, callback
}
}
+
+function getProcessoNaoLido() {
+ var listId = getListIdProtocoloSelected();
+ var tableProc = $('#tblProcessosRecebidos, #tblProcessosGerados, #tblProcessosDetalhado');
+ if (listId) {
+ if ($('body').hasClass('seiSlim')) {
+ $('#divComandos .iconNaoLido').addClass('iconLoading');
+ } else {
+ setIconLoadinBtnSEI($('.iconNaoLido'),true);
+ }
+ var id_procedimento = listId[0];
+ var tr = tableProc.find('tr#P'+id_procedimento);
+ if (isNewSEI) {
+ var idUnidade = getParamsUrlPro($('#lnkInfraUnidade').attr('onclick').split("'")[1]).infra_unidade_atual;
+ var nomeUnidade = $('#lnkInfraUnidade').text();
+ } else {
+ var nomeUnidade = $('#selInfraUnidades').find('option:selected').text();
+ var idUnidade = $('#selInfraUnidades').val();
+ }
+ var href = url_host.replace('controlador.php','')+'controlador.php?acao=procedimento_trabalhar&id_procedimento='+String(id_procedimento);
+ if (href !== null) {
+ $.ajax({ url: href }).done(function (html) {
+ var $html = $(html);
+ var urlArvore = $html.find("#ifrArvore").attr('src');
+ $.ajax({ url: urlArvore }).done(function (htmlArvore) {
+ var arrayLinksArvore = getLinksArvoreAjax(htmlArvore);
+ var urlEnviar = jmespath.search(arrayLinksArvore, "[?name=='Enviar Processo'] | [0].url");
+ var urlAndamento = jmespath.search(arrayLinksArvore, "[?name=='Atualizar Andamento'] | [0].url");
+ console.log(arrayLinksArvore, urlEnviar, urlAndamento);
+ if (urlAndamento !== null && urlEnviar !== null) {
+
+ $.ajax({ url: urlAndamento }).done(function (htmlDoc) {
+ var $htmlDoc = $(htmlDoc);
+ var form = $htmlDoc.find('#frmAtividadeListar');
+ var hrefForm = form.attr('action');
+ var param = {};
+ form.find("input[type=hidden]").each(function () {
+ if ( $(this).attr('name') && $(this).attr('id').indexOf('hdn') !== -1) {
+ param[$(this).attr('name')] = $(this).val();
+ }
+ });
+ form.find('input[type=text]').each(function () {
+ if ( $(this).attr('id') && $(this).attr('id').indexOf('txt') !== -1) {
+ param[$(this).attr('id')] = $(this).val();
+ }
+ });
+ form.find('select').each(function () {
+ if ( $(this).attr('id') && $(this).attr('id').indexOf('sel') !== -1) {
+ param[$(this).attr('id')] = $(this).val();
+ }
+ });
+ form.find('input[type=radio]').each(function () {
+ if ( $(this).attr('name') && $(this).attr('name').indexOf('rdo') !== -1) {
+ param[$(this).attr('name')] = $(this).val();
+ }
+ });
+ param.txaDescricao = 'Processo marcado como n\u00E3o visualizado';
+ param.sbmSalvar = 'Salvar';
+
+ // console.log({nr_sei: nr_sei, name: nameOption, value: value, url: urlDoc, param: param});
+
+ var postData = '';
+ for (var k in param) {
+ if (postData !== '') postData = postData + '&';
+ var valor = (k=='hdnAssuntos') ? param[k] : escapeComponent(param[k]);
+ valor = (k=='hdnInteressados') ? param[k] : valor;
+ // valor = (k=='txtDescricao') ? parent.encodeURI_toHex(param[k].normalize('NFC')) : valor;
+ valor = (k=='txtNumero') ? escapeComponent(param[k]) : valor;
+ postData = postData + k + '=' + valor;
+ }
+ // console.log(postData);
+
+ var xhr = new XMLHttpRequest();
+ $.ajax({
+ method: 'POST',
+ // data: param,
+ data: postData,
+ url: hrefForm,
+ contentType: 'application/x-www-form-urlencoded; charset=ISO-8859-1',
+ xhr: function() {
+ return xhr;
+ },
+ }).done(function (htmlResult) {
+ var status = (xhr.responseURL.indexOf('controlador.php?acao=procedimento_consultar_historico&acao_origem=procedimento_atualizar_andamento') !== -1) ? true : false;
+ if (status) {
+
+ $.ajax({ url: urlEnviar }).done(function (htmlDoc) {
+ var $htmlDoc = $(htmlDoc);
+ var form = $htmlDoc.find('#frmAtividadeListar');
+ var hrefForm = form.attr('action');
+ var param = {};
+ form.find("input[type=hidden]").each(function () {
+ if ( $(this).attr('name') && $(this).attr('id').indexOf('hdn') !== -1) {
+ param[$(this).attr('name')] = $(this).val();
+ }
+ });
+ form.find('input[type=text]').each(function () {
+ if ( $(this).attr('id') && $(this).attr('id').indexOf('txt') !== -1) {
+ param[$(this).attr('id')] = $(this).val();
+ }
+ });
+ form.find('select').each(function () {
+ if ( $(this).attr('id') && $(this).attr('id').indexOf('sel') !== -1) {
+ param[$(this).attr('id')] = $(this).val();
+ }
+ });
+ form.find('input[type=radio]').each(function () {
+ if ( $(this).attr('name') && $(this).attr('name').indexOf('rdo') !== -1) {
+ param[$(this).attr('name')] = $(this).val();
+ }
+ });
+ param.selUnidades = idUnidade;
+ param.hdnUnidades = idUnidade+'\u00B1'+nomeUnidade;
+ param.sbmEnviar = 'Enviar';
+
+ // console.log({nr_sei: nr_sei, name: nameOption, value: value, url: urlDoc, param: param});
+
+ var postData = '';
+ for (var k in param) {
+ if (postData !== '') postData = postData + '&';
+ var valor = (k=='hdnAssuntos') ? param[k] : escapeComponent(param[k]);
+ valor = (k=='hdnInteressados') ? param[k] : valor;
+ valor = (k=='txtDescricao') ? parent.encodeURI_toHex(param[k].normalize('NFC')) : valor;
+ valor = (k=='txtNumero') ? escapeComponent(param[k]) : valor;
+ postData = postData + k + '=' + valor;
+ }
+ // console.log(postData);
+
+ var xhr = new XMLHttpRequest();
+ $.ajax({
+ method: 'POST',
+ // data: param,
+ data: postData,
+ url: hrefForm,
+ contentType: 'application/x-www-form-urlencoded; charset=ISO-8859-1',
+ xhr: function() {
+ return xhr;
+ },
+ }).done(function (htmlResult) {
+ var status = (xhr.responseURL.indexOf('controlador.php?acao=arvore_visualizar&acao_origem=procedimento_enviar') !== -1) ? true : false;
+ if (status) {
+ tr.find('a[href*="controlador.php?acao=procedimento_trabalhar"]').attr('class', 'processoNaoVisualizado');
+ tr.find(elemCheckbox+':checked').trigger('click');
+ initNaoVisualizadoPro();
+ setTimeout(() => {
+ getProcessoNaoLido();
+ }, 500);
+ }
+ });
+
+ });
+
+ }
+ });
+
+ });
+ }
+ if (urlEnviar !== null) {
+ }
+ });
+ });
+ }
+ } else {
+ if ($('body').hasClass('seiSlim')) {
+ $('#divComandos .iconNaoLido').removeClass('iconLoading');
+ } else {
+ setIconLoadinBtnSEI($('.iconNaoLido'),false);
+ }
+ }
+}
function updateDadosArvoreMult(nameLink, values, idProcedimento, callback = false) {
if (typeof idProcedimento !== 'undefined' && idProcedimento != '' && idProcedimento !== null && idProcedimento != 0 && !checkProcessoSigiloso()) {
if ($('#ifrArvore').length == 0) {
@@ -2419,7 +2591,11 @@ function goReaberturaProcesso(index = 0) {
setTimeout(function(){ td.find('.sucessEdit').remove(); }, 2000);
if (next == listReabertura.length) {
- alertaBoxPro('Sucess', 'check-circle', (listReabertura.length > 1 ? 'Processos reabertos': 'Processo reaberto')+' com sucesso!', function(){ window.location.reload() });
+ alertaBoxPro('Sucess', 'check-circle', (listReabertura.length > 1 ? 'Processos reabertos': 'Processo reaberto')+' com sucesso!', function(){
+ window.location.href += "#ID-"+selectReabertura.join(',');
+ location.reload();
+ // window.location.reload();
+ });
loadingButtonConfirm(false);
}
console.log(listReabertura[index], next, listReabertura.length);
@@ -3301,7 +3477,7 @@ function getLinksArvoreAjax(htmlArvore) {
$.each(htmlArvore.split('\n'), function(ind, val){
if (val.indexOf('Nos[0].acoes = ') !== -1) {
var barraControle = val.trim().replace("Nos[0].acoes = '",'').slice(0,-2);
- $(''+barraControle+'
').find('a.botaoSEI').each(function(){
+ $(''+barraControle+'
').find(parent.isNewSEI ? 'a[href*="controlador.php?acao="]' : 'a.botaoSEI').each(function(){
if (typeof $(this).attr('href') !== 'undefined' && $(this).attr('href') != '#') {
links.push({name: $(this).find('img').attr('title'), url: $(this).attr('href')});
}
@@ -4638,7 +4814,7 @@ function verifyConfigValue(name) {
}
}
function restrictConfigValue(name) {
- if (NAMESPACE_SPRO == 'ANTAQ Pro' || NAMESPACE_SPRO == 'ANTT Pro' || NAMESPACE_SPRO == 'SEI Pro') {
+ if (NAMESPACE_SPRO == 'ANTAQ Pro' || NAMESPACE_SPRO == 'ANTT Pro') {
return false;
} else {
return checkConfigValue(name);
@@ -4918,7 +5094,7 @@ function confirmaFraseBoxPro(text, phrase, func, cancel) {
}]
});
}
-function confirmaBoxPro(text, func, titBtn = 'OK', cancel) {
+function confirmaBoxPro(text, func, titBtn = 'OK', cancel = false, titBtnCancel = 'Cancelar') {
if (alertBoxPro) {
alertBoxPro.dialog('destroy');
alertBoxPro = false;
@@ -4935,7 +5111,7 @@ function confirmaBoxPro(text, func, titBtn = 'OK', cancel) {
$('.alertaAttencionPro').html('');
},
buttons: [{
- text: "Cancelar",
+ text: titBtnCancel,
click: function() {
if (typeof cancel === 'function') { cancel() }
$(this).dialog('close');
@@ -5424,7 +5600,7 @@ function eraseCookiePro(name) {
createCookiePro(name, "", -1);
}
function removeAcentos(str) {
- return (typeof str !== 'undefined' && str !== null) ? str.normalize("NFD").replace(/[\u0300-\u036f]/g, "") : '';
+ return (typeof str !== 'undefined' && str !== null && typeof str.normalize === 'function') ? str.normalize("NFD").replace(/[\u0300-\u036f]/g, "") : '';
}
function encodeURI_toHex(str){
var hex, i;
@@ -5899,6 +6075,7 @@ function ajaxDadosProcessoPro(href, mode, arrayAcompEsp) {
// console.log(processo);
setTimeout(function(){
updateTitlePage(mode);
+ if (typeof setTipoPrescricaoProcesso === 'function') setTipoPrescricaoProcesso();
}, 500);
if (mode == 'editor' || mode == 'gantt' || mode == 'dados' || mode == 'processo') {
checkDadosIframeDocumentosPro(mode);
@@ -6130,6 +6307,7 @@ function getHistoryProcessosPro() {
}, 500);
}
}, 500);
+ $.getScript(URL_SPRO+"js/lib/jquery-visible.min.js");
}
function getAllLinksFolder() {
var _ifrArvore = $('#ifrArvore');
@@ -6878,6 +7056,7 @@ function getDocumentosActions() {
}, 1000);
}
}, 500);
+ $.getScript(URL_SPRO+"js/lib/jquery-visible.min.js");
}
function initAppendIconsDocumentosActions(TimeOut = 3000) {
if (TimeOut <= 0) {
@@ -9379,6 +9558,39 @@ function appendIconBatchActions(loop = true) {
},1500);
}
}
+function appendIconCtrPrescricao(loop = true) {
+ var ifrVisualizacao = $('#ifrVisualizacao').contents();
+ var base64IconCtrPrescricao = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAABFJJREFUeJztmG9MG2UYwFeyaTZwcSwx2WzLBjNxGx/mvuAHiYl+WGCML/uDMZWVAHPqNJsxS8acY1sy/DMzQRNzxj8fNNEYPxmTJc4P6jelQLtCS0t71/ZKodcrEOjd296fPr7vXTsKQgbxrsbIk/zy3uV67/3yXNvned9NmzZiI/4D0dba99Khvec+r7e/QhnBQdtZqssx0GiYYHPjFcpe1QH2KqchWCtPwwvH3jtjmGBT41WKTGrTwA+pxLLauH7IHNbKdmg79q5xgq3P91K1O7uhrrpIJ9Tt6FoXtYRqMpJ7O6H9xAfGCc7xcoUkJzfTKamfTskQSKgwEsmvC3eB0ajyBp9UKgiGCRYjzClUmJPBP7l+wSL3oso5w8WMFVT/x4KJKf+nbMILEdYFweDPmLsQmFgb5LPkHob985IpcjmVrxATH1/N0j2Agp0guqyAXLvxuFZ2gTCIR/adblMEScjpO/sRcwVQ+CIII4dAcNnwQ9dGZtAKmeH6lMx/v800QZTntiD2w7sofBlE3wksuEd78IPkRCLoqoGM78ht0+SKIfLf7kbx/l9E+nIeYUlxsOaBmcwM1Sli4PgXIv/VTtMFSSD+xxox9v5PiHk7I461gDD0ZEHGvixzOLsjB+YFf/OXmYU79rLIFUPKTmzPcV8/i2I3f0fhN0EcbcKiTywKDu0T0L2G78TIxcNZObRdgbSlrIJ54C0oz2zJpr55DE0OdKPo9UkxeAZEz9MgeBsjC4GTbRL9+iN5NWUhlFWuNOK8spXm5CN0Ev3GTo3JsekIMHxuMMLnGhJz0kP/mhi/IFtiXG4Pw0mf4AozTypMkRAGS3Ohabk3GFceL7sck5KraE7qwzJsqVgpPtzxeGIquKMq62Wla/RktjzZjKZQJZa7iSXkleUUGE8oWmul119St9WsN5a7wKSkh00XZLhcP40lVsvcOM6ce8VGQYVRVnrLVLnErLqVTkppehU5AnmtK3cyCngiii+eVjebJsgklaMri0mYHCTYX2F84g9wMwoMR+S/ZZDgjalPmSfIKTdCqwjGp8ZgIfAazLibYCzkwTLLBXW8MdlhmmCIk6hSMfKqQykJ2KlxEOnrIPhPauVubrgBfGG/9lr1zJU2rLKZHbVMLc9cdDoG85EByIZ7cIfThusvqcdW4DwvgjccLkiWSRD/eil6SQZnIMPcBkSaWIzgP6W1VsV6nHa3gIeZXZJFjxmLptm0rNVShpNv4f9AIDBJAWbYHwAxlzA9+ohfMelgRJfeA5Ix7ruBJTOapFv/Dp6fS4OFYJhg63PXKG3BvqNbX4iTBXh1Bz4+jXHCvkd19PN2vDh3LKGu2gl78WK9trCAJ3M4jt8ybuHe/EwvZStsfVgL6OftYLt/jNnWUbjuvM/iNYJT2/YwfG/mKBbU9lYM2jyyGS14qqXPUW9/9bOD9rPUP8ZGeJnqcnxk3PZbRkhbCIZNuBEbsRh/AXsKOj5cMZb5AAAAAElFTkSuQmCC';
+ var htmlIconCtrPrescricao = ''+
+ ' '+
+ ' ';
+ if (ifrVisualizacao.find('#iconCtrPrescicao').length == 0) {
+ ifrVisualizacao.find('#divArvoreAcoes').append(htmlIconCtrPrescricao);
+ }
+ if (loop) {
+ setTimeout(function () {
+ appendIconCtrPrescricao();
+ },1500);
+ }
+}
+function checkTipoPrescricaoProcesso() {
+ if (typeof arrayConfigAtividades.tipos_prescricoes !== 'undefined') {
+ var arrayTipoPrescicaoProcesso = [];
+ var id_tipo_procedimento = typeof dadosProcessoPro.propProcesso !== 'undefined' ? dadosProcessoPro.propProcesso.hdnIdTipoProcedimento : false;
+ if (id_tipo_procedimento) {
+ $.each(arrayConfigAtividades.tipos_prescricoes,function(i, v){
+ if (typeof v.config !== 'undefined' && typeof v.config.tipo_processo !== 'undefined') {
+ if (jmespath.search(v.config.tipo_processo,"[?value=='"+id_tipo_procedimento+"']") !== null) arrayTipoPrescicaoProcesso.push(v);
+ }
+ });
+ return arrayTipoPrescicaoProcesso;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+}
function insertIconDocCertidao() {
waitLoadPro($('#ifrVisualizacao').contents(), '#divArvoreAcoes', 'a[href*="controlador.php?acao="]', appendIconDocCertidao);
}
@@ -9428,7 +9640,7 @@ function appendTooltipOnButtons() {
});
}
function insertIconNewDoc() {
- waitLoadPro($('#ifrVisualizacao').contents(), '#divArvoreAcoes', "a.botaoSEI", appendIconNewDoc);
+ if (!isNewSEI) waitLoadPro($('#ifrVisualizacao').contents(), '#divArvoreAcoes', "a.botaoSEI", appendIconNewDoc);
}
function appendIconNewDoc(loop = true) {
var ifrVisualizacao = $('#ifrVisualizacao').contents();
diff --git a/dist/js/sei-pro-all.js b/dist/js/sei-pro-all.js
index 4ca75e0..31bccd9 100644
--- a/dist/js/sei-pro-all.js
+++ b/dist/js/sei-pro-all.js
@@ -1,6 +1,9 @@
var pagesInfiniteSearch = [];
var frmPesquisaProtocolo = ($('#seiSearch').length) ? '#seiSearch' : '#frmPesquisaProtocolo';
+var divPaginas = isNewSEI ? 'div.pesquisaPaginas' : 'div.paginas';
+
function getTableInfiniteSearch(ifrView, formID, tableID, index) {
+ console.log(pagesInfiniteSearch, index, pagesInfiniteSearch);
if (pagesInfiniteSearch.length == 0 || $.inArray(index, pagesInfiniteSearch) === -1) {
var form = ifrView.find(formID);
var href = form.attr('action');
@@ -18,7 +21,8 @@ function getTableInfiniteSearch(ifrView, formID, tableID, index) {
});
param['hdnInicio'] = index;
pagesInfiniteSearch.push(index);
- ifrView.find('div.paginas').append(' ');
+ ifrView.find(divPaginas).append(' ');
+ console.log(param, href);
$.ajax({
method: 'POST',
@@ -35,23 +39,23 @@ function getTableInfiniteSearch(ifrView, formID, tableID, index) {
param['hdnInicio'] = 0;
$.ajax({ method: 'POST', data: param, url: href });
}
- ifrView.find('div.paginas').after($html.find('div.paginas')).remove();
+ ifrView.find(divPaginas).after($html.find(divPaginas)).remove();
startQuickViewSearch();
console.log('startQuickViewSearch');
});
}
}
function getInfiniteSearch() {
- var nrPage = parseInt($('div.paginas b').text()+'0');
- if ($('div.paginas span.pequeno').last().text() == 'Pr\u00F3xima') {
- getTableInfiniteSearch($('#divInfraAreaTela'), frmPesquisaProtocolo, 'table.resultado', nrPage);
+ var nrPage = parseInt($(isNewSEI ? 'div.pesquisaPaginas .pesquisaPaginaSelecionada' : 'div.paginas b').text()+'0');
+ if ($(isNewSEI ? 'div.pesquisaPaginas a' : 'div.paginas span.pequeno').last().text() == 'Pr\u00F3xima') {
+ getTableInfiniteSearch($('#divInfraAreaTela'), frmPesquisaProtocolo, isNewSEI ? 'table.pesquisaResultado' : 'table.resultado', nrPage);
}
}
function startPagesInfiniteSearch(index = false) {
- $(window).scroll(function () {
+ $(isNewSEI ? '#divInfraAreaTelaD' : window).scroll(function () {
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 120) {
getInfiniteSearch();
- }
+ }
});
}
function repairLnkControleProcesso() {
diff --git a/dist/js/sei-pro-arvore.js b/dist/js/sei-pro-arvore.js
index 72c1ab9..3eda290 100644
--- a/dist/js/sei-pro-arvore.js
+++ b/dist/js/sei-pro-arvore.js
@@ -1219,7 +1219,7 @@ function getInfoArvoreLastDoc(dataResult, urlParent, arrayDropzone = arvoreDropz
if (queuedFiles.length == 0) {
dropzoneAlertBoxInfo();
setTimeout(function(){ window.location.reload(); }, 500);
- if (typeof parent.parent.nextUploadFilesInProcess === 'function') parent.parent.nextUploadFilesInProcess();
+ if (typeof parent.parent.nextUploadFilesInProcess === 'function' && parent.parent.arvoreDropzone) parent.parent.nextUploadFilesInProcess();
}
});
return false;
@@ -2349,6 +2349,46 @@ function checkProcessoSigiloso() {
sessionStorageStorePro('processo_sigiloso_'+id_protocolo,true);
}
}
+function initPanelPrescricaoProcesso() {
+ var prescData = parent.arrayPrescricoesProcPro;
+ var tipos_prescricao = typeof jmespath !== 'undefined' ? jmespath.search(prescData,"[*].id_tipo_prescricao") : null;
+ if (typeof prescData !== 'undefined' && prescData.length > 0 && tipos_prescricao !== null && tipos_prescricao.length > 0) {
+ $.each(tipos_prescricao, function(i, v){
+ var value_prescricao = typeof parent.arrayConfigAtividades.tipos_prescricoes !== 'undefined' ? jmespath.search(parent.arrayConfigAtividades.tipos_prescricoes, "[?id_tipo_prescricao==`"+v+"`] | [0]") : null;
+ value_prescricao = value_prescricao !== null ? value_prescricao : false;
+ var prescricao = jmespath.search(prescData,"[?id_tipo_prescricao==`"+v+"`]");
+ prescricao = prescricao !== null ? prescricao : false;
+ var vigente = jmespath.search(prescricao, "[?data_fim=='0000-00-00 00:00:00'] | [0]");
+ vigente = vigente !== null ? vigente : false;
+ var prazo = value_prescricao ? value_prescricao.prazo : false;
+ var config = value_prescricao ? value_prescricao.config : false;
+
+ if (prazo) {
+ var decorrido = moment().diff(moment(vigente.data_inicio, 'YYYY-MM-DD HH:mm:ss'),'days');
+ var porcentagem = parseFloat(((decorrido/prazo)*100).toFixed(2));
+ var nivel_critico = config && typeof config.nivel_critico !== 'undefined' ? config.nivel_critico : 75;
+ var urgencia_nivel_critico = config && typeof config.urgencia_nivel_critico !== 'undefined' ? config.urgencia_nivel_critico : false;
+ var classUrgente = porcentagem >= nivel_critico ? 'urgente' : '';
+ var txtTip = 'Decorrido: '+decorrido+' dias ('+porcentagem+'%) In\u00EDcio: '+vigente.descricao+' ('+moment(vigente.data_inicio).format('DD/MM/YYYY HH:mm')+') Prazo: '+prazo+' dias\',\''+value_prescricao.nome_prescricao;
+
+ $('#progressPrescricao').remove();
+ $('#topmenu').append('
');
+ $('#progressPrescricao').progressbar({
+ value: decorrido,
+ max: prazo
+ });
+ $('#container').css('margin-top','35px');
+
+ setTimeout(function(){
+ if (typeof parent.dadosProcessoPro.propProcesso !== 'undefined' && parent.dadosProcessoPro.propProcesso.txtDescricao.toLowerCase().indexOf('(urgente)') === -1 && porcentagem >= nivel_critico && urgencia_nivel_critico) {
+ parent.addUrgenteProcessoPro();
+ }
+ }, 4000);
+ console.log(value_prescricao, vigente, prazo, decorrido, porcentagem, nivel_critico, urgencia_nivel_critico, parent.dadosProcessoPro);
+ }
+ })
+ }
+}
function initAnchorImg() {
$('a[id*="anchorImg"], a[id*="anchorA"], a[id*="ancjoinPASTA"]').each(function(){
var img = $(this).find('img').attr('src');
@@ -2380,6 +2420,7 @@ function initOnClickPasta() {
function initSeiProArvore(loop = true) {
loadStyleDesign();
checkProcessoSigiloso();
+ initPanelPrescricaoProcesso();
arrayLinksArvore = getLinksArvore();
arrayLinksPage = getLinksPage();
parent.linksArvore = getLinksPage();
diff --git a/dist/js/sei-pro-atividades.js b/dist/js/sei-pro-atividades.js
index d40c81b..4524a4b 100644
--- a/dist/js/sei-pro-atividades.js
+++ b/dist/js/sei-pro-atividades.js
@@ -15,6 +15,7 @@ var tableConfigEditor = {};
var tableConfigList = {};
var arrayAtividadesPro = (!getOptionsPro('panelLocalStorePro') && hybridStorageRestorePro('configDataAtividadesPro') !== null) ? hybridStorageRestorePro('configDataAtividadesPro') : [];
var arrayAtividadesProcPro = !getOptionsPro('panelLocalStorePro') && (hybridStorageRestorePro('configDataAtividadesProcPro') !== null) ? hybridStorageRestorePro('configDataAtividadesProcPro') : [];
+var arrayPrescricoesProcPro = !getOptionsPro('panelLocalStorePro') && (hybridStorageRestorePro('configDataPrescricoesProcPro') !== null) ? hybridStorageRestorePro('configDataPrescricoesProcPro') : [];
var checkLoadAtividadesProcPro = false;
var checkLoadFavoritesProcPro = false;
var arrayAtividades = ($('#ifrArvore').length > 0) ? arrayAtividadesProcPro : arrayAtividadesPro;
@@ -23,7 +24,10 @@ var perfilAtividadesSelected = getOptionsPro('panelAtividadesViewSyncUnidade')
: (getOptionsPro('perfilAtividadesSelected')) ? getOptionsPro('perfilAtividadesSelected') : '';
var arrayProcessosUnidade = getProcessoUnidadePro();
var arrayNomenclaturas = [];
-var lastUpdateAtividades = (!getOptionsPro('panelLocalStorePro') && hybridStorageRestorePro('lastUpdateAtividades') !== null) ? hybridStorageRestorePro('lastUpdateAtividades') : false;
+var timeRestoreAtividades = (getOptionEntidade('cache_demandas_value') && getOptionEntidade('cache_demandas_time')) ? {time: getOptionEntidade('cache_demandas_time'), value: getOptionEntidade('cache_demandas_value')} : {time: 'day', value: 1};
+var lastUpdateAtividades = (!getOptionsPro('panelLocalStorePro') && localStorageRestorePro('lastUpdateAtividades') !== null)
+ ? localStorageRestorePro('lastRestoreAtividades') !== null && moment(localStorageRestorePro('lastRestoreAtividades'),'YYYY-MM-DD HH:mm:ss').add(timeRestoreAtividades.value,timeRestoreAtividades.time) < moment() ? false : localStorageRestorePro('lastUpdateAtividades')
+ : false;
var dly;
var loadRowsPanelAtiv = false;
var indexReportUpdate = 0;
@@ -75,6 +79,7 @@ function setNameConst() {
a_demanda: getName('demanda', 'a demanda', true, true, false),
a_demanda_selecionada: getName('demanda', 'a demanda', true, true, false)+' '+getNameGenre('demanda', 'selecionado', 'selecionada'),
A_demanda: getNameGenre('demanda', 'O', 'A')+' '+__demanda,
+ As_demandas: getNameGenre('demanda', 'O', 'A')+'s '+__demandas,
da_demanda: getNameGenre('demanda', 'do', 'da')+' '+__demanda,
esta_demanda: getNameGenre('demanda', 'este', 'esta')+' '+__demanda,
a_outra_demanda_vinculada: getNameGenre('demanda', 'o outro', 'a outra')+' '+__demanda+' '+getNameGenre('demanda', 'vinculado', 'vinculada'),
@@ -110,6 +115,9 @@ function setNameConst() {
Paralisada: getName('paralisada', 'Paralisada', true, false, true),
paralisacao: getName('paralisacao', 'paralisa\u00E7\u00E3o', true, false, false),
Paralisacao: getName('paralisacao', 'Paralisa\u00E7\u00E3o', true, false, true),
+ prescricao: getName('prescricao', 'prescri\u00E7\u00E3o', true, false, false),
+ Prescricao: getName('prescricao', 'Prescri\u00E7\u00E3o', true, false, true),
+ Prescricoes: getName('prescricao', 'Prescri\u00E7\u00F5es', false, false, true),
retomada: getName('retomada', 'retomada', true, false, false),
Retomada: getName('retomada', 'Retomada', true, false, true),
retomar: getName('retomar', 'retomar', true, false, false),
@@ -255,6 +263,7 @@ function getServerAtividades(param, mode) {
}
} else if (mode == 'edit_tempos') {
updateServerTemposDemanda('reset', param.mode, false, ativData, param);
+ $('.update_tempos_demanda').removeClass('fa-spin');
} else if (mode == 'edit_documento') {
loadingButtonConfirm(false);
if (param.reference == 'modelo') {
@@ -277,6 +286,11 @@ function getServerAtividades(param, mode) {
resetDialogBoxPro('dialogBoxPro');
updateAtividade();
alertaBoxPro('Sucess', 'check-circle', 'Justificativa cadastrada com sucesso!');
+ } else if (mode == 'config_new_planos' && param.mode == 'new') {
+ resetDialogBoxPro('dialogBoxPro');
+ alertaBoxPro('Sucess', 'check-circle', 'Plano de trabalho cadastrado com sucesso!');
+ } else if (mode == 'config_update_tipos_capacidades' && param.mode == 'update') {
+ updateConfigPerfilCapacidade(param, ativData);
}
} else if (mode == 'view_contato') {
setTableContatoPanel(ativData['result']);
@@ -288,9 +302,10 @@ function getServerAtividades(param, mode) {
} else if (mode.indexOf('config_') !== -1) {
loadingButtonConfirm(false);
- if (typeof ativData['padrao'] !== 'undefined' && ativData['padrao'] !== null && (mode == 'config_users' || mode == 'config_unidades' || mode == 'config_tipos_modalidades')) {
- arrayConfigAtividades['unidades_all'] = ativData['padrao']['unidades_all'];
- arrayConfigAtividades['perfis'] = ativData['padrao']['perfis'];
+ if (typeof ativData['padrao'] !== 'undefined' && ativData['padrao'] !== null && (mode == 'config_users' || mode == 'config_unidades' || mode == 'config_tipos_modalidades' || mode == 'config_tipos_capacidades' || mode == 'config_perfis')) {
+ if (typeof ativData['padrao']['unidades_all'] !== 'undefined') arrayConfigAtividades['unidades_all'] = ativData['padrao']['unidades_all'];
+ if (typeof ativData['padrao']['perfis'] !== 'undefined') arrayConfigAtividades['perfis'] = ativData['padrao']['perfis'];
+ if (typeof ativData['padrao']['tipos_capacidades'] !== 'undefined') arrayConfigAtividades['tipos_capacidades'] = ativData['padrao']['tipos_capacidades'];
}
if (typeof ativData['padrao'] !== 'undefined' && ativData['padrao'] !== null && (mode == 'config_planos')) {
arrayConfigAtividades['tipos_modalidades'] = ativData['padrao']['tipos_modalidades'];
@@ -304,6 +319,9 @@ function getServerAtividades(param, mode) {
}
}
+ if (typeof ativData['config'] !== 'undefined' && ativData['config'] !== null && (mode == 'config_tipos_prescricoes')) {
+ arrayConfigAtividades['tipos_prescricoes'] = ativData['config'];
+ }
if (typeof ativData['config'] !== 'undefined' && ativData['config'] !== null && (mode == 'config_cadeia_valor')) {
arrayConfigAtividades['cadeia_valor'] = ativData['config'];
}
@@ -390,11 +408,16 @@ function getServerAtividades(param, mode) {
appendDataDemandaOnLocalArray(ativData['demandas'], 'demandas');
} else {
arrayAtividadesPro = ativData['demandas'];
+ localStorageStorePro('lastRestoreAtividades', moment().format('YYYY-MM-DD HH:mm:ss'));
}
}
if (typeof ativData['demandas_processo'] !== 'undefined' && ativData['demandas_processo'] !== null && isInitOffset) {
arrayAtividadesProcPro = ativData['demandas_processo'];
}
+ if (typeof ativData['prescricoes_processo'] !== 'undefined' && ativData['prescricoes_processo'] !== null && isInitOffset) {
+ arrayPrescricoesProcPro = ativData['prescricoes_processo'];
+ initPanelPrescricaoProc();
+ }
if (typeof ativData['demandas_excluidas'] !== 'undefined' && ativData['demandas_excluidas'] !== null && ativData['demandas_excluidas'].length > 0 && isInitOffset) {
$.each(ativData['demandas_excluidas'], function(i, v){
removeRowsPanelAtividades(v.id_demanda);
@@ -410,7 +433,7 @@ function getServerAtividades(param, mode) {
storeLocalDataConfigArray(arrayConfigAtividades);
lastUpdateAtividades = (!getOptionsPro('panelLocalStorePro') && typeof ativData['last_update'] !== 'undefined' && ativData['last_update']) ? ativData['last_update'] : lastUpdateAtividades;
- hybridStorageStorePro('lastUpdateAtividades', lastUpdateAtividades);
+ localStorageStorePro('lastUpdateAtividades', lastUpdateAtividades);
var ativDataPanel = false;
var _caption = $('#tabelaAtivPanel table caption.infraCaption');
@@ -501,14 +524,17 @@ function getServerAtividades(param, mode) {
mode == 'pause_atividade' ||
mode == 'pause_atividade_remove' ||
mode == 'start_cancel_atividade' ||
+ mode == 'start_cancel_atividades' ||
mode == 'complete_atividade' ||
mode == 'complete_atividade_parcial' ||
mode == 'complete_edit_atividade' ||
mode == 'complete_cancel_atividade' ||
+ mode == 'complete_cancel_atividades' ||
mode == 'rate_atividade' ||
mode == 'rate_atividades' ||
mode == 'rate_edit_atividade' ||
mode == 'rate_cancel_atividade' ||
+ mode == 'rate_cancel_atividades' ||
mode == 'send_atividade' ||
mode == 'send_cancel_atividade' ||
mode == 'notify_send' ||
@@ -541,11 +567,14 @@ function getServerAtividades(param, mode) {
txtAlert = (mode == 'complete_atividade_parcial') ? __.Demanda+' residual '+getNameGenre('demanda', 'cadastrado', 'cadastrada') : txtAlert;
txtAlert = (mode == 'complete_edit_atividade') ? __.Demanda+' '+getNameGenre('demanda', 'editado', 'editada') : txtAlert;
txtAlert = (mode == 'start_cancel_atividade') ? 'In\u00EDcio de '+__.demanda+' cancelado' : txtAlert;
+ txtAlert = (mode == 'start_cancel_atividades') ? 'In\u00EDcio de '+__.demandas+' cancelado' : txtAlert;
txtAlert = (mode == 'complete_cancel_atividade') ? 'Conclus\u00E3o de '+__.demanda+' cancelada' : txtAlert;
+ txtAlert = (mode == 'complete_cancel_atividades') ? 'Conclus\u00E3o de '+__.demandas+' cancelada' : txtAlert;
txtAlert = (mode == 'rate_atividade') ? 'Avalia\u00E7\u00E3o cadastrada' : txtAlert;
txtAlert = (mode == 'rate_atividades') ? 'Avalia\u00E7\u00F5es cadastradas' : txtAlert;
txtAlert = (mode == 'rate_edit_atividade') ? 'Avalia\u00E7\u00E3o editada' : txtAlert;
txtAlert = (mode == 'rate_cancel_atividade') ? 'Avalia\u00E7\u00E3o cancelada' : txtAlert;
+ txtAlert = (mode == 'rate_cancel_atividades') ? 'Avalia\u00E7\u00F5es canceladas' : txtAlert;
txtAlert = (mode == 'send_atividade') ? (ativData['update_demandas'].length == 1 ? __.Demanda+' '+__.arquivada : __.Demandas+' '+__.arquivadas) : txtAlert;
txtAlert = (mode == 'send_cancel_atividade') ? __.Arquivamento+' de '+__.demanda+' '+getNameGenre('arquivamento', 'cancelado', 'cancelado') : txtAlert;
txtAlert = (mode == 'save_afastamento') ? 'Afastamento salvo' : txtAlert;
@@ -670,11 +699,11 @@ function getServerAtividades(param, mode) {
removeRowsPanelAtividades(param.id_demanda);
}
if (
- mode == 'complete_atividade' || mode == 'complete_edit_atividade' || mode == 'complete_atividade_parcial' || mode == 'complete_cancel_atividade' ||
+ mode == 'complete_atividade' || mode == 'complete_edit_atividade' || mode == 'complete_atividade_parcial' || mode == 'complete_cancel_atividade' || mode == 'complete_cancel_atividades' ||
mode == 'save_atividade' || mode == 'edit_atividade' || mode == 'pause_atividade' ||
- mode == 'rate_atividade' || mode == 'rate_atividades' || mode == 'rate_cancel_atividade' || mode == 'rate_default_atividade' || mode == 'rate_edit_atividade' ||
+ mode == 'rate_atividade' || mode == 'rate_atividades' || mode == 'rate_cancel_atividade' || mode == 'rate_cancel_atividades' || mode == 'rate_default_atividade' || mode == 'rate_edit_atividade' ||
mode == 'send_atividade' || mode == 'send_cancel_atividade' ||
- mode == 'start_atividade' || mode == 'start_cancel_atividade' ||
+ mode == 'start_atividade' || mode == 'start_cancel_atividade' || mode == 'start_cancel_atividades' ||
mode == 'type_atividade' || mode == 'extend_atividade' || mode == 'variation_atividade' ||
mode == 'delete_atividade'
) {
@@ -687,12 +716,16 @@ function getServerAtividades(param, mode) {
indexReportUpdate = 0;
checkUpdateReports();
}
+ if (typeof arrayConfigAtividades !== 'undefined' && typeof arrayConfigAtividades.perfil !== 'undefined' &&typeof arrayConfigAtividades.perfil.nivel !== 'undefined' && arrayConfigAtividades.perfil.nivel == 1 && checkOptionEntidade('sincronizar_dados_externos')) {
+ indexReportUpdate = 0;
+ checkSyncDadoExterno();
+ }
}
}
}
}).fail(function(data, textStatus){
- loadingButtonConfirm(false);
if (typeof param.type !== 'undefined') { resetButtonTabConfig('.actionsConfig_'+param.type) }
+ if (typeof data.refresh_page !== 'undefined' && data.refresh_page) cleanAtivParams();
failureScreen(data, textStatus);
});
} else {
@@ -840,6 +873,11 @@ function repairPerfilSelectUnidade() {
}
}
function failureScreen(data, textStatus) {
+ loadingButtonConfirm(false);
+ $('.panelHome').find('.iconAtividade_update i').removeClass('fa-spin');
+ $('#tabsPanelConfig').find('.ui-tabs-anchor i').removeClass('fa-spin').removeClass('fa-spinner');
+ $('.dataFallback').removeClass('dataLoading');
+
var dataResponse = $("
").html(data.responseText).text();
dataResponse = (dataResponse) ? dataResponse.trim() : '';
var htmlReportError = ''+
@@ -862,6 +900,7 @@ function failureScreen(data, textStatus) {
'
';
var textError = (textStatus === 'timeout' || dataResponse == '') ? 'Erro ao receber sua informa\u00E7\u00F5es do servidor de dados. Tente novamente mais tarde. ('+textStatus+')' : 'Erro ao enviar sua informa\u00E7\u00F5es. Tente novamente mais tarde ou notifique o administrador.'+htmlReportError;
alertaBoxPro('Error', 'exclamation-triangle', textError);
+ getInsertIconAtividade();
}
function sendErrorReport(this_) {
var _this = $(this_);
@@ -2284,6 +2323,7 @@ function setPanelAtividades(storeAtividades = arrayAtividadesPro) {
(checkCapacidade('config_users') ? getHtmlActionsConfig('users') : '')+
(checkCapacidade('config_unidades') ? getHtmlActionsConfig('unidades') : '')+
(checkCapacidade('config_cadeia_valor') ? getHtmlActionsConfig('cadeia_valor') : '')+
+ (checkCapacidade('config_tipos_prescricoes') ? getHtmlActionsConfig('tipos_prescricoes') : '')+
(checkCapacidade('config_tipos_documentos') ? getHtmlActionsConfig('tipos_documentos') : '')+
(checkCapacidade('config_tipos_requisicoes') ? getHtmlActionsConfig('tipos_requisicoes') : '')+
(checkCapacidade('config_tipos_justificativas') ? getHtmlActionsConfig('tipos_justificativas') : '')+
@@ -2453,8 +2493,8 @@ function getBtnActionsAtividade(value, more_options = false) {
return btnActionAtiv;
}
function awaitRowsPanelAtividades(id_demanda) {
- $('#tabelaAtivPanel tr[data-index="'+id_demanda+'"] td[data-type="action"] a[onclick*="actionsAtividade"] i').attr('class','fas fa-spinner fa-spin');
- $('#kanbanAtivPanel .kanban-item[data-eid="_id_'+id_demanda+'"] .drag_handler_icon').attr('class','fas fa-spinner fa-spin').css({'font-size': '160%', 'color': '#4385f4', 'margin-top': '5px'});
+ $('#tabelaAtivPanel tr[data-index="'+id_demanda+'"] td[data-type="action"] a[onclick*="actionsAtividade"] i').attr('class','fas fa-spinner fa-spin fa-pulse');
+ $('#kanbanAtivPanel .kanban-item[data-eid="_id_'+id_demanda+'"] .drag_handler_icon').attr('class','fas fa-spinner fa-spin fa-pulse').css({'font-size': '160%', 'color': '#4385f4', 'margin-top': '5px'});
}
function getRowsPanelAtividades(storeAtividades, target) {
function setRowsPanelAtividades(value, index) {
@@ -2665,15 +2705,16 @@ function getHtmlActionsConfig(type) {
param = (type == 'users') ? {name_new: 'Novo Usu\u00E1rio', name: 'Usu\u00E1rios', icon: 'fas fa-users', index: 4} : param;
param = (type == 'unidades') ? {name_new: 'Nova Unidade', name: 'Unidades', icon: 'fas fa-briefcase', index: 5} : param;
param = (type == 'cadeia_valor') ? {name_new: 'Novo Processo', name: 'Cadeia de Valor', icon: 'fas fa-share-alt', index: 6} : param;
- param = (type == 'tipos_documentos') ? {name_new: 'Novo Tipo de Documento', name: 'Tipo de Documento', icon: 'fas fa-file-alt', index: 7} : param;
- param = (type == 'tipos_requisicoes') ? {name_new: 'Novo Tipo de Requisi\u00E7\u00E3o', name: 'Tipo de Requisi\u00E7\u00E3o', icon: 'fas fa-inbox', index: 8} : param;
- param = (type == 'tipos_justificativas') ? {name_new: 'Novo Tipo de Justificativa de Avalia\u00E7\u00E3o', name: 'Tipo de Justificativa', icon: 'fas fa-star', index: 9} : param;
- param = (type == 'tipos_modalidades') ? {name_new: 'Novo Tipo de Modalidade de Trabalho', name: 'Tipo de Modalidade', icon: 'fas fa-wrench', index: 10} : param;
- param = (type == 'tipos_motivos') ? {name_new: 'Novo Tipo de Motivo de Afastamento', name: 'Tipo de Motivo', icon: 'fas fa-luggage-cart', index: 11} : param;
- param = (type == 'tipos_capacidades') ? {name_new: 'Novo Tipo de Capacidade', name: 'Tipo de Capacidade', icon: 'fas fa-users-cog', index: 12} : param;
- param = (type == 'perfis') ? {name_new: 'Novo Tipo de Perfil', name: 'Tipo de Perfil', icon: 'fas fa-shield-alt', index: 13} : param;
- param = (type == 'nomenclaturas') ? {name_new: 'Nova Nomenclatura', name: 'Nomenclatura', icon: 'fas fa-ad', index: 14} : param;
- param = (type == 'entidades') ? {name_new: 'Nova Entidade', name: 'Entidades', icon: 'fas fa-university', index: 15} : param;
+ param = (type == 'tipos_prescricoes') ? {name_new: 'Novo Tipo de '+__.Prescricao+'', name: __.Prescricao, icon: 'fas fa-history', index: 7} : param;
+ param = (type == 'tipos_documentos') ? {name_new: 'Novo Tipo de Documento', name: 'Tipo de Documento', icon: 'fas fa-file-alt', index: 8} : param;
+ param = (type == 'tipos_requisicoes') ? {name_new: 'Novo Tipo de Requisi\u00E7\u00E3o', name: 'Tipo de Requisi\u00E7\u00E3o', icon: 'fas fa-inbox', index: 9} : param;
+ param = (type == 'tipos_justificativas') ? {name_new: 'Novo Tipo de Justificativa de Avalia\u00E7\u00E3o', name: 'Tipo de Justificativa', icon: 'fas fa-star', index: 10} : param;
+ param = (type == 'tipos_modalidades') ? {name_new: 'Novo Tipo de Modalidade de Trabalho', name: 'Tipo de Modalidade', icon: 'fas fa-wrench', index: 11} : param;
+ param = (type == 'tipos_motivos') ? {name_new: 'Novo Tipo de Motivo de Afastamento', name: 'Tipo de Motivo', icon: 'fas fa-luggage-cart', index: 12} : param;
+ param = (type == 'tipos_capacidades') ? {name_new: 'Novo Tipo de Capacidade', name: 'Tipo de Capacidade', icon: 'fas fa-users-cog', index: 13} : param;
+ param = (type == 'perfis') ? {name_new: 'Novo Tipo de Perfil', name: 'Tipo de Perfil', icon: 'fas fa-shield-alt', index: 14} : param;
+ param = (type == 'nomenclaturas') ? {name_new: 'Nova Nomenclatura', name: 'Nomenclatura', icon: 'fas fa-ad', index: 15} : param;
+ param = (type == 'entidades') ? {name_new: 'Nova Entidade', name: 'Entidades', icon: 'fas fa-university', index: 16} : param;
var html = ' '+
(checkCapacidade('config_new_'+type) ?
@@ -2840,7 +2881,7 @@ function initPanelAtividadesView() {
}
function removeLocalDataAtiv(force = false) {
removeLocalDataConfigArray();
- hybridStorageRemovePro('lastUpdateAtividades');
+ localStorageRemovePro('lastUpdateAtividades');
hybridStorageRemovePro('configDataAtividadesPro');
hybridStorageRemovePro('configDataAtividadesProcPro');
hybridStorageRemovePro('configDataAtividadesPadraoPro');
@@ -3095,6 +3136,7 @@ function openModalConfigPanel(){
(checkCapacidade('config_users') ? getHtmlActionsConfig('users') : '')+
(checkCapacidade('config_unidades') ? getHtmlActionsConfig('unidades') : '')+
(checkCapacidade('config_cadeia_valor') ? getHtmlActionsConfig('cadeia_valor') : '')+
+ (checkCapacidade('config_tipos_prescricoes') ? getHtmlActionsConfig('tipos_prescricoes') : '')+
(checkCapacidade('config_tipos_documentos') ? getHtmlActionsConfig('tipos_documentos') : '')+
(checkCapacidade('config_tipos_requisicoes') ? getHtmlActionsConfig('tipos_requisicoes') : '')+
(checkCapacidade('config_tipos_justificativas') ? getHtmlActionsConfig('tipos_justificativas') : '')+
@@ -3139,6 +3181,9 @@ function getTabsConfigPanel(panel = 'panelInfoHomeConfiguracao') {
(checkCapacidade('config_cadeia_valor') ?
' Cadeia de Valor '+
'' : '')+
+ (checkCapacidade('config_tipos_prescricoes') ?
+ ' Tipos de '+__.Prescricoes+' '+
+ '' : '')+
(checkCapacidade('config_tipos_documentos') ?
' Tipos de Documentos '+
'' : '')+
@@ -3188,6 +3233,9 @@ function getTabsConfigPanel(panel = 'panelInfoHomeConfiguracao') {
(checkCapacidade('config_cadeia_valor') ?
' '+
'' : '')+
+ (checkCapacidade('config_tipos_prescricoes') ?
+ ' '+
+ '' : '')+
(checkCapacidade('config_tipos_documentos') ?
' '+
'' : '')+
@@ -3283,7 +3331,7 @@ function getTabConfig(type, mode, data = false, loop = true) {
getServerAtividades(param, action);
$('#tabs-'+type).find('.dataFallback').addClass('dataLoading');
var iconTab = $('a[href="#tabs-'+type+'"]').find('i');
- iconTab.toggleClass('fa-'+iconTab.attr('data-icon')+' fa-spinner').addClass('fa-spin');
+ iconTab.addClass('fa-spinner').addClass('fa-spin');
} else if ((checkCapacidade('config_'+type) || checkCapacidade('config_self_'+type)) && mode == 'set') {
if (typeof SimpleTableCellEditor === 'undefined' && loop) {
@@ -3295,7 +3343,7 @@ function getTabConfig(type, mode, data = false, loop = true) {
getTableTabConfig(type, data);
infraTooltipOcultar();
var iconTab = $('a[href="#tabs-'+type+'"]').find('i');
- iconTab.toggleClass('fa-'+iconTab.attr('data-icon')+' fa-spinner').removeClass('fa-spin');
+ iconTab.removeClass('fa-spinner').removeClass('fa-spin');
}
}
}
@@ -3381,6 +3429,10 @@ function changeSelectConfigItem(this_) {
console.log(data_tr, value_txt, value, td.data());
tr.find('td').eq(1).text(value);
}
+ if (td.data('key') == 'tipos_prescricoes') {
+ console.log(data_tr, value_txt, value, td.data());
+ tr.find('td').eq(1).text(value);
+ }
if (table.data('format') == 'obj_mult') {
value = (value == '') ? 'remove' : value;
@@ -3392,7 +3444,7 @@ function changeSelectConfigItem(this_) {
} else {
table.find('tbody tr:last-child').find('td:first-child').trigger('click');
}
- if (tr.find('td').length == 2 && tr.data('index') == table.find('tbody tr').length-1 && value_txt != '' && (data_tr.key != 'perfil' || data_tr.key != 'cadeia_valor')) {
+ if (tr.find('td').length == 2 && tr.data('index') == table.find('tbody tr').length-1 && value_txt != '' && (data_tr.key != 'perfil' || data_tr.key != 'cadeia_valor' || data_tr.key != 'tipos_prescricoes')) {
addConfigItem(this_);
}
@@ -3832,7 +3884,7 @@ function getRowsTableTabConfig(type, mode, list = false, value = false) {
'
';
}
} else {
- var colspan = 6;
+ var colspan = 7;
colspan = (checkCapacidade('config_update_'+type)) ? colspan+1 : colspan;
colspan = (checkOutrasUnidades) ? colspan+1 : colspan;
_return = '