/* uncleaned */ function showPreparedUploadDialog(id, url) { dijit.byId(id).attr('href', url); dijit.byId(id).show(); } function submitPreparedUploadDialog(id, submitUrl) { callUploadHandler(submitUrl, id + '-form') dijit.byId(id).hide(); } /* 1. Aufruf */ function confirmDialog(id, execUrl, refreshUrl) { dojo.byId(id + '-exec').execute=execUrl; if (refreshUrl != null) { dojo.byId(id + '-exec').refresh=refreshUrl; } dijit.byId(id).show(); } /* 2. Aufruf aus Confirm-Dialog */ function confirmDialogExecute(id, xsd, gridOnly) { getURL(dojo.byId(id + '-exec').execute, true); if (dojo.byId(id + '-exec').refresh != null) { location.href=dojo.byId(id + '-exec').refresh; } if (xsd != null && gridOnly == null) { updateListboxData(xsd); } if (xsd != null && gridOnly != null) { updateGridData(xsd); } dijit.byId(id).hide(); dijit.byId(id + '-ok-button').cancel(); } /* ok */ function infoDialog(title, content) { var infoDialog = new dijit.Dialog({ title: title, content: content, style: "width: 300px" }); infoDialog.show(); } function showDialog(dialogId, url, title, w, h) { if (title != null) dijit.byId(dialogId).attr('title',title); if (w != null) dijit.byId(dialogId).attr('style','width:'+w); if (h != null) dijit.byId(dialogId).attr('style','height:'+h); dijit.byId(dialogId).attr('href',url); /* dijit.byId(dialogId).attr("onDownloadEnd", function(){ dijit.byId(dialogId).show(); }); */ dijit.byId(dialogId).show(); } function closeDialog(dialogId) { dijit.byId(dialogId).hide(); } function confirmDlgURL(title, text, url) { var cDialog = new etag.dijit.ConfirmDialog({ style: "width:30em;height:15em", text: text, title: title, cancelLabel: "Abbruch", execLabel: "OK", execFunc: function() { getURL(url); } }); cDialog.startup(); cDialog.show(); } function confirmDialogUrlReload(title, text, url) { var cDialog = new etag.dijit.ConfirmDialog({ style: "width:30em;height:15em", text: text, title: title, cancelLabel: "Abbruch", execLabel: "OK", execFunc: function() { var def = getURL(url); def.then(function(results){ window.location.reload(); }); } }); cDialog.startup(); cDialog.show(); } function confirmDlg(args) { var base = { style: "width:30em;height:15em", title: "Aktion durchführen", text: "Sind Sie sicher, dass Sie diese Aktion durchführen wollen?", cancelLabel: "Abbruch", execLabel: "OK" }; dojo.mixin(base, args); var cDialog = new etag.dijit.ConfirmDialog(base); cDialog.startup(); cDialog.show(); } function uploadFile(url, formId, dialogId) { /* console.debug('uploadFile: url=' + url); console.debug('uploadFile: formId=' + formId); console.debug('uploadFile: dialogId=' + dialogId); */ callUploadHandler(url, formId); sleep(500); closeDialog(dialogId); } function showProgressStatusDialog(dialogId, url, w, h) { if (w != null) dijit.byId(dialogId).attr('style','width:'+w); if (h != null) dijit.byId(dialogId).attr('style','height:'+h); var status; var oldProgress; var meter; var cnt = 0; status = getURLAsJson(url); dijit.byId(dialogId).attr('title',status.Title); dojo.byId(dialogId + '-label').innerHTML = status.Label; meter = dijit.byId(dialogId + '-meter'); meter.update({maximum: status.ProgressEnd, progress: status.Progress}); dijit.byId(dialogId).show(); oldProgress = status.Progress; var _timer = setInterval(function(){ status = getURLAsJson(url); dijit.byId(dialogId).attr('title',status.Title); dojo.byId(dialogId + '-label').innerHTML = status.Label; meter.update({maximum: status.ProgressEnd, progress: status.Progress}); if (oldProgress == status.Progress && status.Progress == status.ProgressEnd) { cnt++; if (cnt == 3) { clearInterval(_timer); _timer = null; dijit.byId(dialogId).hide(); dijit.byId(dialogId).attr('title',"."); dojo.byId(dialogId + '-label').innerHTML = "."; meter.update({maximum: 100, progress: 0}); } } else { cnt = 0; } oldProgress = status.Progress; }, 1000); } function setProgressStatus(id, title, label, progressEnd, progress) { var url = "/md/util/setProgressStatus(" + id + "," + title + "," + label + "," + progressEnd + "," + progress + ")"; getURL(url); } function contentDlg(args) { var base = { style: 'width:300px;height:150px', title: "Dialog", onCancel: function() {this.destroyRecursive(false);}, cancelLabel: "Abbruch", execLabel: "OK" }; dojo.mixin(base, args); var d = new dijit.Dialog(base); d.startup(); d.show(); }