-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathApplying-Custom-Tags-to-Guides.user.js
34 lines (28 loc) · 1.21 KB
/
Applying-Custom-Tags-to-Guides.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// ==UserScript==
// @name Applying Custom Tags to Guides
// @icon https://store.steampowered.com/favicon.ico
// @namespace steam
// @version 1.1
// @description It allows you to apply custom tags to guides, as well as multiple language tags
// @author Lutymane
// @match *://steamcommunity.com/sharedfiles/editguide/*
// @grant none
// ==/UserScript==
var AddTagButton = '<div class="btn_blue_white_innerfade btn_small_thin" id="AddTag" style="margin:10px 0px 0px 0px;"><span>Add Tag</span></div>',
TagInput = '<div><input type="text" name="tags[]" value="" class="inputTagsFilter"></div>';
$J(document).ready(function () {
$J('input.inputTagsFilter[type=radio]').each(function () {
$J(this).attr('type', 'checkbox');
});
$J('#checkboxgroup_0 div').click(function () {
var tag = $J(this);
tag.find('input').attr('type', 'text');
tag.contents().filter(function () {
return this.nodeType === 3;
}).remove();
});
$J('#checkboxgroup_0').append(AddTagButton);
$J('#AddTag').click(function () {
$J('#checkboxgroup_0 div').eq($J('#checkboxgroup_0 div').index($J(this)) - 1).after(TagInput);
});
});