About: Common.js   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

// /* Needed for rewriteTitle function Source: http://www.dustindiaz.com/getelementsbyclass/ getElementsByClass, which complements getElementById and getElementsByTagName, returns an array of all subelements of ''node'' that are tagged with a specific CSS class (''searchClass'') and are of the tag name ''tag''. If tag is null, it searches for any suitable elements regardless of the tag name. Example: getElementsByClass('infobox', document.getElementById('content'), 'div') selects the same elements as the CSS declaration #content div.infobox */ function getElementsByClass(searchClass, node, tag) { var classElements = new Array(); if(node == null) node = document; if(tag == null) tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var tester = new ClassTester(sea

AttributesValues
rdfs:label
  • Common.js
  • Common.js
  • Common.js
  • Common.js
rdfs:comment
  • // /* Needed for rewriteTitle function Source: <a href="http://www.dustindiaz.com/getelementsbyclass/">http://www.dustindiaz.com/getelementsbyclass/</a> getElementsByClass, which complements getElementById and getElementsByTagName, returns an array of all subelements of ''node'' that are tagged with a specific CSS class (''searchClass'') and are of the tag name ''tag''. If tag is null, it searches for any suitable elements regardless of the tag name. Example: getElementsByClass('infobox', document.getElementById('content'), 'div') selects the same elements as the CSS declaration #content div.infobox */ function getElementsByClass(searchClass, node, tag) { var classElements = new Array(); if(node == null) node = document; if(tag == null) tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var tester = new ClassTester(sea
  • /** CSS einbinden */ function addCSS(title) { document.write( ''); } /** JS einbinden */ function addJS(title) { document.write( ''); } // anzeigen & verbergen function einaus (inhalt, einblenden, ausblenden) { var thisLevel = document.getElementById(inhalt); var otherLevel = document.getElementById(einblenden); var linkLevel = document.getElementById(ausblenden); if (thisLevel.style.display == 'none') { thisLevel.style.display = 'block'; otherLevel.style.display = 'none'; linkLevel.style.display = 'inline'; } else { thisLevel.style.display = 'none'; otherLevel.style.display = 'inline'; linkLevel.style.display = 'none'; } } //===============================================================
  • /* Any JavaScript here will be loaded for all users on every page load. */ //////////////////////////////////////////////////////////////// // ADVANCED AJAX AUTO-REFRESHING ARTICLES // Code courtesy of "pcj" of WoWWiki. //////////////////////////////////////////////////////////////// ajaxPages = new Array("Special:RecentChanges", "Special:Watchlist", "Special:Log"); function setCookie(c_name,value,expiredays) { var exdate=new Date() exdate.setDate(exdate.getDate()+expiredays) document.cookie=c_name+ "=" +escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) } }
  • Записаний нижче код в режимі Редагування вставте в сторінку MediaWiki:Common.js if (document.URL.indexOf("action=edit") > 0 || document.URL.indexOf("action=submit") > 0) {if (wgCanonicalNamespace != "Special") { document.write(''); addOnloadHook(function(){ if (mwEditButtons.length < 3) return; mwEditButtons[0].imageFile = '; mwEditButtons[1].imageFile = '; mwEditButtons[2].imageFile = '; }) } } if (mwCustomEditButtons) {//Перенаправлення mwCustomEditButtons[mwCustomEditButtons.length] = {",
dcterms:subject
dbkwik:uk.wikis/pr...iPageUsesTemplate
abstract
  • /** CSS einbinden */ function addCSS(title) { document.write( ''); } /** JS einbinden */ function addJS(title) { document.write( ''); } // anzeigen & verbergen function einaus (inhalt, einblenden, ausblenden) { var thisLevel = document.getElementById(inhalt); var otherLevel = document.getElementById(einblenden); var linkLevel = document.getElementById(ausblenden); if (thisLevel.style.display == 'none') { thisLevel.style.display = 'block'; otherLevel.style.display = 'none'; linkLevel.style.display = 'inline'; } else { thisLevel.style.display = 'none'; otherLevel.style.display = 'inline'; linkLevel.style.display = 'none'; } } //================================================================================ // alles mit class='jstest' ist dragbar /*********************************************** * Drag and Drop Script: © Dynamic Drive () * This notice MUST stay intact for legal use * Visit for this script and 100s more. ***********************************************/ var dragobject={ z: 0, x: 0, y: 0, offsetx : null, offsety : null, targetobj : null, dragapproved : 0, initialize:function(){ document.onmousedown=this.drag document.onmouseup=function(){this.dragapproved=0} }, drag:function(e){ var evtobj=window.event? window.event : e this.targetobj=window.event? event.srcElement : e.target if (this.targetobj.className=="jstest"){ this.dragapproved=1 if (isNaN(parseInt(this.targetobj.style.left))){this.targetobj.style.left=0} if (isNaN(parseInt(this.targetobj.style.top))){this.targetobj.style.top=0} this.offsetx=parseInt(this.targetobj.style.left) this.offsety=parseInt(this.targetobj.style.top) this.x=evtobj.clientX this.y=evtobj.clientY if (evtobj.preventDefault) evtobj.preventDefault() document.onmousemove=dragobject.moveit } }, moveit:function(e){ var evtobj=window.event? window.event : e if (this.dragapproved==1){ this.targetobj.style.left=this.offsetx+evtobj.clientX-this.x+"px" this.targetobj.style.top=this.offsety+evtobj.clientY-this.y+"px" return false } } } dragobject.initialize(); // Ein- und Ausblenden per Javascript // mit den folgenden Funktionen lässt sich ein div-Konstrukt in ein Einblende-Ausblende-Ding verwandeln // // Variante 1 (Klick irgendwo blendet ein oder aus): // // Titel im eingeblendeten Zustand // Titel im ausgeblendeten Zustand // Einzublendender Inhalt // // // Variante 2 (ein- und ausblenden nur mit Links): // // Titel im eingeblendeten Zustand mit Einblendelink // Titel im ausgeblendeten Zustand mit Ausblendelink // Einzublendender Inhalt // function ausklapp( element ) { var klapp_i = null; var klapp_e = null; var klapp_t = null; for (i=0; i if ( klapp_i && klapp_t && klapp_e ) break; } if( klapp_i.style.display != "none") { klapp_i.style.display = "none"; klapp_e.style.display = "none"; klapp_t.style.display = "block"; } else { klapp_i.style.display = "block"; klapp_e.style.display = "block"; klapp_t.style.display = "none"; } } function getKlappDiv( obj ) { while ( obj && obj.parentNode && obj.className != "klapp_x" ) obj = obj.parentNode; return obj; } // Event-Handler für alle class="klapp"-Objekte zuweisen function makeAusklapp() { // klapp-div-Rahmen var a = document.getElementsByTagName("div"); for ( div=0; div a[div].onclick = function () { ausklapp(this);} } } // klapp-spans-Rahmen als Link-Ersatz var a = document.getElementsByTagName("span"); for ( span=0; span } // Nach dem Laden des Fensters folgendes Ausführen: addOnloadHook(makeAusklapp); /* Test if an element has a certain class ************************************** * * 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); }; })(); /** Collapsible tables ********************************************************* * * Description: Allows tables to be collapsed, showing only the header. See * Wikipedia:NavFrame. * Maintainers: User:R. Koot */ var autoCollapse = 2; var collapseCaption = "verbergen"; var expandCaption = "anzeigen"; function collapseTable( tableIndex ) {var Button = document.getElementById( "collapseButton" + tableIndex ); var Table = document.getElementById( "collapsibleTable" + tableIndex ); if ( !Table || !Button ) { return false; } var Rows = Table.rows; if ( Button.firstChild.data == collapseCaption ) { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = "none"; } Button.firstChild.data = expandCaption; } else { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = Rows[0].style.display; } Button.firstChild.data = collapseCaption; } } function createCollapseButtons() {var tableIndex = 0; var NavigationBoxes = new Object(); var Tables = document.getElementsByTagName( "table" ); for ( var i = 0; i < Tables.length; i++ ) { if ( hasClass( Tables[i], "collapsible" ) ) { /* only add button and increment count if there is a header row to work with */ var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0]; if (!HeaderRow) continue; var Header = HeaderRow.getElementsByTagName( "th" )[0]; if (!Header) continue; NavigationBoxes[ tableIndex ] = Tables[i]; Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex ); var Button = document.createElement( "span" ); var ButtonLink = document.createElement( "a" ); var ButtonText = document.createTextNode( collapseCaption ); Button.style.styleFloat = "right"; Button.style.cssFloat = "right"; Button.style.fontWeight = "normal"; Button.style.textAlign = "right"; Button.style.width = "6em"; ButtonLink.style.color = Header.style.color; ButtonLink.setAttribute( "id", "collapseButton" + tableIndex ); ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" ); ButtonLink.appendChild( ButtonText ); Button.appendChild( document.createTextNode( "[" ) ); Button.appendChild( ButtonLink ); Button.appendChild( document.createTextNode( "]" ) ); Header.insertBefore( Button, Header.childNodes[0] ); tableIndex++; } } for ( var i = 0; i < tableIndex; i++ ) { if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) { collapseTable( i ); } } } addOnloadHook( createCollapseButtons ); /** Dynamic Navigation Bars (experimental) ************************************* * * Description: See Wikipedia:NavFrame. * Maintainers: UNMAINTAINED */ // set up the words in your language var NavigationBarHide = '[' + collapseCaption + ']'; var NavigationBarShow = '[' + expandCaption + ']'; // shows and hides content and picture (if available) of navigation bars // Parameters: // indexNavigationBar: the index of navigation bar to be toggled function toggleNavigationBar(indexNavigationBar) {var NavToggle = document.getElementById("NavToggle" + indexNavigationBar); var NavFrame = document.getElementById("NavFrame" + indexNavigationBar); if (!NavFrame || !NavToggle) { return false; } // if shown now if (NavToggle.firstChild.data == NavigationBarHide) { for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) { if ( hasClass( NavChild, 'NavPic' ) ) { NavChild.style.display = 'none'; } if ( hasClass( NavChild, 'NavContent') ) { NavChild.style.display = 'none'; } } NavToggle.firstChild.data = NavigationBarShow; // if hidden now } else if (NavToggle.firstChild.data == NavigationBarShow) { for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) { if (hasClass(NavChild, 'NavPic')) { NavChild.style.display = 'block'; } if (hasClass(NavChild, 'NavContent')) { NavChild.style.display = 'block'; } } NavToggle.firstChild.data = NavigationBarHide; } } // adds show/hide-button to navigation bars function createNavigationBarToggleButton() {var indexNavigationBar = 0; // iterate over all < div >-elements var divs = document.getElementsByTagName("div"); for (var i = 0; NavFrame = divs[i]; i++) { // if found a navigation bar if (hasClass(NavFrame, "NavFrame")) { indexNavigationBar++; var NavToggle = document.createElement("a"); NavToggle.className = 'NavToggle'; NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar); NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');'); var NavToggleText = document.createTextNode(NavigationBarHide); for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) { if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) { if (NavChild.style.display == 'none') { NavToggleText = document.createTextNode(NavigationBarShow); break; } } } NavToggle.appendChild(NavToggleText); // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked) for(var j=0; j < NavFrame.childNodes.length; j++) { if (hasClass(NavFrame.childNodes[j], "NavHead")) { NavFrame.childNodes[j].appendChild(NavToggle); } } NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar); } } } addOnloadHook( createNavigationBarToggleButton );
  • Записаний нижче код в режимі Редагування вставте в сторінку MediaWiki:Common.js if (document.URL.indexOf("action=edit") > 0 || document.URL.indexOf("action=submit") > 0) {if (wgCanonicalNamespace != "Special") { document.write(''); addOnloadHook(function(){ if (mwEditButtons.length < 3) return; mwEditButtons[0].imageFile = '; mwEditButtons[1].imageFile = '; mwEditButtons[2].imageFile = '; }) } } if (mwCustomEditButtons) {//Перенаправлення mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Перенаправлення", "tagOpen": "#Перенаправлення [[", "tagClose": "]]", "sampleText": "назва сторінки"} //Template button mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Шаблон", "tagOpen": "", "sampleText": "Назва шаблону"} //Category button mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Категорія", "tagOpen": "[[Категорія:", "tagClose": "|Common.js]]", "sampleText": "Назва категорії"} //Underline mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Підкреслення", "tagOpen": "", "tagClose": "", "sampleText": "Підкреслений текст"} //Strike-Out Button mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Закреслений текст", "tagOpen": "", "tagClose": "", "sampleText": "Закреслений текст"} //Нерозривний пробіл mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Нерозривний пробіл", "tagOpen": " ", "tagClose": "", "sampleText": ""} //Line break button mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Розрив", "tagOpen": "", "tagClose": "", "sampleText": ""} //Наголос mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Наголос", "tagOpen": "́", "tagClose": "", "sampleText": ""} //Цитата mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Вставка цитати", "tagOpen": " „", "tagClose": "“ ~ ", "sampleText": "Цитата"} //Superscript mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Верхній індекс", "tagOpen": "", "tagClose": "", "sampleText": "Верхній індекс"} //Subscript mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Нижній індекс", "tagOpen": "", "tagClose": "", "sampleText": "Нижній індекс"} //Left-Text Button mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Вирівняти по лівому краю", "tagOpen": " ", "tagClose": " ", "sampleText": "Вирівняний ліворуч текст"} //Center-Text Button mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Вирівняти по центру", "tagOpen": " ", "tagClose": " ", "sampleText": "Вирівняний по центру текст"} //Right-Text Button mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Вирівняти по правому краю", "tagOpen": " ", "tagClose": " ", "sampleText": "Вирівняний праворуч текст"} //Прихований коментар mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Прихований коментар", "tagOpen": "", "sampleText": "Коментар"} //Заголовок при наведенні курсору mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Курсорний заголовок", "tagOpen": "", "tagClose": "", "sampleText": "Текст"} //Великий текст mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Великий шрифт", "tagOpen": "", "tagClose": "", "sampleText": "Текст великим шрифтом"} //Малий текст mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Малий шрифт", "tagOpen": "", "tagClose": "", "sampleText": "Текст малим шрифтом"} //Gallery mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Галерея", "tagOpen": " ", "tagClose": " ", "sampleText": "Файл:Назва_зображення1.jpg|Опис_зображення1 \Файл:Назва_зображення2.jpg|Опис_зображення2"} //Video mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Відео з YouTube", "tagOpen": " ", "tagClose": " ", "sampleText": "title= \movie_url="} //Reference link button mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Виноска", "tagOpen": "", "sampleText": "Посилання"} //Reference button mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Список виносок", "tagOpen": " == Виноски == ", "tagClose": "", "sampleText": ""} //Colour mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Кольоровий текст", "tagOpen": "", "tagClose": "", "sampleText": "Кольоровий текст"} //Code mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Вставка коду", "tagOpen": "", "tagClose": "", "sampleText": "Код"} //Моноширинний шрифт mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Моноширинний шрифт", "tagOpen": "", "tagClose": "", "sampleText": "Моноширинний шрифт"} //Посилання на шаблон mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": "", "speedTip": "Посилання на шаблон", "tagOpen": "", "sampleText": "Назва шаблону"} } /* Імпорт додаткових скриптів */ function importExternalScript(url) { var s = document.createElement('script'); s.src = url; s.type='text/javascript'; document.getElementsByTagName('head')[0].appendChild(s); } function importScript(page) { importExternalScript(wgScriptPath + '/index.php?title=' + encodeURIComponent(page.replace(' ','_')) + '&action=raw&ctype=text/javascript&dontcountme=s'); } // /** * * English: Open a popup with parameters to generate an array. * The number of rows/columns can be modified. Some additional * parameters are related to templates available on :fr * * @author: fr:user:dake * @version: 0.1 */ function popupTable() {var popup = window.open(,'name','height=180,width=300,scrollbars=yes'); javaCode = ''); popup.document.write(' Введіть параметри таблиці: '); popup.document.write(''); popup.document.write('Вирівнювання : '); popup.document.write('Кількість рядків : '); popup.document.write('Кількість стовпчиків: '); popup.document.write(''); popup.document.write(' |'); popup.document.write(' '); popup.document.write(''); popup.document.close(); } /* Маленьке корегування кнопки підпису */ appendCSS('#mw-editbutton-signature { display: none; }'); if (mwCustomEditButtons) { mwCustomEditButtons.push({ 'imageFile': ', 'speedTip': 'Ваш підпис з часовою міткою', 'tagOpen': '— ~~\~~', 'tagClose': , 'sampleText': , 'imageId': 'editbutton-customsig' }); } /* Всі додаткові скрипти включені нижче */ importScript("MediaWiki:Otherscripts.js"); /* var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-7117465-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = '; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); function ukrbash() {if (document.getElementById('ukrbash')) (function(){var script=document.createElement('script');script.type='text/javascript';script.async=true;script.src=' s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(script,s)})(); } addOnloadHook(ukrbash); /** Collapsible tables ********************************************************* * * Description: Allows tables to be collapsed, showing only the header. See * <a href="http://www.mediawiki.org/wiki/Manual:Collapsible_tables.">http://www.mediawiki.org/wiki/Manual:Collapsible_tables.</a> * Maintainers: **MAINTAINERS** */ var autoCollapse = 2; var collapseCaption = 'сховати'; var expandCaption = 'показати'; function collapseTable( tableIndex ) { var Button = document.getElementById( 'collapseButton' + tableIndex ); var Table = document.getElementById( 'collapsibleTable' + tableIndex ); if ( !Table || !Button ) { return false; } var Rows = Table.rows; if ( Button.firstChild.data == collapseCaption ) { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = 'none'; } Button.firstChild.data = expandCaption; } else { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = Rows[0].style.display; } Button.firstChild.data = collapseCaption; } } function createCollapseButtons() { var tableIndex = 0; var NavigationBoxes = new Object(); var Tables = document.getElementsByTagName( 'table' ); for ( var i = 0; i < Tables.length; i++ ) { if ( hasClass( Tables[i], 'collapsible' ) ) { /* only add button and increment count if there is a header row to work with */ var HeaderRow = Tables[i].getElementsByTagName( 'tr' )[0]; if( !HeaderRow ) continue; var Header = HeaderRow.getElementsByTagName( 'th' )[0]; if( !Header ) continue; NavigationBoxes[tableIndex] = Tables[i]; Tables[i].setAttribute( 'id', 'collapsibleTable' + tableIndex ); var Button = document.createElement( 'span' ); var ButtonLink = document.createElement( 'a' ); var ButtonText = document.createTextNode( collapseCaption ); Button.className = 'collapseButton'; // Styles are declared in MediaWiki:Common.css ButtonLink.style.color = Header.style.color; ButtonLink.setAttribute( 'id', 'collapseButton' + tableIndex ); ButtonLink.setAttribute( 'href', "javascript:collapseTable(" + tableIndex + ");" ); ButtonLink.appendChild( ButtonText ); Button.appendChild( document.createTextNode( '[' ) ); Button.appendChild( ButtonLink ); Button.appendChild( document.createTextNode( ']' ) ); Header.insertBefore( Button, Header.childNodes[0] ); tableIndex++; } } for ( var i = 0; i < tableIndex; i++ ) { if ( hasClass( NavigationBoxes[i], 'collapsed' ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], 'autocollapse' ) ) ) { collapseTable( i ); } } } addOnloadHook( createCollapseButtons ); /** Test if an element has a certain class ************************************** * * 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); }; })(); /* */ function noLogo() { if(document.getElementById('nologo')) document.getElementById('p-logo').style.display = 'none'; } addOnloadHook(onPageInit); function onPageInit() {noLogo(); } Категорія:MediaWiki
  • /* Any JavaScript here will be loaded for all users on every page load. */ //////////////////////////////////////////////////////////////// // ADVANCED AJAX AUTO-REFRESHING ARTICLES // Code courtesy of "pcj" of WoWWiki. //////////////////////////////////////////////////////////////// ajaxPages = new Array("Special:RecentChanges", "Special:Watchlist", "Special:Log"); function setCookie(c_name,value,expiredays) { var exdate=new Date() exdate.setDate(exdate.getDate()+expiredays) document.cookie=c_name+ "=" +escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) } function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "=") if (c_start!=-1) { c_start=c_start + c_name.length+1 c_end=document.cookie.indexOf(";",c_start) if (c_end==-1) c_end=document.cookie.length return unescape(document.cookie.substring(c_start,c_end)) } } return "" } function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); //Not Internet Explorer } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); //Internet Explorer } else { //fail silently } } getRCDataRO = getXmlHttpRequestObject(); var cr = new RegExp("", "gm"); var lf = new RegExp(" ", "gm"); var endText = new RegExp('[ \s]*?[ \s]*? ', "mi"); var rcTimer; var rcRefresh = 60000; function preloadAJAXRC() { if (skin == "monaco") { s = 1; } else { s = 0; } ajaxRCCookie = (getCookie("ajaxload-"+wgPageName)=="on") ? true:false; document.getElementsByTagName("h1")[0].innerHTML += ' AJAX:'; document.getElementById("ajaxRCtoggle").checked = ajaxRCCookie; if (getCookie("ajaxload-"+wgPageName)=="on") loadRCData(); } function toggleRC() { if (document.getElementById("ajaxRCtoggle").checked == true) { setCookie("ajaxload-"+wgPageName, "on", 30); loadRCData(); } else { setCookie("ajaxload-"+wgPageName, "off", 30); clearTimeout(rcTimer); } } function loadRCData() { if (getRCDataRO.readyState == 4 || getRCDataRO.readyState == 0) { if (location.href.indexOf("/wiki/")) { rcURL = "" + location.hostname + "/wiki/" + wgPageName + location.search; } else { rcURL = "" + location.hostname + "/" + wgPageName + location.search; } getRCDataRO.open("GET", rcURL, true); getRCDataRO.onreadystatechange = parseRCdata; getRCDataRO.send(null); } } function parseRCdata() { if (getRCDataRO.readyState == 4) { textFilter = new RegExp(' .*? [ \s]*?[ \s]*? ', "i"); rawRCdata = getRCDataRO.responseText.replace(cr, "").replace(lf, ""); filteredRCdata = textFilter.exec(rawRCdata); updatedText = filteredRCdata[0].replace(' ', "").replace(endText, ""); document.getElementById("bodyContent").innerHTML = updatedText; rcTimer = setTimeout("loadRCData();", rcRefresh); } } for (x in ajaxPages) { if (wgPageName == ajaxPages[x]) addOnloadHook(preloadAJAXRC); } /////////////////////////////////////////////////////////////////////////////////////////////////////////// // END OF AJAX AUTO-REFRESH /////////////////////////////////////////////////////////////////////////////////////////////////////////// // ************************************************** // Experimental javascript countdown timer (Splarka) // Version 0.0.3 // ************************************************** // // Usage example: // // Javascript disabled. function updatetimer(i) {var now = new Date(); var then = timers[i].eventdate; var diff = count=Math.floor((then.getTime()-now.getTime())/1000); // catch bad date strings if(isNaN(diff)) { timers[i].firstChild.nodeValue = '** ' + timers[i].eventdate + ' **' ; return; } // determine plus/minus if(diff<0) { diff = -diff; var tpm = ' '; } else { var tpm = ' '; } // calcuate the diff var left = (diff%60) + ' seconds'; diff=Math.floor(diff/60); if(diff > 0) left = (diff%60) + ' minutes ' + left; diff=Math.floor(diff/60); if(diff > 0) left = (diff%24) + ' hours ' + left; diff=Math.floor(diff/24); if(diff > 0) left = diff + ' days ' + left timers[i].firstChild.nodeValue = tpm + left; // a setInterval() is more efficient, but calling setTimeout() // makes errors break the script rather than infinitely recurse timeouts[i] = setTimeout('updatetimer(' + i + ')',1000); } function checktimers() {//hide 'nocountdown' and show 'countdown' var nocountdowns = getElementsByClassName(document, 'span', 'nocountdown'); for(var i in nocountdowns) nocountdowns[i].style.display = 'none' var countdowns = getElementsByClassName(document, 'span', 'countdown'); for(var i in countdowns) countdowns[i].style.display = 'inline' //set up global objects timers and timeouts. timers = getElementsByClassName(document, 'span', 'countdowndate'); //global timeouts = new Array(); // generic holder for the timeouts, global if(timers.length == 0) return; for(var i in timers) { timers[i].eventdate = new Date(timers[i].firstChild.nodeValue); updatetimer(i); //start it up } } addOnloadHook(checktimers); // ************************************************** // - end - Experimental javascript countdown timer // **************************************************
  • // /* Needed for rewriteTitle function Source: <a href="http://www.dustindiaz.com/getelementsbyclass/">http://www.dustindiaz.com/getelementsbyclass/</a> getElementsByClass, which complements getElementById and getElementsByTagName, returns an array of all subelements of ''node'' that are tagged with a specific CSS class (''searchClass'') and are of the tag name ''tag''. If tag is null, it searches for any suitable elements regardless of the tag name. Example: getElementsByClass('infobox', document.getElementById('content'), 'div') selects the same elements as the CSS declaration #content div.infobox */ function getElementsByClass(searchClass, node, tag) { var classElements = new Array(); if(node == null) node = document; if(tag == null) tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var tester = new ClassTester(searchClass); for(i = 0, j = 0; i < elsLen; i++) { if(tester.isMatch(els[i])) { classElements[j] = els[i]; j++; } } return classElements; } function ClassTester(className) { this.regex = new RegExp("(^|\\s)" + className + "(\\s|$)"); } ClassTester.prototype.isMatch = function(element) { return this.regex.test(element.className); } /* end getElementsByClass */ /** Title rewrite ******************************************************** * Rewrites the page's title, used by Template:Title * By Sikon */ function rewriteTitle() { if(typeof(SKIP_TITLE_REWRITE) != 'undefined' && SKIP_TITLE_REWRITE) return; var titleDiv = document.getElementById('title-meta'); if(titleDiv == null || titleDiv == undefined) return; var cloneNode = titleDiv.cloneNode(true); var firstHeading = getElementsByClass('firstHeading', document.getElementById('content'), 'h1')[0]; var node = firstHeading.childNodes[0]; // new, then old! firstHeading.replaceChild(cloneNode, node); cloneNode.style.display = "inline"; var titleAlign = document.getElementById('title-align'); firstHeading.style.textAlign = titleAlign.childNodes[0].nodeValue; } addOnloadHook(rewriteTitle, false); //
  • /** CSS einbinden */ function addCSS(title) { document.write( ''); } /** JS einbinden */ function addJS(title) { document.write( ''); } // anzeigen & verbergen function einaus (inhalt, einblenden, ausblenden) { var thisLevel = document.getElementById(inhalt); var otherLevel = document.getElementById(einblenden); var linkLevel = document.getElementById(ausblenden); if (thisLevel.style.display == 'none') { thisLevel.style.display = 'block'; otherLevel.style.display = 'none'; linkLevel.style.display = 'inline'; } else { thisLevel.style.display = 'none'; otherLevel.style.display = 'inline'; linkLevel.style.display = 'none'; } } //================================================================================ // alles mit class='jstest' ist dragbar /*********************************************** * Drag and Drop Script: © Dynamic Drive () * This notice MUST stay intact for legal use * Visit for this script and 100s more. ***********************************************/ var dragobject={ z: 0, x: 0, y: 0, offsetx : null, offsety : null, targetobj : null, dragapproved : 0, initialize:function(){ document.onmousedown=this.drag document.onmouseup=function(){this.dragapproved=0} }, drag:function(e){ var evtobj=window.event? window.event : e this.targetobj=window.event? event.srcElement : e.target if (this.targetobj.className=="jstest"){ this.dragapproved=1 if (isNaN(parseInt(this.targetobj.style.left))){this.targetobj.style.left=0} if (isNaN(parseInt(this.targetobj.style.top))){this.targetobj.style.top=0} this.offsetx=parseInt(this.targetobj.style.left) this.offsety=parseInt(this.targetobj.style.top) this.x=evtobj.clientX this.y=evtobj.clientY if (evtobj.preventDefault) evtobj.preventDefault() document.onmousemove=dragobject.moveit } }, moveit:function(e){ var evtobj=window.event? window.event : e if (this.dragapproved==1){ this.targetobj.style.left=this.offsetx+evtobj.clientX-this.x+"px" this.targetobj.style.top=this.offsety+evtobj.clientY-this.y+"px" return false } } } dragobject.initialize(); // Ein- und Ausblenden per Javascript // mit den folgenden Funktionen lässt sich ein div-Konstrukt in ein Einblende-Ausblende-Ding verwandeln // // Variante 1 (Klick irgendwo blendet ein oder aus): // // Titel im eingeblendeten Zustand // Titel im ausgeblendeten Zustand // Einzublendender Inhalt // // // Variante 2 (ein- und ausblenden nur mit Links): // // Titel im eingeblendeten Zustand mit Einblendelink // Titel im ausgeblendeten Zustand mit Ausblendelink // Einzublendender Inhalt // function ausklapp( element ) { var klapp_i = null; var klapp_e = null; var klapp_t = null; for (i=0; i if ( klapp_i && klapp_t && klapp_e ) break; } if( klapp_i.style.display != "none") { klapp_i.style.display = "none"; klapp_e.style.display = "none"; klapp_t.style.display = "block"; } else { klapp_i.style.display = "block"; klapp_e.style.display = "block"; klapp_t.style.display = "none"; } } function getKlappDiv( obj ) { while ( obj && obj.parentNode && obj.className != "klapp_x" ) obj = obj.parentNode; return obj; } // Event-Handler für alle class="klapp"-Objekte zuweisen function makeAusklapp() { // klapp-div-Rahmen var a = document.getElementsByTagName("div"); for ( div=0; div a[div].onclick = function () { ausklapp(this);} } } // klapp-spans-Rahmen als Link-Ersatz var a = document.getElementsByTagName("span"); for ( span=0; span } // Nach dem Laden des Fensters folgendes Ausführen: addOnloadHook(makeAusklapp); /* Test if an element has a certain class ************************************** * * 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); }; })(); /** Collapsible tables ********************************************************* * * Description: Allows tables to be collapsed, showing only the header. See * Wikipedia:NavFrame. * Maintainers: User:R. Koot */ var autoCollapse = 2; var collapseCaption = "-"; var expandCaption = "+"; function collapseTable( tableIndex ) {var Button = document.getElementById( "collapseButton" + tableIndex ); var Table = document.getElementById( "collapsibleTable" + tableIndex ); if ( !Table || !Button ) { return false; } var Rows = Table.rows; if ( Button.firstChild.data == collapseCaption ) { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = "none"; } Button.firstChild.data = expandCaption; } else { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = Rows[0].style.display; } Button.firstChild.data = collapseCaption; } } function createCollapseButtons() {var tableIndex = 0; var NavigationBoxes = new Object(); var Tables = document.getElementsByTagName( "table" ); for ( var i = 0; i < Tables.length; i++ ) { if ( hasClass( Tables[i], "collapsible" ) ) { /* only add button and increment count if there is a header row to work with */ var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0]; if (!HeaderRow) continue; var Header = HeaderRow.getElementsByTagName( "th" )[0]; if (!Header) continue; NavigationBoxes[ tableIndex ] = Tables[i]; Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex ); var Button = document.createElement( "span" ); var ButtonLink = document.createElement( "a" ); var ButtonText = document.createTextNode( collapseCaption ); Button.style.styleFloat = "right"; Button.style.cssFloat = "right"; Button.style.fontWeight = "normal"; Button.style.textAlign = "right"; Button.style.width = "6em"; ButtonLink.style.color = Header.style.color; ButtonLink.setAttribute( "id", "collapseButton" + tableIndex ); ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" ); ButtonLink.appendChild( ButtonText ); Button.appendChild( document.createTextNode( "[" ) ); Button.appendChild( ButtonLink ); Button.appendChild( document.createTextNode( "]" ) ); Header.insertBefore( Button, Header.childNodes[0] ); tableIndex++; } } for ( var i = 0; i < tableIndex; i++ ) { if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) { collapseTable( i ); } } } addOnloadHook( createCollapseButtons ); /** Dynamic Navigation Bars (experimental) ************************************* * * Description: See Wikipedia:NavFrame. * Maintainers: UNMAINTAINED */ // set up the words in your language var NavigationBarHide = '[' + collapseCaption + ']'; var NavigationBarShow = '[' + expandCaption + ']'; // shows and hides content and picture (if available) of navigation bars // Parameters: // indexNavigationBar: the index of navigation bar to be toggled function toggleNavigationBar(indexNavigationBar) {var NavToggle = document.getElementById("NavToggle" + indexNavigationBar); var NavFrame = document.getElementById("NavFrame" + indexNavigationBar); if (!NavFrame || !NavToggle) { return false; } // if shown now if (NavToggle.firstChild.data == NavigationBarHide) { for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) { if ( hasClass( NavChild, 'NavPic' ) ) { NavChild.style.display = 'none'; } if ( hasClass( NavChild, 'NavContent') ) { NavChild.style.display = 'none'; } } NavToggle.firstChild.data = NavigationBarShow; // if hidden now } else if (NavToggle.firstChild.data == NavigationBarShow) { for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) { if (hasClass(NavChild, 'NavPic')) { NavChild.style.display = 'block'; } if (hasClass(NavChild, 'NavContent')) { NavChild.style.display = 'block'; } } NavToggle.firstChild.data = NavigationBarHide; } } // adds show/hide-button to navigation bars function createNavigationBarToggleButton() {var indexNavigationBar = 0; // iterate over all < div >-elements var divs = document.getElementsByTagName("div"); for (var i = 0; NavFrame = divs[i]; i++) { // if found a navigation bar if (hasClass(NavFrame, "NavFrame")) { indexNavigationBar++; var NavToggle = document.createElement("a"); NavToggle.className = 'NavToggle'; NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar); NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');'); var NavToggleText = document.createTextNode(NavigationBarHide); for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) { if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) { if (NavChild.style.display == 'none') { NavToggleText = document.createTextNode(NavigationBarShow); break; } } } NavToggle.appendChild(NavToggleText); // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked) for(var j=0; j < NavFrame.childNodes.length; j++) { if (hasClass(NavFrame.childNodes[j], "NavHead")) { NavFrame.childNodes[j].appendChild(NavToggle); } } NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar); } } } addOnloadHook( createNavigationBarToggleButton );
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software