www/js/prod_new.js

changeset 525
8bbc5730aaa8
parent 500
8d53ad389204
child 533
be8691b7d634
equal deleted inserted replaced
524:55a246085522 525:8bbc5730aaa8
19 * along with ThermFerm; see the file COPYING. If not, write to the Free 19 * along with ThermFerm; see the file COPYING. If not, write to the Free
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *****************************************************************************/ 21 *****************************************************************************/
22 22
23 23
24 $(document).ready(function () { 24 $(document).ready(function() {
25 25
26 // Tab 1, base 26 // Tab 1, base
27 $("#name").jqxTooltip({ content: 'De naam voor dit brouw project.' }); 27 $('#name').jqxTooltip({ content: 'De naam voor dit brouw project.' });
28 $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); 28 $('#name').jqxInput({ theme: theme, width: 640, height: 23 });
29 $("#code").jqxTooltip({ content: 'Het unieke code nummer van dit brouw project.' }); 29 $('#code').jqxTooltip({ content: 'Het unieke code nummer van dit brouw project.' });
30 $("#code").jqxInput({ theme: theme, width: 100, height: 23 }); 30 $('#code').jqxInput({ theme: theme, width: 100, height: 23 });
31 $("#notes").jqxTooltip({ content: 'De uitgebreide opmerkingen over dit project.' }); 31 $('#notes').jqxTooltip({ content: 'De uitgebreide opmerkingen over dit project.' });
32 $("#notes").jqxInput({ theme: theme, width: 960, height: 200 }); 32 $('#notes').jqxInput({ theme: theme, width: 960, height: 200 });
33 $("#type").jqxDropDownList({ 33 $('#type').jqxDropDownList({
34 theme: theme, 34 theme: theme,
35 source: RecipeTypeAdapter, 35 source: RecipeTypeAdapter,
36 valueMember: 'id', 36 valueMember: 'id',
37 displayMember: 'nl', 37 displayMember: 'nl',
38 width: 180, 38 width: 180,
39 height: 23, 39 height: 23,
40 autoDropDownHeight: true 40 autoDropDownHeight: true
41 }); 41 });
42 $("#type").jqxDropDownList('selectItem', 2); 42 $('#type').jqxDropDownList('selectItem', 2);
43 $("#type").on('select', function (event) { 43 $('#type').on('select', function(event) {
44 if (event.args) { 44 if (event.args) {
45 recipe_type = event.args.index; 45 recipe_type = event.args.index;
46 } 46 }
47 }); 47 });
48 48
49 // Tab 2, style 49 // Tab 2, style
50 $("#st_name").jqxTooltip({ content: 'De bierstijl naam voor dit recept.'}); 50 $('#st_name').jqxTooltip({ content: 'De bierstijl naam voor dit recept.'});
51 $("#st_name").jqxInput({ theme: theme, width: 250, height: 23 }); 51 $('#st_name').jqxInput({ theme: theme, width: 250, height: 23 });
52 $("#st_category").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie.'}); 52 $('#st_category').jqxTooltip({ content: 'De Amerikaanse bierstijl categorie.'});
53 $("#st_category").jqxInput({ theme: theme, width: 250, height: 23 }); 53 $('#st_category').jqxInput({ theme: theme, width: 250, height: 23 });
54 $("#st_category_number").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie sub nummer.'}); 54 $('#st_category_number').jqxTooltip({ content: 'De Amerikaanse bierstijl categorie sub nummer.'});
55 $("#st_category_number").jqxInput({ theme: theme, width: 70, height: 23 }); 55 $('#st_category_number').jqxInput({ theme: theme, width: 70, height: 23 });
56 $("#st_letter").jqxTooltip({ content: 'De bierstijl letter voor dit recept.'}); 56 $('#st_letter').jqxTooltip({ content: 'De bierstijl letter voor dit recept.'});
57 $("#st_letter").jqxInput({ theme: theme, width: 250, height: 23 }); 57 $('#st_letter').jqxInput({ theme: theme, width: 250, height: 23 });
58 $("#st_guide").jqxTooltip({ content: 'De bierstijl gids voor dit recept.'}); 58 $('#st_guide').jqxTooltip({ content: 'De bierstijl gids voor dit recept.'});
59 $("#st_guide").jqxInput({ theme: theme, width: 250, height: 23 }); 59 $('#st_guide').jqxInput({ theme: theme, width: 250, height: 23 });
60 $("#st_notes").jqxInput({ theme: theme, width: 800, height: 100 }); 60 $('#st_notes').jqxInput({ theme: theme, width: 800, height: 100 });
61 $("#st_type").jqxTooltip({ content: 'Het bierstijl type.'}); 61 $('#st_type').jqxTooltip({ content: 'Het bierstijl type.'});
62 $("#st_type").jqxInput({ theme: theme, width: 250, height: 23 }); 62 $('#st_type').jqxInput({ theme: theme, width: 250, height: 23 });
63 $("#st_og_min").jqxTooltip({ content: 'Het minimum begin SG voor deze bierstijl.'}); 63 $('#st_og_min').jqxTooltip({ content: 'Het minimum begin SG voor deze bierstijl.'});
64 $("#st_og_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true }); 64 $('#st_og_min').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true });
65 $("#st_og_max").jqxTooltip({ content: 'Het maximum begin SG voor deze bierstijl.'}); 65 $('#st_og_max').jqxTooltip({ content: 'Het maximum begin SG voor deze bierstijl.'});
66 $("#st_og_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true }); 66 $('#st_og_max').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true });
67 $("#st_fg_min").jqxTooltip({ content: 'Het minimum eind SG voor deze bierstijl.'}); 67 $('#st_fg_min').jqxTooltip({ content: 'Het minimum eind SG voor deze bierstijl.'});
68 $("#st_fg_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true }); 68 $('#st_fg_min').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true });
69 $("#st_fg_max").jqxTooltip({ content: 'Het maximum eind SG voor deze bierstijl.'}); 69 $('#st_fg_max').jqxTooltip({ content: 'Het maximum eind SG voor deze bierstijl.'});
70 $("#st_fg_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true }); 70 $('#st_fg_max').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true });
71 $("#st_ibu_min").jqxTooltip({ content: 'De minimum bitterheid voor deze bierstijl.'}); 71 $('#st_ibu_min').jqxTooltip({ content: 'De minimum bitterheid voor deze bierstijl.'});
72 $("#st_ibu_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true }); 72 $('#st_ibu_min').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true });
73 $("#st_ibu_max").jqxTooltip({ content: 'De maximum bitterheid voor deze bierstijl.'}); 73 $('#st_ibu_max').jqxTooltip({ content: 'De maximum bitterheid voor deze bierstijl.'});
74 $("#st_ibu_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true }); 74 $('#st_ibu_max').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true });
75 $("#st_color_min").jqxTooltip({ content: 'De minimum kleur voor deze bierstijl.'}); 75 $('#st_color_min').jqxTooltip({ content: 'De minimum kleur voor deze bierstijl.'});
76 $("#st_color_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true }); 76 $('#st_color_min').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true });
77 $("#st_color_max").jqxTooltip({ content: 'De maximum kleur voor deze bierstijl.'}); 77 $('#st_color_max').jqxTooltip({ content: 'De maximum kleur voor deze bierstijl.'});
78 $("#st_color_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true }); 78 $('#st_color_max').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true });
79 $("#st_carb_min").jqxTooltip({ content: 'Het minimum koolzuur volume voor deze bierstijl.'}); 79 $('#st_carb_min').jqxTooltip({ content: 'Het minimum koolzuur volume voor deze bierstijl.'});
80 $("#st_carb_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true }); 80 $('#st_carb_min').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true });
81 $("#st_carb_max").jqxTooltip({ content: 'Het maximum koolzuur volume voor deze bierstijl.'}); 81 $('#st_carb_max').jqxTooltip({ content: 'Het maximum koolzuur volume voor deze bierstijl.'});
82 $("#st_carb_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true }); 82 $('#st_carb_max').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true });
83 $("#st_abv_min").jqxTooltip({ content: 'Het minimum alcohol volume % voor deze bierstijl.'}); 83 $('#st_abv_min').jqxTooltip({ content: 'Het minimum alcohol volume % voor deze bierstijl.'});
84 $("#st_abv_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true }); 84 $('#st_abv_min').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true });
85 $("#st_abv_max").jqxTooltip({ content: 'Het maximum alcohol volume % voor deze bierstijl.'}); 85 $('#st_abv_max').jqxTooltip({ content: 'Het maximum alcohol volume % voor deze bierstijl.'});
86 $("#st_abv_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true }); 86 $('#st_abv_max').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true });
87 $("#st_profile").jqxInput({ theme: theme, width: 800, height: 48 }); 87 $('#st_profile').jqxInput({ theme: theme, width: 800, height: 48 });
88 $("#st_ingredients").jqxInput({ theme: theme, width: 800, height: 23 }); 88 $('#st_ingredients').jqxInput({ theme: theme, width: 800, height: 23 });
89 $("#st_examples").jqxInput({ theme: theme, width: 800, height: 48 }); 89 $('#st_examples').jqxInput({ theme: theme, width: 800, height: 48 });
90 $("#styleSelect").jqxDropDownList({ 90 $('#styleSelect').jqxDropDownList({
91 placeHolder: "Kies bierstijl:", 91 placeHolder: 'Kies bierstijl:',
92 theme: theme, 92 theme: theme,
93 source: styleslist, 93 source: styleslist,
94 displayMember: "name", 94 displayMember: 'name',
95 width: 250, 95 width: 250,
96 height: 27, 96 height: 27,
97 dropDownWidth: 500, 97 dropDownWidth: 500,
98 dropDownHeight: 500, 98 dropDownHeight: 500,
99 renderer: function (index, label, value) { 99 renderer: function(index, label, value) {
100 var datarecord = styleslist.records[index]; 100 var datarecord = styleslist.records[index];
101 return datarecord.style_guide + " " + datarecord.style_letter+ " " + datarecord.name; 101 return datarecord.style_guide + ' ' + datarecord.style_letter + ' ' + datarecord.name;
102 } 102 }
103 }); 103 });
104 $("#styleSelect").on('select', function (event) { 104 $('#styleSelect').on('select', function(event) {
105 if (event.args) { 105 if (event.args) {
106 var index = event.args.index, 106 var index = event.args.index,
107 datarecord = styleslist.records[index]; 107 datarecord = styleslist.records[index];
108 $("#st_name").val(datarecord.name); 108 $('#st_name').val(datarecord.name);
109 $("#st_category").val(datarecord.category); 109 $('#st_category').val(datarecord.category);
110 $("#st_category_number").val(datarecord.category_number); 110 $('#st_category_number').val(datarecord.category_number);
111 $("#st_letter").val(datarecord.style_letter); 111 $('#st_letter').val(datarecord.style_letter);
112 $("#st_guide").val(datarecord.style_guide); 112 $('#st_guide').val(datarecord.style_guide);
113 style_type = datarecord.type; 113 style_type = datarecord.type;
114 $("#st_type").val(StyleTypeData[datarecord.type].nl); 114 $('#st_type').val(StyleTypeData[datarecord.type].nl);
115 $("#st_og_min").val(datarecord.og_min); 115 $('#st_og_min').val(datarecord.og_min);
116 $("#st_og_max").val(datarecord.og_max); 116 $('#st_og_max').val(datarecord.og_max);
117 $("#st_fg_min").val(datarecord.fg_min); 117 $('#st_fg_min').val(datarecord.fg_min);
118 $("#st_fg_max").val(datarecord.fg_max); 118 $('#st_fg_max').val(datarecord.fg_max);
119 $("#st_ibu_min").val(datarecord.ibu_min); 119 $('#st_ibu_min').val(datarecord.ibu_min);
120 $("#st_ibu_max").val(datarecord.ibu_max); 120 $('#st_ibu_max').val(datarecord.ibu_max);
121 $("#st_color_min").val(datarecord.color_min); 121 $('#st_color_min').val(datarecord.color_min);
122 $("#st_color_max").val(datarecord.color_max); 122 $('#st_color_max').val(datarecord.color_max);
123 $("#st_carb_min").val(datarecord.carb_min); 123 $('#st_carb_min').val(datarecord.carb_min);
124 $("#st_carb_max").val(datarecord.carb_max); 124 $('#st_carb_max').val(datarecord.carb_max);
125 $("#st_abv_min").val(datarecord.abv_min); 125 $('#st_abv_min').val(datarecord.abv_min);
126 $("#st_abv_max").val(datarecord.abv_max); 126 $('#st_abv_max').val(datarecord.abv_max);
127 $("#st_notes").val(datarecord.notes); 127 $('#st_notes').val(datarecord.notes);
128 $("#st_profile").val(datarecord.profile); 128 $('#st_profile').val(datarecord.profile);
129 $("#st_ingredients").val(datarecord.ingredients); 129 $('#st_ingredients').val(datarecord.ingredients);
130 $("#st_examples").val(datarecord.examples); 130 $('#st_examples').val(datarecord.examples);
131 } 131 }
132 }); 132 });
133 133
134 // Tab 3, equipment 134 // Tab 3, equipment
135 $("#eq_name").jqxTooltip({ content: 'De naam van deze brouw apparatuur.' }); 135 $('#eq_name').jqxTooltip({ content: 'De naam van deze brouw apparatuur.' });
136 $("#eq_name").jqxInput({ theme: theme, width: 250, height: 23 }); 136 $('#eq_name').jqxInput({ theme: theme, width: 250, height: 23 });
137 $("#eq_calc_boil_volume").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled: true }); 137 $('#eq_calc_boil_volume').jqxCheckBox({ theme: theme, width: 120, height: 23, disabled: true });
138 $("#eq_boil_size").jqxTooltip({ content: 'Normaal kook volume in liters' }); 138 $('#eq_boil_size').jqxTooltip({ content: 'Normaal kook volume in liters' });
139 $("#eq_boil_size").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 139 $('#eq_boil_size').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
140 $("#eq_batch_size").jqxTooltip({ content: 'Berekende batch grootte in liters aan het eind van de kook.' }); 140 $('#eq_batch_size').jqxTooltip({ content: 'Berekende batch grootte in liters aan het eind van de kook.' });
141 $("#eq_batch_size").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 141 $('#eq_batch_size').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
142 $("#eq_tun_volume").jqxTooltip({ content: 'Maisch ketel volume.' }); 142 $('#eq_tun_volume').jqxTooltip({ content: 'Maisch ketel volume.' });
143 $("#eq_tun_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 143 $('#eq_tun_volume').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
144 $("#eq_tun_weight").jqxTooltip({ content: 'Maisch ketel gewicht.' }); 144 $('#eq_tun_weight').jqxTooltip({ content: 'Maisch ketel gewicht.' });
145 $("#eq_tun_weight").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 145 $('#eq_tun_weight').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
146 $("#eq_tun_height").jqxTooltip({ content: 'Maisch ketel hoogte.' }); 146 $('#eq_tun_height').jqxTooltip({ content: 'Maisch ketel hoogte.' });
147 $("#eq_tun_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 147 $('#eq_tun_height').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
148 $("#eq_tun_material").jqxTooltip({ content: 'Maisch ketel materiaal.' }); 148 $('#eq_tun_material').jqxTooltip({ content: 'Maisch ketel materiaal.' });
149 $("#eq_tun_material").jqxInput({ theme: theme, width: 180, height: 23 }); 149 $('#eq_tun_material').jqxInput({ theme: theme, width: 180, height: 23 });
150 $("#eq_tun_specific_heat").jqxTooltip({ content: 'Maisch ketel warmte geleiding.' }); 150 $('#eq_tun_specific_heat').jqxTooltip({ content: 'Maisch ketel warmte geleiding.' });
151 $("#eq_tun_specific_heat").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 3 }); 151 $('#eq_tun_specific_heat').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 3 });
152 $("#eq_top_up_water").jqxTooltip({ content: 'Extra water in het gistvat.' }); 152 $('#eq_top_up_water').jqxTooltip({ content: 'Extra water in het gistvat.' });
153 $("#eq_top_up_water").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 153 $('#eq_top_up_water').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
154 $("#eq_trub_chiller_loss").jqxTooltip({ content: 'Standaard verlies bij het overbrengen naar het gistvat.' }); 154 $('#eq_trub_chiller_loss').jqxTooltip({ content: 'Standaard verlies bij het overbrengen naar het gistvat.' });
155 $("#eq_trub_chiller_loss").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 155 $('#eq_trub_chiller_loss').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
156 $("#eq_evap_rate").jqxTooltip({ content: 'Verdamping in liters per uur.' }); 156 $('#eq_evap_rate').jqxTooltip({ content: 'Verdamping in liters per uur.' });
157 $("#eq_evap_rate").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 2, }); 157 $('#eq_evap_rate').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 2 });
158 $("#eq_boil_time").jqxTooltip({ content: 'Normale kooktijd in minuten.' }); 158 $('#eq_boil_time').jqxTooltip({ content: 'Normale kooktijd in minuten.' });
159 $("#eq_boil_time").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 0 }); 159 $('#eq_boil_time').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 0 });
160 $("#eq_top_up_kettle").jqxTooltip({ content: 'Extra water toevoegen tijdens de kook.' }); 160 $('#eq_top_up_kettle').jqxTooltip({ content: 'Extra water toevoegen tijdens de kook.' });
161 $("#eq_top_up_kettle").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 161 $('#eq_top_up_kettle').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
162 $("#eq_hop_utilization").jqxTooltip({ content: '100% voor kleine installaties, hoger voor grote brouwerijen.' }); 162 $('#eq_hop_utilization').jqxTooltip({ content: '100% voor kleine installaties, hoger voor grote brouwerijen.' });
163 $("#eq_hop_utilization").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 0 }); 163 $('#eq_hop_utilization').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 0 });
164 $("#eq_notes").jqxTooltip({ content: 'Opmerkingen over deze apparatuur.' }); 164 $('#eq_notes').jqxTooltip({ content: 'Opmerkingen over deze apparatuur.' });
165 $("#eq_notes").jqxInput({ theme: theme, width: 960, height: 100 }); 165 $('#eq_notes').jqxInput({ theme: theme, width: 960, height: 100 });
166 $("#eq_lauter_volume").jqxTooltip({ content: 'Filterkuip volume.' }); 166 $('#eq_lauter_volume').jqxTooltip({ content: 'Filterkuip volume.' });
167 $("#eq_lauter_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 167 $('#eq_lauter_volume').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
168 $("#eq_lauter_height").jqxTooltip({ content: 'Filterkuip hoogte.' }); 168 $('#eq_lauter_height').jqxTooltip({ content: 'Filterkuip hoogte.' });
169 $("#eq_lauter_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 169 $('#eq_lauter_height').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
170 $("#eq_lauter_deadspace").jqxTooltip({ content: 'Filterkuip verlies in liters.' }); 170 $('#eq_lauter_deadspace').jqxTooltip({ content: 'Filterkuip verlies in liters.' });
171 $("#eq_lauter_deadspace").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 171 $('#eq_lauter_deadspace').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
172 $("#eq_kettle_volume").jqxTooltip({ content: 'Kook ketel volume in liters.' }); 172 $('#eq_kettle_volume').jqxTooltip({ content: 'Kook ketel volume in liters.' });
173 $("#eq_kettle_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 173 $('#eq_kettle_volume').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
174 $("#eq_kettle_height").jqxTooltip({ content: 'Kook ketel hoogte in cm.' }); 174 $('#eq_kettle_height').jqxTooltip({ content: 'Kook ketel hoogte in cm.' });
175 $("#eq_kettle_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 175 $('#eq_kettle_height').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
176 $("#eq_mash_volume").jqxTooltip({ content: 'Maisch water voor de eerste stap.' }); 176 $('#eq_mash_volume').jqxTooltip({ content: 'Maisch water voor de eerste stap.' });
177 $("#eq_mash_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 177 $('#eq_mash_volume').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
178 $("#eq_mash_max").jqxTooltip({ content: 'De maximale moutstort in Kg.' }); 178 $('#eq_mash_max').jqxTooltip({ content: 'De maximale moutstort in Kg.' });
179 $("#eq_mash_max").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 179 $('#eq_mash_max').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
180 $("#eq_efficiency").jqxTooltip({ content: 'Gemiddeld brouwzaal rendement.' }); 180 $('#eq_efficiency').jqxTooltip({ content: 'Gemiddeld brouwzaal rendement.' });
181 $("#eq_efficiency").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 }); 181 $('#eq_efficiency').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
182 $("#equipmentSelect").jqxDropDownList({ 182 $('#equipmentSelect').jqxDropDownList({
183 placeHolder: "Kies apparatuur:", 183 placeHolder: 'Kies apparatuur:',
184 theme: theme, 184 theme: theme,
185 source: equipmentlist, 185 source: equipmentlist,
186 displayMember: "name", 186 displayMember: 'name',
187 width: 250, 187 width: 250,
188 height: 27, 188 height: 27,
189 dropDownWidth: 300, 189 dropDownWidth: 300,
190 renderer: function (index, label, value) { 190 renderer: function(index, label, value) {
191 var datarecord = equipmentlist.records[index]; 191 var datarecord = equipmentlist.records[index];
192 return datarecord.batch_size + " liter " + datarecord.name; 192 return datarecord.batch_size + ' liter ' + datarecord.name;
193 } 193 }
194 }); 194 });
195 $("#equipmentSelect").on('select', function (event) { 195 $('#equipmentSelect').on('select', function(event) {
196 if (event.args) { 196 if (event.args) {
197 var index = event.args.index, 197 var index = event.args.index,
198 datarecord = equipmentlist.records[index]; 198 datarecord = equipmentlist.records[index];
199 $("#eq_name").val(datarecord.name); 199 $('#eq_name').val(datarecord.name);
200 $("#eq_boil_size").val(datarecord.boil_size); 200 $('#eq_boil_size').val(datarecord.boil_size);
201 $("#eq_batch_size").val(datarecord.batch_size); 201 $('#eq_batch_size').val(datarecord.batch_size);
202 $("#eq_tun_volume").val(datarecord.tun_volume); 202 $('#eq_tun_volume').val(datarecord.tun_volume);
203 $("#eq_tun_weight").val(datarecord.tun_weight); 203 $('#eq_tun_weight').val(datarecord.tun_weight);
204 $("#eq_tun_specific_heat").val(datarecord.tun_specific_heat); 204 $('#eq_tun_specific_heat').val(datarecord.tun_specific_heat);
205 tun_material = datarecord.tun_material; 205 tun_material = datarecord.tun_material;
206 $("#eq_tun_material").val(MaterialData[datarecord.tun_material].nl); 206 $('#eq_tun_material').val(MaterialData[datarecord.tun_material].nl);
207 $("#eq_tun_height").val(datarecord.tun_height); 207 $('#eq_tun_height').val(datarecord.tun_height);
208 $("#eq_top_up_water").val(datarecord.top_up_water); 208 $('#eq_top_up_water').val(datarecord.top_up_water);
209 $("#eq_trub_chiller_loss").val(datarecord.trub_chiller_loss); 209 $('#eq_trub_chiller_loss').val(datarecord.trub_chiller_loss);
210 $("#eq_evap_rate").val(datarecord.evap_rate); 210 $('#eq_evap_rate').val(datarecord.evap_rate);
211 $("#eq_boil_time").val(datarecord.boil_time); 211 $('#eq_boil_time').val(datarecord.boil_time);
212 $("#eq_calc_boil_volume").val(datarecord.calc_boil_volume); 212 $('#eq_calc_boil_volume').val(datarecord.calc_boil_volume);
213 $("#eq_top_up_kettle").val(datarecord.top_up_kettle); 213 $('#eq_top_up_kettle').val(datarecord.top_up_kettle);
214 $("#eq_hop_utilization").val(datarecord.hop_utilization); 214 $('#eq_hop_utilization').val(datarecord.hop_utilization);
215 $("#eq_notes").val(datarecord.notes); 215 $('#eq_notes').val(datarecord.notes);
216 $("#eq_lauter_volume").val(datarecord.lauter_volume); 216 $('#eq_lauter_volume').val(datarecord.lauter_volume);
217 $("#eq_lauter_height").val(datarecord.lauter_height); 217 $('#eq_lauter_height').val(datarecord.lauter_height);
218 $("#eq_lauter_deadspace").val(datarecord.lauter_deadspace); 218 $('#eq_lauter_deadspace').val(datarecord.lauter_deadspace);
219 $("#eq_kettle_volume").val(datarecord.kettle_volume); 219 $('#eq_kettle_volume').val(datarecord.kettle_volume);
220 $("#eq_kettle_height").val(datarecord.kettle_height); 220 $('#eq_kettle_height').val(datarecord.kettle_height);
221 $("#eq_mash_volume").val(datarecord.mash_volume); 221 $('#eq_mash_volume').val(datarecord.mash_volume);
222 $("#eq_mash_max").val(datarecord.mash_max); 222 $('#eq_mash_max').val(datarecord.mash_max);
223 $("#eq_efficiency").val(datarecord.efficiency); 223 $('#eq_efficiency').val(datarecord.efficiency);
224 } 224 }
225 }); 225 });
226 226
227 var recipe_type = 2, 227 var recipe_type = 2,
228 style_type = 0, 228 style_type = 0,
229 tun_material = 0, 229 tun_material = 0,
230 wizard = (function() { // Creating wizard module 230 wizard = (function() { // Creating wizard module
231 231
232 //Adding event listeners 232 //Adding event listeners
233 var _addHandlers = function () { 233 var _addHandlers = function() {
234 $('#name').on('change', function (event) { wizard.validate(true); }); 234 $('#name').on('change', function(event) { wizard.validate(true); });
235 $('#code').on('change', function (event) { wizard.validate(true); }); 235 $('#code').on('change', function(event) { wizard.validate(true); });
236 $('#type').on('change', function (event) { wizard.validate(true); }); 236 $('#type').on('change', function(event) { wizard.validate(true); });
237 $('#styleSelect').on('change', function (event) { wizard.validate(true); }); 237 $('#styleSelect').on('change', function(event) { wizard.validate(true); });
238 $('#equipmentSelect').on('change', function (event) { wizard.validate(true); }); 238 $('#equipmentSelect').on('change', function(event) { wizard.validate(true); });
239 $('#nextButtonCompleted').click(function () { 239 $('#nextButtonCompleted').click(function() {
240 var d = new Date(), 240 var d = new Date(),
241 m = d.getMonth() + 1, 241 m = d.getMonth() + 1,
242 b = d.getFullYear() + '-', 242 b = d.getFullYear() + '-',
243 newrow, data; 243 newrow, data;
244 if (m < 10) 244 if (m < 10)
245 b = b + '0'; 245 b = b + '0';
246 b = b + m + '-'; 246 b = b + m + '-';
247 if (d.getDate() < 10) 247 if (d.getDate() < 10)
248 b = b + '0'; 248 b = b + '0';
249 b = b + d.getDate(); 249 b = b + d.getDate();
250 newrow = { 250 newrow = {
251 record: -1, 251 record: -1,
252 name: $("#name").val(), 252 name: $('#name').val(),
253 code: $("#code").val(), 253 code: $('#code').val(),
254 birth: b, 254 birth: b,
255 stage: 0, 255 stage: 0,
256 notes: $("#notes").val(), 256 notes: $('#notes').val(),
257 log_brew: 0, 257 log_brew: 0,
258 log_fermentation: 0, 258 log_fermentation: 0,
259 inventory_reduced: 0, 259 inventory_reduced: 0,
260 locked: 0, 260 locked: 0,
261 eq_name: $("#eq_name").val(), 261 eq_name: $('#eq_name').val(),
262 eq_boil_size: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')), 262 eq_boil_size: parseFloat($('#eq_boil_size').jqxNumberInput('decimal')),
263 eq_batch_size: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')), 263 eq_batch_size: parseFloat($('#eq_batch_size').jqxNumberInput('decimal')),
264 eq_tun_volume: parseFloat($("#eq_tun_volume").jqxNumberInput('decimal')), 264 eq_tun_volume: parseFloat($('#eq_tun_volume').jqxNumberInput('decimal')),
265 eq_tun_weight: parseFloat($("#eq_tun_weight").jqxNumberInput('decimal')), 265 eq_tun_weight: parseFloat($('#eq_tun_weight').jqxNumberInput('decimal')),
266 eq_tun_specific_heat: parseFloat($("#eq_tun_specific_heat").jqxNumberInput('decimal')), 266 eq_tun_specific_heat: parseFloat($('#eq_tun_specific_heat').jqxNumberInput('decimal')),
267 eq_tun_material: tun_material, 267 eq_tun_material: tun_material,
268 eq_tun_height: parseFloat($("#eq_tun_height").jqxNumberInput('decimal')) / 100, 268 eq_tun_height: parseFloat($('#eq_tun_height').jqxNumberInput('decimal')) / 100,
269 eq_top_up_water: parseFloat($("#eq_top_up_water").jqxNumberInput('decimal')), 269 eq_top_up_water: parseFloat($('#eq_top_up_water').jqxNumberInput('decimal')),
270 eq_trub_chiller_loss: parseFloat($("#eq_trub_chiller_loss").jqxNumberInput('decimal')), 270 eq_trub_chiller_loss: parseFloat($('#eq_trub_chiller_loss').jqxNumberInput('decimal')),
271 eq_evap_rate: parseFloat($("#eq_evap_rate").jqxNumberInput('decimal')), 271 eq_evap_rate: parseFloat($('#eq_evap_rate').jqxNumberInput('decimal')),
272 eq_boil_time: parseFloat($("#eq_boil_time").jqxNumberInput('decimal')), 272 eq_boil_time: parseFloat($('#eq_boil_time').jqxNumberInput('decimal')),
273 eq_calc_boil_volume: $("#eq_calc_boil_volume").val(), 273 eq_calc_boil_volume: $('#eq_calc_boil_volume').val(),
274 eq_top_up_kettle: parseFloat($("#eq_top_up_kettle").jqxNumberInput('decimal')), 274 eq_top_up_kettle: parseFloat($('#eq_top_up_kettle').jqxNumberInput('decimal')),
275 eq_hop_utilization: parseFloat($("#eq_hop_utilization").jqxNumberInput('decimal')), 275 eq_hop_utilization: parseFloat($('#eq_hop_utilization').jqxNumberInput('decimal')),
276 eq_notes: $("#eq_notes").val(), 276 eq_notes: $('#eq_notes').val(),
277 eq_lauter_volume: parseFloat($("#eq_lauter_volume").jqxNumberInput('decimal')), 277 eq_lauter_volume: parseFloat($('#eq_lauter_volume').jqxNumberInput('decimal')),
278 eq_lauter_height: parseFloat($("#eq_lauter_height").jqxNumberInput('decimal')) / 100, 278 eq_lauter_height: parseFloat($('#eq_lauter_height').jqxNumberInput('decimal')) / 100,
279 eq_lauter_deadspace: parseFloat($("#eq_lauter_deadspace").jqxNumberInput('decimal')), 279 eq_lauter_deadspace: parseFloat($('#eq_lauter_deadspace').jqxNumberInput('decimal')),
280 eq_kettle_volume: parseFloat($("#eq_kettle_volume").jqxNumberInput('decimal')), 280 eq_kettle_volume: parseFloat($('#eq_kettle_volume').jqxNumberInput('decimal')),
281 eq_kettle_height: parseFloat($("#eq_kettle_height").jqxNumberInput('decimal')) / 100, 281 eq_kettle_height: parseFloat($('#eq_kettle_height').jqxNumberInput('decimal')) / 100,
282 eq_mash_volume: parseFloat($("#eq_mash_volume").jqxNumberInput('decimal')), 282 eq_mash_volume: parseFloat($('#eq_mash_volume').jqxNumberInput('decimal')),
283 eq_mash_max: parseFloat($("#eq_mash_max").jqxNumberInput('decimal')), 283 eq_mash_max: parseFloat($('#eq_mash_max').jqxNumberInput('decimal')),
284 eq_efficiency: parseFloat($("#eq_efficiency").jqxNumberInput('decimal')), 284 eq_efficiency: parseFloat($('#eq_efficiency').jqxNumberInput('decimal')),
285 brew_date_start: '', 285 brew_date_start: '',
286 brew_mash_ph: 0.0, 286 brew_mash_ph: 0.0,
287 brew_mash_sg: 1.000, 287 brew_mash_sg: 1.000,
288 brew_mash_efficiency: 0, 288 brew_mash_efficiency: 0,
289 brew_sparge_ph: 0.0, 289 brew_sparge_ph: 0.0,
290 brew_sparge_temperature: 85, 290 brew_sparge_temperature: 85,
291 brew_sparge_est: 0, 291 brew_sparge_est: 0,
292 brew_preboil_volume: 0, 292 brew_preboil_volume: 0,
293 brew_preboil_sg: 0, 293 brew_preboil_sg: 0,
294 brew_preboil_ph: 0.0, 294 brew_preboil_ph: 0.0,
295 brew_preboil_efficiency: 0, 295 brew_preboil_efficiency: 0,
296 brew_aboil_volume: 0, 296 brew_aboil_volume: 0,
297 brew_aboil_sg: 0, 297 brew_aboil_sg: 0,
298 brew_aboil_ph: 0.0, 298 brew_aboil_ph: 0.0,
299 brew_aboil_efficiency: 0, 299 brew_aboil_efficiency: 0,
300 brew_cooling_method: 0, 300 brew_cooling_method: 0,
301 brew_cooling_time: 0, 301 brew_cooling_time: 0,
302 brew_cooling_to: 20, 302 brew_cooling_to: 20,
303 brew_whirlpool9: 0, 303 brew_whirlpool9: 0,
304 brew_whirlpool7: 0, 304 brew_whirlpool7: 0,
305 brew_whirlpool6: 0, 305 brew_whirlpool6: 0,
306 brew_whirlpool2: 0, 306 brew_whirlpool2: 0,
307 brew_fermenter_volume: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')) - 307 brew_fermenter_volume: parseFloat($('#eq_batch_size').jqxNumberInput('decimal')) -
308 parseFloat($("#eq_trub_chiller_loss").jqxNumberInput('decimal')) + 308 parseFloat($('#eq_trub_chiller_loss').jqxNumberInput('decimal')) +
309 parseFloat($("#eq_top_up_water").jqxNumberInput('decimal')), 309 parseFloat($('#eq_top_up_water').jqxNumberInput('decimal')),
310 brew_fermenter_extrawater: parseFloat($("#eq_top_up_water").jqxNumberInput('decimal')), 310 brew_fermenter_extrawater: parseFloat($('#eq_top_up_water').jqxNumberInput('decimal')),
311 brew_fermenter_tcloss: parseFloat($("#eq_trub_chiller_loss").jqxNumberInput('decimal')), 311 brew_fermenter_tcloss: parseFloat($('#eq_trub_chiller_loss').jqxNumberInput('decimal')),
312 brew_aeration_time: 0, 312 brew_aeration_time: 0,
313 brew_aeration_speed: 0, 313 brew_aeration_speed: 0,
314 brew_aeration_type: 0, 314 brew_aeration_type: 0,
315 brew_fermenter_sg: 0, 315 brew_fermenter_sg: 0,
316 brew_fermenter_ibu: 0, 316 brew_fermenter_ibu: 0,
317 brew_fermenter_color: 0, 317 brew_fermenter_color: 0,
318 brew_date_end: '', 318 brew_date_end: '',
319 og: 0, 319 og: 0,
320 fg: 0, 320 fg: 0,
321 primary_start_temp: 0, 321 primary_start_temp: 0,
322 primary_max_temp: 0, 322 primary_max_temp: 0,
323 primary_end_temp: 0, 323 primary_end_temp: 0,
324 primary_end_sg: 0, 324 primary_end_sg: 0,
325 primary_end_date: '', 325 primary_end_date: '',
326 secondary_temp: 0, 326 secondary_temp: 0,
327 secondary_end_date: '', 327 secondary_end_date: '',
328 tertiary_temp: 0, 328 tertiary_temp: 0,
329 package_date: '', 329 package_date: '',
330 package_volume: 0, 330 package_volume: 0,
331 package_infuse_amount: 0, 331 package_infuse_amount: 0,
332 package_infuse_abv: 0, 332 package_infuse_abv: 0,
333 package_infuse_notes: '', 333 package_infuse_notes: '',
334 package_abv: 0, 334 package_abv: 0,
335 package_ph: 0, 335 package_ph: 0,
336 bottle_amount: 0, 336 bottle_amount: 0,
337 bottle_carbonation: 0, 337 bottle_carbonation: 0,
338 bottle_priming_water: 0, 338 bottle_priming_water: 0,
339 bottle_priming_amount: 0, 339 bottle_priming_amount: 0,
340 bottle_carbonation_temp: 23, 340 bottle_carbonation_temp: 23,
341 keg_amount: 0, 341 keg_amount: 0,
342 keg_carbonation: 0, 342 keg_carbonation: 0,
343 keg_priming_water: 0, 343 keg_priming_water: 0,
344 keg_priming_amount: 0, 344 keg_priming_amount: 0,
345 keg_carbonation_temp: 23, 345 keg_carbonation_temp: 23,
346 keg_forced_carb: 1, 346 keg_forced_carb: 1,
347 keg_pressure: 0, 347 keg_pressure: 0,
348 taste_notes: '', 348 taste_notes: '',
349 taste_rate: 0, 349 taste_rate: 0,
350 taste_date: '', 350 taste_date: '',
351 taste_color: '', 351 taste_color: '',
352 taste_transparency: '', 352 taste_transparency: '',
353 taste_head: '', 353 taste_head: '',
354 taste_aroma: '', 354 taste_aroma: '',
355 taste_taste: '', 355 taste_taste: '',
356 taste_mouthfeel: '', 356 taste_mouthfeel: '',
357 taste_aftertaste: '', 357 taste_aftertaste: '',
358 st_name: $('#st_name').val(), 358 st_name: $('#st_name').val(),
359 st_letter: $('#st_letter').val(), 359 st_letter: $('#st_letter').val(),
360 st_guide: $('#st_guide').val(), 360 st_guide: $('#st_guide').val(),
361 st_type: style_type, 361 st_type: style_type,
362 st_category: $('#st_category').val(), 362 st_category: $('#st_category').val(),
363 st_category_number: parseFloat($("#st_category_number").jqxNumberInput('decimal')), 363 st_category_number: parseFloat($('#st_category_number').jqxNumberInput('decimal')),
364 st_og_min: parseFloat($("#st_og_min").jqxNumberInput('decimal')), 364 st_og_min: parseFloat($('#st_og_min').jqxNumberInput('decimal')),
365 st_og_max: parseFloat($("#st_og_max").jqxNumberInput('decimal')), 365 st_og_max: parseFloat($('#st_og_max').jqxNumberInput('decimal')),
366 st_fg_min: parseFloat($("#st_fg_min").jqxNumberInput('decimal')), 366 st_fg_min: parseFloat($('#st_fg_min').jqxNumberInput('decimal')),
367 st_fg_max: parseFloat($("#st_fg_max").jqxNumberInput('decimal')), 367 st_fg_max: parseFloat($('#st_fg_max').jqxNumberInput('decimal')),
368 st_ibu_min: parseFloat($("#st_ibu_min").jqxNumberInput('decimal')), 368 st_ibu_min: parseFloat($('#st_ibu_min').jqxNumberInput('decimal')),
369 st_ibu_max: parseFloat($("#st_ibu_max").jqxNumberInput('decimal')), 369 st_ibu_max: parseFloat($('#st_ibu_max').jqxNumberInput('decimal')),
370 st_color_min: parseFloat($("#st_color_min").jqxNumberInput('decimal')), 370 st_color_min: parseFloat($('#st_color_min').jqxNumberInput('decimal')),
371 st_color_max: parseFloat($("#st_color_max").jqxNumberInput('decimal')), 371 st_color_max: parseFloat($('#st_color_max').jqxNumberInput('decimal')),
372 st_carb_min: parseFloat($("#st_carb_min").jqxNumberInput('decimal')), 372 st_carb_min: parseFloat($('#st_carb_min').jqxNumberInput('decimal')),
373 st_carb_max: parseFloat($("#st_carb_max").jqxNumberInput('decimal')), 373 st_carb_max: parseFloat($('#st_carb_max').jqxNumberInput('decimal')),
374 st_abv_min: parseFloat($("#st_abv_min").jqxNumberInput('decimal')), 374 st_abv_min: parseFloat($('#st_abv_min').jqxNumberInput('decimal')),
375 st_abv_max: parseFloat($("#st_abv_max").jqxNumberInput('decimal')), 375 st_abv_max: parseFloat($('#st_abv_max').jqxNumberInput('decimal')),
376 type: recipe_type, 376 type: recipe_type,
377 batch_size: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')), 377 batch_size: parseFloat($('#eq_batch_size').jqxNumberInput('decimal')),
378 boil_size: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')), 378 boil_size: parseFloat($('#eq_boil_size').jqxNumberInput('decimal')),
379 boil_time: parseFloat($("#eq_boil_time").jqxNumberInput('decimal')), 379 boil_time: parseFloat($('#eq_boil_time').jqxNumberInput('decimal')),
380 efficiency: parseFloat($("#eq_efficiency").jqxNumberInput('decimal')), 380 efficiency: parseFloat($('#eq_efficiency').jqxNumberInput('decimal')),
381 est_og: 0.000, 381 est_og: 0.000,
382 est_fg: 0.000, 382 est_fg: 0.000,
383 est_color: 0, 383 est_color: 0,
384 est_abv: 0.0, 384 est_abv: 0.0,
385 est_carb: 0.0, 385 est_carb: 0.0,
386 color_method: 0, 386 color_method: 0,
387 est_ibu: 0, 387 est_ibu: 0,
388 ibu_method: 0, 388 ibu_method: 0,
389 mash_name: "", 389 mash_name: '',
390 mash_ph: 5.4, 390 mash_ph: 5.4,
391 sparge_temp: 85.0, 391 sparge_temp: 85.0,
392 sparge_volume: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')) / 2, 392 sparge_volume: parseFloat($('#eq_boil_size').jqxNumberInput('decimal')) / 2,
393 sparge_ph: 5.8, 393 sparge_ph: 5.8,
394 sparge_source: 0, 394 sparge_source: 0,
395 sparge_acid_type: 0, 395 sparge_acid_type: 0,
396 sparge_acid_perc: 80, 396 sparge_acid_perc: 80,
397 sparge_acid_amount: 0, 397 sparge_acid_amount: 0,
398 calc_acid: 1, 398 calc_acid: 1,
399 w1_name: 'Tap water', 399 w1_name: 'Tap water',
400 w1_amount: parseFloat($("#eq_mash_volume").jqxNumberInput('decimal')), 400 w1_amount: parseFloat($('#eq_mash_volume').jqxNumberInput('decimal')),
401 w1_calcium: 0, 401 w1_calcium: 0,
402 w1_sulfate: 0, 402 w1_sulfate: 0,
403 w1_chloride: 0, 403 w1_chloride: 0,
404 w1_sodium: 0, 404 w1_sodium: 0,
405 w1_magnesium: 0, 405 w1_magnesium: 0,
406 w1_total_alkalinity: 0, 406 w1_total_alkalinity: 0,
407 w1_ph: 7.0, 407 w1_ph: 7.0,
408 w1_cost: 0.0, 408 w1_cost: 0.0,
409 wa_acid_name: 0, // Lactic acid 409 wa_acid_name: 0, // Lactic acid
410 wa_acid_perc: 80, 410 wa_acid_perc: 80,
411 wa_base_name: 0, 411 wa_base_name: 0,
412 wg_amount: parseFloat($("#eq_mash_volume").jqxNumberInput('decimal')), 412 wg_amount: parseFloat($('#eq_mash_volume').jqxNumberInput('decimal')),
413 wg_calcium: 0, 413 wg_calcium: 0,
414 wg_sulfate: 0, 414 wg_sulfate: 0,
415 wg_chloride: 0, 415 wg_chloride: 0,
416 wg_sodium: 0, 416 wg_sodium: 0,
417 wg_magnesium: 0, 417 wg_magnesium: 0,
418 wg_total_alkalinity: 0, 418 wg_total_alkalinity: 0,
419 wg_ph: 7.0, 419 wg_ph: 7.0,
420 wb_calcium: 0, 420 wb_calcium: 0,
421 wb_sulfate: 0, 421 wb_sulfate: 0,
422 wb_sodium: 0, 422 wb_sodium: 0,
423 wb_chloride: 0, 423 wb_chloride: 0,
424 wb_magnesium: 0, 424 wb_magnesium: 0,
425 wb_total_alkalinity: 0, 425 wb_total_alkalinity: 0,
426 wb_ph: 0, 426 wb_ph: 0,
427 starter_enable: 0, 427 starter_enable: 0,
428 divide_type: 0, 428 divide_type: 0,
429 divide_size: 0, 429 divide_size: 0,
430 divide_parts: 0 430 divide_parts: 0
431 }; 431 };
432 data = "insert=true&return=" + my_return + "&" + $.param(newrow); 432 data = 'insert=true&return=' + my_return + '&' + $.param(newrow);
433 $.ajax({ 433 $.ajax({
434 dataType: 'json', 434 dataType: 'json',
435 url: "includes/db_product.php", 435 url: 'includes/db_product.php',
436 cache: false, 436 cache: false,
437 data: data, 437 data: data,
438 type: "POST", 438 type: 'POST',
439 success: function (data, status, xhr) { 439 success: function(data, status, xhr) {
440 // update command is executed. 440 window.location.href = my_return;
441 window.location.href = my_return; 441 },
442 }, 442 error: function(jqXHR, textStatus, errorThrown) {
443 error: function(jqXHR, textStatus, errorThrown) { 443 }
444 } 444 });
445 }); 445 });
446 }); 446 $('.nextButton').click(function() {
447 $('.nextButton').click(function () { 447 wizard.validate(true);
448 wizard.validate(true); 448 $('#jqxTabs').jqxTabs('next');
449 $('#jqxTabs').jqxTabs('next'); 449 });
450 }); 450 $('.backButton').click(function() {
451 $('.backButton').click(function () { 451 wizard.validate(true);
452 wizard.validate(true); 452 $('#jqxTabs').jqxTabs('previous');
453 $('#jqxTabs').jqxTabs('previous'); 453 });
454 }); 454 };
455 }; 455
456 456 return {
457 return { 457 //Initializing the wizzard - creating all elements, adding event handlers and starting the validation
458 //Initializing the wizzard - creating all elements, adding event handlers and starting the validation 458 init: function() {
459 init: function () { 459 $('#jqxTabs').jqxTabs({
460 $('#jqxTabs').jqxTabs({ 460 theme: theme,
461 theme: theme, 461 height: 630,
462 height: 630, 462 width: 1280,
463 width: 1280, 463 autoHeight: false,
464 autoHeight: false, 464 position: 'top',
465 position: 'top', 465 keyboardNavigation: false
466 keyboardNavigation: false 466 });
467 }); 467 $('#nextButtonBase').jqxButton({ theme: theme, width: 150 });
468 $('#nextButtonBase').jqxButton({ theme: theme, width: 150 }); 468 $('#nextButtonStyle').jqxButton({ theme: theme, width: 150});
469 $('#nextButtonStyle').jqxButton({ theme: theme, width: 150}); 469 $('#backButtonStyle').jqxButton({ theme: theme, template: 'success', width: 150});
470 $('#backButtonStyle').jqxButton({ theme: theme, template: 'success', width: 150}); 470 $('#nextButtonEq').jqxButton({ theme: theme, width: 150});
471 $('#nextButtonEq').jqxButton({ theme: theme, width: 150}); 471 $('#backButtonEq').jqxButton({ theme: theme, template: 'success', width: 150});
472 $('#backButtonEq').jqxButton({ theme: theme, template: 'success', width: 150}); 472 $('#nextButtonCompleted').jqxButton({ theme: theme, template: 'success', width: 150});
473 $('#nextButtonCompleted').jqxButton({ theme: theme, template: 'success', width: 150}); 473 $('#backButtonCompleted').jqxButton({ theme: theme, template: 'success', width: 150});
474 $('#backButtonCompleted').jqxButton({ theme: theme, template: 'success', width: 150}); 474 _addHandlers();
475 _addHandlers(); 475 this.validate();
476 this.validate(); 476 this.showHint('Validation hints.');
477 this.showHint('Validation hints.'); 477 },
478 }, 478
479 479 //Validating all wizard tabs
480 //Validating all wizard tabs 480 validate: function(notify) {
481 validate: function (notify) { 481 if (!this.firstTab(notify)) {
482 if (!this.firstTab(notify)) { 482 $('#jqxTabs').jqxTabs('disableAt', 1);
483 $('#jqxTabs').jqxTabs('disableAt', 1); 483 $('#jqxTabs').jqxTabs('disableAt', 2);
484 $('#jqxTabs').jqxTabs('disableAt', 2); 484 $('#jqxTabs').jqxTabs('disableAt', 3);
485 $('#jqxTabs').jqxTabs('disableAt', 3); 485 return;
486 return; 486 } else {
487 } else { 487 $('#jqxTabs').jqxTabs('enableAt', 1);
488 $('#jqxTabs').jqxTabs('enableAt', 1); 488 }
489 } 489 if (!this.secondTab(notify)) {
490 if (!this.secondTab(notify)) { 490 $('#jqxTabs').jqxTabs('disableAt', 2);
491 $('#jqxTabs').jqxTabs('disableAt', 2); 491 $('#jqxTabs').jqxTabs('disableAt', 3);
492 $('#jqxTabs').jqxTabs('disableAt', 3); 492 return;
493 return; 493 } else {
494 } else { 494 $('#jqxTabs').jqxTabs('enableAt', 2);
495 $('#jqxTabs').jqxTabs('enableAt', 2); 495 }
496 } 496 if (!this.thirdTab(notify)) {
497 if (!this.thirdTab(notify)) { 497 $('#jqxTabs').jqxTabs('disableAt', 3);
498 $('#jqxTabs').jqxTabs('disableAt', 3); 498 return;
499 return; 499 } else {
500 } else { 500 $('#jqxTabs').jqxTabs('enableAt', 3);
501 $('#jqxTabs').jqxTabs('enableAt', 3); 501 }
502 } 502 },
503 }, 503
504 504 //Displaying message to the user
505 //Displaying message to the user 505 showHint: function(message, selector) {
506 showHint: function (message, selector) { 506 if (typeof selector === 'undefined') {
507 if (typeof selector === 'undefined') { 507 selector = '.hint';
508 selector = '.hint'; 508 }
509 } 509 if (message === '') {
510 if (message === '') { 510 message = 'Ok, je mag doorgaan.';
511 message = 'Ok, je mag doorgaan.'; 511 }
512 } 512 $(selector).html('<strong>' + message + '</strong>');
513 $(selector).html('<strong>' + message + '</strong>'); 513 },
514 }, 514
515 515 //Validating the first tab
516 //Validating the first tab 516 firstTab: function(notify) {
517 firstTab: function (notify) { 517 var name = $('#name').val(), code = $('#code').val(), message = '';
518 var name = $('#name').val(), 518 if (name.length < 3) {
519 code = $('#code').val(), 519 message += 'Je moet een brouw project naam invullen. <br />';
520 message = ''; 520 }
521 if (name.length < 3) { 521 if (code.length < 3) {
522 message += 'Je moet een brouw project naam invullen. <br />'; 522 message += 'Je moet een brouw project code invullen. <br />';
523 } 523 }
524 if (code.length < 3) { 524 // Check if code already exists.
525 message += 'Je moet een brouw project code invullen. <br />'; 525 if (message !== '') {
526 } 526 if (notify) {
527 // Check if code already exists. 527 this.showHint(message, '#hintBase');
528 if (message !== '') { 528 }
529 if (notify) { 529 return false;
530 this.showHint(message, '#hintBase'); 530 }
531 } 531 this.showHint('Ok, je mag doorgaan.', '#hintBase');
532 return false; 532 $('#nextButtonBase').jqxButton({ template: 'success' });
533 } 533 return true;
534 this.showHint('Ok, je mag doorgaan.', '#hintBase'); 534 },
535 $('#nextButtonBase').jqxButton({ template: 'success' }); 535
536 return true; 536 //Validating the second tab
537 }, 537 secondTab: function(notify) {
538 538 var stylesel = $('#styleSelect').val(), message = '';
539 //Validating the second tab 539 if (stylesel.length < 3) {
540 secondTab: function (notify) { 540 message += 'Je moet een bierstijl kiezen. <br />';
541 var stylesel = $('#styleSelect').val(), 541 }
542 message = ''; 542 if (message !== '') {
543 if (stylesel.length < 3) { 543 if (notify) {
544 message += 'Je moet een bierstijl kiezen. <br />'; 544 this.showHint(message, '#hintStyle');
545 } 545 }
546 if (message !== '') { 546 return false;
547 if (notify) { 547 }
548 this.showHint(message, '#hintStyle'); 548 this.showHint('Ok, je mag doorgaan.', '#hintStyle');
549 } 549 $('#nextButtonStyle').jqxButton({ template: 'success' });
550 return false; 550 return true;
551 } 551 },
552 this.showHint('Ok, je mag doorgaan.', '#hintStyle'); 552
553 $('#nextButtonStyle').jqxButton({ template: 'success' }); 553 //Validating the third tab
554 return true; 554 thirdTab: function(notify) {
555 }, 555 var equipsel = $('#equipmentSelect').val(), message = '';
556 556 if (equipsel.length < 3) {
557 //Validating the third tab 557 message += 'Je moet een brouw installatie kiezen. <br />';
558 thirdTab: function (notify) { 558 }
559 var equipsel = $('#equipmentSelect').val(), 559 if (message !== '') {
560 message = ''; 560 if (notify) {
561 if (equipsel.length < 3) { 561 this.showHint(message, '#hintEq');
562 message += 'Je moet een brouw installatie kiezen. <br />'; 562 }
563 } 563 return false;
564 if (message !== '') { 564 }
565 if (notify) { 565 this.showHint('Ok, je mag doorgaan.', '#hintEq');
566 this.showHint(message, '#hintEq'); 566 $('#nextButtonEq').jqxButton({ template: 'success' });
567 } 567 return true;
568 return false; 568 }
569 } 569 };
570 this.showHint('Ok, je mag doorgaan.', '#hintEq'); 570 } ());
571 $('#nextButtonEq').jqxButton({ template: 'success' }); 571
572 return true; 572 //Initializing the wizard
573 } 573 wizard.init();
574 }
575 } ());
576
577 //Initializing the wizard
578 wizard.init();
579 }); 574 });
580 575

mercurial