Révision 281047 sur Empaqueter un thème

  • Raccourci de la révision : Empaqueter_un_thème
  • Titre de la révision : Empaqueter un thème
  • ID de la révision : 281047
  • Créé :
  • Créateur : Freedox
  • Version actuelle ? Non
  • Commentaire /* Arborescence des fichiers d'un Thème */
Étiquettes : 

Contenu de la révision

Ce document décrit comment sont packagés les thèmes pour Firefox et Thunderbird.

Pré-requis

Construire un thème pour Firefox ou Thunderbird requière quelques connaissances des Cascading Stylesheets (CSS), probablement XBL, et quelques notions de design graphique et d'esthétisme de thème (...ou bien). Ce document décrit seulement comment les thèmes sont packagés afin d'être visualiser comme Thèmes dans Firefox.

Arborescence des fichiers d'un Thème

Les thèmes Firefox/Thunderbird sont packagé dans un fichier JAR avec la structure arborescente suivante :

montheme.jar:
  install.rdf
  contents.rdf
  preview.png
  icon.png
  browser/files
  global/files
  mozapps/files
  communicator/files
  ...
     
  • You must have a top-level chrome.manifest (Firefox/Thunderbird 1.5) or contents.rdf file which registers the chrome for the theme (as before) and also an install.rdf manifest that specifies metadata that is displayed in the Themes window.
  • preview.png is a preview image which will show in the scrolling preview area in the Themes window. It can be any size.
  • icon.png is a 32x32 PNG (may contain alpha transparency) which will show up in the Themes list in the Themes window.

install.rdf

Your install.rdf manifest will look something like this:

<?xml version="1.0"?>

<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#">

  <Description about="urn:mozilla:install-manifest">
    <em:type>4</em:type>
    more properties
  </Description>      
</RDF>

Required install.rdf Properties

Your install.rdf file must have the following properties. See the install.rdf Reference for more information:

  • em:id
  • em:version
  • em:type
  • em:targetApplication
  • em:name
  • em:internalName

Optional install.rdf Properties

  • em:description
  • em:creator
  • em:contributor
  • em:homepageURL
  • em:updateURL

Note that if your theme will be made available on the http://addons.mozilla.org website, it should not include an updateURL.

Sample install.rdf File

<?xml version="1.0"?>

<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#">

  <Description about="urn:mozilla:install-manifest">
    <em:id>{18b64b56-d42f-428d-a88c-baa413bc413f}</em:id>
    <em:version>1.0</em:version>
    <em:type>4</em:type>

    <!-- Target Application this extension can install into, 
         with minimum and maximum supported versions. -->
    <em:targetApplication>
      <Description>
        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
        <em:minVersion>0.8</em:minVersion>
        <em:maxVersion>0.9</em:maxVersion>
      </Description>
    </em:targetApplication>
    
    <!-- Front End MetaData -->
    <em:name>New Theme 1</em:name>
    <em:description>A test theme for Firefox</em:description>
    <em:creator>Ben Goodger</em:creator>
    <em:contributor>John Doe</em:contributor>
    <em:homepageURL>http://www.bengoodger.com/</em:homepageURL>

    <!-- Front End Integration Hooks (used by Theme Manager)-->
    <em:internalName>newtheme1</em:internalName>
  </Description>
</RDF>

The following are some common target application GUIDs that you can use in your targetApplication properties:

Firefox      {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Thunderbird  {3550f703-e582-4d05-9a08-453d09bdfdc6}

Official References for Toolkit API

{{wiki.template(':fr/Toolkit_API/Official_References')}}

Source de la révision

<p>Ce document décrit comment sont packagés les thèmes pour Firefox et Thunderbird.
</p>
<h3 name="Pr.C3.A9-requis"> Pré-requis </h3>
<p>Construire un thème pour Firefox ou Thunderbird requière quelques connaissances des Cascading Stylesheets (<a href="fr/CSS">CSS</a>), probablement <a href="fr/XBL">XBL</a>, et quelques notions de design graphique et d'esthétisme de thème (...ou bien). Ce document décrit seulement comment les thèmes sont packagés afin d'être visualiser comme Thèmes dans Firefox.
</p>
<h3 name="Arborescence_des_fichiers_d.27un_Th.C3.A8me"> Arborescence des fichiers d'un Thème </h3>
<p>Les thèmes Firefox/Thunderbird sont packagé dans un fichier JAR avec la structure arborescente suivante :
</p>
<pre class="eval">montheme.jar:
  install.rdf
  contents.rdf
  preview.png
  icon.png
  browser/<i>files</i>
  global/<i>files</i>
  mozapps/<i>files</i>
  communicator/<i>files</i>
  ...
     
</pre>
<ul><li> You must have a top-level <a href="fr/Chrome.manifest">chrome.manifest</a> (Firefox/Thunderbird 1.5) or contents.rdf file which registers the chrome for the theme (as before) and also an <a href="fr/Install.rdf">install.rdf</a> manifest that specifies metadata that is displayed in the Themes window.
</li><li> preview.png is a preview image which will show in the scrolling preview area in the Themes window. It can be any size.
</li><li> icon.png is a 32x32 PNG (may contain alpha transparency) which will show up in the Themes list in the Themes window.
</li></ul>
<h3 name="install.rdf"> install.rdf </h3>
<p>Your <a href="fr/Install.rdf">install.rdf</a> manifest will look something like this:
</p>
<pre class="eval">&lt;?xml version="1.0"?&gt;

&lt;RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#"&gt;

  &lt;Description about="urn:mozilla:install-manifest"&gt;
    &lt;em:type&gt;4&lt;/em:type&gt;
    <i>more properties</i>
  &lt;/Description&gt;      
&lt;/RDF&gt;
</pre>
<h4 name="Required_install.rdf_Properties"> Required install.rdf Properties </h4>
<p>Your install.rdf file must have the following properties. See the <a href="fr/Install.rdf">install.rdf Reference</a> for more information:
</p>
<ul><li> em:id
</li><li> em:version
</li><li> em:type
</li><li> em:targetApplication
</li><li> em:name
</li><li> em:internalName
</li></ul>
<h4 name="Optional_install.rdf_Properties"> Optional install.rdf Properties </h4>
<ul><li> em:description
</li><li> em:creator
</li><li> em:contributor
</li><li> em:homepageURL
</li><li> em:updateURL
</li></ul>
<p>Note that if your theme will be made available on the http://addons.mozilla.org website, it should not include an updateURL.
</p>
<h4 name="Sample_install.rdf_File"> Sample install.rdf File </h4>
<pre class="eval">&lt;?xml version="1.0"?&gt;

&lt;RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#"&gt;

  &lt;Description about="urn:mozilla:install-manifest"&gt;
    &lt;em:id&gt;{18b64b56-d42f-428d-a88c-baa413bc413f}&lt;/em:id&gt;
    &lt;em:version&gt;1.0&lt;/em:version&gt;
    &lt;em:type&gt;4&lt;/em:type&gt;

    &lt;!-- Target Application this extension can install into, 
         with minimum and maximum supported versions. --&gt;
    &lt;em:targetApplication&gt;
      &lt;Description&gt;
        &lt;em:id&gt;{ec8030f7-c20a-464f-9b0e-13a3a9e97384}&lt;/em:id&gt;
        &lt;em:minVersion&gt;0.8&lt;/em:minVersion&gt;
        &lt;em:maxVersion&gt;0.9&lt;/em:maxVersion&gt;
      &lt;/Description&gt;
    &lt;/em:targetApplication&gt;
    
    &lt;!-- Front End MetaData --&gt;
    &lt;em:name&gt;New Theme 1&lt;/em:name&gt;
    &lt;em:description&gt;A test theme for Firefox&lt;/em:description&gt;
    &lt;em:creator&gt;Ben Goodger&lt;/em:creator&gt;
    &lt;em:contributor&gt;John Doe&lt;/em:contributor&gt;
    &lt;em:homepageURL&gt;http://www.bengoodger.com/&lt;/em:homepageURL&gt;

    &lt;!-- Front End Integration Hooks (used by Theme Manager)--&gt;
    &lt;em:internalName&gt;newtheme1&lt;/em:internalName&gt;
  &lt;/Description&gt;
&lt;/RDF&gt;
</pre>
<p>The following are some common target application GUIDs that you can use in your targetApplication properties:
</p>
<pre class="eval">Firefox      {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Thunderbird  {3550f703-e582-4d05-9a08-453d09bdfdc6}
</pre>
<h3 name="Official_References_for_Toolkit_API"> Official References for <a href="fr/Toolkit_API">Toolkit API</a> </h3>
<p>{{wiki.template(':fr/Toolkit_API/Official_References')}}
</p>
Revenir à cette révision