ମିଡ଼ିଆଉଇକି:Common.js

ଉଇକିଅଭିଧାନ‌ରୁ

ସୂଚନା: ବଦଳଗୁଡ଼ିକ ଦେଖିବା ପାଇଁ ଆପଣଙ୍କୁ ହୁଏତ ନିଜ ବ୍ରାଉଜର କ୍ୟାସ ବାଇପାସ କରିବାକୁ ପଡ଼ିପାରେ ।

  • Firefox / Safari: Reload ଉପରେ କ୍ଲିକ କରିବା ବେଳେ Shift ଧରି କିମ୍ବା Ctrl-F5 ବା Ctrl-R ଦବାନ୍ତୁ (Macରେ ⌘-R)
  • Google Chrome: Ctrl-Shift-R ଦବାନ୍ତୁ (Macରେ ⌘-Shift-R)
  • Internet Explorer / Edge: Refresh ଉପରେ କ୍ଲିକ କଲା ବେଳେ Ctrl ଧରି ବା Ctrl-F5 ଦବାଇ
  • Opera: Ctrl-F5 ଦବାନ୍ତୁ ।
/* Any JavaScript here will be loaded for all users on every page load. */
mw.loader.using(['mediawiki.cookie']).then(function () {
/*
=== DOM creation ===
*/
/**
 * Create a new DOM node for the current document.
 *    Basic usage:  var mySpan = newNode('span', "Hello World!")
 *    Supports attributes and event handlers*: var mySpan = newNode('span', {style:"color: red", focus: function(){alert(this)}, id:"hello"}, "World, Hello!")
 *    Also allows nesting to create trees: var myPar = newNode('p', newNode('b',{style:"color: blue"},"Hello"), mySpan)
 *
 * *event handlers, there are some issues with IE6 not registering event handlers on some nodes that are not yet attached to the DOM,
 * it may be safer to add event handlers later manually.
**/
function newNode(tagname){

  var node = document.createElement(tagname);
  
  for( var i=1;i<arguments.length;i++ ){
    
    if (typeof arguments[i] == 'string'){ //Text
      node.appendChild( document.createTextNode(arguments[i]) );
      
    } else if(typeof arguments[i] == 'object'){ 
      
      if(arguments[i].nodeName){ //If it is a DOM Node
        node.appendChild(arguments[i]);
        
      } else{ //Attributes (hopefully)
        for(var j in arguments[i]){
          if(j == 'class'){ //Classname different because...
            node.className = arguments[i][j];
            
          } else if(j == 'style'){ //Style is special
            node.style.cssText = arguments[i][j];
            
          } else if(typeof arguments[i][j] == 'function'){ //Basic event handlers
            newNode.addEventHandler(node, j, arguments[i][j]);
          } else{
            node.setAttribute(j,arguments[i][j]); //Normal attributes

          }
        }
      }
    }
  }

  node.addEventHandler =
    function(eventName, handler)
      { newNode.addEventHandler(this, eventName, handler); };
  
  return node;
}

newNode.addEventHandler = function(node, eventName, handler)
{
  try{ node.addEventListener(eventName,handler,false); //W3C
  }catch(e){try{ node.attachEvent('on'+eventName,handler,"Language"); //MSIE
  }catch(e){ node['on'+eventName]=handler; }} //Legacy
};
/*

/*
==Wiktionary Customisation==
*/

//initialize the storage for script options. Gadgets that set script
//options should also include this line as they are loaded before us.
if ( typeof WiktScriptPrefs == 'undefined') {
 WiktScriptPrefs = {};
}

/*
===Edit page javascript===
*/
$(function() { 
 if ( mw.config.get('wgAction') == 'edit' || mw.config.get('wgAction') == 'submit' || document.getElementById('editpage-specialchars') ) {
  importScript('MediaWiki:Edit.js');
 }
});

/*
===Page specific extensions===
*/

/*
====Wiktionary:ପ୍ରଧାନ_ପୃଷ୍ଠା====
*/
// Hide the title and "Redirected from" (maybe we should keep the redirected from so's people update their bookmarks ;)
// Broken in IE!
if ( mw.config.get('wgIsMainPage') && !( mw.config.get('wgAction') == 'view' || mw.config.get('wgAction') == 'submit' ) ){
    mw.loader.using(['mediawiki.util']).then(function() {
    	mw.util.addCSS( '.firstHeading { display: block !important; }' );
    	mw.util.addCSS( '#contentSub { display: inline !important; }' );
    });
}

if (mw.config.get('wgIsMainPage')) {
    mw.loader.using(['mediawiki.util']).then(function () {
        mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/Wiktionary#List_of_Wiktionaries',
                 'Complete list', 'interwiki-completelist', 'Complete list of Wiktionaries');
    });
}

/*
====Special:Search====
*/

if ( mw.config.get('wgCanonicalSpecialPageName') == 'Search') {
    importScript('MediaWiki:SpecialSearch.js');
}
$(function () { if(document.getElementById('preloadGuide')) {
    importScript('MediaWiki:SpecialSearch.js');
}});

/*
====Unsupported titles====
*/

function unsupp() {
 //if (mw.config.get('wgCanonicalNamespace') != 'Appendix') return;//pages have been moved to mainspace, so commenting out this line
 if (mw.config.get('wgTitle').indexOf('Unsupported titles/') !== 0) return;
 string="";
 if (document.getElementById('unsupportedpage')) {string=document.getElementById('unsupportedpage').title;}
 if (string==="") {string="["+mw.config.get('wgTitle').slice(19)+"]";}
 document.getElementById('firstHeading').innerHTML = string;
}
$(unsupp);

/*

====Custom search engines====
*/

if( mw.config.get('wgPageName')=='Help:Tips_and_tricks' ){
    importScript('MediaWiki:CustomSearch.js');
}

/*

====Turn headings in comments into real headings on JavaScript source pages====
*/

else if ((mw.config.get('wgNamespaceNumber') == 2 || mw.config.get('wgNamespaceNumber') == 8) && mw.config.get('wgTitle').lastIndexOf('.js') != -1 && mw.config.get('wgAction') == 'view') {
    importScript('MediaWiki:JavascriptHeadings.js');
}

/*
====Geonotice====
*/
/*Ended December 2009
else if (mw.config.get('wgCanonicalSpecialPageName') === "Watchlist") //watchlist scripts
{
    mw.loader.load('http://toolserver.org/~para/geoip.fcgi');
    $(function() { 
              mw.loader.load('//en.wiktionary.org/w/index.php?title=MediaWiki:Geonotice.js&action=raw&ctype=text/javascript'); 
    });
}
*/

/*
===Make Citations: tabs ===
*/

function citations_tab(){

  var texts = {
      // tab id : [ label, hover-text, access-key (c if tab comes first, 3 if last) ]
      'ca-nstab-main': ['Entry', 'View the dictionary entry', 'c'],
      'ca-nstab-ଆଧାର': ['ଆଧାର', 'ଏହି ପୃଷ୍ଠାର ଆଧାର ଦେଖନ୍ତୁ', '3'],
      'ca-nstab-template': ['Template', 'View the template', 'c'],
      'ca-nstab-documentation': ['Documentation', 'View the documentation', '3']
  };

  var lookup = {}; // {page-title: tab-node} these are looked up and changed to red if missing.

  // Returns [id-of-portlet, node-to-insert-before or null] for inserting the tab.
  function get_insert_position(id) {
    var portlet = document.getElementById('p-namespaces') ? 'p-namespaces' : 'p-cactions';
    var insbef = null;

    if (texts[id][2] == 'c') { // otherwise '3'
       insbef = document.getElementById(portlet).getElementsByTagName('ul')[0].firstChild;
    } else if (portlet == 'p-cactions' ) { // 'last' in Monobook means "before Edit"
      var insbef = document.getElementById('ca-edit');
      if(! insbef) insbef = document.getElementById('ca-viewsource');
    }

    return [portlet, insbef];
  }

  // Add a new namespace with addPortletLink using the lookup table above.
  function add_namespace_tab(page, id) {
    var insert = get_insert_position(id);
    mw.loader.using(['mediawiki.util']).then(function() {
	    mw.util.addPortletLink( insert[0], mw.util.getUrl( page ), texts[id][0], id, texts[id][1], texts[id][2], insert[1] );
	    if (page == mw.config.get('wgPageName')) { // Can by-pass lookup
        var tab = document.getElementById(id);
        tab.className = 'selected';
        if (mw.config.get('wgArticleId') === 0) {
           make_tab_red(tab);
          }
      } else { // lookup the redness with the ajax below
          lookup[page]=document.getElementById(id);
      }
    });
  }

  // Replace the two current tabs with new ones, used when in the third namespace.
  function change_main_tabs(old_id, new_id, talk_page) {
    // Remove old tab.
    var ct = document.getElementById(old_id);
    ct.parentNode.removeChild(ct);
    // Add new tab.
    add_namespace_tab(mw.config.get('wgPageName'), new_id);

    // Change destination of talk tab.
    var dt = document.getElementById('ca-talk');
    var a = dt.getElementsByTagName('a')[0];
    mw.loader.using(['mediawiki.util']).then(function() {
	    a.setAttribute('href', mw.util.getUrl( talk_page ));
    });
    lookup[talk_page] = dt;
    if(dt.className) dt.className = dt.className.replace('new','');
  }

  // Change a blue-link to a red-link
  function make_tab_red(tab){
    tab.className = tab.className+' new';
    var a = tab.getElementsByTagName('a')[0];
    var href = a.getAttribute('href');
    a.setAttribute('href',href+(href.indexOf('?')>0?'&':'?')+'action=edit&redlink=1');
  }
  
  var NS_CITATIONS = 114; //114 has been assigned to 'Citations' namespace
  if( mw.config.get('wgNamespaceNumber') == NS_CITATIONS ){  
    change_main_tabs('ca-nstab-ଆଧାର', 'ca-nstab-ଆଧାର', 'ଆଲୋଚନା:' + mw.config.get('wgTitle'));
    add_namespace_tab(mw.config.get('wgTitle'), 'ca-nstab-main');
    
  } else if( mw.config.get('wgCanonicalNamespace') === '' || mw.config.get('wgCanonicalNamespace') === 'Talk' ){
    add_namespace_tab('ଆଧାର:'+mw.config.get('wgTitle'), 'ca-nstab-ଆଧାର');

  } else if( mw.config.get('wgCanonicalNamespace') == 'Template' && /\/doc$/.test(mw.config.get('wgTitle')) ){
    var baseTitle = mw.config.get('wgTitle').replace(/\/doc$/, "");
    change_main_tabs('ca-nstab-template', 'ca-nstab-documentation', 'Template talk:' + baseTitle);
    add_namespace_tab('Template:' + baseTitle, 'ca-nstab-template');

  } else if( mw.config.get('wgCanonicalNamespace') == 'Template' || mw.config.get('wgCanonicalNamespace') == 'Template_talk' ){
    add_namespace_tab('Template:'+mw.config.get('wgTitle')+'/doc', 'ca-nstab-documentation');
    
  } else{ //Nothing to see here...
    return false;

  }
  
	// Now check for red page
	mw.loader.using( 'mediawiki.api', function () {
		new mw.Api().get( { prop: 'info', titles: Object.keys( lookup ) } ).done( function ( data ) {
			console.log(data.toString());
			var x;
			for ( x in data.query.pages ) {
				if ( x < 0 ) {
					make_tab_red( lookup[data.query.pages[x].title] );
				}
			}
		} );
	} );
}

//jQuery(document).ready( citations_tab );

/*

==URL Fixes==
*/

/**
 * doRedirect will redirect if a did you mean box is found, and create a 
 * "redirected from X" if a rdfrom is passed in the get parameters
 * The first half is an ugly workaround for Bugzilla:3339, :(
 * The second half is an ugly workaround for not having serverware support :(
**/

/*
===Did you mean ____ redirects===
*/

function doRedirect() {

    // REDIRECTED FROM
    if( location.href.indexOf('rdfrom=') != -1 ) {
        var wiktDYMfrom = decodeURIComponent(location.href.replace(/^(.+[&\?]rdfrom=([^&]+).*|.*)?$/,"$2"));
		mw.loader.using(['mediawiki.util']).then(function() {
	        jQuery('#siteSub').after(
    	        newNode('div', {id: 'contentSub'}, '(Auto-redirected from ',
        	        newNode('tt', newNode('a', {href: mw.util.getUrl(wiktDYMfrom) + '?redirect=no', 'class': 'new'}, wiktDYMfrom)),
        	')'));
		});

    } else {
        // DID YOU MEAN
    
        var target = jQuery('#did-you-mean a').html(),
            pagetitle = jQuery('h1').first().text().trim();

		mw.loader.using(['mediawiki.util']).then(function() {
	        if( target && target != pagetitle
                   && !location.href.match(/[&\?]redirect=no|[&\?]action=(?!view)/)
                   && ($.cookie('WiktionaryDisableAutoRedirect') != 'true')
                   && mw.config.get('wgArticleId') === 0
                   && !/Redirected from/.test(jQuery('#contentSub').html())) {
    	        document.location = mw.util.getUrl( target ) + '?rdfrom=' + mw.util.wikiUrlencode( pagetitle );
        	}
		});
    }
}

$(doRedirect);

/*

===Fix Wikified section titles===
*/
$(function () {
  // {temp|template}
  if (/\.7B\.7Btemp\.7C(.*?)\.7D\.7D/.test(location.href)) {
    var url = location.href.replace(/\.7B\.7Btemp.7C/g, ".7B.7B");
    location.href = url;
  }
});

$(function () {
  if(mw.config.get('wgAction') != 'edit')
    return;
  if(! /[?&]section=\d/.test(location.href))
    return;
  var wpSummary = document.getElementById('wpSummary');
  if(! wpSummary)
    return;
  if(wpSummary.value.substr(0, 3) != '/* ')
    return;
  if(wpSummary.value.substr(wpSummary.value.length - 4) != ' */ ')
    return;
  wpSummary.value = wpSummary.value.replace(/\{\{temp(late)?\|/g, '{{');
});

/*
== Visibility toggling ==
*/
var VisibilityToggles = {
    // toggles[category] = [[show, hide],...]; statuses[category] = [true, false,...]; buttons = <li>
    toggles: {}, statuses: {}, buttons: null,

    // Add a new toggle, adds a Show/Hide category button in the toolbar,
    // and will call show_function and hide_function once on register, and every alternate click.
    register: function (category, show_function, hide_function) {

        var id = 0;
        if (!this.toggles[category]) {
            this.toggles[category] = [];
            this.statuses[category] = [];
        } else {
            id = this.toggles[category].length;
        }
        this.toggles[category].push([show_function, hide_function]);
        this.statuses[category].push(this.currentStatus(category));
        this.addGlobalToggle(category);

        (this.statuses[category][id] ? show_function : hide_function)();

        return function () {
            var statuses = VisibilityToggles.statuses[category];
            statuses[id] = !statuses[id]
            VisibilityToggles.checkGlobalToggle(category);
            return (statuses[id] ? show_function : hide_function)();
        }

    },

    // Add a new global toggle to the side bar
    addGlobalToggle: function(category) {
        if (document.getElementById('p-visibility-'+category))
            return;
        if (!this.buttons) {
            this.buttons = newNode('ul');
            var collapsed = $.cookie("vector-nav-p-visibility") == "false", toolbox = newNode('div', {'class': "portal portlet "+(collapsed?"collapsed":"expanded"), 'id': 'p-visibility'},
                            newNode('h5', 'Visibility'),
                            newNode('div', {'class': "pBody body"}, collapsed?undefined:{'style':'display:block;'}, this.buttons)
                          );
            var sidebar = document.getElementById('mw-panel') || document.getElementById('column-one');
            var insert = null;
            if (insert = (document.getElementById('p-lang') || document.getElementById('p-feedback')))
                sidebar.insertBefore(toolbox, insert);
            else
                sidebar.appendChild(toolbox);

        }
        var status = this.currentStatus(category);
        var newToggle = newNode('li', newNode('a', {
            id: 'p-visibility-' + category, 
            style: 'cursor: pointer',
            href: '#visibility-' + category,
            click: function(e)
            {
                VisibilityToggles.toggleGlobal(category); 
                if (e && e.preventDefault)
                    e.preventDefault();
                else 
                    window.event.returnValue = false;
                return false; 
            }},
            (status ? 'Hide ' : 'Show ') + category));
        for (var i=0; i < this.buttons.childNodes.length; i++) {
            if (this.buttons.childNodes[i].id < newToggle.id) {
                this.buttons.insertBefore(newToggle, this.buttons.childNodes[i]);
                return;
            }
        }
        this.buttons.appendChild(newToggle);
    },

    // Update the toggle-all buttons when all things are toggled one way
    checkGlobalToggle: function(category) {
        var statuses = this.statuses[category];
        var status = statuses[0];
        for (var i = 1; i < statuses.length; i++) {
            if (status != statuses[i])
                return;
        }
        document.getElementById('p-visibility-' + category).innerHTML = (status ? 'Hide ' : 'Show ') + category;
    },

    // Toggle all un-toggled elements when the global button is clicked
    toggleGlobal: function(category) {
        var status = document.getElementById('p-visibility-' + category).innerHTML.indexOf('Show ') == 0;
        for (var i = 0; i < this.toggles[category].length; i++ ) {
            if (this.statuses[category][i] != status) {
                this.toggles[category][i][status ? 0 : 1]();
                this.statuses[category][i] = status;
            }
        }
        document.getElementById('p-visibility-' + category).innerHTML = (status ? 'Hide ' : 'Show ') + category;
        var current =$.cookie('Visibility');
        if (!current)
            current = ";";
        current = current.replace(';' + category + ';', ';');
        if (status)
            current = current + category + ";";
        $.cookie('Visibility', current);
    },

    currentStatus: function(category) {
        if (location.hash.toLowerCase().split('_')[0] == '#' + category.toLowerCase())
            return true;
        if (location.href.search(/[?](.*&)?hidecats=/) > 0)
        {
            var hidecats = location.href;
            hidecats = hidecats.replace(/^[^?]+[?]((?!hidecats=)[^&]*&)*hidecats=/, '');
            hidecats = hidecats.replace(/&.*/, '');
            hidecats = hidecats.split(',');
            for (var i = 0; i < hidecats.length; ++i)
                if (hidecats[i] == category || hidecats[i] == 'all')
                    return false;
                else if (hidecats[i] == '!' + category || hidecats[i] == 'none')
                    return true;
        }
        if ($.cookie('WiktionaryPreferencesShowNav') == 'true')
            return true;
        if ($.cookie('Visibility') &&$.cookie('Visibility').indexOf(';' + category + ';') >= 0)
            return true;
        // TODO check category-specific cookies
        return false;
    }
};
/*
=== NavBars ===
*/
var NavigationBarHide = 'ଲୁଚାଇବେ ▲';
var NavigationBarShow = 'ଦେଖାଇବେ ▼';

function NavToggleCategory(navFrame)
{
    var table = navFrame.getElementsByTagName('table')[0];
    if (table && table.className == "translations")
        return "translations";

    var heading = navFrame.previousSibling;
    while (heading) {
        if (/[hH][4-6]/.test(heading.nodeName)) {
            if (heading.getElementsByTagName('span')[1]) {
                return heading.getElementsByTagName('span')[1].innerHTML.toLowerCase();
                }
            else {
                return heading.getElementsByTagName('span')[0].innerHTML.toLowerCase();
                }
            }
        else if (/[hH][1-3]/.test(heading.nodeName)) 
            break;
        heading = heading.previousSibling;
    }
    return "other boxes";
};
function createNavToggle(navFrame){
    var navHead, navToggle, navContent;
    for (var j=0; j < navFrame.childNodes.length; j++) {
        var div = navFrame.childNodes[j];
        switch (div.className) {
            case 'NavHead':
                navHead = div;
                break;
            case 'NavContent':
                navContent = div;
                break;
        }
    }
    if (!navHead || !navContent)
        return;
    // Step 1, don't react when a subitem is clicked.
    for (var i=0; i<navHead.childNodes.length; i++) {
        var child = navHead.childNodes[i];
        if (child.nodeType == 1) {
            child.onclick = function (e)
            {
                if (e && e.stopPropagation)
                    e.stopPropagation();
                else
                    window.event.cancelBubble = true;
            }
        }
    }
    // Step 2, toggle visibility when bar is clicked.
    // NOTE This function was chosen due to some funny behaviour in Safari.
    navToggle = newNode('a', {href: 'javascript:(function(){})()'}, '');
    navHead.insertBefore(newNode('span', {'class': 'NavToggle'}, '[', navToggle, ']'), navHead.firstChild);

    navHead.style.cursor = "pointer";
    navHead.onclick = VisibilityToggles.register(NavToggleCategory(navFrame),
        function show() {
            navToggle.innerHTML = NavigationBarHide;
            if (navContent)
                navContent.style.display = "block";
        },
        function hide() {
            navToggle.innerHTML = NavigationBarShow;
            if (navContent)
                navContent.style.display = "none";
        });
};

$( function ()
{
    var divs = $(".NavFrame");
    for (var i=0; i<divs.length; i++) {
        // NOTE: some templates use a class of NavFrame for the style, but for legacy reasons, are not NavFrames
        if (divs[i].className == "NavFrame") {
            createNavToggle(divs[i]);
        }
    }

});

/*

===Hidden Quotes===
*/

function setupHiddenQuotes(li)
{
   var HQToggle, liComp;
   var HQShow = 'quotations ▼';
   var HQHide = 'quotations ▲';
   for (var k = 0; k < li.childNodes.length; k++) {
      // Look at each component of the definition.
      liComp = li.childNodes[k];
      // If we find a ul or dl, we have quotes or example sentences, and thus need a button.
      if (/^(ul|UL)$/.test(liComp.nodeName)) {
         HQToggle = newNode('a', {href: 'javascript:(function(){})()'}, '');
         li.insertBefore(newNode('span', {'class': 'HQToggle', 'style': 'font-size:0.65em'}, ' [', HQToggle, ']'), liComp);
         HQToggle.onclick = VisibilityToggles.register('quotations',          
            function show() {
               HQToggle.innerHTML = HQHide;
               for (var child = li.firstChild; child != null; child = child.nextSibling) {
                  if (/^(ul|UL)$/.test(child.nodeName)) {
                     child.style.display = 'block';
                     }
                  }
               },
            function hide() {
               HQToggle.innerHTML = HQShow;
               for (var child = li.firstChild; child != null; child = child.nextSibling) {
                  if (/^(ul|UL)$/.test(child.nodeName)) {
                     child.style.display = 'none';
                     }
                  }
               });

         break;
         }
      }
   }            
               
$( function () 
{
   if (mw.config.get('wgNamespaceNumber') == 0) {
      var ols, lis, li;
      // First, find all the ordered lists, i.e. all the series of definitions.
      var ols = document.getElementsByTagName('ol');
      for(var i = 0; i < ols.length; i++) {
         // Then, for every set, find all the individual definitions.
         for (var j = 0; j < ols[i].childNodes.length; j++) {
            li = ols[i].childNodes[j];
            if (li.nodeName.toUpperCase() == 'LI') {
               setupHiddenQuotes(li);
               }
            }
         }
      }
   });

/*
== Interproject links ==
*/

/*
#########
### ProjectLinks
###  by [[user:Pathoschild]] (idea from an older, uncredited script)
###    * generates a sidebar list of links to other projects from {{projectlinks}}
#########
*/
function Projectlinks() {
        var elements = [];
        var spans = document.getElementsByTagName('span');
        
        // filter for projectlinks
        for (var i=0, j=0; i<spans.length; i++) {
                if (spans[i].className == 'interProject') {
                        elements[j] = spans[i].getElementsByTagName('a')[0];
                        j++;
                }
        }

        if (j == 0)
            return;
        
        // sort alphabetically
        function sortbylabel(a,b) {
                // get labels
                a = a.innerHTML.replace(/^.*<a[^>]*>(.*)<\/a>.*$/i,'$1');
                b = b.innerHTML.replace(/^.*<a[^>]*>(.*)<\/a>.*$/i,'$1');

                // return sort order
                if (a < b) return -1;
                if (a > b) return 1;
                return 0;
        }
        elements.sort(sortbylabel);
        
        // Create the list of project links
        var pllist = newNode('ul');
        for (var i=0; i<elements.length; i++) {
                pllist.appendChild(newNode('li', elements[i]));
        }
        var collapsed = $.cookie("vector-nav-p-projects") == "false";
        var projectBox = newNode('div', {'class': 'portlet portal '+(collapsed?"collapsed":"expanded"), id: 'p-projects'}, 
            newNode('h5', 'In other projects'),
            newNode('div', {'class': 'pBody body'}, collapsed?undefined:{'style':'display:block;'}, pllist)
        );

        var insert = document.getElementById('p-tb');
        if (!insert)
            return;

        if (insert.nextSibling)
            insert.parentNode.insertBefore(projectBox, insert.nextSibling);
        else
            insert.parentNode.appendChild(projectBox);
}

$(Projectlinks);
/*
===Scripts specific to Internet Explorer===
*/ 
if (navigator.appName == "Microsoft Internet Explorer")
{
 mw.loader.using(['mediawiki.util']).then(function() {
    // 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;}');
 });
}

/*
===Category page fixes===
*/

$(document).ready(function($){
	var s, c;
	if( mw.config.get('wgNamespaceNumber') === 14 && ( s = document.getElementById("catfix") ) ) {
		c = "#" + s.className.split("CATFIX-")[1];
		s = s.getElementsByTagName("*")[0] || document.createElement("span");
		$("#mw-pages>.mw-content-ltr").find("li>a").each(function(){
			var li = this.parentNode, clone = s.cloneNode( false );
			li.removeChild( this );
			this.setAttribute("href", this.getAttribute("href", 2) + c );
			clone.appendChild( this );
			li.appendChild( clone );
		})
	}
})

/*
===Temporary button for enabling two proposed scripts===
*/

/* Disabling imports from user namespace. This is a security issue. Do not reinstate. -- [[User:Ladsgroup]]
if ( $.cookie("YRNewStuff") || location.search.indexOf("tabbedlanguages=on") != -1 )
{
	importScript("User:Yair rand/editor2.js")
	importScript("User:Yair rand/TabbedLanguages2.js")
}
*/

$(function () {
	
	if(document.getElementById('YRNewStuff-enable-button'))
	{
		document.getElementById('YRNewStuff-enable-button').innerHTML = ""
		var toggle = newNode('span', {click: function ()
		{
			if( $.cookie("YRNewStuff") ){
				$.cookie("YRNewStuff", null,{path:"/"})
				toggle.innerHTML = "Enable tabbed languages and definition editing options."
			}
			else{
				$.cookie("YRNewStuff",1,{expires:30,path:"/"})
				toggle.innerHTML = "Disable tabbed languages and definition editing options."
			}
		} }, ($.cookie("YRNewStuff")?"Disable":"Enable")+" tabbed languages and definition editing options.")
		
		document.getElementById('YRNewStuff-enable-button').appendChild(toggle);
	}

})

$(function () {
    //Odia converter code
    if ( $( "#odia-converter" ).length ) 
    {
        html = $('#hidden-html-code').text();
        $('#odia-converter').html(html);
    }
})

//=== side bar fix - file uploading alternative tool ===
//importScript('MediaWiki:Fileupload.js');
// source and tutorial is at - https://www.mediawiki.org/wiki/Manual:Interface/Sidebar
// tested on - ବ୍ୟବହାରକାରୀ:ଶିତିକଣ୍ଠ ଦାଶ/sidebar.js (https://or.wiktionary.org/s/o7c)
});