diff --git a/WebContent/birt/ajax/ui/dialog/AbstractBaseDialog.js b/WebContent/birt/ajax/ui/dialog/AbstractBaseDialog.js index 7eb3063..d5c25e1 100644 --- a/WebContent/birt/ajax/ui/dialog/AbstractBaseDialog.js +++ b/WebContent/birt/ajax/ui/dialog/AbstractBaseDialog.js @@ -2,20 +2,34 @@ * Dialog base class */ AbstractBaseDialog = function(){}; +// 添加Dialog实例监控 +var Dialogs = {}; AbstractBaseDialog.prototype = { - contentHolderWidth: 500, //TODO - move to display constants? Default width in pixels + contentHolderWidth: 500, + //TODO - move to display constants? Default width in pixels visible: null, //Is the dialog currently visible + __operationCancelled: false, + __allowSelection: false, /** Initialize dialog base */ - __initBase: function(htmlId, contentWidth) - { + __initBase: function(htmlId, contentWidth) { this.__instance = $(htmlId); + // 初始化Dialog + this.__view = jQuery(document.getElementById(htmlId)); + this.__view.modal({ + keyboard: false, + backdrop: 'static', + show: false + }) + // 记录所有的对话框 + Dialogs[htmlId] = this; + // this.htmlId = htmlId; this.visible = false; @@ -26,8 +40,10 @@ AbstractBaseDialog.prototype = //Instance is given a location within screen to avoid //extra scroll bar creation + /** this.__instance.style.top = '0px'; this.__instance.style.left = '0px'; + **/ //Sizing this.contentHolderName = htmlId + "dialogContentContainer"; @@ -64,7 +80,7 @@ AbstractBaseDialog.prototype = __base_installEventHandlers : function( id ) { //Initialize iframe - this.__iframe = $(id + "iframe"); + // this.__iframe = $(id + "iframe"); // Close button var closeBtn = $(id + "dialogCloseBtn"); @@ -151,13 +167,20 @@ AbstractBaseDialog.prototype = * @event, incoming browser native event * @return, void */ - __l_show : function( ) - { + __l_show : function() { + // 隐藏其他对话框 + for(var prop in Dialogs) { + if(Dialogs[prop] !== this) { + // 隐藏其他对话框 + Dialogs[prop].__l_hide(); + } + } // reset cancelled flag this.__operationCancelled = false; this.__preShow(); //check if the dialog is already shown + /** if(!this.visible) { var zIndex = Mask.show(); @@ -167,13 +190,6 @@ AbstractBaseDialog.prototype = Element.show( this.__instance ); this.visible = true; - //workaround for Mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=167801 - if(BrowserUtility.useIFrame()) - { - //show iframe under dialog - Element.show( this.__iframe ); - } - this.__setWidth(); BirtPosition.center( this.__instance ); @@ -201,7 +217,11 @@ AbstractBaseDialog.prototype = Event.observe( window, 'resize', this.__neh_resize_closure, false ); Event.observe( document, 'mouseup', this.disposeSelection_closure, false ); } - + **/ + if(!this.visible) { + this.__view.modal('show'); + this.visible = true; + } this.__postShow(); }, @@ -209,9 +229,8 @@ AbstractBaseDialog.prototype = /** Called right before element is shown */ - __preShow: function() - { - //implementation is left to extending class + __preShow: function() { + }, /** @@ -231,18 +250,22 @@ AbstractBaseDialog.prototype = __l_hide : function( ) { this.__preHide(); + this.__view.modal('hide'); + /** Event.stopObserving( window, 'resize', this.__neh_resize_closure, false ); Event.stopObserving( document, 'mouseup', this.disposeSelection_closure, false ); - [ this.__instance, this.__iframe ].each( Element.hide ); - this.visible = false; + [this.__instance].each(Element.hide); Mask.hide(); + **/ + // [this.__instance, this.__iframe].each( Element.hide ); + this.visible = false; + }, /** Called before element is hidden */ - __preHide: function() - { + __preHide: function() { //implementation is left to extending class }, @@ -424,17 +447,15 @@ AbstractBaseDialog.prototype = contentHolder.style.width = this.contentHolderWidth + 'px'; var newOuterWidth = contentHolder.offsetWidth + difference; this.__instance.style.width = newOuterWidth + 'px'; - + + /** this.__iframe.style.width = this.__instance.offsetWidth + 'px'; this.__iframe.style.height = this.__instance.offsetHeight + 'px'; - - //move iframe to true top, left - //assumes that top/bottom left/right borders are same width - if(this.__iframe.clientWidth > 0) - { + if(this.__iframe.clientWidth > 0) { this.__iframe.style.top = (this.__instance.clientHeight - this.__instance.offsetHeight)/2 + 'px'; this.__iframe.style.left = (this.__instance.clientWidth - this.__instance.offsetWidth)/2 + 'px'; } + **/ }, /** diff --git a/WebContent/birt/ajax/ui/dialog/BirtParameterDialog.js b/WebContent/birt/ajax/ui/dialog/BirtParameterDialog.js index a40b5a5..a6ffbf6 100644 --- a/WebContent/birt/ajax/ui/dialog/BirtParameterDialog.js +++ b/WebContent/birt/ajax/ui/dialog/BirtParameterDialog.js @@ -325,11 +325,10 @@ BirtParameterDialog.prototype = Object.extend(new AbstractParameterDialog(), var k = 0; //oTRC[i] is section - var oTRC = document.getElementById("parameter_table").getElementsByTagName("TR"); - for(var i = 0; i < oTRC.length; i++) - { - if(!this.__parameter[k]) - { + //var oTRC = document.getElementById("parameter_table").getElementsByTagName("TR"); + var oTRC = document.getElementById("parameter_table").querySelectorAll('div.form-group'); + for(var i = 0; i < oTRC.length; i++) { + if(!this.__parameter[k]) { this.__parameter[k] = { }; } diff --git a/WebContent/birt/pages/dialog/DialogContainerFragment.jsp b/WebContent/birt/pages/dialog/DialogContainerFragment.jsp index 6e44a4d..6c651b7 100644 --- a/WebContent/birt/pages/dialog/DialogContainerFragment.jsp +++ b/WebContent/birt/pages/dialog/DialogContainerFragment.jsp @@ -1,13 +1,6 @@ -<%----------------------------------------------------------------------------- - Copyright (c) 2004 Actuate Corporation and others. - All rights reserved. This program and the accompanying materials - are made available under the terms of the Eclipse Public License v1.0 - which accompanies this distribution, and is available at - http://www.eclipse.org/legal/epl-v10.html - - Contributors: - Actuate Corporation - Initial implementation. ------------------------------------------------------------------------------%> +<%-- + 对话框模板 +--%> <%@ page contentType="text/html; charset=utf-8" %> <%@ page session="false" buffer="none" %> <%@ page import="org.eclipse.birt.report.presentation.aggregation.IFragment, @@ -16,83 +9,45 @@ org.eclipse.birt.report.utility.ParameterAccessor, org.eclipse.birt.report.resource.BirtResources" %> -<%----------------------------------------------------------------------------- - Expected java beans ------------------------------------------------------------------------------%> -<%----------------------------------------------------------------------------- - Dialog container fragment, shared by all standard dialogs. ------------------------------------------------------------------------------%> - + \ No newline at end of file diff --git a/WebContent/birt/pages/dialog/PrintReportDialogFragment.jsp b/WebContent/birt/pages/dialog/PrintReportDialogFragment.jsp index ccedde1..0401ab4 100644 --- a/WebContent/birt/pages/dialog/PrintReportDialogFragment.jsp +++ b/WebContent/birt/pages/dialog/PrintReportDialogFragment.jsp @@ -1,13 +1,3 @@ -<%----------------------------------------------------------------------------- - Copyright (c) 2004 Actuate Corporation and others. - All rights reserved. This program and the accompanying materials - are made available under the terms of the Eclipse Public License v1.0 - which accompanies this distribution, and is available at - http://www.eclipse.org/legal/epl-v10.html - - Contributors: - Actuate Corporation - Initial implementation. ------------------------------------------------------------------------------%> <%@ page contentType="text/html; charset=utf-8"%> <%@ page session="false" buffer="none"%> <%@ page import="org.eclipse.birt.report.presentation.aggregation.IFragment, diff --git a/WebContent/birt/pages/layout/FramesetFragment.jsp b/WebContent/birt/pages/layout/FramesetFragment.jsp index ccaa375..33272c4 100644 --- a/WebContent/birt/pages/layout/FramesetFragment.jsp +++ b/WebContent/birt/pages/layout/FramesetFragment.jsp @@ -12,7 +12,6 @@ <% - // base href can be defined in config file for deployment. String baseHref = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort(); if(!attributeBean.isDesigner()) { @@ -35,7 +34,6 @@ - + @@ -178,8 +177,6 @@ Mask.setBaseElements(new Array(birtToolbar.__instance, navigationBar.__instance, birtReportDocument.__instance)); - - // When link to internal bookmark, use javascript to fire an Ajax request function catchBookmark(bookmark) { birtEventDispatcher.broadcastEvent(birtEvent.__E_GETPAGE, { name : "__bookmark", value : bookmark }); diff --git a/WebContent/birt/pages/parameter/TextBoxParameterFragment.jsp b/WebContent/birt/pages/parameter/TextBoxParameterFragment.jsp index 9cdedbc..36801b5 100644 --- a/WebContent/birt/pages/parameter/TextBoxParameterFragment.jsp +++ b/WebContent/birt/pages/parameter/TextBoxParameterFragment.jsp @@ -1,66 +1,34 @@ -<%----------------------------------------------------------------------------- - Copyright (c) 2004 Actuate Corporation and others. - All rights reserved. This program and the accompanying materials - are made available under the terms of the Eclipse Public License v1.0 - which accompanies this distribution, and is available at - http://www.eclipse.org/legal/epl-v10.html - - Contributors: - Actuate Corporation - Initial implementation. ------------------------------------------------------------------------------%> <%@ page contentType="text/html; charset=utf-8" %> <%@ page session="false" buffer="none" %> <%@ page import="org.eclipse.birt.report.utility.ParameterAccessor, org.eclipse.birt.report.context.BaseAttributeBean, org.eclipse.birt.report.context.ScalarParameterBean" %> - -<%----------------------------------------------------------------------------- - Expected java beans ------------------------------------------------------------------------------%> - -<%----------------------------------------------------------------------------- - Text box parameter control ------------------------------------------------------------------------------%> <% ScalarParameterBean parameterBean = ( ScalarParameterBean ) attributeBean.getParameterBean( ); String encodedParameterName = ParameterAccessor.htmlEncode( parameterBean.getName( ) ); %> - - - <%= parameterBean.getDisplayName( ) %> - - - - <%-- is required --%> - <% - if ( parameterBean.isRequired( ) ) - { +
+ +
+ + "/> + + <% + if(!parameterBean.isRequired()) { %> - - <% - } - %> - - - - - - - "> -<% - if ( !parameterBean.isRequired( ) ) - { -%> - - " - VALUE="<%= encodedParameterName %>" - <%= (parameterBean.getValue( ) != null)? "CHECKED" : "" %>> -<% - } -%> - "> + " value="<%=encodedParameterName%>" <%=(parameterBean.getValue() != null)? "checked" : "" %>/> + 请输入 + + <%}%> + " NAME="<%= encodedParameterName %>" ID="<%= encodedParameterName %>" @@ -80,20 +48,14 @@ VALUE="<%= ParameterAccessor.htmlEncode( ( parameterBean.getDisplayText( ) == null )? "" : parameterBean.getDisplayText( ) ) %>" > <% - if ( !parameterBean.isRequired( ) ) - { + if ( !parameterBean.isRequired()) { %> -
- - " - VALUE="<%= encodedParameterName %>" - <%= ( parameterBean.getValue( ) == null )? "CHECKED" : "" %>> Null Value + <% - } -%> - - "> - - \ No newline at end of file +} +%> "/> +
+
diff --git a/WebContent/webcontent/birt/pages/dialog/ParameterDialogFragment.jsp b/WebContent/webcontent/birt/pages/dialog/ParameterDialogFragment.jsp index e8978f1..466502f 100644 --- a/WebContent/webcontent/birt/pages/dialog/ParameterDialogFragment.jsp +++ b/WebContent/webcontent/birt/pages/dialog/ParameterDialogFragment.jsp @@ -1,31 +1,40 @@ +<%----------------------------------------------------------------------------- + Copyright (c) 2004 Actuate Corporation and others. + All rights reserved. This program and the accompanying materials + are made available under the terms of the Eclipse Public License v1.0 + which accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html + + Contributors: + Actuate Corporation - Initial implementation. +-----------------------------------------------------------------------------%> <%@ page contentType="text/html; charset=utf-8" %> <%@ page session="false" buffer="none" %> <%@ page import="java.util.Iterator, java.util.Collection, org.eclipse.birt.report.resource.BirtResources, org.eclipse.birt.report.presentation.aggregation.IFragment" %> + +<%----------------------------------------------------------------------------- + Expected java beans +-----------------------------------------------------------------------------%> -