/* Copyright (c) 2004-2006, The Dojo Foundation All Rights Reserved. Licensed under the Academic Free License version 2.1 or above OR the modified BSD license. For more information on Dojo licensing, see: http://dojotoolkit.org/community/licensing.shtml */ dojo.provide("dojo.html.iframe"); dojo.require("dojo.html.util"); // thanks burstlib! dojo.html.iframeContentWindow = function(/* HTMLIFrameElement */iframe_el) { // summary // returns the window reference of the passed iframe var win = dojo.html.getDocumentWindow(dojo.html.iframeContentDocument(iframe_el)) || // Moz. TODO: is this available when defaultView isn't? dojo.html.iframeContentDocument(iframe_el).__parent__ || (iframe_el.name && document.frames[iframe_el.name]) || null; return win; // Window } dojo.html.iframeContentDocument = function(/* HTMLIFrameElement */iframe_el){ // summary // returns a reference to the document object inside iframe_el var doc = iframe_el.contentDocument // W3 || ((iframe_el.contentWindow)&&(iframe_el.contentWindow.document)) // IE || ((iframe_el.name)&&(document.frames[iframe_el.name])&&(document.frames[iframe_el.name].document)) || null; return doc; // HTMLDocument } dojo.html.BackgroundIframe = function(/* HTMLElement */node) { // summary // For IE z-index schenanigans // Two possible uses: // 1. new dojo.html.BackgroundIframe(node) // Makes a background iframe as a child of node, that fills area (and position) of node // 2. new dojo.html.BackgroundIframe() // Attaches frame to dojo.body(). User must call size() to set size. if(dojo.render.html.ie55 || dojo.render.html.ie60) { var html="