📄 overview-summary-tinymce_domutils.class.js.html
字号:
<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>
Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
parent.document.title="TinyMCE_DOMUtils.class.js Overview";
}
</script>
</head>
<body bgcolor="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
<tr align="center" valign="top">
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a> </td>
<td bgcolor="#FFFFFF" class="NavBarCell1Rev"> <font class="NavBarFont1Rev"><b>File</b></font> </td>
<td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a> </td>
</tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>
<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
PREV
NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
<a href="index.html" target="_top"><b>FRAMES</b></a>
<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
<script>
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
}
//-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->
<hr>
<center>
<h2>TinyMCE_DOMUtils.class.js</h2>
</center>
<h4>Summary</h4>
<p>
No overview generated for 'TinyMCE_DOMUtils.class.js'<BR/><BR/>
</p>
<hr>
<!-- ========== METHOD SUMMARY =========== -->
<!-- ========== END METHOD SUMMARY =========== -->
<pre class="sourceview"><span class="comment">/**
* $RCSfile: overview-summary-TinyMCE_DOMUtils.class.js.html,v $
* $Revision: 1.13 $
* $Date: 2006/02/13 15:28:43 $
*
* <span class="attrib">@author</span> Moxiecode
* <span class="attrib">@copyright</span> Copyright ?2004-2006, Moxiecode Systems AB, All rights reserved.
*/</span>
<span class="comment">/* The contents of this file will be wrapped in a class later on */</span>
<span class="comment">/**
* Returns a element by a specific attribute and it's value.
*
* <span class="attrib">@param</span> {HTMLElement} n Element to search in.
* <span class="attrib">@param</span> {string} e Element name to search for.
* <span class="attrib">@param</span> {string} a Attribute name to search for.
* <span class="attrib">@param</span> {string} v Attribute value to search for.
* <span class="attrib">@return</span> HTML element that matched the criterias or null on failure.
* <span class="attrib">@type</span> HTMLElement
*/</span>
TinyMCE_Engine.<span class="reserved">prototype</span>.getElementByAttributeValue = <span class="reserved">function</span>(n, e, a, v) {
<span class="reserved">return</span> (n = <span class="reserved">this</span>.getElementsByAttributeValue(n, e, a, v)).length == 0 ? null : n[0];
};
<span class="comment">/**
* Returns a element array by a specific attribute and it's value.
*
* <span class="attrib">@param</span> {HTMLElement} n Element to search in.
* <span class="attrib">@param</span> {string} e Element name to search for.
* <span class="attrib">@param</span> {string} a Attribute name to search for.
* <span class="attrib">@param</span> {string} v Attribute value to search for.
* <span class="attrib">@return</span> HTML element array that matched the criterias or null on failure.
* <span class="attrib">@type</span> Array
*/</span>
TinyMCE_Engine.<span class="reserved">prototype</span>.getElementsByAttributeValue = <span class="reserved">function</span>(n, e, a, v) {
var i, nl = n.getElementsByTagName(e), o = new Array();
<span class="reserved">for</span> (i=0; i<nl.length; i++) {
<span class="reserved">if</span> (tinyMCE.getAttrib(nl[i], a).indexOf(v) != -1)
o[o.length] = nl[i];
}
<span class="reserved">return</span> o;
};
<span class="comment">/**
* Returns true/false if the specified node is a block element or not.
*
* <span class="attrib">@param</span> {HTMLNode} n Node to verify.
* <span class="attrib">@return</span> true/false if the specified node is a block element or not.
* <span class="attrib">@type</span> boolean
*/</span>
TinyMCE_Engine.<span class="reserved">prototype</span>.isBlockElement = <span class="reserved">function</span>(n) {
<span class="reserved">return</span> n != null && n.nodeType == 1 && <span class="reserved">this</span>.blockRegExp.test(n.nodeName);
};
<span class="comment">/**
* Returns the first block element parent of the specified node.
*
* <span class="attrib">@param</span> {HTMLNode} n Node get parent block element for.
* <span class="attrib">@return</span> First block element parent of the specified node or null if it wasn't found.
* <span class="attrib">@type</span> HTMLElement
*/</span>
TinyMCE_Engine.<span class="reserved">prototype</span>.getParentBlockElement = <span class="reserved">function</span>(n) {
<span class="reserved">while</span> (n) {
<span class="reserved">if</span> (<span class="reserved">this</span>.isBlockElement(n))
<span class="reserved">return</span> n;
n = n.parentNode;
}
<span class="reserved">return</span> null;
};
<span class="comment">/**
* Inserts a node after the specific node.
*
* <span class="attrib">@param</span> {HTMLNode} n New node to insert.
* <span class="attrib">@param</span> {HTMLNode} r Reference node to insert after.
*/</span>
TinyMCE_Engine.<span class="reserved">prototype</span>.insertAfter = <span class="reserved">function</span>(n, r){
<span class="reserved">if</span> (r.nextSibling)
r.parentNode.insertBefore(n, r.nextSibling);
<span class="reserved">else</span>
r.parentNode.appendChild(n);
};
<span class="comment">/**
* Sets the innerHTML property of a element, this function also
* fixes a MSIE bug where the first comment is removed.
*
* <span class="attrib">@param</span> {HTMLElement} e Element to insert HTML in.
* <span class="attrib">@param</span> {string} h HTML code to insert into innerHTML.
*/</span>
TinyMCE_Engine.<span class="reserved">prototype</span>.setInnerHTML = <span class="reserved">function</span>(e, h) {
<span class="reserved">if</span> (tinyMCE.isMSIE && !tinyMCE.isOpera) {
e.innerHTML = tinyMCE.uniqueTag + h;
e.firstChild.removeNode(true);
} <span class="reserved">else</span> {
h = <span class="reserved">this</span>.fixGeckoBaseHREFBug(1, e, h);
e.innerHTML = h;
<span class="reserved">this</span>.fixGeckoBaseHREFBug(2, e, h);
}
};
<span class="comment">/**
* Returns the outer HTML of a element, this uses the outerHTML
* property in MSIE and Opera and a workaround for Gecko.
*
* <span class="attrib">@param</span> {HTMLElement} e HTML element to get outerHTML from.
* <span class="attrib">@return</span> HTML content string.
* <span class="attrib">@type</span> string
*/</span>
TinyMCE_Engine.<span class="reserved">prototype</span>.getOuterHTML = <span class="reserved">function</span>(e) {
<span class="reserved">if</span> (tinyMCE.isMSIE)
<span class="reserved">return</span> e.outerHTML;
var d = e.ownerDocument.createElement(<span class="literal">"body"</span>);
d.appendChild(e);
<span class="reserved">return</span> d.innerHTML;
};
<span class="comment">/**
* Sets the outer HTML of a element, this uses the outerHTML
* property in MSIE and Opera and a workaround for Gecko.
*
* <span class="attrib">@param</span> {HTMLElement} e HTML element to set outerHTML on.
* <span class="attrib">@param</span> {string} h HTML string to set in property.
*/</span>
TinyMCE_Engine.<span class="reserved">prototype</span>.setOuterHTML = <span class="reserved">function</span>(e, h) {
<span class="reserved">if</span> (tinyMCE.isMSIE) {
e.outerHTML = h;
<span class="reserved">return</span>;
}
var d = e.ownerDocument.createElement(<span class="literal">"body"</span>);
d.innerHTML = h;
e.parentNode.replaceChild(d.firstChild, e);
};
<span class="comment">/**
* Returns a element by id, this will also search the form names to match the id.
*
* <span class="attrib">@param</span> {string} id Id of element.
* <span class="attrib">@return</span> HTML element that matches the id.
* <span class="attrib">@type</span> HTMLElement
*/</span>
TinyMCE_Engine.<span class="reserved">prototype</span>._getElementById = <span class="reserved">function</span>(id) {
var e, i, j, f;
e = document.getElementById(id);
<span class="reserved">if</span> (!e) {
f = document.forms;
<span class="reserved">for</span> (i=0; i<f.length; i++) {
<span class="reserved">for</span> (j=0; j<f[i].elements.length; j++) {
<span class="reserved">if</span> (f[i].elements[j].name == id) {
e = f[i].elements[j];
break;
}
}
}
}
<span class="reserved">return</span> e;
};
<span class="comment">/**
* Returns a array of nodes selected retrived from the child nodes of the specified node.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -