Gebruiker:Josse.Cottenier/vector.js: verschil tussen versies

Uit Wikikids
Naar navigatie springen Naar zoeken springen
(Dat zou moeten werken)
Regel 1: Regel 1:
 
/* JavaScript die hier wordt geplaatst heeft alleen invloed op gebruikers die de skin Vector gebruiken */
 
/* JavaScript die hier wordt geplaatst heeft alleen invloed op gebruikers die de skin Vector gebruiken */
#p-logo a{background-image:url(http://wikikids.wiki.kennisnet.nl/images/b/bc/Wiki.png) !important}table.gallery{background-color:rgb(249,249,249)}table.gallery td{border-color:rgb(249,249,249)}  .wikitable,.wikitable table{border:2px solid;border-collapse:collapse;font-size:95%;margin:1em}.wikitable td,table.wikitable th{border:1px solid;padding:4px}table.wikitable th{border:2px solid}  .wikitable-geel,.wikitable-geel table{border:2px solid #FFFF00;border-collapse:collapse;font-size:95%;margin:1em;background:#FFFFCC}.wikitable-geel td,table.wikitable-geel th{border:1px solid #FFEE00;padding:4px}table.wikitable-geel th{border:2px solid #FFEE00;background:#CCFF66}  .wikitable-rood,.wikitable-rood table{border:2px solid #FF0000;border-collapse:collapse;font-size:95%;margin:1em;background:#FFCC99}.wikitable-rood td,table.wikitable-rood th{border:1px solid #FF6666;padding:4px}table.wikitable-rood th{border:2px solid #FF6666;background:#FF9966} .wikitable-blauw,.wikitable-blauw table{border:2px solid #0000FF;border-collapse:collapse;font-size:95%;margin:1em;background:#99CCFF}.wikitable-blauw td,table.wikitable-blauw th{border:1px solid #3399FF;padding:4px}table.wikitable-blauw th{border:2px solid #3399FF;background:#0066FF} td.diff-otitle,td.diff-ntitle{width:49%} .ns-2 #ca-move,.ns-3 #ca-move{display:none}pre{font-size:13px}select#mw-input-wpExpiry{width:303px;margin-left:2px}select#mw-input-wpReason{width:303px;margin-left:2px}select#wpDeleteReasonList{width:393px;margin-left:2px}select#wpProtectReasonSelection{width:393px;margin-left:2px}.blocklog,.modtools,.page-Wikikids_Blokverzoek input#wpSummary,.page-Wikikids_Blokverzoek .mw-summary,.page-Speciaal_Uploaden .mw-editTools{display:none}div.mw-warning-with-logexcerpt,div.mw-lag-warn-high,div.mw-cascadeprotectedwarning,div#mw-protect-cascadeon{clear:both;margin:0.2em 0;border:1px solid #bb7070;background:#ffdbdb;padding:0.25em 0.9em}div#userlogin .captcha,div#userloginForm .captcha{clear:both;margin:25px;border:1px solid #bb7070;background:#ffdbdb;padding:0.25em 0.9em}div#userlogin form#userlogin2{margin:0 3em 1em 0;border:none;clear:both;padding:1.5em 2em;background-color:#FFFFFF;float:left}div#userlogin form#userlogin2 table{background-color:#FFFFFF} div.opvallend,div.opvallend>div{border:5px #cc0000 solid;margin:5px}div.opvallend>div>div{margin:5px;font-size:125%}#p-MEDIAWIKI_Wikiation_message_sidebar_navigation{display:none}body.page-Hoofdpagina h1.firstHeading{display:none}.minoredit{font-weight:bold}.botedit{font-weight:bold;color:red;border-bottom:1px dotted red}   @media print{  }
+
/**
 +
* Titel_item
 +
*
 +
* Zoek Titel items op (class="Titel_item") (let op de hoofdletter)
 +
* en plaats deze rechts van de titel
 +
* Pas nadat overige titelbewerkingen hebben plaatsgevonden
 +
* (te gebruiken voor bijv. {{Beveiligd}} en {{Semibeveiligd}} zodat deze onder de sluit-knop van de sitenotice komt
 +
*/
 +
function Titel_item() {
 +
  var h1 = document.getElementsByTagName("h1")[0];
 +
  var content = document.getElementById("content");
 +
  var icones = document.getElementsByTagName("div");
 +
  var icones2 = new Array();
 +
  var j = 0;
 +
  for (var i = 0; i < icones.length; ++i) {
 +
    if (icones[i].className == "Titel_item") {
 +
      icones2[j++] = icones[i];
 +
    }
 +
  }
 +
  for (; j > 0; --j) {
 +
    icones2[j-1].style.display = "block"; /* annule display:none par défaut */
 +
    icones2[j-1].style.borderWidth = "1px";
 +
    icones2[j-1].style.borderStyle = "solid";
 +
    icones2[j-1].style.borderColor = "white";
 +
    content.insertBefore(icones2[j-1], h1); /* déplacement de l'élément */
 +
  }
 +
}
 +
   
 +
addOnloadHook(Titel_item);
 +
 +
 +
/* Voor rechterbovenmargesjablonen */
 +
/* Verbeterde versie, werkt beter dan Titel_item() */
 +
 +
function Titel_item3() {
 +
  var h1 = document.getElementsByTagName("h1")[0];
 +
  var content = document.getElementById("content");
 +
  var icones = document.getElementsByTagName("div");
 +
  var icones2 = new Array();
 +
  var j = 0;
 +
  for (var i = 0; i < icones.length; ++i) {
 +
    if (icones[i].className == "Titel_item2") {
 +
      icones2[j++] = icones[i];
 +
    }
 +
  }
 +
  for (; j > 0; --j) {
 +
    icones2[j-1].className = "Titel_item3";
 +
    if (icones2[j-1].id == "Titelbeveiligd" && wgUserName == null){
 +
      icones2[j-1].style.display = "none"; // titelwijzigingssjabloon alleen voor ingelogde gebruikers
 +
    }
 +
    content.insertBefore(icones2[j-1], h1); /* Verplaats het element naar de juiste plek */
 +
  }  
 +
  Titel_toevoegen("templ_Semibeveiligd", h1, content);
 +
  Titel_toevoegen("templ_TitelBeveiligd", h1, content);
 +
  Titel_toevoegen("templ_Beveiligd", h1, content);
 +
  Titel_toevoegen("templ_Commons", h1, content); //staat rechtsboven, wordt geregeld in [[MediaWiki:Sharedupload]]
 +
  Titel_toevoegen("templ_Etalage", h1, content);
 +
  Titel_toevoegen("templ_Woordenboek", h1, content)
 +
  Titel_toevoegen("templ_Coordinaten", h1, content)
 +
}
 +
 +
function Titel_toevoegen(de_div_id, h1, content) {
 +
  if (document.getElementById(de_div_id)){  
 +
    document.getElementById(de_div_id).className = "Titel_item3";
 +
    content.insertBefore(document.getElementById(de_div_id), h1); /* Verplaats het element naar de juiste plek */
 +
  }
 +
}
 +
 +
addOnloadHook(function(){ Titel_item3(); });
 +
//div id's aangepast
 +
 +
/**
 +
* Article history link for SpecialAbuseLog
 +
* @author Krinkle
 +
* @revision 4 (2010-01-28)
 +
* @created January 27, 2011
 +
* @license This script is released in the public domain. Released as-is without guarantee of any kind.
 +
* @stats [[File:Krinkle_SpecialAbuseLog_HistLink.js]]
 +
* @source https://meta.wikimedia.org/wiki/User:Krinkle/Scripts/SpecialAbuseLog_HistLink
 +
*
 +
* Adds an additional (hist) link for article link on Special:AbuseLog
 +
* Is appended after the link in $5 of [[MediaWiki:Abusefilter-log-detailedentry-meta]].
 +
* (due to $5 including the [[ and ]], fullurl: can't be used, hence this work-around
 +
*
 +
* Message:
 +
* $1: $2 triggered $3, performing the action "$4" on $5. Actions taken: $6; Filter description: $7 ($8)
 +
* Sample:
 +
* <div class="mw-specialpage-summary"> <!-- (...) -->  </div>
 +
* <fieldset>
 +
* <p>$1: <a href="/wiki/Special:Contributions/Foo">Foo</a> <span class="mw-usertoollinks">(<a>talk</a> | <a>block</a>)</span> triggered <a>filter 10</a>, performing the action "edit" on <a href="/wiki/Article" title="Article">Article</a>. Action taken: Warn; Filter description: Filternamehere (<a>details</a> | <a>examine</a>)</p>
 +
* <!-- (...) -->
 +
* </fieldset>
 +
*
 +
* The following script assumes that the *third* (0,1,2) anchor link that is a *direct child* of the paragraph tag.
 +
*/
 +
jQuery( function( $ ) {
 +
 +
var histLinkText = 'gesch', // [[MediaWiki:hist]]
 +
linkOffset = 2; // 0 = first. By default the 3rd link is the article link (thus offset = 2)
 +
 +
if ( wgCanonicalSpecialPageName == 'AbuseLog' ) {
 +
$( '.mw-specialpage-summary:first' )
 +
.next( 'fieldset' )
 +
.find( '> p:first > a' )
 +
.eq( linkOffset )
 +
.each( function() {
 +
var $el = $(this),
 +
$histLink = $( '<a>', {
 +
title: $el.attr( 'title' ),
 +
href: $el.attr( 'href' ) + '?action=history',
 +
text: histLinkText
 +
} );
 +
$el.after( ') ' ).after( $histLink ).after( ' (' );
 +
} );
 +
}
 +
} );
  
 
/* cache key: wikikids_kn159:resourceloader:filter:minify-css:4:e1ed7d43a9731d396a701ad8e45fdaa0 */
 
/* cache key: wikikids_kn159:resourceloader:filter:minify-css:4:e1ed7d43a9731d396a701ad8e45fdaa0 */

Versie van 2 aug 2013 12:15

/* JavaScript die hier wordt geplaatst heeft alleen invloed op gebruikers die de skin Vector gebruiken */
/**
 * Titel_item
 * 
 * Zoek Titel items op (class="Titel_item") (let op de hoofdletter)
 * en plaats deze rechts van de titel
 * Pas nadat overige titelbewerkingen hebben plaatsgevonden
 * (te gebruiken voor bijv. {{Beveiligd}} en {{Semibeveiligd}} zodat deze onder de sluit-knop van de sitenotice komt
 */
function Titel_item() {
  var h1 = document.getElementsByTagName("h1")[0];
  var content = document.getElementById("content");
  var icones = document.getElementsByTagName("div");
  var icones2 = new Array();
  var j = 0;
  for (var i = 0; i < icones.length; ++i) {
    if (icones[i].className == "Titel_item") {
      icones2[j++] = icones[i];
    }
  }
  for (; j > 0; --j) {
    icones2[j-1].style.display = "block"; /* annule display:none par défaut */
    icones2[j-1].style.borderWidth = "1px";
    icones2[j-1].style.borderStyle = "solid";
    icones2[j-1].style.borderColor = "white";
    content.insertBefore(icones2[j-1], h1); /* déplacement de l'élément */
  }
}
 
addOnloadHook(Titel_item);
 
 
/* Voor rechterbovenmargesjablonen */
/* Verbeterde versie, werkt beter dan Titel_item() */
 
function Titel_item3() {
  var h1 = document.getElementsByTagName("h1")[0];
  var content = document.getElementById("content");
  var icones = document.getElementsByTagName("div");
  var icones2 = new Array();
  var j = 0;
  for (var i = 0; i < icones.length; ++i) {
    if (icones[i].className == "Titel_item2") {
      icones2[j++] = icones[i];
    }
  }
  for (; j > 0; --j) {
    icones2[j-1].className = "Titel_item3";
    if (icones2[j-1].id == "Titelbeveiligd" && wgUserName == null){
      icones2[j-1].style.display = "none";  // titelwijzigingssjabloon alleen voor ingelogde gebruikers
    }
    content.insertBefore(icones2[j-1], h1); /* Verplaats het element naar de juiste plek */
  } 
  Titel_toevoegen("templ_Semibeveiligd", h1, content);
  Titel_toevoegen("templ_TitelBeveiligd", h1, content);
  Titel_toevoegen("templ_Beveiligd", h1, content);
  Titel_toevoegen("templ_Commons", h1, content); //staat rechtsboven, wordt geregeld in [[MediaWiki:Sharedupload]]
  Titel_toevoegen("templ_Etalage", h1, content);
  Titel_toevoegen("templ_Woordenboek", h1, content)
  Titel_toevoegen("templ_Coordinaten", h1, content)
}
 
function Titel_toevoegen(de_div_id, h1, content) {
  if (document.getElementById(de_div_id)){ 
     document.getElementById(de_div_id).className = "Titel_item3";
     content.insertBefore(document.getElementById(de_div_id), h1); /* Verplaats het element naar de juiste plek */
  }
}
 
addOnloadHook(function(){ Titel_item3(); });
//div id's aangepast
 
/**
 * Article history link for SpecialAbuseLog
 * @author Krinkle
 * @revision 4 (2010-01-28)
 * @created January 27, 2011
 * @license This script is released in the public domain. Released as-is without guarantee of any kind.
 * @stats [[File:Krinkle_SpecialAbuseLog_HistLink.js]]
 * @source https://meta.wikimedia.org/wiki/User:Krinkle/Scripts/SpecialAbuseLog_HistLink
 *
 * Adds an additional (hist) link for article link on Special:AbuseLog
 * Is appended after the link in $5 of [[MediaWiki:Abusefilter-log-detailedentry-meta]].
 * (due to $5 including the [[ and ]], fullurl: can't be used, hence this work-around
 *
 * Message:
 *	$1: $2 triggered $3, performing the action "$4" on $5. Actions taken: $6; Filter description: $7 ($8)
 * Sample:
 *	<div class="mw-specialpage-summary"> <!-- (...) -->   </div>
 *	<fieldset>
 *		<p>$1: <a href="/wiki/Special:Contributions/Foo">Foo</a> <span class="mw-usertoollinks">(<a>talk</a> | <a>block</a>)</span> triggered <a>filter 10</a>, performing the action "edit" on <a href="/wiki/Article" title="Article">Article</a>. Action taken: Warn; Filter description: Filternamehere (<a>details</a> | <a>examine</a>)</p>
 *		<!-- (...) -->
 *	</fieldset>
 *
 * The following script assumes that the *third* (0,1,2) anchor link that is a *direct child* of the paragraph tag.
 */
jQuery( function( $ ) {
 
	var	histLinkText = 'gesch', // [[MediaWiki:hist]]
		linkOffset = 2; // 0 = first. By default the 3rd link is the article link (thus offset = 2)
 
	if ( wgCanonicalSpecialPageName == 'AbuseLog' ) {
		$( '.mw-specialpage-summary:first' )
			.next( 'fieldset' )
			.find( '> p:first > a' )
			.eq( linkOffset )
			.each( function() {
				var	$el = $(this),
					$histLink = $( '<a>', {
						title: $el.attr( 'title' ), 
						href: $el.attr( 'href' ) + '?action=history',
						text: histLinkText
					} );
				$el.after( ') ' ).after( $histLink ).after( ' (' );
		} );
	}
} );

/* cache key: wikikids_kn159:resourceloader:filter:minify-css:4:e1ed7d43a9731d396a701ad8e45fdaa0 */
Afkomstig van Wikikids , de interactieve Nederlandstalige Internet-encyclopedie voor en door kinderen. "https://wikikids.nl/index.php?title=Gebruiker:Josse.Cottenier/vector.js&oldid=276207"