/** * UskyJS * Create By yaoqiang2003@126.com */ Date.prototype.Format = function(fmt) { //author: meizz var o = { "M+" : this.getMonth()+1, //月份 "d+" : this.getDate(), //日 "h+" : this.getHours(), //小时 "m+" : this.getMinutes(), //分 "s+" : this.getSeconds(), //秒 "q+" : Math.floor((this.getMonth()+3)/3), //季度 "S" : this.getMilliseconds() //毫秒 }; if(/(y+)/.test(fmt)) fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); for(var k in o) if(new RegExp("("+ k +")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length))); return fmt; } var removeDIV=function(id){ var obj = document.getElementById(id); var parent = obj.parentNode; parent.removeChild(obj); } var setDivPosition = function(div,left,top){ if(div!=null){ div.style.position = 'absolute'; div.style.top =(div.parentNode.offsetTop+ Number(top))+'px'; div.style.left =(div.parentNode.offsetLeft+ Number(left))+'px'; } }; var maxZIndex = function(div){ var max = 0; var divs = div.children; for(var n=0;nmax) max = divs[n].style.zIndex; } } return Number(max); } var createSubMenu = function(div,items,target,dir){ var mdiv = div;//document.createElement('div'); for(var n=0;n'+menus[n].name+''; datediv.disabled='disabled'; li.appendChild(datediv); }else if(menus[n].type=='systime_label'){ var li = document.createElement('li'); li.setAttribute('class','nav-item'); ul.appendChild(li); var datediv = document.createElement('a'); datediv.setAttribute('class','nav-link active'); datediv.innerHTML=''+(new Date()).Format("yyyy-MM-dd hh:mm:ss")+''; datediv.disabled='disabled'; li.appendChild(datediv); }else if(menus[n].type=='group'){ var dir = (menus[n].side=='right')?'dropleft':'dropright'; var li = document.createElement('li'); li.setAttribute('class','nav-item dropdown'); ul.appendChild(li); var link = document.createElement('a'); link.setAttribute('class','nav-link dropdown-toggle'); link.setAttribute('data-toggle','dropdown'); link.setAttribute('data-submenu',''); link.innerHTML=menus[n].name; li.appendChild(link); var subdiv = document.createElement('div'); if(menus[n].side=='right') subdiv.setAttribute('class','dropdown-menu dropdown-menu-right'); else subdiv.setAttribute('class','dropdown-menu'); li.appendChild(subdiv); if(menus[n].items!=undefined){ createSubMenu(subdiv,menus[n].items,this.config.target,dir); } } } } } } var UDockBar = function(){ }