diff --git a/website/agenda/planung/css/default.css b/website/agenda/planung/css/default.css index fd77ca0..62b838f 100644 --- a/website/agenda/planung/css/default.css +++ b/website/agenda/planung/css/default.css @@ -673,3 +673,20 @@ ul.tabContainer li:last-child{ border-top-right-radius:0.5rem; } +#content #dialog{ + position:absolute; + z-index:1000; + left: 0; + right: 0; + top: 0; + bottom: 0; + margin-left: auto; + margin-right: auto; + margin-top: auto; + margin-bottom: auto; + width: 15rem; + height: 4rem; + text-align:center; + vertical-align:middle; + display:inline; +} diff --git a/website/agenda/planung/js/calendar.js b/website/agenda/planung/js/calendar.js index 1114193..c5a5ed1 100644 --- a/website/agenda/planung/js/calendar.js +++ b/website/agenda/planung/js/calendar.js @@ -337,50 +337,39 @@ function showMouse(){ function checkStudio(){ if($('#studio_id').val()=='-1'){ - $("#no_studio_selected").dialog({ - modal: true, - title: "please select a studio", - }); + showDialog({ title: "please select a studio" }); return 0; } return 1; } function show_not_assigned_to_series_dialog(){ - $("#event_no_series").dialog({ - resizable: false, - width:800, - height:340, - modal: true, - title: loc['label_event_not_assigned_to_series'], - buttons: { - Cancel: function() { - $( this ).dialog( "close" ); - } + showDialog({ + title : loc['label_event_not_assigned_to_series'], + buttons : { + Cancel : function() { $(this).parent().remove(); } } }); } function show_schedule_series_dialog(project_id, studio_id, series_id, start_date){ - $("#series").dialog({ - resizable: false, - width:800, - height:340, - modal: true, - title: loc['label_schedule_series'], - buttons: { + showDialog({ + title : loc['label_schedule_series'], + content : $('#series').html(), + width : "50rem", + height : "15rem", + buttons : { "Schedule": function() { - var series_id=$('#series_select').val(); - var duration=$('#series_duration').val(); - var start_date=$('#series_date').val(); + var series_id = $('#dialog #series_select').val(); + var duration = $('#dialog #series_duration').val(); + var start_date = $('#dialog #series_date').val(); var url='series.cgi?project_id='+project_id+'&studio_id='+studio_id+'&series_id='+series_id+'&start='+escape(start_date)+'&duration='+duration+'&show_hint_to_add_schedule=1#tabs-schedule'; load(url); }, - "Cancel" : function() { - $( this ).dialog( "close" ); - } + Cancel : function() { $(this).parent().remove(); } } }); + showDateTimePicker('#dialog #series_date'); } function setDatePicker(){ @@ -485,12 +474,10 @@ function createId(prefix) { function showRmsPlot(id, project_id, studio_id, start){ console.log(id+" "+project_id+" "+studio_id+" "+start) - $('#'+id).dialog({ + showDialog({ width:940, height:560, - open: function () { - $(this).scrollTop(0); - } + onOpen: function () { $(this).scrollTop(0); } }); return false; } diff --git a/website/agenda/planung/js/default.js b/website/agenda/planung/js/default.js index 219d135..194140e 100644 --- a/website/agenda/planung/js/default.js +++ b/website/agenda/planung/js/default.js @@ -122,35 +122,42 @@ function setTextWidth(select, minValue){ // trigger action on commit function commitAction (title, action){ - if (action==null) {alert("missing action");return} - if (title==null) {alert("missing title");return} + if ( title == null ) { alert("missing title");return; } + if ( action == null ) { alert("missing action");return; } - if ($("#dialog-confirm").length>0) $("#dialog-confirm").remove(); - $("#content").append( - '
' - +'' - +'Are you sure?' - +'
' - +'