This repository was archived by the owner on Apr 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontentscript.js
More file actions
executable file
·68 lines (65 loc) · 3.71 KB
/
contentscript.js
File metadata and controls
executable file
·68 lines (65 loc) · 3.71 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* remove the login window. */
var flowWindow = document.getElementById("TB_overlay");
if (flowWindow != null)
{
flowWindow.parentNode.removeChild(flowWindow);
}
flowWindow = document.getElementById("TB_window");
if (flowWindow != null)
{
flowWindow.parentNode.removeChild(flowWindow);
}
if ( document.URL.search(/lianzai/i) == -1 )
{
/* Author Reader */
var scriptContent = " \n\
/* hacked by daemon & divinity (camelcc.com), 2011-12-18 */ \n\
function authorReader() { \n\
/* reader author only. */ \n\
V.lookByAuthor(V.author); \n\
\n\
/* get rid of vip url */ \n\
if (!!V.$('pageDivTop') && !!V.$('pageDivBottom')) { \n\
V.$('pageDivTop').innerHTML = V.pageContentLog; \n\
V.$('pageDivBottom').innerHTML = V.pageContentLog; \n\
} else if (!!V.$('cttPageDiv') && !!V.$('cttPageDiv1')) { \n\
V.$('pageForm').action = V.pageContentLog; \n\
V.$('pageForm1').action = V.pageContentLog; \n\
} else { \n\
try { \n\
V.$('FirstPageForm').action = V.pageContentLog; \n\
V.$('NextPageForm').action = V.pageContentLog; \n\
V.$('PreviousPageForm').action = V.pageContentLog; \n\
V.$('LastPageForm').action = V.pageContentLog; \n\
} catch (e) {} \n\
try { \n\
V.$('form_select').action = V.pageContentLog; \n\
V.$('form_select_ArticleTop').action = V.pageContentLog; \n\
V.$('form_select_ResponseTop').action = V.pageContentLog; \n\
} catch (e) {} \n\
} \n\
\n\
/* change the vip function */ \n\
var toolbar = document.getElementsByClassName('main-les')[0]; \n\
toolbar.innerHTML = toolbar.innerHTML.replace('只看楼主', '查看所有'); \n\
toolbar.innerHTML = toolbar.innerHTML.replace('authorReader', 'undoAuthorReader');\n\
} \n\
\n\
function undoAuthorReader() { \n\
/* undo look author only. */ \n\
V.lookByAuthorBack(V.author); \n\
\n\
/* change the vip function */ \n\
var toolbar = document.getElementsByClassName('main-les')[0]; \n\
toolbar.innerHTML = toolbar.innerHTML.replace('查看所有', '只看楼主'); \n\
toolbar.innerHTML = toolbar.innerHTML.replace('undoAuthorReader', 'authorReader');\n\
} \n\
";
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.innerHTML=scriptContent;
document.body.appendChild(newScript);
/* Toolbar initialize */
var authorReaderTool = document.getElementsByClassName("main-les")[0];
authorReaderTool.innerHTML = "<a href='javascript:void(0)' onclick='authorReader();'>只看楼主</a>";
}