Labs/Ubiquity/Ubiquity 0.1 Development Tutorial: Difference between revisions

outdated info correction
(→‎Installing the Source Version of the Extension: edited profile parameter syntax to reflect recent change)
(outdated info correction)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''Note: these instructions cover development through current versions of Ubiquity, including versions 0.5.x.'''
If you just want to write new commands for Ubiquity, you should read [https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial the Command Author Tutorial] instead.  This page is about how to do development on the Ubiquity core.
If you just want to write new commands for Ubiquity, you should read [https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial the Command Author Tutorial] instead.  This page is about how to do development on the Ubiquity core.


Line 25: Line 27:
Uninstall your current version of Ubiquity from your Firefox Addons and then run:
Uninstall your current version of Ubiquity from your Firefox Addons and then run:


   python manage.py install
   python manage.py install --profile=<profile name>
 
(Replace <profile name> with the name of the profile into which you prefer to install the extension.)


This will generate a new build of the Ubiquity extension from the source checkout and install it with your local Firefox instance.
If you haven't created any profiles, then the profile you are using is called 'default'.  To install Ubiquity into the default profile, do this:


If you have a separate profile that you'd prefer to install the
  python manage.py install --profile=default
extension under, such as 'testing', you can add that as an optional
parameter:


  python manage.py install --profile=testing
This will generate a new build of the Ubiquity extension from the source checkout and install it with your local Firefox instance.


Now you are all set to become a pro Ubiquity hacker!
Now you are all set to become a pro Ubiquity hacker!
Line 46: Line 48:


== Building an XPI ==
== Building an XPI ==
You generally won't need to build an XPI when doing development, unless you're working on a final version intended for release to end-users.


To build an XPI for Ubiquity, just run:
To build an XPI for Ubiquity, just run:
Line 54: Line 58:
"<version>" is taken from the contents of the "em:version" element in the
"<version>" is taken from the contents of the "em:version" element in the
"ubiquity/install.rdf" file.
"ubiquity/install.rdf" file.
You generally won't need to build an XPI when doing development, unless you're working on a final version intended for release to end-users.


= Development =
= Development =
Line 63: Line 65:
(TODO: find a style guide for HTML + CSS)
(TODO: find a style guide for HTML + CSS)


The heart of the code can be found in the subdirectory:
The heart of the code can be found in the subdirectories:


  ubiquity/modules/ 
   ubiquity/chrome/content/
   ubiquity/chrome/content/


To get started, you may want to first take a look at the built-in commands and built-in noun types, which are in the files:
To get started, you may want to first take a look at the built-in and standard commands, which are in the files:


   ubiquity/builtin-feeds/en/builtincmds.js
   ubiquity/builtin-feeds/builtincmds.js
   ubiquity/feed-parts/header/en/nountypes.js
   ubiquity/standard-feeds/*.js
  ubiquity/standard-feeds/*.xhtml


These files are dynamically loaded, so if you make any changes to them, all you have to do is save the file, then go back to Firefox and hit alt-space to bring up Ubiquity again.  Your changes will be reflected immediately.  There's no need to rebuild your extension or restart Firefox.
The feeds are dynamically loaded, so if you make any changes to them, all you have to do is save the file, then go back to Firefox and bring up Ubiquity again.  Your changes will be reflected immediately.  There's no need to rebuild your extension or restart Firefox.


If you make changes to other files -- parts of the core, such as the parser, that are not dynamically loaded -- you will have to restart Firefox.  Even in this case, there is no need for you to keep on rebuilding your extension.  Once you've run python manage.py for the first time to install the extension, as described above, you shouldn't need to run it again.  Just save the source file and restart Firefox and whatever changes you've made will be reflected in Ubiquity.
If you make changes to other files -- parts of the core such as the parser or built-in nountypes, that are not dynamically loaded -- you will have to restart Firefox.  Even in this case, there is no need for you to keep on rebuilding your extension.  Once you've run python manage.py for the first time to install the extension, as described above, you shouldn't need to run it again.  Just save the source file and restart Firefox and whatever changes you've made will be reflected in Ubiquity.


== Don't Forget to Test ==
== Don't Forget to Test ==
Line 103: Line 107:
We use [http://wiki.mozilla.org/index.php?Ubiquity this Wiki] and [http://getsatisfaction.com/mozilla/products/mozilla_ubiquity GetSatisfaction] as places to get feature requests and bug reports. These feed into an internal Trac-based [https://ubiquity.mozilla.com/trac/report/1 ticketing system].
We use [http://wiki.mozilla.org/index.php?Ubiquity this Wiki] and [http://getsatisfaction.com/mozilla/products/mozilla_ubiquity GetSatisfaction] as places to get feature requests and bug reports. These feed into an internal Trac-based [https://ubiquity.mozilla.com/trac/report/1 ticketing system].


Login to [https://ubiquity.mozilla.com/trac/report/1 the Trac] using an OpenID account. Look for unassigned tickets (these are the ones that say "New" in the status column as opposed to "Assigned").  Check out what needs to be done, add things appropriately, choose unassigned tickets and start hacking!
Login to [https://ubiquity.mozilla.com/trac/report/1 the Trac] using an OpenID account. Look for unassigned tickets (these are the ones that say "New" in the status column as opposed to "Assigned").  You can also search for the keyword "[http://ubiquity.mozilla.com/trac/search?q=good-for-beginners good-for-beginners]".  Check out what needs to be done, add things appropriately, choose unassigned tickets and start hacking!


== Submitting Patches ==
== Submitting Patches ==
73

edits