54 var dataReecord = {}; |
54 var dataReecord = {}; |
55 var url = "includes/db_recipes.php"; |
55 var url = "includes/db_recipes.php"; |
56 // tooltips |
56 // tooltips |
57 $("#name").jqxTooltip({ content: 'De naam voor dit recept.' }); |
57 $("#name").jqxTooltip({ content: 'De naam voor dit recept.' }); |
58 $("#notes").jqxTooltip({ content: 'De uitgebreide opmerkingen over dit recept.' }); |
58 $("#notes").jqxTooltip({ content: 'De uitgebreide opmerkingen over dit recept.' }); |
|
59 $("#type").jqxTooltip({ content: 'Het brouw type van dit recept.' }); |
|
60 $("#est_og").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); |
|
61 $("#est_fg").jqxTooltip({ content: 'Het eind SG. Dit wordt automatisch berekend.' }); |
|
62 $("#est_color").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); |
|
63 $("#est_ibu").jqxTooltip({ content: 'De bitterheid in IBU. Dit wordt automatisch berekend.' }); |
|
64 $("#est_abv").jqxTooltip({ content: 'Alcohol volume %. Dit wordt automatisch berekend.' }); |
|
65 $("#est_carb").jqxTooltip({ content: 'Koolzuur volume. Dit wordt automatisch berekend.' }); |
|
66 |
59 $("#st_name").jqxTooltip({ content: 'De bierstijl naam voor dit recept.'}); |
67 $("#st_name").jqxTooltip({ content: 'De bierstijl naam voor dit recept.'}); |
60 $("#type").jqxTooltip({ content: 'Het brouw type van dit recept.' }); |
68 $("#st_letter").jqxTooltip({ content: 'De bierstijl letter voor dit recept.'}); |
|
69 $("#st_guide").jqxTooltip({ content: 'De bierstijl gids voor dit recept.'}); |
|
70 $("#st_category").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie.'}); |
|
71 $("#st_category_number").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie sub nummer.'}); |
|
72 $("#st_type").jqxTooltip({ content: 'Het bierstijl type.'}); |
|
73 $("#st_og_min").jqxTooltip({ content: 'Het minimum begin SG voor deze bierstijl.'}); |
|
74 $("#st_og_max").jqxTooltip({ content: 'Het maximum begin SG voor deze bierstijl.'}); |
|
75 $("#st_fg_min").jqxTooltip({ content: 'Het minimum eind SG voor deze bierstijl.'}); |
|
76 $("#st_fg_max").jqxTooltip({ content: 'Het maximum eind SG voor deze bierstijl.'}); |
|
77 $("#st_color_min").jqxTooltip({ content: 'De minimum kleur voor deze bierstijl.'}); |
|
78 $("#st_color_max").jqxTooltip({ content: 'De maximum kleur voor deze bierstijl.'}); |
|
79 $("#st_ibu_min").jqxTooltip({ content: 'De minimum bitterheid voor deze bierstijl.'}); |
|
80 $("#st_ibu_max").jqxTooltip({ content: 'De maximum bitterheid voor deze bierstijl.'}); |
|
81 $("#st_abv_min").jqxTooltip({ content: 'Het minimum alcohol volume % voor deze bierstijl.'}); |
|
82 $("#st_abv_max").jqxTooltip({ content: 'Het maximum alcohol volume % voor deze bierstijl.'}); |
|
83 $("#st_carb_min").jqxTooltip({ content: 'Het minimum koolzuur volume voor deze bierstijl.'}); |
|
84 $("#st_carb_max").jqxTooltip({ content: 'Het maximum koolzuur volume voor deze bierstijl.'}); |
|
85 |
61 // prepare the data |
86 // prepare the data |
62 var source = { |
87 var source = { |
63 datatype: "json", |
88 datatype: "json", |
64 cache: false, |
89 cache: false, |
65 datafields: [ |
90 datafields: [ |
66 { name: 'record', type: 'number' }, |
91 { name: 'record', type: 'number' }, |
67 { name: 'st_name', type: 'string' }, |
92 { name: 'st_name', type: 'string' }, |
68 { name: 'st_letter', type: 'string' }, |
93 { name: 'st_letter', type: 'string' }, |
69 { name: 'st_guide', type: 'string' }, |
94 { name: 'st_guide', type: 'string' }, |
|
95 { name: 'st_type', type: 'string' }, |
|
96 { name: 'st_category', type: 'string' }, |
|
97 { name: 'st_category_number', type: 'float' }, |
70 { name: 'st_og_min', type: 'float' }, |
98 { name: 'st_og_min', type: 'float' }, |
71 { name: 'st_og_max', type: 'float' }, |
99 { name: 'st_og_max', type: 'float' }, |
72 { name: 'st_fg_min', type: 'float' }, |
100 { name: 'st_fg_min', type: 'float' }, |
73 { name: 'st_fg_max', type: 'float' }, |
101 { name: 'st_fg_max', type: 'float' }, |
74 { name: 'st_ibu_min', type: 'float' }, |
102 { name: 'st_ibu_min', type: 'float' }, |
85 { name: 'batch_size', type: 'float' }, |
113 { name: 'batch_size', type: 'float' }, |
86 { name: 'boil_time', type: 'float' }, |
114 { name: 'boil_time', type: 'float' }, |
87 { name: 'efficiency', type: 'float' }, |
115 { name: 'efficiency', type: 'float' }, |
88 { name: 'est_og', type: 'float' }, |
116 { name: 'est_og', type: 'float' }, |
89 { name: 'est_fg', type: 'float' }, |
117 { name: 'est_fg', type: 'float' }, |
|
118 { name: 'est_abv', type: 'float' }, |
90 { name: 'est_color', type: 'float' }, |
119 { name: 'est_color', type: 'float' }, |
91 { name: 'color_method', type: 'string' }, |
120 { name: 'color_method', type: 'string' }, |
92 { name: 'est_ibu', type: 'float' }, |
121 { name: 'est_ibu', type: 'float' }, |
93 { name: 'ibu_method', type: 'string' }, |
122 { name: 'ibu_method', type: 'string' }, |
|
123 { name: 'est_carb', type: 'float' }, |
94 { name: 'mash_sparge_temp', type: 'float' }, |
124 { name: 'mash_sparge_temp', type: 'float' }, |
95 { name: 'mash_ph', type: 'float' }, |
125 { name: 'mash_ph', type: 'float' }, |
96 { name: 'mash_name', type: 'string' }, |
126 { name: 'mash_name', type: 'string' }, |
97 { name: 'fermentables', type: 'string' }, |
127 { name: 'fermentables', type: 'string' }, |
98 { name: 'hops', type: 'string' }, |
128 { name: 'hops', type: 'string' }, |
112 $("#name").val(dataRecord.name); |
142 $("#name").val(dataRecord.name); |
113 $("#notes").val(dataRecord.notes); |
143 $("#notes").val(dataRecord.notes); |
114 $("#st_name").val(dataRecord.st_name); |
144 $("#st_name").val(dataRecord.st_name); |
115 $("#st_letter").val(dataRecord.st_letter); |
145 $("#st_letter").val(dataRecord.st_letter); |
116 $("#st_guide").val(dataRecord.st_guide); |
146 $("#st_guide").val(dataRecord.st_guide); |
|
147 $("#st_category").val(dataRecord.st_category); |
|
148 $("#st_category_number").val(dataRecord.st_category_number); |
|
149 $("#st_type").val(dataRecord.st_type); |
117 $("#type").val(dataRecord.type); |
150 $("#type").val(dataRecord.type); |
118 $("#batch_size").val(dataRecord.batch_size); |
151 $("#batch_size").val(dataRecord.batch_size); |
119 $("#boil_time").val(dataRecord.boil_time); |
152 $("#boil_time").val(dataRecord.boil_time); |
120 $("#efficiency").val(dataRecord.efficiency); |
153 $("#efficiency").val(dataRecord.efficiency); |
121 $("#est_og").val(dataRecord.est_og); |
154 $("#est_og").val(dataRecord.est_og); |
122 $("#st_og_min").val(dataRecord.st_og_min); |
155 $("#st_og_min").val(dataRecord.st_og_min); |
123 $("#st_og_max").val(dataRecord.st_og_max); |
156 $("#st_og_max").val(dataRecord.st_og_max); |
124 $("#est_fg").val(dataRecord.est_fg); |
157 $("#est_fg").val(dataRecord.est_fg); |
|
158 $("#st_fg_min").val(dataRecord.st_fg_min); |
|
159 $("#st_fg_max").val(dataRecord.st_fg_max); |
125 $("#est_color").val(dataRecord.est_color); |
160 $("#est_color").val(dataRecord.est_color); |
|
161 $("#est_abv").val(dataRecord.est_abv); |
|
162 $("#st_abv_min").val(dataRecord.st_abv_min); |
|
163 $("#st_abv_max").val(dataRecord.st_abv_max); |
|
164 $("#st_color_min").val(dataRecord.st_color_min); |
|
165 $("#st_color_max").val(dataRecord.st_color_max); |
126 $("#color_method").val(dataRecord.color_method); |
166 $("#color_method").val(dataRecord.color_method); |
127 $("#est_ibu").val(dataRecord.est_ibu); |
167 $("#est_ibu").val(dataRecord.est_ibu); |
|
168 $("#st_ibu_min").val(dataRecord.st_ibu_min); |
|
169 $("#st_ibu_max").val(dataRecord.st_ibu_max); |
128 $("#ibu_method").val(dataRecord.ibu_method); |
170 $("#ibu_method").val(dataRecord.ibu_method); |
|
171 $("#est_carb").val(dataRecord.est_carb); |
|
172 $("#st_carb_min").val(dataRecord.st_carb_min); |
|
173 $("#st_carb_max").val(dataRecord.st_carb_max); |
129 $("#mash_name").val(dataRecord.mash_name); |
174 $("#mash_name").val(dataRecord.mash_name); |
130 $("#mash_ph").val(dataRecord.mash_ph); |
175 $("#mash_ph").val(dataRecord.mash_ph); |
131 $("#mash_sparge_temp").val(dataRecord.mash_sparge_temp); |
176 $("#mash_sparge_temp").val(dataRecord.mash_sparge_temp); |
132 editFermentable(dataRecord); |
177 editFermentable(dataRecord); |
133 editHop(dataRecord); |
178 editHop(dataRecord); |
1034 $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
1079 $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
1035 $("#notes").jqxInput({ theme: theme, width: 960, height: 200 }); |
1080 $("#notes").jqxInput({ theme: theme, width: 960, height: 200 }); |
1036 $("#st_name").jqxInput({ theme: theme, width: 250, height: 23 }); |
1081 $("#st_name").jqxInput({ theme: theme, width: 250, height: 23 }); |
1037 $("#st_letter").jqxInput({ theme: theme, width: 100, height: 23 }); |
1082 $("#st_letter").jqxInput({ theme: theme, width: 100, height: 23 }); |
1038 $("#st_guide").jqxInput({ theme: theme, width: 250, height: 23 }); |
1083 $("#st_guide").jqxInput({ theme: theme, width: 250, height: 23 }); |
|
1084 $("#st_category").jqxInput({ theme: theme, width: 250, height: 23 }); |
|
1085 $("#st_category_number").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
1086 $("#st_type").jqxInput({ theme: theme, width: 90, height: 23 }); |
1039 $("#type").jqxDropDownList({ theme: theme, source: srcType, width: 125, height: 23, dropDownHeight: 95 }); |
1087 $("#type").jqxDropDownList({ theme: theme, source: srcType, width: 125, height: 23, dropDownHeight: 95 }); |
1040 $("#batch_size").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: 'L', symbolPosition: 'right' }); |
1088 $("#batch_size").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: 'L', symbolPosition: 'right' }); |
1041 $("#boil_time").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', template: "success", theme: theme, width: 100, height: 23, min: 4, max: 360, decimalDigits: 0, spinButtons: true }); |
1089 $("#boil_time").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, max: 360, decimalDigits: 0, spinButtons: true }); |
1042 $("#efficiency").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 40, max: 100, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' }); |
1090 $("#efficiency").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 40, max: 100, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' }); |
|
1091 |
1043 $("#est_og").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 1, max: 1.9, decimalDigits: 3, spinButtons: true, spinButtonsStep: 0.001 }); |
1092 $("#est_og").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 1, max: 1.9, decimalDigits: 3, spinButtons: true, spinButtonsStep: 0.001 }); |
1044 $("#st_og_min").jqxNumberInput({ disabled: true, inputMode: 'simple', width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
1093 $("#st_og_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
1045 $("#st_og_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
1094 $("#st_og_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
1046 $("#est_fg").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, min: 0.980, max: 1.040, decimalDigits: 3, readOnly: true }); |
1095 |
1047 $("#est_color").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 1, max: 200, decimalDigits: 0, spinButtons: true }); |
1096 $("#est_fg").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 3, readOnly: true }); |
|
1097 $("#st_fg_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
|
1098 $("#st_fg_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
|
1099 |
|
1100 $("#est_abv").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
1101 $("#st_abv_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
1102 $("#st_abv_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
1103 |
|
1104 $("#est_color").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
1105 $("#st_color_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
1106 $("#st_color_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
1048 $("#color_method").jqxDropDownList({ theme: theme, source: srcColor, width: 125, height: 23, dropDownHeight: 95 }); |
1107 $("#color_method").jqxDropDownList({ theme: theme, source: srcColor, width: 125, height: 23, dropDownHeight: 95 }); |
1049 $("#est_ibu").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 200, decimalDigits: 0, spinButtons: true }); |
1108 |
|
1109 $("#est_ibu").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
1110 $("#st_ibu_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
1111 $("#st_ibu_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
1050 $("#ibu_method").jqxDropDownList({ theme: theme, source: srcIBU, width: 125, height: 23, dropDownHeight: 180 }); |
1112 $("#ibu_method").jqxDropDownList({ theme: theme, source: srcIBU, width: 125, height: 23, dropDownHeight: 180 }); |
|
1113 |
|
1114 $("#est_carb").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
1115 $("#st_carb_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
1116 $("#st_carb_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
1117 |
1051 $("#mash_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
1118 $("#mash_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
1052 $("#mash_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, max: 8, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
1119 $("#mash_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, max: 8, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
1053 $("#mash_sparge_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 70, max: 98, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
1120 $("#mash_sparge_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 70, max: 98, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
1054 |
1121 |
1055 // Tabs inside the popup window. |
1122 // Tabs inside the popup window. |
1119 batch_size: parseFloat($("#batch_size").jqxNumberInput('decimal')), |
1189 batch_size: parseFloat($("#batch_size").jqxNumberInput('decimal')), |
1120 boil_time: parseFloat($("#boil_time").jqxNumberInput('decimal')), |
1190 boil_time: parseFloat($("#boil_time").jqxNumberInput('decimal')), |
1121 efficiency: parseFloat($("#efficiency").jqxNumberInput('decimal')), |
1191 efficiency: parseFloat($("#efficiency").jqxNumberInput('decimal')), |
1122 est_og: parseFloat($("#est_og").jqxNumberInput('decimal')), |
1192 est_og: parseFloat($("#est_og").jqxNumberInput('decimal')), |
1123 est_fg: parseFloat($("#est_fg").jqxNumberInput('decimal')), |
1193 est_fg: parseFloat($("#est_fg").jqxNumberInput('decimal')), |
|
1194 est_abv: parseFloat($("#est_abv").jqxNumberInput('decimal')), |
1124 est_color: parseFloat($("#est_color").jqxNumberInput('decimal')), |
1195 est_color: parseFloat($("#est_color").jqxNumberInput('decimal')), |
1125 color_method: $("#color_method").val(), |
1196 color_method: $("#color_method").val(), |
1126 est_ibu: parseFloat($("#est_ibu").jqxNumberInput('decimal')), |
1197 est_ibu: parseFloat($("#est_ibu").jqxNumberInput('decimal')), |
1127 ibu_method: $("#ibu_method").val(), |
1198 ibu_method: $("#ibu_method").val(), |
|
1199 est_carb: parseFloat($("#est_carb").jqxNumberInput('decimal')), |
1128 mash_name: $("#mash_name").val(), |
1200 mash_name: $("#mash_name").val(), |
1129 mash_ph: parseFloat($("#mash_ph").jqxNumberInput('decimal')), |
1201 mash_ph: parseFloat($("#mash_ph").jqxNumberInput('decimal')), |
1130 mash_sparge_temp: parseFloat($("#mash_sparge_temp").jqxNumberInput('decimal')), |
1202 mash_sparge_temp: parseFloat($("#mash_sparge_temp").jqxNumberInput('decimal')), |
1131 fermentables: fermentablerow, |
1203 fermentables: fermentablerow, |
1132 hops: hoprow, |
1204 hops: hoprow, |