忘却那一抹 发表于 2013-5-15 11:55
其实我也知道LZ只是在寻找方法
只不过我希望LZ能从中学到东西,从而编写出软件,然后方便我们这些 ... - // ==UserScript==
- // [url=home.php?mod=space&uid=467097]@Name[/url] Good Tail
- // [url=home.php?mod=space&uid=321866]@author[/url] Yulei
- // @namespace Yuleigq@gmail.com
- // @description Very Good Tail.Hello!
- // [url=home.php?mod=space&uid=570682]@version[/url] 1.4
- // [url=home.php?mod=space&uid=713796]@include[/url] http://bbs.kafan.cn/thread*
- // @include http://bbs.kafan.cn/forum.php?mod=viewthread&tid=*
- // @include http://bbs.kafan.cn/forum.php?mod=post&action=reply&fid=*
- // @include http://bbs.kafan.cn/forum.php?mod=post&action=newthread&fid=*
- // @include http://bbs.kafan.cn/forum.php?mod=post&action=edit&fid=*&tid=*&pid=*&page=*
- // @copyright 2013+, Yulei
- // ==/UserScript==
- (function() {
- var node = document.createElement("div");
- node.setAttribute("onclick", "return window;");
- var unsafeWindow = node.onclick();
- if (unsafeWindow == window || typeof unsafeWindow == 'undefined') {
- window.onload = GTail();
- return;
- }
- //无法使用unsafeWindow时将代码附到页面里执行
- function GTail() {
- var script = document.createElement('script');
- var jsstring = go.toString() + "\ngo(true, window);";
- script.innerHTML = jsstring;
- document.body.appendChild(script);
- }
- function go(label, unsafeWindow) {
- var $ = unsafeWindow.$;
- var bar=document.querySelector('.bar'),e6=document.querySelector('#e_adv_6>p:nth-child(2)');
- var Psfm = $('postform'),Fps=$('fastpostform');
- var pos=Psfm || Fps;
-
- //插入尾巴
- function MUA(P) { //Custom 为自定尾巴信息,各喜好修改!
- var Custom='\r\r\r\r[list][/list][float=left][hr][color=Red]夏娜[/color],[color=Purple]疾风[/color],[color=Orange]菲特[/color],[color=Pink]奈叶[/color][/float]';
- P.value = unsafeWindow.parseurl(P.value) + Custom;
- }
- //截获提交
- function gform(pos) {
- var posn=pos.onsubmit;
- pos.onsubmit=function() {
- if ($('mUA').checked) MUA(pos.message);
- if ($('postsubmit')) return unsafeWindow.validate($('postform'));
- posn;
- }
- }
- gform(pos);
- //截获快捷键
- function mess(PS) {
- var fwin=$('fwin_reply');
- PS.onkeydown = function(e) {
- if (event.ctrlKey && event.keyCode == 13 || event.altKey && event.keyCode == 83) {
- if (Psfm) {
- if ($('mUA').checked) MUA(PS);
- unsafeWindow.ctlent(e ? e : event);
- } else if (fwin) {
- location.href="javascript:$('postsubmit').click()";
- } else {
- $('fastpostsubmit').click();
- }
- }
- }
- }
- //创建选项
- var Cbox='<input type="checkbox" id="mUA" style="border:1px solid #f6f; color:green; width:20px; height:20px;" title="加入签名(尾巴)" checked />';
- if (e6) {
- if (e6.innerHTML.indexOf("加入签名(尾巴)") < 0) e6.innerHTML += Cbox;
- mess(pos.message);
- } else if (bar) {
- if (bar.innerHTML.indexOf("加入签名(尾巴)") < 0) {
- if (document.querySelector('object#SWFUpload_0')) document.querySelector('.bar>.fpd').innerHTML += Cbox;
- else bar.innerHTML += Cbox;
- }
- mess(pos.message);
- }
- //劫持楼层回复
- var fre=document.querySelectorAll('.fastre');
- var len = fre.length;
- for (var i=0; fre[i]; i++) {
- fre[i].onclick = function() {
- unsafeWindow.showWindow('reply', this.href);
- setTimeout(function(){
- var pof=$('postform');
- document.querySelector('.bar').innerHTML +=Cbox;
- mess(pof.message);
- gform(pof);
- }, 1300);
- }
- }
- if (label) {
- setInterval(function(){
- fre=document.querySelectorAll('.fastre');
- if (fre.length == len) return;
- for (i=len; fre[i]; i++) {
- fre[i].onclick = function() {
- unsafeWindow.showWindow('reply', this.href);
- setTimeout(function(){
- var pof=$('postform');
- document.querySelector('.bar').innerHTML +=Cbox;
- mess(pof.message);
- gform(pof);
- }, 1000);
- }
- }
- },3000);
- }
- }
- go(false, unsafeWindow);
- })();
复制代码 你把我的签名内容改改,就是你想要的效果了。
夏娜,疾风,菲特,奈叶 |