forked from 365CSI/iCSR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathicsr_core_templates.min.js
1 lines (1 loc) · 6.32 KB
/
icsr_core_templates.min.js
1
iCSR.Template("DueDate",function(){var e=this,i=e.days;for(isNaN(i)&&(e.output="<div onclick=\"iCSR.$update(this,'|ID|','|Name|',new Date())\" >|nodate|</div>"),e.colornr=0;e.range[e.colornr]<i;)e.colornr++;e.color=e.colors[e.colornr],e.absdays=Math.abs(i),0>i?e.label=e.past:0===i?(e.absdays="",e.label=e.today):i>0&&(e.label=e.future)},{colors:"|msRed|,#f7a,#fab,#fda,#cf9,|msGreen|",range:[-21,-14,-7,0,7],nodate:"No Date",today:"today",next:"next day",prev:"previous day",future:"|absdays| days left",past:"|absdays| days past",width:"145px",$clck:"<DIV onclick=\"var d=new Date('|value|');d.setDate(d.getDate()",$SPUpdate:"iCSR.$update(this,'|ID|','|Name|',new Date(d))\"",$pick:"<DIV class=|$CSSid|dayset>|$clck|-1);|$SPUpdate|>|prev|</DIV>|$clck|+1);|$SPUpdate| class=|$CSSid|tom>|next|</DIV></DIV>",$date:"<DIV style=float:left>|label|</DIV><DIV style=float:right>|value|</DIV>",$Styles:[{outerdiv:"<div class=|$CSSid| style=color:|contrast|;width:|width|>|$colortag|$date|$pick|</div>",CSS:[".|$CSSid|>DIV{position:relative}",".|$CSSid|dayset{top:-6px}",".|$CSSid|dayset>DIV{position:absolute;width:60%;opacity:0}",".|$CSSid|tom{right:0;text-align:right}",".|$CSSid|dayset>DIV:hover{opacity:1;cursor:pointer}"]}]}),iCSR.Template("Priority",function(){var e=this,i=0,t=e.choices.map(function(t,o){return e.nr=String(o),e.choice=t,e.priocolor=e.colors[o],e.textcolor=e.textcolors[o],e.value===t?(i=o,e.classname=e.$CSSidactive,e.color=e.priocolor,e.priolabel=e.label):(e.classname=e.$CSSidchoice,e.priolabel=" "),e.$edit||(e.classname+=" NonInteractive"),e.$replace(e.style.item)});e.$edit&&t[i].indexOf("click")>-1?e.choices=t:e.choices=t[i]},{choices:["(1) High","(2) Normal","(3) Low"],colors:"|msRed|,|msYellow|,|msGreen|",colortag:"DIV",textcolors:["beige","inherit","grey"],width:"110px",height:"20px",widthactive:"50%",widthchoice:"10px",fontsize:"11px",$SPUpdate:"iCSR.$update(this,'|ID|','|Name|'",$clk:"onclick=\"|$SPUpdate|,'|choice|');\"",$CSSid:"iCSRprio",$CSSidactive:"|$CSSid|_Current",$CSSidchoice:"|$CSSid|_Choice",image:"default",$Styles:[{outerdiv:"<div class='|$CSSid| |$CSSid||$edit| |$CSSid||Item.Status|'>|choices|</div>",item:'<div class="|classname| |$CSSid|" style="background:|priocolor|;color:|textcolor|" |$clk|>|priolabel|</div>',CSS:[".|$CSSid|false {width:auto}",".|$CSSid|true {width:|width|}",".|$CSSid|Completed {opacity:.2;zoom:.7}",".|$CSSid|Not {opacity:.7;zoom:.9}",".|$CSSid||$edit|>div {position:relative;float:left;display:inline;border:1px solid grey;font-size:|fontsize|;padding:1px}",".|$CSSidactive|{width:|widthactive|;text-align:center}",".|$CSSidactive|.NonInteractive {width:100%;display:block}",".|$CSSidchoice|{width:|widthchoice|;opacity:.4}",".|$CSSidchoice|:hover {opacity:1;cursor:pointer;border-color:black}"]},{outerdiv:"<div class='|$CSSid| |$CSSid||$edit| |$CSSid||Item.Status|'>|choices|$colortag|</div>",item:'<span class="|classname|" style="background:|priocolor|" |$clk|> |priolabel| </span>',CSS:[".|$CSSid|{}",".|$CSSid||$edit|>div {position:relative;float:left}",".|$CSSidactive|{width:|widthactive|;text-align:center;padding:2px}",".|$CSSidchoice|{opacity:.4}",".|$CSSidchoice|:hover {opacity:1;cursor:pointer;border-color:black}",".|$CSSidactive|.NonInteractive {width:100%;display:block}"]},{outerdiv:"<div class='|$CSSid|'>|choices|</div>",CSS:[".|$CSSid|{height:|height|}",".|$CSSidactive|.NonInteractive {width:100%;display:block}",".|$CSSidchoice|{width:|widthchoice|;opacity:.4}",".|$CSSidchoice|:hover {opacity:1;cursor:pointer;border-color:black}"],item:'<span class="|classname|" |$clk|><img src="/_layouts/images/kpi|image|-|nr|.gif"></span>'}]}),iCSR.Template("PercentComplete",function(){var e=this,i=10*Math.floor(e.valuenr/10),t=[100,90,80,70,60,50,40,30,20,10];e.bars=t.map(function(t,o){return e.nr=String(o),e.percentage=t,e.label=t,e.barclass="past",e.percent=t/100,t>e.valuenr?e.barclass="new":t===i&&(e.barclass="current"),e.barclass+="|$CSSid|",e.$replace(e.style.item)}),e.valuenr>0&&(e.percent=0,e.bars.push("<div class='reset|$CSSid|' |$clk|>|reset|</div>")),e.percent=String(e.percent)},{$grid:!0,colors:"pink",background:"lightgrey",scalecolor:"grey",scalesize:"75%",color:"|msBlue|",textcolor:"beige",hovercolor:"beige",hoverbarcolor:"green",percentsign:"<span style='display:inline-block;text-align:right;font-size:70%'> %</span>",rangecolor:"blue",labelcolor:"inherit",reset:"reset to 0",rangelabel:"<span style='color:|labelcolor|;display:inline-block;text-align:right;width:20px'>|valuenr|</span>|percentsign|",onchange:'onchange="|$SPUpdate|,this.value/100" ',oninput:'oninput="this.nextSibling.innerHTML=this.value;" ',width:"160px",height:"15px",CSSinset:"border-radius:1px;box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset",$CSSid:"iCSRbar",$SPUpdate:"iCSR.$update(this,'|ID|','|Name|'",$clk:"onclick=\"|$SPUpdate|,'|percent|')\" ",$Styles:[{outerdiv:"<div class='|$CSSid|'>|bars|</div>",item:"<div class='|barclass|' style='width:|percentage|%' |$clk|>|label|</div>",CSS:[".|$CSSid|{width:|width|;height:|height|;position:relative;float:left;background:|background|}",".|$CSSid|{font-family:arial;font-size:11px;color:|scalecolor|}",".|$CSSid|>div {position:absolute;text-align:right;font-size:|scalesize|;height:100%}",".|$CSSid|>div {border-right:1px solid #aaa}",".|$CSSid|>div:not(.current|$CSSid|):hover{color:|hovercolor|;font-size:100%;background:|hoverbarcolor|;z-index:4;;opacity:.8;cursor:pointer}",".|$CSSid|>div:not(.current|$CSSid|):hover:before{content:'>>';font-weight:bold}",".|$CSSid|>div:hover:after,.|$CSSid| .current|$CSSid|:after{content:'%'}",".|$CSSid| .current|$CSSid|{font-size:100%;z-index:3}",".|$CSSid| .current|$CSSid|{background:|color|;color:|textcolor|;|CSSinset|}",".|$CSSid| .reset|$CSSid|{z-index:3;width:10%;height:|height|;overflow:hidden;border-right:0px;color:transparent;padding:0 3px}",".|$CSSid| .reset|$CSSid|:hover{width:auto}"]}]}),iCSR.Template("Status",function(){var e=this;e.color=e.colors[e.value],"Waiting on someone else"===e.value&&(e.value="Waiting"),e.value=e.value.replace(/ /gi," ")},{colors:{"Not Started":"|msBlue|",Deferred:"|msBlue|","Waiting on someone else":"|msYellow|","In Progress":"|msYellow|",Completed:"|msGreen|"},width:"20px",fontsize:"11px",height:"15px",$CSSid:"iCSRstatus",$Styles:[{outerdiv:"<div class='|$CSSid|' style='background:|color|'> |value| </div>",CSS:[".|$CSSid|{font-size:|fontsize|;height:|height|;text-align:center;padding:2px 1px 2px 1px}"]}]});