Last active
May 31, 2017 12:24
-
-
Save daghlny/0d1a801d420a2c1e4e1ab3bdc92362e0 to your computer and use it in GitHub Desktop.
BS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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