📄 timeline.js
字号:
w = ddw;
}
profile.box._moveActive(profile, profile.$active, x, w);
},
onDragstop:function(profile, e, src){
var box=profile.box,
r = profile.box._deActive(profile),
ac=profile.$active;
var from=box._getTime(profile, r.left),
to=box._getTime(profile,r.left+r.width);
if(profile.properties.multiTasks){
if(profile.beforeTaskUpdated && false===profile.boxing().beforeTaskUpdated(profile, profile.getItemByDom(src), from, to)){}else
box._resetItem(profile,r,src);
}else
profile.boxing().setUIValue(from+":"+to);
profile.$dd_type = null;
linb([ac,ac.parentNode]).css('cursor','');
}
},
HEAD:{
onMousedown:function(profile, e, src){
var ps=profile.properties, item=profile.getItemByDom(src);
if(ps.disabled || item.disabled)return;
if(profile.beforeDragTask && false===profile.boxing().beforeDragTask(profile, item, e, src))
return;
if(ps.readonly||item.readonly)return;
linb([src]).parent(2).startDrag(e, {
dragDefer:1,
dragType:'none'
});
}
},
LEFT:{
onMousedown:function(profile, e, src){
var ps=profile.properties, item=profile.getItemByDom(src);
if(ps.disabled || ps.readonly || item.readonly || item.disabled)return;
profile.$dd_type='left';
linb([src]).parent(2).startDrag(e, {
dragDefer:1,
dragType:'none'
});
}
},
RIGHT:{
onMousedown:function(profile, e, src){
var ps=profile.properties, item=profile.getItemByDom(src);
if(ps.disabled || ps.readonly || item.readonly || item.disabled)return;
profile.$dd_type='right';
linb([src]).parent(2).startDrag(e, {
dragDefer:1,
dragType:'none'
});
}
}
},
DataModel:{
$borderW : 1,
readonly:false,
// control width and height
width : 400,
height : 200,
//invisible band count (left,right)
//if it's zero, leftSpanCount will be equal to the visible span count(based on widget width)
leftSpanCount:{
ini:0,
inner:1
},
rightSpanCount:{
ini:0,
inner:1
},
increment:0,
zoomable:{
ini:true,
action:function(v){
if(this.properties.timeSpanKey)
this.getSubNodes(['ZOOMIN','ZOOMOUT']).css('display',v?'':'none');
}
},
dftTaskName:'task',
taskHeight:{
ini:16,
action:function(v){
this.getSubNode('ITEM',true).height(v);
}
},
//time span key
timeSpanKey : {
ini:'1 d',
action:function(){
this.box._refresh(this);
}
},
// how much px to represent a unit
// defalut value is from timeSpanKey
unitPixs : {
action:function(){
this.box._refresh(this);
}
},
/*
*inner properties
*defalut value is from timeSpanKey
*/
//time span count
smallLabelCount:{
inner:1
},
//time span unit
smallLabelUnit:{
inner:1,
listbox:_.toArr(linb.Date.$TIMEUNIT,true)
},
//small label format
smallLabelFormat:{
inner:1,
listbox:_.toArr(linb.Date.$TEXTFORMAT,true)
},
bigLabelCount:{
inner:1
},
//time span unit
bigLabelUnit:{
inner:1,
listbox:_.toArr(linb.Date.$TIMEUNIT,true)
},
//big label format
bigLabelFormat:{
inner:1,
listbox:_.toArr(linb.Date.$TEXTFORMAT,true)
},
//time format
timeFormat:{
inner:1,
listbox:_.toArr(linb.Date.$TEXTFORMAT,true)
},
/*inner properties*/
//bar
showBar:{
ini:true,
action:function(v){
this.getSubNode('BAR').css('display',v?'':'none');
var p=this.properties,w=p.width,h=p.height;
p.width=p.height=0;
linb.UI.$tryResize(this,w,h);
p.width=w,p.height=h;
}
},
//tips
showTips:{
ini:true,
action:function(v){
this.getSubNode('TIPS').css('display',v?'':'none');
var p=this.properties,w=p.width,h=p.height;
p.width=p.height=0;
linb.UI.$tryResize(this,w,h);
p.width=w,p.height=h;
}
},
//big label
showBigLabel: {
ini:true,
action:function(v){
this.getSubNode('BIGLABEL').css('display',v?'':'none');
var p=this.properties,w=p.width,h=p.height;
p.width=p.height=0;
linb.UI.$tryResize(this,w,h);
p.width=w,p.height=h;
}
},
_barHeight : 22,
_tipsHeight : 16,
_bigLabelHeight : 16,
_smallLabelHeight : 14,
_scrollRate:5,
multiTasks: {
ini:false,
action:function(){
this.box._refresh(this);
}
},
minDate:{
ini:null,
action:function(value){
if(value>this.properties.dateStart)
this.box._refresh(this);
}
},
maxDate:{
ini:null,
action:function(value){
var p=this.properties;
if(value<linb.Date.add(p.dateStart,'ms',p.width*p._rate))
this.box._refresh(this);
}
},
dateBtn:{
ini:true,
action:function(v){
this.getSubNode('DATE').css('display',v?'':'none');
}
},
closeBtn:{
ini:false,
action:function(v){
this.getSubNode('CLOSE').css('display',v?'':'none');
}
},
optBtn:{
ini:false,
action:function(v){
this.getSubNode('OPT').css('display',v?'':'none');
}
},
fixWidth:true,
dateStart : {
ini:new Date,
action:function(){
this.box._refresh(this);
}
}
},
EventHandlers:{
beforeClose:function(profile, src){},
onShowOptions:function(profile, e, src){},
onGetContent:function(profile, from, to, minMs, type, callback, threadid){},
beforeTaskUpdated:function(profile, task, from, to){},
beforeNewTasks:function(profile, tasks){},
beforeDelTasks:function(profile, arr){},
beforeDragTask:function(profile, task, e, src){},
onClickTask:function(profile, task, e, src){}
},
Appearances:{
BORDER:{
overflow: 'hidden',
position: 'relative',
'border-bottom':'solid 1px #C1C1C1'
},
'BAR-focus BART':{
$order:2,
'background-position' : 'right -22px'
},
'BART':{
border:0
},
'BARCMDL span':{
$order:0,
position:'relative',
width:'15px',
height:'15px',
'vertical-align': 'middle',
cursor:'default'
},
TIPS:{
'background-color':'#ECE9D8'
},
FOCUS:{
position:'absolute',
'font-size':'0',
width:'1px',
height:'1px',
left:'-100px',
top:'-100px',
'line-height':'0',
border:'0'
},
'BAND, VIEW, BIGLABEL, SMALLLABEL, TIPS':{
position:'relative'
},
'BAND, VIEW, TIPS':{
'border-left': 'solid 1px #C1C1C1',
'border-right': 'solid 1px #C1C1C1'
},
VIEW:{
width:linb.browser.ie6?'100%':null,
overflow:'hidden'
},
SCROLL:{
'z-index':500,
position:'absolute',
'font-size':'0',
'line-height':'0',
right:0,
top:0,
height:'100%',
width:'18px',
overflow:'auto',
'overflow-x':linb.browser.opr?null:'hidden'
},
SCROLLI:{
height:'1000px',
width:'1px'
},
'BIGLABEL, SMALLLABEL':{
'background-color':'#ECE9D8',
cursor:'move'
},
'BIGLABEL,SMALLLABEL':{
'border-bottom':'solid 1px #505050'
},
ITEMS:{
position:'relative',
background: linb.UI.$bg('bars.gif',' left top')
},
'BIGLABEL div, SMALLLABEL div':{
'border-left':'solid 1px #505050',
'text-align':'center',
position:'absolute',
cursor:'move',
"-moz-user-select":linb.browser.gek?'none':'',
top:0,
overflow:'visible',
height:'100%'
},
'BIGLABEL div':{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -