Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
TCNOco committed Jan 13, 2018
1 parent c4e706e commit 02117d8
Show file tree
Hide file tree
Showing 29 changed files with 281 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Chrome/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Wesley Pyburn

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Binary file added Chrome/Logo128x128.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome/Logo128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome/Logo16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome/Logo256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome/Logo48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions Chrome/TcNoEmbed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//Badge list multicraft link creator
function TcNoMulticraft(link) {
var numberTimes = prompt("Enter how many times you want to craft the badge (Between 1 and 5): ", "");
if (numberTimes > 5 || numberTimes < 1){alert("Please enter a number of times between 1 and 5");}
var gameNumber = link.substring(0, link.length-1);
gameNumber = gameNumber.substring(gameNumber.lastIndexOf("/")+1, gameNumber.length);
link = link.substring(link.lastIndexOf("/id/")+4, link.lastIndexOf("/gamecards/"));
var command = "Profile_CraftGameBadge('https://steamcommunity.com/id/" + link +"','" + gameNumber +"','1','0');";
var outLink = "";
for (i = 0; i < numberTimes; i++) {
outLink += command;
}
eval(outLink);
setTimeout(function() {
location.reload();
}, 500);
}

//Add open all trade button to Steam Badge pages.
function OpenAllMarket() {
jQuery("a.btn_medium").each(function() {
if (jQuery(this).attr('href').includes("/market/listings/")){
var link = jQuery(this).attr('href');
window.open(link);
}
});
}
Binary file added Chrome/Webp.net-resizeimage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Chrome/assets/bootstrap/css/bootstrap.min.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Chrome/assets/bootstrap/js/bootstrap.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Chrome/assets/css/styles.min.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a{text-decoration:none;color:#fff}
Binary file added Chrome/assets/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Chrome/assets/js/jquery.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Chrome/jquery-3.2.1.min.js

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions Chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"manifest_version": 2,
"name": "Steam Card Assistant",
"author": "TechNobo (Wesley Pyburn)",
"description": "Extends the Steam Badge crafting system.",
"version": "1.0",
"homepage_url": "https://tcno.co/",
"browser_action": {
"default_icon": "Logo256x256.png",
"default_popup": "popup.html"
},
"icons": {
"16": "Logo16x16.png",
"48": "Logo48x48.png",
"128": "Logo128x128.png"
},
"web_accessible_resources": [
"TcNoEmbed.js"
],
"permissions": ["notifications", "tabs", "*://*.steampowered.com/*", "*://*.steamcommunity.com/*"],
"content_scripts": [
{
"run_at" :"document_end",
"matches": ["*://*.steamcommunity.com/id/*/badges*", "*://*.steamcommunity.com/id/*/gamecards*"],
"js": ["jquery-3.2.1.min.js", "sca.js"]
}
]
}
27 changes: 27 additions & 0 deletions Chrome/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TcNo Steam Card Assistant</title>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/styles.min.css">
</head>

<body style="overflow:hidden;">
<div class="d-block" style="width:500px;x;x;height:120px;padding-right:15px;padding-left:15px;background-color:#2c3134;overflow:hidden;padding-top:15px;">
<div class="d-table-cell" style="/*max-width:130px;*//*min-width:130px;*//*overflow:hidden;*/background-image:url(&quot;assets/img/logo.png&quot;);background-size:contain;background-repeat:no-repeat;padding-top:10px;width:100px;"></div>
<div class="d-table-cell" style="width:400px;padding-right:15px;padding-left:15px;overflow:hidden;">
<div style="overflow:hidden;">
<h3 class="text-center" style="color:rgb(255,255,255);">TcNo Steam Card Assistant</h3>
<p class="text-center" style="color:rgb(242,242,242);margin-bottom:5px;">Created by Wesley Pyburn - TechNobo</p>
<p class="text-center" style="color:rgb(242,242,242);margin-bottom:5px;"><a href="https://steamcommunity.com/profiles/76561198064588130">Steam</a> | <a href="https://twitter.com/TcNobo">Twitter</a> | <a href="https://tcno.co/">Website</a> | <a href="https://youtube.com/TechNobo">YouTube</a></p>
</div>
</div>
</div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
</body>

</html>
111 changes: 111 additions & 0 deletions Chrome/sca.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
//Displays developer information in console :)
var console_info = [" %cTcNo SteamCardAssistant %cby TechNobo (Wesley Pyburn) %chttps://tcno.co/ ", 'background: #222; color: white','background: #222; color: #bada55','background: #222; color: lightblue'];
console.log.apply(console, console_info);

//Verifies that the website is HTTPS
CheckIfHTTPS();
//Checks to see if is a "gamecards" page or a "badges" page, and acts accordingly.
if (window.location.href.includes( "gamecards" )) {
var s = document.createElement( 'script' );
s.src = chrome.extension.getURL( 'TcNoEmbed.js' );
s.onload = function() {
this.remove();
};
(document.head || document.documentElement).appendChild(s);
IndividualPage();
}
if (window.location.href.includes( "badges" )) {
var s = document.createElement( 'script' );
s.src = chrome.extension.getURL( 'TcNoEmbed.js' );
s.onload = function() {
this.remove();
};
(document.head || document.documentElement).appendChild(s);
BadgeListPage();
}

function CheckIfHTTPS() {
//Required for AJAX crafting within steamcommunity.com. One can not be HTTP and the other HTTPS.
if(window.location.href.startsWith( "http://" )) {
console.log( "The website is currently in http://. It is A. Insecure and B. Incompatible with TcNo Steam Card Assistant." );
var httpsLink = window.location.href.replace( "http://", "https://" );
window.location.href = httpsLink;
}
if(window.location.href.startsWith( "steamcommunity.com" )) {
console.log( "The website is currently in http://. It is A. Insecure and B. Incompatible with TcNo Steam Card Assistant." );
var httpsLink = window.location.href.replace( "steamcommunity.com", "https://steamcommunity.com" );
window.location.href = httpsLink;
}
}

function IndividualPage() {
//COMPLETE FOR INDIVIDUAL PAGES
//add to steamcommunity.com/id/*xyz*/gamecards/*381140*/
if (jQuery( 'div.badge_craft_button' ).length) {
//define outerHTML function
jQuery.fn.outerHTML = function() {return (!this.length) ? this : (this[0].outerHTML || (function(el) {var div = document.createElement( 'div' );div.appendChild(el.cloneNode(true));var contents = div.innerHTML;div = null;return contents;} )(this[0]));}

if (jQuery( 'div.badge_info_description' ).length) {
var oldButton = jQuery( "div.badge_craft_button" ).outerHTML();
jQuery( "div.gamecard_badge_craftbtn_ctn" ).html(jQuery( "div.gamecard_badge_craftbtn_ctn" ).html().replace(oldButton, "<br>" + oldButton));
jQuery( "div.badge_craft_button" ).css({ "margin-top": "10px" } );
jQuery( "div.badge_content" ).css({ "height": "165px" } );
jQuery( "div.badge_info" ).css({ "min-width": "328px" } );
jQuery( "div.badge_current" ).css({ "margin-top": "41px" } );
}

var buttonsHTML = jQuery( "div.gamecard_badge_craftbtn_ctn" ).html();
var craftLink = jQuery( "div.badge_craft_button" ).attr( "onclick" );
var craftTimes = jQuery( "div.badge_card_set_text_qty" ).html().substring(1,2);
jQuery( "div.badge_card_set_text_qty" ).each(function() {
var tempVal = jQuery(this).html().substring(1,2);
if (tempVal < craftTimes) {
craftTimes = tempVal;
}
} );

var newCraftLink = "";
for (i = 0; i < craftTimes; i++) {
newCraftLink += craftLink;
}
var newButtonHTML = jQuery( "div.badge_craft_button" ).outerHTML().replace(craftLink, newCraftLink).replace(jQuery( "div.badge_craft_button" ).html(), "Craft " + craftTimes + " Badge(s)" );
newButtonHTML = newButtonHTML.replace( '<div class="', '<style type="text/css">.TcNoButton {background-color:green;border: 1px solid lightgreen;margin-left:5px;} .TcNoButton:hover {background-color:#00b300;border-color:green;}</style><div class="TcNoButton ' );
var buttonHTMLIncluded = buttonsHTML.replace( '<div style="clear: left;"></div>',newButtonHTML + '<div style="clear: left;"></div>' );
jQuery( "div.gamecard_badge_craftbtn_ctn" ).html(buttonHTMLIncluded);
console.log( "Multiple card button added!" );
}else{console.log( "Multiple card button NOT added!" );}

//Open all cards in new tab button:
var textLocation = jQuery( 'div.badge_card_to_collect_header' ).parent();
jQuery( 'div.badge_card_to_collect_header' ).parent().html( '<a href="javascript:OpenAllMarket()" style="display: inline-block;margin-left:10px" class="btn_grey_grey btn_medium"><span>Open all market links</span></a>' + jQuery( 'div.badge_card_to_collect_header' ).parent().html());
jQuery( 'div.badge_card_to_collect_header' ).css({ "display": "inline-block" } );
}

//used on the badge list page
function BadgeListPage() {
//Cards on the /badges/ page:
//Remove one of the 5 cards (to make space)
//OuterHTML ability
jQuery.fn.outerHTML = function() {return (!this.length) ? this : (this[0].outerHTML || (function(el) {var div = document.createElement( 'div' );div.appendChild(el.cloneNode(true));var contents = div.innerHTML;div = null;return contents;} )(this[0]));}
//for each badge_cards, adds another DIV to get rid of the last card
jQuery( "div.badge_cards" ).each(function() {
jQuery(this).html(jQuery(this).outerHTML().replace( '<div','<div style="max-width:400px;overflow:hidden;"><div style="min-width:526px;"' ) + '</div>' );
} );

jQuery( "div.badge_progress_info" ).each(function() {
if (jQuery(this).find( "a[href]" ).attr( 'href' )) {
var cardLink = jQuery(this).find( "a[href]" ).attr( 'href' );
var oldButton = jQuery(this).html();
var newButton = oldButton.replace(cardLink,"javascript:TcNoMulticraft( '" + cardLink + "' )" ).replace(jQuery(oldButton).html(), "Multiple" );
newButton = newButton.replace( 'class="badge_craft_button"','' )
newButton = newButton.replace( '<a ', '<a class="badge_craft_button TcNoButton" ' );
newButton = '<style type="text/css">.TcNoButton {background-color:green;border: 1px solid lightgreen;margin-left:5px;} .TcNoButton:hover {background-color:#00b300;border-color:green;}</style>' + newButton;
newButton = newButton.replace( 'href', 'style="min-width: 92px;display:inline-block;" href' );
oldButton = oldButton.replace( 'href', 'style="min-width: 92px;max-width: 92px;display:inline-block;" href' );
jQuery(this).html(newButton + oldButton);
}
jQuery(this).css({ "min-width": "210px" } );
} );
}

//outerHTML function adapted from https://gist.github.com/davemo/915570/0c848ef50e7d4aafb9bece3e8a90d50fd59716b3 (By: jboesch)
6 changes: 6 additions & 0 deletions Interface/assets/bootstrap/css/bootstrap.min.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Interface/assets/bootstrap/js/bootstrap.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Interface/assets/css/styles.min.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a{text-decoration:none;color:#fff}
Binary file added Interface/assets/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Interface/assets/js/jquery.min.js

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions Interface/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TcNo Steam Card Assistant</title>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/styles.min.css">
</head>

<body style="overflow:hidden;">
<div class="d-block" style="width:500px;x;x;height:120px;padding-right:15px;padding-left:15px;background-color:#2c3134;overflow:hidden;padding-top:15px;">
<div class="d-table-cell" style="/*max-width:130px;*//*min-width:130px;*//*overflow:hidden;*/background-image:url(&quot;assets/img/logo.png&quot;);background-size:contain;background-repeat:no-repeat;padding-top:10px;width:100px;"></div>
<div class="d-table-cell" style="width:400px;padding-right:15px;padding-left:15px;overflow:hidden;">
<div style="overflow:hidden;">
<h3 class="text-center" style="color:rgb(255,255,255);">TcNo Steam Card Assistant</h3>
<p class="text-center" style="color:rgb(242,242,242);margin-bottom:5px;">Created by Wesley Pyburn - TechNobo</p>
<p class="text-center" style="color:rgb(242,242,242);margin-bottom:5px;"><a href="https://steamcommunity.com/profiles/76561198064588130">Steam</a> | <a href="https://twitter.com/TcNobo">Twitter</a> | <a href="https://tcno.co/">Website</a> | <a href="https://youtube.com/TechNobo">YouTube</a></p>
</div>
</div>
</div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
</body>

</html>
Binary file added Logo1000x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Logo128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Logo16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Logo48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Logo500x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 02117d8

Please sign in to comment.