Skip to content

Commit

Permalink
Merge pull request #2 from ejunga/dev
Browse files Browse the repository at this point in the history
Push changes to main
  • Loading branch information
ejunga authored Nov 12, 2024
2 parents f783661 + de68491 commit 68ba2d7
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tdx-enhanced.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name tdx-enhanced-student
// @namespace ecn
// @version 2024-10-24-01
// @version 2024-11-12-01
// @description enhanced tdx coloring & formatting. follows system color scheme.
// @author Purdue STEM IT - it@purdue.edu
// @match https://service.purdue.edu/TDNext/*
Expand Down Expand Up @@ -131,6 +131,17 @@
highlightReportHeadings();
}

function betterSearch() {
var searchText = document.querySelector('#txtItemIDLookup').value.trim();
var isInteger = /^\d*$/.test(searchText);
if (isInteger && searchText.length > 0) {
window.open('/TDNext/Apps/Search/LookupItem?searchText=' + encodeURIComponent(searchText), '_blank');
} else if (false === false){
TeamDynamix.osjs.openApp('appSearch', 'Search', '/TDNext/Apps/Shared/Global/Search?searchText=' + encodeURIComponent(searchText));
$('#txtItemIDLookup').val('')
}
}

let colorScheme

/* BEGIN FUNCTIONS */
Expand Down Expand Up @@ -658,6 +669,11 @@
injectOtherStyles(frame)
});
}

let searchButton = document.getElementById("btnSearch");
if (searchButton) {
searchButton.onclick = betterSearch;
}
});
});

Expand Down

0 comments on commit 68ba2d7

Please sign in to comment.