לדלג לתוכן

מדיה ויקי:Gadget-purple.js: הבדלים בין גרסאות בדף

מתוך צפונות ויקי
אין תקציר עריכה
אין תקציר עריכה
שורה 26: שורה 26:
            .wrap($('<li>'));
            .wrap($('<li>'));
}
}
nodes = document.querySelectorAll('.mw-parser-output br');
nodes.forEach(function(node) {
if (node.nextSibling &&
    node.nextSibling.nodeType === 1 &&
    node.nextSibling.tagName === 'BR') {
    node.remove();
    }
});
    });
    });
}
}

גרסה מ־14:50, 22 באוקטובר 2021

/* טיוטה */

if (['ar', 'en', 'he'].includes(mw.config.get('wgUserLanguage'))) {
	$.get(mw.util.wikiScript(), {
	        title: 'module:ערך לא קיים/רשימה.json',
	        action: 'raw'
	    })
	    .done(function(data) {
	        jsonlist = JSON.parse(data);
	        $('a')
	            .filter(function() {
	                return Object.keys(jsonlist)
	                    .includes($(this)
	                        .text());
	            })
	            .addClass('purple');
	            $('.purple:not(.new)')
	            	.removeClass('purple')
	            	.addClass('notpurple');
	            $('.purple')
	            	.css({color: 'violet'});
				if ($('#blue').length > 0) {
		            ($('#blue'))
		            	.append($('.notpurple'));
	    	        $('.notpurple')
	        	    	.wrap($('<li>'));
				}
				nodes = document.querySelectorAll('.mw-parser-output br');
				nodes.forEach(function(node) {
					if (node.nextSibling &&
					    node.nextSibling.nodeType === 1 &&
					    node.nextSibling.tagName === 'BR') {
					    	node.remove();
					    }
				});
	    });
}