/*!
* Ext JS Library 3.1.1
* Copyright(c) 2006-2010 Ext JS, LLC
* [email protected]
* http://www.extjs.com/license
*/
/**
* @class Ext.DomHelper
* <p>The DomHelper class provides a layer of abstraction from DOM and transparently supports creating
* elements via DOM or using HTML fragments. It also has the ability to create HTML fragment templates
* from your DOM building code.</p>
*
* <p><b><u>DomHelper element specification object</u></b></p>
* <p>A specification object is used when creating elements. Attributes of this object
* are assumed to be element attributes, except for 4 special attributes:
* <div class="mdetail-params"><ul>
* <li><b><tt>tag</tt></b> : <div class="sub-desc">The tag name of the element</div></li>
* <li><b><tt>children</tt></b> : or <tt>cn</tt><div class="sub-desc">An array of the
* same kind of element definition objects to be created and appended. These can be nested
* as deep as you want.</div></li>
* <li><b><tt>cls</tt></b> : <div class="sub-desc">The class attribute of the element.
* This will end up being either the "class" attribute on a HTML fragment or className
* for a DOM node, depending on whether DomHelper is using fragments or DOM.</div></li>
* <li><b><tt>html</tt></b> : <div class="sub-desc">The innerHTML for the element</div></li>
* </ul></div></p>
*
* <p><b><u>Insertion methods</u></b></p>
* <p>Commonly used insertion methods:
* <div class="mdetail-params"><ul>
* <li><b><tt>{@link #append}</tt></b> : <div class="sub-desc"></div></li>
* <li><b><tt>{@link #insertBefore}</tt></b> : <div class="sub-desc"></div></li>
* <li><b><tt>{@link #insertAfter}</tt></b> : <div class="sub-desc"></div></li>
* <li><b><tt>{@link #overwrite}</tt></b> : <div class="sub-desc"></div></li>
* <li><b><tt>{@link #createTemplate}</tt></b> : <div class="sub-desc"></div></li>
* <li><b><tt>{@link #insertHtml}</tt></b> : <div class="sub-desc"></div></li>
* </ul></div></p>
*
* <p><b><u>Example</u></b></p>
* <p>This is an example, where an unordered list with 3 children items is appended to an existing
* element with id <tt>'my-div'</tt>:<br>
<pre><code>
var dh = Ext.DomHelper; // create shorthand alias
// specification object
var spec = {
id: 'my-ul',
tag: 'ul',
cls: 'my-list',
// append children after creating
children: [ // may also specify 'cn' instead of 'children'
{tag: 'li', id: 'item0', html: 'List Item 0'},
{tag: 'li', id: 'item1', html: 'List Item 1'},
{tag: 'li', id: 'item2', html: 'List Item 2'}
]
};
var list = dh.append(
'my-div', // the context element 'my-div' can either be the id or the actual node
spec // the specification object
);
</code></pre></p>
* <p>Element creation specification parameters in this class may also be passed as an Array of
* specification objects. This can be used to insert multiple sibling nodes into an existing
* container very efficiently. For example, to add more list items to the example above:<pre><code>
dh.append('my-ul', [
{tag: 'li', id: 'item3', html: 'List Item 3'},
{tag: 'li', id: 'item4', html: 'List Item 4'}
]);
* </code></pre></p>
*
* <p><b><u>Templating</u></b></p>
* <p>The real power is in the built-in templating. Instead of creating or appending any elements,
* <tt>{@link #createTemplate}</tt> returns a Template object which can be used over and over to
* insert new elements. Revisiting the example above, we could utilize templating this time:
* <pre><code>
// create the node
var list = dh.append('my-div', {tag: 'ul', cls: 'my-list'});
// get template
var tpl = dh.createTemplate({tag: 'li', id: 'item{0}', html: 'List Item {0}'});
for(var i = 0; i < 5, i++){
tpl.append(list, [i]); // use template to append to the actual node
}
* </code></pre></p>
* <p>An example using a template:<pre><code>
var html = '<a id="{0}" href="{1}" class="nav">{2}</a>';
var tpl = new Ext.DomHelper.createTemplate(html);
tpl.append('blog-roll', ['link1', 'http://www.jackslocum.com/', "Jack's Site"]);
tpl.append('blog-roll', ['link2', 'http://www.dustindiaz.com/', "Dustin's Site"]);
* </code></pre></p>
*
* <p>The same example using named parameters:<pre><code>
var html = '<a id="{id}" href="{url}" class="nav">{text}</a>';
var tpl = new Ext.DomHelper.createTemplate(html);
tpl.append('blog-roll', {
id: 'link1',
url: 'http://www.jackslocum.com/',
text: "Jack's Site"
});
tpl.append('blog-roll', {
id: 'link2',
url: 'http://www.dustindiaz.com/',
text: "Dustin's Site"
});
* </code></pre></p>
*
* <p><b><u>Compiling Templates</u></b></p>
* <p>Templates are applied using regular expressions. The performance is great, but if
* you are adding a bunch of DOM elements using the same template, you can increase
* performance even further by {@link Ext.Template#compile "compiling"} the template.
* The way "{@link Ext.Template#compile compile()}" works is the template is parsed and
* broken up at the different variable points and a dynamic function is created and eval'ed.
* The generated function performs string concatenation of these parts and the passed
* variables instead of using regular expressions.
* <pre><code>
var html = '<a id="{id}" href="{url}" class="nav">{text}</a>';
var tpl = new Ext.DomHelper.createTemplate(html);
tpl.compile();
//... use template like normal
* </code></pre></p>
*
* <p><b><u>Performance Boost</u></b></p>
* <p>DomHelper will transparently create HTML fragments when it can. Using HTML fragments instead
* of DOM can significantly boost performance.</p>
* <p>Element creation specification parameters may also be strings. If {@link #useDom} is <tt>false</tt>,
* then the string is used as innerHTML. If {@link #useDom} is <tt>true</tt>, a string specification
* results in the creation of a text node. Usage:</p>
* <pre><code>
Ext.DomHelper.useDom = true; // force it to use DOM; reduces performance
* </code></pre>
* @singleton
*/
Ext.DomHelper = function(){
var tempTableEl = null,
emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,
tableRe = /^table|tbody|tr|td$/i,
pub,
// kill repeat to save bytes
afterbegin = 'afterbegin',
afterend = 'afterend',
beforebegin = 'beforebegin',
beforeend = 'beforeend',
ts = '<table>',
te = '</table>',
tbs = ts+'<tbody>',
tbe = '</tbody>'+te,
trs = tbs + '<tr>',
tre = '</tr>'+tbe;
// private
function doInsert(el, o, returnElement, pos, sibling, append){
var newNode = pub.insertHtml(pos, Ext.getDom(el), createHtml(o));
return returnElement ? Ext.get(newNode, true) : newNode;
}
// build as innerHTML where available
function createHtml(o){
var b = '',
attr,
val,
key,
keyVal,
cn;
if(Ext.isString(o)){
b = o;
} else if (Ext.isArray(o)) {
for (var i=0; i < o.length; i++) {
if(o[i]) {
b += createHtml(o[i]);
}
};
} else {
b += '<' + (o.tag = o.tag || 'div');
Ext.iterate(o, function(attr, val){
if(!/tag|children|cn|html$/i.test(attr)){
if (Ext.isObject(val)) {
b += ' ' + attr + '="';
Ext.iterate(val, function(key, keyVal){
b += key + ':' + keyVal + ';';
});
b += '"';
}else{
b += ' ' + ({cls : 'class', htmlFor : 'for'}[attr] || attr) + '="' + val + '"';
}
}
});
// Now ei
没有合适的资源?快使用搜索试试~ 我知道了~
PHP实例开发源码-Tine Web的群件系统.zip
共2000个文件
png:3435个
php:3149个
js:734个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 110 浏览量
2022-11-21
17:49:05
上传
评论
收藏 22.01MB ZIP 举报
温馨提示
PHP实例开发源码—Tine Web的群件系统.zip PHP实例开发源码—Tine Web的群件系统.zip PHP实例开发源码—Tine Web的群件系统.zip
资源推荐
资源详情
资源评论
收起资源包目录
PHP实例开发源码-Tine Web的群件系统.zip (2000个子文件)
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
config 1KB
ext-all.css 135KB
layout.css 108KB
ext-all-notheme.css 97KB
xtheme-access.css 41KB
Tinebase-FAT.css 40KB
xtheme-blue.css 38KB
xtheme-gray.css 38KB
tine20.css 28KB
Calendar-FAT.css 21KB
Felamimail-FAT.css 13KB
grid.css 11KB
form.css 10KB
button.css 8KB
style.css 7KB
tabs.css 7KB
panel.css 7KB
grid.css 7KB
grid.css 6KB
grid.css 6KB
panel-reset.css 6KB
toolbar.css 5KB
core.css 5KB
Admin-FAT.css 5KB
layout.css 5KB
Crm-FAT.css 5KB
date-picker.css 5KB
tree.css 5KB
Setup-FAT.css 4KB
menu.css 4KB
tree.css 4KB
tree.css 4KB
tree.css 4KB
window.css 3KB
form.css 3KB
button.css 3KB
toolbar.css 3KB
resizable.css 3KB
editor.css 3KB
tabs.css 3KB
date-picker.css 3KB
tabs.css 3KB
date-picker.css 3KB
date-picker.css 3KB
qtips.css 3KB
toolbar.css 3KB
tabs.css 3KB
toolbar.css 3KB
print.css 3KB
form.css 2KB
form.css 2KB
button.css 2KB
button.css 2KB
slider.css 2KB
panel.css 2KB
panel.css 2KB
panel.css 2KB
menu.css 2KB
window.css 2KB
Timetracker-FAT.css 2KB
window.css 2KB
window.css 2KB
core.css 2KB
menu.css 2KB
resizable.css 2KB
core.css 2KB
resizable.css 2KB
resizable.css 2KB
list-view.css 2KB
core.css 2KB
menu.css 2KB
box.css 1KB
box.css 1KB
box.css 1KB
box.css 1KB
layout.css 1KB
layout.css 1KB
layout.css 1KB
qtips.css 1KB
qtips.css 1KB
qtips.css 1KB
dialog.css 1KB
borders.css 1KB
dd.css 1KB
Tasks-FAT.css 965B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
毕业_设计
- 粉丝: 1935
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功