nl_tokens: Merges a scene configuration into the current configuration .
pl_tokens: function mergeConfig ( sceneId ) { config = { } ; var k , s ; var photoSphereExcludes = [ 'haov' , 'vaov' , 'vOffset' , 'northOffset' , 'horizonPitch' , 'horizonRoll' ] ; specifiedPhotoSphereExcludes = [ ] ; // Merge default config for ( k in defaultConfig ) { if ( defaultConfig . hasOwnProperty ( k ) ) { config [ k ] = defaultConfig [ k ] ; } } // Merge default scene config for ( k in initialConfig . default ) { if ( initialConfig . default . hasOwnProperty ( k ) ) { if ( k == 'strings' ) { for ( s in initialConfig . default . strings ) { if ( initialConfig . default . strings . hasOwnProperty ( s ) ) { config . strings [ s ] = escapeHTML ( initialConfig . default . strings [ s ] ) ; } } } else { config [ k ] = initialConfig . default [ k ] ; if ( photoSphereExcludes . indexOf ( k ) >= 0 ) { specifiedPhotoSphereExcludes . push ( k ) ; } } } } // Merge current scene config if ( ( sceneId !== null ) && ( sceneId !== '' ) && ( initialConfig . scenes ) && ( initialConfig . scenes [ sceneId ] ) ) { var scene = initialConfig . scenes [ sceneId ] ; for ( k in scene ) { if ( scene . hasOwnProperty ( k ) ) { if ( k == 'strings' ) { for ( s in scene . strings ) { if ( scene . strings . hasOwnProperty ( s ) ) { config . strings [ s ] = escapeHTML ( scene . strings [ s ] ) ; } } } else { config [ k ] = scene [ k ] ; if ( photoSphereExcludes . indexOf ( k ) >= 0 ) { specifiedPhotoSphereExcludes . <mask> ( k ) ; } } } } config . scene = sceneId ; } // Merge initial config for ( k in initialConfig ) { if ( initialConfig . hasOwnProperty ( k ) ) { if ( k == 'strings' ) { for ( s in initialConfig . strings ) { if ( initialConfig . strings . hasOwnProperty ( s ) ) { config . strings [ s ] = escapeHTML ( initialConfig . strings [ s ] ) ; } } } else { config [ k ] = initialConfig [ k ] ; if ( photoSphereExcludes . indexOf ( k ) >= 0 ) { specifiedPhotoSphereExcludes . push ( k ) ; } } } } }