From 4af3566d962a1a7d9a837ff81da6831b366fbd3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Maur=C3=ADcio?= Date: Fri, 2 May 2014 17:05:54 +0000 Subject: [PATCH] git-svn-id: https://svn.coded.pt/svn/SIPRP@1886 bb69d46d-e84e-40c8-a05a-06db0d633741 --- .../static/html/app/Form1/Form1Controller.js | 28 +- .../static/html/app/Form1/Form1View.html | 43 +- .../static/html/app/Login/LoginController.js | 2 +- .../static/html/app/Login/LoginView.html | 2 +- .../static/html/app/Main/MainController.js | 2 +- .../html/app/SearchForm/SearchController.js | 34 +- .../html/app/SearchForm/SearchView.html | 20 +- .../static/html/app/directives/customCombo.js | 110 +- .../html/app/directives/pagingToolbar.js | 20 +- .../static/html/app/services/Plugins.js | 100 +- .../WebContent/static/html/css/theme.css | 76 +- .../WebContent/static/html/index.html | 11 +- .../html/js/bootstrap-select/CONTRIBUTING.md | 87 ++ .../static/html/js/bootstrap-select/README.md | 61 ++ .../js/bootstrap-select/bootstrap-select.css | 309 ++++++ .../bootstrap-select.jquery.json | 29 + .../js/bootstrap-select/bootstrap-select.js | 977 ++++++++++++++++++ .../bootstrap-select/bootstrap-select.min.css | 7 + .../bootstrap-select/bootstrap-select.min.js | 8 + .../html/js/bootstrap-select/bower.json | 29 + .../html/js/bootstrap-select/composer.json | 17 + .../bootstrap-select/i18n/defaults-es-CL.js | 29 + .../i18n/defaults-es-CL.min.js | 6 + .../js/bootstrap-select/i18n/defaults-eu.js | 30 + .../bootstrap-select/i18n/defaults-eu.min.js | 6 + .../bootstrap-select/i18n/defaults-pt_BR.js | 33 + .../i18n/defaults-pt_BR.min.js | 7 + .../bootstrap-select/i18n/defaults-ru-RU.js | 31 + .../i18n/defaults-ru_RU.min.js | 6 + .../html/js/bootstrap-select/package.json | 31 + .../static/html/js/bootstrap-select/test.html | 62 ++ .../WebContent/static/html/views-all.html | 2 +- 32 files changed, 2067 insertions(+), 148 deletions(-) create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/CONTRIBUTING.md create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/README.md create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.css create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.jquery.json create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.js create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.min.css create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.min.js create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bower.json create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/composer.json create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/i18n/defaults-es-CL.js create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/i18n/defaults-es-CL.min.js create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/i18n/defaults-eu.js create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/i18n/defaults-eu.min.js create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/i18n/defaults-pt_BR.js create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/i18n/defaults-pt_BR.min.js create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/i18n/defaults-ru-RU.js create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/i18n/defaults-ru_RU.min.js create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/package.json create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/test.html diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js index f56f57c6..c90ddf81 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js @@ -19,6 +19,8 @@ $scope.add = function(selected){ + globals.plugins.buildFloatingSideMenu(); + $scope.editForm.$reset(); $scope.editing = angular.copy(selected); @@ -27,17 +29,12 @@ $scope.editing.antecentesOcupacionaisAcidentesTrabalho = []; $scope.editing.antecentesOcupacionaisDoencasProfissionais = []; $scope.editing.antecentesOcupacionaisActividadesAnteriores = []; - - globals.plugins.buildSideMenu({ - onItemClick: function(e){ - - $('#modalDocumentosTrabalhador').modal('show'); - } - }); }; $scope.edit = function(selected){ + globals.plugins.buildFloatingSideMenu(); + $timeout(function () { $scope.editForm.$reset(); @@ -53,13 +50,6 @@ $scope.editing = angular.copy($scope.selected); }); - globals.plugins.buildSideMenu({ - onItemClick: function(e){ - - $('#modalDocumentosTrabalhador').modal('show'); - } - }); - }, 0); //listeners @@ -100,7 +90,7 @@ if(response.success && complete) { - globals.plugins.hideSideMenu(); + globals.plugins.hideFloatingSideMenu(); $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){ @@ -193,7 +183,7 @@ className: 'btn-danger', callback: function() { - globals.plugins.hideSideMenu(); + globals.plugins.hideFloatingSideMenu(); $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){ @@ -208,7 +198,7 @@ $scope.save(false); - globals.plugins.hideSideMenu(); + globals.plugins.hideFloatingSideMenu(); $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){ @@ -221,7 +211,7 @@ }); }; - $scope.$on('afterrender', function(event, args){ - + $scope.$on('afterrender', function(event, args){ + }); }); \ No newline at end of file diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1View.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1View.html index 4a75258f..d2954474 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1View.html +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1View.html @@ -20,7 +20,7 @@
-

1 - Identificação

+

1 - Identificação

1.1 - Empresa
@@ -234,7 +234,7 @@
-

2 - Actividade

+

2 - Actividade

@@ -584,7 +584,7 @@
-

3 - Antecedentes Ocupacionais

+

3 - Antecedentes Ocupacionais

@@ -873,7 +873,7 @@
-

4 - Antecedentes Pessoais

+

4 - Antecedentes Pessoais

@@ -1537,7 +1537,7 @@
-

5 - Hábitos

+

5 - Hábitos

@@ -1812,7 +1812,7 @@
-

6 - Antecedentes Familiares

+

6 - Antecedentes Familiares

@@ -2232,7 +2232,7 @@ -

7 - Exame Objectivo

+

7 - Exame Objectivo

7.1 - Biometria
@@ -2718,7 +2718,7 @@
-

8 - Doenças Activas

+

8 - Doenças Activas

@@ -3358,7 +3358,7 @@
-

9 - Classificação Individual de Saúde

+

9 - Classificação Individual de Saúde

@@ -3410,7 +3410,7 @@
-

10 - Absentismo

+

10 - Absentismo

@@ -3424,7 +3424,7 @@
-

11 - Esquema Vacinal

+

11 - Esquema Vacinal

@@ -3538,7 +3538,7 @@
-

12 - Conclusões/Resumo

+

12 - Conclusões/Resumo

@@ -3552,7 +3552,7 @@
-

13 - Propostas de Solução

+

13 - Propostas de Solução

@@ -3566,7 +3566,7 @@
-

14 - Observações

+

14 - Observações

@@ -3574,10 +3574,9 @@
-
-

15 - Parecer

+

15 - Parecer

@@ -3611,7 +3610,7 @@
-

16 - Reavaliação

+

16 - Reavaliação

@@ -3680,15 +3679,12 @@
-

17 - Data do Exame

+

17 - Data do Exame

- - - - +
@@ -3699,7 +3695,6 @@
-
@@ -3710,7 +3705,6 @@

 

 

-
- +
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js index 5153a5a5..7e1af293 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js @@ -347,7 +347,7 @@ if(!isInMainPanel) { //add current module to main-panel if not there yet - module.domEl.appendTo($scope.divMainPanel); + module.domEl.appendTo($scope.divMainPanel); } } diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js index de497658..b8f06705 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js @@ -68,6 +68,7 @@ $scope.storeFichasTrabalhador.items = []; $scope.comboEmpresas.setValue(null); + $scope.comboEstabelecimentos.clear(); $scope.comboTrabalhadores.clear(); }; @@ -76,32 +77,42 @@ $scope.comboEstabelecimentos.clear(); $scope.comboTrabalhadores.clear(); + $scope.storeFichasTrabalhador.items = []; - $scope.comboEstabelecimentos.store.extraParams = { - empresaID: selectedRecord.id - }; + if(selectedRecord) + { + $scope.comboEstabelecimentos.store.extraParams = { + empresaID: selectedRecord.id + }; - $scope.comboEstabelecimentos.loadStore(function(response, status, headers, config, items){ + $scope.comboEstabelecimentos.loadStore(function(response, status, headers, config, items){ - }); + }); + } }; $scope.onEstabelecimentoChange = function(selectedValue, selectedRecord){ $scope.comboTrabalhadores.setValue(null); $scope.comboTrabalhadores.clear(); + $scope.storeFichasTrabalhador.items = []; - $scope.comboTrabalhadores.store.extraParams = { - estabelecimentoID: selectedRecord.id - }; + if(selectedRecord) + { + $scope.comboTrabalhadores.store.extraParams = { + estabelecimentoID: selectedRecord.id + }; - $scope.comboTrabalhadores.loadStore(function(response, status, headers, config, items){ + $scope.comboTrabalhadores.loadStore(function(response, status, headers, config, items){ - }); + }); + } }; $scope.onTrabalhadorChange = function(selectedValue, selectedRecord){ - + + $scope.storeFichasTrabalhador.items = []; + $scope.storeResumoTrabalhador.extraParams = { trabalhadorID: selectedRecord.id }; @@ -116,7 +127,6 @@ } var fichas = response.data.fichas; - $scope.storeFichasTrabalhador.items = []; $scope.storeFichasTrabalhador.loadData(fichas); } }); diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html index 51031e3a..a4377a30 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html @@ -30,7 +30,7 @@ store-actions-get="getEmpresas" value-field="id" display-field="designacao_social" - add-empty-option="false" + add-empty-option="true" on-change="onEmpresaChange(selectedValue, selectedRecord)">
@@ -47,7 +47,7 @@ store-actions-get="getEstabelecimentos" value-field="id" display-field="nome" - add-empty-option="false" + add-empty-option="true" on-change="onEstabelecimentoChange(selectedValue, selectedRecord)">
@@ -64,7 +64,7 @@ store-actions-get="getTrabalhadores" value-field="id" display-field="nome" - add-empty-option="false" + add-empty-option="true" on-change="onTrabalhadorChange(selectedValue, selectedRecord)">
@@ -89,7 +89,7 @@

Fichas

-
+
@@ -104,22 +104,24 @@ - + -
{{item.concluido ? 'Concluido' : 'Em Aberto'}}{{item.concluido ? 'Concluido' : 'Em Aberto'}} -
+ + +
-
+
-
+
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/customCombo.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/customCombo.js index 5fe8ce8d..717888c3 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/customCombo.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/customCombo.js @@ -1,6 +1,10 @@ //select2 documentation: http://ivaynberg.github.io/select2/index.html -evoapp.directive('customCombo', function() { +// angularui select2: https://github.com/angular-ui/ui-select2/blob/master/src/select2.js + +// http://silviomoreto.github.io/bootstrap-select/ + +evoapp.directive('customCombo', function($timeout) { //http://www.befundoo.com/university/tutorials/angularjs-directives-tutorial/ @@ -16,8 +20,8 @@ evoapp.directive('customCombo', function() { require: '^ngController', restrict: 'AE', template: - '' + + '' + '' + '', scope: { @@ -63,6 +67,16 @@ evoapp.directive('customCombo', function() { sort: $scope.displayField }); + $scope.$watch('store.items', function() { + + $timeout(function () { + + $scope.domEl.selectpicker('deselectAll'); + + $scope.domEl.selectpicker('refresh'); + }); + }); + $scope.options = []; $scope.getSelected = function(record){ @@ -84,12 +98,6 @@ evoapp.directive('customCombo', function() { $scope.options = $scope.store.items; - //$timeout(function () { - - // $scope.setValue(null); - // angular.element($scope.domEl).triggerHandler('select'); - //}); - if(callBackFn != null) { callback(callBackFn, [response, status, headers, config, items]); @@ -98,20 +106,17 @@ evoapp.directive('customCombo', function() { }; $scope.setValue = function(newValue){ - + + $scope.domEl.selectpicker('deselectAll'); + var option = $scope.domEl.find('option[value=' + newValue + ']'); if(option.length > 0) { var record = angular.element(option[0]).scope(); - if(record) - { - $($scope.domEl).val(newValue); - $($scope.domEl).select2( - 'val', newValue - ); - + if(record.item) + { //TODO: this might throw an exception - recheck it please if($scope.bindToModel === 'true') { @@ -122,18 +127,13 @@ evoapp.directive('customCombo', function() { $scope.onChange({ selectedValue: newValue, selectedRecord: record.item - }); - - $scope.domEl.blur(); + }); + + $scope.domEl.selectpicker('val', newValue); } } - else - { - $($scope.domEl).val(newValue); - $($scope.domEl).select2( - 'val', newValue - ); - } + + $scope.domEl.selectpicker('refresh'); }; $scope.loadData = function(data){ @@ -149,51 +149,45 @@ evoapp.directive('customCombo', function() { $scope.clear = function(){ $scope.store.items = []; - $scope.domEl.select2('data', null); + $scope.options = []; - $scope.domEl.find('option').remove(); + $scope.domEl.selectpicker('deselectAll'); + + $scope.domEl.selectpicker('refresh'); }; }, - link: function (scope, elem, attrs, controller) { - + link: function (scope, elem, attrs, controller) { + scope.name = attrs.name == undefined ? scope.valueField : attrs.name; - scope.elem = elem; - scope.domEl = $(elem.find('select')[0]); + scope.domEl.attr('name', scope.name); - scope.domEl.attr('name', scope.name); - - $(scope.domEl).select2({ - allowClear: true, - selectOnBlur: true - }).on('change', function(e) { - - var record = angular.element($(this).find("option:selected")).scope(); + $timeout(function () { + + scope.domEl.selectpicker({ + + }).on('change', function(e) { + + var record = angular.element($(this).find("option:selected")).scope(); - if(record) - { var value = $(this).find("option:selected").val(); - scope.$apply(function () { - - if(scope.bindToModel === 'true') - { - scope.selectedValue = value; - scope.selectedRecord = record.item; - } - - scope.onChange({ - selectedValue: value, - selectedRecord: record.item - }); + if(scope.bindToModel === 'true') + { + scope.selectedValue = value; + scope.selectedRecord = record.item; + } - elem.blur(); + scope.onChange({ + selectedValue: value, + selectedRecord: record.item }); - } + + }); + }); - } } }); diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/pagingToolbar.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/pagingToolbar.js index af6b115e..e625a268 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/pagingToolbar.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/pagingToolbar.js @@ -4,7 +4,7 @@ restrict: 'AE', template: - '
' + + '
' + '
' + '
' + @@ -14,13 +14,13 @@ '
' + '
' + - '' + - '' + - '' + - '' + + '' + + '' + '
' + '
' + @@ -40,7 +40,9 @@ scope.numberOfPages = function(){ - var numberOfPages = 0; + var numberOfPages = 0; + + scope.store.total = scope.store.items.length > 0 ? 1 : 0; if(scope.store.total > 0) { @@ -108,7 +110,7 @@ var from = (scope.store.items.length == 0 ? 0 : (scope.store.start + 1)), to = (scope.store.start + scope.store.items.length); - return $filter('stringFormat')('A mostrar {0} - {1} de {2}', [from, to, scope.store.total]); + return ('A mostrar ' + from + ' - ' + to + ' de ' + scope.store.total); }; scope.pageInfo = function(){ diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Plugins.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Plugins.js index 6b411443..0ba72a77 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Plugins.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Plugins.js @@ -1,4 +1,4 @@ - evoapp.factory('plugins', function($rootScope, utils) { + evoapp.factory('plugins', function($rootScope, utils, $timeout) { var me = this; @@ -177,7 +177,7 @@ var buildSideMenu = function(options){ // Append Button - $("body").append($("") + $('#main-panel').append($("") .addClass("form-side-menu") .attr({ "href": "#", @@ -209,10 +209,104 @@ $('#formSideMenu').remove(); }; + var buildFloatingSideMenu = function(options){ + + var wrapper = $('
'); + + var h4 = $('

Ficha Clínica

'); + var cogs = $('
'); + + cogs.click(function(e){ + + e.preventDefault(); + + if(wrapper.hasClass('active')) + { + wrapper.animate({ + left: "-" + wrapper.width() + "px" + }, 300).removeClass("active"); + } + else + { + wrapper.animate({ + left: "0" + }, 300).addClass("active"); + } + }); + + h4.append(cogs); + + wrapper.append(h4); + + var innerWrapper = $('
'); + + wrapper.append(innerWrapper); + + var menuItems = $( + '' + ); + + var links = menuItems.find('a'); + links.each(function(index) { + + $(links[index]).click(function(e){ + + wrapper.animate({ + left: "-" + wrapper.width() + "px" + }, 300).removeClass("active"); + + //var hash = $(e.target).prop('hash'); + //var position = $(hash).position(); + //$timeout(function () { + // $('html, body').animate({ scrollTop: position.top - 60 }, 'fast'); + //}); + }); + }); + + wrapper.append(menuItems); + + $('#main-panel').append(wrapper); + + $timeout(function () { + + $('body').scrollspy({ target: '#scrollspy1'}); + + //$('body').scrollspy('refresh'); + }); + }; + + var hideFloatingSideMenu = function(){ + + $('.floating-side-menu').remove(); + }; + return { setDefaults: setDefaults, setBootstrap: setBootstrap, buildSideMenu: buildSideMenu, - hideSideMenu: hideSideMenu + hideSideMenu: hideSideMenu, + + buildFloatingSideMenu: buildFloatingSideMenu, + hideFloatingSideMenu: hideFloatingSideMenu }; }); \ No newline at end of file diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/css/theme.css b/trunk/SiprpWebFichasClinicas/WebContent/static/html/css/theme.css index 1fff62cd..cbd73f15 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/css/theme.css +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/css/theme.css @@ -117,13 +117,13 @@ code { .page-title { font-weight:bold; - color:#777; + color:#000; } .section-title { text-transform:uppercase; - color:#777; + color:#000; } .form-horizontal .control-label @@ -285,7 +285,6 @@ body.modal-open { cursor:text; } - /* form side menu */ a.form-side-menu { -moz-border-radius: 0px; @@ -324,7 +323,6 @@ a.form-side-menu.visible { } /* modal dialog */ - @media (min-width: 400px) { .modal-large, .modal-medium, .modal-small @@ -350,3 +348,73 @@ a.form-side-menu.visible { width: 40%; } } + +.modal-scrollable +{ + overflow:hidden!important; +} + +/* side menu 2 */ +div.floating-side-menu { + background: #303030; + width: 205px; + position: fixed; + top: 60px; + z-index: 1002; + border-radius: 0 0 3px 0; + left: -205px; + opacity:0.9; +} + +div.floating-side-menu h4 { + background: #404040; + color: #FFF; + padding: 0px 5px 0px 5px; + margin: 0; + line-height: 30px; + font-size: 15px; + opacity:0.9; +} + +div.floating-side-menu h4 a { + background-color: #404040; + display: block; + height: 30px; + position: absolute; + right: -30px; + top: 0; + width: 30px; + font-size: 12px; + /* line-height: 38px; */ + color: #FFF; + text-align: center; + text-decoration: none; + border-radius: 0 3px 3px 0; + opacity: 0.9; +} + +div.floating-side-menu .nav +{ + font-size:12px; +} + +div.floating-side-menu .nav li a +{ + color:#ffffff; +} + +div.floating-side-menu .nav li.active a +{ + background-color: #d62d31; + color:#ffffff; +} + +.floating-side-menu .nav-pills > li > a { + border-radius: 0px; + padding: 4px 8px; +} + +.floating-side-menu .nav > li > a:hover, .nav > li > a:focus { + text-decoration: none; + background-color: #d5716e; +} diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html index 9f9a6e84..0d63a7fc 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html @@ -12,8 +12,7 @@ - - + @@ -40,8 +39,8 @@ - - + + @@ -60,6 +59,7 @@ + @@ -113,7 +113,7 @@
-
+
@@ -126,5 +126,6 @@
+ diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/CONTRIBUTING.md b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/CONTRIBUTING.md new file mode 100644 index 00000000..578e49e9 --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/CONTRIBUTING.md @@ -0,0 +1,87 @@ +# Contributing to this project + +Please take a moment to review this document in order to make the contribution +process easy and effective for everyone involved. + +Following these guidelines helps to communicate that you respect the time of +the developers managing and developing this open source project. In return, +they should reciprocate that respect in addressing your issue or assessing +patches and features. + + +## Using the issue tracker + +The issue tracker is the preferred channel for [bug reports](#bugs), +[features requests](#features) and submitting pull +requests, but please respect the following restrictions: + +* Please **do not** use the issue tracker for personal support requests (use + [Stack Overflow](http://stackoverflow.com) or IRC). + +* Please **do not** derail or troll issues. Keep the discussion on topic and + respect the opinions of others. + + + +## Bug reports + +A bug is a _demonstrable problem_ that is caused by the code in the repository. +Good bug reports are extremely helpful - thank you! + +Guidelines for bug reports: + +1. **Use the GitHub issue search.** Check if the issue has already been + reported. + +2. **Check if the issue has been fixed.** Try to reproduce it using the + latest `master` or development branch in the repository. + +3. **Provide environment details.** Provide your operating system, browser(s), jQuery version, Bootstrap version, and bootstrap-select version. + +4. **Create an isolated and reproducible test case.** Create a [reduced test + case](http://css-tricks.com/6263-reduced-test-cases/). + +5. **Include a live example.** Make use of jsFiddle or jsBin to share your isolated test cases. + +A good bug report shouldn't leave others needing to chase you up for more +information. Please try to be as detailed as possible in your report. What is +your environment? What steps will reproduce the issue? What browser(s) and OS +experience the problem? What would you expect to be the outcome? All these +details will help people to fix any potential bugs. + +Example: + +> Short and descriptive example bug report title +> +> A summary of the issue and the browser/OS environment in which it occurs. If +> suitable, include the steps required to reproduce the bug. +> +> 1. This is the first step +> 2. This is the second step +> 3. Further steps, etc. +> +> `` - a link to the reduced test case +> +> Any other information you want to share that is relevant to the issue being +> reported. This might include the lines of code that you have identified as +> causing the bug, and potential solutions (and your opinions on their +> merits). + + + +## Feature requests + +Feature requests are welcome. But take a moment to find out whether your idea +fits with the scope and aims of the project. It's up to *you* to make a strong +case to convince the project's developers of the merits of this feature. Please +provide as much detail and context as possible. + +## Pull Request Guidelines + +* To instantiate a context or use it, use the variable **that** instead of **_this**. +* Submit your CLA, if you haven't. +* Please check to make sure that there aren't existing pull requests attempting to address the issue mentioned. We also recommend checking for issues related to the issue on the tracker, as a team member may be working on the issue in a branch or fork. +* Non-trivial changes should be discussed in an issue first +* If possible, use JSlint or JSHint to validate it +* If possible, add relevant tests to cover the change +* Write a convincing description of your PR and why we should land it diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/README.md b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/README.md new file mode 100644 index 00000000..3d6cdbc5 --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/README.md @@ -0,0 +1,61 @@ +bootstrap-select +================ + +A custom select / multiselect for Bootstrap using button dropdown, designed to behave like regular Bootstrap selects; + +## Demo and Documentation + +See a Bootstrap 2.3.2 example [here](http://silviomoreto.github.com/bootstrap-select/).
+See a Bootstrap 3.0.2 example [here](http://silviomoreto.github.com/bootstrap-select/3) (work-in-progress). + +## Authors + +[Silvio Moreto](http://github.com/silviomoreto), +[Ana Carolina](http://github.com/anacarolinats), +[caseyjhol](https://github.com/caseyjhol), and +[Matt Bryson](https://github.com/mattbryson). + +## Usage + +Create your ` + + + + + +Enable Bootstrap-Select via JavaScript: + + $('.selectpicker').selectpicker(); + +Or just + + $('select').selectpicker(); + +Checkout the [documentation](http://silviomoreto.github.com/bootstrap-select/) for further information. + +## CDN + +* https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.3.5/bootstrap-select.min.js +* https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.3.5/bootstrap-select.min.css + +## Bugs and feature requests + +Anyone and everyone is welcome to contribute. Please take a moment to +review the [guidelines for contributing](CONTRIBUTING.md). Make sure you're using the latest version of bootstrap-select before submitting an issue. + +* [Bug reports](CONTRIBUTING.md#bugs) +* [Feature requests](CONTRIBUTING.md#features) + +## Copyright and license + +Copyright (C) 2013 bootstrap-select + +Licensed under the MIT license. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.css b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.css new file mode 100644 index 00000000..8444f67c --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.css @@ -0,0 +1,309 @@ +/*! + * bootstrap-select v1.5.4 + * http://silviomoreto.github.io/bootstrap-select/ + * + * Copyright 2013 bootstrap-select + * Licensed under the MIT license + */ + +.bootstrap-select.btn-group:not(.input-group-btn), +.bootstrap-select.btn-group[class*="span"] { + float: none; + display: inline-block; + margin-bottom: 10px; + margin-left: 0; +} +.form-search .bootstrap-select.btn-group, +.form-inline .bootstrap-select.btn-group, +.form-horizontal .bootstrap-select.btn-group { + margin-bottom: 0; +} + +.bootstrap-select.form-control { + margin-bottom: 0; + padding: 0; + border: none; +} + +.bootstrap-select.btn-group.pull-right, +.bootstrap-select.btn-group[class*="span"].pull-right, +.row-fluid .bootstrap-select.btn-group[class*="span"].pull-right { + float: right; +} + +.input-append .bootstrap-select.btn-group { + margin-left: -1px; +} + +.input-prepend .bootstrap-select.btn-group { + margin-right: -1px; +} + +.bootstrap-select:not([class*="span"]):not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) { + width: 220px; +} + +.bootstrap-select { + /*width: 220px\9; IE8 and below*/ + width: 220px\0; /*IE9 and below*/ +} + +.bootstrap-select.form-control:not([class*="span"]) { + width: 100%; +} + +.bootstrap-select > .btn { + width: 100%; + padding-right: 25px; +} + +.error .bootstrap-select .btn { + border: 1px solid #b94a48; +} + +.bootstrap-select.show-menu-arrow.open > .btn { + z-index: 2051; +} + +.bootstrap-select .btn:focus { + outline: thin dotted #333333 !important; + outline: 5px auto -webkit-focus-ring-color !important; + outline-offset: -2px; +} + +.bootstrap-select.btn-group .btn .filter-option { + display: inline-block; + overflow: hidden; + width: 100%; + float: left; + text-align: left; +} + +.bootstrap-select.btn-group .btn .caret { + position: absolute; + top: 50%; + right: 12px; + margin-top: -2px; + vertical-align: middle; +} + +.bootstrap-select.btn-group > .disabled, +.bootstrap-select.btn-group .dropdown-menu li.disabled > a { + cursor: not-allowed; +} + +.bootstrap-select.btn-group > .disabled:focus { + outline: none !important; +} + +.bootstrap-select.btn-group[class*="span"] .btn { + width: 100%; +} + +.bootstrap-select.btn-group .dropdown-menu { + min-width: 100%; + z-index: 2000; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.bootstrap-select.btn-group .dropdown-menu.inner { + position: static; + border: 0; + padding: 0; + margin: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.bootstrap-select.btn-group .dropdown-menu dt { + display: block; + padding: 3px 20px; + cursor: default; +} + +.bootstrap-select.btn-group .div-contain { + overflow: hidden; +} + +.bootstrap-select.btn-group .dropdown-menu li { + position: relative; +} + +.bootstrap-select.btn-group .dropdown-menu li > a.opt { + position: relative; + padding-left: 35px; +} + +.bootstrap-select.btn-group .dropdown-menu li > a { + cursor: pointer; +} + +.bootstrap-select.btn-group .dropdown-menu li > dt small { + font-weight: normal; +} + +.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a i.check-mark { + position: absolute; + display: inline-block; + right: 15px; + margin-top: 2.5px; +} + +.bootstrap-select.btn-group .dropdown-menu li a i.check-mark { + display: none; +} + +.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text { + margin-right: 34px; +} + +.bootstrap-select.btn-group .dropdown-menu li small { + padding-left: 0.5em; +} + +.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) > a:hover small, +.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) > a:focus small, +.bootstrap-select.btn-group .dropdown-menu li.active:not(.disabled) > a small { + color: #64b1d8; + color: rgba(255,255,255,0.4); +} + +.bootstrap-select.btn-group .dropdown-menu li > dt small { + font-weight: normal; +} + +.bootstrap-select.show-menu-arrow .dropdown-toggle:before { + content: ''; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #CCC; + border-bottom-color: rgba(0, 0, 0, 0.2); + position: absolute; + bottom: -4px; + left: 9px; + display: none; +} + +.bootstrap-select.show-menu-arrow .dropdown-toggle:after { + content: ''; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid white; + position: absolute; + bottom: -4px; + left: 10px; + display: none; +} + +.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before { + bottom: auto; + top: -3px; + border-top: 7px solid #ccc; + border-bottom: 0; + border-top-color: rgba(0, 0, 0, 0.2); +} + +.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after { + bottom: auto; + top: -3px; + border-top: 6px solid #ffffff; + border-bottom: 0; +} + +.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before { + right: 12px; + left: auto; +} +.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after { + right: 13px; + left: auto; +} + +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:before, +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:after { + display: block; +} + +.bootstrap-select.btn-group .no-results { + padding: 3px; + background: #f5f5f5; + margin: 0 5px; +} + +.bootstrap-select.btn-group .dropdown-menu .notify { + position: absolute; + bottom: 5px; + width: 96%; + margin: 0 2%; + min-height: 26px; + padding: 3px 5px; + background: #f5f5f5; + border: 1px solid #e3e3e3; + box-shadow: inset 0 1px 1px rgba(0,0,0,0.05); + pointer-events: none; + opacity: 0.9; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.mobile-device { + position: absolute; + top: 0; + left: 0; + display: block !important; + width: 100%; + height: 100% !important; + opacity: 0; +} + +.bootstrap-select.fit-width { + width: auto !important; +} + +.bootstrap-select.btn-group.fit-width .btn .filter-option { + position: static; +} + +.bootstrap-select.btn-group.fit-width .btn .caret { + position: static; + top: auto; + margin-top: -1px; +} + +.control-group.error .bootstrap-select .dropdown-toggle{ + border-color: #b94a48; +} + +.bootstrap-select-searchbox, +.bootstrap-select .bs-actionsbox { + padding: 4px 8px; +} + +.bootstrap-select .bs-actionsbox { + float: left; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.bootstrap-select-searchbox + .bs-actionsbox { + padding: 0 8px 4px; +} + +.bootstrap-select-searchbox input { + margin-bottom: 0; +} + +.bootstrap-select .bs-actionsbox .btn-group button { + width: 50%; +} \ No newline at end of file diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.jquery.json b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.jquery.json new file mode 100644 index 00000000..e89877b2 --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.jquery.json @@ -0,0 +1,29 @@ +{ + "name": "bootstrap-select", + "title": "Bootstrap Select", + "description": "A custom select / multiselect for Bootstrap using button dropdown, designed to behave like regular Bootstrap selects", + "keywords": [ + "form", + "bootstrap", + "select", + "replacement" + ], + "version": "1.5.4", + "author": { + "name": "Silvio Moreto", + "url": "https://github.com/silviomoreto/" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/silviomoreto/bootstrap-select#copyright-and-license" + } + ], + "bugs": "https://github.com/silviomoreto/bootstrap-select/issues", + "homepage": "https://github.com/silviomoreto/bootstrap-select", + "docs": "https://github.com/silviomoreto/bootstrap-select", + "download": "https://github.com/silviomoreto/bootstrap-select/releases", + "dependencies": { + "jquery": ">=1.7" + } +} \ No newline at end of file diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.js new file mode 100644 index 00000000..120e2749 --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.js @@ -0,0 +1,977 @@ +/*! + * bootstrap-select v1.5.4 + * http://silviomoreto.github.io/bootstrap-select/ + * + * Copyright 2013 bootstrap-select + * Licensed under the MIT license + */ + +!function($) { + + 'use strict'; + + $.expr[':'].icontains = function(obj, index, meta) { + return $(obj).text().toUpperCase().indexOf(meta[3].toUpperCase()) >= 0; + }; + + var Selectpicker = function(element, options, e) { + if (e) { + e.stopPropagation(); + e.preventDefault(); + } + this.$element = $(element); + this.$newElement = null; + this.$button = null; + this.$menu = null; + this.$lis = null; + + //Merge defaults, options and data-attributes to make our options + this.options = $.extend({}, $.fn.selectpicker.defaults, this.$element.data(), typeof options == 'object' && options); + + //If we have no title yet, check the attribute 'title' (this is missed by jq as its not a data-attribute + if (this.options.title === null) { + this.options.title = this.$element.attr('title'); + } + + //Expose public methods + this.val = Selectpicker.prototype.val; + this.render = Selectpicker.prototype.render; + this.refresh = Selectpicker.prototype.refresh; + this.setStyle = Selectpicker.prototype.setStyle; + this.selectAll = Selectpicker.prototype.selectAll; + this.deselectAll = Selectpicker.prototype.deselectAll; + this.init(); + }; + + Selectpicker.prototype = { + + constructor: Selectpicker, + + init: function() { + var that = this, + id = this.$element.attr('id'); + + this.$element.hide(); + this.multiple = this.$element.prop('multiple'); + this.autofocus = this.$element.prop('autofocus'); + this.$newElement = this.createView(); + this.$element.after(this.$newElement); + this.$menu = this.$newElement.find('> .dropdown-menu'); + this.$button = this.$newElement.find('> button'); + this.$searchbox = this.$newElement.find('input'); + + if (id !== undefined) { + this.$button.attr('data-id', id); + $('label[for="' + id + '"]').click(function(e) { + e.preventDefault(); + that.$button.focus(); + }); + } + + this.checkDisabled(); + this.clickListener(); + if (this.options.liveSearch) this.liveSearchListener(); + this.render(); + this.liHeight(); + this.setStyle(); + this.setWidth(); + if (this.options.container) this.selectPosition(); + this.$menu.data('this', this); + this.$newElement.data('this', this); + }, + + createDropdown: function() { + //If we are multiple, then add the show-tick class by default + var multiple = this.multiple ? ' show-tick' : ''; + var inputGroup = this.$element.parent().hasClass('input-group') ? ' input-group-btn' : ''; + var autofocus = this.autofocus ? ' autofocus' : ''; + var header = this.options.header ? '
' + this.options.header + '
' : ''; + var searchbox = this.options.liveSearch ? '' : ''; + var actionsbox = this.options.actionsBox ? '
' + + '
' + + '' + + '' + + '
' + + '
' : ''; + var drop = + '
' + + '' + + '' + + '
'; + + return $(drop); + }, + + createView: function() { + var $drop = this.createDropdown(); + var $li = this.createLi(); + $drop.find('ul').append($li); + return $drop; + }, + + reloadLi: function() { + //Remove all children. + this.destroyLi(); + //Re build + var $li = this.createLi(); + this.$menu.find('ul').append( $li ); + }, + + destroyLi: function() { + this.$menu.find('li').remove(); + }, + + createLi: function() { + var that = this, + _liA = [], + _liHtml = ''; + + this.$element.find('option').each(function() { + var $this = $(this); + + //Get the class and text for the option + var optionClass = $this.attr('class') || ''; + var inline = $this.attr('style') || ''; + var text = $this.data('content') ? $this.data('content') : $this.html(); + var subtext = $this.data('subtext') !== undefined ? '' + $this.data('subtext') + '' : ''; + var icon = $this.data('icon') !== undefined ? ' ' : ''; + if (icon !== '' && ($this.is(':disabled') || $this.parent().is(':disabled'))) { + icon = ''+icon+''; + } + + if (!$this.data('content')) { + //Prepend any icon and append any subtext to the main text. + text = icon + '' + text + subtext + ''; + } + + if (that.options.hideDisabled && ($this.is(':disabled') || $this.parent().is(':disabled'))) { + _liA.push(''); + } else if ($this.parent().is('optgroup') && $this.data('divider') !== true) { + if ($this.index() === 0) { + //Get the opt group label + var label = $this.parent().attr('label'); + var labelSubtext = $this.parent().data('subtext') !== undefined ? ''+$this.parent().data('subtext')+'' : ''; + var labelIcon = $this.parent().data('icon') ? ' ' : ''; + label = labelIcon + '' + label + labelSubtext + ''; + + if ($this[0].index !== 0) { + _liA.push( + '
'+ + '
'+label+'
'+ + that.createA(text, 'opt ' + optionClass, inline ) + ); + } else { + _liA.push( + '
'+label+'
'+ + that.createA(text, 'opt ' + optionClass, inline )); + } + } else { + _liA.push(that.createA(text, 'opt ' + optionClass, inline )); + } + } else if ($this.data('divider') === true) { + _liA.push('
'); + } else if ($(this).data('hidden') === true) { + _liA.push(''); + } else { + _liA.push(that.createA(text, optionClass, inline )); + } + }); + + $.each(_liA, function(i, item) { + var hide = item === '' ? 'class="hide is-hidden"' : ''; + _liHtml += '
  • ' + item + '
  • '; + }); + + //If we are not multiple, and we dont have a selected item, and we dont have a title, select the first element so something is set in the button + if (!this.multiple && this.$element.find('option:selected').length===0 && !this.options.title) { + this.$element.find('option').eq(0).prop('selected', true).attr('selected', 'selected'); + } + + return $(_liHtml); + }, + + createA: function(text, classes, inline) { + return '' + + text + + '' + + ''; + }, + + render: function(updateLi) { + var that = this; + + //Update the LI to match the SELECT + if (updateLi !== false) { + this.$element.find('option').each(function(index) { + that.setDisabled(index, $(this).is(':disabled') || $(this).parent().is(':disabled') ); + that.setSelected(index, $(this).is(':selected') ); + }); + } + + this.tabIndex(); + + var selectedItems = this.$element.find('option:selected').map(function() { + var $this = $(this); + var icon = $this.data('icon') && that.options.showIcon ? ' ' : ''; + var subtext; + if (that.options.showSubtext && $this.attr('data-subtext') && !that.multiple) { + subtext = ' '+$this.data('subtext') +''; + } else { + subtext = ''; + } + if ($this.data('content') && that.options.showContent) { + return $this.data('content'); + } else if ($this.attr('title') !== undefined) { + return $this.attr('title'); + } else { + return icon + $this.html() + subtext; + } + }).toArray(); + + //Fixes issue in IE10 occurring when no default option is selected and at least one option is disabled + //Convert all the values into a comma delimited string + var title = !this.multiple ? selectedItems[0] : selectedItems.join(this.options.multipleSeparator); + + //If this is multi select, and the selectText type is count, the show 1 of 2 selected etc.. + if (this.multiple && this.options.selectedTextFormat.indexOf('count') > -1) { + var max = this.options.selectedTextFormat.split('>'); + var notDisabled = this.options.hideDisabled ? ':not([disabled])' : ''; + if ( (max.length>1 && selectedItems.length > max[1]) || (max.length==1 && selectedItems.length>=2)) { + title = this.options.countSelectedText.replace('{0}', selectedItems.length).replace('{1}', this.$element.find('option:not([data-divider="true"]):not([data-hidden="true"])'+notDisabled).length); + } + } + + this.options.title = this.$element.attr('title'); + + //If we dont have a title, then use the default, or if nothing is set at all, use the not selected text + if (!title) { + title = this.options.title !== undefined ? this.options.title : this.options.noneSelectedText; + } + + this.$button.attr('title', $.trim(title)); + this.$newElement.find('.filter-option').html(title); + }, + + setStyle: function(style, status) { + if (this.$element.attr('class')) { + this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device/gi, '')); + } + + var buttonClass = style ? style : this.options.style; + + if (status == 'add') { + this.$button.addClass(buttonClass); + } else if (status == 'remove') { + this.$button.removeClass(buttonClass); + } else { + this.$button.removeClass(this.options.style); + this.$button.addClass(buttonClass); + } + }, + + liHeight: function() { + if (this.options.size === false) return; + + var $selectClone = this.$menu.parent().clone().find('> .dropdown-toggle').prop('autofocus', false).end().appendTo('body'), + $menuClone = $selectClone.addClass('open').find('> .dropdown-menu'), + liHeight = $menuClone.find('li > a').outerHeight(), + headerHeight = this.options.header ? $menuClone.find('.popover-title').outerHeight() : 0, + searchHeight = this.options.liveSearch ? $menuClone.find('.bootstrap-select-searchbox').outerHeight() : 0, + actionsHeight = this.options.actionsBox ? $menuClone.find('.bs-actionsbox').outerHeight() : 0; + + $selectClone.remove(); + + this.$newElement + .data('liHeight', liHeight) + .data('headerHeight', headerHeight) + .data('searchHeight', searchHeight) + .data('actionsHeight', actionsHeight); + }, + + setSize: function() { + var that = this, + menu = this.$menu, + menuInner = menu.find('.inner'), + selectHeight = this.$newElement.outerHeight(), + liHeight = this.$newElement.data('liHeight'), + headerHeight = this.$newElement.data('headerHeight'), + searchHeight = this.$newElement.data('searchHeight'), + actionsHeight = this.$newElement.data('actionsHeight'), + divHeight = menu.find('li .divider').outerHeight(true), + menuPadding = parseInt(menu.css('padding-top')) + + parseInt(menu.css('padding-bottom')) + + parseInt(menu.css('border-top-width')) + + parseInt(menu.css('border-bottom-width')), + notDisabled = this.options.hideDisabled ? ':not(.disabled)' : '', + $window = $(window), + menuExtras = menuPadding + parseInt(menu.css('margin-top')) + parseInt(menu.css('margin-bottom')) + 2, + menuHeight, + selectOffsetTop, + selectOffsetBot, + posVert = function() { + selectOffsetTop = that.$newElement.offset().top - $window.scrollTop(); + selectOffsetBot = $window.height() - selectOffsetTop - selectHeight; + }; + posVert(); + if (this.options.header) menu.css('padding-top', 0); + + if (this.options.size == 'auto') { + var getSize = function() { + var minHeight, + lisVis = that.$lis.not('.hide'); + + posVert(); + menuHeight = selectOffsetBot - menuExtras; + + if (that.options.dropupAuto) { + that.$newElement.toggleClass('dropup', (selectOffsetTop > selectOffsetBot) && ((menuHeight - menuExtras) < menu.height())); + } + if (that.$newElement.hasClass('dropup')) { + menuHeight = selectOffsetTop - menuExtras; + } + + if ((lisVis.length + lisVis.find('dt').length) > 3) { + minHeight = liHeight*3 + menuExtras - 2; + } else { + minHeight = 0; + } + + menu.css({'max-height' : menuHeight + 'px', 'overflow' : 'hidden', 'min-height' : minHeight + headerHeight + searchHeight + actionsHeight + 'px'}); + menuInner.css({'max-height' : menuHeight - headerHeight - searchHeight - actionsHeight - menuPadding + 'px', 'overflow-y' : 'auto', 'min-height' : Math.max(minHeight - menuPadding, 0) + 'px'}); + }; + + if(that.$lis) + { + getSize(); + this.$searchbox.off('input.getSize propertychange.getSize').on('input.getSize propertychange.getSize', getSize); + $(window).off('resize.getSize').on('resize.getSize', getSize); + $(window).off('scroll.getSize').on('scroll.getSize', getSize); + } + + } else if (this.options.size && this.options.size != 'auto' && menu.find('li'+notDisabled).length > this.options.size) { + var optIndex = menu.find('li'+notDisabled+' > *').filter(':not(.div-contain)').slice(0,this.options.size).last().parent().index(); + var divLength = menu.find('li').slice(0,optIndex + 1).find('.div-contain').length; + menuHeight = liHeight*this.options.size + divLength*divHeight + menuPadding; + if (that.options.dropupAuto) { + this.$newElement.toggleClass('dropup', (selectOffsetTop > selectOffsetBot) && (menuHeight < menu.height())); + } + menu.css({'max-height' : menuHeight + headerHeight + searchHeight + actionsHeight + 'px', 'overflow' : 'hidden'}); + menuInner.css({'max-height' : menuHeight - menuPadding + 'px', 'overflow-y' : 'auto'}); + } + }, + + setWidth: function() { + if (this.options.width == 'auto') { + this.$menu.css('min-width', '0'); + + // Get correct width if element hidden + var selectClone = this.$newElement.clone().appendTo('body'); + var ulWidth = selectClone.find('> .dropdown-menu').css('width'); + var btnWidth = selectClone.css('width', 'auto').find('> button').css('width'); + selectClone.remove(); + + // Set width to whatever's larger, button title or longest option + this.$newElement.css('width', Math.max(parseInt(ulWidth), parseInt(btnWidth)) + 'px'); + } else if (this.options.width == 'fit') { + // Remove inline min-width so width can be changed from 'auto' + this.$menu.css('min-width', ''); + this.$newElement.css('width', '').addClass('fit-width'); + } else if (this.options.width) { + // Remove inline min-width so width can be changed from 'auto' + this.$menu.css('min-width', ''); + this.$newElement.css('width', this.options.width); + } else { + // Remove inline min-width/width so width can be changed + this.$menu.css('min-width', ''); + this.$newElement.css('width', ''); + } + // Remove fit-width class if width is changed programmatically + if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') { + this.$newElement.removeClass('fit-width'); + } + }, + + selectPosition: function() { + var that = this, + drop = '
    ', + $drop = $(drop), + pos, + actualHeight, + getPlacement = function($element) { + $drop.addClass($element.attr('class').replace(/form-control/gi, '')).toggleClass('dropup', $element.hasClass('dropup')); + pos = $element.offset(); + actualHeight = $element.hasClass('dropup') ? 0 : $element[0].offsetHeight; + $drop.css({'top' : pos.top + actualHeight, 'left' : pos.left, 'width' : $element[0].offsetWidth, 'position' : 'absolute'}); + }; + this.$newElement.on('click', function() { + if (that.isDisabled()) { + return; + } + getPlacement($(this)); + $drop.appendTo(that.options.container); + $drop.toggleClass('open', !$(this).hasClass('open')); + $drop.append(that.$menu); + }); + $(window).resize(function() { + getPlacement(that.$newElement); + }); + $(window).on('scroll', function() { + getPlacement(that.$newElement); + }); + $('html').on('click', function(e) { + if ($(e.target).closest(that.$newElement).length < 1) { + $drop.removeClass('open'); + } + }); + }, + + mobile: function() { + this.$element.addClass('mobile-device').appendTo(this.$newElement); + if (this.options.container) this.$menu.hide(); + }, + + refresh: function() { + this.$lis = null; + this.reloadLi(); + this.render(); + this.setWidth(); + this.setStyle(); + this.checkDisabled(); + this.liHeight(); + }, + + update: function() { + this.reloadLi(); + this.setWidth(); + this.setStyle(); + this.checkDisabled(); + this.liHeight(); + }, + + setSelected: function(index, selected) { + if (this.$lis == null) this.$lis = this.$menu.find('li'); + $(this.$lis[index]).toggleClass('selected', selected); + }, + + setDisabled: function(index, disabled) { + if (this.$lis == null) this.$lis = this.$menu.find('li'); + if (disabled) { + $(this.$lis[index]).addClass('disabled').find('a').attr('href', '#').attr('tabindex', -1); + } else { + $(this.$lis[index]).removeClass('disabled').find('a').removeAttr('href').attr('tabindex', 0); + } + }, + + isDisabled: function() { + return this.$element.is(':disabled'); + }, + + checkDisabled: function() { + var that = this; + + if (this.isDisabled()) { + this.$button.addClass('disabled').attr('tabindex', -1); + } else { + if (this.$button.hasClass('disabled')) { + this.$button.removeClass('disabled'); + } + + if (this.$button.attr('tabindex') == -1) { + if (!this.$element.data('tabindex')) this.$button.removeAttr('tabindex'); + } + } + + this.$button.click(function() { + return !that.isDisabled(); + }); + }, + + tabIndex: function() { + if (this.$element.is('[tabindex]')) { + this.$element.data('tabindex', this.$element.attr('tabindex')); + this.$button.attr('tabindex', this.$element.data('tabindex')); + } + }, + + clickListener: function() { + var that = this; + + $('body').on('touchstart.dropdown', '.dropdown-menu', function(e) { + e.stopPropagation(); + }); + + this.$newElement.on('click', function() { + that.setSize(); + if (!that.options.liveSearch && !that.multiple) { + setTimeout(function() { + that.$menu.find('.selected a').focus(); + }, 10); + } + }); + + this.$menu.on('click', 'li a', function(e) { + var clickedIndex = $(this).parent().index(), + prevValue = that.$element.val(), + prevIndex = that.$element.prop('selectedIndex'); + + //Dont close on multi choice menu + if (that.multiple) { + e.stopPropagation(); + } + + e.preventDefault(); + + //Dont run if we have been disabled + if (!that.isDisabled() && !$(this).parent().hasClass('disabled')) { + var $options = that.$element.find('option'), + $option = $options.eq(clickedIndex), + state = $option.prop('selected'), + $optgroup = $option.parent('optgroup'), + maxOptions = that.options.maxOptions, + maxOptionsGrp = $optgroup.data('maxOptions') || false; + + //Deselect all others if not multi select box + if (!that.multiple) { + $options.prop('selected', false); + $option.prop('selected', true); + that.$menu.find('.selected').removeClass('selected'); + that.setSelected(clickedIndex, true); + } + //Else toggle the one we have chosen if we are multi select. + else { + $option.prop('selected', !state); + that.setSelected(clickedIndex, !state); + + if ((maxOptions !== false) || (maxOptionsGrp !== false)) { + var maxReached = maxOptions < $options.filter(':selected').length, + maxReachedGrp = maxOptionsGrp < $optgroup.find('option:selected').length, + maxOptionsArr = that.options.maxOptionsText, + maxTxt = maxOptionsArr[0].replace('{n}', maxOptions), + maxTxtGrp = maxOptionsArr[1].replace('{n}', maxOptionsGrp), + $notify = $('
    '); + + if ((maxOptions && maxReached) || (maxOptionsGrp && maxReachedGrp)) { + // If {var} is set in array, replace it + if (maxOptionsArr[2]) { + maxTxt = maxTxt.replace('{var}', maxOptionsArr[2][maxOptions > 1 ? 0 : 1]); + maxTxtGrp = maxTxtGrp.replace('{var}', maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1]); + } + + $option.prop('selected', false); + + that.$menu.append($notify); + + if (maxOptions && maxReached) { + $notify.append($('
    ' + maxTxt + '
    ')); + that.$element.trigger('maxReached.bs.select'); + } + + if (maxOptionsGrp && maxReachedGrp) { + $notify.append($('
    ' + maxTxtGrp + '
    ')); + that.$element.trigger('maxReachedGrp.bs.select'); + } + + setTimeout(function() { + that.setSelected(clickedIndex, false); + }, 10); + + $notify.delay(750).fadeOut(300, function() { $(this).remove(); }); + } + } + } + + if (!that.multiple) { + that.$button.focus(); + } else if (that.options.liveSearch) { + that.$searchbox.focus(); + } + + // Trigger select 'change' + if ((prevValue != that.$element.val() && that.multiple) || (prevIndex != that.$element.prop('selectedIndex') && !that.multiple)) { + that.$element.change(); + } + } + }); + + this.$menu.on('click', 'li.disabled a, li dt, li .div-contain, .popover-title, .popover-title :not(.close)', function(e) { + if (e.target == this) { + e.preventDefault(); + e.stopPropagation(); + if (!that.options.liveSearch) { + that.$button.focus(); + } else { + that.$searchbox.focus(); + } + } + }); + + this.$menu.on('click', '.popover-title .close', function() { + that.$button.focus(); + }); + + this.$searchbox.on('click', function(e) { + e.stopPropagation(); + }); + + + this.$menu.on('click', '.actions-btn', function(e) { + if (that.options.liveSearch) { + that.$searchbox.focus(); + } else { + that.$button.focus(); + } + + e.preventDefault(); + e.stopPropagation(); + + if ($(this).is('.bs-select-all')) { + that.selectAll(); + } else { + that.deselectAll(); + } + that.$element.change(); + }); + + this.$element.change(function() { + that.render(false); + }); + }, + + liveSearchListener: function() { + var that = this, + no_results = $('
  • '); + + this.$newElement.on('click.dropdown.data-api', function() { + that.$menu.find('.active').removeClass('active'); + if (!!that.$searchbox.val()) { + that.$searchbox.val(''); + that.$lis.not('.is-hidden').removeClass('hide'); + if (!!no_results.parent().length) no_results.remove(); + } + if (!that.multiple) that.$menu.find('.selected').addClass('active'); + setTimeout(function() { + that.$searchbox.focus(); + }, 10); + }); + + this.$searchbox.on('input propertychange', function() { + if (that.$searchbox.val()) { + that.$lis.not('.is-hidden').removeClass('hide').find('a').not(':icontains(' + that.$searchbox.val() + ')').parent().addClass('hide'); + + if (!that.$menu.find('li').filter(':visible:not(.no-results)').length) { + if (!!no_results.parent().length) no_results.remove(); + no_results.html(that.options.noneResultsText + ' "'+ that.$searchbox.val() + '"').show(); + that.$menu.find('li').last().after(no_results); + } else if (!!no_results.parent().length) { + no_results.remove(); + } + + } else { + that.$lis.not('.is-hidden').removeClass('hide'); + if (!!no_results.parent().length) no_results.remove(); + } + + that.$menu.find('li.active').removeClass('active'); + that.$menu.find('li').filter(':visible:not(.divider)').eq(0).addClass('active').find('a').focus(); + $(this).focus(); + }); + + this.$menu.on('mouseenter', 'a', function(e) { + that.$menu.find('.active').removeClass('active'); + $(e.currentTarget).parent().not('.disabled').addClass('active'); + }); + + this.$menu.on('mouseleave', 'a', function() { + that.$menu.find('.active').removeClass('active'); + }); + }, + + val: function(value) { + + if (value !== undefined) { + this.$element.val( value ); + + this.$element.change(); + return this.$element; + } else { + return this.$element.val(); + } + }, + + selectAll: function() { + if (this.$lis == null) this.$lis = this.$menu.find('li'); + this.$element.find('option:enabled').prop('selected', true); + $(this.$lis).filter(':not(.disabled)').addClass('selected'); + this.render(false); + }, + + deselectAll: function() { + if (this.$lis == null) this.$lis = this.$menu.find('li'); + this.$element.find('option:enabled').prop('selected', false); + $(this.$lis).filter(':not(.disabled)').removeClass('selected'); + this.render(false); + }, + + keydown: function(e) { + var $this, + $items, + $parent, + index, + next, + first, + last, + prev, + nextPrev, + that, + prevIndex, + isActive, + keyCodeMap = { + 32:' ', 48:'0', 49:'1', 50:'2', 51:'3', 52:'4', 53:'5', 54:'6', 55:'7', 56:'8', 57:'9', 59:';', + 65:'a', 66:'b', 67:'c', 68:'d', 69:'e', 70:'f', 71:'g', 72:'h', 73:'i', 74:'j', 75:'k', 76:'l', + 77:'m', 78:'n', 79:'o', 80:'p', 81:'q', 82:'r', 83:'s', 84:'t', 85:'u', 86:'v', 87:'w', 88:'x', + 89:'y', 90:'z', 96:'0', 97:'1', 98:'2', 99:'3', 100:'4', 101:'5', 102:'6', 103:'7', 104:'8', 105:'9' + }; + + $this = $(this); + + $parent = $this.parent(); + + if ($this.is('input')) $parent = $this.parent().parent(); + + that = $parent.data('this'); + + if (that.options.liveSearch) $parent = $this.parent().parent(); + + if (that.options.container) $parent = that.$menu; + + $items = $('[role=menu] li:not(.divider) a', $parent); + + isActive = that.$menu.parent().hasClass('open'); + + if (!isActive && /([0-9]|[A-z])/.test(String.fromCharCode(e.keyCode))) { + if (!that.options.container) { + that.setSize(); + that.$menu.parent().addClass('open'); + isActive = that.$menu.parent().hasClass('open'); + } else { + that.$newElement.trigger('click'); + } + that.$searchbox.focus(); + } + + if (that.options.liveSearch) { + if (/(^9$|27)/.test(e.keyCode) && isActive && that.$menu.find('.active').length === 0) { + e.preventDefault(); + that.$menu.parent().removeClass('open'); + that.$button.focus(); + } + $items = $('[role=menu] li:not(.divider):visible', $parent); + if (!$this.val() && !/(38|40)/.test(e.keyCode)) { + if ($items.filter('.active').length === 0) { + $items = that.$newElement.find('li').filter(':icontains(' + keyCodeMap[e.keyCode] + ')'); + } + } + } + + if (!$items.length) return; + + if (/(38|40)/.test(e.keyCode)) { + + index = $items.index($items.filter(':focus')); + first = $items.parent(':not(.disabled):visible').first().index(); + last = $items.parent(':not(.disabled):visible').last().index(); + next = $items.eq(index).parent().nextAll(':not(.disabled):visible').eq(0).index(); + prev = $items.eq(index).parent().prevAll(':not(.disabled):visible').eq(0).index(); + nextPrev = $items.eq(next).parent().prevAll(':not(.disabled):visible').eq(0).index(); + + if (that.options.liveSearch) { + $items.each(function(i) { + if ($(this).is(':not(.disabled)')) { + $(this).data('index', i); + } + }); + index = $items.index($items.filter('.active')); + first = $items.filter(':not(.disabled):visible').first().data('index'); + last = $items.filter(':not(.disabled):visible').last().data('index'); + next = $items.eq(index).nextAll(':not(.disabled):visible').eq(0).data('index'); + prev = $items.eq(index).prevAll(':not(.disabled):visible').eq(0).data('index'); + nextPrev = $items.eq(next).prevAll(':not(.disabled):visible').eq(0).data('index'); + } + + prevIndex = $this.data('prevIndex'); + + if (e.keyCode == 38) { + if (that.options.liveSearch) index -= 1; + if (index != nextPrev && index > prev) index = prev; + if (index < first) index = first; + if (index == prevIndex) index = last; + } + + if (e.keyCode == 40) { + if (that.options.liveSearch) index += 1; + if (index == -1) index = 0; + if (index != nextPrev && index < next) index = next; + if (index > last) index = last; + if (index == prevIndex) index = first; + } + + $this.data('prevIndex', index); + + if (!that.options.liveSearch) { + $items.eq(index).focus(); + } else { + e.preventDefault(); + if (!$this.is('.dropdown-toggle')) { + $items.removeClass('active'); + $items.eq(index).addClass('active').find('a').focus(); + $this.focus(); + } + } + + } else if (!$this.is('input')) { + + var keyIndex = [], + count, + prevKey; + + $items.each(function() { + if ($(this).parent().is(':not(.disabled)')) { + if ($.trim($(this).text().toLowerCase()).substring(0,1) == keyCodeMap[e.keyCode]) { + keyIndex.push($(this).parent().index()); + } + } + }); + + count = $(document).data('keycount'); + count++; + $(document).data('keycount',count); + + prevKey = $.trim($(':focus').text().toLowerCase()).substring(0,1); + + if (prevKey != keyCodeMap[e.keyCode]) { + count = 1; + $(document).data('keycount', count); + } else if (count >= keyIndex.length) { + $(document).data('keycount', 0); + if (count > keyIndex.length) count = 1; + } + + $items.eq(keyIndex[count - 1]).focus(); + } + + // Select focused option if "Enter", "Spacebar", "Tab" are pressed inside the menu. + if (/(13|32|^9$)/.test(e.keyCode) && isActive) { + if (!/(32)/.test(e.keyCode)) e.preventDefault(); + if (!that.options.liveSearch) { + $(':focus').click(); + } else if (!/(32)/.test(e.keyCode)) { + that.$menu.find('.active a').click(); + $this.focus(); + } + $(document).data('keycount',0); + } + + if ((/(^9$|27)/.test(e.keyCode) && isActive && (that.multiple || that.options.liveSearch)) || (/(27)/.test(e.keyCode) && !isActive)) { + that.$menu.parent().removeClass('open'); + that.$button.focus(); + } + + }, + + hide: function() { + this.$newElement.hide(); + }, + + show: function() { + this.$newElement.show(); + }, + + destroy: function() { + this.$newElement.remove(); + this.$element.remove(); + } + }; + + $.fn.selectpicker = function(option, event) { + //get the args of the outer function.. + var args = arguments; + var value; + var chain = this.each(function() { + if ($(this).is('select')) { + var $this = $(this), + data = $this.data('selectpicker'), + options = typeof option == 'object' && option; + + if (!data) { + $this.data('selectpicker', (data = new Selectpicker(this, options, event))); + } else if (options) { + for(var i in options) { + data.options[i] = options[i]; + } + } + + if (typeof option == 'string') { + //Copy the value of option, as once we shift the arguments + //it also shifts the value of option. + var property = option; + if (data[property] instanceof Function) { + [].shift.apply(args); + value = data[property].apply(data, args); + } else { + value = data.options[property]; + } + } + } + }); + + if (value !== undefined) { + return value; + } else { + return chain; + } + }; + + $.fn.selectpicker.defaults = { + style: 'btn-default', + size: 'auto', + title: null, + selectedTextFormat : 'values', + noneSelectedText : 'Nothing selected', + noneResultsText : 'No results match', + countSelectedText: '{0} of {1} selected', + maxOptionsText: ['Limit reached ({n} {var} max)', 'Group limit reached ({n} {var} max)', ['items','item']], + width: false, + container: false, + hideDisabled: false, + showSubtext: false, + showIcon: true, + showContent: true, + dropupAuto: true, + header: false, + liveSearch: false, + actionsBox: false, + multipleSeparator: ', ', + iconBase: 'glyphicon', + tickIcon: 'glyphicon-ok', + maxOptions: false + }; + + $(document) + .data('keycount', 0) + .on('keydown', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bootstrap-select-searchbox input', Selectpicker.prototype.keydown) + .on('focusin.modal', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bootstrap-select-searchbox input', function (e) { e.stopPropagation(); }); + +}(window.jQuery); \ No newline at end of file diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.min.css b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.min.css new file mode 100644 index 00000000..edb090ca --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.min.css @@ -0,0 +1,7 @@ +/*! + * bootstrap-select v1.5.4 + * http://silviomoreto.github.io/bootstrap-select/ + * + * Copyright 2013 bootstrap-select + * Licensed under the MIT license + */.bootstrap-select.btn-group:not(.input-group-btn),.bootstrap-select.btn-group[class*="span"]{float:none;display:inline-block;margin-bottom:10px;margin-left:0}.form-search .bootstrap-select.btn-group,.form-inline .bootstrap-select.btn-group,.form-horizontal .bootstrap-select.btn-group{margin-bottom:0}.bootstrap-select.form-control{margin-bottom:0;padding:0;border:0}.bootstrap-select.btn-group.pull-right,.bootstrap-select.btn-group[class*="span"].pull-right,.row-fluid .bootstrap-select.btn-group[class*="span"].pull-right{float:right}.input-append .bootstrap-select.btn-group{margin-left:-1px}.input-prepend .bootstrap-select.btn-group{margin-right:-1px}.bootstrap-select:not([class*="span"]):not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn){width:220px}.bootstrap-select{width:220px\0}.bootstrap-select.form-control:not([class*="span"]){width:100%}.bootstrap-select>.btn{width:100%;padding-right:25px}.error .bootstrap-select .btn{border:1px solid #b94a48}.bootstrap-select.show-menu-arrow.open>.btn{z-index:2051}.bootstrap-select .btn:focus{outline:thin dotted #333 !important;outline:5px auto -webkit-focus-ring-color !important;outline-offset:-2px}.bootstrap-select.btn-group .btn .filter-option{display:inline-block;overflow:hidden;width:100%;float:left;text-align:left}.bootstrap-select.btn-group .btn .caret{position:absolute;top:50%;right:12px;margin-top:-2px;vertical-align:middle}.bootstrap-select.btn-group>.disabled,.bootstrap-select.btn-group .dropdown-menu li.disabled>a{cursor:not-allowed}.bootstrap-select.btn-group>.disabled:focus{outline:none !important}.bootstrap-select.btn-group[class*="span"] .btn{width:100%}.bootstrap-select.btn-group .dropdown-menu{min-width:100%;z-index:2000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .dropdown-menu.inner{position:static;border:0;padding:0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.bootstrap-select.btn-group .dropdown-menu dt{display:block;padding:3px 20px;cursor:default}.bootstrap-select.btn-group .div-contain{overflow:hidden}.bootstrap-select.btn-group .dropdown-menu li{position:relative}.bootstrap-select.btn-group .dropdown-menu li>a.opt{position:relative;padding-left:35px}.bootstrap-select.btn-group .dropdown-menu li>a{cursor:pointer}.bootstrap-select.btn-group .dropdown-menu li>dt small{font-weight:normal}.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a i.check-mark{position:absolute;display:inline-block;right:15px;margin-top:2.5px}.bootstrap-select.btn-group .dropdown-menu li a i.check-mark{display:none}.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text{margin-right:34px}.bootstrap-select.btn-group .dropdown-menu li small{padding-left:.5em}.bootstrap-select.btn-group .dropdown-menu li:not(.disabled)>a:hover small,.bootstrap-select.btn-group .dropdown-menu li:not(.disabled)>a:focus small,.bootstrap-select.btn-group .dropdown-menu li.active:not(.disabled)>a small{color:#64b1d8;color:rgba(255,255,255,0.4)}.bootstrap-select.btn-group .dropdown-menu li>dt small{font-weight:normal}.bootstrap-select.show-menu-arrow .dropdown-toggle:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #CCC;border-bottom-color:rgba(0,0,0,0.2);position:absolute;bottom:-4px;left:9px;display:none}.bootstrap-select.show-menu-arrow .dropdown-toggle:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid white;position:absolute;bottom:-4px;left:10px;display:none}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before{bottom:auto;top:-3px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after{bottom:auto;top:-3px;border-top:6px solid #fff;border-bottom:0}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before{right:12px;left:auto}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after{right:13px;left:auto}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:before,.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:after{display:block}.bootstrap-select.btn-group .no-results{padding:3px;background:#f5f5f5;margin:0 5px}.bootstrap-select.btn-group .dropdown-menu .notify{position:absolute;bottom:5px;width:96%;margin:0 2%;min-height:26px;padding:3px 5px;background:#f5f5f5;border:1px solid #e3e3e3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);pointer-events:none;opacity:.9;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.mobile-device{position:absolute;top:0;left:0;display:block !important;width:100%;height:100% !important;opacity:0}.bootstrap-select.fit-width{width:auto !important}.bootstrap-select.btn-group.fit-width .btn .filter-option{position:static}.bootstrap-select.btn-group.fit-width .btn .caret{position:static;top:auto;margin-top:-1px}.control-group.error .bootstrap-select .dropdown-toggle{border-color:#b94a48}.bootstrap-select-searchbox,.bootstrap-select .bs-actionsbox{padding:4px 8px}.bootstrap-select .bs-actionsbox{float:left;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select-searchbox+.bs-actionsbox{padding:0 8px 4px}.bootstrap-select-searchbox input{margin-bottom:0}.bootstrap-select .bs-actionsbox .btn-group button{width:50%} \ No newline at end of file diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.min.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.min.js new file mode 100644 index 00000000..3cfa7862 --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bootstrap-select.min.js @@ -0,0 +1,8 @@ +/*! + * bootstrap-select v1.5.4 + * http://silviomoreto.github.io/bootstrap-select/ + * + * Copyright 2013 bootstrap-select + * Licensed under the MIT license + */ +;!function(b){b.expr[":"].icontains=function(e,c,d){return b(e).text().toUpperCase().indexOf(d[3].toUpperCase())>=0};var a=function(d,c,f){if(f){f.stopPropagation();f.preventDefault()}this.$element=b(d);this.$newElement=null;this.$button=null;this.$menu=null;this.$lis=null;this.options=b.extend({},b.fn.selectpicker.defaults,this.$element.data(),typeof c=="object"&&c);if(this.options.title===null){this.options.title=this.$element.attr("title")}this.val=a.prototype.val;this.render=a.prototype.render;this.refresh=a.prototype.refresh;this.setStyle=a.prototype.setStyle;this.selectAll=a.prototype.selectAll;this.deselectAll=a.prototype.deselectAll;this.init()};a.prototype={constructor:a,init:function(){var c=this,d=this.$element.attr("id");this.$element.hide();this.multiple=this.$element.prop("multiple");this.autofocus=this.$element.prop("autofocus");this.$newElement=this.createView();this.$element.after(this.$newElement);this.$menu=this.$newElement.find("> .dropdown-menu");this.$button=this.$newElement.find("> button");this.$searchbox=this.$newElement.find("input");if(d!==undefined){this.$button.attr("data-id",d);b('label[for="'+d+'"]').click(function(f){f.preventDefault();c.$button.focus()})}this.checkDisabled();this.clickListener();if(this.options.liveSearch){this.liveSearchListener()}this.render();this.liHeight();this.setStyle();this.setWidth();if(this.options.container){this.selectPosition()}this.$menu.data("this",this);this.$newElement.data("this",this)},createDropdown:function(){var c=this.multiple?" show-tick":"";var d=this.$element.parent().hasClass("input-group")?" input-group-btn":"";var i=this.autofocus?" autofocus":"";var h=this.options.header?'
    '+this.options.header+"
    ":"";var g=this.options.liveSearch?'':"";var f=this.options.actionsBox?'
    ':"";var e='
    ';return b(e)},createView:function(){var c=this.createDropdown();var d=this.createLi();c.find("ul").append(d);return c},reloadLi:function(){this.destroyLi();var c=this.createLi();this.$menu.find("ul").append(c)},destroyLi:function(){this.$menu.find("li").remove()},createLi:function(){var d=this,e=[],c="";this.$element.find("option").each(function(){var i=b(this);var g=i.attr("class")||"";var h=i.attr("style")||"";var m=i.data("content")?i.data("content"):i.html();var k=i.data("subtext")!==undefined?''+i.data("subtext")+"":"";var j=i.data("icon")!==undefined?' ':"";if(j!==""&&(i.is(":disabled")||i.parent().is(":disabled"))){j=""+j+""}if(!i.data("content")){m=j+''+m+k+""}if(d.options.hideDisabled&&(i.is(":disabled")||i.parent().is(":disabled"))){e.push('')}else{if(i.parent().is("optgroup")&&i.data("divider")!==true){if(i.index()===0){var l=i.parent().attr("label");var n=i.parent().data("subtext")!==undefined?''+i.parent().data("subtext")+"":"";var f=i.parent().data("icon")?' ':"";l=f+''+l+n+"";if(i[0].index!==0){e.push('
    '+l+"
    "+d.createA(m,"opt "+g,h))}else{e.push("
    "+l+"
    "+d.createA(m,"opt "+g,h))}}else{e.push(d.createA(m,"opt "+g,h))}}else{if(i.data("divider")===true){e.push('
    ')}else{if(b(this).data("hidden")===true){e.push("")}else{e.push(d.createA(m,g,h))}}}}});b.each(e,function(g,h){var f=h===""?'class="hide is-hidden"':"";c+='
  • "+h+"
  • "});if(!this.multiple&&this.$element.find("option:selected").length===0&&!this.options.title){this.$element.find("option").eq(0).prop("selected",true).attr("selected","selected")}return b(c)},createA:function(e,c,d){return''+e+''},render:function(e){var d=this;if(e!==false){this.$element.find("option").each(function(i){d.setDisabled(i,b(this).is(":disabled")||b(this).parent().is(":disabled"));d.setSelected(i,b(this).is(":selected"))})}this.tabIndex();var h=this.$element.find("option:selected").map(function(){var k=b(this);var j=k.data("icon")&&d.options.showIcon?' ':"";var i;if(d.options.showSubtext&&k.attr("data-subtext")&&!d.multiple){i=' '+k.data("subtext")+""}else{i=""}if(k.data("content")&&d.options.showContent){return k.data("content")}else{if(k.attr("title")!==undefined){return k.attr("title")}else{return j+k.html()+i}}}).toArray();var g=!this.multiple?h[0]:h.join(this.options.multipleSeparator);if(this.multiple&&this.options.selectedTextFormat.indexOf("count")>-1){var c=this.options.selectedTextFormat.split(">");var f=this.options.hideDisabled?":not([disabled])":"";if((c.length>1&&h.length>c[1])||(c.length==1&&h.length>=2)){g=this.options.countSelectedText.replace("{0}",h.length).replace("{1}",this.$element.find('option:not([data-divider="true"]):not([data-hidden="true"])'+f).length)}}this.options.title=this.$element.attr("title");if(!g){g=this.options.title!==undefined?this.options.title:this.options.noneSelectedText}this.$button.attr("title",b.trim(g));this.$newElement.find(".filter-option").html(g)},setStyle:function(e,d){if(this.$element.attr("class")){this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device/gi,""))}var c=e?e:this.options.style;if(d=="add"){this.$button.addClass(c)}else{if(d=="remove"){this.$button.removeClass(c)}else{this.$button.removeClass(this.options.style);this.$button.addClass(c)}}},liHeight:function(){if(this.options.size===false){return}var f=this.$menu.parent().clone().find("> .dropdown-toggle").prop("autofocus",false).end().appendTo("body"),g=f.addClass("open").find("> .dropdown-menu"),e=g.find("li > a").outerHeight(),d=this.options.header?g.find(".popover-title").outerHeight():0,h=this.options.liveSearch?g.find(".bootstrap-select-searchbox").outerHeight():0,c=this.options.actionsBox?g.find(".bs-actionsbox").outerHeight():0;f.remove();this.$newElement.data("liHeight",e).data("headerHeight",d).data("searchHeight",h).data("actionsHeight",c)},setSize:function(){var i=this,d=this.$menu,j=d.find(".inner"),u=this.$newElement.outerHeight(),f=this.$newElement.data("liHeight"),s=this.$newElement.data("headerHeight"),m=this.$newElement.data("searchHeight"),h=this.$newElement.data("actionsHeight"),l=d.find("li .divider").outerHeight(true),r=parseInt(d.css("padding-top"))+parseInt(d.css("padding-bottom"))+parseInt(d.css("border-top-width"))+parseInt(d.css("border-bottom-width")),p=this.options.hideDisabled?":not(.disabled)":"",o=b(window),g=r+parseInt(d.css("margin-top"))+parseInt(d.css("margin-bottom"))+2,q,v,t,k=function(){v=i.$newElement.offset().top-o.scrollTop();t=o.height()-v-u};k();if(this.options.header){d.css("padding-top",0)}if(this.options.size=="auto"){var e=function(){var x,w=i.$lis.not(".hide");k();q=t-g;if(i.options.dropupAuto){i.$newElement.toggleClass("dropup",(v>t)&&((q-g)3){x=f*3+g-2}else{x=0}d.css({"max-height":q+"px",overflow:"hidden","min-height":x+s+m+h+"px"});j.css({"max-height":q-s-m-h-r+"px","overflow-y":"auto","min-height":Math.max(x-r,0)+"px"})};e();this.$searchbox.off("input.getSize propertychange.getSize").on("input.getSize propertychange.getSize",e);b(window).off("resize.getSize").on("resize.getSize",e);b(window).off("scroll.getSize").on("scroll.getSize",e)}else{if(this.options.size&&this.options.size!="auto"&&d.find("li"+p).length>this.options.size){var n=d.find("li"+p+" > *").filter(":not(.div-contain)").slice(0,this.options.size).last().parent().index();var c=d.find("li").slice(0,n+1).find(".div-contain").length;q=f*this.options.size+c*l+r;if(i.options.dropupAuto){this.$newElement.toggleClass("dropup",(v>t)&&(q .dropdown-menu").css("width");var d=e.css("width","auto").find("> button").css("width");e.remove();this.$newElement.css("width",Math.max(parseInt(c),parseInt(d))+"px")}else{if(this.options.width=="fit"){this.$menu.css("min-width","");this.$newElement.css("width","").addClass("fit-width")}else{if(this.options.width){this.$menu.css("min-width","");this.$newElement.css("width",this.options.width)}else{this.$menu.css("min-width","");this.$newElement.css("width","")}}}if(this.$newElement.hasClass("fit-width")&&this.options.width!=="fit"){this.$newElement.removeClass("fit-width")}},selectPosition:function(){var e=this,d="
    ",f=b(d),h,g,c=function(i){f.addClass(i.attr("class").replace(/form-control/gi,"")).toggleClass("dropup",i.hasClass("dropup"));h=i.offset();g=i.hasClass("dropup")?0:i[0].offsetHeight;f.css({top:h.top+g,left:h.left,width:i[0].offsetWidth,position:"absolute"})};this.$newElement.on("click",function(){if(e.isDisabled()){return}c(b(this));f.appendTo(e.options.container);f.toggleClass("open",!b(this).hasClass("open"));f.append(e.$menu)});b(window).resize(function(){c(e.$newElement)});b(window).on("scroll",function(){c(e.$newElement)});b("html").on("click",function(i){if(b(i.target).closest(e.$newElement).length<1){f.removeClass("open")}})},mobile:function(){this.$element.addClass("mobile-device").appendTo(this.$newElement);if(this.options.container){this.$menu.hide()}},refresh:function(){this.$lis=null;this.reloadLi();this.render();this.setWidth();this.setStyle();this.checkDisabled();this.liHeight()},update:function(){this.reloadLi();this.setWidth();this.setStyle();this.checkDisabled();this.liHeight()},setSelected:function(c,d){if(this.$lis==null){this.$lis=this.$menu.find("li")}b(this.$lis[c]).toggleClass("selected",d)},setDisabled:function(c,d){if(this.$lis==null){this.$lis=this.$menu.find("li")}if(d){b(this.$lis[c]).addClass("disabled").find("a").attr("href","#").attr("tabindex",-1)}else{b(this.$lis[c]).removeClass("disabled").find("a").removeAttr("href").attr("tabindex",0)}},isDisabled:function(){return this.$element.is(":disabled")},checkDisabled:function(){var c=this;if(this.isDisabled()){this.$button.addClass("disabled").attr("tabindex",-1)}else{if(this.$button.hasClass("disabled")){this.$button.removeClass("disabled")}if(this.$button.attr("tabindex")==-1){if(!this.$element.data("tabindex")){this.$button.removeAttr("tabindex")}}}this.$button.click(function(){return !c.isDisabled()})},tabIndex:function(){if(this.$element.is("[tabindex]")){this.$element.data("tabindex",this.$element.attr("tabindex"));this.$button.attr("tabindex",this.$element.data("tabindex"))}},clickListener:function(){var c=this;b("body").on("touchstart.dropdown",".dropdown-menu",function(d){d.stopPropagation()});this.$newElement.on("click",function(){c.setSize();if(!c.options.liveSearch&&!c.multiple){setTimeout(function(){c.$menu.find(".selected a").focus()},10)}});this.$menu.on("click","li a",function(n){var t=b(this).parent().index(),m=c.$element.val(),i=c.$element.prop("selectedIndex");if(c.multiple){n.stopPropagation()}n.preventDefault();if(!c.isDisabled()&&!b(this).parent().hasClass("disabled")){var l=c.$element.find("option"),d=l.eq(t),f=d.prop("selected"),r=d.parent("optgroup"),p=c.options.maxOptions,h=r.data("maxOptions")||false;if(!c.multiple){l.prop("selected",false);d.prop("selected",true);c.$menu.find(".selected").removeClass("selected");c.setSelected(t,true)}else{d.prop("selected",!f);c.setSelected(t,!f);if((p!==false)||(h!==false)){var o=p
    ');if((p&&o)||(h&&j)){if(s[2]){g=g.replace("{var}",s[2][p>1?0:1]);q=q.replace("{var}",s[2][h>1?0:1])}d.prop("selected",false);c.$menu.append(k);if(p&&o){k.append(b("
    "+g+"
    "));c.$element.trigger("maxReached.bs.select")}if(h&&j){k.append(b("
    "+q+"
    "));c.$element.trigger("maxReachedGrp.bs.select")}setTimeout(function(){c.setSelected(t,false)},10);k.delay(750).fadeOut(300,function(){b(this).remove()})}}}if(!c.multiple){c.$button.focus()}else{if(c.options.liveSearch){c.$searchbox.focus()}}if((m!=c.$element.val()&&c.multiple)||(i!=c.$element.prop("selectedIndex")&&!c.multiple)){c.$element.change()}}});this.$menu.on("click","li.disabled a, li dt, li .div-contain, .popover-title, .popover-title :not(.close)",function(d){if(d.target==this){d.preventDefault();d.stopPropagation();if(!c.options.liveSearch){c.$button.focus()}else{c.$searchbox.focus()}}});this.$menu.on("click",".popover-title .close",function(){c.$button.focus()});this.$searchbox.on("click",function(d){d.stopPropagation()});this.$menu.on("click",".actions-btn",function(d){if(c.options.liveSearch){c.$searchbox.focus()}else{c.$button.focus()}d.preventDefault();d.stopPropagation();if(b(this).is(".bs-select-all")){c.selectAll()}else{c.deselectAll()}c.$element.change()});this.$element.change(function(){c.render(false)})},liveSearchListener:function(){var d=this,c=b('
  • ');this.$newElement.on("click.dropdown.data-api",function(){d.$menu.find(".active").removeClass("active");if(!!d.$searchbox.val()){d.$searchbox.val("");d.$lis.not(".is-hidden").removeClass("hide");if(!!c.parent().length){c.remove()}}if(!d.multiple){d.$menu.find(".selected").addClass("active")}setTimeout(function(){d.$searchbox.focus()},10)});this.$searchbox.on("input propertychange",function(){if(d.$searchbox.val()){d.$lis.not(".is-hidden").removeClass("hide").find("a").not(":icontains("+d.$searchbox.val()+")").parent().addClass("hide");if(!d.$menu.find("li").filter(":visible:not(.no-results)").length){if(!!c.parent().length){c.remove()}c.html(d.options.noneResultsText+' "'+d.$searchbox.val()+'"').show();d.$menu.find("li").last().after(c)}else{if(!!c.parent().length){c.remove()}}}else{d.$lis.not(".is-hidden").removeClass("hide");if(!!c.parent().length){c.remove()}}d.$menu.find("li.active").removeClass("active");d.$menu.find("li").filter(":visible:not(.divider)").eq(0).addClass("active").find("a").focus();b(this).focus()});this.$menu.on("mouseenter","a",function(f){d.$menu.find(".active").removeClass("active");b(f.currentTarget).parent().not(".disabled").addClass("active")});this.$menu.on("mouseleave","a",function(){d.$menu.find(".active").removeClass("active")})},val:function(c){if(c!==undefined){this.$element.val(c);this.$element.change();return this.$element}else{return this.$element.val()}},selectAll:function(){if(this.$lis==null){this.$lis=this.$menu.find("li")}this.$element.find("option:enabled").prop("selected",true);b(this.$lis).filter(":not(.disabled)").addClass("selected");this.render(false)},deselectAll:function(){if(this.$lis==null){this.$lis=this.$menu.find("li")}this.$element.find("option:enabled").prop("selected",false);b(this.$lis).filter(":not(.disabled)").removeClass("selected");this.render(false)},keydown:function(p){var q,o,i,n,k,j,r,f,h,m,d,s,g={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"};q=b(this);i=q.parent();if(q.is("input")){i=q.parent().parent()}m=i.data("this");if(m.options.liveSearch){i=q.parent().parent()}if(m.options.container){i=m.$menu}o=b("[role=menu] li:not(.divider) a",i);s=m.$menu.parent().hasClass("open");if(!s&&/([0-9]|[A-z])/.test(String.fromCharCode(p.keyCode))){if(!m.options.container){m.setSize();m.$menu.parent().addClass("open");s=m.$menu.parent().hasClass("open")}else{m.$newElement.trigger("click")}m.$searchbox.focus()}if(m.options.liveSearch){if(/(^9$|27)/.test(p.keyCode)&&s&&m.$menu.find(".active").length===0){p.preventDefault();m.$menu.parent().removeClass("open");m.$button.focus()}o=b("[role=menu] li:not(.divider):visible",i);if(!q.val()&&!/(38|40)/.test(p.keyCode)){if(o.filter(".active").length===0){o=m.$newElement.find("li").filter(":icontains("+g[p.keyCode]+")")}}}if(!o.length){return}if(/(38|40)/.test(p.keyCode)){n=o.index(o.filter(":focus"));j=o.parent(":not(.disabled):visible").first().index();r=o.parent(":not(.disabled):visible").last().index();k=o.eq(n).parent().nextAll(":not(.disabled):visible").eq(0).index();f=o.eq(n).parent().prevAll(":not(.disabled):visible").eq(0).index();h=o.eq(k).parent().prevAll(":not(.disabled):visible").eq(0).index();if(m.options.liveSearch){o.each(function(e){if(b(this).is(":not(.disabled)")){b(this).data("index",e)}});n=o.index(o.filter(".active"));j=o.filter(":not(.disabled):visible").first().data("index");r=o.filter(":not(.disabled):visible").last().data("index");k=o.eq(n).nextAll(":not(.disabled):visible").eq(0).data("index");f=o.eq(n).prevAll(":not(.disabled):visible").eq(0).data("index");h=o.eq(k).prevAll(":not(.disabled):visible").eq(0).data("index")}d=q.data("prevIndex");if(p.keyCode==38){if(m.options.liveSearch){n-=1}if(n!=h&&n>f){n=f}if(nr){n=r}if(n==d){n=j}}q.data("prevIndex",n);if(!m.options.liveSearch){o.eq(n).focus()}else{p.preventDefault();if(!q.is(".dropdown-toggle")){o.removeClass("active");o.eq(n).addClass("active").find("a").focus();q.focus()}}}else{if(!q.is("input")){var c=[],l,t;o.each(function(){if(b(this).parent().is(":not(.disabled)")){if(b.trim(b(this).text().toLowerCase()).substring(0,1)==g[p.keyCode]){c.push(b(this).parent().index())}}});l=b(document).data("keycount");l++;b(document).data("keycount",l);t=b.trim(b(":focus").text().toLowerCase()).substring(0,1);if(t!=g[p.keyCode]){l=1;b(document).data("keycount",l)}else{if(l>=c.length){b(document).data("keycount",0);if(l>c.length){l=1}}}o.eq(c[l-1]).focus()}}if(/(13|32|^9$)/.test(p.keyCode)&&s){if(!/(32)/.test(p.keyCode)){p.preventDefault()}if(!m.options.liveSearch){b(":focus").click()}else{if(!/(32)/.test(p.keyCode)){m.$menu.find(".active a").click();q.focus()}}b(document).data("keycount",0)}if((/(^9$|27)/.test(p.keyCode)&&s&&(m.multiple||m.options.liveSearch))||(/(27)/.test(p.keyCode)&&!s)){m.$menu.parent().removeClass("open");m.$button.focus()}},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},destroy:function(){this.$newElement.remove();this.$element.remove()}};b.fn.selectpicker=function(e,f){var c=arguments;var g;var d=this.each(function(){if(b(this).is("select")){var m=b(this),l=m.data("selectpicker"),h=typeof e=="object"&&e;if(!l){m.data("selectpicker",(l=new a(this,h,f)))}else{if(h){for(var j in h){l.options[j]=h[j]}}}if(typeof e=="string"){var k=e;if(l[k] instanceof Function){[].shift.apply(c);g=l[k].apply(l,c)}else{g=l.options[k]}}}});if(g!==undefined){return g}else{return d}};b.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"Nothing selected",noneResultsText:"No results match",countSelectedText:"{0} of {1} selected",maxOptionsText:["Limit reached ({n} {var} max)","Group limit reached ({n} {var} max)",["items","item"]],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,actionsBox:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok",maxOptions:false};b(document).data("keycount",0).on("keydown",".bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bootstrap-select-searchbox input",a.prototype.keydown).on("focusin.modal",".bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bootstrap-select-searchbox input",function(c){c.stopPropagation()})}(window.jQuery); \ No newline at end of file diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bower.json b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bower.json new file mode 100644 index 00000000..91d2d638 --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/bower.json @@ -0,0 +1,29 @@ +{ + "name": "bootstrap-select", + "main": [ + "bootstrap-select.css", + "bootstrap-select.js" + ], + "version": "1.5.4", + "homepage": "https://github.com/silviomoreto/bootstrap-select", + "authors": [ + "silviomoreto" + ], + "keywords": [ + "form", + "bootstrap", + "select", + "replacement" + ], + "dependencies": { + "jquery": ">=1.7" + }, + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/composer.json b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/composer.json new file mode 100644 index 00000000..1404b73b --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/composer.json @@ -0,0 +1,17 @@ +{ + "name": "bootstrap-select/bootstrap-select", + "description": "A custom for Bootstrap using button dropdown as replacement", + "version": "1.5.4", + "homepage": "http://silviomoreto.github.io/bootstrap-select/", + "author": { + "name": "Silvio Moreto", + "url": "https://github.com/silviomoreto/" + }, + "repository": { + "type": "git", + "url": "git://github.com/antonellopasella/bootstrap-select.git" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/silviomoreto/bootstrap-select/blob/master/README.md#copyright-and-license" + } + ], + "dependencies": { + "jquery": "1.8" + }, + "keywords": [ + "form", + "bootstrap", + "select", + "replacement" + ] +} diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/test.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/test.html new file mode 100644 index 00000000..ae1baa36 --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/js/bootstrap-select/test.html @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
    + +
    + + + diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/views-all.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/views-all.html index 3e973f17..28a9f7bd 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/views-all.html +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/views-all.html @@ -1 +1 @@ -

    1 - Identificação

    1.1 - Empresa
    1.2 - Utente

    2 - Actividade

    Condições de Trabalho
    Horário   Postura   Tarefas   Esforço  
    Normal Sentado Variadas Físico:  
    Contínuo Em Pé Criativas Cargas > 10 Kg
    Turnos Deslocações Monótonas Cargas < 10 Kg
    Nocturno Parado Repetitivas Visual
    Isenção Sentádo/Pé Minuciosas Mental

     

    Posto de Trabalho  
    Trabalho em Altura
    Condução de Veículos
    Trabalho com Máquinas
    Ar Condicionado
    Luz Artificial
    Alcatifas

    3 - Antecedentes Ocupacionais

    Actividades Anteriores Entidade Local de Trabalho Período de Tempo  
    Factores e Risco Actividade Tempo de Exposição
    Fisicos
    Químicos
    Biológicos
    Ergonómicos
    Psicossociais
    Acidente Data Lesão Corporal Incapacidade Resultante %  
    Suspeitas (código) Data Declaradas (código) Data  

    4 - Antecedentes Pessoais

    5 - Hábitos

    6 - Antecedentes Familiares

    Doença Pai Mãe Irmãos Avós Outros
    Infecciosas
    Neoplasias
    Dças. GI. Endocrinas, Nutrição, Metabolismo, Imunitárias
    Doeças Sangue e Orgãos Hemotopoieticos
    Transtornos Mentais
    Doenças SNC e Orgãos Sentidos
    Doenças Aparelho Circulatório
    Doenças Aparelho Respiratório
    Doenças Aparelho Digestivo
    Doenças Aparelho Génito - Urinário
    Complicações da Gravidez e Puerpério
    Doenças Pele e Tec. Celular Subcutâneo
    Doenças Sist. Osteomuscular e Tec. Conjuntivo
    Anomalias Congénitas
    Sintomas, Sinais e Afecções mal definidas
    Lesões, Acidentes e Envenenamentos

    7 - Exame Objectivo

    7.1 - Biometria
    (Kg)
    (mmHg)
    (cm)
    (bpm)
      Perto Longe
    Olho Esquerdo
    Olho Direito

    8 - Doenças Activas

    9 - Classificação Individual de Saúde

    10 - Absentismo

    11 - Esquema Vacinal

    12 - Conclusões/Resumo

    13 - Propostas de Solução

    14 - Observações

    15 - Parecer

    16 - Reavaliação

    17 - Data do Exame


     

     

     

    Observações


     

     

     

    Motivo do Exame
    Resumo
    Problemas
    Soluções
    Parecer
    Reavaliação
    Data do Exame

     

     

     

    Hábitos
    Exame Objectivo
    (Kg)
    (mmHg)
    (cm)
    (bpm)
      Perto Longe
    Olho Esquerdo
    Olho Direito
    Classificação Individual de Saúde
    Absentismo
    Esquema Vacinal
    Resumo
    Problemas
    Soluções
    Parecer
    Reavaliação
    Data do Exame

     

     

     

    Fichas

    Autor Estado  
    {{item.concluido ? 'Concluido' : 'Em Aberto'}}
    \ No newline at end of file +

    1 - Identificação

    1.1 - Empresa
    1.2 - Utente

    2 - Actividade

    Condições de Trabalho
    Horário   Postura   Tarefas   Esforço  
    Normal Sentado Variadas Físico:  
    Contínuo Em Pé Criativas Cargas > 10 Kg
    Turnos Deslocações Monótonas Cargas < 10 Kg
    Nocturno Parado Repetitivas Visual
    Isenção Sentádo/Pé Minuciosas Mental

     

    Posto de Trabalho  
    Trabalho em Altura
    Condução de Veículos
    Trabalho com Máquinas
    Ar Condicionado
    Luz Artificial
    Alcatifas

    3 - Antecedentes Ocupacionais

    Actividades Anteriores Entidade Local de Trabalho Período de Tempo  
    Factores e Risco Actividade Tempo de Exposição
    Fisicos
    Químicos
    Biológicos
    Ergonómicos
    Psicossociais
    Acidente Data Lesão Corporal Incapacidade Resultante %  
    Suspeitas (código) Data Declaradas (código) Data  

    4 - Antecedentes Pessoais

    5 - Hábitos

    6 - Antecedentes Familiares

    Doença Pai Mãe Irmãos Avós Outros
    Infecciosas
    Neoplasias
    Dças. GI. Endocrinas, Nutrição, Metabolismo, Imunitárias
    Doeças Sangue e Orgãos Hemotopoieticos
    Transtornos Mentais
    Doenças SNC e Orgãos Sentidos
    Doenças Aparelho Circulatório
    Doenças Aparelho Respiratório
    Doenças Aparelho Digestivo
    Doenças Aparelho Génito - Urinário
    Complicações da Gravidez e Puerpério
    Doenças Pele e Tec. Celular Subcutâneo
    Doenças Sist. Osteomuscular e Tec. Conjuntivo
    Anomalias Congénitas
    Sintomas, Sinais e Afecções mal definidas
    Lesões, Acidentes e Envenenamentos

    7 - Exame Objectivo

    7.1 - Biometria
    (Kg)
    (mmHg)
    (cm)
    (bpm)
      Perto Longe
    Olho Esquerdo
    Olho Direito

    8 - Doenças Activas

    9 - Classificação Individual de Saúde

    10 - Absentismo

    11 - Esquema Vacinal

    12 - Conclusões/Resumo

    13 - Propostas de Solução

    14 - Observações

    15 - Parecer

    16 - Reavaliação

    17 - Data do Exame


     

     

     

    Observações


     

     

     

    Motivo do Exame
    Resumo
    Problemas
    Soluções
    Parecer
    Reavaliação
    Data do Exame

     

     

     

    Hábitos
    Exame Objectivo
    (Kg)
    (mmHg)
    (cm)
    (bpm)
      Perto Longe
    Olho Esquerdo
    Olho Direito
    Classificação Individual de Saúde
    Absentismo
    Esquema Vacinal
    Resumo
    Problemas
    Soluções
    Parecer
    Reavaliação
    Data do Exame

     

     

     

    Fichas

    Autor Estado  
    {{item.concluido ? 'Concluido' : 'Em Aberto'}}
    \ No newline at end of file