if(!isWidgetSupported(protocol)) {
return;
}
// Retrieve block attributes stored in doRenderOpen
EffectBlockAttributes blockAttributes = (EffectBlockAttributes)popMCSAttributes();
renderWidgetClose(protocol, blockAttributes);
addUsedWidgetId(blockAttributes.getId());
// Detect full screen popup. This will be used on the client side
// to apply ugly workarounds for scrolling.
Styles styleTable = attributes.getStyles();
StyleValue heightValue = styleTable.getPropertyValues()
.getSpecifiedValue(StylePropertyDetails.HEIGHT);
StyleValue widthValue = styleTable.getPropertyValues()
.getSpecifiedValue(StylePropertyDetails.WIDTH);
StyleValue positionValue = styleTable.getPropertyValues()
.getSpecifiedValue(StylePropertyDetails.POSITION);
StyleValue overflowValue = styleTable.getPropertyValues()
.getSpecifiedValue(StylePropertyDetails.OVERFLOW);
String fullScreen;
if (heightValue != null && positionValue != null && widthValue!=null && overflowValue!=null) {
if (heightValue.getStandardCSS().equals("100%")
&& widthValue.getStandardCSS().equals("100%")
&& (overflowValue.getStandardCSS().equals("scroll") || overflowValue.getStandardCSS().equals("auto"))
&& positionValue.getStandardCSS().equals("fixed")) {
fullScreen = new String(" fullScreen: true");
} else {
fullScreen = new String(" fullScreen: false");
}
} else {
fullScreen = new String(" fullScreen: false");
}
// Create the widget
StringBuffer textBuffer = new StringBuffer(createJavaScriptWidgetRegistrationOpening(attributes.getId()))
.append("new Widget.Popup(")
.append(createJavaScriptString(attributes.getId()))
.append(", ").append(createJavaScriptString(blockAttributes.getId()))
.append(", {")
.append(fullScreen)
.append(", ").append(getDisappearableOptions(attributes))
.append(", ").append(getAppearableOptions(attributes))
.append("})")