// OpenCsXtraDialog() // Url = http adresse // Tilte = Title til boksen (optional, blank) // Width = Brede i PX (optional, 0) // Height = Højde i PX (optional, 0) function OpenCsXtraDialog(Url, Title, Width, Height) { if (Width == 0) {Width = 505} if (Height == 0) {Height = 465} $("#dialog_iframe").width(Width); $("#dialog_iframe").height(Height); $("#dialog_iframe").attr("src",Url); $("#dialog").dialog({ title: Title, width: Width + 15, show: 'fade', hide: 'fade', resizable: false, draggable: false, modal: true, shadow: true, open: function(event, ui){ $('body').css('overflow','hidden'); $('.ui-widget-overlay').css('width','100%'); $('.ui-widget-overlay').dblclick(function(e) { $('#dialog').dialog('close'); $("#dialog_iframe").attr("src","loader.asp"); }); }, close: function(event, ui){ $('body').css('overflow','auto'); $("#dialog_iframe").attr("src","loader.asp"); } }); } // OpenCsXtraDialogFullScreen() // Url = http adresse // Tilte = Title til boksen (optional, blank) // Modal = true | false function OpenCsXtraDialogFullScreen(Url, Title, Modal) { //$.mobile.metaViewportContent = "width=device-width"; $("#dialogFullScreen_iframe").attr("src",Url); var intWidth = document.body.clientWidth - 50; var intHeight = document.body.clientHeight - 50; if ($.browser.msie) { intWidth = intWidth; intHeight = intHeight + 100; //$("#dialogFullScreen").css('margin-right','-16px'); } $("#dialogFullScreen").dialog({ title: Title, width: intWidth, height: intHeight, show: 'fade', hide: 'fade', resizable: false, draggable: false, modal: Modal, open: function(event, ui){ if (Modal) { $('body').css('overflow','hidden'); $('.ui-widget-overlay').css('width','100%'); } $('.ui-widget-overlay').dblclick(function(e) { $('#dialogFullScreen').dialog('close'); $("#dialogFullScreen_iframe").attr("src","loader.asp"); }); }, close: function(event, ui){ if (Modal) { $('body').css('overflow','auto'); } $("#dialogFullScreen_iframe").attr("src","loader.asp"); // "sluk" for loader, hvis X er clicked if (event.originalEvent && $(event.originalEvent.target).closest(".ui-dialog-titlebar-close").length ) { var x=document.getElementById("dialog_iframe"); var y=(x.contentWindow || x.contentDocument); if (y.document) { y=y.document; if (y.getElementById("LoaderLayer") != null) y.getElementById("LoaderLayer").style.display = 'none'; } } } }); } jQuery.fn.ForceNumericOnly = function() { return this.each(function() { $(this).keydown(function(e) { var key = e.charCode || e.keyCode || 0; // allow backspace, tab, delete, arrows, numbers and keypad numbers ONLY return ( key == 8 || key == 9 || key == 46 || (key >= 37 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105) ); }) }) };