IndieRoyale: Show only owned bundles and enable search by name

I have no idea how IR considers their library useful for their customers. -_- So, here is my attempt to fix it.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         IndieRoyale: Show only owned bundles and enable search by name
// @namespace    lainverse_indieroyale_show_only_owned_bundles
// @version      0.2
// @description  I have no idea how IR considers their library useful for their customers. -_- So, here is my attempt to fix it.
// @author       lainverse
// @match        http://www.indieroyale.com/collection
// @match        https://www.indieroyale.com/collection
// @grant        none
// ==/UserScript==

var bdy = document.querySelector('.deal');
if (!bdy) return; bdy = bdy.parentNode;

var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = ''+
    ' .body .deal {height:266px!important;margin:0!important;padding:10px 15px!important}'+
    ' .body .deal > a, .body .deal > div, .body .deal > div > a:first-child {height:266px!important}'+
    ' .body .deal > a, .body .deal > div > a:first-child {position:relative!important}'+
    ' .body .deal > div > a:first-child {display:block!important;height:100%!important}'+
    ' .body hr {height:12px;border:0;box-shadow:inset 0 12px 12px -12px rgba(0,0,0,0.5)}'+
    ' .body img {display:block;margin:auto;position:absolute;bottom:18px;left:0;right:0}'+
    ' .body span {display:block;width:100%;position:absolute;bottom:0}';
console.log(style);
bdy.insertBefore(style,bdy.querySelector(':first-child'));

bdy.appendChild(document.createElement('hr'));

[].forEach.call(document.querySelectorAll('.deal'),function(i){
    if(i.querySelector('.wantbundle')) bdy.appendChild(i);
    i.classList.remove('dealalt');
    i.querySelector('a').appendChild((function(i){
        var t = document.createElement('span');
        t.innerHTML = i.querySelector('img').getAttribute('alt');
        return t;
    })(i));
});