modules/dashboard-ui/dashboard-ui-core/src/main/webapp/js-api/dashbuilder-1.0.0.js
/*
 * Embeds iframe to show a given KPI url
 */
Embeds iframe to show a given KPI url
Embeds iframe to show a given KPI url
function dashbuilder_embed_iframe(idElement, frameURL, kpi, width, height, scrolling, autoResize, maxWidth, maxHeight ) {
    mframe = document.createElement("IFRAME");
    mframe.id = "iframe_"+idElement;
    mframe.setAttribute("src", frameURL);
    if( scrolling) {
        mframe.setAttribute("scrolling", "auto");
    } else {
        mframe.setAttribute("scrolling", "no");
    }
    var styles = "";
    mframe.width  = width+"px";
    mframe.height = height+"px";
    if( maxWidth ) {
        styles +="max-width:"+maxWidth+"px;";
    }
    if( maxHeight ) {
        styles +="max-height:"+maxHeight+"px;";
    }
    styles +="border:0px;";
    styles +="margin:0px;";
    styles +="padding:0px;";
    mframe.style.cssText = styles;
    if( autoResize ) {
        mframe.onload = function() {
            dashbuilder_autoResize(mframe.id);
            dashbuilder_callback_end_load(idElement, kpi);
        }
    } else {
        mframe.onload = function() {
            dashbuilder_callback_end_load(idElement, kpi);
        }
    }
    mdiv = document.createElement("DIV");
    mdiv.id = "title_"+idElement;
    var myElement = document.getElementById(idElement);
    while (myElement.firstChild) {
        myElement.removeChild(myElement.firstChild);
    }
    myElement.appendChild(mdiv);
    myElement.appendChild(mframe);
    dashbuilder_callback_start_load(idElement, kpi);
}
function dashbuilder_embed_iframe ( idElement , frameURL , kpi , width , height , scrolling , autoResize , maxWidth , maxHeight ) { mframe = document . createElement ( "IFRAME" ) ; mframe . id = "iframe_" + idElement ; mframe . setAttribute ( "src" , frameURL ) ; if ( scrolling ) { mframe . setAttribute ( "scrolling" , "auto" ) ; } else { mframe . setAttribute ( "scrolling" , "no" ) ; } var styles = "" ; mframe . width = width + "px" ; mframe . height = height + "px" ; if ( maxWidth ) { styles += "max-width:" + maxWidth + "px;" ; } if ( maxHeight ) { styles += "max-height:" + maxHeight + "px;" ; } styles += "border:0px;" ; styles += "margin:0px;" ; styles += "padding:0px;" ; mframe . style . cssText = styles ; if ( autoResize ) { mframe . onload = function ( ) { dashbuilder_autoResize ( mframe . id ) ; dashbuilder_callback_end_load ( idElement , kpi ) ; } } else { mframe . onload = function ( ) { dashbuilder_callback_end_load ( idElement , kpi ) ; } } mdiv = document . createElement ( "DIV" ) ; mdiv . id = "title_" + idElement ; var myElement = document . getElementById ( idElement ) ; while ( myElement . firstChild ) { myElement . removeChild ( myElement . firstChild ) ; } myElement . appendChild ( mdiv ) ; myElement . appendChild ( mframe ) ; dashbuilder_callback_start_load ( idElement , kpi ) ; }
Embeds iframe to show a given KPI url
Embeds iframe to show a given KPI url
// Create new IFRAME element // Create new DIV element // Create a DIV element on top to display 'loading message'. // Ensure the target DOM element has no chidren // Append the iframe plus the loading div