Temporarily fix the draft functionality

edited February 2019 in Off-topic

Add this script to violentmonkey to stop 'Type your comment/message' becoming a draft.

// ==UserScript==
// @name HTB-placeholder
// @namespace Violentmonkey Scripts
// @match https://forum.hackthebox.eu/*
// @grant none
// ==/UserScript==

// for mobile: add to UserScript
// @require https://code.jquery.com/jquery-3.2.1.min.js

$(document).ready(function(){
    var $this = $('#Form_Body');
    var type = ['Type your comment', 'Type your message'];
    if(type.indexOf($this.val()) == 0){
        $this.val('');
    }
    $this.focusout(function(){
        setTimeout(function(){
            if(type.indexOf($this.val()) == 0){
                $this.val('');
            }
        });
    });
});
Tagged:

Comments

Sign In to comment.