| Two ways to get SRD features for Mozilla 1.0 |
| What to do with the tar ball? |
| Technical details |
The tar file includes the files which we have changed. The changed files overwrite the original files, to install the SRD feature. You can untar the file outside the mozilla source code directory to view the code, before you copy them into your mozilla source code. The technical details part tells you what we have changed.
Notice:
1. In order to make the reference window work properly, you need enter dist/bin directory, then run ./mozilla.
2. We have not prepared an uninstall package yet. So if you do not like SRD feature, you probably need redownload the source code from Mozilla.org, and compile it.
3. We only changed some use interface for demo purpose, the navigator window, the page Info window, the viewSource window, the alert window.
Technical details
| Changes in style sheet system |
| Changes in user interface directory |
| Changes in prompt service |
| Summary |
xpfe/browser/resources/content/navigator.xul is the file which defines the main navigator window. We put our JavaScript code into a separate file navigatorCB.js and link it into the navigator.xul file. navigatorCB.js has two functions, change and changeAttr. In the function change, we get the window element reference, set the external attribute to the window and call changeAttr function every 0.5 second; changAttr function reads the random value from the borderStyle module and sets the borderstyle attribute or removes it. Change function itself is called by the window onload method in xul file.
xpfe/browser/resources/content/pageInfo.xul and xpfe/browser/resources/content/viewSource.xul are the files which define the page info window and viewSource window. xpfe/components/search/resources/search-panel.xul and xpfe/components/search/resources/search.xul are the files which define the search window and the search panel window on the side bar of the navigator window. We did the same modification to them as to the navigator window. The only difference is we didn't set the external attribute to their window elements, because they are browser internal windows. The new JavaScript file names need to be added into xpfe/browser/jar.mn or xpfe/components/jar.mn files in order to be packed into the jar packages.
/xpfe/global/resources/content/commonDialog.xul defines the common dialog window, which includes the alert window, the confirm window and the prompt window. In order to distinguish the dialogs popped up by the browser and the dialogs invoked by the server, we defined a different xul file only used for the server dialogs, commonDialoE.xul. This file is the same as commonDialog.xul, the only difference is the JavaScript file which it links to. commonDialoE.js includes the code which is in navigatorCB.js, which set the external attribute for the dialog element; commonDialog.js does not.
Changes in prompt service
Alert windows, confirm windows and prompt windows use the prompt service. When an Alert window is invoked, Mozilla checks who is the caller. If the caller is the server, Mozilla write "JavaScript Application" into the window title then pass the call to the Prompt Service. The Prompt Service checks the window title, if the title has been written because of the caller is the server, Prompt Service use the external common dialog xul file, otherwise, use the internal one.
Summary
We added the borderStyle module and the reference window as in the Mozilla-0.9.2.1. The whole SRD structure doesn't change. Because Mozilla 1.0 made some changes in the user interface design, we made changes accordingly. The server invoked alert window has different color boundaries from the alert window invoked by the browser.
Some observations
Mozilla 1.0 uses dialog element instead of window element in commonDialog.xul. CommonDialog.xul only can be linked to one JavaScript file, otherwise the dialog text can not be displayed successfully.