Upgrade code to Phraseanet Alerts

This commit is contained in:
Romain Neutron
2012-01-31 11:39:29 +01:00
parent 0a21461ab7
commit d0b1a40584

View File

@@ -439,6 +439,7 @@ function disconnected()
function showModal(cas, options){ function showModal(cas, options){
var content = ''; var content = '';
var callback = null;
var button = { var button = {
"OK": function(e) "OK": function(e)
{ {
@@ -459,45 +460,15 @@ function showModal(cas, options){
case 'disconnected': case 'disconnected':
content = language.serverDisconnected; content = language.serverDisconnected;
escape=false; escape=false;
button = {"OK":function(e){ callback = function(e){ self.location.replace(self.location.href)};
self.location.replace(self.location.href);
}};
onClose = function(){
self.location.replace(self.location.href);
};
break;
case 'prompt':
content = "<input type='text' value='' id='" + options.id + "' />";
escape=false;
button = {
"OK":function(e){
(options.callback)();
hideOverlay(3);
$(this).dialog("close");
},
"Cancel":function(e){
hideOverlay(3);
$(this).dialog("close");
}
};
break; break;
default: default:
break; break;
} }
var buttons = {"OK": function(e){$(this).dialog('close');}}; p4.Alerts(options.title, content, callback);
$('#DIALOG').empty().append(content).attr('title',options.title).dialog({
autoOpen:false,
buttons: button,
closeOnEscape :escape,
resizable:false,
draggable:false,
modal:true,
close:onClose
}).dialog('open').dialog('option','buttons',buttons);
return; return;
} }
function showOverlay(n,appendto,callback, zIndex){ function showOverlay(n,appendto,callback, zIndex){