XUL Tutorial Study Notes - Introduction

Introduction

1. XUL is a cross-platform language for describing applications' user interfaces.

2. Ways you can use XUL:

Firefox extensions; standalone XULRunner application; XUL package; Remote XUL application;

3. Three tips you should know to use XUL:

  • XUL elements and attributes should all be entered in lowercase as XML is case-sensitive (unlike HTML).
  • Attribute values in XUL must be placed inside quotes, even if they are numbers.
  • XUL files are usually split into four files, one each for the layout and elements, for style declarations, for entity declarations (used for localization) and for scripts. In addition, you may have extra files for images or for platform specific data.

XUL Structure

1. There are some features that are specific to HTML, such as form, and others that are specific to XUL, such as overlays.
2. Both HTML and XUL placed on a web site have no extra permissions, however both HTML and XUL loaded through a chrome URL have enhanced permissions; This distinction is not based on the kind of content being displayed, only on the type of URL used.
3. Mozilla uses a distinctly different kind of document object for HTML and XUL, although they share much of the same functionality.
4. By default, Mozilla applications parse XUL files and scripts, and store a pre-compiled version in memory for the remainder of the application session.
5. There are three parts of chrome packages: content; skin; locale.
6. Locale: the localized text is stored in two types of files: DTD files and properties files.

The Chrome URL

1. Basic syntax of chrome URL is as follows: chrome://<package name>/<part>/<file.xul>.
2. Simplified  URL: chrome://<package name>/<part>/, this URL will refer to chrome://<package name>/<part>/<package name>.<file extension>, <file extension> will be xul if <part> is content, and css for skin, dtd for locale.

Manifest Files

1. Manifest files' encoding should be ASCII, and it doesn't actually mater what the file is called as long as it has the .manifest extension.
2. The basic syntax of the lines in the manifest file for content/locale/skin package is: content/locale/skin <packagename> <filepath>.
3. For a JAR file located in the chrome directory the syntax is fairly simple: jar:<filename.jar>!/<path_in_archive>.
4. For themes and locales, you also need to specify the content package you are providing a theme or locale for.
skin browser classic/1.0 jar:classic.jar!/skin/classic/browser/
locale browser en-US jar:en-US.jar!/locale/browser/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值