MyShows: sort serials

Sort serials in alphabetic order on myshows.ru

Versione datata 15/06/2014. Vedi la nuova versione l'ultima versione.

// ==UserScript==
// @name        MyShows: sort serials
// @namespace   https://github.com/powerman/userjs-myshows
// @description Sort serials in alphabetic order on myshows.ru
// @include     http://myshows.ru/profile/
// @match       http://myshows.ru/profile/
// @version     2.3
// @grant       none
// ==/UserScript==

window.addEventListener('load', function(){
	'use strict';

	function sort_shows(){
		// sort lists at left panel
		$('div.lside ul').html(function(){
			return $(this).children().sort(function(a,b){
				return $(a).text() < $(b).text() ? -1 : 1;
			});
		});
		// sort main content
		$('div.bserial').html(function(){
			return $(this).children('h4').map(function(){
				return $(this).nextUntil('h4').andSelf();
			}).sort(function(a,b){
				return a.first().text() < b.first().text() ? -1 : 1;
			}).map(function(){
				return this.get();
			});
		});
	}
	sort_shows();

	$('.watch-episode').live('click', function(){
		$('#content-inner').one('DOMNodeInserted', sort_shows);
	});
}, false);
长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

注册一下就行

Rainyun

一年攒够 12 元