<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="0.91">
    <channel>
        <title>Bug in vertical align action</title>
        <description>The 10 most recently added comments in the topic &quot;Bug in vertical align action&quot;</description>
        <link>http://www.freewaytalk.net/</link>
        <lastBuildDate>Fri, 05 Mar 2010 19:47:47 -500</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>Re: Bug in vertical align action</title>
            <link>http://www.freewaytalk.net/thread/view/39447#m_51108</link>
            <description>&lt;p&gt;Peter,&lt;/p&gt;

&lt;p&gt;I have altered the css navigation action to be found here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.freewaytalk.net/thread/view/50746&quot;&gt;http://www.freewaytalk.net/thread/view/50746&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All I did was comment the offending line and everything works now, must try and find out what the previous code did to the body tag to screw everything up though.&lt;/p&gt;

&lt;p&gt;regards,&lt;/p&gt;

&lt;p&gt;mmull&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>mmull</author>
            <pubDate>Thu, 09 Apr 2009 23:53:56 -500</pubDate>
        </item>
        <item>
            <title>Re: Bug in vertical align action</title>
            <link>http://www.freewaytalk.net/thread/view/39447#m_49744</link>
            <description>&lt;p&gt;Peter,&lt;/p&gt;

&lt;p&gt;Grab this file and see what happens:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://mmuller.vndv.com/css-va.zip&quot;&gt;http://mmuller.vndv.com/css-va.zip&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you remove the css menus action it centres vertically.&lt;/p&gt;

&lt;p&gt;If you remove the vertical align action the menu works.&lt;/p&gt;

&lt;p&gt;The error is from the css menus action, so not sure if there is anything you can do to fix this unfortunately&amp;#8230;&lt;/p&gt;

&lt;p&gt;Best Regards,&lt;/p&gt;

&lt;p&gt;mmull&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>mmull</author>
            <pubDate>Tue, 17 Mar 2009 22:44:30 -500</pubDate>
        </item>
        <item>
            <title>Re: Bug in vertical align action</title>
            <link>http://www.freewaytalk.net/thread/view/39447#m_49446</link>
            <description>&lt;p&gt;@DeltaDave:&lt;/p&gt;

&lt;p&gt;Nice to here someone is actually using my patch.&lt;/p&gt;

&lt;p&gt;Thanks for pointing out the missing slash. The formatter had eaten it up unfortunately. ;-)&lt;/p&gt;

&lt;p&gt;@mmull:&lt;/p&gt;

&lt;p&gt;I&amp;#8217;d bet, the error appears also in the original vertical-align  action. Right?&lt;/p&gt;

&lt;p&gt;You can send me a to a single page stripped down Freeway document, where the error occurs, and I can have a look, when I have time. But no promise that I can fix it.&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>Peter Gutbrod</author>
            <pubDate>Fri, 13 Mar 2009 10:39:16 -500</pubDate>
        </item>
        <item>
            <title>Re: Bug in vertical align action</title>
            <link>http://www.freewaytalk.net/thread/view/39447#m_49342</link>
            <description>&lt;p&gt;Edit to the above&amp;#8230;&lt;/p&gt;

&lt;p&gt;the error and code appear in the css menus action that ships with Freeway, is there a way to get around this do you think ?&lt;/p&gt;

&lt;p&gt;mm&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>mmull</author>
            <pubDate>Wed, 11 Mar 2009 20:43:26 -500</pubDate>
        </item>
        <item>
            <title>Re: Bug in vertical align action</title>
            <link>http://www.freewaytalk.net/thread/view/39447#m_49341</link>
            <description>&lt;p&gt;One small caveat to using this is it breaks the page body tags and therefore if you try to use &amp;#8216;css menus&amp;#8217; on a vertically centred page the app errors with the following message:&lt;/p&gt;

&lt;p&gt;&amp;#8220;bodyTag has no properties&amp;#8221;&lt;/p&gt;

&lt;p&gt;and highlights this line:&lt;/p&gt;

&lt;p&gt;fwParameters.bodyTag.fwValue = bodyTag[0];&lt;/p&gt;

&lt;p&gt;any help would be greatly appreciated&lt;/p&gt;

&lt;p&gt;mm&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>mmull</author>
            <pubDate>Wed, 11 Mar 2009 20:41:12 -500</pubDate>
        </item>
        <item>
            <title>Re: Bug in vertical align action</title>
            <link>http://www.freewaytalk.net/thread/view/39447#m_49260</link>
            <description>&lt;p&gt;I have just done a small update to a site last fiddled with in FW4 and couldn&amp;#8217;t understand why some of my Vertically Aligned pages were giving me grief. Until I found this thread of course and Peter&amp;#8217;s version has done the trick for me.&lt;/p&gt;

&lt;p&gt;But be careful as the last line&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;page-action&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;should read&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;/ page-action&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But with no space between the &amp;#8216;/&amp;#8217; and &amp;#8216;page-action&amp;#8217;&lt;/p&gt;

&lt;p&gt;The Web forum does muck with this.&lt;/p&gt;

&lt;p&gt;Maybe this could be added to Actions Forge Peter.&lt;/p&gt;

&lt;p&gt;David&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>DeltaDave</author>
            <pubDate>Wed, 11 Mar 2009 00:08:23 -500</pubDate>
        </item>
        <item>
            <title>Re: Bug in vertical align action</title>
            <link>http://www.freewaytalk.net/thread/view/39447#m_39520</link>
            <description>&lt;p&gt;The formatter does its best, but for something this long and
involved, you might want to use Pastie: &lt;a href=&quot;http://pastie.org&quot;&gt;http://pastie.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Walter&lt;/p&gt;

&lt;p&gt;On Sep 11, 2008, at 8:30 AM, Peter Gutbrod wrote:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Hmm, the parser seems to have its problems, even with the 4 spaces
  thing.&lt;/p&gt;
  
  &lt;p&gt;Peter&lt;/p&gt;
  
  &lt;hr /&gt;
  
  &lt;p&gt;actionsdev mailing list
  email@hidden
  Update your subscriptions at:
  &lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>waltd</author>
            <pubDate>Thu, 11 Sep 2008 12:51:37 -500</pubDate>
        </item>
        <item>
            <title>Re: Bug in vertical align action</title>
            <link>http://www.freewaytalk.net/thread/view/39447#m_39517</link>
            <description>&lt;p&gt;Hmm, the parser seems to have its problems, even with the 4 spaces thing.&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>Peter Gutbrod</author>
            <pubDate>Thu, 11 Sep 2008 12:30:53 -500</pubDate>
        </item>
        <item>
            <title>Re: Bug in vertical align action</title>
            <link>http://www.freewaytalk.net/thread/view/39447#m_39516</link>
            <description>&lt;blockquote&gt;
  &lt;p&gt;On 11 Sep 2008, 8:27 am, Joe Billings wrote:&lt;/p&gt;
  
  &lt;p&gt;You need to use 4 spaces before each line.&lt;/p&gt;
  
  &lt;p&gt;Joe&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;OK so here comes the source:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; &amp;lt;page-action name=&quot;Vertical Alignment&quot; title=&quot;Vertical Alignment&quot;&amp;gt;
&amp;lt;action-version version=&quot;2.2 beta&quot;&amp;gt;
'Vertical Align' Action
Softpress Systems Limited 1999-2006
Patched by Peter Gutbrod 09.09.08
&amp;lt;/action-version&amp;gt;
&amp;lt;action-popup name=&quot;Vertical Align&quot;&amp;gt;
&amp;lt;value name=&quot;Top&quot; value=&quot;top&quot; default/&amp;gt;
&amp;lt;value name=&quot;Centre&quot; value=&quot;center&quot;/&amp;gt;
&amp;lt;value name=&quot;Bottom&quot; value=&quot;bottom&quot;/&amp;gt;
&amp;lt;/action-popup&amp;gt;
&amp;lt;action-javascript&amp;gt;

var gPageHasLayers = pageHasLayers();


// Gets a &quot;CSS&quot; attribute such as &quot;position:absolute&quot; from a tag value
// returns NULL if the attribute can not be found
function GetCSSAttribute(tag, fieldName, attributeName)
{
    if (tag==null)
        return null;
    var tagField = tag[fieldName];
    if (tagField == null)
        return null;
    else
    {
        var tagField = tagField.toString();
        var leftPos = tagField.indexOf(attributeName+&quot;:&quot;);
        if (leftPos &amp;gt; 1)
            leftPos = tagField.indexOf(&quot; &quot;+attributeName+&quot;:&quot;) + 1;
        if (leftPos &amp;gt; 0)
        {
            leftPos += attributeName.length+1;
            var rightPos = tagField.indexOf(&quot;;&quot;, leftPos);
            if (rightPos == -1)
                rightPos = tagField.length-1;
            return tagField.slice(leftPos, rightPos);
        }
        return null;
    }
}


function pageHasLayers()
{
    var bLayers = false;
    var item;
    for(var i in fwPage.fwItems){
        item = fwPage.fwItems[i];
        if(item.fwIsPublished &amp;amp;&amp;amp; item.fwIsLayer &amp;amp;&amp;amp; item.fwTitle != &quot;PageDiv&quot;){
            bLayers = true;
            break;
        }
    }

    return bLayers;
}

function getActualPageHeight()
{
    var height=0;
    if(fwPage.fwItems.fwLength &amp;gt; 0){
        var bottom = fwPage.fwItems[0].fwBottom;

        var item;
        for(var i in fwPage.fwItems){
            item = fwPage.fwItems[i];
            if(item.fwIsPublished)
                bottom = item.fwBottom &amp;gt; bottom ? item.fwBottom : bottom;
        }

        height = bottom;
    }

    return height;
}

function findPageDiv()
{
    var divTags = fwDocument.fwTags.fwFindAll(&quot;div&quot;);
    var divId;
    for(var i in divTags){
        if(divTags[i].id == '&quot;PageDiv&quot;')
            return divTags[i];
    }

    return null;
}

function SetStyleParameter(style, para, value)
{
    var styleStr = style ? style.toString() : &quot;&quot;;
    styleStr = styleStr ? styleStr.substring(styleStr.indexOf('&quot;') + 1, styleStr.lastIndexOf('&quot;')) : &quot;&quot;;

    var startIndex = styleStr.indexOf(para);

    if (startIndex == -1)
    {
        var index = styleStr.lastIndexOf(&quot;;&quot;);

        if (index == -1)
            return '&quot;' + para + &quot;:&quot; + value + &quot;;&quot; + styleStr + '&quot;';

        var newStyle = styleStr.substring(0, index + 1);
        newStyle += para + &quot;:&quot; + value + &quot;;&quot;;
        newStyle += styleStr.substring(index + 1, styleStr.length);

        return '&quot;' + newStyle + '&quot;';
    }

    startIndex += para.length;

    var newStyle = styleStr.substring(0, startIndex);
    newStyle += &quot;:&quot; + value + &quot;;&quot;;

    var endIndex = styleStr.indexOf(&quot;;&quot;, startIndex);

    if (endIndex != -1)
        newStyle += styleStr.substring(endIndex + 1, styleStr.length);

    return '&quot;' + newStyle + '&quot;';
}

function RemoveStyleParameter(style, para)
{
    var styleStr = style ? style.toString() : &quot;&quot;;
    styleStr = styleStr ? styleStr.substring(styleStr.indexOf('&quot;') + 1, styleStr.lastIndexOf('&quot;')) : &quot;&quot;;

    var startIndex = styleStr.indexOf(para);

    if (startIndex == -1)
        return style;

    var newStyle = styleStr.substring(0, startIndex);
    var endIndex = styleStr.indexOf(&quot;;&quot;, startIndex);

    if (endIndex != -1)
        newStyle += styleStr.substring(endIndex + 1, styleStr.length);

    return '&quot;' + newStyle + '&quot;';
}

function fwAfterStartBody()
{
    if(!gPageHasLayers){
        var bodyTag = fwDocument.fwTags.fwFind(&quot;body&quot;);
        if(bodyTag){
            var align = fwParameters[&quot;Vertical Align&quot;];
            if(fwPage.fwHTMLLevel &amp;gt; 1){
                if(align == &quot;center&quot;)
                    align = &quot;middle&quot;;

                // Need to make the body 100% height for IE's benefit...
                bodyTag.style = SetStyleParameter(bodyTag.style,&quot;height&quot;,&quot;100%&quot;);
                bodyTag.style = SetStyleParameter(bodyTag.style,&quot;margin&quot;,&quot;0px&quot;);

                bodyTag.fwAddRawOpt('&amp;lt;div style=&quot;position:absolute;height:100%;width:100%;&quot;&amp;gt;&amp;lt;table style=&quot;position:absolute;height:100%;width:100%;border:0px;&quot;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=&quot;' + align + '&quot;&amp;gt;');
            }
            else{
                bodyTag.fwAddRawOpt('&amp;lt;table width=&quot;99%&quot; height=&quot;100%&quot;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=' + align + '&amp;gt;');
            }
        }
    }
}

function fwBeforeEndBody()
{
    if(!gPageHasLayers){
        var bodyTag = fwDocument.fwTags.fwFind(&quot;body&quot;);
        if(bodyTag){
            bodyTag.fwAddRawOpt('&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;');
            if(fwPage.fwHTMLLevel &amp;gt; 1){
                bodyTag.fwAddRawOpt('&amp;lt;/div&amp;gt;');

                 var pageDiv = findPageDiv();
                 if(pageDiv){
                    var divTags = pageDiv.fwFindAll(&quot;div&quot;);

                    var pageTop = 100000;
                    var pageBottom = 0;
                    for(var i in divTags){
                        var divTop = parseInt (GetCSSAttribute(divTags[i], &quot;style&quot; , &quot;top&quot;));
                        var divHeight = parseInt (GetCSSAttribute(divTags[i], &quot;style&quot; , &quot;height&quot;));

                        pageTop = divTop &amp;lt; pageTop ? divTop : pageTop;
                        pageBottom = (divTop + divHeight) &amp;gt; pageBottom ? (divTop + divHeight) : pageBottom;

                    }
                    var pageHeight = (pageBottom - pageTop)+'px';

                    pageDiv.style = RemoveStyleParameter(pageDiv.style,&quot;min-height&quot;);
                    pageDiv.style = SetStyleParameter(pageDiv.style,&quot;height&quot;,pageHeight);
                }
            }
        }
    }
}

function fwBeforeEndHTML()
{
    if(gPageHasLayers)
    {
        var align = fwParameters[&quot;Vertical Align&quot;];

        if(fwPage.fwHTMLLevel &amp;gt; 1){ // 4.01 and XHTML
            if(align == &quot;center&quot; || align == &quot;bottom&quot;){
                var body = fwDocument.fwTags.fwFind(&quot;body&quot;);
                if(body){
                    var pageDiv = fwDocument.fwTags.fwFind(&quot;div&quot;);

                    if(pageDiv){
                        var divContent = pageDiv.fwAddEnclosing(&quot;div&quot;,true);
                        var divOuter = divContent.fwAddEnclosing(&quot;div&quot;,true);

                        var height = getActualPageHeight() + 1;

                        if(align == &quot;center&quot;){
                            divOuter.style = '&quot;background-color:transparent;position:absolute;top:50%;left:0px;width:100%;height:1px;display:block;&quot;';
                            divContent.style = '&quot;position:absolute;visibility:visible;height:' + height + 'px;top:' + (-height/2) + 'px;width:100%;&quot;';
                        }
                        else{   // bottom
                            divOuter.style = '&quot;background-color:transparent;position:absolute;bottom:0px;left:0px;width:100%;height:1px;display:block;&quot;';
                            divContent.style = '&quot;position:absolute;visibility:visible;height:' + height + 'px;top:' + (-height) + 'px;width:100%;&quot;';
                            divContent.style = '&quot;position:absolute;visibility:visible;height:' + height + 'px;bottom:0px;width:100%;&quot;';
                        }
                    }
                }
            }
        }
    }
}
&amp;lt;/action-javascript&amp;gt;
&amp;lt;/page-action&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>Peter Gutbrod</author>
            <pubDate>Thu, 11 Sep 2008 12:29:38 -500</pubDate>
        </item>
        <item>
            <title>Re: Bug in vertical align action</title>
            <link>http://www.freewaytalk.net/thread/view/39447#m_39509</link>
            <description>&lt;p&gt;You need to use 4 spaces before each line.&lt;/p&gt;

&lt;p&gt;Joe&lt;/p&gt;

&lt;p&gt;On 11 Sep 2008, at 08:03, Peter Gutbrod wrote:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Joe,&lt;/p&gt;
  
  &lt;p&gt;what is the tag to mark code when posting to this board?&lt;/p&gt;
  
  &lt;p&gt;Or probably more convenient for other&amp;#8217;s to try: Is there a
  repository to upload the patched action and just post a link?&lt;/p&gt;
  
  &lt;p&gt;Peter&lt;/p&gt;
  
  &lt;hr /&gt;
  
  &lt;p&gt;actionsdev mailing list
  email@hidden
  Update your subscriptions at:
  &lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>Joe Billings</author>
            <pubDate>Thu, 11 Sep 2008 08:27:55 -500</pubDate>
        </item>
        <item>
            <title>Bug in vertical align action</title>
            <link>http://www.freewaytalk.net/thread/view/39447</link>
            <description>&lt;p&gt;I found a bug in the vertical align action, when used together with horizontal page centering:&lt;/p&gt;

&lt;p&gt;It tries to remove the &amp;#8220;height&amp;#8221; parameter from the pageDiv tag to work with Safari. But the pageDiv tag in my FW 5 output has only a &amp;#8220;min-height&amp;#8221; parameter. That leaves to an invalid &amp;#8220;min-&amp;#8221; parameter.&lt;/p&gt;

&lt;p&gt;I simply commented out the following line in the action:&lt;/p&gt;

&lt;p&gt;// pageDiv.style = RemoveStyleParameter(pageDiv.style,&amp;#8221;height&amp;#8221;); // Height stuffs up Safari (applied if page horizontally aligned as well)&amp;#8230;&lt;/p&gt;

&lt;p&gt;Now it works together with center page aligning. The min-height parameter doesn&amp;#8217;t seem to stuff up Safari.&lt;/p&gt;

&lt;p&gt;There is still an issue with layered item. To do proper vertical aligning it needs at least one non layered item at the bottom of the layout. What it does is to place a table within the PageDiv tag thus preventing the height of the PageDiv to collapse.&lt;/p&gt;

&lt;p&gt;To work on layered items without the help of this non-layered item, the min-height parameter of the PageDiv tag has to be replaced with the height parameter set to the absolute height of the PageDiv.&lt;/p&gt;

&lt;p&gt;To calculate the height of the PageDiv currently I only can iterate through all div tags enclosed by the PageDiv to look for the top and height parameters. If anyone knows an easier way to calculate the height, please drop a line.&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;actionsdev mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>Peter Gutbrod</author>
            <pubDate>Tue, 09 Sep 2008 11:08:49 -500</pubDate>
        </item>
    </channel>
</rss>
