BundleStar_GetKey&Gift

shows how to use babel compiler

  1. // ==UserScript==
  2. // @name BundleStar_GetKey&Gift
  3. // @Namespace http://tampermonkey.net/
  4. // @version 1.03
  5. // @description shows how to use babel compiler
  6. // @icon https://cdn.bundlestars.com/production/brand/logo.png
  7. // @author KamiXuan
  8. // @match https://www.bundlestars.com/en/orders*
  9. // @namespace https://greasyfork.org/users/113438
  10. // ==/UserScript==
  11. //扩散范围仅限STEAMCN论坛 当然你扩散到其他地方我也是管不到你的
  12. $ = unsafeWindow.jQuery;
  13. (function($) {
  14. unsafeWindow.redeem=function redeem()
  15. {$("a[ng-click='redeemSerial(order._id, item._id, game)'][class='ng-scope'][style='color:#d0fe00']").click();};
  16. unsafeWindow.get=function get(){
  17. $("#kamitext").val("");
  18. $("input[ng-model='game.key']").each(function(index){if(index%2!==0){
  19. $("#kamitext").val($("#kamitext").val()+$(this).val()+"\n");}});};
  20. unsafeWindow.getWithName=function (){
  21. $("#kamitext").val("");
  22. $("input[ng-model='game.key']").each(function(index){if(index%2!==0){
  23. $("#kamitext").val($("#kamitext").val()+$(this).parent().parent().parent().parent().find(".title").text()+":"+this.value+"\n");}});};
  24. $("<button value='redeem' onclick='redeem()' id='kamiredeem'>REDEEM</button>").insertAfter($("h2"));
  25. $("<button value='get' onclick='get()' id='kamiget'>GET</button>").insertAfter($("#kamiredeem"));
  26. $("<button value='getwithname' onclick='getWithName()' id='kamigetname'>GETwithNAME</button>").insertAfter($("#kamiget"));
  27. $("</br><textarea id='kamitext' style='width:400px;height:400px;'></textarea>").insertAfter($("#kamigetname"));})(jQuery);