Facebook Double Beta

Adds doubles to Facebook

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name          Facebook Double Beta
// @author        Niqueish
// @description   Adds doubles to Facebook
// @homepage      https://www.facebook.com/Niqueish
// @version       1.0
// @include       *://*.facebook.com/*
// @grant         none
// @run-at        document-start
// @require       http://code.jquery.com/jquery-2.2.1.min.js
// @namespace https://greasyfork.org/users/31125
// ==/UserScript==


/* KOLOR PODŚWIETLENIA W HEX*/

var highlightColour = "#ffe";

/* KOLOR PODŚWIETLENIA W HEX*/







function waitForKeyElements(e,t,n,a){var r,o;r="undefined"==typeof a?$(e):$(a).contents().find(e),r&&r.length>0?(o=!0,r.each(function(){var e=$(this),n=e.data("alreadyFound")||!1;if(!n){var a=t(e);a?o=!1:e.data("alreadyFound",!0)}})):o=!1;var l=waitForKeyElements.controlObj||{},i=e.replace(/[^\w]/g,"_"),d=l[i];o&&n&&d?(clearInterval(d),delete l[i]):d||(d=setInterval(function(){waitForKeyElements(e,t,n,a)},300),l[i]=d),waitForKeyElements.controlObj=l}

waitForKeyElements ("._4-u2.mbm._5v3q._4-u8", op);

function op (jNode) {

	    $timestamp = $(jNode).find('a._5pcq');
	
	    var post;
	
	    if($($timestamp).is("[href]")){
			post = $timestamp.attr("href");
		}

	if (typeof post !== 'undefined') {
		
	    var post_id;
	
	    if (post.indexOf("permalink") > -1){
			
		  post_id = post.replace(/\//g, "");
		  post_id = post_id.split("permalink", 2)[1];

		  $(jNode).find('a._5pcq').parent().append('<span> · </span><span class="op_post_id">No. '+post_id+'</span>');
		}


		var xD = $(jNode).find('span.op_post_id').text();
		var last2 = xD.slice(-2);
		
		doubleHighlight = function (str){
			
			var Fletter = str.substr(0, 1);
			return (str.replace(new RegExp(Fletter, 'g'), "").length === 0);
			
		};

		if(doubleHighlight(last2)){
			
		 $(jNode).find('span.op_post_id').css({ "background-color": highlightColour});

		}

	}

}


/////////COMMENTS/////////



waitForKeyElements (".UFICommentContentBlock", comment);

function comment (jNode) {


        var post = $(jNode).find('a.uiLinkSubtle').attr("href");

if (typeof post !== 'undefined') {
		var post_id;

		if(post.indexOf("reply_comment_id") > -1){
			
		  post_id = post.match("reply_comment_id=" + "(.*)" + "&comment_tracking")[1];
		
		}
		else if (post.indexOf("reply_comment_id") == -1 && post.indexOf("comment_id") > -1){
		
			post_id = post.match("comment_id=" + "(.*)" + "&comment_tracking")[1];
		
		}


		$(jNode).find('a.uiLinkSubtle').parent().append('<span> · </span><span class="post_id">No. '+post_id+'</span>');


		var xD = $(jNode).find('span.post_id').text();
		var last2 = xD.slice(-2);

		doubleHighlight = function (str){
			
			var Fletter = str.substr(0, 1);
			return (str.replace(new RegExp(Fletter, 'g'), "").length === 0);
		
		};

		if(doubleHighlight(last2)){
			
		 $(jNode).find('span.post_id').css({ "background-color": highlightColour});
		
		}
}

}