<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){
没有合适的资源?快使用搜索试试~ 我知道了~
深入浅出ExtJS第2版(随书光盘)之三
共3131个文件
html:1192个
gif:630个
js:541个
5星 · 超过95%的资源 需积分: 9 40 下载量 7 浏览量
2011-10-23
08:24:54
上传
评论
收藏 12.36MB RAR 举报
温馨提示
本人最近买了“深入浅出ExtJS第2版”的书,随书光盘的内容大于我目前的上传,不能一次上传,故分着上传,现在的内容包括:ext-3.0.0及其示例。
资源推荐
资源详情
资源评论
收起资源包目录
深入浅出ExtJS第2版(随书光盘)之三 (3131个子文件)
compile.bat 38B
InfoManager.class 2KB
Info.class 1KB
TreeNodeManager.class 854B
TreeNode.class 802B
ListRange.class 647B
ext-all.css 140KB
ext-all-notheme.css 102KB
ext-all.css 81KB
xtheme-blue.css 38KB
silk.css 17KB
desktop.css 14KB
extjs.css 11KB
ux-all.css 11KB
grid.css 11KB
form.css 10KB
button.css 8KB
panel.css 7KB
tabs.css 7KB
style.css 6KB
grid.css 6KB
panel-reset.css 6KB
docs.css 6KB
GroupTab.css 6KB
toolbar.css 6KB
core.css 5KB
feed-viewer.css 5KB
feed-viewer.css 5KB
layout.css 5KB
date-picker.css 5KB
tree.css 4KB
tree.css 4KB
window.css 3KB
menu.css 3KB
print.css 3KB
tasks.css 3KB
resizable.css 3KB
editor.css 3KB
toolbar.css 3KB
date-picker.css 3KB
forum.css 3KB
tabs.css 3KB
qtips.css 3KB
form.css 2KB
layout-browser.css 2KB
button.css 2KB
StatusBar.css 2KB
restful.css 2KB
img-org.css 2KB
roweditorgrid.css 2KB
slider.css 2KB
panel.css 2KB
Ext.ux.UploadDialog.css 2KB
chooser.css 2KB
window.css 2KB
menu.css 2KB
resizable.css 2KB
list-view.css 2KB
core.css 2KB
organizer.css 2KB
box.css 1KB
box.css 1KB
debug.css 1KB
Spinner.css 1KB
bubble.css 1KB
ColumnNodeUI.css 1KB
layout.css 1KB
qtips.css 1KB
RowEditor.css 1KB
dialog.css 1KB
grid-examples.css 1KB
data-view.css 1KB
borders.css 1KB
samples.css 1KB
examples.css 1KB
dd.css 1KB
collapser.css 939B
toolbars.css 923B
combo.css 887B
basic.css 861B
dialog.css 836B
list-view.css 804B
combo.css 785B
tabs-example.css 734B
progress.css 727B
Portal.css 721B
MultiSelect.css 713B
menus.css 709B
progress-bar.css 688B
dd.css 658B
progress.css 648B
slider.css 647B
xml-tree-loader.css 640B
tab-scroller-menu.css 626B
reset.css 612B
forms.css 602B
qtips.css 600B
prettify.css 594B
file-upload.css 581B
combos.css 575B
共 3131 条
- 1
- 2
- 3
- 4
- 5
- 6
- 32
资源评论
- hubeiqianjiang2013-10-07ext-3.0.0及其示例的源文件。同讲解说明视频一致。东西不错。就是每个都分割的太小了
虾皮
- 粉丝: 15
- 资源: 97
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于javaweb的网上拍卖系统,采用Spring + SpringMvc+Mysql + Hibernate+ JSP技术
- polygon-mumbai
- Chrome代理 switchyOmega
- GVC-全球价值链参与地位指数,基于ICIO表,(Wang等 2017a)计算方法
- 易语言ADS指纹浏览器管理工具
- 易语言奇易模块5.3.6
- cad定制家具平面图工具-(FG)门板覆盖柜体
- asp.net 原生js代码及HTML实现多文件分片上传功能(自定义上传文件大小、文件上传类型)
- whl@pip install pyaudio ERROR: Failed building wheel for pyaudio
- Constantsfd密钥和权限集合.kt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功