ମିଡ଼ିଆଉଇକି:CustomSearch.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 ଦବାନ୍ତୁ ।
/* This file should only be included for pages that use it. At the moment that is only [[:en:Help:Customizing_your_monobook]]. If you wish to add pages to use this, edit the relevant section of Common.js
 
FireFox and IE 7 allow sites to customize the integrated search box. Below exposes that through [[:en:WT:CUSTOM]]. */

$(function () {
    // Find the container node and bail if it's not there
    var searches = document.getElementById('wtCustomIntegratedSearchProviders');
    if (!searches) return;

    // Remove all children from 'searches'
    while (searches.hasChildNodes()) {
        searches.removeChild(searches.firstChild);
    }

    // Bail out in unsupported browsers with a message that this doesn't work
    if (!(window.external && ("AddSearchProvider" in window.external))) {
        var span = document.createElement('em');
        span.appendChild(document.createTextNode('This feature is not supported by your browser. Sorry!'));
        searches.appendChild(span);
        return;
    }

    // MediaWiki built-in search
    appendSearchProviderLink(
        'MediaWiki:SearchOrWiktWithMediaWiki.xml',
        'Add integrated search provider “Odia Wiktionary”.'
    );

    // Odia Witionary search with Google
    appendSearchProviderLink(
        'MediaWiki:SearchOrWiktWithGoogle.xml',
        'Add integrated search provider “Odia Wiktionary via Google”.'
    );

    // All Witionary search with Google
    appendSearchProviderLink(
        'MediaWiki:SearchAllWiktWithGoogle.xml',
        'Add integrated search provider “All Wiktionaries via Google”.'
    );


    // Anchor creator helper
    function appendSearchProviderLink(providerXml, linkText) {
        var anchor = document.createElement("a");
        anchor.setAttribute('href', '#');
        anchor.appendChild(document.createTextNode(linkText));

        var providerXmlUrl =
            'http://or.wiktionary.org/w/index.php?action=raw&title=' +
            encodeURIComponent(providerXml);

        anchor.onclick = function () {
            window.external.AddSearchProvider(providerXmlUrl);
            return false;
        };

        if (searches.hasChildNodes()) {
            searches.appendChild(document.createElement("br"));
        }

        searches.appendChild(anchor);
    }
});