70 | 71 | 72 | 73 | 74 |
├── docs ├── CNAME ├── feedback │ ├── logo.png │ ├── style.css │ └── index.html └── textbooks │ ├── logo.png │ ├── Acorn_white_128.png │ ├── style.css │ ├── index.html │ └── textbooks.js ├── images ├── logo.png ├── Acorn_16.png ├── Acorn_48.png ├── Acorn_128.png ├── Acorn_red_128.png ├── Acorn_red_16.png ├── Acorn_red_48.png └── Acorn_white_128.png ├── firefox-extras.json ├── src ├── contentscripts │ ├── purge.js │ ├── textbookLinker.js │ ├── infiniteScroll.js │ ├── contentScript.js │ ├── util.js │ ├── background.js │ ├── tooltip.js │ └── google.js ├── popup │ ├── popup.css │ ├── popup.html │ └── popup.js ├── settings │ ├── settings.css │ ├── settings.js │ └── settings.html ├── util │ └── updateState.js └── about │ └── index.html ├── firefox-zip.sh ├── firefox.sh ├── Makefile ├── LICENSE ├── dependencies └── tippy │ ├── light.css │ └── tippy.all.min.js ├── manifest.json ├── README.md └── data └── discounttb.json /docs/CNAME: -------------------------------------------------------------------------------- 1 | courseinfo.murad-akh.ca -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuradAkh/UofTCourseInfo/HEAD/images/logo.png -------------------------------------------------------------------------------- /images/Acorn_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuradAkh/UofTCourseInfo/HEAD/images/Acorn_16.png -------------------------------------------------------------------------------- /images/Acorn_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuradAkh/UofTCourseInfo/HEAD/images/Acorn_48.png -------------------------------------------------------------------------------- /docs/feedback/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuradAkh/UofTCourseInfo/HEAD/docs/feedback/logo.png -------------------------------------------------------------------------------- /images/Acorn_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuradAkh/UofTCourseInfo/HEAD/images/Acorn_128.png -------------------------------------------------------------------------------- /docs/textbooks/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuradAkh/UofTCourseInfo/HEAD/docs/textbooks/logo.png -------------------------------------------------------------------------------- /images/Acorn_red_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuradAkh/UofTCourseInfo/HEAD/images/Acorn_red_128.png -------------------------------------------------------------------------------- /images/Acorn_red_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuradAkh/UofTCourseInfo/HEAD/images/Acorn_red_16.png -------------------------------------------------------------------------------- /images/Acorn_red_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuradAkh/UofTCourseInfo/HEAD/images/Acorn_red_48.png -------------------------------------------------------------------------------- /images/Acorn_white_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuradAkh/UofTCourseInfo/HEAD/images/Acorn_white_128.png -------------------------------------------------------------------------------- /docs/textbooks/Acorn_white_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuradAkh/UofTCourseInfo/HEAD/docs/textbooks/Acorn_white_128.png -------------------------------------------------------------------------------- /firefox-extras.json: -------------------------------------------------------------------------------- 1 | { 2 | "options_ui": { 3 | "page": "src/settings/settings.html", 4 | "open_in_tab": true 5 | } 6 | } -------------------------------------------------------------------------------- /src/contentscripts/purge.js: -------------------------------------------------------------------------------- 1 | $(document).ready(() => { 2 | $('.corInf').each(function () { 3 | $(this).replaceWith($(this).data('title')); 4 | }) 5 | }); -------------------------------------------------------------------------------- /firefox-zip.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | cd ./firefox-compiled 3 | zip -r -1 firefox.zip ./data ./images ./dependencies ./src README.md ./manifest.json 4 | cd .. 5 | cp ./firefox-compiled/firefox.zip . 6 | -------------------------------------------------------------------------------- /src/popup/popup.css: -------------------------------------------------------------------------------- 1 | html{ 2 | min-width: 300px; 3 | } 4 | 5 | #icon{ 6 | max-height: 20px; 7 | } 8 | 9 | #title{ 10 | color: #11245D; !important; 11 | } 12 | 13 | #feedback-link{ 14 | color: mediumvioletred; 15 | } -------------------------------------------------------------------------------- /src/contentscripts/textbookLinker.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | $('#settings-link').attr('href', getSettingsUrl()); 3 | $('#about-link').attr('href', getAboutUrl()); 4 | $('.installed').removeAttr('hidden'); 5 | $('.not-installed').attr('hidden', ''); 6 | }); -------------------------------------------------------------------------------- /docs/feedback/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | height: 100vh; 3 | overflow: hidden; 4 | align-items: center; 5 | justify-content: center; 6 | flex-direction: column; 7 | background-color: #fcfcfc; 8 | margin: 0; 9 | display: flex; 10 | } 11 | 12 | div{ 13 | display: block; 14 | } -------------------------------------------------------------------------------- /firefox.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # remove old "binaries" 3 | rm -rf ./firefox-compiled > /dev/null # ignore the warning 4 | 5 | # make compiled dir 6 | mkdir ./firefox-compiled 7 | 8 | cp -r ./data ./images ./dependencies ./src ./README.md ./firefox-compiled 9 | 10 | # filter the manifest requires jq 11 | # will add firefox extras and remove stuff only needed for chrome 12 | jq -s add ./manifest.json ./firefox-extras.json | jq 'del(.key, .update_url, .options_page)'> ./firefox-compiled/manifest.json 13 | 14 | 15 | #rm -rf ./firefox-compiled -------------------------------------------------------------------------------- /src/contentscripts/infiniteScroll.js: -------------------------------------------------------------------------------- 1 | function onElementHeightChange(elm, callback){ 2 | let lastHeight = elm.clientHeight, newHeight; 3 | (function run(){ 4 | newHeight = elm.clientHeight; 5 | if( lastHeight !== newHeight ) 6 | callback(); 7 | lastHeight = newHeight; 8 | 9 | if( elm.onElementHeightChangeTimer ) 10 | clearTimeout(elm.onElementHeightChangeTimer); 11 | 12 | elm.onElementHeightChangeTimer = setTimeout(run, 2500); 13 | })(); 14 | } 15 | 16 | onElementHeightChange(document.body, () => { 17 | findCourses(); 18 | generateTooltips(); 19 | }); -------------------------------------------------------------------------------- /src/settings/settings.css: -------------------------------------------------------------------------------- 1 | 2 | .form-background { 3 | background-color: #f2f3f8; 4 | border-radius: 5px; 5 | padding: 25px; 6 | font-family: 'Open Sans',sans-serif; 7 | } 8 | 9 | .settings-header {} 10 | /* Adjust aesthetics of the h3 elements in settings box. */ 11 | 12 | .btn-primary { 13 | background-color: #3172b7; 14 | border: 0; 15 | } 16 | 17 | .btn-primary:hover { 18 | background-color: #0E5BAC; 19 | } 20 | 21 | .navbar { 22 | background-color: #11245D; 23 | } 24 | 25 | #logo { 26 | max-height: 35px; 27 | padding-right: 10px; 28 | } 29 | 30 | #form { 31 | width: 45%; 32 | } -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | FILES= $(shell find src -type f) $(shell find data -type f) $(shell find dependencies -type f) $(shell find images -type f) 2 | FIREFOX_FILES= $(shell find firefox-compiled -type f) 3 | 4 | all: chrome.zip firefox.zip 5 | 6 | # Package for chrome 7 | chrome.zip: manifest.json README.md $(FILES) 8 | zip -r $@ ./data ./images ./dependencies ./src manifest.json README.md 9 | 10 | # Convert to firefox 11 | firefox-compiled: manifest.json README.md $(FILES) 12 | sh firefox.sh 13 | 14 | # zip converted 15 | firefox.zip: firefox-compiled $(FIREFOX_FILES) 16 | sh firefox-zip.sh 17 | 18 | #firefox.xpi: firefox.zip 19 | # cp $^ $@ 20 | 21 | clean: 22 | rm -f chrome.zip firefox.zip 23 | rm -rf ./firefox-compiled -------------------------------------------------------------------------------- /docs/feedback/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
12 |
UofT Course
13 | Info
13 |
14 |
15 |
16 |
17 |

26 |
27 | Any external libraries included in the code are covered by their respective licenses.
28 | Unless otherwise specified, any code included with the extension is covered by the MIT License.
29 |
30 | ANY FILES IN ./dependencies DIRECTORY ARE NOT COVERED BY THE PROJECT LICENSE
31 |
32 | ## Acknowledgements
33 |
34 | UofT Cobalt API - made creating the extension easy (Used in the earlier versions of the extension)
35 |
36 | UofT Nikel API - for brining back open data to uoft!
37 |
38 | Aniket Kali - web design help for settings, textbooks page, and about page
39 |
40 | Reddit user /u/mycrookedmouth - icon redesign
41 |
--------------------------------------------------------------------------------
/src/settings/settings.js:
--------------------------------------------------------------------------------
1 | $(document).ready(() => {
2 | // Standard Google Universal Analytics code
3 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
5 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); // Note: https protocol here
7 |
8 | ga('create', 'UA-140776274-1\n', 'auto'); // Enter your GA identifier
9 | ga('set', 'checkProtocolTask', function(){}); // Removes failing protocol check. @see: http://stackoverflow.com/a/22152353/1958200
10 | ga('require', 'displayfeatures');
11 | ga('send', 'pageview', '/setting.html');
12 |
13 | chrome.storage.local.get({
14 | // size: 'medium',
15 | link: 'website',
16 | breadths: true,
17 | highlight: false,
18 | prereq: true,
19 | inst: true,
20 | sess: true,
21 | descript: true,
22 | gsearch: true,
23 | maxtt: 1000,
24 | illegal: '',
25 | globoption: true
26 |
27 | }, items => {
28 | // $('#size').val(items.size);
29 | $('#link').val(items.link);
30 | $('#breadths').prop('checked', items.breadths);
31 | $('#highlight').prop('checked', items.highlight);
32 | $('#prerequisites').prop('checked', items.prereq);
33 | $('#sessions').prop('checked', items.sess);
34 | $('#gsearch').prop('checked', items.gsearch);
35 | $('#maxtt').val(items.maxtt);
36 | $('#instructors').prop('checked', items.inst);
37 | $('#description').prop('checked', items.descript);
38 | $('#enablepops').prop('checked', items.globoption);
39 | $('#illegal').val(items.illegal);
40 | });
41 |
42 | $('input').change(apply);
43 | $('select').change(apply);
44 | $('#enablepops').change(() => {
45 | if ($("#enablepops").is(":checked")) chrome.browserAction.setIcon(on);
46 | else chrome.browserAction.setIcon(off);
47 | updateTabs()
48 | });
49 |
50 | // $('#apply').click(function () {
51 | // apply();
52 | //
53 | // alert("UofT Course Info: Settings applied successfully");
54 | // });
55 |
56 | function apply() {
57 | ga('send', 'event', {
58 | 'eventCategory': "Settings",
59 | 'eventAction': "Applied",
60 | });
61 |
62 | chrome.storage.local.set({
63 | link: $('#link').val(),
64 | // size: $('#size').val(),
65 | breadths: $('#breadths').prop('checked'),
66 | highlight: $('#highlight').prop('checked'),
67 | prereq: $('#prerequisites').prop('checked'),
68 | inst: $('#instructors').prop('checked'),
69 | sess: $('#sessions').prop('checked'),
70 | gsearch: $('#gsearch').prop('checked'),
71 | maxtt: $('#maxtt').val(),
72 | descript: $('#description').prop('checked'),
73 | illegal: $('#illegal').val(),
74 | globoption: $('#enablepops').prop('checked'),
75 | });
76 | }
77 | });
--------------------------------------------------------------------------------
/docs/textbooks/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Source code is available on my Github
47 |If you are interested in getting involved in this or a similar project, consider joining UofT.dev
49 |NOT AFFILIATED WITH THE UNIVERSITY OF TORONTO
50 | 51 |52 | Data for courses is provided by Cobalt API. Discount Textbook Store data 53 | was scrapped from a pdf file available on their website. Department website links were scrapped from UofT 54 | directory. 55 |
56 | 57 |58 | Check out my webpage if you want to see more of my stuff or get in touch. 59 | If you are on Android, consider giving 60 | T Map (For UofT) a shot! 61 |
62 | 63 |
64 | Community contributions:
65 | Aniket Kali - bootstrap
66 | Reddit user /u/mycrookedmouth - icon redesign
67 |
70 | Any external libraries included in the code are covered by their respective licenses.
71 | Unless otherwise specified, any code included with the extension is covered by the license below.
72 |
LICENSE
75 |MIT License
76 | 77 |Copyright (c) 2017-2018 Murad Akhundov
78 | 79 |Permission is hereby granted, free of charge, to any person obtaining a copy 80 | of this software and associated documentation files (the "Software"), to deal 81 | in the Software without restriction, including without limitation the rights 82 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 83 | copies of the Software, and to permit persons to whom the Software is 84 | furnished to do so, subject to the following conditions:
85 | 86 |The above copyright notice and this permission notice shall be included in all 87 | copies or substantial portions of the Software.
88 | 89 |THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 90 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 91 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 92 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 93 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 94 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 95 | SOFTWARE. 96 |
97 | 98 |