Skip to content

Instantly share code, notes, and snippets.

@daghlny
Last active May 31, 2017 12:24
Show Gist options
  • Save daghlny/0d1a801d420a2c1e4e1ab3bdc92362e0 to your computer and use it in GitHub Desktop.
Save daghlny/0d1a801d420a2c1e4e1ab3bdc92362e0 to your computer and use it in GitHub Desktop.
BS
/**
* Created by Ashitaka on 2017/5/31.
*/
function getKeys()
{
$("#kktext").val("");
var keys = new Map();
var allkeysString = "";
$("input[ng-model='game.key']").each(function(index){
if(index % 2 != 0){
var name = $(this).parent().parent().parent().parent().find(".title").text();
var key = this.value;
if(keys.get(name) == undefined){
var keyArray = [key];
keys.set(name, keyArray);
} else {
keys.get(name).push(key);
}
}
});
keys.forEach(function(value, key){
allkeysString += "\n"+key+": \n";
value.forEach(function(elem){
allkeysString += elem + "\n";
});
});
return allkeysString;
}
$("<textarea id='kktext' style='width:400px;height:1000px; color:#000000'></textarea>").insertAfter($("h2"));
$("a[ng-click='redeemSerial(order._id, item._id, game)'][class='ng-scope'][style='color:#d0fe00']").click();
var newtext = getKeys();
$("#kktext").val(newtext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment