2 /*******************************************************************************
3 * Copyright (c) 2012-2013 University of Stuttgart.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * and the Apache License 2.0 which both accompany this distribution,
7 * and are available at http://www.eclipse.org/legal/epl-v10.html
8 * and http://www.apache.org/licenses/LICENSE-2.0
11 * Oliver Kopp - initial API and implementation and/or initial documentation
12 * Yves Schubert - switch to bootstrap 3
13 *******************************************************************************/
15 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
19 * Displays a nice message box with "yes" and "no"
21 * TODO: currently cannot be recursively called
23 * @param msg Message to display
24 * @param fnOnYes function to be called if user presses "yes"
25 * @param title (optional) title of the dialog
27 function vConfirmYesNo(msg, fnOnYes, title) {
28 title = title || "Please confirm";
29 $("#diagyesnotitle").text(title);
30 $("#diagyesnomsg").text(msg);
31 $("#diagyesnoyesbtn").off("click");
32 $("#diagyesnoyesbtn").on("click", function() {
33 var diag = $("#diagyesno");
34 // quick hack to get fnOnYes() working -> use the hidden.bs.modal event
35 diag.on("hidden.bs.modal", function() {
37 diag.off("hidden.bs.modal");
41 $("#diagyesno").modal("show");
45 $("#diagyesno").on("shown.bs.modal", function() {
46 $("#diagyesnoyesbtn").focus();
51 <div class="modal fade z1051" id="diagyesno">
52 <div class="modal-dialog">
53 <div class="modal-content">
54 <div class="modal-header">
55 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
56 <h4 class="modal-title" id="diagyesnotitle"></h4>
58 <div class="modal-body">
59 <p id="diagyesnomsg"></p>
61 <div class="modal-footer">
62 <button type="button" class="btn btn-default" data-dismiss="modal">No</button>
63 <button id="diagyesnoyesbtn" type="button" class="btn btn-primary">Yes</button>
69 <div class="modal fade z1060" id="diagmessage">
70 <div class="modal-dialog">
71 <div class="modal-content">
72 <div class="modal-header">
73 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
74 <h4 class="modal-title" id="diagmessagetitle"></h4>
76 <div class="modal-body" id="diagmessagemsg">
78 <div class="modal-footer">
79 <button type="button" class="btn btn-primary" data-dismiss="modal">OK</button>