|
@@ -1,19 +1,20 @@
|
|
|
var onDocumentLoad = function ( event ) {
|
|
|
|
|
|
var path;
|
|
|
- var section = /\/(manual|api)\//.exec( window.location.pathname )[ 1 ].toString().split( '.html' )[ 0 ];
|
|
|
- var name = /[\-A-z0-9]+\.html/.exec( window.location.pathname ).toString().split( '.html' )[ 0 ];
|
|
|
+ var pathname = window.location.pathname;
|
|
|
+ var section = /\/(manual|api)\//.exec( pathname )[ 1 ].toString().split( '.html' )[ 0 ];
|
|
|
+ var name = /[\-A-z0-9]+\.html/.exec( pathname ).toString().split( '.html' )[ 0 ];
|
|
|
|
|
|
if ( section == 'manual' ) {
|
|
|
|
|
|
name = name.replace(/\-/g, ' ');
|
|
|
|
|
|
- path = window.location.pathname.replace( /\ /g, '-' );
|
|
|
+ path = pathname.replace( /\ /g, '-' );
|
|
|
path = /\/manual\/[-a-z0-9\/]+/.exec( path ).toString().substr( 8 );
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- path = /\/api\/[A-z0-9\/]+/.exec( window.location.pathname ).toString().substr( 5 );
|
|
|
+ path = /\/api\/[A-z0-9\/]+/.exec( pathname ).toString().substr( 5 );
|
|
|
|
|
|
}
|
|
|
|