舊文件

此處文件僅供參考,請自行考量時效性與適用程度,其他庫藏文件請參考文件頁面
我們亟需您的協助,進行共筆系統搬移、及文件整理工作,詳情請查閱參與我們

Project/Doc/Creating Skin For Mozilla/gssetup

出自 MozTW Wiki

於 2005年2月26日 (六) 00:31 由 Crazylion對話 | 貢獻 所做的修訂
(比較) ←上一修訂 | 查看目前修訂 (比較) | 下一修訂→ (比較)

Setup

Download the latest version of Mozilla, install it (Install the DOM Inspector as well), and select the classic skin. You can use the same version as the one you use to browse the web, but if you mess it up, it is possible that you will be unable to access your browser without uninstalling and reinstalling Mozilla. For this reason we suggest that you install a second copy into a second directory (Make sure that you use a different profile as stated in the release notes)


Extract the chrome

The chrome is stored in \mozilla\chrome and the individual modules are stored in Jar files. Jar files are zip files with a different extension. You can open them up in your zip program the same way you open up zip files.

Mozilla currently comes with two skins, Classic and Modern. Looking in the directory you'll also notice that there are classic.jar and modern.jar files. For this tutorial we are going to use the Classic skin as a base. Extract classic.jar into \classic (\mozilla\chrome\classic), but make sure to keep the directory structure. Remember if at any point you wish to revert back to the original code again, just extract this jar over top of what you've modified.

Now all of the CSS and images are extracted, but if you make some changes and run Mozilla as it is, you will not see them because it's still set to look at the files in the Jar files. To point Mozilla at the correct files we need to open up \mozilla\chrome\installed-chrome.txt in a text editor. You should probably make a backup of this file now, just in case you make a mistake.

In the file you'll see a list. Do a search for classic.jar. On every line that references classic.jar we need to make some changes (There are about 5 lines). Delete the bolded text:

Original skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/global/ Modified skin,install,url,resource:/chrome/classic/skin/classic/global/

Once you have made these modifications, save them and run mozilla. If mozilla runs fine, that means that it worked. If it doesn't appear as you expected, then go back into the installed-chrome.txt file and double check that you modified the lines correctly.


Back .: Contents :. Next


設定

下載Mozilla最新的版本,安裝它(安裝時安含DOM Inspector),並且選擇預設的skin。 你可以使用跟你用來瀏覽網站同樣版本的Mozilla,但是萬一你在測試的過程中把Mozilla的環境弄得一團亂, 那麼你很有可能必須藉著反安裝以及重新安裝才能繼續使用Mozilla。基於這個理由,我們建議你在另一個資料夾 中安裝另一份(確保第二份瀏覽器使用不同的profile檔案啟動)。


解壓縮chrome


chrome存放在\mozilla\chrome這個資料夾中,且個別的模組化檔案存放在Jar檔中。Jar檔就是另一種有著不一樣 附檔名的zip檔案。你可以使用你的zip程式來打開它,就像是打開一般的zip檔案。


Mozilla內建兩個skin。分別是Classic和Modern。觀看這個資料夾你可以注意到裡面有classic.jar和modern.jar 這兩個檔案。在這份教學手冊中,我們將會使用Classic這個skin作為樣本。解壓縮classic.jar到classic\ (\mozilla\chrome\classic),請小心地保持這個目錄的結構。記住一點,不管在什麼時候,如果你想回復到 原來的程式碼,那麼你只須重新解壓縮這個檔案將檔案覆蓋至目前你所修改的目錄。

現在我們已經將所有的CSS和圖片檔都解壓縮了,但是如果你現在做了某些更動並且執行Mozilla,你還是不會 看到以變更的內容,這是因為目前這個skin的資料來源被設定在Jar檔中。為了指定正確的檔案位置給Mozilla ,我們需要使用文字編輯器打開\mozilla\chrome\installed-chrome.txt這個檔案。你應該先將這份檔案備份, 這單純只是為了避免發生錯誤。

在這份檔案中你可以看到一份列表。使用classic.jar當作關鍵字進行搜尋。在每次搜索到的那行中我們都必須做些改變 (大概有五行)。刪除以下以粗體表示的文字:

原本的內容

skin,install,url,jar:resource:/chrome/classic.jar!'/skin/classic/global/

修改後的內容 skin,install,url,resource:/chrome/classic/skin/classic/global/

修改好之後,將其存檔,並且執行Mozilla。如果Mozilla執行無誤,那麼這表示你的修改是成功的。 如果出現的結果不如預期,那麼回到installed-chrome.txt這個檔案並且將其正確地修改。


Back .: Contents :. Next

個人工具