GruszkaCaps

Zamienia wszystkie wpisy @92Gruszka na pisane capsem

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name            GruszkaCaps
// @author          Szab
// @description     Zamienia wszystkie wpisy @92Gruszka na pisane capsem
// @include	http://*.wykop.pl/*
// @include	https://*.wykop.pl/*
// @released        2015-06-18
// @updated         2015-06-18
// @grant       none
// @compatible      Greasemonkey
// @version 0.0.1.20151206211048
// @namespace https://greasyfork.org/users/12515
// ==/UserScript==
 
(function(){
 	var occurs = false;
	
	var allcaps = function() { 
		if(occurs) return;
		occurs = true;
		var entries = $('li.entry').find('a.profile[href="http://www.wykop.pl/ludzie/Gruszka92/"]');
		var li = entries.closest('li');
		var contents = li.find('> div > div > div.text > p');
		contents.each( function () {
			var text = $(this).html();
			var html = false;
			var newstring = "";
	
			for(var i = 0; i<text.length; i++) {
				var character = text.charAt(i);
	
				if(html && character == '>')
					html = false;
				else if(!html && character == '<' ) 
					html = true;
				else if(!html){
					character = character.toUpperCase();
				}
		
				newstring = newstring+character;
			}
	
			$(this).html(newstring);
		});
		occurs = false;
	};
 
	$(document).ready(function() {
		allcaps();
		
		$('div[id="content"]').bind('DOMNodeInserted', allcaps);
		$('li.entry').bind('DOMNodeInserted', allcaps);
	});
 
 
})();