Wikimanuale rowikibooks https://ro.wikibooks.org/wiki/Pagina_principal%C4%83 MediaWiki 1.47.0-wmf.24 first-letter Media Special Discuție Utilizator Discuție Utilizator Wikimanuale Discuție Wikimanuale Fișier Discuție Fișier MediaWiki Discuție MediaWiki Format Discuție Format Ajutor Discuție Ajutor Categorie Discuție Categorie Raft Discuţie Raft Wikijunior Discuţie Wikijunior Carte de bucate Discuţie Carte de bucate TimedText TimedText talk Modul Discuție Modul Event Event talk MediaWiki:Common.js 8 2345 37792 36124 2026-10-15T12:28:16Z Maintenance script 4980 Use thumb.wikimedia.org for thumbnails ([[phab:T427465]], Operator: Ladsgroup) 37792 javascript text/javascript if (window.showModalDialog && document.compatMode && document.compatMode == "CSS1Compat") { var oldWidth; var docEl = document.documentElement; function fixIEScroll() { if (!oldWidth || docEl.clientWidth > oldWidth) doFixIEScroll(); else setTimeout(doFixIEScroll, 1); oldWidth = docEl.clientWidth; } function doFixIEScroll() { docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth < 4) ? "hidden" : ""; } if (document.attachEvent!=undefined) { document.attachEvent("onreadystatechange", fixIEScroll); attachEvent("onresize", fixIEScroll); } } function LegAF() { // iterate over all <span>-elements for(var i=0; a = document.getElementsByTagName("span")[i]; i++) { // if found a AF span if(a.className == "AF") { // iterate over all <li>-elements for(var j=0; b = document.getElementsByTagName("li")[j]; j++) { // if found a AF link if(b.className == "interwiki-" + a.id) { b.style.padding = "0 0 0 16px"; b.style.backgroundImage = "url('//upload.wikimedia.org/wikipedia/ro/5/53/Pictograma-LegAF.png')"; b.style.backgroundRepeat = "no-repeat"; b.title = "Acest articol este considerat a fi de calitate"; } } } // if found a AB span else if(a.className == "AB") { // iterate over all <li>-elements for(var j=0; b = document.getElementsByTagName("li")[j]; j++) { // if found a AB link if(b.className == "interwiki-" + a.id) { b.style.padding = "0 0 0 16px"; b.style.backgroundImage = "url('//thumb.wikimedia.org/wikipedia/commons/thumb/9/94/Symbol_support_vote.svg/16px-Symbol_support_vote.svg.png')"; b.style.backgroundRepeat = "no-repeat"; b.title = "Acest articol este considerat a fi bun"; } } } } } $(document).ready(LegAF); /*AICI începe codul funcţional pentru "metacasete"*/ /* Funcţionarea Format:Metacasetă */ function MetaCasetaInit(){ //Se execută la încărcarea paginii dacă există metacesete, // sunt ataşate evenimentele la butoane //alert("MetaCasetaInit"); var i=0 //Iniţializare contor casete for (i=0;i<=9;i++){ var vMc = document.getElementById("mc"+i); if (!vMc) break; //alert("MetaCasetaInit, gasit MetaCasetaInit mc"+i); var j=1 //Iniţializare contor butoane din casetă var vFilaIni = 0 //Filă vizibilă iniţial for (j=1;j<=9;j++){ var vBt = document.getElementById("mc"+i+"bt"+j); if (!vBt) break; //alert("MetaCasetaInit, gasit buton mc"+i+"bt"+j); vBt.onclick = MetaCasetaAfisareFila; //La fiecare buton sunt ataşate evenimentele onclick //alert (vBt.className); if (vBt.className=="mcButoSel") vFilaIni=j; //Dacă este selecţionat un buton, vizualizăm indexul } //alert ("mc="+i+", fila="+j+", filaini="+vFilaIni ); if (vFilaIni == 0) { //Dacă niciun buton nu este selecţionat, atunci afişarea este aleatorie vFilaIni = 1+Math.floor((j-1)*Math.random()) ; //alert ("Activare Fila; _mc"+i+"bt"+vFilaIni +"_"); document.getElementById("mc"+i+"fila"+vFilaIni).style.display = "block"; document.getElementById("mc"+i+"fila"+vFilaIni).style.visibility = "visible"; document.getElementById("mc"+i+"bt"+vFilaIni).className="mcButoSel"; } } } function MetaCasetaAfisareFila(){ //Se execută la apăsarea unei file, //aceea este vizibilă, iar celelalte se ascund var vMcNume = this.id.substr(0,3); //pornind de la numele butonului, se deduce numele casetei var vIndex = this.id.substr(5,1); //Şi indexul var i=1 for (i=1;i<=9;i++){ //se caută toate butoanele acelei file //alert(vMcNume+"fila"+i); var vFilaElem = document.getElementById(vMcNume+"fila"+i); if (!vFilaElem) break; if (vIndex==i){ //Dacă este fila bună aceasta este afişată şi se schimbă clasa butonului vFilaElem.style.display = "block"; vFilaElem.style.visibility = "visible"; document.getElementById(vMcNume+"bt"+i).className="mcButoSel"; } else { //Dacă nu, este ascunsă şi se schimbă clasa butonului vFilaElem.style.display = "none"; vFilaElem.style.visibility = "hidden"; document.getElementById(vMcNume+"bt"+i).className="mcButo"; } } return false; //evitarea reîncărcării paginii } $(document).ready(MetaCasetaInit); /*AICI se termină codul funcţional pentru "metacasete"*/ /* ************************************************************** */ // // Ajustări pentru pagina principală // // /* ************************************************************** */ function mainPageRenameNamespaceTab() { try { var Node = document.getElementById( 'ca-nstab-main' ).firstChild; if ( Node.textContent ) { // Per DOM Level 3 Node.textContent = 'Pagina principală'; } else if ( Node.innerText ) { // IE doesn't handle .textContent Node.innerText = 'Pagina principală'; } else { // Fallback Node.replaceChild( Node.firstChild, document.createTextNode( 'Pagina principală' ) ); } } catch(e) { // bailing out! } } function mainPageAppendCompleteListLink() { try { var node = document.getElementById( "p-lang" ) .getElementsByTagName('div')[0] .getElementsByTagName('ul')[0]; var aNode = document.createElement( 'a' ); var liNode = document.createElement( 'li' ); aNode.appendChild( document.createTextNode( 'Lista completă' ) ); aNode.setAttribute( 'href' , '//meta.wikimedia.org/wiki/List_of_Wikipedias' ); liNode.appendChild( aNode ); liNode.className = 'interwiki-completelist'; node.appendChild( liNode ); } catch(e) { // lets just ignore what's happened return; } } if ( mw.config.get('wgIsMainPage') && ( mw.config.get('wgNamespaceNumber') == 0 || mw.config.get('wgNamespaceNumber') == 1 ) ) { $(document).ready( mainPageRenameNamespaceTab ); } if ( mw.config.get('wgIsMainPage') && mw.config.get('wgNamespaceNumber') == 0 ) { $(document).ready( mainPageAppendCompleteListLink ); } /* ************************************************************** */ // // AICI se termină ajustările pentru pagina principală // // /* ************************************************************** */ // ============================================================ // BEGIN Dynamic Navigation Bars // adds show/hide-button to navigation bars function createNavigationBarToggleButton() { var indexNavigationBar = 0; // iterate over all <div>-elements for( var i=0; NavFrame = document.getElementsByTagName("div")[i]; i++ ) { // if found a navigation bar if (NavFrame.className == "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); NavToggle.appendChild(NavToggleText); // add NavToggle-Button as first div-element // in <div class="NavFrame"> NavFrame.insertBefore( NavToggle, NavFrame.firstChild ); NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar); } } // if more Navigation Bars found than Default: hide all if (NavigationBarShowDefault < indexNavigationBar) { for( var i=1; i<=indexNavigationBar; i++ ) { toggleNavigationBar(i); } } } $(document).ready(createNavigationBarToggleButton); var NavigationBarHide = '[ ascundere ]'; var NavigationBarShow = '[ extindere ]'; var NavigationBarShowDefault = 1; 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 (NavChild.className == 'NavPic') { NavChild.style.display = 'none'; } if (NavChild.className == 'NavContent') { NavChild.style.display = 'none'; } if (NavChild.className == 'NavToggle') { NavChild.firstChild.data = NavigationBarShow; } } // if hidden now } else if (NavToggle.firstChild.data == NavigationBarShow) { for ( var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling ) { if (NavChild.className == 'NavPic') { NavChild.style.display = 'block'; } if (NavChild.className == 'NavContent') { NavChild.style.display = 'block'; } if (NavChild.className == 'NavToggle') { NavChild.firstChild.data = NavigationBarHide; } } } } // END Dynamic Navigation Bars // ============================================================ //============================================================ // // ÎNCEPUT dispariţie titlu din pagina principală (test) // //============================================================ var isDiff = (document.location.search && (document.location.search.indexOf("diff=") != -1 || document.location.search.indexOf("oldid=") != -1)); if (mw.config.get('wgIsMainPage') && !isDiff) { mw.util.addCSS('#lastmod, #siteSub, #contentSub, h1.firstHeading { display: none !important; }'); var mpSmallEnabled; var mpMinWidth = 700; function mainPageTransform() { if ((mw.config.get('wgIsMainPage') || /[\/=:]Main_Page/.test(document.location)) && document.getElementById('ca-nstab-main')) document.getElementById('ca-nstab-main').firstChild.innerHTML = 'Pagina principală'; var mpContentEl = document.getElementById("bodyContent"); var mpBrowseEl = document.getElementById("EnWpMpBrowse"); var mpContainEl = document.getElementById("EnWpMpBrowseContainer"); var mpMarginEl = document.getElementById("EnWpMpMargin"); var mpEl = document.getElementById("EnWpMainPage"); if (!mpContentEl || !mpBrowseEl || !mpContainEl || !mpMarginEl || !mpEl) return; if (!mpSmallEnabled && mpContentEl.offsetWidth < mpMinWidth) { mpContainEl.insertBefore(mpBrowseEl, mpContainEl.firstChild); mpBrowseEl.className = "EnWpMpBrowseBottom"; mpMarginEl.style.marginRight = 0; mpSmallEnabled = true; } else if (mpSmallEnabled && mpContentEl.offsetWidth > mpMinWidth) { mpEl.insertBefore(mpBrowseEl, mpEl.firstChild); mpBrowseEl.className = "EnWpMpBrowseRight"; mpMarginEl.style.marginRight = "13.8em"; mpSmallEnabled = false; } } $(document).ready(mainPageTransform); if (window.addEventListener) window.addEventListener("resize", mainPageTransform, false); else if (window.attachEvent) window.attachEvent("onresize", mainPageTransform); } //============================================================ // SFÂRŞIT dispariţie titlu din pagina principală //============================================================ //============================================================ // // ÎNCEPUT previzualizare rapidă // //============================================================ /** * Script de ajoutant une option de prévisualisation rapide. * * * English: Add a Quick View option on the Edit pages. * This script add 2 new buttons into the "editButtons" div. * When QuickPrev button is press, the content of edit window * is retreived and parsed using regular expressions. * * @author: fr:user:aoineko * @version: 0.2 */ function addQuickPreview() { var QuickPreviewBtnTitle = "Previzualizare rapidă a modificărilor dumneavoastră [Alt + Q]"; var QuickPreviewBtnValue = "Previzualizare rapidă"; var QuickPrevHideBtnTitle = "Ascundeţi previzualizarea rapidă [Alt + H]"; var QuickPrevHideBtnValue = "Ascundeţi"; var div = document.getElementsByTagName('div'); for(var i = 0; i < div.length ; i++) { if(div[i].className == "editButtons") // search "editButtons" div { div[i].appendChild(document.createElement("br")); // add a <br/> var wpQuick = document.createElement("input"); // create and set the "QuickPrev" button wpQuick.setAttribute("id", "wpQuick"); wpQuick.setAttribute("name", "wpQuick"); wpQuick.setAttribute("title", QuickPreviewBtnTitle); wpQuick.setAttribute("value", QuickPreviewBtnValue); wpQuick.setAttribute("type", "button"); wpQuick.setAttribute("onclick", "doQuickPreview();"); wpQuick.setAttribute("tabindex", "8"); wpQuick.setAttribute("accesskey", "Q"); div[i].appendChild(wpQuick); var wpHide = document.createElement("input"); // create and set the "Hide" button wpHide.setAttribute("id", "wpHide"); wpHide.setAttribute("name", "wpHide"); wpHide.setAttribute("title", QuickPrevHideBtnTitle); wpHide.setAttribute("value", QuickPrevHideBtnValue); wpHide.setAttribute("type", "button"); wpHide.setAttribute("onclick", "hideQuickPreview();"); wpHide.setAttribute("tabindex", "9"); wpHide.setAttribute("accesskey", "H"); div[i].appendChild(wpHide); } } } /// Retreive current code and parse it function doQuickPreview() { var wpQuickPreview = document.getElementById("wpQuickPreview"); if(!wpQuickPreview) { /*var l = document.getElementsByTagName('div'); for(var i = 0; i < l.length ; i++) if(l[i].className == "previewnote") wpQuickPreview = l; if(!wpQuickPreview)*/ { wpQuickPreview = document.createElement("div"); wpQuickPreview.setAttribute("style", "border:solid 1px gray; width:100%; margin-top:1em; margin-bottom:1em; padding:0.5em;"); var wpSummaryLabel = document.getElementById("wpSummaryLabel"); wpSummaryLabel.parentNode.insertBefore(wpQuickPreview, wpSummaryLabel); } wpQuickPreview.setAttribute("id", "wpQuickPreview"); } wpQuickPreview.style.display = "block"; wpTextbox1 = document.getElementById("wpTextbox1"); var str = "=Previzualizare rapidă=\n" + wpTextbox1.value; var qp = new QuickPreview(str); wpQuickPreview.innerHTML = qp.Parse(); } function QuickPreview(wiki) { this.line = wiki.split(/\n/); this.html = new String; this.list = 0; // current list depth this.tab = 0; // current tabulation depth this.pre = false; /// inside a <pre> tag this.para = false; /// inside a paragraph this.HandlePre = function(i) { if(this.line[i][0] == ' ') { if(this.para) { this.para = false; this.html += "</p>\n"; } if(!this.pre) { this.pre = true; this.html += "<pre>\n"; } this.html += this.line[i] + "\n"; return true; } else if(this.pre) { this.pre = false; this.html += "</pre>\n"; } return false; }; this.HandleH = function(i) { if(res = this.line[i].match(/^(={1,6})(.*)\1(.*)$/)) { this.line[i] = "<h" + res[1].length + ">" + res[2] + "</h" + res[1].length + ">" + res[3]; return true; } return false; }; this.Parse = function() { this.html = ""; for(var i = 0; i < this.line.length ; i++) { var p = true; if(this.HandlePre(i)) continue; if(this.HandleH(i)) p = false; if(p && !this.para) { this.para = true; this.html += "<p>"; } this.html += this.line[i] // Sign // .replace(/~{5}/g, Date()) .replace(/~{4}/g, "<span style='padding:0.2em; margin:0.5em; border:dashed 1px yellow;'>Semnătură</span> "+Date()) .replace(/~{3}/g, "<span style='padding:0.2em; margin:0.5em; border:dashed 1px yellow;'>Semnătură</span>") // Style // .replace(/'''''(.*?)''(.*?)'''/g, "<strong><em>$1</em>$2</strong>") .replace(/'''''(.*?)'''(.*?)''/g, "<em><strong>$1</strong>$2</em>") .replace(/'''(.*?)''(.*?)'''''/g, "<strong>$1<em>$2</em></strong>") .replace(/'''''(.*?)''''/g, "<strong><em>\'$1</em></strong>") .replace(/''''(.*?)''''/g, "<strong><em>$1</em></strong>") .replace(/''''(.*?)'''/g, "<strong>\'$1</strong>") .replace(/'''(.*?)'''/g, "<strong>$1</strong>") .replace(/'''(.*?)''/g, "<em>\'$1</em>") .replace(/''(.*?)''/g, "<em>$1</em>") // List // .replace(/^\*(.*)/g, "<li>$1</li>") .replace(/^#(.*)/g, "<li>$1</li>") .replace(/^:(.*)/g, "<li>$1</li>") // Link // .replace(/\{\{([^\|]*).*}}/g, "<span style='padding:0.2em; margin:0.5em; border:dashed 1px lightgreen;'>Format : $1</span>") .replace(/\[\[[Ii]magine:([^\|]*)[^\[]*\]\]/g, "<span style='padding:0.2em; margin:0.5em; border:dashed 1px lightblue;'>Imagine : $1</span>") .replace(/\[\[[Cc]ategorie:([^\|]*)[^\[]*\]\]/g, "<span style='padding:0.2em; margin:0.5em; border:dashed 1px #FF8080;'><a href='/wiki/Categorie:$1' title='$1'>Categorie : $1</a></span>") .replace(/\[\[([^\[.]*)\|([^\[.]*)\]\]/g, "<a href='/wiki/$1' title='$1'>$2</a>") .replace(/\[\[([^\[.]*)\]\]/g, "<a href='/wiki/$1' title='$1'>$1</a>") /* // Special // .replace(/\n\n/g, "\n\n<br/>") .replace(/(^|\n)-{4}(?!~)/g, "<hr/>") // Table // .replace(/(^|\n)\{\|(.*)/g, "$1<table $2>") .replace(/(^|\n)\|}/g, "$1</table>") .replace(/(^|\n)(\|.*)\|\|/g, "$1$2</td><td>") .replace(/(^|\n)\|[^-}](.*)/g, "$1</td>$2<td>") .replace(/(^|\n)(!.*)!!/g, "$1$2</th><th>") .replace(/(^|\n)![^-](.*)/g, "$1</th>$2<th>") */ ; this.html += "\n"; } return this.html; }; }; /// Hide function hideQuickPreview() { var wpQuickPreview = document.getElementById("wpQuickPreview"); if(wpQuickPreview) { wpQuickPreview.style.display = 'none'; } } $(document).ready(addQuickPreview); //============================================================ // SFÂRŞIT previzualizare rapidă //============================================================ //============================================================ // ÎNCEPUT repararea titlurilor cu iniţială mică //============================================================ // For pages that have something like Template:Lowercase, replace the title, but only if it is cut-and-pasteable as a valid wikilink. // (for instance [[iPod]]'s title is updated. <nowiki>But [[C#]] is not an equivalent wikilink, so [[C Sharp]] doesn't have its main title changed)</nowiki> // // The function looks for a banner like this: <nowiki> // <div id="RealTitleBanner"> <!-- div that gets hidden --> // <span id="RealTitle">title</span> // </div> // </nowiki>An element with id=DisableRealTitle disables the function. var disableRealTitle = 0; // users can disable this by making this true from their monobook.js if ( mw.config.get('wgIsArticle')) { // don't display the RealTitle when editing, since it is apparently inconsistent (doesn't show when editing sections, doesn't show when not previewing) $(document).ready(function() { try { var realTitleBanner = document.getElementById("RealTitleBanner"); if (realTitleBanner && !document.getElementById("DisableRealTitle") && !disableRealTitle) { var realTitle = document.getElementById("RealTitle"); if (realTitle) { var realTitleHTML = realTitle.innerHTML; realTitleText = $(realTitle).text(); var isPasteable = 0; //var containsHTML = /</.test(realTitleHTML); // contains ANY HTML var containsTooMuchHTML = /</.test( realTitleHTML.replace(/<\/?(sub|sup|small|big)>/gi, "") ); // contains HTML that will be ignored when cut-n-pasted as a wikilink // calculate whether the title is pasteable var verifyTitle = realTitleText.replace(/^ +/, ""); // trim left spaces verifyTitle = verifyTitle.charAt(0).toUpperCase() + verifyTitle.substring(1, verifyTitle.length); // uppercase first character // if the namespace prefix is there, remove it on our verification copy. If it isn't there, add it to the original realValue copy. if ( mw.config.get('wgNamespaceNumber') != 0) { if ( mw.config.get('wgCanonicalNamespace') == verifyTitle.substr(0, mw.config.get('wgCanonicalNamespace').length).replace(/ /g, "_") && verifyTitle.charAt( mw.config.get('wgCanonicalNamespace').length) == ":") { verifyTitle = verifyTitle.substr(mw.config.get('wgCanonicalNamespace').length + 1); } else { realTitleText = mw.config.get('wgCanonicalNamespace').replace(/_/g, " ") + ":" + realTitleText; realTitleHTML = mw.config.get('wgCanonicalNamespace').replace(/_/g, " ") + ":" + realTitleHTML; } } // verify whether wgTitle matches verifyTitle = verifyTitle.replace(/^ +/, "").replace(/ +$/, ""); // trim left and right spaces verifyTitle = verifyTitle.replace(/_/g, " "); // underscores to spaces verifyTitle = verifyTitle.charAt(0).toUpperCase() + verifyTitle.substring(1, verifyTitle.length); // uppercase first character isPasteable = (verifyTitle == mw.config.get('wgTitle')); var h1 = document.getElementsByTagName("h1")[0]; if (h1 && isPasteable) { h1.innerHTML = containsTooMuchHTML ? realTitleText : realTitleHTML; if (!containsTooMuchHTML) realTitleBanner.style.display = "none"; } document.title = realTitleText + " - Wikipedia"; } } } catch (e) { /* Something went wrong. */ } }); } //============================================================ // SFÂRŞIT repararea titlurilor cu iniţială mică //============================================================ /** WikiMiniAtlas ******************************************************* * * Description: WikiMiniAtlas is a popup click and drag world map. * This script causes all of our coordinate links to display the WikiMiniAtlas popup button. * The script itself is located on meta because it is used by many projects. * See [[Meta:WikiMiniAtlas]] for more information. * Created by: [[User:Dschwen]] */ mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400'); /** Funcţie care adaugă [[Format:Informaţii]] în cutia pentru trimitere fişiere************** * * Writen by [[commons:User:Yonidebest|User:Yonidebest]] */ function loadAutoInfomationTemplate() { uploadDescription = document.getElementById('wpUploadDescription'); if (uploadDescription==null) { return null; } var tripleTilda = '~~' + '~'; var doubleBracket = '{' + '{'; if ( mw.config.get('wgUserLanguage') != 'fromflickr' && mw.config.get('wgUserLanguage') != 'fromwikimedia' && mw.config.get('wgUserLanguage') != 'fromgov' ) { uploadDescription.focus(); switch( mw.config.get('wgUserLanguage')) { case "ownwork": uploadDescription.value = doubleBracket + 'Informaţii\n|Descriere=\n|Sursa=self-made\n|Data=\n|'+ 'Autor= MyName (' + tripleTilda + ')\n|Permisiune=\n|alte_versiuni=\n}}\n'; break; case "ro-nuestelibera": uploadDescription.value = doubleBracket + 'Material sub drepturi de autor\n|Descriere=\n|Sursa=*OBLIGATORIU*\n|Articol=*OBLIGATORIU*\n|'+ 'Secţiune=cât din fişierul original este folosit?\n|Rezoluţie joasă=da sau nu?\n|Scop=de ce este cu adevărat necesar?\n|Înlocuibil=da sau nu; explicaţi\n|Alte informaţii=\n}}\n'; break; default: uploadDescription.value = doubleBracket + 'Informaţii\n|Descriere=\n|Sursa=\n|Data=\n|' + 'Autor=\n|Permisiune=\n|alte_versiuni=\n}}\n'; break; } } } $(document).ready(loadAutoInfomationTemplate); // support for project:IRC $(document).ready(function () {var ircAdd = document.createElement("script"); ircAdd.setAttribute("type", "text/javascript"); ircAdd.setAttribute("src", "//ro.wikinews.org/w/index.php?title=mediawiki:Irc.js&action=raw&ctype=text/javascript"); document.getElementsByTagName("head")[0].appendChild(ircAdd); }); // adding language tabs at special:Preferences if( mw.config.get('wgCanonicalSpecialPageName') == "Preferences") $(document).ready(function() { var langs = ['ro','en','fr','it','es','pt','de']; for(var i=0;i<langs.length;i++) { mw.util.addPortletLink('p-cactions', mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=' + encodeURIComponent( mw.config.get('wgPageName')) + '&uselang=' + langs[i], langs[i]); } }); /** Collapsible tables ********************************************************* * * Description: Allows tables to be collapsed, showing only the header. See * [[Wikipedia:NavFrame]]. * Maintainers: [[User:R. Koot]] */ var autoCollapse = 2; var collapseCaption = "ascunde"; var expandCaption = "arată"; 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 ( $(Tables[i]).hasClass("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 ( $(NavigationBoxes[i]).hasClass("collapsed" ) || ( tableIndex >= autoCollapse && $(NavigationBoxes[i]).hasClass("autocollapse" ) ) ) { collapseTable( i ); } } } $(document).ready( createCollapseButtons ); /** END Collapsible tables *********************************************************/ // Force preview /*if( mw.config.get('wgAction') == 'edit' || mw.config.get('wgAction') == 'submit' ) { importScript( 'MediaWiki:Common.js/edit.js' ); }*/ // End Force preview // Force summary /*if( mw.config.get('wgAction') == 'edit' || mw.config.get('wgAction') == 'submit' ) { importScript( 'MediaWiki:Common.js/summary.js' ); }*/ // End Force summary // ============================================================ // BEGIN import Onlyifediting-functions // SEE ALSO MediaWiki:Onlyifediting.js /*if (document.URL.indexOf("action=edit") > 0 || document.URL.indexOf("action=submit") > 0) { importScript('MediaWiki:Onlyifediting.js'); }*/ // END import Onlyifediting-functions // ============================================================ /** * Fără obscenităţi în schimbări recente * Vezi //ro.wikipedia.org/w/index.php?title=Wikipedia:Afi%C5%9Fierul_administratorilor&oldid=2457421#Mai_pu.C5.A3ine_obscenit.C4.83.C5.A3i_.C3.AEn_pagina_de_schimb.C4.83ri_recente */ var noobscen_previous_content=''; var noobscen_previous_obscen=false; function noobscen() { var select=document.getElementById('wpDeleteReasonList'); if (select==undefined) { return false; } var input=document.getElementById('wpReason'); select.onchange=function() { if (this.value=="Conţinut obscen") { noobscen_previous_content=input.value; input.value=''; noobscen_previous_obscen=true; } else if (noobscen_previous_obscen) { noobscen_previous_obscen=false; input.value=noobscen_previous_content; } } } if ( mw.config.get('wgAction')=='delete') { $(document).ready(noobscen); } /** END noobscen *****************************/ 97wo79u3lonrrxr8fctnjg0av8xvpaq