-
Notifications
You must be signed in to change notification settings - Fork 1
/
dmhy.user.js
41 lines (37 loc) · 1.15 KB
/
dmhy.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// ==UserScript==
// @name Dmhy 動漫花園
// @version 0.2
// @match *://share.dmhy.org/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @grant none
// ==/UserScript==
// RSS
if (location.href.indexOf("/topics/list") != -1) {
$(".main .nav_title .fr a img[alt='rss']").parent("a").attr("href", location.href.replace("/topics/list","/topics/rss"));
}
// Search
$("#topic_list a").filter(function(){
if($(this).attr("href").match(/topics\/list\/(team_id|sort_id|user_id)\/(\d+)/))
return true;
else
return false;
}).each(function(){
var a = $(this),
id = a.attr("href").match(/topics\/list\/(team_id|sort_id|user_id)\/(\d+)/);
a.parent().append("(", $("<a/>").attr({
"href": "#",
"title": "加到搜尋"
}).html("*").click(function(){
var keyword = $("#keyword");
keyword.val(keyword.val() + " " + id[1] + ":" + id[2]);
return false;
}), ")");
});
$("#topic_list tr th:nth-child(2)").attr("width","6%");
// fixed load comment bug
(function() {
var id = location.href.match(/topics\/view\/(\d+)/);
if (id && id.length == 2) {
$('#recent-commnet').load('/comment/recent/topic_id/' + id[1]);
}
})()