WhisperWindow *OLD*

Lets you make a separate chat tab for whispers

当前为 2016-03-26 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            WhisperWindow *OLD*
// @namespace       skyboy@kongregate
// @author          skyboy
// @version         1.1.1
// @description     Lets you make a separate chat tab for whispers
// @include         http://www.kongregate.com/games/*/*
// @homepage        http://userscripts-mirror.org/scripts/show/73689
// ==/UserScript==
if (/^\/?games\/[^\/]+\/[^\/?]+(\?.*)?$/.test(window.location.pathname)) {
setTimeout(function() {
	javascript:void((function(){window.location.assign("javascript:void($('gamepage_header').insert('<style>#kong_game_ui ul.main_tabs li#private_tab.stacked a#private.active{background-position:-557px -48px}#kong_game_ui ul.main_tabs li#private_tab.stacked a#private, #kong_game_ui ul.main_tabs li#avatar_tab.stacked a#avatar{background-position:-557px -73px}#kong_game_ui ul.main_tabs li#private_tab a#private.active{background-position:-557px 0}#kong_game_ui ul.main_tabs li#private_tab a#private{background-position:-557px -25px;width:62px}</style>'))");setTimeout(function(){window.location.assign("javascript:void((function(){$('other_tab').insert({before:new Element('li',{'class':'tab closeable', id:'private_tab'}).hide()});$('alert_tab_pane').insert({before:new Element('div',{id:'private_tab_pane','class':'tabpane','style':'height:'+($('alert_tab_pane').style.height||'410px')+';'}).hide()})})())");setTimeout(function(){window.location.assign('javascript:void(document.observe("holodeck:ready",function(){$("private_tab").update(\'<a href="#private_tab_pane" id="private" class=""><span style="float: left">Whisper</span><span class="close_tab_link">Close</span></a>\');$("private_tab_pane").update(\'<div id="private_tab_pane_content"><div class="chat_message_window" style="height:\'+(holodeck._height-91||"401")+\'px"></div><div class="chat_controls"><textarea class="chat_input"></textarea></div><div class="guest_chat_controls" style="display:none;"><a href="#" onclick="holodeck.showSignupTab();return !1">Register</a> or <a href="#" onclick="active_user.activateInlineLogin();return !1">Sign in</a> to <strong>chat now</strong>, earn points, level up and track your progress!</div><div class="silenced_chat_controls" style="display:none;">You have been silenced for <span class="silence_duration"></span>.&nbsp; Click <a href="/pages/silenced" target="_blank">here</a> to read about silences.</div></div>\');var g=holodeck._tabs;g.addTab.bind(g,$("private")).defer();})())');setTimeout(function(){window.location.assign("javascript:void(document.observe('holodeck:ready',function(){var g=ChatWindow.prototype,j=g.insertInActiveChatInput,h=g.sendPrivateMessage,info={u:'nul'},d=$('private_tab_pane'),q=new ChatDialogue(d,0,holodeck,holodeck.chatWindow()); Object.extend(q,{_onInputFunction:function(a){var c=this,b=a.strip().match(/^\\/(?:w|msg)\\s+([a-zA-Z0-9_]+)\\s+([\\s\\S]+)/);if(b){a=b[2];info.u=b=b[1]}else b=info.u;if(/^\\/(?!w|msg)/.test(a)){if(!c._holodeck.processChatCommand(a))return}c._holodeck.filterOutgoingMessage(a.strip(),function(a){c.sendPrivateMessage(b,a)})},sendInput:function(){var a=this._input_node;this._onInputFunction(a.value);a.value=''},scrollToBottom:function(){var T=this._message_window_node;T.scrollTop=T.scrollHeight+20},sendPrivateMessage:function(u,m){this._holodeck.chatWindow().sendPrivateMessage(u,m);q.displayMessage(u,m,{'class':'whisper sent_whisper'},{'private':!0});}});g.sendPrivateMessage=function(u,m){if(u&&m)info.u=u,h.call(this,u,m)};holodeck.addChatCommand('pmwnd',(function(b,d){d=d.match(/^\\/pmwnd\\s*(.*)\\s*/i);this._holodeck._tabs.show('private_tab_pane');(b=this._input_node).focus();if(!b.value)b.value=d[1];return !1}).bind(q));holodeck.registerKonduitCallback(KonduitEvent.PRIVATE_MESSAGE,function(e){q.receivedPrivateMessage(e)});g.insertInActiveChatInput=function(t){if(d.style.display=='none')j.call(this,t);else q.setInput(t)}})())")},100)},100)},100)})());
}, 1250);
}