2011-03-21 22:01:15 -04:00
|
|
|
/**
|
|
|
|
* Makes HTML documentation interactive
|
|
|
|
*/
|
|
|
|
|
|
|
|
var head = document.getElementsByTagName( 'head' )[ 0 ],
|
|
|
|
sjquery = document.createElement( 'script' ),
|
|
|
|
sjquery_ui = document.createElement( 'script' ),
|
|
|
|
css = document.createElement( 'link' );
|
|
|
|
|
|
|
|
sjquery.type = sjquery_ui.type = 'text/javascript';
|
|
|
|
|
|
|
|
css.type = 'text/css';
|
|
|
|
css.rel = 'stylesheet';
|
|
|
|
|
|
|
|
sjquery.src =
|
|
|
|
'https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js';
|
|
|
|
sjquery_ui.src =
|
|
|
|
'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js';
|
|
|
|
css.href =
|
|
|
|
'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/base/jquery-ui.css';
|
|
|
|
|
|
|
|
head.appendChild( sjquery );
|
|
|
|
head.appendChild( sjquery_ui );
|
|
|
|
head.appendChild( css );
|
2011-03-21 21:09:36 -04:00
|
|
|
|
2011-06-05 11:18:41 -04:00
|
|
|
// will call callback when jQuery has been loaded
|
|
|
|
function jqueryCheck( callback )
|
|
|
|
{
|
|
|
|
if ( typeof $ === 'undefined' )
|
|
|
|
{
|
|
|
|
// check again in 50ms
|
|
|
|
setTimeout( function()
|
|
|
|
{
|
|
|
|
jqueryCheck( callback );
|
|
|
|
}, 50 );
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
callback();
|
|
|
|
}
|
|
|
|
|
|
|
|
jqueryCheck( function()
|
|
|
|
{
|
|
|
|
$( document ).ready( function()
|
|
|
|
{
|
|
|
|
// syntax highlighting for code samples
|
|
|
|
$( '.verbatim, .samp, .code, .example' ).each( function( i, element )
|
|
|
|
{
|
|
|
|
hljs.highlightBlock( element, ' ' );
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|
|