Greasy Fork 支持简体中文。

steam card exchange simple viewer

just click the 'Sets Available' view showcase on the right side

  1. // ==UserScript==
  2. // @name steam card exchange simple viewer
  3. // @namespace https://github.com/deathxlent/steamcardexchangeviewer
  4. // @version 0.11
  5. // @description just click the 'Sets Available' view showcase on the right side
  6. // @author deathxlent
  7. // @match http://www.steamcardexchange.net/index.php?inventory
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. $('#notification').prepend('<style>div.showcase-element {width: 120px; height:240px ; position: relative; float: left; background-color: #18191B; background-color: rgba(0, 0, 0, .3);}</style>');
  15. var noneedReg=new RegExp('<div class="showcase-element"></div>','g');
  16. $('#inventorylist > tbody > tr > td:nth-child(4)').each(function(){
  17. var ele=$(this);
  18. ele.unbind();
  19. ele.css("border","1px #338FCC solid");
  20. ele.css("cursor","pointer");
  21. ele.bind("click",function(){
  22. var id=ele.attr("id").replace('set-','');
  23. $("div").remove("#div_d");
  24. $.ajax({
  25. url:'http://www.steamcardexchange.net/index.php?gamepage-appid-'+id,
  26. type:'GET',
  27. async:true,
  28. dataType:'text',
  29. success:function(data){
  30. $('#notification').prepend("<div id='div_d' style='position:absolute;right:0;top:"+ele.position().top+"px;height:80%;width:400px;'></div>");
  31. var obj=jQuery.parseHTML(data);
  32. var htmlStr='';
  33. $(obj).find('.showcase-element-container').each(function(){
  34. htmlStr+=$(this).attr('class').replace('showcase-element-container ','')+"<br/>"+$(this).html().replace(noneedReg,'');
  35. });
  36. $('#div_d').html(htmlStr);
  37. }
  38. });
  39. });
  40. });
  41.  
  42. })();