Blades Runner
Posts: 548
Joined: Monday, 23rd March 2015, 05:29
let us ignore, kick, or ban players in tileschat
- For this message the author yesno has received thanks:
- Arrhythmia
Although the central place for design discussion is ##crawl-dev on freenode, some may find it helpful to discuss requests and suggestions here first.
Blades Runner
Posts: 548
Joined: Monday, 23rd March 2015, 05:29
Dungeon Master
Posts: 1051
Joined: Thursday, 12th June 2014, 05:19
Blades Runner
Posts: 548
Joined: Monday, 23rd March 2015, 05:29
Dungeon Master
Posts: 585
Joined: Sunday, 9th June 2013, 17:13
Blades Runner
Posts: 548
Joined: Monday, 23rd March 2015, 05:29
Zot Zealot
Posts: 982
Joined: Monday, 29th September 2014, 09:04
Crypt Cleanser
Posts: 747
Joined: Friday, 6th January 2012, 12:30
chequers wrote:The quickest way to get this for yourself would be to write some client-side javascript bookmarklet which can take a username and reactively delete a user's messages as they come into your chat window.
// ==UserScript==
// @name webtiles_chat_ignore
// @namespace wew
// @include *
// @version 1
// @grant none
// ==/UserScript==
var ignored = ["users", "i", "dislike"];
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.target.id == 'chat_history') {
if (mutation.type == 'childList') {
if (mutation.addedNodes.length >= 1) {
var blockUser = false;
for (var i = 0; i < ignored.length; i++) {
if (mutation.addedNodes[0].textContent == ignored[i]) {
blockUser = true;
break;
}
}
if (blockUser) {
for (var i = 0; i < 4; i++) {
mutation.addedNodes[i].parentNode.removeChild(mutation.addedNodes[i]);
}
}
}
}
}
});
});
var observerConfig = {
childList: true, subtree: true
};
var targetNode = document.body;
observer.observe(targetNode, observerConfig);
Return to Game Design Discussion
Users browsing this forum: No registered users and 58 guests