မီႇတီႇယႃႇဝီႇၶီႇ:CustomSearch.js

လုၵ်ႉတီႈ ဝိၵ်ႇသျိၼ်ႇၼရီႇ မႃး

မၢႆတွင်း: ဝၢႆးသေသိမ်းပၼ်ယဝ်ႉ၊ တွၼ်ႈတႃႇ ၸဝ်ႈၵဝ်ႇ တေႁၼ်လႆႈ လွင်ႈလႅၵ်ႈလၢႆႈၼၼ်ႉ ၸဝ်ႈၵဝ်ႇတေၸၢင်ႈလႆႈလတ်းၶၢမ်ႈ ၶႅတ်ႉၶျ် တူဝ်ပိုတ်ႇဝႅပ်ႉၸဝ်ႈၵဝ်ႇယဝ်ႉ။

  • ၽွင်းမိူဝ်ႈတိုၵ်ႉၼဵၵ်း Reload တီႈ Firefox / Safari: ၼၼ်ႉ ၼဵၵ်းဝႆႉပႃး Shift ၊ဢမ်ႇၼၼ် ၼဵၵ်းပၼ် Ctrl-F5 ဢမ်ႇၼၼ် Ctrl-R (တီႈၼႂ်း Mac ၼႆ ၼဵၵ်းပၼ်⌘-R)
  • တီႈၼႂ်း Google Chrome: ၼဵၵ်းပၼ် Ctrl-Shift-R (တီႈၼႂ်း Mac ၼႆႉ ၼဵၵ်းပၼ်⌘-Shift-R )
  • ၽွင်းမိူဝ်ႈ တိုၵ်ႉၼဵၵ်း Refreshတီႈ Internet Explorer/ Edge: ၼဵၵ်းဝႆႉပၼ် Ctrl ဢမ်ႇၼၼ် ၼဵၵ်းပၼ် Ctrl-F5
  • တီႈၼႂ်း Opera: ၵႂႃႇၸူးတီႈ Menu → Settings (ပေႃးပဵၼ်တီႈၼႂ်း Mac ၸိုင် Opera → Preferences ) သေ သိုပ်ႇၵႂႃႇ Privacy & security → Clear browsing data → Cached images and files ၼၼ်ႉလႄႈ။
// {{documentation}}
/*
** This file should only be included for pages that use it. At the moment that is only [[Help:Tips_and_tricks]]. 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 [[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:SearchEnWiktWithMediaWiki.xml',
        'Add integrated search provider “English Wiktionary”.'
    );

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

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

    // English Witionary search with Ninjawords
    appendSearchProviderLink(
        'MediaWiki:SearchWithNinjawords.xml',
        'Add integrated search provider “English Wiktionary via Ninjawords”.'
    );

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

        var providerXmlUrl =
            'http://en.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);
    }
});