|
|
| שורה 21: |
שורה 21: |
| } | | } |
| mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Jon_Harald_Søby/diffedit.js&action=raw&ctype=text/javascript' ); | | mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Jon_Harald_Søby/diffedit.js&action=raw&ctype=text/javascript' ); |
| //צ'קטי
| |
| ( function () {
| |
| if ( typeof mw === 'undefined' || !mw.config ) return;
| |
|
| |
| var checktyScriptUrl = 'https://chabadpedia.co.il/index.php?title=MediaWiki:Gadget-Checkty.js&action=raw&ctype=text/javascript';
| |
|
| |
| function loadCheckty() {
| |
| $.getScript( checktyScriptUrl )
| |
| .done(function() { mw.notify("צ'קטי נטען!", {title: "Checkty", type: "info"}); })
| |
| .fail(function() { mw.notify("טעינת צ'קטי נכשלה", {title: "Checkty", type: "error"}); });
| |
| }
| |
|
| |
| function addButton() {
| |
| var $editTab = $( '#ca-edit' );
| |
| if ( $editTab.length ) {
| |
| var $newTab = $('<li id="ca-checkty">').append(
| |
| $('<a>').attr('href','#').text("צ'קטי").on('click', function(e){
| |
| e.preventDefault();
| |
| loadCheckty();
| |
| })
| |
| );
| |
| $editTab.after( $newTab );
| |
| } else {
| |
| if ( typeof mw.util.addPortletLink === 'function' ) {
| |
| mw.util.addPortletLink('p-cactions', '#', "צ'קטי", 'ca-checkty', "צ'קטי", '', function($link){
| |
| $link.on('click', function(e){
| |
| e.preventDefault();
| |
| loadCheckty();
| |
| });
| |
| });
| |
| }
| |
| }
| |
| }
| |
|
| |
| $( addButton );
| |
| })();
| |