www/js/profile_setup.js

Sun, 24 Feb 2019 17:23:52 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 24 Feb 2019 17:23:52 +0100
changeset 286
124af734af68
parent 270
cf4b4b63eb36
child 289
4082c41f45e9
permissions
-rw-r--r--

Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.

99
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
218
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
2 * Copyright (C) 2019
99
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of BMS
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * BrewCloud is distributed in the hope that it will be useful, but
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 $(document).ready(function () {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 var dataRecord = {};
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 // dropdownlist datasource from inventory_waters, must load sync
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 var waterUrl = "getwatersources.php";
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 var waterInvSource = {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 datatype: "json",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 datafields: [
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 { name: 'name', type: 'string' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 ],
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 url: waterUrl,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36 async: false
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 };
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 var waterlist = new $.jqx.dataAdapter(waterInvSource);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 var url = "includes/db_setup.php";
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 // Tooltips
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43 $("#brewery_name").jqxTooltip({ content: 'De naam voor deze brouwerij.' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44 $("#factor_mashhop").jqxTooltip({ content: 'Het efficientie percentage voor hop tijdens de maisch.' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 $("#factor_fwh").jqxTooltip({ content: 'Het efficientie percentage voor First Wort Hop.' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 $("#factor_pellet").jqxTooltip({ content: 'Het efficientie percentage bij gebruik van hop pellets.' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 $("#factor_plug").jqxTooltip({ content: 'Het efficientie percentage bij gebruik van hop plugs.' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 $("#brix_correction").jqxTooltip({ content: 'Omzettingsfactor voor Plato naar Brix' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49 $("#grain_absorbtion").jqxTooltip({ content: 'Absorbtie van water door graan (L/Kg)' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 // Prepare the data
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 var source = {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 datatype: "json",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 cache: false,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 datafields: [
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 { name: 'brewery_name', type: 'string' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 /* { name: 'brewery_logo', type: 'array' }, */
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 { name: 'factor_mashhop', type: 'number' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 { name: 'factor_fwh', type: 'number' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 { name: 'factor_pellet', type: 'number' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 { name: 'factor_plug', type: 'number' },
218
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
62 { name: 'ibu_method', type: 'int' },
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
63 { name: 'color_method', type: 'int' },
99
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 { name: 'brix_correction', type: 'float' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 { name: 'grain_absorbtion', type: 'float' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 { name: 'default_water', type: 'string' }
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 ],
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 url: url
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 };
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 // Load data and select one record.
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 var dataAdapter = new $.jqx.dataAdapter(source, {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 loadComplete: function () {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 var records = dataAdapter.records;
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 dataRecord = records[0];
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 $("#brewery_name").val(dataRecord.brewery_name);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 $("#factor_mashhop").val(dataRecord.factor_mashhop);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 $("#factor_fwh").val(dataRecord.factor_fwh);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 $("#factor_pellet").val(dataRecord.factor_pellet);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 $("#factor_plug").val(dataRecord.factor_plug);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 $("#color_method").val(dataRecord.color_method);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 $("#ibu_method").val(dataRecord.ibu_method);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 $("#brix_correction").val(dataRecord.brix_correction);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 $("#grain_absorbtion").val(dataRecord.grain_absorbtion);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 loadError: function (jqXHR, status, error) {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 dataAdapter.dataBind();
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 // Editers
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 $("#brewery_name").jqxInput({ theme: theme, width: 640, height: 23 });
270
cf4b4b63eb36 Code cleanup
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
93 $("#factor_fwh").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: -50, max: 50, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' });
cf4b4b63eb36 Code cleanup
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
94 $("#factor_mashhop").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: -50, max: 50, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' });
cf4b4b63eb36 Code cleanup
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
95 $("#factor_pellet").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 20, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' });
cf4b4b63eb36 Code cleanup
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
96 $("#factor_plug").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 20, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' });
cf4b4b63eb36 Code cleanup
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
97 $("#brix_correction").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1.00, max: 1.05, decimalDigits: 2, spinButtons: true });
cf4b4b63eb36 Code cleanup
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
98 $("#grain_absorbtion").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0.5, max: 1.1, decimalDigits: 2, spinButtons: true });
218
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
99 $("#color_method").jqxDropDownList({
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
100 theme: theme,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
101 source: ColorMethodAdapter,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
102 valueMember: 'id',
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
103 displayMember: 'nl',
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
104 width: 180,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
105 autoDropDownHeight: true
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
106 });
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
107 $("#ibu_method").jqxDropDownList({
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
108 theme: theme,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
109 source: IBUmethodAdapter,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
110 valueMember: 'id',
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
111 displayMember: 'nl',
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
112 width: 180,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
113 autoDropDownHeight: true
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
114 });
99
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 $('#default_water').jqxDropDownList({
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 placeHolder: "Kies water:",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 theme: theme,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 source: waterlist,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 valueMember: "name",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 displayMember: "name",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 width: 250,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 dropDownHorizontalAlignment: 'right',
218
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
123 dropDownWidth: 300,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
124 autoDropDownHeight: true
99
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 $('#default_water').jqxDropDownList( 'selectItem', dataRecord.default_water );
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 $("#Save").jqxButton({ template: "success", width: '90px', theme: theme });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 $("#Save").click(function () {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 var row = {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 record: 1,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 brewery_name: $("#brewery_name").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 factor_mashhop: $("#factor_mashhop").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134 factor_fwh: $("#factor_fwh").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 factor_pellet: $("#factor_pellet").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 factor_plug: $("#factor_plug").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 color_method: $("#color_method").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 ibu_method: $("#ibu_method").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 brix_correction: parseFloat($("#brix_correction").jqxNumberInput('decimal')),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140 grain_absorbtion: parseFloat($("#grain_absorbtion").jqxNumberInput('decimal')),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141 default_water: $("#default_water").val()
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
142 };
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
143 var data = "update=true&" + $.param(row);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
144 $.ajax({
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 dataType: 'json',
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 url: url,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147 cache: false,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 data: data,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149 type: "POST",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150 success: function (data, status, xhr) {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 // update command is executed.
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152 //window.location.href = my_return;
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 error: function(jqXHR, textStatus, errorThrown) {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 }
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157 });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 });

mercurial