X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ed83bf47fbdc10a7d5572b5ae7fdcc3787474470..049e49fea3e4a3c7c78d7aebf055936b3cab40c5:/js/kivi.io.js diff --git a/js/kivi.io.js b/js/kivi.io.js new file mode 100644 index 000000000..109b20010 --- /dev/null +++ b/js/kivi.io.js @@ -0,0 +1,46 @@ +namespace('kivi.io', function(ns) { + var $dialog; + + ns.price_chooser_dialog = function(title, html) { + var id = 'jqueryui_popup_dialog'; + var dialog_params = { + id: id, + width: 800, + height: 500, + modal: true, + close: function(event, ui) { $dialog.remove(); }, + }; + + $('#' + id).remove(); + + $dialog = $('').appendTo('body'); + $dialog.attr('title', title); + $dialog.html(html); + $dialog.dialog(dialog_params); + + $('.cancel').click(ns.close_dialog); + + return true; + }; + + ns.close_dialog = function() { + $dialog.dialog("close"); + } + + ns.price_chooser = function(i) { + var form = $('form').serializeArray(); + form.push( { name: 'action', value: 'PriceSource/price_popup' } + , { name: 'row', value: i } + ); + + $.post('controller.pl', form, function(data) { + kivi.eval_json_result(data); + }); + } + + ns.update_price_source = function(row, source, price_str) { + $('#active_price_source_' + row).val(source); + if (price_str) $('#sellprice_' + row).val(price_str); + $('#update_button').click(); + } +});