зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
d4751bbd20
Коммит
ba93f893eb
|
@ -620,29 +620,7 @@ nsresult nsEditorShell::GetDocumentEventReceiver(nsIDOMEventReceiver **aEventRec
|
||||||
nsresult rv = editor->GetRootElement(getter_AddRefs(rootElement));
|
nsresult rv = editor->GetRootElement(getter_AddRefs(rootElement));
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMEventReceiver> erP;
|
nsCOMPtr<nsIDOMEventReceiver> erP;
|
||||||
|
rv = rootElement->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(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
|
|
||||||
|
|
||||||
if (erP)
|
if (erP)
|
||||||
{
|
{
|
||||||
|
|
|
@ -620,29 +620,7 @@ nsresult nsEditorShell::GetDocumentEventReceiver(nsIDOMEventReceiver **aEventRec
|
||||||
nsresult rv = editor->GetRootElement(getter_AddRefs(rootElement));
|
nsresult rv = editor->GetRootElement(getter_AddRefs(rootElement));
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMEventReceiver> erP;
|
nsCOMPtr<nsIDOMEventReceiver> erP;
|
||||||
|
rv = rootElement->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(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
|
|
||||||
|
|
||||||
if (erP)
|
if (erP)
|
||||||
{
|
{
|
||||||
|
|
|
@ -190,11 +190,6 @@ function _EditorNotImplemented()
|
||||||
dump("Function not implemented\n");
|
dump("Function not implemented\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
function _EditorObsolete()
|
|
||||||
{
|
|
||||||
dump("Function is obsolete\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
function EditorShutdown()
|
function EditorShutdown()
|
||||||
{
|
{
|
||||||
dump("In EditorShutdown..\n");
|
dump("In EditorShutdown..\n");
|
||||||
|
@ -336,16 +331,6 @@ function FindAndSelectEditorWindowWithURL(urlToMatch)
|
||||||
// --------------------------- File menu ---------------------------
|
// --------------------------- File menu ---------------------------
|
||||||
|
|
||||||
|
|
||||||
function EditorOpen()
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
function EditorOpenRemote()
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
// used by openLocation. see openLocation.js for additional notes.
|
// used by openLocation. see openLocation.js for additional notes.
|
||||||
function delayedOpenWindow(chrome, flags, url)
|
function delayedOpenWindow(chrome, flags, url)
|
||||||
{
|
{
|
||||||
|
@ -371,36 +356,7 @@ function EditorSaveDocument(doSaveAs, doSaveCopy)
|
||||||
editorShell.saveDocument(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()
|
function EditorClose()
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for changes to document and allow saving before closing
|
// 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)
|
// This is hooked up to the OS's window close widget (e.g., "X" for Windows)
|
||||||
function EditorCanClose()
|
function EditorCanClose()
|
||||||
|
@ -411,50 +367,6 @@ function EditorCanClose()
|
||||||
|
|
||||||
// --------------------------- Edit menu ---------------------------
|
// --------------------------- 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 ---------------------------
|
// --------------------------- View menu ---------------------------
|
||||||
|
|
||||||
|
@ -662,16 +574,6 @@ function EditorSetFontSize(size)
|
||||||
contentWindow.focus();
|
contentWindow.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function EditorIncreaseFontSize()
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
function EditorDecreaseFontSize()
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
function EditorSelectTextColor(ColorPickerID, ColorWellID)
|
function EditorSelectTextColor(ColorPickerID, ColorWellID)
|
||||||
{
|
{
|
||||||
var color = getColorAndSetColorWell(ColorPickerID, ColorWellID);
|
var color = getColorAndSetColorWell(ColorPickerID, ColorWellID);
|
||||||
|
@ -761,16 +663,6 @@ function EditorApplyStyle(tagName)
|
||||||
contentWindow.focus();
|
contentWindow.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function EditorRemoveStyle(tagName)
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
function EditorToggleStyle(styleName)
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
function EditorRemoveLinks()
|
function EditorRemoveLinks()
|
||||||
{
|
{
|
||||||
editorShell.RemoveTextProperty("href", "");
|
editorShell.RemoveTextProperty("href", "");
|
||||||
|
@ -829,63 +721,8 @@ function EditorObjectProperties()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function EditorListProperties()
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
function EditorPageProperties()
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
function EditorColorProperties()
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
// --------------------------- Dialogs ---------------------------
|
// --------------------------- 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)
|
function EditorAlign(commandID, alignType)
|
||||||
{
|
{
|
||||||
var commandNode = document.getElementById(commandID);
|
var commandNode = document.getElementById(commandID);
|
||||||
|
@ -1051,16 +888,6 @@ function EditorToggleParagraphMarks()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function EditorPreview()
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
function CheckSpelling()
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
function SetBackColorString(xulElementID)
|
function SetBackColorString(xulElementID)
|
||||||
{
|
{
|
||||||
var xulElement = document.getElementById(xulElementID);
|
var xulElement = document.getElementById(xulElementID);
|
||||||
|
@ -1460,12 +1287,6 @@ function EditorSetSelectionFromOffsets(selRanges)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function EditorExit()
|
|
||||||
{
|
|
||||||
return _EditorObsolete();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
function initFontStyleMenu(menuPopup)
|
function initFontStyleMenu(menuPopup)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
editor.xul
|
editor.xul
|
||||||
TextEditorAppShell.xul
|
TextEditorAppShell.xul
|
||||||
EditorCommands.js
|
editor.js
|
||||||
ComposerCommands.js
|
ComposerCommands.js
|
||||||
EditorCommandsDebug.js
|
EditorCommandsDebug.js
|
||||||
EditorCommandsOverlay.xul
|
EditorCommandsOverlay.xul
|
||||||
|
|
|
@ -36,7 +36,7 @@ CHROME_TYPE=content
|
||||||
CHROME_CONTENT = \
|
CHROME_CONTENT = \
|
||||||
manifest.rdf \
|
manifest.rdf \
|
||||||
editor.xul \
|
editor.xul \
|
||||||
EditorCommands.js \
|
editor.js \
|
||||||
ComposerCommands.js \
|
ComposerCommands.js \
|
||||||
EditorCommandsDebug.js \
|
EditorCommandsDebug.js \
|
||||||
EditorCommandsOverlay.xul \
|
EditorCommandsOverlay.xul \
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
persist="screenX screenY width height"
|
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/ComposerCommands.js"/>
|
||||||
<script language="JavaScript" src="chrome://editor/content/EditorCommandsDebug.js"/>
|
<script language="JavaScript" src="chrome://editor/content/EditorCommandsDebug.js"/>
|
||||||
<script language="javascript" src="chrome://global/content/strres.js"/>
|
<script language="javascript" src="chrome://global/content/strres.js"/>
|
||||||
|
|
|
@ -201,8 +201,6 @@ function GetString(id)
|
||||||
return editorShell.GetString(id);
|
return editorShell.GetString(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------- Key Bindings -------------------------
|
|
||||||
|
|
||||||
// ------------------------- Move Selection ------------------------
|
// ------------------------- Move Selection ------------------------
|
||||||
function SelectionBeginningOfLine()
|
function SelectionBeginningOfLine()
|
||||||
{
|
{
|
||||||
|
@ -356,7 +354,6 @@ function EditorSaveDocument(doSaveAs, doSaveCopy)
|
||||||
editorShell.saveDocument(doSaveAs, doSaveCopy);
|
editorShell.saveDocument(doSaveAs, doSaveCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
function EditorClose()
|
|
||||||
// Check for changes to document and allow saving before closing
|
// 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)
|
// This is hooked up to the OS's window close widget (e.g., "X" for Windows)
|
||||||
function EditorCanClose()
|
function EditorCanClose()
|
||||||
|
@ -365,9 +362,6 @@ function EditorCanClose()
|
||||||
return editorShell.CheckAndSaveDocument(GetString("BeforeClosing"));
|
return editorShell.CheckAndSaveDocument(GetString("BeforeClosing"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------- Edit menu ---------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// --------------------------- View menu ---------------------------
|
// --------------------------- View menu ---------------------------
|
||||||
|
|
||||||
function EditorViewSource()
|
function EditorViewSource()
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
persist="screenX screenY width height"
|
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/ComposerCommands.js"/>
|
||||||
<script language="JavaScript" src="chrome://editor/content/EditorCommandsDebug.js"/>
|
<script language="JavaScript" src="chrome://editor/content/EditorCommandsDebug.js"/>
|
||||||
<script language="javascript" src="chrome://global/content/strres.js"/>
|
<script language="javascript" src="chrome://global/content/strres.js"/>
|
||||||
|
|
|
@ -27,14 +27,14 @@ CHROME_TYPE=content
|
||||||
include <$(DEPTH)\config\rules.mak>
|
include <$(DEPTH)\config\rules.mak>
|
||||||
|
|
||||||
install::
|
install::
|
||||||
$(MAKE_INSTALL) manifest.rdf $(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) editor.xul $(DIST)\bin\chrome\editor\content
|
||||||
$(MAKE_INSTALL) TextEditorAppShell.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) ComposerCommands.js $(DIST)\bin\chrome\editor\content
|
||||||
$(MAKE_INSTALL) EditorCommandsDebug.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) 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) EditorContextMenuOverlay.xul $(DIST)\bin\chrome\editor\content
|
||||||
$(MAKE_INSTALL) EditorInitPage.html $(DIST)\bin\chrome\editor\content
|
$(MAKE_INSTALL) EditorInitPage.html $(DIST)\bin\chrome\editor\content
|
||||||
$(MAKE_INSTALL) EditorInitPagePlain.html $(DIST)\bin\chrome\editor\content
|
$(MAKE_INSTALL) EditorInitPagePlain.html $(DIST)\bin\chrome\editor\content
|
||||||
|
@ -152,7 +152,7 @@ install::
|
||||||
clobber::
|
clobber::
|
||||||
rm -f $(DIST)\bin\chrome\editor\content\editor.xul
|
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\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\ComposerCommands.js
|
||||||
rm -f $(DIST)\bin\chrome\editor\content\EditorCommandsDebug.js
|
rm -f $(DIST)\bin\chrome\editor\content\EditorCommandsDebug.js
|
||||||
rm -f $(DIST)\bin\chrome\editor\content\EditorCommandsOverlay.xul
|
rm -f $(DIST)\bin\chrome\editor\content\EditorCommandsOverlay.xul
|
||||||
|
|
Загрузка…
Ссылка в новой задаче