mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
cleanup some code
This commit is contained in:
parent
e566494a87
commit
cb2048f163
14 changed files with 32 additions and 117 deletions
23
vendors/knockout/src/virtualElements.js
vendored
23
vendors/knockout/src/virtualElements.js
vendored
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
var startCommentRegex = /^\s*ko(?:\s+([\s\S]+))?\s*$/;
|
||||
var endCommentRegex = /^\s*\/ko\s*$/;
|
||||
var htmlTagsWithOptionallyClosingChildren = { 'ul': true, 'ol': true };
|
||||
|
||||
function isStartComment(node) {
|
||||
return (node.nodeType == 8) && startCommentRegex.test(node.nodeValue);
|
||||
|
|
@ -57,28 +56,6 @@
|
|||
return null; // Must have no matching end comment, and allowUnbalanced is true
|
||||
}
|
||||
|
||||
function getUnbalancedChildTags(node) {
|
||||
// e.g., from <div>OK</div><!-- ko blah --><span>Another</span>, returns: <!-- ko blah --><span>Another</span>
|
||||
// from <div>OK</div><!-- /ko --><!-- /ko -->, returns: <!-- /ko --><!-- /ko -->
|
||||
var childNode = node.firstChild, captureRemaining = null;
|
||||
if (childNode) {
|
||||
do {
|
||||
if (captureRemaining) // We already hit an unbalanced node and are now just scooping up all subsequent nodes
|
||||
captureRemaining.push(childNode);
|
||||
else if (isStartComment(childNode)) {
|
||||
var matchingEndComment = getMatchingEndComment(childNode, /* allowUnbalanced: */ true);
|
||||
if (matchingEndComment) // It's a balanced tag, so skip immediately to the end of this virtual set
|
||||
childNode = matchingEndComment;
|
||||
else
|
||||
captureRemaining = [childNode]; // It's unbalanced, so start capturing from this point
|
||||
} else if (isEndComment(childNode)) {
|
||||
captureRemaining = [childNode]; // It's unbalanced (if it wasn't, we'd have skipped over it already), so start capturing
|
||||
}
|
||||
} while (childNode = childNode.nextSibling);
|
||||
}
|
||||
return captureRemaining;
|
||||
}
|
||||
|
||||
ko.virtualElements = {
|
||||
allowedBindings: {},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue