FSN#36132 Alerts en confirm via jQuery dialoog

svn path=/Website/trunk/; revision=31389
This commit is contained in:
Jos Groot Lipman
2016-11-09 09:52:36 +00:00
parent ac98701e83
commit ef80d1b945
3 changed files with 39 additions and 29 deletions

View File

@@ -21,8 +21,7 @@
<!--#include file="bez.inc" -->
<%
FCLTHeader.Requires({plugins:["suggest", "jQuery"],
js: ["date.js" /*, "jquery.alerts.js" */],
xxxxcss: ["../localscripts/jquery.alerts.css"]})
js: ["date.js"]});
// AUTORISATIEPARAMETERS
var afspr_key = getQParamInt("afspr_key");
@@ -73,21 +72,19 @@ var urlMail = "../shared/queuemail.asp?pcode=BEZMAI&defemail_key=" + bez_afspraa
}
function bez_delete()
{
// jConfirm("lcl_bez_confirm_delete_afspraak", "Titel", function () { jAlert("Ok") });
// return;
if (confirm(L("lcl_bez_confirm_delete_afspraak")))
{
var data = { level: "A",
afspr_key: <%=afspr_key%>,
urole: "<%=urole%>"
};
<% protectRequest.dataToken("data"); %>
$.post("bez_delete.asp",
data,
FcltCallbackClose,
"json");
}
FcltMgr.confirm(L("lcl_bez_confirm_delete_afspraak"),
function() {
var data = {
level: "A",
afspr_key: <%=afspr_key%>,
urole: "<%=urole%>"
};
<% protectRequest.dataToken("data"); %>
$.post("bez_delete.asp",
data,
FcltCallbackClose,
"json");
});
}
function bez_mail()
{
@@ -116,14 +113,11 @@ var urlMail = "../shared/queuemail.asp?pcode=BEZMAI&defemail_key=" + bez_afspraa
// Wat voor nut heeft dat (wat is er dan aan de hand?), en pas op dat saven alles weggooit en aanmaakt
var buttons = [];
if (!bez_afspraak.res_rsv_ruimte_key)
{
if (this_bez.canChange)
buttons.push( {title: L("lcl_res_add_deelres"), icon: "resrepeat.png", action:"bez_multi()" },
{title: L("lcl_change"), icon:"wijzigen.png", action:"bez_change()" });
if (this_bez.canDelete)
buttons.push( {title: L("lcl_delete"), icon:"delete.png", action:"bez_delete()" });
}
if (this_bez.canChange)
buttons.push( {title: L("lcl_res_add_deelres"), icon: "resrepeat.png", action:"bez_multi()" },
{title: L("lcl_change"), icon:"wijzigen.png", action:"bez_change()" });
if (this_bez.canDelete)
buttons.push( {title: L("lcl_delete"), icon:"delete.png", action:"bez_delete()" });
buttons.push ({title: L("lcl_print"), icon: "print.png", action:"bez_print()" },
{title: L("lcl_noti_bez_email"), icon: "email.png", action:"bez_mail()" });

View File

@@ -1059,10 +1059,24 @@ var FcltMgr =
},
// TODO: Uitbreiden tot een meer luxe interface die mensen niet onbedoeld kunnen
// disablen
confirm: function (tekst, fncallback)
confirm: function (tekst, params, fncallback)
{
if (confirm(tekst))
if (typeof params == "function")
{ // shift
fncallback = params;
params = {};
}
if (params.autoconfirm)
{
fncallback();
return;
}
jConfirm(tekst, "Titel", function (r) {
if (r)
{
fncallback();
}
});
},
antiConfirm: function (tekst, fncallback)
{

View File

@@ -81,8 +81,10 @@ FCLTHeader =
switch (params.plugins[i])
{
case "jQuery":
FCLTHeader.Requires({js: ["jQuery.js", "FcltJquery.js"]});
FCLTHeader.Requires({js: ["jquery.toast.min.js"], css: [rooturl + "/appl/localscripts/jquery.toast.min.css"]});
FCLTHeader.Requires({js: ["jQuery.js", "FcltJquery.js", "jquery.alerts.js"]});
FCLTHeader.Requires({js: ["jquery.toast.min.js"],
css: [rooturl + "/appl/localscripts/jquery.toast.min.css",
rooturl + "/appl/localscripts/jquery.alerts.css"]});
break;
case "suggest":
FCLTHeader.Requires({js: [rooturl + "/appl/shared/suggest/suggest.js"],