-- not part of the build, cascades only --

adds support for line-height property, fixes a blocking bug in length units menulists, fixes a bug in Border Tab when trying to unspecify the border style and all four side borders have the same styles
This commit is contained in:
glazman%netscape.com 2002-09-13 13:47:42 +00:00
Родитель 9f72876153
Коммит 340ad084bb
5 изменённых файлов: 195 добавлений и 143 удалений

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

@ -1,6 +1,6 @@
var gVersion = "0.1.7";
var gVersion = "0.2.1";
var err = initInstall("CaScadeS", "cascades", gVersion);
logComment("initInstall: " + err);

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

@ -2,104 +2,137 @@
<html>
<head>
<title>CaScadeS readme</title>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
<meta name="author" content="Daniel Glazman">
</head>
<body>
<body>
<h1>CaScadeS, a stylesheet editor for Composer</h1>
<hr width="100%" size="2">
<hr width="100%" size="2">
<h3>CaScades build instructions</h3>
<h5>Unix/Window:<br>
</h5>
</h5>
<ol>
<li>use the build configurator to declare you want to build CaScadeS :</li>
<li>use the build configurator to declare you want to build CaScadeS
:</li>
<ol>
<li>open <a href="http://webtools.mozilla.org/build/config.cgi">http://webtools.mozilla.org/build/config.cgi</a></li>
<li>scroll to "Components and Features" section and find the "--enable-extensions="
editable field.</li>
<li>add editor/cascades (editor-slash-cascades, no spaces) to that field</li>
<li>make all other choices you need for your build<br>
</li>
<li>scroll to the bottom of the page</li>
<li>Click on the "Preview Build Script" button</li>
<li>Click on the "Save the script" button (on Windows, save the file
for instance in c:\mozconfig and set the environment variable MOZCONFIG to
that oath)&nbsp;</li>
<li>open <a href="http://webtools.mozilla.org/build/config.cgi">http://webtools.mozilla.org/build/config.cgi</a></li>
<li>scroll to "Components and Features" section and find the "--enable-extensions="
editable field.</li>
<li>add editor/cascades (editor-slash-cascades, no spaces) to that
field</li>
<li>make all other choices you need for your build<br>
</li>
<li>scroll to the bottom of the page</li>
<li>Click on the "Preview Build Script" button</li>
<li>Click on the "Save the script" button (on Windows, save the file
for instance in c:\mozconfig and set the environment variable MOZCONFIG
to that oath)&nbsp;</li>
</ol>
<li>go to the directory containing your mozilla/ tree</li>
<li>type:</li>
<li>go to the directory containing your mozilla/ tree</li>
<li>type:</li>
<ol>
<li><span style="font-family: monospace;">cvs co mozilla/client.mk</span></li>
<li><span style="font-family: monospace;"></span><span
<li><span style="font-family: monospace;">cvs co mozilla/client.mk</span></li>
<li><span style="font-family: monospace;"></span><span
style="font-family: monospace;">cd mozilla</span></li>
<li><span style="font-family: monospace;"></span><span
<li><span style="font-family: monospace;"></span><span
style="font-family: monospace;">gmake -f client.mk</span> &nbsp;(<span
style="font-family: monospace;">make</span> instead of <span
style="font-family: monospace;">gmake</span> on win32)<span
style="font-family: monospace;">&nbsp;</span></li>
</ol>
</ol>
<h5>Macintosh:</h5>
<p>Add an entry for <span style="font-family: monospace;">cascades</span>
in function <span style="font-family: monospace;">ProcessJarManifests()</span>
in file <span style="font-family: monospace;">mozilla/build/mac/build_sripts/MozillaBuildList.pm</span>
<p>Add an entry for <span style="font-family: monospace;">cascades</span>
in function <span style="font-family: monospace;">ProcessJarManifests()</span>
in file <span style="font-family: monospace;">mozilla/build/mac/build_sripts/MozillaBuildList.pm</span>
and don't forget to add an entry 1 for <span
style="font-family: monospace;">cascades</span> in <span
style="font-family: monospace;">mozilla/build/mac/build_sripts/MozillaBuild</span><span
style="font-family: monospace;">Flags.txt</span>.<br>
</p>
</p>
<h5><span style="font-family: monospace;"></span></h5>
<h3>What's the current version ?</h3>
<p>The current version is 0.2.<br>
</p>
<p>The current version is 0.2.1</p>
<table cellpadding="2" cellspacing="2" border="1" width="100%">
<tbody>
<tr>
<th valign="top">Version<br>
</th>
<th valign="top">Date<br>
</th>
<th valign="top">What's new in this version ?<br>
</th>
</tr>
<tr>
<td valign="top">0.2.1<br>
</td>
<td valign="top">2002-sept-13<br>
</td>
<td valign="top">adds support for line-height, fixes a blocking bug
in length units menulists, fixes a bug in Border Tab when trying to unspecify
the border style and all four side borders have the same styles<br>
</td>
</tr>
</tbody>
</table>
<p>.<br>
</p>
<h3>How can I install CaScadeS without building it ?</h3>
<p>Just go <a
href="http://daniel.glazman.free.fr/composer/cascades02.htm">there</a> and
install the XPI.<br>
</p>
href="http://daniel.glazman.free.fr/composer/cascades02.htm">there</a> and
install the XPI.<br>
</p>
<h3>How can I start CaScadeS ?</h3>
<p>CaScadeS is not a standalone app, it is an add-on to Composer, the content
editor in the Mozilla distribution. Just launch Composer and find CaScadeS
under Tools&gt;CSS Editor.<br>
</p>
<p>CaScadeS is not a standalone app, it is an add-on to Composer, the content
editor in the Mozilla distribution. Just launch Composer and find CaScadeS
under Tools&gt;CSS Editor.<br>
</p>
<h3>How can I submit feedback ?</h3>
<p>Depends on the feedback :<br>
</p>
</p>
<ol>
<li>you found a bug, or would like to see implemented a new feature ?
File a bug in <a href="http://bugzilla.mozilla.org/">Bugzilla</a>, product
<li>you found a bug, or would like to see implemented a new feature ?
File a bug in <a href="http://bugzilla.mozilla.org/">Bugzilla</a>, product
<span style="font-style: italic;">Browser</span>, component <span
style="font-style: italic;">Editor:Composer</span>, severity <span
style="font-style: italic;">enhancement</span>.</li>
<li>you need help or have a technical question ? Prefer the <a
href="http://cascades.mozdev.org/list.html">CaScadeS mailing-list</a> or
drop a mail to <a href="mailto:daniel@glazman.org">daniel@glazman.org</a>.</li>
<li>you need help or have a technical question ? Prefer the <a
href="http://cascades.mozdev.org/list.html">CaScadeS mailing-list</a> or
drop a mail to <a href="mailto:daniel@glazman.org">daniel@glazman.org</a>.</li>
</ol>
<h3>Where can I see a demo of CaScadeS ?</h3>
<p><a href="http://cascades.mozdev.org/screenshots.html">Here</a>.</p>
<hr width="100%" size="2">
<address>Daniel Glazman<br>
$Date: 2002-09-09 12:47:51 $</address>
<h3>Where can I see a demo of CaScadeS ?</h3>
<p><a href="http://cascades.mozdev.org/screenshots.html">Here</a>.</p>
<hr width="100%" size="2">
<address>Daniel Glazman<br>
$Date: 2002-09-13 13:47:42 $</address>
<br>
</body>
</html>

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

@ -979,7 +979,6 @@ function IfFourSidesSameStyle(propertyBase, propertySuffix, value, checkboxID, p
if (elt) {
value = elt.value;
}
else return;
}
var xulElt = document.getElementById(previewID);
var sideArray = [ "left", "right", "bottom" ];
@ -1001,8 +1000,8 @@ function ToggleFourBorderSidesSameStyle(elt)
var sideArray = [ "left", "right", "bottom" ];
var style = getSpecifiedStyle("border-top-style");
if (!style || style == "")
style = "unspecified";
/*if (!style || style == "")
style = "unspecified";*/
var color = gDialog.topBorderColorInput.value;
var width = getSpecifiedStyle("border-top-width");
@ -1058,7 +1057,7 @@ function EnableUI(elt, enabled)
// the current value of the property and if it is already a length,
// build the menu keeping the same numeric part and browsing all the
// possible units.
function InitLengthUnitMenuPopup(elt, property, id)
function InitLengthUnitMenuPopup(elt, property, id, allowsPercentages)
{
var value = elt.parentNode.value;
var re = /([+-]?\d*\.\d+|[+-]?\d+)\D*/ ;
@ -1075,28 +1074,15 @@ function InitLengthUnitMenuPopup(elt, property, id)
}
// below is an array of all valid CSS length units
var unitsArray = [ "px", "%", "pt", "cm", "in", "mm", "pc", "em", "ex" ];
var j, newitem;
for (j=0; j<unitsArray.length; j++) {
var unitsArray = [ "%", "px", "pt", "cm", "in", "mm", "pc", "em", "ex" ];
var j, newitem, start = 0;
if (!allowsPercentages)
start = 1;
for (j=start; j<unitsArray.length; j++) {
var itemValue = numPart + unitsArray[j];
newitem = document.createElementNS(XUL_NS, "menuitem");
newitem.setAttribute("label", itemValue);
if (id)
newitem.setAttribute("oncommand", "onPullDownChanged(" +
"'" + property + "'" +
", " +
"'" + itemValue + "'" +
", " +
"'" + id + "'"
+");");
else
newitem.setAttribute("oncommand", "onPullDownChanged(" +
"'" + property + "'" +
", " +
"'" + itemValue + "'" +
", " +
"null"
+");");
newitem.setAttribute("value", itemValue);
if (child)
elt.insertBefore(newitem, child);
else
@ -1191,7 +1177,7 @@ function initLocalFontFaceMenu(menuPopup)
// param String id
function DoMenulistCommand(elt, property, id) {
var choice = elt.selectedItem;
var value = choice.getAttribute("value");
var value = choice.value;
onPullDownChanged(property, value, id);
if (property == "border-top-style") {
// this one is a special case : we need to check if the checkbox

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

@ -88,39 +88,64 @@
</menupopup>
</menulist>
<separator class="groove"/>
<hbox align="center">
<label value="&fontSize.label;"/>
<menulist editable="true"
style="width: 8em"
id="fontSizeInput"
oninput="ChangeValueOnInput(this, 'font-size', 'brownFoxLabel');"
oncommand="DoMenulistCommand(this, 'font-size', 'brownFoxLabel');">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'font-size', 'brownFoxLabel');">
<menuseparator/>
<menuitem label="&largerFontSize.label;"
value='larger'/>
<menuitem label="&smallerFontSize.label;"
value='smaller'/>
<menuseparator/>
<menuitem label="&xxsmallFontSize.label;"
value='xx-small'/>
<menuitem label="&xsmallFontSize.label;"
value='x-small'/>
<menuitem label="&smallFontSize.label;"
value='small'/>
<menuitem label="&mediumFontSize.label;"
value='medium'/>
<menuitem label="&largeFontSize.label;"
value='large'/>
<menuitem label="&xlargeFontSize.label;"
value='x-large'/>
<menuitem label="&xxlargeFontSize.label;"
value='xx-large'/>
</menupopup>
</menulist>
<spinbuttons onup="Spinbutton(1, 'fontSizeInput');"
ondown="Spinbutton(-1, 'fontSizeInput');"/>
</hbox>
<grid>
<columns><column/><column flex="1"/></columns>
<rows>
<row align="center">
<label value="&fontSize.label;"/>
<hbox align="center">
<menulist editable="true"
style="width: 8em"
id="fontSizeInput"
oninput="ChangeValueOnInput(this, 'font-size', 'brownFoxLabel');"
oncommand="DoMenulistCommand(this, 'font-size', 'brownFoxLabel');">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'font-size', 'brownFoxLabel', true);">
<menuseparator/>
<menuitem label="&largerFontSize.label;"
value='larger'/>
<menuitem label="&smallerFontSize.label;"
value='smaller'/>
<menuseparator/>
<menuitem label="&xxsmallFontSize.label;"
value='xx-small'/>
<menuitem label="&xsmallFontSize.label;"
value='x-small'/>
<menuitem label="&smallFontSize.label;"
value='small'/>
<menuitem label="&mediumFontSize.label;"
value='medium'/>
<menuitem label="&largeFontSize.label;"
value='large'/>
<menuitem label="&xlargeFontSize.label;"
value='x-large'/>
<menuitem label="&xxlargeFontSize.label;"
value='xx-large'/>
</menupopup>
</menulist>
<spinbuttons onup="Spinbutton(1, 'fontSizeInput');"
ondown="Spinbutton(-1, 'fontSizeInput');"/>
</hbox>
</row>
<row align="center">
<label value="&lineHeight.label;"/>
<hbox align="center">
<menulist editable="true"
style="width: 8em"
id="lineHeightInput"
oninput="ChangeValueOnInput(this, 'line-height', null);"
oncommand="DoMenulistCommand(this, 'line-height', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'line-height', null, true);">
<menuseparator/>
<menuitem label="&normalLineHeight.label;"
value='normal'/>
</menupopup>
</menulist>
<spinbuttons onup="Spinbutton(1, 'lineHeightInput');"
ondown="Spinbutton(-1, 'lineHeightInput');"/>
</hbox>
</row>
</rows>
</grid>
</vbox>
<separator orient="vertical" class="groove" style="width: 3px"/>
<vbox>
@ -457,9 +482,10 @@
oninput="ChangeValueOnInput(this, 'border-top-width', 'borderPreview');
IfFourSidesSameStyle('border', 'width', null,
'allFourBordersSame', 'borderPreview', this);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'border-top-width', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'border-top-width', null, false);"/>
</menulist>
<spinbuttons onup="Spinbutton(1, 'topBorderWidthInput');"
ondown="Spinbutton(-1, 'topBorderWidthInput');"/>
</hbox>
<spacer/>
@ -523,7 +549,7 @@
style="width: 8em"
id="leftBorderWidthInput"
oninput="ChangeValueOnInput(this, 'border-left-width', 'borderPreview');">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'border-left-width', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'border-left-width', null, false);"/>
</menulist>
<spinbuttons onup="Spinbutton(1, 'leftBorderWidthInput');"
ondown="Spinbutton(-1, 'leftBorderWidthInput');"/>
@ -587,7 +613,7 @@
style="width: 8em"
id="rightBorderWidthInput"
oninput="ChangeValueOnInput(this, 'border-right-width', 'borderPreview');">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'border-right-width', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'border-right-width', null, false);"/>
</menulist>
<spinbuttons onup="Spinbutton(1, 'rightBorderWidthInput');"
ondown="Spinbutton(-1, 'rightBorderWidthInput');"/>
@ -651,7 +677,7 @@
style="width: 8em"
id="bottomBorderWidthInput"
oninput="ChangeValueOnInput(this, 'border-bottom-width', 'borderPreview');">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'border-bottom-width', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'border-bottom-width', null, false);"/>
</menulist>
<spinbuttons onup="Spinbutton(1, 'bottomBorderWidthInput');"
ondown="Spinbutton(-1, 'bottomBorderWidthInput');"/>
@ -877,18 +903,23 @@
<menulist editable="true" style="width: 10em"
id="widthEditableMenulist"
oninput="ChangeValueOnInput(this, 'width', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'width', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'width', null, true);"/>
</menulist>
<spinbuttons onup="Spinbutton(1, 'widthEditableMenulist');"
ondown="Spinbutton(-1, 'widthEditableMenulist');"/>
</hbox>
<spacer/>
<label value="&height.label;"/>
<hbox align="center">
<menulist editable="true" style="width: 10em"
id="heightEditableMenulist"
oninput="ChangeValueOnInput(this, 'height', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'height', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'height', null, true);"/>
</menulist>
<spinbuttons onup="Spinbutton(1, 'heightEditableMenulist');"
ondown="Spinbutton(-1, 'heightEditableMenulist');"/>
@ -900,7 +931,7 @@
<menulist editable="true" style="width: 10em"
id="minwidthEditableMenulist"
oninput="ChangeValueOnInput(this, 'min-width', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'min-width', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'min-width', null, true);"/>
</menulist>
<spinbuttons onup="Spinbutton(1, 'minwidthEditableMenulist');"
ondown="Spinbutton(-1, 'minwidthEditableMenulist');"/>
@ -911,7 +942,7 @@
<menulist editable="true" style="width: 10em"
id="minheightEditableMenulist"
oninput="ChangeValueOnInput(this, 'min-height', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'min-height', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'min-height', null, true);"/>
</menulist>
<spinbuttons onup="Spinbutton(1, 'minheightEditableMenulist');"
ondown="Spinbutton(-1, 'minheightEditableMenulist');"/>
@ -923,7 +954,7 @@
<menulist editable="true" style="width: 10em"
id="maxwidthEditableMenulist"
oninput="ChangeValueOnInput(this, 'max-width', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'max-width', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'max-width', null, true);"/>
</menulist>
<spinbuttons onup="Spinbutton(1, 'maxwidthEditableMenulist');"
ondown="Spinbutton(-1, 'maxwidthEditableMenulist');"/>
@ -934,7 +965,7 @@
<menulist editable="true" style="width: 10em"
id="maxheightEditableMenulist"
oninput="ChangeValueOnInput(this, 'max-height', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'max-height', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'max-height', null, true);"/>
</menulist>
<spinbuttons onup="Spinbutton(1, 'maxheightEditableMenulist');"
ondown="Spinbutton(-1, 'maxheightEditableMenulist');"/>
@ -959,19 +990,19 @@
<menulist editable="true" style="width: 8em"
id="margintopEditableMenulist"
oninput="ChangeValueOnInput(this, 'margin-top', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'margin-top', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'margin-top', null, true);"/>
</menulist>
<spacer flex="1"/>
<menulist editable="true" style="width: 8em"
id="paddingtopEditableMenulist"
oninput="ChangeValueOnInput(this, 'padding-top', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'padding-top', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'padding-top', null, true);"/>
</menulist>
<spacer flex="1"/>
<menulist editable="true" style="width: 8em"
id="topEditableMenulist"
oninput="ChangeValueOnInput(this, 'top', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'top', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'top', null, true);"/>
</menulist>
</row>
<row align="center">
@ -979,19 +1010,19 @@
<menulist editable="true" style="width: 8em"
id="marginleftEditableMenulist"
oninput="ChangeValueOnInput(this, 'margin-left', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'margin-left', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'margin-left', null, true);"/>
</menulist>
<spacer flex="1"/>
<menulist editable="true" style="width: 8em"
id="paddingleftEditableMenulist"
oninput="ChangeValueOnInput(this, 'padding-left', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'padding-left', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'padding-left', null, true);"/>
</menulist>
<spacer flex="1"/>
<menulist editable="true" style="width: 8em"
id="leftEditableMenulist"
oninput="ChangeValueOnInput(this, 'left', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'left', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'left', null, true);"/>
</menulist>
</row>
<row align="center">
@ -999,19 +1030,19 @@
<menulist editable="true" style="width: 8em"
id="marginrightEditableMenulist"
oninput="ChangeValueOnInput(this, 'margin-right', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'margin-right', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'margin-right', null, true);"/>
</menulist>
<spacer flex="1"/>
<menulist editable="true" style="width: 8em"
id="paddingrightEditableMenulist"
oninput="ChangeValueOnInput(this, 'padding-right', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'padding-right', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'padding-right', null, true);"/>
</menulist>
<spacer flex="1"/>
<menulist editable="true" style="width: 8em"
id="rightEditableMenulist"
oninput="ChangeValueOnInput(this, 'right', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'right', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'right', null, true);"/>
</menulist>
</row>
<row align="center">
@ -1019,19 +1050,19 @@
<menulist editable="true" style="width: 8em"
id="marginbottomEditableMenulist"
oninput="ChangeValueOnInput(this, 'margin-bottom', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'margin-bottom', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'margin-bottom', null, true);"/>
</menulist>
<spacer flex="1"/>
<menulist editable="true" style="width: 8em"
id="paddingbottomEditableMenulist"
oninput="ChangeValueOnInput(this, 'padding-bottom', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'padding-bottom', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'padding-bottom', null, true);"/>
</menulist>
<spacer flex="1"/>
<menulist editable="true" style="width: 8em"
id="bottomEditableMenulist"
oninput="ChangeValueOnInput(this, 'bottom', null);">
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'bottom', null);"/>
<menupopup onpopupshowing="InitLengthUnitMenuPopup(this, 'bottom', null, true);"/>
</menulist>
</row>
</rows>

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

@ -65,6 +65,8 @@
<!ENTITY unspecifiedValue.label "unspecified">
<!ENTITY predefFontFamilyRadio.label "predefined:">
<!ENTITY fontSize.label "Font size:">
<!ENTITY lineHeight.label "Line height:">
<!ENTITY normalLineHeight.label "normal">
<!ENTITY color.label "Color:">
<!ENTITY fontWeight.label "Font weight:">
<!ENTITY normalValue.label "Normal">