|
@@ -39,6 +39,28 @@ var messageHandler = (function(my) {
|
39
|
39
|
});
|
40
|
40
|
};
|
41
|
41
|
|
|
42
|
+ /**
|
|
43
|
+ * Shows a message to the user with two buttons: first is given as a parameter and the second is Cancel.
|
|
44
|
+ *
|
|
45
|
+ * @param titleString the title of the message
|
|
46
|
+ * @param msgString the text of the message
|
|
47
|
+ * @param persistent boolean value which determines whether the message is persistent or not
|
|
48
|
+ * @param buttons object with the buttons. The keys must be the name of the button and value is the value
|
|
49
|
+ * that will be passed to submitFunction
|
|
50
|
+ * @param submitFunction function to be called on submit
|
|
51
|
+ * @param loadedFunction function to be called after the prompt is fully loaded
|
|
52
|
+ */
|
|
53
|
+ my.openDialog = function(titleString, msgString, persistent, buttons, submitFunction, loadedFunction) {
|
|
54
|
+ $.prompt(msgString, {
|
|
55
|
+ title: titleString,
|
|
56
|
+ persistent: false,
|
|
57
|
+ buttons: buttons,
|
|
58
|
+ defaultButton: 1,
|
|
59
|
+ loaded: loadedFunction,
|
|
60
|
+ submit: submitFunction
|
|
61
|
+ });
|
|
62
|
+ };
|
|
63
|
+
|
42
|
64
|
/**
|
43
|
65
|
* Shows a dialog with different states to the user.
|
44
|
66
|
*
|