Sat, 06 Aug 2022 22:02:42 +0200
Final code cleanup in product editor.
www/js/prod_edit.js | file | annotate | diff | comparison | revisions | |
www/prod_edit.php | file | annotate | diff | comparison | revisions |
--- a/www/js/prod_edit.js Sat Aug 06 21:21:21 2022 +0200 +++ b/www/js/prod_edit.js Sat Aug 06 22:02:42 2022 +0200 @@ -21,30 +21,6 @@ *****************************************************************************/ -function createPopupElements() { - - $('#volumeWindow').jqxWindow({ - theme: theme, - position: { x: 380, y: 210 }, - width: 500, - height: 200, - resizable: false, - isModal: true, - modalOpacity: 0.4, - autoOpen: false, - cancelButton: $('#volumeReady') - }); - -} - - - -function drop_endis(flag, item, index) { - (flag) ? $(item).jqxDropDownList('disableAt', index) : $(item).jqxDropDownList('enableAt', index); -} - - - function block_fermentable(stage, added) { if (stage > 5 && added < 4) // After fermentation and added before packaging return true; @@ -55,29 +31,6 @@ return false; } - - -function minimum_fermentable(stage, added) { - if (stage > 5 && added < 4) - return 4; - if (stage > 3 && added < 3) - return 3; - if (stage > 2 && added < 2) - return 2; - return added; -} - - - -function minimum_hop(stage, useat) -{ - if (stage > 2 && useat < 5) - return 5; - return useat; -} - - - function block_hop(stage, useat) { if (stage > 2 && useat < 5) @@ -85,8 +38,6 @@ return false; } - - function block_misc(stage, use_use) { if (stage > 5 && use_use < 5) return true; @@ -99,22 +50,6 @@ return false; } - - -function minimum_misc(stage, use_use) { - if (stage > 5 && use_use < 5) - return 5; - if (stage > 3 && use_use < 4) - return 4; - if (stage > 2 && use_use < 3) - return 3; - if (stage > 1 && use_use < 1) - return 1; - return use_use; -} - - - function block_yeast(stage, use) { if (stage > 3 && use < 1) return true; @@ -128,21 +63,6 @@ } - -function minimum_yeast(stage, use) { - if (stage > 3 && use < 1) - return 1; - if (stage > 4 && use < 2) - return 2; - if (stage > 5 && use < 3) - return 3; - if (stage > 6 && use < 4) - return 4; - return use; -} - - - $(document).ready(function() { var i, @@ -1226,7 +1146,6 @@ var a = last_temp * (dataRecord.eq_tun_weight * dataRecord.eq_tun_specific_heat + step_infused * SpecificHeatWater + step_mashkg * SpecificHeatMalt); var b = step_temp * (dataRecord.eq_tun_weight * dataRecord.eq_tun_specific_heat + step_infused * SpecificHeatWater + step_mashkg * SpecificHeatMalt); var vol = Round(((b - a) / ((infuse_temp - step_temp) * SpecificHeatWater)), 2); - //console.log('infusionVol(' + step_infused + ', ' + step_mashkg + ', ' + infuse_temp + ', ' + step_temp + ', ' + last_temp + '): ' + vol); return vol; } @@ -1236,7 +1155,6 @@ var vol = 0; if (b > 0) vol = Round(a / b, 6); - console.log('decoctionVol(' + step_volume + ', ' + step_temp + ', ' + prev_temp + '): ' + vol); return vol; } @@ -1310,32 +1228,6 @@ $('#ok_supplies').html("<img src='images/dialog-error.png'>"); } - function calcPercentages() { - - console.log('calcPercentages()'); - var tw = 0, rowdata, percentage, rowscount = dataRecord.fermentables.length; - if (rowscount > 1) { - for (i = 0; i < rowscount; i++) { - rowdata = dataRecord.fermentables[i]; - if (rowdata.f_added < 4) - tw += Round(rowdata.f_amount, 3); - } - tw = Round(tw, 3); - - for (i = 0; i < rowscount; i++) { - rowdata = $('#fermentableGrid').jqxGrid('getrowdata', i); - if (rowdata.f_added < 4) { - percentage = Round(rowdata.f_amount / tw * 100, 1); - $('#fermentableGrid').jqxGrid('setcellvalue', i, 'f_percentage', percentage); - } else { - $('#fermentableGrid').jqxGrid('setcellvalue', i, 'f_percentage', 0); - } - } - } else { - $('#fermentableGrid').jqxGrid('setcellvalue', 0, 'f_percentage', 100); - } - } - /* * All calculations that depend on changes in the fermentables, * volumes and equipments. @@ -3412,7 +3304,5 @@ $('#Terug').bind('click', function() { window.location.href = my_return; }); - - createPopupElements(); });
--- a/www/prod_edit.php Sat Aug 06 21:21:21 2022 +0200 +++ b/www/prod_edit.php Sat Aug 06 22:02:42 2022 +0200 @@ -926,29 +926,6 @@ </div> <!-- Tabs --> - <div id="volumeWindow"> - <div>Bereken volume in de ketel</div> - <div style="overflow: hidden;"> - <table style="width: 100%;"> - <col width="50%"> - <col width="50%"> - <tr> - <td align="right" style="vertical-align: top;">Ketel volume:</td> - <td style="padding: 3px;"><input readonly="1" id="ketel_volume" /></td> - </tr> - <tr> - <td align="right" style="vertical-align: top;">cm vanaf de bovenrand:</td> - <td style="padding: 3px;"><div id="ketel_cm" /></div></td> - </tr> - <tr> - <td style="padding-top: 30px;" colspan="2" align="center"> - <input id="volumeReady" type="button" value="Ok" /> - </td> - </tr> - </table> - </div> - </div> - <?php page_footer(); ?>