// ==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 // @downloadURL https://update.greasyfork.icu/scripts/17734/WhisperWindow%20%2AOLD%2A.user.js // @updateURL https://update.greasyfork.icu/scripts/17734/WhisperWindow%20%2AOLD%2A.meta.js // ==/UserScript== if (/^\/?games\/[^\/]+\/[^\/?]+(\?.*)?$/.test(window.location.pathname)) { setTimeout(function() { javascript:void((function(){window.location.assign("javascript:void($('gamepage_header').insert(''))");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(\'WhisperClose\');$("private_tab_pane").update(\'
\');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); }