2 iframecontentmws.js - Foteos Macrides (author and copyright holder)
\r
3 Initial: October 10, 2004 - Last Revised: January 26, 2008
\r
4 Scripts for using HTML documents as iframe content in overlibmws popups.
\r
6 See http://www.macridesweb.com/oltest/IFRAME.html
\r
7 and http://www.macridesweb.com/oltest/AJAX.html#ajaxex3
\r
8 for more information.
\r
12 Use as lead argument in overlib or overlb2 calls. Include WRAP and
\r
13 TEXTPADDING,0 in the call to ensure that the width arg is respected (unless
\r
14 the CAPTION plus CLOSETEXT widths add up to more than the width arg, in which
\r
15 case you should increase the width arg). The name arg should be a unique
\r
16 string for each popup with iframe content in the document. The frameborder
\r
17 arg should be 1 (browser default if omitted) or 0. The scrolling arg should
\r
18 be 'auto' (default if omitted), 'yes' or 'no'.
\r
20 function OLiframeContent(src, width, height, name, frameborder, scrolling) {
\r
22 /* stupid safari iframe location caching... */
\r
24 var unique = d.getTime() + '' + Math.floor(1000 * Math.random());
\r
25 name = name + '' + unique;
\r
27 return ('<iframe src="'+src+'" width="'+width+'" height="'+height+'"'
\r
28 +(name!=null?' name="'+name+'" id="'+name+'"':'')
\r
29 +(frameborder!=null?' frameborder="'+frameborder+'"':'')
\r
30 +' scrolling="'+(scrolling!=null?scrolling:'auto')
\r
31 +'"><div>[iframe not supported]</div></iframe>');
\r
35 Swap the src if we are iframe content. The name arg should be the same
\r
36 string as in the OLiframeContent function for the popup. The src arg is
\r
37 a partial, relative, or complete URL for the document to be swapped in.
\r
39 function OLswapIframeSrc(name, src){
\r
41 alert(src+'\n\n is only for iframe content');
\r
44 var o=parent.OLgetRef(name);
\r
46 else alert(src+'\n\n is not available');
\r
50 Emulate the Back button if we are iframe content. Use only in documents
\r
51 which are swapped in by using the OLswapIframeSrc function.
\r
53 function OLiframeBack(){
\r
55 alert('This feature is only for iframe content');
\r