Click to install this script

IP Board: New Topic Confirm

  • Added: October 27, 2007
  • Last Updated: October 27, 2007

File Name: ipboard_newtopicconfirm.user.js

Click to hide sectionDescription

Television Without Pity has some fairly high standards for what is considered new-topic worthy. Frequently, I see new threads almost immediately locked (usually with a snarky comment) by mods. Unfortunately, the New Topic button is right next to Add Reply, and once I accidentally started a New Topic instead of doing an Add Reply. Since posts can't be deleted, it was mildly humiliating, This script adds a confirmation prompt "Are you sure you want to ..." to the New Topic button to prevent future embarrassments.

Screenshot of prompt added by script

Click to hide sectionScript Source

// IP.Board: New Topic Confirm // Copyright (c) 2006-2007 Orbona // Version 1.0 // Release Date: 2007-10-22 // // See also: http://www.orbona.com/greasemonkey/ // // Original file name: ipboard_newtopicconfirm.user.js // Please reference the original file name when contacting me regarding this // script. // // This software is licensed under the CC-GNU GPL: // http://creativecommons.org/license/cc-gpl // //--------------------------------------------------------------------------- // DESCRIPTION // // This script adds an "Are you sure" prompt to the "Add New Topic" button on // an Invision Power Board (IP.Board, see http://www.invisionpower.com). // Currently, I only use this script on the Television Without Pity forums // since they have strict rules about posting new topics. On the TWoP forums // I'm fairly certain I'll never want to create a new topic. The // confirmation alert helps to prevent new-topic accidents. // -------------------------------------------------------------------------- // ==UserScript== // @name IP.Board: New Topic Confirm // @description Adds a confirmation prompt to the Add New Topic buttons // @namespace http://www.orbona.com/greasemonkey/ // @include http://forums.televisionwithoutpity.com/index.php?show* // ==/UserScript== function confirmNewTopic(event) { var ans= confirm("Are you sure you want to start a new topic? Click OK to continue with your new topic, or Cancel to cancel this action (and avoid making a fool of yourself)."); if (!ans) { event.stopPropagation(); event.preventDefault(); } return (ans); } function doIt() { var links=document.evaluate("//A[contains(@href,'new_post')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < links.snapshotLength; i++) links.snapshotItem(i).addEventListener('click', confirmNewTopic, true); } window.addEventListener("load", function() { doIt(); }, false);