|
Tags: Replaced Manual revert |
| Line 11: |
Line 11: |
| } | | } |
| } | | } |
|
| |
|
| |
|
| |
| /*
| |
| * Description: Redirects from /User:UserName/skin.js or .css to the user's actual skin page
| |
| * Maintainer: Cacycle
| |
| */
| |
| if (mw.config.get('wgArticleId') == 0 && mw.config.get('wgUserName')) {
| |
| var slash = mw.config.get('wgPageName').indexOf('/');
| |
| var norm = mw.config.get('wgPageName').substr(0, slash) + mw.config.get('wgPageName').substr(slash).toLowerCase();
| |
| var test = 'User:' + mw.config.get('wgUserName').replace(/ /g, '_') + '/skin.';
| |
| var ext = null;
| |
| if (norm == test + 'js') ext = 'js';
| |
| else if (norm == test + 'css') ext = 'css';
| |
| if (ext != null) window.location.href = window.location.href.replace(/\/skin.(css|js)/i, '/' + skin + '.' + ext);
| |
| }
| |
|
| |
| /** &withJS= URL parameter *******
| |
| * Allow to try custom scripts from MediaWiki space
| |
| * without editing [[Special:Mypage/monobook.js]]
| |
| */
| |
| mw.loader.using( 'mediawiki.util', function() {
| |
| var extraJS = mw.util.getParamValue("withJS");
| |
| if ( extraJS && extraJS.match("^MediaWiki:[^&<>=%]*\.js$") ) {
| |
| importScript(extraJS);
| |
| }
| |
| } );
| |
|
| |
| /**
| |
| * WikiMiniAtlas is a popup click and drag world map.
| |
| * See [[meta:WikiMiniAtlas]] for more information.
| |
| * Maintainers: [[w:User:Dschwen]]
| |
| */
| |
| mw.loader.load( '//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript' );
| |
|
| |
| /* Scripts specific to Internet Explorer */
| |
|
| |
| if (navigator.appName == "Microsoft Internet Explorer")
| |
| {
| |
|
| |
| // In print IE (7?) does not like line-height
| |
| mw.util.addCSS( '@media print { sup, sub, p, .documentDescription { line-height: normal; }}');
| |
|
| |
| // IE overflow bug
| |
| mw.util.addCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');
| |
|
| |
| // IE zoomfix
| |
| // Use to fix right floating div/table inside tables
| |
| mw.util.addCSS('.iezoomfix div, .iezoomfix table { zoom: 1;}');
| |
| }
| |
|
| |
| /** Interwiki links to featured articles ***************************************
| |
| *
| |
| * Description: Highlights interwiki links to featured articles (or
| |
| * equivalents) by changing the bullet before the interwiki link
| |
| * into a star.
| |
| * Maintainers: [[User:R. Koot]]
| |
| */
| |
|
| |
| function LinkFA()
| |
| {
| |
| if ( document.getElementById( "p-lang" ) ) {
| |
| var InterwikiLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" );
| |
|
| |
| for ( var i = 0; i < InterwikiLinks.length; i++ ) {
| |
| if ( document.getElementById( InterwikiLinks[i].className + "-fa" ) ) {
| |
| InterwikiLinks[i].className += " FA"
| |
| InterwikiLinks[i].title = "Bu madde, başka bir dilde seçkin madde statüsündedir.";
| |
| } else if ( document.getElementById( InterwikiLinks[i].className + "-ga" ) ) {
| |
| InterwikiLinks[i].className += " GA"
| |
| InterwikiLinks[i].title = "Eno madde, jewna zuwan de wesiqeyo weşo.";
| |
| }
| |
| }
| |
| }
| |
| }
| |
|
| |
| $( LinkFA );
| |
|
| |
|
| |
| /** Collapsible tables *********************************************************
| |
| *
| |
| * Description: Allows tables to be collapsed, showing only the header. See
| |
| * [[Wikipedia:NavFrame]].
| |
| * Maintainers: [[User:R. Koot]]
| |
| */
| |
|
| |
| var autoCollapse = 2;
| |
| var collapseCaption = "bınımne";
| |
| var expandCaption = "bımocne";
| |
|
| |
| 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.className = "collapseButton"; //Styles are declared in Common.css
| |
|
| |
| ButtonLink.style.color = Header.style.color;
| |
| ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
| |
| ButtonLink.setAttribute( "href", "#" );
| |
| $( ButtonLink ).on( "click", new Function( "evt", "collapseTable(" + tableIndex + " ); return false;") );
| |
| 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 );
| |
| }
| |
| else if ( $(NavigationBoxes[i]).hasClass("innercollapse" ) ) {
| |
| var element = NavigationBoxes[i];
| |
| while (element = element.parentNode) {
| |
| if ( $(element).hasClass("outercollapse" ) ) {
| |
| collapseTable ( i );
| |
| break;
| |
| }
| |
| }
| |
| }
| |
| }
| |
| }
| |
|
| |
| $( 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 ($(NavChild).hasClass('NavContent') || $(NavChild).hasClass('NavPic')) {
| |
| 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 ($(NavChild).hasClass('NavContent') || $(NavChild).hasClass('NavPic')) {
| |
| 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 ($(NavFrame).hasClass("NavFrame")) {
| |
|
| |
| indexNavigationBar++;
| |
| var NavToggle = document.createElement("a");
| |
| NavToggle.className = 'NavToggle';
| |
| NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
| |
| NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');
| |
|
| |
| var isCollapsed = $(NavFrame).hasClass("collapsed" );
| |
| /*
| |
| * Check if any children are already hidden. This loop is here for backwards compatibility:
| |
| * the old way of making NavFrames start out collapsed was to manually add style="display:none"
| |
| * to all the NavPic/NavContent elements. Since this was bad for accessibility (no way to make
| |
| * the content visible without JavaScript support), the new recommended way is to add the class
| |
| * "collapsed" to the NavFrame itself, just like with collapsible tables.
| |
| */
| |
| for (var NavChild = NavFrame.firstChild; NavChild != null && !isCollapsed; NavChild = NavChild.nextSibling) {
| |
| if ( $(NavChild).hasClass('NavPic' ) || $(NavChild).hasClass('NavContent' ) ) {
| |
| if ( NavChild.style.display == 'none' ) {
| |
| isCollapsed = true;
| |
| }
| |
| }
| |
| }
| |
| if (isCollapsed) {
| |
| for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
| |
| if ( $(NavChild).hasClass('NavPic' ) || $(NavChild).hasClass('NavContent' ) ) {
| |
| NavChild.style.display = 'none';
| |
| }
| |
| }
| |
| }
| |
| var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
| |
| 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 ($(NavFrame.childNodes[j]).hasClass("NavHead")) {
| |
| NavToggle.style.color = NavFrame.childNodes[j].style.color;
| |
| NavFrame.childNodes[j].appendChild(NavToggle);
| |
| }
| |
| }
| |
| NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
| |
| }
| |
| }
| |
| }
| |
|
| |
| $( createNavigationBarToggleButton );
| |
|
| |
|
| |
| /** Main Page layout fixes *********************************************************
| |
| *
| |
| * Description: Adds an additional link to the complete list of languages available.
| |
| * Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
| |
| */
| |
|
| |
| if (mw.config.get('wgPageName') == 'Pela_Seri' || mw.config.get('wgPageName') == 'Talk:Pela_Seri')
| |
| $.when(mw.loader.using('mediawiki.util'), $.ready).then(function () {
| |
| mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
| |
| 'Liste pero', 'interwiki-completelist', 'tam listey Wikiya');
| |
| });
| |
|
| |
|
| |
| // -------------------------------------------------------------------------------
| |
| // Force Preview JavaScript code - Start
| |
| //
| |
| // To allow any group to bypass being forced to preview,
| |
| // enter the group name in the permittedGroups array.
| |
| // E.g.
| |
| // var permittedGroups = []; // force everyone
| |
| // var permittedGroups = [ "user"]; // permit logged-in users
| |
| // var permittedGroups = [ "sysop", "bureaucrat"]; // permit sysop, bureaucrat
| |
| // -------------------------------------------------------------------------------
| |
| var permittedGroups = [ "autoconfirmed"];
| |
|
| |
| function forcePreview()
| |
| {
| |
| if( mw.config.get('wgAction') != "edit") return;
| |
| if( mw.config.get('wgUserGroups') === null) {
| |
| mw.config.get('wgUserGroups') = [];
| |
| }
| |
| if ( mw.config.get( "wgUserGroups" ).filter(function(group) {
| |
| return permittedGroups.indexOf(group) > -1;
| |
| }).length ) return;
| |
| var saveButton = document.getElementById("wpSave");
| |
| if( !saveButton )
| |
| return;
| |
| saveButton.disabled = true;
| |
| saveButton.value = "Ena pela qeyd ke";
| |
| saveButton.style.fontWeight = "normal";
| |
| document.getElementById("wpPreview").style.fontWeight = "bold";
| |
| }
| |
|
| |
| $(forcePreview);
| |
| // -----------------------------------------------------
| |
| // Force Preview JavaScript code - End
| |
| // -----------------------------------------------------
| |
|
| |
|
| |
| // Sidebar Değişiklikleri
| |
| function ModifySidebar(action, section, name, link) {
| |
| try {
| |
| switch (section) {
| |
| case "zıwane bini":
| |
| var target = "p-lang";
| |
| break;
| |
| case "wesayıti":
| |
| var target = "p-tb";
| |
| break;
| |
| case "geyrayış":
| |
| var target = "p-navigation";
| |
| break;
| |
| default:
| |
| var target = "p-" + section;
| |
| break;
| |
| }
| |
|
| |
| if (action == "add") {
| |
| var node = document.getElementById(target)
| |
| .getElementsByTagName('div')[0]
| |
| .getElementsByTagName('ul')[0];
| |
|
| |
| var aNode = document.createElement('a');
| |
| var liNode = document.createElement('li');
| |
|
| |
| aNode.appendChild(document.createTextNode(name));
| |
| aNode.setAttribute('href', link);
| |
| liNode.appendChild(aNode);
| |
| liNode.className='plainlinks';
| |
| node.appendChild(liNode);
| |
| }
| |
|
| |
| if (action == "remove") {
| |
| var list = document.getElementById(target)
| |
| .getElementsByTagName('div')[0]
| |
| .getElementsByTagName('ul')[0];
| |
|
| |
| var listelements = list.getElementsByTagName('li');
| |
|
| |
| for (var i = 0; i < listelements.length; i++) {
| |
| if (listelements[i].getElementsByTagName('a')[0].innerHTML == name ||
| |
| listelements[i].getElementsByTagName('a')[0].href == link) {
| |
|
| |
| list.removeChild(listelements[i]);
| |
| }
| |
| }
| |
| }
| |
|
| |
| } catch(e) {
| |
| // lets just ignore what's happened
| |
| return;
| |
| }
| |
| }
| |
|
| |
| function CustomizeModificationsOfSidebar() {
| |
| //removes [[Xısusi:Bar ke]] from toolbox
| |
| ModifySidebar("remove", "araçlar", "Dosya Bar ke", "//diq.wikipedia.org/wiki/Xısusi:Bar ke");
| |
| //adds [[Wikipediya:Bar ke]] to toolbox
| |
| ModifySidebar("add", "wesayıti", "Dosya Bar ke", "//diq.wikipedia.org/wiki/Wikipediya:Bar ke");
| |
| }
| |
|
| |
| $(CustomizeModificationsOfSidebar);
| |
|
| |
| /**
| |
| * Şablon:Galeriya xuzoyın
| |
| */
| |
| function toggleImage(group, remindex, shwindex) {
| |
| document.getElementById("ImageGroupsGr"+group+"Im"+remindex).style.display="none";
| |
| document.getElementById("ImageGroupsGr"+group+"Im"+shwindex).style.display="inline";
| |
| }
| |
| function ImageGroup(){
| |
| if (document.URL.match(/printable/g)) return;
| |
| var divs=document.getElementsByTagName("div");
| |
| var i = 0, j = 0;
| |
| var units, search;
| |
| var currentimage;
| |
| var UnitNode;
| |
| for (i = 0; i < divs.length ; i++) {
| |
| if (divs[i].className != "ImageGroup") continue;
| |
| UnitNode=undefined;
| |
| search=divs[i].getElementsByTagName("div");
| |
| for (j = 0; j < search.length ; j++) {
| |
| if (search[j].className != "ImageGroupUnits") continue;
| |
| UnitNode=search[j];
| |
| break;
| |
| }
| |
| if (UnitNode==undefined) continue;
| |
| units=Array();
| |
| for (j = 0 ; j < UnitNode.childNodes.length ; j++ ) {
| |
| var temp = UnitNode.childNodes[j];
| |
| if (['center', 'mw-halign-center'].some(function(className) { return temp.classList.contains(className); })) { units.push(temp); }
| |
| }
| |
| var wrap;
| |
| for (j = 0 ; j < units.length ; j++) {
| |
| currentimage=units[j];
| |
| wrap = document.createElement('div');
| |
| wrap.id = "ImageGroupsGr" + i + "Im" + j;
| |
| currentimage.parentNode.insertBefore(wrap, currentimage);
| |
| wrap.appendChild(currentimage);
| |
| var imghead = document.createElement("div");
| |
| var leftlink = document.createElement("a");
| |
| var rightlink = document.createElement("a");
| |
| if (j != 0) {
| |
| leftlink.href = "javascript:toggleImage("+i+","+j+","+(j-1)+");";
| |
| leftlink.innerHTML="◀";
| |
| }
| |
| if (j != units.length - 1) {
| |
| rightlink.href = "javascript:toggleImage("+i+","+j+","+(j+1)+");";
| |
| rightlink.innerHTML="▶";
| |
| }
| |
| var comment = document.createElement("tt");
| |
| comment.innerHTML = "("+ (j+1) + "/" + units.length + ")";
| |
| with(imghead) {
| |
| style.fontSize="110%";
| |
| style.fontweight="bold";
| |
| appendChild(leftlink);
| |
| appendChild(comment);
| |
| appendChild(rightlink);
| |
| }
| |
| if (units.length>1) wrap.insertBefore(imghead,wrap.childNodes[0]);
| |
| if (j != 0) wrap.style.display="none";
| |
| }
| |
| }
| |
| }
| |
| $(ImageGroup);
| |
|
| |
| /**
| |
| * Ajax transclusion table adds dynamic content loading to tables with class="attable".
| |
| * (This is a customised copy for diqwiki.)
| |
| * @see https://meta.wikimedia.org/wiki/Ajax_transclusion_table
| |
| * @update-token [[File:pathoschild/ajaxtransclusiontable.js]]
| |
| */
| |
| function attIntialize() {
| |
| /* namespace */
| |
| var att = {};
| |
|
| |
| /* find AJAX tables */
| |
| att.alltables = document.getElementsByTagName('table'); // all tables
| |
| att.tables = new Array(); // AJAX tables
| |
| att.count = att.alltables.length; // count all tables
| |
| var x = 0; // count AJAX tables
| |
| for(var i=0; i<att.count; i++) {
| |
| if(att.alltables[i].getAttribute('class')) {
| |
| if(att.alltables[i].getAttribute('class').match(/\battable\b/)) {
| |
| att.tables[x] = att.alltables[i];
| |
| x++;
| |
| }
| |
| }
| |
| }
| |
| if(att.tables.length) {
| |
| /* array of all att rows */
| |
| att.rows = new Array;
| |
|
| |
| /* rebuild tables with tbodies */
| |
| att.countTables = att.tables.length;
| |
| for(var i=0; i<att.countTables; i++) {
| |
| /* get elements */
| |
| att.table = att.tables[i];
| |
| att.trows = att.table.getElementsByTagName('tr');
| |
| att.countRows = att.trows.length;
| |
|
| |
| /* rebuild and fill row array */
| |
| att.tbody = document.createElement('tbody');
| |
| for(var x=0; x<att.countRows; x++) {
| |
| att.countTemp = att.rows.length;
| |
| att.rows[att.countTemp] = att.trows[x].cloneNode(true);
| |
| att.rows[att.countTemp].setAttribute('id','oldrow_'+att.countTemp);
| |
| att.tbody.appendChild(att.rows[att.countTemp]);
| |
| }
| |
| att.table.innerHTML = '';
| |
| att.table.appendChild(att.tbody);
| |
| }
| |
|
| |
| /* create template add/show link */
| |
| att.shlink = document.createElement('a');
| |
| att.shlink.setAttribute('style','font-size:0.9em; cursor:pointer;');
| |
| att.shlink.appendChild(document.createTextNode('[bımocne] '));
| |
|
| |
| /* add show/hide links */
| |
| att.countRows = att.rows.length;
| |
| for(var i=0; i<att.countRows; i++) {
| |
| att.row = att.rows[i];
| |
| att.firstCell = att.row.getElementsByTagName('td')[0];
| |
| // skip rows with no links or cells
| |
| att.link = att.row.getElementsByTagName('a')[0];
| |
| if(att.link && att.link.getAttribute('href').match(/^\/wiki/) && att.firstCell) {
| |
| att.row.setAttribute('id','oldrow_'+i);
| |
| att.newlink = att.shlink.cloneNode(true);
| |
| att.newlink.setAttribute('OnClick','attShow('+i+');');
| |
| att.newlink.setAttribute('id','attlink_'+i);
| |
| att.firstCell.insertBefore(att.newlink,att.firstCell.firstChild);
| |
| }
| |
| }
| |
| }
| |
| }
| |
|
| |
| function attShow(id) {
| |
| /* get elements */
| |
| var att = {};
| |
| att.row = document.getElementById('oldrow_'+id);
| |
| att.tbody = att.row.parentNode;
| |
|
| |
| /* build display row */
| |
| att.colspan = att.row.getElementsByTagName('td').length;
| |
| att.newrow = document.createElement('tr');
| |
| att.newrow.setAttribute('id','newrow_'+id);
| |
| att.newcell = document.createElement('td');
| |
| att.newcell.setAttribute('colspan',att.colspan);
| |
| att.newbox = document.createElement('div');
| |
| att.newbox.setAttribute('style','margin:0.5em; padding:0.5em; border:2px solid gray;');
| |
| att.loader = document.createElement('img');
| |
| att.loader.setAttribute('src','//upload.wikimedia.org/wikipedia/commons/d/d2/Spinning_wheel_throbber.gif');
| |
| att.newbox.appendChild(att.loader);
| |
| att.newcell.appendChild(att.newbox);
| |
| att.newrow.appendChild(att.newcell);
| |
| att.tbody.insertBefore(att.newrow,att.row.nextSibling);
| |
|
| |
| /* get title */
| |
| att.links = att.row.getElementsByTagName('a');
| |
| att.count = att.links.length;
| |
| for(var i=0; i<att.count; i++) {
| |
| if(att.links[i].getAttribute('title')) {
| |
| att.title = att.links[i].getAttribute('title');
| |
| break;
| |
| }
| |
| }
| |
| att.query = sajax_init_object();
| |
| att.url = mw.config.get('wgServer')+'/wiki/'+att.title+'?action=render';
| |
| att.query.open('GET',att.url,true);
| |
| att.query.send('');
| |
| att.query.onreadystatechange = function() {
| |
| if(att.query.readyState==4) {
| |
| if(att.query.status==200) {
| |
| att.newbox.innerHTML = att.query.responseText;
| |
| }
| |
| else {
| |
| att.loader.setAttribute('img','//upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Achtung.svg/32px-Achtung.svg.png');
| |
| }
| |
| }
| |
| }
| |
| /* update show/hide link */
| |
| att.shlink = document.getElementById('attlink_'+id);
| |
| att.shlink.innerHTML = '[bınımne] ';
| |
| att.shlink.setAttribute('OnClick','attHide('+id+');');
| |
| }
| |
|
| |
| function attHide(id) {
| |
| /* get elements */
| |
| var att = {};
| |
| att.row = document.getElementById('newrow_'+[id]);
| |
| att.shlink = document.getElementById('attlink_'+id);
| |
|
| |
| /* remove display row */
| |
| att.row.parentNode.removeChild(att.row);
| |
|
| |
| /* update show/hide link */
| |
| att.shlink.innerHTML = '[bımocne] ';
| |
| att.shlink.setAttribute('OnClick','attShow('+id+');');
| |
| }
| |
|
| |
| if(!location.href.match('disableatt=true')) {
| |
| attIntialize();
| |
| }
| |
|
| |
| /**
| |
| * Déplacement des [modifier]
| |
| *
| |
| * Correction des titres qui s'affichent mal en raison de limitations dues à MediaWiki.
| |
| * Ce script devrait pouvoir être supprimé lorsque le [[bugzilla:11555]] sera résolu (comportement équivalent)
| |
| *
| |
| * Copyright 2006, Marc Mongenet. Licence GPL et GFDL.
| |
| *
| |
| * The function looks for <span class="editsection">, and move them
| |
| * at the end of their parent and display them inline in small font.
| |
| * var oldEditsectionLinks=true disables the function.
| |
| */
| |
| function setModifySectionStyle()
| |
| {
| |
|
| |
| var process = function(list)
| |
| {
| |
| for(var i=0;i!=list.length;i++)
| |
| {
| |
| var span=list[i].firstChild
| |
|
| |
| if (span.className == "editsection")
| |
| {
| |
| span.style.fontSize = "xx-small";
| |
| span.style.fontWeight = "normal";
| |
| span.style.cssFloat = span.style.styleFloat = "none";
| |
| span.parentNode.appendChild(document.createTextNode(" "));
| |
| span.parentNode.appendChild(span);
| |
| }
| |
| }
| |
| }
| |
|
| |
| try
| |
| {
| |
| if (!(typeof oldEditsectionLinks == 'undefined' || oldEditsectionLinks == false)) return;
| |
| process(document.getElementsByTagName("h2"));
| |
| process(document.getElementsByTagName("h3"));
| |
| process(document.getElementsByTagName("h4"));
| |
| process(document.getElementsByTagName("h5"));
| |
| process(document.getElementsByTagName("h6"));
| |
|
| |
| }
| |
| catch (e) { }
| |
| }
| |
| $(setModifySectionStyle);
| |
|
| |
| //******************************************************************
| |
| // Ana Sayfadaki Metabox için gereken kod. İlk fırsatta muadili bulunacak
| |
| //******************************************************************
| |
|
| |
| /* Funcionament de la Plantilla:Metacaixa
| |
| Implementat per: Usuari:Peleguer.
| |
| Actualitzat per Joanjoc seguint les indicacions d'en Martorell
| |
| */
| |
|
| |
| function MetaCaixaInit(){
| |
| //S'executa al carregar-se la pàgina, si hi ha metacaixes,
| |
| // s'assignen els esdeveniments als botons
| |
| //alert("MetaCaixaInit");
| |
|
| |
| var i=0 //Inicialitzem comptador de caixes
| |
| for (i=0;i<=9;i++){
| |
| var vMc = document.getElementById("mc"+i);
| |
| if (!vMc) break;
| |
| //alert("MetaCaixaInit, trobada Metacaixa mc"+i);
| |
|
| |
| var j=1 //Inicialitzem comptador de botons dins de la caixa
| |
| var vPsIni = 0 //Pestanya visible inicial
| |
| for (j=1;j<=9;j++){
| |
| var vBt = document.getElementById("mc"+i+"bt"+j);
| |
| if (!vBt) break;
| |
| //alert("MetaCaixaInit, trobat botó mc"+i+"bt"+j);
| |
| vBt.onclick = MetaCaixaMostraPestanya; //A cada botó assignem l'esdeveniment onclick
| |
| //alert (vBt.className);
| |
| if (vBt.className=="mcBotoSel") vPsIni=j; //Si tenim un botó seleccionat, en guardem l'index
| |
| }
| |
| //alert ("mc="+i+", ps="+j+", psini="+vPsIni );
| |
| if (vPsIni == 0) { //Si no tenim cap botó seleccionat, n'agafem un aleatòriament
| |
| vPsIni = 1+Math.floor((j-1)*Math.random()) ;
| |
| //alert ("Activant Pestanya a l'atzar; _mc"+i+"bt"+vPsIni +"_");
| |
| document.getElementById("mc"+i+"ps"+vPsIni).style.display = "block";
| |
| document.getElementById("mc"+i+"ps"+vPsIni).style.visibility = "visible";
| |
| document.getElementById("mc"+i+"bt"+vPsIni).className="mcBotoSel";
| |
| }
| |
| }
| |
| }
| |
|
| |
| function MetaCaixaMostraPestanya(){
| |
| //S'executa al clicar una pestanya,
| |
| //aquella es fa visible i les altres s'oculten
| |
| var vMcNom = this.id.substr(0,3); //A partir del nom del botó, deduïm el nom de la caixa
| |
| var vIndex = this.id.substr(5,1); //I l'index
| |
|
| |
| var i=1
| |
| for (i=1;i<=9;i++){ //busquem totes les pestanyes d'aquella caixa
| |
| //alert(vMcNom+"ps"+i);
| |
| var vPsElem = document.getElementById(vMcNom+"ps"+i);
| |
| if (!vPsElem) break;
| |
| if (vIndex==i){ //Si és la pestanya bona la mostrem i canviem la classe de botó
| |
| vPsElem.style.display = "block";
| |
| vPsElem.style.visibility = "visible";
| |
| document.getElementById(vMcNom+"bt"+i).className="mcBotoSel";
| |
| } else { //Sinó, l'ocultem i canviem la classe de botó
| |
| vPsElem.style.display = "none";
| |
| vPsElem.style.visibility = "hidden";
| |
| document.getElementById(vMcNom+"bt"+i).className="mcBoto";
| |
| }
| |
| }
| |
| return false; //evitem la recàrrega de la pàgina
| |
| }
| |
|
| |
| $(MetaCaixaInit);
| |
|
| |
|
| |
| $( function() {
| |
| if ($('li.interwiki-ku').length || $('li.interwiki-ckb').length) {
| |
| $('li.interwiki-ckb').prependTo('#p-lang ul');
| |
| $('li.interwiki-ku').prependTo('#p-lang ul');
| |
| }
| |
| });
| |
|
| |
| $( function() { if ($('li.interwiki-mzn').length || $('li.interwiki-glk').length) { $('li.interwiki-glk').prependTo('#p-lang ul'); $('li.interwiki-mzn').prependTo('#p-lang ul'); } });
| |