Switch to using 'editor.js' instead of 'EditorCommands.js', Removed obsolete methods in editor.js, Removed unnecessary code in editorshell.

This commit is contained in:
cmanske%netscape.com 2000-05-10 13:56:30 +00:00
Родитель d4751bbd20
Коммит ba93f893eb
9 изменённых файлов: 11 добавлений и 240 удалений

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

@ -620,29 +620,7 @@ nsresult nsEditorShell::GetDocumentEventReceiver(nsIDOMEventReceiver **aEventRec
nsresult rv = editor->GetRootElement(getter_AddRefs(rootElement));
nsCOMPtr<nsIDOMEventReceiver> erP;
//(Copied from nsHTMLEditor::InstallEventListeners)
//now hack to make sure we are not anonymous content if we are
// grabbing the parent of root element for our observer
nsCOMPtr<nsIContent> content = do_QueryInterface(rootElement);
if (content)
{
nsCOMPtr<nsIContent> parent;
if (NS_SUCCEEDED(content->GetParent(*getter_AddRefs(parent))) && parent)
{
PRInt32 index;
if (NS_FAILED(parent->IndexOf(content, index)) || index<0 )
{
rootElement = do_QueryInterface(parent);
rv = rootElement->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(erP));
}
else
rootElement = 0;
}
}
if (!rootElement && domDoc)
rv = domDoc->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(erP));
//end hack
rv = rootElement->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(erP));
if (erP)
{

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

@ -620,29 +620,7 @@ nsresult nsEditorShell::GetDocumentEventReceiver(nsIDOMEventReceiver **aEventRec
nsresult rv = editor->GetRootElement(getter_AddRefs(rootElement));
nsCOMPtr<nsIDOMEventReceiver> erP;
//(Copied from nsHTMLEditor::InstallEventListeners)
//now hack to make sure we are not anonymous content if we are
// grabbing the parent of root element for our observer
nsCOMPtr<nsIContent> content = do_QueryInterface(rootElement);
if (content)
{
nsCOMPtr<nsIContent> parent;
if (NS_SUCCEEDED(content->GetParent(*getter_AddRefs(parent))) && parent)
{
PRInt32 index;
if (NS_FAILED(parent->IndexOf(content, index)) || index<0 )
{
rootElement = do_QueryInterface(parent);
rv = rootElement->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(erP));
}
else
rootElement = 0;
}
}
if (!rootElement && domDoc)
rv = domDoc->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(erP));
//end hack
rv = rootElement->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(erP));
if (erP)
{

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

@ -190,11 +190,6 @@ function _EditorNotImplemented()
dump("Function not implemented\n");
}
function _EditorObsolete()
{
dump("Function is obsolete\n");
}
function EditorShutdown()
{
dump("In EditorShutdown..\n");
@ -336,16 +331,6 @@ function FindAndSelectEditorWindowWithURL(urlToMatch)
// --------------------------- File menu ---------------------------
function EditorOpen()
{
return _EditorObsolete();
}
function EditorOpenRemote()
{
return _EditorObsolete();
}
// used by openLocation. see openLocation.js for additional notes.
function delayedOpenWindow(chrome, flags, url)
{
@ -371,36 +356,7 @@ function EditorSaveDocument(doSaveAs, doSaveCopy)
editorShell.saveDocument(doSaveAs, doSaveCopy);
}
function EditorSave()
{
return _EditorObsolete();
}
function EditorSaveAs()
{
return _EditorObsolete();
}
function EditorPrint()
{
return _EditorObsolete();
}
function EditorPrintSetup()
{
return _EditorObsolete();
}
function EditorPrintPreview()
{
return _EditorObsolete();
}
function EditorClose()
{
return _EditorObsolete();
}
// Check for changes to document and allow saving before closing
// This is hooked up to the OS's window close widget (e.g., "X" for Windows)
function EditorCanClose()
@ -411,50 +367,6 @@ function EditorCanClose()
// --------------------------- Edit menu ---------------------------
function EditorUndo()
{
return _EditorObsolete();
}
function EditorRedo()
{
return _EditorObsolete();
}
function EditorCut()
{
return _EditorObsolete();
}
function EditorCopy()
{
return _EditorObsolete();
}
function EditorPaste()
{
return _EditorObsolete();
}
function EditorPasteAsQuotation()
{
return _EditorObsolete();
}
function EditorSelectAll()
{
return _EditorObsolete();
}
function EditorFind()
{
return _EditorObsolete();
}
function EditorFindNext()
{
return _EditorObsolete();
}
// --------------------------- View menu ---------------------------
@ -662,16 +574,6 @@ function EditorSetFontSize(size)
contentWindow.focus();
}
function EditorIncreaseFontSize()
{
return _EditorObsolete();
}
function EditorDecreaseFontSize()
{
return _EditorObsolete();
}
function EditorSelectTextColor(ColorPickerID, ColorWellID)
{
var color = getColorAndSetColorWell(ColorPickerID, ColorWellID);
@ -761,16 +663,6 @@ function EditorApplyStyle(tagName)
contentWindow.focus();
}
function EditorRemoveStyle(tagName)
{
return _EditorObsolete();
}
function EditorToggleStyle(styleName)
{
return _EditorObsolete();
}
function EditorRemoveLinks()
{
editorShell.RemoveTextProperty("href", "");
@ -829,63 +721,8 @@ function EditorObjectProperties()
}
}
function EditorListProperties()
{
return _EditorObsolete();
}
function EditorPageProperties()
{
return _EditorObsolete();
}
function EditorColorProperties()
{
return _EditorObsolete();
}
// --------------------------- Dialogs ---------------------------
function EditorInsertHTML()
{
return _EditorObsolete();
}
function EditorInsertOrEditLink()
{
return _EditorObsolete();
}
function EditorInsertOrEditImage()
{
return _EditorObsolete();
}
function EditorInsertOrEditHLine()
{
return _EditorObsolete();
}
function EditorInsertChars()
{
return _EditorObsolete();
}
function EditorInsertOrEditNamedAnchor()
{
return _EditorObsolete();
}
function EditorIndent(indent)
{
return _EditorObsolete();
}
function EditorMakeOrChangeList(listType)
{
return _EditorObsolete();
}
function EditorAlign(commandID, alignType)
{
var commandNode = document.getElementById(commandID);
@ -1051,16 +888,6 @@ function EditorToggleParagraphMarks()
}
}
function EditorPreview()
{
return _EditorObsolete();
}
function CheckSpelling()
{
return _EditorObsolete();
}
function SetBackColorString(xulElementID)
{
var xulElement = document.getElementById(xulElementID);
@ -1460,12 +1287,6 @@ function EditorSetSelectionFromOffsets(selRanges)
}
}
function EditorExit()
{
return _EditorObsolete();
}
//--------------------------------------------------------------------
function initFontStyleMenu(menuPopup)
{

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

@ -24,7 +24,7 @@
editor.xul
TextEditorAppShell.xul
EditorCommands.js
editor.js
ComposerCommands.js
EditorCommandsDebug.js
EditorCommandsOverlay.xul

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

@ -36,7 +36,7 @@ CHROME_TYPE=content
CHROME_CONTENT = \
manifest.rdf \
editor.xul \
EditorCommands.js \
editor.js \
ComposerCommands.js \
EditorCommandsDebug.js \
EditorCommandsOverlay.xul \

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

@ -45,7 +45,7 @@
persist="screenX screenY width height"
>
<script language="JavaScript" src="chrome://editor/content/EditorCommands.js"/>
<script language="JavaScript" src="chrome://editor/content/editor.js"/>
<script language="JavaScript" src="chrome://editor/content/ComposerCommands.js"/>
<script language="JavaScript" src="chrome://editor/content/EditorCommandsDebug.js"/>
<script language="javascript" src="chrome://global/content/strres.js"/>

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

@ -201,8 +201,6 @@ function GetString(id)
return editorShell.GetString(id);
}
// -------------------------- Key Bindings -------------------------
// ------------------------- Move Selection ------------------------
function SelectionBeginningOfLine()
{
@ -356,7 +354,6 @@ function EditorSaveDocument(doSaveAs, doSaveCopy)
editorShell.saveDocument(doSaveAs, doSaveCopy);
}
function EditorClose()
// Check for changes to document and allow saving before closing
// This is hooked up to the OS's window close widget (e.g., "X" for Windows)
function EditorCanClose()
@ -365,9 +362,6 @@ function EditorCanClose()
return editorShell.CheckAndSaveDocument(GetString("BeforeClosing"));
}
// --------------------------- Edit menu ---------------------------
// --------------------------- View menu ---------------------------
function EditorViewSource()

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

@ -48,7 +48,7 @@
persist="screenX screenY width height"
>
<script language="JavaScript" src="chrome://editor/content/EditorCommands.js"/>
<script language="JavaScript" src="chrome://editor/content/editor.js"/>
<script language="JavaScript" src="chrome://editor/content/ComposerCommands.js"/>
<script language="JavaScript" src="chrome://editor/content/EditorCommandsDebug.js"/>
<script language="javascript" src="chrome://global/content/strres.js"/>

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

@ -27,14 +27,14 @@ CHROME_TYPE=content
include <$(DEPTH)\config\rules.mak>
install::
$(MAKE_INSTALL) manifest.rdf $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) editor.xul $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) manifest.rdf $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) editor.xul $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) TextEditorAppShell.xul $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) EditorCommands.js $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) editor.js $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) ComposerCommands.js $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) EditorCommandsDebug.js $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) EditorCommandsOverlay.xul $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) EditorContextMenu.js $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) EditorContextMenu.js $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) EditorContextMenuOverlay.xul $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) EditorInitPage.html $(DIST)\bin\chrome\editor\content
$(MAKE_INSTALL) EditorInitPagePlain.html $(DIST)\bin\chrome\editor\content
@ -152,7 +152,7 @@ install::
clobber::
rm -f $(DIST)\bin\chrome\editor\content\editor.xul
rm -f $(DIST)\bin\chrome\editor\content\TextEditorAppShell.xul
rm -f $(DIST)\bin\chrome\editor\content\EditorCommands.js
rm -f $(DIST)\bin\chrome\editor\content\editor.js
rm -f $(DIST)\bin\chrome\editor\content\ComposerCommands.js
rm -f $(DIST)\bin\chrome\editor\content\EditorCommandsDebug.js
rm -f $(DIST)\bin\chrome\editor\content\EditorCommandsOverlay.xul