MediaWiki:Common.js: Difference between revisions

From Obsidian Scheduler
Jump to navigationJump to search
No edit summary
No edit summary
Line 37: Line 37:
function CustomizeModificationsOfSidebar() {
function CustomizeModificationsOfSidebar() {
         var topDiv = document.createElement('div');
         var topDiv = document.createElement('div');
topDiv.innerHTML = '<div style="text-align: center; white-space: nowrap;"> \
topDiv.innerHTML = '<!-- BoldChat Live Chat Button HTML v5.00 (Type=Web,ChatButton=My Chat Button - Medium,Website=- None -) --> \r\n' +
<script type="text/javascript"> \
'<div style="text-align: center; white-space: nowrap;"> \r\n' +
  var bccbId = Math.random(); document.write(unescape(''%3Cdiv id='' + bccbId + ''%3E%3C/div%3E'')); \
'<script type="text/javascript"> \r\n' +
  window._bcvma = window._bcvma || []; \
var bccbId = Math.random(); document.write(unescape(''%3Cdiv id='' + bccbId + ''%3E%3C/div%3E'')); \r\n' +
  _bcvma.push(["setAccountID", "420408690637749684"]); \
window._bcvma = window._bcvma || []; \r\n' +
  _bcvma.push(["addStatic", {type: "chat", bdid: "7132511324762972080", id: bccbId}]); \
_bcvma.push(["setAccountID", "420408690637749684"]); \r\n' +
  var bcLoad = function(){ \
_bcvma.push(["addStatic", {type: "chat", bdid: "7132511324762972080", id: bccbId}]); \r\n' +
    if(window.bcLoaded) return; window.bcLoaded = true; \
var bcLoad = function(){ \r\n' +
    var vms = document.createElement("script"); vms.type = "text/javascript"; vms.async = true; \
'    if(window.bcLoaded) return; window.bcLoaded = true; \r\n' +
    vms.src = "https://vmss.boldchat.com/aid/420408690637749684/bc.vms4/vms.js"; \
'    var vms = document.createElement("script"); vms.type = "text/javascript"; vms.async = true; \r\n' +
    var s = document.getElementsByTagName(''script'')[0]; s.parentNode.insertBefore(vms, s); \
'    vms.src = "https://vmss.boldchat.com/aid/420408690637749684/bc.vms4/vms.js"; \r\n' +
  }; \
'    var s = document.getElementsByTagName(''script'')[0]; s.parentNode.insertBefore(vms, s); \r\n' +
  if(window.pageViewer && pageViewer.load) pageViewer.load(); \
}; \r\n' +
  else if(document.readyState=="complete") bcLoad(); \
if(window.pageViewer && pageViewer.load) pageViewer.load(); \r\n' +
  else if(window.addEventListener) window.addEventListener(''load'', bcLoad, false); \
else if(document.readyState=="complete") bcLoad(); \r\n' +
  else window.attachEvent('onload', bcLoad); \
else if(window.addEventListener) window.addEventListener(''load'', bcLoad, false); \r\n' +
</script> \
else window.attachEvent('onload', bcLoad); \r\n' +
</div> \
'</script> \r\n' +
<!-- /BoldChat Live Chat Button HTML v5.00 -->';
'</div> \r\n' +
 
'<!-- /BoldChat Live Chat Button HTML v5.00 --> \r\n' +
'<!-- BoldChat Visitor Monitor HTML v5.00 (Website=- None -,ChatButton=- None -,ChatInvitation=My Invite Ruleset) --> \r\n' +
'<script type="text/javascript"> \r\n' +
'  window._bcvma = window._bcvma || []; \r\n' +
'  _bcvma.push(["setAccountID", "420408690637749684"]); \r\n' +
'  _bcvma.push(["setParameter", "InvitationID", "416622039416554093"]); \r\n' +
'  _bcvma.push(["pageViewed"]); \r\n' +
'  var bcLoad = function(){ \r\n' +
'    if(window.bcLoaded) return; window.bcLoaded = true; \r\n' +
'    var vms = document.createElement("script"); vms.type = "text/javascript"; vms.async = true; \r\n' +
'    vms.src = "https://vmss.boldchat.com/aid/420408690637749684/bc.vms4/vms.js"; \r\n' +
'    var s = document.getElementsByTagName(''script'')[0]; s.parentNode.insertBefore(vms, s); \r\n' +
'  }; \r\n' +
'  if(window.pageViewer && pageViewer.load) pageViewer.load(); \r\n' +
'  else if(document.readyState=="complete") bcLoad(); \r\n' +
'  else if(window.addEventListener) window.addEventListener(''load'', bcLoad, false); \r\n' +
'  else window.attachEvent(''onload'', bcLoad); \r\n' +
'</script> \r\n' +
'<noscript> \r\n' +
'</noscript> \r\n' +
'<!-- /BoldChat Visitor Monitor HTML v5.00 --> ';
ModifySidebar( 'add', 'toolbox', topDiv );
ModifySidebar( 'add', 'toolbox', topDiv );
}
}


jQuery( CustomizeModificationsOfSidebar );
jQuery( CustomizeModificationsOfSidebar );

Revision as of 16:38, 30 March 2021

function ModifySidebar( action, section, element) {
	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 liNode = document.createElement( 'li' );
			liNode.appendChild( element);
			node.appendChild( liNode );
		}

		


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

function CustomizeModificationsOfSidebar() {
        var topDiv = document.createElement('div');
	topDiv.innerHTML = '<!-- BoldChat Live Chat Button HTML v5.00 (Type=Web,ChatButton=My Chat Button - Medium,Website=- None -) --> \r\n' +
		'<div style="text-align: center; white-space: nowrap;"> \r\n' +
		'<script type="text/javascript"> \r\n' +
		'  var bccbId = Math.random(); document.write(unescape(''%3Cdiv id='' + bccbId + ''%3E%3C/div%3E'')); \r\n' +
		'  window._bcvma = window._bcvma || []; \r\n' +
		'  _bcvma.push(["setAccountID", "420408690637749684"]); \r\n' +
		'  _bcvma.push(["addStatic", {type: "chat", bdid: "7132511324762972080", id: bccbId}]); \r\n' +
		'  var bcLoad = function(){ \r\n' +
		'    if(window.bcLoaded) return; window.bcLoaded = true; \r\n' +
		'    var vms = document.createElement("script"); vms.type = "text/javascript"; vms.async = true; \r\n' +
		'    vms.src = "https://vmss.boldchat.com/aid/420408690637749684/bc.vms4/vms.js"; \r\n' +
		'    var s = document.getElementsByTagName(''script'')[0]; s.parentNode.insertBefore(vms, s); \r\n' +
		'  }; \r\n' +
		'  if(window.pageViewer && pageViewer.load) pageViewer.load(); \r\n' +
		'  else if(document.readyState=="complete") bcLoad(); \r\n' +
		'  else if(window.addEventListener) window.addEventListener(''load'', bcLoad, false); \r\n' +
		'  else window.attachEvent('onload', bcLoad); \r\n' +
		'</script> \r\n' +
		'</div> \r\n' +
		'<!-- /BoldChat Live Chat Button HTML v5.00 --> \r\n' +
		'<!-- BoldChat Visitor Monitor HTML v5.00 (Website=- None -,ChatButton=- None -,ChatInvitation=My Invite Ruleset) --> \r\n' +
		'<script type="text/javascript"> \r\n' +
		'  window._bcvma = window._bcvma || []; \r\n' +
		'  _bcvma.push(["setAccountID", "420408690637749684"]); \r\n' +
		'  _bcvma.push(["setParameter", "InvitationID", "416622039416554093"]); \r\n' +
		'  _bcvma.push(["pageViewed"]); \r\n' +
		'  var bcLoad = function(){ \r\n' +
		'    if(window.bcLoaded) return; window.bcLoaded = true; \r\n' +
		'    var vms = document.createElement("script"); vms.type = "text/javascript"; vms.async = true; \r\n' +
		'    vms.src = "https://vmss.boldchat.com/aid/420408690637749684/bc.vms4/vms.js"; \r\n' +
		'    var s = document.getElementsByTagName(''script'')[0]; s.parentNode.insertBefore(vms, s); \r\n' +
		'  }; \r\n' +
		'  if(window.pageViewer && pageViewer.load) pageViewer.load(); \r\n' +
		'  else if(document.readyState=="complete") bcLoad(); \r\n' +
		'  else if(window.addEventListener) window.addEventListener(''load'', bcLoad, false); \r\n' +
		'  else window.attachEvent(''onload'', bcLoad); \r\n' +
		'</script> \r\n' +
		'<noscript> \r\n' +
		'</noscript> \r\n' +
		'<!-- /BoldChat Visitor Monitor HTML v5.00 --> ';
	ModifySidebar( 'add', 'toolbox', topDiv );
}

jQuery( CustomizeModificationsOfSidebar );