cloudbearings / ez-access-web

Automatically exported from code.google.com/p/ez-access-web
0 stars 0 forks source link

Timeout: behavior if only some attributes are present #114

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There are three timeout attributes:
data-ez-timeout
data-ez-timeout-delay
data-ez-timeout-href

I just wanted to make sure that error cases are caught.

If data-ez-timeout is not present, there is not message to be displayed, so it 
should be required for a valid timeout.

If data-ez-timeout-delay is not present, then the author has not defined a 
delay (either before or after the message is played). We could either (1) 
provide a default "before" delay (say 120000ms) or (2) not provide a timeout at 
all if it is missing and/or invalid.

If data-ez-timeout-href is not present, then there is nothing else to load when 
the system times out. I guess this is okay as an error behavior. I cannot think 
of legitimate time when you wouldn't specify an href unless the author is 
trying to do something fancy with JS.

Upshot in pseudocode: 
if ( body.hasAttribute('data-ez-timeout') && 
body.hasAttribute('data-ez-timeout-delay && the attribute values are valid) {
    //this is a legal timeout
    //code for timeout
} else {
    _debug('Timeout does not have the necessary attributes.';
}

Please check the code to see how it behaves in error cases.

Original issue reported on code.google.com by jbjor...@gmail.com on 2 Oct 2013 at 5:56

GoogleCodeExporter commented 9 years ago
In error cases, there is a default action which is 'overridden' by any 
attributes entered. I will double check though that it works to your 
specifications!

Original comment by aeharding on 25 Oct 2013 at 8:35