Fixed color picker bug 27293. Initial checkin of new Color Properties dialog. Added images to show span and div tags. r=mjudge

This commit is contained in:
cmanske%netscape.com 2000-02-11 01:26:03 +00:00
Родитель 306c814879
Коммит 1d97700c18
20 изменённых файлов: 330 добавлений и 25 удалений

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

@ -837,9 +837,9 @@ nsEditorShell::RemoveTextProperty(const PRUnichar *prop, const PRUnichar *attr)
//TODO: FIX THIS! IT IS WRONG! IT DOESN'T CONSIDER ALL THE
// OTHER POSSIBLE TEXT ATTRIBUTES!
static const char* sAllKnownStyles[] = {
"B",
"I",
"U",
"b",
"i",
"u",
nsnull // this null is important
};

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

@ -837,9 +837,9 @@ nsEditorShell::RemoveTextProperty(const PRUnichar *prop, const PRUnichar *attr)
//TODO: FIX THIS! IT IS WRONG! IT DOESN'T CONSIDER ALL THE
// OTHER POSSIBLE TEXT ATTRIBUTES!
static const char* sAllKnownStyles[] = {
"B",
"I",
"U",
"b",
"i",
"u",
nsnull // this null is important
};

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

@ -34,6 +34,20 @@ a[name] {
background-position: center center;
}
div {
/* TEMPORARY TO COMPENSATE FOR BUG */
padding-left: 16px;
background: url(chrome://editor/skin/images/div-in-doc.gif) no-repeat;
background-position: center center;
}
span {
/* TEMPORARY TO COMPENSATE FOR BUG */
padding-left: 16px;
background: url(chrome://editor/skin/images/span-in-doc.gif) no-repeat;
background-position: center center;
}
table {
empty-cells: show;
}

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

@ -65,8 +65,8 @@
</broadcasterset>
<popupset>
<popup id="TextColorPopup"/>
<popup id="BackColorPopup"/>
<popup id="TextColorPopup"/>
</popupset>
<!-- keys are appended from the overlay -->
@ -131,6 +131,7 @@
<titledbutton id="printButton" />
<titledbutton id="findButton"/>
<titledbutton id="spellingButton"/>
<menuseparator/>
<titledbutton id="imageButton"/>
<titledbutton id="hlineButton"/>
<titledbutton id="tableButton"/>

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

@ -685,8 +685,8 @@
<!-- The new Color Picker UI -->
<html:div id="ColorButtons">
<titledbutton id="TextColorPopupButton" popup="TextColorPopup"/>
<titledbutton id="BackColorPopupButton" popup="BackColorPopup"/>
<titledbutton id="TextColorPopupButton" popup="TextColorPopup"/>
</html:div>
<titledbutton id="DecreaseFontSizeButton" onclick="EditorDecreaseFontSize()"/>

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

@ -30,6 +30,8 @@ images:right.gif
images:justify.gif
images:anchor.gif
images:anchor-in-doc.gif
images:div-in-doc.gif
images:span-in-doc.gif
images:bullets.gif
images:outdent.gif
images:hline.gif

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

@ -48,6 +48,8 @@ EXPORT_RESOURCE_TOOLBAR = \
$(srcdir)/images/table.gif \
$(srcdir)/images/anchor.gif \
$(srcdir)/images/anchor-in-doc.gif \
$(srcdir)/images/div-in-doc.gif \
$(srcdir)/images/span-in-doc.gif \
$(srcdir)/images/underline.gif \
$(srcdir)/images/color.gif \
$(srcdir)/images/align.gif \

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

@ -294,30 +294,35 @@ titledbutton#InsertPopupButton {
list-style-image:url("chrome://editor/skin/images/object-popup.gif");
}
/* Doesn't work! */
box#ColorButtons:hover {
border: 1px solid white;
}
div.color-caption {
border: 1px inset white;
}
div#ColorButtons {
/* This needs to be >= 2x color button width
(color.gif=12px + 2 for border) */
width: 28px;
height: 19px;
/* Width needs to be >= 2x color button width
(color.gif=12px + 2 for border)
for initial layout.
Then use relative position to move buttons
to desired overlapping locations
*/
width: 28px;
max-width: 28px;
height: 19px;
/* This compensates for remaining gap
on right after relative button positioning
*/
margin-right: -3px;
}
titledbutton#TextColorPopupButton {
list-style-image:url("chrome://editor/skin/images/color.gif");
border: 1px solid #CCCCCC;
padding: 0px;
margin: 0px;
margin: 0px;
position: relative;
top: 2px;
left: 2px;
z-index: 2;
/* Position top left */
top: 2px;
left: -11px;
/* TEMP: Set color here. TODO: Set color from page */
background-color: #AA0000;
@ -331,11 +336,11 @@ titledbutton#BackColorPopupButton {
list-style-image:url("chrome://editor/skin/images/color.gif");
border: 1px solid #CCCCCC;
padding: 0px;
margin: 0px;
margin: 0px;
position: relative;
top: 9px;
left:-4px;
z-index: 1;
/* Position lower right */
top: 9px;
left: 9px;
/* TEMP: Set color here. TODO: Set color from page */
background-color: yellow;

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

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

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

@ -46,6 +46,8 @@ install:: $(DLL)
$(MAKE_INSTALL) images\table.gif $(DIST)\bin\chrome\editor\skin\default\images
$(MAKE_INSTALL) images\anchor.gif $(DIST)\bin\chrome\editor\skin\default\images
$(MAKE_INSTALL) images\anchor-in-doc.gif $(DIST)\bin\chrome\editor\skin\default\images
$(MAKE_INSTALL) images\div-in-doc.gif $(DIST)\bin\chrome\editor\skin\default\images
$(MAKE_INSTALL) images\span-in-doc.gif $(DIST)\bin\chrome\editor\skin\default\images
$(MAKE_INSTALL) images\underline.gif $(DIST)\bin\chrome\editor\skin\default\images
$(MAKE_INSTALL) images\color.gif $(DIST)\bin\chrome\editor\skin\default\images
$(MAKE_INSTALL) images\newfile.gif $(DIST)\bin\chrome\editor\skin\default\images
@ -91,6 +93,8 @@ clobber::
rm -f $(DIST)\bin\chrome\editor\skin\default\images\table.gif
rm -f $(DIST)\bin\chrome\editor\skin\default\images\anchor.gif
rm -f $(DIST)\bin\chrome\editor\skin\default\images\anchor-in-doc.gif
rm -f $(DIST)\bin\chrome\editor\skin\default\images\div-in-doc.gif
rm -f $(DIST)\bin\chrome\editor\skin\default\images\span-in-doc.gif
rm -f $(DIST)\bin\chrome\editor\skin\default\images\underline.gif
rm -f $(DIST)\bin\chrome\editor\skin\default\images\color.gif
rm -f $(DIST)\bin\chrome\editor\skin\default\images\object-popup.gif

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

@ -0,0 +1,223 @@
<?xml version="1.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):
-->
<?xml-stylesheet href="chrome://editor/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorColorProperties.dtd">
<window class="dialog" title="&windowTitle.label;"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="Startup()"
align="vertical">
<!-- Methods common to all editor dialogs -->
<html:script language="JavaScript" src="chrome://editor/content/EdDialogCommon.js"/>
<html:script language="JavaScript" src="chrome://editor/content/EdColorProps.js"/>
<html:script language="JavaScript" src="chrome://global/content/dialogOverlay.js" />
<broadcaster id="args" value=""/>
<keyset id="keyset"/>
<tabcontrol align="vertical">
<tabbox align="horizontal" flex="100%">
<tab id="GeneralTab">&generalTab.label;</tab>
<tab id="ColorTab">&backgroundTab.label;</tab>
<tab id="MetaTab">&metaTagsTab.label;</tab>
</tabbox>
<tabpanel id="tabPanel" flex="100%">
<!-- ***** general tab ***** -->
<box id="panel1" align="vertical">
<html:table>
<html:tr>
<html:td>
&location.label;
</html:td>
<html:td id="location">
<!-- fill in URL at runtime -->
</html:td>
</html:tr>
<html:tr>
<html:td>
&lastModified.label;
</html:td>
<html:td id="lastModified">
<!-- fill in date at runtime -->
</html:td>
</html:tr>
<html:tr>
<html:td>
&titleInput.label;
</html:td>
<html:td id="titleInput">
<html:input type="text" id="titleInput"/>
</html:td>
</html:tr>
<html:tr>
<html:td>
&authorInput.label;
</html:td>
<html:td id="authorInput">
<html:input type="text" id="titleInput"/>
</html:td>
</html:tr>
<html:tr>
<html:td>
&descriptionInput.label;
</html:td>
<html:td id="title">
<html:input type="text" id="descriptionInput"/>
</html:td>
</html:tr>
</html:table>
</box>
<!-- **** colors/background tab **** -->
<box id="panel2" align="vertical">
<html:fieldset><html:legend class = "dialog" align = "left">&pageColors.label;</html:legend>
<html:input type="radio" name="ColorMode" id="DefaultColorsRadio"/>
<html:label for="DefaultColorsRadio">&defaultColorsRadio.label;</html:label>
<html:br/>
<html:input type="radio" name="ColorMode" id="CustomColorsRadio"/>
<html:label for="CustomColorsRadio">&customColorsRadio.label;</html:label>
<html:br/>
<html:div>
<spring class="bigspacer"/>
<box flex="1">
<html:label> &colorScheme.label;
<html:select id="ColorScheme" size="1" style="min-width: 10em">
<html:option> Black on White </html:option>
<html:option> Blue on White </html:option>
<html:option> White on Black </html:option>
</html:select>
</html:label>
</box>
<!-- TODO: COLOR SCHEME SELECT LIST -->
</html:div>
<spring class="bigspacer"/>
<box align="horizontal">
<spring class="bigspacer"/>
<box align="vertical" flex="100%">
<box>
<html:label class="margin-both"> &normalText.label; </html:label>
<spring flex="100%"/>
<menu class="colorpicker">
<html:div id="textCW" class="color-well"/>
<titledbutton class="popup" align="right" flex="100%" onclick="GetColor('textCP','textCW');"/>
<menupopup id="normalMenuPopup">
<colorpicker id="textCP" palettename="standard" onclick="GetColor('textCP','textCW');"/>
<titledbutton class="push" value="&colorPicker.default.label;" onclick="GetColor('textCP','textCW');"/>
</menupopup>
</menu>
</box>
<spring class="spacer"/>
<box>
<html:label class="margin-both"> &linkText.label; </html:label>
<spring flex="100%"/>
<menu class="colorpicker">
<html:div id="linkCW" class="color-well"/>
<titledbutton class="popup" align="right" flex="100%"/>
<menupopup>
<colorpicker id="linkCP" palettename="standard" onclick="GetColor('linkCP','linkCW');"/>
<titledbutton class="push" value="&colorPicker.default.label;" onclick="RemoveColor('linkCW');"/>
</menupopup>
</menu>
</box>
<spring class="spacer"/>
<box>
<html:label class="margin-both"> &activeLinkText.label; </html:label>
<spring flex="100%"/>
<menu class="colorpicker">
<html:div id="activeCW" class="color-well"/>
<titledbutton class="popup" align="right" flex="100%"/>
<menupopup>
<colorpicker id="activeCP" palettename="standard" onclick="GetColor('activeCP','activeCW');"/>
<titledbutton class="push" value="&colorPicker.default.label;" onclick="RemoveColor('activeCW');"/>
</menupopup>
</menu>
</box>
<spring class="spacer"/>
<box>
<html:label class="margin-both"> &followedLinkText.label; </html:label>
<spring flex="100%"/>
<menu class="colorpicker">
<html:div id="followedCW" class="color-well"/>
<titledbutton class="popup" align="right" flex="100%"/>
<menupopup>
<colorpicker id="followedCP" palettename="standard" onclick="GetColor('followedCP','followedCW');"/>
<titledbutton class="push" value="&colorPicker.default.label;" onclick="RemoveColor('followedCW');"/>
</menupopup>
</menu>
</box>
<spring class="spacer"/>
<box>
<html:label class="margin-both"> &background.label; </html:label>
<spring flex="100%"/>
<menu class="colorpicker">
<html:div id="backgroundCW" class="color-well"/>
<titledbutton class="popup" align="right" flex="100%"/>
<menupopup>
<colorpicker id="backgroundCP" palettename="standard" onclick="GetColor('backgroundCP','backgroundCW');"/>
<titledbutton class="push" value="&colorPicker.default.label;" onclick="RemoveColor('backgroundCW');"/>
</menupopup>
</menu>
</box>
</box>
<spring class="bigspacer"/>
<box align="vertical" flex="100%" id="ColorPreview">
<!-- basestyle="min-height:50px; width: 100%; border: 1px inset #CCCCCC; padding: 5px; " style="min-height:50px; width: 100%; border: 1px inset #CCCCCC; padding: 5px; "-->
<html:div id="NormalText">&normalText.label;</html:div>
<spring class="spacer"/>
<html:div id="LinkText">&linkText.label;</html:div>
<spring class="spacer"/>
<html:div id="ActiveLinkText">&activeLinkText.label;</html:div>
<spring class="spacer"/>
<html:div id="FollowedLinkText">&followedLinkText.label;</html:div>
</box>
</box>
</html:fieldset>
<box align="horizontal">
<html:input type="checkbox" id="BackgroundImageCheckbox"/>
<html:label for="BackgroundImageCheckbox"> &backgroundImage.label; </html:label>
</box>
<box align="horizontal">
<html:input type="text" class="SizeToParent" id="BackgroundImageInput" size="20"/>
<spring class="spacer"/>
<!-- from EdDialogOverlay.xul -->
<titledbutton id="ChooseFile"/>
</box>
</box> <!-- end of colors tab -->
<!-- **** meta tags tab **** -->
<box id="panel3" align="vertical">
</box>
</tabpanel>
</tabcontrol>
<box id="okCancelButtons"/>
</window>

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

@ -27,7 +27,6 @@
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
<?xul-overlay href="chrome://editor/content/EdColorsOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorPageProperties.dtd">

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

@ -50,6 +50,8 @@ EdListProps.xul
EdListProps.js
EdPageProps.xul
EdPageProps.js
EdColorProps.xul
EdColorProps.js
EdAECSSAttributes.js
EdAEHTMLAttributes.js
EdAEJSEAttributes.js

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

@ -34,6 +34,8 @@ EXPORT_RESOURCE_CONTENT = \
$(srcdir)/EdListProps.js \
$(srcdir)/EdPageProps.xul \
$(srcdir)/EdPageProps.js \
$(srcdir)/EdColorProps.xul \
$(srcdir)/EdColorProps.js \
$(srcdir)/EdImageProps.xul \
$(srcdir)/EdImageProps.js \
$(srcdir)/EdInsSrc.xul \

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

@ -52,6 +52,8 @@ install::
$(MAKE_INSTALL) EdListProps.js $(DIST)\bin\chrome\editor\content\default
$(MAKE_INSTALL) EdPageProps.xul $(DIST)\bin\chrome\editor\content\default
$(MAKE_INSTALL) EdPageProps.js $(DIST)\bin\chrome\editor\content\default
$(MAKE_INSTALL) EdColorProps.xul $(DIST)\bin\chrome\editor\content\default
$(MAKE_INSTALL) EdColorProps.js $(DIST)\bin\chrome\editor\content\default
$(MAKE_INSTALL) EdAECSSAttributes.js $(DIST)\bin\chrome\editor\content\default
$(MAKE_INSTALL) EdAEHTMLAttributes.js $(DIST)\bin\chrome\editor\content\default
$(MAKE_INSTALL) EdAEJSEAttributes.js $(DIST)\bin\chrome\editor\content\default
@ -86,6 +88,8 @@ clobber::
rm -f $(DIST)\bin\chrome\editor\content\default\EdListProps.js
rm -f $(DIST)\bin\chrome\editor\content\default\EdPageProps.xul
rm -f $(DIST)\bin\chrome\editor\content\default\EdPageProps.js
rm -f $(DIST)\bin\chrome\editor\content\default\EdColorProps.xul
rm -f $(DIST)\bin\chrome\editor\content\default\EdColorProps.js
rm -f $(DIST)\bin\chrome\editor\content\default\EdAECSSAttributes.js
rm -f $(DIST)\bin\chrome\editor\content\default\EdAEHTMLAttributes.js
rm -f $(DIST)\bin\chrome\editor\content\default\EdAEJSEAttributes.js

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

@ -0,0 +1,43 @@
<!--
- 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):
-->
<!-- Window title -->
<!ENTITY windowTitle.label "Page Properties">
<!ENTITY generalTab.label "General">
<!ENTITY backgroundTab.label "Colors and Background">
<!ENTITY metaTagsTab.label "Meta Tags">
<!ENTITY location.label "Location">
<!ENTITY lastModified.label "Last Modified">
<!ENTITY titleInput.label "Title">
<!ENTITY authorInput.label "Author">
<!ENTITY descriptionInput.label "Description">
<!ENTITY pageColors.label "Page Colors">
<!ENTITY defaultColorsRadio.label "Don't specify colors">
<!ENTITY customColorsRadio.label "Use custom colors:">
<!ENTITY colorScheme.label "Color Schemes:">
<!ENTITY normalText.label "Normal text:">
<!ENTITY linkText.label "Link text:">
<!ENTITY activeLinkText.label "Active link text:">
<!ENTITY followedLinkText.label "Followed link text:">
<!ENTITY background.label "Background:">
<!ENTITY backgroundImage.label "Background Image:">
<!ENTITY colorPicker.default.label "Don't Specify Color">

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

@ -29,6 +29,7 @@ EditorInsertTable.dtd
EditorLinkProperties.dtd
EditorListProperties.dtd
EditorPageProperties.dtd
EditorColorProperties.dtd
EditorPersonalDictionary.dtd
EditorSpellCheck.dtd
EditorTableProperties.dtd

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

@ -34,6 +34,7 @@ EXPORT_RESOURCE_CONTENT = \
$(srcdir)/EditorLinkProperties.dtd \
$(srcdir)/EditorListProperties.dtd \
$(srcdir)/EditorPageProperties.dtd \
$(srcdir)/EditorColorProperties.dtd \
$(srcdir)/EditorPersonalDictionary.dtd \
$(srcdir)/EditorSpellCheck.dtd \
$(srcdir)/EditorTableProperties.dtd \

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

@ -31,6 +31,7 @@ install::
$(MAKE_INSTALL) EditorLinkProperties.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorListProperties.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorPageProperties.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorColorProperties.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorPersonalDictionary.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorSpellCheck.dtd $(DIST)\bin\chrome\editor\locale\en-US
$(MAKE_INSTALL) EditorTableProperties.dtd $(DIST)\bin\chrome\editor\locale\en-US
@ -46,6 +47,7 @@ clobber::
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorLinkProperties.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorListProperties.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorPageProperties.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorColorProperties.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorPersonalDictionary.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorSpellCheck.dtd
rm -f $(DIST)\bin\chrome\editor\locale\en-US\EditorTableProperties.dtd