<html>
<head>
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
</head>
<body onload="prettyPrint();">
<pre class="prettyprint lang-js">/*
* Ext JS Library 2.0.2
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.DomHelper = function(){
var tempTableEl = null;
var emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;
var tableRe = /^table|tbody|tr|td$/i;
var createHtml = function(o){
if(typeof o == 'string'){
return o;
}
var b = "";
if (Ext.isArray(o)) {
for (var i = 0, l = o.length; i < l; i++) {
b += createHtml(o[i]);
}
return b;
}
if(!o.tag){
o.tag = "div";
}
b += "<" + o.tag;
for(var attr in o){
if(attr == "tag" || attr == "children" || attr == "cn" || attr == "html" || typeof o[attr] == "function") continue;
if(attr == "style"){
var s = o["style"];
if(typeof s == "function"){
s = s.call();
}
if(typeof s == "string"){
b += ' style="' + s + '"';
}else if(typeof s == "object"){
b += ' style="';
for(var key in s){
if(typeof s[key] != "function"){
b += key + ":" + s[key] + ";";
}
}
b += '"';
}
}else{
if(attr == "cls"){
b += ' class="' + o["cls"] + '"';
}else if(attr == "htmlFor"){
b += ' for="' + o["htmlFor"] + '"';
}else{
b += " " + attr + '="' + o[attr] + '"';
}
}
}
if(emptyTags.test(o.tag)){
b += "/>";
}else{
b += ">";
var cn = o.children || o.cn;
if(cn){
b += createHtml(cn);
} else if(o.html){
b += o.html;
}
b += "</" + o.tag + ">";
}
return b;
};
var createDom = function(o, parentNode){
var el;
if (Ext.isArray(o)) {
el = document.createDocumentFragment();
for(var i = 0, l = o.length; i < l; i++) {
createDom(o[i], el);
}
} else if (typeof o == "string)") {
el = document.createTextNode(o);
} else {
el = document.createElement(o.tag||'div');
var useSet = !!el.setAttribute;
for(var attr in o){
if(attr == "tag" || attr == "children" || attr == "cn" || attr == "html" || attr == "style" || typeof o[attr] == "function") continue;
if(attr=="cls"){
el.className = o["cls"];
}else{
if(useSet) el.setAttribute(attr, o[attr]);
else el[attr] = o[attr];
}
}
Ext.DomHelper.applyStyles(el, o.style);
var cn = o.children || o.cn;
if(cn){
createDom(cn, el);
} else if(o.html){
el.innerHTML = o.html;
}
}
if(parentNode){
parentNode.appendChild(el);
}
return el;
};
var ieTable = function(depth, s, h, e){
tempTableEl.innerHTML = [s, h, e].join('');
var i = -1, el = tempTableEl;
while(++i < depth){
el = el.firstChild;
}
return el;
};
var ts = '<table>',
te = '</table>',
tbs = ts+'<tbody>',
tbe = '</tbody>'+te,
trs = tbs + '<tr>',
tre = '</tr>'+tbe;
var insertIntoTable = function(tag, where, el, html){
if(!tempTableEl){
tempTableEl = document.createElement('div');
}
var node;
var before = null;
if(tag == 'td'){
if(where == 'afterbegin' || where == 'beforeend'){
return;
}
if(where == 'beforebegin'){
before = el;
el = el.parentNode;
} else{
before = el.nextSibling;
el = el.parentNode;
}
node = ieTable(4, trs, html, tre);
}
else if(tag == 'tr'){
if(where == 'beforebegin'){
before = el;
el = el.parentNode;
node = ieTable(3, tbs, html, tbe);
} else if(where == 'afterend'){
before = el.nextSibling;
el = el.parentNode;
node = ieTable(3, tbs, html, tbe);
} else{
if(where == 'afterbegin'){
before = el.firstChild;
}
node = ieTable(4, trs, html, tre);
}
} else if(tag == 'tbody'){
if(where == 'beforebegin'){
before = el;
el = el.parentNode;
node = ieTable(2, ts, html, te);
} else if(where == 'afterend'){
before = el.nextSibling;
el = el.parentNode;
node = ieTable(2, ts, html, te);
} else{
if(where == 'afterbegin'){
before = el.firstChild;
}
node = ieTable(3, tbs, html, tbe);
}
} else{
if(where == 'beforebegin' || where == 'afterend'){
return;
}
if(where == 'afterbegin'){
before = el.firstChild;
}
node = ieTable(2, ts, html, te);
}
el.insertBefore(node, before);
return node;
};
return {
useDom : false,
markup : function(o){
return createHtml(o);
},
applyStyles : function(el, styles){
if(styles){
el = Ext.fly(el);
if(typeof styles == "string"){
var re = /\s?([a-z\-]*)\:\s?([^;]*);?/gi;
var matches;
while ((matches = re.exec(styles)) != null){
el.setStyle(matches[1], matches[2]);
}
}else if (typeof styles == "object"){
for (var style in styles){
el.setStyle(style, styles[style]);
}
}else if (typeof styles == "function"){
Ext.DomHelper.applyStyles(el, styles.call());
}
}
},
insertHtml : function(where, el, html){
where = where.toLowerCase();
if(el.insertAdjacentHTML){
if(tableRe.test(el.tagName)){
var rs;
if(rs = insertIntoTable(el.tagName.toLowerCase(), where, el, html)){
return rs;
}
}
switch(where){
case "beforebegin":
el.insertAdjacentHTML('BeforeBegin', html);
return el.previousSibling;
case "afterbegin":
el.insertAdjacentHTML('AfterBegin', html);
return el.firstChild;
case "beforeend":
el.insertAdjacentHTML('BeforeEnd', html);
return el.lastChild;
case "afterend":
el.insertAdjacentHTML('AfterEnd', html);
return el.nextSibling;
}
throw 'Illegal insertion point -> "' + where + '"';
}
var range = el.ownerDocument.createRange();
var frag;
switch(where){
没有合适的资源?快使用搜索试试~ 我知道了~
EXT JS 3.0 中文版文档
共829个文件
html:685个
gif:114个
css:8个
需积分: 35 43 下载量 40 浏览量
2009-11-13
09:46:51
上传
评论
收藏 4.22MB ZIP 举报
温馨提示
EXT JS 3.0 中文版文档 HTML版 直接替换英文原版即可 好像下到一定次数就不加分了,给各位网友个方便吧
资源推荐
资源详情
资源评论
收起资源包目录
EXT JS 3.0 中文版文档 (829个子文件)
ext-all.css 81KB
style.css 6KB
docs.css 6KB
print.css 3KB
collapser.css 939B
reset.css 612B
prettify.css 594B
welcome.css 497B
Thumbs.db 54KB
Thumbs.db 5KB
extanim64.gif 6KB
error-tip-corners.gif 4KB
extanim32.gif 3KB
blue-loading.gif 3KB
large-loading.gif 3KB
block-bottom.gif 3KB
search-trigger.gif 2KB
loading-balls.gif 2KB
extjs.gif 2KB
checkbox.gif 2KB
clear-trigger.gif 2KB
tree-bg.gif 2KB
welcome-bg.gif 2KB
trigger.gif 2KB
radio.gif 2KB
collapse-bg.gif 2KB
date-trigger.gif 2KB
trigger-tpl.gif 1KB
grid3-hd-btn.gif 1KB
wait.gif 1KB
hd-sprite.gif 1KB
row-check-sprite.gif 1KB
pkg-open.gif 1KB
pkg-closed.gif 1KB
pick-button.gif 1KB
print.gif 1KB
forum.gif 1KB
docs.gif 1016B
expand-all.gif 1009B
example.gif 1008B
folder.gif 1003B
folder_open.gif 997B
exclamation.gif 996B
wel-bg.gif 991B
cmp.gif 988B
collapse-all.gif 983B
expand-members.gif 981B
calendar.gif 979B
refresh.gif 977B
hmenu-unlock.gif 971B
columns.gif 962B
static.gif 962B
warning.gif 960B
config.gif 955B
group-expand-sprite.gif 955B
hmenu-lock.gif 955B
row-expand-sprite.gif 955B
fav.gif 954B
drop-no.gif 947B
accordian.gif 943B
pkg.gif 936B
method.gif 931B
hmenu-asc.gif 931B
hmenu-desc.gif 930B
class.gif 925B
page-first-disabled.gif 925B
page-first.gif 925B
prop.gif 923B
page-last-disabled.gif 923B
page-last.gif 923B
event.gif 919B
hide-inherited.gif 919B
icon-grid.gif 917B
group-by.gif 917B
tabs.gif 917B
block-top.gif 915B
plus.gif 912B
minus.gif 904B
hd-bg.gif 889B
nowait.gif 884B
inherited.gif 881B
page-prev-disabled.gif 879B
page-prev.gif 879B
page-next.gif 875B
mso-hd.gif 875B
page-next-disabled.gif 875B
glass-bg.gif 873B
right-btn.gif 871B
left-btn.gif 870B
col-move-top.gif 869B
col-move-bottom.gif 868B
member-hover.gif 861B
drop-yes.gif 860B
member-collapsed.gif 856B
grid-hrow.gif 855B
member-expanded.gif 845B
elbow-end.gif 844B
grid3-special-col-sel-bg.gif 843B
hd-pop.gif 839B
grid3-special-col-bg.gif 837B
共 829 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
qbquan
- 粉丝: 16
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功