Prettifying and improving the HSG studynet
- Colored Background (and Text) for the courses
- Removing the ID from the Course Tabs - so you can see the actual name
- Download Function
There are 2 VERSIONS in this repository:
- studynet_prettify_core.js With only the first two functions (colored backgrounds and making the tabs readable)
- studynet_prettify_full.js With all functions (including the buggy download one)
The First two features work properly in most major browsers (tested on firefox, safari and chrome) The Experimental download funciton seems to only work on chrome/chromium at the moment.
If you are using Chrome or Safari: Use TamperMonkey
If you are using Firefox: Use GreaseMonkey
Follow the instructions and install it as an extension on your browser.
These programs will allow you to run the code that changes the studynet interface and adds the additional feauters.
First, Download the .js (javascript) file you want/need and open it in a text editor (e.g. notepad, textedit)
-
Click on the tampermonkey icon and select "Add New Script", dont forget to fill in the 'update url'
-
Hit save, and you're good to go
-
Select the tampermonkey extention asd click 'New User script'
-
Paste the code here - Dont forget to type the 'allow pasting' to allow you to paste
You may modify the colours you want to assign to classes. At the very top of the code, you will see some thing like.
There will be multiple comma separated blocks of {curly brackets}, each block corresponds to a course.
NOTE you may add more blocks, but please dont forget the commas between them.
var courseList = [
{
'course': 'Microeconomics',
'bg_color': '#FFCC66',
'text_color':'#000000',
},
...
]
this is called a json (pronounced j-son) array, and it contains the data the program needs to correctly assign the colors. You will note a few things:
on the left side of the colon is a variable, and on the right side is the value - i.e.
variable : value
DO NOT change the variable, only the values, and only in the following way:
{
'course': 'name of the course that you want to apply a color to',
'bg_color': 'the hexadecimal (hex) code of the background color you want',
'text_color': 'the hex code of the text color you want'
}
-
The name doesnt have to be exact, it just has to be a subset of the actual name.
e.g. If we have 'Microeconomics' as our name, it will match all rows with "Microeconomics" in it, including things like "Microeconomics 3" and "Microeconomics Exercises".
-
Capitalization is important
-
Commas are important, make sure your lines end with a comma
In the web, colors are usually represented via hex codes. you can head to Color Picker and just pick the colors you want.
Don't forget the Hashtag (#) at the front of the 6 character code.
The button must be pressed while you're in the course materials page. you will get a zip file with the data.
NOTE here are some quirks:
- you must refresh the site after every course/materials you download
- the course must be in the third tab
- Some file extensions do not appear
- There is no progress bar: depending on the number of links on the website, might take a while (you can check the web console though)
- Does not work in Safari
This still needs debugging and improvement.
Security note: only install scripts you trust, I will not be responsible for any other scripts you install.
--
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.