Bug 54802 Add clipboard buttons for Composer r=brade sr=alecf

This commit is contained in:
neil%parkwaycc.co.uk 2003-03-14 15:23:53 +00:00
Родитель fbb7418d14
Коммит da09ae6a42
8 изменённых файлов: 258 добавлений и 12 удалений

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

@ -70,12 +70,23 @@ pref("editor.toolbars.showbutton.cut", false);
pref("editor.toolbars.showbutton.copy", false);
pref("editor.toolbars.showbutton.paste", false);
pref("editor.toolbars.showbutton.print", true);
pref("editor.toolbars.showbutton.find", false);
pref("editor.toolbars.showbutton.image", true);
pref("editor.toolbars.showbutton.hline", false);
pref("editor.toolbars.showbutton.table", true);
pref("editor.toolbars.showbutton.link", true);
pref("editor.toolbars.showbutton.namedAnchor", false);
pref("editor.toolbars.showbutton.bold", true);
pref("editor.toolbars.showbutton.italic", true);
pref("editor.toolbars.showbutton.underline", true);
pref("editor.toolbars.showbutton.DecreaseFontSize", true);
pref("editor.toolbars.showbutton.IncreaseFontSize", true);
pref("editor.toolbars.showbutton.ul", true);
pref("editor.toolbars.showbutton.ol", true);
pref("editor.toolbars.showbutton.outdent", true);
pref("editor.toolbars.showbutton.indent", true);
pref("editor.auto_save", false);
pref("editor.auto_save_delay", 10); // minutes
pref("editor.use_html_editor", 0);

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

@ -91,18 +91,36 @@ const nsIFilePicker = Components.interfaces.nsIFilePicker;
const kEditorToolbarPrefs = "editor.toolbars.showbutton.";
function ShowHideToolbarButton(prefName) {
var id = prefName.substr(kEditorToolbarPrefs.length) + "Button";
var button = document.getElementById(id);
if (button)
button.hidden = !gPrefs.getBoolPref(prefName);
function ShowHideToolbarSeparators(toolbar) {
var childNodes = toolbar.childNodes;
var separator = null;
var hideSeparator = true;
for (var i = 0; childNodes[i].localName != "spacer"; i++) {
if (childNodes[i].localName == "toolbarseparator") {
if (separator)
separator.hidden = true;
separator = childNodes[i];
} else if (!childNodes[i].hidden) {
if (separator)
separator.hidden = hideSeparator;
separator = null;
hideSeparator = false;
}
}
}
function ShowHideToolbarButtons()
{
var array = GetPrefs().getChildList(kEditorToolbarPrefs, {});
for (var i in array)
ShowHideToolbarButton(array[i]);
for (var i in array) {
var prefName = array[i];
var id = prefName.substr(kEditorToolbarPrefs.length) + "Button";
var button = document.getElementById(id);
if (button)
button.hidden = !gPrefs.getBoolPref(prefName);
}
ShowHideToolbarSeparators(document.getElementById("EditToolbar"));
ShowHideToolbarSeparators(document.getElementById("FormatToolbar"));
}
function AddToolbarPrefListener()
@ -134,7 +152,12 @@ const gEditorToolbarPrefListener =
if (topic != "nsPref:changed")
return;
ShowHideToolbarButton(prefName);
var id = prefName.substr(kEditorToolbarPrefs.length) + "Button";
var button = document.getElementById(id);
if (button) {
button.hidden = !gPrefs.getBoolPref(prefName);
ShowHideToolbarSeparators(button.parentNode);
}
}
};

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

@ -180,14 +180,15 @@
<toolbarbutton id="cutButton"/>
<toolbarbutton id="copyButton"/>
<toolbarbutton id="pasteButton"/>
<toolbarbutton id="printButton" />
<toolbarbutton id="spellingButton"/>
<toolbarbutton id="printButton"/>
<toolbarbutton id="findButton"/>
<toolbarseparator class="toolbarseparator-primary"/>
<toolbarbutton id="imageButton"/>
<toolbarbutton id="tableButton"/>
<toolbarbutton id="linkButton"/>
<toolbarbutton id="namedAnchorButton"/>
<toolbarbutton id="imageButton"/>
<toolbarbutton id="hlineButton"/>
<toolbarbutton id="tableButton"/>
<toolbarbutton id="spellingButton"/>
<spacer flex="1"/>
<hbox id="throbber-box" align="center">
<button id="navigator-throbber" oncommand="goClickThrobber('editor.throbber.url')" tooltiptext="&throbber.tooltip;">

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

@ -51,6 +51,11 @@
</treerow>
</treeitem>
-->
<treeitem>
<treerow>
<treecell url="chrome://editor/content/pref-toolbars.xul" label="Toolbars"/>
</treerow>
</treeitem>
</treechildren>
</treeitem>
</treechildren>

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

@ -0,0 +1,126 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 Editor Toolbar Preferences.
-
- The Initial Developer of the Original Code is
- Neil Rashbrook.
- Portions created by the Initial Developer are Copyright (C) 2003
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Neil Rashbrook <neil@parkwaycc.co.uk>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE page SYSTEM "chrome://editor/locale/pref-toolbars.dtd">
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://editor/content/pref-toolbars.xul');"
headertitle="&header.title;">
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = [
"showNew", "showOpen", "showSave", "showPublish", "showPreview", "showSmaller", "showLarger", "showBold",
"showCut", "showCopy", "showPaste", "showPrint", "showFind", "showBullets", "showNumbers", "showItalic",
"showImage", "showHline", "showTable", "showLink", "showAnchor", "showOutdent", "showIndent", "showUnderline"];
]]>
</script>
<groupbox orient="horizontal">
<caption label="&composition.caption;"/>
<vbox flex="1">
<checkbox label="&new.label;" id="showNew"
prefstring="editor.toolbars.showbutton.new"/>
<checkbox label="&open.label;" id="showOpen"
prefstring="editor.toolbars.showbutton.open"/>
<checkbox label="&save.label;" id="showSave"
prefstring="editor.toolbars.showbutton.save"/>
<checkbox label="&publish.label;" id="showPublish"
prefstring="editor.toolbars.showbutton.publish"/>
<checkbox label="&preview.label;" id="showPreview"
prefstring="editor.toolbars.showbutton.preview"/>
</vbox>
<vbox flex="1">
<checkbox label="&cut.label;" id="showCut"
disabled="true"
prefstring="editor.toolbars.showbutton.cut"/>
<checkbox label="&copy.label;" id="showCopy"
disabled="true"
prefstring="editor.toolbars.showbutton.copy"/>
<checkbox label="&paste.label;" id="showPaste"
disabled="true"
prefstring="editor.toolbars.showbutton.paste"/>
<checkbox label="&print.label;" id="showPrint"
prefstring="editor.toolbars.showbutton.print"/>
<checkbox label="&find.label;" id="showFind"
disabled="true"
prefstring="editor.toolbars.showbutton.find"/>
</vbox>
<vbox flex="1">
<checkbox label="&image.label;" id="showImage"
prefstring="editor.toolbars.showbutton.image"/>
<checkbox label="&hline.label;" id="showHline"
prefstring="editor.toolbars.showbutton.hline"/>
<checkbox label="&table.label;" id="showTable"
prefstring="editor.toolbars.showbutton.table"/>
<checkbox label="&link.label;" id="showLink"
prefstring="editor.toolbars.showbutton.link"/>
<checkbox label="&anchor.label;" id="showAnchor"
prefstring="editor.toolbars.showbutton.namedAnchor"/>
</vbox>
</groupbox>
<groupbox orient="horizontal">
<caption label="&formatting.caption;"/>
<vbox flex="1">
<checkbox label="&smaller.label;" id="showSmaller"
prefstring="editor.toolbars.showbutton.DecreaseFontSize"/>
<checkbox label="&larger.label;" id="showLarger"
prefstring="editor.toolbars.showbutton.IncreaseFontSize"/>
<checkbox label="&bold.label;" id="showBold"
prefstring="editor.toolbars.showbutton.bold"/>
</vbox>
<vbox flex="1">
<checkbox label="&bullets.label;" id="showBullets"
prefstring="editor.toolbars.showbutton.ul"/>
<checkbox label="&numbers.label;" id="showNumbers"
prefstring="editor.toolbars.showbutton.ol"/>
<checkbox label="&italic.label;" id="showItalic"
prefstring="editor.toolbars.showbutton.italic"/>
</vbox>
<vbox flex="1">
<checkbox label="&outdent.label;" id="showOutdent"
prefstring="editor.toolbars.showbutton.outdent"/>
<checkbox label="&indent.label;" id="showIndent"
prefstring="editor.toolbars.showbutton.indent"/>
<checkbox label="&underline.label;" id="showUnderline"
prefstring="editor.toolbars.showbutton.underline"/>
</vbox>
</groupbox>
</page>

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

@ -0,0 +1,67 @@
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 Editor Toolbar Preferences.
-
- The Initial Developer of the Original Code is
- Neil Rashbrook.
- Portions created by the Initial Developer are Copyright (C) 2003
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Neil Rashbrook <neil@parkwaycc.co.uk>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!ENTITY header.title "Toolbars">
<!ENTITY composition.caption "Show these buttons in the Composition Toolbar:">
<!ENTITY new.label "New">
<!ENTITY open.label "Open">
<!ENTITY save.label "Save">
<!ENTITY publish.label "Publish">
<!ENTITY preview.label "Preview">
<!ENTITY cut.label "Cut">
<!ENTITY copy.label "Copy">
<!ENTITY paste.label "Paste">
<!ENTITY print.label "Print">
<!ENTITY find.label "Find">
<!ENTITY image.label "Image">
<!ENTITY hline.label "H. Line">
<!ENTITY table.label "Table">
<!ENTITY link.label "Link">
<!ENTITY anchor.label "Anchor">
<!ENTITY formatting.caption "Show these buttons in the Formatting Toolbar:">
<!ENTITY smaller.label "Smaller">
<!ENTITY larger.label "Larger">
<!ENTITY bold.label "Bold">
<!ENTITY bullets.label "Bullets">
<!ENTITY numbers.label "Numbers">
<!ENTITY italic.label "Italic">
<!ENTITY outdent.label "Outdent">
<!ENTITY indent.label "Indent">
<!ENTITY underline.label "Underline">

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

@ -20,6 +20,7 @@ comm.jar:
content/editor/editorOverlay.xul (composer/content/editorOverlay.xul)
content/editor/editorOverlay.js (composer/content/editorOverlay.js)
content/editor/composerOverlay.xul (composer/content/composerOverlay.xul)
content/editor/pref-toolbars.xul (composer/content/pref-toolbars.xul)
content/editor/pref-editing.xul (composer/content/pref-editing.xul)
content/editor/pref-composer.js (composer/content/pref-composer.js)
content/editor/pref-composer.xul (composer/content/pref-composer.xul)
@ -231,6 +232,7 @@ en-US.jar:
locale/en-US/editor/editorSmileyOverlay.dtd (composer/locale/en-US/editorSmileyOverlay.dtd)
locale/en-US/editor/editorPrefsOverlay.dtd (composer/locale/en-US/editorPrefsOverlay.dtd)
locale/en-US/editor/editorNavigatorOverlay.dtd (composer/locale/en-US/editorNavigatorOverlay.dtd)
locale/en-US/editor/pref-toolbars.dtd (composer/locale/en-US/pref-toolbars.dtd)
locale/en-US/editor/pref-editing.dtd (composer/locale/en-US/pref-editing.dtd)
locale/en-US/editor/pref-composer.dtd (composer/locale/en-US/pref-composer.dtd)
locale/en-US/editor/pref-publish.dtd (composer/locale/en-US/pref-publish.dtd)

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

@ -70,12 +70,23 @@ pref("editor.toolbars.showbutton.cut", false);
pref("editor.toolbars.showbutton.copy", false);
pref("editor.toolbars.showbutton.paste", false);
pref("editor.toolbars.showbutton.print", true);
pref("editor.toolbars.showbutton.find", false);
pref("editor.toolbars.showbutton.image", true);
pref("editor.toolbars.showbutton.hline", false);
pref("editor.toolbars.showbutton.table", true);
pref("editor.toolbars.showbutton.link", true);
pref("editor.toolbars.showbutton.namedAnchor", false);
pref("editor.toolbars.showbutton.bold", true);
pref("editor.toolbars.showbutton.italic", true);
pref("editor.toolbars.showbutton.underline", true);
pref("editor.toolbars.showbutton.DecreaseFontSize", true);
pref("editor.toolbars.showbutton.IncreaseFontSize", true);
pref("editor.toolbars.showbutton.ul", true);
pref("editor.toolbars.showbutton.ol", true);
pref("editor.toolbars.showbutton.outdent", true);
pref("editor.toolbars.showbutton.indent", true);
pref("editor.auto_save", false);
pref("editor.auto_save_delay", 10); // minutes
pref("editor.use_html_editor", 0);