CloudServices/Sync/FxSync/Archived/AddDataType: Difference between revisions

Jump to navigation Jump to search
m
more typo fixes
(→‎Final touches: fixed terminology, i18n -> l10n)
m (more typo fixes)
Line 1: Line 1:
Back to [[Labs/Weave]].
Back to [[Labs/Weave]].


== Adding support for a new Data type ==
== Adding support for a new data type ==


== Create a new JavaScript file ==
== Create a new JavaScript file ==
Line 57: Line 57:
Once you've created all your classes, you'll need to make sure that your <tt>Engine</tt> subclass is instantiated and registered in <tt>weave/modules/services.js</tt>, in the function <tt>WeaveSvc()</tt>.  Look for where the existing engines are registered (to <tt>Engines.register</tt>) and add yours.
Once you've created all your classes, you'll need to make sure that your <tt>Engine</tt> subclass is instantiated and registered in <tt>weave/modules/services.js</tt>, in the function <tt>WeaveSvc()</tt>.  Look for where the existing engines are registered (to <tt>Engines.register</tt>) and add yours.


The last thing is to add your new data type to the Weave preferences UI.  Look in <tt>weave/chrome/content/preferences.xul</tt> for the boolean preferences called <tt>extensions.weave.bookmarks</tt>, <tt>extensions.weave.history</tt>, and so on.  They're boolean preferences because they're checkboxes which turn synchronization of a given datatype on or off.  Add one for your datatype using the existing XUL tags as a model.
The last thing is to add your new data type to the Weave preferences UI.  Look in <tt>weave/chrome/content/preferences.xul</tt> for the boolean preferences called <tt>extensions.weave.bookmarks</tt>, <tt>extensions.weave.history</tt>, and so on.  They're boolean preferences because they're checkboxes which turn synchronization of a given data type on or off.  Add one for your data type using the existing XUL tags as a model.


The text labels for the checkboxes in the preferences GUI are defined in a separate file to make localization easier.  The file for US English is <tt>weave/chrome/local/en-US/preferences.dtd</tt>.  Create an entity here with a name corresponding to what you used in <tt>preferences.xul</tt>, and with an appropriate value for the label string.
The text labels for the checkboxes in the preferences GUI are defined in a separate file to make localization easier.  The file for US English is <tt>weave/chrome/local/en-US/preferences.dtd</tt>.  Create an entity here with a name corresponding to what you used in <tt>preferences.xul</tt>, and with an appropriate value for the label string.


Finally, set the default value of your preference in <tt>defaults/preferences/sync.js</tt>.
Finally, set the default value of your preference in <tt>defaults/preferences/sync.js</tt>.
874

edits

Navigation menu