📄 overview-summary-tinymce_cleanup.class.js.html
字号:
h = h.replace(<span class="reserved">this</span>.nlBeforeRe, <span class="literal">'\n<$1$2>'</span>);
h = h.replace(<span class="reserved">this</span>.nlAfterRe, <span class="literal">'<$1$2>\n'</span>);
h = h.replace(<span class="reserved">this</span>.nlBeforeAfterRe, <span class="literal">'\n<$1$2$3>\n'</span>);
h += <span class="literal">'\n'</span>;
<span class="comment">//tinyMCE.debug(h);</span>
<span class="reserved">while</span> ((i = h.indexOf(<span class="literal">'\n'</span>, i + 1)) != -1) {
<span class="reserved">if</span> ((l = h.substring(li + 1, i)).length != 0) {
<span class="reserved">if</span> (<span class="reserved">this</span>.ouRe.test(l) && p.length >= s.indent_levels)
p = p.substring(s.indent_levels);
o += p + l + <span class="literal">'\n'</span>;
<span class="reserved">if</span> (<span class="reserved">this</span>.inRe.test(l))
p += <span class="reserved">this</span>.inStr;
}
li = i;
}
<span class="comment">//tinyMCE.debug(h);</span>
<span class="reserved">return</span> o;
},
<span class="comment">/**
* XML Encodes the specified string based on configured entity encoding. The entity encoding modes
* are raw, numeric and named. Where raw is the fastest and named is default.
*
* <span class="attrib">@param</span> {string} s String to convert to XML.
* <span class="attrib">@return</span> Encoded XML string based on configured entity encoding.
* <span class="attrib">@type</span> string
*/</span>
xmlEncode : <span class="reserved">function</span>(s) {
var i, l, e, o = <span class="literal">''</span>, c;
switch (<span class="reserved">this</span>.settings.entity_encoding) {
case <span class="literal">"raw"</span>:
s = <span class="literal">""</span> + s;
s = s.replace(/&/g, <span class="literal">'&amp;'</span>);
s = s.replace(new RegExp(<span class="literal">'"'</span>, <span class="literal">'g'</span>), <span class="literal">'&quot;'</span>);
<span class="comment">//s = s.replace(/\'/g, '&apos;');</span>
s = s.replace(/</g, <span class="literal">'&lt;'</span>);
s = s.replace(/>/g, <span class="literal">'&gt;'</span>);
<span class="reserved">return</span> s;
case <span class="literal">"named"</span>:
<span class="reserved">for</span> (i=0, l=s.length; i<l; i++) {
c = s.charCodeAt(i);
e = <span class="reserved">this</span>.entities[c];
<span class="reserved">if</span> (e && e != <span class="literal">''</span>)
o += <span class="literal">'&'</span> + e + <span class="literal">';'</span>;
<span class="reserved">else</span>
o += String.fromCharCode(c);
}
<span class="reserved">return</span> o;
case <span class="literal">"numeric"</span>:
<span class="reserved">for</span> (i=0, l=s.length; i<l; i++) {
c = s.charCodeAt(i);
<span class="reserved">if</span> (c > 127 || c == 60 || c == 62 || c == 38 || c == 39 || c == 34)
o += <span class="literal">'&#'</span> + c + <span class="literal">";"</span>;
<span class="reserved">else</span>
o += String.fromCharCode(c);
}
<span class="reserved">return</span> o;
}
<span class="reserved">return</span> s;
},
<span class="comment">/**
* Splits the specified string and removed empty chunks.
*
* <span class="attrib">@param</span> {RegEx} re RegEx to split string by.
* <span class="attrib">@param</span> {string} s String value to split.
* <span class="attrib">@return</span> Array with parts from specified string.
* <span class="attrib">@type</span> string
*/</span>
split : <span class="reserved">function</span>(re, s) {
var c = s.split(re);
var i, l, o = new Array();
<span class="reserved">for</span> (i=0, l=c.length; i<l; i++) {
<span class="reserved">if</span> (c[i] != <span class="literal">''</span>)
o[i] = c[i];
}
<span class="reserved">return</span> o;
},
<span class="comment">/**
* Returns the value of the specified attribute name or default value if it wasn't found.
*
* <span class="attrib">@param</span> {HTMLElement} e HTML element to get attribute from.
* <span class="attrib">@param</span> {string} n Attribute name to get from element.
* <span class="attrib">@param</span> {string} d Default value to return if attribute wasn't found.
* <span class="attrib">@return</span> Attribute value based on specified attribute name.
* <span class="attrib">@type</span> string
* <span class="attrib">@private</span>
*/</span>
_getAttrib : <span class="reserved">function</span>(e, n, d) {
<span class="reserved">if</span> (typeof(d) == <span class="literal">"undefined"</span>)
d = <span class="literal">""</span>;
<span class="reserved">if</span> (!e || e.nodeType != 1)
<span class="reserved">return</span> d;
var v = e.getAttribute(n, 0);
<span class="reserved">if</span> (n == <span class="literal">"class"</span> && !v)
v = e.className;
<span class="reserved">if</span> (<span class="reserved">this</span>.isMSIE && n == <span class="literal">"http-equiv"</span>)
v = e.httpEquiv;
<span class="reserved">if</span> (n == <span class="literal">"style"</span> && !tinyMCE.isOpera)
v = e.style.cssText;
<span class="reserved">if</span> (n == <span class="literal">'style'</span>)
v = tinyMCE.serializeStyle(tinyMCE.parseStyle(v));
<span class="reserved">return</span> (v && v != <span class="literal">""</span>) ? <span class="literal">''</span> + v : d;
},
<span class="comment">/**
* Internal URL converter callback function. This simply converts URLs based
* on some settings.
*
* <span class="attrib">@param</span> {TinyMCE_Cleanup} c Cleanup instance.
* <span class="attrib">@param</span> {HTMLNode} n HTML node that holds the URL.
* <span class="attrib">@param</span> {string} v URL value to convert.
* <span class="attrib">@return</span> Converted URL value.
* <span class="attrib">@type</span> string
* <span class="attrib">@private</span>
*/</span>
_urlConverter : <span class="reserved">function</span>(c, n, v) {
<span class="reserved">if</span> (!c.settings.on_save)
<span class="reserved">return</span> tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href, v);
<span class="reserved">else</span> <span class="reserved">if</span> (tinyMCE.getParam(<span class="literal">'convert_urls'</span>))
<span class="reserved">return</span> eval(tinyMCE.settings.urlconverter_callback + <span class="literal">"(v, n, true);"</span>);
<span class="reserved">return</span> v;
},
<span class="comment">/**
* Converts a array into a regex.
*
* <span class="attrib">@param</span> {Array} a Array to convert into a regex.
* <span class="attrib">@param</span> {string} op RegEx options like, gi.
* <span class="attrib">@param</span> {string} be Before chunk, beginning of expression.
* <span class="attrib">@param</span> {string} af After chunk, end of expression.
* <span class="attrib">@return</span> RegEx instance based in input information.
* <span class="attrib">@type</span> string
* <span class="attrib">@private</span>
*/</span>
_arrayToRe : <span class="reserved">function</span>(a, op, be, af) {
var i, r;
op = typeof(op) == <span class="literal">"undefined"</span> ? <span class="literal">"gi"</span> : op;
be = typeof(be) == <span class="literal">"undefined"</span> ? <span class="literal">"^("</span> : be;
af = typeof(af) == <span class="literal">"undefined"</span> ? <span class="literal">")$"</span> : af;
r = be;
<span class="reserved">for</span> (i=0; i<a.length; i++)
r += <span class="reserved">this</span>._wildcardToRe(a[i]) + (i != a.length-1 ? <span class="literal">"|"</span> : <span class="literal">""</span>);
r += af;
<span class="reserved">return</span> new RegExp(r, op);
},
<span class="comment">/**
* Converts a wildcard string into a regex.
*
* <span class="attrib">@param</span> {string} s Wildcard string to convert into RegEx.
* <span class="attrib">@return</span> RegEx string based on input.
* <span class="attrib">@type</span> string
* <span class="attrib">@private</span>
*/</span>
_wildcardToRe : <span class="reserved">function</span>(s) {
s = s.replace(/\?/g, <span class="literal">'(\\S?)'</span>);
s = s.replace(/\+/g, <span class="literal">'(\\S+)'</span>);
s = s.replace(/\*/g, <span class="literal">'(\\S*)'</span>);
<span class="reserved">return</span> s;
}
};
</pre>
<hr>
<!-- ========== 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>
<font size="-1">
</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Mon Feb 13 16:28:04 2006</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -