зеркало из https://github.com/mozilla/gecko-dev.git
Part of Bug 381343 - move the composer debug options to the debugQA extension, remove now redundant files r=KaiRo,sr=Neil
This commit is contained in:
Родитель
2f756de966
Коммит
16e172301d
|
@ -1,569 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** 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 mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 GPL or the LGPL. 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 ***** */
|
||||
|
||||
/* Main Composer window debug menu functions */
|
||||
|
||||
// --------------------------- Output ---------------------------
|
||||
|
||||
|
||||
function EditorGetText()
|
||||
{
|
||||
try {
|
||||
dump("Getting text\n");
|
||||
var outputText = GetCurrentEditor().outputToString("text/plain", kOutputFormatted);
|
||||
dump("<<" + outputText + ">>\n");
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function EditorGetHTML()
|
||||
{
|
||||
try {
|
||||
dump("Getting HTML\n");
|
||||
var outputHTML = GetCurrentEditor().outputToString("text/html", kOutputEncodeW3CEntities);
|
||||
dump(outputHTML + "\n");
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function EditorDumpContent()
|
||||
{
|
||||
dump("============== Content Tree: ================\n");
|
||||
GetCurrentEditor().dumpContentTree();
|
||||
}
|
||||
|
||||
function EditorInsertText(textToInsert)
|
||||
{
|
||||
GetCurrentEditor().insertText(textToInsert);
|
||||
}
|
||||
|
||||
function EditorTestSelection()
|
||||
{
|
||||
dump("Testing selection\n");
|
||||
var selection = GetCurrentEditor().selection;
|
||||
if (!selection)
|
||||
{
|
||||
dump("No selection!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
dump("Selection contains:\n");
|
||||
// 3rd param = column to wrap
|
||||
dump(selection.QueryInterface(Components.interfaces.nsISelectionPrivate)
|
||||
.toStringWithFormat("text/plain",
|
||||
kOutputFormatted | kOutputSelectionOnly,
|
||||
0) + "\n");
|
||||
|
||||
var output, i;
|
||||
|
||||
dump("====== Selection as node and offsets==========\n");
|
||||
dump("rangeCount = " + selection.rangeCount + "\n");
|
||||
for (i = 0; i < selection.rangeCount; i++)
|
||||
{
|
||||
var range = selection.getRangeAt(i);
|
||||
if (range)
|
||||
{
|
||||
dump("Range "+i+": StartParent="+range.startContainer.nodeName+", offset="+range.startOffset+"\n");
|
||||
dump("Range "+i+": EndParent="+range.endContainer.nodeName+", offset="+range.endOffset+"\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
var editor = GetCurrentEditor();
|
||||
|
||||
dump("====== Selection as unformatted text ==========\n");
|
||||
output = editor.outputToString("text/plain", kOutputSelectionOnly);
|
||||
dump(output + "\n\n");
|
||||
|
||||
dump("====== Selection as formatted text ============\n");
|
||||
output = editor.outputToString("text/plain", kOutputFormatted | kOutputSelectionOnly);
|
||||
dump(output + "\n\n");
|
||||
|
||||
dump("====== Selection as HTML ======================\n");
|
||||
output = editor.outputToString("text/html", kOutputSelectionOnly);
|
||||
dump(output + "\n\n");
|
||||
|
||||
dump("====== Selection as prettyprinted HTML ========\n");
|
||||
output = editor.outputToString("text/html", kOutputFormatted | kOutputSelectionOnly);
|
||||
dump(output + "\n\n");
|
||||
|
||||
dump("====== Length and status =====================\n");
|
||||
output = "Document is ";
|
||||
if (editor.documentIsEmpty)
|
||||
output += "empty\n";
|
||||
else
|
||||
output += "not empty\n";
|
||||
output += "Text length is " + editor.textLength + " characters";
|
||||
dump(output + "\n\n");
|
||||
}
|
||||
|
||||
function EditorTestTableLayout()
|
||||
{
|
||||
dump("\n\n\n************ Dump Selection Ranges ************\n");
|
||||
var selection = GetCurrentEditor().selection;
|
||||
var i;
|
||||
for (i = 0; i < selection.rangeCount; i++)
|
||||
{
|
||||
var range = selection.getRangeAt(i);
|
||||
if (range)
|
||||
{
|
||||
dump("Range "+i+": StartParent="+range.startParent+", offset="+range.startOffset+"\n");
|
||||
}
|
||||
}
|
||||
dump("\n\n");
|
||||
|
||||
var editor = GetCurrentEditor();
|
||||
var table = editor.getElementOrParentByTagName("table", null);
|
||||
if (!table) {
|
||||
dump("Enclosing Table not found: Place caret in a table cell to do this test\n\n");
|
||||
return;
|
||||
}
|
||||
|
||||
var cell;
|
||||
var startRowIndexObj = { value: null };
|
||||
var startColIndexObj = { value: null };
|
||||
var rowSpanObj = { value: null };
|
||||
var colSpanObj = { value: null };
|
||||
var actualRowSpanObj = { value: null };
|
||||
var actualColSpanObj = { value: null };
|
||||
var isSelectedObj = { value: false };
|
||||
var startRowIndex = 0;
|
||||
var startColIndex = 0;
|
||||
var rowSpan;
|
||||
var colSpan;
|
||||
var actualRowSpan;
|
||||
var actualColSpan;
|
||||
var isSelected;
|
||||
var col = 0;
|
||||
var row = 0;
|
||||
var rowCount = 0;
|
||||
var maxColCount = 0;
|
||||
var doneWithRow = false;
|
||||
var doneWithCol = false;
|
||||
|
||||
dump("\n\n\n************ Starting Table Layout test ************\n");
|
||||
|
||||
// Note: We could also get the number of rows, cols and use for loops,
|
||||
// but this tests using out-of-bounds offsets to detect end of row or column
|
||||
|
||||
while (!doneWithRow) // Iterate through rows
|
||||
{
|
||||
dump("* Data for ROW="+row+":\n");
|
||||
while(!doneWithCol) // Iterate through cells in the row
|
||||
{
|
||||
try {
|
||||
cell = editor.getCellDataAt(table, row, col,
|
||||
startRowIndexObj, startColIndexObj,
|
||||
rowSpanObj, colSpanObj,
|
||||
actualRowSpanObj, actualColSpanObj,
|
||||
isSelectedObj);
|
||||
|
||||
if (cell)
|
||||
{
|
||||
rowSpan = rowSpanObj.value;
|
||||
colSpan = colSpanObj.value;
|
||||
actualRowSpan = actualRowSpanObj.value;
|
||||
actualColSpan = actualColSpanObj.value;
|
||||
isSelected = isSelectedObj.value;
|
||||
|
||||
dump(" Row="+row+", Col="+col+" StartRow="+startRowIndexObj.value+", StartCol="+startColIndexObj.value+"\n");
|
||||
dump(" RowSpan="+rowSpan+", ColSpan="+colSpan+" ActualRowSpan="+actualRowSpan+", ActualColSpan="+actualColSpan);
|
||||
if (isSelected)
|
||||
dump(" Cell is selected\n");
|
||||
else
|
||||
dump(" Cell is NOT selected\n");
|
||||
|
||||
// Save the indexes of a cell that will span across the cellmap grid
|
||||
if (rowSpan > 1)
|
||||
startRowIndex = startRowIndexObj.value;
|
||||
if (colSpan > 1)
|
||||
startColIndex = startColIndexObj.value;
|
||||
|
||||
// Initialize these for efficient spanned-cell search
|
||||
startRowIndexObj.value = startRowIndex;
|
||||
startColIndexObj.value = startColIndex;
|
||||
|
||||
col++;
|
||||
} else {
|
||||
doneWithCol = true;
|
||||
// Get maximum number of cells in any row
|
||||
if (col > maxColCount)
|
||||
maxColCount = col;
|
||||
dump(" End of row found\n\n");
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
dump(" *** GetCellDataAt failed at Row="+row+", Col="+col+" ***\n\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (col == 0) {
|
||||
// Didn't find a cell in the first col of a row,
|
||||
// thus no more rows in table
|
||||
doneWithRow = true;
|
||||
rowCount = row;
|
||||
dump("No more rows in table\n\n");
|
||||
} else {
|
||||
// Setup for next row
|
||||
col = 0;
|
||||
row++;
|
||||
doneWithCol = false;
|
||||
}
|
||||
}
|
||||
dump("Counted during scan: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n");
|
||||
rowCount = editor.getTableRowCount(table);
|
||||
maxColCount = editor.getTableColumnCount(table);
|
||||
dump("From nsITableLayout: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n****** End of Table Layout Test *****\n\n");
|
||||
}
|
||||
|
||||
function EditorShowEmbeddedObjects()
|
||||
{
|
||||
dump("\nEmbedded Objects:\n");
|
||||
try {
|
||||
var objectArray = GetCurrentEditor().getEmbeddedObjects();
|
||||
dump(objectArray.Count() + " embedded objects\n");
|
||||
for (var i=0; i < objectArray.Count(); ++i)
|
||||
dump(objectArray.GetElementAt(i) + "\n");
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
function EditorUnitTests()
|
||||
{
|
||||
dump("Running Unit Tests\n");
|
||||
var numTests = { value:0 };
|
||||
var numTestsFailed = { value:0 };
|
||||
GetCurrentEditor().debugUnitTests(numTests, numTestsFailed);
|
||||
}
|
||||
|
||||
function EditorTestDocument()
|
||||
{
|
||||
dump("Getting document\n");
|
||||
var theDoc = GetCurrentEditor().document;
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------- Logging stuff ---------------------------
|
||||
|
||||
function EditorExecuteScript(theFile)
|
||||
{
|
||||
var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance();
|
||||
inputStream = inputStream.QueryInterface(Components.interfaces.nsIFileInputStream);
|
||||
|
||||
inputStream.init(theFile, 1, 0, false); // open read only
|
||||
|
||||
var scriptableInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance();
|
||||
scriptableInputStream = scriptableInputStream.QueryInterface(Components.interfaces.nsIScriptableInputStream);
|
||||
|
||||
scriptableInputStream.init(inputStream); // open read only
|
||||
|
||||
var buf = { value:null };
|
||||
var tmpBuf = { value:null };
|
||||
var didTruncate = { value:false };
|
||||
var lineNum = 0;
|
||||
var ex;
|
||||
|
||||
/*
|
||||
// Log files can be quite huge, so read in a line
|
||||
// at a time and execute it:
|
||||
|
||||
while (!inputStream.eof())
|
||||
{
|
||||
buf.value = "";
|
||||
didTruncate.value = true;
|
||||
|
||||
// Keep looping until we get a complete line of
|
||||
// text, or we hit the end of file:
|
||||
|
||||
while (didTruncate.value && !inputStream.eof())
|
||||
{
|
||||
didTruncate.value = false;
|
||||
fileSpec.readLine(tmpBuf, 1024, didTruncate);
|
||||
buf.value += tmpBuf.value;
|
||||
|
||||
// XXX Need to null out tmpBuf.value to avoid crashing
|
||||
// XXX in some JavaScript string allocation method.
|
||||
// XXX This is probably leaking the buffer allocated
|
||||
// XXX by the readLine() implementation.
|
||||
|
||||
tmpBuf.value = null;
|
||||
}
|
||||
|
||||
++lineNum;
|
||||
*/
|
||||
{
|
||||
// suck in the entire file
|
||||
var fileSize = scriptableInputStream.available();
|
||||
var fileContents = scriptableInputStream.read(fileSize);
|
||||
|
||||
dump(fileContents);
|
||||
|
||||
try { eval(fileContents); }
|
||||
catch(ex) { dump("Playback ERROR: Line " + lineNum + " " + ex + "\n"); return; }
|
||||
}
|
||||
|
||||
buf.value = null;
|
||||
}
|
||||
|
||||
function EditorGetScriptFileSpec()
|
||||
{
|
||||
var dirServ = Components.classes['@mozilla.org/file/directory_service;1'].createInstance();
|
||||
dirServ = dirServ.QueryInterface(Components.interfaces.nsIProperties);
|
||||
var processDir = dirServ.get("Home", Components.interfaces.nsIFile);
|
||||
processDir.append("journal.js");
|
||||
return processDir;
|
||||
}
|
||||
|
||||
function EditorStartLog()
|
||||
{
|
||||
try {
|
||||
var edlog = GetCurrentEditor().QueryInterface(Components.interfaces.nsIEditorLogging);
|
||||
var fs = EditorGetScriptFileSpec();
|
||||
edlog.startLogging(fs);
|
||||
window.content.focus();
|
||||
|
||||
fs = null;
|
||||
}
|
||||
catch(ex) { dump("Can't start logging!:\n" + ex + "\n"); }
|
||||
}
|
||||
|
||||
function EditorStopLog()
|
||||
{
|
||||
try {
|
||||
var edlog = GetCurrentEditor().QueryInterface(Components.interfaces.nsIEditorLogging);
|
||||
edlog.stopLogging();
|
||||
window.content.focus();
|
||||
}
|
||||
catch(ex) { dump("Can't stop logging!:\n" + ex + "\n"); }
|
||||
}
|
||||
|
||||
function EditorRunLog()
|
||||
{
|
||||
var fs;
|
||||
fs = EditorGetScriptFileSpec();
|
||||
EditorExecuteScript(fs);
|
||||
window.content.focus();
|
||||
}
|
||||
|
||||
// --------------------------- TransactionManager ---------------------------
|
||||
|
||||
|
||||
function DumpUndoStack()
|
||||
{
|
||||
try {
|
||||
var txmgr = GetCurrentEditor().transactionManager;
|
||||
|
||||
if (!txmgr)
|
||||
{
|
||||
dump("**** Editor has no TransactionManager!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
dump("---------------------- BEGIN UNDO STACK DUMP\n");
|
||||
dump("<!-- Bottom of Stack -->\n");
|
||||
PrintTxnList(txmgr.getUndoList(), "");
|
||||
dump("<!-- Top of Stack -->\n");
|
||||
dump("Num Undo Items: " + txmgr.numberOfUndoItems + "\n");
|
||||
dump("---------------------- END UNDO STACK DUMP\n");
|
||||
} catch (e) {
|
||||
dump("ERROR: DumpUndoStack() failed: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
function DumpRedoStack()
|
||||
{
|
||||
try {
|
||||
var txmgr = GetCurrentEditor().transactionManager;
|
||||
|
||||
if (!txmgr)
|
||||
{
|
||||
dump("**** Editor has no TransactionManager!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
dump("---------------------- BEGIN REDO STACK DUMP\n");
|
||||
dump("<!-- Bottom of Stack -->\n");
|
||||
PrintTxnList(txmgr.getRedoList(), "");
|
||||
dump("<!-- Top of Stack -->\n");
|
||||
dump("Num Redo Items: " + txmgr.numberOfRedoItems + "\n");
|
||||
dump("---------------------- END REDO STACK DUMP\n");
|
||||
} catch (e) {
|
||||
dump("ERROR: DumpUndoStack() failed: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
function PrintTxnList(txnList, prefixStr)
|
||||
{
|
||||
var i;
|
||||
|
||||
for (i=0 ; i < txnList.numItems; i++)
|
||||
{
|
||||
var txn = txnList.getItem(i);
|
||||
var desc = "TXMgr Batch";
|
||||
|
||||
if (txn)
|
||||
{
|
||||
try {
|
||||
txn = txn.QueryInterface(Components.interfaces.nsPIEditorTransaction);
|
||||
desc = txn.txnDescription;
|
||||
} catch(e) {
|
||||
desc = "UnknownTxnType";
|
||||
}
|
||||
}
|
||||
dump(prefixStr + "+ " + desc + "\n");
|
||||
PrintTxnList(txnList.getChildListForItem(i), prefixStr + "| ");
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------ 3rd Party Transaction Test ------------------------
|
||||
|
||||
|
||||
function sampleJSTransaction()
|
||||
{
|
||||
this.wrappedJSObject = this;
|
||||
}
|
||||
|
||||
sampleJSTransaction.prototype = {
|
||||
|
||||
isTransient: false,
|
||||
mStrData: "[Sample-JS-Transaction-Content]",
|
||||
mObject: null,
|
||||
mContainer: null,
|
||||
mOffset: null,
|
||||
|
||||
doTransaction: function()
|
||||
{
|
||||
if (this.mContainer.nodeType != Node.TEXT_NODE)
|
||||
{
|
||||
// We're not in a text node, so create one and
|
||||
// we'll just insert it at (mContainer, mOffset).
|
||||
|
||||
this.mObject = this.mContainer.ownerDocument.createTextNode(this.mStrData);
|
||||
}
|
||||
|
||||
this.redoTransaction();
|
||||
},
|
||||
|
||||
undoTransaction: function()
|
||||
{
|
||||
if (!this.mObject)
|
||||
this.mContainer.deleteData(this.mOffset, this.mStrData.length);
|
||||
else
|
||||
this.mContainer.removeChild(this.mObject);
|
||||
},
|
||||
|
||||
redoTransaction: function()
|
||||
{
|
||||
if (!this.mObject)
|
||||
this.mContainer.insertData(this.mOffset, this.mStrData);
|
||||
else
|
||||
this.insert_node_at_point(this.mObject, this.mContainer, this.mOffset);
|
||||
},
|
||||
|
||||
merge: function(aTxn)
|
||||
{
|
||||
// We don't do any merging!
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
QueryInterface: function(aIID, theResult)
|
||||
{
|
||||
if (aIID.equals(Components.interfaces.nsITransaction) ||
|
||||
aIID.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
|
||||
Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return null;
|
||||
},
|
||||
|
||||
insert_node_at_point: function(node, container, offset)
|
||||
{
|
||||
var childList = container.childNodes;
|
||||
|
||||
if (childList.length == 0 || offset >= childList.length)
|
||||
container.appendChild(node);
|
||||
else
|
||||
container.insertBefore(node, childList.item(offset));
|
||||
}
|
||||
}
|
||||
|
||||
function ExecuteJSTransactionViaTxmgr()
|
||||
{
|
||||
try {
|
||||
var editor = GetCurrentEditor();
|
||||
var txmgr = editor.transactionManager;
|
||||
txmgr = txmgr.QueryInterface(Components.interfaces.nsITransactionManager);
|
||||
|
||||
var selection = editor.selection;
|
||||
var range = selection.getRangeAt(0);
|
||||
|
||||
var txn = new sampleJSTransaction();
|
||||
|
||||
txn.mContainer = range.startContainer;
|
||||
txn.mOffset = range.startOffset;
|
||||
|
||||
txmgr.doTransaction(txn);
|
||||
} catch (e) {
|
||||
dump("ExecuteJSTransactionViaTxmgr() failed!");
|
||||
}
|
||||
}
|
||||
|
||||
function ExecuteJSTransactionViaEditor()
|
||||
{
|
||||
try {
|
||||
var editor = GetCurrentEditor();
|
||||
|
||||
var selection = editor.selection;
|
||||
var range = selection.getRangeAt(0);
|
||||
|
||||
var txn = new sampleJSTransaction();
|
||||
|
||||
txn.mContainer = range.startContainer;
|
||||
txn.mOffset = range.startOffset;
|
||||
|
||||
editor.doTransaction(txn);
|
||||
} catch (e) {
|
||||
dump("ExecuteJSTransactionViaEditor() failed!");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,191 +0,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 mozilla.org code.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corporation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
-
|
||||
- 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 ***** -->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Ender HTML Test Page</title>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
|
||||
<style type="text/css">
|
||||
/* Don't set attributes here, or they can't be changed! */
|
||||
p.note:before { content: "Note: "; }
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Here's the deal...</h2>
|
||||
|
||||
<p>This is a good place to add in <b>html</b> to aid in testing features
|
||||
under development. It's also a great place to not use latin.
|
||||
</p>
|
||||
|
||||
<!-- This is a comment;
|
||||
Here is more of the comment.
|
||||
-->
|
||||
|
||||
<p>
|
||||
Here is an acute entity: "á".
|
||||
This sentence has two &nbsp; tags between each word.
|
||||
</p>
|
||||
<hr size="2" width="100%"/>
|
||||
<div>
|
||||
<p>
|
||||
This paragraph is inside a <div>. <a href="http://www.mozilla.org">Here is some
|
||||
rather boring text that is a link.</a> Now is the time for all good men (and women)
|
||||
to come to the mozilla.org party. And bring the quick brown fox and the lazy dog with you.
|
||||
For your editing pleasure, here is some <span style="font-weight:bold;">inline style</span> for you.
|
||||
<a name="test1"></a>A Named Anchor is just before this sentence.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p class="note">
|
||||
"This paragraph has "class=note", so that we can play with styles."
|
||||
For example, we might insert generated content, like "Note: " before this
|
||||
paragraph.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Here is some very run-o-the-mill text in a paragraph tag, for those
|
||||
of you who are into that kind of thing. I think at this point I shall
|
||||
regale you with some of my inestimable poetry, which will be presented
|
||||
in blockquote mode for your reading pleasure. This particular sample
|
||||
was written when I was eleven years old, but is remarkably similar to
|
||||
the writings of my later "hard-livin" years. It's titled "Reruns":
|
||||
</p>
|
||||
|
||||
<blockquote class="poem" type="cite">
|
||||
<h4>Reruns</h4>
|
||||
Reruns are about as much fun,<br>
|
||||
as your dad taking all your mun,<br>
|
||||
and giving it to a nun,<br>
|
||||
as a contribution.
|
||||
</blockquote>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
There are 4 br tags on either side of this sentence.
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
This text has two spaces between every word
|
||||
<u>Underlined text with space at end </u><b> and bold text with a space at front</b>
|
||||
|
||||
<p>A random list of things to do</p>
|
||||
<ul>
|
||||
<li>Status report</li>
|
||||
<li>Fix bugs</li>
|
||||
<li>Call home</li>
|
||||
</ul>
|
||||
|
||||
<pre>
|
||||
Here is some
|
||||
preformatted text.
|
||||
Here is some
|
||||
preformatted text.
|
||||
</pre>
|
||||
|
||||
<ol>
|
||||
<li>list item 1</li>
|
||||
<li>list item 2</li>
|
||||
<li>list item 3</li>
|
||||
</ol>
|
||||
|
||||
<ol class="roman">
|
||||
<li>list item with child paragraphs
|
||||
<p>
|
||||
First child paragraph
|
||||
</p>
|
||||
<p>
|
||||
Second child paragraph
|
||||
</p>
|
||||
<p>
|
||||
Third child paragraph
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
Another list item
|
||||
</li>
|
||||
<li>
|
||||
Something else.
|
||||
</li>
|
||||
<li>
|
||||
Another thing.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
|
||||
<table border="1">
|
||||
<tr><td>cell 1 </td><td>cell 2 </td><td>cell 3 </td></tr>
|
||||
<tr><td>cell 4 </td><td>cell 5 </td><td>cell 6 </td></tr>
|
||||
<tr><td>cell 7 </td><td>cell 8 </td><td>cell 9 </td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table border="1" id="bigtable">
|
||||
<tr><td>big cell 1 </td>
|
||||
<td>
|
||||
<table BORDER>
|
||||
<tr><td>nested cell 1 </td><td>nested cell 2 </td></tr>
|
||||
<tr><td>nested cell 3 </td><td>nested cell 4 </td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>
|
||||
<table BORDER>
|
||||
<tr><td>nested cell 5 </td><td>nested cell 6 </td></tr>
|
||||
<tr><td>nested cell 7 </td><td>nested cell 8 </td></tr>
|
||||
</table>
|
||||
</td><td>big cell 4 </td></tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
Japanese for ya: プロ野球速報
|
||||
</p>
|
||||
<p>
|
||||
One more paragraph for the road. A true Klingon fears not the atrocious
|
||||
editing file format hoisted on us by html. Well, maybe he does, a little.
|
||||
But he hides it well.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,63 +0,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 Mozilla Communicator client code, released
|
||||
- March 31, 1998.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corporation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1998-1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
-
|
||||
- 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 ***** -->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Ender Plain Text Test Page</title>
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
80 char width (for reference only)
|
||||
---------|---------|---------|---------|---------|---------|---------|---------|
|
||||
|
||||
Welcome to the Gecko Plaintext Editor.
|
||||
|
||||
This message has the wrapping set to 72 columns using a style sheet.
|
||||
|
||||
Typed text will wrap to the current wrap setting. You can view or set the wrap settings by typing various characters, as such:
|
||||
- alt-C: print the current wrap column setting.
|
||||
- alt-]: increase the wrap setting by 5
|
||||
- alt-[: decrease the wrap setting by 5
|
||||
- ctrl-\: wrap to window width (wrapcolumn = -1)
|
||||
- alt-\: turn off wrapping (wrapcolumn = 0)
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,173 +0,0 @@
|
|||
<?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 Mozilla Communicator client code, released
|
||||
- March 31, 1998.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corporation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1998-1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Ryan Cassin (rcassin@supernova.org)
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either of 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 GPL or the LGPL. 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://editor/skin/editor.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://editor/skin/textEditor.css" type="text/css"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://editor/skin/editorPrimaryToolbar.css" type="text/css"?>
|
||||
<?xul-overlay href="chrome://editor/content/editorOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://global/content/charsetOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/contentAreaContextOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/sidebar/sidebarOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://editor/locale/editor.dtd">
|
||||
|
||||
<!-- NOTE: If we don't have "title" set, text editor doesn't work! -->
|
||||
<window id="main-window"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="TextEditorOnLoad()"
|
||||
onunload="EditorShutdown()"
|
||||
onclose="return EditorCanClose()"
|
||||
onfocus="EditorOnFocus()"
|
||||
contenttitlesetting="true"
|
||||
title=""
|
||||
titlemodifier="&textEditorWindow.titlemodifier;"
|
||||
titlemenuseparator="&editorWindow.titlemodifiermenuseparator;"
|
||||
windowtype="composer:text"
|
||||
width="640" height="480"
|
||||
screenX="10" screenY="10"
|
||||
persist="screenX screenY width height sizemode"
|
||||
>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://editor/content/editor.js"/>
|
||||
<script type="application/x-javascript" src="chrome://editor/content/ComposerCommands.js"/>
|
||||
<script type="application/x-javascript" src="chrome://editor/content/EditorCommandsDebug.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaDD.js"/>
|
||||
<!--
|
||||
editor.xul has these - do we need them?
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaUtils.js"/>
|
||||
-->
|
||||
|
||||
<commands id="commands">
|
||||
<commandset id="globalEditMenuItems"/>
|
||||
<commandset id="selectEditMenuItems"/>
|
||||
<commandset id="undoEditMenuItems"/>
|
||||
<commandset id="clipboardEditMenuItems"/>
|
||||
<commandset id="commonEditorMenuItems"/>
|
||||
<commandset id="composerEditMenuItems"/>
|
||||
<commandset id="composerSaveMenuItems"/>
|
||||
<commandset id="composerMenuItems"/>
|
||||
</commands>
|
||||
|
||||
<broadcaster id="args" value="chrome://editor/content/EditorInitPagePlain.html"/>
|
||||
<broadcaster id="canPrint"/>
|
||||
|
||||
<!-- Interim hack to transition from nsIXULWindowCallbacks/ShowWindowWithArgs
|
||||
<broadcaster id="dialog.start" ready="false"/>
|
||||
<observes element="dialog.start" attribute="ready" onbroadcast="EditorStartup('text')"/>
|
||||
-->
|
||||
|
||||
<!-- broadcaster nodes are appended here from the overlays -->
|
||||
<broadcasterset id="broadcasterset">
|
||||
<broadcaster id="Editor:Throbber" busy="false"/>
|
||||
</broadcasterset>
|
||||
|
||||
<!-- keys are appended from the overlay -->
|
||||
<keyset id="keyset"/>
|
||||
|
||||
<toolbox id="EditorToolbox">
|
||||
<menubar id="main-menubar" class="chromeclass-menubar">
|
||||
<menu id="fileMenu"/>
|
||||
<menu id="editMenu"/>
|
||||
|
||||
<menu label="&viewMenu.label;" accesskey="&viewmenu.accesskey;">
|
||||
<!-- id pulls in "Show Sidebar" item from sidebarOverlay -->
|
||||
<menupopup id="menu_View_Popup">
|
||||
<menu id="viewToolbar"/>
|
||||
<menuseparator/>
|
||||
<menu id = "composerCharsetMenu" />
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="insertMenuPlainText"/>
|
||||
|
||||
<!-- tasks menu filled from tasksOverlay -->
|
||||
<menu accesskey="t" id="tasksMenu"/>
|
||||
|
||||
<!-- DEBUG only -->
|
||||
<menu id="debugMenu" />
|
||||
<!-- end DEBUG only -->
|
||||
|
||||
<!-- help menu filled from globalOverlay -->
|
||||
<menu accesskey="h" id="menu_Help"/>
|
||||
|
||||
<spacer flex="1"/>
|
||||
</menubar>
|
||||
|
||||
<!-- toolbar filled out from editorOverlay -->
|
||||
<toolbar class="toolbar-primary" id="EditToolbar" persist="collapsed">
|
||||
<toolbarbutton id="newButton"/>
|
||||
<toolbarbutton id="openButton"/>
|
||||
<toolbarbutton id="saveButton"/>
|
||||
<spacer class="separator-small"/>
|
||||
<toolbarbutton id="printButton"/>
|
||||
<toolbarbutton id="spellingButton"/>
|
||||
<spacer flex="1"/>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<hbox id="sidebar-parent" flex="1">
|
||||
<!-- From sidebarOverlay.xul -->
|
||||
<vbox id="sidebar-box" class="chromeclass-extrachrome" hidden="true"/>
|
||||
<splitter id="sidebar-splitter" class="chromeclass-extrachrome" hidden="true"/>
|
||||
<vbox id="appcontent" flex="1">
|
||||
|
||||
<editor editortype="text" type="content-primary" id="content-frame" src="about:blank" flex="1"/>
|
||||
|
||||
<statusbar id="status-bar">
|
||||
<statusbarpanel class="statusbarpanel-iconic" id="offline-status"/>
|
||||
<statusbarpanel class="statusbarpanel-progress">
|
||||
<progressmeter class="progressmeter-statusbar" id="statusbar-icon" mode="normal" value="0">
|
||||
<observes element="Editor:Throbber" attribute="busy"/>
|
||||
</progressmeter>
|
||||
</statusbarpanel>
|
||||
<statusbarpanel id="statusText" label="&statusText.label;" flex="1" crop="right"/>
|
||||
</statusbar>
|
||||
|
||||
</vbox> <!-- appcontent -->
|
||||
</hbox><!-- sidebar-parent -->
|
||||
|
||||
<hbox id="taskbar" class="toolbox-bottom"/>
|
||||
|
||||
</window>
|
Загрузка…
Ссылка в новой задаче