Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code needs to be cleaned up. #85

Open
Legend-of-iPhoenix opened this issue Mar 23, 2018 · 0 comments
Open

Code needs to be cleaned up. #85

Legend-of-iPhoenix opened this issue Mar 23, 2018 · 0 comments

Comments

@Legend-of-iPhoenix
Copy link
Owner

This code uses my typical trail of compressed methods and obfuscated variable names. We/I should probably clean it up.

TheButton/js/main.js

Lines 210 to 240 in 6f987dc

window.onload = e => {
var i = location.hostname.split("").reverse().join("").substring(10).split("").reverse().join(""),
this_repo_url = (linkOverride ? linkOverride : 'https://github.com/' + i + '/' + location.pathname.split('/')[1]);
is_original = i == 'legend-of-iphoenix';
tr = 'GitHub repo: <a href="' + this_repo_url + '">' + (is_original ? 'Here' : i + ' (this fork)') + '</a>';
if (!is_original) tr += ' | <a href="https://github.com/Legend-of-iPhoenix/TheButton">Legend-of-iPhoenix (original)</a>';
tl = '';
if (!is_original) {
tl += '<b>' + i + '</b> | <a href="https://legend-of-iphoenix.github.io/TheButton/">Legend-of-iPhoenix</a>';
} else if (otherRepos.length) {
tl += '<b>' + i + '</b>';
}
for (i=0; i<otherRepos.length; i++) {
repo = otherRepos[i].split('/');
tr += ' | <a href="https://github.com/' + repo[0] + '/' + repo[1] + '">' + repo[0] + '</a>';
tl += (tl ? ' | ' : '') + '<a href="https://' + repo[0] + '.github.io/' + repo[1] + '">' + repo[0] + '</a>';
}
if (tl) tl = 'Live site: ' + tl;
document.getElementById("repolink").innerHTML = tr;
if (tl) {
document.getElementById("livelink").innerHTML = tl;
} else {
document.getElementById("livelink").remove();
}
document.getElementById("logoutbutton").onclick = function() {
firebase.auth().signOut();
location.reload();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant