Skip to content

Commit

Permalink
Fix the else if chain again
Browse files Browse the repository at this point in the history
Still have bugs to iron out
  • Loading branch information
wolfy1339 authored Oct 4, 2016
1 parent 567d7bd commit 4f1bdcb
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions TPT_Fixer_Upper.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ var TPTFixerUpper = function() {
return +(jQuery(".Pageheader a:eq(1)").attr("href").split("Group=")[1].split("&")[0]);
}
};
} else if (currentURL.indexOf("/Groups/Admin/") !== -1) {
replacePageHeader();
} else if (currentURL.indexOf("/Groups/Thread/") !== -1) {
replacePageHeader();
}

if (currentURL == "/Search.html") {
Expand Down Expand Up @@ -142,7 +146,7 @@ var TPTFixerUpper = function() {
" display: block;",
"}"
].join("\n"));
} else if (currentURL == "/Profile/Password.html") {
} else if (currentURL == "/Profile/Password.html" || currentURL == "/PasswordReset.html") {
// Stylize submit input
jQuery(".Subpage input[type=\"submit\"]").addClass("btn btn-primary");
} else if (currentURL == "/Profile/Avatar.html") {
Expand Down Expand Up @@ -195,6 +199,15 @@ var TPTFixerUpper = function() {
input.val(label);
}
});
} else if (currentURL == "/Groups/Admin/Members.html") {
// Make the Admin management page work better by changing it's looks a little bit
jQuery(".Pagination").remove();
jQuery(".contents").css({"width": "900px"});
jQuery(".MemberColumn").css({"width": "417.5px"});
jQuery(".MemberName").css({"width": "120px"});
} else if (currentURL == "/Groups/Admin/MemberElevation.html") {
// Stylize submit input
jQuery("input[type=\"submit\"]").addClass("btn btn-primary");
} else if (currentURL == "/Groups/Thread/View.html") {
addCss([".MessageList .Post .Meta .Author .Gravatar {",
" border: 0 none;",
Expand Down Expand Up @@ -346,8 +359,6 @@ var TPTFixerUpper = function() {
}
});

replacePageHeader();

// Replace the embedded savegames with a version that uses the same format as the forums
// Wait for all page content (embedded saves) to load
jQuery(".fSaveGame").each(function() {
Expand Down Expand Up @@ -424,10 +435,6 @@ var TPTFixerUpper = function() {

tinymce.activeEditor.setContent(text);
}, 1000);

replacePageHeader();
} else if (currentURL == "/Groups/Thread/Create.html" || currentURL == "/Groups/Thread/Moderation.html" || currentURL == "/Groups/Page/Register.html" || currentURL.indexOf("/Groups/Admin/") !== -1) {
replacePageHeader();
} else if (currentURL == "/Groups/Page/View.html") {
addCss([".breadcrumb {",
" margin: 0;",
Expand All @@ -437,23 +444,12 @@ var TPTFixerUpper = function() {
"}"
].join("\n"));
jQuery(".Pageheader").addClass("breadcrumb").removeClass("Pageheader");
} else if (currentURL == "/Groups/Admin/Members.html") {
// Make the Admin management page work better by changing it's looks a little bit
jQuery(".Pagination").remove();
jQuery(".contents").css({"width": "900px"});
jQuery(".MemberColumn").css({"width": "417.5px"});
jQuery(".MemberName").css({"width": "120px"});
} else if (currentURL == "/Groups/Admin/MemberElevation.html" || currentURL == "/Groups/Page/Resign.html" || currentURL == "/PasswordReset.html") {
// Stylize submit input
jQuery("input[type=\"submit\"]").addClass("btn");
if (currentURL == "/Groups/Page/Resign.html") {
jQuery("input[type=\"submit\"]").addClass("btn-danger");
} else {
jQuery("input[type=\"submit\"]").addClass("btn-primary");
}
} else if (currentURL == "/Groups/Page/Resign.html") {
replacePageHeader();
jQuery("input[type=\"submit\"]").addClass("btn btn-danger");
} else if (currentURL == "/Groups/Page/Index.html") {
// Make the page look like the rest of the website
jQuery(".Pageheader").css({"background": "#fff","border-bottom": "0px","font-weight": "normal","padding": "0"});
jQuery(".Pageheader").css({"background": "#fff", "border-bottom": "0px", "font-weight": "normal", "padding": "0"});
jQuery(".Page").css({"border": "none"});
jQuery(".contents").css({"padding": "10px","background": "white","border": "1px solid #DDD"});
jQuery(".GroupItem:last-child").css({"border-bottom": "none"});
Expand All @@ -470,6 +466,7 @@ var TPTFixerUpper = function() {
].join("\n"));
jQuery(".PageFooter").addClass("breadcrumb").removeClass("PageFooter");
} else if (currentURL == "/Groups/Page/Register.html") {
replacePageHeader();
// Reduce the group registration page to the basics that are needed
jQuery("h1:eq(2)").remove();
jQuery("textarea").hide();
Expand Down

0 comments on commit 4f1bdcb

Please sign in to comment.