95876 - Support <button type='checkbox'/>, r=blake, sr=hyatt

This commit is contained in:
hewitt%netscape.com 2001-10-02 03:06:51 +00:00
Родитель 1b8e0a3b1f
Коммит a0bd804923
19 изменённых файлов: 151 добавлений и 210 удалений

Просмотреть файл

@ -51,5 +51,8 @@ interface nsIDOMXULButtonElement : nsIDOMXULLabeledControlElement {
attribute boolean checked;
attribute long checkState;
attribute boolean autoCheck;
// For buttons of type="radio" only.
attribute DOMString group;
};

Просмотреть файл

@ -2006,7 +2006,7 @@ function onButtonUpdate(button, commmandID)
var commandNode = document.getElementById(commmandID);
var state = commandNode.getAttribute("state");
button.setAttribute("toggled", state);
button.checked = state == "true";
}
//--------------------------------------------------------------------
@ -2015,7 +2015,7 @@ function onStateButtonUpdate(button, commmandID, onState)
var commandNode = document.getElementById(commmandID);
var state = commandNode.getAttribute("state");
button.setAttribute("toggled", (state == onState) ? "true" : "false");
button.checked = state == onState;
}
@ -2032,7 +2032,7 @@ function onStyleChange(theStyle)
var theButton = document.getElementById(theStyle + "Button");
if (theButton)
{
theButton.setAttribute("toggled", (isOn == "true") ? 1 : 0);
theButton.checked = isOn == "true";
}
var theMenuItem = document.getElementById(theStyle + "MenuItem");

Просмотреть файл

@ -744,25 +744,25 @@
<toolbarbutton id="IncreaseFontSizeButton" observes="cmd_increaseFont"
tooltip="aTooltip" tooltiptext="&increaseFontSizeToolbarCmd.tooltip;"/>
<toolbarbutton id="boldButton" observes="cmd_bold"
<toolbarbutton id="boldButton" type="checkbox" autoCheck="false" observes="cmd_bold"
tooltip="aTooltip" tooltiptext="&boldToolbarCmd.tooltip;">
<observes element="cmd_bold" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_bold')"/>
<observes element="cmd_bold" type="checkbox" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_bold')"/>
</toolbarbutton>
<toolbarbutton id="italicButton" observes="cmd_italic"
<toolbarbutton id="italicButton" type="checkbox" autoCheck="false" observes="cmd_italic"
tooltip="aTooltip" tooltiptext="&italicToolbarCmd.tooltip;">
<observes element="cmd_italic" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_italic')"/>
</toolbarbutton>
<toolbarbutton id="underlineButton" observes="cmd_underline"
<toolbarbutton id="underlineButton" type="checkbox" autoCheck="false" observes="cmd_underline"
tooltip="aTooltip" tooltiptext="&underlineToolbarCmd.tooltip;">
<observes element="cmd_underline" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_underline')"/>
</toolbarbutton>
<toolbarbutton id="ulButton" observes="cmd_ul"
<toolbarbutton id="ulButton" type="radio" group="lists" autoCheck="false" observes="cmd_ul"
tooltip="aTooltip" tooltiptext="&bulletListToolbarCmd.tooltip;">
<observes element="cmd_ul" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_ul')"/>
</toolbarbutton>
<toolbarbutton id="olButton" observes="cmd_ol"
<toolbarbutton id="olButton" type="radio" group="lists" autoCheck="false" observes="cmd_ol"
tooltip="aTooltip" tooltiptext="&numberListToolbarCmd.tooltip;">
<observes element="cmd_ol" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_ol')"/>
</toolbarbutton>
@ -773,25 +773,25 @@
tooltip="aTooltip" tooltiptext="&indentToolbarCmd.tooltip;"/>
<!-- alignment buttons -->
<toolbarbutton id="align-left-button"
<toolbarbutton id="align-left-button" type="radio" group="align" autoCheck="false"
oncommand="doStatefulCommand('cmd_align', 'left')"
tooltip="aTooltip" tooltiptext="&alignLeft.tooltip;" >
<observes element="cmd_align" attribute="state"
onbroadcast="onStateButtonUpdate(this.parentNode, 'cmd_align', 'left')" />
</toolbarbutton>
<toolbarbutton id="align-center-button"
<toolbarbutton id="align-center-button" type="radio" group="align" autoCheck="false"
oncommand="doStatefulCommand('cmd_align', 'center')"
tooltip="aTooltip" tooltiptext="&alignCenter.tooltip;" >
<observes element="cmd_align" attribute="state"
onbroadcast="onStateButtonUpdate(this.parentNode, 'cmd_align', 'center')"/>
</toolbarbutton>
<toolbarbutton id="align-right-button"
<toolbarbutton id="align-right-button" type="radio" group="align" autoCheck="false"
oncommand="doStatefulCommand('cmd_align', 'right')"
tooltip="aTooltip" tooltiptext="&alignRight.tooltip;" >
<observes element="cmd_align" attribute="state"
onbroadcast="onStateButtonUpdate(this.parentNode, 'cmd_align', 'right')"/>
</toolbarbutton>
<toolbarbutton id="align-justify-button"
<toolbarbutton id="align-justify-button" type="radio" group="align" autoCheck="false"
oncommand="doStatefulCommand('cmd_align', 'justify')"
tooltip="aTooltip" tooltiptext="&alignJustify.tooltip;" >
<observes element="cmd_align" attribute="state"

Просмотреть файл

@ -36,7 +36,7 @@
<toolbar id="tbInspectorPrimary">
<hbox id="bxURLBar" flex="1">
<toolbarbutton id="btnSelecting" observes="cmd:selectByClick"
<toolbarbutton id="btnSelecting" type="checkbox" observes="cmd:selectByClick"
tooltip="aTooltip" tooltiptext="&btnSelecting.tooltip;"/>
<toolbarbutton id="btnFind" observes="cmd:find"

Просмотреть файл

@ -361,7 +361,7 @@ DOMViewer.prototype =
for (var i = 0; i < this.mSelectDocs.length; ++i)
this.mSelectDocs[i].addEventListener("mousedown", MouseDownListener, true);
this.mPanel.panelset.setCommandAttribute("cmd:selectByClick", "toggled", "true");
this.mPanel.panelset.setCommandAttribute("cmd:selectByClick", "checked", "true");
},
selectByClickOver: function(aTarget)
@ -388,7 +388,7 @@ DOMViewer.prototype =
for (var i = 0; i < this.mSelectDocs.length; ++i)
this.mSelectDocs[i].removeEventListener("mousedown", MouseDownListener, true);
this.mPanel.panelset.setCommandAttribute("cmd:selectByClick", "toggled", null);
this.mPanel.panelset.setCommandAttribute("cmd:selectByClick", "checked", null);
},
////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -60,7 +60,7 @@
list-style-image: url("chrome://inspector/skin/btnSelecting.gif");
}
#btnSelecting[toggled="true"] {
#btnSelecting[checked="true"] {
list-style-image: url("chrome://inspector/skin/btnSelecting-act.gif");
}

Просмотреть файл

@ -65,7 +65,7 @@
list-style-image: url("chrome://inspector/skin/btnSelecting.gif");
}
#btnSelecting[toggled="true"] {
#btnSelecting[checked="true"] {
list-style-image: url("chrome://inspector/skin/btnSelecting-act.gif");
}

Просмотреть файл

@ -1,134 +0,0 @@
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
*/
/* ==== button.css ==========================================================
== Styles for special buttons in the Communicator suite.
========================================================================== */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* ::::: large toolbar buttons ::::: */
.toolbarbutton-1,
.toolbarbutton-1 > .toolbarbutton-menubutton-box
> .toolbarbutton-menubutton-button
{
min-width: 47px;
-moz-box-orient: vertical;
}
.toolbarbutton-1[type="menu-button"] {
-moz-box-orient: horizontal;
}
.toolbarbutton-1 > .toolbarbutton-box,
.toolbarbutton-1 > .toolbarbutton-menubutton-box
> .toolbarbutton-menubutton-button > .toolbarbutton-box,
.toolbarbutton-1[open="true"] > .toolbarbutton-menubutton-box
> .toolbarbutton-menubutton-button > .toolbarbutton-box,
.toolbarbutton-1[disabled="true"]:hover:active > .toolbarbutton-box,
.toolbarbutton-1[disabled="true"][buttondown="true"] > .toolbarbutton-menubutton-box
> .toolbarbutton-menubutton-button > .toolbarbutton-box
{
padding : 2px 7px 2px 6px;
}
.toolbarbutton-1:hover:active > .toolbarbutton-box,
.toolbarbutton-1[open="true"] > .toolbarbutton-box,
.toolbarbutton-1[buttondown="true"] > .toolbarbutton-menubutton-box
> .toolbarbutton-menubutton-button > .toolbarbutton-box
{
padding : 3px 6px 1px 7px;
}
.toolbarbutton-1[type="menu"] > .toolbarbutton-box > .toolbarbutton-dropmarker {
display: none;
}
/* ::::: normal buttons on toolbars ::::: */
.button-toolbar {
-moz-user-focus : ignore;
min-width : 0px;
background-color : transparent;
}
.button-toolbar,
.button-toolbar[disabled="true"]:hover,
.button-toolbar[disabled="true"]:hover:active {
border : 1px solid transparent;
}
.button-toolbar:hover,
.button-toolbar:hover:active {
border-color : ThreeDDarkShadow;
}
.button-toolbar > .button-box,
.button-toolbar[disabled="true"] > .button-box,
.button-toolbar[disabled="true"]:hover > .button-box,
.button-toolbar[disabled="true"]:hover:active > .button-box {
border-left : 1px solid ThreeDHighlight !important;
border-top : 1px solid ThreeDHighlight !important;
border-right : 1px solid ThreeDShadow !important;
border-bottom : 1px solid ThreeDShadow !important;
}
.button-toolbar:hover:active > .button-box {
border-left : 1px solid ThreeDShadow !important;
border-top : 1px solid ThreeDShadow !important;
border-bottom : 1px solid ThreeDHighlight !important;
border-right : 1px solid ThreeDHighlight !important;
}
.button-toolbar > .button-box > .button-box-2,
.button-toolbar > .button-box > .button-box-2 > .button-box-text {
margin: none;
border: none !important;
padding: 0px 2px;
}
.button-toolbar > .button-box > .button-icon {
margin-right: 5px;
}
.button-toolbar > .button-box > .button-text {
margin-right: 2px;
}
/* ::::: reorder buttons ::::: */
.reorder-up {
min-width : 0px;
}
.reorder-down {
min-width : 0px;
}
.reorder-up > .button-internal-box > .button-icon,
.reorder-down > .button-internal-box > .button-icon {
margin : 0;
padding : 0;
}

Просмотреть файл

@ -99,9 +99,9 @@ toolbarbutton[disabled="true"][buttondown="true"] > .toolbarbutton-box {
background-color : transparent;
}
/* ..... toggled state ..... */
/* ..... checked state ..... */
toolbarbutton[toggled="true"] > .toolbarbutton-box {
toolbarbutton[checked="true"] > .toolbarbutton-box {
border-left : 1px solid #9D9D9D;
border-top : 1px solid #9D9D9D;
border-right : 1px solid #FFFFFF;
@ -109,7 +109,7 @@ toolbarbutton[toggled="true"] > .toolbarbutton-box {
background-color : #FFFFFF;
}
toolbarbutton[toggled="true"]:hover > .toolbarbutton-box {
toolbarbutton[checked="true"]:hover > .toolbarbutton-box {
border-left : 1px solid #9D9D9D;
border-top : 1px solid #9D9D9D;
border-right : 1px solid #FFFFFF;

Просмотреть файл

@ -48,12 +48,15 @@
}
button:hover:active,
button[open="true"]
button[open="true"],
button[checked="true"]
{
border : 1px solid ThreeDDarkShadow;
}
button:hover:active > .button-box,
button[checked="true"] > .button-box,
button[checked="true"]:focus > .button-box,
button[open="true"] > .button-box,
button[open="true"]:focus > .button-box
{
@ -61,6 +64,8 @@
}
button:hover:active > .button-box > .button-box-2,
button[checked="true"] > .button-box > .button-box-2,
button[checked="true"]:focus> .button-box > .button-box-2,
button[open="true"] > .button-box > .button-box-2,
button[open="true"]:focus > .button-box > .button-box-2
{

Просмотреть файл

@ -96,9 +96,9 @@ toolbarbutton[disabled="true"][buttondown="true"] > .toolbarbutton-box {
padding : 2px;
}
/* ..... toggled state ..... */
/* ..... checked state ..... */
toolbarbutton[toggled="true"] > .toolbarbutton-box {
toolbarbutton[checked="true"] > .toolbarbutton-box {
border-left : 1px solid ThreeDShadow;
border-top : 1px solid ThreeDShadow;
border-right : 1px solid ThreeDHighlight;
@ -106,7 +106,7 @@ toolbarbutton[toggled="true"] > .toolbarbutton-box {
background-color : ThreeDHighlight;
}
toolbarbutton[toggled="true"]:hover > .toolbarbutton-box {
toolbarbutton[checked="true"]:hover > .toolbarbutton-box {
border-left : 1px solid ThreeDShadow;
border-top : 1px solid ThreeDShadow;
border-right : 1px solid ThreeDHighlight;

Просмотреть файл

@ -29,7 +29,7 @@
border: none !important;
}
#FormatToolbar > toolbarbutton[toggled="true"] {
#FormatToolbar > toolbarbutton[checked="true"] {
background-color: transparent;
}
@ -41,8 +41,8 @@
list-style-image: url("chrome://editor/skin/btn2/dec-font-size-hov.gif");
}
#DecreaseFontSizeButton[toggled="true"],
#DecreaseFontSizeButton[toggled="true"]:hover,
#DecreaseFontSizeButton[checked="true"],
#DecreaseFontSizeButton[checked="true"]:hover,
#DecreaseFontSizeButton:hover:active {
list-style-image: url("chrome://editor/skin/btn2/dec-font-size-act.gif");
}
@ -60,8 +60,8 @@
list-style-image: url("chrome://editor/skin/btn2/inc-font-size-hov.gif");
}
#IncreaseFontSizeButton[toggled="true"],
#IncreaseFontSizeButton[toggled="true"]:hover,
#IncreaseFontSizeButton[checked="true"],
#IncreaseFontSizeButton[checked="true"]:hover,
#IncreaseFontSizeButton:hover:active {
list-style-image: url("chrome://editor/skin/btn2/inc-font-size-act.gif");
}
@ -83,7 +83,7 @@
list-style-image: url("chrome://editor/skin/btn2/bold-act.gif");
}
#boldButton[toggled="true"] {
#boldButton[checked="true"] {
list-style-image: url("chrome://editor/skin/btn2/bold-sel.gif");
}
@ -104,7 +104,7 @@
list-style-image: url("chrome://editor/skin/btn2/italic-act.gif");
}
#italicButton[toggled="true"] {
#italicButton[checked="true"] {
list-style-image: url("chrome://editor/skin/btn2/italic-sel.gif");
}
@ -125,7 +125,7 @@
list-style-image: url("chrome://editor/skin/btn2/underline-act.gif");
}
#underlineButton[toggled="true"] {
#underlineButton[checked="true"] {
list-style-image: url("chrome://editor/skin/btn2/underline-sel.gif");
}
@ -146,7 +146,7 @@
list-style-image: url("chrome://editor/skin/btn2/bullets-act.gif");
}
#ulButton[toggled="true"] {
#ulButton[checked="true"] {
list-style-image: url("chrome://editor/skin/btn2/bullets-sel.gif");
}
@ -167,7 +167,7 @@
list-style-image: url("chrome://editor/skin/btn2/numbers-act.gif");
}
#olButton[toggled="true"] {
#olButton[checked="true"] {
list-style-image: url("chrome://editor/skin/btn2/numbers-sel.gif");
}
@ -184,8 +184,8 @@
list-style-image: url("chrome://editor/skin/btn2/outdent-hov.gif");
}
#outdentButton[toggled="true"],
#outdentButton[toggled="true"]:hover,
#outdentButton[checked="true"],
#outdentButton[checked="true"]:hover,
#outdentButton:hover:active {
list-style-image: url("chrome://editor/skin/btn2/outdent-act.gif");
}
@ -203,8 +203,8 @@
list-style-image: url("chrome://editor/skin/btn2/indent-hov.gif");
}
#indentButton[toggled="true"],
#indentButton[toggled="true"]:hover,
#indentButton[checked="true"],
#indentButton[checked="true"]:hover,
#indentButton:hover:active {
list-style-image: url("chrome://editor/skin/btn2/indent-act.gif");
}
@ -336,7 +336,7 @@
list-style-image: url("chrome://editor/skin/btn2/left-act.gif");
}
#align-left-button[toggled="true"] {
#align-left-button[checked="true"] {
list-style-image: url("chrome://editor/skin/btn2/left-sel.gif");
}
@ -357,7 +357,7 @@
list-style-image: url("chrome://editor/skin/btn2/center-act.gif");
}
#align-center-button[toggled="true"] {
#align-center-button[checked="true"] {
list-style-image: url("chrome://editor/skin/btn2/center-sel.gif");
}
@ -378,7 +378,7 @@
list-style-image: url("chrome://editor/skin/btn2/right-act.gif");
}
#align-right-button[toggled="true"] {
#align-right-button[checked="true"] {
list-style-image: url("chrome://editor/skin/btn2/right-sel.gif");
}
@ -399,7 +399,7 @@
list-style-image: url("chrome://editor/skin/btn2/justify-act.gif");
}
#align-justify-button[toggled="true"] {
#align-justify-button[checked="true"] {
list-style-image: url("chrome://editor/skin/btn2/justify-sel.gif");
}

Просмотреть файл

@ -115,54 +115,64 @@ button[default]:focus {
height: 8px;
}
/* .......... active/open state .......... */
/* .......... active/open/checked state .......... */
button:hover:active,
button[checked="true"],
button[open="true"] {
color: #FFFFFF;
}
button:hover:active > .box-inherit > .button-box-left > .button-left-top,
button[checked="true"] > .box-inherit > .button-box-left > .button-left-top,
button[open="true"] > .box-inherit > .button-box-left > .button-left-top {
background-image: url("chrome://global/skin/button/btn-act-lft-top.gif");
}
button:hover:active > .box-inherit > .button-box-left > .button-left-mid,
button[checked="true"] > .box-inherit > .button-box-left > .button-left-mid,
button[open="true"] > .box-inherit > .button-box-left > .button-left-mid {
background-image: url("chrome://global/skin/button/btn-act-lft-mid.gif");
}
button:hover:active > .box-inherit > .button-box-left > .button-left-btm,
button[checked="true"] > .box-inherit > .button-box-left > .button-left-btm,
button[open="true"] > .box-inherit > .button-box-left > .button-left-btm {
background-image: url("chrome://global/skin/button/btn-act-lft-btm.gif");
}
button:hover:active > .box-inherit > .button-stack > .button-box-mid,
button[checked="true"] > .box-inherit > .button-stack > .button-box-mid,
button[open="true"] > .box-inherit > .button-stack > .button-box-mid {
background-color: #90A1B3;
}
button:hover:active > .box-inherit > .button-stack > .button-box-mid > .button-mid-top,
button[checked="true"] > .box-inherit > .button-stack > .button-box-mid > .button-mid-top,
button[open="true"] > .box-inherit > .button-stack > .button-box-mid > .button-mid-top {
background-image: url("chrome://global/skin/button/btn-act-mid-top.gif");
}
button:hover:active > .box-inherit > .button-stack > .button-box-mid > .button-mid-btm,
button[checked="true"] > .box-inherit > .button-stack > .button-box-mid > .button-mid-btm,
button[open="true"] > .box-inherit > .button-stack > .button-box-mid > .button-mid-btm {
background-image: url("chrome://global/skin/button/btn-act-mid-btm.gif");
}
button:hover:active > .box-inherit > .button-box-right > .button-right-top,
button[checked="true"] > .box-inherit > .button-box-right > .button-right-top,
button[open="true"] > .box-inherit > .button-box-right > .button-right-top {
background-image: url("chrome://global/skin/button/btn-act-rit-top.gif");
}
button:hover:active > .box-inherit > .button-box-right > .button-right-mid,
button[checked="true"] > .box-inherit > .button-box-right > .button-right-mid,
button[open="true"] > .box-inherit > .button-box-right > .button-right-mid {
background-image: url("chrome://global/skin/button/btn-act-rit-mid.gif");
}
button:hover:active > .box-inherit > .button-box-right > .button-right-btm,
button[checked="true"] > .box-inherit > .button-box-right > .button-right-btm,
button[open="true"] > .box-inherit > .button-box-right > .button-right-btm {
background-image: url("chrome://global/skin/button/btn-act-rit-btm.gif");
}

Просмотреть файл

@ -84,11 +84,11 @@ toolbarbutton[open="true"] > .toolbarbutton-box {
padding: 2px 1px 0px 3px;
}
/* ..... toggled state ..... */
/* ..... checked state ..... */
toolbarbutton[toggled="true"],
toolbarbutton[toggled="true"]:hover,
toolbarbutton[toggled="true"]:hover:active {
toolbarbutton[checked="true"],
toolbarbutton[checked="true"]:hover,
toolbarbutton[checked="true"]:hover:active {
border-top: 1px solid #454C55;
border-right: 1px solid #7D848D;
border-bottom: 1px solid #7D848D;
@ -97,7 +97,7 @@ toolbarbutton[toggled="true"]:hover:active {
color: #EFF1F4;
}
toolbarbutton[toggled="true"]:hover:active > .toolbarbutton-box {
toolbarbutton[checked="true"]:hover:active > .toolbarbutton-box {
padding: 1px 2px 1px 2px;
}

Просмотреть файл

@ -66,7 +66,6 @@ function changeMode(aMode)
}
document.persist("ConsoleBox", "mode");
updateModeCommand(aMode);
}
function clearConsole()
@ -97,13 +96,8 @@ function updateSortCommand(aOrder)
function updateModeCommand(aMode)
{
var bcset = document.getElementById("ModeBroadcasters");
for (var i = 0; i < bcset.childNodes.length; i++) {
bcset.childNodes[i].removeAttribute("toggled");
}
var bc = document.getElementById("Console:mode" + aMode);
bc.setAttribute("toggled", "true");
bc.setAttribute("checked", true);
}
function toggleToolbar(aEl)

Просмотреть файл

@ -65,12 +65,10 @@ Contributor(s): Joe Hewitt <hewitt@netscape.com>
oncommand="changeSortOrder(-1);"/>
<broadcaster id="Console:toggleToolbarMode" label="&toolbarMode.label;"
oncommand="toggleToolbar(this);"
type="checkbox" checked="true"
oncommand="toggleToolbar(this);" checked="true"
_toolbar="ToolbarMode"/>
<broadcaster id="Console:toggleToolbarEval" label="&toolbarEval.label;"
oncommand="toggleToolbar(this);"
type="checkbox" checked="true"
oncommand="toggleToolbar(this);" checked="true"
_toolbar="ToolbarEval"/>
<broadcasterset id="ModeBroadcasters">
@ -118,8 +116,8 @@ Contributor(s): Joe Hewitt <hewitt@netscape.com>
<menupopup>
<menu label="&toolbarsCmd.label;" accesskey="&toolbarsCmd.accesskey;">
<menupopup>
<menuitem observes="Console:toggleToolbarMode"/>
<menuitem observes="Console:toggleToolbarEval"/>
<menuitem type="checkbox" observes="Console:toggleToolbarMode"/>
<menuitem type="checkbox" observes="Console:toggleToolbarEval"/>
</menupopup>
</menu>
<menuseparator/>
@ -136,10 +134,10 @@ Contributor(s): Joe Hewitt <hewitt@netscape.com>
</menubar>
<toolbar id="ToolbarMode" grippytooltip="aTooltip" grippytooltiptext="&modeToolbar.tooltip;">
<toolbarbutton observes="Console:modeAll"/>
<toolbarbutton observes="Console:modeErrors"/>
<toolbarbutton observes="Console:modeWarnings"/>
<toolbarbutton observes="Console:modeMessages"/>
<toolbarbutton type="radio" group="mode" observes="Console:modeAll"/>
<toolbarbutton type="radio" group="mode" observes="Console:modeErrors"/>
<toolbarbutton type="radio" group="mode" observes="Console:modeWarnings"/>
<toolbarbutton type="radio" group="mode" observes="Console:modeMessages"/>
<toolbarseparator/>
<toolbarbutton observes="Console:clear"/>
</toolbar>

Просмотреть файл

@ -77,12 +77,7 @@ function loadResultsTree( aSearchURL )
function doEngineClick( event, aNode )
{
// do toggling
var engineTabBox = document.getElementById("engineTabs");
var toggledEls = engineTabBox.getElementsByAttribute("toggled", "true");
for (var i = 0; i < toggledEls.length; i++)
toggledEls[i].removeAttribute("toggled");
event.target.setAttribute("toggled", "true");
event.target.checked = true;
var html = null;

Просмотреть файл

@ -30,15 +30,15 @@
ref="NC:SearchResultsSitesRoot" datasources="rdf:internetsearch"
style="overflow: none; min-width: 1px;">
<template>
<button class="engineTabs button-toolbar button-slimline" uri="..."
<button type="radio" group="engineButton" class="engineTabs button-toolbar" uri="..."
oncommand="doEngineClick(event, this);" crop="right"
src="rdf:http://home.netscape.com/NC-rdf#StatusIcon"
label="rdf:http://home.netscape.com/NC-rdf#Name"
loading="rdf:http://home.netscape.com/NC-rdf#loading" />
</template>
<button class="engineTabs button-toolbar button-slimline" id="allEngines"
<button type="radio" group="engineButton" class="engineTabs button-toolbar" id="allEngines"
oncommand="doEngineClick(event, this);" label="&allresults.title.label;"
toggled="true"/>
checked="true"/>
<separator orient="vertical"/>
<text value="&viewbyprovider.label;"/>
<separator orient="vertical" class="thin"/>

Просмотреть файл

@ -29,10 +29,80 @@
]]>
</getter>
</property>
<property name="type"
onget="return this.getAttribute('type');"
onset="this.setAttribute('type', val); return val;"/>
<property name="dlgType"
onget="return this.getAttribute('dlgType');"
onset="this.setAttribute('dlgType', val); return val;"/>
<property name="group"
onget="return this.getAttribute('group');"
onset="this.setAttribute('group', val); return val;"/>
<property name="open"
onget="return this.getAttribute('open') == 'true';"
onset="this.setAttribute('open', val); return val;"/>
<property name="checked" onget="return this.getAttribute('checked') == 'true';">
<setter><![CDATA[
if (this.type == "checkbox") {
this.checkState = val ? 1 : 0;
} else if (this.type == "radio" && val) {
var sibs = this.parentNode.getElementsByAttribute("group", this.group);
for (var i = 0; i < sibs.length; ++i)
if (sibs[i].checked)
sibs[i].checked = false;
}
if (val)
this.setAttribute("checked", "true");
else
this.removeAttribute("checked");
return val;
]]></setter>
</property>
<property name="checkState">
<getter><![CDATA[
var state = this.getAttribute("checkState");
if (state == "")
return this.checked ? 1 : 0;
else
return state == "0" ? 0 : (state == "2" ? 2 : 1);
]]></getter>
<setter><![CDATA[
this.setAttribute("checkState", val);
return val;
]]></setter>
</property>
<property name="autoCheck"
onget="return this.getAttribute('autoCheck') == 'true';"
onset="this.setAttribute('autoCheck', val); return val;"/>
</implementation>
<handlers>
<handler event="command">
<![CDATA[
if (this.autoCheck || !this.hasAttribute("autoCheck")) {
if (this.type == "checkbox") {
this.checked = !this.checked;
} else if (this.type == "radio") {
this.checked = true;
}
}
]]>
</handler>
</handlers>
</binding>
<binding id="button" extends="chrome://global/content/bindings/button.xml#button-base">
<binding id="button" display="xul:button"
extends="chrome://global/content/bindings/button.xml#button-base">
<resources>
<stylesheet src="chrome://global/skin/button.css"/>
</resources>