skip to content

Latest News

CI:A - Certus In Audio - Latest News: read latest news from CI:A (general and special topics)

CI:A - Certus In Audio
Latest News

News

New API: Iframer [en]

CI:A - Certus In Audio (cia) / 21 Apr 2020
CI:A
Latest News >>CI:A

Iframer (v1.0.0-20200421)

 

Dear user,

we would like to announce that we have added the new API(s)/file(s) 'Iframer' on this site. As you may already know, we provide on this website so-called APIs that can be freely used. These APIs have different purposes of use, e.g. 'qrcode' for creating QR codes etc. The respective purpose of use and information about the usage of the individual APIs can be found in the corresponding help texts. Some APIs also have user interfaces (or wizards) to facilitate their use.

The following list contains all files included to the API 'Iframer':
 

iframer.js (application/javascript , 11321 bytes)

 

iframer.js:
function initFramedPageContainer( arrOptions ) { var strJQuerySource = 'http://certus.in/site/jquery_1_11_0.js'; var strIFrameResizerSource = 'http://certus.in/site/iframeresizer.js'; var strAllowFramedPageParameterName = 'afpapi'; var strFrameOriginParameterName = 'origin'; var strContentPageOrigin = 'http://certus.in'; var strCFN = arguments.callee.toString().substr( 0 , arguments.callee.toString().indexOf( '(' ) ).substr( 'function '.length ); arrOptions = arrOptions || null; if( Object.prototype.toString.call( arrOptions ) !== '[object Object]' ) { return false; } if( ! ( 'container' in arrOptions ) ) { if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.error( '[' + strCFN + '] missing option "container" (iframe element id)!' ); } return false; } var objContainer = document.getElementById( arrOptions[ 'container' ] ); if( ( objContainer == undefined ) || ( objContainer === null ) ) { document.write( '<iframe id="' + arrOptions[ 'container' ] + '" src="about:blank" scrolling="no"></iframe>' ); objContainer = document.getElementById( arrOptions[ 'container' ] ); if( ( objContainer == undefined ) || ( objContainer === null ) ) { if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.error( '[' + strCFN + '] container "' + arrOptions[ 'container' ] + '" not found!' ); } return false; } } var strContainerWidth = '100%'; if( ( 'initialwidth' in arrOptions ) ) { strContainerWidth = arrOptions[ 'initialwidth' ]; } if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.info( '[' + strCFN + '] using initial width "' + strContainerWidth + '".' ); } var strContainerHeight = '300px'; if( ( 'initialheight' in arrOptions ) ) { strContainerHeight = arrOptions[ 'initialheight' ]; } if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.info( '[' + strCFN + '] using initial height "' + strContainerHeight + '".' ); } objContainer.style.width = strContainerWidth; objContainer.style.height = strContainerHeight; objContainer.style.padding = '0px'; objContainer.style.margin = '0px'; objContainer.style.border = '0px'; objContainer.style.visibility = 'hidden'; objContainer.style.overflow = 'hidden'; objContainer.src = 'about:blank'; var bUseIFrameResizer = false; if( ( 'useiframeresizer' in arrOptions ) ) { if( ( arrOptions[ 'useiframeresizer' ] === true ) || ( arrOptions[ 'useiframeresizer' ] === 1 ) || ( arrOptions[ 'useiframeresizer' ] === '1' ) ) { bUseIFrameResizer = true; } } if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.info( '[' + strCFN + '] using ' + ( ( bUseIFrameResizer ) ? 'iframeresizer framework' : 'native functions' ) + '.' ); } if( ! ( 'afpserial' in arrOptions ) ) { if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.error( '[' + strCFN + '] missing option "afpserial"!' ); } return false; } if( ! ( 'origin' in arrOptions ) ) { if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.error( '[' + strCFN + '] missing option "origin"!' ); } return false; } if( ! ( 'url' in arrOptions ) ) { if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.error( '[' + strCFN + '] missing option "url"!' ); } return false; } var strURL = arrOptions[ 'url' ] + ( ( arrOptions[ 'url' ].indexOf( '?' ) > -1 ) ? '&' : '?' ) + strAllowFramedPageParameterName + '=' + arrOptions[ 'afpserial' ] + '&' + strFrameOriginParameterName + '=' + arrOptions[ 'origin' ]; if( ( 'contentonly' in arrOptions ) && ( ( arrOptions[ 'contentonly' ] === true ) || ( arrOptions[ 'contentonly' ] === 1 ) || ( arrOptions[ 'contentonly' ] === '1' ) ) ) { strURL += '&contentonly=1'; } if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.info( '[' + strCFN + '] url -> ' + strURL + '.' ); } if( bUseIFrameResizer ) { var objS1 = document.createElement( 'script' ); objS1.type = 'text/javascript'; objS1.src = strJQuerySource; document.getElementsByTagName( 'head' )[ 0 ].appendChild( objS1 ); objS1.addEventListener( 'load' , function() { var objS2 = document.createElement( 'script' ); objS2.type = 'text/javascript'; objS2.src = strIFrameResizerSource; document.getElementsByTagName( 'head' )[ 0 ].appendChild( objS2 ); objS2.addEventListener( 'load' , function() { objContainer.src = strURL; objContainer.style.visibility = 'visible'; $( 'iframe' ).iFrameResize( { heightCalculationMethod : 'lowestElement' } ); } , false ); } , false ); return true; } objContainer.src = strURL; window.strLastPageContainerTitle = ''; window.strLastPageContainerURL = ''; window.strLastPageContainerHeight = 0; window.strLastPageContainerWidth = 0; window.addEventListener( 'message' , function( e ) { if( ( 'callback' in arrOptions ) && ( typeof arrOptions[ 'callback' ] == 'string' ) ) { window[ arrOptions[ 'callback' ] ]( 0 , e ); } if( e.origin !== strContentPageOrigin ) { if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.error( '[' + strCFN + '] content page origin rejected "' + strContentPageOrigin + '"!' ); } return false; } else { var strData = e.data; if( strData.substr( 0 , 6 ) == 'title:' ) { strData = strData.substr( 6 ); if( ( 'callback' in arrOptions ) && ( typeof arrOptions[ 'callback' ] == 'string' ) ) { window[ arrOptions[ 'callback' ] ]( 1 , strData ); } if( window.strLastPageContainerTitle != strData ) { if( ( 'callback' in arrOptions ) && ( typeof arrOptions[ 'callback' ] == 'string' ) ) { window[ arrOptions[ 'callback' ] ]( 2 , strData ); } if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.info( '[' + strCFN + '] title changed from "' + window.strLastPageContainerTitle + '" to "' + strData + '".' ); } window.strLastPageContainerTitle = strData; if( ( 'resetsize' in arrOptions ) && ( ( arrOptions[ 'resetsize' ] === true ) || ( arrOptions[ 'resetsize' ] === 1 ) || ( arrOptions[ 'resetsize' ] === '1' ) ) ) { objContainer.style.visibility = 'hidden'; objContainer.style.width = strContainerWidth; objContainer.style.height = strContainerHeight; } if( ( 'refreshtitle' in arrOptions ) ) { if( ( arrOptions[ 'refreshtitle' ] === true ) || ( arrOptions[ 'refreshtitle' ] === 1 ) || ( arrOptions[ 'refreshtitle' ] === '1' ) ) { if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.info( '[' + strCFN + '] refreshing title "' + strData + '".' ); } document.title = strData; } } } return true; } if( strData.substr( 0 , 4 ) == 'url:' ) { strData = strData.substr( 4 ); if( ( 'callback' in arrOptions ) && ( typeof arrOptions[ 'callback' ] == 'string' ) ) { window[ arrOptions[ 'callback' ] ]( 3 , strData ); } if( window.strLastPageContainerURL != strData ) { if( ( 'callback' in arrOptions ) && ( typeof arrOptions[ 'callback' ] == 'string' ) ) { window[ arrOptions[ 'callback' ] ]( 4 , strData ); } if( ( 'contentonly' in arrOptions ) && ( ( arrOptions[ 'contentonly' ] === true ) || ( arrOptions[ 'contentonly' ] === 1 ) || ( arrOptions[ 'contentonly' ] === '1' ) ) ) { if( strData.indexOf( 'contentonly' ) < 0 ) { var strNURL = strData + ( ( strData.indexOf( '?' ) > -1 ) ? '&' : '?' ) + 'contentonly=1'; if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.info( '[' + strCFN + '] reload url with content-only option (' + strNURL + ').' ); } if( ( 'resetsize' in arrOptions ) && ( ( arrOptions[ 'resetsize' ] === true ) || ( arrOptions[ 'resetsize' ] === 1 ) || ( arrOptions[ 'resetsize' ] === '1' ) ) ) { objContainer.style.visibility = 'hidden'; objContainer.style.width = strContainerWidth; objContainer.style.height = strContainerHeight; } objContainer.src = strNURL; window.strLastPageContainerURL = strNURL; return true; } } if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.info( '[' + strCFN + '] url changed from "' + window.strLastPageContainerURL + '" to "' + strData + '".' ); } window.strLastPageContainerURL = strData; if( ( 'resetsize' in arrOptions ) && ( ( arrOptions[ 'resetsize' ] === true ) || ( arrOptions[ 'resetsize' ] === 1 ) || ( arrOptions[ 'resetsize' ] === '1' ) ) ) { objContainer.style.visibility = 'hidden'; objContainer.style.width = strContainerWidth; objContainer.style.height = strContainerHeight; } } return true; } if( strData.substr( 0 , 7 ) == 'height:' ) { strData = parseInt( strData.substr( 7 ) ); if( ( 'callback' in arrOptions ) && ( typeof arrOptions[ 'callback' ] == 'string' ) ) { window[ arrOptions[ 'callback' ] ]( 5 , strData ); } if( window.strLastPageContainerHeight != strData ) { if( ( 'callback' in arrOptions ) && ( typeof arrOptions[ 'callback' ] == 'string' ) ) { window[ arrOptions[ 'callback' ] ]( 6 , strData ); } if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.info( '[' + strCFN + '] height changed from "' + window.strLastPageContainerHeight + '" to "' + strData + '".' ); } window.strLastPageContainerHeight = strData; objContainer.style.height = strData + 'px'; objContainer.style.visibility = 'visible'; } return true; } if( strData.substr( 0 , 6 ) == 'width:' ) { if( ( 'refreshwidth' in arrOptions ) ) { if( ( arrOptions[ 'refreshwidth' ] === true ) || ( arrOptions[ 'refreshwidth' ] === 1 ) || ( arrOptions[ 'refreshwidth' ] === '1' ) ) { strData = parseInt( strData.substr( 6 ) ); if( ( 'callback' in arrOptions ) && ( typeof arrOptions[ 'callback' ] == 'string' ) ) { window[ arrOptions[ 'callback' ] ]( 7 , strData ); } if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.info( '[' + strCFN + '] trying to change width to "' + strData + '".' ); } if( window.strLastPageContainerWidth != strData ) { if( ( 'callback' in arrOptions ) && ( typeof arrOptions[ 'callback' ] == 'string' ) ) { window[ arrOptions[ 'callback' ] ]( 8 , strData ); } if( ( 'log' in arrOptions ) && ( ( arrOptions[ 'log' ] === true ) || ( arrOptions[ 'log' ] === 1 ) || ( arrOptions[ 'log' ] === '1' ) ) ) { console.info( '[' + strCFN + '] width changed from "' + window.strLastPageContainerWidth + '" to "' + strData + '".' ); } window.strLastPageContainerWidth = strData; objContainer.style.width = strData + 'px'; objContainer.style.visibility = 'visible'; } } } return true; } } } , false ); return true; }

 

We hope you find this API useful.

Best regards,
CI:A - Certus In Audio

Last changed: 21 Apr 2020

Back

 

We hope you find this API useful.

Best regards,
CI:A - Certus In Audio

Last changed: 21 Apr 2020

Back

RSS-Feed »

 


© 2020 CI:A - Certus In Audio
[Legal Disclosure] [Disclaimer]
[Privacy Statement] [T&C]
[Sitemap] [Contact] [Help/Infos] [Team] [Jobs]


Language: [en] [de] [de]
Font Size: [+] [-] [*]

Setting: [X] CSS | [X] JS | [X] SMM | [X] TT | [ ] PF



[Home] [HTTP] [QR Code] [Bar Code] [News Feed] [Word List] [Plain Text] [Content Only] [Files]



 |  | 

Online: 20 users | Hits: 7.769 (Today: 452)

WelcomeHelp/InfosLatest NewsPrivacy StatementSitemap
- statistics recorded since 05 Sep 2020 (22 days) -

Page generated in 0.06 seconds.
Waiting-Room: requests = 2 (1) | delay = 0 seconds

268.248.248 -