Removed some simplified english, tag changes and cleared out small nuggets of dead code
This commit is contained in:
@@ -104,7 +104,7 @@ var Editor = (function () {
|
||||
// Creates a MochiKit-style iterator that goes over a series of DOM
|
||||
// nodes. The values it yields are strings, the textual content of
|
||||
// the nodes. It makes sure that all nodes up to and including the
|
||||
// one whose text is being yielded have been 'normalized' to be just
|
||||
// one whose text is being yielded have been 'normalised' to be just
|
||||
// <span> and <br> elements.
|
||||
// See the story.html file for some short remarks about the use of
|
||||
// continuation-passing style in this iterator.
|
||||
@@ -145,7 +145,7 @@ var Editor = (function () {
|
||||
// confused when the cursor is between two BRs.
|
||||
var afterBR = true;
|
||||
|
||||
// Insert a normalized node at the current point. If it is a text
|
||||
// Insert a normalised node at the current point. If it is a text
|
||||
// node, wrap it in a <span>, and give that span a currentText
|
||||
// property -- this is used to cache the nodeValue, because
|
||||
// directly accessing nodeValue is horribly slow on some browsers.
|
||||
@@ -171,7 +171,7 @@ var Editor = (function () {
|
||||
|
||||
// Extract the text and newlines from a DOM node, insert them into
|
||||
// the document, and yield the textual content. Used to replace
|
||||
// non-normalized nodes.
|
||||
// non-normalised nodes.
|
||||
function writeNode(node, c, end) {
|
||||
var toYield = [];
|
||||
forEach(simplifyDOM(node, end), function (part) {
|
||||
@@ -180,7 +180,7 @@ var Editor = (function () {
|
||||
return yield(toYield.join(""), c);
|
||||
}
|
||||
|
||||
// Check whether a node is a normalized <span> element.
|
||||
// Check whether a node is a normalised <span> element.
|
||||
function partNode(node) {
|
||||
if (node.isPart && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
|
||||
node.currentText = node.firstChild.nodeValue;
|
||||
@@ -190,8 +190,8 @@ var Editor = (function () {
|
||||
}
|
||||
|
||||
// Handle a node. Add its successor to the continuation if there
|
||||
// is one, find out whether the node is normalized. If it is,
|
||||
// yield its content, otherwise, normalize it (writeNode will take
|
||||
// is one, find out whether the node is normalised. If it is,
|
||||
// yield its content, otherwise, normalise it (writeNode will take
|
||||
// care of yielding).
|
||||
function scanNode(node, c) {
|
||||
if (node.nextSibling)
|
||||
@@ -1188,7 +1188,7 @@ var Editor = (function () {
|
||||
},
|
||||
|
||||
// The function that does the actual highlighting/colouring (with
|
||||
// help from the parser and the DOM normalizer). Its interface is
|
||||
// help from the parser and the DOM normaliser). Its interface is
|
||||
// rather overcomplicated, because it is used in different
|
||||
// situations: ensuring that a certain line is highlighted, or
|
||||
// highlighting up to X milliseconds starting from a certain
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Parse function for JavaScript. Makes use of the tokenizer from
|
||||
* tokenizejavascript.js. Note that your parsers do not have to be
|
||||
* this complicated -- if you don't want to recognize local variables,
|
||||
* this complicated -- if you don't want to recognise local variables,
|
||||
* in many languages it is enough to just look for braces, semicolons,
|
||||
* parentheses, etc, and know when you are inside a string or comment.
|
||||
*
|
||||
@@ -297,7 +297,7 @@ var JSParser = Editor.Parser = (function () {
|
||||
if (atomicTypes.hasOwnProperty(type)) cont(expect(":"), expression);
|
||||
}
|
||||
|
||||
// Parses a comma-separated list of the things that are recognized
|
||||
// Parses a comma-separated list of the things that are recognised
|
||||
// by the 'what' argument.
|
||||
function commasep(what, end) {
|
||||
function proceed(type) {
|
||||
|
||||
@@ -302,7 +302,7 @@ var select = {};
|
||||
}
|
||||
}
|
||||
|
||||
// Used to normalize the effect of the enter key, since browsers
|
||||
// Used to normalise the effect of the enter key, since browsers
|
||||
// do widely different things when pressing enter in designMode.
|
||||
select.insertNewlineAtCursor = function (window) {
|
||||
insertAtCursor(window, "<br>");
|
||||
@@ -396,7 +396,7 @@ var select = {};
|
||||
// We want the nodes right at the cursor, not one of their
|
||||
// ancestors with a suitable offset. This goes down the DOM tree
|
||||
// until a 'leaf' is reached (or is it *up* the DOM tree?).
|
||||
function normalize(point) {
|
||||
function normalise(point) {
|
||||
while (point.node.nodeType != 3 && !isBR(point.node)) {
|
||||
var newNode = point.node.childNodes[point.offset] || point.node.nextSibling;
|
||||
point.offset = 0;
|
||||
@@ -410,8 +410,8 @@ var select = {};
|
||||
}
|
||||
}
|
||||
|
||||
normalize(currentSelection.start);
|
||||
normalize(currentSelection.end);
|
||||
normalise(currentSelection.start);
|
||||
normalise(currentSelection.end);
|
||||
};
|
||||
|
||||
select.selectMarked = function () {
|
||||
|
||||
@@ -91,7 +91,7 @@ var matching = {
|
||||
};
|
||||
|
||||
// Standardize a few unportable event properties.
|
||||
function normalizeEvent(event) {
|
||||
function normaliseEvent(event) {
|
||||
if (!event.stopPropagation) {
|
||||
event.stopPropagation = function () {
|
||||
this.cancelBubble = true;
|
||||
@@ -117,7 +117,7 @@ function normalizeEvent(event) {
|
||||
// Portably register event handlers.
|
||||
function addEventHandler(node, type, handler, removeFunc) {
|
||||
function wrapHandler(event) {
|
||||
handler(normalizeEvent(event || window.event));
|
||||
handler(normaliseEvent(event || window.event));
|
||||
}
|
||||
|
||||
if (typeof node.addEventListener == "function") {
|
||||
|
||||
Reference in New Issue
Block a user