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


jQuery( CustomizeModificationsOfSidebar );
jQuery( CustomizeModificationsOfSidebar );

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

jQuery( CustomizeModificationsOfSidebar );