Continuing Work on a Chrome Extension

For my internal PR for release 0.3, I added step by step instructions to the Seneca Blackboard extension on how to install it for users. Before, there were only instructions for developers. Now there are instructions for users which are easy to understand and don’t have any complicated stuff with cloning and npm and building or anything like that. Obviously, it’s not as user friendly as just putting it on the Chrome Web Store, but our extension isn’t finished yet. When it is, or at least good enough, we’ll probably put it on the Chrome Web Store.

PR: https://github.com/yevseytsev/SenecaBlackboardExtension/pull/55

I feel like work on this extension is about to get a lot harder. The easy code involves removing useless parts of the website, which only requires a few lines in JavaScript to get the ID of the useless module, and remove it. The extension is planned to change how existing, but not-optimal modules look by rearranging things and maybe changing the font size, type, and color. Those will require more detailed and complex code. Having worked with HTML and CSS and JavaScript before, I can make a decent guess as to what it will involve: Selecting the module with JavaScript, then altering the CSS of everything which is inside the module. I probably won’t make the first steps into that, but instead will contribute after someone else has made a working first step, so I have a template to work off of instead of coming up with everything on my own.

One big challenge will be reorganizing the announcements module. Right now, the announcements module has Student News at the top, which is useless.

diagramofbad.png

We plan to either remove those entirely, or move them to the bottom of the list, while moving course annoucements up in the list. However, this is quite challenging, as each line in the announcements module is just stacked on top of each other, instead of belonging to a sub-module for each catagory.diagramofhtml

As shown in the screenshot, each line is just put in the correct order, with the catagory followed by a list of news. The catagory ends when another catagory begins, or when it reaches the bottom of the list. Since there’s no way to tell what catagory any given line belongs to, it will be difficult to choose which lines to remove.

Currently, I’m thinking of reading all the lines (including the catagories) into an array, removing the line from the HTML page, then using the following psuedocode to re-add only the course news:

arrayOfLines = HTML.getAllAnnouncements();
HTML.removeAllAnnoucements
//arrayOfLines preview: ['Full Time Student News', 
//'King Campus, november rec events, ...etc and so on]

boolean badLine = true;
for (each element in arrayOfLines){
    if (arrayOfLines[i] != 'Full Time Student News' &&
        arrayOfLines[i] != 'Student News' &&
        arrayOfLines[i] != 'annDetail' &&)
    badLine = false;

    if (!badLine){
        HTML.reAddAnnouncement(arrayOfLines[i]);
    }
}

Some even harder tasks would be reorganizing the course news by date, showing the date of the annoucements, and marking certain news as read so it doesn’t appear anymore. I have no idea how we would do that since we would have to get data from other webpages, so I’m hoping someone else does it.

 

One thought on “Continuing Work on a Chrome Extension

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s