Melding:Gadget-similar-titles.js

Úr Wikipediu, frjálsa alfræðiritinu

Athugaðu: Eftir útgáfu kann að vera að þú þurfir að komast hjá skyndiminni vafrans þíns til að sjá breytingarnar.

  • Firefox / Safari: Haltu Shift samtímis og þú smellir á Endurhlaða (Reload), eða ýttu á annaðhvort Ctrl-F5 eða Ctrl-R (⌘-R á Mac)
  • Google Chrome: Ýttu á Ctrl-Shift-R (⌘-Shift-R á Mac)
  • Internet Explorer / Edge: Haltu Ctrl samtímis og þú smellir á Endurnýja (Refresh), eða ýttu á Ctrl-F5
  • Opera: Farðu í Verkfæri (Tools) → Stillingar (Preferences) og svo Friðhelgi og öryggi (Privacy & security) → Hreinsa vafragögn (Clear browsing data) → Myndir og skrár í skyndiminni (Chached images and files)
(function(mw, $){
    if (mw.config.get( 'wgNamespaceNumber' ) != 0) return;
    $( function (){
    	if (mw.config.get('skin') == 'vector-2022' ) {
    		var x = mw.util.addPortlet('toollinks');
    		$(x).insertAfter( '#p-tb' );
    		mw.util.addPortletLink('toollinks', 
    			"http://tools.wmflabs.org/grep/index.php?lang=is&project=wikipedia&pattern=" + mw.util.rawurlencode(mw.config.get( 'wgTitle' )), 
    			"Líkir titlar", 
    			"t-nikola-similar-titles",
    			"Leit Nikola eftir líkum titlum"
    		);
    	} else {
	        /* Add a link to one of the portlet menus on the page */
    	    mw.util.addPortletLink(
        	    /* id of the target portlet ("p-cactions", "p-personal", "p-navigation" or "p-tb") */
	            "p-tb",
    	        /* link URL */
        	    "http://tools.wmflabs.org/grep/index.php?lang=is&project=wikipedia&pattern=" + mw.util.rawurlencode(mw.config.get( 'wgTitle' )),
	            /* link text (will be automatically lowercased by CSS for p-cactions in Monobook) */
    	        "Líkir titlar",
        	    /* id of the new item, should be unique and preferably have the appropriate prefix ("ca-", "pt-", "n-" or "t-") */
	            "t-nikola-similar-titles",
    	        /* text to show when hovering over the link, without accesskey suffix */
        	    "Leit Nikola eftir líkum titlum",
	            /* accesskey to activate this link (one character, try to avoid conflicts) */
    	        null,
        	    /* the DOM node before which the new item should be added, should be another item in the same list */
            	null
        	);
    	}
    });
})(mediaWiki, jQuery);