-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Extended-Guide-Editing.user.js
39 lines (35 loc) · 1.53 KB
/
Extended-Guide-Editing.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
35
36
37
38
// ==UserScript==
// @name Extended Guide Editing
// @icon https://store.steampowered.com/favicon.ico
// @namespace steam
// @version 2.4
// @description Save guide subsections with empty titles and 'unlimited' body text length.
// @author Lutymane
// @match *steamcommunity.com/sharedfiles/editguidesubsection*
// @grant unsafeWindow
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
// ==/UserScript==
var location_href = location.href.replace(/#/g, ''),
itemid = location_href.split('?')[1].split('&')[0].split('=')[1],
sectionid = location_href.split("?")[1].split("&")[1].split("=")[1];
$('.btn_green_white_innerfade.btn_small_thin').attr('href', "javascript:ValidateEditExtended();");
$('#description').removeAttr('maxlength');
unsafeWindow.ValidateEditExtended = function () {
g_contentChanged = false;
$.post('//steamcommunity.com/sharedfiles/setguidesubsection', {
id: itemid,
sectionid: sectionid,
sessionid: g_sessionID,
title: title.value,
description: description.value
}).done(function (data) {
if (data.success == 1) {
$('.editGuideSubSectionContentsChangedWarningText').html("Subsection has been saved successfully!");
}
else {
$('.editGuideSubSectionContentsChangedWarningText').html("Unexpected error occured!");
}
}).fail(function () {
$('.editGuideSubSectionContentsChangedWarningText').html("Unexpected error occured!");
});
};