Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
msramalho committed Dec 23, 2018
2 parents 7fe66e9 + 7e4ea0a commit 756cd3d
Show file tree
Hide file tree
Showing 39 changed files with 45,937 additions and 530 deletions.
232 changes: 167 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,127 @@
<img src="icons/icon-512.png" width="128"/>
</a>
</p>
<h1 align="center"> <strike>SigToCa</strike> SigTools- Sigarra Tools</h1>
<h1 align="center">SigTools- Sigarra Tools</h1>

**Sigarra on Steroids**: export calendar events (timetables, events, book renewal, payments, ...); infinite scroll; export, filter and sort data-tables; statistical analysis on grades; library book renewal; configurable behaviour and more. *SigToCa's heir*

### Install via:
- [Chrome WebStore](https://chrome.google.com/webstore/detail/sigarra-to-calendar/piefgbacnljenipiifjopkfifeljjkme)
- [Firefox Addons](https://addons.mozilla.org/en-US/firefox/addon/sigtools/) Thanks a bunch to [@afonsobspinto](https://github.com/afonsobspinto)
- [Source code](https://developer.chrome.com/extensions/getstarted#unpacked) in this repo
- From [.crx](https://github.com/msramalho/SigTools/blob/master/extra/SigTools.crx) see how [here](https://www.wikihow.com/Add-Blocked-Extensions-in-Google-Chrome) (not necessarily blocked as the link says)
- From [.crx](https://github.com/msramalho/SigTools/releases/) see how [here](https://www.wikihow.com/Add-Blocked-Extensions-in-Google-Chrome)

### Features:
### Features
Most features are customizable and can be turned off in the options page.

#### Timetable Extractor
- Personal schedule
- Teacher schedule, try ... [Ademar](https://sigarra.up.pt/feup/pt/hor_geral.docentes_view?pv_doc_codigo=231081)
- Subject schedule, try ... [RCOM](https://sigarra.up.pt/feup/pt/hor_geral.ucurr_view?pv_ocorrencia_id=399898)
- Any other schedule (from sigarra, not just feup) that respects the major formats found
<p align="center"><img src="https://i.imgur.com/To7F74T.gif" height="300px"></p>

#### Exams Extractor
- Exams page, try ... [MIEIC](https://sigarra.up.pt/feup/pt/exa_geral.mapa_de_exames?p_curso_id=741)
- Any other exams page (from sigarra, not just feup) that respects the major formats found

#### Moodle Extractor
- Hover over a moodle event on the calendar and an option to add to Google Calendar (with One click) becomes available
- Moodle already has functionality to export events in the iCal format [here](https://moodle.up.pt/calendar/export.php)

#### Datatables
Any Sigarra data-table is now:
- exportable (copy-paste, csv, excel, pdf)
- sortable by any column
- searchable by a query box

#### Infinite Scroll
- Any page that has paginated tables now has infinite scroll (example: search for MIEIC students)


### Calendars are exported to
[iCalendar](https://en.wikipedia.org/wiki/ICalendar) *.ics* format which means most applications handle it pretty well:
- [Google Calendar](https://support.google.com/calendar/answer/37118?hl=en)
- [Apple Calendar](https://support.apple.com/guide/calendar/import-or-export-calendars-icl1023/mac)
- IBM Lotus Notes
- Yahoo! Calendar
- Evolution (software)
- eM Client
- Lightning extension for Mozilla Thunderbird and SeaMonkey
- [partially] by Microsoft Outlook and Novell GroupWise
<details>
<summary>Timetable Extractor</summary>
<p>
<ul>
<li>Personal schedule</li>
<li>Teacher schedule, try ... <a href="https://sigarra.up.pt/feup/pt/hor_geral.docentes_view?pv_doc_codigo=231081">Ademar</a></li>
<li>Subject schedule, try ... <a href="(https://sigarra.up.pt/feup/pt/hor_geral.ucurr_view?pv_ocorrencia_id=399898">RCOM</a></li>
<li>Any other schedule (from sigarra, not just feup) that respects the major formats found</li>
</ul>
</p>
</details>

<details>
<summary>Exams Extractor</summary>
<p>
<ul>
<li>Exams page, try ... <a href="https://sigarra.up.pt/feup/pt/exa_geral.mapa_de_exames?p_curso_id=741">MIEIC</a></li>
<li>Any other exams page (from sigarra, not just feup) that respects the major formats found</li>
</ul>
</p>
</details>

### Prints
<details>
<summary>Moodle Extractor</summary>
<p>
<ul>
<li>Hover over a moodle event on the calendar and an option to add to Google Calendar (with One click) becomes available</li>
<li>Moodle already has functionality to export events in the iCal format <a href="https://moodle.up.pt/calendar/export.php">here</a></li>
</ul>
-
-
</p>
</details>

<h3 align="center">TimeTable</h3>
<p align="center">
<img align="center" src="https://i.imgur.com/txYvHyI.png" width="80%" height="80%">
<details>
<summary>Datatables</summary>
<p>
Any Sigarra data-table is now:
<ul>
<li>exportable (copy-paste, csv, excel, pdf)</li>
<li>sortable by any column</li>
<li>searchable by a query box</li>
</ul>
</p>
</details>

<h3 align="center">Exams</h3>
<p align="center">
<img align="center" src="https://i.imgur.com/nIDrtKb.png" width="80%" height="80%">
<details>
<summary>Infinite Scroll</summary>
<p>
<ul>
<li>Any page that has paginated tables now has infinite scroll (example: search for MIEIC students)</li>
</ul>
</p>
</details>

<h3 align="center">Moodle</h3>
<p align="center">
<img align="center" src="https://i.imgur.com/dL5wsY7.png" width="35%" height="35%">
<details>
<summary>Grades</summary>
<p>
<ul>
<li>Every time a teacher releases grades for a subject, you can go to that page and check statistics over your grades and how they compare with the rest of the students.</li>
</ul>
</p>
</details>

<h3 align="center">Datatable</h3>
<p align="center">
<img align="center" src="https://i.imgur.com/OpOzlic.png" width="80%" height="80%">
<details>
<summary>Bills</summary>
<p>
<ul>
<li>If you are fast enough, you can go to your 🏃running 💸account (Conta Corrente) and add those debts with their deadline to your calendar, so you don't forget to pay what you own (pagar o que deves)</li>
</ul>
</p>
</details>

<h3 align="center">Infinite Scroll</h3>
<p align="center">
<img align="center" src="https://i.imgur.com/A5okMWU.png" width="80%" height="80%">
<details>
<summary>Book Renewal</summary>
<p>
<ul>
<li>Never forget to return books again, by going to [catalogo.up.pt](https://catalogo.up.pt) and checking that you are not late on those, as it costs 0.50€ per day...</li>
</ul>
</p>
</details>

<h3 align="center">Grades Statistics</h3>
<p align="center">
<img align="center" src="https://i.imgur.com/55phyYC.png" width="80%" height="80%">


### Exporting Calendar Events
SigTools exports to [iCalendar](https://en.wikipedia.org/wiki/ICalendar) *.ics* format which means most applications handle it pretty well, namely
<details>
<summary>Compatible Calendar Apps</summary>
<p>
<ul>
<li><a href="https://support.google.com/calendar/answer/37118?hl=en">Google Calendar</a></li>
<li><a href="https://support.apple.com/guide/calendar/import-or-export-calendars-icl1023/mac">Apple Calendar</a></li>
<li>IBM Lotus Notes</li>
<li>Yahoo! Calendar</li>
<li>Evolution (software)</li>
<li>eM Client</li>
<li>Lightning extension for Mozilla Thunderbird and SeaMonkey</li>
<li>[partially] by Microsoft Outlook and Novell GroupWise</li>
</ul>
</p>
</details>


### Performance
It was developed to be as non-intrusive as possible, requires no permission, only executes processes when it needs to and all the scripts are loaded after the pages are ready so as to minimize any interface performance impact!

A thanks to... [ics.js](https://github.com/nwcell/ics.js) | [FileSaver.js](https://github.com/eligrey/FileSaver.js) | [Blob.js](https://github.com/eligrey/Blob.js) | [mustache](https://github.com/janl/mustache.js/) | [chart.js](https://github.com/chartjs/Chart.js) | [math.js](https://github.com/josdejong/mathjs/) for saving us a lot of time!


# Contribute to SigTools
You can contribute by:
Expand All @@ -97,6 +132,11 @@ You can contribute by:
- Adding more [modules/extractors](https://github.com/msramalho/SigTools/tree/master/js/extractors) each module should address a different calendar need
- Sharing this Extension

<details>
<summary>Contribution guide</summary>
<p>


## Code structure
* `extractors` for all the scripts that extract information from a page and act accordingly
* `lib` for external scripts
Expand All @@ -122,6 +162,8 @@ class NewExtractor extends Extractor{
// belong to the class definition should follow the above line
...
```
By default, each extractor that inherits from `Extractor` already has the `storage.boolean.apply` and `storage.text.exclude_urls_csv` options.

The `structure()` method should return an object that describes the extractor, following this stub:
```javascript
{
Expand Down Expand Up @@ -155,6 +197,54 @@ The `structure()` method should return an object that describes the extractor, f
}
}
```
After developing a new extractor, it should be added to the [options.html](options.html) page as `<script src="js/extractors/NAME.js"></script>` next to the ones already there.

<!-- same for tests and <script></script> -->

### Tests
Testing a browser extension is hard. Nonetheless, we try. Tests are located in the [tests](tests/) folder and we use [mocha](https://mochajs.org/) and [chai](https://www.chaijs.com/) along with some [improvised magic](tests/setup.js).

To run tests open the [tests.html](tests.html) file on the browser, this was the only way as chrome extensions cannot be fully developed as ES6 modules, as of now. This system works fairly well.

To create a new test, check the previous ones. If you need to load html as the current jquery context (you will for evey test with jquery selectors) you can do:
```javascript
describe('what the test is about', function() {
it('should return some results', function(done) {
updatejQueryContext("new_context.html").then(() => {
// your tests
done()
}).catch(done)
})
})
```
or, for the context to be global:

```javascript
describe('what the test is about', function() {
before(() => {
return new Promise((resolve)=>{
updatejQueryContext("new_context.html").then(resolve)
})
})
it('should return some results', function(done) {
// your tests
})
})
describe(...
```
After developing a new test, it should be added to the [options.html](options.html) page as `<script src="test/extractors/NAME.js"></script>` next to the ones already there.
</p>
</details>
### Credits
A thanks to... [ics.js](https://github.com/nwcell/ics.js) | [FileSaver.js](https://github.com/eligrey/FileSaver.js) | [Blob.js](https://github.com/eligrey/Blob.js) | [mustache](https://github.com/janl/mustache.js/) | [chart.js](https://github.com/chartjs/Chart.js) | [math.js](https://github.com/josdejong/mathjs/) for saving us a lot of time!
Credits to [Paomedia](https://www.iconfinder.com/icons/285665/calendar_icon) for the flat calendar icon! ![](icons/calendar.svg)
# Changelog
- V1.0
Expand Down Expand Up @@ -184,11 +274,23 @@ The `structure()` method should return an object that describes the extractor, f
- .1 - bug fix in overlapping classes
- V2.0
- ~SigToCa~ -> SigTools
- complete refactor
- each extractor describes itself
- options page is dynamic and varies according to extractors
- simplified manifest
- better organization of scripts into folders
- started using [mustache](https://github.com/janl/mustache.js/) templates
- options page
- changelog page when installed or updated
- Complete refactor
- Each extractor describes itself
- Options page is dynamic and varies according to extractors
- Simplified manifest
- Better organization of scripts into folders
- Started using [mustache](https://github.com/janl/mustache.js/) templates
- Options page
- Changelog page when installed or updated
- V3.0
- Improved Readme and contribution instructions
- Started Unit Testing
- Fixed UI bugs
- Fixed non-minified JS files for mozilla chrome extension
- Moodle 2019 is alive
- Erasmus Datatables are working
- Every extractor has "exclude pages" for custom pages where you don't want it
- Every extractor has "apply" setting by default (boolean defaults to true)
- Improved Contribution guidelines (extractors, tests, ...)
- Mozilla problem with minified files
44 changes: 36 additions & 8 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script src="js/lib/jquery.min.js"></script>
<script src="js/lib/bootstrap.min.js"></script>

<title>See what is new in SigTools <span class="version"></span></title>
<title>SigTools Changelog</title>

</head>

Expand All @@ -20,7 +20,7 @@
<div class="d-flex h-100 p-3 mx-auto flex-column">
<main role="main" class="inner cover">
<h1 class="cover-heading">SigTools</h1>
<h5>See what is new in <span class="version"></span></h5>
<h5><span class="version"></span> features</h5>
</main>

<div id="changelogCarousel" class="carousel slide" data-ride="carousel">
Expand All @@ -34,9 +34,36 @@ <h5>See what is new in <span class="version"></span></h5>
<li data-target="#changelogCarousel" data-slide-to="6"></li>
<li data-target="#changelogCarousel" data-slide-to="7"></li>
<li data-target="#changelogCarousel" data-slide-to="8"></li>
<li data-target="#changelogCarousel" data-slide-to="9"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="d-block" style="width:800px;height:400px;background:#f1f1f1;color:black;padding:35px;">
<h3>Some interesting updates</h3>
<ul style="text-align:left;padding-left:100px;padding-right:100px;">
<li>[Global] each extractor can have "excluded pages"</li>
<li>[Erasmus] now has datatables</li>
<li>[Moodle] The new version of Moodle is supported</li>
<li>[Development] Unit Tests for the extractors have begun</li>
<li>[Contributing] More readable instructions for contributing</li>
<li>[Bills] use default date as today when none is present</li>
<li>[Mozilla Add-ons] Back to being compliant with the non-minification rule</li>
<li>Other front and backend bugs fixed</li>
</ul>
</div>
<div class="carousel-caption d-none d-md-block">
<h5></h5>
<p></p>
</div>
</div>
<div class="carousel-item" id="christmas_message">
<img class="d-block w-100" src="icons/icon-christmas.png">
<div class="carousel-caption d-none d-md-block" style="color: white">
<h5>We wish you Happy Holidays</h5>
<p>🔥Enjoy the time of the semester when you can put some fires out (and watch other start)🔥</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://i.imgur.com/55phyYC.png">
<div class="carousel-caption d-none d-md-block">
<h5>Grade Statistical Analysis</h5>
Expand Down Expand Up @@ -101,13 +128,13 @@ <h5>Moodle</h5>
</div>
</div>
<a class="carousel-control-prev" href="#changelogCarousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#changelogCarousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>

<footer class="mt-auto">
Expand All @@ -120,4 +147,5 @@ <h5>Moodle</h5>
</body>

<script src="js/scripts/changelog.js"></script>

</html>

0 comments on commit 756cd3d

Please sign in to comment.