Click to install this script

Yuku: Add Reply Confirm

  • Added: September 06, 2009
  • Last Updated: September 06, 2009

File Name: yuku_addreplyconfirm.user.js

Click to hide sectionDescription

This script prompts you to hit "Quick Reply" instead of "Add Reply" button if you have entered text into the Quick Reply text area on a Yuku Board. This prompt helps to prevent accidental message loss in case the user has entered text into the Quick Reply text area and then mistakenly hits the Add Reply button -- which launches a new, full-featured reply window that does not retain the entered text -- instead of the Quick Reply button that will submit the response.

Screenshot of confirmation prompt added by script

Click to hide sectionScript Source

// Yuku: Add Reply Confirm // Copyright (c) 2009 Orbona // Version 1.0 // Release Date: 2009-09-07 // // See also: http://www.orbona.com/greasemonkey/ // // Original file name: yuku_addreplyconfirm.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 prompts the user to use the "Add Reply" button instead of the // "Quick Reply" button when text is entered into the "Quick Reply Text Area" // on a Yuku Board (see http://www.yuku.com). The confirmation alert helps to // prevent accidental message loss in case the user has entered text into the // "Quick Reply Text Area", and then mistakenly hit the Add Reply button -- which // launches a new, full-featured reply window that does not retain the entered // text-- instead of the "Quick Reply" button that will submit the response. // -------------------------------------------------------------------------- // ==UserScript== // @name Yuku: Add Reply Confirm // @namespace http://www.orbona.com/greasemonkey/ // @include http://*.yuku.com/forum/* // @include http://*.yuku.com/topic/* // ==/UserScript== function confirmAddReply(event) { var quickreply = document.getElementById('quick-reply'); if (quickreply) { var body = document.getElementById('body'); if (body && body.value) { /* var ans= confirm("Are you sure your want to start a new reply? Click OK to continue with your new reply and lose what you've already entered, or Cancel to cancel this action."); if (!ans) { event.stopPropagation(); event.preventDefault(); } return (ans); */ alert("Since you have already entered text into the reply box -- text that will 'get eaten' by Add Reply -- I think you should hit Quick Reply instead."); event.stopPropagation(); event.preventDefault(); } } return true; } function doIt() { var links=document.evaluate("//A[contains(@href,'topicreply')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < links.snapshotLength; i++) links.snapshotItem(i).addEventListener('click', confirmAddReply, true); } window.addEventListener("load", function() { doIt(); }, false);