<html>
<head>
<title>
Biggun Framework Ajax Components Demo
</title>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="comp.js"></script>
<script type="text/javascript" src="effects.js"></script>
<link rel="stylesheet" id='cssSha' href="red_share.css" type="text/css" />
<link rel="stylesheet" id='cssGbl' href="red_global.css" type="text/css" />
<link rel="stylesheet" id='cssGbl' href="common.css" type="text/css" />
<style>
<style>
.debug {
left : 600px;
top : 80px;
width:350px;
height : 400;
border : 2px black;
overflow : auto;
position : absolute;
z-index : 55555;
display:none;
}
.debug .info {
color : blue;
font-size : 12pt;
}
.x-tree ,.x-panel-body{
border:0px;
margin : 0px;
float:left;
width:auto;
height:auto;
}
.gMPage{
height:650px;
}
</style>
</head>
<body class="gPage" lang="zh">
<div class="gTop" id='gTop'>
<center><div id='outDv'></div></center>
</div>
<table class="gMain">
<tbody>
<tr>
<td class="gLe">
<div id="dvLeft" class="gFpage">
<div class="gFd">
</div>
</div>
</td>
<td class="gRi" valign="top">
<div id='divMain' class="gMPage" style="overflow: hidden;"></div>
</td>
</tr>
</tbody>
</table>
</body>
</html>
<script>
var comeOn=[];
var tidA,tidB;
var busy=false;
var tips=[];
var tipClockElps = 0;
function print(ss){
$('outDv').innerHTML="<b>"+ss+"</b>";
}
function tip(obj,msg,title) {
tips.push([obj,msg,title]);
}
function checkTip() {
if(tips.length==0) {
clearInterval(tidB);
return;
}
obj = tips.shift();
CUtil.tip(obj[1],obj[2] || '温馨提示:',obj[0],6000);
}
function run(ss,type){
comeOn.push(ss);
}
function addScript(arr,type) {
comeOn=comeOn.concat(arr);
}
function start() {
tidA=setInterval('check()',1);
}
function check(){
if(comeOn.length==0) {
clearInterval(tidA);
}
if(comeOn.length>0 && !busy){
busy=true;
eval(comeOn.shift());
busy=false;
}
}
function changeStyle(s) {
$('cssSha').href=''+s.cs+'_share.css';
$('cssGbl').href=''+s.cs+'_global.css';
}
</script>
<script>
//菜单数据,以面向对象方式生成,也可以传递数组方式.
var editorMenu = new CMenu();
editorMenu.add(new CMenuItem({title:'文件'}));
editorMenu.add(new CMenuItem({title:'编辑'}));
editorMenu.add(new CMenuItem({title:'方案'}));
editorMenu.add(new CMenuItem({title:'视图'}));
editorMenu.add(new CMenuItem({title:'脚本'}));
//File
var fileMenu = new CMenu();
fileMenu.add(new CMenuItem({title:'新建'}));
fileMenu.add(new CMenuItem({title:'打开'}));
fileMenu.add(new CMenuItem({title:'保存'}));
fileMenu.add(new CMenuItem({title:'另存为'}));
//Edit
var editMenu = new CMenu();
editMenu.add(new CMenuItem({title:'撤消'}));
editMenu.add(new CMenuItem({title:'复制'}));
editMenu.add(new CMenuItem({title:'粘贴'}));
editMenu.add(new CMenuItem({title:'选择范围'}));
//Solution
var soluMenu = new CMenu();
soluMenu.add(new CMenuItem({title:'新建方案'}));
soluMenu.add(new CMenuItem({title:'打开方案'}));
soluMenu.add(new CMenuItem({title:'打开TAG方案'}));
soluMenu.add(new CMenuItem({title:'清理方案'}));
//view
var viewMenu = new CMenu();
viewMenu.add(new CMenuItem({title:'查看方式'}));
viewMenu.add(new CMenuItem({title:'设置代码页'}));
viewMenu.add(new CMenuItem({title:'增大字号'}));
viewMenu.add(new CMenuItem({title:'减小字号'}));
//
var scriptMenu = new CMenu();
scriptMenu.add(new CMenuItem({title:'脚本'}));
scriptMenu.add(new CMenuItem({title:'脚本列表'}));
scriptMenu.add(new CMenuItem({title:'执行脚本'}));
scriptMenu.add(new CMenuItem({title:'中止脚本'}));
//第二层
var hexMenu = new CMenu();
hexMenu.add(new CMenuItem({title:'十六进制'}));
hexMenu.add(new CMenuItem({title:'脚本列表'}));
var listMenu = new CMenu();
listMenu.add(new CMenuItem({title:'List'}));
listMenu.add(new CMenuItem({title:'Something'}));
var ssMenu = new CMenu();
ssMenu.add(new CMenuItem({title:'红色'}));
ssMenu.add(new CMenuItem({title:'白色'}));
editorMenu.attach(fileMenu,0);
editorMenu.attach(editMenu,1);
editorMenu.attach(soluMenu,2);
editorMenu.attach(viewMenu,3);
editorMenu.attach(scriptMenu,4);
listMenu.attach(ssMenu,1);
//
fileMenu.attach(hexMenu,0);
//
hexMenu.attach(listMenu,1);
//树型数据
var tree = new CTree({title:'Root'});
tree.root.add(new CTreeItem({title:'Hello'}));
tree.root.add(new CTreeItem({title:'Beautyful'}));
var fldOne = new CTreeItem({isFolder:true,title:'文件夹1'});
tree.root.add(fldOne);
var fldThr = new CTreeItem({isFolder:true,title:'文件夹3'});
tree.root.add(fldThr);
var fldTwo = new CTreeItem({isFolder:true,title:'文件夹2'});
fldOne.add(new CTreeItem({title:'文件1'}));
fldOne.add(fldTwo);
fldOne.add(new CTreeItem({title:'文件2'}));
fldTwo.add(new CTreeItem({title:'文件3'}));
fldTwo.add(new CTreeItem({title:'文件3'}));
fldTwo.add(new CTreeItem({title:'文件3'}));
fldTwo.add(new CTreeItem({title:'文件3'}));
fldThr.add(new CTreeItem({title:'文asddf件3'}));
fldThr.add(new CTreeItem({title:'文件3'}));
fldThr.add(new CTreeItem({title:'文件3'}));
var fldFor = new CTreeItem({isFolder:true,title:'文件夹4'});
fldThr.add(fldFor);
fldFor.add(new CTreeItem({title:'文件5'}));
fldFor.add(new CTreeItem({title:'文件6'}));
fldFor.add(new CTreeItem({title:'文件7'}));
fldFor.add(new CTreeItem({title:'文件8'}));
//
fldOne.expand(true);
tree.root.expand(true);
for(var i=0;i<15;i++){
eval("var div"+i+"=CC.$C('DIV');");
eval("div"+i+".innerHTML='<b>Curr Tab"+i+" Panel'");
}
var tab=new CTab();
tab.setViewAttr('className','gTab');
tab.view.id='dvTab';
tab.ctxPanel=$('divMain');
$('gTop').appendChild(tab.view);
tabItem0 = new CTabItem({id:'tab0',title:'桌面(Biggun Framework)',closeable:false,panel:div0});
addScript(
[
"tab.add(tabItem0)",
"tab.add(new CTabItem({id:'tab1',title:'World',closeable:true,panel:div1}))",
"tab.add(new CTabItem({id:'tab2',title:'Tab2',closeable:false,panel:div2}))",
"tab.add(new CTabItem({id:'tab3',title:'Tab3',closeable:true,panel:div3}))",
"tab.add(new CTabItem({id:'tab4',title:'Tab4',closeable:false,panel:div4}))",
"tab.add(new CTabItem({id:'tab5',title:'Tab5',closeable:true,panel:div5}))",
"tab.add(new CTabItem({id:'tab6',title:'Tab6',closeable:false,panel:div6}))",
"tab.add(new CTabItem({id:'tab7',title:'Tab7',closeable:true,panel:div7}))",
"tab.add(new CTabItem({id:'tab8',title:'Tab8',closeable:true,panel:div8}))",
"tab.add(new CTabItem({id:'tab9',title:'Tab9',closeable:true,panel:div9}))",
"tab.add(new CTabItem({id:'tab10',title:'Tab10',closeable:true,panel:div10}))",
'print("<b>选择tabs...")'
],1);
for(var i=0;i<=10;i++) {
run("tab.select('tab"+i+"')",1);
}
run('print("<b>重命名 tabs...")',1);
for(var i=1;i<10;i++) {
run("tab.get('tab"+i+"').setTitle('tab"+i+"ChangeTo"+i+"')",1);
}
for(var i=3;i<=10;i++) {
run("tab.get('tab"+i+"').setTitle('tab"+i+"')",1);
}
run('print("<b>隐藏 tabs...")',1);
for(var i=0;i<10;i++) {
run("tab.show('tab"+i+"',false);",1);
}
run('print("<b>重现 tabs...")',1);
for(var i=10;i>=0;i--) {
run("tab.show('tab"+i+"',true);",1);
}
run('print("<b>停留tabs...")',1);
for(var i=2;i<=9;i++) {
run("tab.get('tab"+i+"').setCloseable(false);",1);
}
for(var i=2;i<=9;i++) {
run("tab.get('tab"+i+"').setCloseable(true);",1);
}
for(var i=1;i<=10;i++) {
run("tab.show('tab"+i+"',false);",1);
}
//folder demo
run('print("组控件Demo...")',1);
var folder0=new CFolder({title:'Bill Gate的个人文件夹'});
var folder2=new CFolder({title:'界面风格'});
var folder1=new CFolder({title:'公文流转'});
addScript([
"$('dvLeft').appendChild(folder2.view)",
"$('dvLeft').appendChild(folder0.view)",
"$('dvLeft').appendChild(folder1.view)",
'print("添加项到组...")',
"folder2.add(new CItem({title:'粉绿�
- 1
- 2
前往页