DOCTYPE recognition in an action

Just a quick question is there a quick way to sniff out the document type.
in other words:
if document type is HTML else if document type XHTML do that…
well thats what I’m trying to figure out in a quick way
is there a quick freeway method.

Any pointers would be really handy
cheeeers in advance
max :o)


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Max,
Rather than try and get the DocType for the page I’d be inclined to
look at the page output level which in turn will set the correct
DocType.
Try;

// Get the HTML level for this page
var thisPageHTMLLevel = fwPage.fwHTMLLevel;
	
// 1=3.2    2=3.2+css    3=4.01   4=xhtml transitional   5= xhtml strict

Regards,
Tim.

On 20 Oct 2010, at 21:55, max wrote:

Just a quick question is there a quick way to sniff out the document
type.
in other words:
if document type is HTML else if document type XHTML do that…
well thats what I’m trying to figure out in a quick way
is there a quick freeway method.

Any pointers would be really handy
cheeeers in advance
max :o)

FreewayActions.com - Freeware and commercial actions for Freeway
Express & Pro.

Protect your mailto links from being harvested by spambots with Anti
Spam.
Only available at FreewayActions.com

http://www.freewayactions.com


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks tim… that worked a treat
And thanks for posting the solution so quickly and in the middle of the night
cheers max


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

in the middle of the night

One man’s night is another man’s day!

D


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

// Get the HTML level for this page
var thisPageHTMLLevel = fwPage.fwHTMLLevel;
	
// 1=3.2    2=3.2+css    3=4.01   4=xhtml transitional   5= xhtml strict

We’ve actually partially deprecated the use of this property.

By preference, you should use the fwHTMLDocType property of the FWPage object. Amazingly, it’s a string containing the doctype…

Cheers

Stewart


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Stewart
I implemented the fwPage.fwHTMLLevel method last night… and it worked perfectly so its a shame it’s being deprecated :o(

Do you have a reference on how to use HTMLDocType property of the FWPage object, or has this been used recently on a action that I can have a butchers.

On the same note, will the fwPage.fwHTMLLevel be dropped completely from being recognised in future releases of Freeway and is this because of HTML5, or is it for some other reason…
Then finally… “I suppose again in similar same vein”: what other properties are likely to get the old size nine boot… :o)
Do you have a list and what we are to use as alternatives.

All the best max


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Simon, could you please add this to the Wiki at http://www.actionsforge.com/wikis/view/12-actions-api

Thanks so much!

Walter

On Oct 21, 2010, at 12:22 PM, max wrote:

Do you have a reference on how to use HTMLDocType property of the
FWPage object, or has this been used recently on a action that I can
have a butchers.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter,
I’ve just added fwHTMLDocType in the wiki and updated fwHTMLLevel to
include HTML levels that were missing.

Max, if the brief example in the wiki doesn’t do it for you let me know.
Regards,
Tim.

On 21 Oct 2010, at 17:39, Walter Lee Davis wrote:

Simon, could you please add this to the Wiki at http://www.actionsforge.com/wikis/view/12-actions-api

Thanks so much!

Walter

On Oct 21, 2010, at 12:22 PM, max wrote:

Do you have a reference on how to use HTMLDocType property of the
FWPage object, or has this been used recently on a action that I
can have a butchers.


Tim Plumb
Creative Director
Softpress Systems

Follow us on Twitter: http://www.softpress.com/tny/064
Join us on Facebook: http://www.softpress.com/tny/063
Looking for a webhost? We love these guys: http://www.softpress.com/tny/sxf


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 21 Oct 2010, 4:22 pm, max wrote:

On the same note, will the fwPage.fwHTMLLevel be dropped completely from being recognised in future releases of Freeway and is this because of HTML5, or is it for some other reason…

We internally deprecated the use of this property some years ago because it led to some nastiness where there was reliance on the ordering of the values e.g. checking if the value was less than 4 for non-XHTML output types.

This wasn’t very forward-compatible because, for example, when we added HTML 4 Strict, the numerical value was higher than 4. We decided that it was better to use the doctype string for output level checks.

Having said this, we don’t have any plans to drop the fwHTMLLevel property completely so you’re welcome to use it. This is more of a recommended deprecation rather than a formal deprecation :slight_smile:

Then finally… “I suppose again in similar same vein”: what other properties are likely to get the old size nine boot… :o)

The other properties that we have marked as deprecated are:

FWElement: fwIsInlined

FWItem: fwIsOverflowed

FWFileParamPair: fwFullFileName

Cheers

Stewart


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Just to follow up on those deprecated functions Stewart listed, here are some alternatives:

On 22 Oct 2010, at 10:31, stewart wrote:

The other properties that we have marked as deprecated are:

FWElement: fwIsInlined

fwIsInflow
fwIsInflowDiv

FWItem: fwIsOverflowed

fwIsPublished (check if an item is due to be published - there are many forms of overflow and the only relevant one to Actions is the kind that prevents an item from publishing)

FWFileParamPair: fwFullFileName

fwPathName (the name of the file with the path) or
fwFileName (the short file name)

Joe


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options