MediaWiki:Common.js: Difference between revisions

From Obsidian Scheduler
Jump to navigationJump to search
No edit summary
No edit summary
Line 36: Line 36:


function CustomizeModificationsOfSidebar() {
function CustomizeModificationsOfSidebar() {
         var string = '<!-- BoldChat Live Chat Button HTML v5.00 (Type=Web,ChatButton=My Chat Button - Medium,Website=- None -) -->';
         var html = '<!-- BoldChat Live Chat Button HTML v5.00 (Type=Web,ChatButton=My Chat Button - Medium,Website=- None -) -->';
ModifySidebar( 'add', 'toolbox', html );
ModifySidebar( 'add', 'toolbox', html );
}
}


jQuery( CustomizeModificationsOfSidebar );
jQuery( CustomizeModificationsOfSidebar );

Revision as of 16:28, 30 March 2021

function ModifySidebar( action, section, html ) {
	try {
		switch ( section ) {
			case 'languages':
				var target = 'p-lang';
				break;
			case 'toolbox':
				var target = 'p-tb';
				break;
			case 'navigation':
				var target = 'p-navigation';
				break;
			default:
				var target = 'p-' + section;
				break;
		}

		if ( action == 'add' ) {
			var node = document.getElementById( target )
							   .getElementsByTagName( 'div' )[0]
							   .getElementsByTagName( 'ul' )[0];

			var divNode = document.createElement( 'div' );
 			divNode.innerHTML = html;
			node.appendChild( divNode );
		}

		


	} catch( e ) {
		// let's just ignore what's happened
		return;
	}
}

function CustomizeModificationsOfSidebar() {
        var html = '<!-- BoldChat Live Chat Button HTML v5.00 (Type=Web,ChatButton=My Chat Button - Medium,Website=- None -) -->';
	ModifySidebar( 'add', 'toolbox', html );
}

jQuery( CustomizeModificationsOfSidebar );