From 6b33ee47190869a492bcb12819732d9ffae8e6b5 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Mon, 10 Nov 2014 10:52:10 +0100 Subject: [PATCH] fgcommand.js: add wrappers for dialog-[show|close] --- webgui/lib/fgcommand.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/webgui/lib/fgcommand.js b/webgui/lib/fgcommand.js index 368047f88..f665494c4 100644 --- a/webgui/lib/fgcommand.js +++ b/webgui/lib/fgcommand.js @@ -2,6 +2,16 @@ * */ var fgCommand = { + oneArg : function(t1, p1) { + return { + name : '', + children : [ { + name : t1, + index : 0, + value : p1 + } ] + }; + }, twoArgs : function(t1, p1, t2, p2) { return { name : '', @@ -43,6 +53,13 @@ var fgCommand = { pause : function() { $.post("/run.cgi?value=pause"); - } + }, + + dialogShow: function(dlg) { + this.sendCommand("dialog-show", this.oneArg("dialog-name",dlg)); + }, + dialogClose: function(dlg) { + this.sendCommand("dialog-close", this.oneArg("dialog-name",dlg)); + }, };