aviary branch landing - some of the stuff in toolkit/content

git-svn-id: svn://10.0.0.236/trunk@165982 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ben%bengoodger.com
2004-12-01 00:21:43 +00:00
parent 9ffa78a6ca
commit 87fe99fded
20 changed files with 138 additions and 128 deletions

View File

@@ -29,6 +29,8 @@ CHROME_DEPS = buildconfig.html
include $(DEPTH)/config/autoconf.mk
DEFINES += -DMOZ_APP_VERSION=$(MOZ_APP_VERSION)
include $(topsrcdir)/config/rules.mk
distclean::

View File

@@ -29,11 +29,11 @@ function MailMultiplexHandler(event)
} else if (name == 'charsetGroup') {
var charset = node.getAttribute('id');
charset = charset.substring('charset.'.length, charset.length)
MessengerSetForcedCharacterSet(charset);
MessengerSetDefaultCharacterSet(charset);
} else if (name == 'charsetCustomize') {
//do nothing - please remove this else statement, once the charset prefs moves to the pref window
} else {
MessengerSetForcedCharacterSet(node.getAttribute('id'));
MessengerSetDefaultCharacterSet(node.getAttribute('id'));
}
}
@@ -80,7 +80,7 @@ function SelectDetector(event, doReload)
str.data = prefvalue;
pref.setComplexValue("intl.charset.detector",
Components.interfaces.nsISupportsString, str);
if (doReload) window.content.location.reload();
if (doReload) window._content.location.reload();
}
catch (ex) {
dump("Failed to set the intl.charset.detector preference.\n");
@@ -130,7 +130,7 @@ function UpdateCurrentCharset()
// exctract the charset from DOM
var wnd = document.commandDispatcher.focusedWindow;
if ((window == wnd) || (wnd == null)) wnd = window.content;
if ((window == wnd) || (wnd == null)) wnd = window._content;
menuitem = document.getElementById('charset.' + wnd.document.characterSet);
if (menuitem) {
@@ -215,7 +215,7 @@ var gLastBrowserCharset = null;
function charsetLoadListener (event)
{
var charset = window.content.document.characterSet;
var charset = window._content.document.characterSet;
if (charset.length > 0 && (charset != gLastBrowserCharset)) {
gCharsetMenu.SetCurrentCharset(charset);
@@ -227,7 +227,7 @@ function charsetLoadListener (event)
function composercharsetLoadListener (event)
{
var charset = window.content.document.characterSet;
var charset = window._content.document.characterSet;
if (charset.length > 0 ) {

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE overlay SYSTEM "chrome://global/locale/charsetOverlay.dtd">
<!DOCTYPE window SYSTEM "chrome://global/locale/charsetOverlay.dtd">
<overlay id="charsetOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
@@ -144,7 +144,7 @@
<menupopup>
</menupopup>
</menu>
<menu label="&charsetMenuMore.label;" accesskey="&charsetMenuMore.accesskey;" datasources="rdf:charset-menu" ref="NC:BrowserMoreCharsetMenuRoot">
<menu label="&charsetMenuMore.label;" accesskey="&charsetMenuMore.accesskey;" datasources="rdf:charset-menu" ref="NC:BrowserMoreCharsetMenuRoot">
<template>
<rule>
<menupopup>

View File

@@ -98,8 +98,8 @@ function setLabelForNode(aNode, aLabel, aIsLabelFlag)
function commonDialogOnLoad()
{
// set the document title
document.title = gCommonDialogParam.GetString(12);
// set the window title
window.title = gCommonDialogParam.GetString(12);
// set the number of command buttons
var nButtons = gCommonDialogParam.GetInt(2);

View File

@@ -49,6 +49,8 @@
</vbox>
</hbox>
<separator class="thin"/>
<!-- This method is called inline because it may unset hidden="true" on the
above boxes, causing their frames to be build and bindings to load.
So, by calling this inline, we guarantee the textboxes and checkboxes

View File

@@ -1,17 +0,0 @@
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the packages being supplied by this jar -->
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:global-platform"/>
</RDF:Seq>
<!-- package information -->
<RDF:Description about="urn:mozilla:package:global-platform"
chrome:displayName="Platform Specific"
chrome:author="mozilla.org"
chrome:name="global-platform"
chrome:localeVersion="@MOZILLA_LOCALE_VERSION@">
</RDF:Description>
</RDF:RDF>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the packages being supplied by this jar -->
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:global-region"/>
</RDF:Seq>
<!-- package information -->
<RDF:Description about="urn:mozilla:package:global-region"
chrome:displayName="US Regional Contents"
chrome:author="mozilla.org"
chrome:name="global-region"
chrome:localeVersion="@MOZILLA_REGION_VERSION@">
</RDF:Description>
</RDF:RDF>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the packages being supplied by this jar -->
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:global"/>
</RDF:Seq>
<!-- package information -->
<RDF:Description about="urn:mozilla:package:global"
chrome:displayName="Toolkit"
chrome:author="mozilla.org"
chrome:name="global"
chrome:localeVersion="@MOZILLA_LOCALE_VERSION@"
chrome:skinVersion="1.5">
</RDF:Description>
</RDF:RDF>

View File

@@ -46,8 +46,6 @@ function onLoad()
repositionDialog();
document.documentElement.setAttribute("hidechrome", "true");
initDialog();
}
@@ -513,20 +511,26 @@ function addNewToolbar()
var title = stringBundle.getString("enterToolbarTitle");
var name = {};
while (1) {
if (!promptService.prompt(window, title, message, name, null, {})) {
while (true) {
if (!promptService.prompt(window, title, message, name, null, {}))
return;
} else {
// Check for an existing toolbar with the same name and prompt again
// if a conflict is found
var nameToId = "__customToolbar_" + name.value.replace(" ", "");
var existingToolbar = gToolboxDocument.getElementById(nameToId);
if (existingToolbar) {
message = stringBundle.getFormattedString("enterToolbarDup", [name.value]);
} else {
var dupeFound = false;
// Check for an existing toolbar with the same display name
for (i = 0; i < gToolbox.childNodes.length; ++i) {
var toolbar = gToolbox.childNodes[i];
var toolbarName = toolbar.getAttribute("toolbarname");
if (toolbarName == name.value && toolbar.getAttribute("type") != "menubar") {
dupeFound = true;
break;
}
}
}
if (!dupeFound)
break;
message = stringBundle.getFormattedString("enterToolbarDup", [name.value]);
}
gToolbox.appendCustomToolbar(name.value, "");
@@ -541,6 +545,10 @@ function addNewToolbar()
*/
function restoreDefaultSet()
{
// Save disabled/command states, because we're
// going to recreate the wrappers and lose this
var savedAttributes = saveItemAttributes(["itemdisabled", "itemcommand"]);
// Restore the defaultset for fixed toolbars.
var toolbar = gToolbox.firstChild;
while (toolbar) {
@@ -578,10 +586,50 @@ function restoreDefaultSet()
// Now re-wrap the items on the toolbar.
wrapToolbarItems();
// Restore the disabled and command states
restoreItemAttributes(["itemdisabled", "itemcommand"], savedAttributes);
repositionDialog();
gToolboxChanged = true;
}
function saveItemAttributes(aAttributeList)
{
var items = [];
var paletteItems = gToolbox.getElementsByTagName("toolbarpaletteitem");
for (var i = 0; i < paletteItems.length; i++) {
var paletteItem = paletteItems.item(i);
for (var j = 0; j < aAttributeList.length; j++) {
var attr = aAttributeList[j];
if (paletteItem.hasAttribute(attr)) {
items.push([paletteItem.id, attr, paletteItem.getAttribute(attr)]);
}
}
}
return items;
}
function restoreItemAttributes(aAttributeList, aSavedAttrList)
{
var paletteItems = gToolbox.getElementsByTagName("toolbarpaletteitem");
for (var i = 0; i < paletteItems.length; i++) {
var paletteItem = paletteItems.item(i);
// if the item is supposed to have this, it'll get
// restored from the saved list
for (var j = 0; j < aAttributeList.length; j++)
paletteItem.removeAttribute(aAttributeList[j]);
for (var j = 0; j < aSavedAttrList.length; j++) {
var savedAttr = aSavedAttrList[j];
if (paletteItem.id == savedAttr[0]) {
paletteItem.setAttribute(savedAttr[1], savedAttr[2]);
}
}
}
}
function updateIconSize(aUseSmallIcons)
{
gToolboxIconSize = aUseSmallIcons ? "small" : "large";

View File

@@ -28,6 +28,7 @@
]>
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/content/customizeToolbar.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/customizeToolbar.css" type="text/css"?>

View File

@@ -29,7 +29,11 @@
<keyset id="editMenuKeys">
<key id="key_undo" key="&undoCmd.key;" modifiers="accel" command="cmd_undo"/>
#ifdef XP_UNIX
<key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift" command="cmd_redo"/>
#else
<key id="key_redo" key="&redoCmd.key;" modifiers="accel" command="cmd_redo"/>
#endif
<key id="key_cut" key="&cutCmd.key;" modifiers="accel" command="cmd_cut"/>
<key id="key_copy" key="&copyCmd.key;" modifiers="accel" command="cmd_copy"/>
<key id="key_paste" key="&pasteCmd.key;" modifiers="accel" command="cmd_paste"/>

View File

@@ -55,7 +55,8 @@ function onLoad()
// if no download button
// set title to "Install Font"
// and set cancel button to "OK"
document.title = fontPackageBundle.getString("windowTitleNoDownload");
var downloadFontDialog = document.getElementById("downloadFontDialog");
downloadFontDialog.setAttribute("title", fontPackageBundle.getString("windowTitleNoDownload"));
var cancelButton = document.getElementById("cancelButton");
cancelButton.setAttribute("label", fontPackageBundle.getString("cancelButtonNoDownload"));
}

View File

@@ -65,10 +65,12 @@ var FullScreen =
els[i].setAttribute("moz-collapsed", "true");
}
}
#ifndef XP_MACOSX
var controls = document.getElementsByAttribute("fullscreencontrol", "true");
for (i = 0; i < controls.length; ++i)
controls[i].hidden = aShow;
#endif
},
setToolbarButtonMode: function(aToolbar, aMode)

View File

@@ -47,17 +47,24 @@ function goQuitApplication()
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
var enumerator = windowManagerInterface.getEnumerator( null );
var appStartup = Components.classes['@mozilla.org/toolkit/app-startup;1'].
getService(Components.interfaces.nsIAppStartup);
var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService();
appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService );
var nativeAppSupport = null;
try {
nativeAppSupport = appShell.nativeAppSupport;
}
catch ( ex ) {
}
while ( enumerator.hasMoreElements() )
{
var domWindow = enumerator.getNext();
if (("tryToClose" in domWindow) && !domWindow.tryToClose())
return false;
return false;
domWindow.close();
};
appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit);
appShell.quit(Components.interfaces.nsIAppShellService.eAttemptQuit);
return true;
}
@@ -89,7 +96,8 @@ function goDoCommand(command)
controller.doCommand(command);
}
catch (e) {
dump("An error occurred executing the " + command + " command\n" + e + "\n");
dump("An error occurred executing the "+command+" command\n");
dump(e+"\n")
}
}

View File

@@ -2,10 +2,11 @@ toolkit.jar:
+ content/global/MPL-1.1.html (MPL-1.1.html)
content/global/NPL-1.1.html (NPL-1.1.html)
content/global/XPCNativeWrapper.js (XPCNativeWrapper.js)
+ content/global/contents.rdf (contents.rdf)
+ content/global-platform/contents.rdf (contents-platform.rdf)
+ content/global-region/contents.rdf (contents-region.rdf)
*+ content/global/xul.css (xul.css)
* content/global/contents.rdf (contents.rdf)
* content/global-platform/contents.rdf (contents-platform.rdf)
* content/global-region/contents.rdf (contents-region.rdf)
* content/global/xul.css (xul.css)
* content/global/about.xhtml (about.xhtml)
+ content/global/buildconfig.html (buildconfig.html)
+ content/global/charsetOverlay.js (charsetOverlay.js)
+ content/global/charsetOverlay.xul (charsetOverlay.xul)
@@ -17,7 +18,7 @@ toolkit.jar:
* content/global/customizeToolbar.js (customizeToolbar.js)
* content/global/customizeToolbar.xul (customizeToolbar.xul)
+ content/global/editMenuOverlay.js (editMenuOverlay.js)
+ content/global/editMenuOverlay.xul (editMenuOverlay.xul)
*+ content/global/editMenuOverlay.xul (editMenuOverlay.xul)
*+ content/global/finddialog.js (finddialog.js)
*+ content/global/finddialog.xul (finddialog.xul)
*+ content/global/findUtils.js (findUtils.js)

View File

@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
[
<!ENTITY % mozillaDTD SYSTEM "chrome://global/locale/mozilla.dtd" >
%mozillaDTD;
]>
<!--
The contents of this file are subject to the Netscape Public License
@@ -61,16 +65,11 @@ em {
<body>
<p id="moztext">
And so at last the beast <em class="f">fell</em> and the unbelievers rejoiced.
But all was not lost, for from the ash rose a <em>great bird</em>.
The bird gazed down upon the unbelievers and cast <em class="f">fire</em>
and <em>thunder</em> upon them. For the beast had been
<em>reborn</em> with its strength <em>renewed</em>, and the
followers of <em>Mammon</em> cowered in horror.
&mozilla.quote;
</p>
<p id="from">
from <strong>The Book of Mozilla,</strong> 7:15
&mozilla.from;
</p>
</body>

View File

@@ -80,7 +80,7 @@ var nsTransferable = {
{
// non-string data.
supports = currData.supports;
length = 0; // kFlavorHasDataProvider
length = 0; // kFlavorHasDataProvider
}
trans.setTransferData(currFlavour, supports, length * 2);
}

View File

@@ -260,7 +260,7 @@ nsWidgetStateManager.prototype =
var element = gCurrentWindow.document.getElementById(aElementID);
wsm.generic_Set(element, aDataObject);
if ("value" in aDataObject)
element.value = aDataObject.value;
element.selectedItem = element.getElementsByAttribute("value", aDataObject.value)[0];
if ("disabled" in aDataObject)
element.disabled = aDataObject.disabled;
},

View File

@@ -75,10 +75,11 @@ function selectDialogOnLoad() {
}
}
document.title = param.GetString( 0 );
var windowTitle = param.GetString( 0 );
window.title = windowTitle;
list = document.getElementById("list");
numItems = param.GetInt( 2 );
numItems = param.GetInt( 2 )
var i;
for ( i = 2; i <= numItems+1; i++ ) {

View File

@@ -15,18 +15,19 @@
display: -moz-box;
}
/* hide the content, but don't destroy the frames. Make sure this
comes before any rules involving "hidden" */
*[collapsed="true"], *[moz-collapsed="true"] {
visibility: collapse;
}
/* The rule for hidden comes AFTER the rule for collapsed. That way if
both are specified on an element, the hidden rule wins. */
/* hide the content and destroy the frame */
*[hidden="true"] {
display: none;
}
/* hide the content, but don't destroy the frames */
*[collapsed="true"],
*[moz-collapsed="true"] {
visibility: collapse;
}
/* ::::::::::
:: Rules for 'hiding' portions of the chrome for special
:: kinds of windows (not JUST browser windows) with toolbars
@@ -146,6 +147,10 @@ browser {
-moz-binding: url("chrome://global/content/bindings/browser.xml#browser");
}
browsermessage {
-moz-binding: url("chrome://global/content/bindings/browser.xml#browsermessage");
}
tabbrowser {
-moz-binding: url("chrome://global/content/bindings/tabbrowser.xml#tabbrowser");
}
@@ -274,10 +279,6 @@ menuitem.menuitem-iconic {
-moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic");
}
menuitem[description] {
-moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic-desc-noaccel");
}
menuitem[type="checkbox"],
menuitem[type="radio"] {
-moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic");
@@ -470,6 +471,10 @@ listbox {
height: 200px;
}
listhead, listrows, listboxbody {
-moz-user-focus: none;
}
listhead {
-moz-box-orient: vertical;
}
@@ -517,6 +522,7 @@ treecol.treecol-image {
tree > treechildren {
display: -moz-box;
-moz-binding: url("chrome://global/content/bindings/tree.xml#treebody");
-moz-user-focus: none;
-moz-user-select: none;
-moz-box-flex: 1;
}
@@ -595,10 +601,6 @@ progressmeter {
-moz-binding: url("chrome://global/content/bindings/progressmeter.xml#progressmeter");
}
progressmeter[mode="undetermined"] {
-moz-binding: url("chrome://global/content/bindings/progressmeter.xml#progressmeter-undetermined");
}
/********** basic rule for anonymous content that needs to pass box properties through
********** to an insertion point parent that holds the real kids **************/
@@ -628,14 +630,10 @@ label.text-link {
-moz-user-focus: normal;
}
label[control], label.radio-label, label.checkbox-label {
label[control] {
-moz-binding: url("chrome://global/content/bindings/text.xml#label-control");
}
html|span.accesskey {
text-decoration: underline;
}
/********** textbox **********/
textbox {
@@ -780,10 +778,6 @@ menulist[editable] {
-moz-binding: url("chrome://global/content/bindings/menulist.xml#menulist-editable");
}
menulist[type="description"] {
-moz-binding: url("chrome://global/content/bindings/menulist.xml#menulist-description");
}
html|*.menulist-editable-input {
-moz-appearance: none !important;
}
@@ -809,8 +803,6 @@ grippy {
.tree-splitter {
width: 0px;
max-width: 0px;
min-width: 0% ! important;
min-height: 0% ! important;
-moz-box-ordinal-group: 2147483646;
}
@@ -838,8 +830,6 @@ scrollbar[value="hidden"] {
scrollbox {
-moz-binding: url("chrome://global/content/bindings/scrollbox.xml#scrollbox");
/* This makes it scrollable! */
overflow:hidden ! important;
}
arrowscrollbox {
@@ -868,6 +858,10 @@ statusbarpanel {
-moz-binding: url("chrome://global/content/bindings/general.xml#statusbarpanel-iconic");
}
.statusbarpanel-iconic-text {
-moz-binding: url("chrome://global/content/bindings/general.xml#statusbarpanel-iconic-text");
}
.statusbarpanel-menu-iconic {
-moz-binding: url("chrome://global/content/bindings/general.xml#statusbarpanel-menu-iconic");
}