Add Test Selection and Test Document to Debug menu

This commit is contained in:
sfraser%netscape.com 1999-04-15 20:14:00 +00:00
Родитель 194e158179
Коммит 3b7c4a96b4
2 изменённых файлов: 51 добавлений и 0 удалений

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

@ -77,6 +77,9 @@
<menuitem name="Output HTML" onclick="EditorGetHTML()"/>
<separator />
<menuitem name="Insert Text" onclick="EditorInsertText()"/>
<separator />
<menuitem name="Test Selection" onclick="EditorTestSelection()"/>
<menuitem name="Test Document" onclick="EditorTestDocument()"/>
</menu>
<menu name="Help">
<menuitem name=".About" onclick=""/>

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

@ -207,6 +207,54 @@
}
function EditorTestSelection()
{
appCore = XPAppCoresManager.Find(editorName);
if (appCore != null)
{
dump("Testing selection\n");
var selection = appCore.editorSelection;
if (selection)
{
dump("Got selection\n");
var firstRange = selection.getRangeAt(0);
if (firstRange)
{
dump("Range contains \"");
dump(firstRange.toString() + "\"\n");
}
}
}
else
{
dump("EditorAppCore has not been created!\n");
}
}
function EditorTestDocument()
{
appCore = XPAppCoresManager.Find(editorName);
if (appCore != null)
{
dump("Getting document\n");
var theDoc = appCore.editorDocument;
if (theDoc)
{
dump("Got the doc\n");
dump("Document name:" + theDoc.nodeName + "\n");
dump("Document type:" + theDoc.doctype + "\n");
}
else
{
dump("Failed to get the doc\n");
}
}
else
{
dump("EditorAppCore has not been created!\n");
}
}
/* Status calls */
function onBoldChange()