PageSourceSearch

https://www.thesettlersonline.net/sites/default/themes/common/js/common/menu.js

js thesettlersonline.net collected 2026-09-29 22:10:46 UTC 1,588 bytes, 44 lines download raw bytes

1require(['/sites/default/themes/common/js/common/form.js'], function() {
2	window.addEvent( 'domready', function() {
3		[ 'menu', 'submenu' ].each( function( menuIdent ) { 
4			var menu = document.id( menuIdent );
5			if( !menu ) {
6				return;
7			}
8			menu.getElements( '.doi' ).each( function( element ) {
9				element.addEvent( 'click', function( e ) {
10					e.stop();
11					var type = element.get( 'class' ).match( /doi_\w*/ );
12					// workaround: do not continue redirecting people if we try accessing the shop page
13					const redirect = element.classList.contains('doi_shop2') ? undefined : element.getElement('a').get('href');
14					gm_DialogHandler.add( new gm_dialog_DoiRepeat( window[ 'doiText_' + type[ 0 ] + '_title' ], window[ 'doiText_' + type[ 0 ] + '_text' ], redirect ) );
15					return false;
16				} )
17			} );
18		} );
19
20		const shopNeedsDoi = $$('#menu .doi.doi_shop2').length > 0
21		if (shopNeedsDoi) {
22			$$('#promotionShopLink').each( function(element) {
23				element.addEvent('click', function(e) {
24					e.stop();
25					gm_DialogHandler.add(new gm_dialog_DoiRepeat(window.doiText_doi_shop2_title, window.doiText_doi_shop2_text));
26					return false;
27				})
28			});
29		}
30
31		// game language selector
32		if( document.id( 'gameLanguageForm' ) ) {
33			var gameLanguageForm = new gm_Form( document.id( 'gameLanguageForm' ), {
34				continueOnStatusFailed: true
35				,continueOnStatusOkay: true
36			} );
37
38			document.id( 'gameLanguageForm' ).getElements( 'input' ).addEvent( 'change', function() {
39				gameLanguageForm.onSubmit();
40			} );
41		}
42		
43	} );
44});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.