src/ztfy/myams/resources/js/myams-notify.js
changeset 206 02a40997d8cb
parent 142 0201f1422bd7
equal deleted inserted replaced
205:27ed26ca8623 206:02a40997d8cb
    43 				Content,
    43 				Content,
    44 				isIE8 = MyAMS.browser.isIE8orlower();
    44 				isIE8 = MyAMS.browser.isIE8orlower();
    45 			var defaults = {
    45 			var defaults = {
    46 				title: "",
    46 				title: "",
    47 				content: "",
    47 				content: "",
       
    48 				status: "",
    48 				NormalButton: undefined,
    49 				NormalButton: undefined,
    49 				ActiveButton: undefined,
    50 				ActiveButton: undefined,
    50 				buttons: undefined,
    51 				buttons: undefined,
    51 				input: undefined,
    52 				input: undefined,
    52 				placeholder: "",
    53 				placeholder: "",
    81 			var i;
    82 			var i;
    82 			var InputType = "";
    83 			var InputType = "";
    83 			var HasInput = 0;
    84 			var HasInput = 0;
    84 			var Name = "";
    85 			var Name = "";
    85 			var NumButtons = 0;
    86 			var NumButtons = 0;
       
    87 			var btnClass;
    86 			if (settings.input !== undefined) {
    88 			if (settings.input !== undefined) {
    87 				HasInput = 1;
    89 				HasInput = 1;
    88 				settings.input = settings.input.toLowerCase();
    90 				settings.input = settings.input.toLowerCase();
    89 				switch (settings.input) {
    91 				switch (settings.input) {
    90 					case "text":
    92 					case "text":
   120 						if (globals.alert) {
   122 						if (globals.alert) {
   121 							globals.alert("That type of input is not handled yet");
   123 							globals.alert("That type of input is not handled yet");
   122 						}
   124 						}
   123 				}
   125 				}
   124 			}
   126 			}
   125 			Content = "<div class='MessageBoxContainer animated fadeIn fast' id='Msg" + SmartMSGboxCount + "'>";
   127 			Content = "<div class='MessageBoxContainer " + settings.status + " animated fadeIn fast' id='Msg" + SmartMSGboxCount + "'>";
   126 			Content += "<div class='MessageBoxMiddle'>";
   128 			Content += "<div class='MessageBoxMiddle'>";
   127 			Content += "<span class='MsgTitle'>" + settings.title + "</span class='MsgTitle'>";
   129 			Content += "<span class='MsgTitle'>" + settings.title + "</span class='MsgTitle'>";
   128 			Content += "<p class='pText'>" + settings.content + "</p>";
   130 			Content += "<p class='pText'>" + settings.content + "</p>";
   129 			Content += InputType;
   131 			Content += InputType;
   130 			Content += "<div class='MessageBoxButtonSection'>";
   132 			Content += "<div class='MessageBoxButtonSection'>";
   143 				if (settings.buttons[i] === "[") {
   145 				if (settings.buttons[i] === "[") {
   144 					Name = "";
   146 					Name = "";
   145 				} else {
   147 				} else {
   146 					if (settings.buttons[i] === "]") {
   148 					if (settings.buttons[i] === "]") {
   147 						NumButtons = NumButtons + 1;
   149 						NumButtons = NumButtons + 1;
   148 						Name = "<button id='bot" + NumButtons + "-Msg" + SmartMSGboxCount + "' class='btn btn-default btn-sm botTempo'> " + Name + "</button>";
   150 						if (NumButtons === 1) {
       
   151 							btnClass = 'btn-primary';
       
   152 						} else {
       
   153 							btnClass = 'btn-default';
       
   154 						}
       
   155 						Name = "<button id='bot" + NumButtons + "-Msg" + SmartMSGboxCount + "' class='btn " + btnClass + " btn-sm botTempo'> " + Name + "</button>";
   149 						Content += Name;
   156 						Content += Name;
   150 					} else {
   157 					} else {
   151 						Name += settings.buttons[i];
   158 						Name += settings.buttons[i];
   152 					}
   159 					}
   153 				}
   160 				}