BBwObj={cls:'',bbwskin:'001',menukd:'full',colskd:'',currMenu:'',currPage:0,touchStartTime:0,currTouchSeq:0,menuDiv:undefined,addDiv:undefined,currDiv:undefined,httpScript:'',penColor:'#000000',penThick:1,defColor:'',hlgColor:'#9cff00',hlgThick:10,hlgAlpha:0.7,memobgColor:'#FFE99C',memofntColor:'#000000',memofntFamily:'돋움',memofntSize:'12',memoIdx:0,armemoObj:[],tempPt:[],bbwsData:[],memoData:[],currArea:undefined,downKind:0,tmpWidth:0,tmpHeight:0,areaWidth:0,areaHeight:0};BBwObj.onload_func2=function(){if(BBwObj.menukd==="full"||BBwObj.menukd==="memo"){if(document.getElementById('bbwpencolshow'))BBwObj.penColor=document.getElementById('bbwpencolshow').getAttribute("fill");if(document.getElementById('memobgcolshow'))BBwObj.memobgColor=document.getElementById('memobgcolshow').getAttribute("fill");if(document.getElementById('memofntcolshow'))BBwObj.memofntColor=document.getElementById('memofntcolshow').getAttribute("fill");if(document.getElementById('bbwline1thbtn'))document.getElementById('bbwline1thbtn').setAttribute("class","bbw_btnE001-down");BBwObj.menuDiv=document.getElementById('bbwmenu');} BBwInfo.applyBBw=true;BBwObj.cls="5"+CataInfo.incview+"D"+BBwObj.bbwskin;BBwObj.do_afterMainFinish();} BBwObj.do_afterMainFinish=function(){BBwObj.currPage=PageInfo.get_imagePage(PageInfo.currentPage);BBwObj.bbwsData=["",""];BBwObj.memoData=["",""];BBwObj.retrieve_data("all","open");} BBwObj.after_retdata=function(scaller){var sevt="none";if(scaller==="turn"&&BBwObj.menuDiv&&BBwObj.menuDiv.style.visibility=="visible"&&BBwObj.currMenu!=="")sevt="auto";var memo=BBwObj.memoData[0]+BBwObj.memoData[1];if(memo!=="")BBwObj.show_memoData();var bbws=BBwObj.bbwsData[0]+BBwObj.bbwsData[1];if(bbws!==""||sevt==="auto")load_blackboard(true,sevt);} BBwObj.prepare_turnover=function(){if(BBwObj.currMenu=="memoplus"){document.getElementById(BBwObj.currMenu+"btn").className=BBwObj.currMenu+"btn"+BBwObj.cls+" bbw_btnE001";BBwObj.currMenu="";} if(bboardSvg){bboardSvg.prepare_turnover();unload_blackboard();} else{if(Action.mainState==="blackboard")Action.restoreState();} BBwObj.store_memoData();var nodes=memoDiv.childNodes;if(nodes.length>0){for(var i=nodes.length-1;i>=0;i--){memoDiv.removeChild(nodes[i]);}} BBwObj.addDiv=undefined;BBwObj.currDiv=undefined;memoDiv.innerHTML="";BBwObj.armemoObj=[];BBwObj.memoData="";} BBwObj.finish_turnover=function(){BBwObj.currPage=(BBwInfo.storeWhere==="db")?PageInfo.currentPage:PageInfo.get_imagePage(PageInfo.currentPage);BBwObj.bbwsData=["",""];BBwObj.memoData=["",""];BBwObj.retrieve_data("all","turn");} BBwObj.onresize_func=function(){if(BBwObj.menuDiv.style.visibility=="visible")BBwObj.loc_bbwmenu();var obj,sid,divid,rx,ry;for(var i=0;i0)return;if(BBwObj.menuDiv.style.visibility=="visible"){BBwObj.bbwclosebtnClick();} else{BBwObj.menuDiv.style.visibility="visible";BBwObj.loc_bbwmenu();if(BBwObj.menukd==="memo"){BBwObj.bbwmenuClick("memoplus");} else{if(!bboardSvg)load_blackboard(true,'none');}}} BBwObj.bbwclosebtnClick=function(){if(BBwObj.menuDiv.style.visibility=="visible"){BBwObj.menuDiv.style.visibility="hidden";bbwDiv.style.pointerEvents="none";} if(BBwObj.currMenu==="memoplus"&&BBwObj.addDiv){memoDiv.removeChild(BBwObj.addDiv);BBwObj.currDiv=undefined;} BBwObj.currMenu="";if(Action.mainState==="blackboard")Action.restoreState();} BBwObj.bbwmenuClick=function(s){if(BBwObj.get_permit('drawmenu')===false)return;if(BBwObj.menukd==="full"&&BBwObj.addDiv){memoDiv.removeChild(BBwObj.addDiv);BBwObj.addDiv=undefined;BBwObj.currDiv=undefined;} var sbtn=s+"btn";if(BBwObj.currMenu===s){if(s==="memoplus"&&BBwObj.addDiv){memoDiv.removeChild(BBwObj.addDiv);BBwObj.addDiv=undefined;} if(s==="bbwhlg"&&BBwObj.menukd==="hlmm"){document.getElementById('erabtn').style.display="none";} document.getElementById(sbtn).className=sbtn+BBwObj.cls+" bbw_btnE001";if(Action.mainState==="blackboard")Action.restoreState();bbwDiv.style.pointerEvents="none";BBwObj.currMenu="";return;} var armenu;if(BBwObj.menukd==="full")armenu=["bbwpenbtn","bbwhlgbtn","bbwlinebtn","bbwrectbtn","bbwccbtn","bbwerabtn","memoplusbtn"];else if(BBwObj.menukd==="hlmm")armenu=["bbwhlgbtn","memoplusbtn"];else if(BBwObj.menukd==="memo")armenu=["memoplusbtn"];var smenu;for(var i=0;i" +"

"+BBwObj.get_memoFirstLine(obj.cont)+"

";else s+="onmousedown=\"BBwObj.memoTitleDown(event,'"+divid+"');\">"+BBwObj.get_memoFirstLine(obj.cont)+"

";s+="\n";} memoDiv.insertAdjacentHTML('beforeend',s);} BBwObj.store_memoData=function(){var obj,s="",s2="";if(BBwInfo.loc==="win"){for(var i=0;i

":"onmousedown=\"BBwObj.memoTitleDown(event,'"+sid+"s');\">";s+="" +"

" +"";memoDiv.insertAdjacentHTML('beforeend',s);BBwObj.addDiv=document.getElementById(sid+"s");BBwObj.memoIdx++;} BBwObj.memoclosebtnClick=function(idx,ds){BBwObj.currDiv=document.getElementById(ds);if(BBwObj.currDiv.getAttribute("data-mem")=="1"){BBwObj.armemoObj.splice(idx,1);BBwObj.store_memoData();memoDiv.removeChild(BBwObj.currDiv);BBwObj.currDiv=undefined;} else{memoDiv.removeChild(BBwObj.addDiv);BBwObj.addDiv=undefined;} document.getElementById("memoplusbtn").className="memoplusbtn"+BBwObj.cls+" bbw_btnE001";BBwObj.currMenu="";if(Action.mainState==="blackboard")Action.restoreState();} BBwObj.memominbtnClick=function(n,s){var sDiv=document.getElementById(s+"s");var minmax=sDiv.getAttribute("data-minmax");var idx=parseInt(sDiv.getAttribute("data-idx"));if(minmax=="max"){var sval=document.getElementById(s+"t").value;if(sval=="")return;sDiv.className="bbw_memomin"+BBwObj.cls;sDiv.style.background="linear-gradient(to right, "+sDiv.style.backgroundColor+" 210px, #ffc600 30px)";document.getElementById(s+"p").className="bbw_memominp"+BBwObj.cls;document.getElementById(s+"p").innerHTML=BBwObj.get_memoFirstLine(sval);document.getElementById(s+"t").style.display="none";sDiv.setAttribute("data-minmax","min");document.getElementById("memoplusbtn").className="memoplusbtn"+BBwObj.cls+" bbw_btnE001";if(Action.mainState==="blackboard")Action.restoreState();BBwObj.currMenu="";} else{sDiv.className="bbw_memo"+BBwObj.cls;sDiv.style.background=BBwObj.armemoObj[idx].bgcol;document.getElementById(s+"p").className="bbw_memobtn"+BBwObj.cls;document.getElementById(s+"p").innerHTML="";document.getElementById(s+"t").style.display="inline";sDiv.setAttribute("data-minmax","max");}} BBwObj.memominbtnTouch=function(e,n,s){var now=new Date();var atime=now.getTime();var diffTime=atime-BBwObj.touchStartTime;if(diffTime<=300){e.preventDefault();BBwObj.memominbtnClick(n,s);return;} BBwObj.touchStartTime=atime;} BBwObj.memotxtFocus=function(idx,s){Action.keyDownBlock=true;Action.resizeLocking=true;} BBwObj.memotxtBlur=function(idx,s){BBwObj.currDiv=document.getElementById(s+"s");var memin=BBwObj.currDiv.getAttribute("data-mem");var idx=parseInt(BBwObj.currDiv.getAttribute("data-idx"));var sval=document.getElementById(s+"t").value;if(sval==""){if(memin=="0")return;BBwObj.armemoObj.splice(idx,1);memoDiv.removeChild(BBwObj.currDiv);BBwObj.currDiv=undefined;} else{if(memin=="0"){var currtArea=document.getElementById(s+"t");var tcolor=BBwObj.currDiv.style.backgroundColor;if(tcolor.substr(0,1)!=="#")tcolor=BBwObj.memobgColor;var nleft=parseInt(BBwObj.currDiv.style.left.replace("px",""));var ntop=parseInt(BBwObj.currDiv.style.top.replace("px",""));var cwidth=(BBwInfo.loc==="win")?stageWidth:ScreenInfo.smImageWidth;var cheight=(BBwInfo.loc==="win")?stageHeight:ScreenInfo.smImageHeight;var npage=BBwObj.currPage;if(BBwInfo.loc==="smcsync"){if(ScreenInfo.onesmc===false&&nleft>=smRect.centerPt.x){npage=BBwObj.currPage+1;nleft-=smRect.centerPt.x;} else{nleft-=smRect.x;} ntop-=smRect.y;} var obj=new memoObj(npage,nleft,ntop,tcolor,currtArea.style.fontFamily,currtArea.style.fontSize.replace("px",""),currtArea.style.color,cwidth,cheight,sval);BBwObj.armemoObj[idx]=obj;BBwObj.currDiv.setAttribute("data-mem","1");BBwObj.addDiv=undefined;} else{var obj=BBwObj.armemoObj[idx];var nleft=parseInt(BBwObj.currDiv.style.left.replace("px",""));var ntop=parseInt(BBwObj.currDiv.style.top.replace("px",""));if(BBwInfo.loc==="smcsync"){if(obj.npage===BBwObj.currPage&&nleft>smRect.centerPt.x)obj.npage+=1;else if(obj.npage===BBwObj.currPage+1&&nleft15)return lines[0].substr(0,15);return lines[0];} BBwObj.loc_bbwmenu=function(){var arearect=document.getElementById('bbwritebtn').getBoundingClientRect();BBwObj.menuDiv.style.left=arearect.left+"px";if((arearect.left+BBwObj.menuDiv.clientWidth)>cataRect.right){BBwObj.menuDiv.style.left=(cataRect.right-BBwObj.menuDiv.clientWidth)+"px";}} BBwObj.get_permit=function(s){if(s==="open"){if(PermitMan.normalPerm(-1)===false)return false;} else if(s=="drawmenu"){if(PermitMan.includePerm(-1,"blackboard")===false)return false;} return true;} BBwObj.get_alertString=function(s){if(s==="notdata")return"데이터 형식이 맞지 않습니다.(cate)";else if(s==="permission")return"디렉토리에 대한 변경 권한이 없습니다.";else if(s==="existdata")return"폴더내에 파일이 존재합니다.";return s;} BBwObj.memoTitleDown=function(e,ds){e.preventDefault();BBwObj.memoTitleDown2(e.clientX,e.clientY,ds);BBwObj.downKind=1;} BBwObj.memoTitleTouch=function(e,ds){BBwObj.memoTitleDown2(e.touches[0].clientX,e.touches[0].clientY,ds);document.addEventListener("touchmove",BBwObj.do_touchMove,false);} BBwObj.memoTitleDown2=function(ax,ay,ds){BBwObj.currDiv=document.getElementById(ds);BBwObj.tempPt.push(parseInt(BBwObj.currDiv.style.left.replace("px","")),parseInt(BBwObj.currDiv.style.top.replace("px","")));BBwObj.tempPt.push(ax,ay);Action.mouseDragClip=BBwObj;} BBwObj.memotxtDown=function(e,ds){return;BBwObj.downKind=2;clickX=e.clientX;clickY=e.clientY;BBwObj.currDiv=document.getElementById(ds+"s");BBwObj.currArea=document.getElementById(ds+"t");var tstyle=window.getComputedStyle(BBwObj.currDiv);BBwObj.tmpWidth=parseInt(tstyle.getPropertyValue("width").replace("px",""));BBwObj.tmpHeight=parseInt(tstyle.getPropertyValue("height").replace("px",""));BBwObj.areaWidth=BBwObj.currArea.clientWidth;BBwObj.areaHeight=BBwObj.currArea.clientHeight;Action.mouseDragClip=BBwObj;} BBwObj.do_touchMove=function(e){if(Action.mouseDragClip!=undefined){Action.mouseDragged=true;BBwObj.do_mouse2Drag(e.touches[0].clientX,e.touches[0].clientY);}} BBwObj.do_touchEnd=function(){BBwObj.do_mouse2Up();BBwObj.currTouchSeq=0;} BBwObj.do_mouseDrag=function(e){if(BBwObj.downKind===2){var aw=e.clientX-clickX;var ah=e.clientY-clickY;var tw=BBwObj.areaWidth+aw+20;var th=BBwObj.areaHeight+ah+38;if(tw<100)tw=100;else if(tw>ScreenInfo.smImageWidth)tw=ScreenInfo.smImageWidth;if(th<100)th=100;else if(th>ScreenInfo.smImageHeight)th=ScreenInfo.smImageHeight;BBwObj.currDiv.style.width=tw+"px";BBwObj.currDiv.style.height=th+"px";} else if(BBwObj.downKind===1){BBwObj.do_mouse2Drag(e.clientX,e.clientY);} return true;} BBwObj.do_mouse2Drag=function(ax,ay){var posX=ax-BBwObj.tempPt[2]+BBwObj.tempPt[0];var posY=ay-BBwObj.tempPt[3]+BBwObj.tempPt[1];if(posXcataRect.right-BBwObj.currDiv.clientWidth)posX=cataRect.right-BBwObj.currDiv.clientWidth;if(posYcataRect.bottom-BBwObj.currDiv.clientHeight)posY=cataRect.bottom-BBwObj.currDiv.clientHeight;BBwObj.currDiv.style.left=posX+"px";BBwObj.currDiv.style.top=posY+"px";} BBwObj.do_mouseUp=function(e){BBwObj.downKind=0;BBwObj.do_mouse2Up();} BBwObj.do_mouse2Up=function(){BBwObj.tempPt=[];if(Action.mouseDragged===true){var idx=parseInt(BBwObj.currDiv.getAttribute("data-idx"));if(!BBwObj.armemoObj[idx])return;var obj=BBwObj.armemoObj[idx];var nleft=parseInt(BBwObj.currDiv.style.left.replace("px",""));var ntop=parseInt(BBwObj.currDiv.style.top.replace("px",""));var cwidth=(BBwInfo.loc==="win")?stageWidth:ScreenInfo.smImageWidth;var cheight=(BBwInfo.loc==="win")?stageHeight:ScreenInfo.smImageHeight;if(BBwInfo.loc==="smcsync"){if(ScreenInfo.onesmc===false){if(obj.npage===BBwObj.currPage&&nleft>smRect.centerPt.x)obj.npage+=1;else if(obj.npage===BBwObj.currPage+1&&nleft