QuitFirefoxAtTime

From ProgClub
Revision as of 02:38, 9 April 2016 by Jevan (talk | contribs) (→‎Done)
Jump to: navigation, search

QuitFirefoxAtTime is the ProgClub Firefox extension which will close your current tab after a timeout. For other projects see projects.

Status

Version 0.1.4 released! With nothing TODO.

Motivation

This software allows you to have a browser tab closed automatically after a timeout (in Firefox). It was particularly created so you could set up a YouTube play-list and go to bed knowing it wouldn't play all night.

Administration

Contributors

Members who have contributed to this project. Newest on top.

All contributors have agreed to the terms of the Contributor License Agreement. This excludes any upstream contributors who tend to have different administrative frameworks.

Copyright

Copyright 2016, Contributors.

License

Licensed under the MIT license.

Components

We use a timer icon by Nut Chanut. Thanks Nut!

Resources

Downloads

You can download the latest installer here: quitfirefoxattime-0.1.4.xpi.

Source code

The repository can be browsed online:

https://www.progclub.org/pcrepo/quit-firefox-at-time/branches/0.1

The latest stable released version of the code will be available from:

https://www.progclub.org/svn/pcrepo/quit-firefox-at-time/tags/latest/0.1

Or if you want the latest version for development purposes:

https://www.progclub.org/svn/pcrepo/quit-firefox-at-time/branches/0.1

Links

Specifications

Functional specification

The functional specification describes what the project does.

The project is a Firefox extension that allows you to automatically close the current tab after a number of minutes.

When the Firefox extension (XPI) is installed there is a timer button added to the toolbar.

Clicking the timer button brings up the dialog box that controls our extension. When clicked a dialog appears with:

  1. An input box for the number of minutes to wait before closing the current tab
  2. A Start Timer button, to start the count-down
  3. A Stop Timer button, to stop the count-down
  4. A Hide button, to hide the dialog
  5. A status message showing the time remaining for the count-down

If the tab to be closed is closed while a count-down is running the count-down is canceled.

Technical specification

The technical specification describes how the project works.

The main code for the extension is in index.js. In index.js a panel is created which responds to the following messages: show, hide, startTimer, stopTimer. The panel HTML is defined in data/text-entry.html and the panel script is defined in data/get-text.js.

When the timer is started (startTimer occurs), a timer interval is defined which triggers a function every second to send a message from index.js called "updateMilliseconds" to the panel's internal javascript in get-text.js which updates the timer countdown display. The triggered function also checks if the millisecondsRemaining is less than or equal to zero and if it is then it closes the initial tab whose object was remembered when the timer start occurred. If the tab is closed, it triggers a function to clear the timer interval so that the timer will no longer countdown or trigger. Clicking "Start Timer" (which can also be used to reset the timer) will re-enable the countdown again and set the "initialTab" variable to remember the current tab as the one to be closed.

There is some CSS in text-entry.html which prevents the UI from displaying an up/down button for the number of minutes, which can have a decimal point such as "1.3" or "0.2" minutes.

The XPI file is created by jpm which is installed by npm. See README.md for details.

Notes

Notes for implementers

If you are interested in incorporating this software into your project, here's what you need to know:

Copy and paste your way to victory! See notes for developers for packaging instructions.

Installation instructions are in the README file.

Notes for developers

If you're looking to set up a development environment for this project here's what you need to know:

svn co https://www.progclub.org/svn/pcrepo/quit-firefox-at-time/branches/0.1/ \
  quit-firefox-at-time-0.1

See the README.md file for instructions for packaging/testing on Linux and/or Windows.

Doing a release

Note: version numbers are in the format MAJOR.MINOR.REVISION. Odd revision numbers are development revisions, they do not get released; even revision numbers are release revisions, which do. When doing a release you bump the revision number when you start, from an odd revision to an even revision, then you do your release, then you start the next development revision by bumping the revision number from even to odd.

To do a release:

  1. Edit package.json and bump the version revision number
    • e.g. "0.1.3" to "0.1.4".
  2. Generate the new xpi:
    • $ jpm xpi
  3. svn rm the previous xpi, e.g.:
    • $ svn rm @quitfirefoxattime-0.1.3.xpi@
    • (note the extra @ symbol at the end of the file name, this is required by svn)
  4. svn add the new xpi, e.g.:
    • $ svn add @quitfirefoxattime-0.1.4.xpi@
    • (again the extra @ character at the end of the file name)
  5. svn commit:
    • $ svn ci -m 'Preparing for 0.1.4 release...'
  6. Release:
    • $ pcrepo-branch-release quit-firefox-at-time 0.1 4
    • i.e. pcrepo-branch-release PROJECT MAJOR.MINOR REVISION
  7. Edit package.json and bump the version revision number (again)
    • e.g. "0.1.4" to "0.1.5".
  8. Edit this page to refer to the latest version

Tasks

TODO

Things to do, in rough order of priority:

N/A. This project is done! If you have any ideas for features we should add come over and tell us on the mailing list!

Done

Stuff that's done. Latest stuff on top.

  • JP 2016-04-09: released version 0.1.4
  • JP 2016-04-09: negative time numbers countdown display after countdown finished replaced with text message
  • JE 2016-04-08: released version 0.1.3
  • JE 2016-04-08: workaround for blank dialog after first close bug
  • JE 2016-04-08: updated the technical specification (how it works)
  • JP 2016-04-08: closes tab that was active when the start timer button was pressed
  • JP 2016-04-08: got rid of up/down buttons on minutes input
  • JP 2016-04-08: allow decimal minutes, e.g. 0.1 minutes is 6 seconds
  • JP 2016-04-08: if tab is closed timer is canceled
  • JE 2016-04-08: explain how to update/package the xpi file
  • JP 2016-04-08: stop timer button next to start timer
  • JP 2016-04-08: show countdown in hours:minutes:seconds
  • JP 2016-04-08: closes current tab rather than all windows
  • JP 2016-04-08: made input box smaller
  • JP 2016-04-08: enter minutes instead of date
  • JP 2016-04-08: changed version to 0.1.2
  • JE 2016-04-03: added notes for implementers
  • JE 2016-04-03: created project page
  • JP 2016-04-02: version 0.0.1