Skip to content

Commit

Permalink
Update Steamgifts_GA_creator.user.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurvin authored Apr 4, 2019
1 parent eea95a1 commit 44dc4e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Steamgifts_GA_creator.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @namespace http://akhanubis.com/
// @author Pablo Bianciotto (updated by Laurvin)
// @description Allows creation of multiple GAs at the same time (See https://greasyfork.org/en/scripts/14840-steamgifts-ga-creator for the original.)
// @version 0.2
// @version 0.21
// @icon http://i.imgur.com/XYzKXzK.png
// @downloadURL https://github.com/Laurvin/Steamgifts-GA-creator/raw/master/Steamgifts_GA_creator.user.js
// @match http://www.steamgifts.com/giveaways/new
Expand Down Expand Up @@ -59,9 +59,9 @@ if (!form.find('#games_textarea').length) {

$(document).on('ajaxSuccess.batch', function(e, xhr, settings) {
if (settings.data.match(/do\=autocomplete_giveaway_game/)) {
var result = JSON.parse(xhr.responseText).html.match('<div data-autocomplete-id=\"(\\d+)\" data-autocomplete-name=\"' + game.name.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + '\"'); // Added replace function to create a regex safe game name.
var result = JSON.parse(xhr.responseText).html.match('<div data-autocomplete-id=\"(\\d+)\" data-autocomplete-name=\"' + game.name.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&").replace(/&(?!amp;)/g, '&amp;') + '\"'); // Added replace function to create a regex safe game name.
if (result) {
form.find('.js__autocomplete-id').val(result[1]);
form.find('.js__autocomplete-id').val(result[2]);
form[0].submit();
next();
}
Expand All @@ -78,7 +78,7 @@ if (!form.find('#games_textarea').length) {
</div>\
<div class="form__row__indent">\
<div class="form__input-description">\
This section has been added by Steamgifts GA creator (<a style="color:#4B72D4" target="_blank" href="https://www.steamgifts.com/discussion/x1fu9/">info</a>).\
This section has been added by Steamgifts GA creator (<a style="color:#4B72D4" target="_blank" href="https://www.steamgifts.com/discussion/KnfXs/">info</a>).\
<br/>\
1 game per line. Example:\
<br/>\
Expand Down

0 comments on commit 44dc4e3

Please sign in to comment.