MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus Kurhaus Schärding
Wechseln zu: Navigation, Suche
Zeile 1: Zeile 1:
 +
 +
<!--Cookie Consent-->
 +
 +
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" />
 +
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
 +
<script>
 +
window.addEventListener("load", function(){
 +
window.cookieconsent.initialise({
 +
  "palette": {
 +
    "popup": {
 +
      "background": "#efefef",
 +
      "text": "#404040"
 +
    },
 +
    "button": {
 +
      "background": "#8ec760",
 +
      "text": "#ffffff"
 +
    }
 +
  },
 +
  "position": "bottom-left",
 +
  "content": {
 +
    "message": "Diese Website nutzt Cookies, um Ihnen bestmögliche Funktionalität bieten zu können.",
 +
    "dismiss": "Verstanden",
 +
    "link": "Datenschutz",
 +
    "href": "https://wiki.kurhaus-schaerding.at/wiki/Kurhaus_Sch%C3%A4rding:Datenschutz"
 +
  }
 +
})});
 +
</script>
 +
  
 
function ModifySidebar( action, section, name, link ) {
 
function ModifySidebar( action, section, name, link ) {

Version vom 31. Januar 2019, 21:25 Uhr


<!--Cookie Consent-->

<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function(){
window.cookieconsent.initialise({
  "palette": {
    "popup": {
      "background": "#efefef",
      "text": "#404040"
    },
    "button": {
      "background": "#8ec760",
      "text": "#ffffff"
    }
  },
  "position": "bottom-left",
  "content": {
    "message": "Diese Website nutzt Cookies, um Ihnen bestmögliche Funktionalität bieten zu können.",
    "dismiss": "Verstanden",
    "link": "Datenschutz",
    "href": "https://wiki.kurhaus-schaerding.at/wiki/Kurhaus_Sch%C3%A4rding:Datenschutz"
  }
})});
</script>


function ModifySidebar( action, section, name, link ) {
	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 aNode = document.createElement( 'a' );
			var liNode = document.createElement( 'li' );

aNode.appendChild( document.createTextNode( name ) );
			aNode.setAttribute( 'href', link );
			liNode.appendChild( aNode );
			liNode.className = 'plainlinks';
			node.appendChild( liNode );
		}

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

var listelements = list.getElementsByTagName( 'li' );

for ( var i = 0; i < listelements.length; i++ ) {
				if (
					listelements[i].getElementsByTagName( 'a' )[0].innerHTML == name ||
					listelements[i].getElementsByTagName( 'a' )[0].href == link
				)
				{
					list.removeChild( listelements[i] );
				}
			}
		}


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

function CustomizeModificationsOfSidebar() {
	// adds [[Special:CategoryTree|Special:CategoryTree]] to toolbox
	ModifySidebar( 'add', 'toolbox', 'CategoryTree', 'http://p456196.mittwaldserver.info/wiki/Special:CategoryTree' );
	// removes [[Special:Upload|Special:Upload]] from toolbox
	ModifySidebar( 'remove', 'toolbox', 'Upload file', 'http://p456196.mittwaldserver.info/wiki/Special:Upload' );
}

jQuery( CustomizeModificationsOfSidebar );