Changeset 89:cd44b7d86188 in iovar


Ignore:
Timestamp:
Feb 27, 2017, 7:45:12 AM (20 months ago)
Author:
Shawn Wilson <shawn@…>
Branch:
default
Phase:
public
Message:

saw_022717_1 - New /bin/redirect options: ?script for adding javascript; ?wait for adding delay.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r88 r89  
    22Copyright (C) 2011-2015 Lannocc Technologies
    33@%@~LICENSE~@%@
     4
     5saw_022717_1 - New /bin/redirect options: ?script for adding javascript; ?wait for adding delay.
    46
    57saw_021817_1 - Resource now supports auto-exec and auto ./index.
  • bin/redirect

    r77 r89  
    66
    77set redirect_uri
    8 test "$@" = '' || set redirect_uri="$@"
     8test "$@" = '' || redirect_uri="$@"
     9test "$wait" = '' && wait=0
     10test "$wait" is int || wait=0
    911
    1012test "$VIEW" = 'text' && {
     
    1921        <script language="javascript" type="text/javascript">
    2022            var self = false;
    21             var inparent = false;'
     23            var inparent = false;
     24            var wait = 0'
    2225
    2326            test "$self" = "true" && echo "self = true;"
    2427            test "$parent" = "true" && echo "inparent = true;"
     28            test "$wait" -gt 0 && echo "wait = $wait"
     29            test "$script" = '' || echo "$script"
    2530            echo ?noline '
    2631
     
    3742            {
    3843                //alert ("redirecting: '$redirect_uri'");
    39                 window.location.href = '\'$redirect_uri\'';
     44               
     45                if (wait > 0) {
     46                    window.setTimeout(function() { window.location.href = '\'$redirect_uri\''; }, wait);
     47                }
     48                else {
     49                    window.location.href = '\'$redirect_uri\'';
     50                }
    4051            }
    4152        </script>
    4253        <noscript>
    43             <meta http-equiv="refresh" content="0;URL='$redirect_uri'">
     54            <meta http-equiv="refresh" content="'$wait';URL='$redirect_uri'">
    4455        </noscript>
    4556    </head>
    4657    <body>
    47         Redirecting to <a href="'$redirect_uri'">'$redirect_uri'</a>
     58        <h1><a href="'$redirect_uri'">Continue...</a></h1>
    4859    </body>
    4960</html>'
Note: See TracChangeset for help on using the changeset viewer.