]>
Softwares of Agnibho - pdosage.git/blob - src/routine.js
26f2aef51d8867596903270625dc1210e7465b80
1 /**********************************************************************
3 * Description: Pediatric Calculator
4 * Author: Agnibho Mondal
5 * Website: http://code.agnibho.com
6 **********************************************************************
7 Copyright (c) 2016 Agnibho Mondal
9 **********************************************************************
10 This file is part of PDosage.
12 PDosage is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, either version 3 of the License, or
15 (at your option) any later version.
17 PDosage is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with PDosage. If not, see <http://www.gnu.org/licenses/>.
24 **********************************************************************/
26 $(document
).ready(function(){
29 $(".loader").remove();
30 $(".container").fadeIn();
33 $(".copyright").each(function(){
34 if(new Date().getFullYear()>$(this).data("start")){
35 $(this).text($(this).data("start")+"-"+new Date().getFullYear());
38 $(this).text(new Date().getFullYear());
42 //Emit input on form reset
43 $("input[type='reset']").on("click", function(e
){
45 $(this.form
).find("input, select, textarea").each(function(){
46 this.dispatchEvent(new Event("input"));
50 //Change focus after number input
51 $(".jump-focus").on("input", function(){
52 if($(this).val().length
== $(this).prop("maxlength")){
53 var all
=$("input").toArray();
54 var i
=all
.indexOf(this)+1;
55 $(all
[i
]).focus().select();
59 //Defocus after input finished
60 $(".stop-focus").on("input", function(){
61 if($(this).val().length
== $(this).prop("maxlength")){
63 var target
=$($(this).data("ref"));
64 $("html, body").animate({
65 scrollTop
: $(target
).offset().top