function ShowNotification(type, message) {
var n = noty({
text: message,
type: type,
dismissQueue: false,
modal: true,
layout: 'top',
theme: 'defaultTheme'
});
//console.log('html: ' + n.options.id);
}
function ShowNotificationAndClose(type, message) {
var n = noty({
text: message,
type: type,
dismissQueue: false,
modal: true,
layout: 'top',
theme: 'defaultTheme',
callback: {
onShow: function () { },
afterShow: function () { },
onClose: function () { },
afterClose: function () {
if (GetParam("IsDlg") == "1")
{ window.frameElement.commitPopup();
}
else {
var source = GetParam("Source");
if (source == null || source == "null" || source == "")
window.location.href = window.location.protocol + "//" + window.location.host + _spPageContextInfo.siteServerRelativeUrl;
else
{
window.location.href = decodeURIComponent(source);
}
}
}
}
});
//console.log('html: ' + n.options.id);
}
function ShowNotificationWithRedirection1(type, message, source) {
//$('#position-top-full-success').on('click',function(){
var $toast=toastr.success('
I do not think that word means what you think it means.', 'Top Full Width!', {positionClass: 'toast-top-full-width', containerId: 'toast-top-full-width'});
//toastr.options = { onclick: function () { alert("You clicked Me!"); } }//Command: toastr["success"]("Clear itself?
")
//var $toast = toastr[shortCutFunction](msg, title); // Wire up an event handler to a button in the toast, if it exists
if ($toast.find('#okBtn').length) {
$toast.delegate('#okBtn', 'click', function () {
alert('you clicked me. i was toast #' + 1 + '. goodbye!');
$toast.remove();
window.parent.closeModal();
});
}
//
//});
}
function ShowNotificationWithRedirection(type, message, source) {
var n = noty({
text: message,
type: type,
dismissQueue: false,
modal: true,
layout: 'top',
theme: 'defaultTheme',
callback: {
onShow: function () { },
afterShow: function () { },
onClose: function () { },
afterClose: function () {
if (source == null || source == "null" || source == "")
window.location.href = window.location.protocol + "//" + window.location.host + _spPageContextInfo.siteServerRelativeUrl;
else
{
window.location.href = decodeURIComponent(source);
}
}
}
});
//console.log('html: ' + n.options.id);
}
function GetParam(name) {
return decodeURI((RegExp(name + '=' + '(.+?)(&|$)', 'i').exec(location.search) || [, null])[1]);
}
function CustomConfirmSimple(message, uniqueID){
var lcid =_spPageContextInfo.currentLanguage;
if(lcid==1033) //English
ShowConfirmationsEn(message, uniqueID);
else
ShowConfirmationsAr(message, uniqueID);
return false;
}
function CustomConfirm(message, uniqueID, validationGroup){
validationGroup=validationGroup||'';
if(Page_ClientValidate(validationGroup)==false)
return false;
var lcid =_spPageContextInfo.currentLanguage;
if(lcid==1033) //English
ShowConfirmationsEn(message, uniqueID);
else
ShowConfirmationsAr(message, uniqueID);
return false;
}
function ShowConfirmationsEn(message, uniqueID) {
var n = noty({
text: message,
type: 'alert',
dismissQueue: true,
modal: true,
layout: 'center',
theme: 'defaultTheme',
buttons: [
{addClass: 'btn btn-primary', text: 'Ok', onClick: function($noty) {
$noty.close();
__doPostBack(uniqueID, '');
}
},
{addClass: 'btn btn-danger', text: 'Cancel', onClick: function($noty) {
$noty.close();
}
}
]
});
}
function ShowConfirmationsAr(message, uniqueID) {
var n = noty({
text: message,
type: 'alert',
dismissQueue: true,
modal: true,
layout: 'center',
theme: 'defaultTheme',
buttons: [
{addClass: 'btn btn-primary', text: 'تاكيد', onClick: function($noty) {
$noty.close();
__doPostBack(uniqueID, '');
}
},
{addClass: 'btn btn-danger', text: 'الغاء', onClick: function($noty) {
$noty.close();
}
}
]
});
}