diff options
Diffstat (limited to 'files/zh-cn/archive/mozilla')
24 files changed, 0 insertions, 3018 deletions
diff --git a/files/zh-cn/archive/mozilla/compiling_the_npruntime_sample_plugin_in_visual_studio/index.html b/files/zh-cn/archive/mozilla/compiling_the_npruntime_sample_plugin_in_visual_studio/index.html deleted file mode 100644 index 64c3a0f200..0000000000 --- a/files/zh-cn/archive/mozilla/compiling_the_npruntime_sample_plugin_in_visual_studio/index.html +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Compiling The npruntime Sample Plugin in Visual Studio -slug: Archive/Mozilla/Compiling_The_npruntime_Sample_Plugin_in_Visual_Studio -translation_of: Archive/Mozilla/Compiling_The_npruntime_Sample_Plugin_in_Visual_Studio ---- -<h2 id="General_decisions" name="General_decisions">通用选项</h2> - -<ul> - <li>DLL的文件名<br> - 必须以 "np" (不是 "ns") 开头并且以 ".dll" 结尾(我在这个地方一次又一次的犯错,小心)</li> - <li>mimetype<br> - 映射了这个插件处理的数据类型. 同时也是网页唤起你的插件的一个标识. 应该像是 "application/x-vnd-yourorganization-yourfiletype" 或者 在IANA上注册的类型 (不太可能)或者是一种标准类型(例如,如果你想要播放MPEG文件的话).</li> - <li>文件扩展名<br> - 映射了插件处理的数据类型,尤其是当插件从Windows系统的本地磁盘中加载的时候。</li> -</ul> - -<h2 id="Build" name="Build">Build</h2> - -<ol> - <li>创建一个<strong>Win32 GUI library工程</strong> (DLL) (在.NET 2003版本中: 选择模板中的<strong>Win32</strong> , 然后在弹出的对话框中找到<strong>应用程序类型</strong>,勾选<strong>DLL</strong>, 不添加公共头文件。)(在VS2008版本中,选择<strong>Visualc++|Win32|Win32 Project</strong>, 然后在向导中勾选DLL).</li> - <li>如果向导询问你是否创建一个空项目,那么勾选它。否则你需要在后面手动删除向导给你创建的文件。</li> - <li>请注意接下来的DLL创建中文件名必须以"<strong>np</strong>"开头, 你可以以这样的命名格式给你的工程命名,或者在后面的步骤中重命名你的项目。</li> - <li>(如果你不是创建了一个空项目才需要进行此步骤)从你的工程与磁盘中删除.cpp文件、.h文件、ReadMe文件。</li> - <li>复制npruntime例子插件源码到新创建工程的VS目录下,然后使用VS的界面向导方式添加这些文件到工程中。(<strong>.cpp</strong>文件添加到"源文件", <strong>.h</strong> 文件添加到 "头文件", <strong>.rc</strong> 文件添加到"资源文件"). 例子可以从以下网址获取:<br> - <a class="external" href="/en/Plugins/Samples_and_Test_Cases" title="https://developer.mozilla.org/en/Plugins/Samples_and_Test_Cases">https://developer.mozilla.org/en/Plugins/Samples_and_Test_Cases</a></li> - <li>下载<a href="http://code.google.com/p/npapi-sdk/" style="font-weight: bold;" title="http://code.google.com/p/npapi-sdk/">NPAPI SDK</a>.</li> - <li>添加<strong>NPAPI SDK的include目录 </strong>(例如 : C:\npapi-sdk\headers) 到项目属性<strong>|(所有配置)|C++|常规|附加包含目录</strong>. 注意: 如果你的项目仍然为空,C++树可能无法查看。所以先添加一些文件吧。</li> - <li>Add the following preprocessor definitions to <strong>Project Properties|(all configurations)|C++|Preprocessor|Preprocessor Definitions:</strong> <strong><code>WIN32;_WINDOWS;XP_WIN32;XP_WIN;_X86_;NPSIMPLE_EXPORTS</code></strong></li> - <li>Disable precompiled headers using <strong>Project Properties|(all configurations)|C++|Precompiled headers|Create/Use precompiled header</strong>. They may be already disabled.</li> - <li>Define the function exports by adding the <strong>.def</strong> filename (e.g. nprt.def) to <strong>Project Properties|(all configurations)|Linker|Input|Module Definition File</strong>. It could be either the full path or the path relative to the project directory.</li> - <li>Optional: Open the above <strong>.def</strong> file and change "NPRT" to the filename of your dll as VS sees it (without "np", if you decided to rename later)</li> - <li>Optional: Edit the <strong>.rc</strong> file and and the top of <strong>npp_gate.cpp</strong> for the description, mimetype, file extension etc. to reflect your plugin</li> - <li>Remove the function <strong><code>NPP_GetJavaClass</code></strong> from <strong>npp_gate.cpp</strong></li> - <li>Build</li> - <li>Rename the resulting DLL so that the filename starts with "<strong>np</strong>" and ends with ".dll" (or "32.dll"? 8.3?) and copy it in Mozilla's "plugins" folder</li> - <li>Start Mozilla and open <strong>about:plugins</strong> to verify the plugin is detected</li> - <li>Open the file "test.html" and begin testing. Make sure the mimetypes of your html embed tags match the mimetype specified in your <strong>nprt.rc</strong> file and the top of your <strong>npp_gate.cpp</strong> file</li> -</ol> - -<h2 id="Version_Issues" name="Version_Issues">Version Issues</h2> - -<ol> - <li>If VC++ compiler throws you <strong><code>error C2664</code></strong> on 'DrawText' function call, you may replace it by 'DrawTextA'. In fact, all win32 API functions dealing with character strings can be added an 'A' to the end to avoid unicode cast errors.</li> - <li>Visual C++ 2008 Express don't support C99 standard about <strong>int32_t</strong>, <strong>uint32_t</strong>. You have to add <strong>#include "nptypes.h"</strong> in top of <strong>plugin.h</strong> file.</li> - <li>Feel free to append here your issues fixes if the above guide helped you.</li> -</ol> diff --git a/files/zh-cn/archive/mozilla/getting_started_with_irc/index.html b/files/zh-cn/archive/mozilla/getting_started_with_irc/index.html deleted file mode 100644 index 730a987f20..0000000000 --- a/files/zh-cn/archive/mozilla/getting_started_with_irc/index.html +++ /dev/null @@ -1,316 +0,0 @@ ---- -title: Getting Started with IRC -slug: Archive/Mozilla/Getting_Started_with_IRC -tags: - - 'IRC: xgqfrms' - - MDN - - irc -translation_of: Archive/Mozilla/Getting_started_with_chat ---- -<h2 class="western" id="什么是_IRC" style="font-style: normal;">什么是 IRC?</h2> - -<p>IRC, or Internet Relay Chat, is a form of real-time text messaging between multiple users at the same time. Users connect to a server using an IRC client and join channels (chat rooms). Users type messages which are broadcasted to all users within a channel. IRC also allows one to one communication between connected users. This is the primary form of communication for members of the Mozilla community; developers, testers, users, and the like.</p> - -<h2 class="western" id="通用规则和礼仪" style="font-style: normal;">通用规则和礼仪</h2> - -<p style="margin-bottom: 0in; font-weight: normal;"><span style="font-style: normal;"><span style="text-decoration: none;">Once you have your client set up (see software below) and are connected to IRC, there are some basic rules you should follow to ensure the most enjoyable and productive IRC experience:</span></span></p> - -<p style="margin-bottom: 0in; font-weight: normal;"> </p> - -<p style="margin-bottom: 0in; padding-left: 30px;">1. Try to keep messages as concise as possible. If you have something long to post, a code snippet for example, use <a href="https://pastebin.mozilla.org/">pastebin.mozilla.org</a> and paste the generated URL in IRC instead.</p> - -<p style="margin-bottom: 0in; padding-left: 30px;">2. When addressing someone directly, try to use name: message format. For example, "ashughes: good morning!"</p> - -<p style="margin-bottom: 0in; padding-left: 30px;">3. Every channel has its own topic. Try to keep your messages within that subject matter. For example, do not talk about Thunderbird issues in #Firefox.</p> - -<p style="margin-bottom: 0in; padding-left: 30px;">4. Mozilla's IRC channels are most active between 9am and 7pm PST Monday to Friday, excluding <a href="https://www.opm.gov/policy-data-oversight/pay-leave/pay-administration/fact-sheets/holidays-work-schedules-and-pay/">US Holidays</a>.</p> - -<p style="margin-bottom: 0in; padding-left: 30px;">5. When asking a question, be patient. Sometimes, it can take a few minutes for people to respond.</p> - -<p style="margin-bottom: 0in; padding-left: 30px;">6. Posting a message like "Help!" is not particularly helpful. Asking a good question will result in a better experience for both you and the person trying to help. There is a good reference for what makes a good question <a href="https://www.gerv.net/hacking/how-to-ask-good-questions/">here</a>.</p> - -<p style="padding-left: 30px;"><span style="font-style: normal;">7. <strong>Relax and have fun!</strong></span></p> - -<h2 class="western" id="软件" style="font-style: normal;">软件</h2> - -<h3 class="western" id="ChatZilla_–_The_Firefox_Add-on"><strong><span style="font-size: small;"><span style="font-style: normal;"><span style="text-decoration: none;">ChatZilla – The Firefox Add-on</span></span></span></strong></h3> - -<p class="western"><span style="font-style: normal;"><span style="text-decoration: none;">There are several different applications which allow you to connect to IRC networks. The easiest one to use is an add-on for Firefox called Chatzilla. The following instructions describe how to install and configure Chatzilla for use on the Mozilla IRC network:</span></span></p> - -<p style="padding-left: 30px;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">1. Go to <a href="https://addons.mozilla.org/en-US/firefox/addon/16">addons.mozilla.org</a> to download and install Chatzilla</span></span></span></p> - -<p style="padding-left: 30px;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">2. Click the green </span></span></span><em><span style="text-decoration: none;"><span style="font-weight: normal;">Add to Firefox</span></span></em><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;"> button</span></span></span></p> - -<p style="padding-left: 30px;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">3. Click the </span></span></span><em><span style="text-decoration: none;"><span style="font-weight: normal;">Install</span></span></em><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;"> button on the Addon Installation dialog</span></span></span></p> - -<p style="padding-left: 30px;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">4. Once ChatZilla is installed, click </span></span></span><em><span style="text-decoration: none;"><span style="font-weight: normal;">Restart Firefox</span></span></em></p> - -<p style="padding-left: 30px;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">5. Once Firefox restarts, close the Add-ons dialog</span></span></span></p> - -<p style="padding-left: 30px;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">6. Now click Tools menu > ChatZilla to start the client</span></span></span></p> - -<p style="padding-left: 30px;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">7. In the textbox at the bottom of the window type </span></span></span><span style="font-size: x-small;"><span style="font-family: courier new,monospace;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">/server irc.mozilla.org</span></span></span></span></span><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;"> and press enter</span></span></span></p> - -<p style="padding-left: 30px;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">8. You will be given a random username when you first connect. Usually the client will just use your computer username. If this name is already in use, it will use something like </span></span></span><em><span style="text-decoration: none;"><span style="font-weight: normal;">IRCMonkey21710</span></span></em><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">. You can change your nickname by typing /nick nickname, where nickname is your desired nickname. You can also change your nickname using the dropdown box to the left of the textbox.</span></span></span></p> - -<p style="font-style: normal; padding-left: 30px;"><em><span style="text-decoration: none;"><span style="font-weight: normal;">See the <a href="#commands">Commands</a> section below for more IRC commands.</span></span></em></p> - -<p style="padding-left: 30px;"><span style="text-decoration: none;"><span style="font-weight: normal;">9. To join a channel type </span></span><span style="font-family: courier new,monospace;"><span style="font-size: xx-small;"><span style="text-decoration: none;"><span style="font-weight: normal;"><span style="font-size: x-small;">/join #channel</span>,</span></span></span></span><span style="text-decoration: none;"><span style="font-weight: normal;"> where #channel is the name of the channel you want to join.</span></span></p> - -<p style="padding-left: 30px;"><em><span style="text-decoration: none;"><span style="font-weight: normal;">See the <a href="#channels">Channels</a> section below for some channels available on the Mozilla IRC network.</span></span></em></p> - -<h3 class="western" id="Desktop_Clients"><span style="font-size: small;"><strong><span style="text-decoration: none;">Desktop Clients</span></strong></span></h3> - -<p style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">As mentioned earlier, ChatZilla is not the only IRC client available, though it is the simplest. The advantage is that the desktop clients allow much more detailed configuration. For example, you can connect using SSL or a non-secure connection, and you can configure the client to automatically connect to a server and join a particular set of channels when you start the client. The following are some other options available to you:</span></span></p> - -<table style="text-align: right; width: 100%;"> - <tbody> - <tr> - <td> </td> - <td> - <p align="CENTER"><strong>Windows</strong></p> - </td> - <td> - <p align="CENTER"><strong>Mac</strong></p> - </td> - <td> - <p align="CENTER"><strong>Linux</strong></p> - </td> - </tr> - <tr> - <td><a href="http://colloquy.info/downloads.html">Colloquy</a></td> - <td> </td> - <td> - <p align="CENTER">●</p> - </td> - <td> </td> - </tr> - <tr> - <td><a href="https://irssi.org/download#binaries">IRSSI</a></td> - <td> - <p align="CENTER">●</p> - </td> - <td> - <p align="CENTER">●</p> - </td> - <td> - <p align="CENTER">●<span style="font-family: arial,sans-serif;">*</span></p> - </td> - </tr> - <tr> - <td><a href="http://www.xchat.org/download/">Xchat</a></td> - <td> - <p align="CENTER">●</p> - </td> - <td> - <p align="CENTER">○</p> - </td> - <td> - <p align="CENTER">●<span style="font-family: arial,sans-serif;">*</span></p> - </td> - </tr> - </tbody> -</table> - -<p style="padding-left: 30px;"><em><span style="font-family: arial,sans-serif;"><span style="text-decoration: none;"><span style="font-weight: normal;">● </span></span></span></em><span style="font-family: arial,sans-serif;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">Binary or executable program available</span></span></span></span></p> - -<p style="padding-left: 30px;"><span style="font-family: arial,sans-serif;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">○ Only available by downloading and compiling source code</span></span></span></span></p> - -<p style="padding-left: 30px;"><span style="font-family: arial,sans-serif;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">●* Binary or executable may be available. If not, you'll have to download source code and compile.</span></span></span></span></p> - -<p style="padding-left: 30px;"><span style="font-family: arial,sans-serif;"><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">w Web-based client (i.e. it runs in the browser) </span></span></span></span></p> - -<p><em><span style="text-decoration: none;"><span style="font-weight: normal;">For a complete list of IRC clients go <a href="https://en.wikipedia.org/wiki/Comparison_of_Internet_Relay_Chat_clients">here</a>.</span></span></em></p> - -<p style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">If using a desktop client, you will need to use the following information to configure the server connection:</span></span></p> - -<p style="font-style: normal; padding-left: 30px;"><span style="text-decoration: none;"><strong>Server: irc.mozilla.org</strong></span></p> - -<p style="padding-left: 30px;"><span style="font-style: normal;"><span style="text-decoration: none;"><strong>Port: 6667 (default) or 6697 (SSL)</strong></span></span></p> - -<h3 id="网络客户端">网络客户端</h3> - -<p><span style="font-style: normal;"><span style="text-decoration: none;">There are also a few web-based clients which allow connecting to IRC by clicking on irc:// links. One of the simplest web-based clients is </span></span><a href="https://www.mibbit.com/">Mibbit</a>, another is <a href="https://www.irccloud.com/">IRCCloud</a>. These operate very much in the same way as the previously mentioned desktop clients and ChatZilla. Mibbit does NOT require flash or any other plugins. <a name="channels"></a></p> - -<h2 class="western" id="频道">频道</h2> - -<p><span style="font-style: normal;">Here is a list of channels you should be aware of as a member of the Mozilla community: </span><span style="font-style: normal;"><strong>(Remember to use irc.mozilla.org and port 6697 or 6667 for your server settings)</strong></span></p> - -<table style="width: 100%;"> - <tbody> - <tr> - <td><a href="irc://irc.mozilla.org/qa"><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">#qa</span></span></a></td> - <td>A channel for QA discussion</td> - </tr> - <tr> - <td><a href="irc://irc.mozilla.org/developers"><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">#developers</span></span></a></td> - <td>A channel for Mozilla development discussion</td> - </tr> - <tr> - <td><a href="irc://irc.mozilla.org/sumo"><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">#sumo</span></span></a></td> - <td>A channel for support with Firefox</td> - </tr> - </tbody> -</table> - -<p><em>For more information about the Mozilla IRC network and more channels, go <a href="https://wiki.mozilla.org/IRC">here</a>.</em> <a name="commands"></a></p> - -<h2 class="western" id="指令" style="font-style: normal;">指令</h2> - -<p><span style="font-style: normal;">The following is a list of commands you should be familiar with. Simply type them into the message box at the bottom of the screen and press enter:</span></p> - -<table style="width: 100%;"> - <tbody> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/join #channel</span></span></td> - <td>Joins you to the specified channel until you quit your IRC client or quit the channel</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/leave</span></span></td> - <td>Leave the current channel</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/mode #channel +k password</span></span></td> - <td>Sets a password for the channel. If #channel is not specified, the command is executed for the current channel.</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/mode #channel +o nickname</span></span></td> - <td>Sets specified user as an owner or moderator of the specified channel. If a #channel is not specified, the command is executed for the current channel.</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/mode #channel +s</span></span></td> - <td>Sets the channel as a secret channel. This takes the channel off the public list of active channels and topics.</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/msg nick message</span></span></td> - <td>Sends a private message to the specified user</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/nick nickname</span></span></td> - <td>Change your current nickname</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">nickname: ping</span></span></td> - <td>Get a user's attention (nickname is the name of the user you want the attention of)</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">nickname: pong</span></span></td> - <td>Respond to a user's ping (nickname is the name of the user who wants your attention)</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/query nickname</span></span></td> - <td>Opens a private chat with the specified user</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/quit message</span></span></td> - <td>Disconnects you from the current server displaying the message in all connected channels prior to quitting</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/reload styles</span></span></td> - <td>Some IRC clients, Colloquy on Mac in particular, stop displaying your messages in the channel window. If this happens, you can type this command to resolve this issue.</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/server server-name</span></span></td> - <td>Manually connect to a server</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/topic topic</span></span></td> - <td>Changes the topic of the channel. The topic is a message that displays first when you join a channel.</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/whois nickname</span></span></td> - <td>Display information about the specified user. This information displays in the server window.</td> - </tr> - </tbody> -</table> - -<p><em>For more information about IRC commands go <a href="http://www.technerd.net/irc-commands.html">here</a>.</em></p> - -<h2 class="western" id="机器人" style="font-style: normal;">机器人</h2> - -<p><span style="font-style: normal;">Some users in IRC are not human. These users are known as bots and automatically perform certain tasks; some automatic, some triggered by other users. The most common of these bots are called NickServ, ChanServ, and Firebot.</span></p> - -<h3 class="western" id="NickServ"><span style="font-size: small;"><span style="font-style: normal;"><strong>NickServ</strong></span></span></h3> - -<p><span style="font-style: normal;">This bot allows you to register your nickname which prevents other users from using it. NickServ also automatically elevates all registered users to operators when they sign on.</span><span style="font-style: normal;"><span style="font-weight: normal;">The following are some helpful commands which can be used by NickServ:</span></span></p> - -<table style="width: 100%;"> - <tbody> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;"><span style="font-style: normal;"><span style="font-weight: normal;">/msg NickServ REGISTER password email</span></span></span></span></td> - <td><span style="font-style: normal;"><span style="font-weight: normal;">This registers your nickname with the server.</span></span></td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;"><span style="font-style: normal;"><span style="font-weight: normal;">/msg NickServ IDENTIFY password</span></span></span></span></td> - <td><span style="font-style: normal;"><span style="font-weight: normal;">Once registered, you need to type this every time you want to sign into channels using your registered nickname</span></span></td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;"><span style="font-style: normal;"><span style="font-weight: normal;">/msg NickServ HELP</span></span></span></span></td> - <td><span style="font-style: normal;"><span style="font-weight: normal;">This displays a list of commands which can be used with NickServ</span></span></td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;"><span style="font-style: normal;"><span style="font-weight: normal;">/msg NickServ HELP REGISTER</span></span></span></span></td> - <td><span style="font-style: normal;"><span style="font-weight: normal;">This displays helpful information about nickname registration</span></span></td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;"><span style="font-style: normal;"><span style="font-weight: normal;">/msg NickServ HELP IDENTIFY </span></span></span></span></td> - <td><span style="font-style: normal;"><span style="font-weight: normal;">This displays helpful information about identifying yourself upon sign in</span></span></td> - </tr> - </tbody> -</table> - -<p><em><span style="font-weight: normal;">For more information about NickServ go <a href="https://www.esper.net/nickserv.php">here</a>.</span></em></p> - -<h3 id="ChanServ"><span style="font-size: small;"><span style="font-style: normal;"><strong>ChanServ</strong></span></span></h3> - -<p><span style="font-style: normal;"><span style="font-weight: normal;">This bot allows you to register new channels and control aspects of channels. The following are some helpful commands which can be used by ChanServ:</span></span></p> - -<table style="width: 100%;"> - <tbody> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/msg ChanServ HELP</span></span></td> - <td>This displays a list of commands which can be used with ChanServ</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/msg ChanServ IDENTIFY #channel password</span></span></td> - <td>Allows you to edit the aspects of the specified channel given the correct password</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/msg ChanServ REGISTER #channel password topic</span></span></td> - <td>Registers a channel given the correct password and sets the topic</td> - </tr> - </tbody> -</table> - -<p><em><span style="font-weight: normal;">For more information about ChanServ go <a href="https://www.esper.net/chanserv.php">here</a>.</span></em></p> - -<h3 id="Firebot"><span style="font-size: small;"><span style="font-style: normal;"><strong>Firebot</strong></span></span></h3> - -<p><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">Firebot is a bot which assists with Mozilla related activities on IRC. For instance, Firebot automatically posts messages to #developers about the status of automated tests. The following are some helpful commands which can be used by Firebot:</span></span></span></p> - -<table style="width: 100%;"> - <tbody> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">bug ######</span></span></td> - <td>When a bug number is mentioned in a message, Firebot automatically displays the link and summary from bugzilla for that bug.</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/msg firebot uuid</span></span></td> - <td>Displays a unique identifier. This is useful when creating interfaces for add-on development.</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/msg firebot cid</span></span></td> - <td>Displays a unique 128-bit number which can be used to identify a class or component.</td> - </tr> - <tr> - <td><span style="font-size: x-small;"><span style="font-family: courier new,monospace;">/invite firebot #channel</span></span></td> - <td>Adds firebot to the specified channel.</td> - </tr> - </tbody> -</table> - -<p><em><span style="font-weight: normal;">For more information about Firebot go <a href="https://wiki.mozilla.org/Firebot">here</a>.</span></em></p> - -<h2 class="western" id="进一步阅读" style="font-style: normal;">进一步阅读</h2> - -<p><span style="font-style: normal;"><a href="http://www.irchelp.org/irchelp/changuide.html">IRC Channel Operator's Guide</a> (New Version)</span> <span style="font-style: normal;"><a href="http://www.irchelp.org/irchelp/opguide.html">IRC Channel Operator's Guide</a> (Old Version) [</span><em>From 1995, but still quite useful</em><span style="font-style: normal;">]</span></p> diff --git a/files/zh-cn/archive/mozilla/help_viewer/creating_a_help_content_pack/index.html b/files/zh-cn/archive/mozilla/help_viewer/creating_a_help_content_pack/index.html deleted file mode 100644 index 2a64c576e7..0000000000 --- a/files/zh-cn/archive/mozilla/help_viewer/creating_a_help_content_pack/index.html +++ /dev/null @@ -1,200 +0,0 @@ ---- -title: Creating a Help Content Pack -slug: Archive/Mozilla/Help_viewer/Creating_a_Help_Content_Pack -translation_of: Archive/Mozilla/Help_viewer/Creating_a_Help_Content_Pack ---- -<p><span class="comment">Original doc: <a class="external" href="http://www.mozilla.org/projects/help-viewer/content_packs" rel="freelink">http://www.mozilla.org/projects/help.../content_packs</a> I hesitate to call it "original", tho, because I've basically rewritten the entire thing so that it's easier and faster to use to create Help content. The previous document had a lot of places where ideas were simply introduced without explanation, and I've tried to go through things a bit more slowly with better descriptions. This is still very much a work in progress, tho, and I need to complete the rest of it soon (where "complete" means "use what's there that's good, build on the stuff that's not as good, and add other useful information as necessary".</span></p> -<p>This document describes how to integrate HTML help documentation into your application using the Mozilla Help Viewer. Documentation contained in the Help Viewer can be accessed using any XUL application or program that embeds Mozilla.</p> -<h3 id="What_is_a_Content_Pack.3F" name="What_is_a_Content_Pack.3F">What is a Content Pack?</h3> -<p>A Content Pack is a packaged set of files that describe Help content. Content Packs include help documents written in <a href="cn/XHTML">XHTML</a>, a content pack descriptor file written in <a href="cn/RDF">RDF</a>, and a table of contents, index, and glossary (also written in RDF). You can create a content packs which inherit from existing Mozilla Help content packs.</p> -<h3 id="The_Contents_of_a_Content_Pack" name="The_Contents_of_a_Content_Pack">The Contents of a Content Pack</h3> -<p>Content Packs consist of a general pack description file, table of contents, index, search, glossary, and help documents. The help documents are written in XHTML, and the rest are written in RDF. The content pack descriptor file outlines the framework of the contents of the pack by pointing to the files describing the table of contents, index, and glossary RDF files. The table of contents and index files are simple tree-based outlines written in RDF. The glossary file is written in RDF and consists of a simple list of terms with corresponding URLs to the term definition.</p> -<h3 id="Creating_a_Content_Pack" name="Creating_a_Content_Pack">Creating a Content Pack</h3> -<h4 id="The_Content_Pack_Descriptor_File" name="The_Content_Pack_Descriptor_File">The Content Pack Descriptor File</h4> -<p>As mentioned earlier, the content pack descriptor file is written using RDF. If you don't know RDF, that's okay - for our purposes, you won't need to learn very much. If you understand the basics of HTML or (preferably) XML, you'll understand the very basics of the syntax - elements, attributes, and element contents. Understanding the syntax is important because small syntax errors can mean that a whole file won't be loaded correctly. However, while it may seem like this is a disadvantage, it's actually an advantage - if you make an error you'll know immediately, and you should be able to easily figure out what the problem is by directly loading the file in Firefox. Later, when we get to actually writing content, you'll need to know XHTML, but for now knowledge of the syntax should be enough.</p> -<p>Open up your favorite text editor and create the file <code>content-pack.rdf</code>. Insert into it the following text:</p> -<pre><?xml version="1.0"?> -<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:nc="http://home.netscape.com/NC-rdf#"> - -</rdf:RDF> -</pre> -<p>If you're familiar with HTML or XML, you might recognize this as the container element for the whole document. It serves as a wrapper around the entire contents of the file, marking it as RDF.</p> -<p>Next, you'll need to insert a <code>rdf:Description</code> element into the file, inside the <code>rdf:RDF</code> element just created:</p> -<pre> <rdf:Description rdf:about="urn:root" - nc:title="" - nc:defaulttopic="" - nc:base=""> - </rdf:Description> -</pre> -<p>Fill in the attributes as follows:</p> -<ul> - <li><b>rdf:about</b> must be <code>urn:root</code> or your pack won't work. This attribute marks the start point in the RDF graph described by the file, and the Help Viewer searches for this element in order to query for further information (stored in child elements) about the content pack being parsed.</li> - <li><b>nc:title</b> is where you specify the title (e.g., "Mozilla Firefox Help") for the Help Window. This attribute is <b>required</b>.</li> - <li><b>nc:defaulttopic</b> will hold the <code>rdf:ID</code> of the topic you want displayed when the viewer first loads if none has been specified. This attribute also specifies what topic is loaded when the user hits the Home button in the viewer. We'll get to exactly how to fill in this attribute later. This attribute is <b>optional</b>, with fallback to the value <code>welcome</code>.</li> - <li><b>nc:base</b> contains the base URL relative to which the Help content referenced in the descriptor file is located. For example, if your glossary, index, and table of contents RDF files are all located at <code><a class="external" rel="freelink">chrome://myapp/locale/help/*</a></code>, then you could put <code><a class="external" rel="freelink">chrome://myapp/locale/help/</a></code> here and use only the actual file names without path when needed later. You don't actually need this attribute if you don't want it, but it's a useful shorthand to save typing.</li> -</ul> -<p>Next, we need to describe where to find the glossary, index, and table of contents. (We're still not actually to the point where we're describing the actual data in each of these, so we'll just use some filler data for now.) Add the following code inside the <code>rdf:Description</code> element you just created:</p> -<pre> <nc:panellist> - <rdf:Seq> - - </rdf:Seq> - </nc:panellist> -</pre> -<p>You'll create the relevant information descriptions within the <code>rdf:Seq</code> element.</p> -<p>The location of each of the glossary, index, and table of contents data sources is stored in one <code>rdf:Description</code> element contained within one <code>rdf:li</code> element, like so:</p> -<pre> <rdf:Seq> - <rdf:li> - <rdf:Description nc:panelid="glossary" - nc:datasources="chrome://foo/locale/help/glossary.rdf"/> - </rdf:li> - <rdf:li> - <rdf:Description nc:panelid="toc" - nc:datasources="chrome://foo/locale/help/glossary.rdf"/> - </rdf:li> - <rdf:li> - <rdf:Description nc:panelid="index" - nc:datasources="chrome://foo/locale/help/glossary.rdf"/> - </rdf:li> - </rdf:Seq> -</pre> -<p>The Help Viewer UI may or may not provide a panel for each of these data sources. In Firefox 1.0 each data source had a panel. Starting with Firefox 1.1 and the Mozilla 1.8 platform, only the table of contents data source will be displayed. The glossary and index data sources will be - <i> - hidden</i> - - information found only in them will not be displayed unless the user conducts a search of the Help pack that would return glossary or index results.<span class="comment">XXX this sentence is ugly - a little rewording help here would be nice</span></p> -<p>A data source description is pretty much the same no matter which type you're defining, and the syntax is pretty simple. Each panel is specified by one <code>rdf:Description</code> element with the following attributes:</p> -<ul> - <li><b>nc:panelid</b> specifies the name of the panel, which may be any one of <code>glossary</code>, <code>search</code>, <code>toc</code>, or <code>index</code>. The data source specified by <code>toc</code> will always be displayed, while the other data sources may only be available by searching through the loaded content pack.</li> - <li><b>nc:datasources</b> is a space-separated list of RDF datasources used in construction of the structure of referenced topics. Generally, each item in the list will be a URI to an RDF file, but if you're more familiar with RDF you can also refer to a specific node within the RDF file using its <code>rdf:ID</code> attribute.</li> - <li><b>nc:platform</b> (added in Mozilla 1.8b2/Firefox 1.1) when present specifies the platforms to which the information stored in the referenced data sources applies. This attribute is useful when some of your help contents only apply to one specific platform. If this attribute is omitted, the information in the data sources applies to - <i> - all</i> - platforms. The attribute is a space-separated list of platform strings. Strings recognized from 1.8 onward are <b>win</b>, <b>mac</b>, <b>os2</b>, and <b>unix</b>; more will be added as required. Unrecognized strings are ignored during parsing. An example of how to use this attribute follows:</li> -</ul> -<pre> <!-- Assumptions: - win-toc.rdf contains Windows- and OS/2-specific info, - unix-toc.rdf contains Linux- and Mac-specific info. --> - <rdf:li> - <rdf:Description nc:panelid="toc" - nc:platform="win os2" - nc:datasources="win-toc.rdf"/> - </rdf:li> - <rdf:li> - <rdf:Description nc:panelid="toc" - nc:platform="unix mac" - nc:datasources="unix-toc.rdf"/> - </rdf:li> -</pre> -<p>There's one final element to add inside <code>rdf:Seq</code> to complete the content pack descriptor file: an element to describe the Help Viewer's search function. Search automatically goes through all of the elements in the table of contents, index, and glossary, but you might wish to have Search go through more sources of data. One possible source might be an online, dynamically-generated list of added content stored on your web site. To have the Help Viewer search through these additional data sources, define another <code>rdf:li</code> element like so:</p> -<pre> <rdf:li> - <rdf:Description nc:panelid="search" - nc:datasources="" - nc:emptysearchtext="[No matching items found.]" - nc:emptysearchlink="chrome://foo/locale/bar.html"/> - </rdf:li> -</pre> -<ul> - <li><b>nc:panelid</b> should be set to <code>search</code>.</li> - <li><b>nc:datasources</b> should be set as with table of contents, index, and glossary definitions.</li> - <li><b>nc:platform</b> (added in Mozilla 1.8b2/Firefox 1.1) may be used on search data sources as it's used on table of contents, index, and glossary definitions.</li> - <li><b>nc:emptysearchtext</b> specifies the text that is shown when a search through Help returns no results.</li> - <li><b>nc:emptysearchlink</b> specifies what URI should be shown when the pseudo-result "no results found" is accessed. This attribute is <b>required</b>. The sample page <code><a class="external" rel="freelink">chrome://help/locale/welcome.xhtml</a></code> has a section on searching which may be a useful link to use here.</li> -</ul> -<p>Note that you can use the <code>nc:datasources</code> attribute to inherit content from other content packs. One common use of this is to inherit the small Using the Help Window article provided with the viewer. For example, the following code uses a datasource outside the content pack you have created to include the article in a table of contents:</p> -<pre> <rdf:li> - <rdf:Description nc:panelid="toc" - nc:datasources="chrome://help/locale/help-toc.rdf chrome://foo/locale/help/glossary.rdf"/> - </rdf:li> - -</pre> -<p>Each of the different data source types (<code>toc</code>, <code>index</code>, <code>glossary</code>, and <code>search</code>) may be used multiple times (and in the case of platform-specific information, must be used multiple times). However, it is recommended you use a space-separated list of URIs for <code>nc:datasources</code> instead of separate entries, as separate entries will require a slightly longer time to load.</p> -<h4 id="The_Glossary_File" name="The_Glossary_File">The Glossary File</h4> -<p>The glossary file has the simplest format of all the data sources you'll need because there's only one level of content. (The index, table of contents, and search data sources are more likely to be nested, complicating their formats.) Create a new RDF file (for now let's name it <code>glossary.rdf</code>), and add the following lines to it:</p> -<pre><?xml version="1.0"?> - -<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:nc="http://home.netscape.com/NC-rdf#"> - - <rdf:Description rdf:about="urn:root"> - <nc:subheadings> - <rdf:Seq> - - - </rdf:Seq> - <nc:subheadings> - </rdf:Description> - -</rdf:RDF> -</pre> -<p>This forms the outer framework of a glossary description file. To add data to it, add one of the following per entry in your glossary within the <code>rdf:Seq</code> above:</p> -<pre> <rdf:li> - <rdf:Description nc:name="" - nc:link=""/> - </rdf:li> -</pre> -<p>The <code>rdf:li</code> element serves purely to contain each separate entry. The <code>rdf:Description</code> element describes the glossary entry. It has two required attributes: <code>nc:name</code> and <code>nc:link</code>. <code>nc:name</code> is the name for the entry - it's what's currently displayed in the glossary as the entry's title. <code>nc:link</code> contains a URI referencing what will be displayed in the viewer when the entry is accessed.</p> -<h4 id="The_Index_File" name="The_Index_File">The Index File</h4> -<div class="side-note-right"> - <p>One important note on the index file is that there is <b>no</b> automatically generated set of top-level letters (e.g., A for Accessibility and Automation or B for Book and Border). Help documentation may be written in any language, so such automatic splitting is not desirable. You must implement such splitting if you wish to have it.</p> -</div> -<p>The index data source structurally differs from the glossary in that it is more likely to have multiple levels. A single-level index may be accomplished in exactly the same way as a glossary file, but multiple levels can make it easier to navigate to specific information. Let's start with a brief sample RDF file with a single level:</p> -<pre><?xml version="1.0"?> - -<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:nc="http://home.netscape.com/NC-rdf#"> - - <rdf:Description rdf:about="urn:root"> - <nc:subheadings> - <rdf:Seq> - <rdf:li><rdf:Description nc:link="foo.html" nc:title="Foo"/></rdf:li> - <rdf:li><rdf:Description nc:link="baz.html" nc:title="Baz"/></rdf:li> - </rdf:Seq> - <nc:subheadings> - </rdf:Description> - -</rdf:RDF> -</pre> -<p>There's not much here: a single level containing the two entries "Foo" and "Baz". Now, let's say you want to add an entry "bar" underneath "Foo". How would you do this? First, you need to add an attribute to the "Foo" entry so that you can precisely refer to it. The <code>rdf:ID</code> attribute serves this purpose. It should be unique both within file and within the data sources in your content pack to ensure clarity.</p> -<p> </p> -<pre class="eval"> <rdf:li><rdf:Description <b>rdf:ID="foo"</b> nc:link="foo.html" nc:title="Foo"/></rdf:li> -</pre> -<p>Next, add the following to your file just after the existing <code>rdf:Description</code> element:</p> -<pre> <rdf:Description rdf:about="#foo"> - <nc:subheadings> - <rdf:Seq> - <rdf:li><rdf:Description rdf:ID="bar" nc:link="bar.html" nc:title="bar"/></rdf:li> - </rdf:Seq> - </nc:subheadings> - </rdf:Description> -</pre> -<p>Except for the different value for <code>rdf:about</code>, this looks exactly like a top-level entry definition. The difference is a result of how RDF works. In RDF data describes data. Top-level entries describe the root node, <code>urn:root</code>; nested entries describe other entries. You can refer to an entry by giving the entry a unique <code>rdf:ID</code> attribute. Then, to describe that entry, you set an <code>rdf:about</code> attribute to the value of the entry's <code>rdf:ID</code>, prefixed by a <code>#</code>.</p> -<p>Nesting as described above works exactly the same no matter how deeply or shallowly nested your entry is. Nesting theoretically can work to any number of levels, but for practical reasons nesting is limited to roughly 20 levels. If you're coming anywhere close to this limit, however, you probably should be considering exactly why you need so much nesting.</p> -<h4 id="The_Table_of_Contents_File" name="The_Table_of_Contents_File">The Table of Contents File</h4> -<p>The table of contents file is the most important data source you'll create. The help viewer will display the table of contents when you start the viewer. In some versions of the viewer, it will be the - <i> - only</i> - data source ever directly displayed. It's the primary way to provide a structured view of the help you provide to users.</p> -<p>The table of contents also provides the list of topics from which the home page for the viewer will be chosen. Recall that in the content pack descriptor file you included an <code>nc:defaulttopic</code> attribute, which defaulted to "welcome". The value of that attribute is the <code>rdf:ID</code> of the topic you want displayed when the viewer is loaded.</p> -<p>The table of contents data source is exactly like an index data source, and if you have a working index data source you could use it as a table of contents with no changes whatsoever. See the instructions on creating glossary and index data sources to learn how to create a table of contents.</p> -<h4 id="Additional_Search_Databases" name="Additional_Search_Databases">Additional Search Databases</h4> -<p>Starting with Firefox 1.1, you can define additional information databases through which the help viewer will search. The data from these may never even be displayed to the user, but if he tries to search through Help, he will see results from these databases.</p> -<p>Defining a search database is exactly like defining a table of contents file (and therefore exactly like creating an index file), so follow the instructions there to create additional data sources as you need them.</p> -<h3 id="Viewing_your_Content_Pack_in_the_Help_Viewer" name="Viewing_your_Content_Pack_in_the_Help_Viewer">Viewing your Content Pack in the Help Viewer</h3> -<p>To launch the Help Viewer with your content pack, you need to have <code><a class="external" rel="freelink">chrome://help/content/contextHelp.js</a></code> loaded into the XUL file that provides the UI to open the help viewer:</p> -<pre> <script type="application/x-javascript" - src="chrome://help/content/contextHelp.js"/> -</pre> -<p>This will allow you to access all of the viewer functions. To open the Help Viewer, run the <code>openHelp()</code> function. It's exactly the same as any JavaScript command, you you can insert it in <code>command</code> elements, <code>oncommand</code> attributes, and other such places. The parameters are described below:</p> -<pre>openHelp(aTopic, aContentPackSpec); -</pre> -<ul> - <li><b>aTopic</b>: the <code>rdf:ID</code> of the topic you want to load as the home page in the help viewer.</li> - <li><b>aContentPackSpec</b>: the path to the content pack you want to load.</li> -</ul> -<p>Here is an example of how Firefox opens its help documentation:</p> -<pre>openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf'); -</pre> -<h3 id="Packing_It_All_Up" name="Packing_It_All_Up">Packing It All Up</h3> -<div class="noinclude"> - </div> -<p></p> diff --git a/files/zh-cn/archive/mozilla/help_viewer/index.html b/files/zh-cn/archive/mozilla/help_viewer/index.html deleted file mode 100644 index 051ffdd64c..0000000000 --- a/files/zh-cn/archive/mozilla/help_viewer/index.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Help Viewer -slug: Archive/Mozilla/Help_viewer -translation_of: Archive/Mozilla/Help_viewer ---- -<p>Help Viewer: Allows information to be shown to the user inside Mozilla.</p> -<h3 id="Introduction" name="Introduction">Introduction</h3> -<p>Computers and software are incredibly complex. Naturally, then, everyone needs a little help now and then, and getting that help to the user is critical to making applications useful. Consequently, the Mozilla platform provides a cross-platform help viewer along with a framework for providing built-in help documentation. Mozilla's help viewer makes providing documentation an easy job, and this document will describe how you can use it.</p> -<ul> - <li><a class="external" href="http://www.mozilla.org/projects/help-viewer/">Help Viewer Project Page</a></li> -</ul> -<h3 id="Articles_&_Tutorials" name="Articles_&_Tutorials">Articles & Tutorials</h3> -<ul> - <li><a href="en/Help_Viewer/Creating_a_Help_Content_Pack">Creating a Help Content Pack</a> <span class="comment">task-oriented, as opposed to spec-type stuff like the link below will be</span></li> -</ul> -<h3 id="Other_Resources" name="Other_Resources">Other Resources</h3> -<ul> - <li><a href="en/Help_Viewer/Content_Pack_Specification">Content Pack Specification</a> <span class="comment">a technical description of it, meant primarily to solidify the idea of exactly what constitutes a content pack</span></li> -</ul> -<div class="noinclude"> - </div> -<p></p> diff --git a/files/zh-cn/archive/mozilla/index.html b/files/zh-cn/archive/mozilla/index.html deleted file mode 100644 index f4e2252d18..0000000000 --- a/files/zh-cn/archive/mozilla/index.html +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Archived Mozilla and build documentation -slug: Archive/Mozilla -translation_of: Archive/Mozilla ---- -<p>These articles are archived, obsolete documents about Mozilla, Gecko, and the process of building Mozilla projects.</p> -<p></p><dl><dt class="landingPageList"><a href="/zh-CN/docs/Archive/Mozilla/Help_viewer">Help Viewer</a></dt><dd class="landingPageList">Help Viewer: Allows information to be shown to the user inside Mozilla.</dd><dt class="landingPageList"><a href="/zh-CN/docs/Archive/Mozilla/Tamarin">Tamarin</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/zh-CN/docs/XPInstall">XPInstall</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/zh-CN/docs/XUL_Explorer">XUL Explorer</a></dt><dd class="landingPageList">XUL Explorer是一款提供一个很容易上手来进行XUL测试的 <a href="/en/XULRunner" title="en/XULRunner">XULRunner</a> 应用。这个编辑器很简单,他能在线预览或者在一个独立窗口预览XUL。它有一个列表的代码片段(小片段的XUL或JavaScript),可以快速插入到编辑器中。XUL可以加载和保存到文件。其中的XUL验证器和 <a href="/en/Error_Console" title="en/Error_Console">错误控制台</a> 可以帮助您找到问题所在。帮助菜单提供了访问 MDC上XUL信息的通道,更有 “keyword” 查找框帮助查找XUL元素。</dd><dt class="landingPageList"><a href="/zh-CN/docs/Drag_and_Drop">拖拽</a></dt><dd class="landingPageList">这部分描述了怎样实现可以拖拽和拖放到其他对象上的可拖拽对象。</dd></dl><p></p> diff --git a/files/zh-cn/archive/mozilla/marketplace/index.html b/files/zh-cn/archive/mozilla/marketplace/index.html deleted file mode 100644 index 3beff9da4f..0000000000 --- a/files/zh-cn/archive/mozilla/marketplace/index.html +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: 火狐应用工场 -slug: Archive/Mozilla/Marketplace -tags: - - Marketplace - - TopicStub -translation_of: Archive/Mozilla/Marketplace ---- -<div class="summary">火狐应用工场是一个开放的、非独占的在线应用市场,其所提供的应用都是使用HTML5技术开发的Web应用。</div> - -<div class="column-container"> -<div class="warning"> -<p>为了提供更多、更深入的关于如何发布与管理您的应用的信息,此页面正处于不断的维护更新中。</p> -</div> - -<p><span class="seoSummary"><a href="https://marketplace.firefox.com/">火狐应用工场</a> 使得开发者可以使用标准的Web技术、语言和工具来发布跨平台的<a href="/zh-CN/Apps">开放Web应用</a>。Mozilla将会把它的核心理念——开放、自由、用户导向——带到每一个应用中去。</span></p> - -<p><span class="seoSummary"><a href="https://marketplace.firefox.com/" title="/zh-CN/docs/Web/Apps/Publishing/Submitting_an_app">火狐应用工场</a>是我们为了发行应用(免费或付费)而自行建立的应用商城。向火狐应用工场<a href="/zh-CN/docs/Web/Apps/Publishing/Submitting_an_app">提交应用</a>很简单,只需要上传应用并添加必要的信息,然后等待我们审查完毕,确认应用高效、非恶意即可。向火狐应用工场提交应用还可以获得一些其它的好处。您的应用会得到更广泛的推广,付费的应用发布起来也更加简单,而且您不需要在您的Web站点上实现任何特定的API。主机的应用和打包的应用都可以提交给火狐应用工场。</span></p> -</div> - -<div class="row topicpage-table"> -<div class="section"> -<h2 class="Community" id="Community" name="Community">发布您的应用</h2> - -<dl> - <dt><a href="/zh-CN/Marketplace/Options">应用发布选项</a></dt> - <dd>当你完成一个开放Web应用之后,你可以选择多种不同的方式来发布它。这一章节将会向您介绍这些方式的不同。</dd> - <dt><a href="/zh-CN/Marketplace/Submission/Submitting_an_app">向火狐应用商场提交应用</a></dt> - <dd>如果您想向火狐应用工场发布一个应用,这里提供了详尽的指引。</dd> - <dt><a href="/zh-CN/Apps/Publishing/General_app_publishing_topics">与应用发布有关的常见问题</a></dt> - <dd>这里列出了关于发布开放Web应用有关的常见的问题,相信会对您有用。</dd> - <dt><a href="/zh-CN/Marketplace/Marketplace_APIs">火狐应用商场API</a></dt> - <dd>这些API参考内容涵盖了火狐应用商场的大多数API,它们可以帮助您配置应用的收费账户,使您的应用提交自动化等。</dd> -</dl> -</div> - -<div class="section"> -<h2 class="Community" id="Community" name="Community">关于收益</h2> - -<dl> - <dt><a href="/zh-CN/Marketplace/Monetization/Profiting_from_your_app">从您的应用中获取收益</a></dt> - <dd>要如何从您辛勤开发的应用中获取回报呢?不用担心,这篇文章会告诉您如何做,包括应用本身收费还是应用内收费。</dd> -</dl> - -<h2 class="Tools" id="Tools" name="Tools">应用开发工具</h2> - -<ul> - <li><a href="/zh-CN/Firefox_OS/Using_the_App_Manager">Firefox OS应用管理器</a></li> - <li><a href="/zh-CN/Apps/App_developer_tools">应用开发工具</a></li> -</ul> - -<h2 id="来自己建一个应用商场吧">来自己建一个应用商场吧</h2> - -<dl> - <dt><a href="/zh-CN/Marketplace/Creating_a_store">创建一个商店</a></dt> - <dd>您完全可以不借助火狐应用商场来发布您的应用。</dd> -</dl> -</div> -</div> - -<h2 id="Subnav">Subnav</h2> - -<ol> - <li><a href="/zh-CN/Marketplace/Prepare">做好准备</a> - - <ol> - <li><a href="/zh-CN/Marketplace/Prepare/Introduction">简介</a></li> - <li><a href="/zh-CN/Marketplace/Prepare/Deciding_what_to_build">做个什么应用呢?</a></li> - <li><a href="/zh-CN/Marketplace/Prepare_For_Success/Getting_to_know_your_users">您的应用面向哪些群体?</a></li> - <li><a href="/zh-CN/Marketplace/Prepare/Choosing_your_business_model">选择合适的商业模式</a></li> - <li><a href="/zh-CN/Marketplace/Prepare_For_Success/Quality_and_your_app">开发一款优质的应用</a></li> - <li><a href="/zh-CN/Marketplace/Prepare/Localizing_your_apps">本地化您的应用</a></li> - <li><a href="/zh-CN/Marketplace/Prepare/Promoting_your_app">推广您的应用</a></li> - <li><a href="/zh-CN/Marketplace/Prepare/Creating_your_community">创建一个社区</a></li> - </ol> - </li> - <li><a href="/zh-CN/Marketplace/Options">应用发布选项</a> - <ol> - <li><a href="/zh-CN/Marketplace/Options/Introduction">简介</a></li> - <li><a href="/zh-CN/Marketplace/Options/Packaged_apps">打包应用</a></li> - <li><a href="/zh-CN/Marketplace/Options/Hosted_apps">主机应用</a></li> - <li><a href="/zh-CN/Marketplace/Options/Packaged_or_hosted_">如何在两者之间选择</a></li> - <li><a href="/zh-CN/Marketplace/Options/Open_web_apps_for_android">面向安卓的开放Web应用</a></li> - <li><a href="/zh-CN/Marketplace/Options/Open_web_apps_for_desktop">面向桌面的开放Web应用</a></li> - <li><a href="/zh-CN/Marketplace/Options/Self_publishing">发布您的应用吧</a></li> - <li><a href="/zh-CN/Marketplace/Options/Creating_a_store">建一个属于自己的商店</a></li> - </ol> - </li> - <li><a href="/zh-CN/Marketplace/Submission">应用提交与审核</a> - <ol> - <li><a href="/zh-CN/Marketplace/Submission/Submitting_an_app" title="这条指引会详细地告诉您如何向火狐应用市场提交应用">向火狐应用工场提交一个应用</a></li> - <li><a href="/zh-CN/Marketplace/Submission/Rating_Your_Content">获取您应用的排名</a></li> - <li><a href="/zh-CN/Marketplace/Submission/Marketplace_review_criteria" title="向火狐应用市场提交应用必须达到的要求">应用工场审核标准</a></li> - <li><a href="/zh-CN/Marketplace/Publishing/Marketplace_screenshot_criteria" title="关于如何在提交应用时创建有效的截图的一些指引">应用工场截图要求</a></li> - <li><a href="/zh-CN/Marketplace/Publishing/Privacy_policies" title="用户隐私非常重要,您有必要整理并遵守一些用户隐私条款以获取他们的信任。这篇文章会告诉您如何整理用户隐私条款。">隐私条款</a></li> - <li><a href="/zh-CN/Marketplace/Submission/Testing_and_troubleshooting">应用测试与排错</a></li> - </ol> - </li> - <li><a href="/zh-CN/Marketplace/Publishing">应用推广</a> - <ol> - <li><a href="/zh-CN/Marketplace/Publishing/Pricing">应用定价以及应用内购买</a> - <ol> - <li><a href="/zh-CN/Marketplace/Publishing/Pricing/Introduction">简介</a></li> - <li><a href="/zh-CN/Marketplace/Publishing/Pricing/Providers">支付提供商</a> - <ol> - <li><a href="/zh-CN/Marketplace/Publishing/Pricing/Providers/Bango">Bango</a></li> - </ol> - </li> - </ol> - </li> - <li><a href="/zh-CN/Marketplace/Publishing/Updating_apps" title="Information about how both hosted and packaged app updates are handled, and what you need to do to ensure that your app properly supports updating.">更新应用</a></li> - <li><a href="/zh-CN/Marketplace/Publishing/Adding_a_subdomain" title="For security reasons, each app must have its own domain (or subdomain) on the Web. This article covers how to go about creating a subdomain for your app.">为应用添加子域</a></li> - </ol> - </li> - <li><a href="/zh-CN/Marketplace/Monetization">应用获利</a> - <ol> - <li><a href="/zh-CN/Marketplace/Monetization/Profiting_from_your_app" title="This guide contains introductory materials on how to monetize your apps, including tools needed, and a monetization calculator.">从你的应用中获利</a></li> - <li><a href="/zh-CN/Marketplace/Monetization/App_payments_guide">应用付款指南</a></li> - <li><a href="/zh-CN/Marketplace/Monetization/In-app_payments" title="为你的应用提供导入内购支持的指南。">应用内购</a></li> - <li><a href="/zh-CN/Marketplace/Monetization/validating_a_receipt" title="何时如何确认应用购买的指南。">确认购买Validating a receipt</a></li> - <li><a href="/zh-CN/Marketplace/Monetization/App_pricing" title="A round up of fixed price points you can choose for your paid apps, and how these vary across different currencies, along with useful supporting information on dealing with app payments.">应用价格</a></li> - <li><a href="/zh-CN/Marketplace/Monetization/Payments_Status" title="An at-a-glance summary of what countries have got our app payment services set up in them — where paid apps can be distributed">付款状态</a></li> - </ol> - </li> - <li><a href="/zh-CN/Marketplace/APIs">火狐商场APIs</a> - <ol> - <li><a href="/zh-CN/Marketplace/APIs/Marketplace_utility_library" title="我们提供了一个JavaScript库来帮助开发者更容易的在火狐工场中控制内购和确认购买。">火狐商场公共库</a></li> - <li><a href="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/submission.html" title="The Submission API lets you validate your app, update your app, and fetch information about the apps available to be installed.">提交应用API</a></li> - <li><a href="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/payment.html" title="The Payment API lets you get information about and process in-app purchases as well as to simply get information about what pricing tiers are available.">付款API</a></li> - <li><a href="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/overview.html" title="All Marketplace-related documentation is centered here.">火狐商场API</a></li> - </ol> - </li> - <li><a href="/zh-CN/Marketplace/FAQ">火狐商场FAQ</a></li> -</ol> diff --git a/files/zh-cn/archive/mozilla/marketplace/marketplace_apis/index.html b/files/zh-cn/archive/mozilla/marketplace/marketplace_apis/index.html deleted file mode 100644 index 821b22afdf..0000000000 --- a/files/zh-cn/archive/mozilla/marketplace/marketplace_apis/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Firefox Marketplace APIs -slug: Archive/Mozilla/Marketplace/Marketplace_APIs -tags: - - API - - Apps - - Firefox OS Marketplace - - Marketplace -translation_of: Archive/Mozilla/Marketplace/Marketplace_APIs ---- -<div class="summary"> -<p><span class="seoSummary">Links to the main references covering Mozilla's Firefox Marketplace APIs, with which you can handle app submissions, configure a payment account for an app, and more.</span></p> -</div> - -<div class="row topicpage-table"> -<div class="section"> -<dl> - <dt><a href="/en-US/docs/Web/Apps/Publishing/Marketplace_utility_library">Marketplace utility library</a></dt> - <dd>To help you work with the Firefox Marketplace, we provide a JavaScript library you can use in your apps to make it easier to handle in-app payments and verify payment receipts.</dd> - <dt><a href="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/app_submission.html" title="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/app_submission.html">上架API</a></dt> - <dd>The Submission API lets you validate your app, update your app, and fetch information about the apps available to be installed.</dd> - <dt><a href="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/payment.html" title="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/payment.html">支付API</a></dt> - <dd> </dd> - <dd>The Payment API lets you do things like get information about in-app purchases and get information about pricing tiers for various countries.</dd> - <dt><a href="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/overview.html" title="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/overview.html">其他应用市场API</a></dt> - <dd>The full documentation for the Firefox Marketplace APIs.</dd> -</dl> -</div> - -<div class="section"> -<h5 class="Tools" id="Tools" name="Tools">面向应用开发者的工具</h5> -<ul> - <li><a href="https://marketplace.firefox.com/developers/">访问 Firefox 应以市场开发者中心</a></li> - <li><a href="/zh-CN/docs/Mozilla/Firefox_OS/Using_Firefox_OS_Simulator">Firefox OS 模拟器</a></li> - <li><a href="/zh-CN/docs/Apps/App_developer_tools">应用开发者工具</a></li> -</ul> -<h5 class="Documentation" id="Documentation" name="Documentation">技术参考文档</h5> -<div class="twocolumns"> - <ul> - <li><a href="/zh-CN/docs/Web/CSS">CSS</a></li> - <li><a href="/zh-CN/docs/DOM">DOM</a></li> - <li><a href="/zh-CN/docs/Web/HTML">HTML</a></li> - <li><a href="/zh-CN/docs/JavaScript">JavaScript</a></li> - <li><a href="/zh-CN/docs/WebAPI">WebAPI</a></li> - <li><a href="/zh-CN/docs/Web/WebGL">WebGL</a></li> - <li><a href="/zh-CN/docs/SVG">SVG</a></li> - <li><a href="https://www.mozilla.org/zh-CN/apps/">开放网络应用 概览网站</a></li> - <li><a href="https://wiki.mozilla.org/Apps">应用项目 wiki 页面</a></li> - </ul> -</div> -<h5 class="Community" id="Community" name="Community">从社区获取帮助</h5> -<p>如果您还不确定该做的事,欢迎随时加入讨论。</p> -<ul> - <li>咨询 webapps 论坛:<ul> - <li><a href="https://lists.mozilla.org/listinfo/dev-webapps"> 邮件列表</a></li> - - - <li><a href="http://groups.google.com/group/mozilla.dev.webapps"> 新闻组</a></li> - <li><a href="http://groups.google.com/group/mozilla.dev.webapps/feeds"> Web feed</a></li> -</ul> - <ul> - <li>在 Open Web Apps IRC 频道上提问和讨论:<a class="link-irc" href="irc://irc.mozilla.org/openwebapps">#openwebapps</a></li> - </ul> - </li> -</ul> -<p><span class="alllinks"><a href="http://www.catb.org/~esr/faqs/smart-questions.html" rel="external">别忘记<em>网络礼仪</em>...</a></span></p> -</div> -</div> diff --git a/files/zh-cn/archive/mozilla/marketplace/options/self_publishing/index.html b/files/zh-cn/archive/mozilla/marketplace/options/self_publishing/index.html deleted file mode 100644 index 0421e01082..0000000000 --- a/files/zh-cn/archive/mozilla/marketplace/options/self_publishing/index.html +++ /dev/null @@ -1,144 +0,0 @@ ---- -title: 自主发布应用 -slug: Archive/Mozilla/Marketplace/Options/Self_publishing -translation_of: Archive/Mozilla/Marketplace/Options/Self_publishing ---- -<div class="summary"> - <p>可能会出现这样一种情况,你不想让你的应用可以在火狐市场上得到,比如,你可能想要把应用分发给你组织中的成员,进行beta版本测试或者只是单纯的做你自己的事。这种情况下你可以直接使用应用源文件在Firefox OS设备上安装和使用应用,而不是发布到火狐市场。</p> -</div> -<p>安装到 Firefox OS 上的 Open Web Apps, 使用 {{ domxref("Apps.install") }} or {{ domxref("Apps.installPackage") }} 运行在设备上或桌面版中。 这两种情况下, 这些 API 都是通过发送描述要安装的 app 的 manifest URL 来安装的。因此自行发布应用的基本要求如下:</p> -<ol> - <li>服务器中包含 app 的manifest</li> - <li>服务器中包含 app (对 host app 而言) 或 app 的打包 zip 文件</li> - <li>在网站上的代码会合适的调用 {{ domxref("Apps.install") }} or {{ domxref("Apps.installPackage") }}</li> -</ol> -<h2 id="局限性">局限性</h2> -<p>在利用自主发布 web 应用之前,你应该了解以下局限性:</p> -<ul> - <li>自主发布应用不可以使用<a href="/en-US/Apps/Build/App_permissions">特殊和认证权限API</a>。要使用这些API需要签名使用火狐市场的提交流程。</li> - <li>你的应用不可以使用火狐市场的应用内购买功能。</li> - <li>你需要实现你自己的搜索技术,因为你借助火狐市场列表中完成。</li> -</ul> -<h2 id="自主发布打包型应用(packed_apps)">自主发布打包型应用(packed apps)</h2> -<p>你可以通过在一个服务器上托管应用的 ZIP 文件及 min-manifest 的方式自己发布一个 package App。mini-manifest 文件必须和 ZIP 在同一目录下,用于识别 app 的安装过程。你可以创建一个脚本来调用 {{ domxref("Apps.installPackage") }}从而传递 mini-manifest 的具体信息。我们来看一下这个过程:</p> -<h3 id="步骤">步骤</h3> -<ol> - <li> - <p>压缩你的应用内容并命名为<code>package.zip。这个文件应该包含所有的应用资源,包括应用清单。</code></p> - <div class="warning"> - <p>注意:你必须要小心你希望出现在打包应用中的压缩内容,不是包含这些内容的目录。如果你压缩的是父目录,应用清单文件将会无法找到,导致打包型应用不可用。</p> - </div> - </li> - <li>创建一个名称为 <code>manifest.webapp</code> 的文件,添加内容如下。这个文件也称为 mini-manifest, 因为它是 manifest 文件的裁剪版本,放置在 Packaged App ZIP 文件中。 它会被{{ domxref("Apps.installPackage") }}所调用以承接 app 的安装任务。要获得更多的细节,请查看下面的 <a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Marketplace/Options/Self_publishing$edit#Mini-manifest_fields">Mini-manifest 字段</a> 。<br> - <pre class="brush: js language-js"><code class="language-js"><span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"My sample app"</span><span class="token punctuation">,</span> - <span class="token string">"package_path"</span> <span class="token punctuation">:</span> <span class="token string">"http://my-server.com/my-app-directory/package.zip"</span><span class="token punctuation">,</span> - <span class="token string">"version"</span><span class="token punctuation">:</span> <span class="token string">"1"</span><span class="token punctuation">,</span> - <span class="token string">"developer"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"A. Developer"</span><span class="token punctuation">,</span> - <span class="token string">"url"</span><span class="token punctuation">:</span> <span class="token string">"http://my-server.com"</span> - <span class="token punctuation">}</span> -<span class="token punctuation">}</span></code></pre> - </li> - <li>创建安装 app 的脚本文件。此处我们使用了简单的 HTML 文件 <code>index.html</code>,但是你可以将脚本添加到按钮或使用其他合适的方法来在你的站点上调用。 这个页面的JavaScript 会调用 the Packaged App installer API ({{ domxref("Apps.installPackage") }}) 而且还包括了一些回调函数,用于提供安装是否成功的提示信息。 - <pre class="brush: html language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>html</span><span class="token punctuation">></span></span> - <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>body</span><span class="token punctuation">></span></span> - <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>p</span><span class="token punctuation">></span></span>Packaged app installation page<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>p</span><span class="token punctuation">></span></span> - <span class="token script"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span><span class="token punctuation">></span></span> - <span class="token comment"> // This URL must be a full url. -</span> <span class="token keyword">var</span> manifestUrl <span class="token operator">=</span> <span class="token string">'http://my-server.com/my-app-directory/manifest.webapp'</span><span class="token punctuation">;</span> - <span class="token keyword">var</span> req <span class="token operator">=</span> navigator<span class="token punctuation">.</span>mozApps<span class="token punctuation">.</span><span class="token function">installPackage<span class="token punctuation">(</span></span>manifestUrl<span class="token punctuation">)</span><span class="token punctuation">;</span> - req<span class="token punctuation">.</span>onsuccess <span class="token operator">=</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> - <span class="token function">alert<span class="token punctuation">(</span></span><span class="token keyword">this</span><span class="token punctuation">.</span>result<span class="token punctuation">.</span>origin<span class="token punctuation">)</span><span class="token punctuation">;</span> - <span class="token punctuation">}</span><span class="token punctuation">;</span> - req<span class="token punctuation">.</span>onerror <span class="token operator">=</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> - <span class="token function">alert<span class="token punctuation">(</span></span><span class="token keyword">this</span><span class="token punctuation">.</span>error<span class="token punctuation">.</span>name<span class="token punctuation">)</span><span class="token punctuation">;</span> - <span class="token punctuation">}</span><span class="token punctuation">;</span> - <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span></span> - <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>body</span><span class="token punctuation">></span></span> -<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>html</span><span class="token punctuation">></span></span></code></pre> - </li> - <li>通过拷贝 <code>package.zip</code>, <code>package.manifest</code>, 和<code>index.html</code> 到你选定目录(<code> 本例中是 my-app-directory</code> )在你的服务器或站点上配置文件。</li> - <li>现在你就可以使用一个兼容的设备(如 Firefox OS 手机)来安装 app 了。打开 <code>index.html</code> 文件后 (本例中的路径是 <code> <a class="LinkyMobile-ext" href="http://my-server.com/my-app-directory/package.manifest" title="Linkification: http://my-server.com/my-app-directory/package.manifest">http://my-server.com/my-app-directory/index.html</a></code>) 你就会得到一个弹出框,询问你是否想要安装应用。继续安装过程,一旦完成,你的 Web 页面就会提供一个安装成功或失败的提示信息。</li> -</ol> -<div class="note"> - <p>提示: 你可以将 Package App 托管在本地,并在设备上测试。Web Server 和设备必须网络相同,服务器必须能够处理本地网络的请求。你只需要在 mini-manifest 的 <code>package_path </code>中包含绝对路径(如下所示)。如果你使用了非标准端口,记得要包含端口信息,例如 <code><a class="LinkyMobile-ext" href="http://10.10.12.1:8080/package.zip" title="Linkification: http://10.10.12.1:8080/package.zip">http://10.10.12.1:8080/package.zip</a></code>.</p> -</div> -<h3 id="Mini-manifest_字段">Mini-manifest 字段</h3> -<p>当火狐市场为你的应用生成一个迷你清单,它会从你的应用清单中取出信息填充一些字段。你可以在<a href="/en-US/docs/Web/Apps/Manifest">应用清单</a>中找到这些字段的说明。而迷你清单中独有的字段有<code>package_path</code>, <code>release_notes和</code> <code>size</code>。<code>而迷你清单中的name</code>, <code>version</code>, <code>developer</code>和<code>locales字段必须和应用清单相同。</code></p> -<p>这里有一些关于在本地调试时,迷你清单相关的信息:</p> -<dl> - <dt> - <code>name</code></dt> - <dd> - (必须) 应用名称,最大长度128个字符。</dd> - <dt> - <code>package_path</code></dt> - <dd> - (必须) 可以找到应用zip文件的URL。确保<code>package_path是zip文件所在的绝对路径</code></dd> - <dt> - <code>version</code></dt> - <dd> - 应用的版本号。</dd> - <dt> - <code>size</code></dt> - <dd> - 应用zip文件的字节数。这对于本地测试不是必须,但是会在安装过程中提供一个进度条。</dd> -</dl> -<pre class="brush: js language-js"><code class="language-js"><span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"My app"</span><span class="token punctuation">,</span> - <span class="token string">"package_path"</span><span class="token punctuation">:</span> <span class="token string">"http://thisdomaindoesnotexist.org/myapp.zip"</span><span class="token punctuation">,</span> - <span class="token string">"version"</span><span class="token punctuation">:</span> <span class="token string">"1.0"</span><span class="token punctuation">,</span> - <span class="token string">"size"</span><span class="token punctuation">:</span> <span class="token number">172496</span><span class="token punctuation">,</span> - <span class="token string">"release_notes"</span><span class="token punctuation">:</span> <span class="token string">"First release"</span><span class="token punctuation">,</span> - <span class="token string">"developer"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Developer Name"</span><span class="token punctuation">,</span> - <span class="token string">"url"</span><span class="token punctuation">:</span> <span class="token string">"http://thisdomaindoesnotexist.org/"</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"locales"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"fr-FR"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Mon application"</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"se-SE"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Min balla app"</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"icons"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"16"</span><span class="token punctuation">:</span> <span class="token string">"/icons/16.png"</span><span class="token punctuation">,</span> - <span class="token string">"32"</span><span class="token punctuation">:</span> <span class="token string">"/icons/32.png"</span><span class="token punctuation">,</span> - <span class="token string">"256"</span><span class="token punctuation">:</span> <span class="token string">"/icons/256.png"</span> - <span class="token punctuation">}</span> -<span class="token punctuation">}</span></code></pre> -<dl> - <dt> - </dt> - <dt> - <code>release_notes</code></dt> - <dd> - 应用发行的相关信息。在火狐市场中,这些信息会出现在提交过程中的一个页面中。</dd> - <dt> - <code>developer</code></dt> - <dd> - 开发者相关信息,包括<code>name</code>和 <code>url字段。开发者信息需要迷你清单和zip中的主要清单一致。</code></dd> - <dt> - <code>locales</code></dt> - <dd> - 本地化信息。值应该是<code>xx-YY格式。</code></dd> - <dt> - <code>icons</code></dt> - <dd> - 应用图标。</dd> -</dl> -<div class="note"> - <p><strong>注意:</strong>在迷你清单和应用清单中的许多值需要一致,否则会导致安装失败。最安全的方式是把应用清单中的内容拷贝到迷你清单中然后加上<code>package_path</code>。</p> -</div> -<h2 id="自行发布托管应用_Hosted_Apps">自行发布托管应用 Hosted Apps</h2> -<p>与 Packaged Apps 相比, 自行发布 Hosted App 是更直接的方式。is more straightforward, if you create its content in the same way as you would for Firefox Marketplace publication. This basically means creating the <a href="https://developer.mozilla.org/en-US/Apps/Build/Manifest" title="Manifest documentation">manifest file</a> for your app. You then need to add the code to invoke {{ domxref("Apps.install") }}. This code is essentially the same as that you would use for a Packaged App, shown above, the only difference being that you can make relative reference to the location of the manifest file if you wish.</p> -<h2 id="参考">参考</h2> -<ul> - <li><a href="https://developer.mozilla.org/en-US/Apps/Build/JavaScript_API">App Installation and Management APIs</a></li> - <li>{{ domxref("Apps.install") }}</li> - <li>{{ domxref("Apps.installPackage") }}</li> - <li><a href="https://developer.mozilla.org/en-US/Apps/Build/Manifest" title="Manifest documentation">App manifest</a></li> - <li><a href="https://developer.mozilla.org/en-US/Apps/Build/App_permissions">App permissions</a></li> -</ul> diff --git a/files/zh-cn/archive/mozilla/marketplace/options/打包_应用程序/index.html b/files/zh-cn/archive/mozilla/marketplace/options/打包_应用程序/index.html deleted file mode 100644 index 87dfaf1675..0000000000 --- a/files/zh-cn/archive/mozilla/marketplace/options/打包_应用程序/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: 封装的应用程序 -slug: Archive/Mozilla/Marketplace/Options/打包_应用程序 -tags: - - 封装应用程序 - - 应用市场 - - 应用程序发布 - - 应用程序种类 -translation_of: Archive/Mozilla/Marketplace/Options/Packaged_apps ---- -<div class="summary"> - <p><span class="seoSummary">一个封装的应用程序app就是把开放式Web应用程序的所有资源(HTML,CSS,JavaScript,应用程序的manifest,等等)<span class="seoSummary">封装</span>进一个ZIP文件,而不是将这些资源放在一个Web服务器上。这篇文档从一个开发者的视角提供了<span class="seoSummary">封装</span>应用程序的介绍,并且链接了你需要知道的有关<span class="seoSummary">封装</span>应用程序app的一切。 </span></p> -</div> -<p>一个<span class="seoSummary">封装</span>的应用程序就是一个zip文件, 它包含了能够使Web应用程序运行的所有资源, 并且在zip文件的根目录下包含有应用程序的<a href="/en-US/docs/Web/Apps/Manifest">manifest</a> 文件。应用程序的manifest提供了应用程序的详细信息,如:程序的描述, 图标等。如此<span class="seoSummary">封装</span>的应用程序然后才能够安装到Firefox OS设备, <a href="/en-US/Marketplace/Options/Open_web_apps_for_android">Android设备</a>,以及<a href="/en-US/Marketplace/Options/Open_web_apps_for_desktop">电脑桌面</a>。安装的应用程序在设备上运行时,仍然能够访问Web上面的资源,如在一个Web服务器上的数据库。</p> -<p><a href="#types_of_packaged_apps"><span class="seoSummary">封装</span>的应用程序分三种类型</a>: Web应用程序, 特权应用程序和认证的应用程序。虽然<span class="seoSummary">封装</span>应用程序能够发布任何开放的Web应用,但是特权应用和认证应用需要数字签名才能使用<a href="/en-US/Apps/Build/App_permissions">特权和认证API</a>。特权应用程序签名是应用市场审查流程的一部分,而认证应用程序签名是由设备厂商和运营商完成的。</p> -<p>除了使用特权和认证API的能力之外,<span class="seoSummary">封装</span>应用程序安装到设备上之后,所有应用程序的资源都位于设备中,这也为用户提供了更快速的程序启动及响应。基于这些特征,<span class="seoSummary">封装</span>应用程序是开放Web应用程序发布到Firefox OS设备,<a href="/en-US/Marketplace/Options/Open_web_apps_for_android">Android设备</a>以及<a href="/en-US/Marketplace/Options/Open_web_apps_for_desktop">桌面</a>的推荐方法。</p> -<div class="note"> - <p><strong>注意:</strong> 当前的Firefox应用市场支持Web和特权<span class="seoSummary">封装的</span>应用。另外,Firefox应用市场仅仅支持Firefox OS的付费应用,并且支持Firefox OS, Android Firefox以及桌面Firefox的免费应用程序。 支持所有平台的的付费应用正在开发当中。</p> -</div> -<h2 id="封装应用程序的种类"><strong><span class="seoSummary">封装</span>应用程序的种类</strong></h2> -<p>共有三种类型的<span class="seoSummary">封装</span>应用程序:Web应用程序,特权应用程序及认证应用程序。每种类型的<span class="seoSummary">封装</span>应用程序分别对应于Firefox OS中实现的<a href="https://developer.mozilla.org/en-US/Firefox_OS/Security/Security_model#App_Security">应用程序安全</a>模型的一个等级,本章接下来提供每个种类应用程序的更多信息。</p> -<h3 id="Web应用程序">Web应用程序</h3> -<p>web应用程序是没有使用特权和内置(认证的)API的程序, 当提交到应用市场的<span class="seoSummary">封装</span>应用程序被签注时,使用特殊的授权进程来保证特权和内置应用不被执行,因此Web应用程序不能使用特权和内置的APIs,这些应用程序也不需要特权和认证应用程序所要求的<a href="/en-US/Apps/CSP">内容安全政策</a>。</p> -<p>Web应用在他的manifest.webapp文件中没有要求一定要有type域,因为type的默认值web就是正确的值。</p> -<div class="note"> - <p><strong>注意</strong>: Web应用可以 <a href="/en-US/Marketplace/Options/Self_publishing">自行发布</a> 或者通过Firefox应用市场来发布。</p> -</div> -<div class="note"> - <p><strong>注意</strong>: Web应用也可以使用<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Hosted_apps">托管应用程序(Hosted App)</a>机制来发布。</p> -</div> -<h3 id="特权应用程序"><strong>特权应用程序</strong></h3> -<p>特权应用是使用了特权APIs的应用程序,与iOS和Android平台上的原生应用程序类似。当特权应用被提交到Firefox应用市场时,通过一个特别的进程来审核。这个审核进程给了应用程序用户一定程度的保障,潜在的安全,隐私及性能问题等都得到了仔细的审查。</p> -<p>要指定一个应用为特权应用程序,只要在他的manifest.webapp文件中增加<a href="/en-US/docs/Web/Apps/Manifest#type"><code>type域</code></a>,并设定他的值为privileged。你的应用程序要访问的每个特权API都必须添加到应用程序<a href="/en-US/docs/Web/Apps/Manifest">manifest</a>中的permissions域中。</p> -<p>Firefox OS和Android运行环境以及desktop对于特权应用程序强行使用下面的内容安全政策<a href="/en-US/docs/Security/CSP/Introducing_Content_Security_Policy">(CSP)</a>:</p> -<pre class="brush: js">"default-src *; script-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'"</pre> -<div class="note"> - <p><strong>注意</strong>: 特权应用程序只能通过Firefox应用市场来发布。</p> -</div> -<h3 id="内置应用程序"><strong>内置应用程序</strong></h3> -<div class="geckoVersionNote"> - <p>内置应用程序不像第三方开发者创建的应用程序,内置应用程序通常不是总是可用的,并且不能通过Firefox应用市场发布。内置APIs长期的目标是加强(harden)内置API的认证,使他们像特权程序一样可用。如果你有兴趣了解如何使一个特殊API可用,请在<a href="https://lists.mozilla.org/listinfo/dev-webapps">dev-webapps</a>邮件列表中提供反馈。</p> -</div> -<p>内置应用是使用了内置认证API的应用程序,他提供了访问设备上诸如默认的拨号器,系统设置应用这些关键系统功能。相对于特权应用程序,内置应用程序中的API权限许可都是隐含的,就是说他们不需要用户明确的核准即可使用。内置应用程序必须要设备厂商或运营商核准。</p> -<p>要指定一个程序为内置应用程序,在manifest.webapp中设定<a href="/en-US/docs/Web/Apps/Manifest#type"><code>type</code></a>域为certified。你的应用程序要访问的每个特权API和内置API都必须添加到应用程序<a href="/en-US/docs/Web/Apps/Manifest">manifest</a>中的permissions域中。</p> -<p>Firefox OS为内置应用程序实现了下面的内容安全政策CSP:</p> -<pre class="brush: js">"default-src *; script-src 'self'; object-src 'none'; style-src 'self'"</pre> -<p>相对特权应用程序,内置应用为CSP实现了更严格的规则。如果你想要了解背后的原因,请查阅 <a href="https://wiki.mozilla.org/Apps/Security#Default_CSP_policy">默认CSP政策</a> 和 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=768029">Bug 768029。</a></p> -<div class="note"> - <p><strong>注意</strong>: 内置应用程序只能通过设备制造商或运营商来预装到设备中,不能透过其他任何方式发布。</p> -</div> -<div class="note"> - <p><strong>注意</strong>: 内置应用程序的内部代号是认证应用程序。</p> -</div> -<h2 id="测试封装的应用程序"><strong>测试<span class="seoSummary">封装</span>的应用程序</strong></h2> -<p>为了测试目的,要安装<span class="seoSummary">封装</span>的应用程序到Firefox OS模拟器或设备,请参考<a href="/en-US/Firefox_OS/Using_the_App_Manager">应用程序管理器</a>。 另外,你能够从Web服务器上面安装一个<span class="seoSummary">封装</span>应用程序到设备上,参考<a href="/en-US/Marketplace/Options/Self_publishing">自行发布应用程序</a>中描述的步骤。 记住当你要自行发布应用程序时,只有<span class="seoSummary">封装</span>的应用程序才能被安装。</p> -<h2 id="发布应用程序"><strong>发布应用程序</strong></h2> -<p align="left">你有两种选择来发布你的应用程序:一个是在Firefox应用市场,另一个是自行发布。</p> -<h3 id="Firefox应用市场发布程序"><strong>Firefox应用市场发布程序</strong></h3> -<p align="left">提交<span class="seoSummary">封装</span>的应用程序到Firefox应用市场的过程在<a href="/en-US/Marketplace/Publishing"> 应用发布</a> 章节有已经有描述。</p> -<p align="left">当你提交你的<span class="seoSummary">封装</span>的应用程序时, ZIP文件存储在Firefox应用市场的服务器里面,并且应用市场基于你ZIP文件中的应用程序manifest生成一个新的叫做mini-manifest的manifest。当用户安装你的应用程序时,mini-manifest被传递给<a href="/en-US/docs/Web/API/Apps.installPackage"><code>Apps.installPackage()</code></a><u>函数</u> 来安装应用程序。mini-manifest的存在是为了安装和升级的目的,并不在你运行应用程序时使用。</p> -<h3 id="自行发布">自行发布</h3> -<p>自行发布应用程序到Firefox应用市场外也是可能的,如在你自己的web服务器上面发布。详细内容请参考<a href="/en-US/Marketplace/Options/Self_publishing"> 自行发布应用程序</a>。</p> -<h2 id="更新封装的应用程序">更新<span class="seoSummary">封装</span>的应用程序</h2> -<p>更多有关更新应用程序的信息,请参考<a href="/en-US/docs/Web/Apps/Updating_apps"> 跟新应用程序 </a>章节。</p> -<h2 id="更多信息">更多信息</h2> -<ul> - <li><a href="/en-US/Firefox_OS/Security/Security_model">Firefox OS安全概要</a></li> - <li><a href="/en-US/Firefox_OS/Security/Application_security">应用程序安全</a></li> - <li><a href="https://github.com/robnyman/Firefox-OS-Boilerplate-App" title="https://github.com/robnyman/Firefox-OS-Boilerplate-App">Firefox OS样板应用程序</a></li> -</ul> -<p> </p> diff --git a/files/zh-cn/archive/mozilla/marketplace/options/简介/index.html b/files/zh-cn/archive/mozilla/marketplace/options/简介/index.html deleted file mode 100644 index 383e510b48..0000000000 --- a/files/zh-cn/archive/mozilla/marketplace/options/简介/index.html +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: 简介 — 你的发布选项 -slug: Archive/Mozilla/Marketplace/Options/简介 -tags: - - Firefox OS - - 应用市场 - - 应用程序 - - 简介 -translation_of: Archive/Mozilla/Marketplace/Options/Introduction ---- -<div class="summary"> - <p>Firefox应用市场提供了直达你发布的应用程序的通道,并且使他们能够被Firefox OS,安卓Firefox以及Desktop用户很容易地发现。无论如何,它不是你应用程序发布的唯一选择。在这章节里,你将会发现你能够投递你的应用程序的形式,以及在安卓设备和PC桌面的Firefox浏览器中启用应用程序的机制,你能够发现在Firefox OS设备上的可用内存是如何影响你的应用程序,自行发布应用程序的选项和创建你自己的应用市场的方法。</p> -</div> -<h2 id="你的发布选项">你的发布选项</h2> -<div class="twocolumns"> - <dl> - <dt> - <a href="/en-US/Marketplace/Options/Packaged_apps">封装的应用程序</a></dt> - <dd> - 找到有关投递应用程序的首选方法,这个方法为你提供了访问特权和安全应用程序接口(APIs)。</dd> - <dt> - <a href="/en-US/Marketplace/Options/Hosted_apps">托管应用程序</a></dt> - <dd> - 找到如何使你的应用程序从服务器上运行,而给用户本地安装应用程序一样的体验。</dd> - <dt> - <a href="/en-US/Marketplace/Options/Packaged_or_hosted_">封装还是托管 ?</a></dt> - <dd> - 使用这个检查表来决定哪一个投递格式最适合你的应用程序。</dd> - <dt> - <a href="/en-US/Marketplace/Options/Open_web_apps_for_android">Android平台开放Web应用</a></dt> - <dd> - Firefox市场应用程序现在已经以APK的形式发布给了安卓用户,你能够启动它来安装并使用你的应用程序,像你使用其他安卓应用成成一样。你能够在这儿发现这是如何做到的。</dd> - <dt> - <a href="/en-US/Marketplace/Options/Open_web_apps_for_desktop">桌面开放Web应用</a></dt> - <dd> - 你的web应用程序现在通过Firefox桌面浏览器安装到了Windows、Mac以及Linux 个人电脑。使用户能够像运行其他桌面应用程序一样运行你的Web应用程序。找出它是如何做到的。</dd> - <dt> - 内存事项</dt> - <dd> - Firefox OS devices come with a range of memory configurations, find out how this affects your apps and how to make sure they will run on all Firefox OS devices.</dd> - <dt> - <a href="/en-US/Marketplace/Options/Self_publishing">自行发布应用程序</a></dt> - <dd> - 在一些场合,如你想要在Firefox市场外的地方发布应用程序,或者为了测试,或在你的企业内分发。找到有关你的选项及如何实现他们。</dd> - <dt> - <a href="/en-US/Marketplace/Options/Creating_a_store">创建你自己的应用市场</a></dt> - <dd> - 不管你是否是在Firefox应用市场发布你的应用程序,亦或自行发布,你有很多在商店里呈现他们的选项。本章节聚焦在这些选项和你怎样实现他们。</dd> - <dt> - </dt> - <dd> - </dd> - </dl> -</div> -<p> </p> diff --git a/files/zh-cn/archive/mozilla/marketplace/prepare/introduction/index.html b/files/zh-cn/archive/mozilla/marketplace/prepare/introduction/index.html deleted file mode 100644 index 9e23e87760..0000000000 --- a/files/zh-cn/archive/mozilla/marketplace/prepare/introduction/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: 简介 — 为成功而准备 -slug: Archive/Mozilla/Marketplace/Prepare/Introduction -translation_of: Archive/Mozilla/Marketplace/Prepare/Introduction ---- -<div class="summary"> -<p><span class="seoSummary">学习关于如何创建优质Firefox Marketplace应用或人们所爱的游戏的相关知识,基于你的粉丝建立全球用户网。</span></p> -</div> - -<p>Creating a successful Open Web App isn't just about great coding for a great open platform. Whether you’re coding for pleasure and the joy of sharing your ideas, or you want to build a business from your coding activities, you’ll want users to download and use your apps.</p> - -<p>This section contains the advice you need to achieve your goals in terms of app downloads, revenue and use.</p> - -<dl> - <dt> - <p><a href="/zh-CN/Marketplace/Prepare/Deciding_what_to_build">决定制作什么</a></p> - </dt> - <dd> - <p>一个伟大的应用由一个伟大的点子开始。指导你如何选择开发什么样的应用。</p> - </dd> - <dt> - <p><a href="/zh-CN/Marketplace/Prepare_For_Success/Getting_to_know_your_users">了解你的用户</a></p> - </dt> - <dd> - <p>Understanding your users and what they are looking for in your apps is critical to success.</p> - </dd> - <dt> - <p><a href="/zh-CN/Marketplace/Prepare/Choosing_your_business_model">选择你的商业模式</a></p> - </dt> - <dd> - <p>为你的应用或游戏寻找合适的商业模式,如何运用他们。</p> - </dd> - <dt> - <p><a href="/zh-CN/Marketplace/Prepare/Localizing_your_apps">应用本地化</a></p> - </dt> - <dd> - <p>把你的应用带给全世界意味着为全球用户进行应用本地化。了解如何本地化你的应用。</p> - </dd> - <dt> - <p><a href="/zh-CN/Marketplace/Prepare/Promoting_your_app">推广你的应用</a></p> - </dt> - <dd> - <p>Firefox Marketplace is a great way for users to discover apps, but to achieve the downloads you deserve you’ll need to shout about your app. Find out how to make a noise.</p> - </dd> - <dt> - <p><a href="/zh-CN/Marketplace/Prepare/Creating_your_community">Creating your community</a></p> - </dt> - <dd> - <p>Nurture and grow a vibrant community around your apps and tap into their enthusiasm and expertise.</p> - </dd> -</dl> - -<dl> -</dl> - -<dl> -</dl> diff --git a/files/zh-cn/archive/mozilla/marketplace/publishing/submit/index.html b/files/zh-cn/archive/mozilla/marketplace/publishing/submit/index.html deleted file mode 100644 index a6e3468169..0000000000 --- a/files/zh-cn/archive/mozilla/marketplace/publishing/submit/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Submit -slug: Archive/Mozilla/Marketplace/Publishing/Submit -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit ---- -<p>This section describes the process for submitting an app to Firefox Marketplace</p> -<p>Residual details: <a href="/en-US/Marketplace/Publishing/Submit/Submitting_an_app">https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/Submitting_an_app</a></p> diff --git a/files/zh-cn/archive/mozilla/rdf_datasource_how-to/index.html b/files/zh-cn/archive/mozilla/rdf_datasource_how-to/index.html deleted file mode 100644 index a75e5268f2..0000000000 --- a/files/zh-cn/archive/mozilla/rdf_datasource_how-to/index.html +++ /dev/null @@ -1,231 +0,0 @@ ---- -title: RDF 数据源 How-To -slug: Archive/Mozilla/RDF_Datasource_How-To -tags: - - RDF -translation_of: Archive/Mozilla/RDF_Datasource_How-To ---- -<p> </p> -<div class="warning"> - <p>This article is at least partially outdated. Help bring it up to date, if you can. <span class="comment">The XPCOM registration parts and the "As of this writing, it is not currently possible to implement JavaScript XPCOM components" comment seem outdated didn't check the whole article.</span></p> -</div> -<p>This document is a cookbook that describes how to create a - <i> - native, client-side datasource</i> - that works with Mozilla's <a href="cn/RDF">RDF</a> implementation. It supercedes (and borrows from) the <a class="external" href="http://www.mozilla.org/rdf/doc/rdfdatasources.html">original document</a> put together by <a class="link-mailto" href="mailto:rjc@netscape.com">Robert Churchill</a>.</p> -<h3 id="What_is_a_datasource.3F" name="What_is_a_datasource.3F">What is a datasource?</h3> -<p>The "RDF universe" consists of a set of - <i> - statements</i> - about Internet - <i> - resources</i> - ; for example, "my home page was last modified April 2nd", or "that news article was sent by Bob". In the most abstract sense, a - <i> - datasource</i> - is a collection of such statements.</p> -<p>More concretely, a datasource is a - <i> - translator</i> - that can present information as a collection of RDF statements. For example, a "file system datasource" would translate the file system into statements like "/tmp is a directory" and "/tmp/foo is contained within /tmp". An "IMAP datasource" would use the IMAP protocol to translate your mail server's inbox as a collection of statements like "message number 126's subject is 'make money fast on the Internet'" and "message number 126 was sent by <a class="link-mailto" href="mailto:'spammer128@hotmail.com" rel="freelink">'spammer128@hotmail.com</a>'". An "address book" datasource could translate a database file into statements like "<a class="link-mailto" href="mailto:spammer128@hotmail.com's" rel="freelink">spammer128@hotmail.com's</a> real name is 'Billy Dumple'" and "<a class="link-mailto" href="mailto:spammer128@hotmail.com" rel="freelink">spammer128@hotmail.com</a> is considered an 'important friend'."</p> -<p>Statements from one datasource can be combined with statements from another datasource using a - <i> - composite datasource</i> - . By combining statements from the IMAP datasource and address book datasource, above, we'd be able to identify the sender of "message 126" as an "important friend".</p> -<h3 id="Deciding_on_a_vocabulary" name="Deciding_on_a_vocabulary">Deciding on a vocabulary</h3> -<p>The - <i> - vocabulary</i> - is the set of properties that you will use to express relationships between elements (resources and literals) in your data model. The first question that you must answer is "should I use an existing vocabulary, or invent my own?" A reasonable answer is, "use an existing vocabulary unless you - <i> - absolutely must</i> - invent your own." This will allow your datasource to be integrated with other datasources with a minimum of effort.</p> -<p>There are several existing vocabularies of note, including:</p> -<ul> - <li><a class="external" href="http://www.w3.org/TR/PR-rdf-schema/">The RDF Schema Specification</a>. This vocabulary is a "meta vocabulary" that is used to specify other vocabularies.</li> - <li><a class="external" href="http://purl.oclc.org/dc/">The Dublin Core</a>. This vocabulary is useful for describing electronic resources. It contains elements for authorship, subject, publication date, etc.</li> -</ul> -<h3 id="Mapping_your_data_to_nodes_and_arcs" name="Mapping_your_data_to_nodes_and_arcs">Mapping your data to nodes and arcs</h3> -<p><b>[write me!]</b></p> -<h3 id="Implementing_the_nsIRDFDataSource_interface" name="Implementing_the_nsIRDFDataSource_interface">Implementing the <tt>nsIRDFDataSource</tt> interface</h3> -<p>Your first chore will be to implement the <tt><a class="external" href="http://lxr.mozilla.org/seamonkey/source/rdf/base/idl/nsIRDFDataSource.idl">nsIRDFDataSource</a></tt> interface. There are basically two approaches that you can take in this endeavor:</p> -<ol> - <li> - <p> - <i> - Delegate to an inner proxy</i> - . For example, you may choose to delegate to the - <i> - in-memory datasource</i> - , which is a generic datasource that implements <tt>nsIRDFDataSource</tt>.</p> - <p>Typically, you provide a parser for reading in some sort of static storage (e.g., a data file); the parser translates the datafile into a series of calls to <tt>Assert()</tt> to set up the in-memory datasource. When <tt>Flush()</tt> is called, or the last reference to the datasource is released, a routine walks the in-memory datasource and re-serializes the graph back to the original file format. For examples of an implementation like this, look at the <a class="external" href="http://lxr.mozilla.org/seamonkey/source/rdf/base/src/nsRDFXMLDataSource.cpp">RDF/XML datasource</a> or the <a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/components/bookmarks/src/nsBookmarksService.cpp">bookmarks datasource</a>.</p> - <p>You may want to choose this implementation if your primary goal is to "wrap" a legacy data store. This implementation may cause problems if your data store can be modified "on the fly" by other agents.</p> - </li> - <li> - <p> - <i> - Aggregate the in-memory datasource</i> - . This is an extreme case of delegation, where you use XPCOM - <i> - aggregation</i> - to implement the <tt>nsIRDFDataSource</tt> interface. See <a href="cn/Aggregating_the_In-Memory_Datasource">Aggregating the In-Memory Datasource</a> for technical details.</p> - <p>If you take this approach, you won't be able to selectively implement methods of the <tt>nsIRDFDataSource</tt> interface; instead, - <i> - all</i> - of the methods will be "forwarded" to the in-memory datasource. This can be useful if your datasource is "read-only", and you aren't worried about modification using <tt>Assert()</tt>, etc.</p> - </li> - <li> - <p> - <i> - Implement the interface yourself</i> - . If you choose this route, you'll need to implement each of the <tt>nsIRDFDataStore</tt> methods "by hand". Although this is more work, it is really the only way to create a "live" datasource that may be changed by some outside agent.</p> - <p>The <a class="external" href="http://lxr.mozilla.org/seamonkey/source/rdf/datasource/src/nsFileSystemDataSource.cpp">file system datasource</a> and <a class="external" href="http://lxr.mozilla.org/seamonkey/source/mailnews/base/src/nsMsgFolderDataSource.cpp">local mail datasource</a> are good examples of datasources that have been implemented this way.</p> - <p>You'll probably need to choose this implementation if your datasource is "live", and may be modified or altered by some outside agent (e.g., new mail arriving). You may also need to choose this implementation if the data set which your datasource is modeling is too large to fit in to memory (e.g., the entire file system structure).</p> - </li> -</ol> -<p><b>[More info on what each method needs to do - <i> - here</i> - ]</b></p> -<h4 id="RDF_Commands" name="RDF_Commands">RDF Commands</h4> -<p><b>[Describe what commands are, and why you'd implement them.]</b></p> -<h3 id="Registering_the_datasource_component" name="Registering_the_datasource_component">Registering the datasource component</h3> -<p>A datasource is an <a href="cn/XPCOM">XPCOM</a> component. As such, it must (currently, see <a href="#footnote1">[1]</a>) have:</p> -<ol> - <li>An XPCOM - <i> - CLSID</i> - to identify the data source implementation</li> - <li>An implementation class (that corresponds to the CLSID) whose code lives in a DLL. The DLL must be located in the XPCOM <tt>components</tt> directory</li> - <li>A - <i> - factory</i> - that is - <i> - registered</i> - to an XPCOM - <i> - ProgID</i> - in order to be instantiated from the repository.</li> -</ol> -<p>Constructing a DLL for a component is beyond the scope of this document; the reader is referred to <a class="external" href="http://lxr.mozilla.org/seamonkey/source/rdf/build/nsRDFFactory.cpp">the RDF factory</a> as a guideline.</p> -<p>Registering an RDF datasource is fairly simple: in the DLL's <tt>NSRegisterSelf()</tt> method, you simply call the - <i> - component manager'</i> - s <tt>RegisterComponent()</tt> method:</p> -<pre class="eval">extern "C" PR_IMPLEMENT(nsresult) -NSRegisterSelf(nsISupports* aServiceManager, const char* aPath) -{ - nsresult rv; - ... - // Assume compMgr refers to the component manager - rv = compMgr->RegisterComponent(kMyDataSourceCID, - "My Data Source", - NS_RDF_DATASOURCE_PROGID_PREFIX "my-datasource", - aPath, PR_TRUE, PR_TRUE); - ... -} -</pre> -<p>Replace <tt>kMyDataSourceCID</tt> with your datasource's CLSID. Replace <tt>"My Data Source"</tt> with a descriptive string that should appear in the registry. Finally, replace <tt>"my-datasource"</tt> with a value appropriate for your datasource. This value, when prefixed with <tt>"rdf:"</tt>, is a - <i> - datasource identifier</i> - , and may be used with <tt><a class="external" href="http://lxr.mozilla.org/seamonkey/source/rdf/base/idl/nsRDFInterfaces.idl#384">nsIRDFService::GetDataSource()</a></tt> to retrieve your datasource from the RDF service. For example, the above datasource would be accessable as follows:</p> -<pre class="eval">nsIRDFService* rdf; -rv = nsServiceManager::GetService(kRDFServiceCID, - kIRDFServiceIID, - (nsISupports**) &rdf); - -if (NS_SUCCEEDED(rv)) { - nsIRDFDataSource* myDataSource; - rv = rdf->GetDataSource("rdf:my-datasource", - &myDataSource); - - if (NS_SUCCEEDED(rv)) { - // ...do something to myDataSource here... - NS_RELEASE(myDataSource); - } - nsServiceManager::ReleaseService(kRDFServiceCID, rdf); -} -</pre> -<h3 id="Displaying_RDF_as_content" name="Displaying_RDF_as_content">Displaying RDF as content</h3> -<p>Now that you've gone through all this pain to expose your information as a datasource, you probably want to - <i> - see</i> - it. Using <a class="external" href="http://www.mozilla.org/xpfe/languageSpec.html">XUL</a>, you can display the contents of your datasource in a - <i> - tree</i> - control - <i> - , a</i> - menu - <i> - , or a</i> - toolbar - <i> - . In fact, you can</i> - convert RDF to an - <i> - arbitrary</i> - content model using <a href="cn/XUL/Template_Guide">XUL Templates</a>.</p> -<p>The following XUL fragment illustrates how to instantiate a tree control whose body is "rooted" to a resource (<tt><a class="external" href="http://foo.bar.com/" rel="freelink">http://foo.bar.com/</a></tt>) that your datasource describes:</p> -<pre class="eval"><window - xmlns:html="<a class="external" href="http://www.w3.org/1999/xhtml" rel="freelink">http://www.w3.org/1999/xhtml</a>" - xmlns:rdf="<a class="external" href="http://www.w3.org/TR/WD-rdf-syntax#" rel="freelink">http://www.w3.org/TR/WD-rdf-syntax#</a>" - xmlns="<a class="external" href="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" rel="freelink">http://www.mozilla.org/keymaster/gat...re.is.only.xul</a>"> - - <tree <b>datasources="rdf:my-datasource" ref="<a class="external" href="http://foo.bar.com/" rel="freelink">http://foo.bar.com/</a>"</b>> - <b><template></b> - <b><treechildren></b> - <b><treeitem uri="..."></b> - <b><treerow></b> - <b><treecell></b> - <b><text value="rdf:<a class="external" href="http://home.netscape.com/NC-rdf#Name" rel="freelink">http://home.netscape.com/NC-rdf#Name</a>" /></b> - <b></treecell></b> - <b><treecell></b> - <b><text value="rdf:<a class="external" href="http://home.netscape.com/NC-rdf#URL" rel="freelink">http://home.netscape.com/NC-rdf#URL</a>" /></b> - <b></treecell></b> - <b></treerow></b> - <b></treeitem></b> - <b></treechildren></b> - <b></template></b> - - <treehead> - <treeitem> - <treecell>Name</treecell> - <treecell>URL</treecell> - </treeitem> - </treehead> - - <!-- treechildren built _here_ --> - </tree> - -</window> -</pre> -<p>The important "magic attributes" have been called out in bold, above:</p> -<ul> - <li> - <p><tt>datasources="rdf:my-datasource"</tt>. This is a space-separated list that may include internal XPCOM datasource "identifiers" (as described above) and URIs for local or remote RDF/XML documents. Each datasource that is listed will be loaded, and the assertions contained in the datasource will be made available to the tree control for display.</p> - </li> - <li> - <p><tt>ref="<a class="external" href="http://foo.bar.com/" rel="freelink">http://foo.bar.com/</a>"</tt>. This roots the graph in your content model. The <tt>tree</tt> tag will be treated as if it has the <tt>ID</tt> attribute with a value <tt><a class="external" href="http://foo.bar.com/" rel="freelink">http://foo.bar.com/</a></tt>.</p> - </li> - <li> - <p><tt><template>...</template></tt>. The XUL - <i> - template</i> - that is used to build content from the graph. Starting with the resource that corresponds to the <tt>tree</tt> element, <tt><a class="external" href="http://foo.bar.com/" rel="freelink">http://foo.bar.com/</a></tt>, the graph will be traversed and content will be constructed using the pattern specified within the <tt>template</tt> tags.</p> - </li> -</ul> -<p>For a complete description of how content is built from RDF, see the <a href="cn/XUL/Template_Guide">XUL:Template Guide</a>.</p> -<hr> -<p><small><sup>1</sup> As of this writing, it is not currently possible to implement JavaScript XPCOM components; however, it may soon be possible to do so via <a href="cn/XPConnect">XPConnect</a>. <strong>Update:</strong> JavaScript XPCOM should now be possible. </small></p> -<p>Contact: <a class="link-mailto" href="mailto:waterson@netscape.com">Chris Waterson</a> <a class="link-mailto" href="mailto:(waterson@netscape.com)" rel="freelink">(waterson@netscape.com)</a></p> -<div class="originaldocinfo"> - <h2 id="Original_Document_Information" name="Original_Document_Information">Original Document Information</h2> - <ul> - <li>Author(s): <a class="link-mailto" href="mailto:waterson@netscape.com">Chris Waterson</a></li> - <li>Last Updated Date: June 19, 2000</li> - <li>Copyright Information: Copyright (C) <a class="link-mailto" href="mailto:waterson@netscape.com">Chris Waterson</a></li> - </ul> -</div> -<p> </p> diff --git a/files/zh-cn/archive/mozilla/tamarin/index.html b/files/zh-cn/archive/mozilla/tamarin/index.html deleted file mode 100644 index e13f983f5d..0000000000 --- a/files/zh-cn/archive/mozilla/tamarin/index.html +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: Tamarin -slug: Archive/Mozilla/Tamarin -tags: - - JavaScript - - Landing - - NeedsTranslation - - Tamarin - - TopicStub -translation_of: Archive/Mozilla/Tamarin ---- -<p> </p> - -<div> -<p><strong>Tamarin</strong> is a <a href="/en/JavaScript" title="en/JavaScript">JavaScript</a> engine written in C++. It currently implements Adobe ActionScript™ 3 (a superset of ECMAScript Edition 3) and is embedded within the Adobe® Flash® Player versions 9 and later. Tamarin's jit-compiler, NanoJIT, is also used in <a class="link-https" href="https://wiki.mozilla.org/JavaScript:TraceMonkey" title="https://wiki.mozilla.org/JavaScript:TraceMonkey">TraceMonkey</a> ergo SpiderMonkey, which is Mozilla’s JavaScript engine in Firefox.</p> - -<p>Tamarin is available under the MPL/GPL/LGPL tri-license.</p> -</div> - -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h4 id="Roadmap" name="Roadmap">Releases</h4> - - <dl> - <dt><a class="internal" href="/En/Tamarin/Tamarin_Releases" title="En/Tamarin/Tamarin Releases">Release Tracking</a></dt> - <dd><small>Information on current, past, and upcoming releases of Tamarin.</small></dd> - </dl> - - <h4 id="Documentation" name="Documentation">Documentation</h4> - - <dl> - <dt><a class="external" href="http://www.adobe.com/content/dam/Adobe/en/devnet/actionscript/articles/avm2overview.pdf" title="http://www.adobe.com/content/dam/Adobe/en/devnet/actionscript/articles/avm2overview.pdf">Adobe ActionScript Virtual Machine 2 (AVM2) Overview <small>(PDF, 400K)</small></a></dt> - <dd><small>The instructions, architecture, and file format supported by the AVM2. See also the <a class="link-https" href="https://wiki.mozilla.org/Tamarin::AVM2_Overview_Errata">possible errata.</a></small></dd> - </dl> - - <dl> - <dt><a href="/En/Tamarin/Tamarin_Build_Documentation" title="en/Tamarin_Build_Documentation">Tamarin Build Documentation</a></dt> - <dd><small>How to get, build, and use Tamarin.</small></dd> - <dt style="font-style: normal; font-weight: bold;"> </dt> - <dt style="font-style: normal; font-weight: bold;"><a class="internal" href="/En/Tamarin/Tamarin_Build_System_Documentation" style="text-decoration: none; color: rgb(4, 137, 183) ! important; cursor: default;" title="En/Tamarin/Tamarin Build System Documentation">Tamarin Build System Documentation</a></dt> - <dd style="margin-left: 0px; margin-bottom: 0.5em; padding-left: 15px;"><small>Documentation on how the Tamarin build system works and how to modify.</small></dd> - <dt style="font-style: normal; font-weight: bold;"><a class="internal" href="/en/Tamarin/Tamarin_mercurial_commit_hook" style="text-decoration: none; color: rgb(4, 137, 183) ! important; cursor: default;" title="en/Tamarin/Tamarin mercurial commit hook">Tamarin commit hook</a></dt> - <dd style="margin-left: 0px; margin-bottom: 0.5em; padding-left: 15px;"><small>Instructions for installing and using the mercurial hook for Tamarin.</small></dd> - <dt style="font-style: normal; font-weight: bold;"><a class="internal" href="/En/Tamarin/Tamarin_Acceptance_Testing" style="text-decoration: none; color: rgb(4, 137, 183) ! important; cursor: default;" title="En/Tamarin/Tamarin Tests">Tamarin Acceptance Testing</a></dt> - <dd style="margin-left: 0px; margin-bottom: 0.5em; padding-left: 15px;"><small>Instructions on how to validate changes to the Tamarin source code.</small></dd> - </dl> - - <dl> - <dt><a class="link-https" href="https://wiki.mozilla.org/Tamarin">Tamarin pages at wiki.mozilla.org</a></dt> - <dd><small>More documentation.</small></dd> - </dl> - - <dl> - <dt><a href="/en/MMgc" title="en/MMgc">MMgc overview</a></dt> - <dd><small>An overview of the Tamarin garbage collector.</small></dd> - </dl> - - <dl> - <dt><a href="/En/Nanojit/LIR" title="en/Nanojit/Nanojit_LIR">Nanojit LIR </a></dt> - <dd><small>In Nanojit, LIR is the source language for compilation to machine code.</small></dd> - </dl> - - <dl> - <dt><a class="link-https" href="https://wiki.mozilla.org/Tamarin:Strings" title="https://wiki.mozilla.org/Tamarin:Strings">Tamarin strings documentation</a></dt> - <dd><small>The implementation of Tamarin strings has changed. This page is a how-to about the changes, and what can be done to adapt source code to the changes. </small></dd> - </dl> - - <dl> - <dt><a class="external" href="http://tamarin-builds.mozilla.org/doxygen/html/index.html" title="http://tamarin-builds.mozilla.org/doxygen/html/index.html">Tamarin doxygen documentation</a></dt> - <dd><small>Documentation for the latest release.</small></dd> - </dl> - - <p><span class="alllinks"><a href="/Special:Tags?tag=Tamarin&language=en" title="Special:Tags?tag=Tamarin&language=en">View All...</a></span></p> - </td> - <td> - <h4 id="Community" name="Community">Get Involved!</h4> - - <ul> - <li>log a bug against <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Tamarin">Tamarin</a></li> - <li><a class="link-https" href="https://mail.mozilla.org/listinfo/tamarin-devel" title="https://mail.mozilla.org/listinfo/tamarin-devel">tamarin-devel</a> mailing list</li> - <li><a class="link-irc" href="irc://irc.mozilla.org/tamarin" title="irc://irc.mozilla.org/tamarin">#tamarin</a> channel on irc.mozilla.org</li> - </ul> - - <h4 id="Related_Topics" name="Related_Topics">Blogroll</h4> - - <ul> - <li><a class="external" href="http://masonchang.com/search/label/Tamarin">Mason Chang</a></li> - <li>David Mandelin</li> - </ul> - - <h4 id="Related_Topics" name="Related_Topics">Related Topics</h4> - - <dl> - <dd><a href="/en/JavaScript" title="en/JavaScript">JavaScript</a></dd> - <dd><a href="/en/SpiderMonkey" title="en/SpiderMonkey">SpiderMonkey</a></dd> - <dd><a class="external" href="http://wiki.mozilla.org/JavaScript:ActionMonkey">ActionMonkey</a></dd> - <dd><a class="external" href="http://www.mozilla.org/projects/tamarin/">Tamarin on mozilla.org</a></dd> - </dl> - </td> - </tr> - </tbody> -</table> diff --git a/files/zh-cn/archive/mozilla/tamarin/tamarin_build_documentation/index.html b/files/zh-cn/archive/mozilla/tamarin/tamarin_build_documentation/index.html deleted file mode 100644 index 3841a0565c..0000000000 --- a/files/zh-cn/archive/mozilla/tamarin/tamarin_build_documentation/index.html +++ /dev/null @@ -1,416 +0,0 @@ ---- -title: Tamarin 编译文档 -slug: Archive/Mozilla/Tamarin/Tamarin_Build_Documentation -translation_of: Archive/Mozilla/Tamarin/Tamarin_Build_Documentation ---- -<h2 id="Tamarin_Source_Versions" name="Tamarin_Source_Versions">Tamarin 源码版本</h2> - -<p>以下说明用于获取和构建 Tamarin Central 源码.</p> - -<p>Tamarin Tracing 的相关说明, 请查看 <a href="/en/Tamarin_Tracing_Build_Documentation" title="en/Tamarin_Tracing_Build_Documentation">Tamarin Tracing Build Documentation</a>.</p> - -<h2 id="Supported_platforms" name="Supported_platforms">支持平台</h2> - -<p>Tamarin 目前支持以下操作系统/架构.</p> - -<ul> - <li>Windows 32 and 64 bit</li> - <li>Mac OSX 10.4, 10.5 on PPC</li> - <li>Mac OSX 10.5, 10.6 on Intel</li> - <li>Linux 32 and 64 bit</li> - <li>Solaris 10 on SPARC</li> - <li>Android 2.2 on ARM</li> - <li>Windows Mobile 6.5</li> - <li>MIPS (Linux)</li> - <li>SH4 (Linux)</li> -</ul> - -<h2 id="Getting_the_Tamarin_source" name="Getting_the_Tamarin_source">获取 Tamarin 源码</h2> - -<p>Tamarin 源码位于 <a class="external" href="http://hg.mozilla.org/tamarin-central">Tamarin Central</a> 的 <a class="external" href="http://www.selenic.com/mercurial/wiki/">Mercurial</a> . 目前开发中的源码位于 <a class="external" href="http://hg.mozilla.org/tamarin-redux" title="http://hg.mozilla.org/tamarin-redux">Tamarin Redux</a>. 在本文中 replace instances of tamarin-central with tamarin-redux to operate in the redux repository. 使用以下命令克隆一个 Tamarin 仓库:</p> - -<pre class="eval"><span class="nowiki">$ hg clone http://hg.mozilla.org/tamarin-central tamarin-central</span> -</pre> - -<p>Tips for working with Mercurial can be found <a href="/en/Mercurial_FAQ" title="en/Mercurial_FAQ">here.</a></p> - -<h2 id="Building_Tamarin" name="Building_Tamarin">构建 Tamarin</h2> - -<p>构建 Tamarin 将创建 AVMPlus 和 garbage collector (MMgc) 的所有库, 并创建一个独立的可执行文件(shell),用于以ABC文件格式执行文件. 不附加任何参数运行shell将列出可用的选项. 注意其他的命令行参数仅在调试配置中可用.</p> - -<p><a href="/en/Tamarin" title="en/Tamarin">Tamarin</a> 的代码库包含一个Mozilla开发者的跨平台构建系统. 该跨平台构建系统用于日常自动化构建测试, 因此是非常可靠的系统.</p> - -<p>The Tamarin codebase has the ability to build additional code which supports debugging hooks. 在 XCode 项目中, 这是 <code>Debug_Debugger</code> 和 <code>Release_Debugger</code> 配置. The Flash Player builds Tamarin with the debugging hooks off for codesize reasons, but the Mozilla client will build Tamarin with the debugging hooks on.</p> - -<h3 id="Cross-platform_build" name="Cross-platform_build">跨平台构建 (general instructions - 非安卓)</h3> - -<p><strong>预备条件(环境):</strong> 你需要 Python 2.5 或更高版本和 GNU <code>make</code> 3.81 或更高版本. (<strong>GNU <code>make</code> 3.80 does not work.</strong> Nor does any other brand of <code>make</code>.)</p> - -<p>预备条件达成后, 使用这些命令构建 Tamarin:</p> - -<pre class="eval"> $ hg clone <a class="external" href="http://hg.mozilla.org/tamarin-redux/" rel="freelink">http://hg.mozilla.org/tamarin-redux/</a> - $ cd tamarin-redux - $ mkdir objdir-release - $ cd objdir-release - $ python ../configure.py - $ make - ... - $ shell/avmshell - shell 1.0 build cyclone - ... -</pre> - -<p>AVMPlus 的可执行文件是 <code>avmshell</code>.</p> - -<p>可选项:</p> - -<ul> - <li><code>--enable-debugger</code> - 调试器构建</li> - <li><code>--enable-debug</code> - 调试构建</li> -</ul> - -<p>对于详细的构建Tamarin, 你可以通过 CPPFLAGS 进行.</p> - -<pre class="eval"> $ make CPPFLAGS=-DAVMPLUS_VERBOSE -</pre> - -<h4 id="在_OSX_10.6_(Snow_Leopard)_构建的非安卓跨平台_Tamarin-redux_的其他说明">在 OSX 10.6 (Snow Leopard) 构建的非安卓跨平台 Tamarin-redux 的其他说明</h4> - -<p>(要在Mac上构建 Tamarin-central 请参阅此处的跨平台说明: <a href="/En/Tamarin/Tamarin_Build_Documentation?revision=21" title="https://developer.mozilla.org/index.php?title=En/Tamarin/Tamarin_Build_Documentation&revision=21">https://developer.mozilla.org/index.php?title=En/Tamarin/Tamarin_Build_Documentation&revision=21</a></p> - -<p>The bug when building on Snow Leopard (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=537817" title="https://bugzilla.mozilla.org/show_bug.cgi?id=537817">Bug 537817</a>) has been fixed in the Tamarin-redux repo. The work for that fix also included some changes to the configure.py default behavior to decouple the --target switch from sdk choice: </p> - -<ul> - <li>There is a new switch, --mac-sdk, that selects the 10.4u, 10.5 or 10.6 sdk. Its options are '104u', '105' or '106' (Note: no '.')</li> - <li>If you don't pass the --mac-sdk switch you will get no sdk in your build.</li> - <li>If you pass '--mac-sdk=104u' you will also get gcc/g++ 4.0.</li> - <li>If you pass '--mac-sdk=105' or '--mac-sdk=106' you will get the gcc/g++ default for the machine you're building on.</li> -</ul> - -<p>Example call to build on an x86_64 machine with the 10.5 sdk:</p> - -<pre>$ ../configure.py --mac-sdk=105 --target=x86_64-darwin -</pre> - -<p>If ASC is not set, you will need to add ASC.jar to the utils directory in Tamarin-redux (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=631641" title="https://bugzilla.mozilla.org/show_bug.cgi?id=631641">Bug 631641</a>).</p> - -<ul> - <li>下载<a class="link-ftp" href="ftp://ftp.mozilla.org/pub/js/tamarin/builds/asc/latest/asc.jar " title="ftp://ftp.mozilla.org/pub/js/tamarin/builds/asc/latest/asc.jar">ftp://ftp.mozilla.org/pub/js/tamarin/builds/asc/latest/asc.jar </a></li> - <li>把它放到 utils/</li> -</ul> - -<p> </p> - -<h3 id="在Mac上构建_Tamarin_的安卓_2.3.3_版本">在Mac上构建 Tamarin 的安卓 2.3.3 版本</h3> - -<h4 id="公共_sdkndk_安装">公共 sdk/ndk 安装</h4> - -<p>To build Tamarin for Android you will need an sdk/ndk. The setup procedure below creates an android sdk/ndk entirely from publicly available sources. This sdk/ndk *must* be used if you've cloned tamarin at changeset 5844:92ad3ca84a0b or later <strong>and</strong> will be using the cross-compile build method.</p> - -<p>Steps to create a public sdk/ndk tree on a Mac:</p> - -<p>- Create an sdk/ndk top folder under your main volume named /android-public.</p> - -<p>- 下载 Android 2.3.3 的Mac sdk zip 文件自 <a class="external" href="http://developer.android.com/sdk/index.html" title="http://developer.android.com/sdk/index.html">http://developer.android.com/sdk/index.html</a>. 解压到你的 sdk/ndk 顶级文件夹. Make sure it's named 'android-sdk-mac_86'.</p> - -<p>- Download the r5b Mac ndk zip file from <a class="external" href="http://developer.android.com/sdk/ndk/index.html" title="http://developer.android.com/sdk/ndk/index.html">http://developer.android.com/sdk/ndk/index.html</a>. Unzip to your sdk/ndk top folder. Rename this folder to 'android-ndk'.</p> - -<p>- Run the Android SDK/AVD Manager at /android-public/android-sdk-mac_86/tools/android and add Android SDK Platform-tools (to get adb), SDK Platform Android 2.3.3, and API 10 (samples and docs are optional). If you have trouble starting the app try this:</p> - -<p><code>$ export ANDROID_SWT=$ANDROID_BUILD_TOP/android-sdk-mac_86/tools/lib/x86_64</code></p> - -<p>where $ANDROID_BUILD_TOP is the full path to your sdk/ndk top folder</p> - -<p>- Get the openssl-0.9.8r.tar (openssl-1.0.0c.tar.gz won't work) openssl files from <a class="external" href="http://www.openssl.org" title="http://www.openssl.org/">http://www.openssl.org</a> (use the Source link on the left). Unzip the file and put the /openssl main folder under your sdk/ndk top folder. Make sure its name is just "openssl". Then build as follows:</p> - -<p>- Replace the Makefile in the main folder with the one attached to this page.</p> - -<p>- Change the variable ANDROID_DEVICE in the makefile (near line 65) to point to your sdk/ndk top folder.</p> - -<p>- Find the two instances of "android-ndk" and make sure they match your ndk's name (they should already).</p> - -<p>- In a terminal window change to your /openssl folder and run <code>make build_libs</code> to create the necessary '<code>libcrypto.a</code>' and '<code>libssl.a</code>' static libraries.</p> - -<p>Alternatively, run make, in which case the process will complete with errors when it tries to create the shared lib crt0.o:</p> - -<pre>$ /android-public/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/darwin-x86/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: crt0.o: -No such file: No such file or directory collect2: ld returned 1 exit status -make[2]: *** [link_app.] Error 1 -make[1]: *** [openssl] Error 2 -make: *** [build_apps] Error 1</pre> - -<p>You can ignore these errors. The necessary static files 'libcrypto.a' and 'libssl.a' are made correctly and are present in the /openssl folder. More information on why this happens on Mac OS is here: <a class="external" href="http://developer.apple.com/library/mac/#qa/qa2001/qa1118.html" title="http://developer.apple.com/library/mac/#qa/qa2001/qa1118.html">http://developer.apple.com/library/mac/#qa/qa2001/qa1118.html</a></p> - -<p>- Create a /frameworks/base/opengl/include/EGL folder under your sdk/ndk top folder. Get the ersion 1.4 EGL header files (egl.h, eglext.h and eglplatform.h) from <a class="external" href="http://www.khronos.org/registry/egl/" title="http://www.khronos.org/registry/egl/">http://www.khronos.org/registry/egl/</a> and save or copy them there. </p> - -<h4 id="构建_Tamarin_Release_Shell">构建 Tamarin Release Shell</h4> - -<p>- Get tamarin-redux</p> - -<p>- Export the following variables into the environment</p> - -<p> </p> - -<pre>$ export ANDROID_TOOLCHAIN=<full path to your android sdk/ndk top folder> -$ export ANDROID_NDK=$ANDROID_TOOLCHAIN/android-ndk -$ export ANDROID_NDK_BIN=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin -$ export ANDROID_SDK=$ANDROID_TOOLCHAIN/android-sdk-mac_86 -$ export PATH=$PATH:$ANDROID_SDK/platform-tools:$ANDROID_NDK_BIN</pre> - -<div>- Example commands to build Tamarin: </div> - -<pre>$ hg clone http://hg.mozilla.org/tamarin-redux -$ cd tamarin-redux -$ mkdir objdir-release -$ cd objdir-release -$ ../configure.py --arm-arch=armv7-a --target=arm-android -$ make</pre> - -<p>使用此命令制作一个调试shell:</p> - -<p><code>../configure.py --enable-debug --arm-arch=armv7-a --target=arm-android</code></p> - -<p> </p> - -<h3 id="在Windows上使用CYGWIN的跨平台脚本">在Windows上使用CYGWIN的跨平台脚本:</h3> - -<p><strong>预备条件(环境):</strong> 你需要 Python 2.5 或更高版本和 GNU <code>make</code> 3.81 或更高版本. (<strong>GNU <code>make</code> 3.80 does not work.</strong> Nor does any other brand of <code>make</code>.)</p> - -<p><strong>设置:</strong></p> - -<ul> - <li>If you normally work in a cygwin mounted place (eg /home/user/...) then you must cd around to the cygdrive path equivalent (eg /cygdrive/c/cygwin/home/user/).</li> - <li>使用以下环境变量设置shell环境:</li> -</ul> - -<pre style="margin-left: 40px;"># NOTE: The INCLUDE, LIB and LIBPATH must contain windows path information and separator and not cygwin paths. -VS_HOME_PATH="/cygdrive/c/Program Files/Microsoft Visual Studio 9.0" -VS_HOME="c:\Program Files\Microsoft Visual Studio 9.0" - -export PATH="$VS_HOME_PATH/Common7/IDE:$VS_HOME_PATH/VC/bin:$VS_HOME_PATH/Common7/Tools:$VS_HOME_PATH/VC/VCPackages:$PATH" -export INCLUDE="$VS_HOME\VC\atlmfc\include;$VS_HOME\VC\include;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include;" -export LIB="$VS_HOME\VC\atlmfc\lib;$VS_HOME\VC\lib;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib" -export LIBPATH="$VS_HOME\VC\atlmfc\lib;$VS_HOME\VC\lib;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib" -</pre> - -<p>完成上方的条件后, 你现在应该可以通过这些命令进行构建:</p> - -<pre style="margin-left: 40px;">$ hg clone http://hg.mozilla.org/tamarin-central/ -$ cd tamarin-central -$ mkdir objdir-release -$ cd objdir-release -$ python ../configure.py -$ make -... -$ shell/avmshell.exe -shell 1.0 build cyclone -... -</pre> - -<p> </p> - -<h3 id="Microsoft_Visual_Studio" name="Microsoft_Visual_Studio">微软 Visual Studio</h3> - -<p>Visual Studio 2008 (VS2008) 是首选的Windows构建环境. Visual Studio 2003 和 2005 不再被支持. 构建 Tamarin:</p> - -<ol> - <li>copy tamarin/platform/win32/armasm.rules to c:/Program Files/Microsoft Visual Studio 9.0/VC/VCProjectDefaults</li> - <li>Build "builtin.h" following the instructions below in the section "Compiling and running applications"</li> - <li>Do the same for shell_toplevel.h, starting in avmplus/shell, using the command "python shell_toplevel.py"</li> - <li>open the Tamarin project file "platform/win32/avmplus2008.sln".</li> - <li>Choose your desired configuration and target, and build.</li> - <li>Note: now that bug 478714 has been fixed, the name of the (shell) executable will always be "avm.exe" no matter which build configuration you select. The avm.exe file will be found in a directory reflecting your configuration choice. For example, if you chose the win32 Debug_Debugger configuration your build will be under \tamarin-redux\platform\win32\obj_9\shell\Debug_Debugger by default. Building the x64 Release_Debugger configuration will create avm.exe under \tamarin-redux\platform\win32\x64\Release_Debugger. Note the "\obj9" directory under \platform\win32 for the win32 builds and "\x64" directory under \platform\win32 for 64-bit builds; this looks a little odd but preserves previous behavior as much as possible to avoid initial disruption from the shell rename fix.</li> -</ol> - -<p>你必须安装支持x64的VS2008才能构建64位配置. </p> - -<p>如果你安装了 Windows Mobile 6 SDK, 你还可以用 Windows Mobile (ARM) 为目标构建.</p> - -<h3 id="Apple_XCode" name="Apple_XCode">Apple XCode</h3> - -<p>The project files are designed for XCode 3.0. Se "platform/mac/avmplus/avmplus.xcodeproj". XCode 2.2, 2.3, and 2.4 will not work.</p> - -<p>There are two targets in the XCode IDE, 'avm' for 32-bit builds and 'avm64' for 64-bit builds. There is also an aggregate target that will build both targets. Note that, whereas before when you selected the aggregate target you got a 'shell' 32-bit executable and a 'shell64' 64-bit executable in the same folder, now because of the fix to bug 478714 you will get an 'avm' executable in two separate folders, /Debug and /Debug64 respectively.</p> - -<p>The command to build from the Terminal is:</p> - -<pre class="eval"> $ cd tamarin-redux - $ xcodebuild ARCHS=ppc -project platform/mac/avmshell/avmshell.xcodeproj -</pre> - -<p>For a debug build, add '-configuration Debug' (note the capital D and no "="). Additional configurations are: Debug_Debugger, Release and Release_Debugger.</p> - -<p>The resulting Debug executable for the command above would be built at /platform/mac/avmshell/build/Debug/avm.</p> - -<p>Intel Macs build correctly by setting ARCHS=i386.</p> - -<h3 id="Eclipse_(目前只有Mac)">Eclipse (目前只有Mac)</h3> - -<p>Eclipse (Galileo) / CDT (6.0) project for Tamarin (also works with Helios).</p> - -<p>The configurations in this initial version cover 32- and 64-bit builds for Mac OS with the GCC 4.0 toolchain (installed with Xcode 3.x).</p> - -<h4 id="Preparing_your_Eclipse_workspace_and_perspective">Preparing your Eclipse workspace and perspective</h4> - -<ul> - <li>Open the C/C++ perspective</li> - <li>Open the 'C/C++ Projects' view (Window >> Show View >> C/C++ Projects)</li> - <li>Add view filter 'Non-C Elements' (In the top-right of the 'C/C++ Projects' view, click the down-arrow, click 'Filters...', check 'Non-C elements')</li> - <li>Increase the threshold for 'editor scalability mode' to 20000 lines. As some Tamarin source files have more than the Eclipse standard threshold of 5000, they do not appear as indexed. The threshold can be adjusted in Eclipse preferences >> C/C++ >> Editor >> Scalability.</li> - <li>*IMPORTANT* Project-specific settings for the CDT Indexer do not appear to work (it looks like a bug in Eclipse), so you have to set these manually/globally. What we want is to have the indexer track the currently selected build config (so the correct conditional compiles are highlighted in the editor). To enable this go to Eclipse preferences >> C/C++ >> Indexer, then select 'Use active build configuration' in the 'Build configuration for the indexer' section.</li> -</ul> - -<h4 id="将项目导入到_Eclipse">将项目导入到 Eclipse</h4> - -<ul> - <li>File >> Import >> General >> Existing Projects into Workspace</li> - <li>Click next</li> - <li>The root directory should be the full path to your top-level tamarin-redux directory</li> - <li>Ensure the 'avmshell-project' project is checked in the 'Projects' list</li> - <li>Uncheck 'Copy projects into workspace'</li> - <li>Click finish</li> -</ul> - -<h4 id="在_Eclipse_构建">在 Eclipse 构建</h4> - -<p>8 build configurations are included for MacOS with the GCC 4.0 toolchain:</p> - -<ul> - <li>Mac-32-Release</li> - <li>Mac-64-Release</li> - <li>Mac-32-Debug</li> - <li>Mac-64-Debug</li> - <li>Mac-32-Release-Debugger</li> - <li>Mac-64-Release-Debugger</li> - <li>Mac-32-Debug-Debugger</li> - <li>Mac-64-Debug-Debugger</li> -</ul> - -<p>The build location will be PROJECT_ROOT/BUILD_NAME/avm</p> - -<p>Note: As discussed above, the C++ indexer has been setup to track the current build config, so the correct conditional compiles are highlighted in the editor</p> - -<h4 id="从_Eclipse_运行调试">从 Eclipse 运行/调试</h4> - -<p>For test purposes, a launch config (running the HelloWorld test from esc) has been included for each of the build configs. All are available from the Run menu.</p> - -<p>Note: if you receive an error when trying to run/debug a newly imported project, try opening a file in the project first - Eclipse can sometimes get confused as to what the 'current project' actually is. Additional things to try are clicking on the project name then refreshing it (File/Refresh or right-click/Refresh) and/or quitting and restarting Eclipse.</p> - -<h3 id="Linux_and_Unix" name="Linux_and_Unix">Linux 和 Unix</h3> - -<p>Tamarin is tested on Linux but not on other Unix flavors. Nonetheless, it is possible to build Tamarin on Unix. </p> - -<p>Execute the following commands to build:</p> - -<pre class="eval"> $ cd tamarin-central/platform/unix - $ make -</pre> - -<p>The resulting executable "shell" is built in the current directory.</p> - -<h2 id="Compiling_and_running_applications" name="Compiling_and_running_applications">编译和运行应用程序</h2> - -<p>Currently the only compiler for Tamarin is the Adobe ActionScript compiler. The source code for the ActionScript compiler, <code>asc</code>, has been open sourced as part of Adobe Flex®. This compiler is written in Java and will require the installation of a Java™ 1.4 or later JDK.</p> - -<p>A prototype self-hosting ECMAScript Edition 4 compiler, <code>esc</code>, is provided with Tamarin but it is not yet capable of bootstrapping itself or building applications. <code>esc</code> is under active development and will be able to generate Tamarin applications later this year.</p> - -<p>Use the following steps to build and install the ActionScript compiler.</p> - -<ol> - <li>Download and build the asc source code using the subversion client</li> -</ol> - -<pre class="eval"> $ svn co <a class="external" href="http://opensource.adobe.com/svn/opensource/flex/sdk/sandbox/asc-redux/" rel="freelink">http://opensource.adobe.com/svn/open...box/asc-redux/</a> asc - $ cd asc/build/java - $ ant - ... - jar: - [jar] Building jar asc\lib\asc.jar - $ cd ../.. - $ java -jar lib/asc.jar # shows usage -</pre> - -<p>You may also download the latest asc.jar from <a class="link-ftp" href="ftp://ftp.mozilla.org/pub/js/tamarin/builds/asc/latest/asc.jar" rel="external nofollow" title="ftp://ftp.mozilla.org/pub/js/tamarin/builds/asc/latest/asc.jar">ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar</a> .</p> - -<p>You should now copy asc.jar into tamarin-central/utils.</p> - -<p><code>asc.jar</code> can be used to compile the <code>builtin.abc</code> file. The <code>builtin.abc</code> file provides internal information about the built-in classes (Object, Array, etc). This file is located in the <code>core</code> directory; you shouldn't normally need to rebuild it, unless you edit any of the ActionScript source for the built-in classes. To rebuild it, use the <code>builtin.py</code> script:</p> - -<pre class="eval"> $ cd tamarin-central/core - $ export ASC=../utils/asc.jar # builtin.py uses this to find asc.jar - $ python builtin.py - building builtin.abc, builtin.cpp, builtin.h - builtin: 26795 - Files: 6 Time: 1709ms -</pre> - -<p>You can now use</p> - -<p><code>asc.jar</code> to compile applications.</p> - -<pre class="eval"> $ cd tamarin-central - $ echo 'print("hello, world")' > hello.as - $ java -jar ./utils/asc.jar -import ./core/builtin.abc hello.as - hello.abc, 86 bytes written -</pre> - -<p>Use the AVMPlus standalone executable (<code>avmshell</code>) built previously to run the application:</p> - -<pre class="eval"> $ avmshell hello.abc - hello, world -</pre> - -<p>Use the <code>-help</code> options of <code>asc.jar</code> and <code>avmshell</code> for more details.</p> - -<h2 id="Running_Tamarin_compliance_tests" name="Running_Tamarin_compliance_tests">对 Tamarin 进行测试</h2> - -<p>See <a href="/En/Tamarin/Tamarin_Acceptance_Testing/Running_Tamarin_acceptance_tests" title="En/Tamarin/Tamarin Tests/Running Tamarin acceptance tests">Running Tamarin acceptance tests</a> and <a href="/En/Tamarin/Tamarin_Acceptance_Testing/Running_Tamarin_performance_tests" title="En/Tamarin/Tamarin Tests/Running Tamarin performance tests">Running Tamarin performance tests</a></p> - -<h2 id="Running_Tamarin_compliance_tests" name="Running_Tamarin_compliance_tests">构建 Tamarin Windows Mobile utilities</h2> - -<p>The Tamarin Windows Mobile utilities allows the existing acceptance and performance testsuites to be run on a Windows Mobile device connected to a Windows desktop machine by ActiveSync or Windows Mobile Device Center (for Windows Vista and Windows 7). </p> - -<ol> - <li>Setup and run ActiveSync or Windows Mobile Device Center. You should be connected and able to see the devices file system in Windows Explorer</li> - <li>in tamarin repository go to the utils/wmremote directory, open the ceremoteshell2008.sln file in Visual Studio 2008</li> - <li>Build all targets in Release mode (for more information see utils/wmremote/readme.txt)</li> - <li>copy Release/avmremote.dll to the device in the \Windows directory</li> - <li>export AVM=Release/ceremoteshell.exe, the ceremoteshell.exe behaves as a proxy copying and running abc files on the windows mobile device</li> - <li>build a windows mobile tamarin shell, copy the shell to the windows mobile device in \Program Files\shell\avmshell.exe</li> - <li>(optional) Can sanity check the windows mobile shell is functioning by running $AVM hello.abc (where hello.abc is a simple abc to print a string, or can substitute with any test abc)</li> - <li>Now any acceptance or performance tests can be run as on desktop using test/acceptance/runtests.py or tests/performance/runtests.py</li> -</ol> - -<h2 id="Running_Tamarin_compliance_tests" name="Running_Tamarin_compliance_tests">Tamarin BuildBot</h2> - -<p>Adobe maintains a <a class="external" href="http://tamarin-builds.mozilla.org/tamarin-redux/" title="http://tamarin-builds.mozilla.org/tamarin-redux/">continuous build and test system</a> for Tamarin Redux, similar to TinderBox.</p> - -<h2 id="Tamarin_BuildBot_TryServer" name="Tamarin_BuildBot_TryServer">Tamarin BuildBot TryServer</h2> - -<p>The TryServer/Sandbox is setup to allow users to push any code changes that they would like to have tested in the automated build/test process prior to actually pushing the changes. The Sandbox is setup so that it is able to build and test branches that are based on either tamarin-central or tamarin-tracing.</p> - -<p>Any comments, questions or problems can be directed to</p> - -<p><a class="link-mailto" href="mailto:actionscriptqe@adobe.com" title="mailto:actionscriptqe@adobe.com">ActionScript QE</a></p> - -<h3 id="How_To" name="How_To">How to</h3> - -<ol> - <li>Setup a user repository with the source and patches that will be compiled. Documentation on how to setup a user repository <a href="/../../../../En/Publishing_Mercurial_Clones" title="../../../../En/Publishing_Mercurial_Clones">http://developer.mozilla.org/En/Publishing_Mercurial_Clones</a>. Push any changes that you want to test into this repository.</li> - <li>Request a build via the form at <a class="external" href="http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm" title="http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm">http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm</a> - <ul> - <li><strong>User Email:</strong> Your email address. An email with the build status will be sent to this address when a builder completes whether it is passes or fails.</li> - <li><strong>Mercurial Repository:</strong> Give the location of the repository that will be used for the build. NOTE: Only repositories hosted on <a class="external" href="http://hg.mozilla.org/" rel="freelink">http://hg.mozilla.org/</a> are accepted.</li> - <li><strong>Revision:</strong> Specify the revision number that will be built. Currently this only accepts the change number and not the hash.</li> - <li><strong>Branch:</strong> Which branch of tamarin the repository is based on, Tamarin-Central or Tamarin-Tracing.</li> - <li><strong>Description:</strong> Self explanatory</li> - </ul> - </li> - <li>Check the status of the build @ <a class="external" href="http://tamarin-builds.mozilla.org/tamarin-redux/" title="http://tamarin-builds.mozilla.org/tamarin-redux/">http://tamarin-builds.mozilla.org/tamarin-redux/</a> , you can also see your build request in the queue at <a class="external" href="http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm" title="http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm">http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm</a>. If you no longer want you sandbox to build and it has not started yet, you can delete the build request from the queue from the request page.</li> -</ol> - -<h3 id="TryServer_Etiquette" name="TryServer_Etiquette">TryServer etiquette</h3> - -<p>The sandbox is not a good substitute for running the regression tests locally to catch obvious problems.</p> - -<p>This is a shared resource, each request takes approximately 2+ hours to run so please use wisely.</p> diff --git a/files/zh-cn/archive/mozilla/xbl/index.html b/files/zh-cn/archive/mozilla/xbl/index.html deleted file mode 100644 index 554771a049..0000000000 --- a/files/zh-cn/archive/mozilla/xbl/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: XBL -slug: Archive/Mozilla/XBL -tags: - - XBL -translation_of: Archive/Mozilla/XBL ---- -<p><strong>XML 绑定语言</strong> (<strong>XBL</strong>,有时也被称为可扩展绑定语言)是用于描述可以附加到其他文档中的元素的“绑定”(bindings)的语言。绑定所附加到的元素被称为<em>绑定元素</em>(bound element),会获取绑定中指定的新行为。</p> - -<p>绑定可以包含在绑定元素上注册的事件处理器(event handlers)、可从绑定元素访问的新方法(methods)和属性(properties)、以及插入到绑定元素下的匿名内容。</p> - -<p>Most <a href="/en/XUL" title="en/XUL">XUL</a> widgets are at least partially implemented using XBL. You can build your own reusable widgets from existing <a href="/en/XUL" title="en/XUL">XUL</a>, <a href="/en/HTML" title="en/HTML">HTML</a>, <a href="/en/SVG" title="en/SVG">SVG</a>, and other primitives using XBL.</p> - -<h3 id="Specifications" name="Specifications">定义</h3> - -<ul> - <li>XBL 1.0 is specified in <a href="/en/XBL/XBL_1.0_Reference" title="en/XBL/XBL_1.0_Reference">XBL 1.0 Reference</a>. Unfortunately, the actual implementation in Mozilla is different from the specification, and there's no known document available describing the differences. Hopefully, the Reference will be updated to describe those differences.</li> -</ul> - -<p>XBL 1.0 是一个 Mozilla-specific technology,不是一个 <a class="external" href="http://w3.org/">W3C</a> 标准。至少两个基于它的标准已经被废弃:sXBL 和 XBL 2.0。</p> - -<div class="warning"> -<p>警告!sXBL 和 XBL 2.0 已被废弃。</p> -</div> - -<ul> - <li>W3C <a class="external" href="http://w3.org/TR/sXBL/">sXBL</a> (currently a working draft, 2005) stands for <em>SVG's XML Binding Language</em>. It is supposed to include a subset of XBL 2.0 features needed for <a href="/en/SVG" title="en/SVG">SVG</a>. It's similar in spirit to Mozilla's XBL, but there are a few subtle (and not-so-subtle) differences. For example, names of the elements are different. Also sXBL lacks some features of XBL, such as bindings inheritance and defining methods/properties on bound elements.</li> - <li><a class="external" href="http://www.mozilla.org/projects/xbl/xbl2.html">XBL 2.0</a> (<a class="external" href="http://w3.org/TR/XBL/">W3C Candidate Recommendation</a>) is being developed to address problems found in XBL 1.0 and to allow for implementations in a broader range of Web browsers. Mozilla plans to implement XBL2 in future versions of <a href="/en/Gecko" title="en/Gecko">Gecko</a> with <a class="external" href="http://groups.google.com/group/mozilla.dev.tech.xbl/msg/d7d4f279ebdad65f" title="http://groups.google.com/group/mozilla.dev.tech.xbl/msg/d7d4f279ebdad65f">initial stages</a> started in June 2009.</li> -</ul> - -<p>Some differences between sXBL and XBL2 are listed in <a class="external" href="http://annevankesteren.nl/2005/11/xbl">an article by Anne van Kesteren</a> (November, 2005).</p> - -<p>An overview of differences between Mozilla XBL and XBL2 is in a <a class="external" href="http://groups.google.com/group/mozilla.dev.tech.xbl/msg/af3d4e37cce1d907">newsgroup posting by Jonas Sicking</a> (April, 2007).</p> - -<div class="geckoVersionNote"> -<p>Still living "Shadow DOM" related specs</p> -</div> - -<ul> - <li><a href="http://www.w3.org/TR/shadow-dom/">Shadow DOM</a> (<a href="http://w3c.github.io/webcomponents/spec/shadow/">Editor's Draft</a>)</li> - <li><a href="http://dev.w3.org/csswg/css-scoping/#shadow-dom">CSS Scoping » Shadow Encapsulation</a></li> -</ul> - -<h3 id="See_also" name="See_also">参见</h3> - -<ul> - <li><a href="/en/XUL_Tutorial/Introduction_to_XBL" title="en/XUL_Tutorial/Introduction_to_XBL">Introduction to XBL</a> from the <a href="/en/XUL_Tutorial" title="en/XUL_Tutorial">XUL Tutorial</a>.</li> - <li><a href="/en-US/docs/XUL/School_tutorial/Custom_XUL_Elements_with_XBL" title="/en-US/docs/XUL/School_tutorial/Custom_XUL_Elements_with_XBL">Custom XUL Elements with XBL [en-US]</a> from the <a href="/en-US/docs/XUL/School_tutorial" title="/en-US/docs/XUL/School_tutorial">XUL School Tutorial [en-US]</a> for add-on developers</li> - <li><a class="external" href="http://mb.eschew.org/15.php">XBL chapter</a> of <a class="external" href="http://mb.eschew.org/">"Rapid Application Development with Mozilla"</a></li> - <li><a class="external" href="http://www.w3.org/TR/xbl-primer/">XBL 2.0 Primer</a> (draft)</li> - <li><a class="external" href="http://code.google.com/p/xbl/" title="http://code.google.com/p/xbl/">XBL 2.0 Cross-browser implementation in JavaScript</a></li> -</ul> - -<ul> - <li><a href="/en-US/docs/tag/XBL">更多 XBL 资源…</a></li> -</ul> - -<h3 id="Community" name="Community">社区</h3> - -<ul> - <li>查看 Mozilla 论坛上的讨论…</li> -</ul> - -<p></p><ul> - <li><a href="https://lists.mozilla.org/listinfo/dev-tech-xbl"> 邮件列表</a></li> - - - <li><a href="http://groups.google.com/group/mozilla.dev.tech.xbl"> 新闻组</a></li> - <li><a href="http://groups.google.com/group/mozilla.dev.tech.xbl/feeds"> Web feed</a></li> -</ul><p></p> diff --git a/files/zh-cn/archive/mozilla/xbl/xbl_1.0_reference/dom_interfaces/index.html b/files/zh-cn/archive/mozilla/xbl/xbl_1.0_reference/dom_interfaces/index.html deleted file mode 100644 index 6e926d52b5..0000000000 --- a/files/zh-cn/archive/mozilla/xbl/xbl_1.0_reference/dom_interfaces/index.html +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: DOM Interfaces -slug: Archive/Mozilla/XBL/XBL_1.0_Reference/DOM_Interfaces -translation_of: Archive/Mozilla/XBL/XBL_1.0_Reference/DOM_Interfaces ---- -<p> </p> -<h2 id="The_DocumentXBL_Interface" name="The_DocumentXBL_Interface">The nsIDOMDocumentXBL Interface</h2> -<p>The <code>nsIDOMDocumentXBL</code> interface contains methods for manipulating XBL bindings. The interface is implemented by all DOM documents.</p> -<h3 id="IDL_Definition" name="IDL_Definition">IDL Definition</h3> -<pre>interface nsIDOMDocumentXBL { - NodeList getAnonymousNodes(in Element elt); - Element getAnonymousElementByAttribute(in Element elt, - in DOMString attrName, - in DOMString attrValue); - /* NOT IMPLEMENTED - void addBinding(in Element elt, - in DOMString bindingURL); - void removeBinding(in Element elt, - in DOMString bindingURL); - */ - - Element getBindingParent(in Node node); - void loadBindingDocument(in DOMString documentURL); -}; -</pre> -<h3 id="Methods" name="Methods">Methods</h3> -<h4 id="getAnonymousNodes" name="getAnonymousNodes">getAnonymousNodes</h4> -<p>The <code>getAnonymousNodes</code> method retrieves the anonymous children of the specified element.</p> -<ul> - <li><em>Parameters</em> - <ul> - <li><code>elt</code> - The element to retrieve anonymous children for.</li> - </ul> - </li> - <li><em>Return Value</em> - <ul> - <li><code>NodeList</code> - The return value of <code>getAnonymousNodes</code> is a <code>NodeList</code> that represents the children of an element after insertion points from its own binding have been applied. This means that, depending on the details regarding the insertion points of the binding, it's possible that some non-anonymous nodes appear in the list. See <a class="external" href="http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/d89ed07aea746c50" title="http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/d89ed07aea746c50">"Not so anonymous nodes" on mozilla.dev.platform</a> for some discussion about this.</li> - </ul> - </li> -</ul> -<h4 id="getAnonymousElementByAttribute" name="getAnonymousElementByAttribute">getAnonymousElementByAttribute</h4> -<p>The <code>getAnonymousElementByAttribute</code> methods retrieves an anonymous descendant with a specified attribute value. Typically used with an (arbitrary) <code>anonid</code> attribute to retrieve a specific anonymous child in an XBL binding.</p> -<ul> - <li><em>Parameters</em> - <ul> - <li><code>elt</code> - The element to retrieve anonymous children for.</li> - <li><code>attrName</code> - The attribute name to look up.</li> - <li><code>attrValue</code> - The attribute value to match.</li> - </ul> - </li> - <li><em>Return Value</em> - <ul> - <li><code>Element</code> - The return value of <code>getAnonymousElementByAttribute</code> is an anonymous descendant of the given element with matching attribute name and value.</li> - </ul> - </li> -</ul> -<h4 id="addBinding" name="addBinding">addBinding</h4> -<p><em>NOT IMPLEMENTED</em> The <code>addBinding</code> method attaches the specified binding (and any bindings that the binding inherits from) to an element. This call is not necessarily synchronous. The binding may not be attached yet when the call completes. See <a href="/zh-CN/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#Attachment_using_the_DOM" title="zh-CN/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#Attachment_using_the_DOM">here</a> for more information.</p> -<ul> - <li><em>Parameters</em> - <ul> - <li><code>elt</code> - The element to attach a binding to.</li> - <li><code>bindingURL</code> of type <code>DOMString</code> - A URI that specifies the location of a specific binding to attach.</li> - </ul> - </li> - <li><em>No Return Value</em></li> -</ul> -<h4 id="removeBinding" name="removeBinding">removeBinding</h4> -<p><em>NOT IMPLEMENTED</em> The <code>removeBinding</code> method detaches the specified binding (and any bindings that the binding inherits from explicitly using the <code>extends</code> attribute) from the element. See <a href="/zh-CN/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#The_bindingdetached_Event" title="zh-CN/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#The_bindingdetached_Event">here</a> for more information.</p> -<ul> - <li><em>Parameters</em> - <ul> - <li><code>elt</code> - The element to remove a binding from.</li> - <li><code>bindingURL</code> of type <code>DOMString</code> - A URI that specifies the location of a specific binding to detach.</li> - </ul> - </li> - <li><em>No Return Value</em></li> -</ul> -<h4 id="getBindingParent" name="getBindingParent">getBindingParent</h4> -<p>The <code>getBindingParent</code> method is used to obtain the bound element with the binding attached that is responsible for the generation of the specified anonymous node. This method enables an author to determine the scope of any content node. When content at the document-level scope is passed in as an argument, the property's value is <code>null</code>.</p> -<ul> - <li><em>Parameters</em> - <ul> - <li><code>node</code> - The node for which the bound element responsible for generation is desired.</li> - </ul> - </li> - <li><em>Return Value</em> - <ul> - <li><code>Element</code> - The return value of <code>getBindingParent</code> is the element responsible for the given anonymous node.</li> - </ul> - </li> -</ul> -<h4 id="loadBindingDocument" name="loadBindingDocument">loadBindingDocument</h4> -<p>The <code>loadBindingDocument</code> method can be used to synchronously obtain the specified binding document for use within a particular document (the one on which the <code>loadBindingDocument </code> method was invoked). The binding document can then be modified programmatically using the DOM. Any subsequent bindings that are attached to elements within the document will be constructed from the modified binding document.</p> -<ul> - <li><em>Parameters</em> - <ul> - <li><code>documentURL</code> of type <code><a class="external" href="http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/core.html#DOMString">DOMString</a></code> - The URL of a binding document.</li> - </ul> - </li> - <li><em>Return Value</em> - <ul> - <li><code>Document</code> - The return value of <code>loadBindingDocument</code> is the binding document used by the calling document to attach bindings that are defined in the binding document.</li> - </ul> - </li> -</ul> -<h3 id="Example">Example</h3> -<p>The following snippet checks to see if any anonymous child of "element" is itself an element.</p> -<pre>if (element.ownerDocument instanceof Ci.nsIDOMDocumentXBL) -{ - var anonChildren = element.ownerDocument.getAnonymousNodes(element); - if (anonChildren) - { - for (var i = 0; i < anonChildren.length; i++) - { - if (anonChildren[i].nodeType == 1) - return false; - } - } -} -return true; -</pre> diff --git a/files/zh-cn/archive/mozilla/xbl/xbl_1.0_reference/index.html b/files/zh-cn/archive/mozilla/xbl/xbl_1.0_reference/index.html deleted file mode 100644 index b891778907..0000000000 --- a/files/zh-cn/archive/mozilla/xbl/xbl_1.0_reference/index.html +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: XBL 1.0 Reference -slug: Archive/Mozilla/XBL/XBL_1.0_Reference -tags: - - NeedsTranslation - - TopicStub - - XBL -translation_of: Archive/Mozilla/XBL/XBL_1.0_Reference ---- -<p> </p> -<h2 id="Abstract" name="Abstract">Abstract</h2> -<p>This document describes Extensible Binding Language (<a href="/en/XBL" title="en/XBL">XBL</a>) 1.0 as implemented in <a href="/en/Gecko" title="en/Gecko">Gecko</a> browsers.</p> -<p>Extensible Binding Language is a <a href="/en/XML" title="en/XML">XML</a>-based markup language to implement reusable components (<em>bindings</em>) that can be bound to elements in other documents. The element with a binding specified, called the <em>bound element</em>, acquires the new behavior specified by the binding. Bindings can be bound to elements using Cascading Style Sheets (<a href="/en/CSS" title="en/CSS">CSS</a>) or <a href="/en/DOM" title="en/DOM">DOM</a>. One element can be bound to several bindings at once.</p> -<p>Functionally bindings should be correlated with <a class="external" href="http://msdn.microsoft.com/workshop/components/htc/reference/htcref.asp">Behaviors</a> and <a class="external" href="http://msdn.microsoft.com/workshop/author/behaviors/overview/viewlink_ovw.asp">Viewlink</a> but being implemented as one integrated XML solution.</p> -<p>Bindings can contain event handlers that are registered on the bound element, an implementation of new methods and properties that become accessible from the bound element, and anonymous content that is inserted around the bound element.</p> -<div class="note"> - <p>There are numerous adjustments in the current implementation in comparison of <a class="external" href="http://www.w3.org/TR/xbl/">earlier XBL proposals</a>, and not all of them are reflected yet in this document. The documentation process is still in progress: please keep it in your mind while using the provided information.</p> -</div> -<h2 id="XBL_Elements" name="XBL_Elements"><a href="/en/XBL/XBL_1.0_Reference/Elements">XBL Elements</a></h2> -<p>XBL 1.0 elements are in the <code><span class="nowiki">http://www.mozilla.org/xbl</span></code> namespace.</p> -<ul> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#bindings">bindings</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#binding">binding</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#_content">content</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#children">children</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#implementation">implementation</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#constructor">constructor</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#destructor">destructor</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#field">field</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#property">property</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#getter">getter</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#setter">setter</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#method">method</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#parameter">parameter</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#body">body</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#handlers">handlers</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#handler">handler</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#resources">resources</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#stylesheet">stylesheet</a></code></li> - <li><code><a href="/en/XBL/XBL_1.0_Reference/Elements#image">image</a></code></li> -</ul> -<h2 id="Binding_Attachment_and_Detachment" name="Binding_Attachment_and_Detachment"><a href="/en/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment">Binding Attachment and Detachment</a></h2> -<ul> - <li><a href="/en/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#Attachment_using_CSS">Attachment using CSS</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#Attachment_using_element.style_property">Attachment using element.style property</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#.3Cconstructor.3E_call"><constructor> call</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#.3Cdestructor.3E_call"><destructor> call</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#Binding_Documents">Binding Documents</a></li> -</ul> -<h2 id="DOM_Interfaces" name="DOM_Interfaces"><a href="/en/XBL/XBL_1.0_Reference/DOM_Interfaces" title="en/XBL/XBL_1.0_Reference/DOM_Interfaces">DOM Interfaces</a></h2> -<ul> - <li><a href="/en/XBL/XBL_1.0_Reference/DOM_Interfaces#The_nsIDOMDocumentXBL_Interface" title="en/XBL/XBL 1.0 Reference/DOM Interfaces#The nsIDOMDocumentXBL Interface">The nsIDOMDocumentXBL Interface</a></li> -</ul> -<h2 id="Anonymous_Content" name="Anonymous_Content"><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content">Anonymous Content</a></h2> -<ul> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Introduction">Introduction</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Scoping_and_Access_Using_the_DOM">Scoping and Access Using the DOM</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Content_Generation">Content Generation</a> - <ul> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Rules_for_Generation">Rules for Generation</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#The_contentgenerated_Event">The contentgenerated Event</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#The_contentdestroyed_Event">The contentdestroyed Event</a></li> - </ul> - </li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Attribute_Forwarding">Attribute Forwarding</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Insertion_Points">Insertion Points</a> - <ul> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#.3Cchildren.3E_and_.3Celement.3E"><children> and <element></a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Handling_DOM_Changes">Handling DOM Changes</a></li> - </ul> - </li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Event_Flow_and_Targeting">Event Flow and Targeting</a> - <ul> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Flow_and_Targeting_Across_Scopes">Flow and Targeting Across Scopes</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Focus_and_Blur_Events">Focus and Blur Events</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Mouseover_and_Mouseout_Events">Mouseover and Mouseout Events</a></li> - </ul> - </li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Anonymous_Content_and_CSS">Anonymous Content and CSS</a> - <ul> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Selectors_and_Scopes">Selectors and Scopes</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content#Binding_Stylesheets">Binding Stylesheets</a></li> - </ul> - </li> -</ul> -<h2 id="Binding_Implementations" name="Binding_Implementations"><a href="/en/XBL/XBL_1.0_Reference/Binding_Implementations">Binding Implementations</a></h2> -<ul> - <li><a href="/en/XBL/XBL_1.0_Reference/Binding_Implementations#Introduction">Introduction</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Binding_Implementations#Methods">Methods</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Binding_Implementations#Properties">Properties</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Binding_Implementations#Inheritance_of_Implementations">Inheritance of Implementations</a></li> -</ul> -<h2 id="Event_Handlers" name="Event_Handlers"><a href="/en/XBL/XBL_1.0_Reference/Event_Handlers">Event Handlers</a></h2> -<h2 id="Example_-_Sticky_Notes" name="Example_-_Sticky_Notes"><a href="/en/XBL/XBL_1.0_Reference/Example_Sticky_Notes">Example - Sticky Notes</a></h2> -<p>Updated and adjusted for the current Firefox implementation.</p> -<div class="note"> - <p>This example is targeted to demonstrate the XBL usage rather than to be a practically useful application. For this reason it contains many comments and some blocks could be avoided in a more compact solution yet used here for demonstration purposes.</p> -</div> -<ul> - <li><a href="/en/XBL/XBL_1.0_Reference/Example_Sticky_Notes#notes.html">notes.html</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Example_Sticky_Notes#notes.xml">notes.xml</a></li> - <li><a href="/en/XBL/XBL_1.0_Reference/Example_Sticky_Notes#notes.css">notes.css</a></li> -</ul> -<p><a class="external" href="http://www.cogjam.com/external/xbl/notes.html">View this example</a></p> -<p><br> - <span class="comment"><a class="external" href="http://www.nskom.com/external/xbl/notes.zip" title="http://www.nskom.com/external/xbl/notes.zip">Download all files (.zip archive)</a> need to ask to adjust the server - it gives "Access denied" for zip files (?)</span></p> -<h2 id="References" name="References">References</h2> -<ul> - <li><a class="external" href="http://www.w3.org/TR/xbl/">Initial XBL 1.0 proposal submitted as a Note to W3C</a> (does not reflect Mozilla implementation, nor future plans)</li> - <li><a class="external" href="http://www.mozilla.org/projects/xbl/xbl2.html">XBL 2.0 Project</a></li> -</ul> -<div class="originaldocinfo"> - <h2 id="Original_Document_Information" name="Original_Document_Information">Original Document Information</h2> - <ul> - <li>Last Updated Date: April 24, 2006</li> - </ul> -</div> diff --git a/files/zh-cn/archive/mozilla/xpinstall/index.html b/files/zh-cn/archive/mozilla/xpinstall/index.html deleted file mode 100644 index b1d122e53b..0000000000 --- a/files/zh-cn/archive/mozilla/xpinstall/index.html +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: XPInstall -slug: Archive/Mozilla/XPInstall -tags: - - XPInstall - - XPInstall_API_reference -translation_of: Archive/Mozilla/XPInstall ---- -<p></p><div class="warning"><p>Parts of this page show the use of the <a href="https://developer.mozilla.org/zh-CN/docs/XPInstall_API_Reference">XPInstall API</a>. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. <a href="https://developer.mozilla.org/zh-CN/docs/Extensions">Extension</a>, <a href="https://developer.mozilla.org/zh-CN/docs/Themes">Theme</a>, and <a href="https://developer.mozilla.org/zh-CN/docs/Plugins">plug-in</a> developers must switch away from <code>install.js</code> based packages to the new <a href="https://developer.mozilla.org/zh-CN/docs/Bundles">packaging scheme</a> with an <code><a href="https://developer.mozilla.org/zh-CN/docs/Install_Manifests">install.rdf</a></code> manifest. In particular plugin developers should see <a class="new" href="https://developer.mozilla.org/zh-CN/docs/Shipping_a_plugin_as_a_Toolkit_bundle" rel="nofollow">how to package a plugin as an extension</a>.</p></div><p></p> - -<div><strong>Cross-Platform Install (XPInstall)</strong> is a technology used by Mozilla Application Suite, Mozilla Firefox, Mozilla Thunderbird and other <a href="cn/XUL">XUL</a>-based applications for installing <a href="cn/Extensions">extensions</a>. An <a href="cn/XPI">XPI</a> (pronounced "zippy" and derived from XPInstall) installer module is a ZIP file that contains an install script or manifest (entitled install.js or <a href="cn/Install_Manifests">install.rdf</a>) at the root of the file.<br> -<strong>跨平台安装(XPInstall)</strong>是被Mozilla应用程序套件(Firefox, Thunderbird, 其它一些基于<a href="cn/XUL">XUL</a>的应用程序)所使用的一项安装扩展的技术. <a href="cn/XPI">XPI</a>安装模块是一个ZIP文件, 它包括一个位于根路径的安装脚本文件或者清单(符合规定格式的install.js或者<a href="cn/Install_Manifests">install.ref</a>)文件</div> - -<p>.</p> - -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h4 id="Documentation" name="Documentation"><a>Documentation</a></h4> - - <dl> - <dt><a href="cn/XPInstall_API_Reference">XPInstall API 参考</a></dt> - </dl> - - <dl> - <dt><a href="cn/Learn_XPI_Installer_Scripting_by_Example">通过实例学习XPI安装脚本</a></dt> - <dd><small>This article uses the installer script from <code>browser.xpi</code> install package as the basis for discussing XPI installations in general. </small></dd> - <dd>这篇文章使用了取至于<code>browser.xpi</code>安装包中的安装脚本来讨论XPI安装的基本原理.</dd> - </dl> - - <dl> - <dt><a href="cn/Creating_XPI_Installer_Modules">创建XPI安装模块</a></dt> - <dd><small>This article describes the packaging scheme of the Mozilla and offers a tutorial for creating a new package that can then be redistributed, installed, and made available to users. </small></dd> - <dd>这篇文件描述了Mozilla安装模块的打包方案, 并提供了一个关于创建一个新的可用来分发, 安装和用户可用的安装包的教程.</dd> - </dl> - - <dl> - <dt><a href="cn/Install_Wizards_(aka/Stub_Installers)">安装向导 (aka: Stub Installers)</a></dt> - </dl> - - <p><span class="alllinks"><a>View All...</a></span></p> - </td> - <td> - <h4 id="Community" name="Community">Community</h4> - - <ul> - <li>View Mozilla forums...</li> - </ul> - - <p></p><ul> - <li><a href="https://lists.mozilla.org/listinfo/dev-platform"> 邮件列表</a></li> - - - <li><a href="http://groups.google.com/group/mozilla.dev.platform"> 新闻组</a></li> - <li><a href="http://groups.google.com/group/mozilla.dev.platform/feeds"> Web feed</a></li> -</ul><p></p> - - <h4 id="Tools" name="Tools">Tools</h4> - - <ul> - <li><a class="external" href="http://www.mozilla.org/quality/smartupdate/xpinstall-trigger.html">XPInstall trigger page</a></li> - </ul> - - <h4 id="Related_Topics" name="Related_Topics">Related Topics</h4> - - <dl> - <dd><a href="cn/Extensions">Extensions</a>, <a href="cn/XUL">XUL</a>, <a href="cn/XPI">XPI</a></dd> - </dl> - </td> - </tr> - </tbody> -</table> - -<p><span class="comment">Categories</span></p> - -<p><span class="comment">Interwiki Language Links</span></p> - -<p> </p> - -<div class="noinclude"> </div> - -<p></p> diff --git a/files/zh-cn/archive/mozilla/xpinstall/reference/index.html b/files/zh-cn/archive/mozilla/xpinstall/reference/index.html deleted file mode 100644 index 5111ad1a6b..0000000000 --- a/files/zh-cn/archive/mozilla/xpinstall/reference/index.html +++ /dev/null @@ -1,189 +0,0 @@ ---- -title: XPInstall API reference -slug: Archive/Mozilla/XPInstall/Reference -translation_of: Archive/Mozilla/XPInstall/Reference ---- -<p></p><div class="warning"><p>Parts of this page show the use of the <a href="https://developer.mozilla.org/zh-CN/docs/XPInstall_API_Reference">XPInstall API</a>. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. <a href="https://developer.mozilla.org/zh-CN/docs/Extensions">Extension</a>, <a href="https://developer.mozilla.org/zh-CN/docs/Themes">Theme</a>, and <a href="https://developer.mozilla.org/zh-CN/docs/Plugins">plug-in</a> developers must switch away from <code>install.js</code> based packages to the new <a href="https://developer.mozilla.org/zh-CN/docs/Bundles">packaging scheme</a> with an <code><a href="https://developer.mozilla.org/zh-CN/docs/Install_Manifests">install.rdf</a></code> manifest. In particular plugin developers should see <a class="new" href="https://developer.mozilla.org/zh-CN/docs/Shipping_a_plugin_as_a_Toolkit_bundle" rel="nofollow">how to package a plugin as an extension</a>.</p></div><p></p> - - -<h3 id="Objects" name="Objects">Objects</h3> - -<h4 id="Install" name="Install"><a href="/en-US/docs/XPInstall_API_Reference/Install_Object">Install</a></h4> - -<dl> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Properties">Properties</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods">Methods</a></dd> -</dl> - -<dl> - <dd> - <dl> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/addDirectory">addDirectory</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/addFile">addFile</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/alert">alert</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/cancelInstall">cancelInstall</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/confirm">confirm</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/deleteRegisteredFile">deleteRegisteredFile</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/execute">execute</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/gestalt">gestalt</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/getComponentFolder">getComponentFolder</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/getFolder">getFolder</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/getLastError">getLastError</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/getWinProfile">getWinProfile</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/getWinRegistry">getWinRegistry</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/initInstall">initInstall</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/loadResources">loadResources</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/logComment">logComment</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/patch">patch</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/performInstall">performInstall</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/refreshPlugins">refreshPlugins</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/registerChrome">registerChrome</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/resetError">resetError</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Install_Object/Methods/setPackageFolder">setPackageFolder</a></dd> - </dl> - </dd> -</dl> - -<h4 id="InstallTrigger" name="InstallTrigger"><a href="/en-US/docs/XPInstall_API_Reference/InstallTrigger_Object">InstallTrigger</a></h4> - -<dl> - <dd><em>No properties</em></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallTrigger_Object/Methods">Methods</a></dd> -</dl> - -<dl> - <dd> - <dl> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallTrigger_Object/Methods/compareVersion">compareVersion</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallTrigger_Object/Methods/enabled">enabled</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallTrigger_Object/Methods/getVersion">getVersion</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallTrigger_Object/Methods/install">install</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallTrigger_Object/Methods/installChrome">installChrome</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallTrigger_Object/Methods/startSoftwareUpdate">startSoftwareUpdate</a></dd> - </dl> - </dd> -</dl> - -<h4 id="InstallVersion" name="InstallVersion"><a href="/en-US/docs/XPInstall_API_Reference/InstallVersion_Object">InstallVersion</a></h4> - -<dl> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallVersion_Object/Properties">Properties</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallVersion_Object/Methods">Methods</a></dd> -</dl> - -<dl> - <dd> - <dl> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallVersion_Object/Methods/compareTo">compareTo</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallVersion_Object/Methods/init">init</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/InstallVersion_Object/Methods/toString">toString</a></dd> - </dl> - </dd> -</dl> - -<h4 id="File" name="File"><a href="/en-US/docs/XPInstall_API_Reference/File_Object">File</a></h4> - -<dl> - <dd><em>No properties</em></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods">Methods</a></dd> -</dl> - -<dl> - <dd> - <dl> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/copy">copy</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/dirCreate">dirCreate</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/dirGetParent">dirGetParent</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/dirRemove">dirRemove</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/dirRename">dirRename</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/diskSpaceAvailable">diskSpaceAvailable</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/execute">execute</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/exists">exists</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/isDirectory">isDirectory</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/isFile">isFile</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/macAlias">macAlias</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/modDate">modDate</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/modDateChanged">modDateChanged</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/move">move</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/remove">remove</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/rename">rename</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/size">size</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/windowsGetShortName">windowsGetShortName</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/windowsRegisterServer">windowsRegisterServer</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/File_Object/Methods/windowsShortcut">windowsShortcut</a></dd> - </dl> - </dd> -</dl> - -<h4 id="WinProfile" name="WinProfile"><a href="/en-US/docs/XPInstall_API_Reference/WinProfile_Object">WinProfile</a></h4> - -<dl> - <dd><em>No properties</em></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinProfile_Object/Methods">Methods</a></dd> -</dl> - -<dl> - <dd> - <dl> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinProfile_Object/Methods/getString">getString</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinProfile_Object/Methods/writeString">writeString</a></dd> - </dl> - </dd> -</dl> - -<h4 id="WinReg" name="WinReg"><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object">WinReg</a></h4> - -<dl> - <dd><em>No properties</em></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods">Methods</a></dd> -</dl> - -<dl> - <dd> - <dl> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/createKey">createKey</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/deleteKey">deleteKey</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/deleteValue">deleteValue</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/enumKeys">enumKeys</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/enumValueNames">enumValueNames</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/getValue">getValue</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/getValueNumber">getValueNumber</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/getValueString">getValueString</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/isKeyWritable">isKeyWritable</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/keyExists">keyExists</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/setRootKey">setRootKey</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/setValue">setValue</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/setValueNumber">setValueNumber</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/setValueString">setValueString</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/Methods/valueExists">valueExists</a></dd> - </dl> - </dd> -</dl> - -<dl> - <dd><a href="/en-US/docs/XPInstall_API_Reference/WinReg_Object/WinRegValue">WinRegValue constructor</a></dd> -</dl> - -<h3 id="Other_Information" name="Other_Information">Other Information</h3> - -<h4 id="Return_Codes" name="Return_Codes">Return Codes</h4> - -<p><a href="/en-US/docs/XPInstall_API_Reference/Return_Codes">See complete list</a></p> - -<h4 id="Examples" name="Examples"><a href="/en-US/docs/XPInstall_API_Reference/Examples">Examples</a></h4> - -<dl> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Examples/Trigger_Scripts_and_Install_Scripts">Trigger Scripts and Install Scripts</a></dd> -</dl> - -<h5 id="Code_Samples" name="Code_Samples">Code Samples</h5> - -<dl> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Examples/File.macAlias">File.macAlias</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Examples/File.windowsShortcut">File.windowsShortcut</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Examples/Install.addDirectory">Install.addDirectory</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Examples/Install.addFile">Install.addFile</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Examples/InstallTrigger.installChrome">InstallTrigger.installChrome</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Examples/InstallTrigger.startSoftwareUpdate">InstallTrigger.startSoftwareUpdate</a></dd> - <dd><a href="/en-US/docs/XPInstall_API_Reference/Examples/Windows_Install">Windows Install</a></dd> -</dl> diff --git a/files/zh-cn/archive/mozilla/xpinstall/reference/install_object/index.html b/files/zh-cn/archive/mozilla/xpinstall/reference/install_object/index.html deleted file mode 100644 index 0a4a02a30a..0000000000 --- a/files/zh-cn/archive/mozilla/xpinstall/reference/install_object/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: Install Object -slug: Archive/Mozilla/XPInstall/Reference/Install_Object -tags: - - XPInstall_API_reference -translation_of: Archive/Mozilla/XPInstall/Reference/Install_Object ---- -<p></p><div class="warning"><p>Parts of this page show the use of the <a href="https://developer.mozilla.org/zh-CN/docs/XPInstall_API_Reference">XPInstall API</a>. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. <a href="https://developer.mozilla.org/zh-CN/docs/Extensions">Extension</a>, <a href="https://developer.mozilla.org/zh-CN/docs/Themes">Theme</a>, and <a href="https://developer.mozilla.org/zh-CN/docs/Plugins">plug-in</a> developers must switch away from <code>install.js</code> based packages to the new <a href="https://developer.mozilla.org/zh-CN/docs/Bundles">packaging scheme</a> with an <code><a href="https://developer.mozilla.org/zh-CN/docs/Install_Manifests">install.rdf</a></code> manifest. In particular plugin developers should see <a class="new" href="https://developer.mozilla.org/zh-CN/docs/Shipping_a_plugin_as_a_Toolkit_bundle" rel="nofollow">how to package a plugin as an extension</a>.</p></div><p></p> - -<h2 id="Install_.28Install_.E5.AF.B9.E8.B1.A1.29" name="Install_.28Install_.E5.AF.B9.E8.B1.A1.29">Install (Install 对象)</h2> - -<p>Use the <code>Install</code> object to manage the downloading and installation of software with the XPI Installation Manager.<br> - 译:使用<code>Install</code>对象协同XPI安装管理器操纵软件的下载和安装.</p> - -<h3 id="Overview" name="Overview">Overview</h3> - -<p>The Install object is used primarily in installation scripts. In all cases, the <code>Install</code> object is implicit--like the <code>window</code> object in regular web page scripts--and needn't be prefixed to the object methods. The following two lines, for example, are equivalent:<br> - Install对象首先会被安装脚本所使用. Install对象总是隐式的, 如同在规则的web页脚本中的<code>window</code>对象一样, 你并不需要将其作为其方法的调用前缀. 例如, 以下两行代码功能是完全一样的:</p> - -<pre>f = getFolder("Program"); -f = Install.getFolder("Program"); -</pre> - -<p>An installation script is composed of calls to the Install object, and generally takes the following form:<br> - 一个安装脚本被书写为调用Install对象, 并且通常采取以下形式:</p> - -<dl> - <dt>Initialize the installation (初始化安装)</dt> - <dd>Call <a href="cn/XPInstall_API_Reference/Install_Object/Methods/initInstall"> initInstall</a> with the name of the installation and the necessary registry and version information.</dd> - <dd>调用<a href="cn/XPInstall_API_Reference/Install_Object/Methods/initInstall">initInstall(函数)</a>, 和安装的名称, 必须的注册以及版本信息.</dd> - <dt>Add the files to the installation (添加文件到安装)</dt> - <dd>Add files to the installation by calling <a href="cn/XPInstall_API_Reference/Install_Object/Methods/getFolder"> getFolder</a> to get file objects and passing those object refs to <a href="cn/XPInstall_API_Reference/Install_Object/Methods/addFile"> addFile</a> as many times as necessary.</dd> - <dd>添加文件到安装, 通过调用<a href="cn/XPInstall_API_Reference/Install_Object/Methods/getFolder"> getFolder(函数)</a>取得文件对象并传递那些对象引用到<a href="cn/XPInstall_API_Reference/Install_Object/Methods/addFile"> addFile(函数)</a>, 多数时候这样做还是有必要的.</dd> - <dt>Perform installation (执行安装)</dt> - <dd>Check that the files have been added successfully (e.g., by checking the error <a href="cn/XPInstall_API_Reference/Return_Codes"> Return Codes</a> from many of the main installation methods, and go ahead with the install if everything is in order:</dd> - <dd>检查那些文件是否被添加成功(比如通过检查<a href="cn/XPInstall_API_Reference/Return_Codes"> Return Codes</a>从多数主要安装函数所返回的错误代码), 并且如果所有函数的执行都是正确的, 那么就可以进行后继安装步骤:</dd> -</dl> - -<pre>performOrCancel(); -function performOrCancel() -{ - if (0 == getLastError()) - performInstall(); - else - cancelInstall(); -} -</pre> - -<p>For complete script examples, see <a href="cn/XPInstall_API_Reference/Examples"> Script Examples</a>.<br> - 完事的脚本实例, 参见<a href="cn/XPInstall_API_Reference/Examples"> Script Examples</a>.</p> diff --git a/files/zh-cn/archive/mozilla/xpinstall/reference/install_object/properties/index.html b/files/zh-cn/archive/mozilla/xpinstall/reference/install_object/properties/index.html deleted file mode 100644 index 76804ce8cd..0000000000 --- a/files/zh-cn/archive/mozilla/xpinstall/reference/install_object/properties/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: Properties -slug: Archive/Mozilla/XPInstall/Reference/Install_Object/Properties -translation_of: Archive/Mozilla/XPInstall/Reference/Install_Object/Properties ---- -<p> </p> -<h3 id="Properties" name="Properties">Properties</h3> -<dl> - <dt> - <code>archive</code></dt> - <dd> - Full local path of the archive after it is downloaded to the platform specific temp folder. (e.g. <code>C:\TEMP\argstest.xpi</code>)</dd> - <dt> - <code>arguments</code></dt> - <dd> - args can be passed in through the triggering APIs by attaching a ? and then the rg string to the xpi URL: (e.g. <code>startSoftwareUpdate(<span class="nowiki">"http://webserver/argstest.xpi?ARGUMENT_STRING"</span>)</code> will result in the value of <code>Install.arguments</code> being <code>ARGUMENT_STRING</code> #). Note that spaces in the arg string are legal. Everything after the question mark is treated as one string which becomes the <code>Install.arguments</code> property.</dd> - <dt> - <code>buildID</code></dt> - <dd> - The application build ID in the form 20041231. Note that due to branching (different versions of Gecko with different feature sets might be built on the same day), using this property to "detect" the application version may produce false results. Additionally, the build ID can be 0 for custom builds.</dd> - <dt> - <code>jarfile</code></dt> - <dd> - Alias for <code>archive</code></dd> - <dt> - <code>platform</code></dt> - <dd> - Contains information about the platform XPInstall was compiled for/runs on. For example, the value could begin with "Windows", "Macintosh" or "X11" (for Unix/Linux). For more details, see the corresponding code living in the <a class="external" href="http://lxr.mozilla.org/mozilla/ident?i=GetInstallPlatform">GetInstallPlatform method of class nsInstall</a>.</dd> - <dt> - <code>url</code></dt> - <dd> - The fully qualified URL of the xpi (file URL, http URL, ftp URL, etc.) (e.g. <code><span class="nowiki">http://dolfin/sgehani/zzz/ip.xpi</span></code>). Note, even if triggered using relative URLs this will show the full URL (after qualification).</dd> -</dl> diff --git a/files/zh-cn/archive/mozilla/xpinstall/scripting_by_example/index.html b/files/zh-cn/archive/mozilla/xpinstall/scripting_by_example/index.html deleted file mode 100644 index fb43c1237c..0000000000 --- a/files/zh-cn/archive/mozilla/xpinstall/scripting_by_example/index.html +++ /dev/null @@ -1,246 +0,0 @@ ---- -title: Learn XPI Installer Scripting by Example -slug: Archive/Mozilla/XPInstall/Scripting_by_example -tags: - - XPInstall - - XPInstall_API_reference -translation_of: Archive/Mozilla/XPInstall/Scripting_by_example ---- -<p></p><div class="warning"><p>Parts of this page show the use of the <a href="https://developer.mozilla.org/zh-CN/docs/XPInstall_API_Reference">XPInstall API</a>. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. <a href="https://developer.mozilla.org/zh-CN/docs/Extensions">Extension</a>, <a href="https://developer.mozilla.org/zh-CN/docs/Themes">Theme</a>, and <a href="https://developer.mozilla.org/zh-CN/docs/Plugins">plug-in</a> developers must switch away from <code>install.js</code> based packages to the new <a href="https://developer.mozilla.org/zh-CN/docs/Bundles">packaging scheme</a> with an <code><a href="https://developer.mozilla.org/zh-CN/docs/Install_Manifests">install.rdf</a></code> manifest. In particular plugin developers should see <a class="new" href="https://developer.mozilla.org/zh-CN/docs/Shipping_a_plugin_as_a_Toolkit_bundle" rel="nofollow">how to package a plugin as an extension</a>.</p></div><p></p> - -<p>This article uses the installer script from browser.xpi install package as the basis for discussing XPI installations in general. This <code><a href="cn/Learn_XPI_Installer_Scripting_by_Example/Installer_Script">installer script</a></code> is relatively short, but it exercises most of the important features of the XPInstall API, and it can easily be used as a template for other more general software installations. In this article, we use the unix install file, but the installers for all the platforms are quite similar, and you can easily take what you learn here and apply it to installations on any platform that mozilla supports.</p> - -<h2 id="About_browser.xpi" name="About_browser.xpi">About <code>browser.xpi</code></h2> - -<p><code>browser.xpi</code> is the XPI archive in which the main components of the Mozilla browser are archived for installation. Mozilla cross-platform installations use the XPI format as a way to organize, compress, and automate software installations and software updates. A XPI is a PKZIP-compressed archive (like ZIP and JAR files) with a special script at the highest level that manages the installation. That <code><a href="cn/Learn_XPI_Installer_Scripting_by_Example/Installer_Script">installer script</a></code> , usually named <code>install.js</code>, is the subject of this article.</p> - -<p>First, a quick scan of the contents of the XPI file (which you can open using with any unzip utility) reveals the following high-level directory structure:</p> - -<pre>install.js -bin\ - chrome\ - components - defaults\ - icons\ - plugins\ - res\ -</pre> - -<p>Note that this high-level structure parallels the directory structure of the installed browser very closely:</p> - -<p><img alt="mozilla directory on linux"></p> - -<p>As you will see in the installation script, the contents of the archive are installed onto the file system in much the same way that they are stored in the archive itself, though it's possible to rearrange things arbitrarily upon installation--to create new directories, to install files in system folders and other areas.</p> - -<h2 id="Overview_of_the_Install_Script" name="Overview_of_the_Install_Script">Overview of the Install Script</h2> - -<p>XPI install scripts are written in JavaScript using XPInstall Engine syntax defined in the <a href="cn/XPInstall_API_Reference">XPInstall API Reference</a>.</p> - -<p>Most installation scripts, including the one discussed here, take the following basic form (in pseudo-code and with links to the sections in which these installation steps are documented):</p> - -<pre>initInstall(); -if (verify_space()) { - err = add_dirs_and_files; - register_files; - - if (err==SUCCESS) { performInstall() }; - else { cancelInstall() }; -} -</pre> - -<p>As you can see in the <a href="cn/Learn_XPI_Installer_Scripting_by_Example/Installer_Script">code listing</a>, the verification process at the top is on lines 1 to 18; the file addition process, here part of the main installation block, is on lines 24 to 41; the registration part of the main installation block is on lines 42-58; and the execution at the end of the main block is on lines 59 to 71. If you choose not to register the installed software or do the verifications at the front end of the installation, then at a minimum, the install scripts must<em>initialize, add the files to be installed, and execute.</em></p> - -<p>Note also that when you call methods on the <code>Install</code>--as you do so often in installation scripts (<code>getFolder</code>, <code>initInstall</code>, <code>addFile</code>, and <code>performInstall</code> are all examples of common <code>Install</code> object methods)--the <code>Install</code> object is implicit; like the <code>window</code> object in regular web page scripts, the Install object does not need to be prefixed to the method.</p> - -<h3 id="Initializing_the_Installation" name="Initializing_the_Installation">Initializing the Installation</h3> - -<p>All installations must begin with <code>initInstall()</code>. The <code>initInstall()</code> method on the Install object creates a new installation for the specified software and version. In the browser.xpi installation, this function appears at line 20: <code> var err = initInstall("Netscape Seamonkey", "Browser", "6.0.0.2000110807"); </code></p> - -<p>If you call a method on the <code>Install</code> object before <code>initInstall()</code>, you will get an error.</p> - -<p>The <code>initInstall</code> method takes the following parameters: the display name of the package, the name of the package as it appears in the client registry, and the version, which can be expressed as a number or as an InstallVersion object. In the example above, "Netscape Seamonkey" is the display name, "Browser" is the registry name, and the version is "6.0.0.2000110807." See <code><a href="cn/XPInstall_API_Reference/Install_Object/Methods/initInstall">initInstall</a></code> in the <a href="cn/XPInstall_API_Reference">XPInstall API Reference</a> for more information on the initialization process.</p> - -<h3 id="Verifying_the_Target" name="Verifying_the_Target">Verifying the Target</h3> - -<p>The first thing the installation script does when it's executed is to check that there is adequate disk space for the software to be installed, where the <code>verifyDiskSpace</code> function is called as a condition of the main installation block that starts at line 24).</p> - -<pre> // this function verifies disk space in kilobytes - function verifyDiskSpace(dirPath, spaceRequired) - { - var spaceAvailable; - // Get the available disk space on the given path - spaceAvailable = fileGetDiskSpaceAvailable(dirPath); - - // Convert the available disk space into kilobytes - spaceAvailable = parseInt(spaceAvailable / 1024); - // do the verification - if(spaceAvailable < spaceRequired) - { - logComment("Insufficient disk space: " + dirPath); - logComment(" required : " + spaceRequired + " K"); - logComment(" available: " + spaceAvailable + " K"); - return(false); - } - return(true); - } -</pre> - -<p>In the <code>verifyDiskSpace</code> block, <code>fileGetDiskSpaceAvailable</code> is called with <code>dirPath</code> as its expected input. This input is defined in line 22, where <code>getFolder()</code> is used to assign a value to the communicatorFolder variable representing the "Program" folder on the local system:</p> - -<pre>var communicatorFolder = getFolder("Program"); -spaceAvailable = fileGetDiskSpaceAvailable(dirPath); -</pre> - -<p><code>spaceRequired</code>, the other expected input to the <code>verifyDiskSpace</code> function, is given as 17311 kilobytes on line 19. Inside the function, the two sizes are compared and if the available space is larger than the required space, the installation proceeds.</p> - -<h3 id="Adding_Files_and_Directories_.28Full_of_Files.29_to_the_Install" name="Adding_Files_and_Directories_.28Full_of_Files.29_to_the_Install">Adding Files and Directories (Full of Files) to the Install</h3> - -<p>Once you have verified that the target can accomodate the software to be installed and initialized the actual installation, you must add files and directories to the installation in order to have them installed. In the <code>browser.xpi</code> install script, the files are added in lines 26-41:</p> - -<pre> err = addDirectory("Program", - "6.0.0.2000110807", - "bin", // jar source folder - communicatorFolder, // target folder - "", // target subdir - true ); // force flag - - logComment("addDirectory() returned: " + err); - - // create the plugins folder next to mozilla - var pluginsFolder = getFolder("Plugins"); - if (!fileExists(pluginsFolder)) - { - var ignoreErr = dirCreate(pluginsFolder); - logComment("dirCreate() returned: " + ignoreErr); - } - else - logComment("Plugins folder already exists"); -</pre> - -<p>In this case, the files are contained within a single directory, so calling the <code>Install</code> object's <code>addDirectory</code> method is sufficient to queue all the files in the archive for installation. The <code>addDirectory</code>, like <code>addFile</code>, handles both the source file location and the target location. In the example above, all of the contents of the "bin" directory in the archive are queued for installation, and the target of that installation (when the installation is actually begun with a call to <code>performInstall</code> at the end), is the <code>communicatorFolder</code> directory defined at line 22 as "Program."</p> - -<p>"Program" is one of a short list of keywords that can be used in place of full path names in methods such as <code>addFile</code>. "Program" represents the directory where software itself is installed (e.g., <code>C:\Program Files\</code> on win32 systems), as opposed to supporting directories like "Components", "Chrome", or "Temporary" (see <code><a href="cn/XPInstall_API_Reference/Install_Object/Methods/getFolder">getFolder</a></code> in the <a href="cn/XPInstall_API_Reference">XPInstall API Reference</a> for a list of keywords).</p> - -<h3 id="Registering_the_Software" name="Registering_the_Software">Registering the Software</h3> - -<p>Registering software is sometimes a requirement of both the operating system and of the Netscape 6 platform. When you install new chrome, for example, like the <code>browser.xpi</code> install does, you need to alert the chrome registry to these changes, so that skins, user preferences, packaging lists, and localization bundles will all track the new software.</p> - -<p>For registering software with the win32 operating system, the XPInstall API provides two special Install objects, <code>WinProfile</code> and <code>WinReg</code>. These two objects provide programmatic access to the Windows user profile and the Windows registry, respectively. The <code>browser.xpi</code> install script does not demonstrate the use of these objects, but see the XPInstall API Reference for more information about registering software with the win32 operating systems and other operating systems.</p> - -<p>To register new Netscape 6-based software (e.g., plug-ins, new components, new themes, new packages) with the chrome registry, you must use the registerChrome function of the Install object. If successful, this function returns a "0" and makes entries into the<em>installed-chrome.txt</em> file in the <code>chrome</code> subdirectory, which is then used to regenerate the various RDF files that make up the chrome registry.</p> - -<pre> var cf = getFolder("Chrome"); - registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"toolkit.xpi"),"content/global/"); - registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"browser.xpi"),"content/communicator/"); - registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"browser.xpi"),"content/editor/"); - registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"browser.xpi"),"content/navigator/"); - registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/communicator/"); - registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/editor/"); - ... -</pre> - -<p>In lines 42-58, <code>registerChrome</code> is called as many times as there are different directories that contain content that needs to be registered with the chrome registry. Note that in the first few lines of this process, new content from the XPI is being registered, and in the remainder, it is new skin information. In this most common form of the <code>registerChrome</code> function (it can also be used to support the now-deprecated<em>manifest.rdf</em> style of installation archive), the three parameters represent, in order, the chrome <code>SWITCH</code> used to indicate what kind of software is being registered, the target destination of the software (e.g., the "Chrome" folder in the example above), and the path within the XPI (or JAR theme archive) where the contents.rdf file is located.</p> - -<p>See <code><a href="cn/XPInstall_API_Reference/Install_Object/Methods/registerChrome">registerChrome</a></code> in the XPInstall API Reference for more information about registering new packages with the chrome registry.</p> - -<h3 id="Executing_the_Installation" name="Executing_the_Installation">Executing the Installation</h3> - -<p>Once you have added all the files to the installation, the final step is to actually execute the installation. Note that until this point, the install calls you have been making on the Install object are preliminary only. Recall that an install process takes the following general form:</p> - -<pre>initInstall(); -if (verify_space()) { - err = add_dirs_and_files; - register_files; - - if (err==SUCCESS) { performInstall() }; - else { cancelInstall() }; -} -</pre> - -<p>In this arrangement, the actual execution of the installation is checked against the errors returned from the addition of files to the installation, which may itself have been conditioned on some verification of version and necessary disk space.</p> - -<p>The actual install code used to execute the installation appears in the<em>install.js</em> file as follows:</p> - -<pre>if (err==SUCCESS) - { - err = performInstall(); - logComment("performInstall() returned: " + err); - } - - else - { - cancelInstall(err); - logComment("cancelInstall() due to error: " + err); - } -} -else - cancelInstall(INSUFFICIENT_DISK_SPACE); -</pre> - -<p><code>performInstall</code> is the function used to execute the install once it has been initialized and loaded, and it is the last step to installing the software. Note that in the example above, the installation is cancelled if the error code from the file addition process returns success (0), and also cancelled outside the main block if the earlier verification process is not successful.</p> - -<p>Note also the comments that indicate the success of various steps in the process--including the performInstall and cancelInstall steps--are written to the install log using the <code>logComment</code>, described in the following section.</p> - -<h2 id="Installation_Logging" name="Installation_Logging">Installation Logging</h2> - -<p>Logging is an important feature of the XPInstall API that can help you streamline and debug your installations. In the example in the <a href="#Executing_the_Installation">Executing the Installation</a> section and in many places in the installation script, the <code>logComment</code> API is used to write data to a log file that can then be reviewed when things don't go as planned.</p> - -<p>The install log is created in the product directory by default (where the browser executable is). If the installation doesn't have proper permission, the install log is written to the user's profile directory. Respectively, these directories correspond to the "Program" and "Current User" keywords for the getFolder method.</p> - -<h2 id="Extending_the_Example" name="Extending_the_Example">Extending the Example</h2> - -<p>What does all this mean to you? How can this information be adapted for your own installations? In this final section, we describe the application of the XPInstall technology described here in the creation and deployment of a very simple installation script and installation archive (XPI).</p> - -<p>Say you have a simple executable and a README file that goes with it, and you want to make it available for installation from a XPI. After putting these two files in a XPI (which, as described above, is simply a ZIP file with an install.js script at the top and a suffix of '.xpi'), the next step is to add an installation script to the XPI.</p> - -<p>Minimally, the installation script must:</p> - -<ul> - <li>Call <code>initInstall</code> with the name and version of the executable (the version is not optional, though you may or may not use the version in subsequent installations or updates)</li> - <li>Find somewhere to put the installed files. In the example below, <code>getFolder</code> is used with the "Program" keyword to specify the browser's program directory as the target for installation. Since I am using NS6 right now on a Windows machine, that target directory is "C:\Program Files\Netscape\Netscape 6\".</li> - <li>Add files to the initialized installation using <code>addFile</code>.</li> - <li>Call performInstall to execute the installation.</li> -</ul> - -<p>Here is an example of small but complete installation script.</p> - -<pre>var xpiSrc = "cd_ripper.exe"; -var xpiDoc = "README_cdrip"; - -initInstall("My CD Ripper", "cdrip", "1.0.1.7"); -f = getFolder("Program"); -setPackageFolder(f); -addFile(xpiSrc); -addFile(xpiDoc); - -if (0 == getLastError()) - performInstall(); -else - cancelInstall(); -</pre> - -<p>The example above shows this minimal installation. This install script does not include any version or disk space checking, very little error checking, only a single executable, no registration, and no commenting. It does, however, take the executable and the README file and install them on the user's system. Note also that for the installation script in a XPI to be automatically triggered from a web page, you must use a "trigger script." The following InstallTrigger function, called from an event handler on a regular web page, will point to the remotely-hosted XPI (called here 'cdrip.xpi') and trigger its installation:</p> - -<pre>function putIt() -{ - xpi={'CD_Ripper':'cdrip.xpi'}; - InstallTrigger.install(xpi); -} -... - -<a href="#" onclick="putIt();">install the CD Ripper Now!</a> -</pre> - -<p>See the <a href="cn/XPInstall_API_Reference/InstallTrigger_Object">InstallTrigger</a> object in the XPInstall API Reference for more information on triggering installations.</p> - -<div class="originaldocinfo"> -<h2 id="Original_Document_Information" name="Original_Document_Information">Original Document Information</h2> - -<ul> - <li>Author(s): <a class="link-mailto" href="mailto:mailto:oeschger@netscape.com">Ian Oeschger</a></li> - <li>Last Updated Date: 01/26/2006</li> - <li>Copyright Information: Copyright (C) <a class="link-mailto" href="mailto:mailto:oeschger@netscape.com">Ian Oeschger</a></li> -</ul> -</div> - -<p></p> diff --git a/files/zh-cn/archive/mozilla/xpinstall/using_xpinstall_to_install_plugins/index.html b/files/zh-cn/archive/mozilla/xpinstall/using_xpinstall_to_install_plugins/index.html deleted file mode 100644 index 7df82abc04..0000000000 --- a/files/zh-cn/archive/mozilla/xpinstall/using_xpinstall_to_install_plugins/index.html +++ /dev/null @@ -1,227 +0,0 @@ ---- -title: Using XPInstall to Install Plugins -slug: Archive/Mozilla/XPInstall/Using_XPInstall_to_Install_Plugins -tags: - - Plugins - - XPInstall -translation_of: Archive/Mozilla/XPInstall/Installing_plugins ---- -<p><a href="cn/XPInstall">XPInstall</a> is a JavaScript-based installer technology that works across all the platforms that <a class="external" href="http://mozilla.org">Mozilla</a> and Netscape browsers based on Mozilla (such as Netscape 7) are deployed. It can be a way to ensure a smooth user-experience when obtaining plugins, without obliging the user to exit the browsing environment to launch a binary installer (the classic setup.exe experience on Windows) or obliging the user to restart their browser. For plugin vendors who have already written a native code (e.g. EXE) installer, XPInstall can wrap this native installer and run it so that the user never has to leave the browsing environment and click on the EXE to run it. This article presents a guideline for improving the plugin installation experience for Netscape Gecko browsers using <a href="cn/XPInstall_API_Reference">XPInstall</a>. XPInstall是基于js的安装plugin插件的跨平台技术。其包*.xpi,同扩展/主题|皮肤(*.jar)是一样的(zip包)。</p> -<h3 id="A_Definition_of_Terms" name="A_Definition_of_Terms">A Definition of Terms</h3> -<p>XPInstall is an installer technology, and the name itself stands for "Cross Platform Install" (hence "XP" -- an abbreviation for "Cross Platform"). An XPInstall package is usually called an XPI package for short (and often pronounced "zippy"). This article is about how you can use XPInstall to install plugins to the browsers that support XPInstall.</p> -<p>An XPI Package is in fact a ZIP file with the XPI file extension (e.g. myPluginInstaller.xpi), and can be created on Windows by utilities such as WinZip. XPI Packages, like ZIP files, "contain" other files, typically: 典型的插件包结构:</p> -<ul> - <li>The software component to be installed. In our case, this is the plugin software.</li> -</ul> -<p>1。插件本身(动态库:如office.so or office.dll等,另外常见的为各种多媒体插件)。</p> -<ul> - <li>A JavaScript file called install.js, which is the install logic that drives the installation. This includes instructions on where to install the software, and what messages to feed to the user.</li> -</ul> -<p>2。install.js:如何安装该插件的javascript脚本。 You can create an XPInstall file by first zipping all the items you want installed with WinZip (create a ZIP archive) and then renaming it with the XPI file extension instead of the ZIP file extension.</p> -<p>Unlike native code installers (for example, files called setup.exe), the programming language for install operations in XPI is JavaScript. Since the file format that contains the software and the install.js JavaScript file is a cross-platform file (Zip) and since JavaScript is understood by Mozilla browsers on all platforms, often one single XPI package can be deployed on all platforms. This is, in fact, <a class="external" href="http://www.mozilla.org/docs/xul/xulnotes/xulnote_packages.html">how skins and themes are installed to Mozilla browsers</a>, changing their look and feel. This article focuses on how to install plugins.</p> -<h3 id="Which_Browsers_Support_XPInstall.3F" name="Which_Browsers_Support_XPInstall.3F">Which Browsers Support XPInstall?</h3> -<p>哪些浏览器支持XPInstall安装方式? Currently, all <a class="external" href="http://mozilla.org/releases/stable.html">Mozilla browsers released by mozilla.org</a> support XPInstall, and a family of browsers based on Mozilla code support XPInstall. In particular, this includes:</p> -<ul> - <li>Recent Netscape browsers such as Netscape 6.2.x and Netscape 7.0, which are both based on Netscape Gecko, which is at the core of the Mozilla browser</li> - <li>Recent <b>beta-only</b> versions of the AOL software based on Netscape Gecko, the layout engine of the Mozilla project.</li> -</ul> -<p><b>Caveats:</b></p> -<ul> - <li>AOL Time Warner's <a class="external" href="http://www.compuserve.com/">CompuServe browser</a>, also based on Netscape Gecko, does not support XPInstall.</li> - <li>Netscape Communicator 4.x does not support XPInstall.</li> -</ul> -<h3 id="What_Does_a_Plugin_Consist_Of.3F" name="What_Does_a_Plugin_Consist_Of.3F">What Does a Plugin Consist Of?</h3> -<p>一个插件通常包含什么内容? Plugins can consist of the following types of files, all of which can be installed via an XPI Package:</p> -<ul> - <li><b>动态共享链接库</b> (例如,在Windows中,有DLL文件;在Unix中有*.so文件)。 These files are native code files made with the <a href="cn/Gecko_Plugin_API_Reference">Netscape Plugin API</a>.</li> -</ul> -<p>1。遵从Gecko Plugin API或Netscape Plugin API接口的动态库。[cada:也可能only ln连接文件]</p> -<ul> - <li>If the plugin is scriptable, then it will also consist of an <a href="cn/Gecko_Plugin_API_Reference/Plug-in_Development_Overview">XPT file</a>. Examples would be Flash 6r47 on Windows, which consists of a DLL (called npswf32.dll) and an XPT file for scriptability (called flashplayer.xpt). If you are developing a plugin and wish to <a href="cn/Gecko_Plugin_API_Reference/Plug-in_Development_Overview">make it scriptable</a>, read the relevant portions of the <a href="cn/Gecko_Plugin_API_Reference">Plugin API</a>.</li> -</ul> -<p>2。可选文件:xpt文件(该文件用来暴露该插件对外的接口描述--通常用javascript脚本可以访问)--新的插件API无须xpt文件也可以支持同样功能了!</p> -<ul> - <li><b>Additional software.</b> Many plugins are part of additional software for media types. For example, RealPlayer on Windows consists of a plugin DLL, but also the RealPlayer application (EXE) which the plugin DLL is a subset of. In this case, the plugin is the part of the software package that is browser-specific, as a mechanism to give the application additional "hooks" into the browser.</li> -</ul> -<p>3。这种情形也特别多:即某个插件还是某个应用程序的一部分,即该插件必须依赖该应用程序才能在browser中运行,即此时插件依赖的其他文件就是该应用程序的其他相关模块。例如openoffice插件也是这样的。</p> -<p>XPInstall can be used to install any combination of these files on an end-user's machine. For those familiar with Netscape Communicator 4.x's SmartUpdate technology, this will be a familiar idea.</p> -<h3 id="A_Brief_History_of_Netscape_Installer_Technologies" name="A_Brief_History_of_Netscape_Installer_Technologies">A Brief History of Netscape Installer Technologies</h3> -<p>Netscape 安装技术的简要历史: This section is relevant if you are familiar with Netscape Communicator 4.x's SmartUpdate installer technology.[智能update安装技术] The use of JavaScript as the install logic is not unprecedented in Netscape browsers. Netscape Communicator 4.x uses the notion of SmartUpdate to install software, particularly plugins and Java applets to be run locally. SmartUpdate is - <i> - <b>not supported</b></i> - by Mozilla browsers (and Netscape/AOL browsers based on Mozilla such as Netscape 7), but because of the similarity between the two installer technologies, it is easy to convert your SmartUpdate files to XPInstall files. SmartUpdate involves a digitally signed JAR file which contained the software components to be installed as well as a JavaScript install.js file (called the install script安装脚本) as the installer logic. Downloads and installs would be initiated with a security dialog box naming the certificate authority and the signer(签名安装包的验证). Often, the SmartUpdate download was triggered via the pluginurl attribute of the embed tag:</p> -<pre><embed type="application/x-randomtype" src="myfile.typ" width="50" height="50" -pluginurl="http://mytypecompany.xyz/jarpacks/mytypeplugin.jar"></embed> -</pre> -<p>在上面的例子中, the pluginurl attribute points to the signed JAR file, which Netscape Communicator 4.x would then download (subject to the security dialog boxes) <b>if</b> the plugin was not located on the user's machine. SmartUpdate differs from XPInstall in that:以上是Netscape Communicator的插件包(签名的jar包)安装技术概要,他与XPInstall的区别如下:</p> -<ul> - <li>XPInstall uses ZIP files named XPI files (*.xpi) and SmartUpdate uses JAR files (*.jar)一个是zip包一个是jar包--cada:jar包仅仅比zip包多一个自动生成的manifest文件,所以jar包通常比zip包大一点点(对同样内容而言)</li> - <li>Unlike a SmartUpdate JAR file, XPI Packages do not have to be digitally signed with a code-signing certificate.XPI包可以不签名</li> - <li>XPI Packages make use of <a href="cn/XPInstall_API_Reference">different APIs</a> from within install.js(该js中大量使用XPInstall API去实现安装逻辑), although the concept is the same.</li> -</ul> -<p>XPInstall for Mozilla-based browsers is analogous to SmartUpdate in Netscape Communicator 4.x browsers. Porting SmartUpdate deployments to XPInstall is trivial after gaining some familiarity with the <a href="cn/XPInstall_API_Reference">new XPInstall API</a>. 二者移植比较琐碎!详细请查看XPInstall API。</p> -<h3 id="The_Recommended_Installation_Process" name="The_Recommended_Installation_Process">The Recommended Installation Process</h3> -<p>XPInstall provides a cohesive API to accomplish rapid installation and setup of plugin software for end-users. The benefit of using XPInstall is to provide a streamlined installation mechanism. This section discusses what an ideal XPInstall Package will do, as well as points out some of the JavaScript API calls that you will make to accomplish these install tasks. An ideal XPI Package will:</p> -<ol> - <li>Install to the current browser that is initiating the XPInstall installation via HTML or triggering an XPInstall installation via a Trigger Script. We will use the term current browser to refer to the browser that initiates the XPInstall download by visiting a site which requires a plugin that the current browser can not find locally. This step will involve the use of the <a href="cn/XPInstall_API_Reference/Install_Object/Methods/initInstall">initInstall</a> API call to start everything off, and also the <a href="cn/XPInstall_API_Reference/Install_Object/Methods/getFolder">getFolder</a> API call, which helps to locate the current browser's plugin directory.</li> - <li>Install the plugin software to another location on the user's hard disk, so that other Mozilla-based browsers that the user may install later can find the plugin (the browser specific components) and pick it up. The goal is to ensure that future Netscape Gecko browsers that the user may install later can benefit from the installation that the user initiated with the current browser. An example might be that the current browser is Netscape 7, but later, the user downloads a beta of the AOL software using Netscape Gecko. Rather than re-initiate the download of the plugin with the yet another browser, the second Netscape Gecko browser can detect that an installation has already occurred. This discovery mechanism hinges on making the secondary install location available from looking at a common repository of metadata. On Windows, this is the Windows System Registry. Once again, this step involves calls to <a href="cn/XPInstall_API_Reference/Install_Object/Methods/getFolder">getFolder</a> to locate a "well known" directory in which to install to as a secondary install location.</li> - <li>On Windows: write Windows Registry keys that Netscape Gecko browsers (that get installed after the current browser) can parse to discover where the plugin is installed on the machine. In particular, the Windows Registry keys should point to the secondary install location so that future Netscape Gecko browsers can find and add to their list of available plugin locations. The exact format of these registry keys and how they should be written is covered in the section on the first install problem. To actually create and write keys to the Windows System Registry, you'll use the functions of the <a href="cn/XPInstall_API_Reference/WinReg_Object">WinReg object</a>.</li> - <li>Ensure that the plugin that has just been installed is refreshed by correctly invoking the <a href="cn/XPInstall_API_Reference/Install_Object/Methods/refreshPlugins">refreshPlugins API</a>. By refreshing your plugin, you're ensuring that the plugin is available for use immediately, without obliging the user to restart their browser. This is one of the chief advantages of a smooth XPInstall experience.</li> -</ol> -<h3 id="The_First_Install_Problem" name="The_First_Install_Problem">The First Install Problem</h3> -<p>The First Install Problem refers to the conditions arising when a plugin arrives on a user's machine before a browser arrives. The recommended install process addresses this issue, which is to install to a secondary location after installing to the current browser. In a nutshell, the first install problem can be summed up by the question: how can a browser which is installed on a user's machine after a given plugin has already been installed by the user benefit from the existing installation rather than download the same plugin again? In order to address this issue, plugin vendors are encouraged to:</p> -<ul> - <li>Install the plugin software components for the browser (e.g. DLLs on Windows, and XPT files if applicable) to a secondary location, in addition to that of the plugins directory of the current browser.</li> - <li>Write keys in the Windows registry which store information about this secondary location, in particular the Plugin Path and the XPT Path (if applicable) so that Netscape Gecko browsers can pick up the plugin from the secondary location if they are installed after the plugin is (and thus, if a particular Netscape Gecko browser follows or replaces the current browser). The keys to write and the information they should contain is <a class="external" href="http://www.mozilla.org/projects/plugins/first-install-problem.html">discussed in detail in the specification posted on mozilla.org</a>. There is also a <a class="external" href="http://www.mozilla.org/projects/plugins/example-scobe.txt">sample registry entry</a> created by an imaginary company that is illustrative of what is discussed in the <a class="external" href="http://www.mozilla.org/projects/plugins/first-install-problem.html">specification for these registry keys</a>.</li> - <li>On Windows, the Windows Registry keys mentioned above follow a nomenclature using the concept of a <a class="external" href="http://www.mozilla.org/projects/plugins/plugin-identifier.html">Plugin Identifier</a> as the name of the key under the MozillaPlugins subkey. The <a class="external" href="http://www.mozilla.org/projects/plugins/plugin-identifier.html">Plugin Identifier (or PLID)</a> is a useful concept that is also applicable when initializing the installation via the <a href="cn/XPInstall_API_Reference/Install_Object/Methods/initInstall">initInstall API</a>.</li> -</ul> -<h3 id="A_Breakdown_of_the_APIs_Used" name="A_Breakdown_of_the_APIs_Used">A Breakdown of the APIs Used</h3> -<p>The recommended plugin installation process makes use of the XPInstall APIs to install to the current browser's Plugins directory, install to a secondary location, and to <a class="external" href="http://www.mozilla.org/projects/plugins/first-install-problem.html">write to the Windows System Registry to disclose this secondary location</a>. This section traces some of the XPInstall APIs that can do this. A complete template of an XPI Package is also presented in this section. Not all the work needs to be done in JavaScript -- if you have a native installer (EXE) that <a class="external" href="http://mozilla.org/projects/plugins/install-scheme.html">recognizes Netscape Gecko browsers</a>, and you merely wish to wrap the EXE installer in an XPI Package for a streamlined delivery to the client, you can easily do so. This section refers extensively to the <a href="cn/XPInstall_API_Reference">XPInstall API Documentation</a>.</p> -<h4 id="Initializing_Installation_with_Plugin_Identifier" name="Initializing_Installation_with_Plugin_Identifier">Initializing Installation with Plugin Identifier</h4> -<p>All XPInstall installations are initiated with the <a href="cn/XPInstall_API_Reference/Install_Object/Methods/initInstall">initInstall method of the Install Object</a>. Since the Install Object is available to the install script, it need not be mentioned in the install script (e.g. there is no need to invoke Install.initInstall; simply invoking <a href="cn/XPInstall_API_Reference/Install_Object/Methods/initInstall">initInstall</a> will suffice). The initInstall method is polymorphic, but here is a recommended invocation mechanism:</p> -<pre>initInstall("My Plugin Software", "@myplugin.com/MyPlugin,version=2.5", "2.5.0.0"); -</pre> -<p>在上面的一段代码中, the <a href="cn/XPInstall_API_Reference/Install_Object/Methods/initInstall">initInstall</a> method is invoked with three parameters:</p> -<ul> - <li>A String for the name of the application</li> - <li>A String signifying the <a class="external" href="http://mozilla.org/projects/plugins/plugin-identifier.html">Plugin Identifier</a> associated with the plugin. This value is actually entered in the Client Version Registry upon installation, a Mozilla-browser file that stores metadata about the software that has just been installed. This value can be queried via web-page delivered JavaScript, and is useful for initiating XPInstall downloads via <a href="cn/XPInstall_API_Reference/InstallTrigger_Object">Trigger Scripts</a>. You can determine the version of the software that has been installed, and determine whether to update it, all via JavaScript in a web-page.</li> - <li>A String representing the four digit version of the software.</li> -</ul> -<p><b>Caveat:</b> Certain versions of Mozilla-based browsers (such as Netscape 6.x) treat the use of the equals character ("=") as an illegal token and thus do not allow invocation of initInstall with strings containing "=". A workaround to this would be to detect if initInstall has failed, and then invoke it again without the "=" string. Here is an example:</p> -<pre>var PLID = "MyPlugin.plug/version=6.5"; -err = initInstall(SOFTWARE_NAME, PLID, VERSION); - -if (err != 0) -{ - // install may have failed because of N6 and = - // replace PLID with a simple string - err = initInstall(SOFTWARE_NAME, "MyPluginString", VERSION); - if (err != 0) - cancelInstall(err); -} -</pre> -<p>Note that above, the PLID contains an "=" and in case the XPI package is running on browsers that treat "=" as an illegal token, the workaround is to handle the error and invoke initInstall again.</p> -<h3 id="Using_XPInstall_to_Run_an_EXE_.28Native_Code.29_Installer" name="Using_XPInstall_to_Run_an_EXE_.28Native_Code.29_Installer">Using XPInstall to Run an EXE (Native Code) Installer</h3> -<p>If you wish to run a native installer (EXE) to install plugin software, but wish to make the delivery of this native installer streamlined and within the browser's process, then you ought to consider wrapping it in an XPI Package. From JavaScript, you can call XPInstall's <a href="cn/XPInstall_API_Reference/Install_Object/Methods/execute">execute method of the Install Object</a> to execute the binary. You can also call the <a href="cn/XPInstall_API_Reference/File_Object/Methods/execute">execute method of the File object</a> if you wish to actually install the file you are executing, rather than have it deleted. You can pass command line parameters to the executable. An example of calling the execute method from the Install Object on an executable that has a temporary life span (and is not needed after one execution) is:</p> -<pre>// Initialize the installation .... - -// initInstall(..... ) has already been called - -// Using the Install Object's execute method to block on a native installer - -execute("setup.exe", "-s", true); - -// In the above sample, assume that running "setup -s" from the -// Command Prompt runs the setup executable, and that "-s" is some -// invocation parameter defined by the setup.exe file, perhaps to force -// the installer to run silently. We are passing "-s" to the setup file. -// By passing 'true' we are telling the Install Script to block -// on the execution of the installable, and do it synchronously - -// Must call performInstall to make it all happen... - -err = getLastError(); -if (!err) - performInstall(); -else - cancelInstall(err); -</pre> -<h4 id="Installing_Plugin_Files_To_the_Current_Browser" name="Installing_Plugin_Files_To_the_Current_Browser">Installing Plugin Files To the Current Browser</h4> -<p>Installing to the current browser is the task that is the most important for the XPI Package to succeed in. Here is a code snippet that accomplishes this:</p> -<pre>// Name of the files to be installed -var PLUGIN_FILE = "NPMyPlugin.dll"; -var COMPONENT_FILE = "NPMyPluginScriptablePeer.xpt"; - -// invoke initInstall to start the installation - -.... - -var pluginFolder = getFolder("Plugins"); - -// verify disk space is appropriate - -.... - -err = addFile("@myplugin.com/MyPlugin,version=2.5.0.0", - "2.5.0.0", PLUGIN_FILE, pluginsFolder, null); - if (err != 0) - { - //alert("Installation of MyPlugin plug-in failed. Error code "+err); - logComment("adding file "+PLUGIN_FILE+" failed. Errror conde: " + err); - return err; - } - -err = addFile(null, CULT_VERSION, COMPONENT_FILE, componentsFolder, null); - if (err != 0) - { - alert("Installation of MyPlugin component failed. Error code "+err); - logComment("adding file "+COMPONENT_FILE+" failed. Error conde: " + err); - return err; - } -</pre> -<h4 id="Installing_to_a_Secondary_Location" name="Installing_to_a_Secondary_Location">Installing to a Secondary Location</h4> -<p>For the purposes of solving the <a class="external" href="http://www.mozilla.org/projects/plugins/first-install-problem.html">First Install Problem</a>, it is necessary to install to a secondary location to ensure discoverability of the plugin by other Netscape Gecko browser in addition to the current browser. A good choice for this secondary location might be the Windows directory on Windows machines. <b>Caveat:</b> Because of possible administrator issues, handle errors carefully!</p> -<pre>// Get the Windows System directory e.g. C:\WINNT\system32\ directory - -var winDirectory = getFolder("Win System"); - -// Create the Folder C:\WINNT\system32\MyPlugin - -var dllWin32Folder = getFolder("file:///", winDirectory+"\\MyPlugin\\"); -//Install DLL to C:\Windows Folder - copyErr = addFile("", VERSION, PLUGIN_FILE, dllWin32Folder, null); - if (copyErr != 0) - { - logComment("First Install:"+copyErr); - return copyErr; - } - -// Install the XPT file to C:\WINNT\system32\MyPlugin folder - -var xptWin32Folder = getFolder("file:///", winDirectory+"\\MyPlugin\\"); - copyErr = addFile("", VERSION, COMPONENT_FILE, xptWin32Folder, null); - if (copyErr != 0) - { - logComment("First Install:"+copyErr); - return copyErr; - } -</pre> -<p>Once the secondary installation has taken place, the <a class="external" href="http://www.mozilla.org/projects/plugins/first-install-problem.html">Win32 Registry keys have to be updated</a> to indicate information about where the secondary install location is, so that browsers can discover it. This is accomplished with the <a href="cn/XPInstall_API_Reference/WinReg_Object">WinReg</a> object that is exposed to XPInstall. The pieces all come together in the template below.</p> -<h3 id="An_XPInstall_Template" name="An_XPInstall_Template">An XPInstall Template</h3> -<p>We have provided you with <a href="cn/Using_XPInstall_to_Install_Plugins/Install_script_template">a template for an install script</a> which you might want to open in another tab or window. This install script does all of the following:</p> -<ul> - <li>It installs both a DLL and an XPT file to the browser's plugins directory. The plugin itself is an imaginary one: MyPlugin. The variables that determine the plugin name, however, can be easily modified. This install.js file assumes that the plugin software that is to be installed consists of both a DLL and an XPT file, which is not always true. Many plugins may involve more than one DLL, or perhaps additional native code. It is, however, a safe assumption for most plugins, especially <a class="external" href="http://www.macromedia.com/go/getflashplayerbutton/">Macromedia's Flash Plugin</a> which consists of a single DLL (on Windows this is npswf32.dll) and a single XPT file for scriptability (called flashplayer.xpt).</li> - <li>It further installs to a secondary location on the user's desktop. In particular, like many OCX files (ActiveX controls) it installs to a special directory within C:\WINNT\System32\, called C:\WINNT\System32\MyPlugin. XPInstall is able to determine what directory this is by the <a href="cn/XPInstall_API_Reference/Install_Object/Methods/getFolder">getFolder</a> API call. We have written our own JavaScript function to contain all the secondary installation code -- function createSecondaryInstall()</li> - <li>And finally, it writes the <a class="external" href="http://www.mozilla.org/projects/plugins/first-install-problem.html">required registry keys to Windows</a>. This is done via the created function, called function registerPLID().</li> -</ul> -<p>Certainly, this script is Windows-centric, but it is easy to port it to any other platform. Easier, perhaps, since the lengthy Win32 Registry manipulation need not occur on Linux or Mac OSX. The <a href="cn/XPInstall_API_Reference/Install_Object/Methods/getFolder">getFolder API</a> provides you with enough "syntactic sugar" to determine other locations on the user's computer on different platforms and OS's. A single install.js is often capable of running on many different platforms.</p> -<h3 id="Some_Installation_Concerns" name="Some_Installation_Concerns">Some Installation Concerns</h3> -<p>This section gathers together some of the chief concerns about deploying XPI packages, notably: how ought a plugin download via XPI be initiated? And what about uninstalling plugins?</p> -<h3 id="Triggering_an_XPInstall_Download_with_a_TriggerScript" name="Triggering_an_XPInstall_Download_with_a_TriggerScript">Triggering an XPInstall Download with a TriggerScript</h3> -<p>A <a href="cn/XPInstall_API_Reference/Examples/Trigger_Scripts_and_Install_Scripts">Trigger Script</a> is web-page delivered piece of JavaScript that can automatically initiate an XPInstall download. This can be done conditionally, since <a href="cn/XPInstall_API_Reference/Examples/Trigger_Scripts_and_Install_Scripts">Trigger Scripts</a> can also detect what software has already been installed to the user's machine via XPInstall. This feature is useful for Web sites because:</p> -<ul> - <li>HTML pages and JavaScript already have a way of detecting what plugins are installed. Additionally, via the <a href="cn/XPInstall_API_Reference/InstallTrigger_Object">InstallTrigger</a> object which is exposed in Web pages, they can find out what the last version of the XPI Package was.</li> - <li>The <a href="cn/XPInstall_API_Reference/InstallTrigger_Object">InstallTrigger</a> object can also start an XPI download automatically. This is useful because users can visit a Web site, and conditionally get served software (in a streamlined manner) that the Web site wants the user to have.</li> -</ul> -<p>Trigger Scripts are a recommended way of initiating an XPInstall download.</p> -<h3 id="Triggering_an_XPInstall_Download_from_HTML" name="Triggering_an_XPInstall_Download_from_HTML">Triggering an XPInstall Download from HTML</h3> -<p>In a manner analogous to how SmartUpdate downloads were initiated by the pluginurl attribute of the embed tag, XPInstall downloads can also be initiated by HTML tags invoking plugins, notably via the <a class="external" href="http://www.w3.org/TR/REC-html40/struct/objects.html#adef-codebase-OBJECT">codebase</a> attribute of the <a class="external" href="http://www.w3.org/TR/REC-html40/struct/objects.html#edef-OBJECT">object</a> tag. This is analogous to how Internet Explorer downloads CAB files pointed to by the <a class="external" href="http://www.w3.org/TR/REC-html40/struct/objects.html#adef-codebase-OBJECT">codebase</a> attribute of the <a class="external" href="http://www.w3.org/TR/REC-html40/struct/objects.html#edef-OBJECT">object</a> tag. Here's an example of a hypothetical object tag used to invoke MyPlugin (an imaginary application):</p> -<pre> <object id="thePlugin" type="application/x-myplugin" width="100" - height="100" codebase="http://location/XPI/myplugin.xpi"> - -<param .... > -</pre> -<p>In the above case, the codebase attribute points directly to the XPI Package, and if the browser can not identify any plugin to handle the (imaginary) application/x-myplugin MIME type, it will download the XPI Package.</p> -<p><b>Note:</b> XPI Packages (files with the xpi extension) use the application/x-xpinstall MIME type. When serving XPI Packages from servers to clients, make sure that XPI Packages are served with this MIME type in the HTTP headers. Associate the application/x-xpinstall MIME type with XPI Packages.</p> -<h3 id="The_Uninstall_Problem" name="The_Uninstall_Problem">The Uninstall Problem</h3> -<p>In its current iteration, XPInstall does not have an affiliated uninstall technology. It can therefore only be used to install files or deliver native code installers to the client, and if uninstall is a legitimate concern, it might be wise to write a native code (EXE) uninstaller to remove the software. XPInstall can therefore be the "agent of delivery" to streamline the download of the EXE software, but ultimately, the logic of installation and uninstallation will be handled by EXE, which can then create files and registry entries and also clean up after itself upon removal.</p> -<div class="originaldocinfo"> - <h3 id="Original_Document_Information" name="Original_Document_Information">Original Document Information</h3> - <ul> - <li>Author(s): Arun K. Ranganathan, Netscape Communications</li> - <li>Last Updated Date: 05 Aug 2002</li> - <li>Copyright Information: Copyright © 2001-2003 Netscape. All rights reserved.</li> - <li>Link: <a class="external" href="http://devedge-temp.mozilla.org/viewsource/2002/xpinstall-guidelines/index_en.html" rel="freelink">http://devedge-temp.mozilla.org/view.../index_en.html</a></li> - </ul> -</div> -<p> </p> |
