Facebook Double

Adds doubles to Facebook

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name          Facebook Double
// @author        Niqueish (edited by noisy cat)
// @description   Adds doubles to Facebook
// @homepage      https://www.facebook.com/Niqueish
// @version       1.0n
// @include       *://*.facebook.com/*
// @grant         none
// @require       http://code.jquery.com/jquery-2.2.1.min.js
// @require https://greasyfork.org/scripts/20860-arrive-upload/code/arrive-upload.js?version=133295
// @namespace https://greasyfork.org/users/31125
// ==/UserScript==


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

//HEX
var highlightColour = "#ffe";

function fillPost(element)
{
    console.log(element);
    if (element.hasClass("postid"))
        return;

    element.addClass("postid");

    var post = element.find('a._5pcq').attr("href");
    var post_id = post.match(/(?:permalink|posts|videos|(?:photos\/.*\/))\/([0-9]*)/);
    if (!post_id)
        return;
    post_id = post_id[1];
    var container = element.find('a._5pcq').first().parent();
    console.log(container);
    container.append('<span> · </span><span class="post_id">No. '+post_id+'</span>');
}

function fillComment(element)
{
    if (element.hasClass("postid"))
        return;

    element.addClass("postid");

    var post = element.find('a.uiLinkSubtle').attr("href");
    var post_id = post.match(/comment_id=([0-9]*)&comment_tracking/)[1];

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

$("body").arrive(".userContentWrapper:not(.postid)", {fireOnAttributesModification: true, existing: true}, function() { fillPost($(this)); });
$("body").arrive(".UFICommentContentBlock:not(.postid)", {fireOnAttributesModification: true, existing: true}, function() { fillComment($(this)); });