User:Xls/monobook.js

// User:Lupin/popups.js

mw.loader.load(            'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'             + '&action=raw&ctype=text/javascript&dontcountme=s');

// User:Ilmari Karonen/editsection0.js

document.write(' ');

/* advanced talkpages

ed_absteigend = 1 ; // Diese Zeile einfügen, wenn Diskussionsseiten standardmäßig absteigend (d.h. letztes Thema oben) sortiert werden sollen ed_letzte = 2 ; // Hier werden standardmäßig die letzten zwei Diskussionen angezeigt (alle anderen verden versteckt)



var ed_reverse = 0 ; var ed_counter = 0 ;

if ( wgAction == "view" && ( wgNamespaceNumber & 1 ) > 0 ) addOnloadHook(erweiterte_diskussion);

function ed_get_recursive_text ( obj ) { var ret = "" ; if ( obj.nodeValue ) ret += obj.nodeValue + "\n" ; for ( var i = obj.firstChild ; i ; i = i.nextSibling ) { ret += ed_get_recursive_text ( i ); } if ( ret != "" ) ret += "\n" ; return ret ; }

function ed_get_date_range ( obj ) { var text = ed_get_recursive_text ( obj ) ; var dates = text.match ( /\d\d?\:\d\d?,\s\d\d?\.\s[A-Z][a-zäüö]*\.?\s20\d\d\s\(/g ) ; // 14:21, 13. Aug. 2007 (CEST)  if ( !dates ) return "" ;  var days = new Array  ;  var cd = new Date;  var year = cd.getFullYear ;  var j ;  for ( var i = 0 ; i < dates.length ; i++ ) {    var d = dates[i].split(" ") ;    var day = d[1] + " " + d[2] ;    if ( d[3] != year ) day += " " + d[3] ;    for ( j = 0 ; j < days.length && days[j] != day ; j++ ) ;    if ( j == days.length ) days.push ( day ) ;  }

if ( days ) return days.join ( ", " ) ; return "" ; }

function ed_hide ( e ) { var title = "" ; var es ; for ( var n = e.firstChild ; n ; n = n.nextSibling ) { if ( n.className == "mw-headline" ) title = n.innerHTML ; if ( n.className == "editsection" ) es = n ; } if ( title == "" ) return ; // Abort

ed_counter++ ; var id = "talk_title_" + ed_counter ; var toggle_link = "+ " ;

var nd = document.createElement ( "div" ) ; var nd_title = document.createElement ( "div" ) ; var nd_cont = document.createElement ( "div" ) ;

nd.className = "new_discussion_element" ; nd.id = "new_discussion_thread_" + ed_counter ;

nd_title.id = id ; nd_title.style.backgroundColor = "#DDDDFF" ; nd_title.style.margin = "2px" ; nd_title.onclick = "ed_toggle_talk_section('" + id + "');" ; // ??? No-can-do in Firefox nd_title.innerHTML = toggle_link + " " + ed_counter + ": " + title + "" ; if ( es ) nd_title.innerHTML += " " + es.innerHTML ;

nd_cont.style.display = "none" ; nd_cont.style.marginLeft = "20px" ;

nd.appendChild ( nd_title ) ; nd.appendChild ( nd_cont ) ; e.parentNode.insertBefore ( nd, e ) ; nd_cont.appendChild ( e ) ; e.style.display = "none" ; while ( nd.nextSibling && nd.nextSibling.tagName != "H2" ) nd_cont.appendChild ( nd.nextSibling ) ;

var dr = ed_get_date_range ( nd_cont ) ; if ( dr != "" ) nd_title.innerHTML += " (" + dr + ")" ; }

function ed_reverse_order { var id ; if ( ed_reverse ) id = "talk_title_" + ed_counter ; else id = "talk_title_1" ; var nd = document.getElementById(id).parentNode ;

for ( var d = nd.nextSibling ; d ; d = d.nextSibling ) { if ( d.className != "new_discussion_element" ) continue ; var xd = d ; d = d.previousSibling ; nd.parentNode.insertBefore ( xd, nd ) ; nd = nd.previousSibling ; } ed_reverse = 1 - ed_reverse ; }

function erweiterte_diskussion { var toc = document.getElementById("toc") ; if ( toc ) toc.style.display = "none";

var h2s = document.getElementsByTagName ( "H2" ) ; for ( var a = 0 ; a < h2s.length ; a++ ) { ed_hide ( h2s[a] ) ; } ed_add_header  ; if ( ed_absteigend ) ed_reverse_order; if ( ed_letzte ) ed_show_last; }

function ed_change_state ( state ) { for ( var i = 1 ; i <= ed_counter ; i++ ) { var d = document.getElementById ( "talk_title_" + i ) ; d.nextSibling.style.display = state ? "block" : "none" ; } }

function ed_add_header { // var cs = document.getElementById ( "contentSub" ) ; var cs = document.getElementById("new_discussion_thread_1") ;

var d = document.createElement ( "div" ) ; d.style.backgroundColor = "#DDDDDD" ; d.style.marginBottom = "5px" ; d.style.borderBottom = "2px solid black" ;

var b1 = document.createElement ( "b" ) ; b1.appendChild ( document.createTextNode ( "advanced discussion" ) ) ;

var a1 = document.createElement ( "a" ) ; a1.href = "javascript:ed_reverse_order" ; a1.appendChild ( document.createTextNode ( "up-and-down" ) ) ;

var a2 = document.createElement ( "a" ) ; a2.href = "javascript:ed_change_state(1)" ; a2.appendChild ( document.createTextNode ( "show all" ) ) ;

var a3 = document.createElement ( "a" ) ; a3.href = "javascript:ed_change_state(0)" ; a3.appendChild ( document.createTextNode ( "hide all" ) ) ;

d.appendChild ( b1 ) ; d.appendChild ( document.createTextNode ( " | " ) ) ; d.appendChild ( a1 ) ; d.appendChild ( document.createTextNode ( " | " ) ) ; d.appendChild ( a2 ) ; d.appendChild ( document.createTextNode ( " | " ) ) ; d.appendChild ( a3 ) ;

cs.parentNode.insertBefore ( d, cs ) ; }

function ed_show_last { for ( var i = ed_counter - ed_letzte + 1 ; i <= ed_counter ; i++ ) { if ( i < 0 ) continue ; ed_toggle_talk_section ( "talk_title_" + i ) ; } }

function ed_toggle_talk_section ( id ) { var div_title = document.getElementById ( id ) ; var div_cont = div_title.nextSibling ; var tl = div_title.getElementsByTagName("A")[0] ; if ( div_cont.style.display == "none" ) { div_cont.style.display = "block" ; tl.innerHTML = "–" ; } else { div_cont.style.display = "none" ; tl.innerHTML = "+" ; } }