Skip to content

Instantly share code, notes, and snippets.

@korden32
Last active October 29, 2017 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save korden32/88ce0fc072f7c151daeb to your computer and use it in GitHub Desktop.
Save korden32/88ce0fc072f7c151daeb to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name SCUD FastReply
// @version 0.2.0
// @author KorDen
// @grant none
// @include *//steamcommunity.com/discussions/forum/*
// @include *//steamcommunity.com/groups/*/discussions*
// @include *//steamcommunity.com/app/*discussions*
// @include *//steamcommunity.com/app/*/tradingforum*
// @include *//steamcommunity.com/workshop/discussions/*
// @include *//steamcommunity.com/*/filedetails/discussion*
// ==/UserScript==
( function () {
var replies = [
'Quick answer...', '',
'Name1', 'Answer1',
'Name2', 'Answer2',
];
var html='<div>\
<select id="fastreply" class="gray_bevel subforum_select_control">';
for(var i=0; i < replies.length; i = i + 2)
html+="<option value='" + replies[i+1] + "'>" + replies[i] + "</option>";
html+='</select> <span class="btn_darkblue_white_innerfade btn_small" style="position:relative;top:-5px;" id=fReply><span>Добавить</span></span></div>';
$J('.forumtopic_reply_textarea[id*="commentthread"]').before(html);
$J('#fReply').click(addFastReply);
} )();
function addFastReply() {
var text = $J('.forumtopic_reply_textarea[id*="commentthread"]');
text.val(text.val() + $J('#fastreply option:selected').attr('value'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment