Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
11,698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 134.98 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Steam Community Moderation - Hub Mod Version
  3. // @version 1.0
  4. // @include *//steamcommunity.com/app/*/*/*
  5. // @include *//steamcommunity.com/discussions/forum/*/*
  6. // @include *//steamcommunity.com/groups/*
  7. // @include *//steamcommunity.com/workshop/filedetails/discussion*
  8. // @include *//steamcommunity.com/*/discussions/*
  9. // @include *//steamcommunity.com/id/*
  10. // @include *//steamcommunity.com/profiles/*
  11. // @include *//steamcommunity.com/app/*/guides*
  12. // ==/UserScript==
  13. /* jshint -W097 */
  14. 'use strict';
  15.  
  16. var cooldownIndicators = /cooldown|7 day|unban|(vac|overwatch) ban|banned/i;
  17. var tradeIndicators = /((\[|\(|{)h(\]|\)|}))|((\[|\(|{)w(\]|\)|}))|(^|\s)h(\s.+\sw\s.+)|(^|\s)(h|w):\s|(^(go )?trade( me)?$)|((looking|want) (2|to) trade)|trade (my|with me)|((knife|knives|butterfly|karambit|gut|deagle|items|inv).+|worth|have|offer|offers at) (([0-9]+\s?(€|\$|£))|((€|\$|£)\s?[0-9]))|(([0-9]+\s?(€|\$|£))|((€|\$|£)\s?[0-9])) (inv|value|worth)|(I trade|tran?ding|tarding)|((ope?n( to)?|nice|look|whole|(up|down)grade) (inv(entory)?|trade))|(\(h\))|(send offers?)|(h:.+w:)|((want|looking for|send( me)?)( (good|fair))? offer)|(have.+want)|((sell|trade|have|check my|looking for).{0,10}(open|knife|knives|flip|gut|usp|butterfly|m4a4|karambit|bowie|inv|item|skin|sticker|deagle|awp))|(knife.*(for|4).*knife)|((let's|for|go|send|items|knife|inv(entory)?|fast).+trade)/i;
  18. var beggingIndicators = /donate|(gift|throw|please give) me|donations|(unneeded|free|give me) (skin|item|knife)|give[^?!.]+(for free|cheap skins)/i;
  19. var referralIndicators = /((free)|([0-9]+))\s[^0-9]{0,15}(points|coins|code|([0-9]+\s?(€|\$|£)))|(use|redeem).+(code|referral)|[^p]\?(r(ef)?|code|invite)=/i;
  20. var spamIndicators = /^(asd)|(qwert)|^[\[0-9\]\s-a,\.\+\*:<>\?!]+$/i;
  21. var rep4repIndicators = /(\+|-)?rep\s?(4|for)\s?(\+|-)?rep|(\+|-)?rep me|write (in|on) my (profile|wall)|напишите в моём профиле|(write|comment|say|give me) (\+|-)rep/i;
  22.  
  23. var warningOptions = '<option value="When using the Steam Discussions, please make sure you are being relevant, constructive and polite." data-pattern="' + encodeURIComponent(spamIndicators.toString().slice(1, spamIndicators.toString().lastIndexOf('/'))) + '" class="option_unconstructive">Unconstructive posting</option>' +
  24. '<option value="When using the Steam Discussions, please make sure you are being relevant, constructive and polite." data-pattern="' + encodeURIComponent(spamIndicators.toString().slice(1, spamIndicators.toString().lastIndexOf('/'))) + '" class="option_spamming">Spamming</option>' +
  25. '<option value="Please post trades in the appropriate trading subforum of the game\'s hub only." data-pattern="' + encodeURIComponent(tradeIndicators.toString().slice(1, tradeIndicators.toString().lastIndexOf('/'))) + '" class="option_trading">Trading outside the trading forum</option>' +
  26. '<option value="When participating in a discussion, please make sure all your posts are constructive and polite. Disruptive behavior (e.g. insulting or harassment) will not be tolerated." data-pattern="♥{3,}" class="option_disruptive">Disruptive behavior</option>' +
  27. '<option value="Posting referrals is a mix of spam and advertising and is therefore not allowed." data-pattern="' + encodeURIComponent(referralIndicators.toString().slice(1, referralIndicators.toString().lastIndexOf('/'))) + '" class="option_referrals">Posting referrals</option>' +
  28. '<option value="When creating a thread, please make sure to post in the correct (sub-)forum; some hubs offer subforums for specific purposes (e.g. recruiting players or trading) which should be used.\nAdditionally, all game-related threads should be posted within the game\'s hub only." data-pattern="((looking (4|for)|need).+(mate|player|crew|team))|(new|my|our|cool|game|join) (ip|server)" class="option_incorrect_subforum">Posting within an incorrect (sub-)forum</option>' +
  29. '<option value="The Steam Discussions are not for asking for free handouts." data-pattern="' + encodeURIComponent(beggingIndicators.toString().slice(1, beggingIndicators.toString().lastIndexOf('/'))) + '" class="option_begging">Begging / Asking for free handouts</option>' +
  30. '<option value="Please don\'t bypass any filters (i.e. word and/or URL filter,) they exist for a reason." data-pattern="(remove (space|dot))|([a-z0-9.:/] ){3,}" class="option_bypassing_filter">Bypassing filters</option>' +
  31. '<option value="Steam Discussions exist for conversation and not for showing off your latest video, website, workshop item, etc." data-pattern="((sub(scribe)?|watch|like|follow) (to|my|me))|twitch.tv\/|youtube.com\/channel\/" class="option_advertising">Advertising</option>' +
  32. '<option value="Per the Rules and Guidelines for Steam, raffles are strictly forbidden." class="option_raffling">Raffling</option>' +
  33. '<option value="Unconditional giveaways are usually overlooked if you delete the thread after the giveaway has ended. However, giveaways in which you ask people for something in return (e.g. likes, +rep, subscriptions, referral clicks etc.) are not allowed." data-pattern="(give|giving )away" class="option_conditional_giveaway">Conditional Giveaways</option>' +
  34. '<option value="All-caps posts are generally considered rude and make your posts hard to read. Therefore, to allow a friendly discussion and to receive quick help, please refrain from creating all-caps posts." class="option_caps">All-caps posts</option>' +
  35. '<option value="Naming and shaming other users is not allowed on the Steam forums; please make use of the [url=http://support.steampowered.com/kb_article.php?ref=1476-HJCM-5616]reporting tool[/url] instead." data-pattern="report (him|her|this|them)" class="option_name_shame">Naming and shaming</option>' +
  36. '<option value="Per the Steam Subscriber Agreement, selling/trading Steam accounts is strictly forbidden and may result in all involved accounts being permanently restricted.\n\nFor further information, please review section 1C of the [url=http://store.steampowered.com/subscriber_agreement/]Steam Subscriber Agreement[/url]." data-pattern="((selling|buying|trading|looking (4|for)) (a |my |this )?(Steam )?account)|Steam account trade" class="option_selling_accoung">Selling Steam accounts</option>' +
  37. '<option value="All trades offered on the Steam forums must be conducted via the Steam trading system only. Trades that include product keys, PayPal transactions or the like may therefore not be posted." data-pattern="PayPal|(gift|wallet) card" class="option_cash_trade">Cash / Key trades</option>' +
  38. '<option value="Per the Discussions Rules and Guidelines, any discussion of software piracy is strictly forbidden and may result in a ban from the Steam Community." data-pattern="pirate|piracy|crack|torrent|emulator" class="option_piracy">Discussion of software piracy</option>' +
  39. '<option value="Asking other users to comment on your profile has no relevance to the forum you were posting in, therefore, such comments are considered off-topic and may not be posted." data-pattern="' + encodeURIComponent(rep4repIndicators.toString().slice(1, rep4repIndicators.toString().lastIndexOf('/'))) + '" class="option_rep4rep">Reputation comment exchange</option>' +
  40. '<option value="Promoting, sharing, or advocating cheating is not allowed and results in a permanent ban." class="option_cheats">Promoting Cheats</option>' +
  41. '<option value="When submitting a thread, please ensure that you have included as many details as possible; doing so helps other users understand and identify your problem and results in more helpful and fast replies to your question. In addition to this, please also make sure to choose a descriptive title; vague titles such as \'I need help\' should not be used." class="option_vague">Vague discussion title / description</option>';
  42. var bulkCommentOptions = '<option value="Cooldowns and bans are non-negotiable and cannot be removed or reduced by Steam Support.\n\nIf an automated cooldown or ban is determined to have been issued incorrectly, it will automatically be rolled back by the servers.\n\nAs nobody on the forums is able to assist with an issue of this kind, any thread requesting the removal of a cooldown or ban will be locked.">CS:GO/Dota 2 – Cooldown/Ban</option>' +
  43. '<option value="All VAC bans are permanent - Valve has a zero-tolerance policy for cheating and will not lift VAC bans under any circumstances.\nRegardless of who was using your account at the time it was banned, the use and security of your Steam account is your responsibility.\n\nFurther information can be found here:[list][*][url=https://support.steampowered.com/kb_article.php?ref=7849-RADZ-6869]Valve Anti-Cheat-System (VAC)[/url][*][url=https://support.steampowered.com/kb_article.php?ref=4044-QDHJ-5691]I\'ve been banned[/url][*][url=http://steamcommunity.com/discussions/forum/9/882959527688934488/]Valve Anti-Cheat: Information Thread[/url][/list]">VAC Ban</option>';
  44.  
  45. (function() {
  46. //Start moderation message tools
  47. if (/^https?:\/\/steamcommunity\.com\/(?:profiles|id)\/.+\/moderatormessages\/[0-9]+\/?(\?tscn=[0-9]+)?$/i.test($J(location).attr('href'))) {
  48. $J('.emoticon_container').before('<a class="btn_grey_black btn_small_thin" id="post_template_response_btn">' +
  49. '<span>Template response</span>' +
  50. '</a>&emsp;');
  51. $J('#post_template_response_btn').on('click', function() {
  52. if ($J('#template_replies_select').length === 0) {
  53. $J(this).parent().append('<br><br>' +
  54. '<select id="template_replies_select" name="template_selection" size="3" style="width: 200px; display: none;">' +
  55. '<option value="If you have trouble understanding the rules, please take a look at the following guide: http://steamcommunity.com/sharedfiles/filedetails/?id=143962136">Rules Guide</option>' +
  56. '<option value="For information on how to dispute a forum ban, please take a look at this article: https://support.steampowered.com/kb_article.php?ref=7917-TYJV-9172">Dispute ban</option>' +
  57. '<option value="We have provided you with all necessary information; there will be no further correspondence regarding this matter.">Provided with all info</option>' +
  58. '<option value="Your post/thread was deleted and is therefore not longer visible to non-moderators, including yourself.">Post deleted hint</option>' +
  59. '</select>');
  60. $J('#template_replies_select').on('change', function() {
  61. $J.post($J(location).attr('protocol') + '//steamcommunity.com/comment/ModeratorMessage/post/' + $J('.commentthread_area').attr('id').split('_')[2] + '/' + $J('.commentthread_area').attr('id').split('_')[3], {
  62. 'comment': $J(this).find('option:selected').val(),
  63. 'sessionid': g_sessionID,
  64. 'count': '10'
  65. }).done(function(data) {
  66. $J('.commentthread_comment_container').empty().append(data.comments_html);
  67. });
  68. });
  69. }
  70. $J('#template_replies_select').slideToggle();
  71. });
  72. } //End moderation message tools
  73. // Start Guide UGC Tools
  74. else if (/^https?:\/\/steamcommunity\.com\/app\/[0-9]+\/guides\/?(?:(?:\?|#).+)?$/i.test($J(location).attr('href'))) {
  75. var appID = $J(location).attr('href').split('/app/')[1].split('/guides/')[0];
  76. var searchTermInputBox = '<span class="search_box"><input type="text" class="search_box_input" placeholder="Search term" style="margin-bottom: 0.25em;"><br></span>';
  77. var addCheckboxes = function(bShow = false) {
  78. $J('.workshopItemCollection').each(function() {
  79. if ($J(this).find('.ugc_moderation_checkbox').length === 0) {
  80. $J(this).prepend('<input type="checkbox" class="ugc_moderation_checkbox mod_panel_item" style="float: left; width: 20px; height: 20px; display: ' + (bShow ? 'block' : 'none') + ';">');
  81. }
  82. var url = $J(this).attr('href');
  83. $J(this).removeAttr('href');
  84. $J(this).on('click', function(e) {
  85. e.stopPropagation();
  86. if ($J(this).find('.ugc_moderation_checkbox').css('display') === 'none') {
  87. location.href = url;
  88. } else {
  89. $J(this).find('.ugc_moderation_checkbox').trigger('click');
  90. }
  91. });
  92. });
  93. };
  94. addCheckboxes();
  95. $J('div.panel:first').before('<span class="btn_darkblue_white_innerfade btn_small" id="show_mod_panel_btn"><span>Show Moderation Panel</span></span><br><br>' +
  96. '<div class="mod_panel_item" id="search_term_boxes_container" style="display: none; margin-bottom: 1em;">' +
  97. '<span class="btn_darkblue_white_innerfade btn_small" id="search_box_btn_remove"><span>- 1</span></span>&ensp;' +
  98. '<span class="btn_darkblue_white_innerfade btn_small" id="search_box_btn_add"><span>+ 1</span></span>&ensp;' +
  99. '<span class="btn_darkblue_white_innerfade btn_small" id="search_box_btn_find"><span>Find</span></span><br>' +
  100. searchTermInputBox +
  101. '<span class="2nd_level_search_box" id="2nd_level_filter_span" title="Optional Regular Expression.\nChecks the title of all guide results against the entered RegExp."><input type="text" id="2nd_level_filter" class="2nd_level_box_input" placeholder="Second level filter" style="margin-bottom: 0.25em;"><br></span>' +
  102. '</div>');
  103. $J('#search_box_btn_remove').on('click', function() {
  104. $J('#search_term_boxes_container').find('.search_box:last').remove();
  105. });
  106. $J('#search_box_btn_add').on('click', function() {
  107. $J('#2nd_level_filter_span').before($J(searchTermInputBox));
  108. });
  109. $J('#search_box_btn_find').on('click', function() {
  110. var $container = $J('.workshopItemCollectionContainer:first').parent();
  111. if (!$container.html()) {
  112. if ($J('#results_container').length === 0) {
  113. $J('.guides_home_section_title:last').after($J('<div id="results_container"></div>'));
  114. }
  115. $container = $J('#results_container');
  116. }
  117. var bSecondLevelRequired = $J('#2nd_level_filter').val().length > 0;
  118. $J('.workshopItemCollectionContainer').remove();
  119. $J('.search_box_input').each(function() {
  120. $J.get($J(location).attr('protocol') + '//steamcommunity.com/app/' + appID + '/guides/?searchText=' + encodeURIComponent($J(this).val()) + '&browsefilter=trend&browsesort=creationorder&requiredtags%5B%5D=-1', function(response) {
  121. if (bSecondLevelRequired) {
  122. var regex = new RegExp($J('#2nd_level_filter').val(), 'i');
  123. $J(response).find('.workshopItemCollectionContainer').each(function() {
  124. if (regex.test($J(this).find('.workshopItemTitle').text().trim())) {
  125. $container.append($J(this));
  126. }
  127. });
  128. } else {
  129. $container.append($J(response).find('.workshopItemCollectionContainer'));
  130. }
  131. }).done(function() {
  132. addCheckboxes(true);
  133. });
  134. });
  135. });
  136. $J('div.content:first').before('<div class="mod_panel_item" id="mod_panel_action_bar" align="center" style="padding: 10px; background-color: rgb(40, 40, 40); box-shadow: rgb(0, 0, 0) 5px 5px 8px; z-index: 1000; display: none; position: fixed;">' +
  137. '<span class="btn_darkblue_white_innerfade btn_small selection_status_btn" id="select_all_btn"><span>Select All</span></span>&emsp;' +
  138. '<span class="btn_darkblue_white_innerfade btn_small selection_status_btn" id="unselect_all_btn"><span>Unselect All</span></span>&emsp;' +
  139. '<span class="btn_darkblue_white_innerfade btn_small" id="ban_selected_btn"><span>Ban</span></span>&emsp;' +
  140. '<span class="btn_darkblue_white_innerfade btn_small" id="incompatible_selected_btn"><span>Incompatible</span></span>' +
  141. '</div>');
  142. $J('.selection_status_btn').on('click', function() {
  143. $J('.ugc_moderation_checkbox').prop('checked', $J(this).attr('id') === 'select_all_btn');
  144. });
  145. $J('#ban_selected_btn').on('click', function() {
  146. $J('.ugc_moderation_checkbox:checked').each(function(index, elem) {
  147. $J.post($J(location).attr('protocol') + '//steamcommunity.com/sharedfiles/ban', {
  148. 'id': $J(elem).closest('.workshopItemCollectionContainer').attr('id').split('_')[1],
  149. 'appid': appID,
  150. 'sessionid': g_sessionID,
  151. 'IsBanned': '1'
  152. }).done(function() {
  153. $J(elem).replaceWith('<span style="color: lime; float: left;">Banned!</span>');
  154. }).fail(function() {
  155. $J(elem).replaceWith('<span style="color: red; float: left;">Failed!</span>');
  156. });
  157. });
  158. });
  159. $J('#incompatible_selected_btn').on('click', function() {
  160. $J('.ugc_moderation_checkbox:checked').each(function(index, elem) {
  161. $J.post($J(location).attr('protocol') + '//steamcommunity.com/sharedfiles/updateincompatible', {
  162. 'id': $J(elem).closest('.workshopItemCollectionContainer').attr('id').split('_')[1],
  163. 'appid': appID,
  164. 'sessionid': g_sessionID,
  165. 'incompatible': '1'
  166. }).done(function() {
  167. $J(elem).replaceWith('<span style="color: lime; float: left;">Incompatible!</span>');
  168. }).fail(function() {
  169. $J(elem).replaceWith('<span style="color: red; float: left;">Failed!</span>');
  170. });
  171. });
  172. });
  173. $J('#show_mod_panel_btn').on('click', function() {
  174. $J('.mod_panel_item').toggle();
  175. });
  176. } //End Guide UGC tools
  177. //Start profile tools
  178. else if (/^https?:\/\/steamcommunity\.com\/(?:profiles|id)\/.+\/?$/i.test($J(location).attr('href'))) {
  179. $J('#profile_action_dropdown').find('.popup_menu_item:last').after('<hr><a class="popup_menu_item" href="' + $J(location).attr('href') + '/posthistory" style="color: red;">Post History</a>');
  180. $J('#profile_action_dropdown').find('.popup_menu_item:last').after('<a class="popup_menu_item" id="perm_link_btn" style="color: red;">Perm Link</a>');
  181. $J('#perm_link_btn').on('click', function() {
  182. ShowDialog('SteamID 64', '<input type="text" id="perm_link_container" style="width: 100%;" value="' + $J(location).attr('protocol') + '//steamcommunity.com/profiles/' + g_rgProfileData.steamid + '">' +
  183. '<br><br><div class="btn_grey_white_innerfade btn_medium" id="copy_perm_link_btn"><span>Copy to Clipboard</span></div>');
  184. $J('#copy_perm_link_btn').on('click', function() {
  185. $J('#perm_link_container').select();
  186. document.execCommand('copy');
  187. });
  188. });
  189. } //End profile tools
  190. //Start discussions overview tools
  191. else if (/^https?:\/\/steamcommunity\.com\/(?:discussions\/forum\/[0-9]{1,2}\/|app\/[0-9]{2,8}\/(?:discussions|tradingforum)\/(?:[0-9]{0,2}\/)?|workshop\/discussions(?:\/\?appid=[0-9]{1,8}|\/-?[0-9]+)?|groups\/[^\/]+\/discussions(?:\/[0-9]{0,2})?|sharedfiles\/filedetails\/discussions\/[0-9]+)\/?(?:(?:\?|&)fp=[0-9]*)?$/i.test($J(location).attr('href'))) {
  192. AddLocalReportsButton();
  193. var selectionStorage = [];
  194. $J('.manage_actions_buttons').append('<span class="btn_grey_white_innerfade btn_medium bulk_warn_btn">' +
  195. '<span>Ban</span>' +
  196. '</span>' +
  197. '<span class="btn_grey_white_innerfade btn_medium" id="deselect_btn">' +
  198. '<span>Deselect All</span>' +
  199. '</span>' +
  200. '<span class="btn_grey_white_innerfade btn_medium" id="save_selection_btn">' +
  201. '<span>Save Selection</span>' +
  202. '</span>');
  203. $J('.manage_actions_buttons ').after('&emsp;<span class="btn_grey_white_innerfade btn_medium" id="bulk_select_all_btn">' +
  204. '<span title="Selects all non-stickied threads.">Select All</span>' +
  205. '</span>');
  206. $J('#bulk_select_all_btn').on('click', function() {
  207. $J('.forum_topic:not(.sticky)').find('.forum_topic_checkbox_input:not(:checked)').trigger('click');
  208. });
  209. $J('#deselect_btn').on('click', function() {
  210. $J('.forum_topic_checkbox_input:checked').trigger('click');
  211. ColorThreads();
  212. HideThreads();
  213. });
  214. $J('#save_selection_btn').on('click', function() {
  215. if ($J('input[type="radio"][name="lockDelete"][value="none"]').length > 0) {
  216. $J('input[type="radio"][name="lockDelete"][value="none"]').prop('checked', true);
  217. } else {
  218. localStorage.setItem('bulk_warnings_additional_action', 'none');
  219. }
  220. if ($J(this).parent().css('opacity') === '1') {
  221. $J('.forum_topic_checkbox_input:checked').each(function() {
  222. if (selectionStorage.indexOf($J(this).parent().parent().attr('id')) === -1) {
  223. selectionStorage.push($J(this).parent().parent().attr('id'));
  224. }
  225. });
  226. if ($J('#bulk_select_saved_btn').length === 0) {
  227. $J('#bulk_select_all_btn').after('&emsp;<span class="btn_grey_white_innerfade btn_medium" id="bulk_select_saved_btn">' +
  228. '<span title="Selects all threads that were previously saved used the \'Save Selection\' button.">Select Saved</span>' +
  229. '</span>');
  230. $J('#bulk_select_saved_btn').on('click', function() {
  231. $J.each(selectionStorage, function(index, value) {
  232. $J('#' + value).find('.forum_topic_checkbox_input:not(:checked)').trigger('click');
  233. });
  234. });
  235. }
  236. }
  237. });
  238. $J('.bulk_warn_btn').on('click', function() {
  239. if ($J(this).parent().css('opacity') === '1') {
  240. $J(this).hide().after('<main role="main" id="warning_stuff">' +
  241. '<label><input type="radio" name="lockDelete" value="none">None</label>&nbsp;' +
  242. '<label><input type="radio" name="lockDelete" value="lock">Lock</label>&nbsp;' +
  243. '<label><input type="radio" name="lockDelete" value="delete">Delete</label>&nbsp;' +
  244. '<label title="When checked, a closing note will be posted instead of a warning."><input type="checkbox" name="leaveClosingNote">Comment</label><br>' +
  245. '<select id="topic_header" name="topic" class="warning_dropdown" size="5">' +
  246. warningOptions +
  247. '</select>' +
  248. '</form>' +
  249. '</main>');
  250. $J('input[type="radio"][name="lockDelete"][value="' + localStorage.getItem('bulk_warnings_additional_action') + '"]').prop('checked', true);
  251. $J('input[type="radio"][name="lockDelete"]').on('change', function() {
  252. if (!$J('input[type="checkbox"][name="leaveClosingNote"]').prop('checked')) {
  253. localStorage.setItem('bulk_warnings_additional_action', $J('input[type="radio"][name="lockDelete"]:checked').val());
  254. }
  255. });
  256. $J('input[type="checkbox"][name="leaveClosingNote"]').on('change', function() {
  257. if ($J(this).prop('checked') === true) {
  258. $J('#topic_header').empty().append(bulkCommentOptions + warningOptions);
  259. $J('input[type="radio"][name="lockDelete"][value="lock"]').prop('checked', true);
  260. } else {
  261. $J('#topic_header').empty().append(warningOptions);
  262. $J('input[type="radio"][name="lockDelete"][value="' + localStorage.getItem('bulk_warnings_additional_action') + '"]').prop('checked', true);
  263. }
  264. });
  265. $J('.warning_dropdown').on('change', function() {
  266. if ($J('input[type="checkbox"][name="leaveClosingNote"]:checked').length > 0) {
  267. IssueBulkComment($J('#topic_header').val());
  268. } else {
  269. IssueBulkWarning($J('.warning_dropdown option:selected').text().toLowerCase(), $J('#topic_header').val());
  270. }
  271. });
  272. }
  273. });
  274. $J('.bulk_actions_toggle_btn').on('click', function() {
  275. $J('#warning_stuff').remove();
  276. $J('.bulk_warn_btn').show();
  277. });
  278. $J('.rules').after('<div class="rightbox_footer"></div>' +
  279. '<div class="rightbox">' +
  280. '<div class="rightbox_content_header" id="display_settings_toggle">SCRIPT SETTINGS <span class="btn_details_arrow down"></span></div>' +
  281. '<div class="rule" style="display: none;"></div>' +
  282. '<div class="content" style="display: none;">' +
  283. '<label>' +
  284. '<input type="checkbox" name="hide_threads_deleted" ' + localStorage.getItem('hide_threads_deleted') + '>&nbsp;Hide Deleted Topics' +
  285. '</label><br>' +
  286. '<label>' +
  287. '<input type="checkbox" name="hide_threads_locked" ' + localStorage.getItem('hide_threads_locked') + '>&nbsp;Hide Locked Topics' +
  288. '</label><br>' +
  289. '<label>' +
  290. '<input type="checkbox" name="hide_threads_redirected" ' + localStorage.getItem('hide_threads_redirected') + '>&nbsp;Hide Topic Redirects' +
  291. '</label><br>' +
  292. '<label>' +
  293. '<input type="checkbox" name="hide_threads_pinned" ' + localStorage.getItem('hide_threads_pinned') + '>&nbsp;Hide Pinned Topics' +
  294. '</label>' +
  295. '<br>' +
  296. '<label>' +
  297. '<input type="checkbox" name="mark_threads" ' + localStorage.getItem('mark_threads') + '>&nbsp;Group&thinsp;/&thinsp;Color Topics' +
  298. '</label><br>' +
  299. '<label>' +
  300. '<input type="checkbox" name="sorted_warnings_deactivated" ' + localStorage.getItem('sorted_warnings_deactivated') + '>&nbsp;Deactivate Ban Option Sorting' +
  301. '</label><br>' +
  302. '<label>' +
  303. '<input type="number" name="thread_group_start" value="' + (localStorage.getItem('thread_group_start') || 1) + '" min="1" style="width: 40px;">&ensp;Thread Group Start' +
  304. '</label><br>' +
  305. '<label>' +
  306. '<input type="number" name="thread_group_end" value="' + (localStorage.getItem('thread_group_end') || 15) + '" min="1" style="width: 40px;">&ensp;Thread Group End' +
  307. '</label><br>' +
  308. '<label title="Age limit in days that a topic needs to exceed for a warning to be shown in the Generate Thread Group feature\'s review dialog.">' +
  309. '<input type="number" value="' + (localStorage.getItem('review_dialog_max_topic_age') || 7) + '" min="2" style="width: 40px;" onclick="localStorage.setItem(\'review_dialog_max_topic_age\', this.value);">&ensp;Topic Age Warning' +
  310. '</label>' +
  311. '</div>' +
  312. '</div>');
  313. $J('input[name="thread_group_start"], input[name="thread_group_end"]').on('change', function() {
  314. // WIP/NI
  315. var min = parseInt($J('input[name="thread_group_start"]').val());
  316. var max = parseInt($J('input[name="thread_group_end"]').val());
  317. if (min < max) {
  318. localStorage.setItem('thread_group_start', min);
  319. localStorage.setItem('thread_group_end', max);
  320. } else {
  321. $J('input[name="thread_group_start"]').val(min);
  322. $J('input[name="thread_group_end"]').val(min + 1);
  323. localStorage.setItem('thread_group_start', min);
  324. localStorage.setItem('thread_group_end', min + 1);
  325. }
  326. });
  327. $J('#display_settings_toggle').on('click', function() {
  328. if ($J(this).find('.btn_details_arrow').hasClass('down')) {
  329. $J(this).find('.btn_details_arrow').removeClass('down').addClass('up');
  330. } else {
  331. $J(this).find('.btn_details_arrow').removeClass('up').addClass('down');
  332. }
  333. $J(this).parent().find('.content').slideToggle(300);
  334. $J(this).parent().find('.rule').toggle(300);
  335. });
  336. HideThreads();
  337. $J('input[name^="hide_threads_"], input[name="mark_threads"], input[name="sorted_warnings_deactivated"]').on('change', function() {
  338. if ($J(this).is(':checked')) {
  339. localStorage.setItem($J(this).attr('name'), 'checked');
  340. } else {
  341. localStorage.setItem($J(this).attr('name'), '');
  342. }
  343. if ($J(this).attr('name') === 'mark_threads') {
  344. ColorThreads();
  345. } else if ($J(this).attr('name').startsWith('hide_threads_')) {
  346. HideThreads(undefined, 400);
  347. }
  348. });
  349. if (localStorage.getItem('mark_threads') === 'checked') {
  350. ColorThreads();
  351. }
  352. $J('.local_reports_link').parent().after('<div class="weblink">&nbsp;&emsp;<a id="generate_thread_group_btn">Generate Thread Group</a></div>');
  353. $J('#generate_thread_group_btn').on('click', function() {
  354. if (GetCookie('Steam_Language') !== 'english') {
  355. ShowDialog('Error – Unsupported Language Settings', 'You\'re currently using an unsupported language.<br>To use the Bulk Banning system with all its features and to avoid bugs, please switch to English.<br><br><a class="btnv6_blue_hoverfade btn_small_thin" onClick="ChangeLanguage(\'english\'); return false;"><span>Switch to English</span></a>');
  356. return;
  357. }
  358. if ($J('div[id$="_bulk_enable"').css('display') === 'none') {
  359. $J('div[id$="_bulk_disable"').trigger('click');
  360. }
  361. if ($J('.manage_actions_otherpage_clearlink').length > 0) {
  362. $J('.manage_actions_otherpage_clearlink').trigger('click');
  363. }
  364. $J('.forum_topic_checkbox_input:checked').prop('checked', false);
  365. $J(this).css('display', 'none').after('<span id="generate_thread_group_loading"><span>Group is being generated...</span>&nbsp;<img src="http://steamcommunity-a.akamaihd.net/public/images/login/throbber.gif" alt="Loading" style="width: 10%; heigth: 10%;"></span>');
  366. var cooldownThreads = [];
  367. var tradeThreads = [];
  368. var beggingThreads = [];
  369. var referralThreads = [];
  370. var capsThreads = [];
  371. var spamThreads = [];
  372. var rep4repThreads = [];
  373. var loopStart = parseInt(localStorage.getItem('thread_group_start')) || 1;
  374. var loopEnd = parseInt(localStorage.getItem('thread_group_end')) || 15;
  375. var numDone = 0;
  376. var requestURL = $J('.forum_paging_pagelink:first').attr('href') + ($J('.forum_paging_pagelink:first').attr('href').indexOf('?') === -1 ? '?fp=' : '&fp=');
  377. for (var pageID = loopStart; pageID <= loopEnd; pageID++) {
  378. $J.get(requestURL + pageID, function(topic) {
  379. $J(topic).find('.forum_topic').each(function() {
  380. if ($J(this).hasClass('locked') === false && $J(this).hasClass('deleted') === false && $J(this).hasClass('sticky') === false && $J(this).hasClass('moved') === false && parseInt($J(this).find('.forum_topic_reply_count').text().trim().replace(',', '')) < 250) {
  381. if (cooldownIndicators.test($J(this).find('.forum_topic_name').text().trim())) {
  382. cooldownThreads.push($J(this));
  383. } else if (referralIndicators.test($J(this).find('.forum_topic_name').text().trim())) {
  384. referralThreads.push($J(this));
  385. } else if (tradeIndicators.test($J(this).find('.forum_topic_name').text().trim())) {
  386. tradeThreads.push($J(this));
  387. } else if (beggingIndicators.test($J(this).find('.forum_topic_name').text().trim())) {
  388. beggingThreads.push($J(this));
  389. } else if (rep4repIndicators.test($J(this).find('.forum_topic_name').text().trim())) {
  390. rep4repThreads.push($J(this));
  391. } else if ($J(this).find('.forum_topic_name').text().trim().length < 3 || spamIndicators.test($J(this).find('.forum_topic_name').text())) {
  392. spamThreads.push($J(this));
  393. } else if ($J(this).find('.forum_topic_name').text() + $J($J.parseHTML($J(this).data('tooltip-content'))[1]).text() === $J(this).find('.forum_topic_name').text().toUpperCase() + $J($J.parseHTML($J(this).data('tooltip-content'))[1]).text().toUpperCase()) {
  394. capsThreads.push($J(this));
  395. }
  396. }
  397. });
  398. }).always(function() {
  399. if (++numDone === (loopEnd - loopStart + 1)) {
  400. $J('.forum_topics').empty();
  401. jQuery.each(tradeThreads, function(index, value) {
  402. $J('.forum_topics').append(value);
  403. });
  404. jQuery.each(beggingThreads, function(index, value) {
  405. $J('.forum_topics').append(value);
  406. });
  407. jQuery.each(referralThreads, function(index, value) {
  408. $J('.forum_topics').append(value);
  409. });
  410. jQuery.each(spamThreads, function(index, value) {
  411. $J('.forum_topics').append(value);
  412. });
  413. jQuery.each(rep4repThreads, function(index, value) {
  414. $J('.forum_topics').append(value);
  415. });
  416. jQuery.each(capsThreads, function(index, value) {
  417. $J('.forum_topics').append(value);
  418. });
  419. jQuery.each(cooldownThreads, function(index, value) {
  420. $J('.forum_topics').append(value);
  421. });
  422. ColorThreads();
  423. Forum_InitTooltips();
  424. $J('#generate_thread_group_loading').fadeOut(400, function() {
  425. $J('#generate_thread_group_btn').fadeToggle(400);
  426. });
  427. }
  428. });
  429. }
  430. });
  431. } //End discussions overview tools
  432. //Start discussions in-thread tools
  433. else if (/^https?:\/\/steamcommunity\.com\/(?:discussions\/forum\/[0-9]{1,2}|app\/[0-9]{2,8}\/(?:discussions|tradingforum)(?:\/[0-9]{0,2})?|greenlight\/discussions\/-1|workshop\/(?:filedetails\/)?discussions?\/-?[0-9]+|groups\/[^\/]+\/discussions(?:\/[0-9]{0,2})?|sharedfiles\/filedetails\/discussions\/[0-9]+)\/[0-9]{5,}\/?(?:\?appid=[0-9]*|(?:\?|&)(?:tscn|ctp)=[0-9]*)?(?:#(?:c-?|forum_op_)[0-9]+)?$/i.test($J(location).attr('href'))) {
  434. AddLocalReportsButton();
  435. SearchIncludeDeletedPosts(true);
  436. AddModeratorMessageInfoBtn(true);
  437. ReportStatusAndResolve();
  438. $J('.moderatorToolLink:first').before('<div class="manage_actions_ctn">' +
  439. '<div class="manage_actions_content">' +
  440. '<div class="btn_grey_black btn_details btn_medium bulk_actions_toggle_btn in_thread_toggle btn_state_tools_hidden">' +
  441. '<span>Bulk Tools <span class="btn_details_arrow down"></span></span>' +
  442. '</div>' +
  443. '<div class="btn_state_tools_shown" style="display: none;">' +
  444. '<div class="btn_grey_black btn_details btn_medium bulk_actions_toggle_btn in_thread_toggle btn_state_tools_shown" >' +
  445. '<span>Bulk Tools <span class="btn_details_arrow up"></span></span>' +
  446. '</div>' +
  447. '<br><br>' +
  448. '<div class="manage_actions_content">' +
  449. '<div>' +
  450. '<label><input type="checkbox" name="bulk_moderation_resolve_status"' + localStorage.getItem('bulk_moderation_resolve_status') + '>Resolve affected reports</label>' +
  451. '</div>' +
  452. '</div>' +
  453. '<br>' +
  454. '<span class="btn_grey_white_innerfade btn_medium bulk_delete_btn">' +
  455. '<span><img class="bulk_tools_icon" src="http://steamcommunity-a.akamaihd.net/public/images/skin_1/notification_icon_trash_bright.png">Delete</span>' +
  456. '</span>' +
  457. '&nbsp;&nbsp;&nbsp;<span class="btn_grey_white_innerfade btn_medium bulk_resolve_btn">' +
  458. '<span>Resolve</span>' +
  459. '</span>' +
  460. '</div>' +
  461. '</div>' +
  462. '</div>');
  463. $J('.in_thread_toggle').on('click', function() {
  464. if ($J(this).css('display') !== 'none' && $J(this).hasClass('btn_state_tools_hidden')) {
  465. $J('.btn_state_tools_shown').css('display', '');
  466. AddSelectionBoxes();
  467. } else {
  468. $J(this).parent().css('display', 'none');
  469. $J('.btn_state_tools_hidden').css('display', '');
  470. RemoveSelectionBoxes();
  471. }
  472. $J(this).css('display', 'none');
  473. });
  474. $J('.bulk_delete_btn').on('click', function() {
  475. if ($J('[name="bulk_moderation_resolve_status"]').is(':checked')) {
  476. $J('.bulk_resolve_btn').trigger('click');
  477. }
  478. var showConfirmation = false;
  479. var selectionCount = $J('.forum_topic_checkbox_input:checked').length;
  480. $J('.forum_topic_checkbox_input:checked').each(function() {
  481. var args = $J('.forum_paging_controls:first').attr('id');
  482. var arg1 = args.split('_')[2];
  483. var arg2 = args.split('_')[3];
  484. var gidcomment = $J(this).data('gidcomment');
  485. $J(this).remove();
  486. if ($J('.forum_topic_checkbox_input:checked').length === 0) {
  487. var showConfirmation = true;
  488. }
  489. $J.ajax({
  490. type: 'POST',
  491. url: $J(location).attr('protocol') + '//steamcommunity.com/comment/ForumTopic/delete/' + arg1 + '/' + arg2 + '/',
  492. data: {
  493. 'gidcomment': gidcomment,
  494. 'start': parseInt($J('[id$="_pagestart"]').text().replace(',', '') - 1),
  495. 'count': parseInt($J('[id$="_pageend"]').text().replace(',', '')) - parseInt($J('[id$="_pagestart"]').text().replace(',', '')) + 1,
  496. 'sessionid': g_sessionID,
  497. 'extended_data': GetTopicPermissionsString(),
  498. 'feature2': GetExtendedData().feature2,
  499. 'oldestfirst': true,
  500. 'include_raw': true
  501. }
  502. }).done(function(data) {
  503. $J('.commentthread_comments').empty().prepend(data.comments_html);
  504. if (showConfirmation) {
  505. ShowForumSuccessDialogWithDetailTitle('Bulk Moderation Tool', 'Posts deleted', selectionCount + ' posts have been deleted as part of the bulk action.');
  506. $J('.btn_state_tools_shown').css('display', 'none');
  507. $J('.btn_state_tools_hidden').css('display', '');
  508. }
  509. });
  510. });
  511. });
  512. $J('.bulk_resolve_btn').on('click', function() {
  513. var forumID = GetExtendedData().owner;
  514. $J('.forum_topic_checkbox_input:checked').each(function() {
  515. try {
  516. var gid_forumtopic = $J(this).parent().parent().parent().find('a[href*="reporteddiscussions/-1/"]').attr('href').split('-1/')[1].replace(/\//g, '').trim();
  517. if ($J('a[href*="reporteddiscussions/-1/' + gid_forumtopic + '"]').find('.resolved_report_notice').length === 0) {
  518. var requestURL = $J(location).attr('protocol') + '//steamcommunity.com/forum/' + forumID + '/ReportedPosts/moderatetopic/-1/';
  519. $J.post(requestURL, {
  520. 'action': 'setflag',
  521. 'flag': 'sticky',
  522. 'value': false,
  523. 'gidforumtopic': gid_forumtopic,
  524. 'sessionid': g_sessionID
  525. }).done(function() {
  526. MarkReportResolved($J('a[href*="reporteddiscussions/-1/' + gid_forumtopic + '"]'));
  527. });
  528. }
  529. } catch (e) {}
  530. });
  531. });
  532. $J('.commentthread_pagelink, .pagebtn').on('click', function() {
  533. $J('.btn_state_tools_shown').css('display', 'none');
  534. $J('.btn_state_tools_hidden').css('display', '');
  535. });
  536. $J('[name="bulk_moderation_resolve_status"]').on('click', function() {
  537. if ($J(this).is(':checked')) {
  538. localStorage.setItem('bulk_moderation_resolve_status', 'checked');
  539. } else {
  540. localStorage.setItem('bulk_moderation_resolve_status', '');
  541. }
  542. });
  543. if ($J('a.whiteLink[href^="javascript:Forum_ResolveReports("]').length > 0 && $J('img[src*="://steamcommunity-a.akamaihd.net/public/images/skin_1/forum_topicicon_deleted.png"]').length === 0) {
  544. $J('a.whiteLink[href^="javascript:Forum_DeleteTopic("]').after('&emsp;&nbsp;<a class="whiteLink delete_resolve" title="Deletes the thread and resolves all reports in it.">&amp; Resolve</a>');
  545. $J('a.whiteLink[href^="javascript:Forum_SetTopicFlag("]:first').after('&emsp;&emsp;<a class="whiteLink lock_resolve" title="Locks the thread and resolves all reports in it.">&amp; Resolve</a>');
  546. $J('.delete_resolve').on('click', function() {
  547. DoResolveAction().done(function() {
  548. $J(location).attr('href', $J('a.whiteLink[href^="javascript:Forum_DeleteTopic("]').attr('href'));
  549. }).fail(function() {
  550. ShowDialog('Error', 'Failed to resolve reports.');
  551. });
  552. });
  553. $J('.lock_resolve').on('click', function() {
  554. DoResolveAction().done(function() {
  555. $J(location).attr('href', $J('a[href^="javascript:Forum_SetTopicFlag("]').attr('href'));
  556. }).fail(function() {
  557. ShowDialog('Error', 'Failed to resolve reports.');
  558. });
  559. });
  560. } else {
  561. if ($J('.forum_topic_pinned_notice').length > 0) {
  562. $J('a.whiteLink[href^="javascript:Forum_PurgeTopic("]').parent().after('<div class="moderatorToolLink">' +
  563. '<a class="whiteLink" href="javascript:Forum_SetTopicFlag( \'' + $J('.forum_op:first').attr('id').split('_')[2] + '\', \'sticky\', false );" title="A &quot;pinned&quot; thread always appears at the top of the topic list, even if other topics have more recent replies.">' +
  564. '<img class="toolsIcon" src="http://steamcommunity-a.akamaihd.net/public/images/skin_1/notification_icon_pinned.png">Unpin Thread</a>' +
  565. '</div>');
  566. }
  567. }
  568. $J('.whiteLink[href^="javascript:Forum_ResolveReports("]').on('click', function() {
  569. $J('a[href*="/reporteddiscussions/-1/"]:not(.local_reports_link)').each(function() {
  570. MarkReportResolved($J(this));
  571. });
  572. });
  573. if ($J('a[href*="Forum_ResolveReports"]').length > 0) {
  574. $J('.moderatorToolLink:last').after('<div class="moderatorToolLink" id="report_hopper_toggle">' +
  575. '&emsp;&emsp;<a class="whiteLink" title="Allows you to hop from one to the next reported post in this thread.">Toggle Report Hopping</a>' +
  576. '</div>');
  577. $J('#report_hopper_toggle').on('click', function() {
  578. var reported_comments = [];
  579. var extendedData, hash;
  580. if ($J('.rightcol').find('#report_hopper_table').length === 0) {
  581. extendedData = JSON.parse(GetExtendedData().extended_data);
  582. var op;
  583. if (extendedData) {
  584. $J.each(extendedData.reported_posts, function() {
  585. reported_comments.push(JSON.stringify($J(this)[0].gidcomment).replace(/"/g, ''));
  586. });
  587. reported_comments.sort(function(a, b) {
  588. return a - b;
  589. });
  590. }
  591. $J('.rightcol').append('<table id="report_hopper_table" style="position: fixed; top: -5px; margin-top: 12em; margin-left: 22em; display: none;"><tr>' +
  592. '<td><div><span id="previous_report_btn" class="btn_darkblue_white_innerfade btn_small btn_uppercase" style="padding: 5px;">&#8592;</span></div></td>' +
  593. '<td><div><span class="btn_darkblue_white_innerfade btn_small btn_uppercase" style="padding: 5px;" id="rep_nav">Reports (0 / ' + reported_comments.length + ')</div></td>' +
  594. '<td><div><span id="next_report_btn" class="btn_darkblue_white_innerfade btn_small btn_uppercase" style="padding: 5px;">&#8594;</span></div></td></tr></table>');
  595. $J('#rep_nav').data('selected_report', 0);
  596. }
  597. $J('#report_hopper_table').slideToggle(400);
  598. $J('#previous_report_btn').on('click', function() {
  599. if ($J('#rep_nav').data('selected_report') > 1) {
  600. $J('#rep_nav').data('selected_report', $J('#rep_nav').data('selected_report') - 1);
  601. } else {
  602. $J('#rep_nav').data('selected_report', reported_comments.length);
  603. }
  604. hash = 'c' + reported_comments[$J('#rep_nav').data('selected_report') - 1];
  605. if (hash === 'c-1') {
  606. hash = $J('.forum_op[id^="forum_op_"]').attr('id');
  607. $J('.permlinked').removeClass('permlinked');
  608. }
  609. window.location.hash = hash;
  610. $J('#rep_nav').text('Reports (' + $J('#rep_nav').data('selected_report') + ' / ' + reported_comments.length + ')');
  611. });
  612. $J('#next_report_btn').on('click', function() {
  613. if ($J('#rep_nav').data('selected_report') !== reported_comments.length) {
  614. hash = 'c' + reported_comments[$J('#rep_nav').data('selected_report')].replace(/"/g, '');
  615. $J('#rep_nav').data('selected_report', $J('#rep_nav').data('selected_report') + 1);
  616. } else {
  617. hash = 'c' + reported_comments[0].replace(/"/g, '');
  618. $J('#rep_nav').data('selected_report', 1);
  619. }
  620. $J('#rep_nav').text('Reports (' + $J('#rep_nav').data('selected_report') + ' / ' + reported_comments.length + ')');
  621. if (hash === 'c-1') {
  622. hash = $J('.forum_op[id^="forum_op_"]').attr('id');
  623. $J('.permlinked').removeClass('permlinked');
  624. }
  625. window.location.hash = hash;
  626. });
  627. $J('#rep_nav').on('click', function() {
  628. if ($J('#rep_nav').data('selected_report') !== 0) {
  629. hash = 'c' + reported_comments[$J('#rep_nav').data('selected_report') - 1].replace(/"/g, '');
  630. if (hash === 'c-1') {
  631. hash = $J('.forum_op[id^="forum_op_"]').attr('id');
  632. $J('.permlinked').removeClass('permlinked');
  633. }
  634. window.location.hash = hash;
  635. }
  636. });
  637. });
  638. }
  639. if ($J('a[href$="\'locked\', false );"]').length === 0) {
  640. $J('.commentthread_entry_autosubscribe').prepend('<label style="margin-right: 1em;" title="Locks the thread once the reply has been posted."><input type="checkbox" id="lock_thread_onreply">&nbsp;Lock Thread</label>');
  641. $J('.commentthread_entry_submitlink').find('button[type="submit"]').on('click', function() {
  642. if ($J('#lock_thread_onreply').prop('checked')) {
  643. setTimeout(function() {
  644. $J(location).attr('href', $J('a[href^="javascript:Forum_SetTopicFlag("]').attr('href'));
  645. }, 500);
  646. }
  647. });
  648. }
  649. $J('.emoticon_container').before('<a class="btn_grey_black btn_small_thin" id="template_reply_btn"><span>Template Reply</span></a>&emsp;');
  650. $J('#template_reply_btn').on('click', function() {
  651. if ($J('#template_replies').length === 0) {
  652. $J(this).parent().append('<main role="main" id="template_replies" align="right" style="display: none;">' +
  653. '<br>' +
  654. '<select class="gray_bevel" style="width: 200px;">' +
  655. '<option name="template_language" value="english">English</option>' +
  656. '<option name="template_language" value="german">German</option>' +
  657. '<option name="template_language" value="russian">Russian</option>' +
  658. '<option name="template_language" value="spanish">Spanish</option>' +
  659. '<option name="template_language" value="french">French</option>' +
  660. '</select>' +
  661. '<br>' +
  662. '<select id="template_replies_select" name="template_selection" size="6" style="width: 200px;">' +
  663. '<option value="banned_by_vac">Banned by VAC</option>' +
  664. '<option value="csgo_cooldown">CS:GO Cooldown</option>' +
  665. '<option value="dota_ban">Dota 2 Ban/Low Priority</option>' +
  666. '<option value="trade_market_restriction">Trade/Market Restrictions</option>' +
  667. '<option value="scammed">Scammed</option>' +
  668. '<option value="lost_account">Stolen Account</option>' +
  669. '<option value="limited_account">Limited Account</option>' +
  670. '<option value="contact_support">Contact Support</option>' +
  671. '<option value="refund_policy">Refund Policy</option>' +
  672. '<option value="mobile_authenticator">Steam Mobile Authenticator</option>' +
  673. '<option value="product_key_registration">Activating CD Keys</option>' +
  674. '<option value="more_info_required">Add more info</option>' +
  675. //'<option value="system_reqs">System Requirements</option>' +
  676. //'<option value=""></option>' +
  677. '</select>' +
  678. '</form>' +
  679. '</main>');
  680. $J('#template_replies_select').on('change', function() {
  681. var replies = {
  682. "banned_by_vac": {
  683. "english": "All VAC bans are permanent - Valve has a zero-tolerance policy for cheating and will not lift VAC bans under any circumstances.\nRegardless of who was using your account at the time it was banned, the use and security of your Steam account is your responsibility.\n\nFurther information can be found here: [list][*][url=https://support.steampowered.com/kb_article.php?ref=7849-RADZ-6869]Valve Anti-Cheat-System (VAC)[/url][*][url=https://support.steampowered.com/kb_article.php?ref=4044-QDHJ-5691]I've been banned[/url][*][url=http://steamcommunity.com/discussions/forum/9/882959527688934488/]Valve Anti-Cheat: Information Thread[/url][/list]",
  684. "german": "Jeder VAC-Ausschluss ist permanent – Valve verfolgt eine Null-Toleranz-Strategie gegen Cheater und wird unter keinen Umständen einen VAC-Ausschluss wieder aufheben.\nEin VAC-Ausschluss kann auch dann nicht entfernt werden, wenn ein Dritter Ihren Account zum Zeitpunkt des Verstoßes verwendet hat.\n\nWeitere Informationen erhalten Sie hier: [list][*][url=https://support.steampowered.com/kb_article.php?ref=7849-RADZ-6869]Valve Anti-Cheat-System (VAC)[/url][*][url=https://support.steampowered.com/kb_article.php?ref=4044-QDHJ-5691]Ich wurde von VAC ausgeschlossen[/url][*][url=http://steamcommunity.com/discussions/forum/9/882959527688934488/]Valve Anti-Cheat: Information Thread (Englisch)[/url][/list]",
  685. "russian": "Все блокировки системой VAC выдаются навсегда - Valve не делает поблажек читерам и не снимет блокировку ни при каких обстоятельствах.\n\n[list][*][url=https://support.steampowered.com/kb_article.php?ref=7849-Radz-6869&l=russian]Античит Valve (VAC)[/url][*][url=https://support.steampowered.com/kb_article.php?ref=4044-QDHJ-5691&l=russian]Меня заблокировали[/url][/list]",
  686. "french": "Tous les bans VAC sont permanents. Valve applique une politique de tolérance zéro dans sa lutte contre la triche et ne retire pas les bans, quelle qu'en soit la raison.\nL'utilisation et la sécurité du compte Steam étant de la responsabilité de l'utilisateur, le ban VAC reste valide qu'importe l'utilisateur ayant utilisé le compte.\n\nPlus d'informations sont disponibles ici: [list][*][url=https://support.steampowered.com/kb_article.php?ref=7849-RADZ-6869&l=french]Système Valve Anti-Cheat (VAC).[/url][*][url=https://support.steampowered.com/kb_article.php?ref=4044-QDHJ-5691&l=french]J'ai été banni.[/url][*][url=http://steamcommunity.com/discussions/forum/9/882959527688934488/]Valve Anti-Cheat: Sujet d'information (anglais)[/url][*][url=http://steamcommunity.com/discussions/forum/25/622954023415099428/]Valve Anti-Cheat: Sujet d'information (français)[/url][/list]",
  687. "spanish": "Todos los bloqueos de VAC son permanentes - Valve tiene tolerancia cero con los tramposos y no retirará ningun bloqueo de VAC bajo ninguna circunstancia. \nIndependientemente de quien estuviera utilizando la cuenta en el momento que fué bloqueada. El uso y la seguridad de la cuenta son responsabilidad del usuario.\n\nPara más información puedes consultar los siguientes enlaces: [list][*][url=https://support.steampowered.com/kb_article.php?ref=7849-RADZ-6869&l=Spanish]Sistema Anti-Trampas de Valve (VAC)[/url][*][url=https://support.steampowered.com/kb_article.php?ref=4044-QDHJ-5691&l=Spanish]He sido bloqueado[/url][*][url=http://steamcommunity.com/discussions/forum/9/882959527688934488/]Hilo de información de Valve Anti-Cheat (Inglés)[/url][/list]"
  688. },
  689. "csgo_cooldown": {
  690. "english": "Counter-Strike: Global Offensive cooldowns and bans are non-negotiable and cannot be removed or reduced by Steam Support.\n\nIf an automated cooldown or ban is determined to have been issued incorrectly, it will automatically be rolled back by the servers.",
  691. "german": "Strafzeiten und Ausschlüsse in Counter-Strike: Global Offensive sind nicht verhandelbar und können nicht vom Steam-Supportteam entfernt werden.\n\nWird festgestellt, dass eine automatische Sperre unrechtmäßig ausgestellt wurde, wird diese von den Servern rückgängig gemacht.",
  692. "russian": "Блокировки в Counter-Strike: Global Offensive не подлежат обжалованию и не могут быть отменены службой поддержки Steam.\n\nЕсли выяснится, что система блокировки сработала неверно, то вы будете разблокированы нашими серверами автоматически.",
  693. "french": "Les bannissements et pénalités compétitives de Counter-Strike: Global Offensive sont non-négociables et de ce fait, ne peuvent être retirés ou réduits par le Support Steam.\n\nSi un ban Overwatch ou VAC a été administré par erreur, alors il sera automatiquement retiré.\n\nPlus d'informations sont disponibles sur [url=http://steamcommunity.com/discussions/forum/25/350542145710717135]ce sujet[/url].",
  694. "spanish": "Los bloqueos de Counter-Strike: Global Offensive no son negociables y no pueden ser apelados o acortados por el Soporte de Steam.\n\nSi se determinara que algún bloqueo se hubiera aplicado incorrectamente, será automáticamente anulado por el servidor."
  695. },
  696. "contact_support": {
  697. "english": "Unfortunately, we cannot help you with this issue on the forums, please [url=https://support.steampowered.com/kb_article.php?ref=1223-QROC-4460]contact Steam Support[/url] for assistance.\n\n[quote]\n[h1]Tips for submitting a Steam Support ticket: [/h1]\n\nFor the best and quickest results, ensure that you do the following when submitting a ticket.\n[list]\n[*]Always provide your Steam account's login name when submitting a Steam Support ticket\n[*]Ensure that you provide the name of the game(s) or addon(s) that you are having trouble with (if any)\n[*]Categorize your ticket correctly\n[*]If the issue is resolved and your ticket is still open, log in to your Steam Support account and [url=https://support.steampowered.com/kb_article.php?ref=9952-EIVN-1674]close your ticket[/url]\n[/list]\nFailure to provide all necessary information when submitting a ticket can only cause a longer delay before your issue is resolved.\n[/quote]",
  698. "german": "Im Forenbereich können wir bei diesem Problem leider nicht behilflich sein, bitte [url=https://support.steampowered.com/kb_article.php?ref=1223-QROC-4460&l=german]wenden Sie sich an den Steam-Support[/url], um Unterstützung zu erhalten.\n\n[quote]\n[h1]Hinweise zum Erstellen eines Steam-Supporttickets: [/h1]\n\nFür die besten und schnellsten Resultate stellen Sie bitte sicher, dass Sie Folgendes beachten, wenn Sie ein Ticket erstellen.\n[list]\n[*]Geben Sie immer Ihren Steam-Accountnamen an, wenn Sie ein Steam-Supportticket erstellen.\n[*]Wenn Sie ein Problem mit einem Spiel oder Add-on haben, geben Sie bitte unbedingt dessen Namen an.\n[*]Ordnen Sie Ihr Ticket der Kategorie zu\n[*]Wenn das Problem behoben wurde und das Ticket noch offen ist, melden Sie sich mit Ihrem Steam-Account an und [url=https://support.steampowered.com/kb_article.php?ref=9952-EIVN-1674]schließen Sie Ihr Ticket[/url].\n[/list]\nNichtbeachten dieser Hinweise kann zu einer längeren Bearbeitungszeit Ihres Tickets führen.\n[/quote]",
  699. "russian": "[url=https://support.steampowered.com/kb_article.php?ref=1223-QROC-4460&l=russian]Связь с финансовым отделом и службой поддержки Steam[/url]",
  700. "french": null,
  701. "spanish": "Desafortunadamente en los foros no podemos ayudarte a resolver tu problema. Por favor [url=https://support.steampowered.com/kb_article.php?ref=1223-QROC-4460]contacta con el Soporte de Steam"
  702. },
  703. "scammed": {
  704. "english": "Please refer to the following article for detailed information on trade scams: [url=https://support.steampowered.com/kb_article.php?ref=3415-WAFH-6433]Trade Scam FAQ[/url]",
  705. "german": "Der folgende Supportartikel enthält detaillierte Informationen zu Handelsbetrug auf Steam: [url=https://support.steampowered.com/kb_article.php?ref=3415-WAFH-6433&l=german]Häufig gestellte Fragen zu Handelsbetrug[/url]",
  706. "russian": "[url=https://support.steampowered.com/kb_article.php?ref=3415-WAFH-6433&l=russian]ЧаВо о мошенничестве[/url]",
  707. "french": "Merci de se référer à la [url=https://support.steampowered.com/kb_article.php?ref=3415-WAFH-6433]FAQ des arnaques d'échanges[/url] pour tout savoir sur les vecteurs d'attaques d'arnaqueurs.\n\nA noter qu'il existe aussi un guide illustré [url=http://steamcommunity.com/sharedfiles/filedetails/?id=770153985]ici[/url] reprenant les informations de cette FAQ.",
  708. "spanish": "Por favor echa un vistazo al siguiente artículo con información detallada acerca de las estafas en el intercambio: [url=https://support.steampowered.com/kb_article.php?ref=3415-WAFH-6433&l=Spanish]FAQ sobre las estafas en el intercambio[/url]"
  709. },
  710. "lost_account": {
  711. "english": "Please take a look at the following article for instructions on how to recover a stolen or hijacked account: [url=https://support.steampowered.com/kb_article.php?ref=2347-QDFN-4366]Recovering a Stolen or Hijacked Steam Account[/url]",
  712. "german": "Der folgende Artikel enthält Informationen darüber, wie der Zugriff auf einen gestohlenen Steam-Account wiederhergestellt werden kann: [url=https://support.steampowered.com/kb_article.php?ref=2347-QDFN-4366&l=german]Einen gestohlenen Steam-Account wiederherstellen[/url]",
  713. "russian": "[url=https://support.steampowered.com/kb_article.php?ref=2347-QDFN-4366&l=russian]Восстановление украденного или взломанного аккаунта Steam[/url]",
  714. "french": "Pour récupérer un compte piraté ou volé, suis les instructions de cet article : [url=https://support.steampowered.com/kb_article.php?ref=2347-QDFN-4366&l=french]Récupérer un compte Steam volé ou piraté[/url] ",
  715. "spanish": "Por favor, echa un vistazo al siguiente artículo con instrucciones sobre como recuperar una cuenta robada o secuestrada: [url=https://support.steampowered.com/kb_article.php?ref=2347-QDFN-4366&l=Spanish]Recuperando una cuenta de Steam robada[/url]"
  716. },
  717. "trade_market_restriction": {
  718. "english": "There are a few different reasons why you may be unable to trade or use the Community Market. The reason is typically shown when you try to initiate a trade or perform an action on the Community Market.\n\nFor further information, please refer to the [url=https://support.steampowered.com/kb_article.php?ref=1047-EDFM-2932]Steam Support article on Trading and Market Restrictions[/url] or visit the [url=help.steampowered.com]help site[/url] for information on what causes the restriction.",
  719. "german": "Es gibt einige verschiedene Gründe, warum Sie möglicherweise nicht handeln oder den Communitymarkt benutzen können. Der Grund wird normalerweise angezeigt, wenn Sie versuchen, einen Handel zu initiieren oder eine Aktion auf dem Communitymarkt durchzuführen.\n\nFür weitere Informationen lesen Sie bitte den Steam-Supportartikel [url=https://support.steampowered.com/kb_article.php?ref=1047-EDFM-2932&l=german]Handels- und Markteinschränkungen[/url] oder besuchen Sie die [url=help.steampowered.com]Hilfeseite[/url], um den Auslöser der Einschränkung zu erfahren.",
  720. "russian": "Есть несколько причин, по которым у вас может отсутствовать возможность использовать Торговую площадкой или совершать обмены. Причина отображается при попытке начать обмен или совершить какое-либо действие на Торговой площадке.\n\n[url=https://support.steampowered.com/kb_article.php?ref=1047-EDFM-2932&l=russian]Ограничения на обмен и использование Торговой площадки[/url]",
  721. "french": "Il existe une pléthore de raisons pour laquelle le système d'échange ou le marché de la communauté est inaccessible. Habituellement, cette raison est affichée lorsqu'une vente ou un échange est initié, et ce uniquement pour la personne qui subit la restriction.\n\nPlus d'informations sont disponibles sur [url=https://support.steampowered.com/kb_article.php?ref=1047-EDFM-2932]l'article dédié du Support Steam[/url] ou sur [url=help.steampowered.com]la plate-forme d'aide[/url].",
  722. "spanish": "Hay varios motivos por los que no puedes realizar intercambios o el Mercado de la Comunidad. Generalmente el motivo se te muestra cuando intentas iniciar un intercambio o realizar una operación en el Mercado de la Comunidad.\n\nPara más información puedes consultar el [url=https://support.steampowered.com/kb_article.php?ref=1047-EDFM-2932&l=Spanish]Artículo sobre Restricciones en el intercambio y en el Mercado de la Comunidad[/url] o visitar la [url=help.steampowered.com]Página de Ayuda[/url] para más información sobre la causa de la restricción"
  723. },
  724. "limited_account": {
  725. "english": "In order to protect users from spamming, phishing, and other abuse, Steam prevents some accounts from accessing certain community and social features.\n\nFor further information on limited accounts and on how to delimit your account, please refer to the following support article: [url=https://support.steampowered.com/kb_article.php?ref=3330-IAGK-7663]Limited User Accounts[/url]",
  726. "german": "Um Steam-Nutzer vor Spam, Phishing oder anderen Formen von Fehlverhalten zu schützen, verhindert Steam, dass einige Accounts bestimmte Communityfunktionen nutzen können. Für weitere Informationen über solche limitierten Accounts und darüber, wie die damit verbundenen Einschränkungen aufgehoben werden können, lesen Sie bitte den folgenden Artikel: [url=https://support.steampowered.com/kb_article.php?ref=3330-IAGK-7663&l=german]Eingeschränkte Accounts[/url]",
  727. "russian": "[url=https://support.steampowered.com/kb_article.php?ref=3330-IAGK-7663&l=russian]Аккаунты с ограниченными правами[/url]",
  728. "french": "En raison d'abus divers des fonctions communautaires ayant permis entre autres de spammer ou de hameçonner des comptes Steam établis, il a été décidé de limiter ces fonctions aux comptes n'ayant pas encore dépensé 5€.\n\nPour en savoir plus sur ces limitations et comment les retirer, lis cet article : [url=https://support.steampowered.com/kb_article.php?ref=3330-IAGK-7663]Comptes Steam limités[/url].",
  729. "spanish": "Hemos optado por limitar el acceso a estas características como una forma de proteger a nuestros usuarios de aquellos que abusan de Steam para fines tales como spam y phishing.\n\nPara más información sobre las cuentas limitadas y como acceder a todas las características puedes consultar el siguiente artículo: [url=https://support.steampowered.com/kb_article.php?ref=3330-IAGK-7663&l=Spanish]Cuentas de usuario limitadas[/url]"
  730. },
  731. "refund_policy": {
  732. "english": "You can request a refund or get other assistance with your Steam purchases at help.steampowered.com.\n\nFor more detailled information, please refer to [url=http://store.steampowered.com/steam_refunds/]Steam's Refund Policy[/url].",
  733. "german": "Um eine Rückerstattung zu beantragen oder weitere Hilfe zu einem Steam-Einkauf zu erhalten, folgen Sie bitte diesem Link: help.steampowered.com\n\nNähere Informationen bezüglich Rückerstattungen auf Steam können den [url=http://store.steampowered.com/steam_refunds/?l=german]Steam-Rückerstattungsrichtlinien[/url] entnommen werden.",
  734. "russian": "Вы можете запросить возврат средств и получить помощь по другим проблемам с покупками в Steam здесь: help.steampowered.com.",
  735. "french": "Il est possible de demander un remboursement, sous certaines conditions,ou une assistance technique avec un jeu donné en allant sur help.steampowered.com\n\nPlus d'informations sur les remboursements Steam et leurs conditions d'applications sont disponibles sur [url=http://store.steampowered.com/steam_refunds/]la page officielle Steam[/url].",
  736. "spanish": "Puedes solicitar un reembolso o obtener ayuda en help.steampowered.com.\n\nPara información detallada por favor dirigete a [url=http://store.steampowered.com/steam_refunds/]Política de reembolsos de Steam[/url]."
  737. },
  738. "mobile_authenticator": {
  739. "english": "For help and information regarding the Steam Guard Mobile Authenticator, please refer to the [url=https://support.steampowered.com/kb_article.php?ref=8625-WRAH-9030]Steam Guard Mobile Authenticator FAQ[/url].\n\nIf you're having trouble logging in with the Steam mobile authenticator, please use the help site ([url=help.steampowered.com]help.steampowered.com[/url]) to recover your account.",
  740. "german": "Hilfestellungen und Informationen bezüglich des Steam Mobile-Authentifikators können Sie dem Steam-Supportartikel [url=https://support.steampowered.com/kb_article.php?ref=8625-WRAH-9030&l=german]Steam Mobile-Authentifikator[/url] entnehmen.\n\nFalls Sie Probleme dabei haben, sich mit dem Steam Mobile-Authentifikator anzumelden, besuchen Sie bitte die Hilfeseite ([url=help.steampowered.com]help.steampowered.com[/url]), um den Zugang zu Ihrem Account wiederherzustellen.",
  741. "russian": "De l'aide et des informations complètes sur l'authentificateur mobile Steam Guard sont disponibles dans l'article qui lui est dédié : [url=https://support.steampowered.com/kb_article.php?ref=8625-WRAH-9030]FAQ de l'authentificateur mobile Steam Guard[/url]\n\nEn cas de problème de connexion lié à cet authentificateur, il est possible de se rendre sur la plate-forme d'assistance technique ([url=help.steampowered.com]help.steampowered.com[/url]) et de suivre les instructions à l'écran.",
  742. "spanish": "Para ayuda e informacíon acerca del Autenticador Móvil de Steam, por favor dirígete al [url=https://support.steampowered.com/kb_article.php?ref=8625-WRAH-9030&l=spanish]FAQ del Autenticador Móvil de Steam[/url].\n\nSi tienes problemas iniciando sesión en el Autenticador Móvil de Steam, Por favor dirígete al sitio de ayuda ([url=help.steampowered.com]help.steampowered.com[/url]) para recuperar tu cuenta."
  743. },
  744. "system_reqs": {
  745. "english": " You can verify whether your computer fulfills the minimum system requirements by following these steps:\n[list]\n[*]Open the game's store page and extract the game's AppID from the store page URL. \n[list][*]Example: The URL of Team Fortress 2's store page is 'http://store.steampowered.com/app/440/', so the AppID would be 440.[/list]\n[*][b]Important: [/b] In the next step, make sure to replace the <AppID> part with the previously extracted AppID. For TF2, the result would be steam://checksysreqs/440.\n[olist]\n[*]For Windows, open the Run command by pressing the Windows Key + R and type steam://checksysreqs/<AppID> then press Enter. \n[*]For Mac, open the Network window by pressing Command + K and type steam://checksysreqs/<AppID> then press Enter.\n[/olist]\n[/list]",
  746. "german": null,
  747. "russian": null,
  748. "french": null,
  749. "spanish": null
  750. },
  751. "product_key_registration": {
  752. "english": "Please follow these instructions to activate a new retail purchase on Steam:\n[list]\n[*]Launch the Steam client software and log into your Steam account.\n[*]Click the Games Menu.\n[*]Choose Activate a Product on Steam...\n[*]Follow the onscreen instructions to complete the process.\n[/list]\nPlease see the [url=https://support.steampowered.com/kb_article.php?ref=7480-WUSF-3601]Retail CD Keys[/url] article for more info on registering keys.",
  753. "german": "Bitte folgen Sie diesen Anweisungen, um eine neue Einzelhandelskopie bei Steam zu aktivieren:\n[list]\n[*]Öffnen Sie den Steam-Client und melden Sie sich mit Ihrem Account an.\n[*]Klicken Sie in der obersten Leiste auf Spiele.\n[*]Wählen Sie Ein Produkt bei Steam aktivieren.\n[*]Folgen Sie nun den weiteren Anweisungen, um den Vorgang abzuschließen.\n[/list]\nBitte lesen Sie den Artikel [url=https://support.steampowered.com/kb_article.php?ref=7480-WUSF-3601&l=german]Registrierung von Einzelhandelsproduktschlüsseln[/url] für weitere Informationen über die Registrierung von Produktschlüsseln.",
  754. "russian": "Чтобы активировать ваш розничный цифровой ключ в Steam, пожалуйста, следуйте следующим инструкциям:\n[list]\n[*]Запустите Steam\n[*]Войдите в меню Игры.\n[*]Выберите пункт Активировать через Steam.\n[*]Следуйте инструкциям на экране, чтобы завершить активацию игры в Steam.\n[/list]\nПожалуйста, изучите статью [url=https://support.steampowered.com/kb_article.php?ref=7480-WUSF-3601&l=russian]Розничные цифровые ключи[/url] для просмотра игр, доступных для регистрации в Steam.",
  755. "french": null,
  756. "spanish": "Por favor, sigue estas instrucciones para activar la copia física de un juego en Steam:\n[list]\n[*]Ejecuta Steam e inicia sesión en tu cuenta.\n[*]Haz clic en el menú Juegos.\n[*]Elige Activar un producto en Steam...\n[*]Sigue las instrucciones que aparecerán en pantalla para completar el proceso.\n[/list]\nPor favor, consulta el artículo [url=https://support.steampowered.com/kb_article.php?ref=7480-WUSF-3601&l=spanish]Claves de producto de copias físicas[/url] para una lista de juegos disponibles para su activación en Steam."
  757. },
  758. "dota_ban": {
  759. "english": "All low priority matchmaking or communication bans will be automatically removed when they expire. There is no way to have a matchmaking ban removed early.\nSteam Support cannot modify or remove your ban, regardless of the circumstances under which the ban was issued.\nIf the system appears to be functioning incorrectly, submit a bug report to the [url=http://dev.dota2.com/]Dota 2 Development Forums[/url].",
  760. "german": "Es besteht keine Möglichkeit, die Sperre (vorzeitig) aufzuheben; auch nicht durch den Steam-Support.\nIm Falle eines Fehlers, werden Sperren automatisch durch die Server rückgängig gemacht, die Kontaktaufnahme mit dem Steam-Support ist hierfür nicht vonnöten.",
  761. "russian": "Низкий приоритет при подборе игр и ограничения на общение с другими игроками будут автоматически сняты через определенное время. Преждевременная отмена данных ограничений невозможна.\nПоддержка Steam не может изменить или убрать ограничение вне зависимости от обстоятельств, при которых оно было получено.\nЕсли вы считаете, что система работает некорректно, сообщите об ошибке на [url=http://dev.dota2.com/]форуме разработчиков Dota 2[/url].",
  762. "french": "Toutes les priorités basses du Matchmaking de Dota 2 ne seront retirées que lors de leur expiration. Il n'existe aucun moyen de réduire ce laps de temps.\n\nLe Support Steam ne peut pas accorder d'exception à cette règle, qu'importe les circonstances de la pénalité.",
  763. "spanish": "Todos los emparejamientos de baja prioridad o suspensiones de comunicación se eliminarán automáticamente cuando caduquen. No hay modo de eliminar una suspensión de emparejamiento antes.\nEl Soporte de Steam no puede modificar o eliminar tu suspensión, independientemente de las circunstancias en las que se haya producido.\nSi el sistema parece funcionar incorrectamente, envía un informe de fallos a [url=http://dev.dota2.com/]Dota 2 Development Forums[/url]."
  764. },
  765. "more_info_required": {
  766. "english": "When submitting a thread, please ensure that you have included as many details as possible; this helps other users understand and identify your problem and results in more helpful and fast replies to your question. In addition to this, please also make sure to choose a descriptive title; vague titles such as 'I need help' should not be chosen.",
  767. "german": "Vor dem Absenden eines Themas sollte sichergestellt werden, dass so viele Details wie möglich angegeben wurden, damit andere Nutzer das beschriebene Problem oder Thema leichter identifizieren und hilfreichere Antworten verfassen können. Außerdem sollten Thementitel immer eine kurze Beschreibung des Themas darstellen; von sehr allgemeinen und unpräzisen Titeln wie \"Ich brauche Hilfe\" ist daher abzusehen.",
  768. "russian": null,
  769. "french": null,
  770. "spanish": null
  771. }
  772. /*"": {
  773. "english": "",
  774. "german": "",
  775. "russian": "",
  776. "french": "",
  777. "spanish": ""
  778. ]*/
  779. };
  780. var selectedTemplate = $J('#template_replies_select').val();
  781. var selectedLanguage = $J('option[name="template_language"]:selected').val();
  782. var reply = replies[selectedTemplate][selectedLanguage];
  783. if (reply !== null) {
  784. PostForumReply(reply);
  785. } else {
  786. ShowConfirmDialog('Language Unavailable', 'There is no ' + $J('option[name="template_language"]:selected').text() + ' template available for the selected topic at this time. Do you want to post the English version instead?').done(function() {
  787. PostForumReply(replies[selectedTemplate].english);
  788. });
  789. }
  790. $J('#template_replies').remove();
  791. });
  792. }
  793. $J('#template_replies').slideToggle(400);
  794. });
  795. } //End discussions in-thread tools
  796. //Start Local Reports List Tools
  797. else if (/reporteddiscussions\/-1\/?(?:\?fp=[0-9]*)?$/i.test($J(location).attr('href'))) {
  798. $J('.rightbox_header:first').before('<div class="manage_actions_ctn">' +
  799. '<div class="manage_actions_content">' +
  800. '<div class="btn_grey_black btn_details btn_medium bulk_actions_toggle_btn" id="bulk_enable">' +
  801. '<span>Moderator Tools <span class="btn_details_arrow down"></span></span>' +
  802. '</div>' +
  803. '<div class="btn_grey_black btn_details btn_medium bulk_actions_toggle_btn" id="bulk_disable" style="display: none;">' +
  804. '<span>Moderator Tools <span class="btn_details_arrow up"></span></span>' +
  805. '</div>' +
  806. '</div>' +
  807. '<div id="bulk_content" style="display: none;">' +
  808. '<div class="manage_actions_rule"></div>' +
  809. '<div class="manage_actions_content" title="Selects all unresolved reports.">' +
  810. '<span class="btn_grey_white_innerfade btn_medium" id="select_all_btn">' +
  811. '<span>Select All</span>' +
  812. '</span>' +
  813. '&nbsp;&nbsp;&nbsp;' +
  814. '<span class="btn_grey_white_innerfade btn_medium" id="deselect_all_btn">' +
  815. '<span>Deselect All</span>' +
  816. '</span>' +
  817. '<br><br>' +
  818. '<span class="btn_grey_white_innerfade btn_medium" id="bulk_resolve_btn">' +
  819. '<span>Resolve</span>' +
  820. '</span>' +
  821. '&nbsp;&nbsp;&nbsp;' +
  822. '<span class="btn_grey_white_innerfade btn_medium" id="bulk_unresolve_btn">' +
  823. '<span>Unresolve</span>' +
  824. '</span>' +
  825. '</div>' +
  826. '</div>' +
  827. '</div>');
  828. $J('#bulk_enable').on('click', function() {
  829. $J('#bulk_enable, #bulk_disable, #bulk_content, .forum_topic_overlay').toggle();
  830. if ($J('.bulk_selection_checkbox').length > 0) {
  831. $J('.bulk_selection_checkbox').show();
  832. } else {
  833. $J('.forum_topic_overlay').each(function() {
  834. $J(this).before('<div class="forum_topic_checkbox"><input type="checkbox" class="forum_topic_checkbox_input bulk_selection_checkbox">&nbsp;</div>');
  835. });
  836. }
  837. });
  838. $J('#bulk_disable').on('click', function() {
  839. $J('.bulk_resolve_status_indicator').remove();
  840. $J('#bulk_enable, #bulk_disable, #bulk_content, .forum_topic_overlay, .bulk_selection_checkbox').toggle();
  841. });
  842. $J('#bulk_resolve_btn').on('click', function() {
  843. $J('.bulk_resolve_status_indicator').remove();
  844. $J('input.bulk_selection_checkbox[type="checkbox"]:checked').each(function(index, checkbox) {
  845. $J.post($J(location).attr('protocol') + '//steamcommunity.com/forum/' + $J('.forum_topic').attr('id').split('_')[2] + '/ReportedPosts/moderatetopic/-1/', {
  846. 'action': 'setflag',
  847. 'flag': 'sticky',
  848. 'value': 'false',
  849. 'gidforumtopic': $J(this).closest('.forum_topic').data('gidforumtopic'),
  850. 'sessionid': g_sessionID
  851. }).done(function() {
  852. $J(checkbox).after($J('<span class="bulk_resolve_status_indicator" style="color: lime;">Resolved</span>'));
  853. }).fail(function() {
  854. $J(checkbox).after($J('<span class="bulk_resolve_status_indicator" style="color: red;">Failed</span>'));
  855. });
  856. });
  857. });
  858. $J('#bulk_unresolve_btn').on('click', function() {
  859. $J('.bulk_resolve_status_indicator').remove();
  860. $J('input.bulk_selection_checkbox[type="checkbox"]:checked').each(function(index, checkbox) {
  861. $J.post($J(location).attr('protocol') + '//steamcommunity.com/forum/' + $J('.forum_topic').attr('id').split('_')[2] + '/ReportedPosts/moderatetopic/-1/', {
  862. 'action': 'setflag',
  863. 'flag': 'sticky',
  864. 'value': 'true',
  865. 'gidforumtopic': $J(this).closest('.forum_topic').data('gidforumtopic'),
  866. 'sessionid': g_sessionID
  867. }).done(function() {
  868. $J(checkbox).after($J('<span class="bulk_resolve_status_indicator" style="color: lime;">Unresolved</span>'));
  869. }).fail(function() {
  870. $J(checkbox).after($J('<span class="bulk_resolve_status_indicator" style="color: red;">Failed</span>'));
  871. });
  872. });
  873. });
  874. $J('#select_all_btn').on('click', function() {
  875. $J('.sticky').find('input.bulk_selection_checkbox[type="checkbox"]').prop('checked', true);
  876. });
  877. $J('#deselect_all_btn').on('click', function() {
  878. $J('input.bulk_selection_checkbox[type="checkbox"]').prop('checked', false);
  879. });
  880. $J('.forum_paging_pagelink, .pagebtn').on('click', function() {
  881. $J('#bulk_disable, #bulk_content, .bulk_selection_checkbox').hide();
  882. $J('#bulk_enable, .forum_topic_overlay').show();
  883. });
  884. } //End Local Reports List Tools
  885. })();
  886.  
  887. function IssueBulkComment(commentText) {
  888. var iterations = $J('.forum_topic_checkbox_input:checked').length;
  889. $J('.forum_topic_checkbox_input:checked').each(function() {
  890. var threadURL = $J(this).closest('.forum_topic').find('.forum_topic_overlay').attr('href');
  891. var extendedData;
  892. var feature2;
  893. var args;
  894. var erroredThreads = [];
  895. $J.get(threadURL, function(threadPage) {
  896. $J(threadPage).find('script').each(function(index, value) {
  897. if ($J(this).html().indexOf('InitializeForumTopic(') > -1) {
  898. var extractedExtendedData = $J(this).html().split('InitializeForumTopic(')[1].split(', "http')[0];
  899. extendedData = JSON.parse(extractedExtendedData);
  900. return false;
  901. }
  902. });
  903. feature2 = $J(threadPage).find('.forum_op:first').attr('id').split('_')[2];
  904. args = $J(threadPage).find('.commentthread_comment_container:first').attr('id').split('_');
  905. $J.post($J(location).attr('protocol') + '//steamcommunity.com/comment/ForumTopic/post/' + args[2] + '/' + args[3] + '/', {
  906. 'comment': commentText,
  907. 'sessionid': g_sessionID,
  908. 'extended_data': '{"topic_permissions":' + JSON.stringify(extendedData.permissions) + '}',
  909. 'feature2': feature2,
  910. 'include_raw': 'true',
  911. 'count': '15',
  912. 'oldestfirst': 'true'
  913. })
  914. .done(function(data) {
  915. var objectKeys = Object.keys(data.comments_raw);
  916. var gidcomment = objectKeys[objectKeys.length - 1];
  917. $J.post($J(location).attr('protocol') + '//steamcommunity.com/comment/ForumTopic/delete/' + args[2] + '/' + args[3] + '/', {
  918. 'gidcomment': gidcomment,
  919. 'start': data.start,
  920. 'count': data.pagesize,
  921. 'sessionid': g_sessionID,
  922. 'extended_data': JSON.stringify(extendedData),
  923. 'feature2': feature2,
  924. 'oldestfirst': true,
  925. 'include_raw': true
  926. }).always(function() {
  927. $J.post($J(location).attr('protocol') + '//steamcommunity.com/comment/ForumTopic/delete/' + args[2] + '/' + args[3] + '/', {
  928. 'gidcomment': gidcomment,
  929. 'start': data.start,
  930. 'count': data.pagesize,
  931. 'sessionid': g_sessionID,
  932. 'extended_data': JSON.stringify(extendedData),
  933. 'feature2': feature2,
  934. 'oldestfirst': true,
  935. 'include_raw': true,
  936. 'undelete': '1'
  937. }).always(function() {
  938. iterations--;
  939. if (iterations === 0 && erroredThreads.length > 0) {
  940. var $errorContainer = $J('<div/>');
  941. $J.each(erroredThreads, function(index, value) {
  942. $errorContainer.append(value);
  943. });
  944. ShowDialog('Failed to Comment', $errorContainer);
  945. }
  946. });
  947. });
  948. }).fail(function() {
  949. erroredThreads.push($J('.forum_topic_overlay[href="' + threadURL + '"]').parent());
  950. iterations--;
  951. if (iterations === 0) {
  952. var $errorContainer = $J('<div/>');
  953. $J.each(erroredThreads, function(index, value) {
  954. $errorContainer.append(value);
  955. });
  956. ShowDialog('Failed to Comment', $errorContainer);
  957. }
  958. });
  959. });
  960. });
  961. if ($J('input[type="radio"][name="lockDelete"]:checked').val() === 'lock') {
  962. $J('span[id$="_bulk_lock"]').trigger('click');
  963. } else if ($J('input[type="radio"][name="lockDelete"]:checked').val() === 'delete') {
  964. $J('span[id$="_bulk_delete"]').trigger('click');
  965. }
  966. $J('#warning_stuff').remove();
  967. $J('.bulk_warn_btn').show();
  968. }
  969.  
  970. function IssueBulkWarning(reason, moderatorComment) {
  971. /*var hubName = $J('.apphub_AppName').length === 0 ? 'Steam' : $J('.apphub_AppName').text().trim();
  972. var forumIDParts = $J('.forum_area').attr('id').split('_');
  973. var forumID = forumIDParts[1] + '_' + forumIDParts[2] + (forumIDParts[3] !== 'area' ? ('_' + forumIDParts[3]) : '');
  974. var rgForumData = g_rgForums[forumID].m_rgForumData;
  975. var forumName = '"[url=' + rgForumData.forum_url + ']' + rgForumData.forum_display_name + '[/url]" subforum of the ' + hubName + ' hub';*/
  976. var warnedUsers = [];
  977. var errorsThrown = [];
  978. var dialogVisible = false;
  979. var $bulkActionReviewDialogContent;
  980. var btnID = 0;
  981. var DialogVisibleCheck = function() {
  982. if (!dialogVisible) {
  983. ShowBulkActionReviewDialog();
  984. dialogVisible = true;
  985. $bulkActionReviewDialogContent = $J('.newmodal_content:contains("The following user(s) already have at least one moderation message on records and therefore require your review:")');
  986. }
  987. };
  988. var LoadBanMessageInformation = function(modMsgURL, index, date, actorInfo, topicID) {
  989. $J.get(modMsgURL, function(banNotification) {
  990. if ($J(banNotification).find('.bb_blockquote').length > 0) {
  991. var tooltipText = actorInfo + '\nThis ban was issued by: ' + $J(banNotification).find('.forum_op_author').text().trim();
  992. var banLength = $J(banNotification).find('.content').text().indexOf('This is a permanent ban.') > -1 ? date + ' (permanent)' : date + ' until ' + $J(banNotification).find('.content').text().split('This ban will expire on ')[1].split('.')[0];
  993. $J('#pending_review_info_' + topicID + '_' + index).replaceWith('<li title="' + tooltipText + '"><i><a href="' + modMsgURL + '" target="_blank">' + banLength + '</a></i> &ndash; Ban Reason: "' + $J(banNotification).find('.bb_blockquote:last').text() + '"</li>');
  994. } else {
  995. if (errorsThrown.indexOf(modMsgURL) === -1) {
  996. errorsThrown.push(modMsgURL);
  997. LoadBanMessageInformation(modMsgURL, index, date, actorInfo, topicID);
  998. } else {
  999. $J('#pending_review_info_' + topicID + '_' + index).replaceWith('<li>&nbsp;<a href="' + modMsgURL + '" target="_blank" style="color: red;">Error: Failed to load ban reason. Click to open the moderation message.</a></li>');
  1000. }
  1001. }
  1002. });
  1003. };
  1004. var LoadModerationMessageOverview = function(overviewURL, topicID) {
  1005. $J.get(overviewURL, function(modMsgPage) {
  1006. if ($J(modMsgPage).find('.moderatormessage').length > 0) {
  1007. var index = -1;
  1008. $J(modMsgPage).find('.moderatormessage').each(function() {
  1009. index++;
  1010. var date = $J(this).find('.commentnotification_date').text();
  1011. var modMsgURL = $J(this).find('a[href*="/moderatormessages/"]').attr('href');
  1012. if ($J(this).find('.commentnotification_description').text().indexOf('Ban notification') > -1) {
  1013. LoadBanMessageInformation(modMsgURL, index, date, $J(this).find('.commentnotification_description').text().trim(), topicID);
  1014. } else {
  1015. $J('#pending_review_info_' + topicID + '_' + index).replaceWith('<li><i><a href="' + modMsgURL + '" target="_blank">' + date + '</a></i> &ndash; ' + $J(this).find('.commentnotification_title').text() + '</li>');
  1016. }
  1017. });
  1018. } else {
  1019. if (errorsThrown.indexOf(overviewURL) === -1) {
  1020. errorsThrown.push(overviewURL);
  1021. LoadModerationMessageOverview(overviewURL, topicID);
  1022. } else {
  1023. $J('span[id^="pending_review_info_' + topicID + '_"]').each(function() {
  1024. $J(this).replaceWith('<li>&nbsp;<a href="' + overviewURL + '" target="_blank" style="color: red;">Error: Failed to load moderation message information. Click to load message overview.</span></li>');
  1025. });
  1026. }
  1027. }
  1028. });
  1029. };
  1030. var IssueWarning = function(threadURL) {
  1031. $J.get(threadURL, function(topic) {
  1032. var $topic = $J(topic);
  1033. var topicID = $topic.find('.forum_op[id^="forum_op_"]').attr('id').split('_')[2]
  1034. if ($topic.find('.forum_op_author').length > 0) {
  1035. var userProfileLink = $J(topic).find('.forum_op_author').attr('href');
  1036. if (warnedUsers.indexOf(userProfileLink) > -1) {
  1037. return true;
  1038. }
  1039. warnedUsers.push(userProfileLink);
  1040. var topicName = $topic.find('.forum_op').find('.topic').text().trim();
  1041. var quote = $topic.find('.forum_op').find('.content').text();
  1042. $J.get(userProfileLink + '/moderatormessages', function(modMsgOverview) {
  1043. var numMsgs = $J(modMsgOverview).find('.moderatormessage').length;
  1044. var maxTopicAge = localStorage.getItem('review_dialog_max_topic_age') || 7; // If a topic is older than this, a warning will be shown to avoid warning for really old violations.
  1045. var topicDate = $topic.find('.forum_op').find('.date').text();
  1046. var topicAge;
  1047. if (topicDate.indexOf('@') > -1) {
  1048. topicDate = topicDate.split('@')[0];
  1049. if (!/[0-9]{4,4}/.test(topicDate)) {
  1050. topicDate += new Date().getFullYear();
  1051. }
  1052. topicAge = parseInt((new Date().getTime() - Date.parse(topicDate)) / 86400000); //Topic age in days.
  1053. }
  1054. if (numMsgs > 0 || (topicAge && topicAge > maxTopicAge)) {
  1055. DialogVisibleCheck();
  1056. var modMessageTitles = '';
  1057. if (numMsgs > 0) {
  1058. modMessageTitles = '<u>Moderation Messages on Records:</u> <ul>';
  1059. for (var i = 0, max = (numMsgs < 15 ? numMsgs : 15); i < max; i++) {
  1060. modMessageTitles += '<span id="pending_review_info_' + topicID + '_' + i + '"><li><img src="http://steamcommunity-a.akamaihd.net/public/images/login/throbber.gif" alt="Loading"></li></span>';
  1061. }
  1062. }
  1063. var topicAgeWarning = '';
  1064. if (topicAge > maxTopicAge) {
  1065. topicAgeWarning = '<div style="display: inline-block; background-color: #B33B32; color: black;">' +
  1066. '<p style="margin: 1em;">This topic is older than ' + maxTopicAge + ' days. It was created ' + topicAge + ' days ago.</p>' +
  1067. '</div>' +
  1068. '<br><br>';
  1069. }
  1070. var $reviewEntry = $J('<div class="bulk_warning_review_entry" style="border-width: 1px; border-style: solid; padding: 1em;">' +
  1071. topicAgeWarning +
  1072. '<a class="btnv6_blue_hoverfade btn_small_thin" href="' + threadURL + '" target="_blank">' +
  1073. '<span>Open Thread</span>' +
  1074. '</a>' +
  1075. '&ensp;' +
  1076. '<span class="btnv6_blue_hoverfade btn_small_thin" onClick="$J(this).closest(\'.bulk_warning_review_entry\').slideUp(400);">' +
  1077. '<span>Remove</span>' +
  1078. '</span>' +
  1079. '&ensp;' +
  1080. '<select class="ban_user_length_selection" title="Changing this bans the user for the selected length with the following as reason:\n&quot;' + moderatorComment + '&quot;">' +
  1081. '<option value="none" selected>Don\'t ban</option>' +
  1082. '<option value="1">1 Day</option>' +
  1083. '<option value="3">3 Days</option>' +
  1084. '<option value="7">7 Days</option>' +
  1085. '<option value="30">30 Days</option>' +
  1086. '<option value="90">90 Days</option>' +
  1087. '<option value="365">1 Year</option>' +
  1088. '<option value="0">Permanent</option>' +
  1089. '</select>' +
  1090. '<br><br>' +
  1091. '<div style="width: 80%;" class="mod_message_titles_container">' + modMessageTitles + '</ul></div><br>' +
  1092. '</div>');
  1093. $reviewEntry.find('.ban_user_length_selection').on('change', function() {
  1094. var $selectionMenu = $J(this);
  1095. if ($selectionMenu.val() !== 'none') {
  1096. $selectionMenu.prop('disabled', true);
  1097. var banArgs = $J(topic).find('.forum_op').find('.popup_menu_item[href*="Forum_BanUser("]').attr('href').split('Forum_BanUser(')[1].split(',');
  1098. var clanid = banArgs[0].trim();
  1099. var banLengthDescription = $selectionMenu.find('option:selected').text();
  1100. $J.post($J(location).attr('protocol') + '//steamcommunity.com/gid/' + clanid + '/banuser/?ajax=1', {
  1101. 'gidforum': banArgs[1].trim().replace(/'/g, ''),
  1102. 'gidtopic': banArgs[2].trim().replace(/'/g, ''),
  1103. 'gidcomment': banArgs[3].trim().replace(/'/g, ''),
  1104. 'target': banArgs[4].split(')')[0].trim(),
  1105. 'sessionid': g_sessionID,
  1106. 'ban_length': $selectionMenu.val(),
  1107. 'ban_reason': moderatorComment
  1108. }).done(function() {
  1109. $selectionMenu.replaceWith('<span style="color: lime;">Banned (' + banLengthDescription + ')</span>&nbsp;<span class="undo_ban_btn" style="color: red; font-size: 75%;">(x)</span>');
  1110. $reviewEntry.find('.undo_ban_btn').on('click', function() {
  1111. var $btn = $J(this);
  1112. var forumBanManageURL = $J('a[href$="/forumBanManage"]').attr('href');
  1113. $J.post(forumBanManageURL, {
  1114. 'xml': '1',
  1115. 'action': 'unban',
  1116. 'steamId': $reviewEntry.find('.authorline').find('a.popup_menu_item[href^="javascript:IssueCommunityWarning("]').attr('href').split('\'')[1],
  1117. 'sessionID': g_sessionID
  1118. }).done(function() {
  1119. $btn.replaceWith('<span style="color: orange;">(UNBANNED)</span>');
  1120. ShowDialog('Unbanned', 'The user has been unbanned.<br/><br/><span style="color: red;">However, as this feature is still WIP, the corresponding moderation message has <strong>NOT</strong> been removed yet.</span>');
  1121. }).fail(function() {
  1122. $btn.replaceWith('<span style="color: red;">(FAILED)</span>');
  1123. });
  1124. });
  1125. }).fail(function() {
  1126. $selectionMenu.replaceWith('<span style="color: red;">Failed to ban.</span>');
  1127. });
  1128. }
  1129. });
  1130. $bulkActionReviewDialogContent.append($reviewEntry.append($topic.find('.forum_op')));
  1131. UpdateBulkActionReviewDialog(btnID, threadURL, $bulkActionReviewDialogContent);
  1132. btnID++;
  1133. LoadModerationMessageOverview(userProfileLink + '/moderatormessages', topicID);
  1134. } else {
  1135. var banArgs = $topic.find('.forum_op').find('.popup_menu_item[href*="Forum_BanUser("]').attr('href').split('Forum_BanUser(')[1].split(',');
  1136. var clanid = banArgs[0].trim();
  1137. $J.post($J(location).attr('protocol') + '//steamcommunity.com/gid/' + clanid + '/banuser/?ajax=1', {
  1138. 'gidforum': banArgs[1].trim().replace(/'/g, ''),
  1139. 'gidtopic': banArgs[2].trim().replace(/'/g, ''),
  1140. 'gidcomment': banArgs[3].trim().replace(/'/g, ''),
  1141. 'target': banArgs[4].split(')')[0].trim(),
  1142. 'sessionid': g_sessionID,
  1143. 'ban_length': 1,
  1144. 'ban_reason': moderatorComment
  1145. }).fail(function() {
  1146. DialogVisibleCheck();
  1147. $bulkActionReviewDialogContent.append(GenerateBulkWarningReviewFailBox(threadURL, 'An error occurred while trying to ban the user; maybe they\'re already banned? Click to open the associated thread in a new tab.'));
  1148. });
  1149. }
  1150. });
  1151. } else {
  1152. DialogVisibleCheck();
  1153. if (errorsThrown.indexOf(threadURL) === -1) {
  1154. errorsThrown.push(threadURL);
  1155. IssueWarning(threadURL);
  1156. } else {
  1157. $bulkActionReviewDialogContent.append(GenerateBulkWarningReviewFailBox(threadURL, 'Failed to load thread information. Click to open the thread in a new tab.'));
  1158. }
  1159. }
  1160. });
  1161. };
  1162. $J('.forum_topic_checkbox_input:checked').each(function() {
  1163. var threadURL = $J(this).closest('.forum_topic').find('.forum_topic_overlay').attr('href');
  1164. IssueWarning(threadURL);
  1165. });
  1166. if ($J('input[type="radio"][name="lockDelete"]:checked').val() === 'lock') {
  1167. $J('span[id$="_bulk_lock"]').trigger('click');
  1168. } else if ($J('input[type="radio"][name="lockDelete"]:checked').val() === 'delete') {
  1169. $J('span[id$="_bulk_delete"]').trigger('click');
  1170. }
  1171. $J('#warning_stuff').remove();
  1172. $J('.bulk_warn_btn').show();
  1173. }
  1174.  
  1175. function GenerateBulkWarningReviewFailBox(threadURL, errorMsg) {
  1176. var result = '<div class="bulk_warning_failed_entry" style="border-width: 1px; border-style: solid; border-color: red; padding: 1em;">' +
  1177. '<a class="btnv6_blue_hoverfade btn_small_thin" href="' + threadURL + '" target="_blank">' +
  1178. '<span>Open Thread</span>' +
  1179. '</a>' +
  1180. '&ensp;' +
  1181. '<span class="btnv6_blue_hoverfade btn_small_thin" onClick="$J(this).closest(\'.bulk_warning_failed_entry\').slideUp(400);">' +
  1182. '<span>Remove</span>' +
  1183. '</span>' +
  1184. '<br><br>' +
  1185. '<a href="' + threadURL + '" target="_blank" style="color: red;">Error: ' + errorMsg + '</a>' +
  1186. '</div>';
  1187. return result;
  1188. }
  1189.  
  1190. function ShowBulkActionReviewDialog() {
  1191. ShowDialog('For Review – User(s) with Existing Moderator Messages', $J('<p>The following user(s) already have at least one moderation message on records and therefore require your review:</p><br>'));
  1192. $J('.newmodal').css('top', '25px');
  1193. }
  1194.  
  1195. function UpdateBulkActionReviewDialog(btnID, threadURL, $bulkActionReviewDialogContent) {
  1196. $bulkActionReviewDialogContent.find('a').not('[href^="javascript:"]').not('.forum_comment_action').each(function() {
  1197. $J(this).attr('target', '_blank');
  1198. });
  1199. $bulkActionReviewDialogContent.find('.delete, .report, .reply, .edit_post').each(function() {
  1200. $J(this).hide();
  1201. });
  1202. }
  1203.  
  1204. function AddSelectionBoxes() {
  1205. $J('.commentthread_comment:not(.commentthread_deleted_expanded)').each(function() {
  1206. $J(this).find('.forum_comment_permlink').prepend('<div class="forum_topic_checkbox"><input type="checkbox" class="forum_topic_checkbox_input">&nbsp;</div>');
  1207. $J(this).find('.forum_topic_checkbox_input').data('gidcomment', $J(this).attr('id').split('_')[1]);
  1208. });
  1209. $J('.forum_topic_checkbox_input').css({
  1210. 'width': '20px',
  1211. 'height': '20px'
  1212. });
  1213. }
  1214.  
  1215. function RemoveSelectionBoxes() {
  1216. $J('.forum_topic_checkbox_input').each(function() {
  1217. $J(this).remove();
  1218. });
  1219. }
  1220.  
  1221. function DoResolveAction() {
  1222. var $deferred = $J.Deferred();
  1223. var actionURL_arg3 = '-1';
  1224. if ($J(location).attr('href').indexOf('/forum/') > -1) {
  1225. actionURL_arg3 = $J(location).attr('href').split('/forum/')[1].split('/')[0];
  1226. } else if ($J(location).attr('href').indexOf('/discussions/') > -1) {
  1227. actionURL_arg3 = $J(location).attr('href').split('/discussions/')[1].split('/')[0];
  1228. } else if ($J(location).attr('href').indexOf('/discussion/') > -1) {
  1229. actionURL_arg3 = $J(location).attr('href').split('/discussion/')[1].split('/')[0];
  1230. }
  1231. var forumType = 'General';
  1232. if ($J(location).attr('href').indexOf('/filedetails/') > -1) {
  1233. forumType = 'PublishedFile';
  1234. } else if ($J(location).attr('href').indexOf('/tradingforum/') > -1) {
  1235. forumType = 'Trading';
  1236. } else if ($J(location).attr('href').indexOf('/workshop/') > -1) {
  1237. forumType = 'Workshop';
  1238. }
  1239. var gidforumtopic = $J('div[id^="forum_op_"]').attr('id').split('_')[2];
  1240. var actionURL = $J(location).attr('protocol') + '//steamcommunity.com/forum/' + GetForumOwnerID() + '/' + forumType + '/moderatetopic/' + actionURL_arg3 + '/';
  1241. $J.post(actionURL, {
  1242. 'action': 'resolvereports',
  1243. 'gidforumtopic': gidforumtopic,
  1244. 'sessionid': g_sessionID
  1245. }).done(function() {
  1246. $deferred.resolve();
  1247. }).fail(function() {
  1248. $deferred.reject();
  1249. });
  1250. return $deferred.promise();
  1251. }
  1252.  
  1253. function AddLocalReportsButton() {
  1254. try {
  1255. var reportedContent, hubID, urlSplit, urlSplit2, hubLink;
  1256. var url = $J(location).attr('href');
  1257. if (url.indexOf('app/') > -1) {
  1258. urlSplit = url.split('app/');
  1259. urlSplit2 = urlSplit[1].split("/");
  1260. hubID = urlSplit2[0];
  1261. reportedContent = '<div class="weblink"><img class="admin_option_icon" src="http://steamcommunity-a.akamaihd.net/public/images/skin_1/iconGlobalReported.png">&nbsp;<a href="http://steamcommunity.com/app/' + hubID + '/reporteddiscussions/-1/" class="local_reports_link">Local Reported Posts</a></div>';
  1262. } else if (url.indexOf('forum/') > -1) {
  1263. reportedContent = '<div class="weblink"><img class="admin_option_icon" src="http://steamcommunity-a.akamaihd.net/public/images/skin_1/iconGlobalReported.png">&nbsp;<a href="http://steamcommunity.com/discussions/reporteddiscussions/-1/" class="local_reports_link">Local Reported Posts</a></div>';
  1264. } else if (url.indexOf('-1')) {
  1265. reportedContent = '<div class="weblink"><img class="admin_option_icon" src="http://steamcommunity-a.akamaihd.net/public/images/skin_1/iconGlobalReported.png">&nbsp;<a href="' + $J('a[href*="/reporteddiscussions/-1/"]').attr('href') + '" class="local_reports_link">Local Reported Posts</a></div>';
  1266. } else if (url.indexOf('workshop/') > -1) {
  1267. hubLink = $J('.apphub_sectionTabs').children('a').attr('href');
  1268. hubLink = hubLink.split('app/');
  1269. hubLink = hubLink[1].split('/');
  1270. hubID = hubLink[0];
  1271. reportedContent = '<div class="weblink"><img class="admin_option_icon" src="http://steamcommunity-a.akamaihd.net/public/images/skin_1/iconGlobalReported.png">&nbsp;<a href="http://steamcommunity.com/app/' + hubID + '/reporteddiscussions/-1/" class="local_reports_link">Local Reported Posts</a></div>';
  1272. }
  1273. $J('a[href*="forumBanManage"]').closest('.weblink').after(reportedContent);
  1274. } catch (e) {}
  1275. }
  1276.  
  1277. unsafeWindow.Forum_BanUser = function(clanid, gidForum, gidTopic, gidComment, accountIDTarget) {
  1278. var lastWarningNotice = 'Due to continued disruptive behavior on the discussion boards, permanent bans will now be considered for any further violations you incur. Please note, users who repeatedly disregard the rules risk having their Steam Community privileges revoked.';
  1279. var additionalBanLengthsOptions = '<option disabled="">--------------------</option><option value="90">90 days</option><option value="365">1 year</option>';
  1280. var banTemplateOption = '<br>' +
  1281. '<div class="forum_banuser_row">' +
  1282. '<div class="forum_banuser_label">Template Reason:</div>' +
  1283. '<div class="forum_banuser_data">' +
  1284. '<select name="ban_template" style="width: 240px; max-width: 100%;" class="gray_bevel">' +
  1285. '<option selected></option>' +
  1286. warningOptions +
  1287. '</select>' +
  1288. '</div>' +
  1289. '</div>';
  1290. var ConfirmBan = function($Form) {
  1291. if ($Form[0].elements.forum_banuser_lastwarning && $Form[0].elements.forum_banuser_lastwarning.checked) {
  1292. $Form[0].elements.ban_reason.value = $Form[0].elements.ban_reason.value + '\n\n' + lastWarningNotice;
  1293. }
  1294. var bDelete = $Form[0].elements.deletecomments && $Form[0].elements.deletecomments.checked;
  1295. var bKick = $Form[0].elements.kickmember && $Form[0].elements.kickmember.checked;
  1296. var bDeleteSource = $Form[0].elements.forum_banuser_delete_source ? $Form[0].elements.forum_banuser_delete_source.checked : false;
  1297. if ($Form[0].elements.ban_length.value < 0 && !bDelete && !bKick) {
  1298. ShowAlertDialog('Ban User', 'At least one option must be selected. The user has not been banned.');
  1299. } else {
  1300. $J.post($J(location).attr('protocol') + '//steamcommunity.com/gid/' + clanid + '/banuser/?ajax=1', $Form.serialize())
  1301. .done(function(data) {
  1302. if (bDeleteSource) {
  1303. if ($Form[0].elements.gidcomment.value === '-1') { // Topic OPs
  1304. Forum_DeleteTopic($Form[0].elements.gidtopic.value);
  1305. } else { // Topic replies, group comments
  1306. CCommentThread.DeleteComment($J('.commentthread_comments:first').attr('id').split('commentthread_')[1].split('_posts')[0], $Form[0].elements.gidcomment.value);
  1307. }
  1308. }
  1309. ShowAlertDialog('Success', data.message ? data.message : 'The user\'s posting and editing privileges have been revoked.');
  1310. }).fail(function() {
  1311. ShowAlertDialog('Error', 'You may not have permission to ban users. Please verify your account\'s permissions or try again later.');
  1312. });
  1313. }
  1314. };
  1315. var $WaitElem = $J('<div/>', {
  1316. 'class': 'forum_banuser_modal_wait'
  1317. }).append('<img src="http://steamcommunity-a.akamaihd.net/public/images/login/throbber.gif">');
  1318. var Modal = ShowConfirmDialog('Ban User', $WaitElem, 'Ban User');
  1319. Modal.GetContent().find('.newmodal_buttons').css('visibility', 'hidden');
  1320. Modal.GetContent().css('width', '600px');
  1321. $J.get($J(location).attr('protocol') + '//steamcommunity.com/gid/' + clanid + '/banuserdialog', {
  1322. ajax: 1,
  1323. gidforum: gidForum,
  1324. gidtopic: gidTopic,
  1325. gidcomment: gidComment,
  1326. target: accountIDTarget
  1327. }).done(function(data) {
  1328. var $Content = $J(data);
  1329. $WaitElem.replaceWith($Content);
  1330. }).fail(function() {
  1331. $WaitElem.replaceWith($J('<span>You may not have permission to ban users. Please verify your account\'s permissions or try again later.</span>' +
  1332. '<br><br><br>' +
  1333. '<h2 align="center" style="color: red;">Force Ban</h2>' +
  1334. '<form id="forum_banuser_form" onsubmit="Forum_OnBanUserSubmit(); return false;">' +
  1335. '<div class="forum_modal_text">' +
  1336. '<input type="hidden" name="gidforum" value="' + gidForum + '">' +
  1337. '<input type="hidden" name="gidtopic" value="' + gidTopic + '">' +
  1338. '<input type="hidden" name="gidcomment" value="' + gidComment + '">' +
  1339. '<input type="hidden" name="target" value="' + accountIDTarget + '">' +
  1340. '<input type="hidden" name="sessionid" value="' + g_sessionID + '">' +
  1341. '<div class="forum_banuser_row">' +
  1342. '<div class="forum_banuser_label">' +
  1343. 'Ban length:</div>' +
  1344. '<div class="forum_banuser_data">' +
  1345. '<select name="ban_length" style="width: 240px; max-width: 100%;" class="gray_bevel">' +
  1346. '<option value="0">Permanent</option>' +
  1347. '<option value="1">1 day</option>' +
  1348. '<option value="3">3 days</option>' +
  1349. '<option value="7">1 week</option>' +
  1350. '<option value="30">1 month</option>' +
  1351. '</select>' +
  1352. '</div>' +
  1353. '</div>' +
  1354. '<div class="forum_banuser_row">' +
  1355. '<div class="forum_banuser_label">Ban reason:</div>' +
  1356. '<div class="forum_banuser_data">' +
  1357. '<div class="gray_bevel fullwidth"><textarea name="ban_reason" style="resize: vertical;"></textarea></div>' +
  1358. '(this message will be visible to the banned user)</div>' +
  1359. '</div>' +
  1360. '<br>' +
  1361. '<div data-community-tooltip="This will delete all posts by this user in discussions, on the group comments page, and on group announcements and events.">' +
  1362. '<input type="checkbox" id="forum_banuser_deletecomments" name="deletecomments">' +
  1363. '<label for="forum_banuser_deletecomments">' +
  1364. 'Delete all forum posts and comments by the user in this group</label>' +
  1365. '</div>' +
  1366. '</form>'));
  1367. }).always(function() {
  1368. Modal.GetContent().find('.newmodal_buttons').css('visibility', '');
  1369. Modal.AdjustSizing();
  1370. var $Form = $J('form#forum_banuser_form');
  1371. Forum_InitBanLengthOptions($Form.find('select[name=ban_length]'));
  1372. $J('select[name="ban_length"]').children('option[value="30"]').after(additionalBanLengthsOptions);
  1373. $J('input[name="ban_reason"]').parent().replaceWith('<div class="gray_bevel fullwidth"><textarea name="ban_reason" style="resize: vertical;"></textarea></div>');
  1374. $J('.forum_banuser_row:last').after(banTemplateOption);
  1375. $J('[name="ban_template"]').on('change', function() {
  1376. $J('[name="ban_reason"').val($J('[name="ban_template"]').val());
  1377. });
  1378. $J('#forum_banuser_deletecomments').parent().after('<div>' +
  1379. '<input type="checkbox" name="forum_banuser_lastwarning" id="forum_banuser_lastwarning">' +
  1380. '&nbsp;<label for="forum_banuser_lastwarning" title="' + lastWarningNotice + '">Include "Last Warning" Notice</label><br>' +
  1381. '<input type="checkbox" name="forum_banuser_delete_source" id="forum_banuser_delete_source">' +
  1382. '&nbsp;<label for="forum_banuser_delete_source" title="Deletes the post or thread you\'ve opened this ban form from.">Delete Post/Thread</label>' +
  1383. '</div>');
  1384. Modal.done(function() {
  1385. ConfirmBan($Form);
  1386. });
  1387. });
  1388. };
  1389.  
  1390. function LockDelete(action, deletionURL) {
  1391. switch (action) {
  1392. case "lock":
  1393. $J(location).attr('href', $J('a[href^="javascript:Forum_SetTopicFlag("]').attr('href'));
  1394. break;
  1395. case "delete":
  1396. $J(location).attr('href', deletionURL);
  1397. break;
  1398. default:
  1399. break;
  1400. }
  1401. }
  1402.  
  1403. function MarkReportResolved($reportBtn) {
  1404. if ($reportBtn.find('.resolved_report_notice').length === 0) {
  1405. $reportBtn.append('&nbsp;<span style="color: lime;" title="This report has been resolved.\nClick to view report history." class="resolved_report_notice">&#10003;</span>');
  1406. $reportBtn.prev('.resolve_btn').fadeOut(400, function() {
  1407. $J(this).remove();
  1408. });
  1409. $reportBtn.find('.resolved_report_notice').on('click', function(e) {
  1410. e.preventDefault();
  1411. if ($reportBtn.parent().find('.report_management_history').length === 0) {
  1412. var forumID = GetExtendedData().owner;
  1413. $J.ajax({
  1414. type: 'GET',
  1415. url: $J(location).attr('protocol') + '//steamcommunity.com/forum/' + forumID + '/ReportedPosts/auditlog/-1/',
  1416. data: {
  1417. 'gidforumtopic': $reportBtn.attr('href').split('/reporteddiscussions/-1/')[1],
  1418. 'gidobject': -1,
  1419. 'ajax': 1
  1420. }
  1421. }).done(function(response) {
  1422. $reportBtn.find('.resolved_report_notice').after('<div class="report_management_history" title="" style="border-color: #a55b13; border-width: 1px; border-style: solid; padding: 5px; display: none;"><span style="color: #a55b13;" onClick="event.preventDefault(); $J(this).parent().slideToggle(400);">Close</span>' + response + '</div>');
  1423. $reportBtn.parent().find('.report_management_history').slideToggle(400);
  1424. });
  1425. } else {
  1426. $reportBtn.parent().find('.report_management_history').slideToggle(400);
  1427. }
  1428. });
  1429. }
  1430. }
  1431.  
  1432. function ReportStatusAndResolve() {
  1433. var forumID = GetExtendedData().owner;
  1434. $J('a[href*="/reporteddiscussions/-1/"]:not(.local_reports_link, .whiteLink)').each(function() {
  1435. if ($J(this).data('statusChecked') === 'true') {
  1436. return true;
  1437. }
  1438. $J(this).data('statusChecked', 'true');
  1439. if ($J('#resolve_btn_' + $J(this).attr('href').split('/reporteddiscussions/-1/')[1].split('/')[0]).length + $J(this).find('.resolved_report_notice').length === 0) {
  1440. var $reportBtn = $J(this);
  1441. $J.get($J(location).attr('protocol') + '//steamcommunity.com/forum/' + forumID + '/ReportedPosts/isreportactive/-1/?gidforumtopic=' + $J(this).attr('href').split('/reporteddiscussions/-1/')[1], function(response) {
  1442. if (response === false) {
  1443. MarkReportResolved($reportBtn);
  1444. } else {
  1445. $reportBtn.before('<span class="btnv6_blue_hoverfade btn_small_thin resolve_btn" id="resolve_btn_' + $reportBtn.attr('href').split('-1/')[1].replace(/\//g, '').trim() + '"><span>Resolve</span></span>&ensp;');
  1446. $reportBtn.prev('.resolve_btn').on('click', function() {
  1447. var gid_forumtopic = $J(this).attr('id').split('resolve_btn_')[1];
  1448. var requestURL = $J(location).attr('protocol') + '//steamcommunity.com/forum/' + forumID + '/ReportedPosts/moderatetopic/-1/';
  1449. $J.post(requestURL, {
  1450. 'action': 'setflag',
  1451. 'flag': 'sticky',
  1452. 'value': false,
  1453. 'gidforumtopic': gid_forumtopic,
  1454. 'sessionid': g_sessionID
  1455. }).done(function() {
  1456. MarkReportResolved($J('a[href*="reporteddiscussions/-1/' + gid_forumtopic + '"]'));
  1457. });
  1458. });
  1459. }
  1460. });
  1461. }
  1462. });
  1463. setTimeout(ReportStatusAndResolve, 1500);
  1464. }
  1465.  
  1466. function SearchIncludeDeletedPosts(loopRequired) {
  1467. $J('a.popup_menu_item[href*="/search/?ip="]').each(function() {
  1468. if ($J(this).attr('href').indexOf('&include_deleted=1') === -1) {
  1469. $J(this).attr('href', $J(this).attr('href') + '&include_deleted=1');
  1470. }
  1471. });
  1472. if (loopRequired) {
  1473. setTimeout(function() {
  1474. SearchIncludeDeletedPosts(true);
  1475. }, 1500);
  1476. }
  1477. }
  1478.  
  1479. function ColorThreads(oldPage) {
  1480. if (oldPage === $J(location).attr('href')) {
  1481. var curPage = $J(location).attr('href');
  1482. setTimeout(function() {
  1483. ColorThreads(curPage);
  1484. }, 250);
  1485. return;
  1486. }
  1487. if (localStorage.getItem('mark_threads') === 'checked') {
  1488. $J('.forum_topic_name').each(function() {
  1489. if ($J(this).closest('.forum_topic').hasClass('locked') === false && $J(this).closest('.forum_topic').hasClass('deleted') === false && $J(this).closest('.forum_topic').hasClass('sticky') === false && $J(this).closest('.forum_topic').hasClass('moved') === false) {
  1490. if (cooldownIndicators.test($J(this).text().trim())) {
  1491. $J(this).parent().css('background-color', '#E97E1C').addClass('violation_cooldown');
  1492. } else if (referralIndicators.test($J(this).text().trim())) {
  1493. $J(this).parent().css('background-color', '#17992F').addClass('violation_referrals');
  1494. } else if (tradeIndicators.test($J(this).text().trim())) {
  1495. $J(this).parent().css('background-color', '#F08080').addClass('violation_trading');
  1496. } else if (beggingIndicators.test($J(this).text().trim())) {
  1497. $J(this).parent().css('background-color', '#FF00FF').addClass('violation_begging');
  1498. } else if (rep4repIndicators.test($J(this).text().trim())) {
  1499. $J(this).parent().css('background-color', '#5D68E8').addClass('violation_rep4rep');
  1500. } else if ($J(this).text().trim().length < 3 || spamIndicators.test($J(this).text().trim())) {
  1501. $J(this).parent().css('background-color', '#C9A80C').addClass('violation_spam');
  1502. } else if ($J(this).text() + $J($J.parseHTML($J(this).parent().data('tooltip-content'))[1]).text() === $J(this).text().toUpperCase() + $J($J.parseHTML($J(this).parent().data('tooltip-content'))[1]).text().toUpperCase()) {
  1503. $J(this).parent().css('background-color', '#A200FF').addClass('violation_caps');
  1504. }
  1505. }
  1506. });
  1507. var violations = ['trading', 'begging', 'referrals', 'spam', 'rep4rep', 'caps', 'cooldown'];
  1508. var counter = 0;
  1509. $J('body').keyup(function(event) {
  1510. if (event.keyCode === 107) {
  1511. if (counter >= violations.length) {
  1512. counter = 0;
  1513. }
  1514. while ($J('.violation_' + violations[counter]).length === 0 && counter < violations.length) {
  1515. counter++;
  1516. }
  1517. $J('.forum_topic_checkbox_input').each(function() {
  1518. if ($J(this).prop('checked') === true) {
  1519. $J(this).trigger('click');
  1520. }
  1521. });
  1522. $J('.violation_' + violations[counter]).each(function() {
  1523. $J(this).find('.forum_topic_checkbox_input').trigger('click');
  1524. });
  1525. counter++;
  1526. }
  1527. });
  1528. } else {
  1529. $J('.forum_topic_name').each(function() {
  1530. $J(this).parent().css('background-color', '');
  1531. });
  1532. }
  1533. $J('a[href*="/?fp="], a.pagebtn').each(function() {
  1534. if ($J(this).data('colorthreads') === undefined) {
  1535. $J(this).data('colorthreads', 'set');
  1536. $J(this).on('click', function() {
  1537. var curPage = $J(location).attr('href');
  1538. setTimeout(function() {
  1539. ColorThreads(curPage);
  1540. }, 1000);
  1541. });
  1542. }
  1543. });
  1544. }
  1545.  
  1546. function HideThreads(oldPage, speed = 0) {
  1547. if (oldPage === $J(location).attr('href')) {
  1548. var curPage = $J(location).attr('href');
  1549. setTimeout(function() {
  1550. HideThreads(curPage);
  1551. }, 250);
  1552. return;
  1553. }
  1554. if (localStorage.getItem('hide_threads_deleted') === 'checked') {
  1555. $J('.deleted').not('.sticky').slideUp(speed);
  1556. } else {
  1557. $J('.deleted').not('.sticky').slideDown(speed);
  1558. }
  1559. if (localStorage.getItem('hide_threads_pinned') === 'checked') {
  1560. $J('.sticky').slideUp(speed);
  1561. } else {
  1562. $J('.sticky').slideDown(speed);
  1563. }
  1564. if (localStorage.getItem('hide_threads_locked') === 'checked') {
  1565. $J('.locked').not('.sticky').slideUp(speed);
  1566. } else {
  1567. $J('.locked').not('.sticky').slideDown(speed);
  1568. }
  1569. if (localStorage.getItem('hide_threads_redirected') === 'checked') {
  1570. $J('.moved').not('.sticky').slideUp(speed);
  1571. } else {
  1572. $J('.moved').not('.sticky').slideDown(speed);
  1573. }
  1574. $J('a[href*="/?fp="], a.pagebtn').each(function() {
  1575. if ($J(this).data('hidethreads') === undefined) {
  1576. $J(this).data('hidethreads', 'hidden');
  1577. $J(this).on('click', function() {
  1578. var curPage = $J(location).attr('href');
  1579. setTimeout(function() {
  1580. HideThreads(curPage);
  1581. }, 1000);
  1582. });
  1583. }
  1584. });
  1585. }
  1586.  
  1587. function GetExtendedData() {
  1588. return g_rgForumTopicCommentThreads[$J('.forum_op:first').attr('id').split('_')[2]].m_rgCommentData;
  1589. }
  1590.  
  1591. function GetForumOwnerID() {
  1592. return g_rgForumTopics[$J('.forum_op:first').attr('id').split('_')[2]].m_rgForumData.owner;
  1593. }
  1594.  
  1595. function GetTopicPermissionsString() {
  1596. return '{"topic_permissions":' + JSON.stringify(JSON.parse(GetExtendedData().extended_data).topic_permissions) + '}';
  1597. }
  1598.  
  1599. function PostForumReply(comment) {
  1600. var $deferred = $J.Deferred();
  1601. var topicInfo = $J('.commentthread_area[id^="commentthread_ForumTopic_"]').attr('id');
  1602. var extendedData = GetExtendedData();
  1603. $J.post($J(location).attr('protocol') + '//steamcommunity.com/comment/ForumTopic/post/' + topicInfo.split('_')[2] + '/' + topicInfo.split('_')[3] + '/', {
  1604. 'comment': comment,
  1605. 'sessionid': g_sessionID,
  1606. 'feature2': extendedData.feature2,
  1607. 'oldestfirst': false,
  1608. 'include_raw': true,
  1609. 'count': extendedData.pagesize,
  1610. 'extended_data': GetTopicPermissionsString()
  1611. }).done(function(data) {
  1612. if ($J('.commentthread_pagelink:last').hasClass('active') || $J('.commentthread_pagelink').length === 0) {
  1613. $J('.commentthread_comments').empty().prepend(data.comments_html);
  1614. } else {
  1615. $J(location).attr('href', $J('.commentthread_pagelink:last').attr('href'));
  1616. }
  1617. $deferred.resolve();
  1618. }).fail(function() {
  1619. $deferred.reject();
  1620. });
  1621. return $deferred.promise();
  1622. }
  1623.  
  1624. function ToggleTradeForumTopics(speed = 0) {
  1625. $J('.report_content_line1').find('.whiteLink[href*="tradingforum"]').each(function() {
  1626. $J(this).parents('.forum_report:first').slideToggle(speed);
  1627. });
  1628. }
  1629.  
  1630. function ToggleReportGrouping($newPage) {
  1631. var $oldPage = $J('form[name="reports_form"]').find('div:first').children().clone(true, true);
  1632. if ($newPage !== '') {
  1633. $J('form[name="reports_form"]').find('div:first').empty().append($newPage);
  1634. return $oldPage;
  1635. }
  1636. var cooldownThreads = [];
  1637. var tradeThreads = [];
  1638. var beggingThreads = [];
  1639. var referralThreads = [];
  1640. var capsThreads = [];
  1641. var spamThreads = [];
  1642. var rep4repThreads = [];
  1643. $J('.commentthread_comment_text, .content').each(function() {
  1644. /*if (cooldownIndicators.test($J(this).text().trim())){
  1645. cooldownThreads.push($J(this).closest('.forum_report').clone(true, true));
  1646. }else */
  1647. if (referralIndicators.test($J(this).text().trim())) {
  1648. referralThreads.push($J(this).closest('.forum_report').clone(true, true));
  1649. } else if (tradeIndicators.test($J(this).text().trim()) && $J(this).closest('.forum_report').find('.report_content_line2').find('.whiteLink:first').attr('href').indexOf('/tradingforum/') === -1) {
  1650. tradeThreads.push($J(this).closest('.forum_report').clone(true, true));
  1651. } else if (beggingIndicators.test($J(this).text().trim())) {
  1652. beggingThreads.push($J(this).closest('.forum_report').clone(true, true));
  1653. } else if (rep4repIndicators.test($J(this).text().trim())) {
  1654. rep4repThreads.push($J(this).closest('.forum_report').clone(true, true));
  1655. } else if ($J(this).text().trim().length < 3) {
  1656. spamThreads.push($J(this).closest('.forum_report').clone(true, true));
  1657. } else if ($J(this).text() === $J(this).text().toUpperCase()) {
  1658. capsThreads.push($J(this).closest('.forum_report').clone(true, true));
  1659. }
  1660. });
  1661. $J('form[name="reports_form"]').find('div:first').addClass('grouped_reports_container').empty();
  1662. if (referralThreads.length > 0) {
  1663. $J('.grouped_reports_container').append('<div id="referral_topics"><h1 class="report_group_title" align="center">Referrals</h1></div>');
  1664. $J.each(referralThreads, function(index, $report) {
  1665. $J('#referral_topics').append($report);
  1666. });
  1667. }
  1668. if (beggingThreads.length > 0) {
  1669. $J('.grouped_reports_container').append('<div id="begging_topics"><h1 class="report_group_title" align="center">Begging</h1></div>');
  1670. $J.each(beggingThreads, function(index, $report) {
  1671. $J('#begging_topics').append($report);
  1672. });
  1673. }
  1674. if (rep4repThreads.length > 0) {
  1675. $J('.grouped_reports_container').append('<div id="rep4rep_topics"><h1 class="report_group_title" align="center">Rep4Rep</h1></div>');
  1676. $J.each(rep4repThreads, function(index, $report) {
  1677. $J('#rep4rep_topics').append($report);
  1678. });
  1679. }
  1680. if (tradeThreads.length > 0) {
  1681. $J('.grouped_reports_container').append('<div id="trading_topics"><h1 class="report_group_title" align="center">Trading outside the Trading subforum</h1></div>');
  1682. $J.each(tradeThreads, function(index, $report) {
  1683. $J('#trading_topics').append($report);
  1684. });
  1685. }
  1686. if (spamThreads.length > 0) {
  1687. $J('.grouped_reports_container').append('<div id="spam_topics"><h1 class="report_group_title" align="center">Spam</h1></div>');
  1688. $J.each(spamThreads, function(index, $report) {
  1689. $J('#spam_topics').append($report);
  1690. });
  1691. }
  1692. if (capsThreads.length > 0) {
  1693. $J('.grouped_reports_container').append('<div id="caps_topics"><h1 class="report_group_title" align="center">All-Caps</h1></div>');
  1694. $J.each(capsThreads, function(index, $report) {
  1695. $J('#caps_topics').append($report);
  1696. });
  1697. }
  1698. /*if (cooldownThreads.length > 0){
  1699. $J('.grouped_reports_container').append('<div id="cooldown_topics"><h1 class="report_group_title" align="center">Cooldown/Ban Complaints</h1></div>');
  1700. $J.each(cooldownThreads, function(index, $report){
  1701. $J('#cooldown_topics').append($report);
  1702. });
  1703. }*/
  1704. $J('.report_group_title').css('color', '#799905');
  1705. return $oldPage;
  1706. }
  1707.  
  1708.  
  1709. function GetTopicDeletionFunction(topicURL, $threadPage) {
  1710. if (!$threadPage) {
  1711. $J.get($J(location).attr('protocol') + topicURL.replace(/https?:/i, ''), function(page) {
  1712. $threadPage = $J(page);
  1713. });
  1714. }
  1715. var actionURL_arg3 = '-1';
  1716. if (topicURL.indexOf('/forum/') > -1) {
  1717. actionURL_arg3 = topicURL.split('/forum/')[1].split('/')[0];
  1718. } else if (topicURL.indexOf('/discussions/') > -1) {
  1719. actionURL_arg3 = topicURL.split('/discussions/')[1].split('/')[0];
  1720. } else if (topicURL.indexOf('/discussion/') > -1) {
  1721. actionURL_arg3 = topicURL.split('/discussion/')[1].split('/')[0];
  1722. }
  1723. var forumType = 'General';
  1724. if (topicURL.indexOf('/filedetails/') > -1) {
  1725. forumType = 'PublishedFile';
  1726. } else if (topicURL.indexOf('/tradingforum/') > -1) {
  1727. forumType = 'Trading';
  1728. } else if (topicURL.indexOf('/workshop/') > -1) {
  1729. forumType = 'Workshop';
  1730. }
  1731. var extendedData;
  1732. $threadPage.find('script').each(function(index, value) {
  1733. if ($J(this).html().indexOf('InitializeForumTopic(') > -1) {
  1734. var extractedExtendedData = $J(this).html().split('InitializeForumTopic(')[1].split(', "http')[0];
  1735. extendedData = JSON.parse(extractedExtendedData);
  1736. return false;
  1737. }
  1738. });
  1739. var forumID = extendedData.owner;
  1740. var gidforumtopic = $threadPage.find('div[id^="forum_op_"]').attr('id').split('_')[2];
  1741. var actionURL = $J(location).attr('protocol') + '//steamcommunity.com/forum/' + forumID + '/' + forumType + '/deletetopic/' + actionURL_arg3 + '/';
  1742. var DeleteTopicFunction = function() {
  1743. var $deferred = $J.Deferred();
  1744. $J.post(actionURL, {
  1745. 'gidforumtopic': gidforumtopic,
  1746. 'sessionid': g_sessionID
  1747. }).done(function() {
  1748. $deferred.resolve();
  1749. }).fail(function() {
  1750. $deferred.reject();
  1751. });
  1752. return $deferred.promise();
  1753. };
  1754. return DeleteTopicFunction;
  1755. }
  1756.  
  1757. function AddModeratorMessageInfoBtn(loopRequired) {
  1758. $J('.forum_author_menu').each(function() {
  1759. if ($J(this).find('.mod_message_info_btn').length === 0) {
  1760. $J(this).find('.popup_menu').append('<a class="popup_menu_item tight mod_message_info_btn" href="' + $J(this).find('.popup_menu_item[href*="/posthistory"]').attr('href').replace('posthistory', 'moderatormessages') +'">Moderation History</a>');
  1761. }
  1762. });
  1763. if (loopRequired) {
  1764. setTimeout(function() {
  1765. AddModeratorMessageInfoBtn(true);
  1766. }, 1500);
  1767. }
  1768. }
  1769.  
  1770. function SortWarningOptions(text) {
  1771. var $warningOptions = $J('<select>' + warningOptions + '</select>');
  1772. if (localStorage.getItem('sorted_warnings_deactivated') !== 'checked') {
  1773. $warningOptions.find('option').each(function(index, option) {
  1774. var $option = $J(option);
  1775. if ($option.data('pattern')) {
  1776. if (new RegExp(decodeURIComponent($option.data('pattern')), 'i').test(text)) {
  1777. $option.detach().prependTo($warningOptions);
  1778. }
  1779. }
  1780. });
  1781. }
  1782. return $warningOptions;
  1783. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement