You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/03/31 17:09:44 UTC
svn commit: r1583345 - in /myfaces/tobago/branches/tobago-3.0.x:
tobago-core/src/main/java/org/apache/myfaces/tobago/context/
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/
tobago-core/src/main/java/org/apache/myfaces/tobago/re...
Author: lofwyr
Date: Mon Mar 31 15:09:43 2014
New Revision: 1583345
URL: http://svn.apache.org/r1583345
Log:
remove scrollbar measuring
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutableRendererBaseWrapper.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRenderer.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRendererBase.java
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java?rev=1583345&r1=1583344&r2=1583345&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java Mon Mar 31 15:09:43 2014
@@ -61,7 +61,11 @@ public class ClientProperties implements
@Deprecated
private boolean debugMode;
+ /** @deprecated since Tobago 3.0 */
+ @Deprecated
private Measure verticalScrollbarWeight;
+ /** @deprecated since Tobago 3.0 */
+ @Deprecated
private Measure horizontalScrollbarWeight;
private Measure pageWidth;
@@ -162,18 +166,26 @@ public class ClientProperties implements
FacesContext.getCurrentInstance().getViewRoot().setLocale(locale);
}
+ /** @deprecated since Tobago 3.0 */
+ @Deprecated
public Measure getVerticalScrollbarWeight() {
return verticalScrollbarWeight;
}
+ /** @deprecated since Tobago 3.0 */
+ @Deprecated
public void setVerticalScrollbarWeight(final Measure verticalScrollbarWeight) {
this.verticalScrollbarWeight = verticalScrollbarWeight;
}
+ /** @deprecated since Tobago 3.0 */
+ @Deprecated
public Measure getHorizontalScrollbarWeight() {
return horizontalScrollbarWeight;
}
+ /** @deprecated since Tobago 3.0 */
+ @Deprecated
public void setHorizontalScrollbarWeight(final Measure horizontalScrollbarWeight) {
this.horizontalScrollbarWeight = horizontalScrollbarWeight;
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java?rev=1583345&r1=1583344&r2=1583345&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java Mon Mar 31 15:09:43 2014
@@ -283,6 +283,9 @@ public abstract class AbstractUISheetLay
}
}
+ // todo: remove
+ /** @deprecated since Tobago 3.0 */
+ @Deprecated
public boolean needVerticalScrollbar(final FacesContext facesContext, final AbstractUISheet sheet) {
// estimate need of height-scrollbar on client, if yes we have to consider
// this when calculating column width's
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutableRendererBaseWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutableRendererBaseWrapper.java?rev=1583345&r1=1583344&r2=1583345&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutableRendererBaseWrapper.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutableRendererBaseWrapper.java Mon Mar 31 15:09:43 2014
@@ -112,6 +112,8 @@ public abstract class AbstractLayoutable
return ((LayoutComponentRenderer) getRenderer(facesContext)).getPaddingBottom(facesContext, component);
}
+ /** @deprecated since Tobago 3.0 */
+ @Deprecated
public Measure getVerticalScrollbarWeight(final FacesContext facesContext, final Configurable component) {
return ((LayoutComponentRenderer) getRenderer(facesContext)).getVerticalScrollbarWeight(facesContext, component);
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRenderer.java?rev=1583345&r1=1583344&r2=1583345&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRenderer.java Mon Mar 31 15:09:43 2014
@@ -68,5 +68,7 @@ public interface LayoutComponentRenderer
Measure getPaddingBottom(FacesContext facesContext, Configurable component);
+ /** @deprecated since Tobago 3.0 */
+ @Deprecated
Measure getVerticalScrollbarWeight(FacesContext facesContext, Configurable component);
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRendererBase.java?rev=1583345&r1=1583344&r2=1583345&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRendererBase.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRendererBase.java Mon Mar 31 15:09:43 2014
@@ -113,6 +113,8 @@ public abstract class LayoutComponentRen
return getResourceManager().getThemeMeasure(facesContext, component, Attributes.PADDING_BOTTOM, Measure.ZERO);
}
+ /** @deprecated since Tobago 3.0 */
+ @Deprecated
public Measure getVerticalScrollbarWeight(final FacesContext facesContext, final Configurable component) {
final ClientProperties clientProperties = VariableResolverUtils.resolveClientProperties(facesContext);
final Measure weight = clientProperties.getVerticalScrollbarWeight();
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css?rev=1583345&r1=1583344&r2=1583345&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css Mon Mar 31 15:09:43 2014
@@ -640,17 +640,6 @@ li.tobago-menu-markup-selected {
position: relative;
}
-.tobago-page-scrollbarWeight {
- width: 100px;
- height: 100px;
- overflow: scroll;
- margin: 0;
- padding: 0;
- z-index: -1;
- visibility: hidden;
- position: absolute;
-}
-
.tobago-page-overlay {
display: table;
position: absolute;
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java?rev=1583345&r1=1583344&r2=1583345&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java Mon Mar 31 15:09:43 2014
@@ -71,7 +71,6 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.StringTokenizer;
public class PageRenderer extends PageRendererBase {
@@ -91,28 +90,6 @@ public class PageRenderer extends PageRe
if (lastFocusId != null) {
FacesContextUtils.setFocusId(facesContext, lastFocusId);
}
-
- // scrollbar weight
- final String name = clientId + ComponentUtils.SUB_SEPARATOR + "scrollbarWeight";
- String value = null;
- try {
- value = facesContext.getExternalContext().getRequestParameterMap().get(name);
- if (StringUtils.isNotBlank(value)) {
- final StringTokenizer tokenizer = new StringTokenizer(value, ";");
- final Measure vertical = Measure.valueOf(tokenizer.nextToken());
- final Measure horizontal = Measure.valueOf(tokenizer.nextToken());
- if (vertical.greaterThan(Measure.valueOf(30)) || vertical.lessThan(Measure.valueOf(3))
- || horizontal.greaterThan(Measure.valueOf(30)) || horizontal.lessThan(Measure.valueOf(3))) {
- LOG.error("Ignoring strange values: vertical=" + vertical + " horizontal=" + horizontal);
- } else {
- final ClientProperties client = VariableResolverUtils.resolveClientProperties(facesContext);
- client.setVerticalScrollbarWeight(vertical);
- client.setHorizontalScrollbarWeight(horizontal);
- }
- }
- } catch (final Exception e) {
- LOG.error("Error in decoding '" + name + "': value='" + value + "'", e);
- }
}
@Override
@@ -332,29 +309,6 @@ public class PageRenderer extends PageRe
writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "form-clientDimension");
writer.endElement(HtmlElements.INPUT);
- final boolean calculateScrollbarWeight =
- client.getVerticalScrollbarWeight() == null || client.getHorizontalScrollbarWeight() == null;
-
- if (calculateScrollbarWeight) {
- writer.startElement(HtmlElements.DIV, null);
- writer.writeClassAttribute(Classes.create(page, "scrollbarWeight", Markup.NULL));
- writer.startElement(HtmlElements.DIV, null);
- writer.endElement(HtmlElements.DIV);
- writer.endElement(HtmlElements.DIV);
- }
-
- writer.startElement(HtmlElements.INPUT, null);
- writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.HIDDEN, false);
- writer.writeNameAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "scrollbarWeight");
- writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "scrollbarWeight");
- if (client.getVerticalScrollbarWeight() != null && client.getHorizontalScrollbarWeight() != null) {
- writer.writeAttribute(
- HtmlAttributes.VALUE,
- client.getVerticalScrollbarWeight().getPixel() + ";" + client.getHorizontalScrollbarWeight().getPixel(),
- false);
- }
- writer.endElement(HtmlElements.INPUT);
-
if (TobagoConfig.getInstance(FacesContext.getCurrentInstance()).isCheckSessionSecret()) {
Secret.encode(facesContext, writer);
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java?rev=1583345&r1=1583344&r2=1583345&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java Mon Mar 31 15:09:43 2014
@@ -937,6 +937,7 @@ public class SheetRenderer extends Layou
writer.endElement(HtmlElements.DIV);
}
+ // todo: remove
private boolean needVerticalScrollbar(final FacesContext facesContext, final UISheet sheet) {
final LayoutManager layoutManager = sheet.getLayoutManager();
if (layoutManager instanceof AbstractUISheetLayout) {
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=1583345&r1=1583344&r2=1583345&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Mon Mar 31 15:09:43 2014
@@ -258,6 +258,7 @@ Tobago.Sheet.setup2 = function (sheets)
});
+ // todo: remove this for Tobago 3.0
// adjust body row filler cells if no scrollbar present but was calculated
jQuery(sheets).find("[data-tobago-sheet-verticalscrollbarwidth]").each(function() {
var table = jQuery(this);
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1583345&r1=1583344&r2=1583345&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Mon Mar 31 15:09:43 2014
@@ -302,7 +302,6 @@ var Tobago = {
window.setTimeout(Tobago.registerResizeAction, 1000);
}
- Tobago.ensureScrollbarWeights();
window.setTimeout(Tobago.finishPageLoading, 1);
console.timeEnd("[tobago] init (main thread)"); // @DEV_ONLY
},
@@ -1069,23 +1068,6 @@ var Tobago = {
return Tobago.Utils.selectWidthJQuery(elements, selector);
},
- ensureScrollbarWeights: function() {
- var id = Tobago.page.id + Tobago.SUB_COMPONENT_SEP + 'scrollbarWeight';
- var hidden = jQuery(Tobago.Utils.escapeClientId(id));
- if (hidden.val().length == 0) {
- var outer = hidden.prev();
- hidden.val(''
- + (100 - outer.prop('clientWidth')) + ';'
- + (100 - outer.prop('clientHeight')));
- } else {
- var scrollbarWeights = hidden.val().split(",");
- if (scrollbarWeights.length == 2) {
- Tobago.Config.set('Tobago', 'verticalScrollbarWeight', scrollbarWeights[0]);
- Tobago.Config.set('Tobago', 'horizontalScrollbarWeight', scrollbarWeights[1]);
- }
- }
- },
-
clickOnElement: function(id) {
var element = this.element(id);
// console.debug("id = " + id + " element = " + typeof element);