Feedly Colorful Listview Mod

Feedly Colorful Listview Mod working with Chrome

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

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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           Feedly Colorful Listview Mod
// @id             FeedlyColorfulListviewMod
// @version        0.0.9.20161116
// @description    Feedly Colorful Listview Mod working with Chrome
// @namespace      https://greasyfork.org/pl/users/66016-marcindabrowski
// @match          *://*.feedly.com/*
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require        https://greasyfork.org/scripts/23268-waitforkeyelements/code/waitForKeyElements.js?version=147835
// @grant          GM_addStyle
// @run-at         document-end
// ==/UserScript==
var ColorfulListView = function () {
	this.initialize.apply(this, arguments);
};

ColorfulListView.prototype = {
	initialize:function () {
		this.colors = {};
	},
    makeColor:function (str) {
		var h = 0;
        for (var i = 0; i < str.length; i++) {
            h += str.charCodeAt(i);
        }
		return {"h":(h%36+1)*10, "s":30 + (h%5+1)*10};
	},
	color:function (item) {
		var itemid = item.id.replace(/^([^=]+).*$/, "$1");
		item.setAttribute("data-color", itemid);
		if (this.colors[itemid]!==undefined) return null;
		this.colors[itemid] = this.makeColor(itemid);
		GM_addStyle(
			"div[data-color='" + itemid + "'] {background:hsl(" + this.colors[itemid].h + "," + this.colors[itemid].s + "%,80%) !important;}"	+
            "div[data-color='" + itemid + "']:hover {background:hsl(" + this.colors[itemid].h + "," + this.colors[itemid].s + "%,70%) !important;}"
		);
	}
};
var colorfulListViewObj = new ColorfulListView();

waitForKeyElements (".entry", colorEntry);

function colorEntry (jNode) {
    colorfulListViewObj.color(jNode[0]);
}