CodeForge QQ客服 CodeForge 400电话 客服电话 4006316121

xtree.js ( 文件浏览 )

  • 发布于2010-08-06
  • 浏览次数:7
  • 下载次数:1
  • 下载需 1 积分
  • 侵权举报
			/*----------------------------------------------------------------------------\
|                       Cross Browser Tree Widget 1.17                        |
|-----------------------------------------------------------------------------|
|                          Created by Emil A Eklund                           |
|                  (http://webfx.eae.net/contact.html#emil)                   |
|                      For WebFX (c/)                      |
|-----------------------------------------------------------------------------|
| An object based tree widget,  emulating the one found in microsoft windows, |
| with persistence using cookies. Works in IE 5+, Mozilla and konqueror 3.    |
|-----------------------------------------------------------------------------|
|                   Copyright (c) 1999 - 2002 Emil A Eklund                   |
|-----------------------------------------------------------------------------|
| This software is provided "as is", without warranty of any kind, express or |
| implied, including  but not limited  to the warranties of  merchantability, |
| fitness for a particular purpose and noninfringement. In no event shall the |
| authors or  copyright  holders be  liable for any claim,  damages or  other |
| liability, whether  in an  action of  contract, tort  or otherwise, arising |
| from,  out of  or in  connection with  the software or  the  use  or  other |
| dealings in the software.                                                   |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| This  software is  available under the  three different licenses  mentioned |
| below.  To use this software you must chose, and qualify, for one of those. |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| The WebFX Non-Commercial License          http://webfx.eae.net/license.html |
| Permits  anyone the right to use the  software in a  non-commercial context |
| free of charge.                                                             |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| The WebFX Commercial license           http://webfx.eae.net/commercial.html |
| Permits the  license holder the right to use  the software in a  commercial |
| context. Such license must be specifically obtained, however it's valid for |
| any number of  implementations of the licensed software.                    |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| GPL - The GNU General Public License    http://www.gnu.org/licenses/gpl.txt |
| Permits anyone the right to use and modify the software without limitations |
| as long as proper  credits are given  and the original  and modified source |
| code are included. Requires  that the final product, software derivate from |
| the original  source or any  software  utilizing a GPL  component, such  as |
| this, is also licensed under the GPL license.                               |
|-----------------------------------------------------------------------------|
| Dependencies: xtree.css (To set up the CSS of the tree classes)             |
|-----------------------------------------------------------------------------|
| 2001-01-10 | Original Version Posted.                                       |
| 2001-03-18 | Added getSelected and get/setBehavior  that can make it behave |
|            | more like windows explorer, check usage for more information.  |
| 2001-09-23 | Version 1.1 - New features included  keyboard  navigation (ie) |
|            | and the ability  to add and  remove nodes dynamically and some |
|            | other small tweaks and fixes.                                  |
| 2002-01-27 | Version 1.11 - Bug fixes and improved mozilla support.         |
| 2002-06-11 | Version 1.12 - Fixed a bug that prevented the indentation line |
|            | from  updating correctly  under some  circumstances.  This bug |
|            | happened when removing the last item in a subtree and items in |
|            | siblings to the remove subtree where not correctly updated.    |
| 2002-06-13 | Fixed a few minor bugs cased by the 1.12 bug-fix.              |
| 2002-08-20 | Added usePersistence flag to allow disable of cookies.         |
| 2002-10-23 | (1.14) Fixed a plus icon issue                                 |
| 2002-10-29 | (1.15) Last changes broke more than they fixed. This version   |
|            | is based on 1.13 and fixes the bugs 1.14 fixed withou breaking |
|            | lots of other things.                                          |
| 2003-02-15 | The  selected node can now be made visible even when  the tree |
|            | control  loses focus.  It uses a new class  declaration in the |
|            | css file '.webfx-tree-item a.selected-inactive', by default it |
|            | puts a light-gray rectangle around the selected node.          |
| 2003-03-16 | Adding target support after lots of lobbying...                |
|-----------------------------------------------------------------------------|
| Created 2000-12-11 | All changes are in the log above. | Updated 2003-03-16 |
\----------------------------------------------------------------------------*/

var webFXTreeConfig = {
		
	rootIcon        : this.imagePath + '/foldericon.png',
	openRootIcon    : this.imagePath + '/openfoldericon.png',
	folderIcon      :  this.imagePath + '/foldericon.png',
	openFolderIcon  :this.imagePath + '/openfoldericon.png',
	fileIcon        : this.imagePath + '/file.png',
	iIcon           : this.imagePath + '/I.png',
	lIcon           : this.imagePath + '/L.png',
	lMinusIcon      : this.imagePath + '/Lminus.png',
	lPlusIcon       : this.imagePath + '/Lplus.png',
	tIcon           : this.imagePath + '/T.png',
	tMinusIcon   : this.imagePath + '/Tminus.png',
	tPlusIcon       : this.imagePath + '/Tplus.png',
	blankIcon       : this.imagePath + '/blank.png',
	defaultText     : 'Tree Item',
	defaultAction   : 'javascript:void(0);',
	defaultBehavior : 'classic',
	usePersistence	: true,
    disableColor : "#9B9B9B",   // luohc [add] 2004-12-1. 不可用时的文本颜色。
	defaultColor : "black",   // luohc [add] 2006-4-30. 节点的文本颜色。
	cascadeCheck: true,    // luohc. 定义checkbox树是否级联选择。 2005.02.15
	//imagePath : "js/images",  // luohc. 图片路径.	2005.02.15  // 这个属性有点问题,请不要使用. 参见 setImagePath 方法.	
	setImagePath: function(path){
  // 设置图片路径。直接设置 imagePath 属性不起作用。
		if(path == null) path = "js/images/";
		if(path.charAt(path.length-1) != '/') path += "/";
        //this.imagePath = path;
		this.rootIcon = path + "foldericon.png";
		this.openRootIcon = path + 'openfoldericon.png';
		this.folderIcon     =  path + 'foldericon.png';
		this.openFolderIcon  = path + 'openfoldericon.png';
		this.fileIcon       = path + 'file.png';
		this.iIcon           = path + 'I.png';
		this.lIcon           = path + 'L.png';
		this.lMinusIcon   =  path + 'Lminus.png';
		this.lPlusIcon     = path + 'Lplus.png';
		this.tIcon          = path + 'T.png';
		this.tMinusIcon  = path + 'Tminus.png';
		this.tPlusIcon     = path + 'Tplus.png';
		this.blankIcon     = path + 'blank.png';
	
}	
	

};

var webFXTreeHandler = {

	idCounter : 0,
	idPrefix  : "webfx-tree-object-apollo-",
	all       : {

},
	behavior  : null,
	selected  : null,
	onSelect  : null, /* should be part of tree, not handler */
	getId     : function() {
 return this.idPrefix + this.idCounter++; 
},
	toggle    : function (oItem) {
 this.all[oItem.id.replace('-plus','')].toggle(); 
},
	select    : function (oItem) {
 this.all[oItem.id.replace('-icon','')].select(); 
},
	focus     : function (oItem) {
 this.all[oItem.id.replace('-anchor','')].focus(); 
},
	blur      : function (oItem) {
 this.all[oItem.id.replace('-anchor','')].blur(); 
},
	keydown   : function (oItem, e) {
 return this.all[oItem.id].keydown(e.keyCode); 
},
	cookies   : new WebFXCookie(),
	insertHTMLBeforeEnd	:	function (oElement, sHTML) {

		if (oElement.insertAdjacentHTML != null) {

			oElement.insertAdjacentHTML("BeforeEnd", sHTML)
			return;
		
}
		var df;	// DocumentFragment
		var r = oElement.ownerDocument.createRange();
		r.selectNodeContents(oElement);
		r.collapse(false);
		df = r.createContextualFragment(sHTML);
		oElement.appendChild(df);
	
}

};

/*
 * WebFXCookie class
 */

function WebFXCookie() {

	this.cookieKey = "extreecookie";
	if (document.cookie.length) {
 	        
		this.cookies = ' ' +  document.cookie; 
	
}	

}

WebFXCookie.prototype.deleteCookie = function(){

	document.cookie = this.cookieKey + "=none";
	document.cookie = this.cookieKey + "=nothing; expires=Thu, 01-Jan-1970 00:00:01 GMT";

}

WebFXCookie.prototype.setCookie = function (key, value) {

	value = key + "=" + value + ";";
	this.cookies = ' ' +  document.cookie; 
	var values = this.getCookieValue(" " + this.cookieKey, this.cookies);
	if(values == null){
		
		document.cookie = this.cookieKey + "=" + escape(value);
	
}else{

		values = unescape(values);
		var start = values.indexOf(key + "=");
		if(start>=0){

			var end = values.indexOf(";", start);
			values = values.substring(0, start) + values.substring(end+1) + value;
		
}else{

			values = values + value;
		
}	
		document.cookie = this.cookieKey + "=" + escape(values);
	
}

}

WebFXCookie.prototype.getCookie = function(key){

	this.cookies = ' ' +  document.cookie; 
	if(this.cookies == null) return null;
	var values = this.getCookieValue(" " + this.cookieKey, this.cookies);
    
	var value = null;
	if(values != null){

	   value = this.getCookieValue(key, unescape(values));
	
}
	return value;

}

// 在 "key1=value1;key2=value2;" 这样的键值对字符串中获取某键值对应的值。
WebFXCookie.prototype.getCookieValue = function (key, values) {

	if(values == null) return null;
	var newKey = key + "=";
	var start = values.indexOf(newKey);
	if(start == -1) return null;
	start += newKey.length;
	var end = values.indexOf(";", start);
	if(end == -1) end = values.leng
...
...
(文件超长,未完全显示,请下载后阅读剩余部分)
			
...
展开> <收缩

下载源码到电脑,阅读使用更方便

1 积分

快速下载
还剩0行未阅读,继续阅读
免费下载源码
Sponsored links

源码文件列表

温馨提示: 点击源码文件名可预览文件内容哦 ^_^
...
名称 大小 修改日期
allItemTree.html1.50 kB18-02-05 15:32
checkboxTree_demo.html2.21 kB12-05-06 17:19
checkbox_xloadtree.html2.18 kB12-05-06 10:13
err_item.xml627.00 B12-05-06 10:52
help.html10.16 kB15-05-06 17:04
index.html444.00 B15-05-06 14:51
itemb.xml192.00 B30-11-05 17:05
items.xml883.00 B15-05-06 16:25
checkboxTreeItem.js10.85 kB12-05-06 14:39
checkboxXLoadTree.js11.82 kB12-05-06 08:47
blank.png144.00 B13-06-02 17:51
file.png251.00 B13-06-02 17:51
foldericon.png229.00 B13-06-02 17:51
I.png148.00 B13-06-02 17:51
L.png153.00 B13-06-02 17:51
Lminus.png219.00 B13-06-02 17:51
Lplus.png224.00 B13-06-02 17:51
new.png251.00 B13-06-02 17:51
openfoldericon.png232.00 B13-06-02 17:51
pspbrwse.jbf5.54 kB13-06-02 17:51
T.png152.00 B13-06-02 17:51
Thumbs.db14.50 kB12-05-06 10:23
Tminus.png207.00 B13-06-02 17:51
Tplus.png222.00 B13-06-02 17:51
vssver.scc240.00 B21-09-04 09:40
<images>0.00 B19-06-08 11:38
map.js1.60 kB29-03-06 16:47
radioTreeItem.js7.83 kB13-05-06 17:59
radioXLoadTree.js11.77 kB12-05-06 08:47
xloadtree.js12.05 kB15-05-06 14:51
xmlextras.js3.87 kB05-02-02 20:39
xtree.css1.04 kB01-12-04 17:13
xtree.js29.21 kB15-05-06 17:06
<js>0.00 B19-06-08 11:38
largeCheckBoxTree.html1.78 kB18-02-05 15:33
left.html1.55 kB15-05-06 14:53
map.html1.06 kB05-02-05 10:24
no_item.xml60.00 B12-11-04 09:53
radioTree_demo.html1.83 kB12-05-06 10:04
radio_xloadtree.html1.85 kB12-05-06 10:04
ReadMe.txt5.33 kB15-05-06 17:03
web.xml426.00 B03-12-04 09:01
<WEB-INF>0.00 B19-06-08 11:38
xloadtree.html2.14 kB13-05-06 17:46
<xTree>0.00 B29% 03-12-04
xtree.html2.04 kB15-05-06 15:54
<eXtree>0.00 B19-06-08 11:38
Sponsored links

xtree.js (52.66 kB)

需要 1 积分
您持有 积分

CodeForge积分(原CF币)全新升级,功能更强大,使用更便捷,不仅可以用来下载海量源代码马上还可兑换精美小礼品了 了解更多

您的积分不足

支付宝优惠套餐快速获取 30 积分

订单支付完成后,积分将自动加入到您的账号。以下是优惠期的人民币价格,优惠期过后将恢复美元价格。

更多付款方式:网银PayPal

上传代码,免费获取

您本次下载所消耗的积分将转交上传作者。

同一源码,30天内重复下载,只扣除一次积分。

登录 CodeForge

还没有CodeForge账号? 立即注册
关注微博
联系客服

Switch to the English version?

Yes
CodeForge 英文版
No
CodeForge 中文版

完善个人资料,获价值¥30元积分奖励!

^_^"呃 ...

Sorry!这位大神很神秘,未开通博客呢,请浏览一下其他的吧
好的