Wykop tag slider (fix)

Slide your tags like a boss!

// ==UserScript==
// @name         Wykop tag slider (fix)
// @description  Slide your tags like a boss!
// @version      1.0.6
// @author       @incognito_man, opsomh
// @namespace    https://gf.qytechs.cn/en/users/30-opsomh
// @match        https://www.wykop.pl/*
// ==/UserScript==
/* jshint -W097 */
'use strict';

var $rightArrow = $('<div id="x-next-tag" style="position: fixed;bottom: -42%; right: 0; height: 100%; z-index: 1000; font-size: 150px;"><a href="#">〉</a></div>'),
    refreshUrl = $('.notification.m-tag .hashtag.ajax').data('ajaxurl') +'/hash/' + wykop.params.hash;

$.ajax({
    method: "GET",
    url: refreshUrl,
    complete: function(response) {
        var data = JSON.parse(response.responseText.substr(8));
        var html = data.operations[0].data.html;
        var lastUnreadEntry = $(html).find('li.type-light-warning a:last-child')[0];
        if(response.status == 200 && lastUnreadEntry !== undefined) {
            var entryUrl = $(lastUnreadEntry).attr('href');
            $rightArrow.find('a').attr('href', entryUrl);
            $(document.body).append($rightArrow);
            $(document).keydown(function (e) {
                if(e.keyCode == 39 && document.body == e.target) {
                    document.location = entryUrl;
                }
            });
        }
    }
});

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址