www/js/rec_export.js

Sun, 12 May 2019 15:16:35 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 12 May 2019 15:16:35 +0200
changeset 359
98354ef399cd
parent 303
98c2afc88780
child 494
af28ebe4a779
permissions
-rw-r--r--

Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.

/*****************************************************************************
 * Copyright (C) 2019
 *
 * Michiel Broek <mbroek at mbse dot eu>
 *
 * This file is part of BMS
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2, or (at your option) any
 * later version.
 *
 * BrewCloud is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with ThermFerm; see the file COPYING.  If not, write to the Free
 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 *****************************************************************************/


$(document).ready(function () {

	var     choice = 0;

	$("#name").html(my_name);
	$("#jqxRadioButton1").jqxRadioButton({ theme: theme, width: 250, height: 23 });
	$("#jqxRadioButton2").jqxRadioButton({ theme: theme, width: 250, height: 23 });
	$("#jqxRadioButton3").jqxRadioButton({ theme: theme, width: 250, height: 23 });
	$("#jqxRadioButton4").jqxRadioButton({ theme: theme, width: 250, height: 23 });
        $("#jqxRadioButton5").jqxRadioButton({ theme: theme, width: 250, height: 23 });
	$('#jqxRadioButton1').on('checked', function (event) {
		$('#Start').jqxButton({ disabled: false });
		choice = 1;
	});
	$('#jqxRadioButton2').on('checked', function (event) {
		$('#Start').jqxButton({ disabled: false });
		choice = 2;
	});
	$('#jqxRadioButton3').on('checked', function (event) {
		$('#Start').jqxButton({ disabled: false });
		choice = 3;
	});
	$('#jqxRadioButton4').on('checked', function (event) {
                $('#Start').jqxButton({ disabled: false });
                choice = 4;
        });
        $('#jqxRadioButton5').on('checked', function (event) {
                $('#Start').jqxButton({ disabled: false });
                choice = 5;
        });

	$('#Start').jqxButton({ template: "success", width: '100px', theme: theme, disabled: true });
	$('#Start').click(function () {
		if (choice == 1) {
			var url="rec_beerxml.php?record=" + my_record;
			window.open(url);
		} else if (choice == 2) {
			var url="rec_duplicate.php?record=" + my_record;
			window.open(url);
		} else if (choice == 3) {
			var url="rec_toproduct.php?record=" + my_record;
			window.open(url);
		} else if (choice == 4) {
                        var url="rec_print.php?record=" + my_record;
                        window.open(url);
                } else if (choice == 5) {
                        var url="rec_forum.php?record=" + my_record;
                        window.open(url);
                }
		// Return to the original recipe
		window.location.href = "rec_edit.php?record=" + my_record + "&return=" + my_return;
	});
});

mercurial