omniauth-sabia 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +16 -39
- data/Gemfile +2 -62
- data/{vendor/plugins/omniauth-sabia/README.md → README.md} +0 -0
- data/{vendor/plugins/omniauth-sabia/lib → lib}/omniauth-sabia.rb +0 -0
- data/{vendor/plugins/omniauth-sabia/lib → lib}/omniauth-sabia/version.rb +1 -1
- data/{vendor/plugins/omniauth-sabia/lib → lib}/omniauth/strategies/sabia.rb +0 -0
- data/{vendor/plugins/omniauth-sabia/omniauth-sabia.gemspec → omniauth-sabia.gemspec} +0 -0
- metadata +9 -990
- data/Dockerfile +0 -13
- data/Gemfile.lock +0 -315
- data/README.rdoc +0 -261
- data/Rakefile +0 -7
- data/app.docker +0 -13
- data/app/assets/images/calc.png +0 -0
- data/app/assets/images/dds.png +0 -0
- data/app/assets/images/diabetes.png +0 -0
- data/app/assets/images/disturbiosadrenais.png +0 -0
- data/app/assets/images/disturbioscrescimento.png +0 -0
- data/app/assets/images/disturbiospuberais.png +0 -0
- data/app/assets/images/disturbiostireoidianos.png +0 -0
- data/app/assets/images/emblema.png +0 -0
- data/app/assets/images/geral.png +0 -0
- data/app/assets/images/huol_logo.png +0 -0
- data/app/assets/images/lais_logo.png +0 -0
- data/app/assets/images/logo.jpg +0 -0
- data/app/assets/images/miscelanea.png +0 -0
- data/app/assets/images/obesidadedislipidemias.png +0 -0
- data/app/assets/images/pdf.png +0 -0
- data/app/assets/images/pesquisa.png +0 -0
- data/app/assets/images/print.png +0 -0
- data/app/assets/images/select2/select2-spinner.gif +0 -0
- data/app/assets/images/select2/select2.png +0 -0
- data/app/assets/images/select2/select2x2.png +0 -0
- data/app/assets/images/uep-ufrn.JPG +0 -0
- data/app/assets/images/ufrn.jpg +0 -0
- data/app/assets/images/ufrn_logo.png +0 -0
- data/app/assets/javascripts/application.js +0 -302
- data/app/assets/javascripts/bootstrap/bootstrap.min.js +0 -6
- data/app/assets/javascripts/datepicker/bootstrap-datepicker.js +0 -1671
- data/app/assets/javascripts/datepicker/locales/bootstrap-datepicker.pt-BR.js +0 -15
- data/app/assets/javascripts/fullcalendar/fullcalendar.js +0 -11898
- data/app/assets/javascripts/fullcalendar/locales/pt-br.js +0 -1
- data/app/assets/javascripts/jquery-1.10.0.min.js +0 -6
- data/app/assets/javascripts/jquery-ui/jquery.maskedinput.min.js +0 -7
- data/app/assets/javascripts/jquery.onerror.js +0 -33
- data/app/assets/javascripts/moment.min.js +0 -7
- data/app/assets/javascripts/select2/select2.min.js +0 -23
- data/app/assets/javascripts/select2/select2_locale_pt-BR.js +0 -18
- data/app/assets/stylesheets/application.css +0 -442
- data/app/assets/stylesheets/bootstrap/bootstrap.min.css +0 -7
- data/app/assets/stylesheets/bootstrap/font-awesome.min.css +0 -4
- data/app/assets/stylesheets/bootstrap/font/FontAwesome.otf +0 -0
- data/app/assets/stylesheets/bootstrap/font/fontawesome-webfont.eot +0 -0
- data/app/assets/stylesheets/bootstrap/font/fontawesome-webfont.svg +0 -655
- data/app/assets/stylesheets/bootstrap/font/fontawesome-webfont.ttf +0 -0
- data/app/assets/stylesheets/bootstrap/font/fontawesome-webfont.woff +0 -0
- data/app/assets/stylesheets/bootstrap/font/fontawesome-webfont.woff2 +0 -0
- data/app/assets/stylesheets/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/stylesheets/bootstrap/fonts/glyphicons-halflings-regular.svg +0 -229
- data/app/assets/stylesheets/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/stylesheets/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/stylesheets/bootstrap/subnav.css +0 -143
- data/app/assets/stylesheets/datepicker/datepicker3.css +0 -790
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.svg +0 -229
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/stylesheets/fonts/texgyreadventor-regular-webfont.eot +0 -0
- data/app/assets/stylesheets/fonts/texgyreadventor-regular-webfont.svg +0 -1410
- data/app/assets/stylesheets/fonts/texgyreadventor-regular-webfont.ttf +0 -0
- data/app/assets/stylesheets/fonts/texgyreadventor-regular-webfont.woff +0 -0
- data/app/assets/stylesheets/fullcalendar/fullcalendar.css +0 -1142
- data/app/assets/stylesheets/pagination.css +0 -0
- data/app/assets/stylesheets/patologias.css.scss +0 -3
- data/app/assets/stylesheets/pdf.css +0 -59
- data/app/assets/stylesheets/select2/select2.bootstrap.css +0 -87
- data/app/assets/stylesheets/select2/select2.css +0 -692
- data/app/controllers/admin/cid_controller.rb +0 -9
- data/app/controllers/admin/medicos_controller.rb +0 -67
- data/app/controllers/admin/patologias_controller.rb +0 -47
- data/app/controllers/admin/relatorios_controller.rb +0 -286
- data/app/controllers/admin/tipo_exames_controller.rb +0 -82
- data/app/controllers/admin/unidades_saude_controller.rb +0 -85
- data/app/controllers/admin_controller.rb +0 -17
- data/app/controllers/agendamentos_controller.rb +0 -101
- data/app/controllers/alunos_controller.rb +0 -88
- data/app/controllers/api/consultas_controller.rb +0 -13
- data/app/controllers/api/mensagens_controller.rb +0 -102
- data/app/controllers/api/pacientes_controller.rb +0 -15
- data/app/controllers/api/teleconsultorias_controller.rb +0 -19
- data/app/controllers/api_controller.rb +0 -31
- data/app/controllers/application_controller.rb +0 -24
- data/app/controllers/assistencia_social/pacientes_controller.rb +0 -37
- data/app/controllers/cids_controller.rb +0 -16
- data/app/controllers/consultas_controller.rb +0 -227
- data/app/controllers/conta_controller.rb +0 -22
- data/app/controllers/doses_controller.rb +0 -94
- data/app/controllers/especialidades_controller.rb +0 -91
- data/app/controllers/exames_controller.rb +0 -110
- data/app/controllers/formacoes_controller.rb +0 -91
- data/app/controllers/impressos_controller.rb +0 -97
- data/app/controllers/medicacoes_controller.rb +0 -89
- data/app/controllers/mensagens_controller.rb +0 -73
- data/app/controllers/modelos_impressos_controller.rb +0 -75
- data/app/controllers/modulos_controller.rb +0 -9
- data/app/controllers/pacientes_controller.rb +0 -175
- data/app/controllers/padroes_oms_controller.rb +0 -68
- data/app/controllers/paginas_controller.rb +0 -6
- data/app/controllers/painel_controller.rb +0 -30
- data/app/controllers/percentis_controller.rb +0 -92
- data/app/controllers/profissionais_controller.rb +0 -102
- data/app/controllers/quadros_controller.rb +0 -95
- data/app/controllers/reavaliacoes_controller.rb +0 -99
- data/app/controllers/redefinir_senha_controller.rb +0 -34
- data/app/controllers/respostas_controller.rb +0 -99
- data/app/controllers/sessions_controller.rb +0 -49
- data/app/controllers/supervisao/pesquisas_controller.rb +0 -170
- data/app/controllers/supervisao_controller.rb +0 -9
- data/app/controllers/teleconsultorias_controller.rb +0 -110
- data/app/controllers/tipo_diabetes_controller.rb +0 -85
- data/app/controllers/tipo_exames_controller.rb +0 -24
- data/app/controllers/tipos_profissionais_controller.rb +0 -85
- data/app/controllers/unidades_saude_controller.rb +0 -79
- data/app/helpers/admin/cid_helper.rb +0 -2
- data/app/helpers/admin/medicos_helper.rb +0 -2
- data/app/helpers/admin/relatorios_helper.rb +0 -13
- data/app/helpers/admin/tipo_exames_helper.rb +0 -2
- data/app/helpers/admin/unidades_saude_helper.rb +0 -2
- data/app/helpers/admin_helper.rb +0 -2
- data/app/helpers/agendamentos_helper.rb +0 -2
- data/app/helpers/alunos_helper.rb +0 -2
- data/app/helpers/api/consultas_helper.rb +0 -2
- data/app/helpers/api/pacientes_helper.rb +0 -2
- data/app/helpers/application_helper.rb +0 -103
- data/app/helpers/assistencia_social/pacientes_helper.rb +0 -2
- data/app/helpers/cids_helper.rb +0 -2
- data/app/helpers/consultas_helper.rb +0 -148
- data/app/helpers/conta_helper.rb +0 -2
- data/app/helpers/doses_helper.rb +0 -2
- data/app/helpers/especialidades_helper.rb +0 -2
- data/app/helpers/exames_helper.rb +0 -2
- data/app/helpers/formacoes_helper.rb +0 -2
- data/app/helpers/impressos_helper.rb +0 -2
- data/app/helpers/medicacoes_helper.rb +0 -2
- data/app/helpers/mensagens_helper.rb +0 -2
- data/app/helpers/modelos_impressos_helper.rb +0 -2
- data/app/helpers/pacientes_helper.rb +0 -2
- data/app/helpers/padroes_oms_helper.rb +0 -2
- data/app/helpers/paginas_helper.rb +0 -2
- data/app/helpers/painel_helper.rb +0 -2
- data/app/helpers/patologias_helper.rb +0 -2
- data/app/helpers/percentis_helper.rb +0 -2
- data/app/helpers/profissionais_helper.rb +0 -10
- data/app/helpers/quadros_helper.rb +0 -2
- data/app/helpers/reavaliacoes_helper.rb +0 -2
- data/app/helpers/respostas_helper.rb +0 -2
- data/app/helpers/sessions_helper.rb +0 -2
- data/app/helpers/supervisao/pesquisas_helper.rb +0 -2
- data/app/helpers/supervisao_helper.rb +0 -2
- data/app/helpers/teleconsultorias_helper.rb +0 -2
- data/app/helpers/tipo_diabetes_helper.rb +0 -2
- data/app/helpers/tipos_exames_helper.rb +0 -2
- data/app/helpers/tipos_profissionais_helper.rb +0 -2
- data/app/helpers/unidades_saude_helper.rb +0 -2
- data/app/mailers/administracao_mailer.rb +0 -6
- data/app/mailers/application_mailer.rb +0 -4
- data/app/mailers/client_side_mailer.rb +0 -27
- data/app/mailers/duvidas_clinicas_mailer.rb +0 -17
- data/app/mailers/redefinir_senha_mailer.rb +0 -10
- data/app/mailers/supervisao_mailer.rb +0 -11
- data/app/models/agendamento.rb +0 -16
- data/app/models/aluno.rb +0 -5
- data/app/models/application_record.rb +0 -3
- data/app/models/cid.rb +0 -14
- data/app/models/cidade.rb +0 -9
- data/app/models/concentracao.rb +0 -3
- data/app/models/consulta.rb +0 -102
- data/app/models/consulta_autosave.rb +0 -15
- data/app/models/diagnostico.rb +0 -4
- data/app/models/dica.rb +0 -2
- data/app/models/dose.rb +0 -15
- data/app/models/dose_administrada.rb +0 -16
- data/app/models/dose_vacina.rb +0 -4
- data/app/models/especialidade.rb +0 -10
- data/app/models/estado.rb +0 -2
- data/app/models/exame.rb +0 -13
- data/app/models/formacao.rb +0 -10
- data/app/models/hipotese.rb +0 -4
- data/app/models/impresso.rb +0 -16
- data/app/models/marco.rb +0 -3
- data/app/models/marco_atingido.rb +0 -4
- data/app/models/medicacao.rb +0 -32
- data/app/models/mensagem.rb +0 -37
- data/app/models/modelo_impresso.rb +0 -120
- data/app/models/modulo.rb +0 -20
- data/app/models/paciente.rb +0 -146
- data/app/models/paciente_hosped.rb +0 -2
- data/app/models/padrao_oms_dias.rb +0 -2
- data/app/models/padrao_oms_meses.rb +0 -2
- data/app/models/patologia.rb +0 -5
- data/app/models/percentil.rb +0 -53
- data/app/models/perfil.rb +0 -28
- data/app/models/permissao.rb +0 -4
- data/app/models/profissional.rb +0 -74
- data/app/models/quadro.rb +0 -36
- data/app/models/reavaliacao.rb +0 -22
- data/app/models/recurso.rb +0 -4
- data/app/models/resposta.rb +0 -4
- data/app/models/teleconsultoria.rb +0 -23
- data/app/models/tipo_diabete.rb +0 -9
- data/app/models/tipo_exame.rb +0 -37
- data/app/models/tipo_insulina.rb +0 -9
- data/app/models/tipo_parto.rb +0 -9
- data/app/models/tipo_profissional.rb +0 -10
- data/app/models/token.rb +0 -37
- data/app/models/turno.rb +0 -10
- data/app/models/unidade_saude.rb +0 -17
- data/app/models/usuario.rb +0 -69
- data/app/models/vacina.rb +0 -3
- data/app/views/admin/cid/index.html.erb +0 -62
- data/app/views/admin/index.html.erb +0 -17
- data/app/views/admin/medicos/edit.html.erb +0 -361
- data/app/views/admin/medicos/index.html.erb +0 -96
- data/app/views/admin/medicos/new.html.erb +0 -370
- data/app/views/admin/medicos/show.html.erb +0 -191
- data/app/views/admin/patologias/edit.html.erb +0 -90
- data/app/views/admin/patologias/index.html.erb +0 -81
- data/app/views/admin/patologias/new.html.erb +0 -90
- data/app/views/admin/patologias/show.html.erb +0 -34
- data/app/views/admin/relatorios/ano_municipio.pdf.erb +0 -19
- data/app/views/admin/relatorios/ano_patologia.pdf.erb +0 -19
- data/app/views/admin/relatorios/index.html.erb +0 -3
- data/app/views/admin/relatorios/mes_ano.pdf.erb +0 -24
- data/app/views/admin/relatorios/patologia_mes_ano.pdf.erb +0 -23
- data/app/views/admin/tipo_exames/edit.html.erb +0 -52
- data/app/views/admin/tipo_exames/index.html.erb +0 -67
- data/app/views/admin/tipo_exames/new.html.erb +0 -52
- data/app/views/admin/tipo_exames/transferencia.html.erb +0 -53
- data/app/views/admin/unidades_saude/_form.html.erb +0 -127
- data/app/views/admin/unidades_saude/edit.html.erb +0 -24
- data/app/views/admin/unidades_saude/index.html.erb +0 -75
- data/app/views/admin/unidades_saude/new.html.erb +0 -24
- data/app/views/admin/unidades_saude/show.html.erb +0 -41
- data/app/views/administracao_mailer/cadastrar.html.erb +0 -16
- data/app/views/agendamentos/_new_agendamento.html.erb +0 -208
- data/app/views/agendamentos/edit.html.erb +0 -109
- data/app/views/agendamentos/index.html.erb +0 -205
- data/app/views/agendamentos/new.html.erb +0 -209
- data/app/views/agendamentos/show.html.erb +0 -59
- data/app/views/alunos/_form.html.erb +0 -17
- data/app/views/alunos/edit.html.erb +0 -6
- data/app/views/alunos/index.html.erb +0 -21
- data/app/views/alunos/new.html.erb +0 -5
- data/app/views/alunos/show.html.erb +0 -5
- data/app/views/api/index.html.erb +0 -452
- data/app/views/assistencia_social/pacientes/index.html.erb +0 -137
- data/app/views/client_side_mailer/report_problem.html.erb +0 -24
- data/app/views/consultas/_dados_paciente.html.erb +0 -116
- data/app/views/consultas/_quadro_clinico_inicial.html.erb +0 -294
- data/app/views/consultas/edit.html.erb +0 -196
- data/app/views/consultas/edit/_avaliacao_inicial.html.erb +0 -394
- data/app/views/consultas/graficos.print.erb +0 -18
- data/app/views/consultas/index.html.erb +0 -124
- data/app/views/consultas/new.html.erb +0 -452
- data/app/views/consultas/new/_analise_dietetica.html.erb +0 -70
- data/app/views/consultas/new/_avaliacao_inicial.html.erb +0 -391
- data/app/views/consultas/new/_carregar_autosave.html.erb +0 -374
- data/app/views/consultas/new/_carregar_consulta_anterior.html.erb +0 -35
- data/app/views/consultas/new/_conclusoes.html.erb +0 -93
- data/app/views/consultas/new/_consultas.html.erb +0 -24
- data/app/views/consultas/new/_desenvolvimento_neuropsicomotor.html.erb +0 -125
- data/app/views/consultas/new/_exame_clinico.html.erb +0 -126
- data/app/views/consultas/new/_exames_periodicos.html.erb +0 -213
- data/app/views/consultas/new/_impressos.html.erb +0 -324
- data/app/views/consultas/new/_medicacoes.html.erb +0 -18
- data/app/views/consultas/new/_medicacoes_diabetes.html.erb +0 -417
- data/app/views/consultas/new/_medicacoes_doses.html.erb +0 -10
- data/app/views/consultas/new/_medicacoes_suplementacoes.html.erb +0 -10
- data/app/views/consultas/new/_vacinacao.html.erb +0 -153
- data/app/views/consultas/show.html.erb +0 -104
- data/app/views/consultas/show.pdf.erb +0 -41
- data/app/views/consultas/show/html/_analise_dietetica.html.erb +0 -101
- data/app/views/consultas/show/html/_avaliacao_inicial.html.erb +0 -265
- data/app/views/consultas/show/html/_conclusoes.html.erb +0 -127
- data/app/views/consultas/show/html/_desenvolvimento_neuropsicomotor.html.erb +0 -79
- data/app/views/consultas/show/html/_exame_clinico.html.erb +0 -148
- data/app/views/consultas/show/html/_exames_periodicos.html.erb +0 -28
- data/app/views/consultas/show/html/_impressos.html.erb +0 -108
- data/app/views/consultas/show/html/_medicacoes.html.erb +0 -13
- data/app/views/consultas/show/html/_medicacoes_diabetes.html.erb +0 -145
- data/app/views/consultas/show/html/_medicacoes_doses.html.erb +0 -10
- data/app/views/consultas/show/html/_medicacoes_suplementacoes.html.erb +0 -10
- data/app/views/consultas/show/html/_teleconsultoria.html.erb +0 -58
- data/app/views/consultas/show/html/_vacinacao.html.erb +0 -70
- data/app/views/consultas/show/pdf/_analise_dietetica.pdf.erb +0 -42
- data/app/views/consultas/show/pdf/_avaliacao_inicial.pdf.erb +0 -166
- data/app/views/consultas/show/pdf/_conclusoes.pdf.erb +0 -28
- data/app/views/consultas/show/pdf/_dados_paciente.pdf.erb +0 -6
- data/app/views/consultas/show/pdf/_desenvolvimento_neuropsicomotor.pdf.erb +0 -51
- data/app/views/consultas/show/pdf/_exame_clinico.pdf.erb +0 -47
- data/app/views/consultas/show/pdf/_exames_periodicos.pdf.erb +0 -23
- data/app/views/consultas/show/pdf/_medicacoes.pdf.erb +0 -13
- data/app/views/consultas/show/pdf/_medicacoes_diabetes.pdf.erb +0 -86
- data/app/views/consultas/show/pdf/_medicacoes_doses.pdf.erb +0 -4
- data/app/views/consultas/show/pdf/_medicacoes_suplementacoes.pdf.erb +0 -4
- data/app/views/consultas/show/pdf/_vacinacao.pdf.erb +0 -74
- data/app/views/conta/index.html.erb +0 -264
- data/app/views/doses/_form.html.erb +0 -37
- data/app/views/doses/edit.html.erb +0 -6
- data/app/views/doses/index.html.erb +0 -31
- data/app/views/doses/new.html.erb +0 -5
- data/app/views/doses/show.html.erb +0 -30
- data/app/views/duvidas_clinicas_mailer/nova_duvida.html.erb +0 -12
- data/app/views/duvidas_clinicas_mailer/nova_resposta.erb +0 -12
- data/app/views/especialidades/_form.html.erb +0 -27
- data/app/views/especialidades/edit.html.erb +0 -6
- data/app/views/especialidades/index.html.erb +0 -21
- data/app/views/especialidades/new.html.erb +0 -5
- data/app/views/especialidades/show.html.erb +0 -7
- data/app/views/exames/_form.html.erb +0 -33
- data/app/views/exames/edit.html.erb +0 -6
- data/app/views/exames/index.html.erb +0 -30
- data/app/views/exames/index.pdf.erb +0 -31
- data/app/views/exames/new.html.erb +0 -5
- data/app/views/exames/show.html.erb +0 -25
- data/app/views/formacoes/_form.html.erb +0 -27
- data/app/views/formacoes/edit.html.erb +0 -6
- data/app/views/formacoes/index.html.erb +0 -21
- data/app/views/formacoes/new.html.erb +0 -5
- data/app/views/formacoes/show.html.erb +0 -8
- data/app/views/impressos/edit.html.erb +0 -74
- data/app/views/impressos/index.html.erb +0 -2
- data/app/views/impressos/new.html.erb +0 -72
- data/app/views/impressos/show.html.erb +0 -28
- data/app/views/impressos/show.pdf.erb +0 -3
- data/app/views/layouts/application.html.erb +0 -174
- data/app/views/layouts/area_publica.html.erb +0 -45
- data/app/views/layouts/assistencia_social.html.erb +0 -125
- data/app/views/layouts/layout.pdf.erb +0 -16
- data/app/views/layouts/layout.print.erb +0 -48
- data/app/views/layouts/mailer.html.erb +0 -8
- data/app/views/layouts/mailer.text.erb +0 -1
- data/app/views/layouts/pdf-footer.html.erb +0 -18
- data/app/views/layouts/pdf-header.html.erb +0 -13
- data/app/views/layouts/relatorios/estatisticos/footer.html.erb +0 -0
- data/app/views/layouts/relatorios/estatisticos/header.html.erb +0 -25
- data/app/views/layouts/relatorios/estatisticos/layout.pdf.erb +0 -16
- data/app/views/layouts/sessions.html.erb +0 -27
- data/app/views/medicacoes/_form.html.erb +0 -45
- data/app/views/medicacoes/edit.html.erb +0 -6
- data/app/views/medicacoes/index.html.erb +0 -35
- data/app/views/medicacoes/new.html.erb +0 -5
- data/app/views/medicacoes/show.html.erb +0 -40
- data/app/views/mensagens/_form.html.erb +0 -29
- data/app/views/mensagens/edit.html.erb +0 -6
- data/app/views/mensagens/index.html.erb +0 -27
- data/app/views/mensagens/new.html.erb +0 -5
- data/app/views/mensagens/show.html.erb +0 -20
- data/app/views/modelos_impressos/_ajuda.html.erb +0 -31
- data/app/views/modelos_impressos/edit.html.erb +0 -106
- data/app/views/modelos_impressos/index.html.erb +0 -84
- data/app/views/modelos_impressos/new.html.erb +0 -97
- data/app/views/modelos_impressos/show.html.erb +0 -36
- data/app/views/modulos/index.html.erb +0 -16
- data/app/views/pacientes/_form.html.erb +0 -136
- data/app/views/pacientes/busca_avancada.html.erb +0 -50
- data/app/views/pacientes/edit.html.erb +0 -20
- data/app/views/pacientes/index.html.erb +0 -149
- data/app/views/pacientes/marcos_adiantados.pdf.erb +0 -39
- data/app/views/pacientes/marcos_atrasados.pdf.erb +0 -35
- data/app/views/pacientes/new.html.erb +0 -20
- data/app/views/pacientes/show.html.erb +0 -126
- data/app/views/pacientes/show/_agendamentos.html.erb +0 -50
- data/app/views/pacientes/show/_consultas.html.erb +0 -39
- data/app/views/pacientes/show/_dados_basicos.html.erb +0 -166
- data/app/views/pacientes/show/_dados_clinicos_legados.html.erb +0 -58
- data/app/views/pacientes/show/_exames.html.erb +0 -31
- data/app/views/pacientes/show/_impressos.html.erb +0 -108
- data/app/views/pacientes/show/_quadro_clinico_inicial.html.erb +0 -294
- data/app/views/pacientes/show/_reavaliacoes.html.erb +0 -41
- data/app/views/paginas/navegador_incompativel.html.erb +0 -17
- data/app/views/painel/index.html.erb +0 -176
- data/app/views/profissionais/_form.html.erb +0 -65
- data/app/views/profissionais/edit.html.erb +0 -6
- data/app/views/profissionais/index.html.erb +0 -45
- data/app/views/profissionais/new.html.erb +0 -5
- data/app/views/profissionais/show.html.erb +0 -63
- data/app/views/quadros/edit.html.erb +0 -179
- data/app/views/quadros/index.html.erb +0 -37
- data/app/views/quadros/new.html.erb +0 -331
- data/app/views/quadros/show.html.erb +0 -313
- data/app/views/quadros/show.pdf.erb +0 -172
- data/app/views/reavaliacoes/_form.html.erb +0 -160
- data/app/views/reavaliacoes/edit.html.erb +0 -3
- data/app/views/reavaliacoes/index.html.erb +0 -31
- data/app/views/reavaliacoes/new.html.erb +0 -9
- data/app/views/reavaliacoes/show.html.erb +0 -107
- data/app/views/reavaliacoes/show.pdf.erb +0 -77
- data/app/views/redefinir_senha/edit.html.erb +0 -94
- data/app/views/redefinir_senha_mailer/redefinicao.html.erb +0 -11
- data/app/views/respostas/_form.html.erb +0 -29
- data/app/views/respostas/edit.html.erb +0 -6
- data/app/views/respostas/index.html.erb +0 -27
- data/app/views/respostas/new.html.erb +0 -5
- data/app/views/respostas/show.html.erb +0 -20
- data/app/views/sessions/new.html.erb +0 -123
- data/app/views/supervisao/index.html.erb +0 -10
- data/app/views/supervisao/pesquisas/consultas.html.erb +0 -50
- data/app/views/supervisao/pesquisas/new.html.erb +0 -612
- data/app/views/supervisao/pesquisas/pacientes.html.erb +0 -47
- data/app/views/supervisao_mailer/cadastrar.html.erb +0 -16
- data/app/views/supervisao_mailer/notificar_duvida_clinica.html.erb +0 -12
- data/app/views/teleconsultorias/_form.html.erb +0 -23
- data/app/views/teleconsultorias/edit.html.erb +0 -6
- data/app/views/teleconsultorias/index.html.erb +0 -34
- data/app/views/teleconsultorias/new.html.erb +0 -13
- data/app/views/teleconsultorias/show.html.erb +0 -5
- data/app/views/tipo_diabetes/_form.html.erb +0 -21
- data/app/views/tipo_diabetes/edit.html.erb +0 -6
- data/app/views/tipo_diabetes/index.html.erb +0 -23
- data/app/views/tipo_diabetes/new.html.erb +0 -5
- data/app/views/tipo_diabetes/show.html.erb +0 -10
- data/app/views/tipo_exames/edit.html.erb +0 -2
- data/app/views/tipo_exames/index.html.erb +0 -2
- data/app/views/tipo_exames/new.html.erb +0 -2
- data/app/views/tipo_exames/show.html.erb +0 -2
- data/app/views/tipos_profissionais/_form.html.erb +0 -21
- data/app/views/tipos_profissionais/edit.html.erb +0 -6
- data/app/views/tipos_profissionais/index.html.erb +0 -23
- data/app/views/tipos_profissionais/new.html.erb +0 -5
- data/app/views/tipos_profissionais/show.html.erb +0 -8
- data/app/views/unidades_saude/_form.html.erb +0 -21
- data/app/views/unidades_saude/edit.html.erb +0 -6
- data/app/views/unidades_saude/index.html.erb +0 -23
- data/app/views/unidades_saude/new.html.erb +0 -5
- data/app/views/unidades_saude/show.html.erb +0 -10
- data/bin/bundle +0 -3
- data/bin/rails +0 -4
- data/bin/rake +0 -4
- data/bin/setup +0 -34
- data/bin/update +0 -29
- data/config.ru +0 -4
- data/config/application.rb +0 -20
- data/config/boot.rb +0 -3
- data/config/cable.yml +0 -9
- data/config/cucumber.yml +0 -8
- data/config/environment.rb +0 -5
- data/config/environments/development.rb +0 -54
- data/config/environments/production.rb +0 -86
- data/config/environments/test.rb +0 -42
- data/config/environments/treinamento.rb +0 -86
- data/config/initializers/active_record_belongs_to_required_by_default.rb +0 -1
- data/config/initializers/application_controller_renderer.rb +0 -6
- data/config/initializers/assets.rb +0 -34
- data/config/initializers/backtrace_silencers.rb +0 -7
- data/config/initializers/callback_terminator.rb +0 -1
- data/config/initializers/cookies_serializer.rb +0 -5
- data/config/initializers/factory_girl_config.rb +0 -3
- data/config/initializers/filter_parameter_logging.rb +0 -4
- data/config/initializers/inflections.rb +0 -45
- data/config/initializers/mime_types.rb +0 -5
- data/config/initializers/new_framework_defaults.rb +0 -23
- data/config/initializers/omniauth.rb +0 -7
- data/config/initializers/paper_trail.rb +0 -1
- data/config/initializers/session_store.rb +0 -3
- data/config/initializers/setup_mail.rb +0 -9
- data/config/initializers/simple_form.rb +0 -165
- data/config/initializers/simple_form_bootstrap.rb +0 -149
- data/config/initializers/wicked_pdf.rb +0 -7
- data/config/initializers/will_paginate_array_fix.rb +0 -1
- data/config/initializers/wrap_parameters.rb +0 -14
- data/config/locales/en.bootstrap.yml +0 -17
- data/config/locales/en.yml +0 -23
- data/config/locales/pt-BR.yml +0 -217
- data/config/locales/simple_form.en.yml +0 -31
- data/config/puma.rb +0 -47
- data/config/routes.rb +0 -125
- data/config/schedule.rb +0 -24
- data/config/spring.rb +0 -6
- data/data.docker +0 -6
- data/db/backup/config.rb +0 -32
- data/db/backup/models/mysql_backup.rb +0 -84
- data/db/migrate/20120604175906_create_pacientes.rb +0 -34
- data/db/migrate/20120604175958_create_especialidades.rb +0 -9
- data/db/migrate/20120604180437_create_tipos_profissionais.rb +0 -9
- data/db/migrate/20120604181253_create_profissionais.rb +0 -24
- data/db/migrate/20120604182754_create_agendamentos.rb +0 -13
- data/db/migrate/20120604185707_create_formacoes.rb +0 -9
- data/db/migrate/20120606191632_create_consultas.rb +0 -57
- data/db/migrate/20120606202227_create_usuarios.rb +0 -13
- data/db/migrate/20120607113309_create_quadros.rb +0 -18
- data/db/migrate/20120607120139_create_tipo_diabetes.rb +0 -9
- data/db/migrate/20120607185247_create_exames.rb +0 -13
- data/db/migrate/20120607185745_create_tipo_exames.rb +0 -10
- data/db/migrate/20120608133535_create_medicacoes.rb +0 -15
- data/db/migrate/20120608134843_create_doses.rb +0 -18
- data/db/migrate/20120608141134_create_tipo_insulinas.rb +0 -9
- data/db/migrate/20120618013135_create_unidades_saude.rb +0 -12
- data/db/migrate/20120622012230_create_reavaliacoes.rb +0 -13
- data/db/migrate/20120712213549_create_recursos.rb +0 -11
- data/db/migrate/20120712213726_create_perfis.rb +0 -9
- data/db/migrate/20120712213812_create_permissoes.rb +0 -10
- data/db/migrate/20120714015420_create_versions.rb +0 -18
- data/db/migrate/20120716225507_create_respostas.rb +0 -11
- data/db/migrate/20120717121640_create_padroes_oms_dias.rb +0 -20
- data/db/migrate/20120717150014_create_padroes_oms_meses.rb +0 -22
- data/db/migrate/20120731194538_create_profissionais_unidades_saude.rb +0 -13
- data/db/migrate/20120807193616_create_pacientes_hosped.rb +0 -33
- data/db/migrate/20120902231308_create_concentracoes.rb +0 -10
- data/db/migrate/20130127214243_create_modelos_receitas.rb +0 -10
- data/db/migrate/20130127214318_create_receitas.rb +0 -12
- data/db/migrate/20130329143219_create_perfis_usuarios.rb +0 -11
- data/db/migrate/20130530193921_add_peso_to_reavaliacoes.rb +0 -9
- data/db/migrate/20130531004631_add_medico_to_reavaliacoes.rb +0 -9
- data/db/migrate/20130531230024_add_cartao_sus_to_pacientes.rb +0 -9
- data/db/migrate/20130602230010_delete_modelo_from_receitas.rb +0 -9
- data/db/migrate/20131001190150_rename_perfil_aluno.rb +0 -9
- data/db/migrate/20140128162226_add_redefinirsenha_to_usuario.rb +0 -8
- data/db/migrate/20140204201145_add_resposta_vista_to_consulta.rb +0 -6
- data/db/migrate/20140218172542_insert_new_perfis.rb +0 -11
- data/db/migrate/20140218172554_insert_new_recurso.rb +0 -9
- data/db/migrate/20140218172603_insert_new_permissoes.rb +0 -21
- data/db/migrate/20140218205922_add_codigo_cnes_to_unidades_saude.rb +0 -6
- data/db/migrate/20140218212214_add_discutido_com_to_consulta.rb +0 -5
- data/db/migrate/20140321140331_create_modulos.rb +0 -13
- data/db/migrate/20140331132144_create_usuarios_modulos.rb +0 -8
- data/db/migrate/20140331132322_insert_new_modulo.rb +0 -15
- data/db/migrate/20140416105956_populate_patologias.rb +0 -14
- data/db/migrate/20140416112617_create_consultas_diabetes.rb +0 -10
- data/db/migrate/20140416113123_migrate_from_consultas_to_consultas_diabetes.rb +0 -15
- data/db/migrate/20140416113722_remove_columns_from_consultas.rb +0 -9
- data/db/migrate/20140416130543_insert_modulo_geral_to_modulos.rb +0 -15
- data/db/migrate/20140416131458_create_consultas_gerals.rb +0 -9
- data/db/migrate/20140421235340_add_modulo_id_to_agendamentos.rb +0 -5
- data/db/migrate/20140422001033_migrate_consultas_modulos_to_agendamentos.rb +0 -21
- data/db/migrate/20140422003735_add_modulo_id_to_consultas.rb +0 -5
- data/db/migrate/20140422004136_migrate_consultas_modulos_to_consultas.rb +0 -23
- data/db/migrate/20140422194237_rename_tipo_insulina_detemir.rb +0 -15
- data/db/migrate/20140422232713_populate_modulos_usuarios.rb +0 -13
- data/db/migrate/20140426192239_add_consulta_diabetes_id_to_medicacoes.rb +0 -5
- data/db/migrate/20140426193405_migrate_medicacoes_from_consulta_id_to_consulta_diabetes_id.rb +0 -12
- data/db/migrate/20140426215729_remove_consulta_id_from_medicacoes.rb +0 -9
- data/db/migrate/20140427001832_add_column_medicacoes_doses_to_consultas_gerals.rb +0 -9
- data/db/migrate/20140430030336_add_column_ordem_to_modulos.rb +0 -9
- data/db/migrate/20140430030622_define_ordem_modulos.rb +0 -15
- data/db/migrate/20140430133816_add_index_to_unidades_saude.rb +0 -9
- data/db/migrate/20140606171624_populate_modulos.rb +0 -22
- data/db/migrate/20140606174108_populate_patologias_to_modulos.rb +0 -74
- data/db/migrate/20140617210604_create_consultas_disturbioscrescimentos.rb +0 -10
- data/db/migrate/20140617210618_create_consultas_disturbiostireoidianos.rb +0 -10
- data/db/migrate/20140617210627_create_consultas_disturbiospuberais.rb +0 -10
- data/db/migrate/20140617210652_create_consultas_obesidadedislipidemias.rb +0 -10
- data/db/migrate/20140617210701_create_consultas_disturbiosadrenais.rb +0 -10
- data/db/migrate/20140617210707_create_consultas_dds.rb +0 -10
- data/db/migrate/20140617210716_create_consultas_miscelaneas.rb +0 -10
- data/db/migrate/20140618124153_rename_column_outra_forma_to_hipotese_diagnostica.rb +0 -8
- data/db/migrate/20140618124311_update_quadros.rb +0 -11
- data/db/migrate/20140618154110_add_modulo_id_to_quadro.rb +0 -6
- data/db/migrate/20140618154430_insert_data_into_modulo_id_at_quadros.rb +0 -12
- data/db/migrate/20140619125935_add_column_medicacoes_doses_to_consultas.rb +0 -11
- data/db/migrate/20140619132301_add_column_usuario_padrao_to_usuario.rb +0 -5
- data/db/migrate/20140619132434_create_alunos.rb +0 -11
- data/db/migrate/20140619193806_add_aluno_to_consulta.rb +0 -6
- data/db/migrate/20140619194153_add_unique_cpf_index_to_aluno.rb +0 -5
- data/db/migrate/20141219133938_create_tokens.rb +0 -10
- data/db/migrate/20141219133948_add_tokens.rb +0 -12
- data/db/migrate/20150215140918_create_consulta_autosaves.rb +0 -12
- data/db/migrate/20150217214135_alterar_nomes_modulos.rb +0 -17
- data/db/migrate/20150218114047_add_nomes_curtos_aos_modulos.rb +0 -22
- data/db/migrate/20150225022412_calcular_imc.rb +0 -25
- data/db/migrate/20150620210353_create_turnos.rb +0 -10
- data/db/migrate/20150620210451_add_turno_to_agendamentos.rb +0 -5
- data/db/migrate/20150620210759_add_turnos.rb +0 -15
- data/db/migrate/20150704002356_add_cnes_hosped.rb +0 -9
- data/db/migrate/20150704141144_add_cns_profissionais.rb +0 -9
- data/db/migrate/20150704213555_create_estados.rb +0 -10
- data/db/migrate/20150704215000_populate_estados.rb +0 -37
- data/db/migrate/20150704215905_create_cidades.rb +0 -11
- data/db/migrate/20150704215933_add_cidades_iniciais.rb +0 -14
- data/db/migrate/20150704230348_add_cidade_to_unidades_saude.rb +0 -11
- data/db/migrate/20150704230551_associate_cidades_unidades_saude.rb +0 -14
- data/db/migrate/20150704231859_update_dados_nova_caico.rb +0 -11
- data/db/migrate/20150708002211_add_codigo_estados.rb +0 -9
- data/db/migrate/20150708002409_populate_codigos_estados.rb +0 -37
- data/db/migrate/20150708003613_fix_codigos_cidades.rb +0 -11
- data/db/migrate/20150718191808_add_cid_ciap2_to_patologias.rb +0 -11
- data/db/migrate/20150718194818_add_cbo_to_profissionais.rb +0 -5
- data/db/migrate/20150802181337_create_cids.rb +0 -10
- data/db/migrate/20150802181408_populate_cids.rb +0 -14243
- data/db/migrate/20150802194134_create_diagnosticos.rb +0 -10
- data/db/migrate/20150803171312_create_hipoteses.rb +0 -10
- data/db/migrate/20150817002141_add_ativo_to_usuarios.rb +0 -6
- data/db/migrate/20150912172700_add_sono_to_consulta.rb +0 -6
- data/db/migrate/20150921173214_insert_assistente_social_into_perfis.rb +0 -9
- data/db/migrate/20151017141750_add_santa_cruz_to_cidades.rb +0 -13
- data/db/migrate/20151025200559_add_cabecalho_rodape_to_unidades_saude.rb +0 -6
- data/db/migrate/20151112003729_unificar_consultas.rb +0 -129
- data/db/migrate/20151112132030_associar_medicacoes_a_consultas.rb +0 -28
- data/db/migrate/20151121194508_add_sc_to_consultas.rb +0 -5
- data/db/migrate/20151121203337_add_acantose_to_consultas.rb +0 -5
- data/db/migrate/20151129205606_renomear_perfil_agendador.rb +0 -15
- data/db/migrate/20151129213429_add_recurso_painel.rb +0 -12
- data/db/migrate/20151129213440_add_recurso_pacientes.rb +0 -12
- data/db/migrate/20151129213450_add_recurso_consultas.rb +0 -12
- data/db/migrate/20151129214020_add_slug_to_perfis.rb +0 -25
- data/db/migrate/20151129215016_add_recurso_agendamentos.rb +0 -12
- data/db/migrate/20151129215118_conceder_permissoes.rb +0 -40
- data/db/migrate/20151129220444_add_recurso_realizar_consulta.rb +0 -18
- data/db/migrate/20151203003144_add_campos_pacientes.rb +0 -10
- data/db/migrate/20151207141439_unificar_quadros.rb +0 -90
- data/db/migrate/20151213152147_delete_campos_quadros.rb +0 -9
- data/db/migrate/20151230112200_add_campos_quadro_clinico_inicial.rb +0 -93
- data/db/migrate/20151230114801_create_tipo_partos.rb +0 -9
- data/db/migrate/20151230114826_add_tipos_partos.rb +0 -11
- data/db/migrate/20160105232035_rename_aleitamento_quadros.rb +0 -5
- data/db/migrate/20160207174548_create_marcos.rb +0 -12
- data/db/migrate/20160207175802_add_marcos_desenvolvimento.rb +0 -54
- data/db/migrate/20160207184107_create_marcos_atingidos.rb +0 -12
- data/db/migrate/20160215195926_create_vacinas.rb +0 -10
- data/db/migrate/20160215204936_create_doses_vacinas.rb +0 -14
- data/db/migrate/20160215204948_add_vacinas_doses.rb +0 -69
- data/db/migrate/20160221153015_create_doses_administradas.rb +0 -12
- data/db/migrate/20160228195102_abarcar_pediatria_geral.rb +0 -20
- data/db/migrate/20160228212607_delete_modulo_consultas.rb +0 -9
- data/db/migrate/20160228213050_delete_modulo_consultas_autosave.rb +0 -9
- data/db/migrate/20160312210832_add_circunferencia_abdominal.rb +0 -5
- data/db/migrate/20160312220545_create_percentis.rb +0 -14
- data/db/migrate/20160312220619_popular_percentis_ca.rb +0 -184
- data/db/migrate/20160318143102_add_suplementacoes_to_consultas.rb +0 -5
- data/db/migrate/20160318200501_rename_dentes.rb +0 -9
- data/db/migrate/20160325001139_remove_modulo_id_from_agendamentos.rb +0 -9
- data/db/migrate/20160328155220_create_dicas.rb +0 -10
- data/db/migrate/20160328155247_add_dica_circunferencia_abdominal.rb +0 -11
- data/db/migrate/20160410194636_popular_percentis_estatura.rb +0 -3387
- data/db/migrate/20160417162558_rename_receitas_to_impressos.rb +0 -9
- data/db/migrate/20160417171627_rename_modelos_receitas_to_modelos_impressos.rb +0 -9
- data/db/migrate/20160421162612_redefinir_fragmentos.rb +0 -40
- data/db/migrate/20160430154000_add_paciente_to_impressos.rb +0 -9
- data/db/migrate/20160430200534_associar_impressos_to_pacientes.rb +0 -18
- data/db/migrate/20160430200657_remover_coluna_consulta_em_impressos.rb +0 -9
- data/db/migrate/20160501230953_add_profissional_to_impressos.rb +0 -9
- data/db/migrate/20160503143335_alterar_especialidades.rb +0 -42
- data/db/migrate/20160503144422_create_teleconsultorias.rb +0 -12
- data/db/migrate/20160503150737_create_mensagens.rb +0 -11
- data/db/migrate/20160505165932_add_fields_to_tokens.rb +0 -9
- data/db/migrate/20160505170629_gerar_tokens_para_usuarios.rb +0 -13
- data/db/migrate/20160605215842_add_arquivo_to_mensagens.rb +0 -11
- data/db/migrate/20160730182728_add_paciente_consulta_to_teleconsultorias.rb +0 -6
- data/db/migrate/20160813135057_add_campos_vacinacao_desenvolvimento_to_consultas.rb +0 -7
- data/db/migrate/20160813141145_adaptar_novos_campos_consultas.rb +0 -54
- data/db/migrate/20160813142420_remover_campos_obsoletos_consultas.rb +0 -11
- data/db/migrate/20160813160917_renomear_campos_consultas.rb +0 -11
- data/db/migrate/20170524123533_add_foreign_keys_to_agendamentos.rb +0 -15
- data/db/migrate/20170524124120_add_foreign_keys_to_cidades.rb +0 -9
- data/db/migrate/20170524124417_add_foreign_keys_to_consulta_autosaves.rb +0 -11
- data/db/migrate/20170524124536_add_foreign_keys_to_consultas.rb +0 -23
- data/db/migrate/20170524131536_add_foreign_keys_to_diagnosticos.rb +0 -15
- data/db/migrate/20170524131856_add_foreign_keys_to_doses.rb +0 -13
- data/db/migrate/20170524132008_add_foreign_keys_to_doses_administradas.rb +0 -11
- data/db/migrate/20170524132049_add_foreign_keys_to_doses_vacinas.rb +0 -9
- data/db/migrate/20170524132140_add_foreign_keys_to_hipoteses.rb +0 -11
- data/db/migrate/20170524132219_add_foreign_keys_to_impressos.rb +0 -11
- data/db/migrate/20170524132307_add_foreign_keys_to_marcos_atingidos.rb +0 -11
- data/db/migrate/20170524132348_add_foreign_keys_to_medicacoes.rb +0 -13
- data/db/migrate/20170524132845_add_foreign_keys_to_patologias.rb +0 -9
- data/db/migrate/20170524132945_add_foreign_keys_to_perfis_usuarios.rb +0 -11
- data/db/migrate/20170524133040_add_foreign_keys_to_permissoes.rb +0 -15
- data/db/migrate/20170525102348_add_foreign_keys_to_profissionais.rb +0 -11
- data/db/migrate/20170525102825_add_foreign_keys_to_profissionais_unidades_saude.rb +0 -15
- data/db/migrate/20170525103012_add_foreign_keys_to_quadros.rb +0 -13
- data/db/migrate/20170525103102_add_foreign_keys_to_reavaliacoes.rb +0 -15
- data/db/migrate/20170525103414_add_foreign_keys_to_respostas.rb +0 -11
- data/db/migrate/20170525104429_add_foreign_keys_to_tipo_exames.rb +0 -9
- data/db/migrate/20170525104602_add_foreign_keys_to_tokens.rb +0 -9
- data/db/migrate/20170525104642_add_foreign_keys_to_unidades_saude.rb +0 -9
- data/db/migrate/20170529151633_add_not_null_to_agendamentos.rb +0 -13
- data/db/migrate/20170529155113_add_not_null_to_alunos.rb +0 -15
- data/db/migrate/20170529155217_add_not_null_to_cidades.rb +0 -13
- data/db/migrate/20170529155308_add_not_null_to_cids.rb +0 -11
- data/db/migrate/20170529155444_add_not_null_to_concentracoes.rb +0 -11
- data/db/migrate/20170529155542_add_not_null_to_consulta_autosaves.rb +0 -13
- data/db/migrate/20170529155705_add_not_null_to_diagnosticos.rb +0 -9
- data/db/migrate/20170529155912_add_not_null_to_dicas.rb +0 -11
- data/db/migrate/20170529160035_add_not_null_to_doses.rb +0 -27
- data/db/migrate/20170529160338_add_not_null_to_doses_administradas.rb +0 -15
- data/db/migrate/20170529160609_add_not_null_to_doses_vacinas.rb +0 -13
- data/db/migrate/20170529160753_add_not_null_to_especialidades.rb +0 -9
- data/db/migrate/20170529160838_add_not_null_to_estados.rb +0 -11
- data/db/migrate/20170529160929_add_not_null_to_exames.rb +0 -17
- data/db/migrate/20170529161048_add_not_null_to_feedbacks.rb +0 -15
- data/db/migrate/20170529161138_add_not_null_to_formacoes.rb +0 -9
- data/db/migrate/20170529161221_add_not_null_to_hipoteses.rb +0 -11
- data/db/migrate/20170529161308_add_not_null_to_impressos.rb +0 -13
- data/db/migrate/20170529161428_add_not_null_to_marcos.rb +0 -15
- data/db/migrate/20170529161535_add_not_null_to_marcos_atingidos.rb +0 -15
- data/db/migrate/20170529161637_add_not_null_to_medicacoes.rb +0 -17
- data/db/migrate/20170529161823_add_not_null_to_mensagens.rb +0 -23
- data/db/migrate/20170529161946_add_not_null_to_modelos_impressos.rb +0 -11
- data/db/migrate/20170529162037_add_not_null_to_modulos.rb +0 -15
- data/db/migrate/20170529162137_add_not_null_to_modulos_usuarios.rb +0 -11
- data/db/migrate/20170529162228_add_not_null_to_pacientes.rb +0 -11
- data/db/migrate/20170529162429_add_not_null_to_padroes_oms_dias.rb +0 -31
- data/db/migrate/20170529162642_add_not_null_to_padroes_oms_meses.rb +0 -33
- data/db/migrate/20170529162832_add_not_null_to_patologias.rb +0 -11
- data/db/migrate/20170529162918_add_not_null_to_percentis.rb +0 -19
- data/db/migrate/20170529163048_add_not_null_to_perfis.rb +0 -11
- data/db/migrate/20170529163141_add_not_null_to_perfis_usuarios.rb +0 -11
- data/db/migrate/20170529163238_add_not_null_to_permissoes.rb +0 -11
- data/db/migrate/20170529163321_add_not_null_to_profissionais.rb +0 -35
- data/db/migrate/20170529163541_add_not_null_to_profissionais_unidade_saude.rb +0 -11
- data/db/migrate/20170529163707_add_not_null_to_reavaliacoes.rb +0 -15
- data/db/migrate/20170529163847_add_not_null_to_recursos.rb +0 -13
- data/db/migrate/20170529163954_add_not_null_to_respostas.rb +0 -13
- data/db/migrate/20170529164223_add_not_null_to_tipo_diabetes.rb +0 -9
- data/db/migrate/20170529164310_add_not_null_to_tipo_exames.rb +0 -11
- data/db/migrate/20170529164405_add_not_null_to_tipo_insulinas.rb +0 -9
- data/db/migrate/20170529164448_add_not_null_to_tipo_partos.rb +0 -9
- data/db/migrate/20170529164527_add_not_null_to_tipos_profissionais.rb +0 -9
- data/db/migrate/20170529164641_add_not_null_to_tokens.rb +0 -9
- data/db/migrate/20170529164726_add_not_null_to_turnos.rb +0 -11
- data/db/migrate/20170529164807_add_not_null_to_unidades_saude.rb +0 -13
- data/db/migrate/20170529164903_add_not_null_to_usuarios.rb +0 -21
- data/db/migrate/20170529165019_add_not_null_to_vacinas.rb +0 -11
- data/db/migrate/20170606130311_drop_teleconsultorias_table.rb +0 -14
- data/db/migrate/20170606131217_create_teleconsultorias_table.rb +0 -18
- data/db/migrate/20170608112630_insert_new_recurso_teleconsultoria.rb +0 -9
- data/db/migrate/20170608112758_insert_new_permissao_teleconsultoria.rb +0 -19
- data/db/pacientes_hosped.sql +0 -3795
- data/db/padroes_oms_dias.sql +0 -7430
- data/db/padroes_oms_meses.sql +0 -1159
- data/db/schema.rb +0 -834
- data/db/seeds.rb +0 -137
- data/db/seeds/.DS_Store +0 -0
- data/db/seeds/agendamentos.json +0 -37587
- data/db/seeds/agendamentos_import.rb +0 -31
- data/db/seeds/correcao_horario.rb +0 -32
- data/doc/README_FOR_APP +0 -2
- data/doc/dicionario.odt +0 -0
- data/doc/erd.pdf +0 -0
- data/docker-compose.yml +0 -25
- data/features/paciente.feature +0 -17
- data/features/step_definitions/.gitkeep +0 -0
- data/features/step_definitions/generic_steps.rb +0 -16
- data/features/step_definitions/paciente_steps.rb +0 -33
- data/features/support/env.rb +0 -59
- data/features/support/factories.rb +0 -27
- data/features/support/seed.rb +0 -131
- data/lib/api_authentication.rb +0 -20
- data/lib/assets/.gitkeep +0 -0
- data/lib/authentication.rb +0 -50
- data/lib/calendario_agendamentos.rb +0 -34
- data/lib/sql_builder.rb +0 -103
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/agendamentos_correcao.rake +0 -11
- data/lib/tasks/agendamentos_import.rake +0 -11
- data/lib/tasks/cucumber.rake +0 -76
- data/lib/tasks/db.rake +0 -24
- data/lib/tasks/reload.rake +0 -45
- data/lib/templates/erb/scaffold/_form.html.erb +0 -13
- data/public/404.html +0 -27
- data/public/422.html +0 -26
- data/public/500.html +0 -26
- data/public/favicon.ico +0 -0
- data/public/robots.txt +0 -5
- data/script/cucumber +0 -10
- data/script/rails +0 -6
- data/script/rails.prej +0 -2
- data/test/fixtures/.gitkeep +0 -0
- data/test/fixtures/agendamentos.yml +0 -11
- data/test/fixtures/alunos.yml +0 -11
- data/test/fixtures/analises_dieteticas.yml +0 -13
- data/test/fixtures/cidades.yml +0 -11
- data/test/fixtures/cids.yml +0 -9
- data/test/fixtures/concentracoes.yml +0 -9
- data/test/fixtures/consulta_autosaves.yml +0 -11
- data/test/fixtures/consultas.yml +0 -23
- data/test/fixtures/consultas_dds.yml +0 -11
- data/test/fixtures/consultas_diabetes.yml +0 -11
- data/test/fixtures/consultas_disturbiosadrenais.yml +0 -11
- data/test/fixtures/consultas_disturbioscrescimentos.yml +0 -11
- data/test/fixtures/consultas_disturbiospuberais.yml +0 -11
- data/test/fixtures/consultas_disturbiostireoidianos.yml +0 -11
- data/test/fixtures/consultas_gerals.yml +0 -11
- data/test/fixtures/consultas_miscelaneas.yml +0 -11
- data/test/fixtures/consultas_obesidadedislipidemias.yml +0 -11
- data/test/fixtures/diagnosticos.yml +0 -9
- data/test/fixtures/dicas.yml +0 -9
- data/test/fixtures/doses.yml +0 -15
- data/test/fixtures/doses_administradas.yml +0 -13
- data/test/fixtures/doses_vacinas.yml +0 -13
- data/test/fixtures/especialidades.yml +0 -7
- data/test/fixtures/estados.yml +0 -9
- data/test/fixtures/exames.yml +0 -15
- data/test/fixtures/feedbacks.yml +0 -13
- data/test/fixtures/formacoes.yml +0 -7
- data/test/fixtures/hipoteses.yml +0 -9
- data/test/fixtures/impresso.yml +0 -11
- data/test/fixtures/marcos.yml +0 -13
- data/test/fixtures/marcos_atingidos.yml +0 -11
- data/test/fixtures/medicacoes.yml +0 -19
- data/test/fixtures/mensagens.yml +0 -11
- data/test/fixtures/modelos_impressos.yml +0 -9
- data/test/fixtures/modulos.yml +0 -11
- data/test/fixtures/pacientes.yml +0 -37
- data/test/fixtures/pacientes_hosped.yml +0 -11
- data/test/fixtures/padroes_oms_dias.yml +0 -29
- data/test/fixtures/padroes_oms_meses.yml +0 -33
- data/test/fixtures/patologia.yml +0 -11
- data/test/fixtures/percentis.yml +0 -15
- data/test/fixtures/perfis.yml +0 -7
- data/test/fixtures/permissoes.yml +0 -9
- data/test/fixtures/profissionais.yml +0 -29
- data/test/fixtures/quadros.yml +0 -21
- data/test/fixtures/reavaliacoes.yml +0 -15
- data/test/fixtures/recursos.yml +0 -11
- data/test/fixtures/respostas.yml +0 -11
- data/test/fixtures/teleconsultorias.yml +0 -13
- data/test/fixtures/tipo_diabetes.yml +0 -7
- data/test/fixtures/tipo_exames.yml +0 -7
- data/test/fixtures/tipo_insulinas.yml +0 -7
- data/test/fixtures/tipo_partos.yml +0 -7
- data/test/fixtures/tipos_profissionais.yml +0 -7
- data/test/fixtures/tokens.yml +0 -9
- data/test/fixtures/turnos.yml +0 -9
- data/test/fixtures/unidades_saude.yml +0 -7
- data/test/fixtures/usuarios.yml +0 -11
- data/test/fixtures/vacinas.yml +0 -7
- data/test/functional/.gitkeep +0 -0
- data/test/functional/admin/cid_controller_test.rb +0 -9
- data/test/functional/admin/medicos_controller_test.rb +0 -24
- data/test/functional/admin/relatorios_controller_test.rb +0 -9
- data/test/functional/admin/tipo_exames_controller_test.rb +0 -7
- data/test/functional/admin/unidades_saude_controller_test.rb +0 -7
- data/test/functional/admin_controller_test.rb +0 -9
- data/test/functional/administracao_mailer_test.rb +0 -12
- data/test/functional/agendamentos_controller_test.rb +0 -49
- data/test/functional/alunos_controller_test.rb +0 -49
- data/test/functional/analise_dieteticas_controller_test.rb +0 -7
- data/test/functional/api/consultas_controller_test.rb +0 -7
- data/test/functional/api/pacientes_controller_test.rb +0 -7
- data/test/functional/assistencia_social/pacientes_controller_test.rb +0 -9
- data/test/functional/cids_controller_test.rb +0 -7
- data/test/functional/client_side_mailer_test.rb +0 -7
- data/test/functional/consultas_controller_test.rb +0 -49
- data/test/functional/conta_controller_test.rb +0 -7
- data/test/functional/doses_controller_test.rb +0 -49
- data/test/functional/duvidas_clinicas_mailer_test.rb +0 -7
- data/test/functional/especialidades_controller_test.rb +0 -49
- data/test/functional/exames_controller_test.rb +0 -49
- data/test/functional/feedbacks_controller_test.rb +0 -49
- data/test/functional/formacoes_controller_test.rb +0 -49
- data/test/functional/impressos_controller_test.rb +0 -14
- data/test/functional/medicacoes_controller_test.rb +0 -49
- data/test/functional/mensagens_controller_test.rb +0 -49
- data/test/functional/modelos_impressos_controller_test.rb +0 -19
- data/test/functional/pacientes_controller_test.rb +0 -49
- data/test/functional/padroes_oms_controller_test.rb +0 -7
- data/test/functional/paginas_controller_test.rb +0 -9
- data/test/functional/painel_controller_test.rb +0 -9
- data/test/functional/patologias_controller_test.rb +0 -7
- data/test/functional/percentis_controller_test.rb +0 -9
- data/test/functional/profissionais_controller_test.rb +0 -49
- data/test/functional/quadros_controller_test.rb +0 -49
- data/test/functional/reavaliacoes_controller_test.rb +0 -49
- data/test/functional/respostas_controller_test.rb +0 -49
- data/test/functional/sessions_controller_test.rb +0 -9
- data/test/functional/supervisao/pesquisas_controller_test.rb +0 -14
- data/test/functional/supervisao_controller_test.rb +0 -9
- data/test/functional/supervisao_mailer_test.rb +0 -7
- data/test/functional/teleconsultorias_controller_test.rb +0 -49
- data/test/functional/tipo_diabetes_controller_test.rb +0 -49
- data/test/functional/tipos_exames_controller_test.rb +0 -24
- data/test/functional/tipos_profissionais_controller_test.rb +0 -49
- data/test/functional/unidades_saude_controller_test.rb +0 -49
- data/test/integration/.gitkeep +0 -0
- data/test/performance/browsing_test.rb +0 -12
- data/test/test_helper.rb +0 -13
- data/test/unit/.gitkeep +0 -0
- data/test/unit/agendamento_test.rb +0 -7
- data/test/unit/aluno_test.rb +0 -7
- data/test/unit/analise_dietetica_test.rb +0 -7
- data/test/unit/cid_test.rb +0 -7
- data/test/unit/cidade_test.rb +0 -7
- data/test/unit/concentracao_test.rb +0 -7
- data/test/unit/consulta_autosave_test.rb +0 -7
- data/test/unit/consulta_test.rb +0 -7
- data/test/unit/consultas_dds_test.rb +0 -7
- data/test/unit/consultas_diabetes_test.rb +0 -7
- data/test/unit/consultas_disturbiosadrenais_test.rb +0 -7
- data/test/unit/consultas_disturbioscrescimento_test.rb +0 -7
- data/test/unit/consultas_disturbiospuberais_test.rb +0 -7
- data/test/unit/consultas_disturbiostireoidianos_test.rb +0 -7
- data/test/unit/consultas_geral_test.rb +0 -7
- data/test/unit/consultas_miscelanea_test.rb +0 -7
- data/test/unit/consultas_obesidadedislipidemias_test.rb +0 -7
- data/test/unit/diagnostico_test.rb +0 -7
- data/test/unit/dica_test.rb +0 -7
- data/test/unit/dose_administrada_test.rb +0 -7
- data/test/unit/dose_test.rb +0 -7
- data/test/unit/dose_vacina_test.rb +0 -7
- data/test/unit/especialidade_test.rb +0 -7
- data/test/unit/estado_test.rb +0 -7
- data/test/unit/exame_test.rb +0 -7
- data/test/unit/feedback_test.rb +0 -7
- data/test/unit/formacao_test.rb +0 -7
- data/test/unit/helpers/admin/cid_helper_test.rb +0 -4
- data/test/unit/helpers/admin/medicos_helper_test.rb +0 -4
- data/test/unit/helpers/admin/relatorios_helper_test.rb +0 -4
- data/test/unit/helpers/admin/tipo_exames_helper_test.rb +0 -4
- data/test/unit/helpers/admin/unidades_saude_helper_test.rb +0 -4
- data/test/unit/helpers/admin_helper_test.rb +0 -4
- data/test/unit/helpers/agendamentos_helper_test.rb +0 -4
- data/test/unit/helpers/alunos_helper_test.rb +0 -4
- data/test/unit/helpers/analise_dieteticas_helper_test.rb +0 -4
- data/test/unit/helpers/api/consultas_helper_test.rb +0 -4
- data/test/unit/helpers/api/pacientes_helper_test.rb +0 -4
- data/test/unit/helpers/assistencia_social/pacientes_helper_test.rb +0 -4
- data/test/unit/helpers/cids_helper_test.rb +0 -4
- data/test/unit/helpers/consultas_helper_test.rb +0 -4
- data/test/unit/helpers/conta_helper_test.rb +0 -4
- data/test/unit/helpers/doses_helper_test.rb +0 -4
- data/test/unit/helpers/especialidades_helper_test.rb +0 -4
- data/test/unit/helpers/exames_helper_test.rb +0 -4
- data/test/unit/helpers/feedbacks_helper_test.rb +0 -4
- data/test/unit/helpers/formacoes_helper_test.rb +0 -4
- data/test/unit/helpers/impressos_helper_test.rb +0 -4
- data/test/unit/helpers/medicacoes_helper_test.rb +0 -4
- data/test/unit/helpers/mensagens_helper_test.rb +0 -4
- data/test/unit/helpers/modelos_impressos_helper_test.rb +0 -4
- data/test/unit/helpers/pacientes_helper_test.rb +0 -4
- data/test/unit/helpers/padroes_oms_helper_test.rb +0 -4
- data/test/unit/helpers/paginas_helper_test.rb +0 -4
- data/test/unit/helpers/painel_helper_test.rb +0 -4
- data/test/unit/helpers/patologias_helper_test.rb +0 -4
- data/test/unit/helpers/percentis_helper_test.rb +0 -4
- data/test/unit/helpers/profissionais_helper_test.rb +0 -4
- data/test/unit/helpers/quadros_helper_test.rb +0 -4
- data/test/unit/helpers/reavaliacoes_helper_test.rb +0 -4
- data/test/unit/helpers/respostas_helper_test.rb +0 -4
- data/test/unit/helpers/sessions_helper_test.rb +0 -4
- data/test/unit/helpers/supervisao/pesquisas_helper_test.rb +0 -4
- data/test/unit/helpers/supervisao_helper_test.rb +0 -4
- data/test/unit/helpers/teleconsultorias_helper_test.rb +0 -4
- data/test/unit/helpers/tipo_diabetes_helper_test.rb +0 -4
- data/test/unit/helpers/tipos_exames_helper_test.rb +0 -4
- data/test/unit/helpers/tipos_profissionais_helper_test.rb +0 -4
- data/test/unit/helpers/unidades_saude_helper_test.rb +0 -4
- data/test/unit/hipotese_test.rb +0 -7
- data/test/unit/impresso_test.rb +0 -7
- data/test/unit/marco_atingido_test.rb +0 -7
- data/test/unit/marco_test.rb +0 -7
- data/test/unit/medicacao_test.rb +0 -7
- data/test/unit/mensagem_test.rb +0 -7
- data/test/unit/modelo_impresso_test.rb +0 -7
- data/test/unit/modulo_test.rb +0 -7
- data/test/unit/paciente_hosped_test.rb +0 -7
- data/test/unit/paciente_test.rb +0 -7
- data/test/unit/padrao_oms_dias_test.rb +0 -7
- data/test/unit/padrao_oms_meses_test.rb +0 -7
- data/test/unit/patologia_test.rb +0 -7
- data/test/unit/percentil_test.rb +0 -7
- data/test/unit/perfil_test.rb +0 -7
- data/test/unit/permissao_test.rb +0 -7
- data/test/unit/profissional_test.rb +0 -7
- data/test/unit/quadro_test.rb +0 -7
- data/test/unit/reavaliacao_test.rb +0 -7
- data/test/unit/recurso_test.rb +0 -7
- data/test/unit/resposta_test.rb +0 -7
- data/test/unit/teleconsultoria_test.rb +0 -7
- data/test/unit/tipo_diabete_test.rb +0 -7
- data/test/unit/tipo_exame_test.rb +0 -7
- data/test/unit/tipo_insulina_test.rb +0 -7
- data/test/unit/tipo_parto_test.rb +0 -7
- data/test/unit/tipo_profissional_test.rb +0 -7
- data/test/unit/token_test.rb +0 -7
- data/test/unit/turno_test.rb +0 -7
- data/test/unit/unidade_saude_test.rb +0 -7
- data/test/unit/usuario_test.rb +0 -7
- data/test/unit/vacina_test.rb +0 -7
- data/vendor/assets/javascripts/.gitkeep +0 -0
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/plugins/.gitkeep +0 -0
- data/vendor/plugins/omniauth-sabia/Gemfile +0 -4
data/Rakefile
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
|
-
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
-
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
-
|
5
|
-
require File.expand_path('../config/application', __FILE__)
|
6
|
-
|
7
|
-
Telepediatria::Application.load_tasks
|
data/app.docker
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
FROM ruby:2.3
|
2
|
-
MAINTAINER Jalerson Lima <jalerson.lima@lais.huol.ufrn.br>
|
3
|
-
|
4
|
-
ENV DEBIAN_FRONTEND noninteractive
|
5
|
-
|
6
|
-
RUN echo 'America/Recife' > /etc/timezone && dpkg-reconfigure tzdata
|
7
|
-
|
8
|
-
RUN mkdir -p /usr/src/app
|
9
|
-
WORKDIR /usr/src/app
|
10
|
-
|
11
|
-
COPY Gemfile /usr/src/app/
|
12
|
-
COPY Gemfile.lock /usr/src/app/
|
13
|
-
RUN bundle install
|
data/app/assets/images/calc.png
DELETED
Binary file
|
data/app/assets/images/dds.png
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/app/assets/images/geral.png
DELETED
Binary file
|
Binary file
|
Binary file
|
data/app/assets/images/logo.jpg
DELETED
Binary file
|
Binary file
|
Binary file
|
data/app/assets/images/pdf.png
DELETED
Binary file
|
Binary file
|
data/app/assets/images/print.png
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/app/assets/images/ufrn.jpg
DELETED
Binary file
|
Binary file
|
@@ -1,302 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// the compiled file.
|
9
|
-
//
|
10
|
-
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
-
// GO AFTER THE REQUIRES BELOW.
|
12
|
-
|
13
|
-
//= require turbolinks
|
14
|
-
|
15
|
-
function add_fields(link, association, content) {
|
16
|
-
var new_id = new Date().getTime();
|
17
|
-
var regexp = new RegExp("new_" + association, "g")
|
18
|
-
$(link).parent().before(content.replace(regexp, new_id));
|
19
|
-
}
|
20
|
-
|
21
|
-
function remove_fields(link) {
|
22
|
-
$(link).prev("input[type=hidden]").val("1");
|
23
|
-
$(link).closest(".fields").hide();
|
24
|
-
}
|
25
|
-
|
26
|
-
function close_alert() {
|
27
|
-
$("div.alert").hide('blind');
|
28
|
-
}
|
29
|
-
|
30
|
-
function redirect(url) {
|
31
|
-
location.href = url;
|
32
|
-
}
|
33
|
-
|
34
|
-
function validar_cpf(cpf) {
|
35
|
-
cpf = cpf.replace(/[^\d]+/g,'');
|
36
|
-
if(cpf == '') return false;
|
37
|
-
// Elimina CPFs invalidos conhecidos
|
38
|
-
if (cpf.length != 11 ||
|
39
|
-
cpf == "00000000000" ||
|
40
|
-
cpf == "11111111111" ||
|
41
|
-
cpf == "22222222222" ||
|
42
|
-
cpf == "33333333333" ||
|
43
|
-
cpf == "44444444444" ||
|
44
|
-
cpf == "55555555555" ||
|
45
|
-
cpf == "66666666666" ||
|
46
|
-
cpf == "77777777777" ||
|
47
|
-
cpf == "88888888888" ||
|
48
|
-
cpf == "99999999999")
|
49
|
-
return false;
|
50
|
-
// Valida 1o digito
|
51
|
-
add = 0;
|
52
|
-
for (i=0; i < 9; i ++)
|
53
|
-
add += parseInt(cpf.charAt(i)) * (10 - i);
|
54
|
-
rev = 11 - (add % 11);
|
55
|
-
if (rev == 10 || rev == 11)
|
56
|
-
rev = 0;
|
57
|
-
if (rev != parseInt(cpf.charAt(9)))
|
58
|
-
return false;
|
59
|
-
// Valida 2o digito
|
60
|
-
add = 0;
|
61
|
-
for (i = 0; i < 10; i ++)
|
62
|
-
add += parseInt(cpf.charAt(i)) * (11 - i);
|
63
|
-
rev = 11 - (add % 11);
|
64
|
-
if (rev == 10 || rev == 11)
|
65
|
-
rev = 0;
|
66
|
-
if (rev != parseInt(cpf.charAt(10)))
|
67
|
-
return false;
|
68
|
-
return true;
|
69
|
-
}
|
70
|
-
|
71
|
-
function validar_email(email){
|
72
|
-
var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
|
73
|
-
var check=/@[\w\-]+\./;
|
74
|
-
var checkend=/\.[a-zA-Z]{2,3}$/;
|
75
|
-
if(((email.search(exclude) != -1)||(email.search(check)) == -1)||(email.search(checkend) == -1)){return false;}
|
76
|
-
else {return true;}
|
77
|
-
}
|
78
|
-
|
79
|
-
function validar_data(valor) {
|
80
|
-
var date=valor;
|
81
|
-
var ardt=new Array;
|
82
|
-
var ExpReg=new RegExp("(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[012])/[12][0-9]{3}");
|
83
|
-
ardt=date.split("/");
|
84
|
-
erro=false;
|
85
|
-
if ( date.search(ExpReg)==-1){
|
86
|
-
erro = true;
|
87
|
-
}
|
88
|
-
else if (((ardt[1]==4)||(ardt[1]==6)||(ardt[1]==9)||(ardt[1]==11))&&(ardt[0]>30))
|
89
|
-
erro = true;
|
90
|
-
else if ( ardt[1]==2) {
|
91
|
-
if ((ardt[0]>28)&&((ardt[2]%4)!=0))
|
92
|
-
erro = true;
|
93
|
-
if ((ardt[0]>29)&&((ardt[2]%4)==0))
|
94
|
-
erro = true;
|
95
|
-
}
|
96
|
-
if (erro) {
|
97
|
-
return false;
|
98
|
-
}
|
99
|
-
return true;
|
100
|
-
}
|
101
|
-
|
102
|
-
function validar_inteiro(valor, permitir_negativo) {
|
103
|
-
valor = parseInt(valor);
|
104
|
-
if(isNaN(valor)) {
|
105
|
-
return false;
|
106
|
-
} else {
|
107
|
-
if(!permitir_negativo && valor < 0) {
|
108
|
-
return false;
|
109
|
-
}
|
110
|
-
return true;
|
111
|
-
}
|
112
|
-
}
|
113
|
-
|
114
|
-
function toFloat(valor) {
|
115
|
-
return parseFloat(valor.replace(",", "."));
|
116
|
-
}
|
117
|
-
|
118
|
-
function toReal(valor, casas) {
|
119
|
-
return valor.toFixed(casas).toString().replace(".", ",");
|
120
|
-
}
|
121
|
-
|
122
|
-
function contains(valor, fragmento) {
|
123
|
-
if(valor.indexOf(fragmento) != -1) {
|
124
|
-
return true;
|
125
|
-
}
|
126
|
-
return false;
|
127
|
-
}
|
128
|
-
|
129
|
-
function onkeypress_validar_real(e, valor) {
|
130
|
-
var unicode = e.charCode? e.charCode : e.keyCode; // Pega o unicode do caractere digitado
|
131
|
-
if(contains(valor, ",") || contains(valor, ".")) { // Verifica se o valor do campo já contém ponto ou vígula
|
132
|
-
if(unicode == 44 || unicode == 46) { // Se o usuário estiver tentando digitar outro ponto ou outra vírgula, não permite
|
133
|
-
return false;
|
134
|
-
}
|
135
|
-
}
|
136
|
-
if (unicode != 8 && unicode != 44 && unicode != 46) { // verifica se é backspace, vírgula ou ponto
|
137
|
-
if (unicode < 48 || unicode > 57) { // se não for um número
|
138
|
-
return false;
|
139
|
-
}
|
140
|
-
}
|
141
|
-
return true;
|
142
|
-
}
|
143
|
-
|
144
|
-
function onkeypress_validar_inteiro(e, valor) {
|
145
|
-
var unicode = e.charCode? e.charCode : e.keyCode;
|
146
|
-
if(unicode != 8) {
|
147
|
-
if(unicode < 48 || unicode > 57) {
|
148
|
-
return false;
|
149
|
-
}
|
150
|
-
}
|
151
|
-
return true;
|
152
|
-
}
|
153
|
-
|
154
|
-
function toggle_checkbox(checkbox, field_id) {
|
155
|
-
if ($("#"+checkbox.id).is(':checked')) {
|
156
|
-
$('#'+field_id).removeAttr('disabled');
|
157
|
-
} else {
|
158
|
-
$('#'+field_id).attr('disabled', 'disabled');
|
159
|
-
}
|
160
|
-
}
|
161
|
-
|
162
|
-
function get_id_of_checked_radio(name) {
|
163
|
-
if( $("input[name='"+name+"']:radio:checked").length > 0 ) {
|
164
|
-
return $("input[name='"+name+"']:radio:checked").attr('id');
|
165
|
-
}
|
166
|
-
else {
|
167
|
-
return undefined;
|
168
|
-
}
|
169
|
-
}
|
170
|
-
|
171
|
-
function get_value_of_checked_radio(name) {
|
172
|
-
if( $("input[name='"+name+"']:radio:checked").length > 0 ) {
|
173
|
-
return $("input[name='"+name+"']:radio:checked").val();
|
174
|
-
}
|
175
|
-
else {
|
176
|
-
return undefined;
|
177
|
-
}
|
178
|
-
}
|
179
|
-
|
180
|
-
function ajax(type, url, return_type, params) {
|
181
|
-
return $.ajax({
|
182
|
-
type: type,
|
183
|
-
url: url,
|
184
|
-
dataType: return_type,
|
185
|
-
async: false,
|
186
|
-
data: params
|
187
|
-
}).responseText;
|
188
|
-
}
|
189
|
-
|
190
|
-
function ajaxCSRF(type, url, return_type, params) {
|
191
|
-
return $.ajax({
|
192
|
-
type: type,
|
193
|
-
url: url,
|
194
|
-
dataType: return_type,
|
195
|
-
async: false,
|
196
|
-
beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))},
|
197
|
-
data: params
|
198
|
-
}).responseText;
|
199
|
-
}
|
200
|
-
|
201
|
-
function capitalize(str) {
|
202
|
-
return str.toLowerCase().replace(/\b[a-z]/g, function(letter) {
|
203
|
-
return letter.toUpperCase();
|
204
|
-
});
|
205
|
-
}
|
206
|
-
|
207
|
-
function select_option(select_id, value) {
|
208
|
-
$("#"+select_id+" > option[value='"+value+"']").attr("selected", "selected")
|
209
|
-
}
|
210
|
-
|
211
|
-
function show_unidade_saude_dialog() {
|
212
|
-
$(".help-inline").hide();
|
213
|
-
$('#unidade_saude_dialog').modal('show');
|
214
|
-
}
|
215
|
-
|
216
|
-
function set_unidade_saude() {
|
217
|
-
if($("#unidade_saude_id").val() == "") {
|
218
|
-
$("#unidade_saude_required").parents("div.form-group").addClass("has-error");
|
219
|
-
$("#unidade_saude_required").show();
|
220
|
-
return;
|
221
|
-
}
|
222
|
-
|
223
|
-
params = { unidade_saude_id: $("#unidade_saude_id").val() };
|
224
|
-
$.ajax({
|
225
|
-
url: '/set_unidade_saude',
|
226
|
-
type: 'POST',
|
227
|
-
beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))},
|
228
|
-
data: params,
|
229
|
-
success: $('#unidade_saude_dialog').modal('hide')
|
230
|
-
}).done(function(data) {
|
231
|
-
if($('#unidade-saude-nome').length > 0) {
|
232
|
-
$('#unidade-saude-nome').html(data);
|
233
|
-
}
|
234
|
-
});
|
235
|
-
}
|
236
|
-
|
237
|
-
function to_date(data) {
|
238
|
-
if(validar_data(data)) {
|
239
|
-
split = data.split('/');
|
240
|
-
return new Date(split[2], (split[1]-1), split[0]);
|
241
|
-
}
|
242
|
-
return null;
|
243
|
-
}
|
244
|
-
|
245
|
-
function calcular_meses_vividos(data) {
|
246
|
-
return ((new Date).getFullYear() * 12 + ((new Date).getMonth()+1)) - (data.getFullYear() * 12 + (data.getMonth()+1))
|
247
|
-
}
|
248
|
-
|
249
|
-
function draw_chart(medida, tipo, paciente_id, valor) {
|
250
|
-
var unidades = { estatura: "cm", peso: "Kg", imc: "Kg/m2", circunferencia_abdominal: "cm" };
|
251
|
-
var gridlines = { estatura: 20, imc: 20, peso: 11, circunferencia_abdominal: 10 };
|
252
|
-
var maxvalues = { estatura: 228, imc: 228, peso: 120, circunferencia_abdominal: 192 };
|
253
|
-
var minvalues = { estatura: 0, imc: 0, peso: 0, circunferencia_abdominal: 60 };
|
254
|
-
var humanized = { estatura: 'Estatura', imc: 'IMC', peso: 'Peso', circunferencia_abdominal: 'Circunferência Abdominal' };
|
255
|
-
var tempo = { estatura: 'anos', imc: 'anos', peso: 'anos', circunferencia_abdominal: 'meses' };
|
256
|
-
var colors = {
|
257
|
-
zscore: ['black', 'red', 'green', 'red', 'black', 'blue'],
|
258
|
-
percentil: ['red', 'red', 'green', 'green', 'green', 'green', 'red']
|
259
|
-
};
|
260
|
-
var series = {
|
261
|
-
zscore: { 5: {type: "line", pointSize: 8, visibleInLegend: true } },
|
262
|
-
percentil: { 7: {type: "line", pointSize: 8, visibleInLegend: true, color: 'blue' } }
|
263
|
-
};
|
264
|
-
var url = {
|
265
|
-
zscore: "/padroes_oms/get_chart_data",
|
266
|
-
percentil: "/percentis/get_chart_data"
|
267
|
-
}
|
268
|
-
|
269
|
-
var options = {
|
270
|
-
title: humanized[medida]+" x Idade",
|
271
|
-
curveType: 'function',
|
272
|
-
explorer: {},
|
273
|
-
width: 850,
|
274
|
-
height: 550,
|
275
|
-
interpolateNulls: true,
|
276
|
-
hAxis: {
|
277
|
-
title: "Idade ("+tempo[medida]+")",
|
278
|
-
gridlines: { count: gridlines[medida] },
|
279
|
-
viewWindow: { min: minvalues[medida] }
|
280
|
-
},
|
281
|
-
vAxis: {
|
282
|
-
title: humanized[medida]+" ("+unidades[medida]+")",
|
283
|
-
gridlines: { count: 10 }
|
284
|
-
},
|
285
|
-
colors: colors[tipo],
|
286
|
-
seriesType: "line",
|
287
|
-
series: series[tipo]
|
288
|
-
};
|
289
|
-
|
290
|
-
$("#chart_header").html("Gráfico de "+humanized[medida]+" x Idade");
|
291
|
-
|
292
|
-
if(valor == null) {
|
293
|
-
params = { tipo: medida, paciente_id: paciente_id };
|
294
|
-
} else {
|
295
|
-
params = { tipo: medida, paciente_id: paciente_id, valor: valor };
|
296
|
-
}
|
297
|
-
|
298
|
-
jsonData = ajax("GET", url[tipo], "json", params);
|
299
|
-
var data_table = new google.visualization.DataTable(jsonData);
|
300
|
-
chart = new google.visualization.ComboChart(document.getElementById('chart'));
|
301
|
-
chart.draw(data_table, options);
|
302
|
-
}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Bootstrap.js by @fat & @mdo
|
3
|
-
* Copyright 2012 Twitter, Inc.
|
4
|
-
* http://www.apache.org/licenses/LICENSE-2.0.txt
|
5
|
-
*/
|
6
|
-
!function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||s.toggleClass("open"),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f<s.length-1&&f++,~f||(f=0),s.eq(f).focus()}};var s=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=s,this},e(document).on("click.dropdown.data-api",r).on("click.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api",t,n.prototype.toggle).on("keydown.dropdown.data-api",t+", [role=menu]",n.prototype.keydown)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e.fn[this.type].defaults,r={},i;this._options&&e.each(this._options,function(e,t){n[e]!=t&&(r[e]=t)},this),i=e(t.currentTarget)[this.type](r).data(this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(n=e.isFunction(this.source)?this.source(this.query,e.proxy(this.process,this)):this.source,n?this.process(n):this)},process:function(t){var n=this;return t=e.grep(t,function(e){return n.matcher(e)}),t=this.sorter(t),t.length?this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(e){return~e.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){var t=[],n=[],r=[],i;while(i=e.shift())i.toLowerCase().indexOf(this.query.toLowerCase())?~i.indexOf(this.query)?n.push(i):r.push(i):t.push(i);return t.concat(n,r)},highlighter:function(e){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),function(e,t){return"<strong>"+t+"</strong>"})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery);
|
@@ -1,1671 +0,0 @@
|
|
1
|
-
/* =========================================================
|
2
|
-
* bootstrap-datepicker.js
|
3
|
-
* Repo: https://github.com/eternicode/bootstrap-datepicker/
|
4
|
-
* Demo: http://eternicode.github.io/bootstrap-datepicker/
|
5
|
-
* Docs: http://bootstrap-datepicker.readthedocs.org/
|
6
|
-
* Forked from http://www.eyecon.ro/bootstrap-datepicker
|
7
|
-
* =========================================================
|
8
|
-
* Started by Stefan Petre; improvements by Andrew Rowls + contributors
|
9
|
-
*
|
10
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
-
* you may not use this file except in compliance with the License.
|
12
|
-
* You may obtain a copy of the License at
|
13
|
-
*
|
14
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
15
|
-
*
|
16
|
-
* Unless required by applicable law or agreed to in writing, software
|
17
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
-
* See the License for the specific language governing permissions and
|
20
|
-
* limitations under the License.
|
21
|
-
* ========================================================= */
|
22
|
-
|
23
|
-
(function($, undefined){
|
24
|
-
|
25
|
-
var $window = $(window);
|
26
|
-
|
27
|
-
function UTCDate(){
|
28
|
-
return new Date(Date.UTC.apply(Date, arguments));
|
29
|
-
}
|
30
|
-
function UTCToday(){
|
31
|
-
var today = new Date();
|
32
|
-
return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());
|
33
|
-
}
|
34
|
-
function alias(method){
|
35
|
-
return function(){
|
36
|
-
return this[method].apply(this, arguments);
|
37
|
-
};
|
38
|
-
}
|
39
|
-
|
40
|
-
var DateArray = (function(){
|
41
|
-
var extras = {
|
42
|
-
get: function(i){
|
43
|
-
return this.slice(i)[0];
|
44
|
-
},
|
45
|
-
contains: function(d){
|
46
|
-
// Array.indexOf is not cross-browser;
|
47
|
-
// $.inArray doesn't work with Dates
|
48
|
-
var val = d && d.valueOf();
|
49
|
-
for (var i=0, l=this.length; i < l; i++)
|
50
|
-
if (this[i].valueOf() === val)
|
51
|
-
return i;
|
52
|
-
return -1;
|
53
|
-
},
|
54
|
-
remove: function(i){
|
55
|
-
this.splice(i,1);
|
56
|
-
},
|
57
|
-
replace: function(new_array){
|
58
|
-
if (!new_array)
|
59
|
-
return;
|
60
|
-
if (!$.isArray(new_array))
|
61
|
-
new_array = [new_array];
|
62
|
-
this.clear();
|
63
|
-
this.push.apply(this, new_array);
|
64
|
-
},
|
65
|
-
clear: function(){
|
66
|
-
this.splice(0);
|
67
|
-
},
|
68
|
-
copy: function(){
|
69
|
-
var a = new DateArray();
|
70
|
-
a.replace(this);
|
71
|
-
return a;
|
72
|
-
}
|
73
|
-
};
|
74
|
-
|
75
|
-
return function(){
|
76
|
-
var a = [];
|
77
|
-
a.push.apply(a, arguments);
|
78
|
-
$.extend(a, extras);
|
79
|
-
return a;
|
80
|
-
};
|
81
|
-
})();
|
82
|
-
|
83
|
-
|
84
|
-
// Picker object
|
85
|
-
|
86
|
-
var Datepicker = function(element, options){
|
87
|
-
this.dates = new DateArray();
|
88
|
-
this.viewDate = UTCToday();
|
89
|
-
this.focusDate = null;
|
90
|
-
|
91
|
-
this._process_options(options);
|
92
|
-
|
93
|
-
this.element = $(element);
|
94
|
-
this.isInline = false;
|
95
|
-
this.isInput = this.element.is('input');
|
96
|
-
this.component = this.element.is('.date') ? this.element.find('.add-on, .input-group-addon, .btn') : false;
|
97
|
-
this.hasInput = this.component && this.element.find('input').length;
|
98
|
-
if (this.component && this.component.length === 0)
|
99
|
-
this.component = false;
|
100
|
-
|
101
|
-
this.picker = $(DPGlobal.template);
|
102
|
-
this._buildEvents();
|
103
|
-
this._attachEvents();
|
104
|
-
|
105
|
-
if (this.isInline){
|
106
|
-
this.picker.addClass('datepicker-inline').appendTo(this.element);
|
107
|
-
}
|
108
|
-
else {
|
109
|
-
this.picker.addClass('datepicker-dropdown dropdown-menu');
|
110
|
-
}
|
111
|
-
|
112
|
-
if (this.o.rtl){
|
113
|
-
this.picker.addClass('datepicker-rtl');
|
114
|
-
}
|
115
|
-
|
116
|
-
this.viewMode = this.o.startView;
|
117
|
-
|
118
|
-
if (this.o.calendarWeeks)
|
119
|
-
this.picker.find('tfoot th.today')
|
120
|
-
.attr('colspan', function(i, val){
|
121
|
-
return parseInt(val) + 1;
|
122
|
-
});
|
123
|
-
|
124
|
-
this._allow_update = false;
|
125
|
-
|
126
|
-
this.setStartDate(this._o.startDate);
|
127
|
-
this.setEndDate(this._o.endDate);
|
128
|
-
this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);
|
129
|
-
|
130
|
-
this.fillDow();
|
131
|
-
this.fillMonths();
|
132
|
-
|
133
|
-
this._allow_update = true;
|
134
|
-
|
135
|
-
this.update();
|
136
|
-
this.showMode();
|
137
|
-
|
138
|
-
if (this.isInline){
|
139
|
-
this.show();
|
140
|
-
}
|
141
|
-
};
|
142
|
-
|
143
|
-
Datepicker.prototype = {
|
144
|
-
constructor: Datepicker,
|
145
|
-
|
146
|
-
_process_options: function(opts){
|
147
|
-
// Store raw options for reference
|
148
|
-
this._o = $.extend({}, this._o, opts);
|
149
|
-
// Processed options
|
150
|
-
var o = this.o = $.extend({}, this._o);
|
151
|
-
|
152
|
-
// Check if "de-DE" style date is available, if not language should
|
153
|
-
// fallback to 2 letter code eg "de"
|
154
|
-
var lang = o.language;
|
155
|
-
if (!dates[lang]){
|
156
|
-
lang = lang.split('-')[0];
|
157
|
-
if (!dates[lang])
|
158
|
-
lang = defaults.language;
|
159
|
-
}
|
160
|
-
o.language = lang;
|
161
|
-
|
162
|
-
switch (o.startView){
|
163
|
-
case 2:
|
164
|
-
case 'decade':
|
165
|
-
o.startView = 2;
|
166
|
-
break;
|
167
|
-
case 1:
|
168
|
-
case 'year':
|
169
|
-
o.startView = 1;
|
170
|
-
break;
|
171
|
-
default:
|
172
|
-
o.startView = 0;
|
173
|
-
}
|
174
|
-
|
175
|
-
switch (o.minViewMode){
|
176
|
-
case 1:
|
177
|
-
case 'months':
|
178
|
-
o.minViewMode = 1;
|
179
|
-
break;
|
180
|
-
case 2:
|
181
|
-
case 'years':
|
182
|
-
o.minViewMode = 2;
|
183
|
-
break;
|
184
|
-
default:
|
185
|
-
o.minViewMode = 0;
|
186
|
-
}
|
187
|
-
|
188
|
-
o.startView = Math.max(o.startView, o.minViewMode);
|
189
|
-
|
190
|
-
// true, false, or Number > 0
|
191
|
-
if (o.multidate !== true){
|
192
|
-
o.multidate = Number(o.multidate) || false;
|
193
|
-
if (o.multidate !== false)
|
194
|
-
o.multidate = Math.max(0, o.multidate);
|
195
|
-
else
|
196
|
-
o.multidate = 1;
|
197
|
-
}
|
198
|
-
o.multidateSeparator = String(o.multidateSeparator);
|
199
|
-
|
200
|
-
o.weekStart %= 7;
|
201
|
-
o.weekEnd = ((o.weekStart + 6) % 7);
|
202
|
-
|
203
|
-
var format = DPGlobal.parseFormat(o.format);
|
204
|
-
if (o.startDate !== -Infinity){
|
205
|
-
if (!!o.startDate){
|
206
|
-
if (o.startDate instanceof Date)
|
207
|
-
o.startDate = this._local_to_utc(this._zero_time(o.startDate));
|
208
|
-
else
|
209
|
-
o.startDate = DPGlobal.parseDate(o.startDate, format, o.language);
|
210
|
-
}
|
211
|
-
else {
|
212
|
-
o.startDate = -Infinity;
|
213
|
-
}
|
214
|
-
}
|
215
|
-
if (o.endDate !== Infinity){
|
216
|
-
if (!!o.endDate){
|
217
|
-
if (o.endDate instanceof Date)
|
218
|
-
o.endDate = this._local_to_utc(this._zero_time(o.endDate));
|
219
|
-
else
|
220
|
-
o.endDate = DPGlobal.parseDate(o.endDate, format, o.language);
|
221
|
-
}
|
222
|
-
else {
|
223
|
-
o.endDate = Infinity;
|
224
|
-
}
|
225
|
-
}
|
226
|
-
|
227
|
-
o.daysOfWeekDisabled = o.daysOfWeekDisabled||[];
|
228
|
-
if (!$.isArray(o.daysOfWeekDisabled))
|
229
|
-
o.daysOfWeekDisabled = o.daysOfWeekDisabled.split(/[,\s]*/);
|
230
|
-
o.daysOfWeekDisabled = $.map(o.daysOfWeekDisabled, function(d){
|
231
|
-
return parseInt(d, 10);
|
232
|
-
});
|
233
|
-
|
234
|
-
var plc = String(o.orientation).toLowerCase().split(/\s+/g),
|
235
|
-
_plc = o.orientation.toLowerCase();
|
236
|
-
plc = $.grep(plc, function(word){
|
237
|
-
return (/^auto|left|right|top|bottom$/).test(word);
|
238
|
-
});
|
239
|
-
o.orientation = {x: 'auto', y: 'auto'};
|
240
|
-
if (!_plc || _plc === 'auto')
|
241
|
-
; // no action
|
242
|
-
else if (plc.length === 1){
|
243
|
-
switch (plc[0]){
|
244
|
-
case 'top':
|
245
|
-
case 'bottom':
|
246
|
-
o.orientation.y = plc[0];
|
247
|
-
break;
|
248
|
-
case 'left':
|
249
|
-
case 'right':
|
250
|
-
o.orientation.x = plc[0];
|
251
|
-
break;
|
252
|
-
}
|
253
|
-
}
|
254
|
-
else {
|
255
|
-
_plc = $.grep(plc, function(word){
|
256
|
-
return (/^left|right$/).test(word);
|
257
|
-
});
|
258
|
-
o.orientation.x = _plc[0] || 'auto';
|
259
|
-
|
260
|
-
_plc = $.grep(plc, function(word){
|
261
|
-
return (/^top|bottom$/).test(word);
|
262
|
-
});
|
263
|
-
o.orientation.y = _plc[0] || 'auto';
|
264
|
-
}
|
265
|
-
},
|
266
|
-
_events: [],
|
267
|
-
_secondaryEvents: [],
|
268
|
-
_applyEvents: function(evs){
|
269
|
-
for (var i=0, el, ch, ev; i < evs.length; i++){
|
270
|
-
el = evs[i][0];
|
271
|
-
if (evs[i].length === 2){
|
272
|
-
ch = undefined;
|
273
|
-
ev = evs[i][1];
|
274
|
-
}
|
275
|
-
else if (evs[i].length === 3){
|
276
|
-
ch = evs[i][1];
|
277
|
-
ev = evs[i][2];
|
278
|
-
}
|
279
|
-
el.on(ev, ch);
|
280
|
-
}
|
281
|
-
},
|
282
|
-
_unapplyEvents: function(evs){
|
283
|
-
for (var i=0, el, ev, ch; i < evs.length; i++){
|
284
|
-
el = evs[i][0];
|
285
|
-
if (evs[i].length === 2){
|
286
|
-
ch = undefined;
|
287
|
-
ev = evs[i][1];
|
288
|
-
}
|
289
|
-
else if (evs[i].length === 3){
|
290
|
-
ch = evs[i][1];
|
291
|
-
ev = evs[i][2];
|
292
|
-
}
|
293
|
-
el.off(ev, ch);
|
294
|
-
}
|
295
|
-
},
|
296
|
-
_buildEvents: function(){
|
297
|
-
if (this.isInput){ // single input
|
298
|
-
this._events = [
|
299
|
-
[this.element, {
|
300
|
-
focus: $.proxy(this.show, this),
|
301
|
-
keyup: $.proxy(function(e){
|
302
|
-
if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)
|
303
|
-
this.update();
|
304
|
-
}, this),
|
305
|
-
keydown: $.proxy(this.keydown, this)
|
306
|
-
}]
|
307
|
-
];
|
308
|
-
}
|
309
|
-
else if (this.component && this.hasInput){ // component: input + button
|
310
|
-
this._events = [
|
311
|
-
// For components that are not readonly, allow keyboard nav
|
312
|
-
[this.element.find('input'), {
|
313
|
-
focus: $.proxy(this.show, this),
|
314
|
-
keyup: $.proxy(function(e){
|
315
|
-
if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)
|
316
|
-
this.update();
|
317
|
-
}, this),
|
318
|
-
keydown: $.proxy(this.keydown, this)
|
319
|
-
}],
|
320
|
-
[this.component, {
|
321
|
-
click: $.proxy(this.show, this)
|
322
|
-
}]
|
323
|
-
];
|
324
|
-
}
|
325
|
-
else if (this.element.is('div')){ // inline datepicker
|
326
|
-
this.isInline = true;
|
327
|
-
}
|
328
|
-
else {
|
329
|
-
this._events = [
|
330
|
-
[this.element, {
|
331
|
-
click: $.proxy(this.show, this)
|
332
|
-
}]
|
333
|
-
];
|
334
|
-
}
|
335
|
-
this._events.push(
|
336
|
-
// Component: listen for blur on element descendants
|
337
|
-
[this.element, '*', {
|
338
|
-
blur: $.proxy(function(e){
|
339
|
-
this._focused_from = e.target;
|
340
|
-
}, this)
|
341
|
-
}],
|
342
|
-
// Input: listen for blur on element
|
343
|
-
[this.element, {
|
344
|
-
blur: $.proxy(function(e){
|
345
|
-
this._focused_from = e.target;
|
346
|
-
}, this)
|
347
|
-
}]
|
348
|
-
);
|
349
|
-
|
350
|
-
this._secondaryEvents = [
|
351
|
-
[this.picker, {
|
352
|
-
click: $.proxy(this.click, this)
|
353
|
-
}],
|
354
|
-
[$(window), {
|
355
|
-
resize: $.proxy(this.place, this)
|
356
|
-
}],
|
357
|
-
[$(document), {
|
358
|
-
'mousedown touchstart': $.proxy(function(e){
|
359
|
-
// Clicked outside the datepicker, hide it
|
360
|
-
if (!(
|
361
|
-
this.element.is(e.target) ||
|
362
|
-
this.element.find(e.target).length ||
|
363
|
-
this.picker.is(e.target) ||
|
364
|
-
this.picker.find(e.target).length
|
365
|
-
)){
|
366
|
-
this.hide();
|
367
|
-
}
|
368
|
-
}, this)
|
369
|
-
}]
|
370
|
-
];
|
371
|
-
},
|
372
|
-
_attachEvents: function(){
|
373
|
-
this._detachEvents();
|
374
|
-
this._applyEvents(this._events);
|
375
|
-
},
|
376
|
-
_detachEvents: function(){
|
377
|
-
this._unapplyEvents(this._events);
|
378
|
-
},
|
379
|
-
_attachSecondaryEvents: function(){
|
380
|
-
this._detachSecondaryEvents();
|
381
|
-
this._applyEvents(this._secondaryEvents);
|
382
|
-
},
|
383
|
-
_detachSecondaryEvents: function(){
|
384
|
-
this._unapplyEvents(this._secondaryEvents);
|
385
|
-
},
|
386
|
-
_trigger: function(event, altdate){
|
387
|
-
var date = altdate || this.dates.get(-1),
|
388
|
-
local_date = this._utc_to_local(date);
|
389
|
-
|
390
|
-
this.element.trigger({
|
391
|
-
type: event,
|
392
|
-
date: local_date,
|
393
|
-
dates: $.map(this.dates, this._utc_to_local),
|
394
|
-
format: $.proxy(function(ix, format){
|
395
|
-
if (arguments.length === 0){
|
396
|
-
ix = this.dates.length - 1;
|
397
|
-
format = this.o.format;
|
398
|
-
}
|
399
|
-
else if (typeof ix === 'string'){
|
400
|
-
format = ix;
|
401
|
-
ix = this.dates.length - 1;
|
402
|
-
}
|
403
|
-
format = format || this.o.format;
|
404
|
-
var date = this.dates.get(ix);
|
405
|
-
return DPGlobal.formatDate(date, format, this.o.language);
|
406
|
-
}, this)
|
407
|
-
});
|
408
|
-
},
|
409
|
-
|
410
|
-
show: function(){
|
411
|
-
if (!this.isInline)
|
412
|
-
this.picker.appendTo('body');
|
413
|
-
this.picker.show();
|
414
|
-
this.place();
|
415
|
-
this._attachSecondaryEvents();
|
416
|
-
this._trigger('show');
|
417
|
-
},
|
418
|
-
|
419
|
-
hide: function(){
|
420
|
-
if (this.isInline)
|
421
|
-
return;
|
422
|
-
if (!this.picker.is(':visible'))
|
423
|
-
return;
|
424
|
-
this.focusDate = null;
|
425
|
-
this.picker.hide().detach();
|
426
|
-
this._detachSecondaryEvents();
|
427
|
-
this.viewMode = this.o.startView;
|
428
|
-
this.showMode();
|
429
|
-
|
430
|
-
if (
|
431
|
-
this.o.forceParse &&
|
432
|
-
(
|
433
|
-
this.isInput && this.element.val() ||
|
434
|
-
this.hasInput && this.element.find('input').val()
|
435
|
-
)
|
436
|
-
)
|
437
|
-
this.setValue();
|
438
|
-
this._trigger('hide');
|
439
|
-
},
|
440
|
-
|
441
|
-
remove: function(){
|
442
|
-
this.hide();
|
443
|
-
this._detachEvents();
|
444
|
-
this._detachSecondaryEvents();
|
445
|
-
this.picker.remove();
|
446
|
-
delete this.element.data().datepicker;
|
447
|
-
if (!this.isInput){
|
448
|
-
delete this.element.data().date;
|
449
|
-
}
|
450
|
-
},
|
451
|
-
|
452
|
-
_utc_to_local: function(utc){
|
453
|
-
return utc && new Date(utc.getTime() + (utc.getTimezoneOffset()*60000));
|
454
|
-
},
|
455
|
-
_local_to_utc: function(local){
|
456
|
-
return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));
|
457
|
-
},
|
458
|
-
_zero_time: function(local){
|
459
|
-
return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());
|
460
|
-
},
|
461
|
-
_zero_utc_time: function(utc){
|
462
|
-
return utc && new Date(Date.UTC(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate()));
|
463
|
-
},
|
464
|
-
|
465
|
-
getDates: function(){
|
466
|
-
return $.map(this.dates, this._utc_to_local);
|
467
|
-
},
|
468
|
-
|
469
|
-
getUTCDates: function(){
|
470
|
-
return $.map(this.dates, function(d){
|
471
|
-
return new Date(d);
|
472
|
-
});
|
473
|
-
},
|
474
|
-
|
475
|
-
getDate: function(){
|
476
|
-
return this._utc_to_local(this.getUTCDate());
|
477
|
-
},
|
478
|
-
|
479
|
-
getUTCDate: function(){
|
480
|
-
return new Date(this.dates.get(-1));
|
481
|
-
},
|
482
|
-
|
483
|
-
setDates: function(){
|
484
|
-
var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
|
485
|
-
this.update.apply(this, args);
|
486
|
-
this._trigger('changeDate');
|
487
|
-
this.setValue();
|
488
|
-
},
|
489
|
-
|
490
|
-
setUTCDates: function(){
|
491
|
-
var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
|
492
|
-
this.update.apply(this, $.map(args, this._utc_to_local));
|
493
|
-
this._trigger('changeDate');
|
494
|
-
this.setValue();
|
495
|
-
},
|
496
|
-
|
497
|
-
setDate: alias('setDates'),
|
498
|
-
setUTCDate: alias('setUTCDates'),
|
499
|
-
|
500
|
-
setValue: function(){
|
501
|
-
var formatted = this.getFormattedDate();
|
502
|
-
if (!this.isInput){
|
503
|
-
if (this.component){
|
504
|
-
this.element.find('input').val(formatted).change();
|
505
|
-
}
|
506
|
-
}
|
507
|
-
else {
|
508
|
-
this.element.val(formatted).change();
|
509
|
-
}
|
510
|
-
},
|
511
|
-
|
512
|
-
getFormattedDate: function(format){
|
513
|
-
if (format === undefined)
|
514
|
-
format = this.o.format;
|
515
|
-
|
516
|
-
var lang = this.o.language;
|
517
|
-
return $.map(this.dates, function(d){
|
518
|
-
return DPGlobal.formatDate(d, format, lang);
|
519
|
-
}).join(this.o.multidateSeparator);
|
520
|
-
},
|
521
|
-
|
522
|
-
setStartDate: function(startDate){
|
523
|
-
this._process_options({startDate: startDate});
|
524
|
-
this.update();
|
525
|
-
this.updateNavArrows();
|
526
|
-
},
|
527
|
-
|
528
|
-
setEndDate: function(endDate){
|
529
|
-
this._process_options({endDate: endDate});
|
530
|
-
this.update();
|
531
|
-
this.updateNavArrows();
|
532
|
-
},
|
533
|
-
|
534
|
-
setDaysOfWeekDisabled: function(daysOfWeekDisabled){
|
535
|
-
this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});
|
536
|
-
this.update();
|
537
|
-
this.updateNavArrows();
|
538
|
-
},
|
539
|
-
|
540
|
-
place: function(){
|
541
|
-
if (this.isInline)
|
542
|
-
return;
|
543
|
-
var calendarWidth = this.picker.outerWidth(),
|
544
|
-
calendarHeight = this.picker.outerHeight(),
|
545
|
-
visualPadding = 10,
|
546
|
-
windowWidth = $window.width(),
|
547
|
-
windowHeight = $window.height(),
|
548
|
-
scrollTop = $window.scrollTop();
|
549
|
-
|
550
|
-
var zIndex = parseInt(this.element.parents().filter(function(){
|
551
|
-
return $(this).css('z-index') !== 'auto';
|
552
|
-
}).first().css('z-index'))+10;
|
553
|
-
var offset = this.component ? this.component.parent().offset() : this.element.offset();
|
554
|
-
var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);
|
555
|
-
var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);
|
556
|
-
var left = offset.left,
|
557
|
-
top = offset.top;
|
558
|
-
|
559
|
-
this.picker.removeClass(
|
560
|
-
'datepicker-orient-top datepicker-orient-bottom '+
|
561
|
-
'datepicker-orient-right datepicker-orient-left'
|
562
|
-
);
|
563
|
-
|
564
|
-
if (this.o.orientation.x !== 'auto'){
|
565
|
-
this.picker.addClass('datepicker-orient-' + this.o.orientation.x);
|
566
|
-
if (this.o.orientation.x === 'right')
|
567
|
-
left -= calendarWidth - width;
|
568
|
-
}
|
569
|
-
// auto x orientation is best-placement: if it crosses a window
|
570
|
-
// edge, fudge it sideways
|
571
|
-
else {
|
572
|
-
// Default to left
|
573
|
-
this.picker.addClass('datepicker-orient-left');
|
574
|
-
if (offset.left < 0)
|
575
|
-
left -= offset.left - visualPadding;
|
576
|
-
else if (offset.left + calendarWidth > windowWidth)
|
577
|
-
left = windowWidth - calendarWidth - visualPadding;
|
578
|
-
}
|
579
|
-
|
580
|
-
// auto y orientation is best-situation: top or bottom, no fudging,
|
581
|
-
// decision based on which shows more of the calendar
|
582
|
-
var yorient = this.o.orientation.y,
|
583
|
-
top_overflow, bottom_overflow;
|
584
|
-
if (yorient === 'auto'){
|
585
|
-
top_overflow = -scrollTop + offset.top - calendarHeight;
|
586
|
-
bottom_overflow = scrollTop + windowHeight - (offset.top + height + calendarHeight);
|
587
|
-
if (Math.max(top_overflow, bottom_overflow) === bottom_overflow)
|
588
|
-
yorient = 'top';
|
589
|
-
else
|
590
|
-
yorient = 'bottom';
|
591
|
-
}
|
592
|
-
this.picker.addClass('datepicker-orient-' + yorient);
|
593
|
-
if (yorient === 'top')
|
594
|
-
top += height;
|
595
|
-
else
|
596
|
-
top -= calendarHeight + parseInt(this.picker.css('padding-top'));
|
597
|
-
|
598
|
-
this.picker.css({
|
599
|
-
top: top,
|
600
|
-
left: left,
|
601
|
-
zIndex: zIndex
|
602
|
-
});
|
603
|
-
},
|
604
|
-
|
605
|
-
_allow_update: true,
|
606
|
-
update: function(){
|
607
|
-
if (!this._allow_update)
|
608
|
-
return;
|
609
|
-
|
610
|
-
var oldDates = this.dates.copy(),
|
611
|
-
dates = [],
|
612
|
-
fromArgs = false;
|
613
|
-
if (arguments.length){
|
614
|
-
$.each(arguments, $.proxy(function(i, date){
|
615
|
-
if (date instanceof Date)
|
616
|
-
date = this._local_to_utc(date);
|
617
|
-
dates.push(date);
|
618
|
-
}, this));
|
619
|
-
fromArgs = true;
|
620
|
-
}
|
621
|
-
else {
|
622
|
-
dates = this.isInput
|
623
|
-
? this.element.val()
|
624
|
-
: this.element.data('date') || this.element.find('input').val();
|
625
|
-
if (dates && this.o.multidate)
|
626
|
-
dates = dates.split(this.o.multidateSeparator);
|
627
|
-
else
|
628
|
-
dates = [dates];
|
629
|
-
delete this.element.data().date;
|
630
|
-
}
|
631
|
-
|
632
|
-
dates = $.map(dates, $.proxy(function(date){
|
633
|
-
return DPGlobal.parseDate(date, this.o.format, this.o.language);
|
634
|
-
}, this));
|
635
|
-
dates = $.grep(dates, $.proxy(function(date){
|
636
|
-
return (
|
637
|
-
date < this.o.startDate ||
|
638
|
-
date > this.o.endDate ||
|
639
|
-
!date
|
640
|
-
);
|
641
|
-
}, this), true);
|
642
|
-
this.dates.replace(dates);
|
643
|
-
|
644
|
-
if (this.dates.length)
|
645
|
-
this.viewDate = new Date(this.dates.get(-1));
|
646
|
-
else if (this.viewDate < this.o.startDate)
|
647
|
-
this.viewDate = new Date(this.o.startDate);
|
648
|
-
else if (this.viewDate > this.o.endDate)
|
649
|
-
this.viewDate = new Date(this.o.endDate);
|
650
|
-
|
651
|
-
if (fromArgs){
|
652
|
-
// setting date by clicking
|
653
|
-
this.setValue();
|
654
|
-
}
|
655
|
-
else if (dates.length){
|
656
|
-
// setting date by typing
|
657
|
-
if (String(oldDates) !== String(this.dates))
|
658
|
-
this._trigger('changeDate');
|
659
|
-
}
|
660
|
-
if (!this.dates.length && oldDates.length)
|
661
|
-
this._trigger('clearDate');
|
662
|
-
|
663
|
-
this.fill();
|
664
|
-
},
|
665
|
-
|
666
|
-
fillDow: function(){
|
667
|
-
var dowCnt = this.o.weekStart,
|
668
|
-
html = '<tr>';
|
669
|
-
if (this.o.calendarWeeks){
|
670
|
-
var cell = '<th class="cw"> </th>';
|
671
|
-
html += cell;
|
672
|
-
this.picker.find('.datepicker-days thead tr:first-child').prepend(cell);
|
673
|
-
}
|
674
|
-
while (dowCnt < this.o.weekStart + 7){
|
675
|
-
html += '<th class="dow">'+dates[this.o.language].daysMin[(dowCnt++)%7]+'</th>';
|
676
|
-
}
|
677
|
-
html += '</tr>';
|
678
|
-
this.picker.find('.datepicker-days thead').append(html);
|
679
|
-
},
|
680
|
-
|
681
|
-
fillMonths: function(){
|
682
|
-
var html = '',
|
683
|
-
i = 0;
|
684
|
-
while (i < 12){
|
685
|
-
html += '<span class="month">'+dates[this.o.language].monthsShort[i++]+'</span>';
|
686
|
-
}
|
687
|
-
this.picker.find('.datepicker-months td').html(html);
|
688
|
-
},
|
689
|
-
|
690
|
-
setRange: function(range){
|
691
|
-
if (!range || !range.length)
|
692
|
-
delete this.range;
|
693
|
-
else
|
694
|
-
this.range = $.map(range, function(d){
|
695
|
-
return d.valueOf();
|
696
|
-
});
|
697
|
-
this.fill();
|
698
|
-
},
|
699
|
-
|
700
|
-
getClassNames: function(date){
|
701
|
-
var cls = [],
|
702
|
-
year = this.viewDate.getUTCFullYear(),
|
703
|
-
month = this.viewDate.getUTCMonth(),
|
704
|
-
today = new Date();
|
705
|
-
if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){
|
706
|
-
cls.push('old');
|
707
|
-
}
|
708
|
-
else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){
|
709
|
-
cls.push('new');
|
710
|
-
}
|
711
|
-
if (this.focusDate && date.valueOf() === this.focusDate.valueOf())
|
712
|
-
cls.push('focused');
|
713
|
-
// Compare internal UTC date with local today, not UTC today
|
714
|
-
if (this.o.todayHighlight &&
|
715
|
-
date.getUTCFullYear() === today.getFullYear() &&
|
716
|
-
date.getUTCMonth() === today.getMonth() &&
|
717
|
-
date.getUTCDate() === today.getDate()){
|
718
|
-
cls.push('today');
|
719
|
-
}
|
720
|
-
if (this.dates.contains(date) !== -1)
|
721
|
-
cls.push('active');
|
722
|
-
if (date.valueOf() < this.o.startDate || date.valueOf() > this.o.endDate ||
|
723
|
-
$.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1){
|
724
|
-
cls.push('disabled');
|
725
|
-
}
|
726
|
-
if (this.range){
|
727
|
-
if (date > this.range[0] && date < this.range[this.range.length-1]){
|
728
|
-
cls.push('range');
|
729
|
-
}
|
730
|
-
if ($.inArray(date.valueOf(), this.range) !== -1){
|
731
|
-
cls.push('selected');
|
732
|
-
}
|
733
|
-
}
|
734
|
-
return cls;
|
735
|
-
},
|
736
|
-
|
737
|
-
fill: function(){
|
738
|
-
var d = new Date(this.viewDate),
|
739
|
-
year = d.getUTCFullYear(),
|
740
|
-
month = d.getUTCMonth(),
|
741
|
-
startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
|
742
|
-
startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
|
743
|
-
endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
|
744
|
-
endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
|
745
|
-
todaytxt = dates[this.o.language].today || dates['en'].today || '',
|
746
|
-
cleartxt = dates[this.o.language].clear || dates['en'].clear || '',
|
747
|
-
tooltip;
|
748
|
-
this.picker.find('.datepicker-days thead th.datepicker-switch')
|
749
|
-
.text(dates[this.o.language].months[month]+' '+year);
|
750
|
-
this.picker.find('tfoot th.today')
|
751
|
-
.text(todaytxt)
|
752
|
-
.toggle(this.o.todayBtn !== false);
|
753
|
-
this.picker.find('tfoot th.clear')
|
754
|
-
.text(cleartxt)
|
755
|
-
.toggle(this.o.clearBtn !== false);
|
756
|
-
this.updateNavArrows();
|
757
|
-
this.fillMonths();
|
758
|
-
var prevMonth = UTCDate(year, month-1, 28),
|
759
|
-
day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth());
|
760
|
-
prevMonth.setUTCDate(day);
|
761
|
-
prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);
|
762
|
-
var nextMonth = new Date(prevMonth);
|
763
|
-
nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
|
764
|
-
nextMonth = nextMonth.valueOf();
|
765
|
-
var html = [];
|
766
|
-
var clsName;
|
767
|
-
while (prevMonth.valueOf() < nextMonth){
|
768
|
-
if (prevMonth.getUTCDay() === this.o.weekStart){
|
769
|
-
html.push('<tr>');
|
770
|
-
if (this.o.calendarWeeks){
|
771
|
-
// ISO 8601: First week contains first thursday.
|
772
|
-
// ISO also states week starts on Monday, but we can be more abstract here.
|
773
|
-
var
|
774
|
-
// Start of current week: based on weekstart/current date
|
775
|
-
ws = new Date(+prevMonth + (this.o.weekStart - prevMonth.getUTCDay() - 7) % 7 * 864e5),
|
776
|
-
// Thursday of this week
|
777
|
-
th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),
|
778
|
-
// First Thursday of year, year from thursday
|
779
|
-
yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay())%7*864e5),
|
780
|
-
// Calendar week: ms between thursdays, div ms per day, div 7 days
|
781
|
-
calWeek = (th - yth) / 864e5 / 7 + 1;
|
782
|
-
html.push('<td class="cw">'+ calWeek +'</td>');
|
783
|
-
|
784
|
-
}
|
785
|
-
}
|
786
|
-
clsName = this.getClassNames(prevMonth);
|
787
|
-
clsName.push('day');
|
788
|
-
|
789
|
-
if (this.o.beforeShowDay !== $.noop){
|
790
|
-
var before = this.o.beforeShowDay(this._utc_to_local(prevMonth));
|
791
|
-
if (before === undefined)
|
792
|
-
before = {};
|
793
|
-
else if (typeof(before) === 'boolean')
|
794
|
-
before = {enabled: before};
|
795
|
-
else if (typeof(before) === 'string')
|
796
|
-
before = {classes: before};
|
797
|
-
if (before.enabled === false)
|
798
|
-
clsName.push('disabled');
|
799
|
-
if (before.classes)
|
800
|
-
clsName = clsName.concat(before.classes.split(/\s+/));
|
801
|
-
if (before.tooltip)
|
802
|
-
tooltip = before.tooltip;
|
803
|
-
}
|
804
|
-
|
805
|
-
clsName = $.unique(clsName);
|
806
|
-
html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>');
|
807
|
-
if (prevMonth.getUTCDay() === this.o.weekEnd){
|
808
|
-
html.push('</tr>');
|
809
|
-
}
|
810
|
-
prevMonth.setUTCDate(prevMonth.getUTCDate()+1);
|
811
|
-
}
|
812
|
-
this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
|
813
|
-
|
814
|
-
var months = this.picker.find('.datepicker-months')
|
815
|
-
.find('th:eq(1)')
|
816
|
-
.text(year)
|
817
|
-
.end()
|
818
|
-
.find('span').removeClass('active');
|
819
|
-
|
820
|
-
$.each(this.dates, function(i, d){
|
821
|
-
if (d.getUTCFullYear() === year)
|
822
|
-
months.eq(d.getUTCMonth()).addClass('active');
|
823
|
-
});
|
824
|
-
|
825
|
-
if (year < startYear || year > endYear){
|
826
|
-
months.addClass('disabled');
|
827
|
-
}
|
828
|
-
if (year === startYear){
|
829
|
-
months.slice(0, startMonth).addClass('disabled');
|
830
|
-
}
|
831
|
-
if (year === endYear){
|
832
|
-
months.slice(endMonth+1).addClass('disabled');
|
833
|
-
}
|
834
|
-
|
835
|
-
html = '';
|
836
|
-
year = parseInt(year/10, 10) * 10;
|
837
|
-
var yearCont = this.picker.find('.datepicker-years')
|
838
|
-
.find('th:eq(1)')
|
839
|
-
.text(year + '-' + (year + 9))
|
840
|
-
.end()
|
841
|
-
.find('td');
|
842
|
-
year -= 1;
|
843
|
-
var years = $.map(this.dates, function(d){
|
844
|
-
return d.getUTCFullYear();
|
845
|
-
}),
|
846
|
-
classes;
|
847
|
-
for (var i = -1; i < 11; i++){
|
848
|
-
classes = ['year'];
|
849
|
-
if (i === -1)
|
850
|
-
classes.push('old');
|
851
|
-
else if (i === 10)
|
852
|
-
classes.push('new');
|
853
|
-
if ($.inArray(year, years) !== -1)
|
854
|
-
classes.push('active');
|
855
|
-
if (year < startYear || year > endYear)
|
856
|
-
classes.push('disabled');
|
857
|
-
html += '<span class="' + classes.join(' ') + '">'+year+'</span>';
|
858
|
-
year += 1;
|
859
|
-
}
|
860
|
-
yearCont.html(html);
|
861
|
-
},
|
862
|
-
|
863
|
-
updateNavArrows: function(){
|
864
|
-
if (!this._allow_update)
|
865
|
-
return;
|
866
|
-
|
867
|
-
var d = new Date(this.viewDate),
|
868
|
-
year = d.getUTCFullYear(),
|
869
|
-
month = d.getUTCMonth();
|
870
|
-
switch (this.viewMode){
|
871
|
-
case 0:
|
872
|
-
if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() && month <= this.o.startDate.getUTCMonth()){
|
873
|
-
this.picker.find('.prev').css({visibility: 'hidden'});
|
874
|
-
}
|
875
|
-
else {
|
876
|
-
this.picker.find('.prev').css({visibility: 'visible'});
|
877
|
-
}
|
878
|
-
if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() && month >= this.o.endDate.getUTCMonth()){
|
879
|
-
this.picker.find('.next').css({visibility: 'hidden'});
|
880
|
-
}
|
881
|
-
else {
|
882
|
-
this.picker.find('.next').css({visibility: 'visible'});
|
883
|
-
}
|
884
|
-
break;
|
885
|
-
case 1:
|
886
|
-
case 2:
|
887
|
-
if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear()){
|
888
|
-
this.picker.find('.prev').css({visibility: 'hidden'});
|
889
|
-
}
|
890
|
-
else {
|
891
|
-
this.picker.find('.prev').css({visibility: 'visible'});
|
892
|
-
}
|
893
|
-
if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear()){
|
894
|
-
this.picker.find('.next').css({visibility: 'hidden'});
|
895
|
-
}
|
896
|
-
else {
|
897
|
-
this.picker.find('.next').css({visibility: 'visible'});
|
898
|
-
}
|
899
|
-
break;
|
900
|
-
}
|
901
|
-
},
|
902
|
-
|
903
|
-
click: function(e){
|
904
|
-
e.preventDefault();
|
905
|
-
var target = $(e.target).closest('span, td, th'),
|
906
|
-
year, month, day;
|
907
|
-
if (target.length === 1){
|
908
|
-
switch (target[0].nodeName.toLowerCase()){
|
909
|
-
case 'th':
|
910
|
-
switch (target[0].className){
|
911
|
-
case 'datepicker-switch':
|
912
|
-
this.showMode(1);
|
913
|
-
break;
|
914
|
-
case 'prev':
|
915
|
-
case 'next':
|
916
|
-
var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1);
|
917
|
-
switch (this.viewMode){
|
918
|
-
case 0:
|
919
|
-
this.viewDate = this.moveMonth(this.viewDate, dir);
|
920
|
-
this._trigger('changeMonth', this.viewDate);
|
921
|
-
break;
|
922
|
-
case 1:
|
923
|
-
case 2:
|
924
|
-
this.viewDate = this.moveYear(this.viewDate, dir);
|
925
|
-
if (this.viewMode === 1)
|
926
|
-
this._trigger('changeYear', this.viewDate);
|
927
|
-
break;
|
928
|
-
}
|
929
|
-
this.fill();
|
930
|
-
break;
|
931
|
-
case 'today':
|
932
|
-
var date = new Date();
|
933
|
-
date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
|
934
|
-
|
935
|
-
this.showMode(-2);
|
936
|
-
var which = this.o.todayBtn === 'linked' ? null : 'view';
|
937
|
-
this._setDate(date, which);
|
938
|
-
break;
|
939
|
-
case 'clear':
|
940
|
-
var element;
|
941
|
-
if (this.isInput)
|
942
|
-
element = this.element;
|
943
|
-
else if (this.component)
|
944
|
-
element = this.element.find('input');
|
945
|
-
if (element)
|
946
|
-
element.val("").change();
|
947
|
-
this.update();
|
948
|
-
this._trigger('changeDate');
|
949
|
-
if (this.o.autoclose)
|
950
|
-
this.hide();
|
951
|
-
break;
|
952
|
-
}
|
953
|
-
break;
|
954
|
-
case 'span':
|
955
|
-
if (!target.is('.disabled')){
|
956
|
-
this.viewDate.setUTCDate(1);
|
957
|
-
if (target.is('.month')){
|
958
|
-
day = 1;
|
959
|
-
month = target.parent().find('span').index(target);
|
960
|
-
year = this.viewDate.getUTCFullYear();
|
961
|
-
this.viewDate.setUTCMonth(month);
|
962
|
-
this._trigger('changeMonth', this.viewDate);
|
963
|
-
if (this.o.minViewMode === 1){
|
964
|
-
this._setDate(UTCDate(year, month, day));
|
965
|
-
}
|
966
|
-
}
|
967
|
-
else {
|
968
|
-
day = 1;
|
969
|
-
month = 0;
|
970
|
-
year = parseInt(target.text(), 10)||0;
|
971
|
-
this.viewDate.setUTCFullYear(year);
|
972
|
-
this._trigger('changeYear', this.viewDate);
|
973
|
-
if (this.o.minViewMode === 2){
|
974
|
-
this._setDate(UTCDate(year, month, day));
|
975
|
-
}
|
976
|
-
}
|
977
|
-
this.showMode(-1);
|
978
|
-
this.fill();
|
979
|
-
}
|
980
|
-
break;
|
981
|
-
case 'td':
|
982
|
-
if (target.is('.day') && !target.is('.disabled')){
|
983
|
-
day = parseInt(target.text(), 10)||1;
|
984
|
-
year = this.viewDate.getUTCFullYear();
|
985
|
-
month = this.viewDate.getUTCMonth();
|
986
|
-
if (target.is('.old')){
|
987
|
-
if (month === 0){
|
988
|
-
month = 11;
|
989
|
-
year -= 1;
|
990
|
-
}
|
991
|
-
else {
|
992
|
-
month -= 1;
|
993
|
-
}
|
994
|
-
}
|
995
|
-
else if (target.is('.new')){
|
996
|
-
if (month === 11){
|
997
|
-
month = 0;
|
998
|
-
year += 1;
|
999
|
-
}
|
1000
|
-
else {
|
1001
|
-
month += 1;
|
1002
|
-
}
|
1003
|
-
}
|
1004
|
-
this._setDate(UTCDate(year, month, day));
|
1005
|
-
}
|
1006
|
-
break;
|
1007
|
-
}
|
1008
|
-
}
|
1009
|
-
if (this.picker.is(':visible') && this._focused_from){
|
1010
|
-
$(this._focused_from).focus();
|
1011
|
-
}
|
1012
|
-
delete this._focused_from;
|
1013
|
-
},
|
1014
|
-
|
1015
|
-
_toggle_multidate: function(date){
|
1016
|
-
var ix = this.dates.contains(date);
|
1017
|
-
if (!date){
|
1018
|
-
this.dates.clear();
|
1019
|
-
}
|
1020
|
-
else if (ix !== -1){
|
1021
|
-
this.dates.remove(ix);
|
1022
|
-
}
|
1023
|
-
else {
|
1024
|
-
this.dates.push(date);
|
1025
|
-
}
|
1026
|
-
if (typeof this.o.multidate === 'number')
|
1027
|
-
while (this.dates.length > this.o.multidate)
|
1028
|
-
this.dates.remove(0);
|
1029
|
-
},
|
1030
|
-
|
1031
|
-
_setDate: function(date, which){
|
1032
|
-
if (!which || which === 'date')
|
1033
|
-
this._toggle_multidate(date && new Date(date));
|
1034
|
-
if (!which || which === 'view')
|
1035
|
-
this.viewDate = date && new Date(date);
|
1036
|
-
|
1037
|
-
this.fill();
|
1038
|
-
this.setValue();
|
1039
|
-
this._trigger('changeDate');
|
1040
|
-
var element;
|
1041
|
-
if (this.isInput){
|
1042
|
-
element = this.element;
|
1043
|
-
}
|
1044
|
-
else if (this.component){
|
1045
|
-
element = this.element.find('input');
|
1046
|
-
}
|
1047
|
-
if (element){
|
1048
|
-
element.change();
|
1049
|
-
}
|
1050
|
-
if (this.o.autoclose && (!which || which === 'date')){
|
1051
|
-
this.hide();
|
1052
|
-
}
|
1053
|
-
},
|
1054
|
-
|
1055
|
-
moveMonth: function(date, dir){
|
1056
|
-
if (!date)
|
1057
|
-
return undefined;
|
1058
|
-
if (!dir)
|
1059
|
-
return date;
|
1060
|
-
var new_date = new Date(date.valueOf()),
|
1061
|
-
day = new_date.getUTCDate(),
|
1062
|
-
month = new_date.getUTCMonth(),
|
1063
|
-
mag = Math.abs(dir),
|
1064
|
-
new_month, test;
|
1065
|
-
dir = dir > 0 ? 1 : -1;
|
1066
|
-
if (mag === 1){
|
1067
|
-
test = dir === -1
|
1068
|
-
// If going back one month, make sure month is not current month
|
1069
|
-
// (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
|
1070
|
-
? function(){
|
1071
|
-
return new_date.getUTCMonth() === month;
|
1072
|
-
}
|
1073
|
-
// If going forward one month, make sure month is as expected
|
1074
|
-
// (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
|
1075
|
-
: function(){
|
1076
|
-
return new_date.getUTCMonth() !== new_month;
|
1077
|
-
};
|
1078
|
-
new_month = month + dir;
|
1079
|
-
new_date.setUTCMonth(new_month);
|
1080
|
-
// Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
|
1081
|
-
if (new_month < 0 || new_month > 11)
|
1082
|
-
new_month = (new_month + 12) % 12;
|
1083
|
-
}
|
1084
|
-
else {
|
1085
|
-
// For magnitudes >1, move one month at a time...
|
1086
|
-
for (var i=0; i < mag; i++)
|
1087
|
-
// ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
|
1088
|
-
new_date = this.moveMonth(new_date, dir);
|
1089
|
-
// ...then reset the day, keeping it in the new month
|
1090
|
-
new_month = new_date.getUTCMonth();
|
1091
|
-
new_date.setUTCDate(day);
|
1092
|
-
test = function(){
|
1093
|
-
return new_month !== new_date.getUTCMonth();
|
1094
|
-
};
|
1095
|
-
}
|
1096
|
-
// Common date-resetting loop -- if date is beyond end of month, make it
|
1097
|
-
// end of month
|
1098
|
-
while (test()){
|
1099
|
-
new_date.setUTCDate(--day);
|
1100
|
-
new_date.setUTCMonth(new_month);
|
1101
|
-
}
|
1102
|
-
return new_date;
|
1103
|
-
},
|
1104
|
-
|
1105
|
-
moveYear: function(date, dir){
|
1106
|
-
return this.moveMonth(date, dir*12);
|
1107
|
-
},
|
1108
|
-
|
1109
|
-
dateWithinRange: function(date){
|
1110
|
-
return date >= this.o.startDate && date <= this.o.endDate;
|
1111
|
-
},
|
1112
|
-
|
1113
|
-
keydown: function(e){
|
1114
|
-
if (this.picker.is(':not(:visible)')){
|
1115
|
-
if (e.keyCode === 27) // allow escape to hide and re-show picker
|
1116
|
-
this.show();
|
1117
|
-
return;
|
1118
|
-
}
|
1119
|
-
var dateChanged = false,
|
1120
|
-
dir, newDate, newViewDate,
|
1121
|
-
focusDate = this.focusDate || this.viewDate;
|
1122
|
-
switch (e.keyCode){
|
1123
|
-
case 27: // escape
|
1124
|
-
if (this.focusDate){
|
1125
|
-
this.focusDate = null;
|
1126
|
-
this.viewDate = this.dates.get(-1) || this.viewDate;
|
1127
|
-
this.fill();
|
1128
|
-
}
|
1129
|
-
else
|
1130
|
-
this.hide();
|
1131
|
-
e.preventDefault();
|
1132
|
-
break;
|
1133
|
-
case 37: // left
|
1134
|
-
case 39: // right
|
1135
|
-
if (!this.o.keyboardNavigation)
|
1136
|
-
break;
|
1137
|
-
dir = e.keyCode === 37 ? -1 : 1;
|
1138
|
-
if (e.ctrlKey){
|
1139
|
-
newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
|
1140
|
-
newViewDate = this.moveYear(focusDate, dir);
|
1141
|
-
this._trigger('changeYear', this.viewDate);
|
1142
|
-
}
|
1143
|
-
else if (e.shiftKey){
|
1144
|
-
newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
|
1145
|
-
newViewDate = this.moveMonth(focusDate, dir);
|
1146
|
-
this._trigger('changeMonth', this.viewDate);
|
1147
|
-
}
|
1148
|
-
else {
|
1149
|
-
newDate = new Date(this.dates.get(-1) || UTCToday());
|
1150
|
-
newDate.setUTCDate(newDate.getUTCDate() + dir);
|
1151
|
-
newViewDate = new Date(focusDate);
|
1152
|
-
newViewDate.setUTCDate(focusDate.getUTCDate() + dir);
|
1153
|
-
}
|
1154
|
-
if (this.dateWithinRange(newDate)){
|
1155
|
-
this.focusDate = this.viewDate = newViewDate;
|
1156
|
-
this.setValue();
|
1157
|
-
this.fill();
|
1158
|
-
e.preventDefault();
|
1159
|
-
}
|
1160
|
-
break;
|
1161
|
-
case 38: // up
|
1162
|
-
case 40: // down
|
1163
|
-
if (!this.o.keyboardNavigation)
|
1164
|
-
break;
|
1165
|
-
dir = e.keyCode === 38 ? -1 : 1;
|
1166
|
-
if (e.ctrlKey){
|
1167
|
-
newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
|
1168
|
-
newViewDate = this.moveYear(focusDate, dir);
|
1169
|
-
this._trigger('changeYear', this.viewDate);
|
1170
|
-
}
|
1171
|
-
else if (e.shiftKey){
|
1172
|
-
newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
|
1173
|
-
newViewDate = this.moveMonth(focusDate, dir);
|
1174
|
-
this._trigger('changeMonth', this.viewDate);
|
1175
|
-
}
|
1176
|
-
else {
|
1177
|
-
newDate = new Date(this.dates.get(-1) || UTCToday());
|
1178
|
-
newDate.setUTCDate(newDate.getUTCDate() + dir * 7);
|
1179
|
-
newViewDate = new Date(focusDate);
|
1180
|
-
newViewDate.setUTCDate(focusDate.getUTCDate() + dir * 7);
|
1181
|
-
}
|
1182
|
-
if (this.dateWithinRange(newDate)){
|
1183
|
-
this.focusDate = this.viewDate = newViewDate;
|
1184
|
-
this.setValue();
|
1185
|
-
this.fill();
|
1186
|
-
e.preventDefault();
|
1187
|
-
}
|
1188
|
-
break;
|
1189
|
-
case 32: // spacebar
|
1190
|
-
// Spacebar is used in manually typing dates in some formats.
|
1191
|
-
// As such, its behavior should not be hijacked.
|
1192
|
-
break;
|
1193
|
-
case 13: // enter
|
1194
|
-
focusDate = this.focusDate || this.dates.get(-1) || this.viewDate;
|
1195
|
-
this._toggle_multidate(focusDate);
|
1196
|
-
dateChanged = true;
|
1197
|
-
this.focusDate = null;
|
1198
|
-
this.viewDate = this.dates.get(-1) || this.viewDate;
|
1199
|
-
this.setValue();
|
1200
|
-
this.fill();
|
1201
|
-
if (this.picker.is(':visible')){
|
1202
|
-
e.preventDefault();
|
1203
|
-
if (this.o.autoclose)
|
1204
|
-
this.hide();
|
1205
|
-
}
|
1206
|
-
break;
|
1207
|
-
case 9: // tab
|
1208
|
-
this.focusDate = null;
|
1209
|
-
this.viewDate = this.dates.get(-1) || this.viewDate;
|
1210
|
-
this.fill();
|
1211
|
-
this.hide();
|
1212
|
-
break;
|
1213
|
-
}
|
1214
|
-
if (dateChanged){
|
1215
|
-
if (this.dates.length)
|
1216
|
-
this._trigger('changeDate');
|
1217
|
-
else
|
1218
|
-
this._trigger('clearDate');
|
1219
|
-
var element;
|
1220
|
-
if (this.isInput){
|
1221
|
-
element = this.element;
|
1222
|
-
}
|
1223
|
-
else if (this.component){
|
1224
|
-
element = this.element.find('input');
|
1225
|
-
}
|
1226
|
-
if (element){
|
1227
|
-
element.change();
|
1228
|
-
}
|
1229
|
-
}
|
1230
|
-
},
|
1231
|
-
|
1232
|
-
showMode: function(dir){
|
1233
|
-
if (dir){
|
1234
|
-
this.viewMode = Math.max(this.o.minViewMode, Math.min(2, this.viewMode + dir));
|
1235
|
-
}
|
1236
|
-
this.picker
|
1237
|
-
.find('>div')
|
1238
|
-
.hide()
|
1239
|
-
.filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName)
|
1240
|
-
.css('display', 'block');
|
1241
|
-
this.updateNavArrows();
|
1242
|
-
}
|
1243
|
-
};
|
1244
|
-
|
1245
|
-
var DateRangePicker = function(element, options){
|
1246
|
-
this.element = $(element);
|
1247
|
-
this.inputs = $.map(options.inputs, function(i){
|
1248
|
-
return i.jquery ? i[0] : i;
|
1249
|
-
});
|
1250
|
-
delete options.inputs;
|
1251
|
-
|
1252
|
-
$(this.inputs)
|
1253
|
-
.datepicker(options)
|
1254
|
-
.bind('changeDate', $.proxy(this.dateUpdated, this));
|
1255
|
-
|
1256
|
-
this.pickers = $.map(this.inputs, function(i){
|
1257
|
-
return $(i).data('datepicker');
|
1258
|
-
});
|
1259
|
-
this.updateDates();
|
1260
|
-
};
|
1261
|
-
DateRangePicker.prototype = {
|
1262
|
-
updateDates: function(){
|
1263
|
-
this.dates = $.map(this.pickers, function(i){
|
1264
|
-
return i.getUTCDate();
|
1265
|
-
});
|
1266
|
-
this.updateRanges();
|
1267
|
-
},
|
1268
|
-
updateRanges: function(){
|
1269
|
-
var range = $.map(this.dates, function(d){
|
1270
|
-
return d.valueOf();
|
1271
|
-
});
|
1272
|
-
$.each(this.pickers, function(i, p){
|
1273
|
-
p.setRange(range);
|
1274
|
-
});
|
1275
|
-
},
|
1276
|
-
dateUpdated: function(e){
|
1277
|
-
// `this.updating` is a workaround for preventing infinite recursion
|
1278
|
-
// between `changeDate` triggering and `setUTCDate` calling. Until
|
1279
|
-
// there is a better mechanism.
|
1280
|
-
if (this.updating)
|
1281
|
-
return;
|
1282
|
-
this.updating = true;
|
1283
|
-
|
1284
|
-
var dp = $(e.target).data('datepicker'),
|
1285
|
-
new_date = dp.getUTCDate(),
|
1286
|
-
i = $.inArray(e.target, this.inputs),
|
1287
|
-
l = this.inputs.length;
|
1288
|
-
if (i === -1)
|
1289
|
-
return;
|
1290
|
-
|
1291
|
-
$.each(this.pickers, function(i, p){
|
1292
|
-
if (!p.getUTCDate())
|
1293
|
-
p.setUTCDate(new_date);
|
1294
|
-
});
|
1295
|
-
|
1296
|
-
if (new_date < this.dates[i]){
|
1297
|
-
// Date being moved earlier/left
|
1298
|
-
while (i >= 0 && new_date < this.dates[i]){
|
1299
|
-
this.pickers[i--].setUTCDate(new_date);
|
1300
|
-
}
|
1301
|
-
}
|
1302
|
-
else if (new_date > this.dates[i]){
|
1303
|
-
// Date being moved later/right
|
1304
|
-
while (i < l && new_date > this.dates[i]){
|
1305
|
-
this.pickers[i++].setUTCDate(new_date);
|
1306
|
-
}
|
1307
|
-
}
|
1308
|
-
this.updateDates();
|
1309
|
-
|
1310
|
-
delete this.updating;
|
1311
|
-
},
|
1312
|
-
remove: function(){
|
1313
|
-
$.map(this.pickers, function(p){ p.remove(); });
|
1314
|
-
delete this.element.data().datepicker;
|
1315
|
-
}
|
1316
|
-
};
|
1317
|
-
|
1318
|
-
function opts_from_el(el, prefix){
|
1319
|
-
// Derive options from element data-attrs
|
1320
|
-
var data = $(el).data(),
|
1321
|
-
out = {}, inkey,
|
1322
|
-
replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');
|
1323
|
-
prefix = new RegExp('^' + prefix.toLowerCase());
|
1324
|
-
function re_lower(_,a){
|
1325
|
-
return a.toLowerCase();
|
1326
|
-
}
|
1327
|
-
for (var key in data)
|
1328
|
-
if (prefix.test(key)){
|
1329
|
-
inkey = key.replace(replace, re_lower);
|
1330
|
-
out[inkey] = data[key];
|
1331
|
-
}
|
1332
|
-
return out;
|
1333
|
-
}
|
1334
|
-
|
1335
|
-
function opts_from_locale(lang){
|
1336
|
-
// Derive options from locale plugins
|
1337
|
-
var out = {};
|
1338
|
-
// Check if "de-DE" style date is available, if not language should
|
1339
|
-
// fallback to 2 letter code eg "de"
|
1340
|
-
if (!dates[lang]){
|
1341
|
-
lang = lang.split('-')[0];
|
1342
|
-
if (!dates[lang])
|
1343
|
-
return;
|
1344
|
-
}
|
1345
|
-
var d = dates[lang];
|
1346
|
-
$.each(locale_opts, function(i,k){
|
1347
|
-
if (k in d)
|
1348
|
-
out[k] = d[k];
|
1349
|
-
});
|
1350
|
-
return out;
|
1351
|
-
}
|
1352
|
-
|
1353
|
-
var old = $.fn.datepicker;
|
1354
|
-
$.fn.datepicker = function(option){
|
1355
|
-
var args = Array.apply(null, arguments);
|
1356
|
-
args.shift();
|
1357
|
-
var internal_return;
|
1358
|
-
this.each(function(){
|
1359
|
-
var $this = $(this),
|
1360
|
-
data = $this.data('datepicker'),
|
1361
|
-
options = typeof option === 'object' && option;
|
1362
|
-
if (!data){
|
1363
|
-
var elopts = opts_from_el(this, 'date'),
|
1364
|
-
// Preliminary otions
|
1365
|
-
xopts = $.extend({}, defaults, elopts, options),
|
1366
|
-
locopts = opts_from_locale(xopts.language),
|
1367
|
-
// Options priority: js args, data-attrs, locales, defaults
|
1368
|
-
opts = $.extend({}, defaults, locopts, elopts, options);
|
1369
|
-
if ($this.is('.input-daterange') || opts.inputs){
|
1370
|
-
var ropts = {
|
1371
|
-
inputs: opts.inputs || $this.find('input').toArray()
|
1372
|
-
};
|
1373
|
-
$this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts))));
|
1374
|
-
}
|
1375
|
-
else {
|
1376
|
-
$this.data('datepicker', (data = new Datepicker(this, opts)));
|
1377
|
-
}
|
1378
|
-
}
|
1379
|
-
if (typeof option === 'string' && typeof data[option] === 'function'){
|
1380
|
-
internal_return = data[option].apply(data, args);
|
1381
|
-
if (internal_return !== undefined)
|
1382
|
-
return false;
|
1383
|
-
}
|
1384
|
-
});
|
1385
|
-
if (internal_return !== undefined)
|
1386
|
-
return internal_return;
|
1387
|
-
else
|
1388
|
-
return this;
|
1389
|
-
};
|
1390
|
-
|
1391
|
-
var defaults = $.fn.datepicker.defaults = {
|
1392
|
-
autoclose: false,
|
1393
|
-
beforeShowDay: $.noop,
|
1394
|
-
calendarWeeks: false,
|
1395
|
-
clearBtn: false,
|
1396
|
-
daysOfWeekDisabled: [],
|
1397
|
-
endDate: Infinity,
|
1398
|
-
forceParse: true,
|
1399
|
-
format: 'mm/dd/yyyy',
|
1400
|
-
keyboardNavigation: true,
|
1401
|
-
language: 'en',
|
1402
|
-
minViewMode: 0,
|
1403
|
-
multidate: false,
|
1404
|
-
multidateSeparator: ',',
|
1405
|
-
orientation: "auto",
|
1406
|
-
rtl: false,
|
1407
|
-
startDate: -Infinity,
|
1408
|
-
startView: 0,
|
1409
|
-
todayBtn: false,
|
1410
|
-
todayHighlight: false,
|
1411
|
-
weekStart: 0
|
1412
|
-
};
|
1413
|
-
var locale_opts = $.fn.datepicker.locale_opts = [
|
1414
|
-
'format',
|
1415
|
-
'rtl',
|
1416
|
-
'weekStart'
|
1417
|
-
];
|
1418
|
-
$.fn.datepicker.Constructor = Datepicker;
|
1419
|
-
var dates = $.fn.datepicker.dates = {
|
1420
|
-
en: {
|
1421
|
-
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
|
1422
|
-
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
1423
|
-
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
|
1424
|
-
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
1425
|
-
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
1426
|
-
today: "Today",
|
1427
|
-
clear: "Clear"
|
1428
|
-
}
|
1429
|
-
};
|
1430
|
-
|
1431
|
-
var DPGlobal = {
|
1432
|
-
modes: [
|
1433
|
-
{
|
1434
|
-
clsName: 'days',
|
1435
|
-
navFnc: 'Month',
|
1436
|
-
navStep: 1
|
1437
|
-
},
|
1438
|
-
{
|
1439
|
-
clsName: 'months',
|
1440
|
-
navFnc: 'FullYear',
|
1441
|
-
navStep: 1
|
1442
|
-
},
|
1443
|
-
{
|
1444
|
-
clsName: 'years',
|
1445
|
-
navFnc: 'FullYear',
|
1446
|
-
navStep: 10
|
1447
|
-
}],
|
1448
|
-
isLeapYear: function(year){
|
1449
|
-
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));
|
1450
|
-
},
|
1451
|
-
getDaysInMonth: function(year, month){
|
1452
|
-
return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
|
1453
|
-
},
|
1454
|
-
validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
|
1455
|
-
nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,
|
1456
|
-
parseFormat: function(format){
|
1457
|
-
// IE treats \0 as a string end in inputs (truncating the value),
|
1458
|
-
// so it's a bad format delimiter, anyway
|
1459
|
-
var separators = format.replace(this.validParts, '\0').split('\0'),
|
1460
|
-
parts = format.match(this.validParts);
|
1461
|
-
if (!separators || !separators.length || !parts || parts.length === 0){
|
1462
|
-
throw new Error("Invalid date format.");
|
1463
|
-
}
|
1464
|
-
return {separators: separators, parts: parts};
|
1465
|
-
},
|
1466
|
-
parseDate: function(date, format, language){
|
1467
|
-
if (!date)
|
1468
|
-
return undefined;
|
1469
|
-
if (date instanceof Date)
|
1470
|
-
return date;
|
1471
|
-
if (typeof format === 'string')
|
1472
|
-
format = DPGlobal.parseFormat(format);
|
1473
|
-
var part_re = /([\-+]\d+)([dmwy])/,
|
1474
|
-
parts = date.match(/([\-+]\d+)([dmwy])/g),
|
1475
|
-
part, dir, i;
|
1476
|
-
if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){
|
1477
|
-
date = new Date();
|
1478
|
-
for (i=0; i < parts.length; i++){
|
1479
|
-
part = part_re.exec(parts[i]);
|
1480
|
-
dir = parseInt(part[1]);
|
1481
|
-
switch (part[2]){
|
1482
|
-
case 'd':
|
1483
|
-
date.setUTCDate(date.getUTCDate() + dir);
|
1484
|
-
break;
|
1485
|
-
case 'm':
|
1486
|
-
date = Datepicker.prototype.moveMonth.call(Datepicker.prototype, date, dir);
|
1487
|
-
break;
|
1488
|
-
case 'w':
|
1489
|
-
date.setUTCDate(date.getUTCDate() + dir * 7);
|
1490
|
-
break;
|
1491
|
-
case 'y':
|
1492
|
-
date = Datepicker.prototype.moveYear.call(Datepicker.prototype, date, dir);
|
1493
|
-
break;
|
1494
|
-
}
|
1495
|
-
}
|
1496
|
-
return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0);
|
1497
|
-
}
|
1498
|
-
parts = date && date.match(this.nonpunctuation) || [];
|
1499
|
-
date = new Date();
|
1500
|
-
var parsed = {},
|
1501
|
-
setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],
|
1502
|
-
setters_map = {
|
1503
|
-
yyyy: function(d,v){
|
1504
|
-
return d.setUTCFullYear(v);
|
1505
|
-
},
|
1506
|
-
yy: function(d,v){
|
1507
|
-
return d.setUTCFullYear(2000+v);
|
1508
|
-
},
|
1509
|
-
m: function(d,v){
|
1510
|
-
if (isNaN(d))
|
1511
|
-
return d;
|
1512
|
-
v -= 1;
|
1513
|
-
while (v < 0) v += 12;
|
1514
|
-
v %= 12;
|
1515
|
-
d.setUTCMonth(v);
|
1516
|
-
while (d.getUTCMonth() !== v)
|
1517
|
-
d.setUTCDate(d.getUTCDate()-1);
|
1518
|
-
return d;
|
1519
|
-
},
|
1520
|
-
d: function(d,v){
|
1521
|
-
return d.setUTCDate(v);
|
1522
|
-
}
|
1523
|
-
},
|
1524
|
-
val, filtered;
|
1525
|
-
setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
|
1526
|
-
setters_map['dd'] = setters_map['d'];
|
1527
|
-
date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
|
1528
|
-
var fparts = format.parts.slice();
|
1529
|
-
// Remove noop parts
|
1530
|
-
if (parts.length !== fparts.length){
|
1531
|
-
fparts = $(fparts).filter(function(i,p){
|
1532
|
-
return $.inArray(p, setters_order) !== -1;
|
1533
|
-
}).toArray();
|
1534
|
-
}
|
1535
|
-
// Process remainder
|
1536
|
-
function match_part(){
|
1537
|
-
var m = this.slice(0, parts[i].length),
|
1538
|
-
p = parts[i].slice(0, m.length);
|
1539
|
-
return m === p;
|
1540
|
-
}
|
1541
|
-
if (parts.length === fparts.length){
|
1542
|
-
var cnt;
|
1543
|
-
for (i=0, cnt = fparts.length; i < cnt; i++){
|
1544
|
-
val = parseInt(parts[i], 10);
|
1545
|
-
part = fparts[i];
|
1546
|
-
if (isNaN(val)){
|
1547
|
-
switch (part){
|
1548
|
-
case 'MM':
|
1549
|
-
filtered = $(dates[language].months).filter(match_part);
|
1550
|
-
val = $.inArray(filtered[0], dates[language].months) + 1;
|
1551
|
-
break;
|
1552
|
-
case 'M':
|
1553
|
-
filtered = $(dates[language].monthsShort).filter(match_part);
|
1554
|
-
val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
|
1555
|
-
break;
|
1556
|
-
}
|
1557
|
-
}
|
1558
|
-
parsed[part] = val;
|
1559
|
-
}
|
1560
|
-
var _date, s;
|
1561
|
-
for (i=0; i < setters_order.length; i++){
|
1562
|
-
s = setters_order[i];
|
1563
|
-
if (s in parsed && !isNaN(parsed[s])){
|
1564
|
-
_date = new Date(date);
|
1565
|
-
setters_map[s](_date, parsed[s]);
|
1566
|
-
if (!isNaN(_date))
|
1567
|
-
date = _date;
|
1568
|
-
}
|
1569
|
-
}
|
1570
|
-
}
|
1571
|
-
return date;
|
1572
|
-
},
|
1573
|
-
formatDate: function(date, format, language){
|
1574
|
-
if (!date)
|
1575
|
-
return '';
|
1576
|
-
if (typeof format === 'string')
|
1577
|
-
format = DPGlobal.parseFormat(format);
|
1578
|
-
var val = {
|
1579
|
-
d: date.getUTCDate(),
|
1580
|
-
D: dates[language].daysShort[date.getUTCDay()],
|
1581
|
-
DD: dates[language].days[date.getUTCDay()],
|
1582
|
-
m: date.getUTCMonth() + 1,
|
1583
|
-
M: dates[language].monthsShort[date.getUTCMonth()],
|
1584
|
-
MM: dates[language].months[date.getUTCMonth()],
|
1585
|
-
yy: date.getUTCFullYear().toString().substring(2),
|
1586
|
-
yyyy: date.getUTCFullYear()
|
1587
|
-
};
|
1588
|
-
val.dd = (val.d < 10 ? '0' : '') + val.d;
|
1589
|
-
val.mm = (val.m < 10 ? '0' : '') + val.m;
|
1590
|
-
date = [];
|
1591
|
-
var seps = $.extend([], format.separators);
|
1592
|
-
for (var i=0, cnt = format.parts.length; i <= cnt; i++){
|
1593
|
-
if (seps.length)
|
1594
|
-
date.push(seps.shift());
|
1595
|
-
date.push(val[format.parts[i]]);
|
1596
|
-
}
|
1597
|
-
return date.join('');
|
1598
|
-
},
|
1599
|
-
headTemplate: '<thead>'+
|
1600
|
-
'<tr>'+
|
1601
|
-
'<th class="prev">«</th>'+
|
1602
|
-
'<th colspan="5" class="datepicker-switch"></th>'+
|
1603
|
-
'<th class="next">»</th>'+
|
1604
|
-
'</tr>'+
|
1605
|
-
'</thead>',
|
1606
|
-
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
|
1607
|
-
footTemplate: '<tfoot>'+
|
1608
|
-
'<tr>'+
|
1609
|
-
'<th colspan="7" class="today"></th>'+
|
1610
|
-
'</tr>'+
|
1611
|
-
'<tr>'+
|
1612
|
-
'<th colspan="7" class="clear"></th>'+
|
1613
|
-
'</tr>'+
|
1614
|
-
'</tfoot>'
|
1615
|
-
};
|
1616
|
-
DPGlobal.template = '<div class="datepicker">'+
|
1617
|
-
'<div class="datepicker-days">'+
|
1618
|
-
'<table class=" table-condensed">'+
|
1619
|
-
DPGlobal.headTemplate+
|
1620
|
-
'<tbody></tbody>'+
|
1621
|
-
DPGlobal.footTemplate+
|
1622
|
-
'</table>'+
|
1623
|
-
'</div>'+
|
1624
|
-
'<div class="datepicker-months">'+
|
1625
|
-
'<table class="table-condensed">'+
|
1626
|
-
DPGlobal.headTemplate+
|
1627
|
-
DPGlobal.contTemplate+
|
1628
|
-
DPGlobal.footTemplate+
|
1629
|
-
'</table>'+
|
1630
|
-
'</div>'+
|
1631
|
-
'<div class="datepicker-years">'+
|
1632
|
-
'<table class="table-condensed">'+
|
1633
|
-
DPGlobal.headTemplate+
|
1634
|
-
DPGlobal.contTemplate+
|
1635
|
-
DPGlobal.footTemplate+
|
1636
|
-
'</table>'+
|
1637
|
-
'</div>'+
|
1638
|
-
'</div>';
|
1639
|
-
|
1640
|
-
$.fn.datepicker.DPGlobal = DPGlobal;
|
1641
|
-
|
1642
|
-
|
1643
|
-
/* DATEPICKER NO CONFLICT
|
1644
|
-
* =================== */
|
1645
|
-
|
1646
|
-
$.fn.datepicker.noConflict = function(){
|
1647
|
-
$.fn.datepicker = old;
|
1648
|
-
return this;
|
1649
|
-
};
|
1650
|
-
|
1651
|
-
|
1652
|
-
/* DATEPICKER DATA-API
|
1653
|
-
* ================== */
|
1654
|
-
|
1655
|
-
$(document).on(
|
1656
|
-
'focus.datepicker.data-api click.datepicker.data-api',
|
1657
|
-
'[data-provide="datepicker"]',
|
1658
|
-
function(e){
|
1659
|
-
var $this = $(this);
|
1660
|
-
if ($this.data('datepicker'))
|
1661
|
-
return;
|
1662
|
-
e.preventDefault();
|
1663
|
-
// component click requires us to explicitly show it
|
1664
|
-
$this.datepicker('show');
|
1665
|
-
}
|
1666
|
-
);
|
1667
|
-
$(function(){
|
1668
|
-
$('[data-provide="datepicker-inline"]').datepicker();
|
1669
|
-
});
|
1670
|
-
|
1671
|
-
}(window.jQuery));
|