Last active
October 29, 2017 15:00
-
-
Save korden32/88ce0fc072f7c151daeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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