/* generated javascript */ var skin = 'monobook'; var stylepath = '/skins-1.5'; /* MediaWiki:Common.js */ // Common javascript code which effects everyone // hasClass() // Description: Uses regular expressions and caching for better performance. // Maintainers: User:Mike Dillon, User:R. Koot, User:SG var hasClass = (function () { var reCache = {}; return function (element, className) { return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className); }; })(); // for backwards compatibility var addLoadEvent = addOnloadHook; var import_script = importScript; var import_style = importStylesheet; // book name var wgBookName = wgPageName.split("/", 1)[0] || wgPageName; wgBookName = wgBookName.split(':', 2).join(":"); // Provides an easy way to disable load dependent features function delLoadEvent(func) { for (var i = 0; i < onloadFuncts.length; i++) { if (onloadFuncts[i] == func) onloadFuncts.splice(i, 1); } } function get_query_value(query, name) { if (typeof query != "string" || typeof name != "string") return ""; var value = query.match('[&?]' + name + '=([^&]*)'); if (value) return decodeURIComponent(value[1]); else return ""; } // cross-browser event attachment (John Resig) // http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html function addEvent(obj, type, fn) { if (obj.addEventListener) obj.addEventListener( type, fn, false ); else if (obj.attachEvent) { obj["e"+type+fn] = fn; obj[type+fn] = function() { obj["e"+type+fn]( window.event ); } obj.attachEvent( "on"+type, obj[type+fn] ); } } // cross-browser XMLHtttpRequest compatibility if (typeof XMLHttpRequest == "undefined") XMLHttpRequest = function() { try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch(e) {}; try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch(e) {}; try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {}; try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {}; throw new Error("This browser does not support XMLHttpRequest or XMLHTTP."); }; /** Add dismiss button to watchlist-message ************************************* * * Description: Hide the watchlist message for one week. * Maintainers: [[w:User:Ruud Koot|Ruud Koot]] */ function addDismissButton() { var watchlistMessage = document.getElementById("watchlist-message"); if ( watchlistMessage == null ) return; if ( document.cookie.indexOf( "hidewatchlistmessage=yes" ) != -1 ) { watchlistMessage.style.display = "none"; } var Button = document.createElement( "span" ); var ButtonLink = document.createElement( "a" ); var ButtonText = document.createTextNode( "dismiss" ); ButtonLink.setAttribute( "id", "dismissButton" ); ButtonLink.setAttribute( "href", "javascript:dismissWatchlistMessage();" ); ButtonLink.setAttribute( "title", "Hide this message for one week" ); ButtonLink.appendChild( ButtonText ); Button.appendChild( document.createTextNode( "[" ) ); Button.appendChild( ButtonLink ); Button.appendChild( document.createTextNode( "]" ) ); watchlistMessage.appendChild( Button ); } function dismissWatchlistMessage() { var e = new Date(); e.setTime( e.getTime() + (7*24*60*60*1000) ); document.cookie = "hidewatchlistmessage=yes; expires=" + e.toGMTString() + "; path=/"; var watchlistMessage = document.getElementById("watchlist-message"); watchlistMessage.style.display = "none"; } addOnloadHook( addDismissButton ); // Removes the default no-license option for image uploads. // All new image uploads must be tagged with a license or nld function remove_no_license() { if (wgPageName != "Special:Upload") return; var license = document.getElementById("wpLicense"); if (!license) return; var options = license.getElementsByTagName("option"); if (!options) return; license.removeChild(options[0]); } addOnloadHook(remove_no_license); // ============================================================ // BEGIN pageview counter // Please talk to [[de:User:LeonWeber]] before changing anything or // if there are any issues with that. // // this should be adjusted to a good value. // BE CAREFULL, you will break zedler if it's too low! // And then DaB. will kill Leon :-( var disable_counter = 0; var counter_factor = 100; function pgcounter_setup() { // do not count if disabled or if its a history page, etc. if (disable_counter != 0 || wgIsArticle == false) return; if (wgNamespaceNumber != 0 && wgNamespaceNumber != 102 && wgNamespaceNumber != 110) return; // ignore unless main namespace, cookbook namespace or wikijunior namespace if (Math.floor(Math.random()*counter_factor)!=42) return; // the probability thing var url = window.location.href; var pgcountNs = wgCanonicalNamespace; if (wgCanonicalNamespace=="") pgcountNs = "0"; var cnt_url = "http://pgcount.wikimedia.de/index.png?ns=" + pgcountNs + "&title=" + encodeURI(wgTitle).replace(/\+/g, "%2B") + "&factor=" + counter_factor + "&wiki=enwikibooks"; var img = new Image(); img.src = cnt_url; } // Do not use aOnloadFunctions[aOnloadFunctions.length] = pgcounter_setup;, some browsers don't like that. pgcounter_setup(); // import additional scripts // import_script('MediaWiki:ExtraTools.js'); import_script('MediaWiki:Navigation.js'); import_script('MediaWiki:NavigationTabs.js'); import_script('MediaWiki:Displaytitle.js'); import_script('MediaWiki:RandomBook.js'); import_script('MediaWiki:Edittools.js'); // adds buttons to the edit toolbar if (mwCustomEditButtons) { import_script('MediaWiki:EditToolbar.js'); } // End of Common.js /* MediaWiki:Monobook.js */ /* See also: [[MediaWiki:Common.js]]
*/

/* Functions for adding links to the personal links section and the toolbox*/
function AddPersonalLink(link, text, tag, ibefore)
{
  var li = document.createElement( 'li' );
  li.id = tag;
  var a = document.createElement( 'a' );
  a.appendChild( document.createTextNode( text ) ); 
  a.href = link;
  li.appendChild( a );
  if ( ! ibefore ) // append to end (right) of list
  {
     document.getElementById( 'pt-logout' ).parentNode.appendChild( li );
  }
  else
  {
      var before = document.getElementById( ibefore );
      before.appendChild( li, before );
  }
}

function AddToolboxLink(text, href, onclick, linkid) {
  var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
  
  var link = document.createElement('a');
  link.onclick = onclick;
  link.href = href;
  link.appendChild(document.createTextNode(text));

  var li = document.createElement('li');
  li.id = linkid;
  li.appendChild(link);

  tb.insertBefore(li, tb.firstChild);
  return;
}
/*
*/