Creating Patches

Feel free to add stuff to this page.

Development Environment

First of all you need to create a development environment.

Get a proper subversion client.

Create a new Firefox Profile.
Go to it's extension directory and either:

  • checkout the trunk directly into it.
  • checkout the trunk somewhere else, Create a new file with the name dta@downthemall.net within Profile\extensions and put the path to your extension folder inside, e.g. C:\downthemall-dev\trunk\ or ~/extensions/downthemall-trunk.

Start Firefox and you should see DownThemAll in the Add-Ons list.

Coding conventions and information

  • Try to write code that is as simple as possible
  • Style like so:
    if (something != anotherthing) {
    <tab>doSomeThing(1, 'string', something[i], anotherthing.prop);
    }
    else {
    <tab>...
    }
    try {
    <tab>...
    }
    catch (ex) {
    <tab>...
    }
    
  • Always use brackets for blocks, even if the block is just a single expression.
  • Try not to reinvent the wheel, seach dev.mo and mxr.mo first. See overlay/internalFunctions.js
  • Do not use compiled languages (which comes down to C/C++).
  • Be careful with overlayFunctions.js. Do NOT add anything that might affect the general browser, as these functions are meant to be save for inclusion in overlays.
  • Everything must be localizable. Add a default localization yourself.
  • If you're going to implement new features or something else with a high impact then check back with the official developers first. Otherwise you might have spend much work on something that is not included.
    Best would be to use the DevTalk forums.

Creating a patch file

Once you developed and tested(!) a feature or bugfix create a patch for all files.
See you subversion client documentation on details.

Examples:

  • Subversion command line client:
    svn diff chrome/content/manager.js > patchfile.diff
    
  • TortoiseSVN: Select the directories and/or files and use Create Patch from the Tortoise menu.
  • Subclipse: Select the directory and/or file from the Navigator and use Create Patch from the Team context menu.

View the resulting patch file with a text-viewer of your choice and verify that everything is there and nothing went in that shouldn't be there.

Then go to this bug-tracker and search the corresponding ticket. If there isn't any yet then create a new one.
Attach the patch to the ticket and don't forget to comment on what the patch includes/changes.

Please note that we can only accept patches in form of code donations, i.e. you sign over the copyrights to us.
This is to avoid problems when it comes to (re-)licensing.
Big time contributers will however get honorable mentioned or even invited to join the official developer team.

General

Tools