cmlx
火狐狸
火狐狸
  • UID37515
  • 注册日期2011-10-06
  • 最后登录2017-09-30
  • 发帖数127
  • 经验101枚
  • 威望0点
  • 贡献值46点
  • 好评度4点
  • 社区居民
  • 忠实会员
阅读:1240回复:2

Feedly的彩色条目失效了,盼修正

楼主#
更多 发布于:2015-11-02 21:32
之前用的天涯倦客的,很不错,今天不知何故失效了,只能随便找了个先顶着,盼修正呀



// ==UserScript==
// @id             feedlycolorfullistviewbytyjk
// @name           Feedly Colorful Listview by TYJK
// @version        1.5
// @author         http://t.qq.com/HeartBlade
// @homepage       http://userscripts.org/scripts/show/174689
// @updateURL      https://userscripts.org/scripts/source/174689.meta.js
// @description    Feedly彩色条目,并修改查看原文按钮为新标签页打开。
// @include        http*://*feedly.com/*
// @grant          GM_addStyle
// @run-at         document-end
// ==/UserScript==
(function() {
    var colors = {};
    function $x(query, context) {
        return document.evaluate(query, (context || document), null, 
        XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
    }
    function computeColor(title) {
        var h ="";
        for each (var c in title) {
            h += c.charCodeAt(0);
        }
        h = h % 360;
        colors[title] = h;
        return h;
    }
    function colorFun() {
        try {
            var uncolored = $x('//div[@class="u0Entry "][not(@colored)]', timeline);
            if (uncolored == null) return;
            var titleA = $x("//div[@class='u0Entry '][not(@colored)]//span[@class='sourceTitle']/a", uncolored)
            titleA.setAttribute("style", "color: black;");
            var title=$x("//div[@class='u0Entry '][not(@colored)]//span[@class='sourceTitle']//a", uncolored).attributes["data-uri"].value.split("subscription/feed/")[1];
            uncolored.setAttribute("colored", title);
            if (colors[title] == undefined) {
                var color = computeColor(title);
                GM_addStyle(
                "div[colored='" + title + "'] {background: hsl(" + color + ",70%,80%)}" +
                "div[colored='" + title + "']:hover {background: hsl(" + color + ",90%,85%)}" 
                );
            }
            //链接新建标签页打开
            var linklist=document.querySelectorAll('.condensedTools>a[title="Open in a tab"]');
            for (var a in linklist){linklist[a].target="_blank";}
        }
        catch (e) { }
    }
    var timeline = document.getElementById("box");
    timeline.addEventListener("DOMNodeInserted",colorFun, false);
    document.addEventListener("DOMAttrModified", function () {
        var read=document.querySelectorAll('.title.read');
        for (var i=0;i<read.length;i++){
            read[i].parentNode.parentNode.parentNode.setAttribute("colored","");
        }
    }, false);
})();
文科
千年狐狸
千年狐狸
  • UID39959
  • 注册日期2013-10-17
  • 最后登录2019-07-27
  • 发帖数2069
  • 经验1328枚
  • 威望4点
  • 贡献值340点
  • 好评度256点
  • 最爱沙发
  • 社区居民
  • 忠实会员
1楼#
发布于:2015-11-02 21:58
 找作者反馈 @author         http://t.qq.com/HeartBlade
cmlx
火狐狸
火狐狸
  • UID37515
  • 注册日期2011-10-06
  • 最后登录2017-09-30
  • 发帖数127
  • 经验101枚
  • 威望0点
  • 贡献值46点
  • 好评度4点
  • 社区居民
  • 忠实会员
2楼#
发布于:2015-11-03 00:20
他现在都不用feedly,早就该用inoreader去了
游客

返回顶部