var ViewerApp={Router:{},Models:{},Collections:{},Views:{},App:{},Templates:{},Config:{},mediator:{},Modules:{}};ViewerApp.Models.Domain=Backbone.Model.extend({defaults:{id:0,url:""},initialize:function(e,i){}}),ViewerApp.Collections.DomainList=Backbone.Collection.extend({model:ViewerApp.Models.Domain,localStorage:new Store("meclib-domain"),comparator:function(e){return e.get("id")},getMaxId:function(){var e=0;if(this.length>0){var i=this.max((function(e){return e.id}));e=parseInt(i.get("id"),10)}return e}}),ViewerApp.Models.StorageBookInfo=Backbone.Model.extend({defaults:{id:0,key:"",value:"",date:""},initialize:function(e,i){}}),ViewerApp.Collections.StorageBookInfoList=Backbone.Collection.extend({model:ViewerApp.Models.StorageBookInfo,localStorage:new Store("meclib-bookinfo-storage"),comparator:function(e){return e.get("id")},getMaxId:function(){var e=0;if(this.length>0){var i=this.max((function(e){return e.id}));e=parseInt(i.get("id"),10)}return e}}),ViewerApp.Models.Design=Backbone.Model.extend({defaults:{id:"",skin_no:"",bgcolor:"",link:"",highlight:0,newscolor:0},initialize:function(e,i){},validate:function(e){},url:function(){},parse:function(e){return""!==e.bgcolor&&("#"===e.bgcolor.substring(0,1)&&7===e.bgcolor.length?!1===e.bgcolor.match(/[^0-9a-zA-Z]/g)&&(e.bgcolor=""):e.bgcolor=""),""!==e.highlight&&(e.highlight.alpha=.5),e}}),ViewerApp.Models.Viewer=Backbone.Model.extend({defaults:{nowloading:0,device:1,touchIf:!1,page:1,viewMode:0,type:"PUBLIC",mode:"",autoFlipMode:"",autoFlipDir:"",moveMotion:"",moveType:"flip",action:"slide",scale:1,imageScale:1,moveDir:0,dataPath:"./",menu:"",flippableSpace:50,flipSpeed:"4500",autoflipSpeed:"",autoflipSpeedSlow:"6000",autoflipSpeedNormal:"4000",autoflipSpeedFast:"1000",options:{comment_area:1,fusen:1,news:1,memo:1,link:1,movie:1,highlight:1,embed:1,tooltip:1,flip:1,slide:1,noeffect:0},optionIncludes:{comment:0,news:0,link:0,movie:0,txtsearch:0,embed:0,booklink:0,externalapi:0,bookindex:0,pagenumber:0},enabedOptions:{browsingHistory:1,crop:1,comment:1,comment_deletable:1,fusen:1,news:1,booklink:1,bookindex:1,memo:0,link:0,movie:1,highlight:1,embed:1,tooltip:1,automove:1,open:1,unit:1,grid:1,flip:1,slide:1,noeffect:0},systemAllows:{news:1,link:1,browsingHistory:1,crop:1,comment:1,comment_deletable:1,fusen:1,movie:0,embed:0,booklink:0,externalapi:0,bookindex:0,pagenumber:0},rotate:0,sid:"",movePageNum:1,menuOpen:0,selected:!1,dragging:!1,flipLoop:"",flipTime:0,flipCurled:!1,moving:!1,flipping:!1,flipX:0,flipY:0},events:{},initialize:function(e,i){},validate:function(e){if(0===e.text.length)return""}}),ViewerApp.Models.Menu=Backbone.Model.extend({defaults:{fusenListSelect:0}}),ViewerApp.Modules.Book=function(){this.basePath="../pageview/",this.bookId="",this.tplVer="",this.verCode=0,this.verNum=0,this.uniId="",this.timestamp="",this.imgtimestamp="",this.totalPage=0,this.pageOpenDir=0,this.docSize=0,this.cover=0,this.twopage=0,this.shadow=0,this.zoomPageMove=0,this.zoom={x2:0,x4:1,x6:1,x8:1},this.zoomMax=0,this.jpg_files={x2:1,x4:1,x6:1},this.public=0,this.publicSettings=[],this.publishType=0,this.analytics_flg=0,this.webpropertyid="",this.gaMeasurementId="",this.thumbWidth=0,this.thumbHeight=0,this.sliceWidth=0,this.sliceHeight=0,this.moveType=0,this.allPdfName="",this.pdf=0,this.allPdf=0,this.crop=0,this.link=0,this.bookindex=0,this.bookindexLaunch=0,this.txtsearch=0,this.booklink=0,this.sns1=0,this.sns2=0,this.sns3=0,this.sns4=0,this.sns5=0,this.video=0,this.audio=0,this.highlight=0,this.embed=0,this.print=0,this.printSetting={nowpage:1,pageselect:1,allpage:1,fusenprint:1},this.news=0,this.label=0,this.memo=0,this.txtcopy=0,this.autoMove=0,this.comment=0,this.commentDeletable=0,this.bookinfo=0,this.book_db=0,this.page_db=0,this.page_db_label="",this.mybookshelfFlg=0,this.expirationDate=0,this.newestBookFlg=0,this.dlFilename=0,this.dlSize=0,this.dlNum=0,this.mainmenuOverlay=0,this.logo=0,this.logoUrl="",this.logoType="png",this.logoOpentype=0,this.slice2LandNum=0,this.slice2PortNum=0,this.slice4LandNum=0,this.slice4PortNum=0,this.slice6LandNum=0,this.slice6PortNum=0,this.slice8LandNum=0,this.slice8PortNum=0,this.slice2Num=0,this.slice4Num=0,this.slice6Num=0,this.slice8Num=0,this.jpegImages={},this.loadImageCompleteFlg=!1,this.currentPage=1,this.defaultMoveType=0,this.enabledMoveType={},this.pageNumList={}},ViewerApp.Modules.Book.prototype.init=function(){1===arguments.length&&(this.basePath=arguments[0])},ViewerApp.Modules.Book.prototype.getName=function(){return this.name},ViewerApp.Modules.Book.prototype.loadInit=function(e){Meclib.Property.loading=60;var i=this.basePath+"data/book.txt",t=this,o=e;$.ajax({type:"GET",scriptCharset:"utf-8",cache:!1,url:i}).done((function(e){null===$.parseJSON(e)&&console.info("JSON Parse Error");var i=$.parseJSON(e);t.setJson(i),t.initComplete(),o(),Meclib.Cache.fileCache="?"+t.getImgtimestamp()})).fail((function(e){console.info("Error:book data not found")}))},ViewerApp.Modules.Book.prototype.initComplete=function(e){Meclib.Property.loading=70,this.setSliceSizes();for(var i=0;i0&&t<=Meclib.Globals.book.totalPage&&(e=!0)}}catch(e){Meclib.Debug.log("error page validate",2)}}return e},ViewerApp.Modules.Book.prototype.getTotalPage=function(){return this.totalPage},ViewerApp.Modules.Book.prototype.getImgtimestamp=function(){var e="";return this.imgtimestamp&&(e=this.imgtimestamp),e},ViewerApp.Modules.Book.prototype.getLeftPage=function(){return 0===arguments.length?this.getOpenPageNo(0):1===arguments.length?this.getOpenPageNo(0,arguments[0]):void 0},ViewerApp.Modules.Book.prototype.getRightPage=function(){return 0===arguments.length?this.getOpenPageNo(1):1===arguments.length?this.getOpenPageNo(1,arguments[0]):void 0},ViewerApp.Modules.Book.prototype.moveLeft=function(){var e=1;1===arguments.length&&(e=arguments[0]),0===this.pageOpenDir?(this.currentPage=this.currentPage-e,this.currentPage<1&&(this.currentPage=1)):(this.currentPage=this.currentPage+e,this.totalPage0&&(this.slice2LandNum+=1),this.slice2PortNum=parseInt(i/this.sliceHeight,10),i%this.sliceHeight>0&&(this.slice2PortNum+=1),this.slice2Num=this.slice2LandNum*this.slice2PortNum,e=4*this.thumbWidth,i=4*this.thumbHeight,this.slice4LandNum=parseInt(e/this.sliceWidth,10),e%this.sliceWidth>0&&(this.slice4LandNum+=1),this.slice4PortNum=parseInt(i/this.sliceHeight,10),i%this.sliceHeight>0&&(this.slice4PortNum+=1),this.slice4Num=this.slice4LandNum*this.slice4PortNum,e=6*this.thumbWidth,i=6*this.thumbHeight,this.slice6LandNum=parseInt(e/this.sliceWidth,10),e%this.sliceWidth>0&&(this.slice6LandNum+=1),this.slice6PortNum=parseInt(i/this.sliceHeight,10),i%this.sliceHeight>0&&(this.slice6PortNum+=1),this.slice6Num=this.slice6LandNum*this.slice6PortNum,e=8*this.thumbWidth,i=8*this.thumbHeight,this.slice8LandNum=parseInt(e/this.sliceWidth,10),e%this.sliceWidth>0&&(this.slice8LandNum+=1),this.slice8PortNum=parseInt(i/this.sliceHeight,10),i%this.sliceHeight>0&&(this.slice8PortNum+=1),this.slice8Num=this.slice8LandNum*this.slice8PortNum},ViewerApp.Modules.Book.prototype.getPageDir=function(e){var i=0;return 1===this.twopage&&(i=0===this.pageOpenDir?0===this.cover?e%2==0?0:1:e%2==0?1:0:0===this.cover?e%2==0?1:0:e%2==0?0:1),i},ViewerApp.Modules.Book.prototype.getOpenPageNo=function(e){var i=0,t=0,o=0,a=0;return 1==arguments.length?a=this.currentPage:2==arguments.length&&(a=arguments[1]),1===this.twopage?(0===this.getPageDir(a)?(i=a,t=0===this.pageOpenDir?this.totalPagethis.totalPage)return!1;if(this.pageNumList.length1&&"*"===t.substring(0,1)&&(t=""),t},ViewerApp.Modules.Book.prototype.getDisplayPageName=function(e){if(e<1||e>this.totalPage)return!1;if(this.pageNumList.length1&&"*"===t.substring(0,1)&&(t=t.substr(1)),t},ViewerApp.Modules.Book.prototype.getPageFileNo=function(e){var i=0,t=this.pageNumList.findWhere({text:e});return void 0===t||(i=t.get("id")),i},ViewerApp.Modules.Book.prototype.isMovabledPage=function(){var e=0,i=1;return arguments.length>0&&(e=arguments[0]),arguments.length>1&&(i=arguments[1]),0===e?(i=2===i?this.currentPage===this.getLeftPage()?1:this.currentPage===this.getRightPage()?2:1:1,0===this.pageOpenDir&&(i*=-1)):(i=2===i?this.currentPage===this.getLeftPage()?2:(this.currentPage,this.getRightPage(),1):1,1===this.pageOpenDir&&(i*=-1)),!(this.currentPage+i<=0)&&!(this.currentPage+i>this.totalPage)},ViewerApp.Modules.Book.prototype.getFlipStartPage=function(){var e=0;return 1==arguments.length&&(e=arguments[0]),1===this.twopage?0===e?this.getLeftPage():this.getRightPage():this.currentPage},ViewerApp.Modules.Book.prototype.getFlipReversePage=function(){var e=0,i=0;return 1==arguments.length&&(i=arguments[0]),(e=1===this.twopage?0===this.pageOpenDir?0===i?this.getLeftPage()-1:this.getRightPage()+1:0===i?this.getLeftPage()+1:this.getRightPage()-1:0===this.pageOpenDir?0===i?this.currentPage-1:this.currentPage+1:0===i?this.currentPage+1:this.currentPage-1)<1&&(e=1),e>this.totalPage&&(e=this.totalPage),e},ViewerApp.Modules.Book.prototype.getFlipUnderPage=function(){var e=0,i=0;return 1==arguments.length&&(i=arguments[0]),(e=1===this.twopage?0===this.pageOpenDir?0===i?this.getLeftPage()-2:this.getRightPage()+2:0===i?this.getLeftPage()+2:this.getRightPage()-2:0===this.pageOpenDir?0===i?this.currentPage-1:this.currentPage+1:0===i?this.currentPage+1:this.currentPage-1)<1&&(e=0),e>this.totalPage&&(e=0),e},ViewerApp.Modules.Book.prototype.getMovePageLog=function(e){var i={left:0,right:0};return 1===e?(i.left=this.getOpenPageNo(0),i.right=this.getOpenPageNo(1)):i.left=this.currentPage,i},ViewerApp.Modules.Book.prototype.getEnableNowPages=function(){var e=[];return 1===Meclib.Globals.bookCanvas.canvasNum?e.push(this.currentPage):2===Meclib.Globals.bookCanvas.canvasNum&&(this.getOpenPageNo(0)>0&&e.push(this.getOpenPageNo(0)),this.getOpenPageNo(1)>0&&e.push(this.getOpenPageNo(1))),e},ViewerApp.Modules.Book.prototype.isVisibledPage=function(e){return!0},ViewerApp.Modules.Book.prototype.setJson=function(e){var i=Meclib.Globals.viewer.get("device")-1;if(this.bookId=e.book_id,this.name=e.title,this.tplVer=e.tpl_ver,this.verCode=e.ver_code,this.verNum=e.ver_num,this.uniId=e.uni_id,this.timestamp=parseInt(e.timestamp,10),e.imgtimestamp?this.imgtimestamp=parseInt(e.imgtimestamp,10):this.imgtimestamp="",this.totalPage=parseInt(e.total_page,10),this.pageOpenDir=parseInt(e.page_open_dir,10),this.docSize=e.doc_size,this.cover=parseInt(e.cover,10),this.twopage=parseInt(e.twopage,10),0===this.twopage&&(Meclib.Globals.viewer.get("enabedOptions").open=0,Meclib.Globals.viewer.get("options").open=0,Meclib.Globals.viewer.set({viewMode:1})),this.shadow=parseInt(e.shadow,10),this.zoomPageMove=parseInt(e.zoom_page_move),e.enabled_move_type,e.zoom){switch(Meclib.Globals.viewer.get("device")){case 1:default:this.zoom=e.zoom[0];break;case 2:this.zoom=e.zoom[1];break;case 3:this.zoom=e.zoom[2]}this.zoom.x2=parseInt(this.zoom.x2,10),this.zoom.x4=parseInt(this.zoom.x4,10),this.zoom.x6=parseInt(this.zoom.x6,10),this.zoom.x8=parseInt(this.zoom.x8,10),1===this.zoom.x8?this.zoomMax=8:1===this.zoom.x6?this.zoomMax=6:1===this.zoom.x4?this.zoomMax=4:1===this.zoom.x2&&(this.zoomMax=2)}if(e.jpg_files&&(this.jpg_files.x2=parseInt(e.jpg_files.x2,10),this.jpg_files.x4=parseInt(e.jpg_files.x4,10),this.jpg_files.x6=parseInt(e.jpg_files.x6,10)),this.public=parseInt(e.public[i],10),e.public.length>0)for(var t=0;t-1||Meclib.Globals.ua.search("iPad")>-1||Meclib.Function.isIOSDesctopMode())&&e.scheme_name.ios&&(Meclib.App.scheme=e.scheme_name.ios),Meclib.Globals.ua.search("Android")>-1&&e.scheme_name.android&&(Meclib.App.scheme=e.scheme_name.android)),Meclib.Globals.viewer.get("enabedOptions").comment=this.comment,Meclib.Globals.viewer.get("enabedOptions").comment_deletable=this.commentDeletable,this.mybookshelfFlg=parseInt(e.mybookshelf_flg,10),this.expirationDate=e.expiration_date,this.newestBookFlg=parseInt(e.newest_book_flg,10),this.dlFilename=e.dl_filename,this.dlSize=e.dl_size,this.dlNum=parseInt(e.dl_num,10),void 0!==e.print_setting&&(this.printSetting=e.print_setting,this.printSetting.nowpage=parseInt(this.printSetting.nowpage,10),isNaN(this.printSetting.nowpage)&&(this.printSetting.now=0),this.printSetting.pageselect=parseInt(this.printSetting.pageselect,10),isNaN(this.printSetting.pageselect)&&(this.printSetting.pageselect=0),this.printSetting.allpage=parseInt(this.printSetting.allpage,10),isNaN(this.printSetting.allpage)&&(this.printSetting.allpage=0),this.printSetting.fusenprint=parseInt(this.printSetting.fusenprint,10),isNaN(this.printSetting.fusenprint)&&(this.printSetting.fusenprint=0),this.printSetting.memoprint=parseInt(this.printSetting.memoprint,10),isNaN(this.printSetting.memoprint)&&(this.printSetting.memoprint=0)),this.mainmenuOverlay=parseInt(e.mainmenu_overlay,10),1===this.mainmenuOverlay?Meclib.MainMenu.overlay=!0:Meclib.MainMenu.overlay=!1,this.logo=parseInt(e.logo,10),this.logoUrl=e.logo_url,e.logo_type&&(this.logoType=e.logo_type),this.logoOpentype=parseInt(e.logo_opentype,10),"MAINTE"===Meclib.Setting.type&&(this.shadow=0,Meclib.Globals.viewer.get("enabedOptions").flip=0,Meclib.Globals.viewer.get("enabedOptions").slide=0,Meclib.Globals.viewer.get("enabedOptions").noeffect=1,Meclib.Globals.viewer.set("moveType","none"),Meclib.MainMenu.overlay=!1,Meclib.Click.zoomClickNum=2,Meclib.Zoom.effect=!1),this.endpoint=1},ViewerApp.Modules.BookCanvas=function(){this.left=0,this.top=0,this.varticalSpace=10,this.canvasWidth=0,this.canvasHeight=0,this.drawWidth=0,this.drawHeight=0,this.canvasNum=1,this.scale=1},ViewerApp.Modules.BookCanvas.prototype={init:function(){},resize:function(){try{this.canvasNum=1,this.canvasWidth=Meclib.Function.getWinsize().width,this.canvasHeight=Meclib.Function.getWinsize().height;var e=0,i={width:0,height:0};switch(Meclib.Globals.viewer.get("device")){case 1:this.canvasHeight=Meclib.Function.getWinsize().height,!1===Meclib.MainMenu.overlay&&(this.canvasHeight=Meclib.Function.getWinsize().height-(Meclib.Size.headerHeight+Meclib.Size.footerHeight)),i.height=this.canvasHeight-2*this.varticalSpace,this.left=Meclib.Size.sideBar.width+Meclib.Size.thickness.width+5;break;case 2:this.canvasHeight=Meclib.Function.getWinsize().height,i.height=this.canvasHeight-2*this.varticalSpace,this.left=Meclib.Size.sideBar.width+Meclib.Size.thickness.width+5;break;case 3:this.canvasHeight=Meclib.Function.getWinsize().height,i.height=this.canvasHeight-2*this.varticalSpace,this.left=0;break;case 9:this.canvasHeight=Meclib.Function.getWinsize().height,i.height=this.canvasHeight-2*this.varticalSpace}i.width=this.canvasWidth-2*this.left,i.width>i.height?1===Meclib.Globals.book.twopage&&0===Meclib.Globals.viewer.get("viewMode")?(this.canvasNum=2,this.drawHeight=i.height,e=this.drawHeight/Meclib.Globals.book.thumbHeight,this.drawWidth=Math.ceil(Meclib.Globals.book.thumbWidth*e),2*this.drawWidth>i.width&&(e=i.width/2/this.drawWidth,this.drawHeight=Math.ceil(this.drawHeight*e),this.drawWidth=i.width/2)):(this.drawHeight=i.height,e=this.drawHeight/Meclib.Globals.book.thumbHeight,this.drawWidth=Math.ceil(Meclib.Globals.book.thumbWidth*e),this.drawWidth>i.width&&(e=i.width/this.drawWidth,this.drawHeight=Math.ceil(this.drawHeight*e),this.drawWidth=i.width)):Meclib.Globals.book.thumbWidth>=Meclib.Globals.book.thumbHeight?(this.drawHeight=i.height,e=this.drawHeight/Meclib.Globals.book.thumbHeight,this.drawWidth=Math.ceil(Meclib.Globals.book.thumbWidth*e),this.drawWidth>i.width&&(e=i.width/this.drawWidth,this.drawHeight=Math.ceil(this.drawHeight*e),this.drawWidth=i.width)):(this.drawWidth=i.width,e=this.drawWidth/Meclib.Globals.book.thumbWidth,this.drawHeight=Math.ceil(Meclib.Globals.book.thumbHeight*e),this.drawHeight>i.height&&(e=i.height/this.drawHeight,this.drawWidth=Math.ceil(this.drawWidth*e),this.drawHeight=i.height)),this.left=(this.canvasWidth-i.width)/2+(i.width-this.drawWidth*this.canvasNum)/2,this.top=(this.canvasHeight-this.drawHeight)/2,i.width>=i.height?Meclib.Globals.viewer.set({rotate:1}):Meclib.Globals.viewer.set({rotate:0}),this.setMovePageNum(),this.left=Meclib.Function.f2i(this.left),this.top=Meclib.Function.f2i(this.top),this.scale=this.drawWidth/Meclib.Globals.book.thumbWidth}catch(e){}},getCenterPos:function(){var e=parseInt($("#page-area").css("width").replace("px",""),10)/2;return e=Meclib.Function.f2i(e)},getSelectPage:function(e){var i=!1;arguments.length>1&&!0===arguments[1]&&(i=!0);var t=0;return 0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage?e>this.getCenterPos()?(t=Meclib.Globals.book.getRightPage(),!0===i&&0===t&&(t=Meclib.Globals.book.getLeftPage())):(t=Meclib.Globals.book.getLeftPage(),!0===i&&0===t&&(t=Meclib.Globals.book.getRightPage())):t=Meclib.Globals.book.currentPage,!1===i&&(ethis.left+this.drawWidth*this.canvasNum&&(t=0)),t},setMovePageNum:function(){var e=1;(1===Meclib.Globals.viewer.get("device")||2===Meclib.Globals.viewer.get("device")||3===Meclib.Globals.viewer.get("device"))&&(1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage&&(e=2),1===Meclib.Globals.viewer.get("viewMode")&&(e=1)),Meclib.Globals.viewer.set({movePageNum:e})},showCanvas:function(){$("#canvas-leftpage").show(),1===this.canvasNum?$("#canvas-rightpage").hide():$("#canvas-rightpage").show()},setFlipDir:function(e){var i=Meclib.Globals.bookCanvas.getCenterPos();Meclib.Canvas.flipDir=e=this.left&&e<=this.left+this.drawWidth*this.canvasNum&&(t=!0),t},isDraggabled:function(e,i){var t,o,a=!1;return t=this.left,o=this.left+2*this.drawWidth,t0&&(e=this.max((function(e){return e.id})).get("id"));return e}}),ViewerApp.Models.Embed=Backbone.Model.extend({defaults:{id:0,page_no:0,linkpage:0,link_url:"",tel:0,type:0,file_name:"",x:0,y:0,width:1,height:1,option:0},initialize:function(e,i){},parse:function(e){return e.page_no=parseInt(e.page_no,10),e.type=parseInt(e.type,10),e.linkpage=parseInt(e.linkpage,10),e.x=parseInt(e.x,10),e.y=parseInt(e.y,10),e.width=parseInt(e.width,10),e.height=parseInt(e.height,10),e.option=parseInt(e.option,10),e}}),ViewerApp.Collections.EmbedList=Backbone.Collection.extend({model:ViewerApp.Models.Embed,url:function(){return"MAINTE"===Meclib.Setting.type||"PREVIEW"===Meclib.Setting.type?"../config/data/embed.txt"+Meclib.Cache.fileCache:Meclib.Globals.viewer.get("dataPath")+"data/embed.txt"+Meclib.Cache.fileCache}}),ViewerApp.Models.Movie=Backbone.Model.extend({defaults:{id:0,page_no:0,type:0,x:0,y:0,width:1,height:1,pc:"",tablet:"",phone:"",ios:"",android:"",option:0},initialize:function(e,i){},parse:function(e){return e.page_no=parseInt(e.page_no,10),e.type=parseInt(e.type,10),e.x=parseInt(e.x,10),e.y=parseInt(e.y,10),e.width=parseInt(e.width,10),e.height=parseInt(e.height,10),e}}),ViewerApp.Collections.MovieList=Backbone.Collection.extend({model:ViewerApp.Models.Movie,url:function(){return"MAINTE"===Meclib.Setting.type||"PREVIEW"===Meclib.Setting.type?"../config/data/movie.txt"+Meclib.Cache.fileCache:Meclib.Globals.viewer.get("dataPath")+"data/movie.txt"+Meclib.Cache.fileCache}}),ViewerApp.Models.Highlight=Backbone.Model.extend({defaults:{id:"",page_no:0,text:"",x:0,y:0,width:1,height:1,option:0},initialize:function(e,i){},parse:function(e){return e.page_no=parseInt(e.page_no,10),e.x=parseFloat(e.x),e.y=parseFloat(e.y),e.width=parseFloat(e.width),e.height=parseFloat(e.height),e}}),ViewerApp.Collections.HighlightList=Backbone.Collection.extend({model:ViewerApp.Models.Highlight}),ViewerApp.Models.Txtcopy=Backbone.Model.extend({defaults:{id:"",page_no:0,text:"",x:0,y:0,width:1,height:1,option:0},initialize:function(e,i){},parse:function(e){return e.page_no=parseInt(e.page_no,10),e.x=parseFloat(e.x),e.y=parseFloat(e.y),e.width=parseFloat(e.width),e.height=parseFloat(e.height),e}}),ViewerApp.Collections.TxtcopyList=Backbone.Collection.extend({model:ViewerApp.Models.Txtcopy}),ViewerApp.Models.BrowsingHistory=Backbone.Model.extend({defaults:{id:0,uid:"",url:0,title:"",lastdate:"",option:0},initialize:function(e,i){}}),ViewerApp.Collections.BrowsingHistoryList=Backbone.Collection.extend({model:ViewerApp.Models.BrowsingHistory,localStorage:new Store("meclib-browsinghistory"),comparator:function(e){return e.get("lastdate")},getMaxId:function(){var e=0;this.length>0&&(e=this.max((function(e){return e.id})).get("id"));return e}}),ViewerApp.Modules.Analytics=function(){this.trackingFlg=!1,this.baseURL="",this.trackingId="",this.gaMeasurementId=""},ViewerApp.Modules.Analytics.prototype.init=function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&"LOCAL"!==Meclib.Setting.type){arguments.length>0&&(this.gaMeasurementId=arguments[0]),arguments.length>1&&(this.trackingId=arguments[1]);var e=location.pathname;if("/"!==e.slice(-1)){for(var i=e.split("/"),t="",o=i.length-1,a=0;a0&&0===i?o=e:e1&&(n+=(o-1)*Meclib.Constants.ANALYTICS_ZOOM_DIV),n=e+"_"+l+"_"+n,this.sendV4ZoomIn(n,e,l,t,o),this.sendUa(a)}}},ViewerApp.Modules.PublicUserAnalytics=function(){this.tracking=!1,this.post_url="/library/admin/site-log/new_bulk",this.get_url="/library/api/book-access-auth/get_analytics_settings",this.user_id="",this.guest_id="",this.guestuser_book_analytics=!1,this.publicuser_book_analytics=!1,this.queue=[]},ViewerApp.Modules.PublicUserAnalytics.prototype.init=function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&"LOCAL"!==Meclib.Setting.type&&1===Meclib.Globals.book.publishType){var e=this;$.ajax({type:"GET",data:[],url:this.get_url}).done((function(i){if(void 0!==i.user_id){var t=parseInt(i.user_id,10);isNaN(t)||(e.user_id=t)}void 0!==i.publicuser_book_analytics&&(1===parseInt(i.publicuser_book_analytics,10)&&(e.publicuser_book_analytics=!0));void 0!==i.guestuser_book_analytics&&(1===parseInt(i.guestuser_book_analytics,10)&&(e.guestuser_book_analytics=!0));if(void 0!==i.guest_id){var o=parseInt(i.guest_id,10);isNaN(o)||(e.guest_id=o)}!1===e.publicuser_book_analytics&&(e.user_id=""),(""!==e.user_id&&!0===e.publicuser_book_analytics||!0===e.guestuser_book_analytics)&&(Meclib.UserAnalytics.setTracking(!0),e.send())})).fail((function(){}))}},ViewerApp.Modules.PublicUserAnalytics.prototype.setTracking=function(e){this.tracking=e},ViewerApp.Modules.PublicUserAnalytics.prototype.setUserId=function(e){this.user_id=e},ViewerApp.Modules.PublicUserAnalytics.prototype.add=function(e,i,t){var o={page_no:i,target:"",operation:""},a=!1;switch(e){case"move":o.operation="book.view";break;case"move_first":o.operation="book.firstview",a=!0;break;case"crop":o.operation="book.crop",a=!0;break;case"pdf":o.operation="book.pdf",99999===i&&(o.operation="book.allpdf"),a=!0;break;case"zoom_in":o.operation="book.large",a=!0;break;case"print":o.operation="book.print";break;case"txtsearch":o.operation="book.searchkeyword",o.target=t,a=!0;break;case"pagesearch":o.operation="book.searchpage",a=!0;break;case"bookindex":o.operation="book.index",o.target=t,a=!0;break;case"ext_link":o.operation="book.link",a=!0;break;case"book_ext_link":o.operation="book.ext_link",a=!0}""!==o.operation&&(this.queue.push(o),a&&this.send())},ViewerApp.Modules.PublicUserAnalytics.prototype.addPrint=function(e,i){var t={};if(e===i||e>0&&0===i)t={page_no:e,target:"",operation:"book.print"},this.queue.push(t);else if(eMeclib.Constants.TAP_TIME||Math.abs(this.distanceX)>Meclib.Constants.TAP_DISTANCE||Math.abs(this.distanceY)>Meclib.Constants.PORT_SCROLL_DISTANCE?(this.init(),!1):(this.init(),!0)}},ViewerApp.Modules.ClickManager=function(){},ViewerApp.Modules.ClickManager.prototype={add:function(e,i,t){var o=Meclib.Function.getDeviceEventLists(),a=0,l=0,n=0,c=0,s=0,r=0,g=0,b=0,p=0,d=function(){a=0,l=0,n=0,c=0,s=0,r=0,g=0,b=0,p=0};!0===o.touch&&(d(),$(i).off(),$(i).on("touchstart",(function(e){d(),a=e.originalEvent.touches[0].clientX,l=e.originalEvent.touches[0].clientY;var i=new Date;s=i.getTime()})).on("touchmove",(function(e){if(1!==e.originalEvent.touches.length)return d(),!1;n=e.originalEvent.touches[0].clientX,r=aMeclib.Constants.TAP_TIME||Math.abs(r)>Meclib.Constants.TAP_DISTANCE||Math.abs(g)>Meclib.Constants.PORT_SCROLL_DISTANCE?(d(),o):(d(),!1===Meclib.Function.isSkipStopPropagation(i)&&e.stopPropagation(),t(this,e),o)}))),!0===o.mouse?($(e).off("mousedown mousemove mouseup",i),$(e).on({mousedown:function(e){b=1;var i=new Date;s=i.getTime()},mousemove:function(e){b>0&&b++},mouseup:function(e){var i=(new Date).getTime()-s;b>10||i>Meclib.Constants.TAP_TIME?d():(d(),t(this,e))}},i)):!0===o.pointer&&($(e).off("pointerdown pointermove pointerup",i),$(e).on({pointerdown:function(e){d(),p=1;var i=new Date;s=i.getTime()},pointermove:function(e){p>0&&p++},pointerup:function(e){var i=(new Date).getTime()-s;if(p>10)d();else{if(!(i>Meclib.Constants.TAP_TIME))return d(),t(this,e),!1;d()}}},i))}},ViewerApp.Modules.KeybordManager=function(){this.isMenuKey=0,this.ctrlKey=0,this.shiftKey=0},ViewerApp.Modules.KeybordManager.prototype={keyDown:function(e){if(1!==this.isMenuKey)e!==Meclib.KeyBindings.left?e!==Meclib.KeyBindings.right?e!==Meclib.KeyBindings.end?e!==Meclib.KeyBindings.home?Meclib.KeyBindings.menuKey:0===Meclib.Globals.book.pageOpenDir?ViewerApp.mediator.trigger("main:moveLeftLimitPage"):ViewerApp.mediator.trigger("main:moveRightLimitPage"):0===Meclib.Globals.book.pageOpenDir?ViewerApp.mediator.trigger("main:moveRightLimitPage"):ViewerApp.mediator.trigger("main:moveLeftLimitPage"):ViewerApp.mediator.trigger("main:moveRightPage"):ViewerApp.mediator.trigger("main:moveLeftPage");else switch(e){case Meclib.KeyBindings.left:ViewerApp.mediator.trigger("main:moveLeftLimitPage");break;case Meclib.KeyBindings.right:ViewerApp.mediator.trigger("main:moveRightLimitPage");break;case Meclib.KeyBindings.auto:var i=0;i=0===Meclib.Globals.book.pageOpenDir?1:0,ViewerApp.mediator.trigger("autoflip:play",i);break;case Meclib.KeyBindings.keywordSearch:case Meclib.KeyBindings.pageSeaech:ViewerApp.mediator.trigger("menu:openMainMenu");break;case Meclib.KeyBindings.viewMode:ViewerApp.mediator.trigger("optionmenu:toggleViewMode");break;case Meclib.KeyBindings.off1:case Meclib.KeyBindings.off2:ViewerApp.mediator.trigger("optionmenu:showAllOption",0);break;case Meclib.KeyBindings.on1:case Meclib.KeyBindings.on2:ViewerApp.mediator.trigger("optionmenu:showAllOption",1);break;case Meclib.KeyBindings.moveType:ViewerApp.mediator.trigger("optionmenu:toggleMoveType");break;case Meclib.KeyBindings.help:break;case Meclib.KeyBindings.pgUp:ViewerApp.mediator.trigger("canvas:scaleCenter");break;case Meclib.KeyBindings.pgDn:break;case Meclib.KeyBindings.esc:ViewerApp.mediator.trigger("canvas:initScale"),ViewerApp.mediator.trigger("updatePage");break;case Meclib.KeyBindings.print:ViewerApp.mediator.trigger("print:showPanel")}},keyUp:function(e){71!==e||(this.isMenuKey=0)}},ViewerApp.Models.Comment=Backbone.Model.extend({defaults:{id:"",p_id:"",user:"",text:"",a_date:"",u_date:"",page:0,area:"",delete:0,option:""},initialize:function(e,i){},parse:function(e){return e.page=parseInt(e.page,10),e.delete=parseInt(e.delete,10),isNaN(e.page)&&(e.page=0),e}}),ViewerApp.Collections.CommentList=Backbone.Collection.extend({model:ViewerApp.Models.Comment,url:function(){if("MAINTE"!==Meclib.Setting.type)return Meclib.Globals.viewer.get("dataPath")+"scripts/comment.php"}}),ViewerApp.Models.BookInfo=Backbone.Model.extend({defaults:{id:0,post_date:"",title:"",content:"",url:"",update:"",update_date:""},initialize:function(e,i){},parse:function(e){var i=e.update_date;return i=i.replaceAll("-","/"),e.update=new Date(i).getTime(),e}}),ViewerApp.Collections.BookInfoList=Backbone.Collection.extend({model:ViewerApp.Models.BookInfo,comparator:function(e){return-e.get("update")}}),ViewerApp.Models.PersistentSetting=Backbone.Model.extend({defaults:{name:0,value:0},initialize:function(e,i){},parse:function(e){return e}}),new ViewerApp.Models.PersistentSetting,ViewerApp.Collections.PersistentSettingList=Backbone.Collection.extend({model:ViewerApp.Models.PersistentSetting,localStorage:new Store("meclib-persistent_setting"),comparator:function(e){return e.get("name")}}),ViewerApp.Router=Backbone.Router.extend({routes:{"":"home",mainte:"mainte","target/:params":"target"},initialize:function(){},home:function(){},mainte:function(){Meclib.Setting.type="MAINTE",Meclib.Setting.configType=0},target:function(e){var i=e.split("&");if(0!==i.length)for(var t=0;t1&&("keyword"===o[0]&&(Meclib.defaults.keyword=o[1]),"page"===o[0]&&(Meclib.defaults.pageName=o[1],1===Meclib.Initial.book&&Meclib.defaults.pageName!==Meclib.Globals.book.getPageName(Meclib.Globals.book.currentPage)&&ViewerApp.mediator.trigger("main:movePage",Meclib.Globals.book.getPageFileNo(Meclib.defaults.pageName))),"page_no"===o[0]&&(Meclib.defaults.pageNo=o[1],1===Meclib.Initial.book&&Meclib.defaults.pageNo!==Meclib.Globals.book.currentPage&&ViewerApp.mediator.trigger("main:movePage",Meclib.defaults.pageNo)),"error_code"===o[0]&&(Meclib.Globals.errorCode=o[1],!0===Meclib.Setting.enabled&&""!==Meclib.Globals.errorCode&&(Meclib.Message.error[Meclib.Globals.errorCode]&&new Messi(Meclib.Message.error[Meclib.Globals.errorCode],{center:!0,animate:!1,width:Meclib.Size.MessiWidth,modal:!0,buttons:[{id:0,label:Meclib.Message.common.ok,val:null}],callback:function(){}}),Meclib.Globals.errorCode="")),"autoflip"===o[0]&&(Meclib.defaults.autoflip=o[1]),"autoflip_loop"===o[0]&&(Meclib.defaults.autoflip_loop=o[1]),"embed"===o[0]&&(Meclib.defaults.embed=o[1]))}}});var Meclib={API:{}},MeclibApi={};function pagemove(e){ViewerApp.mediator.trigger("news:closeDialog"),setTimeout((function(){ViewerApp.mediator.trigger("main:movePage",e)}),300)}MeclibApi.Book={},MeclibApi.Event={},Meclib.App={scheme:""},Meclib.analytics=new ViewerApp.Modules.Analytics,Meclib.UserAnalytics=new ViewerApp.Modules.PublicUserAnalytics,Meclib.Asetts={},Meclib.Bookindex={},Meclib.Bookindex.level=1,Meclib.Bookindex.current=1,Meclib.Bookindex.maxChild=5,Meclib.Bookindex.count=!1,Meclib.Bookindex.defaultExpand=!1,Meclib.BookInfo={display:!1,balloonLedge:{id:"balloonLedge",class:"balloonLedge bookinfo-contents",el:"",width:12,height:24},balloonLedgeShadow:{id:"balloonLedgeShadow",class:"balloonLedgeShadow bookinfo-contents",el:"",width:14,height:26},maskId:"bookinfo_mask"},Meclib.BookInfo.balloonLedge.el='
',Meclib.BookInfo.balloonLedgeShadow.el='
',Meclib.Constants={ANALYTICS_ZOOM_DIV:20,SWIPE_DISTANCE:23,TAP_DISTANCE:23,TAP_TIME:1e3,PORT_SCROLL_DISTANCE:5},Meclib.Contents={hideDrag:!1,blink:!1},Meclib.Cache={},Meclib.Cache.Tpl={},Meclib.Cache.fileCache="",Meclib.Comment={init:!1,inputMode:!1,editMode:!1,addMode:!1,replyMode:!1,jCropApi:null,currentPage:0,reply:"",selectArea:"",server:"scripts/comment.php",userName:"",listHeight:0,listFilter:!0,txtClosedHeight:22,dateAgoFormat:!0,highlightId:"",bgColor:"",bgAlpha:.7,selectAreaClass:"comment-select-obj",pageHighlightClass:"comment-pagehighlight-obj",iconSrc:""},Meclib.Canvas={},Meclib.Canvas.Move={mode:""},Meclib.Canvas.Touch={},Meclib.Canvas.ZoomPos={x:0,y:0},Meclib.Canvas.zoomDeltaPos={x:0,y:0},Meclib.Canvas.zoomInitPos={x:0,y:0},Meclib.Canvas.flipEdge={x:0,y:0},Meclib.Canvas.flippableSpace=0,Meclib.Contextmenu={enables:["panel-txtcopy-clipboad-txtarea"]},Meclib.Crop={jCropApi:null,pageNum:0,left:!1,right:!1},Meclib.Click={count:0,zoomClickNum:1,start:{x:0,y:0,time:0},end:{x:0,y:0,time:0}},Meclib.Cursor={},Meclib.Cursor.Memo={default:"default",eraser:"crosshair"},Meclib.Debug={level:0,stage:1},Meclib.defaults={},Meclib.defaults.pageNo=0,Meclib.defaults.pageName="",Meclib.defaults.keyword="",Meclib.defaults.embed=0,Meclib.Embed={up_dir:"embed"},Meclib.Event={gesture:"",type:1},Meclib.Function={},Meclib.Fusen={selectedColor:1,selected:!1},Meclib.Fullscreen={},Meclib.Fullscreen.videoMax=!1,Meclib.Globals={animationFrame:"",deviceType:"",deviceCode:"",ua:"",menu:"",mediator:"",searchTextList:"",searchResultList:"",searchHitList:"",highlightData:"",highlightTextData:[],highlightResultList:"",highlightHitList:"",txtcopyData:[],searchScrollMode:!1},Meclib.Highlight={},Meclib.Highlight.info={},Meclib.Highlight.color="#fef263",Meclib.Highlight.alpha=.5,Meclib.IndexedDb=new Dexie("MeclibDB"),Meclib.IndexedDb.version(1).stores({memo:"++id, book_id, data,updated_at"}),Meclib.Initial={book:0,slider:0,pagenumInclude:!1},Meclib.Initial.Events={},Meclib.KeyBindings={menuKey:71,left:37,right:39,end:35,home:36,print:80,esc:27,auto:65,viewMode:86,moveType:77,help:72,pgUp:33,pgDN:34,off1:48,off2:96,on1:49,on2:97,pageSeaech:83,keywordSearch:70},Meclib.KeybordManager=new ViewerApp.Modules.KeybordManager,Meclib.Limit={},Meclib.Limit.cropMax=50,Meclib.Link={count:0,icon_size:{width:37,height:32},icon_pos:{top:0,left:0},icon_dir:"",up_dir:"upload_contents",blinkObj:""},Meclib.Lists={},Meclib.Message={},Meclib.SystemMessage={prev_popup:"\u30d7\u30ec\u30d3\u30e5\u30fc\u30e2\u30fc\u30c9\u3067\u8868\u793a\u3057\u3066\u3044\u307e\u3059"},Meclib.LayerZindex={link:120,highlight:110,txtcopy:105,memo:200},Meclib.Logo={enabled:!1,url:"",open:1,width:"",height:26},Meclib.MainMenu={animate:!0,overlay:!1,display:!0,forceOpen:!1,forceClose:!1},Meclib.Memo={},Meclib.Memo.action={},Meclib.Memo.init=!1,Meclib.Memo.select={},Meclib.Memo.select.start={x:0,y:0},Meclib.Memo.select.end={x:0,y:0},Meclib.Memo.select.color=[0,0,0],Meclib.Memo.select.nowData=[],Meclib.Memo.select.nowData.eraser=[],Meclib.Memo.MemoSaveQueueData=[],Meclib.Memo.MemoSaveData=[],Meclib.Memo.MemoSaveLastData=[],Meclib.Memo.MemoSaveQueueMax=10,Meclib.Memo.enableDistance=8,Meclib.Memo.margin=0,Meclib.Memo.ratinaScale=2,Meclib.Memo.menuSpeed=300,Meclib.Memo.colors={red:[255,51,51],yellow:[255,204,0],green:[0,153,51],blue:[0,102,255],skyblue:[0,204,255],white:[255,255,255],black:[0,0,0]},Meclib.Memo.size=[4,8,12,16,22],Meclib.Memo.selectedStyle={strokeStyle:"rgba(0, 0, 0, .2)",strokeAlpha:.2,fillStyle:"",fillAlpha:0,shadowBlur:10,shadowStyle:"rgba(0, 0, 0, .2)"},Meclib.Memo.dragStyle={strokeStyle:"rgba(0,0,0, 1.0)",strokeAlpha:1,fillStyle:"rgb(0,0,0)",fillAlpha:0},Meclib.Memo.mode={select:!0,zoomdrag:!1},Meclib.Menu={masked:!1,name:"",maximum:!1,toggle:!1,scrollTheme:"light"},Meclib.Mode={autoflip:!1,autoflipping:!1,commentSelect:!1,fusen:!1,crop:!1,memo:!1,print:!1,option:!1},Meclib.Modal="",Meclib.MouseCursor={sideSpace:100,sideMargin:18,topMargin:8},Meclib.MouseWheel={zoomInc:.2},Meclib.NaviMenu={display:!1},Meclib.Path={template:"./templates/",whiteImage:"./common/img/system/white.png",spaceImage:"./common/img/system/space.png"},Meclib.PageMove={sideMargin:10},Meclib.PageSearch={display:!1},Meclib.PageSlider={selected:!1},Meclib.Pagelist={scrollStart:0,scrollEnd:0,nowScrollStart:0,nowScrollEnd:0,blockList:[],from:"",focusBeforeScroll:"",focusAfterScroll:"",icon:{fusen:{width:20,height:16},memo:{width:20,height:20}},maxPageNum:200,maximum:!1},Meclib.Pdf={warningModal:""},Meclib.Pinch={time:0,pinchtime:0,endtime:0},Meclib.Print={warningPageNum:100,errorModal:"",warningModal:"",selected:{open:0,fusenprint:"",memoprint:""}},Meclib.Products={load:!1,loading:!1,dataDefines:"",pageNation:{div:100,displayNum:5},ajax:{txtcount:"",txtdata:"",dbcount:"",dbdata:""},search:{mode:"",keyword:"",start:1,end:0,currentPage:1},results:{header:[],data:[]},select:{page:{db:0,start:1,end:0,page:1,pages:[]},search:{db:0,start:1,end:0,page:1,pages:[]}},sort:{page:{db:"",page:0,field:"",order:0},search:{db:"",page:0,field:"",order:0}}},Meclib.Property={domains:[],url:"",loading:0,localStorage:!0,startTime:0,timestamp:""},Meclib.Setting={enabled:!1,type:"",configType:1,configName:""},Meclib.Size={},Meclib.Size.thickness={width:14},Meclib.Size.sideNavi={width:0,outsideWidth:70},Meclib.Size.sideBar={width:30},Meclib.Size.sideMenu=400,Meclib.Size.sideMenuHeight=0,Meclib.Size.headerHeight=0,Meclib.Size.footerHeight=0,Meclib.Size.footerSubHeight=0,Meclib.Size.sidemenuHeaderHeight=30,Meclib.Size.sdSidemenuHeaderHeight=36,Meclib.Size.sidemenuFooterHeight=30,Meclib.Size.sidemenuTitlebarHeight=36,Meclib.Size.pageListRow=385,Meclib.Size.sidemenuHeaderMenuHeight=30,Meclib.Size.commentmenuHeaderHeight=30,Meclib.Size.MessiWidth=300,Meclib.Size.MessiWidthL=400,Meclib.Slide={},Meclib.Slide.move={x:0,y:0},Meclib.Slide.moveVal=15,Meclib.Speed={menuOpen:200,menuClose:100,sideNaviOpen:100,sideNaviClose:200},Meclib.TextSearch={inputKeyword:"",mode:"",results:[],page_num:40,page:1,keyword:"",keywords:[]},Meclib.Txtcopy={mode:{select:!1,zoomdrag:!1},drag:{start:{x:0,y:0},end:{x:0,y:0}},selected:{start:{x:0,y:0},end:{x:0,y:0},text:"",lasttime:0}},Meclib.Txtcopy.action={},Meclib.Txtcopy.scale={x:0,y:0},Meclib.Txtcopy.select={},Meclib.Txtcopy.select.start={x:0,y:0},Meclib.Txtcopy.select.end={x:0,y:0},Meclib.Txtcopy.select.color=[0,0,0],Meclib.Txtcopy.select.nowData=[],Meclib.Txtcopy.select.nowData.eraser=[],Meclib.Txtcopy.enableDistance=8,Meclib.Txtcopy.margin=0,Meclib.Txtcopy.pagearea={},Meclib.Txtcopy.ratinaScale=2,Meclib.Txtcopy.normalStyle={strokeStyle:"rgba(0, 255, 0,.2)",fillStyle:"rgb(0, 255, 0)",strokeAlpha:.2,fillAlpha:.2},Meclib.Txtcopy.selectedStyle={strokeStyle:"rgba(0, 254, 254,.3)",fillStyle:"rgb(0, 254, 254)",strokeAlpha:.3,fillAlpha:.3},Meclib.Txtcopy.dragStyle={strokeStyle:"rgba(0,0,0, 1.0)",fillStyle:"rgb(0,0,0)",strokeAlpha:1,fillAlpha:0},Meclib.Timer={printModal:0,link:0,fusen:0,mouse:0,click:0,movie:0,embed:0,comment:0,autoflip:0,slidepage:0},Meclib.Touch={selected:!1,tap:0,dbltap:0,pinchscale:0},Meclib.TouchManager=new ViewerApp.Modules.TouchManager,Meclib.ClickManager=new ViewerApp.Modules.ClickManager,Meclib.Tooltip={},Meclib.Windows={print:""},Meclib.Zoom={effect:!0,level:0,pinch:"",scale:"",x:0,y:0},Meclib.ZoomArea={enabled:!1,CloseStyle:{},OpenStyle:{},maxImageSize:{width:206,height:155}},Meclib.Globals.errorCode="",Meclib.Globals.ua=navigator.userAgent,Meclib.Globals.router=new ViewerApp.Router,Meclib.Globals.mediator=_.extend({},Backbone.Events),Meclib.Globals.viewer=new ViewerApp.Models.Viewer({}),Meclib.Design=new ViewerApp.Models.Design({}),Meclib.Globals.menu=new ViewerApp.Models.Menu,Meclib.Lists.domainList=new ViewerApp.Collections.DomainList,Meclib.Lists.linkList=[],Meclib.Lists.newsList=new ViewerApp.Collections.NewsList,Meclib.Lists.fusenList=new ViewerApp.Collections.FusenList,Meclib.Lists.movieList=new ViewerApp.Collections.MovieList,Meclib.Lists.embedList=new ViewerApp.Collections.EmbedList,Meclib.Lists.highlightList1=new ViewerApp.Collections.HighlightList,Meclib.Lists.highlightList2=new ViewerApp.Collections.HighlightList,Meclib.Lists.txtcopyList=[],Meclib.Lists.txtcopyList[0]=new ViewerApp.Collections.TxtcopyList,Meclib.Lists.txtcopyList[1]=new ViewerApp.Collections.TxtcopyList,Meclib.Lists.pageNumList=new ViewerApp.Collections.PageNumberList,Meclib.Lists.pageSettingList=new ViewerApp.Collections.PageSettingList,Meclib.Lists.bookIndexList=new ViewerApp.Collections.BookIndexList,Meclib.Lists.bookLinkList=new ViewerApp.Collections.BookLinkList,Meclib.Lists.externalApiList=new ViewerApp.Collections.ExternalApiList,Meclib.Lists.browsingHistoryList=new ViewerApp.Collections.BrowsingHistoryList,Meclib.Lists.cropList=[],Meclib.Lists.commentList=new ViewerApp.Collections.CommentList,Meclib.Lists.bookInfoList=new ViewerApp.Collections.BookInfoList,Meclib.Lists.storageBookInfoList=new ViewerApp.Collections.StorageBookInfoList,Meclib.Lists.PersistentSettingList=new ViewerApp.Collections.PersistentSettingList,Meclib.Globals.book=new ViewerApp.Modules.Book,Meclib.Globals.book.init(Meclib.Globals.viewer.get("dataPath")),Meclib.Globals.bookCanvas=new ViewerApp.Modules.BookCanvas,Me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f1vlsDiAeZeT9J+89itb4P4XNmG/p5/lugO2xYfbr7Jv0vXw3GI0V+T6a/T/HkPRVliXLO6vvEo+irfyPL/Ft9rWeTn8v6ONJjrXZ92bzUdaD/Hp7yPE802TM6TbpZJlu+Tvor9rK/6WyUb4Dlm37e3v3Ne0k/cD7BGnRpnjmFP9nPMYk8iLNXr4lPer8r5RSSimlnlOX2ufNdO9lL/nWlOsgl7BhfRvNvmv699RftfZ5tT+sOdSayWzNeo3S/31tI7/zR9/8S2shrJv082soyznqR/zjMbu/lN7oepbXLK1RvybubM1pVua/iv2y3PsjX9Y88pz2wjO5zp5tJPdeOWcNl3s5JrB3sya82zrLmeuJdY/1Ztaa+rpShfc61r1MK21Xx/QZkFdeox6nxHol90mXve6lMp+j7pdsb6P+z1obtmY/vms09le83Mct6COs860JP1Yv7JdjXv+3IfchEHsZdcy1yrRVptnzGtm3/xNBnNH9kf9HZT5Hff4/xf8Zf/b+kHbinL0Zjvgz/8lYE35qvfqcl3sC+HpUp/RBt09ez/LKsNE+E/ezP3OdeY/KfK628H/fRymfUKY8LzHWMX4yltGe14afUi/CGDf4jwAb074Qc233fx9zco/ymP/5fyLzKPX73f+zMp+rY/7PuR079H6SdS318Sl9g7+Iyzy2Vfgxu2cYtuT9OudhxnDiYue0NXud+DP3KI+Vg39r8SFtJ23KntnI/6Myn/MuyH5b1il9R9/OumKP0VhF3Eyv59f92fvBmnDCluqVYdSDuaT7N+fy0TcYz/fnRnn1MNpA34tMGxM/856Vufe1S2hpvUA9vvS/UkoppZRSSimllFJKXU07EREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREZE75B+Hl45q2TuOnAAAAVNta0JU+s7K/gB/pYUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHic7dbhaYNgFIZRB3ERB3EQF3EQB3ERB7G8gQu3piH/ignng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0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eG1wOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzUgMTEuMC4xLjcgV2luZG93czwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxMy0xMi0xMVQwODozNzowNlo8L3htcDpDcmVhdGVEYXRlPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxMy0xMi0xMVQwODozNzozMlo8L3htcDpNb2RpZnlEYXRlPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz7n4vSFAAAAF0lEQVQYlWP8//8/AzGAiShVowqpphAA1RIDET0/PewAAAAASUVORK5CYII=",Meclib.Globals.tooltip=$("#tip").css({position:"absolute",bottom:Meclib.Size.footerHeight}).hide(),Meclib.Globals.load_connection=0,Meclib.Globals.load_connection_x1=0,Meclib.Globals.load_waiting=[],Meclib.Globals.load_waiting_x1=[],Meclib.Globals.loaded_image={x1:{},x2:{},x4:{},x6:{}},Meclib.Globals.pagehtml=null,Meclib.Globals.printhtml=null,Meclib.Globals.flip_page=0,Meclib.Globals.flip_index=0,Meclib.Globals.animation_page=[],Meclib.Globals.vendor=/webkit/i.test(navigator.appVersion)?"-webkit-":/firefox/i.test(navigator.userAgent)?"-moz-":"opera"in window?"-O-":/msie/i.test(navigator.userAgent)?"-ms-":"",$.extend($.fn,{transform:function(){for(var e="",i=0;it&&this0)for(var i=0;i-1||Meclib.Globals.ua.search("iPad")>-1||Meclib.Globals.ua.search("Android")>-1?(Meclib.Globals.viewer.set({touchIf:!0}),Meclib.Globals.ua.search("iPhone")>-1&&(Meclib.Globals.viewer.set({device:3}),Meclib.Globals.deviceCode="sp",Meclib.Globals.deviceType="iphone"),Meclib.Globals.ua.search("iPad")>-1&&(Meclib.Globals.viewer.set({device:2}),Meclib.Globals.deviceCode="sd",Meclib.Globals.deviceType="ipad"),Meclib.Globals.ua.search("Android")>-1&&(Meclib.Globals.deviceType="android",Meclib.Globals.ua.search("Mobile")>-1?(Meclib.Globals.deviceCode="sp",Meclib.Globals.viewer.set({device:3})):(Meclib.Globals.deviceCode="sd",Meclib.Globals.viewer.set({device:2})))):Meclib.Globals.ua.toLowerCase().indexOf("macintosh")>-1&&"ontouchend"in document?(Meclib.Globals.deviceCode="sd",Meclib.Globals.viewer.set({device:2})):Meclib.Globals.viewer.set({device:1})),$("#body").css("height",Meclib.Function.getWinsize().height),"LOCAL"!==Meclib.Setting.type){var e=location.href;if(!1===/^(http|https)/.test(e))return $("#main").html("\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u306f\u3054\u89a7\u3044\u305f\u3060\u3051\u307e\u305b\u3093\u3002"),!1}Meclib.Function.showLoader();var i="./settings/";"MAINTE"===Meclib.Setting.type&&(i="./settings_conf/"),new Promise((e=>{$.ajax({type:"GET",scriptCharset:"utf-8",dataType:"json",url:i+"message-core.json"}).done((function(i){Meclib.Message=i[0],"COMPLETE"!==Meclib.Message.check&&console.log("Error:Localize failed!!"),e()})).fail((function(){console.log("[Error] message-core.json Not Found."),e()}))})).then((()=>new Promise((e=>{$.ajax({type:"GET",scriptCharset:"utf-8",dataType:"json",url:i+"style.json"}).done((function(i){Meclib.Style=i[0],Meclib.Function.setDefaultStyle(),e()})).fail((function(){e()}))})))).then((()=>new Promise((e=>{Meclib.Lists.pageNumList.fetch({cache:!1,dataType:"json",success:function(i,t,o){var a=t.length;a>0&&(Meclib.Globals.viewer.get("optionIncludes").pagenumber=1);for(var l=0;lnew Promise((e=>{Meclib.Function.getDomain(),e()})))).then((()=>new Promise((e=>{Meclib.Lists.storageBookInfoList.fetch({dataType:"json",success:function(e,i,t){for(var o=i.length,a=0;anew Promise((e=>{Meclib.Function.setDeviceEventType(),e()}))))},Meclib.Function.setDeviceEventType=function(){var e=Meclib.Function.getDeviceEventLists();"MAINTE"!==Meclib.Setting.type&&!1===Meclib.Function.isMac()&&"LOCAL"!==Meclib.Setting.type&&-1==Meclib.Globals.ua.search("iPhone")&&-1==Meclib.Globals.ua.search("iPad")&&-1===Meclib.Globals.ua.search("Android")?Meclib.Lists.PersistentSettingList.fetch({dataType:"json",success:function(i,t,o){for(var a=t.length,l="",n=0;n{$.ajax({type:"GET",scriptCharset:"utf-8",dataType:"json",url:e}).done((function(e){Meclib.Design.set(e),""!==Meclib.Design.get("bgcolor")&&($("#canvas-area").css({"background-color":Meclib.Design.get("bgcolor")}),$("#main").css({"background-color":Meclib.Design.get("bgcolor")})),i()})).fail((function(e){console.log(e),i()}))})).then((()=>new Promise((e=>{var i="device1.css";switch(Meclib.Globals.viewer.get("device")){case 1:case 9:default:i="device1.css";break;case 2:i="device2.css";break;case 3:i="device3.css"}var t=$("");$(t).attr({href:"./common/css/"+i,rel:"stylesheet",type:"text/css"}),$("head").append(t),Meclib.Property.loading=50,e()}))))},Meclib.Function.launch=function(){!1===Meclib.Property.localstorage&&(Meclib.Globals.viewer.get("systemAllows").fusen=0,Meclib.Globals.viewer.get("systemAllows").crop=0,Meclib.Globals.viewer.get("systemAllows").browsingHistory=0),Meclib.Property.loading=30;var e={};switch(Meclib.Globals.viewer.get("device")){case 1:$("#header").html(_.template($("#header-template").html(),e)),$("#footer").html(_.template($("#footer-template").html(),e)),$("#sidemenu").html(_.template($("#menu-template").html(),e)),$("#header").addClass("pc"),$("#footer").addClass("pc"),$("#sidemenu").addClass("pc"),Meclib.Menu.scrollTheme="light";break;case 2:$("#header").html(_.template($("#sd-header-template").html(),e)),$("#footer").html(_.template($("#sd-footer-template").html(),e)),$("#sidemenu").html(_.template($("#sd-menu-template").html(),e)),$("#header").addClass("sd"),$("#footer").addClass("sd"),$("#sidemenu").addClass("sd"),$("#shadow-center").addClass("sd"),Meclib.Menu.scrollTheme="dark-thick";break;case 3:$("#header").html(_.template($("#sp-header-template").html(),e)),$("#footer").html(_.template($("#sp-footer-template").html(),e)),$("#sidemenu").html(_.template($("#sp-menu-template").html(),e)),$("#header").addClass("sd"),$("#footer").addClass("sd"),$("#sidemenu").addClass("sp"),$("#shadow-center").addClass("sp"),Meclib.Menu.scrollTheme="dark-thick",Meclib.Size.MessiWidth=260}Meclib.Size.headerHeight=$("#header").height(),Meclib.Size.footerHeight=$("#footer").height(),2!==Meclib.Globals.viewer.get("device")&&3!==Meclib.Globals.viewer.get("device")||(Meclib.Size.sidemenuHeaderHeight=Meclib.Size.sdSidemenuHeaderHeight),"MAINTE"===Meclib.Globals.viewer.get("type")&&($(".header-left").hide(),$("#txtsearch-box").hide(),$("#menu-setting").hide(),$("#footer-icon-left").hide(),$("#btn-crop").hide(),$("#btn-fusen").hide(),$("#btn-memo").hide()),"MAINTE"===Meclib.Setting.type&&Meclib.Function.changeMaintenanceMode(),Meclib.Property.loading=40,Meclib.Function.setDesign(),Meclib.Function.init();var i=setInterval((function(){void 0!==Meclib.Globals.book.endpoint&&(clearInterval(i),ViewerApp.mediator.trigger("common:loadTemplates"))}),100)},Meclib.Function.includeParts=function(){Meclib.Property.loading=20;var e=Meclib.Path.template+"parts.html";2===Meclib.Globals.viewer.get("device")||3===Meclib.Globals.viewer.get("device")?e=Meclib.Path.template+"parts-sd.html":9===Meclib.Globals.viewer.get("device")&&(e=Meclib.Path.template+"parts-mainte.html"),$.ajax({url:e,success:function(e){$("#body").append(e),setTimeout((function(){Meclib.Function.launch()}),50)}}),$.ajax({type:"GET",dataType:"html",url:Meclib.Path.template+"parts-common.html"}).done((function(e){$("#body").append(e)})).fail((function(e,i,t){}))},Meclib.Function.setLogo=function(){var e,i=!1,t={dir:"",name:"",height:"auto"},o="";if(!1===Meclib.Logo.enabled&&1===Meclib.Globals.book.logo?(Meclib.Logo.url=Meclib.Globals.book.logoUrl,Meclib.Logo.open=Meclib.Globals.book.logoOpentype,i=!0,t.dir="./data/"):!0===Meclib.Logo.enabled&&(i=!0,t.dir="./common/img/parts/common/"),"png"===Meclib.Globals.book.logoType?window.devicePixelRatio>1&&window.devicePixelRatio<=2?t.name="logo_2x.png":window.devicePixelRatio>2?t.name="logo_3x.png":t.name="logo.png":"svg"===Meclib.Globals.book.logoType&&(t.name="logo.svg"),""!==Meclib.Logo.width&&!1===isNaN(Meclib.Logo.width)?t.width=Meclib.Logo.width+"px":t.width=Meclib.Logo.width,""!==Meclib.Logo.height&&!1===isNaN(Meclib.Logo.height)?t.height=Meclib.Logo.height+"px":t.height=Meclib.Logo.height,o=1===Meclib.Globals.viewer.get("device")?"#header-left":"#footer-sub-bg",!1!==i){e=t.dir+t.name,Meclib.Function.appendFooterSub();var a=$(""),l={id:"main_logo",src:e};""!=t.width&&(l.width=t.width),""!=t.height&&(l.height=t.height),$(a).attr(l).addClass("ev-main_logo main_logo "+Meclib.Globals.deviceCode),$(o).append(a),""!==Meclib.Logo.url&&($(a).css({cursor:"pointer"}),Meclib.ClickManager.add(document,".ev-main_logo",(function(e,i){return i.preventDefault(),1===Meclib.Logo.open?window.open(Meclib.Logo.url,"logo"):0===Meclib.Logo.open&&(location.href=Meclib.Logo.url),!1})))}},Meclib.Function.setFooterPosition=function(){$("#footer.sd").css("top",Meclib.Function.getWinsize().height-75)},Meclib.Function.appendFooterSub=function(){switch(Meclib.Cache.Tpl.footerSub="",Meclib.Globals.viewer.get("device")){case 2:Meclib.Cache.Tpl.footerSub=$("#sd-footer-sub-template").html();break;case 3:Meclib.Cache.Tpl.footerSub=$("#sp-footer-sub-template").html()}$("#body").append(_.template(Meclib.Cache.Tpl.footerSub)),Meclib.Size.footerSubHeight=$("#footer-sub-box").height(),$("#footer").addClass("submenu"),$("#footer-sub-box").addClass("submenu")},Meclib.Function.escapeBookIndexText=function(e){return e=(e=Meclib.Function.escapeHTML(e)).replaceAll("\n","
")},Meclib.Function.escapeCommentText=function(e){return e=(e=(e=Meclib.Function.escapeHTML(e)).replaceAll("\n","
")).replaceAll('"',""")},Meclib.Function.escapeBoonInfoText=function(e){return e=(e=Meclib.Function.escapeHTML(e)).replaceAll("\n","
")},Meclib.Function.escapeSearchResultText=function(e){return e=e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")},Meclib.Function.escapeSearchText=function(e){return e=(e=e.replaceAll('\\"','"')).replaceAll("\\\\","\\")},Meclib.Function.getListThumbSize=function(e,i){var t={width:0,height:0},o=70/e;return t.height=i*o,t.width=70,t.height>95&&(o=95/t.height,t.width=t.width*o,t.height=95),t},Meclib.Function.getDataPath=function(){var e=location.pathname,i=e.split("/"),t=i.length,o=!1,a="";if("/"===e.slice(-1)?o=!0:t--,t>1)for(var l=0;l=2)if(2===t)e=i[t-2];else{o=i[t-2];for(var a=0;a-1&&-1==Meclib.Globals.ua.toLocaleLowerCase().indexOf("chrome")},Meclib.Function.isIE=function(){return Meclib.Globals.ua.toLocaleLowerCase().indexOf("msie")>-1||Meclib.Globals.ua.toLocaleLowerCase().indexOf("trident")>-1},Meclib.Function.requestFullscreen=function(){if(Meclib.API.onFullscreen(1),Meclib.Function.changeTooptipFullscreen(!0),document.body.webkitRequestFullscreen)document.body.onwebkitfullscreenchange=function(e){document.body.onwebkitfullscreenchange=function(){}},document.body.webkitRequestFullScreen();else if(document.body.mozRequestFullScreen)document.body.mozRequestFullScreen();else if(document.body.msRequestFullscreen)document.body.msRequestFullscreen();else{if(!document.body.requestFullscreen)return;document.body.requestFullscreen()}},Meclib.Function.exitFullscreen=function(){Meclib.API.onFullscreen(0),Meclib.Function.changeTooptipFullscreen(!1),document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msCancelFullScreen?document.msCancelFullScreen():document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()},Meclib.Function.hasLocalStorage=function(){if(!("localStorage"in window)||null===window.localStorage)return!1;try{localStorage.setItem("test","test");var e=localStorage.getItem("test");return localStorage.removeItem("test"),"test"===e}catch(e){return!1}},Meclib.Function.elementBlink=function(e,i,t){var o=null,a=arguments[arguments.length-1];"function"==typeof a&&(o=a),Meclib.Contents.blink=!0,$(e).ready((function(a){!function(i){if(!1!==Meclib.Contents.blink){var a=arguments.callee;if(i&&(a.rest=2*i),--a.rest>=0){var l=parseFloat($(e).css("opacity"),10);isNaN(l)&&(l=0),0===l?$(e).animate({opacity:1},{duration:500,complete:function(){a(i-1)}}):$(e).animate({opacity:0},{duration:500,complete:function(){a(i-1)}})}a.rest<0&&(!0===t?$(e).remove():$(e).animate({opacity:1},500),null!==o&&o())}}(i)}))},Meclib.Function.alphaElementBlink=function(e,i,t){var o=null,a=arguments[arguments.length-1];"function"==typeof a&&(o=a),Meclib.Contents.blink=!0;var l=parseFloat($(e).css("opacity"),10);$(e).ready((function(a){!function(i){if(!1!==Meclib.Contents.blink){var a=arguments.callee;if(i&&(a.rest=2*i),--a.rest>=0){var n=parseFloat($(e).css("opacity"),10);0===n?$(e).animate({opacity:l},{duration:500,complete:function(){a(i-1)}}):$(e).animate({opacity:0},{duration:500,complete:function(){a(i-1)}})}a.rest<0&&(!0===t?$(e).remove():$(e).animate({opacity:l},500),null!==o&&o())}}(i)}))},Meclib.Function.updateMenu=function(){ViewerApp.mediator.trigger("menu:checkEnableMenu")},Meclib.Function.upperCase=function(e){return e.replace(/[a-z]/g,(function(e){return String.fromCharCode(-33&e.charCodeAt(0))}))},Meclib.Function.setForceClose=function(){Meclib.MainMenu.forceClose=!0,setTimeout((function(){Meclib.MainMenu.forceClose=!1}),500)},Meclib.Function.convertCommentDateName=function(e){var i=new Date,t=new Date(e),o=i.getTime()-t.getTime(),a=Math.floor(o/864e5),l=Math.floor(o/36e5),n=Math.floor(o/6e4),c="",s=t.getFullYear(),r=t.getMonth()+1,g=t.getDate(),b=t.getHours(),p=t.getMinutes();return r=Meclib.Function.formatNum(2,r),g=Meclib.Function.formatNum(2,g),b=Meclib.Function.formatNum(2,b),p=Meclib.Function.formatNum(2,p),c=(c=(c=(c=(c=(c=Meclib.Message.comment.dateAgoFormat).replace("|YEAR|",s)).replace("|MONTH|",r)).replace("|DAY|",g)).replace("|HOUR|",b)).replace("|MINITE|",p),!1===Meclib.Comment.dateAgoFormat?c:a>0?1===a?Meclib.Message.comment.yesterday:c:l>0?Meclib.Message.comment.hourAgo.replace("|NUM|",l):n>1?Meclib.Message.comment.minAgo.replace("|NUM|",n):Meclib.Message.comment.justNow},Meclib.Function.convertBookInfoDateName=function(e){e=e.replaceAll("-","/");var i=new Date(e),t=i.getFullYear(),o=i.getMonth()+1,a=i.getDate(),l=i.getHours(),n=i.getMinutes();return o=Meclib.Function.formatNum(2,o),a=Meclib.Function.formatNum(2,a),l=Meclib.Function.formatNum(2,l),n=Meclib.Function.formatNum(2,n),Meclib.Message.bookInfo.dateFormat.replace("|YEAR|",t).replace("|MONTH|",o).replace("|DAY|",a).replace("|HOUR|",l).replace("|MINITE|",n)},Meclib.Function.compareDate=function(e,i){e=e.replaceAll("-","/"),i=i.replaceAll("-","/");var t=new Date(e);return new Date(i).getTime()-t.getTime()>0},Meclib.Function.getSaveFormatDate=function(){var e=new Date;return e.getFullYear()+"/"+("0"+(e.getMonth()+1)).slice(-2)+"/"+("0"+e.getDate()).slice(-2)+" "+("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)},Meclib.Function.formatNumber=function(e){return[e].toString().replace(/(\d)(?=(\d{3})+$)/g,"$1,")},Meclib.Function.isNewBookInfo=function(){var e=!1,i=Meclib.Lists.storageBookInfoList.findWhere({key:Meclib.Globals.book.uniId});if(void 0===i)e=!0;else{var t=Meclib.Lists.bookInfoList.at(0).get("update_date"),o=i.get("value");!0===Meclib.Function.compareDate(o,t)&&(e=!0)}return e},Meclib.Function.isGlobalMenuOpened=function(){return 0!==$("#sd-sidemenu-navi").length&&("none"!==$("#sd-sidemenu-navi").css("sd-sidemenu-navi")&&0!==$("#sd-sidemenu-navi").width())},Meclib.Function.isSideMenuOpened=function(){return 0!==$("#sidemenu").length&&("none"!==$("#sidemenu").css("display")&&0!==$("#sidemenu").width())},Meclib.Function.isOptionMenuOpened=function(){return 0!==$("#optionmenu").length&&"none"!==$("#optionmenu").css("display")},Meclib.Function.isPanelMenuOpened=function(){if($('[data-role="panel"]').length>0){var e=0;return $('[data-role="panel"]').each((function(){if("none"!==$(this).css("display"))return e++,!1})),e>0}return!1},Meclib.Function.isInputMenuOpened=function(){if($('[data-role="panel"],[data-type="input"]').length>0){var e=0;return $('[data-role="panel"],[data-type="input"]').each((function(){if("none"!==$(this).css("display"))return e++,!1})),e>0}return!1},Meclib.Function.hexToR=function(e){return parseInt(Meclib.Function.cutHex(e).substring(0,2),16)},Meclib.Function.hexToG=function(e){return parseInt(Meclib.Function.cutHex(e).substring(2,4),16)},Meclib.Function.hexToB=function(e){return parseInt(Meclib.Function.cutHex(e).substring(4,6),16)},Meclib.Function.cutHex=function(e){return"#"==e.charAt(0)?e.substring(1,7):e},Meclib.Function.to6Num=function(e){return"#"+(e.slice(1,2)+e.slice(1,2))+(e.slice(2,3)+e.slice(2,3))+(e.slice(3,4)+e.slice(3,4))},Meclib.Function.hex2Rgb=function(e){e=(e=e.match("#")?e:"#"+e).length>4?e:Meclib.Function.to6Num(e);var i=Meclib.Function.hexToR(e),t=Meclib.Function.hexToG(e),o=Meclib.Function.hexToB(e),a="";return i>=0&&t>=0&&o>=0&&(a=i+","+t+","+o),a},Meclib.Function.f2i=function(e){return e=~~(.5+e)},Meclib.Function.convertHalfNum=function(e){return String(e).replace(/[\uff21-\uff3a\uff41-\uff5a\uff10-\uff19]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))},Meclib.Function.toHalfWidth=function(e){return e.replace(/[\uff01-\uff5e]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)})).replace(/\u201d/g,'"').replace(/\u2019/g,"'").replace(/\u2018/g,"`").replace(/\uffe5/g,"\\").replace(/\u3000/g," ").replace(/\u301c/g,"~")},Meclib.Function.convertKanaToFull=function(e){var i=new Array("\uff73\uff9e","\uff76\uff9e","\uff77\uff9e","\uff78\uff9e","\uff79\uff9e","\uff7a\uff9e","\uff7b\uff9e","\uff7c\uff9e","\uff7d\uff9e","\uff7e\uff9e","\uff7f\uff9e","\uff80\uff9e","\uff81\uff9e","\uff82\uff9e","\uff83\uff9e","\uff84\uff9e","\uff8a\uff9e","\uff8b\uff9e","\uff8c\uff9e","\uff8d\uff9e","\uff8e\uff9e","\uff8a\uff9f","\uff8b\uff9f","\uff8c\uff9f","\uff8d\uff9f","\uff8e\uff9f"),t=new Array("\u30f4","\u30ac","\u30ae","\u30b0","\u30b2","\u30b4","\u30b6","\u30b8","\u30ba","\u30bc","\u30be","\u30c0","\u30c2","\u30c5","\u30c7","\u30c9","\u30d0","\u30d3","\u30d6","\u30d9","\u30dc","\u30d1","\u30d4","\u30d7","\u30da","\u30dd");for(var o in i)e=e.replace(new RegExp(i[o],"g"),t[o]);var a=new Array("\uff71","\uff72","\uff73","\uff74","\uff75","\uff76","\uff77","\uff78","\uff79","\uff7a","\uff7b","\uff7c","\uff7d","\uff7e","\uff7f","\uff80","\uff81","\uff82","\uff83","\uff84","\uff85","\uff86","\uff87","\uff88","\uff89","\uff8a","\uff8b","\uff8c","\uff8d","\uff8e","\uff8f","\uff90","\uff91","\uff92","\uff93","\uff94","\uff95","\uff96","\uff97","\uff98","\uff99","\uff9a","\uff9b","\uff9c","\uff66","\uff9d","\uff67","\uff68","\uff69","\uff6a","\uff6b","\uff6c","\uff6d","\uff6e","\uff6f"),l=new Array("\u30a2","\u30a4","\u30a6","\u30a8","\u30aa","\u30ab","\u30ad","\u30af","\u30b1","\u30b3","\u30b5","\u30b7","\u30b9","\u30bb","\u30bd","\u30bf","\u30c1","\u30c4","\u30c6","\u30c8","\u30ca","\u30cb","\u30cc","\u30cd","\u30ce","\u30cf","\u30d2","\u30d5","\u30d8","\u30db","\u30de","\u30df","\u30e0","\u30e1","\u30e2","\u30e4","\u30e6","\u30e8","\u30e9","\u30ea","\u30eb","\u30ec","\u30ed","\u30ef","\u30f2","\u30f3","\u30a1","\u30a3","\u30a5","\u30a7","\u30a9","\u30e3","\u30e5","\u30e7","\u30c3");for(var n in a)e=e.replace(new RegExp(a[n],"g"),l[n]);return e},Meclib.Function.floor=function(e){var i=2;return e=parseFloat(e),isNaN(e)&&(e=0),arguments.length>1&&(i=parseInt(arguments[1],10)),parseFloat(e.toFixed(i))},Meclib.Function.getWinsize=function(){var e={width:0,height:0};return e.width=$(window).width()?$(window).width():window.innerWidth,e.height=window.innerHeight?window.innerHeight:$(window).height(),e},Meclib.Function.getCssVal=function(e){var i={width:0,height:0,top:0,left:0};return $(e)[0]?(i.width=parseInt($(e).css("width").replace("px",""),10),i.height=parseInt($(e).css("height").replace("px",""),10),i.left=parseInt($(e).css("left").replace("px",""),10),i.top=parseInt($(e).css("top").replace("px",""),10)):Meclib.Debug.log(e+" not Found","getCssVal",2),i},Meclib.Function.getCssFloatVal=function(e){var i={width:0,height:0,top:0,left:0};return $(e)[0]?(i.width=parseFloat($(e).css("width").replace("px","")),i.height=parseFloat($(e).css("height").replace("px","")),i.left=parseFloat($(e).css("left").replace("px","")),i.top=parseFloat($(e).css("top").replace("px",""))):Meclib.Debug.log(e+" not Found","getCssVal",2),i},Meclib.Function.showLoader=function(){$("#loader").html("");var e=this;!function(){if("off"===e.loaderFlg)return!1;var i=$(".loadingPercentage").text().replace("%",""),t=Meclib.Property.loading;i<=t&&(i++,$(".loadingPercentage").text(i+"%")),window.requestAnimationFrame(arguments.callee,50)}(),$("#loader").css({"background-color":"rgba(0,0,0,0.6)","border-radius":10,"-webkit-border-radius":10,"-moz-border-radius":10});$("#loader").append('
'),$("#loader").show()},Meclib.Function.hideLoader=function(){this.loaderFlg="off",$("#loader").remove()},Meclib.Function.popup=function(e){var i="";2===arguments.length&&(i=arguments[1]);var t={};t.text=e;var o=280;$("#popup").finish(),$("#popup").remove(),$("#body").append(_.template($("#popup-template").html())(t)),o=$("#popup").width()+20,$("#popup").css({width:o}),Meclib.Function.setPosCenter("popup"),setTimeout((function(){if(""!==i){var e=$("#btn-croplist").offset();$("#popup").animate({top:e.top-30,left:e.left+$("#btn-croplist").width()/2-$("#popup").outerWidth()/2},{duration:800,complete:function(){$("#popup").html("")}}),$("#popup").animate({top:e.top,left:e.left+$("#btn-croplist").width()/2-parseInt($("#popup").css("padding-left")),width:0,opacity:"toggle"},{duration:"slow",complete:function(){$("#popup").remove()}})}else $("#popup").animate({top:0,opacity:"toggle"},{duration:"slow",complete:function(){$("#popup").remove()}})}),1500)},Meclib.Function.popupMessage=function(e){var i,t=$("
").attr({id:"prev-popup"}).addClass("prev-popup").html(e);$("#body").append(t),i=$("#prev-popup").width()+20,$("#prev-popup").css({width:i}),Meclib.Function.setPosCenter("prev-popup"),setTimeout((function(){$("#prev-popup").animate({top:27},{duration:"slow",complete:function(){$("#prev-popup").addClass("wait")}})}),3e3)},Meclib.Function.resizeMessage=function(){0!==$("#prev-popup").length&&(Meclib.Function.setPosCenter("prev-popup"),$("#prev-popup").css({top:27}))},Meclib.Function.formatNum=function(e,i){var t=new String(i),o=e-t.length;if(o<=0)return t;for(;o-- >0;)t="0"+t;return t},Meclib.Function.escapeHTML=function(e){return $("
").text(e).html()},Meclib.Function.postParent=function(e){if("MAINTE"===Meclib.Setting.type){var i={};i.event=e,i.currentpage=Meclib.Globals.book.currentPage,i.leftpageno=Meclib.Globals.book.getLeftPage(),i.leftpagename=Meclib.Globals.book.getPageName(Meclib.Globals.book.getLeftPage()),i.rightpageno=Meclib.Globals.book.getRightPage(),i.rightpagename=Meclib.Globals.book.getPageName(Meclib.Globals.book.getRightPage()),i.scale=Meclib.Globals.viewer.get("scale"),i.thumbScale=Meclib.Globals.bookCanvas.scale,i.x=Meclib.Function.getCssVal("#page-area").left,i.y=Meclib.Function.getCssVal("#page-area").top,i.from="meclib",1===Meclib.Globals.viewer.get("scale")&&(i.x=Meclib.Globals.bookCanvas.left,i.y=Meclib.Globals.bookCanvas.top),i.message={resize:"\u753b\u9762\u304c\u30ea\u30b5\u30a4\u30ba\u3055\u308c\u305f\u3068\u304d",movestart:"\u30da\u30fc\u30b8\u79fb\u52d5\u30e1\u30cb\u30e5\u30fc\u304c\u9078\u629e\u3055\u308c\u305f\u3068\u304d",complete:"\u8aad\u307f\u8fbc\u307f\u304c\u5b8c\u4e86\u3057\u305f\u3068\u304d",move:"\u30da\u30fc\u30b8\u3092\u79fb\u52d5\u3057\u305f\u3068\u304d",zoom:"\u62e1\u5927\u7e2e\u5c0f\u3057\u305f\u3068\u304d",zoomdrag:"\u62e1\u5927\u6642\u306b\u30c9\u30e9\u30c3\u30b0\u79fb\u52d5\u3057\u305f\u3068\u304d",showContents:"\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u8868\u793a\u3057\u305f\u3068\u304d",linkStop:"\u7121\u52b9\u306a\u30ea\u30f3\u30af"}[e];var t=location.href.match(/^https?:\/\/[^\/]+/)[0],o=parent.postMessage?parent:parent.document.postMessage?parent.document:void 0;window!=parent&&o.postMessage(JSON.stringify(i),t)}},Meclib.Function.setPosCenter=function(e){var i="window";2===arguments.length&&(i=arguments[1]);var t=0,o=0;"window"===i?(t=$(window).width(),o=$(window).height()):(t=$(i).css("width").replace("px",""),o=$(i).css("height").replace("px",""));var a=$("#"+e).outerWidth(!0),l=$("#"+e).outerHeight(!0);t=t/2-a/2,o=o/2-l/2,t=parseInt(t,10),o=parseInt(o,10),$("#"+e).css({top:o+"px",left:t+"px"})},Meclib.Function.pt2deg=function(e){return Meclib.Function.rad2deg(Math.atan2(e.y,e.x))},Meclib.Function.pt2rad=function(e){return Math.atan2(e.y,e.x)},Meclib.Function.getHypot=function(e,i){return Math.sqrt(Math.pow(e,2)+Math.pow(i,2))},Meclib.Function.deg2rad=function(e){return.01745329251*e},Meclib.Function.rad2deg=function(e){return 57.2957795131*e},Meclib.Function.translate=function(e,i){return"-ms-"==Meclib.Globals.vendor&&/msie 9./i.test(navigator.appVersion)?"translate("+e+"px,"+i+"px)":"translate3d("+e+"px,"+i+"px,0)"},Meclib.Function.rotate=function(e){return"rotate("+e+"deg)"},Meclib.Function.point2D=function(e,i){return{x:e,y:i}},Meclib.Function.dispose=function(e,i,t,o,a){return{x:e,y:i,width:t,height:o,rotate:a}},Meclib.Function.range=function(e,i,t){return et&&(e=t),t},Meclib.Function.getBesier=function(e){var i=e.t/e.max,t=1-i,o=i*i*e.pt3.x+2*i*t*e.pt2.x+t*t*e.pt1.x,a=i*i*e.pt3.y+2*i*t*e.pt2.y+t*t*e.pt1.y;return Meclib.Function.point2D(o,a)},Meclib.Function.startClick=function(e,i){Meclib.Click.count++,Meclib.Click.start.x=e,Meclib.Click.start.y=i,Meclib.Click.start.time=(new Date).getTime()},Meclib.Function.endClick=function(e,i){Meclib.Click.end.x=e,Meclib.Click.end.y=i,Meclib.Click.end.time=(new Date).getTime()},Meclib.Function.resetClick=function(e){0===Meclib.Timer.click&&(Meclib.Timer.click=window.setTimeout((function(){Meclib.Click.count=0,Meclib.Click.start={x:0,y:0,time:0},Meclib.Click.end={x:0,y:0,time:0},window.clearInterval(Meclib.Timer.click),Meclib.Timer.click=0}),600))},Meclib.Function.isSingleClicked=function(e){return!0!==Meclib.Function.isPageZooming()&&(0!==Meclib.Click.start.time&&0!==Meclib.Click.end.time&&(Meclib.Click.start.x===Meclib.Click.end.x&&Meclib.Click.start.y===Meclib.Click.end.y))},Meclib.Function.isPageZooming=function(){var e=!1,i=$("#page-area").css("transform");if(null!==i.match(/^matrix\(/i)&&i.match(/\)$/i)){var t=i.replaceAll(" ","").replaceAll("matrix(",""),o=(t=t.replaceAll(")","")).split(",");6===o.length&&("1"===o[0]&&"1"===o[3]||(e=!0))}return e},Meclib.Function.isZoomabled=function(){var e=!0;return 1===Meclib.Globals.book.zoom.x4&&1===Meclib.Globals.book.zoom.x6?Meclib.Globals.bookCanvas.drawWidth>=4*Meclib.Globals.book.thumbWidth&&(e=!1):1===Meclib.Globals.book.zoom.x4&&0===Meclib.Globals.book.zoom.x6?Meclib.Globals.bookCanvas.drawWidth>=2*Meclib.Globals.book.thumbWidth&&(e=!1):0===Meclib.Globals.book.zoom.x4&&1===Meclib.Globals.book.zoom.x6?Meclib.Globals.bookCanvas.drawWidth>=4*Meclib.Globals.book.thumbWidth&&(e=!1):e=!1,e},Meclib.Function.isMac=function(){return Meclib.Globals.ua.toLocaleLowerCase().indexOf("mac os x")>-1&&Meclib.Globals.ua.toLocaleLowerCase().indexOf("macintosh")>-1},Meclib.Function.isIOSDesctopMode=function(){return Meclib.Globals.ua.toLowerCase().indexOf("macintosh")>-1&&"ontouchend"in document},Meclib.Function.isSkipStopPropagation=function(e){return!!$(e).hasClass("btn-change-fusen-color")||!!$(e).hasClass("btn-close-fusen")},Meclib.Function.mouseDragged=function(){return Meclib.Click.start.x!==Meclib.Click.end.x||Meclib.Click.start.y!==Meclib.Click.end.y},Meclib.Function.checkMouseStop=function(e){if(!(jQuery(":hover").filter(".comment-obj,.link-obj,.embed-obj,.news-obj,.video-obj,.audio-obj").length>0)){if(!0===Meclib.Function.isTwoPage()){if(0===jQuery(":hover").filter("#canvas-leftpage").length&&0===jQuery(":hover").filter("#canvas-rightpage").length)return}else if(0===jQuery(":hover").filter("#canvas-leftpage").length)return;!1!==Meclib.Function.isZoomabled()&&Meclib.Function.showMouseTip(e)}},Meclib.Function.showMouseTip=function(e){var i=Meclib.Message.tooltip.mouse.zoomIn;Meclib.Globals.viewer.get("scale")>=Meclib.Globals.book.zoomMax?i=Meclib.Message.tooltip.mouse.zoomOutDrag:(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&(i=Meclib.Message.tooltip.mouse.zoomInDrag);var t=e.pageX+Meclib.MouseCursor.sideMargin,o=$("
").attr("id","mouse-tip").addClass("mouse-tip").css({left:t,right:"",top:e.pageY+Meclib.MouseCursor.topMargin}).html(i);$(window).width()-(e.pageX+Meclib.MouseCursor.sideSpace)<0&&(t=$(window).width()-e.pageX,$(o).css({left:"",right:t})),$(o).fadeIn(500),$("#body").append(o)},Meclib.Function.hideMouseTip=function(){$(".mouse-tip").remove()},Meclib.Function.isTwoPage=function(){return 0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage},Meclib.Function.cancelFlipMotion=function(){if(""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}},Meclib.Function.getDefaultDeviceInterfaceType=function(){var e=1;return!0===Meclib.Function.getDeviceEventLists().touch&&(e=2),e},Meclib.Function.getDeviceEventLists=function(){var e={mouse:!1,touch:!1,pointer:!1};return void 0!==document.onmousedown&&(e.mouse=!0),void 0!==document.ontouchstart&&(e.touch=!0),window.navigator.pointerEnabled|window.navigator.msPointerEnabled&&(e.pointer=!0),void 0!==document.onpointerdown&&(e.pointer=!0),Meclib.Globals.ua.search("iPhone")>-1||Meclib.Globals.ua.search("iPad")>-1||Meclib.Globals.ua.search("Android")>-1?(e.mouse=!1,e.pointer=!1):Meclib.Globals.ua.toLowerCase().indexOf("macintosh")>-1&&"ontouchend"in document?(e.touch=!0,e.mouse=!1,e.pointer=!1):!0===e.pointer&&(e.touch=!1),navigator.maxTouchPoints,e},Meclib.Function.getDomain=function(){Meclib.Property.domainName=location.protocol+"//"+location.host,Meclib.Property.url=Meclib.Property.domainName+location.pathname,""!==location.pathname.split("/").pop()&&(Meclib.Property.url=Meclib.Property.url.replace(location.pathname.split("/").pop(),"")),Meclib.Lists.domainList.fetch({dataType:"json",success:function(e,i,t){for(var o=i.length,a=0;a0&&(i=Meclib.Lists.domainList.getMaxId()+1),void 0===e){var t=new ViewerApp.Models.Domain({id:i,url:Meclib.Property.url});Meclib.Lists.domainList.add(t),t.save(),Meclib.Property.domainId=i}else Meclib.Property.domainId=e.get("id");Meclib.Property.domainId+="",Meclib.Property.domains=[],Meclib.Property.domains.push(Meclib.Property.domainId);var o=Meclib.Property.url.split("/").length-1;Meclib.Lists.domainList.length>0&&Meclib.Lists.domainList.each((function(e){var i=e.get("url"),t=i.split("/").length-1;i.indexOf(Meclib.Property.url)>-1&&t===o&&Meclib.Property.domains.push(e.get("id")+"")}))},Meclib.Function.mergeTextbox=function(e){for(var i=null,t=e.length,o=0;oa.x?l.x+l.width-a.x:a.x-(l.x+l.width))>30)i=o;else{var c,s=0;l.x2&&"function"==typeof arguments[2]&&(t=arguments[2],o=!0),$(e).css({display:"flex",bottom:0}).stop().animate({bottom:-1*$("#footer").height()},{duration:300,complete:function(){}}),setTimeout((function(){$(i).css({display:"flex",bottom:-1*$("#footer").height()}).stop().animate({bottom:0},{duration:300,complete:function(){o&&t()}})}),400)},Meclib.Tooltip.objects={printout:{id:"#btn-printout",placement:"s",smartPlacement:!0},fullscreen:{id:"#btn-fullscreen",placement:"s",smartPlacement:!0},option:{id:"#btn-option",placement:"s",smartPlacement:!0},help:{id:"#btn-help",placement:"s",smartPlacement:!0},bookinfo:{id:"#btn-bookinfo",placement:"s",smartPlacement:!0},listmenu:{id:"#btn-listmenu",placement:"n",smartPlacement:!0},thumbnail:{id:"#btn-thumbnail",placement:"n",smartPlacement:!0},booklink:{id:"#btn-booklink",placement:"n",smartPlacement:!0},bookpdf:{id:"#btn-bookpdf",placement:"n",smartPlacement:!0},autoflip:{id:"#btn-autoflip",placement:"n",smartPlacement:!0},zoominout:{id:"#btn-zoominout",placement:"n",smartPlacement:!0},croplist:{id:"#btn-croplist",placement:"n",smartPlacement:!0},fusenlist:{id:"#btn-fusenlist",placement:"n",smartPlacement:!0},commentlist:{id:"#btn-commentlist",placement:"n",smartPlacement:!0},memo:{id:"#btn-memo",placement:"n",smartPlacement:!0},txtcopy:{id:"#btn-txtcopy",placement:"n",smartPlacement:!0},crop:{id:"#btn-crop",placement:"n",smartPlacement:!0},fusen:{id:"#btn-fusen",placement:"n",smartPlacement:!0},moveright:{id:"#btn-moveright",placement:"n",smartPlacement:!0},moverightlimit:{id:"#btn-moverightlimit",placement:"n",smartPlacement:!0},moveleft:{id:"#btn-moveleft",placement:"n",smartPlacement:!0},moveleftlimit:{id:"#btn-moveleftlimit",placement:"n",smartPlacement:!0},moveleftldbimit:{id:"#btn-db",placement:"n",smartPlacement:!0},selectText:{id:"#btn-mode-drag-txtcopy",placement:"n",smartPlacement:!0},dragPagearea:{id:"#btn-mode-drag-zoomarea",placement:"n",smartPlacement:!0},cancelMenu:{id:".btn-close-submenu",placement:"n",smartPlacement:!0},curve:{id:'.btn-memo-tool[data-type="curve"]',placement:"n",smartPlacement:!0},straight:{id:'.btn-memo-tool[data-type="straight"]',placement:"n",smartPlacement:!0},square:{id:'.btn-memo-tool[data-type="square"]',placement:"n",smartPlacement:!0},circle:{id:'.btn-memo-tool[data-type="circle"]',placement:"n",smartPlacement:!0},eraser:{id:'.btn-memo-tool[data-type="eraser"]',placement:"n",smartPlacement:!0},trash:{id:'.btn-memo-tool[data-type="trash"]',placement:"n",smartPlacement:!0},undo:{id:'.btn-memo-tool[data-type="undo"]',placement:"n",smartPlacement:!0},color:{id:'.btn-memo-tool[data-type="color"]',placement:"n",smartPlacement:!0},size:{id:'.btn-memo-tool[data-type="size"]',placement:"n",smartPlacement:!0},alpha:{id:'.btn-memo-tool[data-type="alpha"]',placement:"n",smartPlacement:!0}},Meclib.Function.hideTooltips=function(){for(var e in Meclib.Tooltip.objects)$.powerTip.destroy(Meclib.Tooltip.objects[e].id)},Meclib.Function.initTooltips=function(){for(var e in Meclib.Tooltip.objects)$(Meclib.Tooltip.objects[e].id).powerTip({placement:Meclib.Tooltip.objects[e].placement,smartPlacement:Meclib.Tooltip.objects[e].smartPlacement});$("#btn-option").data("powertip",Meclib.Message.tooltip.header.option),$("#btn-help").data("powertip",Meclib.Message.tooltip.header.help),$("#btn-fullscreen").data("powertip",Meclib.Message.tooltip.header.fullscreen),$("#btn-printout").data("powertip",Meclib.Message.tooltip.header.printout),$("#btn-bookinfo").data("powertip",Meclib.Message.tooltip.header.bookinfo),$("#btn-listmenu").data("powertip",Meclib.Message.tooltip.footer.bookIndex),$("#btn-thumbnail").data("powertip",Meclib.Message.tooltip.footer.pageList),$("#btn-booklink").data("powertip",Meclib.Message.tooltip.footer.bookLink),$("#btn-bookpdf").data("powertip",Meclib.Message.tooltip.footer.bookPdf),$("#btn-autoflip").data("powertip",Meclib.Message.tooltip.footer.autoflip),$("#btn-zoominout").data("powertip",Meclib.Message.tooltip.footer.zoomIn),$("#btn-croplist").data("powertip",Meclib.Message.tooltip.footer.cropList),$("#btn-fusenlist").data("powertip",Meclib.Message.tooltip.footer.fusenList),$("#btn-commentlist").data("powertip",Meclib.Message.tooltip.footer.commentList),$("#btn-crop").data("powertip",Meclib.Message.tooltip.footer.crop),$("#btn-fusen").data("powertip",Meclib.Message.tooltip.footer.fusen),$("#btn-memo").data("powertip",Meclib.Message.tooltip.footer.memo),$("#btn-txtcopy").data("powertip",Meclib.Message.tooltip.footer.txtcopy),$("#btn-mode-drag-txtcopy").data("powertip",Meclib.Message.tooltip.footer.selectText),$("#btn-mode-drag-zoomarea").data("powertip",Meclib.Message.tooltip.footer.dragPagearea),$(".btn-close-submenu").data("powertip",Meclib.Message.common.close),$('.btn-memo-tool[data-type="curve"]').data("powertip",Meclib.Message.memo.curve),$('.btn-memo-tool[data-type="straight"]').data("powertip",Meclib.Message.memo.straight),$('.btn-memo-tool[data-type="square"]').data("powertip",Meclib.Message.memo.square),$('.btn-memo-tool[data-type="circle"]').data("powertip",Meclib.Message.memo.circle),$('.btn-memo-tool[data-type="eraser"]').data("powertip",Meclib.Message.memo.eraser),$('.btn-memo-tool[data-type="trash"]').data("powertip",Meclib.Message.memo.trash),$('.btn-memo-tool[data-type="undo"]').data("powertip",Meclib.Message.memo.undo),$('.btn-memo-tool[data-type="color"]').data("powertip",Meclib.Message.memo.color),$('.btn-memo-tool[data-type="size"]').data("powertip",Meclib.Message.memo.size),$('.btn-memo-tool[data-type="alpha"]').data("powertip",Meclib.Message.memo.alpha),0===Meclib.Globals.book.pageOpenDir?($("#btn-moveright").data("powertip",Meclib.Message.tooltip.footer.moveNext),$("#btn-moverightlimit").data("powertip",Meclib.Message.tooltip.footer.moveEnd),$("#btn-moveleft").data("powertip",Meclib.Message.tooltip.footer.moveBack),$("#btn-moveleftlimit").data("powertip",Meclib.Message.tooltip.footer.moveStart)):($("#btn-moveright").data("powertip",Meclib.Message.tooltip.footer.moveBack),$("#btn-moverightlimit").data("powertip",Meclib.Message.tooltip.footer.moveStart),$("#btn-moveleft").data("powertip",Meclib.Message.tooltip.footer.moveNext),$("#btn-moveleftlimit").data("powertip",Meclib.Message.tooltip.footer.moveEnd)),$("#slider").data("powertip",""),1===Meclib.Globals.book.page_db&&$("#btn-db").data("powertip",(function(){return Meclib.Message.tooltip.footer.page_db.replace("|NAME|",Meclib.Globals.book.page_db_label)}))},Meclib.Function.changeTooptipFullscreen=function(e){!0===e?$("#btn-fullscreen").data("powertip",Meclib.Message.tooltip.header.exitFullscreen):$("#btn-fullscreen").data("powertip",Meclib.Message.tooltip.header.fullscreen)},Meclib.Function.changeTooptipZoom=function(e){!0===e?$("#btn-zoominout").data("powertip",Meclib.Message.tooltip.footer.zoomIn):$("#btn-zoominout").data("powertip",Meclib.Message.tooltip.footer.zoomOut)},Meclib.Function.showTooltips=function(){Meclib.Function.initTooltips()},Meclib.Function.showTooltipImage=function(){if(9!==Meclib.Globals.viewer.get("device")){var e={width:0,height:0};e.width=parseInt($("#tip").css("width"),10),e.height=parseInt($("#tip").css("height"),10);var i=0,t=0,o=0;arguments.length>=1?(i=arguments[0],t=Meclib.Globals.book.getLeftPage(i),o=Meclib.Globals.book.getRightPage(i)):(t=Meclib.Globals.book.getLeftPage(),o=Meclib.Globals.book.getRightPage()),0===t?($("#tooltip-image-l").attr({src:""}),$("#tooltip-label-l").text(""),$("#tooltip-label-unit").text(""),$("#tooltip-left").css("visibility","hidden")):($("#tooltip-left").css("visibility","visible"),$("#tooltip-label-l").text(Meclib.Globals.book.getPageName(t)),Meclib.Globals.book.jpegImages[t-1].src=Meclib.Globals.viewer.get("dataPath")+"jpg/"+Meclib.Function.formatNum(4,t)+".jpg"+Meclib.Cache.fileCache,$("#tooltip-image-l").attr({src:Meclib.Globals.book.jpegImages[t-1].src}),$(Meclib.Globals.book.jpegImages[t-1]).bind("load",{page:t},(function(e){}))),1===Meclib.Globals.bookCanvas.canvasNum&&i>0&&($("#tooltip-label-unit").text(Meclib.Globals.book.getPageName(i)),Meclib.Globals.book.jpegImages[i-1].src=Meclib.Globals.viewer.get("dataPath")+"jpg/"+Meclib.Function.formatNum(4,i)+".jpg"+Meclib.Cache.fileCache,$("#tooltip-image-unit").attr({src:Meclib.Globals.book.jpegImages[i-1].src}),$(Meclib.Globals.book.jpegImages[i-1]).bind("load",{page:i},(function(e){}))),0===o?($("#tooltip-image-r").attr({src:""}),$("#tooltip-label-r").text(""),$("#tooltip-right").css("visibility","hidden")):($("#tooltip-right").css("visibility","visible"),$("#tooltip-label-r").text(Meclib.Globals.book.getPageName(o)),Meclib.Globals.book.jpegImages[o-1].src=Meclib.Globals.viewer.get("dataPath")+"jpg/"+Meclib.Function.formatNum(4,o)+".jpg"+Meclib.Cache.fileCache,$("#tooltip-image-r").attr({src:Meclib.Globals.book.jpegImages[o-1].src}),$(Meclib.Globals.book.jpegImages[o-1]).bind("load",{page:o},(function(e){})));var a=150,l=180,n=90,c=90,s=85,r=20,g=0,b=0,p=0,d=0,M=85,m=0,h=1;1===Meclib.Globals.bookCanvas.canvasNum&&(l=140,n=140,c=140,s=140),Meclib.Globals.book.thumbWidthM&&(b*=h=(p=M)/g,g=p)):(1===Meclib.Globals.bookCanvas.canvasNum&&(M=115),h=(g=M)/Meclib.Globals.book.thumbWidth,(b=Meclib.Globals.book.thumbHeight*h)>M&&(g*=h=(d=M)/b,b=d)),m=parseInt((a-(r+b))/2,10)-2,$("#tooltip-image-l").css({width:g,height:b,"margin-top":m}),$("#tooltip-image-r").css({width:g,height:b,"margin-top":m}),$("#tooltip-image-unit").css({width:g,height:b,"margin-top":m}),$("#tip").css({width:l,height:a}),$("#tooltip-label-l").css("width",s),$("#tooltip-label-r").css("width",s),$("#tooltip-label-unit").css("width",s),$("#tooltip-left").css("width",n),$("#tooltip-right").css("width",c),1===Meclib.Globals.bookCanvas.canvasNum?($("#tooltip-left").hide(),$("#tooltip-right").hide(),$("#tooltip-unit").show()):($("#tooltip-left").show(),$("#tooltip-right").show(),$("#tooltip-unit").hide())}},ViewerApp.Views.HeaderView=Backbone.View.extend({el:$("#header"),initialize:function(e){ViewerApp.mediator.on("book:ready",this.ready),ViewerApp.mediator.on("header:update",this.update),1===Meclib.Globals.viewer.get("device")&&(Meclib.ClickManager.add("#header","#btn-fullscreen",(function(e){!0===Meclib.Function.isSideMenuOpened()&&ViewerApp.mediator.trigger("menu:close"),!0===Meclib.Function.isFullscreen()?Meclib.Function.exitFullscreen():Meclib.Function.requestFullscreen()})),$(document).off("submit","#pagesearch-form"),$(document).on("submit","#pagesearch-form",(function(e){var i=$("#input-targetpage").val();return ViewerApp.mediator.trigger("main:moveInputPage",i),!1})),$(document).on("blur","#header input",(function(e){return Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1&&window.getSelection().removeAllRanges(),setTimeout((function(){ViewerApp.mediator.trigger("menu:closeMainMenu")}),2e3),!1})));var i=!1;(document.body.webkitRequestFullscreen||document.body.mozRequestFullScreen||document.body.msRequestFullscreen||document.body.requestFullscreen)&&(i=!0),!0===i&&$("#btn-fullscreen").show()},ready:function(){$(".menu-btn-printout").hide(),1===Meclib.Globals.viewer.get("enabedOptions").print&&"MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&(Meclib.Globals.book.totalPage>1||!0===Meclib.Lists.pageSettingList.isPrint(1))&&$(".menu-btn-printout").show(),"MAINTE"!==Meclib.Setting.type&&(1!==Meclib.Globals.viewer.get("enabedOptions").txtsearch&&1!==Meclib.Globals.book.book_db||ViewerApp.mediator.trigger("menu:showMenuButon","txtsearch"))},events:function(){return{"click #btn-txtsearch-icon":"onTxtSearch","click #btn-printout":"onPrintOut","click .ev-btn-option":"onOptionMenu","click .ev-btn-help":"onHelpMenu","click .sd-menu-topleft":"onSideNavi","click .ev-btn-bookinfo":"onBookInfoMenu",mouseleave:"onMouseOut"}},update:function(){!0===Meclib.Function.isFullscreen()?$("#btn-fullscreen").removeClass("fullscreen").addClass("fullscreen"):$("#btn-fullscreen").removeClass("fullscreen"),$(".header-title").hide(),setTimeout((function(){$(".header-title").hide(),$(".header-title").show()}),500)},onMouseOut:function(e){var i=500;!0!==Meclib.Mode.fusen&&!0!==Meclib.Mode.crop&&!0!==Meclib.Mode.autoflipping||(i=0),1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay&&setTimeout((function(){ViewerApp.mediator.trigger("menu:closeMainMenu")}),i)},onSideNavi:function(){ViewerApp.mediator.trigger("sidenavi:toggleSideNavi")},onTxtSearch:function(){1===Meclib.Globals.book.book_db?(Meclib.Products.search.mode="search",Meclib.Products.search.form="#txtsearch-input",ViewerApp.mediator.trigger("products:openPageProductsPanel")):ViewerApp.mediator.trigger("textsearch:search",1)},onPrintOut:function(){ViewerApp.mediator.trigger("print:showPanel")},onOptionMenu:function(){"optionmenu"===Meclib.Globals.viewer.get("mode")?ViewerApp.mediator.trigger("optionmenu:close"):ViewerApp.mediator.trigger("optionmenu:show")},onHelpMenu:function(){ViewerApp.mediator.trigger("main:openHelp")},onBookInfoMenu:function(){ViewerApp.mediator.trigger("bookinfo:show")}}),ViewerApp.Views.SideNaviView=Backbone.View.extend({el:$("#sd-sidemenu-navi"),initialize:function(e){_.bindAll(this,"showMenu"),ViewerApp.mediator.on("sidenavi:openSideNavi",this.openSideNavi),ViewerApp.mediator.on("sidenavi:closeSideNavi",this.closeSideNavi),ViewerApp.mediator.on("sidenavi:toggleSideNavi",this.toggleSideNavi),ViewerApp.mediator.on("sidenavi:load",this.load),ViewerApp.mediator.on("sidenavi:resize",this.resize),ViewerApp.mediator.on("sidenavi:showMenu",this.showMenu),ViewerApp.mediator.on("sidenavi:addListsEvent",this.addListsEvent)},load:function(){var e={};switch(e._pageMove=Meclib.Message.functionName.pageMove,e._pageList=Meclib.Message.functionName.pageList,e._pdfOpen=Meclib.Message.functionName.pdfOpen,e._bookLink=Meclib.Message.functionName.bookLink,e._fusenList=Meclib.Message.functionName.fusenList,e._cropList=Meclib.Message.functionName.cropList,e._commentList=Meclib.Message.functionName.commentList,e._browsingHistory=Meclib.Message.functionName.browsingHistory,e._bookInfo=Meclib.Message.functionName.bookInfo,e._option=Meclib.Message.functionName.option,e._txtcopy=Meclib.Message.functionName.txtcopy,e._download=Meclib.Message.functionName.download,1===Meclib.Globals.viewer.get("enabedOptions").fusen&&1===Meclib.Globals.viewer.get("systemAllows").fusen?e.enableFusen=!0:e.enableFusen=!1,e.enablePdf=!1,1!==Meclib.Globals.viewer.get("enabedOptions").allPdf&&1!==Meclib.Globals.viewer.get("enabedOptions").pdf||(e.enablePdf=!0),1===Meclib.Globals.viewer.get("optionIncludes").booklink?e.enableBooklink=!0:e.enableBooklink=!1,1===Meclib.Globals.viewer.get("enabedOptions").crop&&1===Meclib.Globals.viewer.get("systemAllows").crop?e.enableCrop=!0:e.enableCrop=!1,1===Meclib.Globals.viewer.get("enabedOptions").comment&&1===Meclib.Globals.viewer.get("systemAllows").comment?e.enableComment=!0:e.enableComment=!1,1===Meclib.Globals.viewer.get("enabedOptions").txtcopy?e.enableTxtcopy=!0:e.enableTxtcopy=!1,1===Meclib.Globals.viewer.get("systemAllows").browsingHistory?e.enableBrowsinghistory=!0:e.enableBrowsinghistory=!1,1===Meclib.Globals.book.bookinfo?e.enableBookInfo=!0:e.enableBookInfo=!1,1===Meclib.Globals.book.mybookshelfFlg&&""!==Meclib.App.scheme?e.enableDownload=!0:e.enableDownload=!1,Meclib.Globals.viewer.get("device")){case 2:$("#sd-sidemenu-navi").html(_.template($("#sd-sidemenu-template").html())(e));break;case 3:$("#sd-sidemenu-navi").html(_.template($("#sp-sidemenu-template").html())(e))}setTimeout((function(){$("#sd-sidemenu-items").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:100,scrollInertia:200,scrollButtons:{enable:!1}}),ViewerApp.mediator.trigger("sidenavi:addListsEvent")}),1e3)},addListsEvent:function(){Meclib.ClickManager.add("#sd-sidemenu-navi",".sd-sidemenu-item",(function(e){"LI"===$(e).get(0).tagName?ViewerApp.mediator.trigger("sidenavi:showMenu",$(e).attr("id")):ViewerApp.mediator.trigger("sidenavi:showMenu",$(e).parent().attr("id"))}),!0),$("#sd-sidemenu-navi").hammer().on("swipeleft",(function(e){e.stopPropagation(),ViewerApp.mediator.trigger("sidenavi:closeSideNavi")}))},resize:function(){switch($("#sd-sidemenu-navi").css({height:Meclib.Function.getWinsize().height,top:"0px"}),Meclib.Globals.viewer.get("device")){case 2:Meclib.Size.sideNavi.width=300;break;case 3:Meclib.Size.sideNavi.width=$(window).width()-Meclib.Size.sideNavi.outsideWidth}2!==Meclib.Globals.viewer.get("device")&&3!==Meclib.Globals.viewer.get("device")||ViewerApp.mediator.trigger("sidenavi:closeSideNavi")},showMenu:function(e){switch(e){case"navi-pagesearch":this.onPageSearch();break;case"navi-pagelist":this.onPageList();break;case"navi-booklink":this.onBookLink();break;case"navi-bookpdf":this.onBookPdf();break;case"navi-browsinghistory":this.onBrowsingHistory();break;case"navi-fusenlist":this.onFusenList();break;case"navi-commentlist":this.onCommentList();break;case"navi-bookinfo":this.onBookInfo();break;case"navi-crop":this.onCropList();break;case"navi-download":this.onDownload();break;case"navi-option":this.onOption();break;case"navi-txtcopy":this.onTxtCopy()}},onPageSearch:function(e){ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),ViewerApp.mediator.trigger("pagesearch:show")},onPageList:function(e){ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),ViewerApp.mediator.trigger("menu:toggle","pageList")},onBookLink:function(e){ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),ViewerApp.mediator.trigger("menu:toggle","bookLink")},onFusenList:function(e){ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),ViewerApp.mediator.trigger("menu:toggle","fusenList")},onCropList:function(e){ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),ViewerApp.mediator.trigger("menu:open","cropList")},onBookPdf:function(e){ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),ViewerApp.mediator.trigger("pdf:showPanel")},onCommentList:function(e){ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),ViewerApp.mediator.trigger("menu:toggle","commentList")},onBookInfo:function(){ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),setTimeout((function(){ViewerApp.mediator.trigger("bookinfo:show")}),500)},onBrowsingHistory:function(e){ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),ViewerApp.mediator.trigger("menu:toggle","browsingHistory")},onTxtCopy:function(e){ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),Meclib.Txtcopy.action.startTxtcopyMode()},onDownload:function(e){ViewerApp.mediator.trigger("main:donwload2Bookshelf")},onOption:function(e){ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),ViewerApp.mediator.trigger("menu:toggle","option")},openSideNavi:function(){ViewerApp.mediator.trigger("contents:endEditMode"),ViewerApp.mediator.trigger("pagesearch:close"),ViewerApp.mediator.trigger("pdf:closePanel"),Meclib.Mode.txtcopy&&ViewerApp.mediator.trigger("txtcopy:end"),Meclib.Mode.memo&&ViewerApp.mediator.trigger("memo:close"),Meclib.NaviMenu.display=!0,ViewerApp.mediator.trigger("menu:showNaviMask",!0);var e=Meclib.Speed.sideNaviOpen,i="easeOutBack";$("#sd-sidemenu-navi").show(),ViewerApp.mediator.trigger("menu:close"),$("#main").animate({left:Meclib.Size.sideNavi.width+"px"},{duration:e,easing:i}),$("#header").animate({left:Meclib.Size.sideNavi.width+1+"px"},{duration:e,easing:i}),$("#footer").animate({left:Meclib.Size.sideNavi.width+1+"px"},{duration:e,easing:i}),$("#footer-sub-box").animate({left:Meclib.Size.sideNavi.width+1+"px"},{duration:e,easing:i}),$("#sd-sidemenu-navi").animate({width:Meclib.Size.sideNavi.width+"px"},{duration:e,easing:i,complete:function(){$("#btn-sidenavi-menu").removeClass("closed").addClass("closed"),$(".sd-menu-topleft").removeClass("closed").addClass("closed"),setTimeout((function(){ViewerApp.mediator.trigger("externalapi:draw"),$("#sd-sidemenu-items").mCustomScrollbar("update")}),500)}}),3===Meclib.Globals.viewer.get("device")&&$(".menu-pagemove").addClass("hidden")},closeSideNavi:function(){$("#main").animate({left:0},{duration:Meclib.Speed.sideNaviClose}),$("#header").animate({left:0},{duration:Meclib.Speed.sideNaviClose}),$("#footer").animate({left:0},{duration:Meclib.Speed.sideNaviClose}),$("#footer-sub-box").animate({left:0},{duration:Meclib.Speed.sideNaviClose}),ViewerApp.mediator.trigger("menu:showMenuMask",!1),ViewerApp.mediator.trigger("menu:close"),$("#sd-sidemenu-navi").animate({width:"0"},{duration:Meclib.Speed.sideNaviClose,complete:function(){$("#sd-sidemenu-navi").hide(),Meclib.NaviMenu.display=!1,$(".sd-menu-topleft").removeClass("closed"),$("#btn-sidenavi-menu").removeClass("closed"),ViewerApp.mediator.trigger("menu:showNaviMask",!1),3===Meclib.Globals.viewer.get("device")&&$(".menu-pagemove").removeClass("hidden")}})},toggleSideNavi:function(){!0!==Meclib.Mode.autoflipping&&("0px"===$("#sd-sidemenu-navi").css("width")?ViewerApp.mediator.trigger("sidenavi:openSideNavi"):$("#sd-sidemenu-navi").css("width")===Meclib.Size.sideNavi.width+"px"&&ViewerApp.mediator.trigger("sidenavi:closeSideNavi"))}}),ViewerApp.Views.FooterView=Backbone.View.extend({el:$("#footer"),initialize:function(e){ViewerApp.mediator.on("footer:changeZoomIcon",this.changeZoomIcon),ViewerApp.mediator.on("footer:initPageSlider",this.initPageSlider),ViewerApp.mediator.on("footer:updatePageSlider",this.updatePageSlider),ViewerApp.mediator.on("footer:updateSliderTipPos",this.updateSliderTipPos),ViewerApp.mediator.on("footer:showCommentList",this.showCommentList),ViewerApp.mediator.on("menu:moveLeftPage",this.moveLeftPage),ViewerApp.mediator.on("menu:moveRightPage",this.moveRightPage),$("#body").append($("#footer-tooltip-template").html()),ViewerApp.mediator.on("footer:resize",this.resize)},events:function(){return{"click #btn-moveright":"moveRightPage","click #btn-moverightlimit":"moveRightLimitPage","click #btn-moveleft":"moveLeftPage","click #btn-moveleftlimit":"moveLeftLimitPage","click #btn-listmenu":"showCatalogIndex","click #sp-btn-index":"showCatalogIndex","click #btn-bookpdf":"showBookPdf","click #btn-thumbnail":"showPageList","click #btn-booklink":"showBookLink","click #btn-fusenlist":"showFusenList","click #btn-fusen":"showFusenPanel","click #sp-btn-fusen":"showFusenPanel","click #btn-croplist":"showCropList",'click #btn-crop:not(".disabled")':"showCropPanel","click #btn-memo":"showMemoPanel","click #btn-autoflip":"showAutoFlipPanel","click #btn-zoominout":"onZoomInOut","click #btn-txtsearch":"showTxtSearchPanel",'click #btn-db:not(".disabled")':"showProductsPanel","click #btn-download":"onDownload","click #btn-commentlist":"showCommentList",'click #btn-txtcopy:not(".disabled")':"showTxtcopy",'click #btn-memo:not(".disabled")':"showMemoMenu","mouseover .ev-icon-footer":"onOverFooterIcon",mouseleave:"onMouseOut"}},resize:function(){var e=Meclib.Globals.bookCanvas.canvasWidth,i=.1*e;(i=55)>120&&(i=120);var t=e-2*i;$("#pageno-label-l").css({position:"absolute",width:i-10,left:10}),$("#pageno-label-r").css({position:"absolute",width:i-10,right:10}),$("#slider").css({position:"absolute",width:t,left:i}),$("#slider-image").css({position:"absolute",width:t,left:i}),!1===Meclib.Function.isZoomabled()?$("#btn-zoominout").addClass("disabled"):$("#btn-zoominout").removeClass("disabled"),Meclib.Function.setFooterPosition()},onMouseOut:function(e){var i=500;!0!==Meclib.Mode.fusen&&!0!==Meclib.Mode.crop&&!0!==Meclib.Mode.autoflipping||(i=0),1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay&&setTimeout((function(){ViewerApp.mediator.trigger("menu:closeMainMenu")}),i)},onOverFooterIcon:function(e){ViewerApp.mediator.trigger("canvas:onMouseMove",e)},initPageSlider:function(){var e=1;1===Meclib.Globals.book.pageOpenDir&&(e=Meclib.Globals.book.totalPage),Meclib.Initial.slider=1;$("#slider").slider({value:e,min:1,max:10*Meclib.Globals.book.totalPage,animate:.5,step:1,create:function(e,i){9!==Meclib.Globals.viewer.get("device")&&Meclib.Function.showTooltipImage()},slide:function(e,i){if(!0===Meclib.ShowMenuBehind)return!1;Meclib.PageSlider.selected=!0;var t=i.value;(t=parseInt(t/10,10))<1&&(t=1),1===Meclib.Globals.book.pageOpenDir&&(t=Meclib.Globals.book.totalPage-t+1),!0!==Meclib.PageSearch.display&&(ViewerApp.mediator.trigger("footer:updateSliderTipPos",e.clientX),$(Meclib.Globals.tooltip).fadeIn(),setTimeout((function(){ViewerApp.mediator.trigger("footer:updateSliderTipPos",0)}),300),Meclib.Function.showTooltipImage(t))},stop:function(e,i){if(!0===Meclib.ShowMenuBehind)return!1;var t=i.value;(t=parseInt(t/10,10))<1&&(t=1),ViewerApp.mediator.trigger("footer:updateSliderTipPos",0),Meclib.PageSlider.selected=!0,1===Meclib.Globals.book.pageOpenDir&&(t=Meclib.Globals.book.totalPage-t+1),ViewerApp.mediator.trigger("canvas:cancelOverAnimation"),ViewerApp.mediator.trigger("main:movePage",t),Meclib.PageSlider.selected=!1,setTimeout((function(){$(Meclib.Globals.tooltip).fadeOut()}),500)},change:function(e,i){}}).find(".ui-slider-handle").hover((function(){}),(function(){}))},updatePageSlider:function(){if(""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}if(1===Meclib.Initial.slider){var e=Meclib.Globals.book.currentPage;1===Meclib.Globals.book.pageOpenDir&&(e=Meclib.Globals.book.totalPage-e+1),e*=10,1===Meclib.Globals.book.getOpenPageNo(0)||1===Meclib.Globals.book.getOpenPageNo(1)?(e=1,1===Meclib.Globals.book.pageOpenDir&&(e=10*Meclib.Globals.book.totalPage)):Meclib.Globals.book.getOpenPageNo(0)!==Meclib.Globals.book.totalPage&&Meclib.Globals.book.getOpenPageNo(1)!==Meclib.Globals.book.totalPage||(e=10*Meclib.Globals.book.totalPage,1===Meclib.Globals.book.pageOpenDir&&(e=1)),$("#slider").slider("value",e)}$("#slider").show(),$("#slider-image").show(),1===Meclib.Globals.book.totalPage?($("#slider").hide(),$("#slider-image").hide()):2===Meclib.Globals.book.totalPage&&(1===Meclib.Globals.bookCanvas.canvasNum||2===Meclib.Globals.bookCanvas.canvasNum&&0===Meclib.Globals.book.cover||($("#slider").hide(),$("#slider-image").hide()))},updateSliderTipPos:function(e){var i=parseInt($("#slider").css("left"),10),t=parseInt($("#slider .ui-slider-handle").css("left"),10),o=0;e>0?o=e-$(".tooltip-box").width()/2:(o=i+t,o-=$(".tooltip-box").width()/2),o<0&&(o=0),o+Meclib.Function.getCssVal(".tooltip-box").width>Meclib.Function.getWinsize().width&&(o=Meclib.Function.getWinsize().width-Meclib.Function.getCssVal(".tooltip-box").width);var a=100;1===Meclib.Globals.viewer.get("device")&&(a=90),Meclib.Globals.tooltip.css({left:o,bottom:a})},moveRightPage:function(){!1!==Meclib.Function.isAutoflipPageMovable()&&(Meclib.Function.postParent("movestart"),Meclib.Globals.viewer.get("scale")>2?ViewerApp.mediator.trigger("main:moveRightPage","none"):ViewerApp.mediator.trigger("main:moveRightPage"))},moveRightLimitPage:function(){!1!==Meclib.Function.isAutoflipPageMovable()&&(Meclib.Function.postParent("movestart"),ViewerApp.mediator.trigger("main:moveRightLimitPage"))},moveLeftPage:function(){!1!==Meclib.Function.isAutoflipPageMovable()&&(Meclib.Function.postParent("movestart"),ViewerApp.mediator.trigger("main:moveLeftPage"))},moveLeftLimitPage:function(){!1!==Meclib.Function.isAutoflipPageMovable()&&(Meclib.Function.postParent("movestart"),ViewerApp.mediator.trigger("main:moveLeftLimitPage"))},showCatalogIndex:function(){ViewerApp.mediator.trigger("menu:toggle","catalogIndex")},showBookPdf:function(){ViewerApp.mediator.trigger("pdf:showPanel")},showPageList:function(){ViewerApp.mediator.trigger("menu:toggle","pageList")},showBookLink:function(){ViewerApp.mediator.trigger("menu:toggle","bookLink")},showFusenList:function(){ViewerApp.mediator.trigger("menu:toggle","fusenList")},showFusenPanel:function(){return"fusen"===Meclib.Globals.viewer.get("mode")?ViewerApp.mediator.trigger("fusen:close"):ViewerApp.mediator.trigger("fusen:showPanel"),!1},showCropPanel:function(){"MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&ViewerApp.mediator.trigger("crop:startCropMode")},showCropList:function(){"MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping&&ViewerApp.mediator.trigger("menu:toggle","cropList")},showProductsPanel:function(e){Meclib.Products.search.mode="page",ViewerApp.mediator.trigger("products:openPageProductsPanel")},showMemoPanel:function(){!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping&&ViewerApp.mediator.trigger("memo:show")},showAutoFlipPanel:function(){ViewerApp.mediator.trigger("autoflip:showAutoFlip")},onZoomInOut:function(){!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping&&ViewerApp.mediator.trigger("canvas:scaleCenter")},showTxtSearchPanel:function(){1===Meclib.Globals.book.book_db?(Meclib.Products.search.mode="search",Meclib.Products.search.form="",ViewerApp.mediator.trigger("products:openPageProductsPanel")):ViewerApp.mediator.trigger("menu:toggle","txtSearch")},changeZoomIcon:function(){Meclib.Globals.viewer.get("scale")===Meclib.Globals.book.zoomMax?($("#btn-zoominout *").attr("data-zoom","zoomout"),Meclib.Function.changeTooptipZoom(!1)):($("#btn-zoominout *").attr("data-zoom",""),Meclib.Function.changeTooptipZoom(!0))},showCommentList:function(){"MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping&&ViewerApp.mediator.trigger("menu:toggle","commentList")},onDownload:function(){ViewerApp.mediator.trigger("main:donwload2Bookshelf")},showTxtcopy:function(){Meclib.Txtcopy.action.startTxtcopyMode()},showMemoMenu:function(){if(Meclib.Function.cancelFlipMotion(),"MAINTE"!==Meclib.Setting.type)if(!0===Meclib.Mode.memo)$('[data-role="main"]').show(),$('[data-role="sub"]').hide(),$('[data-type="memo"]').hide(),$("#header").show(),ViewerApp.mediator.trigger("memo:clear"),$("#page-area").css({"pointer-events":""}),$("#memo-layer").css({"pointer-events":"none"});else{if(!0===Meclib.Function.isSideMenuOpened()&&ViewerApp.mediator.trigger("menu:close"),!0===Meclib.Mode.autoflip||!0===Meclib.Mode.autoflipping)return;$('[data-role="main"]').hide(),$('[data-role="sub"]').css("display","flex"),$("#page-area").css({"pointer-events":"none"}),Meclib.Memo.action.start(),ViewerApp.mediator.trigger("memo:onSelectMode"),$('footer [data-type="memo"]').css({position:"absolute",bottom:-1*$("#footer-sub").height()}),3===Meclib.Globals.viewer.get("device")&&$("#footer-sub-box").hide();var e="#footer-icon-box";3===Meclib.Globals.viewer.get("device")&&(e="#footer-centericon"),Meclib.Memo.action.changeMemoMenu(e,'footer [data-type="memo"]',(function(){3===Meclib.Globals.viewer.get("device")&&($("#memo-layer").css({"pointer-events":""}),$("#footer-sub-box").hide())}))}}}),ViewerApp.Views.SideMenuView=Backbone.View.extend({name_:"SideMenuView",el:$("#sidemenu"),current:"",events:function(){return{resize:"resize","click .ev-maxmin-menu":"showMaxminMenu","click #btn-closemenu":"onClose","click .ev-close-menu":"onClose","click #btn-back-menu":"close"}},initialize:function(e){try{_.bindAll(this,"render","resize","initPageList","toggle","open","close","clearMenu","updatePage")}catch(e){Meclib.Function.onError(e)}Meclib.Canvas.motion="",ViewerApp.mediator.on("menu:render",this.render),ViewerApp.mediator.on("menu:initPageList",this.initPageList),ViewerApp.mediator.on("menu:update",this.updatePage),ViewerApp.mediator.on("menu:clearSedeMenu",this.clearMenu),ViewerApp.mediator.on("menu:open",this.open),ViewerApp.mediator.on("menu:onClose",this.onClose),ViewerApp.mediator.on("menu:close",this.close),ViewerApp.mediator.on("menu:toggle",this.toggle),ViewerApp.mediator.on("menu:resize",this.resize),ViewerApp.mediator.on("menu:resizeNormal",this.resizeNormal),ViewerApp.mediator.on("menu:resizeMax",this.resizeMax),ViewerApp.mediator.on("menu:showMenuMask",this.showMenuMask),ViewerApp.mediator.on("menu:showNaviMask",this.showNaviMask),ViewerApp.mediator.on("menu:toggleMenu",this.toggleMenu),ViewerApp.mediator.on("menu:openMainMenu",this.openMainMenu),ViewerApp.mediator.on("menu:closeMainMenu",this.closeMainMenu),ViewerApp.mediator.on("menu:showMaxminMenu",this.showMaxminMenu),ViewerApp.mediator.on("menu:showBookPdf",this.showBookPdf),ViewerApp.mediator.on("menu:checkEnableMenu",this.checkEnableMenu),ViewerApp.mediator.on("menu:showMenuButon",this.showMenuButon),ViewerApp.mediator.on("menu:hideMenuButon",this.hideMenuButon),ViewerApp.mediator.on("menu:showCommentList",this.showCommentList),ViewerApp.mediator.on("menu:showPageList",this.showPageList),ViewerApp.mediator.on("menu:showLoading",this.showLoading),ViewerApp.mediator.on("menu:closeLoading",this.closeLoading),this.resize(),$("#sidemenu").hide(),this.close()},render:function(){ViewerApp.mediator.trigger("menu:updatePage")},resize:function(){var e=Meclib.Function.getWinsize().height;switch(Meclib.Globals.viewer.get("device")){case 1:case 2:Meclib.Size.sideMenu=400,Meclib.Size.sidemenuHeight=e-(Meclib.Size.headerHeight+Meclib.Size.footerHeight);break;case 3:Meclib.Size.sideMenu=Meclib.Function.getWinsize().width,Meclib.Size.sidemenuHeight=e-Meclib.Size.headerHeight,$("#header,#footer").width($(window).width())}switch($("#sidemenu").css("height",Meclib.Size.sidemenuHeight+"px"),$("#sd-sidemenu-navi").css({height:e+"px",top:"0px"}),Meclib.Globals.viewer.get("device")){case 1:case 2:Meclib.Size.sidemenuTop=Meclib.Size.headerHeight;break;case 3:Meclib.Size.sidemenuTop=Meclib.Size.headerHeight+Meclib.Size.sidemenuTitlebarHeight,$("#sd-menu-title-bar").css({top:Meclib.Size.headerHeight+"px"}),Meclib.Size.sidemenuTop=Meclib.Size.headerHeight}$("#sidemenu").css({top:Meclib.Size.sidemenuTop+"px"}),setTimeout("this.updateScrollbar",1e3),$(".menu-mask").css({width:Meclib.Function.getWinsize().width,height:Meclib.Function.getWinsize().height-(Meclib.Size.headerHeight+Meclib.Size.footerHeight),top:Meclib.Size.headerHeight,left:0}),$("navi-mask").css({width:Meclib.Function.getWinsize().width,height:Meclib.Function.getWinsize().height,top:0,left:0}),1===Meclib.Globals.viewer.get("device")&&this.close()},checkEnableMenu:function(){"MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&(1===Meclib.Globals.viewer.get("enabedOptions").crop&&1===Meclib.Globals.viewer.get("systemAllows").crop?ViewerApp.mediator.trigger("menu:showMenuButon","crop"):ViewerApp.mediator.trigger("menu:hideMenuButon","crop"),1===Meclib.Globals.viewer.get("optionIncludes").bookindex&&ViewerApp.mediator.trigger("menu:showMenuButon","bookindex"),1===Meclib.Globals.viewer.get("optionIncludes").booklink?ViewerApp.mediator.trigger("menu:showMenuButon","booklink"):ViewerApp.mediator.trigger("menu:hideMenuButon","booklink"),1===Meclib.Globals.viewer.get("enabedOptions").fusen&&1===Meclib.Globals.viewer.get("systemAllows").fusen?ViewerApp.mediator.trigger("menu:showMenuButon","fusen"):ViewerApp.mediator.trigger("menu:hideMenuButon","fusen"),1!==Meclib.Globals.viewer.get("enabedOptions").pdf&&1!==Meclib.Globals.viewer.get("enabedOptions").allPdf||ViewerApp.mediator.trigger("menu:showMenuButon","allPdf"),1===Meclib.Globals.viewer.get("enabedOptions").automove?ViewerApp.mediator.trigger("menu:showMenuButon","automove"):ViewerApp.mediator.trigger("menu:hideMenuButon","automove"),1===Meclib.Globals.viewer.get("enabedOptions").comment?ViewerApp.mediator.trigger("menu:showMenuButon","commentlist"):ViewerApp.mediator.trigger("menu:hideMenuButon","commentlist"),1===Meclib.Globals.viewer.get("enabedOptions").txtcopy?ViewerApp.mediator.trigger("menu:showMenuButon","txtcopy"):ViewerApp.mediator.trigger("menu:hideMenuButon","txtcopy"),1===Meclib.Globals.viewer.get("enabedOptions").memo?ViewerApp.mediator.trigger("menu:showMenuButon","memo"):ViewerApp.mediator.trigger("menu:hideMenuButon","memo"),1===Meclib.Globals.viewer.get("optionIncludes").externalapi&&ViewerApp.mediator.trigger("menu:showMenuButon","externalapi"),1===Meclib.Globals.book.mybookshelfFlg&&""!==Meclib.App.scheme&&ViewerApp.mediator.trigger("menu:showMenuButon","downoad"),1===Meclib.Globals.viewer.get("systemAllows").browsingHistory&&$("#menu-browsinghistory").hide())},showMenuButon:function(e){switch(e){case"bookindex":$("#btn-listmenu").show(),$("#sp-btn-index").show();break;case"booklink":$("#btn-booklink").show();break;case"fusen":$("#btn-fusen").show(),$("#sp-btn-fusen").show(),$("#btn-fusenlist").show(),$("#sp-btn-fusenlist").show();break;case"crop":$("#btn-croplist").show(),$("#btn-crop").show();break;case"allPdf":$("#btn-bookpdf").show();break;case"txtsearch":$("#btn-txtsearch").show(),$("#txtsearch-box").show();break;case"automove":$("#btn-autoflip").show();break;case"externalapi":$(".btn-sns").show(),$("#navi-sns").css("display","inline-table");break;case"print":$(".menu-btn-printout").show();break;case"commentlist":$("#btn-commentlist").show();break;case"db":$("#btn-db").show();break;case"downoad":$("#btn-download").show();break;case"txtcopy":$("#btn-txtcopy").show();break;case"memo":$("#btn-memo").show()}},hideMenuButon:function(e){switch(e){case"bookindex":$("#btn-listmenu").hide(),$("#sp-btn-index").hide();break;case"booklink":$("#btn-booklink").hide();break;case"fusen":$("#btn-fusen").hide(),$("#btn-fusenlist").hide(),$("#sp-btn-fusen").hide();break;case"crop":$("#btn-croplist").hide(),$("#btn-crop").hide();break;case"allPdf":$("#btn-bookpdf").hide();break;case"txtsearch":$("#btn-txtsearch").hide(),$("#txtsearch-box").hide();break;case"automove":$("#btn-autoflip").hide();break;case"externalapi":$(".btn-sns").hide(),$("#navi-sns").css("display","inline-table");break;case"commentlist":$("#btn-commentlist").hide();break;case"db":$("#btn-db").hide();break;case"print":$(".menu-btn-printout").hide();break;case"txtcopy":$("#btn-txtcopy").hide();break;case"memo":$("#btn-memo").hide()}},openMainMenu:function(){var e={};if(1===Meclib.Globals.viewer.get("device")){if(!1===Meclib.MainMenu.overlay)return;if(!0===Meclib.Function.isSideMenuOpened()||!0===Meclib.MainMenu.display)return;if("MAINTE"===Meclib.Setting.type)return;if(!0===Meclib.Mode.fusen||!0===Meclib.Mode.crop||!0===Meclib.Mode.commentSelect)return;if(!0===$("#header").is(":animated")||!0===$("#footer").is(":animated"))return;if(!0===Meclib.Canvas.selected||""!==Meclib.Canvas.motion)return;if(!0===Meclib.Mode.memo&&Meclib.Memo.isDown)return;$("#header").show().animate({top:0},{duration:300,complete:function(){Meclib.MainMenu.display=!0}}),e={startY:Meclib.Function.getWinsize().height+Meclib.Size.footerHeight+Meclib.Size.footerSubHeight,endY:Meclib.Function.getWinsize().height-Meclib.Size.footerHeight},parseInt($("#footer").css("top"),10)!==e.endY&&$("#footer").css({top:e.startY}),$("#footer").show().animate({top:e.endY},{duration:300,complete:function(){Meclib.MainMenu.display=!0}})}else{if(!0===Meclib.Mode.fusen||!0===Meclib.Mode.crop||!0===Meclib.Mode.commentSelect)return;if(!0===$("#header").is(":animated")||!0===$("#footer").is(":animated"))return;if(!0===Meclib.Canvas.selected||""!==Meclib.Canvas.motion)return;$("#header").show().animate({top:0},{duration:300,complete:function(){Meclib.MainMenu.display=!0}}),e={startY:Meclib.Function.getWinsize().height+Meclib.Size.footerHeight+Meclib.Size.footerSubHeight,endY:Meclib.Function.getWinsize().height-Meclib.Size.footerHeight},parseInt($("#footer").css("top"),10)!==e.endY&&$("#footer").css({top:e.startY}),$("#footer").show().animate({top:e.endY},{duration:300,complete:function(){Meclib.MainMenu.display=!0,ViewerApp.mediator.trigger("canvas:toggleSideBar",1)}}),$("#footer-sub-box").show().animate({bottom:Meclib.Size.footerHeight},{duration:300,complete:function(){}}),ViewerApp.mediator.trigger("pagemove:open")}},closeMainMenu:function(){if(0!==Meclib.Property.startTime&&0!==Meclib.Initial.book&&!((new Date).getTime()-Meclib.Property.startTime<2e3))if(1===Meclib.Globals.viewer.get("device")){if(!1===Meclib.MainMenu.overlay)return;if(!1===$("#sidemenu").is(":hidden"))return;if(!0===Meclib.Function.isSideMenuOpened())return;if(!1===Meclib.MainMenu.display)return;if("MAINTE"===Meclib.Setting.type)return;if(!0===Meclib.MainMenu.forceOpen)return;if(!1===Meclib.MainMenu.forceClose&&(jQuery(":hover").filter("#header").length>0||jQuery(":hover").filter("#footer").length))return;if(!1===Meclib.MainMenu.forceClose&&(!0===$("#header").is(":animated")||!0===$("#footer").is(":animated")))return;if(!1===Meclib.MainMenu.forceClose&&(jQuery(":focus").filter("#header input").length>0||jQuery(":focus").filter("#footer input").length))return;if(!1===Meclib.MainMenu.forceClose&&!0===Meclib.Menu.toggle)return;if(!$("#tip").is(":hidden"))return;if($("#panel-bookinfo")[0])return;if(!0===Meclib.Mode.txtcopy)return;if(!0===Meclib.Mode.memo)return;$("#header").animate({top:-50},{duration:300,complete:function(){Meclib.MainMenu.display=!1,$("#header").hide()}}),$("#footer").css({top:Meclib.Function.getWinsize().height-Meclib.Size.footerHeight,bottom:""}).animate({top:Meclib.Function.getWinsize().height+Meclib.Size.footerSubHeight+Meclib.Size.footerHeight},{duration:300,complete:function(){Meclib.MainMenu.display=!1,$("#footer").hide()}})}else{if(!1===Meclib.Mode.commentSelect&&!1===Meclib.Mode.crop){if(!1===$("#sidemenu").is(":hidden"))return;if(!0===Meclib.Function.isSideMenuOpened())return}if(3===Meclib.Globals.viewer.get("device")&&!0===Meclib.Function.isPanelMenuOpened())return;if(!1===Meclib.MainMenu.display)return;if("MAINTE"===Meclib.Setting.type)return;if(!0===Meclib.MainMenu.forceOpen)return;if(!1===Meclib.MainMenu.forceClose&&(!0===$("#header").is(":animated")||!0===$("#footer").is(":animated")))return;if(!0===Meclib.Function.isGlobalMenuOpened())return;if(!1===Meclib.MainMenu.forceClose&&!0===$("#sd-sidemenu-navi").is(":animated"))return;if($("#menu-pagesearch-box")[0])return;if(!1===Meclib.MainMenu.forceClose&&(jQuery(":focus").filter("#header input").length>0||jQuery(":focus").filter("#footer input").length))return;if(!1===Meclib.MainMenu.forceClose&&!0===Meclib.Menu.toggle)return;if(!$("#tip").is(":hidden"))return;if($("#panel-bookinfo")[0])return;Meclib.zoomScale>1&&ViewerApp.mediator.trigger("canvas:toggleSideBar",0),$("#header").animate({top:-50},{duration:300,complete:function(){Meclib.MainMenu.display=!1,$("#header").hide()}}),$("#footer").css({top:Meclib.Function.getWinsize().height-Meclib.Size.footerHeight,bottom:""}).animate({top:Meclib.Function.getWinsize().height+Meclib.Size.footerSubHeight+Meclib.Size.footerHeight},{duration:300,complete:function(){Meclib.MainMenu.display=!1,$("#footer").hide()}}),$("#footer-sub-box").css({top:"",bottom:Meclib.Size.footerHeight}).animate({bottom:-1*Meclib.Size.footerHeight},{duration:300,complete:function(){Meclib.MainMenu.display=!1,$("#footer-sub-box").hide()}}),ViewerApp.mediator.trigger("pagemove:close")}},toggleMenu:function(){!0===Meclib.PageSearch.display&&ViewerApp.mediator.trigger("pagesearch:close"),!0===Meclib.MainMenu.display?ViewerApp.mediator.trigger("menu:closeMainMenu"):ViewerApp.mediator.trigger("menu:openMainMenu")},open:function(e){if(Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1&&window.getSelection().removeAllRanges(),!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping&&!(!0===Meclib.Function.isSideMenuOpened()&&!1===Meclib.Menu.maximum||$("#sidemenu").is(":animated")&&!1===$("#sd-sidemenu-navi").is(":animated"))){if(""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}var i=Meclib.Speed.menuOpen;Meclib.Menu.name=e,ViewerApp.mediator.trigger("contents:endEditMode"),ViewerApp.mediator.trigger("fusen:close"),ViewerApp.mediator.trigger("optionmenu:close"),ViewerApp.mediator.trigger("print:closePanel"),ViewerApp.mediator.trigger("pdf:closePanel"),ViewerApp.mediator.trigger("products:hidePanel"),ViewerApp.mediator.trigger("memo:close"),1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay&&ViewerApp.mediator.trigger("menu:openMainMenu"),2!==Meclib.Globals.viewer.get("device")&&3!==Meclib.Globals.viewer.get("device")||($("#footer-sub-box").addClass("hidden"),ViewerApp.mediator.trigger("menu:openMainMenu")),3===Meclib.Globals.viewer.get("device")&&($("#footer").hide(),$(".menu-pagemove").hide()),$("#sidemenu").show(),"txtSearch"!==e&&"txtSearchList"!==e&&ViewerApp.mediator.trigger("menu:showLoading"),this.current=e,ViewerApp.mediator.trigger("menu:showMenuMask",!0);var t=0;switch($(".box-maxmin-btn").addClass("hidden"),$("#sidemenu.sp").attr("data-type",""),$("#sd-sidemenu-header").attr("data-type",""),e){case"catalogIndex":t=1,setTimeout(this.showCatalogIndex,1e3);break;case"pageList":t=1,1!=Meclib.Globals.viewer.get("device")&&2!=Meclib.Globals.viewer.get("device")||$(".box-maxmin-btn").removeClass("hidden"),setTimeout(this.showPageList,1e3);break;case"bookLink":setTimeout(this.showBookLink,1e3);break;case"fusenList":setTimeout(this.showFusenList,1e3);break;case"cropList":setTimeout(this.showCropList,1e3);break;case"txtSearch":t=1,ViewerApp.mediator.trigger("textsearch:list");break;case"txtSearchList":t=1;break;case"browsingHistory":ViewerApp.mediator.trigger("browsinghistory:drawList");break;case"option":ViewerApp.mediator.trigger("optionmenu:showSpList"),$("#sidemenu.sp").attr("data-type","option"),$("#sd-sidemenu-header").attr("data-type","option");break;case"commentList":setTimeout(this.showCommentList,1e3);break;case"txtcopy":t=1,ViewerApp.mediator.trigger("txtcopy:showSpPanel")}"txtcopy"===e&&3===Meclib.Globals.viewer.get("device")||ViewerApp.mediator.trigger("txtcopy:end"),$("#sidemenu-header-title").text(Meclib.Message.functionName[e]),$("#menu-title").text(Meclib.Message.functionName[e]),Meclib.Globals.viewer.set({menu:e}),3===Meclib.Globals.viewer.get("device")?($("#sd-menu-title-bar").css({width:"100%"}),$("#sd-menu-title-bar").show()):t=0,this.slideMenu(!0,t),1===t?($("#sidemenu").css({top:$(window).height()+"px",width:Meclib.Size.sideMenu+"px",height:Meclib.Size.sidemenuHeight+"px"}),setTimeout((function(){$("#sidemenu").animate({top:Meclib.Size.sidemenuTop},{duration:300,complete:function(){$("#sidemenu-header").show()}})}),300)):(3===Meclib.Globals.viewer.get("device")&&($("#sd-menu-title-bar").css({width:"0px"}),$("#sd-menu-title-bar").show()),$("#sidemenu").css({top:Meclib.Size.sidemenuTop,width:0,height:Meclib.Size.sidemenuHeight+"px"}),$("#sidemenu").stop().animate({width:Meclib.Size.sideMenu+"px"},{duration:i,complete:function(){$("#sidemenu-header").show()}}),$("#sd-menu-title-bar").stop().animate({width:"100%"},{duration:i}))}},slideMenu:function(e){!0===e?0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("scale")&&$(".slide-obj").hide():0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("scale")&&$(".slide-obj").show()},showMaxminMenu:function(){"pageList"===Meclib.Menu.name&&($("#btn-menu-maxmin").removeClass("max"),!0===Meclib.Menu.maximum?ViewerApp.mediator.trigger("menu:resizeNormal","pageList"):($("#btn-menu-maxmin").addClass("max"),ViewerApp.mediator.trigger("menu:resizeMax","pageList")))},resizeMax:function(e){$("#menu-pagelist").hide(),$("#sidemenu").animate({width:"100%"},{duration:300,complete:function(){Meclib.Menu.maximum=!0,$("#pagelist-items").addClass("max"),ViewerApp.mediator.trigger("pagelist:resize"),ViewerApp.mediator.trigger("pagelist:drawMaxList"),$("#menu-pagelist").show(),$("#sidemenu-header").show()}}),$("#sd-menu-title-bar").animate({width:"100%"},{duration:300})},resizeNormal:function(e){$("#menu-pagelist").hide(),$("#sidemenu").animate({width:Meclib.Size.sideMenu+"px"},{duration:200,complete:function(){$("#pagelist-items").removeClass("max"),Meclib.Menu.maximum=!1,Meclib.Pagelist.maximum=!1,ViewerApp.mediator.trigger("pagelist:resize"),ViewerApp.mediator.trigger("pagelist:drawList",!0),$("#menu-pagelist").show(),$("#sidemenu-header").show()}})},onClose:function(){ViewerApp.mediator.trigger("comment:resetMenu"),ViewerApp.mediator.trigger("common:beforeCloseMenu"),ViewerApp.mediator.trigger("menu:close")},close:function(){if(Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1&&window.getSelection().removeAllRanges(),$("#btn-menu-maxmin").removeClass("max"),$(".box-maxmin-btn").addClass("hidden"),!$("#sidemenu").is(":animated")||!1!==$("#sd-sidemenu-navi").is(":animated")){Meclib.Menu.maximum=!1;var e=Meclib.Speed.menuClose;this.render(),this.hideAll();var i=0;3===Meclib.Globals.viewer.get("device")&&("pageList"!==Meclib.Globals.viewer.get("menu")&&"catalogIndex"!==Meclib.Globals.viewer.get("menu")&&"txtSearch"!==Meclib.Globals.viewer.get("menu")&&"txtcopy"!==Meclib.Globals.viewer.get("menu")||(i=1)),$("#btn-back-menu").addClass("hidden"),$("#sidemenu-header-title").text(""),$("#menu-title").text(""),$("#sidemenu-header").hide(),$("#sidemenu-footer").hide(),this.slideMenu(!1,i);var t=function(){3===Meclib.Globals.viewer.get("device")&&($("#header").show(),$("#footer").show(),$(".menu-pagemove").show(),$("#sp-menu-fusen").hide(),$("#sd-menu-title-bar").hide(),ViewerApp.mediator.trigger("menu:onClosedMenu")),2!==Meclib.Globals.viewer.get("device")&&3!==Meclib.Globals.viewer.get("device")||$("#footer-sub-box").removeClass("hidden")};0===i?($("#sidemenu").animate({width:"0"},{duration:e,complete:function(){ViewerApp.mediator.trigger("canvas:toggleSideBar",1),$("#sidemenu").hide(),1===Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("menu:closeMainMenu"),t()}}),$("#sd-menu-title-bar").animate({width:"0"},{duration:e,complete:function(){}})):$("#sidemenu").animate({top:$(window).height()+"px"},{duration:e,complete:function(){ViewerApp.mediator.trigger("canvas:toggleSideBar",1),$("#sidemenu").hide(),1===Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("menu:closeMainMenu"),t()}}),ViewerApp.mediator.trigger("menu:showMenuMask",!1)}},toggle:function(e){$("#sidemenu").is(":animated")&&!1===$("#sd-sidemenu-navi").is(":animated")||!0!==Meclib.Mode.autoflipping&&(Meclib.Menu.toggle=!0,!1===Meclib.Function.isSideMenuOpened()?(ViewerApp.mediator.trigger("menu:open",e),Meclib.Menu.toggle=!1):!0===Meclib.Function.isSideMenuOpened()&&(ViewerApp.mediator.trigger("menu:close"),this.current!==e?setTimeout((function(){ViewerApp.mediator.trigger("menu:open",e),Meclib.Menu.toggle=!1}),500):Meclib.Menu.toggle=!1))},showMenuMask:function(e){if(!1!==Meclib.Menu.masked&&3!==Meclib.Globals.viewer.get("device"))if(!0===e){var i=$("
").addClass("menu-mask").css({width:Meclib.Function.getWinsize().width,height:Meclib.Function.getWinsize().height-(Meclib.Size.headerHeight+Meclib.Size.footerHeight),top:Meclib.Size.headerHeight,left:0});$("#body").append(i)}else $(".menu-mask").remove()},showNaviMask:function(e){if(!0===e){var i=$("
").addClass("navi-mask").css({width:Meclib.Function.getWinsize().width,height:Meclib.Function.getWinsize().height,top:0,left:0});$("#body").append(i),Meclib.ClickManager.add(document,".navi-mask",(function(e,i){i.stopPropagation(),ViewerApp.mediator.trigger("sidenavi:closeSideNavi")}),!0),$(".navi-mask").hammer().on("swipeleft",(function(e){e.stopPropagation(),ViewerApp.mediator.trigger("sidenavi:closeSideNavi")}))}else $(".navi-mask").remove()},clearMenu:function(){Meclib.Globals.viewer.set({mode:""}),this.close(),null!==Meclib.Crop.jCropApi&&"undesigned"!==Meclib.Crop.jCropApi&&(Meclib.Crop.jCropApi.disable(),Meclib.Crop.jCropApi.release(),Meclib.Crop.jCropApi=null,$("#crop-area").remove()),null!==Meclib.Comment.jCropApi&&void 0!==Meclib.Comment.jCropApi&&(Meclib.Comment.jCropApi.disable(),Meclib.Comment.jCropApi=null,$("#comment-select-area").remove())},updatePage:function(){var e=0;$(".pagelist-item").each((function(){e++,$(this).removeClass("current");var i=Math.ceil(Meclib.Globals.book.currentPage/2);e===i&&$(this).addClass("current")})),$("#menu-pagelist").mCustomScrollbar("scrollTo","#pagelist-itemid"+Meclib.Globals.book.getLeftPage())},hideAll:function(){ViewerApp.mediator.trigger("fusen:hideFusenMenu"),ViewerApp.mediator.trigger("optionmenu:hideSpList"),ViewerApp.mediator.trigger("txtcopy:closeSpPanel"),this.closeCatalogIndex(),this.closePageList(),this.closeFusenList(),this.closeBookLink(),this.closeCropList(),this.closeTxtSearchPanel(),this.closeBrowsingHistory(),this.closeCommentList(),ViewerApp.mediator.trigger("products:hidePanel")},showBookPdf:function(){if(0!==Meclib.Globals.book.allPdf&&""!==Meclib.Globals.book.allPdfName){var e=Meclib.Globals.viewer.get("dataPath")+"data/"+Meclib.Globals.book.allPdfName;Meclib.analytics.sendV4Pdf(99999),Meclib.analytics.sendContents("pdf",99999),Meclib.UserAnalytics.add("pdf",99999,""),window.open(e,"allpdf"+Meclib.Globals.book.uniId)}},showCatalogIndex:function(){$("#menu-index").show(),ViewerApp.mediator.trigger("bookindex:drawList"),Meclib.Globals.viewer.get("device")>1&&$("#sidemenu-footer").hide()},closeCatalogIndex:function(){ViewerApp.mediator.trigger("bookindex:close")},initPageList:function(){},showPageList:function(e){$("#menu-pagelist").show(),ViewerApp.mediator.trigger("pagelist:drawList",!1)},closePageList:function(){ViewerApp.mediator.trigger("pagelist:close")},showBookLink:function(){ViewerApp.mediator.trigger("booklink:drawList")},closeBookLink:function(){ViewerApp.mediator.trigger("booklink:close")},closeBrowsingHistory:function(){ViewerApp.mediator.trigger("browsinghistory:close")},showFusenList:function(){ViewerApp.mediator.trigger("fusen:renderFusenList")},closeFusenList:function(){$("#menu-fusenlist").hide()},showCropList:function(){ViewerApp.mediator.trigger("crop:openList")},closeCropList:function(){ViewerApp.mediator.trigger("crop:closeList")},closeTxtSearchPanel:function(){$("#menu-txtsearch").hide()},showCommentList:function(){ViewerApp.mediator.trigger("comment:drawList")},closeCommentList:function(){ViewerApp.mediator.trigger("comment:closeList")},updateScrollbar:function(){$("#menu-index").mCustomScrollbar("update"),$("#menu-pagelist").mCustomScrollbar("update"),$("#menu-booklink").mCustomScrollbar("update"),$("#txtsearch-result-items").mCustomScrollbar("update"),$("#menu-browsinghistory").mCustomScrollbar("update")},showLoading:function(){if(!$("#menu-loading").length){var e=!1;1===arguments.length&&!0===arguments[0]&&(e=!0);var i='';!0===e?($("#body").append(i),$("#menu-loading").css({top:$("#sidemenu").height()/2-15,left:Meclib.Globals.bookCanvas.canvasWidth/2-15})):1===Meclib.Globals.viewer.get("device")?($("#sidemenu-header").after(i),$("#menu-loading").css({top:Meclib.Size.sidemenuHeight/2-30,left:Meclib.Size.sideMenu/2-30})):($("#sd-sidemenu-header").after(i),$("#menu-loading").css({top:Meclib.Size.sidemenuHeight/2-15,left:Meclib.Size.sideMenu/2-15}))}},closeLoading:function(){$("#menu-loading").remove()}}),ViewerApp.Views.OptionMenuView=Backbone.View.extend({el:null,initialize:function(e){switch(_.bindAll(this,"resize","draw","show","load","close"),ViewerApp.mediator.on("optionmenu:resize",this.resize),ViewerApp.mediator.on("optionmenu:close",this.close),ViewerApp.mediator.on("common:closePanel",this.close),ViewerApp.mediator.on("optionmenu:show",this.show),ViewerApp.mediator.on("book:complete",this.load),ViewerApp.mediator.on("optionmenu:showSpList",this.showSpList),ViewerApp.mediator.on("optionmenu:hideSpList",this.hideSpList),ViewerApp.mediator.on("optionmenu:addPanelEvent",this.addPanelEvent),ViewerApp.mediator.on("optionmenu:cancelPosition",this.cancelPosition),ViewerApp.mediator.on("optionmenu:toggleViewMode",this.toggleViewMode),ViewerApp.mediator.on("optionmenu:toggleMoveType",this.toggleMoveType),ViewerApp.mediator.on("optionmenu:showAllOption",this.showAllOption),Meclib.Globals.viewer.get("device")){case 1:case 2:Meclib.Cache.Tpl.option="";break;case 3:Meclib.Cache.Tpl.option=$("#sp-sidemenu-option-template").html()}Meclib.Size.optionMenuTop=10},resize:function(){var e=0,i=Meclib.Function.getWinsize().height;switch(Meclib.Globals.viewer.get("device")){case 1:case 2:e=i-(Meclib.Size.headerHeight+Meclib.Size.footerHeight+Meclib.Size.sidemenuHeaderHeight)-Meclib.Size.optionMenuTop,Meclib.Size.optionMenuHeight=e;break;case 3:e=i-(Meclib.Size.headerHeight+Meclib.Size.sidemenuHeaderHeight)}$("#menu-option").css({height:e+"px"})},close:function(){Meclib.Mode.option=!1,Meclib.Globals.viewer.set({mode:""}),$("#optionmenu").hide(),1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay&&setTimeout((function(){ViewerApp.mediator.trigger("menu:closeMainMenu")}),3e3)},load:function(){this.el=$("#optionmenu")},draw:function(){if($("#optionmenu").remove(),""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}var e={};if(e._option=Meclib.Message.functionName.option,e._option_comment_area=Meclib.Message.option.comment_area,e._option_news=Meclib.Message.option.news,e._option_memo=Meclib.Message.option.memo,e._option_fusen=Meclib.Message.option.fusen,e._option_link=Meclib.Message.option.link,e._option_movie=Meclib.Message.option.movie,e._option_embed=Meclib.Message.option.embed,e._option_highlight=Meclib.Message.option.highlight,e._option_tooltip=Meclib.Message.option.tooltip,e._option_viewmode=Meclib.Message.option.viewmode,e._option_viewmode_open=Meclib.Message.option.viewmode_open,e._option_viewmode_unit=Meclib.Message.option.viewmode_unit,e._option_movetype=Meclib.Message.option.movetype,e._option_movetype_real=Meclib.Message.option.movetype_real,e._option_movetype_slide=Meclib.Message.option.movetype_slide,e._option_movetype_none=Meclib.Message.option.movetype_none,e._option_devicemode=Meclib.Message.option.devicemode,e._option_devicemode_pc=Meclib.Message.option.devicemode_pc,e._option_devicemode_sd=Meclib.Message.option.devicemode_sd,3!==Meclib.Globals.viewer.get("device")){for(var i in Meclib.Globals.viewer.get("device")>1&&(Meclib.Globals.viewer.get("enabedOptions").grid=0),e.movetype=!0,1===Meclib.Globals.viewer.get("enabedOptions").flip&&1===Meclib.Globals.viewer.get("enabedOptions").slide?e.movetype=!0:e.movetype=!1,1===Meclib.Globals.viewer.get("viewMode")&&(e.movetype=!0),1===Meclib.Globals.bookCanvas.canvasNum&&(e.movetype=!1),e.viewmode=!0,0===Meclib.Globals.book.twopage?(Meclib.Globals.viewer.get("enabedOptions").open=0,e.viewmode=!1):1===Meclib.Globals.bookCanvas.canvasNum&&1===Meclib.Globals.viewer.get("enabedOptions").open&&Meclib.Function.getWinsize().height>Meclib.Function.getWinsize().width&&(e.viewmode=!1),Meclib.Globals.viewer.get("enabedOptions")){var t=i.charAt(0).toUpperCase()+i.slice(1);1===Meclib.Globals.viewer.get("enabedOptions")[i]?(e["enable"+t]=!0,i in Meclib.Globals.viewer.get("optionIncludes")&&0===Meclib.Globals.viewer.get("optionIncludes")[i]&&(e["enable"+t]=!1)):e["enable"+t]=!1,"highlight"===i&&1===Meclib.Globals.viewer.get("enabedOptions")[i]&&(0!==Meclib.Globals.viewer.get("enabedOptions").txtsearch&&0!==Meclib.Globals.viewer.get("optionIncludes").txtsearch||(e["enable"+t]=!1))}for(var o in Meclib.Globals.viewer.get("options"))1===Meclib.Globals.viewer.get("options")[o]?e[o]="on":e[o]="";e.unit="",e.open="",0===Meclib.Globals.viewer.get("viewMode")?e.open="on":1===Meclib.Globals.viewer.get("viewMode")&&(e.unit="on"),"flip"===Meclib.Globals.viewer.get("moveType")?(e.flip="on",e.slide="",e.none=""):"slide"===Meclib.Globals.viewer.get("moveType")?(e.flip="",e.slide="on",e.none=""):(e.flip="",e.slide="",e.none="on"),e.enableDevicemode=!1,"MAINTE"!==Meclib.Setting.type&&!1===Meclib.Function.isMac()&&"LOCAL"!==Meclib.Setting.type&&-1==Meclib.Globals.ua.search("iPhone")&&-1==Meclib.Globals.ua.search("iPad")&&-1===Meclib.Globals.ua.search("Android")&&(e.enableDevicemode=!0,0!==Meclib.Globals.book.publicSettings[0]&&0!==Meclib.Globals.book.publicSettings[1]&&0!==Meclib.Globals.book.publicSettings[2]||(e.enableDevicemode=!1)),$("#body").append(_.template($("#optionmenu-template").html())(e)),$("#optionmenu").draggable({handle:"#optionmenu-panel-title",containment:"#canvas-area",scroll:!1,stop:function(e,i){var t=i.position.top;$("#header").height()>t&&$("#optionmenu").css({top:$("#header").height()+"px"})}}),!0===e.enableDevicemode&&("pc"===Meclib.Globals.deviceCode&&$('.options-devicemode[data-type="pc"]').find(".radio-devicemode").each((function(){$(this).addClass("on")})),"sd"===Meclib.Globals.deviceCode&&$('.options-devicemode[data-type="sd"]').find(".radio-devicemode").each((function(){$(this).addClass("on")}))),Meclib.Mode.memo&&$('.options-func[data-type="memo"]').addClass("disabled"),setTimeout((function(){$("#optionmenu-panel-body").height()>Meclib.Size.optionMenuHeight&&$("#optionmenu-panel-body").css({height:Meclib.Size.optionMenuHeight+"px"}),$("#optionmenu-panel-body").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:100,scrollInertia:200,scrollButtons:{enable:!1}})}),600),ViewerApp.mediator.trigger("optionmenu:cancelPosition"),ViewerApp.mediator.trigger("optionmenu:addPanelEvent")}},cancelPosition:function(){var e=$(window).width()-$(".ev-btn-option").offset().left,i=$(".ev-btn-option").offset().top;if(1===Meclib.Globals.viewer.get("device"))var t=28,o=28;else if(2===Meclib.Globals.viewer.get("device"))t=30,o=30;e-=t,i=i+o+10,$("#optionmenu").css("right",e+"px"),$("#optionmenu").css("top",i+"px")},addPanelEvent:function(){Meclib.ClickManager.add(document,".ev-btn-close-option",(function(e,i){ViewerApp.mediator.trigger("optionmenu:close")}),!0),Meclib.ClickManager.add(document,"li.options-func",(function(e,i){var t=$(e).attr("data-type");Meclib.Mode.memo&&"memo"===t||($(".chk-func").removeClass("on"),$("#option-func-"+t).toggleClass("on"),Meclib.Globals.viewer.get("options")[t]=1^Meclib.Globals.viewer.get("options")[t],ViewerApp.mediator.trigger("common:updateOption"),ViewerApp.mediator.trigger("contents:clear"),ViewerApp.mediator.trigger("contents:showContents"),1===Meclib.Globals.viewer.get("device")&&(0===Meclib.Globals.viewer.get("options").tooltip?Meclib.Function.hideTooltips():Meclib.Function.showTooltips()))}),!0),Meclib.ClickManager.add(document,"li.options-viewmode",(function(e,i){var t=$(e).attr("data-type");$(".radio-viewmode").removeClass("on"),$("#viewmode-"+t).toggleClass("on");Meclib.Globals.viewer.set({viewMode:{open:0,unit:1,grid:2}[t]}),ViewerApp.mediator.trigger("optionmenu:close"),setTimeout((function(){$("#page-area").data("ui-draggable")&&$("#page-area").stop().draggable("destroy"),ViewerApp.mediator.trigger("canvas:initScale"),ViewerApp.mediator.trigger("main:resize")}),500)}),!0),Meclib.ClickManager.add(document,"li.options-movetype",(function(e,i){$(e).find(".radio-options").each((function(){$("optionmenu").find(".radio-options").removeClass("on");var e=String($(this).attr("id").replace("movetype","")),i=parseInt(e,10);"flip"===Meclib.Globals.viewer.get("moveType")&&ViewerApp.mediator.trigger("canvas:cancelOverAnimation"),0===i?Meclib.Globals.viewer.set({moveType:""}):1===i?Meclib.Globals.viewer.set({moveType:"flip"}):2===i&&Meclib.Globals.viewer.set({moveType:"slide"}),$("li.options-movetype").find(".radio-options").removeClass("on"),$(this).toggleClass("on"),setTimeout((function(){$("#page-area").data("ui-draggable")&&$("#page-area").stop().draggable("destroy"),ViewerApp.mediator.trigger("canvas:initScale"),ViewerApp.mediator.trigger("main:resize")}),500)}))}),!0),Meclib.ClickManager.add(document,".options-devicemode",(function(e,i){var t=$(e).attr("data-type");if(Meclib.Globals.deviceCode!==t){var o=Meclib.Lists.PersistentSettingList.findWhere({name:"device_mode"});if(void 0===o){var a=new ViewerApp.Models.PersistentSetting({name:"device_mode",value:t});Meclib.Lists.PersistentSettingList.add(a),a.save()}else o.set({value:t}),o.save();$(".radio-devicemode").removeClass("on"),$('.options-devicemode[data-type="'+t+'"]').find(".radio-devicemode").each((function(){$(this).addClass("on")})),setTimeout((function(){location.reload()}),500)}}),!0)},showAllOption:function(e){_.each(Meclib.Globals.viewer.get("options"),(function(i,t,o){var a=t;$(".chk-func").removeClass("on"),$("#option-func-"+a).toggleClass("on"),Meclib.Globals.viewer.get("options")[a]=e,ViewerApp.mediator.trigger("common:updateOption"),ViewerApp.mediator.trigger("contents:clear"),ViewerApp.mediator.trigger("contents:showContents"),0===Meclib.Globals.viewer.get("options").tooltip?Meclib.Function.hideTooltips():Meclib.Function.showTooltips()}))},toggleViewMode:function(){var e=!0;(0===Meclib.Globals.book.twopage||1===Meclib.Globals.bookCanvas.canvasNum&&1===Meclib.Globals.viewer.get("enabedOptions").open&&Meclib.Function.getWinsize().height>Meclib.Function.getWinsize().width)&&(e=!1),0===Meclib.Globals.viewer.get("viewMode")?Meclib.Globals.viewer.set({viewMode:1}):1===Meclib.Globals.viewer.get("viewMode")&&!0===e&&Meclib.Globals.viewer.set({viewMode:0}),$("#page-area").data("ui-draggable")&&$("#page-area").stop().draggable("destroy"),ViewerApp.mediator.trigger("canvas:initScale"),ViewerApp.mediator.trigger("main:resize")},toggleMoveType:function(){"slide"===Meclib.Globals.viewer.get("moveType")?Meclib.Globals.viewer.set({moveType:"flip"}):"flip"===Meclib.Globals.viewer.get("moveType")&&Meclib.Globals.viewer.set({moveType:"slide"}),$("#page-area").data("ui-draggable")&&$("#page-area").stop().draggable("destroy"),ViewerApp.mediator.trigger("canvas:initScale"),ViewerApp.mediator.trigger("updatePage")},show:function(){ViewerApp.mediator.trigger("optionmenu:cancelPosition");var e=10;!0===Meclib.Function.isSideMenuOpened()&&(ViewerApp.mediator.trigger("menu:close"),e=300),!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping&&(ViewerApp.mediator.trigger("crop:endCropMode"),ViewerApp.mediator.trigger("comment:endAreaSelectMode"),ViewerApp.mediator.trigger("fusen:close"),ViewerApp.mediator.trigger("optionmenu:close"),ViewerApp.mediator.trigger("print:closePanel"),ViewerApp.mediator.trigger("pdf:closePanel"),Meclib.Mode.txtcopy&&ViewerApp.mediator.trigger("txtcopy:end"),Meclib.Mode.memo&&ViewerApp.mediator.trigger("memo:close"),ViewerApp.mediator.trigger("products:hidePanel"),Meclib.Globals.viewer.set({mode:"optionmenu"}),this.draw(),setTimeout((function(){$("#optionmenu").show(),Meclib.Mode.option=!0}),e))},showSpList:function(){var e={};for(var i in $(".sp-sidemenu-title").removeClass("onSideNavi").addClass("onSideNavi"),$("#menu-option").mCustomScrollbar("destroy"),$("#menu-option").html(""),e._option=Meclib.Message.functionName.option,e._option_news=Meclib.Message.option.news,e._option_memo=Meclib.Message.option.memo,e._option_fusen=Meclib.Message.option.fusen,e._option_link=Meclib.Message.option.link,e._option_movie=Meclib.Message.option.movie,e._option_embed=Meclib.Message.option.embed,e._option_highlight=Meclib.Message.option.highlight,e._option_tooltip=Meclib.Message.option.tooltip,e._option_viewmode=Meclib.Message.option.viewmode,e._option_viewmode_open=Meclib.Message.option.viewmode_open,e._option_viewmode_unit=Meclib.Message.option.viewmode_unit,e._option_movetype=Meclib.Message.option.movetype,e._option_movetype_real=Meclib.Message.option.movetype_real,e._option_movetype_slide=Meclib.Message.option.movetype_slide,e._option_movetype_none=Meclib.Message.option.movetype_none,e._option_comment_area=Meclib.Message.option.comment_area,e.movetype=!1,0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage&&(e.movetype=!0),e.viewmode=!0,0===Meclib.Globals.book.twopage&&(Meclib.Globals.viewer.get("enabedOptions").open=0,e.viewmode=!1),0===Meclib.Globals.viewer.get("rotate")&&(e.viewmode=!1),Meclib.Globals.viewer.get("enabedOptions")){var t=i.charAt(0).toUpperCase()+i.slice(1);1===Meclib.Globals.viewer.get("enabedOptions")[i]?(e["enable"+t]=!0,i in Meclib.Globals.viewer.get("optionIncludes")&&0===Meclib.Globals.viewer.get("optionIncludes")[i]&&(e["enable"+t]=!1)):e["enable"+t]=!1,"highlight"===i&&1===Meclib.Globals.viewer.get("enabedOptions")[i]&&(0!==Meclib.Globals.viewer.get("enabedOptions").txtsearch&&0!==Meclib.Globals.viewer.get("optionIncludes").txtsearch||(e["enable"+t]=!1))}for(var o in Meclib.Globals.viewer.get("options"))1===Meclib.Globals.viewer.get("options")[o]?e[o]="on":e[o]="";e.unit="",e.open="",0===Meclib.Globals.viewer.get("viewMode")?e.open="on":1===Meclib.Globals.viewer.get("viewMode")&&(e.unit="on"),"flip"===Meclib.Globals.viewer.get("moveType")?(e.flip="on",e.slide="",e.none=""):"slide"===Meclib.Globals.viewer.get("moveType")?(e.flip="",e.slide="on",e.none=""):(e.flip="",e.slide="",e.none="on"),$("#menu-option").append(_.template(Meclib.Cache.Tpl.option)(e)),$("#menu-option").show(),ViewerApp.mediator.trigger("menu:closeLoading"),ViewerApp.mediator.trigger("optionmenu:addPanelEvent"),setTimeout((function(){$("#menu-option").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:100,scrollInertia:200,scrollButtons:{enable:!1}})}),1e3)},hideSpList:function(){$("#menu-option").hide(),$(".sp-sidemenu-title").removeClass("onSideNavi")}}),ViewerApp.Views.AutoFlipView=Backbone.View.extend({initialize:function(e){ViewerApp.mediator.on("autoflip:addPanelEvent",this.addPanelEvent),ViewerApp.mediator.on("autoflip:showAutoFlip",this.showAutoFlip),ViewerApp.mediator.on("autoflip:autoFlip",this.autoFlip),ViewerApp.mediator.on("autoflip:close",this.close),ViewerApp.mediator.on("autoflip:disabledAutoFlipMenu",this.disabledAutoFlipMenu),ViewerApp.mediator.on("autoflip:disabledItems",this.disabledItems),ViewerApp.mediator.on("autoflip:play",this.play)},showAutoFlip:function(){if(ViewerApp.mediator.trigger("fusen:close"),ViewerApp.mediator.trigger("object:hide"),ViewerApp.mediator.trigger("optionmenu:close"),ViewerApp.mediator.trigger("print:closePanel"),ViewerApp.mediator.trigger("contents:endEditMode"),ViewerApp.mediator.trigger("sidenavi:closeSideNavi"),ViewerApp.mediator.trigger("pdf:closePanel"),!0!==Meclib.Function.isSideMenuOpened()&&!0!==Meclib.Function.isOptionMenuOpened()){if(""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}Meclib.Function.setForceClose(),1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay&&ViewerApp.mediator.trigger("menu:closeMainMenu");var e={};if(e._autoflip=Meclib.Message.general.autoflip,e._slow=Meclib.Message.autoflip.slow,e._normal=Meclib.Message.autoflip.normal,e._fast=Meclib.Message.autoflip.fast,$("#panel-autoflip")[0])!0===Meclib.Mode.autoflipping?($("#panel-autoflip").remove(),Meclib.Mode.autoflip=!1):ViewerApp.mediator.trigger("autoflip:close");else{$("#body").append(_.template($("#panel-autoflip-template").html())(e)),Meclib.Mode.autoflip=!0,Meclib.Globals.viewer.set({mode:"autoflip"}),ViewerApp.mediator.trigger("autoflip:disabledItems",1),Meclib.Function.setPosCenter("panel-autoflip"),$("#panel-autoflip").draggable({handle:"#panel-autoflip-title",containment:"#canvas-area",scroll:!1}),1===Meclib.Globals.viewer.get("autoFlipDir")?$(".btn-autoflip-right").addClass("on"):0===Meclib.Globals.viewer.get("autoFlipDir")&&$(".btn-autoflip-left").addClass("on"),$("li#autoflip-speed-normal").each((function(){$(this).find(".btn-radio").toggleClass("on")}));var i=Meclib.Globals.viewer.get("autoflipSpeedNormal");Meclib.Globals.viewer.set({autoflipSpeed:i}),ViewerApp.mediator.trigger("autoflip:addPanelEvent")}}},addPanelEvent:function(){Meclib.ClickManager.add(document,".btn-autoflip-stop",(function(e,i){$(".btn-autoflip-right").removeClass("on"),$(".btn-autoflip-left").removeClass("on"),$("#btn-autoflip").removeClass("on"),Meclib.Globals.viewer.set({autoFlipDir:""}),ViewerApp.mediator.trigger("autoflip:disabledItems",0),Meclib.Mode.autoflipping=!1,Meclib.API.onAutoflip("stop")})),Meclib.ClickManager.add(document,".btn-autoflip-left",(function(e,i){$(".btn-autoflip-right").removeClass("on"),$(".btn-autoflip-left").addClass("on"),$("#btn-autoflip").addClass("on"),window.clearInterval(Meclib.Timer.autoflip),Meclib.Mode.autoflipping=!0,ViewerApp.mediator.trigger("autoflip:autoFlip",0),ViewerApp.mediator.trigger("autoflip:disabledItems",1),Meclib.API.onAutoflip("start",0)})),Meclib.ClickManager.add(document,".btn-autoflip-right",(function(e,i){$(".btn-autoflip-right").addClass("on"),$(".btn-autoflip-left").removeClass("on"),$("#btn-autoflip").addClass("on"),window.clearInterval(Meclib.Timer.autoflip),Meclib.Mode.autoflipping=!0,ViewerApp.mediator.trigger("autoflip:autoFlip",1),ViewerApp.mediator.trigger("autoflip:disabledItems",1),Meclib.API.onAutoflip("start",1)})),Meclib.ClickManager.add(document,"li#autoflip-speed-slow",(function(e,i){var t=Meclib.Globals.viewer.get("autoflipSpeedSlow");Meclib.Globals.viewer.set({autoflipSpeed:t}),$("ul.panel-autoflip-box.select-speed li ").find(".btn-radio").removeClass("on"),$(e).find(".btn-radio").toggleClass("on"),Meclib.API.onAutoflip("speed","slow")})),Meclib.ClickManager.add(document,"li#autoflip-speed-normal",(function(e,i){var t=Meclib.Globals.viewer.get("autoflipSpeedNormal");Meclib.Globals.viewer.set({autoflipSpeed:t}),$("ul.panel-autoflip-box.select-speed li ").find(".btn-radio").removeClass("on"),$(e).find(".btn-radio").toggleClass("on"),Meclib.API.onAutoflip("speed","normal")})),Meclib.ClickManager.add(document,"li#autoflip-speed-fast",(function(e,i){var t=Meclib.Globals.viewer.get("autoflipSpeedFast");Meclib.Globals.viewer.set({autoflipSpeed:t}),$("ul.panel-autoflip-box.select-speed li ").find(".btn-radio").removeClass("on"),$(e).find(".btn-radio").toggleClass("on"),Meclib.API.onAutoflip("speed","fast")})),Meclib.ClickManager.add(document,".ev-btn-close-autoflip",(function(e,i){ViewerApp.mediator.trigger("autoflip:close")}))},autoFlip:function(e){if(!1===Meclib.Mode.autoflipping)return $(".btn-autoflip-right").removeClass("on"),$(".btn-autoflip-left").removeClass("on"),$("#btn-autoflip").removeClass("on"),ViewerApp.mediator.trigger("autoflip:disabledItems",0),void(0==$("#panel-autoflip").length&&(Meclib.Globals.viewer.set({mode:""}),Meclib.Globals.viewer.set({autoflipSpeed:""}),Meclib.Globals.viewer.set({autoFlipDir:""})));var i=0,t=Meclib.defaults.autoflip_loop;if(Meclib.Globals.viewer.set({autoFlipDir:e}),0===Meclib.Globals.book.pageOpenDir&&Meclib.Globals.book.currentPage===Meclib.Globals.book.totalPage&&1===e&&(1==t?i=1:Meclib.Mode.autoflipping=!1),0===Meclib.Globals.book.pageOpenDir&&1===Meclib.Globals.book.currentPage&&0===e&&(1==t?i=1:Meclib.Mode.autoflipping=!1),1===Meclib.Globals.book.pageOpenDir&&Meclib.Globals.book.currentPage===Meclib.Globals.book.totalPage&&0===e&&(1==t?i=1:Meclib.Mode.autoflipping=!1),1===Meclib.Globals.book.pageOpenDir&&1===Meclib.Globals.book.currentPage&&1===e&&(1==t?i=1:Meclib.Mode.autoflipping=!1),!1===Meclib.Mode.autoflipping)return $(".btn-autoflip-right").removeClass("on"),$(".btn-autoflip-left").removeClass("on"),$("#btn-autoflip").removeClass("on"),ViewerApp.mediator.trigger("autoflip:disabledItems",0),void(0==$("#panel-autoflip").length&&(Meclib.Globals.viewer.set({mode:""}),Meclib.Globals.viewer.set({autoflipSpeed:""}),Meclib.Globals.viewer.set({autoFlipDir:""})));0===e?1===i?ViewerApp.mediator.trigger("main:moveRightLimitPage"):ViewerApp.mediator.trigger("main:moveLeftPage"):1===e&&(1===i?ViewerApp.mediator.trigger("main:moveLeftLimitPage"):ViewerApp.mediator.trigger("main:moveRightPage")),Meclib.Timer.autoflip=window.setTimeout((function(){!function(e){ViewerApp.mediator.trigger("autoflip:autoFlip",e)}(e)}),Meclib.Globals.viewer.get("autoflipSpeed"))},play:function(e){Meclib.Mode.autoflipping=!0;var i=Meclib.Globals.viewer.get("autoflipSpeedNormal");Meclib.Globals.viewer.set({autoflipSpeed:i}),window.clearInterval(Meclib.Timer.autoflip),ViewerApp.mediator.trigger("autoflip:autoFlip",e),ViewerApp.mediator.trigger("autoflip:disabledItems",1)},close:function(){$("#panel-autoflip").remove(),Meclib.Mode.autoflip=!1,!1===Meclib.Mode.autoflipping&&(Meclib.Globals.viewer.set({mode:""}),Meclib.Globals.viewer.set({autoflipSpeed:""}),Meclib.Globals.viewer.set({autoFlipDir:""}),ViewerApp.mediator.trigger("autoflip:disabledItems",0),Meclib.Mode.autoflipping=!1)},disabledAutoFlipMenu:function(e){1===e?$("#btn-autoflip").addClass("disabled"):$("#btn-autoflip").removeClass("disabled")},disabledItems:function(e){if(1===e){if($("#btn-printout").addClass("autoflipping"),$("#btn-option").addClass("autoflipping"),$("#btn-bookinfo").addClass("autoflipping"),$("#btn-listmenu").addClass("autoflipping"),$("#btn-thumbnail").addClass("autoflipping"),$("#btn-fusenlist").addClass("autoflipping"),$("#btn-croplist").addClass("autoflipping"),$("#btn-booklink").addClass("autoflipping"),$("#btn-commentlist").addClass("autoflipping"),$("#btn-fusen").addClass("autoflipping"),$("#btn-crop").addClass("autoflipping"),$("#btn-zoominout").addClass("autoflipping"),$("#btn-db").addClass("autoflipping"),$("#btn-bookpdf").addClass("autoflipping"),$("#btn-memo").addClass("autoflipping"),$("#btn-txtcopy").addClass("autoflipping"),!1===Meclib.Mode.autoflipping)return;$("#btn-moveleftlimit").addClass("autoflipping"),$("#btn-moveleft").addClass("autoflipping"),$("#btn-moveright").addClass("autoflipping"),$("#btn-moverightlimit").addClass("autoflipping"),$("#leftbar").addClass("autoflipping"),$("#rightbar").addClass("autoflipping")}else{if($("#btn-moveleftlimit").removeClass("autoflipping"),$("#btn-moveleft").removeClass("autoflipping"),$("#btn-moveright").removeClass("autoflipping"),$("#btn-moverightlimit").removeClass("autoflipping"),$("#leftbar").removeClass("autoflipping"),$("#rightbar").removeClass("autoflipping"),$("#panel-autoflip").length>0)return;$("#btn-printout").removeClass("autoflipping"),$("#btn-option").removeClass("autoflipping"),$("#btn-bookinfo").removeClass("autoflipping"),$("#btn-listmenu").removeClass("autoflipping"),$("#btn-thumbnail").removeClass("autoflipping"),$("#btn-fusenlist").removeClass("autoflipping"),$("#btn-croplist").removeClass("autoflipping"),$("#btn-booklink").removeClass("autoflipping"),$("#btn-commentlist").removeClass("autoflipping"),$("#btn-fusen").removeClass("autoflipping"),$("#btn-crop").removeClass("autoflipping"),$("#btn-zoominout").removeClass("autoflipping"),$("#btn-db").removeClass("autoflipping"),$("#btn-bookpdf").removeClass("autoflipping"),$("#btn-memo").removeClass("autoflipping"),$("#btn-txtcopy").removeClass("autoflipping")}}}),ViewerApp.Views.PageListView=Backbone.View.extend({eventFlg:!1,initialize:function(e){switch(_.bindAll(this,"drawList","nextScroll"),ViewerApp.mediator.on("main:onMovedPage",this.onPageChenged),ViewerApp.mediator.on("pagelist:drawList",this.drawList),ViewerApp.mediator.on("pagelist:drawMaxList",this.drawMaxList),ViewerApp.mediator.on("pagelist:resize",this.resize),ViewerApp.mediator.on("pagelist:addListsEvent",this.addListsEvent),ViewerApp.mediator.on("pagelist:nextScroll",this.nextScroll),ViewerApp.mediator.on("pagelist:beforeScroll",this.beforeScroll),ViewerApp.mediator.on("pagelist:close",this.close),ViewerApp.mediator.on("pagelist:init",this.init),ViewerApp.mediator.on("pagelist:setCurrentPage",this.setCurrentPage),Meclib.Pagelist.maximum=!1,Meclib.Pagelist.scrollStart=0,Meclib.Pagelist.scrollEnd=0,Meclib.Pagelist.nowScrollStart=0,Meclib.Pagelist.nowScrollEnd=0,Meclib.Pagelist.blockList=[],Meclib.Pagelist.from="",Meclib.Pagelist.focusBeforeScroll="",Meclib.Pagelist.focusAfterScroll="",Meclib.Cache.Tpl.pageList="",Meclib.Globals.viewer.get("device")){case 1:case 2:Meclib.Cache.Tpl.pageList=$("#sidemenu-pagelist-template").html();break;case 3:Meclib.Cache.Tpl.pageList=$("#sp-sidemenu-pagelist-template").html()}Meclib.Lists.pageSettingList.fetch({cache:!1,dataType:"json",success:function(e,i,t){if(null!==i)for(var o=i.length,a=0;a1&&$("#sidemenu-footer").hide();var l=36,n=120,c=120;n=170,c=160;var s=120,r=190;$(window).width()<370&&(r=160);var g=200,b=5;3===Meclib.Globals.viewer.get("device")&&1===Meclib.Globals.viewer.get("rotate")&&(r=140,n=140);var p=0;Meclib.Globals.book.thumbWidths&&(p=c/Meclib.Globals.book.thumbHeight,n=Math.floor(Meclib.Globals.book.thumbWidth*p),c=s));var d={width:0,height:0,left:0,top:0},M={width:32},m=parseInt($("#pagelist-items").css("width"),10);3===Meclib.Globals.viewer.get("device")&&(m-=20);var h=m/2;d.height=c+40-2,d.width=h/2,d.left=(d.width-n)/2,d.top=10,d.height=105;var u=0;u=3===Meclib.Globals.viewer.get("device")||!0===Meclib.Pagelist.maximum?Meclib.Globals.bookCanvas.canvasWidth:Meclib.Size.sideMenu,u-=l,Meclib.Globals.viewer.get("device")<3&&(r=!0===Meclib.Pagelist.maximum?n+10:u/2),g=c+30;var A=r-b;a=d.height;var v={width:0,height:0};3===Meclib.Globals.viewer.get("device")?(M.width=0,v.width=r):v.width=2*r,v.height=g;var f=0,C=Math.floor($("#pagelist-items").height()/v.height),w=(f=Meclib.Globals.viewer.get("device")<3&&!1===Meclib.Pagelist.maximum?1:Math.floor(u/(v.width+20)))*C;o=0,!0===Meclib.Pagelist.maximum&&(o=(u-f*v.width)/f/2,o=10);var I=f*v.width,x=u-I;o=x/f/2;var y=50;y<=2*w&&(y=2*w);var k=0;1===Meclib.Globals.bookCanvas.canvasNum&&0===Meclib.Globals.book.twopage?(k=(r-n)/2,!0===Meclib.Pagelist.maximum&&(k+=o/2)):k=r-n;var P={width:Meclib.Pagelist.icon.fusen.width,x:k-10,y:d.top+c-26},G={x:k-10,red:d.top+4,yellow:d.top+4+Meclib.Pagelist.icon.memo.height,blue:d.top+4+2*Meclib.Pagelist.icon.memo.height},V=Meclib.Pagelist.scrollEnd,S=Meclib.Pagelist.scrollStart;!0===e?(Meclib.Pagelist.scrollStart=Meclib.Globals.book.currentPage,Meclib.Pagelist.scrollEnd=Meclib.Pagelist.scrollStart+y,Meclib.Pagelist.nowScrollStart=Meclib.Pagelist.scrollStart,Meclib.Pagelist.nowScrollEnd=Meclib.Pagelist.scrollEnd,S=Meclib.Globals.book.currentPage):"slider"===Meclib.Pagelist.from?(Meclib.Pagelist.scrollEnd=Meclib.Pagelist.scrollStart+y,Meclib.Pagelist.nowScrollStart=Meclib.Pagelist.scrollStart,Meclib.Pagelist.nowScrollEnd=Meclib.Pagelist.scrollEnd,S=Meclib.Pagelist.scrollStart):"before"===Meclib.Pagelist.from?(Meclib.Pagelist.scrollStart=Meclib.Pagelist.nowScrollStart-2*w,Meclib.Pagelist.scrollStart<1&&(Meclib.Pagelist.scrollStart=1),Meclib.Pagelist.scrollEnd=Meclib.Pagelist.scrollStart+2*w,Meclib.Pagelist.nowScrollStart=Meclib.Pagelist.scrollStart,S=Meclib.Pagelist.scrollStart):(Meclib.Pagelist.scrollStart=Meclib.Pagelist.nowScrollEnd+1,Meclib.Pagelist.scrollEnd=Meclib.Pagelist.scrollStart+y,Meclib.Pagelist.nowScrollEnd=Meclib.Pagelist.scrollEnd);var T=Meclib.Pagelist.maxPageNum;1===Meclib.Globals.viewer.get("device")&&(T*=2),Meclib.Pagelist.nowScrollEnd-Meclib.Pagelist.nowScrollStart>T&&(!0===e||"slider"===Meclib.Pagelist.from?Meclib.Pagelist.scrollStart=Meclib.Pagelist.scrollStart-2*w:Meclib.Pagelist.scrollStart=V-2*w,Meclib.Pagelist.scrollStart<1&&(Meclib.Pagelist.scrollStart=1),Meclib.Pagelist.scrollEnd=Meclib.Pagelist.scrollStart+y,Meclib.Pagelist.nowScrollStart=Meclib.Pagelist.scrollStart,Meclib.Pagelist.nowScrollEnd=Meclib.Pagelist.scrollEnd,Meclib.Pagelist.from="slider",$("#pagelist-items").mCustomScrollbar("destroy"),$("#pagelist-items").html(""),Meclib.Pagelist.blockList=[]),Meclib.Pagelist.scrollEnd>Meclib.Globals.book.totalPage&&(Meclib.Pagelist.scrollEnd=Meclib.Globals.book.totalPage,Meclib.Pagelist.nowScrollEnd=Meclib.Pagelist.scrollEnd),Meclib.Pagelist.nowScrollEnd-Meclib.Pagelist.nowScrollStart<2*w&&(Meclib.Pagelist.scrollStart=Meclib.Pagelist.scrollStart-2*w,Meclib.Pagelist.scrollStart<1&&(Meclib.Pagelist.scrollStart=1),Meclib.Pagelist.nowScrollStart=Meclib.Pagelist.scrollStart),$(".page-slider-contents").hide();for(var L=0,F=0,z="",N=1;NMeclib.Globals.book.totalPage&&(D.rightpage=0)):(D.rightpage=N,D.leftpage=N+1,D.leftpage>Meclib.Globals.book.totalPage&&(D.leftpage=0)),1===Meclib.Globals.book.twopage?D.twopage=!0:(D.floatLeft="center",D.floatRight="center")):(D.twopage=!0,0===Meclib.Globals.book.cover&&1===N?(0===Meclib.Globals.book.getPageDir(N)?(D.leftpage=N,D.rightpage=0):(D.leftpage=0,D.rightpage=N),N=0):0===Meclib.Globals.book.getPageDir(N)?(D.leftpage=N,D.rightpage=N+1):(D.leftpage=N+1,D.rightpage=N)),D.leftpage>Meclib.Globals.book.totalPage&&(D.leftpage=0),D.rightpage>Meclib.Globals.book.totalPage&&(D.rightpage=0),Meclib.Lists.fusenList.sortColor(),Meclib.Lists.fusenList.each((function(e){if(-1===Meclib.Property.domains.indexOf(e.get("url")))return!0;e.get("page_no")===D.leftpage&&(1===e.get("color")?D.leftFusenRed=!0:2===e.get("color")?D.leftFusenYellow=!0:3===e.get("color")&&(D.leftFusenBlue=!0)),e.get("page_no")===D.rightpage&&(1===e.get("color")?D.rightFusenRed=!0:2===e.get("color")?D.rightFusenYellow=!0:3===e.get("color")&&(D.rightFusenBlue=!0))})),Meclib.Memo.action.isInPage(D.leftpage)&&(D.leftMemo=!0),Meclib.Memo.action.isInPage(D.rightpage)&&(D.rightMemo=!0),D.pageItemId="pagelist-itemid"+N,S!==D.leftpage&&S!==D.rightpage||(L=N),D.leftPdf=!0,D.rightPdf=!0,Meclib.Globals.book.currentPage!==D.leftpage&&Meclib.Globals.book.currentPage!==D.rightpage||(D.current="current"),0===Meclib.Globals.book.pdf?(D.leftPdf=!1,D.rightPdf=!1):(!0===Meclib.Lists.pageSettingList.isPdf(D.leftpage)?D.leftPdf=!0:D.leftPdf=!1,!0===Meclib.Lists.pageSettingList.isPdf(D.rightpage)?D.rightPdf=!0:D.rightPdf=!1),0!==D.leftpage&&D.leftpage<=Meclib.Globals.book.totalPage){D.noimageLeft="";var E=Meclib.Lists.pageNumList.get({id:D.leftpage});void 0!==E&&(D.leftpageOutput=E.get("text"),D.leftpageOutput.length>1&&"*"===D.leftpageOutput.substring(0,1)&&(D.leftpageOutput=""))}else D.noimageLeft="-noimage",D.leftpageOutput="",D.leftPdf=!1;if(0!==D.rightpage&&D.rightpage<=Meclib.Globals.book.totalPage){D.noimageRight="";var O=Meclib.Lists.pageNumList.get({id:D.rightpage});D.rightpageOutput=O.get("text"),D.rightpageOutput.length>1&&"*"===D.rightpageOutput.substring(0,1)&&(D.rightpageOutput="")}else D.noimageRight="-noimage",D.rightpageOutput="",D.rightPdf=!1;1===Meclib.Globals.bookCanvas.canvasNum&&!1===D.twopage&&(D.noimageLeft="-unit",D.noimageRight="-unit"),!0===D.twopage&&0===D.leftpage?0!==D.leftpage&&0!==D.rightpage||(D.border="border"):1===Meclib.Globals.bookCanvas.canvasNum&&!1===D.twopage&&(D.border="border"),D.imageWidth='width="'+n+'px"',D.imageHeight='height="'+c+'px"',!0===Meclib.Pagelist.maximum?D.cssClass="-block":D.cssClass="";var H=!1;if(Meclib.Pagelist.blockList.length>0)for(var W=0;W=Meclib.Pagelist.scrollStart&&D.leftpage<=Meclib.Pagelist.scrollEnd||D.rightpage>=Meclib.Pagelist.scrollStart&&D.rightpage<=Meclib.Pagelist.scrollEnd)&&(R=!0),!1===H&&!0===R&&(Meclib.Pagelist.blockList.push(F),!1===e&&"slider"!==Meclib.Pagelist.from?"before"===Meclib.Pagelist.from?z+=_.template(Meclib.Cache.Tpl.pageList)(D):(Meclib.Pagelist.from,$("#pagelist-items .mCSB_container").append(_.template(Meclib.Cache.Tpl.pageList)(D))):$("#pagelist-items").append(_.template(Meclib.Cache.Tpl.pageList)(D)));var j=new Image,B=new Image,X=Meclib.Globals.viewer.get("dataPath")+"jpg/"+Meclib.Function.formatNum(4,D.leftpage)+".jpg"+Meclib.Cache.fileCache,Y=Meclib.Globals.viewer.get("dataPath")+"jpg/"+Meclib.Function.formatNum(4,D.rightpage)+".jpg"+Meclib.Cache.fileCache;0===D.leftpage&&$("#pagelist-image"+D.leftpage).hide(),0===D.rightpage&&$("#pagelist-image"+D.rightpage).hide(),D.leftpage>=Meclib.Pagelist.nowScrollStart&&D.leftpage<=Meclib.Pagelist.scrollEnd&&(j.src=X,$(j).on("load",{imageid:D.leftpage,imageurl:X},(function(e){$("#pagelist-image"+e.data.imageid).attr({src:e.data.imageurl})})),$("#pagelist-image"+D.leftpage).show(),0!==D.rightpage&&(B.src=Y,$(B).on("load",{imageid:D.rightpage,imageurl:Y},(function(e){$("#pagelist-image"+e.data.imageid).attr({src:e.data.imageurl})})),$("#pagelist-image"+D.rightpage).show())),D.rightpage>=Meclib.Pagelist.nowScrollStart&&D.rightpage<=Meclib.Pagelist.scrollEnd&&(B.src=Y,$(B).on("load",{imageid:D.rightpage,imageurl:Y},(function(e){$("#pagelist-image"+e.data.imageid).attr({src:e.data.imageurl})})),$("#pagelist-image"+D.rightpage).show(),0!==D.leftpage&&(j.src=X,$(j).on("load",{imageid:D.leftpage,imageurl:X},(function(e){$("#pagelist-image"+e.data.imageid).attr({src:e.data.imageurl})})),$("#pagelist-image"+D.leftpage).show()))}if("before"===Meclib.Pagelist.from&&$("#pagelist-items .mCSB_container").prepend(z),$(".pagelist-image-item").css({width:r+"px",height:g+10+"px"}),$(".sd-pagelist-image-item").css({width:r+"px",height:g+10+"px"}),$(".pagelist-icon-l").css({height:g+10+"px"}),$(".pagelist-icon-r").css({height:g+10+"px"}),1===Meclib.Globals.bookCanvas.canvasNum&&0===Meclib.Globals.book.twopage?(d.left=(r-n)/2,$(".pagelist-image").css({top:d.top+"px",left:d.left+"px"}),$(".pagelist-image-l-unit").css({height:g+10+"px"}),$(".pagelist-image-r-unit").css({height:g+10+"px"}),$(".sd-pagelist-image-l-unit").css({width:r+"px",height:g+10+"px"}),$(".sd-pagelist-image-r-unit").css({width:r+"px",height:g+10+"px"}),3===Meclib.Globals.viewer.get("device")&&($(".sp-pagelist-image").css({top:d.top+"px",left:d.left+"px"}),Meclib.Globals.bookCanvas.canvasWidthw){var K=1,Z=S;(Z=10*(Meclib.Globals.book.totalPage-Z+1))<=10&&(Z=1),$("#pagelist-slider").slider({value:Z,min:1,max:10*Meclib.Globals.book.totalPage,animate:.5,step:K,orientation:"vertical",create:function(e,i){},slide:function(e,i){if(!0===Meclib.ShowMenuBehind)return!1;Meclib.PageSlider.selected=!0;var t=i.value;(t=parseInt(t/10,10))<1&&(t=1)},stop:function(e,i){if(!0===Meclib.ShowMenuBehind)return!1;setTimeout((function(){Meclib.PageSlider.selected=!1}),500);var t=i.value;(t=parseInt(t/10,10))<1&&(t=1),t=-1*(t-Meclib.Globals.book.totalPage),t++,Meclib.Pagelist.from="slider",Meclib.Pagelist.scrollStart=t,ViewerApp.mediator.trigger("pagelist:drawList")},change:function(e,i){}}),$(".page-slider-contents").show()}},drawMaxList:function(){Meclib.Pagelist.maximum=!0,ViewerApp.mediator.trigger("pagelist:drawList",!0)},nextScroll:function(){Meclib.Pagelist.from="next",ViewerApp.mediator.trigger("pagelist:drawList")},beforeScroll:function(){Meclib.Pagelist.from="before",ViewerApp.mediator.trigger("pagelist:drawList")},addListsEvent:function(){Meclib.ClickManager.add(document,".ev-pagelist-item",(function(e,i){i.stopPropagation();var t=parseInt($(e).attr("data-page"),10);return!0!==Meclib.Menu.maximum&&3!==Meclib.Globals.viewer.get("device")||ViewerApp.mediator.trigger("menu:close"),ViewerApp.mediator.trigger("main:movePage",t),!1}),!0)},close:function(){Meclib.Pagelist.maximum=!1,Meclib.Pagelist.scrollStart=0,Meclib.Pagelist.scrollEnd=0,$("#pagelist-items").hide(),$("#menu-pagelist").hide()},onPageChenged:function(){"pageList"===Meclib.Menu.name&&ViewerApp.mediator.trigger("pagelist:drawList",!0)},setCurrentPage:function(){var e="#pagelist-image",i="current_pagelist";if(Meclib.Globals.viewer.get("device")>1&&(i="sd_current_pagelist"),$("."+i).each((function(){$(this).removeClass(i)})),2===Meclib.Globals.bookCanvas.canvasNum){var t=Meclib.Globals.book.getLeftPage(),o=Meclib.Globals.book.getRightPage();$(e+t).closest("div").addClass(i),$(e+o).closest("div").addClass(i)}else t=Meclib.Globals.book.currentPage,$(e+t).closest("div").addClass(i)}}),ViewerApp.Views.CropView=Backbone.View.extend({eventFlg:!1,initialize:function(e){if(_.bindAll(this,"drawList"),ViewerApp.mediator.on("crop:startCropMode",this.startCropMode),ViewerApp.mediator.on("crop:endCropMode",this.endCropMode),ViewerApp.mediator.on("crop:resize",this.resize),ViewerApp.mediator.on("crop:onSelect",this.onSelect),ViewerApp.mediator.on("crop:showDialog",this.showDialog),ViewerApp.mediator.on("crop:doCrop",this.doCrop),ViewerApp.mediator.on("crop:openList",this.openList),ViewerApp.mediator.on("crop:drawList",this.drawList),ViewerApp.mediator.on("crop:closeList",this.closeList),ViewerApp.mediator.on("crop:addListsEvent",this.addListsEvent),ViewerApp.mediator.on("crop:releaseCrop",this.releaseCrop),ViewerApp.mediator.on("common:closePanel",this.releaseCrop),ViewerApp.mediator.on("crop:removeItem",this.removeItem),ViewerApp.mediator.on("crop:removeFile",this.removeFile),ViewerApp.mediator.on("crop:downloadItem",this.downloadItem),ViewerApp.mediator.on("crop:deleteAll",this.deleteAll),ViewerApp.mediator.on("crop:downloadAll",this.downloadAll),ViewerApp.mediator.on("crop:updateCropButton",this.updateCropButton),"MAINTE"!==Meclib.Setting.type){var i={};switch(i._croppedNum=Meclib.Message.crop.croppedNum,Meclib.Globals.viewer.get("device")){case 1:case 2:Meclib.Cache.Tpl.cropList=$("#sidemenu-croplist-template").html(),Meclib.Cache.Tpl.cropListRow=$("#sidemenu-croplist-row-template").html(),$("#menu-croplist").html(_.template(Meclib.Cache.Tpl.cropList)(i))}}},resize:function(){Meclib.Mode.crop=!1;var e=Meclib.Function.getWinsize().height,i=0;switch(Meclib.Globals.viewer.get("device")){case 1:case 2:i=e-(Meclib.Size.headerHeight+Meclib.Size.footerHeight+Meclib.Size.sidemenuHeaderHeight+Meclib.Size.sidemenuHeaderMenuHeight)}$("#croplist-items").css({height:i-10+"px"})},startCropMode:function(){if(!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping){if(!0===Meclib.Function.isSideMenuOpened()&&ViewerApp.mediator.trigger("menu:close"),Meclib.Mode.crop=!0,ViewerApp.mediator.trigger("fusen:close"),ViewerApp.mediator.trigger("object:hide"),ViewerApp.mediator.trigger("optionmenu:close"),ViewerApp.mediator.trigger("print:closePanel"),ViewerApp.mediator.trigger("pdf:closePanel"),ViewerApp.mediator.trigger("products:hidePanel"),""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}if(Meclib.Function.setForceClose(),1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay&&ViewerApp.mediator.trigger("menu:closeMainMenu"),2!==Meclib.Globals.viewer.get("device")&&3!==Meclib.Globals.viewer.get("device")||ViewerApp.mediator.trigger("menu:closeMainMenu"),null!==Meclib.Crop.jCropApi&&void 0!==Meclib.Crop.jCropApi)return ViewerApp.mediator.trigger("crop:endCropMode"),!1;if(null!==Meclib.Comment.jCropApi&&void 0!==Meclib.Comment.jCropApi)return ViewerApp.mediator.trigger("comment:endAreaSelectMode"),!1;var e={width:(0,0),height:0,top:Meclib.Globals.bookCanvas.top+1,left:(0,0)},i=Meclib.Globals.book.getLeftPage(),t=Meclib.Globals.book.getRightPage();2===Meclib.Globals.bookCanvas.canvasNum?0!==i&&0!==t?!0===Meclib.Lists.pageSettingList.isCrop(i)&&!0===Meclib.Lists.pageSettingList.isCrop(t)?(e.width=2*Meclib.Globals.bookCanvas.drawWidth,e.left=$("#canvas-leftpage").css("left"),Meclib.Crop.pageNum=2,Meclib.Crop.left=!0,Meclib.Crop.right=!0):!0===Meclib.Lists.pageSettingList.isCrop(i)&&!1===Meclib.Lists.pageSettingList.isCrop(t)?(e.width=Meclib.Globals.bookCanvas.drawWidth,e.left=$("#canvas-leftpage").css("left"),Meclib.Crop.pageNum=1,Meclib.Crop.left=!0,Meclib.Crop.right=!1):!1===Meclib.Lists.pageSettingList.isCrop(i)&&!0===Meclib.Lists.pageSettingList.isCrop(t)&&(e.width=Meclib.Globals.bookCanvas.drawWidth,e.left=$("#canvas-rightpage").css("left"),Meclib.Crop.pageNum=1,Meclib.Crop.left=!1,Meclib.Crop.right=!0):0!==i&&0===t?!0===Meclib.Lists.pageSettingList.isCrop(i)&&(e.width=Meclib.Globals.bookCanvas.drawWidth,e.left=$("#canvas-leftpage").css("left"),Meclib.Crop.pageNum=1,Meclib.Crop.left=!0,Meclib.Crop.right=!1):0===i&&0!==t&&!0===Meclib.Lists.pageSettingList.isCrop(t)&&(e.width=Meclib.Globals.bookCanvas.drawWidth,e.left=$("#canvas-rightpage").css("left"),Meclib.Crop.pageNum=1,Meclib.Crop.left=!1,Meclib.Crop.right=!0):!0===Meclib.Lists.pageSettingList.isCrop(Meclib.Globals.book.currentPage)&&(e.width=Meclib.Globals.bookCanvas.drawWidth,e.left=parseInt($("#canvas-leftpage").css("left"),10)+1,Meclib.Crop.pageNum=1,Meclib.Crop.left=!0,Meclib.Crop.right=!1),0!==e.width&&($("#page-area").append(_.template($("#croparea-template").html())),$("#crop-area").css({width:e.width+1,height:Meclib.Globals.bookCanvas.drawHeight,top:e.top,left:e.left}),(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&(e.width=parseInt($("#page-area").css("width"),10),1===Meclib.Crop.pageNum&&2===Meclib.Globals.bookCanvas.canvasNum&&(e.width=e.width/2),e.height=parseInt($("#page-area").css("height"),10),$("#crop-area").css({width:e.width,height:e.height,top:0,left:e.left})),null!==Meclib.Crop.jCropApi&&void 0!==Meclib.Crop.jCropApi||(Meclib.Crop.jCropApi=$.Jcrop("#crop-target"),Meclib.Crop.jCropApi.release()),$("#crop-target").Jcrop({onSelect:function(e){3===Meclib.Event.type&&e.w<10&&e.h<10?ViewerApp.mediator.trigger("contents:endCropMode"):ViewerApp.mediator.trigger("crop:onSelect",e)},onRelease:function(e){ViewerApp.mediator.trigger("crop:releaseCrop"),Meclib.Globals.viewer.get("device")>1&&ViewerApp.mediator.trigger("menu:toggleMenu")}}),$(".jcrop-holder").css("background-color","rgb(0,0,0,0.3)"),ViewerApp.mediator.trigger("contents:changeCropMode",!0),ViewerApp.mediator.trigger("contents:overrideCropMode"))}},releaseCrop:function(){Meclib.Mode.crop=!1,Meclib.Crop.pageNum=0,Meclib.Crop.left=!1,Meclib.Crop.right=!1,null!==Meclib.Crop.jCropApi&&void 0!==Meclib.Crop.jCropApi&&(Meclib.Crop.jCropApi.disable(),Meclib.Crop.jCropApi=null,$("#crop-area").remove(),ViewerApp.mediator.trigger("contents:changeCropMode",!1))},endCropMode:function(){null!==Meclib.Crop.jCropApi&&void 0!==Meclib.Crop.jCropApi?Meclib.Crop.jCropApi.release():ViewerApp.mediator.trigger("crop:releaseCrop")},onSelect:function(e){var i=Meclib.Globals.viewer.get("dataPath")+"scripts/crop.php";$.ajax({type:"POST",data:{mode:"list"},scriptCharset:"utf-8",url:i}).done((function(i){Meclib.Lists.cropList=i.list,ViewerApp.mediator.trigger("crop:showDialog",e)})).fail((function(e,i,t){Meclib.Debug.log("error @crop select",2)}))},showDialog:function(e){if(Meclib.Lists.cropList.length>=Meclib.Limit.cropMax){var i=Meclib.Message.crop.errorMax,t=Meclib.Limit.cropMax+"";i=i.replace("|MAX|",t),new Messi(i,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.yes,val:1}]})}else new Messi(Meclib.Message.crop.confirm.doCrop,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.yes,val:1},{id:1,label:Meclib.Message.common.no,val:2}],callback:function(i){"1"===i&&ViewerApp.mediator.trigger("crop:doCrop",e)}});$(window).resize((function(){$(".alert-mask").css({width:Meclib.Function.getWinsize().width,height:Meclib.Function.getWinsize().height,top:0,left:0}),Meclib.Function.setPosCenter("alert-crop")}))},doCrop:function(e){var i={page:0,x:0,y:0,width:0,height:0},t={page:0,x:0,y:0,width:0,height:0},o=0,a=0,l=parseInt($("#crop-area").css("width"),10);if(2===Meclib.Crop.pageNum&&2===Meclib.Globals.bookCanvas.canvasNum?(o=Meclib.Globals.book.getLeftPage(),e.x>l/2&&(o=Meclib.Globals.book.getRightPage()),e.x2>l/2&&(a=Meclib.Globals.book.getRightPage()),i.page=o,i.x=e.x,i.y=e.y,i.width=e.x2-e.x,i.height=e.y2-e.y,o!==a&&0!==a?(t.page=a,i.x=e.x,i.y=e.y,i.width=l/2-e.x,i.height=e.y2-e.y,t.x=0,t.y=e.y,t.width=e.x2-l/2,t.height=e.y2-e.y):o===Meclib.Globals.book.getRightPage()&&(i.x=e.x-l/2)):1===Meclib.Crop.pageNum&&2===Meclib.Globals.bookCanvas.canvasNum?!0===Meclib.Crop.left?(a=o=Meclib.Globals.book.getLeftPage(),i.page=o,i.x=e.x,i.y=e.y,i.width=e.x2-e.x,i.height=e.y2-e.y):!0===Meclib.Crop.right&&(a=o=Meclib.Globals.book.getRightPage(),i.page=o,i.x=e.x,i.y=e.y,i.width=e.x2-e.x,i.height=e.y2-e.y):1===Meclib.Crop.pageNum&&1===Meclib.Crop.pageNum&&(a=o=Meclib.Globals.book.currentPage,i.page=o,i.x=e.x,i.y=e.y,i.width=e.x2-e.x,i.height=e.y2-e.y),0!==o||0!==a){var n=Meclib.Function.getContentsScale();i.x=i.x/n*4,i.y=i.y/n*4,i.width=i.width/n*4,i.height=i.height/n*4,t.x=t.x/n*4,t.y=t.y/n*4,t.width=t.width/n*4,t.height=t.height/n*4;var c=new Object;c.data1=i,Meclib.UserAnalytics.add("crop",i.page,i),0!==t.page&&(c.data2=t,Meclib.UserAnalytics.add("crop",t.page,t)),Meclib.API.onCrop(c);var s=Meclib.Globals.viewer.get("dataPath")+"scripts/crop.php";$.ajax({type:"POST",data:JSON.stringify(c),scriptCharset:"utf-8",url:s}).done((function(e){Meclib.Lists.cropList=e.list,1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.display?Meclib.Function.popup(Meclib.Message.crop.complete,"#btn-croplist"):Meclib.Function.popup(Meclib.Message.crop.complete)})).fail((function(e,i,t){Meclib.Function.popup(Meclib.Message.crop.failed)}))}},openList:function(){var e=Meclib.Globals.viewer.get("dataPath")+"scripts/crop.php";$.ajax({type:"POST",data:{mode:"list"},scriptCharset:"utf-8",url:e}).done((function(e){ViewerApp.mediator.trigger("crop:drawList",e)})).fail((function(e,i,t){Meclib.Debug.log("error @crop list",2)}))},drawList:function(){var e="";$("#menu-croplist").show(),$("#croplist-items").mCustomScrollbar("destroy"),$("#croplist-items").html("");var i=80,t=100;1===arguments.length&&(e=arguments[0],Meclib.Lists.cropList=e.list,Meclib.Globals.viewer.set({sid:e.info.id})),$("#crop-count").html(Meclib.Lists.cropList.length+"/"+Meclib.Limit.cropMax);var o="";Meclib.Lists.cropList.sort((function(e,i){return e.page>i.page?1:e.pagei.name?-1:e.nameMeclib.Lists.cropList[a].height?(n=i,c=Meclib.Lists.cropList[a].height*(i/Meclib.Lists.cropList[a].width)):(c=i,n=Meclib.Lists.cropList[a].width*(i/Meclib.Lists.cropList[a].height)),l.imageWidth='"width="'+n+'px"',l.imageHeight='height="'+c+'px"',l.page=Meclib.Globals.book.getPageName(Meclib.Lists.cropList[a].page),l.imgstyle="style=top:"+(t-c)/2+"px;left:"+($("#croplist-items").width()-n)/2+"px;",o+=_.template(Meclib.Cache.Tpl.cropListRow)(l)}$("#croplist-items").append(o),o="",0===Meclib.Lists.cropList.length?($(".ev-crop-alldelete").hide(),$(".ev-crop-alldownload").hide()):($(".ev-crop-alldelete").show(),$(".ev-crop-alldownload").show()),setTimeout((function(){$("#croplist-items").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:100,scrollInertia:0,scrollButtons:{enable:!1}})}),2e3),ViewerApp.mediator.trigger("menu:closeLoading"),ViewerApp.mediator.trigger("crop:addListsEvent")},addListsEvent:function(){var e="#menu-croplist";Meclib.ClickManager.add(e,".ev-croplist-item",(function(e,i){i.stopPropagation();var t=parseInt($(e).attr("data-page"),10);return ViewerApp.mediator.trigger("main:movePage",t),!1}),!0),Meclib.ClickManager.add(e,".ev-crop-delete",(function(e,i){i.stopPropagation();var t=$(e).attr("data-id");return ViewerApp.mediator.trigger("crop:removeItem",t),!1}),!0),Meclib.ClickManager.add(e,".ev-crop-download",(function(e,i){i.stopPropagation();for(var t=$(e).attr("data-id"),o=0;o0&&ViewerApp.mediator.trigger("crop:downloadAll"),!1}),!0),Meclib.ClickManager.add(e,".ev-crop-alldelete",(function(e,i){return i.stopPropagation(),Meclib.Lists.cropList.length>0&&ViewerApp.mediator.trigger("crop:deleteAll"),!1}),!0)},removeItem:function(e){return ViewerApp.mediator.trigger("contents:hideAll"),new Messi(Meclib.Message.crop.confirm.removeItem,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.yes,val:1},{id:1,label:Meclib.Message.common.no,val:2}],callback:function(i){if(ViewerApp.mediator.trigger("contents:showAll"),"1"===i)for(var t=0;t1&&(Meclib.Globals.ua.search("iPhone")>-1||Meclib.Globals.ua.search("iPad")>-1||Meclib.Function.isIOSDesctopMode()||Meclib.Globals.ua.search("Android")>-1)&&window.open("about:blank",e);var t=$('
');$(t).append(''),$(t).append(''),$(t).appendTo(document.body),Meclib.Globals.viewer.get("device")>1&&(Meclib.Globals.ua.search("iPhone")>-1||Meclib.Globals.ua.search("iPad")>-1||Meclib.Function.isIOSDesctopMode()||Meclib.Globals.ua.search("Android")>-1)&&$(t).attr("target",e),$(t).submit()},downloadAll:function(){ViewerApp.mediator.trigger("contents:hideAll"),new Messi(Meclib.Message.crop.confirm.downloadAll,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.yes,val:1},{id:1,label:Meclib.Message.common.no,val:2}],callback:function(e){if(ViewerApp.mediator.trigger("contents:showAll"),"1"===e){var i=Meclib.Globals.viewer.get("dataPath")+"scripts/dl.php";$("#form-cropalldl").remove();var t=$('
');$(t).append(''),$(t).appendTo(document.body),$(t).submit()}}})},deleteAll:function(){1!==Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("contents:hideAll"),new Messi(Meclib.Message.crop.confirm.deleteAll,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.yes,val:1},{id:1,label:Meclib.Message.common.no,val:2}],callback:function(e){if(1!==Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("contents:showAll"),"1"===e){var i=Meclib.Globals.viewer.get("dataPath")+"scripts/crop.php";$.ajax({type:"POST",data:{mode:"alldelete"},scriptCharset:"utf-8",url:i}).done((function(e){Meclib.Lists.cropList.length=0,ViewerApp.mediator.trigger("crop:drawList")})).fail((function(e,i,t){Meclib.Debug.log("error @crop delete",2)}))}}})},updateCropButton:function(){if(1===Meclib.Globals.viewer.get("enabedOptions").crop){var e=!1;2===Meclib.Globals.bookCanvas.canvasNum?(0!==Meclib.Globals.book.getLeftPage()&&!0===Meclib.Lists.pageSettingList.isCrop(Meclib.Globals.book.getLeftPage())&&(e=!0),0!==Meclib.Globals.book.getRightPage()&&!0===Meclib.Lists.pageSettingList.isCrop(Meclib.Globals.book.getRightPage())&&(e=!0)):0!==Meclib.Globals.book.currentPage&&!0===Meclib.Lists.pageSettingList.isCrop(Meclib.Globals.book.currentPage)&&(e=!0),!0===e?$("#btn-crop").removeClass("disabled"):$("#btn-crop").addClass("disabled")}},closeList:function(){$("#menu-croplist").hide(),null!==Meclib.Crop.jCropApi&&void 0!==Meclib.Crop.jCropApi&&(Meclib.Crop.jCropApi.disable(),Meclib.Crop.jCropApi.release(),Meclib.Crop.jCropApi=null,$("#crop-area").remove())}}),ViewerApp.Views.FusenPanelView=Backbone.View.extend({el:null,selectedColor:1,listScroll:!0,eventFlg:!1,colors:["red","yellow","blue"],initialize:function(e){if(_.bindAll(this,"showPanel","resize","clear","draw","selectColor","drawFusenOne","updateFusen","addFusenOne","renderFusenList","addPanelEvent","addItemEvent","addListsEvent"),ViewerApp.mediator.on("fusen:showPanel",this.showPanel),ViewerApp.mediator.on("fusen:resize",this.resize),ViewerApp.mediator.on("fusen:clear",this.clear),ViewerApp.mediator.on("common:closePanel",this.close),ViewerApp.mediator.on("fusen:close",this.close),ViewerApp.mediator.on("fusen:draw",this.draw),ViewerApp.mediator.on("fusen:addListsEvent",this.addListsEvent),ViewerApp.mediator.on("fusen:hideFusenMenu",this.hideFusenMenu),ViewerApp.mediator.on("fusen:addFusenOne",this.addFusenOne),ViewerApp.mediator.on("fusen:drawFusenOne",this.drawFusenOne),ViewerApp.mediator.on("fusen:removeFusenOne",this.removeFusenOne),ViewerApp.mediator.on("fusen:selectColor",this.selectColor),ViewerApp.mediator.on("fusen:updateFusen",this.updateFusen),ViewerApp.mediator.on("fusen:allClear",this.allClear),ViewerApp.mediator.on("fusen:renderFusenList",this.renderFusenList),ViewerApp.mediator.on("fusen:showDeleteDialog",this.showDeleteDialog),ViewerApp.mediator.on("fusen:disabledFusenMenu",this.disabledFusenMenu),ViewerApp.mediator.on("fusen:enableFusenAddButton",this.enableFusenAddButton),ViewerApp.mediator.on("fusen:showFusenArea",this.showFusenArea),ViewerApp.mediator.on("fusen:show",this.show),ViewerApp.mediator.on("fusen:hide",this.hide),ViewerApp.mediator.on("common:updateOption",this.updateOption),"MAINTE"!==Meclib.Setting.type){switch(Meclib.Lists.fusenList.fetch({dataType:"json",success:function(e,i,t){},error:function(){Meclib.Debug.log("error fusen data",1)}}),Meclib.Cache.Tpl.fusenArea=$("#fusenarea-template").html(),Meclib.Globals.viewer.get("device")){case 1:Meclib.Cache.Tpl.fusen=$("#fusen-template").html(),Meclib.Cache.Tpl.fusenList=$("#sidemenu-fusenlist-template").html(),Meclib.Cache.Tpl.newsList=$("#sidemenu-newslist-template").html(),Meclib.Cache.Tpl.fusenHeader=$("#sidemenu-fusenlist-header-template").html(),Meclib.Cache.Tpl.fusenFooter=$("#sidemenu-fusenlist-footer-template").html();break;case 2:Meclib.Cache.Tpl.fusen=$("#fusen-template").html(),Meclib.Cache.Tpl.fusenList=$("#sd-sidemenu-fusenlist-template").html(),Meclib.Cache.Tpl.newsList=$("#sd-sidemenu-newslist-template").html(),Meclib.Cache.Tpl.fusenHeader=$("#sd-sidemenu-fusenlist-header-template").html(),Meclib.Cache.Tpl.fusenFooter=$("#sd-sidemenu-fusenlist-footer-template").html();break;case 3:$("#body").append(_.template($("#sp-menu-fusen-template").html())),Meclib.Cache.Tpl.fusen=$("#sp-fusen-template").html(),Meclib.Cache.Tpl.fusenList=$("#sp-sidemenu-fusenlist-template").html(),Meclib.Cache.Tpl.newsList=$("#sp-sidemenu-newslist-template").html(),Meclib.Cache.Tpl.fusenHeader=$("#sp-sidemenu-fusenlist-header-template").html(),Meclib.Cache.Tpl.fusenFooter=$("#sp-sidemenu-fusenlist-footer-template").html(),this.listScroll=!1}this.resize(),this.addEvent()}},resize:function(){var e=0,i=Meclib.Function.getWinsize().height;switch(Meclib.Globals.viewer.get("device")){case 1:case 2:e=i-(Meclib.Size.headerHeight+Meclib.Size.footerHeight+Meclib.Size.sidemenuHeaderHeight+Meclib.Function.getCssVal("#fusenlist-header").height);break;case 3:e=i-(Meclib.Size.headerHeight+Meclib.Size.sidemenuHeaderHeight+Meclib.Function.getCssVal("#fusenlist-header").height)}$("#fusenlist-items").css({height:e-10+"px"}),(Meclib.Globals.ua.search("iPhone")>-1||Meclib.Globals.ua.search("iPad")>-1)&&Meclib.Globals.ua.search("OS 7_")>-1||Meclib.Function.isIOSDesctopMode()?($(window).scrollTop(0,0),$("#sp-menu-fusen").css({position:"fixed",bottom:"0"})):$("#sp-menu-fusen").css("bottom",0)},close:function(){$("#fusen-area").remove(),3===Meclib.Globals.viewer.get("device")?Meclib.Mode.fusen&&(setTimeout((function(){ViewerApp.mediator.trigger("menu:openMainMenu")}),600),Meclib.Function.changeFooterMenu(".sp-footer-menu","#footer-centericon",(function(){}))):2===Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("menu:openMainMenu"),setTimeout((function(){$("#panel-fusen").remove()}),0),Meclib.Mode.fusen=!1,Meclib.Globals.viewer.set({mode:""})},showFusenArea:function(){return $("#fusen-area").remove(),$("#page-area").append(Meclib.Cache.Tpl.fusenArea,null),$("#fusen-area").css({width:"100%",height:"100%",top:0,left:0}),Meclib.ClickManager.add(document,"#fusen-area",(function(e,i){if(i.stopPropagation(),!1===Meclib.Mode.fusen)return!1;var t,o=0;i.originalEvent.touches?(t=i.originalEvent.changedTouches[0].pageX,o=i.originalEvent.changedTouches[0].pageY):(t=i.pageX,o=i.pageY);var a=new ViewerApp.Models.Fusen({uni_id:Meclib.Globals.book.uniId,url:Meclib.Property.domainId,page_no:Meclib.Globals.bookCanvas.getSelectPage(t,!0),x:t,y:o-parseInt($("#canvas-area").css("top"),10)});return ViewerApp.mediator.trigger("fusen:addFusenOne",a),!1}),!0),!1},showPanel:function(){if(!(Meclib.Globals.viewer.get("scale")>1||(!0===Meclib.Function.isSideMenuOpened()&&ViewerApp.mediator.trigger("menu:close"),!0===Meclib.Mode.autoflip||!0===Meclib.Mode.autoflipping||$("#btn-fusen,#sp-btn-fusen").hasClass("disabled")))){if(ViewerApp.mediator.trigger("contents:endEditMode"),ViewerApp.mediator.trigger("optionmenu:close"),ViewerApp.mediator.trigger("print:closePanel"),ViewerApp.mediator.trigger("pdf:closePanel"),ViewerApp.mediator.trigger("products:hidePanel"),Meclib.Globals.viewer.set({mode:"fusen"}),3===Meclib.Globals.viewer.get("device"))return $("#footer-sub-box").hide(),$(".sp-footer-menu").css({position:"absolute",bottom:-1*$("#footer").height()}),ViewerApp.mediator.trigger("menu:closeMainMenu"),Meclib.Function.changeFooterMenu("#footer-centericon",".sp-footer-menu",(function(){$("#footer").hide(),$("#sidemenu-header-title").html(Meclib.Message.fusen.drawFusen),$("#sidemenu-header").show(),$("#sd-menu-title-bar").css({width:"100%"}).show(),$("#menu-title").html(Meclib.Message.fusen.drawFusen),Meclib.Mode.fusen=!0,setTimeout((function(){ViewerApp.mediator.trigger("fusen:showFusenArea")}),100),Meclib.Function.setForceClose()})),!1;if($("#panel-fusen")[0])return!1;if(""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}var e={};return e._fusen=Meclib.Message.general.fusen,Meclib.Globals.viewer.get("device")>1?e._panel_fusen_caption=Meclib.Message.fusen.panelFusenCaptionTap:e._panel_fusen_caption=Meclib.Message.fusen.panelFusenCaptionClick,$("#body").append(_.template($("#panel-fusen-template").html())(e)),$("#panel-fusen").draggable({handle:".panel-fusen-title",containment:"#canvas-area",scroll:!1}),$(".ev-fusen-select-color").removeClass("on"),$("#rdo-select-fusen-color"+Meclib.Fusen.selectedColor).addClass("on"),Meclib.Mode.fusen=!0,Meclib.Function.setPosCenter("panel-fusen"),setTimeout((function(){ViewerApp.mediator.trigger("fusen:showFusenArea")}),500),this.addPanelEvent(),Meclib.Function.setForceClose(),1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay&&ViewerApp.mediator.trigger("menu:closeMainMenu"),Meclib.Globals.viewer.get("device")>1&&ViewerApp.mediator.trigger("menu:closeMainMenu"),!1}},draw:function(){$(".fusen-obj")[0]&&$(".fusen-obj").remove(),0!==Meclib.Globals.viewer.get("options").fusen&&!0!==Meclib.Mode.crop&&Meclib.Lists.fusenList.each((function(e){Meclib.Property.domains.indexOf(e.get("url"))>-1&&ViewerApp.mediator.trigger("fusen:drawFusenOne",e)}))},selectColor:function(e){Meclib.Fusen.selectedColor=parseInt(e,10)},addFusenOne:function(e){e=this.convertPoints(e),Meclib.API.onFusen("add",JSON.parse(JSON.stringify(e))),ViewerApp.mediator.trigger("fusen:drawFusenOne",e)},convertPoints:function(e){var i=0,t=0;i=e.get("x"),t=e.get("y");var o=Meclib.Function.getContentsScale();return 0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage?e.get("page_no")===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getLeftPage()?1===Meclib.zoomScale?i=(i-Meclib.Globals.bookCanvas.left)/o:i/=o:e.get("page_no")===Meclib.Globals.book.getRightPage()&&0!==Meclib.Globals.book.getRightPage()&&(i=(Meclib.Globals.viewer.get("scale"),(i-Meclib.Globals.bookCanvas.getCenterPos())/o)):e.get("page_no")===Meclib.Globals.book.currentPage&&(1===Meclib.Globals.viewer.get("scale")?i=(i-Meclib.Globals.bookCanvas.left)/o:i/=o),t=(Meclib.Globals.viewer.get("scale"),(t-Meclib.Globals.bookCanvas.top)/o),e.set({x:i,y:t}),e},drawFusenOne:function(e){var i={};if(0===e.get("id")){var t=Meclib.Lists.fusenList.getMaxId()+1;e.set({id:t}),Meclib.Lists.fusenList.add(e)}0===e.get("color")&&e.set({color:Meclib.Fusen.selectedColor});var o=this.colors[e.get("color")-1];i._fusenInputPlaceholder=Meclib.Message.fusen.InputPlaceholder,i.id=e.get("id"),i.fusenId="fusen"+e.get("id"),i.text=e.get("text"),$("#"+i.fusenId)[0]&&$("#"+i.fusenId).remove();var a=Meclib.Function.getContentsScale();if(0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage)if(e.get("page_no")===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getLeftPage())1===Meclib.Globals.viewer.get("scale")?i.left=Meclib.Function.getCssVal("#canvas-leftpage").left+e.get("x")*Meclib.Globals.bookCanvas.scale:i.left=Meclib.Function.getCssVal("#canvas-leftpage").left+e.get("x")*a;else{if(e.get("page_no")!==Meclib.Globals.book.getRightPage()||0===Meclib.Globals.book.getRightPage())return!0;1===Meclib.Globals.viewer.get("scale")?i.left=Meclib.Globals.bookCanvas.getCenterPos()+e.get("x")*Meclib.Globals.bookCanvas.scale:i.left=Meclib.Function.getCssVal("#canvas-rightpage").left+e.get("x")*a}else{if(e.get("page_no")!==Meclib.Globals.book.currentPage)return!0;1===Meclib.Globals.viewer.get("scale")?i.left=Meclib.Function.getCssVal("#canvas-leftpage").left+e.get("x")*Meclib.Globals.bookCanvas.scale:i.left=Meclib.Function.getCssVal("#canvas-leftpage").left+e.get("x")*a}try{$("#page-area").append(_.template(Meclib.Cache.Tpl.fusen)(i))}catch(e){Meclib.Debug.log("error fusen add",2)}var l;if(l=e.get("y")*a+Meclib.Function.getCssVal("#canvas-leftpage").top,1===Meclib.Globals.viewer.get("device")||2===Meclib.Globals.viewer.get("device")){$("#"+i.fusenId).addClass("").addClass(o).css({width:e.get("width")*a+"px",height:e.get("height")*a+"px",left:i.left+"px",top:l+"px",position:"absolute"}).draggable({handle:".fusen-obj-title",containment:"#page-area",scroll:!1,drag:function(e,i){Meclib.Fusen.selected=!0},stop:function(e,i){setTimeout((function(){Meclib.Fusen.selected=!1}),100),ViewerApp.mediator.trigger("fusen:updateFusen",{mode:"drag",event:e})}}),$("#"+i.fusenId+" .fusen-obj-title").bind("mousedown touchstart",(function(){Meclib.Fusen.selected=!0})),$("#"+i.fusenId+" .fusen-obj-title").bind("mouseup touchend",(function(){setTimeout((function(){Meclib.Fusen.selected=!1}),100)})),$("#"+i.fusenId).resizable({minWidth:100,minHeight:80,stop:function(e,i){setTimeout((function(){Meclib.Fusen.selected=!1}),100)}}).resize((function(e){e.stopPropagation();var i=$(e.target).css("width").replace("px","")-4,t=$(e.target).css("height").replace("px","")-35;$(e.target).find(".fusen-obj-title").css({width:i+"px"}),$(e.target).find(".fusen-obj-body").css({width:i-4+"px",height:t+"px"}),$(e.target).find(".fusen-obj-textarea").css({width:i-4-10+"px",height:t-10+"px"}),ViewerApp.mediator.trigger("fusen:updateFusen",{mode:"resize",event:e})})),$("#"+i.fusenId+" .ui-resizable-handle").bind("mousedown touchstart",(function(){Meclib.Fusen.selected=!0}));var n=parseInt($("#"+i.fusenId).css("height"),10)-35;$("#"+i.fusenId).addClass(o),$("#"+i.fusenId).find(".fusen-obj-title").css({width:e.get("width")*a-4+"px"}).addClass(o),$("#"+i.fusenId).find(".fusen-obj-body").css({width:e.get("width")*a-8+"px",height:n+"px"}).addClass(o),$("#"+i.fusenId).find(".fusen-obj-textarea").css({width:e.get("width")*a-15+"px",height:n-10+"px"})}else $("#"+i.fusenId).addClass(o).css({width:"130px",height:"30px",left:i.left+"px",top:l+"px"}).draggable({handle:"",containment:"#canvas-area",scroll:!1,drag:function(e,i){Meclib.Fusen.selected=!0},stop:function(e,i){setTimeout((function(){Meclib.Fusen.selected=!1}),100),ViewerApp.mediator.trigger("fusen:updateFusen",{mode:"drag",event:e})}});e.save(),this.addItemEvent()},removeFusenOne:function(e){var i="fusen"+e;setTimeout((function(){$("#"+i).remove()}),0),Meclib.Lists.fusenList.on("remove",(function(e,i,t){e.destroy()})),Meclib.Lists.fusenList.remove({id:e})},updateFusen:function(e){var i="",t={},o=null,a=Meclib.Function.getContentsScale(),l=0;switch(e.mode){case"textchange":i=String(e.event.target.id).replace("fusen-text-fusen",""),o=Meclib.Lists.fusenList.get({id:i});var n=$(e.event.target).val();o.save({text:n});break;case"colorchange":var c=String(e.event.target.id).replace("btn-change-fusen-color","");i=$(e.event.target).attr("data-id").replace("fusen","");var s=(o=Meclib.Lists.fusenList.get({id:i})).get("color");o.save({color:parseInt(c,10)}),$("#fusen"+i).removeClass(this.colors[s-1]).addClass(this.colors[c-1]),$("#fusen"+i).find(".fusen-obj-title").removeClass(this.colors[s-1]).addClass(this.colors[c-1]),$("#fusen"+i).find(".fusen-obj-body").removeClass(this.colors[s-1]).addClass(this.colors[c-1]);break;case"drag":i=String(e.event.target.id).replace("fusen",""),t=Meclib.Function.getCssVal(e.event.target),o=Meclib.Lists.fusenList.get({id:i}),l=Meclib.Globals.bookCanvas.getSelectPage(t.left,!0),o.set({page_no:l,x:t.left,y:t.top}),(o=this.convertPoints(o)).save({width:t.width/a,height:t.height/a});break;case"resize":i=String(e.event.target.id).replace("fusen",""),t=Meclib.Function.getCssVal(e.event.target),l=Meclib.Globals.bookCanvas.getSelectPage(t.left,!0),(o=Meclib.Lists.fusenList.get({id:i})).set({page_no:l,x:t.left,y:t.top}),(o=this.convertPoints(o)).save({width:t.width/a,height:t.height/a})}Meclib.API.onFusen("update",JSON.parse(JSON.stringify(o)))},renderFusenList:function(){$("#fusenlist-items").mCustomScrollbar("destroy"),$("#fusenlist-items").html("");var e=[];e.enableNews=!1,Meclib.Lists.newsList.length>0&&(e.enableNews=!0),$("#fusenlist-header").html(_.template(Meclib.Cache.Tpl.fusenHeader)(e)),$("#fusenlist-footer").html(Meclib.Cache.Tpl.fusenFooter),$(".ev-radio-menu-fusen").removeClass("on"),$("#menu-fusen-color-radio"+Meclib.Globals.menu.get("fusenListSelect")).addClass("on"),$("#sp-fusen-select-color-box"+Meclib.Globals.menu.get("fusenListSelect")).addClass("on");var i=this.colors;9===Meclib.Globals.menu.get("fusenListSelect")?Meclib.Lists.newsList.each((function(e){var t=[];t.id=e.get("id"),t.color=i[e.get("color")-1],0===e.get("page_no")||"undefined"===e.get("page_no")?(t.thumbImage=Meclib.Asetts.SpaceImage.src,t.page=""):(t.page=Meclib.Globals.book.getPageName(e.get("page_no")),t.thumbImage=Meclib.Globals.viewer.get("dataPath")+"jpg/"+Meclib.Function.formatNum(4,e.get("page_no"))+".jpg"),t.text=e.get("text"),t.text=$("

").html(t.text).text(),t.text=t.text.substring(0,40),t.type=2,t.imageWidth="",t.imageHeight="";var o=Meclib.Function.getListThumbSize(Meclib.Globals.book.thumbWidth,Meclib.Globals.book.thumbHeight);t.imageWidth="width="+o.width+"px",t.imageHeight="height="+o.height+"px";var a=!1;(0===Meclib.Globals.menu.get("fusenListSelect")||i[Meclib.Globals.menu.get("fusenListSelect")-1]===t.color)&&(a=!0),!0===a&&$("#fusenlist-items").append(_.template(Meclib.Cache.Tpl.newsList)(t))})):(Meclib.Lists.fusenList.sortColor(),Meclib.Lists.fusenList.each((function(e){if(-1===Meclib.Property.domains.indexOf(e.get("url")))return!0;var t=[];t.id=e.get("id"),t.color=i[e.get("color")-1],0===e.get("page_no")||"undefined"===e.get("page_no")?(t.thumbImage=Meclib.Asetts.SpaceImage.src,t.page=""):(t.page=Meclib.Globals.book.getPageName(e.get("page_no")),t.thumbImage=Meclib.Globals.viewer.get("dataPath")+"jpg/"+Meclib.Function.formatNum(4,e.get("page_no"))+".jpg"),t.text=Meclib.Function.escapeBookIndexText(e.get("text")),t.imageWidth="",t.imageHeight="",t.type=1;var o=Meclib.Function.getListThumbSize(Meclib.Globals.book.thumbWidth,Meclib.Globals.book.thumbHeight);t.imageWidth="width="+o.width+"px",t.imageHeight="height="+o.height+"px";var a=!1;(0===Meclib.Globals.menu.get("fusenListSelect")||i[Meclib.Globals.menu.get("fusenListSelect")-1]===t.color)&&(a=!0),!0===a&&$("#fusenlist-items").append(_.template(Meclib.Cache.Tpl.fusenList)(t))}))),$("#menu-fusenlist").show(),$(".fusenlist-item-page").css("width",Meclib.Size.sideMenu-95+"px"),$(".sd-fusenlist-item-page").css("width",Meclib.Size.sideMenu-140+"px"),$(".sp-fusenlist-item-page").css("width",Meclib.Size.sideMenu-140+"px"),setTimeout((function(){$("#fusenlist-items").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:100,scrollInertia:200,scrollButtons:{enable:!1},callbacks:{onCreate:function(){ViewerApp.mediator.trigger("fusen:addListsEvent")}}})}),1e3),ViewerApp.mediator.trigger("menu:closeLoading")},addPanelEvent:function(){Meclib.ClickManager.add(document,"ul#list-fusencolor label",(function(e,i){$("ul#list-fusencolor").find(".btn-radio").removeClass("on"),$(e).find(".btn-radio").toggleClass("on");var t=$(e).attr("data-id");"1"===t?ViewerApp.mediator.trigger("fusen:selectColor",1):"2"===t?ViewerApp.mediator.trigger("fusen:selectColor",2):"3"===t&&ViewerApp.mediator.trigger("fusen:selectColor",3)})),Meclib.ClickManager.add(document,"#btn-close-fusenpanel",(function(e,i){ViewerApp.mediator.trigger("fusen:close")}))},addItemEvent:function(){$(document).on("change",".fusen-obj-textarea",(function(e){ViewerApp.mediator.trigger("fusen:updateFusen",{mode:"textchange",event:e})})),$(document).off("blur",".fusen-obj-textarea"),$(document).on("blur",".fusen-obj-textarea",(function(e){Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1&&window.getSelection().removeAllRanges()})),Meclib.ClickManager.add(document,".btn-close-fusen",(function(e,i){var t=String($(e).attr("data-id"));ViewerApp.mediator.trigger("fusen:removeFusenOne",t),Meclib.Fusen.selected=!1})),Meclib.ClickManager.add(document,".btn-change-fusen-color",(function(e,i){ViewerApp.mediator.trigger("fusen:updateFusen",{mode:"colorchange",event:i}),Meclib.Fusen.selected=!1}))},addListsEvent:function(){var e=document;Meclib.ClickManager.add(e,".ev-fusenlist-item",(function(e,i){var t,o=$(e).attr("data-id"),a=parseInt($(e).attr("data-type"),10);1===a?(o=parseInt($(e).attr("data-id"),10),t=Meclib.Lists.fusenList.get({id:o})):2===a&&(t=Meclib.Lists.newsList.get({id:o})),3===Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("menu:close"),ViewerApp.mediator.trigger("main:movePage",t.get("page_no"))}),!0),Meclib.ClickManager.add(e,".ev-fusen-delete",(function(e,i){i.stopPropagation();var t=$(e).attr("data-id");return ViewerApp.mediator.trigger("fusen:showDeleteDialog",t),!1}),!0),Meclib.ClickManager.add(e,"label.lbl-fusen-color-select",(function(e,i){var t=$(e).attr("data-color");$(".ev-radio-menu-fusen").removeClass("on"),$("#menu-fusen-color-radio"+t).addClass("on"),Meclib.Globals.menu.set({fusenListSelect:parseInt(t)}),ViewerApp.mediator.trigger("fusen:renderFusenList")}),!0),Meclib.ClickManager.add(e,".ev-btn-fusen-allclear",(function(e,i){return new Messi(Meclib.Message.fusen.confirm.deleteAll,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.yes,val:1},{id:1,label:Meclib.Message.common.no,val:2}],callback:function(e){"1"===e&&ViewerApp.mediator.trigger("fusen:allClear")}}),!1}),!0)},addEvent:function(){Meclib.ClickManager.add(document,"#sp-fusen-color-red,#sp-fusen-color-yellow,#sp-fusen-color-blue",(function(e,i){var t=1;"sp-fusen-color-red"===i.target.id?t=1:"sp-fusen-color-yellow"===i.target.id?t=2:"sp-fusen-color-blue"===i.target.id&&(t=3),ViewerApp.mediator.trigger("fusen:selectColor",t),$(".sp-fusen-color-items").find("i[id^='sp-fusen-color']").each((function(){$(this).prev(".menu-button-image").removeClass("selected")})),$(e).prev(".menu-button-image").addClass("selected")})),Meclib.ClickManager.add(document,".sp-btn-fusenclose",(function(e,i){return i.stopPropagation(),ViewerApp.mediator.trigger("fusen:close"),setTimeout((function(){$("#footer").show(),$("#footer-sub-box").show()}),400),!1}))},show:function(){1!=Meclib.Mode.txtcopy&&($(".fusen-obj").show(),$(".sp-fusen-obj").show())},hide:function(){$(".fusen-obj").hide(),$(".sp-fusen-obj").hide()},clear:function(){$(".fusen-obj").remove(),$(".sp-fusen-obj").remove()},allClear:function(){Meclib.Fusen.selected=!1;var e=Meclib.Lists.fusenList.length;if(e>0)for(var i=e-1;i>=0;i--){var t=Meclib.Lists.fusenList.at(i);Meclib.Property.domainId===t.get("url")&&t.destroy()}$(".fusen-obj").remove(),$(".sp-fusen-obj").remove(),ViewerApp.mediator.trigger("fusen:renderFusenList")},showDeleteDialog:function(e){1!==Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("contents:hideAll"),new Messi(Meclib.Message.fusen.confirm.removeItem,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.yes,val:1},{id:1,label:Meclib.Message.common.no,val:2}],callback:function(i){1!==Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("contents:showAll"),"1"===i&&(ViewerApp.mediator.trigger("fusen:removeFusenOne",e),setTimeout((function(){ViewerApp.mediator.trigger("fusen:renderFusenList")}),1e3))}})},enableFusenAddButton:function(e){if(0===Meclib.Globals.viewer.get("options").fusen)return $("#btn-fusen").addClass("disabled"),$("#btn-fusen").css("cursor","default"),void $("#sp-btn-fusen").addClass("disabled");setTimeout((function(){!1===e?($("#btn-fusen").addClass("disabled"),$("#btn-fusen").css("cursor","default"),$("#sp-btn-fusen").addClass("disabled")):($("#btn-fusen").removeClass("disabled"),$("#btn-fusen").css("cursor",""),$("#sp-btn-fusen").removeClass("disabled"))}),10)},updateOption:function(){Meclib.zoomScale>1||Meclib.Globals.viewer.get("scale")>1||0===Meclib.Globals.viewer.get("options").fusen?ViewerApp.mediator.trigger("fusen:enableFusenAddButton",!1):ViewerApp.mediator.trigger("fusen:enableFusenAddButton",!0)},disabledFusenMenu:function(e){"fusen"==Meclib.Globals.viewer.get("mode")&&(ViewerApp.mediator.trigger("fusen:close"),3===Meclib.Globals.viewer.get("device")&&setTimeout((function(){$("#footer").show(),$("#footer-sub-box").show()}),400)),1===e||Meclib.zoomScale>1||Meclib.Globals.viewer.get("scale")>1||0===Meclib.Globals.viewer.get("options").fusen?ViewerApp.mediator.trigger("fusen:enableFusenAddButton",!1):ViewerApp.mediator.trigger("fusen:enableFusenAddButton",!0)}}),ViewerApp.Views.LinkView=Backbone.View.extend({initialize:function(e){_.bindAll(this,"draw"),ViewerApp.mediator.on("book:ready",this.ready),ViewerApp.mediator.on("main:onMovedPage",this.pageLoad),ViewerApp.mediator.on("link:load",this.load),ViewerApp.mediator.on("link:draw",this.draw),ViewerApp.mediator.on("link:drawLink",this.drawLink),ViewerApp.mediator.on("link:clear",this.clear),ViewerApp.mediator.on("link:sendLink",this.sendLink),ViewerApp.mediator.on("link:renderLinkTip",this.renderLinkTip),ViewerApp.mediator.on("link:show",this.show),ViewerApp.mediator.on("link:hide",this.hide),2===Meclib.Globals.viewer.get("device")||3===Meclib.Globals.viewer.get("device")?Meclib.Link.icon_dir="./common/img/parts/link_icons-sd/":Meclib.Link.icon_dir="./common/img/parts/link_icons/";var i=Meclib.Globals.viewer.get("dataPath")+"data/link/info.txt"+Meclib.Cache.fileCache;$.ajax({type:"GET",scriptCharset:"utf-8",cache:!1,url:i}).done((function(e){var i=[];try{i=$.parseJSON(e),Meclib.Link.count=i.count,Meclib.Link.count>0&&(Meclib.Globals.viewer.get("optionIncludes").link=1)}catch(e){return}})).fail((function(e,i,t){}))},ready:function(){if("MAINTE"!==Meclib.Setting.type){for(var e=0;e"),n={};if(0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage)if(e.get("page_no")===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getLeftPage())n.left=Meclib.Function.getCssVal("#canvas-leftpage").left+e.get("x")*o;else{if(e.get("page_no")!==Meclib.Globals.book.getRightPage()||0===Meclib.Globals.book.getRightPage())return!0;n.left=Meclib.Function.getCssVal("#canvas-rightpage").left+e.get("x")*o}else{if(e.get("page_no")!==Meclib.Globals.book.currentPage)return!0;n.left=Meclib.Function.getCssVal("#canvas-leftpage").left+e.get("x")*o}n.width=e.get("width")*o,n.height=e.get("height")*o,n.top=e.get("y")*o+Meclib.Function.getCssVal("#canvas-leftpage").top,n.id="link"+e.get("id");var c="";try{c=t["link_color"+e.get("link_color")]}catch(e){c={default_color:"#cccccc",default_alpha:.8,over_color:"#ffffaa",over_alpha:.4}}if(c.start_alpha=c.default_alpha,"0"==c.default_alpha&&(c.start_alpha=.1),$(s).css({opacity:""}),0===$("#"+n.id).length){$(i).addClass("link-obj").attr({id:n.id,"data-id":e.get("id")});var s=$("

");if($(s).css({width:"100%",height:"100%","background-color":"rgba("+Meclib.Function.hex2Rgb(c.default_color)+","+c.start_alpha+")"}),$(s).addClass("link-bg"),"0"==c.default_alpha&&$(s).addClass("link-zero-alpha"),$(i).append(s),""!==e.get("icon")&&n.height){var r=$("");r.attr({src:Meclib.Link.icon_dir+e.get("icon")+"?"+Meclib.Design.get("skin_no"),width:Meclib.Link.icon_size.width,height:Meclib.Link.icon_size.height}).css({top:Meclib.Link.icon_pos.top+"px",left:Meclib.Link.icon_pos.left+"px"}),$(r).addClass("link-icon"),$(i).append(r)}}else $(i).find(".link-bg").each((function(){$(this).css({opacity:""})})),$(i).find(".link-icon").each((function(){$(this).css({top:Meclib.Link.icon_pos.top+"px",left:Meclib.Link.icon_pos.left+"px"})}));$(i).css({width:n.width+"px",height:n.height+"px",left:n.left+"px",top:n.top+"px",cursor:"pointer"});var g={id:e.get("id"),page:e.get("page_no"),url:e.get("url"),tel:e.get("tel")},b="#"+n.id;!0===a.touch&&$(i).on("touchstart",(function(e){Meclib.TouchManager.start($(this).attr("data-id"),e)})).on("touchmove",(function(e){Meclib.TouchManager.move($(this).attr("data-id"),e)})).on("touchend",(function(e){if(!1!==Meclib.TouchManager.end($(this).attr("data-id"),e))return e.preventDefault(),ViewerApp.mediator.trigger("link:sendLink",g),!1})),!0===a.mouse&&3!==Meclib.Event.type?$(i).mouseover({link:g},(function(e){$(this).find(".link-bg").each((function(){$(this).stop().css({"background-color":"rgba("+Meclib.Function.hex2Rgb(c.over_color)+","+c.over_alpha+")",opacity:""})})),$(".link-icon").css({opacity:""})})).mouseout((function(){$(this).find(".link-bg").each((function(){$(this).css({"background-color":"rgba("+Meclib.Function.hex2Rgb(c.default_color)+","+c.default_alpha+")",opacity:""})})),$(".link-icon").css({opacity:""}),$("#link-tip").hide()})).mousemove({link:g},(function(e){})).on({click:function(e){return e.preventDefault(),ViewerApp.mediator.trigger("link:sendLink",g),!1}}):!0===a.pointer&&Meclib.ClickManager.add(document,b,(function(e,i){return i.stopPropagation(),setTimeout((function(){$(s).css({opacity:""}),$(r).css({opacity:""})}),500),ViewerApp.mediator.trigger("link:sendLink",g),!1})),$(l).append(i)}))}}},draw:function(){if("MAINTE"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("options").link){var e=!0;arguments.length>0&&!1===arguments[0]&&(e=!1),$("#linkdraw-layer").remove();var i=$("
");$(i).attr({id:"linkdraw-layer"}).addClass("linkdraw-layer").css({width:"100%",height:"100%",position:"absolute","z-index":Meclib.LayerZindex.link,"pointer-events":"none"}).hide(),$("#page-area").append(i);var t=Meclib.Globals.book.getLeftPage(),o=Meclib.Globals.book.getRightPage();0!==t&&ViewerApp.mediator.trigger("link:drawLink",t),0!==o&&ViewerApp.mediator.trigger("link:drawLink",o),setTimeout((function(){$(i).show(),$(".link-obj").css({"pointer-events":"visible"})}),250),""===Meclib.TextSearch.keyword&&e&&setTimeout((function(){Meclib.Function.elementBlink(i,3,!1,(function(){Meclib.Link.blinkObj="",setTimeout((function(){$(".link-zero-alpha").animate({opacity:0},500)}),300)}))}),500)}},sendLink:function(e){var i,t,o=Meclib.Lists.linkList[e.page-1].get({id:e.id}),a=o.get("option"),l=o.get("url"),n="",c="",s="",r="",g=o.get("page_no");if("undefined"!==o.get("label")&&""!==o.get("label")&&(n=o.get("label")),1===o.get("type")?(c="url",r=l):2===o.get("type")?(c="page_move",a=1,r=l):3===o.get("type")?(c="tel",l="tel:"+l,1===Meclib.Globals.viewer.get("device")&&(l=""),r=l,a=1):4===o.get("type")?(c="email",r=l="mailto:"+l,a=1):5===o.get("type")?(c="upload_file",r=l,l="./"+Meclib.Link.up_dir+"/"+l):(c="url",r=l),i=r,t=s=""!==n?n:r,Meclib.analytics.sendV4Link(s,g,c,i,n),Meclib.analytics.sendContents("ext_link",r),Meclib.UserAnalytics.add("ext_link","",t),Meclib.API.onLink(o.get("type"),o.get("url"),e.page),""!==l)if(ViewerApp.mediator.trigger("canvas:cancelOverAnimation"),ViewerApp.mediator.trigger("contents:showAll"),2===a){if("MAINTE"===Meclib.Setting.type)return void Meclib.Function.postParent("linkStop");if(1===o.get("type")||5===o.get("type")){var b=o.get("popup_size"),p=0;return 2!==Meclib.Globals.viewer.get("device")&&3!==Meclib.Globals.viewer.get("device")||(p=1),$("#"+e.id).popup(l,b.width,b.width_unit,b.height,b.height_unit,p),!1}}else if(1===a)if(2===o.get("type"))ViewerApp.mediator.trigger("main:movePage",l);else{if("MAINTE"===Meclib.Setting.type)return void Meclib.Function.postParent("linkStop");location.href=l}else window.open(l,"link"+o.get("id").replaceAll("-",""))},renderLinkTip:function(e){var i="";""!==e.page&&(i="PAGE:"+e.page),""!==e.url?i="URL:"+e.url:""!==e.tel&&(i="");var t=Meclib.Function.getCssVal("#"+e.id);""!==i&&$("#link-tip").css({left:t.left+t.width+5,top:e.pageY}).text(i).show()},show:function(){0!==Meclib.Globals.viewer.get("options").link&&(Meclib.Mode.txtcopy||($(".link-obj").show(),$(".link-icon").show(),$("#linkdraw-layer").show()))},hide:function(){$(".link-obj").hide(),$(".link-icon").hide(),$("#linkdraw-layer").hide()},clear:function(){Meclib.Contents.blink=!1,$(".link-obj").length&&$(".link-obj").remove()}}),ViewerApp.Views.BookIndexView=Backbone.View.extend({initialize:function(e){if(_.bindAll(this,"drawList","addListsEvent","getChildItems"),ViewerApp.mediator.on("bookindex:drawList",this.drawList),ViewerApp.mediator.on("bookindex:resize",this.resize),ViewerApp.mediator.on("bookindex:addListsEvent",this.addListsEvent),ViewerApp.mediator.on("bookindex:sendLink",this.sendLink),ViewerApp.mediator.on("bookindex:close",this.close),"MAINTE"!==Meclib.Setting.type)switch(Meclib.Lists.bookIndexList.fetch({cache:!1,dataType:"json",success:function(e,i,t){if(null!==i){var o=i.length;o>0&&(Meclib.Globals.viewer.get("optionIncludes").bookindex=1);for(var a=0;a1&&" "===o.text.substring(0,1)&&(o.color="",o.text=o.text.substr(1)),o.page=t.get("page"),o.mark="noicon",o.child="",o.space=o.level;var a="",l={};if(Meclib.Lists.bookIndexList.where({parent_id:o.id,level:o.level+1}).length>0){o.mark="icon";var n={id:o.id,level:o.level+1};a=this.getChildItems(n),l.items=a,o.child=_.template(Meclib.Cache.Tpl.bookindexSubList)(l)}else o.mark="noicon",o.child="";$("#menu-index").append(_.template(Meclib.Cache.Tpl.bookindexList)(o))}Meclib.Bookindex.defaultExpand&&($("#menu-index").find("ul").each((function(){$(this).show()})),$("#menu-index").find('.index-mark-icon[data-type="icon"]').each((function(){$(this).addClass("index-mark-icon-down")}))),setTimeout((function(){$("#menu-index").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:100,scrollInertia:200,scrollButtons:{enable:!1},advanced:{updateOnContentResize:!1},callbacks:{onCreate:function(){ViewerApp.mediator.trigger("bookindex:addListsEvent")}}})}),1e3);var c=0;1===Meclib.Globals.viewer.get("device")?$("#menu-index a.index-row").each((function(){c=$(this).find(".index-item").innerHeight(),$(this).find(".index-color-item").css({height:c+1})})):$("#menu-index li.sd-index-row-top a").each((function(){c=$(this).find(".sd-index-item").innerHeight(),$(this).find(".sd-index-color-item").css({height:c+1})})),Meclib.Bookindex.count=!0}ViewerApp.mediator.trigger("menu:closeLoading")},getChildItems:function(e){for(var i=Meclib.Lists.bookIndexList.where({parent_id:e.id,level:e.level}),t="",o=0;o1&&" "===l.text.substring(0,1)&&(l.color="",l.text=l.text.substr(1)),"*"===a.get("link_page_no")?l.enabled=!1:l.enabled=!0,l.mark="noicon",l.child="",l.page=a.get("page"),l.space=e.level,Meclib.Lists.bookIndexList.where({parent_id:l.id,level:e.level+1}).length>0){l.mark="icon";var n={},c={id:l.id,level:e.level+1};Meclib.Bookindex.maxChild>e.level&&(n.items=this.getChildItems(c)),l.child=_.template(Meclib.Cache.Tpl.bookindexSubList)(n)}else l.mark="noicon",l.child="";t+=_.template(Meclib.Cache.Tpl.bookindexItem)(l)}return t},addListsEvent:function(){var e=document;Meclib.ClickManager.add(e,".ev-index-item",(function(e,i){i.stopPropagation();var t=$(e).attr("data-id");3===Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("menu:close"),ViewerApp.mediator.trigger("bookindex:sendLink",t)}),!0),Meclib.ClickManager.add(e,".ev-index-mark-icon",(function(e,i){i.stopPropagation();var t=null;t="icon"===$(e).attr("data-type")?$(e):$(e).next();var o=$(e).closest("li").children("ul");$(o).find(".index-color-item").hide(),$(e).closest("li").children("ul").slideToggle("fast",(function(){$(this).closest("li").children("ul").is(":hidden")?1===Meclib.Globals.viewer.get("device")?(t.removeClass("index-mark-icon-down"),t.addClass("index-mark-icon")):(t.removeClass("sd-index-mark-icon-down"),t.addClass("sd-index-mark-icon")):1===Meclib.Globals.viewer.get("device")?(t.removeClass("index-mark-icon"),t.addClass("index-mark-icon-down"),$(this).children("li").each((function(){var e=$(this).children("a.index-row").children(".index-item").innerHeight();$(this).children("a.index-row").children(".index-color-item").css({height:e+1})}))):(t.removeClass("sd-index-mark-icon"),t.addClass("sd-index-mark-icon-down"),$(this).children("li").each((function(){var e=$(this).children("a").children(".sd-index-item").innerHeight();$(this).children("a").children(".sd-index-color-item").css({height:e+1})}))),$(o).find(".index-color-item").show(),$("#menu-index").mCustomScrollbar("update")}))}),!0)},sendLink:function(e){var i=Meclib.Lists.bookIndexList.get({id:e}),t=i.get("option");Meclib.analytics.sendV4BookIndex(i.get("name")),Meclib.analytics.sendContents("bookindex",i.get("name")),Meclib.UserAnalytics.add("bookindex","",i.get("name"));var o="",a="";""!==i.get("link_page_no")?(o="page_move",a=i.get("link_page_no")):""!==i.get("link_url")?(o="url",a=i.get("link_url")):""!==i.get("tel")&&(o="tel",a="tel:"+i.get("tel")),Meclib.API.onBookIndex(i.get("name"),o,a),"page_move"===o?"*"!==a&&ViewerApp.mediator.trigger("main:movePage",a):"url"===o?-1!==a.indexOf("mailto:")||1===t&&"MAINTE"!==Meclib.Setting.type?location.href=a:window.open(a,"bookindex"+i.get("id")):"tel"===o&&3===Meclib.Globals.viewer.get("device")&&(location.href=a)},close:function(){$("#btn-back-menu").removeClass("ev-sp-parentback"),Meclib.Mode.bookindex=!1,$("#menu-index").hide()}}),ViewerApp.Views.BookLinkView=Backbone.View.extend({el:$("#menu-booklink"),initialize:function(e){if(ViewerApp.mediator.on("booklink:addListsEvent",this.addListsEvent),ViewerApp.mediator.on("booklink:close",this.close),ViewerApp.mediator.on("booklink:drawList",this.drawList),ViewerApp.mediator.on("booklink:addListEvent",this.addListEvent),ViewerApp.mediator.on("booklink:openLink",this.openLink),ViewerApp.mediator.on("menu:resize",this.resize),"MAINTE"!==Meclib.Setting.type)switch(Meclib.Lists.bookLinkList.fetch({cache:!1,dataType:"json",success:function(e,i,t){var o=i.length;o>0&&(Meclib.Globals.viewer.get("optionIncludes").booklink=1);for(var a=0;a",{href:i.url})[0],o="";""!==t.port&&(o=":"+t.port);var a="";a=0!==t.pathname.indexOf("/")?"/"+t.pathname:t.pathname,i.url=t.protocol+"//"+t.hostname+o+a,i.thumbImage="";var l=[],n="";if(i.url.indexOf(".html")>-1||i.url.indexOf(".php")>-1){l=i.url.split("/"),n="";for(var c=0;c0&&(Meclib.Globals.viewer.get("optionIncludes").externalapi=1);for(var a=0;a1)){$("#externalapi").html("");var e="";Meclib.Lists.externalApiList.each((function(i){e+="
  • "+i.get("tag_text")+"
  • "})),$("#externalapi").html(e)}},drawNaviList:function(){if(!($("#externalapi-items").find("li").length>0)){var e="";Meclib.Lists.externalApiList.each((function(i){e+="
  • "+i.get("tag_text")+"
  • "})),$("#externalapi-items").html(e)}}}),ViewerApp.Views.NewsView=Backbone.View.extend({initialize:function(e){if(ViewerApp.mediator.on("news:clear",this.clear),ViewerApp.mediator.on("news:render",this.showNews),ViewerApp.mediator.on("news:addItemEvent",this.addItemEvent),ViewerApp.mediator.on("news:showDialog",this.showDialog),ViewerApp.mediator.on("news:updateCloseFlag",this.updateCloseFlag),ViewerApp.mediator.on("news:closeDialog",this.closeDialog),ViewerApp.mediator.on("news:show",this.show),ViewerApp.mediator.on("news:hide",this.hide),"MAINTE"!==Meclib.Setting.type){switch(Meclib.Cache.Tpl.news="",Meclib.Globals.viewer.get("device")){case 1:case 2:case 3:Meclib.Cache.Tpl.news=$("#news-template").html()}Meclib.Lists.newsList.fetch({cache:!1,dataType:"json",success:function(e,i,t){if(null!==i){var o=i.length;o>0&&(Meclib.Globals.viewer.get("optionIncludes").news=1);for(var a=0;a0&&(Meclib.Globals.viewer.get("optionIncludes").movie=1);for(var a=0;a=0||Meclib.Globals.ua.search("iPad")>=0||Meclib.Function.isIOSDesctopMode())&&(t.autoplay=""),0===$("#"+t.movieObjId).length){$("#contents-mask").append(_.template(Meclib.Cache.Tpl.video)(t));var l=document.getElementById(t.movieId);l.addEventListener("webkitbeginfullscreen",(function(){Meclib.Fullscreen.videoMax=!0}),!1),l.addEventListener("webkitendfullscreen",(function(){setTimeout((function(){Meclib.Fullscreen.videoMax=!1}),3e3)}),!1),l.addEventListener("MSbeginfullscreen",(function(){Meclib.Fullscreen.videoMax=!0}),!1),l.addEventListener("MSendfullscreen",(function(){Meclib.Fullscreen.videoMax=!1}),!1)}$("#"+t.movieObjId).css({top:t.top+"px",left:t.left+"px"}),$("#"+t.movieId).css({width:t.width+"px",height:t.height+"px"}),!0===Meclib.Function.getDeviceEventLists().touch&&$("video").on("touchmove",(function(e){e.stopPropagation()}))}else{if(2!==i.get("type"))return!0;""!==t.controls&&t.width<300&&(t.width=300),0===$("#"+t.movieObjId).length&&$("#contents-mask").append(_.template(Meclib.Cache.Tpl.audio)(t)),$("#"+t.movieObjId).css({top:t.top+"px",left:t.left+"px"}),$("#"+t.movieId).css({width:t.width+"px",height:""}),!0===Meclib.Function.getDeviceEventLists().touch&&$("audio").on("touchmove",(function(e){e.stopPropagation()}))}}))}},show:function(){1!=Meclib.Mode.txtcopy&&$(".movie-obj").show()},hide:function(){$(".movie-obj").hide()},clear:function(){$(".movie-obj").remove()}}),ViewerApp.Views.EmbedView=Backbone.View.extend({eventFlg:!1,initialize:function(e){_.bindAll(this,"draw","addEvent"),ViewerApp.mediator.on("embed:clear",this.clear),ViewerApp.mediator.on("embed:draw",this.draw),ViewerApp.mediator.on("embed:sendLink",this.sendLink),ViewerApp.mediator.on("embed:show",this.show),ViewerApp.mediator.on("embed:hide",this.hide),"MAINTE"!==Meclib.Setting.type&&(Meclib.Lists.embedList.fetch({cache:!1,dataType:"json",success:function(e,i,t){if(null!==i){var o=i.length;o>0&&(Meclib.Globals.viewer.get("optionIncludes").embed=1);for(var a=0;a").css({width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px"}).addClass("embed-obj").attr({id:t.embedId,"data-id":t.id,src:Meclib.Globals.viewer.get("dataPath")+Meclib.Embed.up_dir+"/"+i.get("file_name")}).show();$("#contents-mask").append(o),$(o).bind("load",(function(e){}))}else $("#"+t.embedId).css({width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px"});(void 0!==i.get("link_page_no")&&""!==i.get("link_page_no")||void 0!==i.get("link_url")&&""!==i.get("link_url"))&&$("#"+t.embedId).addClass("embed-link-obj"),1!==Meclib.Globals.viewer.get("device")&&void 0!==i.get("tel")&&""!==i.get("tel")&&$("#"+t.embedId).addClass("embed-link-obj")}else{if(2!==i.get("type"))return!0;if(""===i.get("name")||""===i.get("file_name"))return!0;t.src=Meclib.Globals.viewer.get("dataPath")+Meclib.Embed.up_dir+"/"+i.get("name")+"/"+i.get("file_name"),0===$("#"+t.embedId).length&&$("#contents-mask").append(_.template(Meclib.Cache.Tpl.embed)(t)),$("#"+t.embedId).css({width:t.width+"px",height:t.height+"px"}),$("#"+t.embedObjId).css({width:t.width+"px",height:t.height+5+"px",top:t.top+"px",left:t.left+"px"})}})),this.addEvent()}},addEvent:function(){var e=document;Meclib.ClickManager.add(e,".embed-link-obj",(function(e){var i=$(e).attr("data-id");ViewerApp.mediator.trigger("embed:sendLink",i)}))},sendLink:function(e){var i=Meclib.Lists.embedList.get({id:e}),t=i.get("option");if(""!==i.get("link_page_no"))ViewerApp.mediator.trigger("main:movePage",i.get("link_page_no"));else if(""!==i.get("link_url")){var o=i.get("link_url");-1!==o.indexOf("mailto:")||1===t&&"MAINTE"!==Meclib.Setting.type?location.href=o:window.open(o,"embed"+i.get("id").replaceAll("-",""))}else""!==i.get("tel")&&Meclib.Globals.viewer.get("device")>1&&(location.href="tel:"+i.get("tel"))},show:function(){1!=Meclib.Mode.txtcopy&&$(".embed-obj").show()},hide:function(){$(".embed-obj").hide()},clear:function(){$(".embed-obj").remove()}}),ViewerApp.Views.ContentsView=Backbone.View.extend({el:null,initialize:function(e){_.bindAll(this,"showContents"),ViewerApp.mediator.on("contents:showContents",this.showContents),ViewerApp.mediator.on("contents:clear",this.clear),ViewerApp.mediator.on("contents:clearTimer",this.clearTimer),ViewerApp.mediator.on("contents:hideAll",this.hideAll),ViewerApp.mediator.on("contents:showAll",this.showAll),ViewerApp.mediator.on("contents:onZoomDragStart",this.onZoomDragStart),ViewerApp.mediator.on("contents:onZoomDragEnd",this.onZoomDragEnd),ViewerApp.mediator.on("contents:changeCropMode",this.changeCropMode),ViewerApp.mediator.on("contents:changeTxtcopyMode",this.changeTxtcopyMode),ViewerApp.mediator.on("contents:overrideCropMode",this.overrideCropMode),ViewerApp.mediator.on("contents:endEditMode",this.endEditMode)},clearTimer:function(){window.clearInterval(Meclib.Timer.link),window.clearInterval(Meclib.Timer.fusen),window.clearInterval(Meclib.Timer.movie),window.clearInterval(Meclib.Timer.embed),window.clearInterval(Meclib.Timer.comment)},showContents:function(){this.clearTimer(),"MAINTE"===Meclib.Setting.type&&0===Meclib.Setting.configType&&Meclib.Function.postParent("showContents"),"MAINTE"!==Meclib.Setting.type&&!0!==Meclib.Function.isPageZooming()&&!0!==Meclib.Mode.txtcopy&&(("MAINTE"===Meclib.Setting.type&&1===Meclib.Setting.configType&&"link"===Meclib.Setting.configName||"MAINTE"!==Meclib.Setting.type)&&(ViewerApp.mediator.trigger("link:draw"),Meclib.Function.postParent("showContents")),("MAINTE"===Meclib.Setting.type&&1===Meclib.Setting.configType&&"news"===Meclib.Setting.configName||"MAINTE"!==Meclib.Setting.type)&&(ViewerApp.mediator.trigger("news:render"),Meclib.Function.postParent("showContents")),"MAINTE"!==Meclib.Setting.type&&(ViewerApp.mediator.trigger("fusen:draw"),Meclib.Function.postParent("showContents")),"MAINTE"!==Meclib.Setting.type&&ViewerApp.mediator.trigger("comment:draw"),("MAINTE"===Meclib.Setting.type&&1===Meclib.Setting.configType&&"movie"===Meclib.Setting.configName||"MAINTE"!==Meclib.Setting.type)&&(ViewerApp.mediator.trigger("movie:draw"),Meclib.Function.postParent("showContents")),("MAINTE"===Meclib.Setting.type&&1===Meclib.Setting.configType&&"embed"===Meclib.Setting.configName||"MAINTE"!==Meclib.Setting.type)&&(ViewerApp.mediator.trigger("embed:draw"),Meclib.Function.postParent("showContents")),"MAINTE"!==Meclib.Setting.type&&ViewerApp.mediator.trigger("highlight:draw"),"MAINTE"!==Meclib.Setting.type&&ViewerApp.mediator.trigger("memo:draw"),this.showAll())},update:function(){},hide:function(){},clear:function(){ViewerApp.mediator.trigger("link:clear"),ViewerApp.mediator.trigger("news:clear"),ViewerApp.mediator.trigger("fusen:clear"),ViewerApp.mediator.trigger("movie:clear"),ViewerApp.mediator.trigger("highlight:clear"),ViewerApp.mediator.trigger("embed:clear"),ViewerApp.mediator.trigger("comment:clear")},changeCropMode:function(e){!0===e?setTimeout((function(){ViewerApp.mediator.trigger("contents:hideAll")}),100):ViewerApp.mediator.trigger("contents:showAll")},changeTxtcopyMode:function(e){!0===e?setTimeout((function(){ViewerApp.mediator.trigger("contents:clearTimer"),ViewerApp.mediator.trigger("movie:hide"),ViewerApp.mediator.trigger("embed:hide"),ViewerApp.mediator.trigger("news:hide"),ViewerApp.mediator.trigger("fusen:hide"),ViewerApp.mediator.trigger("highlight:hide"),ViewerApp.mediator.trigger("link:hide"),ViewerApp.mediator.trigger("comment:hide"),ViewerApp.mediator.trigger("memo:hide")}),100):(ViewerApp.mediator.trigger("movie:draw"),ViewerApp.mediator.trigger("embed:draw"),ViewerApp.mediator.trigger("news:render"),ViewerApp.mediator.trigger("fusen:draw"),ViewerApp.mediator.trigger("highlight:draw"),ViewerApp.mediator.trigger("link:draw",!1),ViewerApp.mediator.trigger("comment:draw"),ViewerApp.mediator.trigger("memo:draw"))},onZoomDragStart:function(){ViewerApp.mediator.trigger("memo:hide"),ViewerApp.mediator.trigger("txtcopy:hide")},onZoomDragEnd:function(){ViewerApp.mediator.trigger("memo:fixPos"),Meclib.Txtcopy.action.fixLayer()},hideAll:function(){ViewerApp.mediator.trigger("contents:clearTimer"),ViewerApp.mediator.trigger("movie:hide"),ViewerApp.mediator.trigger("embed:hide"),ViewerApp.mediator.trigger("news:hide"),ViewerApp.mediator.trigger("fusen:hide"),ViewerApp.mediator.trigger("highlight:hide"),ViewerApp.mediator.trigger("link:hide"),ViewerApp.mediator.trigger("comment:hide"),ViewerApp.mediator.trigger("txtcopy:hide"),ViewerApp.mediator.trigger("memo:hide")},showAll:function(){ViewerApp.mediator.trigger("movie:show"),ViewerApp.mediator.trigger("embed:show"),ViewerApp.mediator.trigger("news:show"),ViewerApp.mediator.trigger("fusen:show"),ViewerApp.mediator.trigger("highlight:show"),ViewerApp.mediator.trigger("link:show"),ViewerApp.mediator.trigger("comment:show"),ViewerApp.mediator.trigger("txtcopy:show"),$("#memo-layer").hasClass("hidden-memo")||ViewerApp.mediator.trigger("memo:show")},overrideCropMode:function(){$(".link-icon").hide();setTimeout((function(){$("#linkdraw-layer").hide(),$(".link-obj").hide()}),500)},endEditMode:function(){ViewerApp.mediator.trigger("crop:endCropMode"),ViewerApp.mediator.trigger("comment:endAreaSelectMode",!1)}}),ViewerApp.Views.TextSearchView=Backbone.View.extend({initialize:function(e){_.bindAll(this,"list"),ViewerApp.mediator.on("textsearch:resize",this.resize),ViewerApp.mediator.on("textsearch:load",this.load),ViewerApp.mediator.on("textsearch:search",this.search),ViewerApp.mediator.on("textsearch:list",this.list),ViewerApp.mediator.on("textsearch:list_page",this.list_page),ViewerApp.mediator.on("textsearch:clearFocus",this.clearFocus),ViewerApp.mediator.on("textsearch:clear",this.clear),ViewerApp.mediator.on("textsearch:onMenuSearch",this.onMenuSearch),ViewerApp.mediator.on("textsearch:onSelectList",this.onSelectList),ViewerApp.mediator.on("textsearch:addListsEvent",this.addListsEvent),ViewerApp.mediator.on("common:loadTemplates",this.loadTemplates)},loadTemplates:function(){switch($("#txtsearch-input").attr("placeholder",Meclib.Message.txtsearch.searchtxtInputPlaceholder),Meclib.Cache.Tpl.textSearch="",Meclib.Cache.Tpl.textSearchResult="",Meclib.Cache.Tpl.textSearchPagezone="",Meclib.Globals.viewer.get("device")){case 1:case 2:Meclib.Cache.Tpl.textSearch=$("#panel-txtsearch-template").html(),Meclib.Cache.Tpl.textSearchResult=$("#txtsearch-result-template").html(),Meclib.Cache.Tpl.textSearchPagezone=$("#txtsearch-result-pagezone-template").html();break;case 3:Meclib.Cache.Tpl.textSearch=$("#sp-panel-txtsearch-template").html(),Meclib.Cache.Tpl.textSearchResult=$("#sp-txtsearch-result-template").html(),Meclib.Cache.Tpl.textSearchPagezone=$("#sp-txtsearch-result-pagezone-template").html()}$(document).off("submit","#menu-txtsearch-form"),$(document).on("submit","#menu-txtsearch-form",(function(e){return ViewerApp.mediator.trigger("textsearch:onMenuSearch"),!1})),$(document).off("submit","#txtsearch-form"),$(document).on("submit","#txtsearch-form",(function(e){return 1===Meclib.Globals.book.book_db?(Meclib.Products.search.mode="search",Meclib.Products.search.form="#txtsearch-input",ViewerApp.mediator.trigger("products:openPageProductsPanel")):ViewerApp.mediator.trigger("textsearch:search",1),!1})),$(document).off("submit","#sp-menu-txtsearch-form"),$(document).on("submit","#sp-menu-txtsearch-form",(function(e){return ViewerApp.mediator.trigger("textsearch:onMenuSearch"),!1})),ViewerApp.mediator.trigger("textsearch:load")},resize:function(){var e=Meclib.Function.getWinsize().height,i=0;switch(Meclib.Globals.viewer.get("device")){case 1:case 2:i=e-(Meclib.Size.headerHeight+Meclib.Size.footerHeight+Meclib.Size.sidemenuHeaderHeight);break;case 3:i=e-Meclib.Size.headerHeight-Meclib.Size.sidemenuHeaderHeight}$("#menu-txtsearch").css("height",i+"px"),$("#sp-menu-txtsearch-form").css({width:$(window).width()-85}),$("#sp-menu-txtsearch-inputbox").css({width:$(window).width()-91})},onMenuSearch:function(){ViewerApp.mediator.trigger("textsearch:search",2),Meclib.Globals.searchScrollMode=!0,setTimeout((function(){Meclib.Globals.searchScrollMode=!1}),1500)},onSelectList:function(e,i){var t=!1;if(2===Meclib.Globals.bookCanvas.canvasNum?e!==Meclib.Globals.book.getLeftPage()&&e!==Meclib.Globals.book.getRightPage()||(t=!0):e===Meclib.Globals.book.currentPage&&(t=!0),!1===t&&ViewerApp.mediator.trigger("main:movePage",e),$(".saerch-selected").each((function(){$(this).removeClass("saerch-selected")})),null!=document.getElementById("saerch-selected-val")?$("#saerch-selected-val").attr("data-val",e+"-"+i):$("#page-area").append("
    "),ViewerApp.mediator.trigger("highlight:focusSelectedItem"),!0===t){var o=".highlight-obj.hit-box-"+$("#saerch-selected-val").attr("data-val");Meclib.Function.alphaElementBlink($(o),5,!1,(function(){}))}},load:function(){if("MAINTE"!==Meclib.Setting.type&&1===Meclib.Globals.viewer.get("enabedOptions").txtsearch&&1!==Meclib.Globals.book.book_db){var e=Meclib.Globals.viewer.get("dataPath")+"data/txtsearch.txt";$.ajax({type:"GET",scriptCharset:"utf-8",url:e}).done((function(e){Meclib.Globals.searchTextList=e.split("\n"),$("#btn-txtsearch-icon").removeClass("disabled"),Meclib.Globals.viewer.get("optionIncludes").txtsearch=1,""!==Meclib.defaults.keyword&&ViewerApp.mediator.trigger("textsearch:search",0)})).fail((function(e){ViewerApp.mediator.trigger("menu:hideMenuButon","txtsearch")}))}},search:function(e){if(!$("#sidemenu").is(":animated")||!1!==$("#sd-sidemenu-navi").is(":animated")||0===e){ViewerApp.mediator.trigger("highlight:clear"),$("#saerch-selected-val").attr("data-val","");var i="",t="",o=0,a=[];Meclib.TextSearch.keyword="",Meclib.TextSearch.keywords=[];var l=1;"txtSearch"!==Meclib.Globals.viewer.get("menu")&&"txtSearchList"!==Meclib.Globals.viewer.get("menu")&&(l=300,ViewerApp.mediator.trigger("menu:close")),ViewerApp.mediator.trigger("menu:showLoading"),Meclib.MainMenu.forceOpen=!0,setTimeout((function(){Meclib.MainMenu.forceOpen=!1}),1e3),!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping||($(".btn-autoflip-right").removeClass("on"),$(".btn-autoflip-left").removeClass("on"),$("#btn-autoflip").removeClass("on"),Meclib.Globals.viewer.set({autoFlipMode:""}),ViewerApp.mediator.trigger("autoflip:close")),Meclib.Mode.txtcopy&&ViewerApp.mediator.trigger("txtcopy:end"),Meclib.Mode.memo&&ViewerApp.mediator.trigger("memo:close"),0===e?(i=Meclib.defaults.keyword,setTimeout((function(){ViewerApp.mediator.trigger("menu:open","txtSearchList")}),l)):1===e?(i=$("#txtsearch-input").val(),$("#txtsearch-input").blur(),setTimeout((function(){ViewerApp.mediator.trigger("menu:open","txtSearchList")}),l)):2===e&&(3===Meclib.Globals.viewer.get("device")?(i=$("#sp-menu-txtsearch-input").val(),$("#sp-menu-txtsearch-input").blur()):(i=$("#menu-txtsearch-input").val(),$("#menu-txtsearch-input").blur())),t=i,i=(i=i.replaceAll("\u3000"," ")).trim(),i=Meclib.Function.convertKanaToFull(i),t=Meclib.Function.convertKanaToFull(t),i=Meclib.Function.convertHalfNum(i);var n=(t=Meclib.Function.convertHalfNum(t)).replaceAll("\u3000"," ").trim();n=n.replace(/ OR /gi," ").trim(),Meclib.TextSearch.keywords=n.split(" "),Meclib.TextSearch.keywords=$.grep(Meclib.TextSearch.keywords,(function(e){return""!==e})),Meclib.TextSearch.inputKeyword=t;var c=i.toUpperCase().indexOf(" OR "),s=i.indexOf(" ");o=c>-1&&s>-1||c>-1&&-1===s?1:0,i=i.replace(/ OR /gi," ").trim(),i=Meclib.Function.upperCase(i),Meclib.TextSearch.keyword=i,a=i.split(" ");var r=(a=$.grep(a,(function(e){return""!==e}))).length;if(0===r||""===a[0])return ViewerApp.mediator.trigger("menu:closeLoading"),ViewerApp.mediator.trigger("textsearch:clear"),ViewerApp.mediator.trigger("textsearch:list"),$(".messi-box").length?($(".messi-content").html()==Meclib.Message.error.txtsearchInput||$(".messi-content").html(Meclib.Message.error.txtsearchInput),!1):(1!==Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("contents:hideAll"),new Messi(Meclib.Message.error.txtsearchInput,{title:"",animate:!1,width:Meclib.Size.MessiWidth,modal:!0,buttons:[{id:0,label:Meclib.Message.common.ok,val:null}],callback:function(e){1!==Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("contents:showAll")}}),!1);ViewerApp.mediator.trigger("products:sendLog",t),Meclib.Globals.searchResultList=[],Meclib.Globals.searchHitList=[];for(var g=Meclib.Globals.searchTextList.length,b=0;b-1)u++;else if(0===o){u=0;break}if(0!==u){for(var v=0;v-1&&!((m=p.indexOf(a[v],M))<0);){M=m+a[v].length,h++;var f=m-20;f<0&&(f=0);var C=d.slice(f,m),w=d.slice(m,m+a[v].length),I=d.slice(m+a[v].length,m+a[v].length+20);C=C.replace(/\s+/g,""),I=I.replace(/\s+/g,""),w=w.replace(/\s+/g,"");var x={keyword:v,page:b+1,start:m+1,text:Meclib.Function.escapeSearchResultText(C)+''+Meclib.Function.escapeSearchResultText(w)+""+Meclib.Function.escapeSearchResultText(I),len:a[v].length};Meclib.Globals.searchResultList.push(x)}Meclib.Globals.searchHitList[b]=h}}Meclib.TextSearch.mode=o,0===e||1===e?ViewerApp.mediator.trigger("textsearch:list"):2===e&&ViewerApp.mediator.trigger("textsearch:list","update"),$("#menu-txtsearch-input").val(t),$("#txtsearch-input").val(t),Meclib.SearchBehind=!0,setTimeout((function(){Meclib.SearchBehind=!1,ViewerApp.mediator.trigger("highlight:draw")}),3e3)}},list:function(e){var i=!1;arguments.length>0&&"update"===e&&(i=!0),$("#menu-txtsearch").show();var t=Meclib.Globals.searchResultList.length;$("#txtsearch-result-items").length>0&&$("#txtsearch-result-items").mCustomScrollbar("destroy"),$("#txtsearch-result-items").html("");var o={};!1===i&&(o._searchtxtInputPlaceholder=Meclib.Message.txtsearch.searchtxtInputPlaceholder,$("#menu-txtsearch").html(_.template(Meclib.Cache.Tpl.textSearch)(o)));var a=0;a=3===Meclib.Globals.viewer.get("device")?Meclib.Function.getCssVal("#menu-txtsearch").height-$("#sp-menu-txtsearch-box").outerHeight():Meclib.Function.getCssVal("#menu-txtsearch").height-$("#menu-txtsearch-box").outerHeight(),o={};var l=0;Meclib.TextSearch.results=[];for(var n=0;nt;t++){var o=Meclib.TextSearch.results[t];void 0!==o._hitNum&&$(i).append($(_.template(Meclib.Cache.Tpl.textSearchPagezone)(o)).attr("data-no",Meclib.TextSearch.page)),Meclib.TextSearch.keywords.length>1&&(0===t?$(i).append('
  • '+Meclib.TextSearch.keywords[Meclib.TextSearch.results[t].keyword]+"
  • "):Meclib.TextSearch.results[t-1].keyword===Meclib.TextSearch.results[t].keyword&&Meclib.TextSearch.results[t-1].page===Meclib.TextSearch.results[t].page||$(i).append('
  • '+Meclib.TextSearch.keywords[Meclib.TextSearch.results[t].keyword]+"
  • ")),$(i).append($(_.template(Meclib.Cache.Tpl.textSearchResult)(o)).attr("data-no",Meclib.TextSearch.page))}ViewerApp.mediator.trigger("textsearch:addListsEvent")},addListsEvent:function(){Meclib.ClickManager.add(document,".ev-icon-search-box",(function(e,i){ViewerApp.mediator.trigger("textsearch:onMenuSearch")}),!0),Meclib.ClickManager.add(document,".ev-txtsearch-result-item",(function(e,i){i.stopPropagation();var t=parseInt($(e).attr("data-page"),10),o=$("li.ev-txtsearch-result-item[data-page='"+t+"']").index(e);return ViewerApp.mediator.trigger("textsearch:onSelectList",t,o),3===Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("menu:close"),!1}),!0),Meclib.ClickManager.add(document,".ev-btn-clear-txtsearch",(function(e,i){ViewerApp.mediator.trigger("textsearch:clear")}),!0)},clearFocus:function(){3===Meclib.Globals.viewer.get("device")&&$("#sp-menu-txtsearch-input").blur()},clear:function(){Meclib.TextSearch.inputKeyword="",Meclib.TextSearch.keyword="",Meclib.TextSearch.keywords=[],Meclib.TextSearch.mode="",$("#saerch-selected-val").attr("data-val",""),Meclib.Globals.searchResultList=[],ViewerApp.mediator.trigger("highlight:clear"),$("#txtsearch-input").val(""),$("#sp-menu-txtsearch-input").val(""),$("#menu-txtsearch-input").val(""),$("#txtsearch-result-items").mCustomScrollbar("destroy"),$("#txtsearch-result-items").html(""),Meclib.TextSearch.results=[]}}),ViewerApp.Views.HighlightView=Backbone.View.extend({initialize:function(e){_.bindAll(this,"draw","loadPageData"),ViewerApp.mediator.on("highlight:draw",this.draw),ViewerApp.mediator.on("highlight:clear",this.clear),ViewerApp.mediator.on("highlight:load",this.load),ViewerApp.mediator.on("highlight:makeHighligt",this.makeHighligt),ViewerApp.mediator.on("highlight:drawHighlight",this.drawHighlight),ViewerApp.mediator.on("highlight:focusSelectedItem",this.focusSelectedItem),ViewerApp.mediator.on("highlight:show",this.show),ViewerApp.mediator.on("highlight:hide",this.hide),this.load()},load:function(){if("MAINTE"!==Meclib.Setting.type&&(1===Meclib.Globals.viewer.get("enabedOptions").txtsearch||1===Meclib.Globals.viewer.get("enabedOptions").txtcopy)){Meclib.Highlight.info={};var e=Meclib.Globals.viewer.get("dataPath")+"data/highlight.txt";$.ajax({type:"GET",dataType:"json",scriptCharset:"utf-8",url:e}).done((function(e){var i=JSON.stringify(e),t=$.parseJSON(i);Meclib.Highlight.info=t,Meclib.Highlight.info.width?Meclib.Highlight.info.width=parseInt(Meclib.Highlight.info.width,10):Meclib.Highlight.info.width=0,Meclib.Highlight.info.height?Meclib.Highlight.info.height=parseInt(Meclib.Highlight.info.height,10):Meclib.Highlight.info.height=0,Meclib.Highlight.info.tool_ver?Meclib.Highlight.info.tool_ver=parseInt(Meclib.Highlight.info.tool_ver,10):Meclib.Highlight.info.tool_ver=0})).fail((function(e){Meclib.Debug.log("error highlight data",1)}))}},makeHighligt:function(e){var i=0;i=2===Meclib.Globals.bookCanvas.canvasNum?0===e?Meclib.Globals.book.getLeftPage():Meclib.Globals.book.getRightPage():Meclib.Globals.book.currentPage,0===e?Meclib.Lists.highlightList1=new ViewerApp.Collections.HighlightList:Meclib.Lists.highlightList2=new ViewerApp.Collections.HighlightList;for(var t=0,o=Meclib.Globals.highlightData[i-1],a=0;a=t&&l.index+r-1)p++;else if(0===c){p=0;break}if(0!==p)for(var M=0;M-1;)""!==g[M]?(-1!==(n=o.indexOf(g[M],s))&&Meclib.Globals.highlightHitList.push({index:n,size:g[M].length}),s=n+g[M].length):n=-1}},drawHighlight:function(e){if(0!==Meclib.Globals.viewer.get("options").highlight){var i=Meclib.Design.get("highlight"),t=$("#highlight-layer"),o="";if(0===e)o=Meclib.Lists.highlightList1;else{if(1!==e)return;o=Meclib.Lists.highlightList2}var a="";2===Meclib.Globals.bookCanvas.canvasNum?0===e?a=Meclib.Globals.book.getLeftPage():1===e&&(a=Meclib.Globals.book.getRightPage()):a=Meclib.Globals.book.currentPage,a=parseInt(a,10);var l=$("#canvas-leftpage").width()/Meclib.Globals.book.thumbWidth,n=$("#canvas-leftpage").height()/Meclib.Globals.book.thumbHeight,c=Meclib.Globals.book.thumbWidth*l/Meclib.Highlight.info.width,s=Meclib.Globals.book.thumbHeight*n/Meclib.Highlight.info.height;o.each((function(o){if(3!==Meclib.Highlight.info.tool_ver){var l=o.get("height")/o.get("text").length;o.get("width")<=.8*l&&((o.get("width")<=0||o.get("text").length>1)&&o.set({y:o.get("y")+l}),o.set({x:o.get("x")-(l-o.get("width"))/2}),o.set({width:l}))}var n=$("
    "),r={x:o.get("x")*c,y:o.get("y")*s,width:o.get("width")*c,height:o.get("height")*s,page:"0",hit_index:""};if(i.alpha=Meclib.Highlight.alpha,i.color=Meclib.Highlight.color,2===Meclib.Globals.bookCanvas.canvasNum)if(0===e)r.left=Meclib.Function.getCssVal("#canvas-leftpage").left+r.x;else{if(1!==e)return!0;r.left=Meclib.Function.getCssVal("#canvas-rightpage").left+r.x}else{if(0!==e)return!0;r.left=Meclib.Function.getCssVal("#canvas-leftpage").left+r.x}r.top=r.y+Meclib.Function.getCssVal("#canvas-leftpage").top;var g=o.get("id").split("_");if(r.id=g[0],r.hit_index=g[1],r.id="highlight_"+e+"_"+r.id,0===$("#"+r.id).length){var b="hit-box-"+a+"-"+r.hit_index;$(n).addClass("highlight-obj").addClass(b).attr({id:r.id}),$(t).append(n)}else $("#"+r.id).addClass(b);$(n).css({width:r.width+"px",height:r.height+"px",left:r.left+"px",top:r.top+"px",background:i.color,opacity:i.alpha})}));var r=".hit-box-"+$("#saerch-selected-val").attr("data-val");Meclib.Globals.searchTextList[a-1]==Meclib.Globals.highlightTextData[a-1]&&$(".highlight-obj"+r).each((function(){$(this).addClass("saerch-selected")})),1===Meclib.Globals.book.book_db&&$(".highlight-obj"+r).each((function(){$(this).addClass("saerch-selected")}))}},draw:function(){ViewerApp.mediator.trigger("highlight:clear"),$(".highlight-obj").remove(),$("#highlight-layer").remove();var e=$("
    ");$(e).attr({id:"highlight-layer"}).addClass("highlight-layer").css({width:"100%",height:"100%",position:"absolute","z-index":Meclib.LayerZindex.highlight,"pointer-events":"none"}).hide(),$("#page-area").append(e),0!==Meclib.Globals.viewer.get("options").highlight&&""!==Meclib.TextSearch.keyword&&(2===Meclib.Globals.bookCanvas.canvasNum?(this.loadPageData(0,Meclib.Globals.book.getLeftPage()),this.loadPageData(1,Meclib.Globals.book.getRightPage())):this.loadPageData(0,Meclib.Globals.book.currentPage),setTimeout((function(){$(e).show(),ViewerApp.mediator.trigger("highlight:focusSelectedItem"),$(".highlight-obj").css({"pointer-events":"visible"})}),250),setTimeout((function(){if($("#saerch-selected-val").attr("data-val")&&""!==$("#saerch-selected-val").attr("data-val")){var i=".highlight-obj.hit-box-"+$("#saerch-selected-val").attr("data-val");Meclib.Function.alphaElementBlink($(i),5,!1,(function(){}))}else Meclib.Function.elementBlink(e,3,!1,(function(){}))}),500))},focusSelectedItem:function(){var e=".highlight-obj.hit-box-"+$("#saerch-selected-val").attr("data-val");$(e).addClass("saerch-selected")},show:function(){$("#highlight-layer").show()},hide:function(){$("#highlight-layer").hide()},clear:function(){$("#highlight-layer").remove(),Meclib.Lists.highlightList1=[],Meclib.Lists.highlightList2=[],Meclib.Globals.highlightData=[]}}),ViewerApp.Views.TxtcopyView=Backbone.View.extend({initialize:function(e){switch(ViewerApp.mediator.on("book:ready",this.ready),ViewerApp.mediator.on("menu:resize",this.update),ViewerApp.mediator.on("menu:onClosedMenu",this.onClosedMenu),ViewerApp.mediator.on("common:beforeCloseMenu",this.beforeCloseMenu),ViewerApp.mediator.on("canvas:scaleCanvas",this.startZoom),ViewerApp.mediator.on("contents:showContents",this.update),ViewerApp.mediator.on("object:hide",this.hide),ViewerApp.mediator.on("main:onMovedPage",this.onMovedPage),ViewerApp.mediator.on("txtcopy:addMenuEvent",this.addMenuEvent),ViewerApp.mediator.on("txtcopy:addPanelEvent",this.addPanelEvent),ViewerApp.mediator.on("txtcopy:closePanel",this.closePanel),ViewerApp.mediator.on("txtcopy:closeSpPanel",this.closeSpPanel),ViewerApp.mediator.on("txtcopy:close",this.close),ViewerApp.mediator.on("txtcopy:end",this.end),ViewerApp.mediator.on("common:closePanel",this.end),ViewerApp.mediator.on("txtcopy:fixTxtcopyArea",this.fixTxtcopyArea),ViewerApp.mediator.on("txtcopy:hide",this.hide),ViewerApp.mediator.on("txtcopy:onSelectMode",this.onSelectMode),ViewerApp.mediator.on("txtcopy:onDragMode",this.onDragMode),ViewerApp.mediator.on("txtcopy:resetDrag",this.resetDrag),ViewerApp.mediator.on("txtcopy:show",this.show),ViewerApp.mediator.on("txtcopy:showPanel",this.showPanel),ViewerApp.mediator.on("txtcopy:showSpPanel",this.showSpPanel),ViewerApp.mediator.on("txtcopy:updateMenuButton",this.updateMenuButton),ViewerApp.mediator.trigger("txtcopy:addMenuEvent"),ViewerApp.mediator.trigger("txtcopy:resetDrag"),Meclib.Cache.Tpl.txtcopyCanvas=$("").attr({id:"canvas-txtcopy"}).addClass("canvas-txtcopy").css({"pointer-events":"none"}),Meclib.Cache.Tpl.txtcopyPreviewCanvas=$("").attr({id:"canvas-txtcopy-preview"}).addClass("canvas-txtcopy").css({"pointer-events":"none"}),Meclib.Cache.Tpl.txtcopyWorkCanvas=$("").attr({id:"canvas-txtcopy-work"}).addClass("canvas-txtcopy").css({"pointer-events":"none"}),Meclib.Globals.viewer.get("device")){case 1:case 2:Meclib.Cache.Tpl.txtcopy=$("#panel-txtcopy-clipboad-template").html();break;case 3:Meclib.Cache.Tpl.txtcopy=$("#sp-txtcopy-clipboad-template").html()}Meclib.Txtcopy.selected.text=""},ready:function(){if(3===Meclib.Globals.viewer.get("device")){var e={};e.deviceCode=Meclib.Globals.deviceCode,$("#menu-txtcopy-clipboad").append(_.template(Meclib.Cache.Tpl.txtcopy)(e)),$(".panel-txtcopy-clipboad-txtarea").css({width:$(window).width()-20+"px"})}},update:function(){!0===Meclib.Mode.txtcopy&&(3===Meclib.Globals.viewer.get("device")&&$(".panel-txtcopy-clipboad-txtarea").css({width:$(window).width()-20+"px"}),Meclib.Txtcopy.action.drawLayer(),Meclib.Globals.viewer.get("device")<3&&ViewerApp.mediator.trigger("txtcopy:showPanel"))},startZoom:function(){ViewerApp.mediator.trigger("txtcopy:hide")},onMovedPage:function(){if(1===Meclib.Globals.viewer.get("enabedOptions").txtcopy){var e=!1;2===Meclib.Globals.bookCanvas.canvasNum?(0!==Meclib.Globals.book.getLeftPage()&&!0===Meclib.Lists.pageSettingList.isTxtcopy(Meclib.Globals.book.getLeftPage())&&(e=!0),0!==Meclib.Globals.book.getRightPage()&&!0===Meclib.Lists.pageSettingList.isTxtcopy(Meclib.Globals.book.getRightPage())&&(e=!0)):0!==Meclib.Globals.book.currentPage&&!0===Meclib.Lists.pageSettingList.isTxtcopy(Meclib.Globals.book.currentPage)&&(e=!0),Meclib.Txtcopy.action.load(),!0===e?ViewerApp.mediator.trigger("txtcopy:onSelectMode"):ViewerApp.mediator.trigger("txtcopy:onDragMode")}},beforeCloseMenu:function(){3===Meclib.Globals.viewer.get("device")&&Meclib.Mode.txtcopy&&Meclib.Txtcopy.action.closeTxtcopyMenu(!1)},onClosedMenu:function(){},updateMenuButton:function(){if(1===Meclib.Globals.viewer.get("enabedOptions").txtcopy){var e=!1;2===Meclib.Globals.bookCanvas.canvasNum?(0!==Meclib.Globals.book.getLeftPage()&&!0===Meclib.Lists.pageSettingList.isTxtcopy(Meclib.Globals.book.getLeftPage())&&(e=!0),0!==Meclib.Globals.book.getRightPage()&&!0===Meclib.Lists.pageSettingList.isTxtcopy(Meclib.Globals.book.getRightPage())&&(e=!0)):0!==Meclib.Globals.book.currentPage&&!0===Meclib.Lists.pageSettingList.isTxtcopy(Meclib.Globals.book.currentPage)&&(e=!0),!0===e?($("#btn-txtcopy").removeClass("disabled"),$("#btn-mode-drag-txtcopy").removeClass("disabled")):($("#btn-txtcopy").addClass("disabled"),$("#btn-mode-drag-txtcopy").addClass("disabled"))}},addMenuEvent:function(){Meclib.ClickManager.add(document,"#btn-mode-drag-txtcopy",(function(e,i){if($(e).hasClass("disabled"))return!1;ViewerApp.mediator.trigger("txtcopy:onSelectMode")})),Meclib.ClickManager.add(document,"#btn-mode-drag-zoomarea",(function(e,i){if($(e).hasClass("disabled"))return!1;ViewerApp.mediator.trigger("txtcopy:onDragMode")})),Meclib.ClickManager.add(document,".btn-close-txtcopymenu",(function(e,i){Meclib.Txtcopy.action.closeTxtcopyMenu()}))},addPanelEvent:function(){Meclib.ClickManager.add(document,"#btn-txtcopy-clipboad",(function(e,i){if(""!==Meclib.Txtcopy.selected.text){var t=window.navigator.userAgent.toLowerCase(),o=document.createElement("textarea");return o.textContent=Meclib.Txtcopy.selected.text,document.getElementsByTagName("body")[0].appendChild(o),t.match(/(msie|MSIE)/)||t.match(/(T|t)rident/)?window.clipboardData.setData("Text",o.textContent):(o.select(),document.execCommand("copy")),Meclib.Function.popup(Meclib.Message.txtcopy.completeClipboadCopy),!1}})),Meclib.ClickManager.add(document,"#btn-txtcopy-clear",(function(e,i){Meclib.Txtcopy.selected.text="";var t=0;3===Meclib.Globals.viewer.get("device")?(t=$(window).height()-126,$("#panel-txtcopy-clipboad-txtarea").css({height:t-24-10})):(t=$("#panel-txtcopy-clipboad").height()-66,$("#panel-txtcopy-clipboad-txtarea").css({height:t-20})),$("#panel-txtcopy-clipboad-txtarea").html(""),$(".panel-txtcopy-clipboad-scroll").mCustomScrollbar("destroy")})),Meclib.ClickManager.add(document,"#btn-close-txtcopy-clipboad",(function(e,i){Meclib.Txtcopy.action.closeTxtcopyMenu()})),Meclib.ClickManager.add(document,"#btn-txtcopy-cancel",(function(e,i){if(3===Meclib.Globals.viewer.get("device"))return ViewerApp.mediator.trigger("menu:toggle","txtcopy"),Meclib.Mode.txtcopy=!1,void Meclib.Txtcopy.action.startTxtcopyMode(!1);Meclib.Txtcopy.action.closeTxtcopyMenu()}))},onSelectMode:function(){Meclib.Txtcopy.mode.select=!0,Meclib.Txtcopy.mode.zoomdrag=!1,$("#btn-mode-drag-txtcopy").children(".menu-button-image").removeClass("on").addClass("on"),$("#btn-mode-drag-zoomarea").children(".menu-button-image").removeClass("on"),$("#txtcopy-layer").css({"pointer-events":""})},onDragMode:function(){Meclib.Txtcopy.mode.zoomdrag=!0,Meclib.Txtcopy.mode.select=!1,$("#btn-mode-drag-zoomarea").children(".menu-button-image").removeClass("on").addClass("on"),$("#btn-mode-drag-txtcopy").children(".menu-button-image").removeClass("on"),$("#txtcopy-layer").css({"pointer-events":"none"})},resetDrag:function(){Meclib.Txtcopy.drag={start:{x:0,y:0},end:{x:0,y:0}},Meclib.Txtcopy.selected.down=!1,Meclib.Txtcopy.selected.start={x:0,y:0},Meclib.Txtcopy.selected.end={x:0,y:0},Meclib.Txtcopy.selected.lasttime=0},showSpPanel:function(){$("#menu-txtcopy-clipboad").show(),ViewerApp.mediator.trigger("menu:closeLoading");var e=$(window).width(),i=$(window).height()-116-20,t={width:e-20-24,height:i-20};$(".panel-txtcopy-clipboad-body,.panel-txtcopy-clipboad-scroll").css({height:i});var o=Meclib.Txtcopy.selected.text;o=o.replaceAll("\n","
    "),$("#panel-txtcopy-clipboad-txtarea").html(o),setTimeout((function(){ViewerApp.mediator.trigger("txtcopy:fixTxtcopyArea")}),500),$("#panel-txtcopy-clipboad-txtarea").css({width:t.width}),setTimeout((function(){$(".panel-txtcopy-clipboad-scroll").hasClass("mCustomScrollbar")||$(".panel-txtcopy-clipboad-scroll").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:50,scrollInertia:200,scrollButtons:{enable:!1}}),$(".panel-txtcopy-clipboad-scroll").mCustomScrollbar("update"),(Meclib.Txtcopy.selected.text.match(/\n/g)||[]).length>1&&$(".panel-txtcopy-clipboad-scroll").mCustomScrollbar("scrollTo","bottom")}),1e3),ViewerApp.mediator.trigger("txtcopy:addPanelEvent")},closeSpPanel:function(){$("#menu-txtcopy-clipboad").hide()},showPanel:function(){var e=Meclib.Txtcopy.selected.text;if(e=e.replaceAll("\n","
    "),1===$("#panel-txtcopy-clipboad").length)return $("#panel-txtcopy-clipboad-txtarea").html(e),void setTimeout((function(){ViewerApp.mediator.trigger("txtcopy:fixTxtcopyArea")}),500);var i={};i._txtcopy_clipboad=Meclib.Message.functionName.txtcopy,i.deviceCode=Meclib.Globals.deviceCode,$("#body").append(_.template($("#panel-txtcopy-clipboad-template").html())(i)),$("#panel-txtcopy-clipboad").resizable({handles:"se",minHeight:166,maxHeight:500,minWidth:350,maxWidth:700,stop:function(e,i){$("#panel-txtcopy-clipboad-txtarea").css({"min-height":"",height:"auto"}),ViewerApp.mediator.trigger("txtcopy:fixTxtcopyArea")}}).resize((function(e){e.stopPropagation(),ViewerApp.mediator.trigger("txtcopy:fixTxtcopyArea"),""!==Meclib.Txtcopy.selected.text&&($(".panel-txtcopy-clipboad-scroll").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:50,scrollInertia:200,scrollButtons:{enable:!1}}),ViewerApp.mediator.trigger("txtcopy:fixTxtcopyArea"))})),setTimeout((function(){$("#panel-txtcopy-clipboad").draggable({handle:".panel-txtcopy-clipboad-title,.panel-txtcopy-clipboad-header",containment:"#canvas-area",scroll:!1}),$("#panel-txtcopy-clipboad-txtarea").html(e),ViewerApp.mediator.trigger("txtcopy:fixTxtcopyArea")}),500),Meclib.Function.setPosCenter("panel-txtcopy-clipboad"),$("#panel-txtcopy-clipboad").css({top:$(window).height()-($("#panel-txtcopy-clipboad").innerHeight()+$("#footer").height()+10)}),ViewerApp.mediator.trigger("txtcopy:addPanelEvent")},fixTxtcopyArea:function(){var e=$("#panel-txtcopy-clipboad").height(),i=e-76;3===Meclib.Globals.viewer.get("device")&&(i=(e=$("#menu-txtcopy-clipboad").height())-116),$(".panel-txtcopy-clipboad-title").css({width:$("#panel-txtcopy-clipboad").width()-4});var t=i-10;$(".panel-txtcopy-clipboad-body").css({height:i,"min-height":100}),$(".panel-txtcopy-clipboad-scroll").css({height:t,"min-height":80}),3===Meclib.Globals.viewer.get("device")?$("#panel-txtcopy-clipboad-txtarea").css({width:$(window).width()-20-24-10,height:"auto","min-height":t}):$("#panel-txtcopy-clipboad-txtarea").css({width:$("#panel-txtcopy-clipboad").width()-10-24-10-10,height:"auto","min-height":t}),""!==Meclib.Txtcopy.selected.text&&setTimeout((function(){$(".panel-txtcopy-clipboad-scroll").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:50,scrollInertia:200,scrollButtons:{enable:!1}}),$(".panel-txtcopy-clipboad-scroll").mCustomScrollbar("update"),(Meclib.Txtcopy.selected.text.match(/\n/g)||[]).length>1&&$(".panel-txtcopy-clipboad-scroll").mCustomScrollbar("scrollTo","bottom")}),500)},closePanel:function(){$("#panel-txtcopy-clipboad").remove()},show:function(){$("#txtcopy-layer").show()},hide:function(){$("#txtcopy-layer").hide()},close:function(){$("#txtcopy-layer").remove(),Meclib.Mode.txtcopy=!1,Meclib.Txtcopy.selected.text="",ViewerApp.mediator.trigger("contents:changeTxtcopyMode",!1),Meclib.Lists.txtcopyList=[],$('[data-type="txtcopy"]').hide(),ViewerApp.mediator.trigger("txtcopy:closePanel"),ViewerApp.mediator.trigger("txtcopy:closeSpPanel")},end:function(){Meclib.Txtcopy.action.closeTxtcopyMenu()}}),Meclib.Txtcopy.action.startTxtcopyMode=function(){var e=!0;if("MAINTE"!==Meclib.Setting.type)if(arguments.length>0&&!1===arguments[0]&&(e=!1),!0!==Meclib.Mode.txtcopy){if(!0===Meclib.Function.isSideMenuOpened()&&ViewerApp.mediator.trigger("menu:close"),!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping&&($("#footer-sub-box").hide(),$('[data-role="sub"]').css("display","flex"),$('[data-type="txtcopy"]').show(),$('footer [data-type="txtcopy"]').css({position:"absolute",bottom:-1*$("#footer").height()}),ViewerApp.mediator.trigger("highlight:hide"),!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping)){if(""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}if(ViewerApp.mediator.trigger("common:closePanel"),Meclib.Mode.txtcopy=!0,Meclib.Txtcopy.action.load(),ViewerApp.mediator.trigger("txtcopy:onSelectMode"),e){var i="#footer-icon-box";3===Meclib.Globals.viewer.get("device")&&(i="#footer-centericon"),Meclib.Memo.action.changeMemoMenu(i,'footer [data-type="txtcopy"]',(function(){}))}else $("#footer-centericon").css({bottom:-1*$("#footer").height()}),$('footer [data-type="txtcopy"]').css({bottom:0})}}else ViewerApp.mediator.trigger("txtcopy:close")},Meclib.Txtcopy.action.closeTxtcopyMenu=function(){if(Meclib.Mode.txtcopy){var e=!0;if(Meclib.Txtcopy.mode.zoomdrag=!1,Meclib.Txtcopy.mode.select=!1,arguments.length>0&&!1===arguments[0]&&(e=!1),ViewerApp.mediator.trigger("txtcopy:close"),e){var i="#footer-icon-box";3===Meclib.Globals.viewer.get("device")&&(i="#footer-centericon"),Meclib.Memo.action.changeMemoMenu('footer [data-type="txtcopy"]',i,(function(){$('footer [data-role="main"]').show(),$('footer [data-role="sub"]').hide(),$('footer [data-type="txtcopy"]').hide(),$("#header").show(),$("#page-area").css({"pointer-events":""}),$("#footer-sub-box").show()}))}else $("#footer-centericon").css({bottom:0}),$('footer [data-type="txtcopy"]').css({bottom:-1*$("#footer").height()})}},Meclib.Txtcopy.action.getScale=function(){var e={x:0,y:0},i=$("#canvas-leftpage").width()/Meclib.Globals.book.thumbWidth,t=$("#canvas-leftpage").height()/Meclib.Globals.book.thumbHeight;return e.x=Meclib.Globals.book.thumbWidth*i/Meclib.Highlight.info.width,e.y=Meclib.Globals.book.thumbHeight*t/Meclib.Highlight.info.height,e},Meclib.Txtcopy.action.load=function(){if(Meclib.Lists.txtcopyList=[],Meclib.Mode.txtcopy){ViewerApp.mediator.trigger("contents:changeTxtcopyMode",!0),Meclib.Lists.txtcopyList=new ViewerApp.Collections.TxtcopyList;var e=!1;2===Meclib.Globals.bookCanvas.canvasNum?(0!==Meclib.Globals.book.getLeftPage()&&(0===Meclib.Globals.book.getRightPage()&&(e=!0),Meclib.Txtcopy.action.loadPageData(0,Meclib.Globals.book.getLeftPage(),e)),0!==Meclib.Globals.book.getRightPage()&&Meclib.Txtcopy.action.loadPageData(1,Meclib.Globals.book.getRightPage(),!0)):Meclib.Txtcopy.action.loadPageData(0,Meclib.Globals.book.currentPage,!0),setTimeout((function(){1!==Meclib.Globals.viewer.get("device")&&2!==Meclib.Globals.viewer.get("device")||ViewerApp.mediator.trigger("txtcopy:showPanel")}),250)}},Meclib.Txtcopy.action.loadPageData=function(){var e=0,i=0,t=!1,o="";0!==arguments.length&&(arguments.length>0&&(i=arguments[0]),arguments.length>1&&(e=arguments[1]),arguments.length>2&&(t=arguments[2]),o=Meclib.Globals.viewer.get("dataPath")+"data/txtcopy/"+Meclib.Function.formatNum(4,e)+".txt",$.ajax({type:"GET",dataType:"json",scriptCharset:"utf-8",url:o}).done((function(o){var a=JSON.stringify(o),l=$.parseJSON(a);for(var n in l){var c=l[n];c.page_no=e,c.id=i+""+c.id,Meclib.Lists.txtcopyList.add(new ViewerApp.Models.Txtcopy(c,{parse:!0}))}t&&Meclib.Txtcopy.action.drawLayer()})).fail((function(){})))},Meclib.Txtcopy.action.drawLayer=function(){if(0!==Meclib.Globals.viewer.get("options").txtcopy&&Meclib.Mode.txtcopy){$("#txtcopy-layer").remove(),Meclib.Txtcopy.pagearea=Meclib.Function.getCssVal("#page-area"),Meclib.Txtcopy.scale=Meclib.Txtcopy.action.getScale();var e=Meclib.Txtcopy.pagearea.width,i=Meclib.Txtcopy.pagearea.height,t=Meclib.Txtcopy.pagearea.left,o=Meclib.Txtcopy.pagearea.top,a={width:$(window).width(),height:$(window).height(),left:t,top:o};1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?(t=Meclib.Globals.bookCanvas.left,o=Meclib.Globals.bookCanvas.top,a.width=e,a.height=i,a.left=t,a.top=o,Meclib.Function.isTwoPage()&&(0===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getRightPage()&&(a.left=t+$("#canvas-leftpage").width(),a.width=e/2),0===Meclib.Globals.book.getRightPage()&&0!==Meclib.Globals.book.getLeftPage()&&(a.width=e/2))):(a.width=$(window).width(),a.height=$(window).height());var l=$("
    ");$(l).attr({id:"txtcopy-layer"}).addClass("txtcopy-layer").css({width:a.width,height:a.height,left:a.left,top:a.top,position:"absolute","z-index":Meclib.LayerZindex.txtcopy,display:"none"}).addClass("hidden-txtcopy"),!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select?$(l).css({"pointer-events":""}):$(l).css({"pointer-events":"none"}),$(l).append(Meclib.Cache.Tpl.txtcopyCanvas).append(Meclib.Cache.Tpl.txtcopyPreviewCanvas).append(Meclib.Cache.Tpl.txtcopyWorkCanvas),$("#canvas-area").append(l),setTimeout((function(){Meclib.Txtcopy.action.initEvent(),$(".canvas-txtcopy").css({position:"absolute"}),$("#canvas-txtcopy").css({"z-index":200}),$("#canvas-txtcopy-preview").css({"z-index":210}),$("#canvas-txtcopy-work").css({"z-index":220}),Meclib.Txtcopy.action.fixLayer(),$(l).removeClass("hidden-txtcopy").show()}),500)}},Meclib.Txtcopy.action.fixLayer=function(){var e={x:0,y:0};Meclib.Txtcopy.pagearea=Meclib.Function.getCssVal("#page-area"),Meclib.Txtcopy.scale=Meclib.Txtcopy.action.getScale();var i=Meclib.Txtcopy.pagearea.left,t=Meclib.Txtcopy.pagearea.top,o={width:$(window).width(),height:$(window).height(),left:i,top:t};arguments.length>0&&(e=arguments[0],o.left=e.x,o.top=e.y),1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?(i=Meclib.Globals.bookCanvas.left,t=Meclib.Globals.bookCanvas.top,o.width=Meclib.Globals.bookCanvas.drawWidth*Meclib.Globals.bookCanvas.canvasNum,o.height=Meclib.Globals.bookCanvas.drawHeight,o.left=i,o.top=t,Meclib.Function.isTwoPage()&&(0===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getRightPage()&&(o.left=i+$("#canvas-leftpage").width(),o.width=$("#canvas-leftpage").width()),0===Meclib.Globals.book.getRightPage()&&0!==Meclib.Globals.book.getLeftPage()&&(o.width=$("#canvas-leftpage").width()))):(o.left=i>0?i:0,o.top=t>0?t:0,o.width=$(window).width(),o.height=$(window).height()),$("#txtcopy-layer,.canvas-txtcopy").css({width:o.width,height:o.height}),$(".canvas-txtcopy").attr({width:o.width*Meclib.Txtcopy.ratinaScale,height:o.height*Meclib.Txtcopy.ratinaScale}),$("#txtcopy-layer").css({left:o.left,top:o.top}),Meclib.Txtcopy.action.redraw()},Meclib.Txtcopy.action.initEvent=function(){var e=document.getElementById("txtcopy-layer"),i=document.getElementById("canvas-txtcopy"),t=document.getElementById("canvas-txtcopy-preview"),o=document.getElementById("canvas-txtcopy-work");if(Meclib.Txtcopy.ctx=i.getContext("2d"),Meclib.Txtcopy.prectx=t.getContext("2d"),Meclib.Txtcopy.wrkctx=o.getContext("2d"),Meclib.Txtcopy.select.lastPoint=[],Meclib.Txtcopy.isDown=!1,!0===Meclib.Function.getDeviceEventLists().touch){var a=new Hammer.Manager(e);a.remove(),a.add(new Hammer.Tap({event:"doubletap",taps:2})),a.add(new Hammer.Tap({event:"singletap"})),a.get("doubletap").recognizeWith("singletap"),a.get("singletap").requireFailure("doubletap"),a.on("singletap",(function(e){ViewerApp.mediator.trigger("canvas:TapPage",e)})),a.on("doubletap",(function(e){ViewerApp.mediator.trigger("canvas:WTapPage",e)}))}},Meclib.Txtcopy.action.onDown=function(e,i){1===Meclib.Globals.viewer.get("device")&&!1===Meclib.MainMenu.overlay&&(i-=Meclib.Size.headerHeight);var t=Meclib.Txtcopy.pagearea,o={left:t.left,top:t.top,width:t.width,height:t.height};1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&(o={left:Meclib.Globals.bookCanvas.left,top:Meclib.Globals.bookCanvas.top,width:Meclib.Globals.bookCanvas.canvasWidth,height:Meclib.Globals.bookCanvas.canvasHeight}),Meclib.Txtcopy.isDown=!0,Meclib.Txtcopy.select.start={x:e,y:i},Meclib.Txtcopy.select.end={x:!1,y:!1},Meclib.Txtcopy.select.lastPoint={x:e,y:i},o.left>0&&(Meclib.Txtcopy.select.start.x-=o.left),o.top>0&&(Meclib.Txtcopy.select.start.y-=o.top),Meclib.Txtcopy.select.nowData={rect:[],eraser:[]},!0===Meclib.Function.getDeviceEventLists().touch&&Meclib.Txtcopy.action.onItemOver(e,i)},Meclib.Txtcopy.action.onItemOver=function(e,i){var t=Meclib.Txtcopy.scale,o=Meclib.Txtcopy.pagearea,a={left:o.left,top:o.top,width:o.width,height:o.height};1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&(a={left:Meclib.Globals.bookCanvas.left,top:Meclib.Globals.bookCanvas.top,width:Meclib.Globals.bookCanvas.canvasWidth,height:Meclib.Globals.bookCanvas.canvasHeight}),Meclib.Txtcopy.action.clearCanvas(1),Meclib.Txtcopy.select.end={x:!1,y:!1},Meclib.Txtcopy.select.nowData.eraser={x1:0,x2:!1,y1:0,y2:!1},Meclib.Txtcopy.select.nowData.eraser.x1=e/t.x,Meclib.Txtcopy.select.nowData.eraser.y1=i/t.y,a.left>0?Meclib.Txtcopy.select.nowData.eraser.x1-=a.left/t.x:1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?Meclib.Txtcopy.select.nowData.eraser.x1+=a.left:Meclib.Txtcopy.select.nowData.eraser.x1+=Math.abs(a.left/t.x),a.top>0?Meclib.Txtcopy.select.nowData.eraser.y1-=a.top/t.y:1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?Meclib.Txtcopy.select.nowData.eraser.y1+=a.top:Meclib.Txtcopy.select.nowData.eraser.y1+=Math.abs(a.top/t.y),Meclib.Txtcopy.action.checkSelectedObjects(Meclib.Txtcopy.select.nowData.eraser)},Meclib.Txtcopy.action.onDrag=function(e,i){1===Meclib.Globals.viewer.get("device")&&!1===Meclib.MainMenu.overlay&&(i-=Meclib.Size.headerHeight);var t=Meclib.Txtcopy.pagearea,o={left:t.left,top:t.top,width:t.width,height:t.height};1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&(o={left:Meclib.Globals.bookCanvas.left,top:Meclib.Globals.bookCanvas.top,width:Meclib.Globals.bookCanvas.canvasWidth,height:Meclib.Globals.bookCanvas.canvasHeight});var a=Meclib.Txtcopy.scale;if(Meclib.Txtcopy.isDown){Meclib.Txtcopy.select.end={x:e,y:i};var l=Math.sqrt(Math.pow(Meclib.Txtcopy.select.start.x-Meclib.Txtcopy.select.end.x,2)+Math.pow(Meclib.Txtcopy.select.start.y-Meclib.Txtcopy.select.end.y,2));if(o.left>0&&(Meclib.Txtcopy.select.end.x-=o.left),o.top>0&&(Meclib.Txtcopy.select.end.y-=o.top),Meclib.Txtcopy.action.clearCanvas(1),Meclib.Txtcopy.action.clearCanvas(2),l<2)return Meclib.Txtcopy.select.end={x:!1,y:!1},Meclib.Txtcopy.select.nowData.eraser={x1:Meclib.Txtcopy.select.start.x,x2:!1,y1:Meclib.Txtcopy.select.start.y,y2:!1},Meclib.Txtcopy.select.nowData.eraser={x1:e/a.x,x2:!1,y1:i/a.y,y2:!1},void Meclib.Txtcopy.action.checkSelectedObjects(Meclib.Txtcopy.select.nowData.eraser);var n,c,s,r=0;Meclib.Txtcopy.select.start.x>Meclib.Txtcopy.select.end.x?(n=Meclib.Txtcopy.select.end.x,s=Meclib.Txtcopy.select.start.x-Meclib.Txtcopy.select.end.x):(n=Meclib.Txtcopy.select.start.x,s=Meclib.Txtcopy.select.end.x-Meclib.Txtcopy.select.start.x),Meclib.Txtcopy.select.start.y1&&(i=arguments[1]);var t=Meclib.Lists.txtcopyList,o=t.length;if(0!==o){var a=!1;!1===e.x2&&!1===e.y2&&(a=!0);var l=Meclib.Highlight.info.width;Meclib.Txtcopy.prectx.lineWidth=1,Meclib.Txtcopy.prectx.strokeStyle=Meclib.Txtcopy.selectedStyle.strokeStyle,Meclib.Txtcopy.prectx.lineJoin="round",Meclib.Txtcopy.prectx.lineCap="round";var n="";t.each((function(t){var o={x:t.get("x"),y:t.get("y"),width:t.get("width"),height:t.get("height"),page:t.get("page_no"),text:t.get("text")},c={x1:o.x,x2:o.x+o.width,y1:o.y,y2:o.y+o.height};if(!0===Meclib.Function.isTwoPage()&&o.page===Meclib.Globals.book.getRightPage()&&(c.x1+=l,c.x2+=l),a){if(Meclib.Txtcopy.action.isPointInRect(c,{x:e.x1,y:e.y1}))return Meclib.Txtcopy.action.drawObject(o,!0),i&&(n=3===Meclib.Globals.viewer.get("device")?o.text:o.text+"\n"),!0}else Meclib.Txtcopy.action.isRectOverlapRect(c,e)&&(Meclib.Txtcopy.action.drawObject(o,!0),i&&(n+=o.text+"\n"))})),i&&(3===Meclib.Globals.viewer.get("device")?Meclib.Txtcopy.selected.text=n:Meclib.Txtcopy.selected.text+=n),Meclib.Txtcopy.prectx.globalAlpha=1,Meclib.Txtcopy.prectx.lineJoin=Meclib.Txtcopy.prectx.lineCap="round"}},Meclib.Txtcopy.action.drawObject=function(e){if(void 0!==Meclib.Txtcopy.prectx){e=JSON.parse(JSON.stringify(e)),arguments.length>1&&!0===arguments[1]&&!0;var i=Meclib.Txtcopy.scale,t=Meclib.Highlight.info.width*i.x;e.width=e.width*i.x,e.height=e.height*i.y,e.x=e.x*i.x,e.y=e.y*i.y,Meclib.Txtcopy.pagearea.left<0&&(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&(e.x=e.x+Meclib.Txtcopy.pagearea.left),Meclib.Txtcopy.pagearea.top<0&&(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&(e.y=e.y+Meclib.Txtcopy.pagearea.top);var o=!1;!0===Meclib.Function.isTwoPage()?(e.page!==Meclib.Globals.book.getRightPage()||Meclib.Function.isSingleCoverPageNow()||(o=!0),(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&e.page===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPageNow()&&(o=!0)):e.page.length>1&&(Meclib.Globals.book.currentPage===Meclib.Globals.book.getRightPage()?e.page===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getLeftPage()&&(o=!0):e.page===Meclib.Globals.book.getRightPage()&&0!==Meclib.Globals.book.getRightPage()&&(o=!0)),o&&(e.x+=t),Meclib.Txtcopy.prectx.beginPath(),Meclib.Txtcopy.prectx.lineJoin="round",Meclib.Txtcopy.prectx.lineCap="round",Meclib.Txtcopy.prectx.lineWidth=1,Meclib.Txtcopy.prectx.globalAlpha=Meclib.Txtcopy.selectedStyle.strokeAlpha,Meclib.Txtcopy.prectx.strokeStyle=Meclib.Txtcopy.selectedStyle.strokeStyle,Meclib.Txtcopy.prectx.strokeRect(e.x*Meclib.Txtcopy.ratinaScale,e.y*Meclib.Txtcopy.ratinaScale,e.width*Meclib.Txtcopy.ratinaScale,e.height*Meclib.Txtcopy.ratinaScale),Meclib.Txtcopy.prectx.closePath(),Meclib.Txtcopy.prectx.globalAlpha=Meclib.Txtcopy.selectedStyle.fillAlpha,Meclib.Txtcopy.prectx.fillStyle=Meclib.Txtcopy.selectedStyle.fillStyle,Meclib.Txtcopy.prectx.fillRect(e.x*Meclib.Txtcopy.ratinaScale,e.y*Meclib.Txtcopy.ratinaScale,e.width*Meclib.Txtcopy.ratinaScale,e.height*Meclib.Txtcopy.ratinaScale),Meclib.Txtcopy.prectx.closePath()}},Meclib.Txtcopy.action.getDist2d=function(e,i){return Math.sqrt(Math.pow(i-e,2))},Meclib.Txtcopy.action.getPointsDistance=function(e,i){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))},Meclib.Txtcopy.action.isPointInRectBorder=function(e,i){return Meclib.Txtcopy.action.getDist2d(e.x1,i.x)=e.y1&&i.y<=e.y2||(Meclib.Txtcopy.action.getDist2d(e.x2,i.x)=e.y1&&i.y<=e.y2||(Meclib.Txtcopy.action.getDist2d(e.y1,i.y)=e.x1&&i.x<=e.x2||Meclib.Txtcopy.action.getDist2d(e.y2,i.y)=e.x1&&i.x<=e.x2))},Meclib.Txtcopy.action.isPointInRect=function(e,i){var t={x:!1,y:!1};return e.x1<=i.x&&e.x2>=i.x&&(t.x=!0),e.y1<=i.y&&e.y2>=i.y&&(t.y=!0),!0===t.x&&!0===t.y},Meclib.Txtcopy.action.isRectOverlapRectBorder=function(e,i){var t={x1:0,y1:0,x2:0,y2:0};return t={x1:e.x1,y1:e.y1,x2:e.x1,y2:e.y2},!!Meclib.Txtcopy.action.isRectOverlapRect(i,t)||(t={x1:e.x2,y1:e.y1,x2:e.x2,y2:e.y2},!!Meclib.Txtcopy.action.isRectOverlapRect(i,t)||(t={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y1},!!Meclib.Txtcopy.action.isRectOverlapRect(i,t)||(t={x1:e.x1,y1:e.y2,x2:e.x2,y2:e.y2},!!Meclib.Txtcopy.action.isRectOverlapRect(i,t))))},Meclib.Txtcopy.action.isRectOverlapRect=function(e,i){var t={x:!1,y:!1};if(!1===i.x2&&!1===i.y2){var o={x:e.x1+(e.x2-e.x1)/2,y:e.y1+(e.y2-e.y1)/2};return Math.sqrt(Math.pow(i.x1-o.x,2)+Math.pow(i.y1-o.y,2))=e.x1||i.x1<=e.x2&&i.x2>=e.x2)&&(t.x=!0),i.x1>=e.x1&&i.x2<=e.x2&&(t.x=!0),(i.y1<=e.y1&&i.y2>=e.y1||i.y1<=e.y2&&i.y2>=e.y2)&&(t.y=!0),i.y1>=e.y1&&i.y2<=e.y2&&(t.y=!0),!0===t.x&&!0===t.y},Meclib.Memo.action.isPointInLine=function(e,i){var t,o,a=!1,l=e.x1,n=e.y1,c=0,s={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},r={x1:i.x-Meclib.Memo.enableDistance/2,y1:i.y-Meclib.Memo.enableDistance/2,x2:i.x+Meclib.Memo.enableDistance/2,y2:i.y+Meclib.Memo.enableDistance/2},g=-1;if(e.x1>e.x2?(t=e.x1-e.x2,l=e.x2,n=e.y2,g=1,s.x1=e.x2,s.x2=e.x1):(t=e.x2-e.x1,l=e.x1,n=e.y1),e.y1e.y2?(c=(o=e.y1-e.y2)/t,s.y1=e.y2,s.y2=e.y1):c=0,t<10)return!!Meclib.Memo.action.isRectOverlapRect(r,s);if(o<10)return!!Meclib.Memo.action.isRectOverlapRect(r,s);for(var b=1;b<=t;b+=1){var p={x:l+b,y:n+c*b*g};if(Meclib.Memo.action.getPointsDistance(p,i)1)&&e.set({y:e.get("y")+a}),e.set({x:e.get("x")-(a-e.get("width"))/2}),e.set({width:a}))}o.width=e.get("width")*l,o.height=e.get("height")*n,o.x=e.get("x")*l,o.y=e.get("y")*n,o.page=e.get("page_no"),i<0&&(o.x=o.x+i),t<0&&(o.y=o.y+t);var c=!1;!0===Meclib.Function.isTwoPage()&&(o.page!==Meclib.Globals.book.getRightPage()||Meclib.Function.isSingleCoverPageNow()||(c=!0),(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&o.page===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPageNow()&&(c=!0)),c&&(o.x+=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale()),Meclib.Txtcopy.ctx.beginPath(),Meclib.Txtcopy.ctx.lineJoin="round",Meclib.Txtcopy.ctx.lineCap="round",Meclib.Txtcopy.ctx.lineWidth=2,Meclib.Txtcopy.ctx.strokeStyle=Meclib.Txtcopy.normalStyle.strokeStyle,Meclib.Txtcopy.ctx.strokeRect(o.x*Meclib.Txtcopy.ratinaScale,o.y*Meclib.Txtcopy.ratinaScale,o.width*Meclib.Txtcopy.ratinaScale,o.height*Meclib.Txtcopy.ratinaScale),Meclib.Txtcopy.ctx.closePath(),Meclib.Txtcopy.ctx.globalAlpha=Meclib.Txtcopy.normalStyle.fillAlpha,Meclib.Txtcopy.ctx.fillStyle=Meclib.Txtcopy.normalStyle.fillStyle,Meclib.Txtcopy.ctx.fillRect(o.x*Meclib.Txtcopy.ratinaScale,o.y*Meclib.Txtcopy.ratinaScale,o.width*Meclib.Txtcopy.ratinaScale,o.height*Meclib.Txtcopy.ratinaScale),Meclib.Txtcopy.ctx.closePath(),Meclib.Txtcopy.ctx.globalAlpha=1,Meclib.Txtcopy.ctx.lineJoin=Meclib.Txtcopy.prectx.lineCap="round"}))}}},Meclib.Txtcopy.action.clearCanvas=function(){var e=parseInt($("#txtcopy-layer").css("width"),10),i=parseInt($("#txtcopy-layer").css("height"),10);e*=Meclib.Txtcopy.ratinaScale,i*=Meclib.Txtcopy.ratinaScale;var t=0;1===arguments.length&&(t=arguments[0]),0===t&&Meclib.Txtcopy.ctx&&Meclib.Txtcopy.ctx.clearRect(0,0,e,i),1===t&&Meclib.Txtcopy.prectx&&Meclib.Txtcopy.prectx.clearRect(0,0,e,i),2===t&&Meclib.Txtcopy.wrkctx&&Meclib.Txtcopy.wrkctx.clearRect(0,0,e,i),-1===t&&(Meclib.Txtcopy.ctx&&Meclib.Txtcopy.ctx.clearRect(0,0,e,i),Meclib.Txtcopy.prectx&&Meclib.Txtcopy.prectx.clearRect(0,0,e,i),Meclib.Txtcopy.wrkctx&&Meclib.Txtcopy.wrkctx.clearRect(0,0,e,i))},ViewerApp.Views.MemoView=Backbone.View.extend({initialize:function(e){_.bindAll(this,"draw"),ViewerApp.mediator.on("book:ready",this.ready),ViewerApp.mediator.on("menu:resize",this.update),ViewerApp.mediator.on("menu:onClosedMenu",this.onClosedMenu),ViewerApp.mediator.on("page:updateCompleted",this.update),ViewerApp.mediator.on("canvas:scaleCanvas",this.startZoom),ViewerApp.mediator.on("contents:showContents",this.update),ViewerApp.mediator.on("object:hide",this.hide),ViewerApp.mediator.on("main:onMovedPage",this.onMovedPage),ViewerApp.mediator.on("common:updateOption",this.updateOption),ViewerApp.mediator.on("memo:addMenuEvent",this.addMenuEvent),ViewerApp.mediator.on("memo:addPanelEvent",this.addPanelEvent),ViewerApp.mediator.on("memo:close",this.close),ViewerApp.mediator.on("memo:clearSelectObjects",this.clearSelectObjects),ViewerApp.mediator.on("memo:clear",this.clear),ViewerApp.mediator.on("memo:dragStart",this.dragStart),ViewerApp.mediator.on("memo:dragMove",this.dragMove),ViewerApp.mediator.on("memo:dragEnd",this.dragEnd),ViewerApp.mediator.on("memo:draw",this.draw),ViewerApp.mediator.on("memo:drawTxtcopy",this.drawTxtcopy),ViewerApp.mediator.on("memo:hide",this.hide),ViewerApp.mediator.on("memo:fixPos",this.fixPos),ViewerApp.mediator.on("memo:initEvent",this.initEvent),ViewerApp.mediator.on("memo:make",this.make),ViewerApp.mediator.on("memo:resetDrag",this.resetDrag),ViewerApp.mediator.on("memo:selectObject",this.selectObject),ViewerApp.mediator.on("memo:show",this.show),ViewerApp.mediator.on("memo:showPanel",this.showPanel),ViewerApp.mediator.on("memo:showSpPanel",this.showSpPanel),ViewerApp.mediator.on("memo:updateMenuButton",this.updateMenuButton),Meclib.Cache.Tpl.memoCanvas=$("").attr({id:"canvas-memo"}).addClass("canvas-memo"),Meclib.Cache.Tpl.memoPreviewCanvas=$("").attr({id:"canvas-memo-preview"}).addClass("canvas-memo"),Meclib.Cache.Tpl.memoWorkCanvas=$("").attr({id:"canvas-memo-work"}).addClass("canvas-memo"),Meclib.Globals.viewer.get("device")},ready:function(){if(3===Meclib.Globals.viewer.get("device")){Meclib.Globals.deviceCode}"MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").memo&&(Meclib.IndexedDb.memo.where({id:1,book_id:Meclib.Globals.book.bookId}).first().then((function(e){if(void 0!==e&&e.data){Meclib.Memo.MemoSaveData=JSON.parse(e.data);var i=Meclib.Function.getSaveFormatDate();Meclib.IndexedDb.memo.put({id:Meclib.Globals.book.uniId,book_id:Meclib.Globals.book.bookId,data:e.data,updated_at:i}).then((function(){Meclib.IndexedDb.memo.delete(1)})).catch((function(e){}))}})).catch((function(e){})),Meclib.IndexedDb.memo.where({id:Meclib.Globals.book.uniId,book_id:Meclib.Globals.book.bookId}).first().then((function(e){void 0!==e&&e.data&&(Meclib.Memo.MemoSaveData=JSON.parse(e.data),Meclib.Memo.action.parseMemoData(),Meclib.Memo.init=!0)})).catch((function(e){})),Meclib.Memo.action.setMemoType(),Meclib.Memo.action.setMemoColor(),Meclib.Memo.action.setMemoAlpha(),Meclib.Memo.action.setMemoSize())},update:function(){},updateOption:function(){0===Meclib.Globals.viewer.get("options").memo?$("#btn-memo").addClass("disabled"):$("#btn-memo").removeClass("disabled")},draw:function(){if($("#memo-layer").remove(),0!==Meclib.Globals.viewer.get("options").memo){var e=parseInt($("#page-area").css("width"),10),i=parseInt($("#page-area").css("height"),10),t=parseInt($("#page-area").css("left"),10),o=parseInt($("#page-area").css("top"),10),a={width:$(window).width(),height:$(window).height(),left:t,top:o};1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?(t=Meclib.Globals.bookCanvas.left,o=Meclib.Globals.bookCanvas.top,a.width=e,a.height=i,a.left=t,a.top=o,Meclib.Function.isTwoPage()&&(0===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getRightPage()&&(a.left=t+$("#canvas-leftpage").width(),a.width=e/2),0===Meclib.Globals.book.getRightPage()&&0!==Meclib.Globals.book.getLeftPage()&&(a.width=e/2))):(a.width=$(window).width(),a.height=$(window).height());var l=$("
    ");$(l).attr({id:"memo-layer"}).addClass("memo-layer").css({width:a.width,height:a.height,left:a.left,top:a.top,position:"absolute","z-index":Meclib.LayerZindex.memo,display:"none"}).addClass("hidden-memo"),Meclib.Mode.memo?($(l).css({"pointer-events":""}),10===Meclib.Memo.select.type&&$(l).css({cursor:Meclib.Cursor.Memo.eraser})):$(l).css({"pointer-events":"none"}),$(l).append(Meclib.Cache.Tpl.memoCanvas).append(Meclib.Cache.Tpl.memoPreviewCanvas).append(Meclib.Cache.Tpl.memoWorkCanvas),$("#canvas-area").append(l),Meclib.Globals.viewer.get("options").memo,setTimeout((function(){Meclib.Memo.action.initEvent(),$(".canvas-memo").css({position:"absolute"}),$("#canvas-memo").css({"z-index":200}),$("#canvas-memo-preview").css({"z-index":210}),$("#canvas-memo-work").css({"z-index":220}),ViewerApp.mediator.trigger("memo:addMenuEvent"),ViewerApp.mediator.trigger("memo:fixPos"),$(l).removeClass("hidden-memo").show()}),100)}},fixPos:function(){var e={x:0,y:0},i=parseInt($("#page-area").css("left"),10),t=parseInt($("#page-area").css("top"),10),o={width:$(window).width(),height:$(window).height(),left:i,top:t};if(arguments.length>0&&(e=arguments[0],o.left=e.x,o.top=e.y),1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale)i=Meclib.Globals.bookCanvas.left,t=Meclib.Globals.bookCanvas.top,o.width=Meclib.Globals.bookCanvas.drawWidth*Meclib.Globals.bookCanvas.canvasNum,o.height=Meclib.Globals.bookCanvas.drawHeight,o.left=i,o.top=t,Meclib.Function.isTwoPage()&&(0===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getRightPage()&&(o.left=i+$("#canvas-leftpage").width(),o.width=$("#canvas-leftpage").width()),0===Meclib.Globals.book.getRightPage()&&0!==Meclib.Globals.book.getLeftPage()&&(o.width=$("#canvas-leftpage").width()));else{o.left=i>0?i:0,o.top=t>0?t:0;var a=$("#canvas-leftpage").height()/Meclib.Globals.book.thumbHeight,l=!1,n=-1;Meclib.Function.isTwoPage()&&(o.width=2*$("#canvas-leftpage").width(),o.height=$("#canvas-leftpage").height(),0===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getRightPage()&&(o.left=i+$("#canvas-leftpage").width(),o.width=$("#canvas-leftpage").width(),l=!0,n=1),0===Meclib.Globals.book.getRightPage()&&0!==Meclib.Globals.book.getLeftPage()&&(o.width=$("#canvas-leftpage").width(),n=0)),!0===l?0===n&&(o.width-=Math.abs(i)):i<0&&(o.width-=Math.abs(i)),t<0&&(o.height=Meclib.Globals.book.thumbHeight*a-Math.abs(t),o.top+=2),!1===Meclib.Function.isTwoPage()&&(o.width=$("#canvas-leftpage").width(),i<0&&(o.width-=Math.abs(i)))}$("#memo-layer,.canvas-memo").css({width:o.width,height:o.height}),$(".canvas-memo").attr({width:o.width*Meclib.Memo.ratinaScale,height:o.height*Meclib.Memo.ratinaScale}),$("#memo-layer").css({left:o.left,top:o.top}),Meclib.Memo.action.redraw()},startZoom:function(){$("#memo-layer").remove()},onMovedPage:function(){Meclib.Memo.ctx&&Meclib.Memo.action.clearCanvas(),Meclib.Memo.MemoSaveLastData=JSON.parse(JSON.stringify(Meclib.Memo.MemoSaveData)),Meclib.Memo.MemoSaveQueueData=[],$('.btn-memo-tool[data-type="undo"]').addClass("disabled")},onClosedMenu:function(){Meclib.Mode.memo&&0!==$('.footer-sub-lists[data-type="memo"]').length&&3===Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("memo:show")},updateMenuButton:function(){if(1===Meclib.Globals.viewer.get("enabedOptions").memo){var e=!1;2===Meclib.Globals.bookCanvas.canvasNum?(0!==Meclib.Globals.book.getLeftPage()&&!0===Meclib.Lists.pageSettingList.isMemo(Meclib.Globals.book.getLeftPage())&&(e=!0),0!==Meclib.Globals.book.getRightPage()&&!0===Meclib.Lists.pageSettingList.isMemo(Meclib.Globals.book.getRightPage())&&(e=!0)):0!==Meclib.Globals.book.currentPage&&!0===Meclib.Lists.pageSettingList.isMemo(Meclib.Globals.book.currentPage)&&(e=!0),!0===e?$("#btn-memo").removeClass("disabled"):($("#btn-memo").addClass("disabled"),Meclib.Mode.memo&&ViewerApp.mediator.trigger("memo:clear"))}},initEvent:function(){ViewerApp.mediator.trigger("canvas:cancelOverAnimation")},addMenuEvent:function(){Meclib.ClickManager.add(document,".btn-memo-tool",(function(e,i){if($(e).hasClass("disabled"))return!1;var t=$(e).attr("data-type");switch(t){case"tool":Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo"]','.footer-sub-lists[data-type="memo-tool"]');break;case"curve":Meclib.Memo.select.type=1,Meclib.Memo.select.toolType=t,Meclib.Memo.action.setMemoType(Meclib.Memo.select.type);break;case"straight":Meclib.Memo.select.type=2,Meclib.Memo.select.toolType=t,Meclib.Memo.action.setMemoType(Meclib.Memo.select.type);break;case"square":Meclib.Memo.select.type=3,Meclib.Memo.select.toolType=t,Meclib.Memo.action.setMemoType(Meclib.Memo.select.type);break;case"circle":Meclib.Memo.select.type=4,Meclib.Memo.select.toolType=t,Meclib.Memo.action.setMemoType(Meclib.Memo.select.type);break;case"toolmenu":Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo"]','.footer-sub-lists[data-type="memo-toolmenu"]'),$(".btn-memo-toolmenu").removeClass("selected"),$('.btn-memo-toolmenu[data-type="'+Meclib.Memo.select.toolmenuType+'"]').addClass("selected");break;case"color":Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo"]','.footer-sub-lists[data-type="memo-color"]'),$(".btn-memo-color").children(".menu-button-image-none").removeClass("selected"),$('.btn-memo-color[data-type="'+Meclib.Memo.select.colorType+'"]').children(".menu-button-image-none").addClass("selected");break;case"size":Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo"]','.footer-sub-lists[data-type="memo-size"]'),$(".btn-memo-size").children(".menu-button-image-none").removeClass("selected"),$('.btn-memo-size[data-type="'+Meclib.Memo.select.sizeType+'"]').children(".menu-button-image-none").addClass("selected");break;case"alpha":Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo"]','.footer-sub-lists[data-type="memo-alpha"]'),$(".btn-memo-alpha").children(".menu-button-image-none").removeClass("selected"),$('.btn-memo-alpha[data-type="'+Meclib.Memo.select.alphaType+'"]').children(".menu-button-image-none").addClass("selected");break;case"eraser":Meclib.Memo.select.type=10,Meclib.Memo.select.toolType=t,Meclib.Memo.action.setMemoType(Meclib.Memo.select.type);break;case"trash":Meclib.Memo.action.confirmClearPage();break;case"undo":Meclib.Memo.action.undo()}})),Meclib.ClickManager.add(document,".btn-memo-toolmenu",(function(e,i){if($(e).hasClass("disabled"))return!1;var t=$(e).attr("data-type");switch(Meclib.Memo.select.toolType=t,t){case"curve":Meclib.Memo.action.setMemoType(1);break;case"straight":Meclib.Memo.action.setMemoType(2);break;case"square":Meclib.Memo.action.setMemoType(3);break;case"circle":Meclib.Memo.action.setMemoType(4);break;case"eraser":Meclib.Memo.action.setMemoType(10);break;case"trash":Meclib.Memo.action.confirmClearPage()}Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo-toolmenu"]','.footer-sub-lists[data-type="memo"]')})),Meclib.ClickManager.add(document,".btn-memo-color",(function(e,i){if($(e).hasClass("disabled"))return!1;var t=$(e).attr("data-type");Meclib.Memo.action.setMemoColor(t)})),Meclib.ClickManager.add(document,".btn-memo-alpha",(function(e,i){if($(e).hasClass("disabled"))return!1;var t=$(e).attr("data-type");Meclib.Memo.action.setMemoAlpha(t)})),Meclib.ClickManager.add(document,".btn-memo-size",(function(e,i){if($(e).hasClass("disabled"))return!1;var t=$(e).attr("data-type");Meclib.Memo.action.setMemoSize(t)})),Meclib.ClickManager.add(document,".btn-close-memomenu",(function(e,i){if($(e).hasClass("disabled"))return!1;switch($(e).attr("data-type")){case"memo-color":Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo-color"]','.footer-sub-lists[data-type="memo"]');break;case"memo-size":Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo-size"]','.footer-sub-lists[data-type="memo"]');break;case"memo-alpha":Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo-alpha"]','.footer-sub-lists[data-type="memo"]');break;case"memo-trash":Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo-trash"]','.footer-sub-lists[data-type="memo"]');break;case"memo-toolmenu":Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo-tool"]','.footer-sub-lists[data-type="memo"]');break;case"memo-menu":ViewerApp.mediator.trigger("memo:clear"),$("#memo-layer").css({cursor:Meclib.Cursor.Memo.default});var t="#footer-icon-box";3===Meclib.Globals.viewer.get("device")&&(t="#footer-centericon"),Meclib.Memo.action.changeMemoMenu('footer [data-type="memo"]',t,(function(){$('footer [data-role="main"]').show(),$('footer [data-role="sub"]').hide(),$('footer [data-type="memo"]').hide(),$("#header").show(),$("#page-area").css({"pointer-events":""}),3===Meclib.Globals.viewer.get("device")&&$("#footer-sub-box").show(),ViewerApp.mediator.trigger("memo:clear"),Meclib.Function.callAutoSave()}))}}))},addPanelEvent:function(){},show:function(){0!==$("#memo-layer").length&&(ViewerApp.mediator.trigger("memo:fixPos"),!0!==Meclib.Mode.txtcopy&&$("#memo-layer").show())},hide:function(){$("#memo-layer").hide()},clear:function(){Meclib.Mode.memo=!1,$('footer [data-type="memo"]').hide(),$("#page-area").css({"pointer-events":""}),$("#memo-layer").css({"pointer-events":"none",cursor:Meclib.Cursor.Memo.default})},close:function(){Meclib.Memo.action.end()}}),Meclib.Memo.action.start=function(){ViewerApp.mediator.trigger("optionmenu:close"),ViewerApp.mediator.trigger("print:closePanel"),ViewerApp.mediator.trigger("pdf:closePanel"),ViewerApp.mediator.trigger("products:hidePanel"),ViewerApp.mediator.trigger("common:closePanel"),Meclib.Mode.memo=!0,$("#memo-layer").css({"pointer-events":""})},Meclib.Memo.action.end=function(){$('footer [data-type="memo"]').css({display:"flex",bottom:-1*$("#footer-sub").height()}),$('footer [data-role="main"]').show(),$('footer [data-role="sub"]').hide(),$('footer [data-type="memo"]').hide(),$('.footer-sub-lists[data-func="memo"]').css({bottom:-1*$("#footer").height()}),$("#header").show(),$("#page-area").css({"pointer-events":""}),3===Meclib.Globals.viewer.get("device")&&$("#footer-sub-box").show(),ViewerApp.mediator.trigger("memo:clear"),Meclib.Function.callAutoSave(),$("#memo-layer").css({cursor:Meclib.Cursor.Memo.default});var e="#footer-icon-box";3===Meclib.Globals.viewer.get("device")&&(e="#footer-centericon"),$(e).css({bottom:0}).show()},Meclib.Memo.action.setMemoType=function(){var e=1,i={1:"curve",2:"straight",3:"square",4:"circle",10:"eraser",6:"trash"};arguments.length>0&&(e=arguments[0]),Meclib.Memo.select.type=e,$(".btn-memo-tool").children(".menu-button-image").removeClass("on"),$('.btn-memo-tool[data-type="'+i[e]+'"]').children(".menu-button-image").addClass("on"),3===Meclib.Globals.viewer.get("device")&&($('.btn-memo-tool[data-type="toolmenu"] *').attr({"data-id":i[e]}),$(".btn-memo-toolmenu").children(".menu-button-image-none").removeClass("selected"),$('.btn-memo-toolmenu[data-type="'+i[e]+'"]').children(".menu-button-image-none").addClass("selected")),10===e?$("#memo-layer").css({cursor:Meclib.Cursor.Memo.eraser}):$("#memo-layer").css({cursor:Meclib.Cursor.Memo.default})},Meclib.Memo.action.setMemoColor=function(){var e="red";Meclib.Memo.select.colorType=e;var i={red:"01",yellow:"02",green:"03",blue:"04",skyblue:"05",white:"06",black:"07"};arguments.length>0&&(e=arguments[0]);var t=i[e];switch(Meclib.Memo.select.colorType=e,e){case"red":Meclib.Memo.select.color=Meclib.Memo.colors.red;break;case"yellow":Meclib.Memo.select.color=Meclib.Memo.colors.yellow;break;case"green":Meclib.Memo.select.color=Meclib.Memo.colors.green;break;case"blue":Meclib.Memo.select.color=Meclib.Memo.colors.blue;break;case"skyblue":Meclib.Memo.select.color=Meclib.Memo.colors.skyblue;break;case"white":Meclib.Memo.select.color=Meclib.Memo.colors.white;break;case"black":Meclib.Memo.select.color=Meclib.Memo.colors.black}$('.btn-memo-tool[data-type="color"] *').attr({"data-id":t}),arguments.length>0&&($(".btn-memo-color").removeClass("selected"),$('.btn-memo-color[data-type="'+Meclib.Memo.select.colorType+'"]').addClass("selected"),Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo-color"]','.footer-sub-lists[data-type="memo"]'))},Meclib.Memo.action.setMemoAlpha=function(){var e="50";Meclib.Memo.select.alphaType=e;var i={10:"01",30:"02",50:"03",70:"04",100:"05"};arguments.length>0&&(e=arguments[0]),Meclib.Memo.select.alphaType=e;var t=i[e];switch(e){case"10":Meclib.Memo.select.borderAlpha=.1;break;case"30":Meclib.Memo.select.borderAlpha=.3;break;case"50":Meclib.Memo.select.borderAlpha=.5;break;case"70":Meclib.Memo.select.borderAlpha=.7;break;case"100":Meclib.Memo.select.borderAlpha=1}$('.btn-memo-tool[data-type="alpha"] *').attr({"data-id":t}),arguments.length>0&&($(".btn-memo-alpha").removeClass("selected"),$('.btn-memo-alpha[data-type="'+Meclib.Memo.select.alphaType+'"]').addClass("selected"),Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo-alpha"]','.footer-sub-lists[data-type="memo"]'))},Meclib.Memo.action.setMemoSize=function(){var e="2";Meclib.Memo.select.sizeType=e;var i={1:"01",2:"02",3:"03",4:"04",5:"05"};arguments.length>0&&(e=arguments[0]);var t=i[e];switch(Meclib.Memo.select.sizeType=e,e){case"1":Meclib.Memo.select.borderWidth=Meclib.Memo.size[0];break;case"2":Meclib.Memo.select.borderWidth=Meclib.Memo.size[1];break;case"3":Meclib.Memo.select.borderWidth=Meclib.Memo.size[2];break;case"4":Meclib.Memo.select.borderWidth=Meclib.Memo.size[3];break;case"5":Meclib.Memo.select.borderWidth=Meclib.Memo.size[4]}$('.btn-memo-tool[data-type="size"] *').attr({"data-id":t}),arguments.length>0&&($(".btn-memo-size").removeClass("selected"),$('.btn-memo-size[data-type="'+Meclib.Memo.select.sizeType+'"]').addClass("selected"),Meclib.Memo.action.changeMemoMenu('.footer-sub-lists[data-type="memo-size"]','.footer-sub-lists[data-type="memo"]'))},Meclib.Memo.action.confirmClearPage=function(){new Messi(Meclib.Message.memo.confirm.deleteNowPage,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.yes,val:1},{id:1,label:Meclib.Message.common.no,val:2}],callback:function(e){"1"===e&&Meclib.Memo.action.clearNowPageData()}})},Meclib.Memo.action.changeMemoMenu=function(e,i){var t,o=!1;arguments.length>2&&"function"==typeof arguments[2]&&(t=arguments[2],o=!0),$(e).css({display:"flex",bottom:0}).stop().animate({bottom:-1*$("#footer").height()},{duration:Meclib.Memo.menuSpeed,complete:function(){}}),setTimeout((function(){$(i).css({display:"flex",bottom:-1*$("#footer").height()}).stop().animate({bottom:0},{duration:Meclib.Memo.menuSpeed,complete:function(){o&&t()}})}),400)},Meclib.Memo.action.closeMemoMenu=function(){$('footer [data-type="memo"]').css("display","flex").animate({bottom:-1*$("#footer-sub").height()},{duration:Meclib.Memo.menuSpeed,complete:function(){setTimeout((function(){$('footer [data-role="main"]').show(),$('footer [data-role="sub"]').hide(),$('footer [data-type="memo"]').hide(),$("#header").show(),$("#page-area").css({"pointer-events":""}),3===Meclib.Globals.viewer.get("device")&&$("#footer-sub-box").show(),ViewerApp.mediator.trigger("memo:clear"),Meclib.Function.callAutoSave()}),100)}})},Meclib.Memo.action.initEvent=function(){var e=document.getElementById("memo-layer"),i=document.getElementById("canvas-memo"),t=document.getElementById("canvas-memo-preview"),o=document.getElementById("canvas-memo-work");if(Meclib.Memo.ctx=i.getContext("2d"),Meclib.Memo.prectx=t.getContext("2d"),Meclib.Memo.wrkctx=o.getContext("2d"),Meclib.Memo.ctx.lineJoin=Meclib.Memo.ctx.lineCap="round",Meclib.Memo.prectx.lineJoin="round",Meclib.Memo.prectx.lineCap="round",Meclib.Memo.wrkctx.lineJoin=Meclib.Memo.wrkctx.lineCap="round",Meclib.Memo.select.lastPoint=[],Meclib.Memo.isDown=!1,!0===Meclib.Function.getDeviceEventLists().touch){var a=new Hammer.Manager(e);a.remove(),a.add(new Hammer.Tap({event:"doubletap",taps:2})),a.add(new Hammer.Tap({event:"singletap"})),a.get("doubletap").recognizeWith("singletap"),a.get("singletap").requireFailure("doubletap"),a.on("singletap",(function(e){ViewerApp.mediator.trigger("canvas:TapPage",e)})),a.on("doubletap",(function(e){ViewerApp.mediator.trigger("canvas:WTapPage",e)}))}},Meclib.Memo.action.onDownMemo=function(e,i){1===Meclib.Globals.viewer.get("device")&&!1===Meclib.MainMenu.overlay&&(i-=Meclib.Size.headerHeight);var t=$("#canvas-leftpage").width()/Meclib.Globals.book.thumbWidth,o=$("#canvas-leftpage").height()/Meclib.Globals.book.thumbHeight,a=Meclib.Function.getCssVal("#page-area"),l={left:a.left,top:a.top,width:a.width,height:a.height};if(1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&(l={left:Meclib.Globals.bookCanvas.left,top:Meclib.Globals.bookCanvas.top,width:Meclib.Globals.bookCanvas.canvasWidth,height:Meclib.Globals.bookCanvas.canvasHeight}),Meclib.Memo.isDown=!0,Meclib.Memo.select.start={x:e,y:i},Meclib.Memo.select.end={x:!1,y:!1},Meclib.Memo.select.lastPoint={x:e,y:i},l.left>0&&(Meclib.Memo.select.start.x-=l.left),l.top>0&&(Meclib.Memo.select.start.y-=l.top),Meclib.Memo.select.nowData={pen:{data:[],page:[],lw:0,color:[],alpha:0,op:0},line:[],rect:[],circle:[],eraser:[]},1===Meclib.Memo.select.type){Meclib.Memo.prectx.strokeStyle=Meclib.Memo.select.strokeStyle,Meclib.Memo.prectx.beginPath(),Meclib.Memo.prectx.lineJoin="round",Meclib.Memo.prectx.lineWidth=Meclib.Memo.select.borderWidth,Meclib.Memo.prectx.moveTo(e,i);var n=0,c=(e-l.left)/t;n=!0===Meclib.Function.isTwoPage()?c>Meclib.Globals.book.thumbWidth?Meclib.Globals.book.getRightPage():Meclib.Globals.book.getLeftPage():Meclib.Globals.book.currentPage,Meclib.Memo.select.nowData.pen.page.push(n)}10===Meclib.Memo.select.type&&(Meclib.Memo.select.end={x:!1,y:!1},Meclib.Memo.select.nowData.eraser={x1:0,x2:!1,y1:0,y2:!1},Meclib.Memo.select.nowData.eraser.x1=e/t,Meclib.Memo.select.nowData.eraser.y1=i/o,l.left>0?Meclib.Memo.select.nowData.eraser.x1-=l.left/t:1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?Meclib.Memo.select.nowData.eraser.x1+=l.left:Meclib.Memo.select.nowData.eraser.x1+=Math.abs(l.left/t),l.top>0?Meclib.Memo.select.nowData.eraser.y1-=l.top/o:1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?Meclib.Memo.select.nowData.eraser.y1+=l.top:Meclib.Memo.select.nowData.eraser.y1+=Math.abs(l.top/o))},Meclib.Memo.action.onDragMemo=function(e,i){1===Meclib.Globals.viewer.get("device")&&!1===Meclib.MainMenu.overlay&&(i-=Meclib.Size.headerHeight);var t,o,a,l,n,c=1,s=1,r=0,g=0,b=Meclib.Function.getCssVal("#page-area"),p={left:b.left,top:b.top,width:b.width,height:b.height},d=0;1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&(p={left:Meclib.Globals.bookCanvas.left,top:Meclib.Globals.bookCanvas.top,width:Meclib.Globals.bookCanvas.canvasWidth,height:Meclib.Globals.bookCanvas.canvasHeight});var M=$("#canvas-leftpage").width()/Meclib.Globals.book.thumbWidth,m=$("#canvas-leftpage").height()/Meclib.Globals.book.thumbHeight;if(Meclib.Memo.isDown){Meclib.Memo.select.end={x:e,y:i},p.left>0&&(Meclib.Memo.select.end.x-=p.left),p.top>0&&(Meclib.Memo.select.end.y-=p.top);var h=Math.sqrt(Math.pow(Meclib.Memo.select.start.x-Meclib.Memo.select.end.x,2)+Math.pow(Meclib.Memo.select.start.y-Meclib.Memo.select.end.y,2));if(10===Meclib.Memo.select.type){if(Meclib.Memo.action.clearCanvas(1),Meclib.Memo.action.clearCanvas(2),h<2)return Meclib.Memo.select.end={x:!1,y:!1},Meclib.Memo.select.nowData.eraser={x1:0,x2:!1,y1:0,y2:!1},Meclib.Memo.select.nowData.eraser.x1=e/M,Meclib.Memo.select.nowData.eraser.y1=i/m,p.left>0?Meclib.Memo.select.nowData.eraser.x1-=p.left/M:1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?Meclib.Memo.select.nowData.eraser.x1+=p.left:Meclib.Memo.select.nowData.eraser.x1+=Math.abs(p.left/M),p.top>0?Meclib.Memo.select.nowData.eraser.y1-=p.top/m:1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?Meclib.Memo.select.nowData.eraser.y1+=p.top:Meclib.Memo.select.nowData.eraser.y1+=Math.abs(p.top/m),void Meclib.Memo.action.checkSelectedObjects(Meclib.Memo.select.nowData.eraser);l=0,Meclib.Memo.select.start.x>Meclib.Memo.select.end.x?(t=Meclib.Memo.select.end.x,a=Meclib.Memo.select.start.x-Meclib.Memo.select.end.x):(t=Meclib.Memo.select.start.x,a=Meclib.Memo.select.end.x-Meclib.Memo.select.start.x),Meclib.Memo.select.start.y1||Meclib.zoomScale>1)&&p.left<0&&(u.x+=Math.abs(p.left))),Meclib.Memo.wrkctx.beginPath(),Meclib.Memo.wrkctx.lineWidth=1,Meclib.Memo.wrkctx.lineCap="square",Meclib.Memo.wrkctx.lineJoin="bevel",Meclib.Memo.wrkctx.globalAlpha=Meclib.Memo.dragStyle.strokeAlpha,Meclib.Memo.wrkctx.strokeStyle=Meclib.Memo.dragStyle.strokeStyle,Meclib.Memo.wrkctx.strokeRect(u.x*Meclib.Memo.ratinaScale+.5,u.y*Meclib.Memo.ratinaScale+.5,u.width*Meclib.Memo.ratinaScale+.5,u.height*Meclib.Memo.ratinaScale+.5),Meclib.Memo.wrkctx.globalAlpha=Meclib.Memo.dragStyle.fillAlpha,Meclib.Memo.wrkctx.fillStyle=Meclib.Memo.dragStyle.fillStyle,Meclib.Memo.wrkctx.fillRect(u.x*Meclib.Memo.ratinaScale+.5,u.y*Meclib.Memo.ratinaScale+.5,u.width*Meclib.Memo.ratinaScale+.5,u.height*Meclib.Memo.ratinaScale+.5),Meclib.Memo.wrkctx.closePath(),Meclib.Memo.wrkctx.globalAlpha=1,Meclib.Memo.wrkctx.lineJoin=Meclib.Memo.prectx.lineCap="round",Meclib.Memo.select.nowData.eraser={x1:t,x2:t+a,y1:o,y2:o+l},Meclib.Memo.select.nowData.eraser.x1=Meclib.Memo.select.nowData.eraser.x1/M,Meclib.Memo.select.nowData.eraser.y1=Meclib.Memo.select.nowData.eraser.y1/m,Meclib.Memo.select.nowData.eraser.x2=Meclib.Memo.select.nowData.eraser.x2/M,Meclib.Memo.select.nowData.eraser.y2=Meclib.Memo.select.nowData.eraser.y2/m,p.left<0&&(1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?(Meclib.Memo.select.nowData.eraser.x1+=p.left,Meclib.Memo.select.nowData.eraser.x2+=p.left):(Meclib.Memo.select.nowData.eraser.x1+=Math.abs(p.left/M),Meclib.Memo.select.nowData.eraser.x2+=Math.abs(p.left/M))),p.top<0&&(1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?(Meclib.Memo.select.nowData.eraser.y1+=p.top,Meclib.Memo.select.nowData.eraser.y2+=p.top):(Meclib.Memo.select.nowData.eraser.y1+=Math.abs(p.top/m),Meclib.Memo.select.nowData.eraser.y2+=Math.abs(p.top/m))),Meclib.Memo.action.checkSelectedObjects(Meclib.Memo.select.nowData.eraser)}if(Meclib.Memo.prectx.shadowBlur=0,1===Meclib.Memo.select.type){var A={x:e,y:i},v=Meclib.Memo.action.distanceBetween(Meclib.Memo.select.lastPoint,A),f=Meclib.Memo.action.angleBetween(Meclib.Memo.select.lastPoint,A),C=[];if(v>10&&(v=10),v<4)return;Meclib.Memo.select.nowData.pen.lw=Meclib.Memo.select.borderWidth,Meclib.Memo.select.nowData.pen.color=Meclib.Memo.select.color,Meclib.Memo.select.nowData.pen.alpha=Meclib.Memo.select.borderAlpha;for(var w=0;wMeclib.Memo.select.end.x?Meclib.Memo.select.start.x-Meclib.Memo.select.end.x:Meclib.Memo.select.end.x-Meclib.Memo.select.start.x)>=(Meclib.Memo.select.start.y1||Meclib.zoomScale>1)&&p.left<0&&(P.start.x+=Math.abs(p.left),P.end.x+=Math.abs(p.left))),Meclib.Memo.prectx.lineWidth=Meclib.Memo.select.borderWidth*M*Meclib.Memo.ratinaScale,Meclib.Memo.prectx.strokeStyle="rgba("+Meclib.Memo.select.color[0]+","+Meclib.Memo.select.color[1]+","+Meclib.Memo.select.color[2]+",1)",Meclib.Memo.prectx.globalAlpha=Meclib.Memo.select.borderAlpha,Meclib.Memo.prectx.beginPath(),Meclib.Memo.prectx.lineCap="round",Meclib.Memo.prectx.lineJoin="round",Meclib.Memo.prectx.moveTo(P.start.x*Meclib.Memo.ratinaScale,P.start.y*Meclib.Memo.ratinaScale),Meclib.Memo.prectx.lineTo(P.end.x*Meclib.Memo.ratinaScale,P.end.y*Meclib.Memo.ratinaScale),Meclib.Memo.prectx.stroke(),Meclib.Memo.prectx.closePath(),Meclib.Memo.prectx.globalAlpha=1}if(3===Meclib.Memo.select.type){Meclib.Memo.action.clearCanvas(1),o=0,d=0,Meclib.Memo.select.start.x>Meclib.Memo.select.end.x?(t=Meclib.Memo.select.end.x,n=Meclib.Memo.select.start.x-Meclib.Memo.select.end.x,c=0):(t=Meclib.Memo.select.start.x,n=Meclib.Memo.select.end.x-Meclib.Memo.select.start.x),Meclib.Memo.select.start.y=d?(r=n-d,d=n,0===s&&(r>0?o-=r:o+=r)):(g=d-n,n=d,0===c&&(g>0?t-=g:t+=g))),Meclib.Memo.select.nowData.rect={style:Meclib.Memo.prectx.strokeStyle,lw:Meclib.Memo.select.borderWidth,x:t,y:o,width:n,height:d};var G={x:t,y:o,width:n,height:d};!0===Meclib.Function.isSingleCoverPageNow()&&Meclib.Globals.book.currentPage===Meclib.Globals.book.getRightPage()&&(G.x-=Meclib.Globals.book.thumbWidth*M,(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&p.left<0&&(G.x+=Math.abs(p.left))),Meclib.Memo.prectx.beginPath(),Meclib.Memo.prectx.lineWidth=Meclib.Memo.select.borderWidth*M*Meclib.Memo.ratinaScale,Meclib.Memo.prectx.strokeStyle="rgba("+Meclib.Memo.select.color[0]+","+Meclib.Memo.select.color[1]+","+Meclib.Memo.select.color[2]+","+Meclib.Memo.select.borderAlpha+")",Meclib.Memo.prectx.lineCap="round",Meclib.Memo.prectx.lineJoin="round",Meclib.Memo.prectx.strokeRect(G.x*Meclib.Memo.ratinaScale,G.y*Meclib.Memo.ratinaScale,G.width*Meclib.Memo.ratinaScale,G.height*Meclib.Memo.ratinaScale),Meclib.Memo.prectx.closePath()}if(4===Meclib.Memo.select.type){Meclib.Memo.action.clearCanvas(1),Meclib.Memo.prectx.lineWidth=Meclib.Memo.select.borderWidth*M,Meclib.Memo.prectx.strokeStyle="rgba("+Meclib.Memo.select.color[0]+","+Meclib.Memo.select.color[1]+","+Meclib.Memo.select.color[2]+","+Meclib.Memo.select.borderAlpha+")";var V={left:0,top:0,right:0,bottom:0};Meclib.Memo.select.start.x>Meclib.Memo.select.end.x?(V.left=Meclib.Memo.select.end.x,V.right=Meclib.Memo.select.start.x,c=0):(V.left=Meclib.Memo.select.start.x,V.right=Meclib.Memo.select.end.x),Meclib.Memo.select.start.y=T?(r=S-T,T=S,0===s&&(r>0?V.top-=r:V.top+=r)):(g=T-S,S=T,0===c&&(g>0?V.left-=g:V.left+=g))),Meclib.Memo.select.nowData.circle={style:Meclib.Memo.prectx.strokeStyle,lw:Meclib.Memo.select.borderWidth,x:V.left,y:V.top,width:S,height:T};var L={style:Meclib.Memo.prectx.strokeStyle,lw:Meclib.Memo.select.borderWidth,x:V.left,y:V.top,width:S,height:T};Meclib.Function.isSingleCoverPage()&&0!==Meclib.Globals.book.getRightPage()&&1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&(L.x-=Meclib.Globals.book.thumbWidth*M),Meclib.Memo.action.drawCircle(1,L)}}else 10===Meclib.Memo.select.type&&(Meclib.Memo.action.clearCanvas(1),Meclib.Memo.select.end={x:!1,y:!1},Meclib.Memo.select.nowData.eraser={x1:0,x2:!1,y1:0,y2:!1},Meclib.Memo.select.nowData.eraser.x1=e/M,Meclib.Memo.select.nowData.eraser.y1=i/m,p.left>0?Meclib.Memo.select.nowData.eraser.x1-=p.left/M:1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?Meclib.Memo.select.nowData.eraser.x1+=p.left:Meclib.Memo.select.nowData.eraser.x1+=Math.abs(p.left/M),p.top>0?Meclib.Memo.select.nowData.eraser.y1-=p.top/m:1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?Meclib.Memo.select.nowData.eraser.y1+=p.top:Meclib.Memo.select.nowData.eraser.y1+=Math.abs(p.top/m),Meclib.Memo.action.checkSelectedObjects(Meclib.Memo.select.nowData.eraser))},Meclib.Memo.action.onUpMemo=function(){if($("#header,#footer").show(),Meclib.Memo.isDown){Meclib.Memo.isDown=!1,Meclib.Memo.isClick=!1,!1===Meclib.Memo.select.end.x&&!1===Meclib.Memo.select.end.y&&(Meclib.Memo.isClick=!0);var e=Meclib.Function.getCssVal("#page-area"),i={left:e.left,top:e.top,width:e.width,height:e.height},t={x:i.left,y:i.top};1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&(i={left:Meclib.Globals.bookCanvas.left,top:Meclib.Globals.bookCanvas.top,width:Meclib.Globals.bookCanvas.canvasWidth,height:Meclib.Globals.bookCanvas.canvasHeight},t={x:0,y:0});var o=$("#canvas-leftpage").width()/Meclib.Globals.book.thumbWidth,a=$("#canvas-leftpage").height()/Meclib.Globals.book.thumbHeight;if(Meclib.Memo.select.start.x=Meclib.Memo.select.start.x/o,Meclib.Memo.select.start.y=Meclib.Memo.select.start.y/a,Meclib.Memo.isClick||(Meclib.Memo.select.end.x=Meclib.Memo.select.end.x/o,Meclib.Memo.select.end.y=Meclib.Memo.select.end.y/a),i.left<0&&(Meclib.Memo.select.start.x-=i.left/o,Meclib.Memo.select.end.x-=i.left/o),i.top<0&&(Meclib.Memo.select.start.y-=i.top/a,Meclib.Memo.select.end.y-=i.top/a),10===Meclib.Memo.select.type)return Meclib.Memo.action.checkSelectedObjects(Meclib.Memo.select.nowData.eraser,!0),Meclib.Memo.action.clearCanvas(-1),void Meclib.Memo.action.redraw();if(!Meclib.Memo.isClick){if(1===Meclib.Memo.select.type){var l=Meclib.Memo.select.nowData.pen.data.length;if(0===l)return;Meclib.Memo.select.nowData.pen.page=[],Meclib.Memo.select.nowData.pen.op=0;for(var n={start:0,end:0},c=0,s=0,r=0;rMeclib.Globals.book.thumbWidth?(n.start=Meclib.Globals.book.getRightPage(),s=1):n.start=Meclib.Globals.book.getLeftPage():n.start=Meclib.Globals.book.currentPage;else if(r===l-1)!0===Meclib.Function.isTwoPage()?Meclib.Function.isSingleCoverPage()?n.end=Meclib.Globals.book.currentPage:g[0]>Meclib.Globals.book.thumbWidth?0===s&&(n.end=Meclib.Globals.book.getRightPage()):1===s&&(n.end=Meclib.Globals.book.getLeftPage()):n.end=Meclib.Globals.book.currentPage;else{var b=0;!0===Meclib.Function.isTwoPage()?Meclib.Function.isSingleCoverPage()?(Meclib.Globals.book.currentPage,Meclib.Globals.book.currentPage===Meclib.Globals.book.getRightPage()&&(b=1)):g[0]>Meclib.Globals.book.thumbWidth?(Meclib.Globals.book.getRightPage(),b=1):Meclib.Globals.book.getLeftPage():Meclib.Globals.book.currentPage===Meclib.Globals.book.getRightPage()&&0!==Meclib.Globals.book.getRightPage()&&(b=1),!0===Meclib.Function.isTwoPage()&&s!==b&&(c=1)}1===s&&(g[0]-=Meclib.Globals.book.thumbWidth)}Meclib.Memo.select.nowData.pen.op=c,Meclib.Memo.select.nowData.pen.page.push(n.start),1===c&&(0===s?Meclib.Memo.select.nowData.pen.page.push(Meclib.Globals.book.getRightPage()):Meclib.Memo.select.nowData.pen.page.push(Meclib.Globals.book.getLeftPage())),Meclib.Memo.action.addPen(Meclib.Memo.select.nowData.pen),Meclib.Memo.action.clearCanvas(),Meclib.Memo.action.redraw()}if(2===Meclib.Memo.select.type){if(!Meclib.Memo.isClick){var p={start:Meclib.Memo.select.start,lw:Meclib.Memo.select.borderWidth,end:Meclib.Memo.select.end,alpha:Meclib.Memo.select.borderAlpha,style:"rgba("+Meclib.Memo.select.color[0]+","+Meclib.Memo.select.color[1]+","+Meclib.Memo.select.color[2]+",1)",page:[]};!0===Meclib.Function.isTwoPage()?(s=0,Meclib.Function.isSingleCoverPage()?(p.page.push(Meclib.Globals.book.currentPage),Meclib.Globals.book.currentPage===Meclib.Globals.book.getRightPage()&&(s=1,p.start.x-=Meclib.Globals.book.thumbWidth,p.end.x-=Meclib.Globals.book.thumbWidth)):(p.start.x>Meclib.Globals.book.thumbWidth?(p.page.push(Meclib.Globals.book.getRightPage()),s=1):p.page.push(Meclib.Globals.book.getLeftPage()),p.end.x>Meclib.Globals.book.thumbWidth?0===s&&p.page.push(Meclib.Globals.book.getRightPage()):1===s&&p.page.push(Meclib.Globals.book.getLeftPage()),1===s&&(p.start.x-=Meclib.Globals.book.thumbWidth,p.end.x-=Meclib.Globals.book.thumbWidth))):p.page.push(Meclib.Globals.book.currentPage),Meclib.Memo.action.addLine(p)}Meclib.Memo.action.clearCanvas(),Meclib.Memo.action.redraw()}3===Meclib.Memo.select.type&&(Meclib.Memo.select.nowData.rect.x=Meclib.Memo.select.nowData.rect.x/o,Meclib.Memo.select.nowData.rect.y=Meclib.Memo.select.nowData.rect.y/a,i.left<0&&(Meclib.Memo.select.nowData.rect.x-=i.left/o),i.top<0&&(Meclib.Memo.select.nowData.rect.y-=i.top/a),Meclib.Memo.select.nowData.rect.width=Meclib.Memo.select.nowData.rect.width/o,Meclib.Memo.select.nowData.rect.height=Meclib.Memo.select.nowData.rect.height/a,Meclib.Memo.select.nowData.rect.page=[],!0===Meclib.Function.isTwoPage()?(s=0,Meclib.Function.isSingleCoverPageNow()?(Meclib.Memo.select.nowData.rect.page.push(Meclib.Globals.book.currentPage),Meclib.Globals.book.currentPage===Meclib.Globals.book.getRightPage()&&(s=1,Meclib.Memo.select.nowData.rect.x-=Meclib.Globals.book.thumbWidth)):(Meclib.Memo.select.nowData.rect.x>Meclib.Globals.book.thumbWidth?(Meclib.Memo.select.nowData.rect.page.push(Meclib.Globals.book.getRightPage()),s=1):Meclib.Memo.select.nowData.rect.page.push(Meclib.Globals.book.getLeftPage()),Meclib.Memo.select.nowData.rect.x+Meclib.Memo.select.nowData.rect.width>Meclib.Globals.book.thumbWidth?0===s&&Meclib.Memo.select.nowData.rect.page.push(Meclib.Globals.book.getRightPage()):1===s&&Meclib.Memo.select.nowData.rect.page.push(Meclib.Globals.book.getLeftPage()),1===s&&(Meclib.Memo.select.nowData.rect.x-=Meclib.Globals.book.thumbWidth))):Meclib.Memo.select.nowData.rect.page.push(Meclib.Globals.book.currentPage),Meclib.Memo.action.addRect(Meclib.Memo.select.nowData.rect),Meclib.Memo.action.clearCanvas(),Meclib.Memo.action.redraw()),4===Meclib.Memo.select.type&&(Meclib.Memo.select.nowData.circle.x=Meclib.Memo.select.nowData.circle.x/o,Meclib.Memo.select.nowData.circle.y=Meclib.Memo.select.nowData.circle.y/a,i.left<0&&(Meclib.Memo.select.nowData.circle.x-=i.left/o),i.top<0&&(Meclib.Memo.select.nowData.circle.y-=i.top/a),Meclib.Memo.select.nowData.circle.width=Meclib.Memo.select.nowData.circle.width/o,Meclib.Memo.select.nowData.circle.height=Meclib.Memo.select.nowData.circle.height/a,Meclib.Memo.select.nowData.circle.page=[],!0===Meclib.Function.isTwoPage()?(s=0,Meclib.Function.isSingleCoverPageNow()?(Meclib.Memo.select.nowData.circle.page.push(Meclib.Globals.book.currentPage),Meclib.Globals.book.currentPage===Meclib.Globals.book.getRightPage()&&(s=1,Meclib.Memo.select.nowData.circle.x-=Meclib.Globals.book.thumbWidth)):(Meclib.Memo.select.nowData.circle.x>Meclib.Globals.book.thumbWidth?(Meclib.Memo.select.nowData.circle.page.push(Meclib.Globals.book.getRightPage()),s=1):Meclib.Memo.select.nowData.circle.page.push(Meclib.Globals.book.getLeftPage()),Meclib.Memo.select.nowData.circle.x+Meclib.Memo.select.nowData.circle.width>Meclib.Globals.book.thumbWidth?0===s&&Meclib.Memo.select.nowData.circle.page.push(Meclib.Globals.book.getRightPage()):1===s&&Meclib.Memo.select.nowData.circle.page.push(Meclib.Globals.book.getLeftPage()),1===s&&(Meclib.Memo.select.nowData.circle.x-=Meclib.Globals.book.thumbWidth))):Meclib.Memo.select.nowData.circle.page.push(Meclib.Globals.book.currentPage),Meclib.Memo.action.addCircle(Meclib.Memo.select.nowData.circle),Meclib.Memo.action.clearCanvas(),Meclib.Memo.action.redraw()),Meclib.Memo.action.clearCanvas(1),Meclib.Memo.select.start={x:0,y:0},Meclib.Memo.select.end={x:!1,y:!1},Meclib.Memo.select.nowData={pen:{data:[],page:[],op:0},line:[],rect:[],circle:[],eraser:[]}}}},Meclib.Memo.action.drawCircle=function(e,i){i=JSON.parse(JSON.stringify(i));var t=Meclib.Memo.ctx,o=Meclib.Function.getCssVal("#page-area"),a={left:o.left,top:o.top,width:o.width,height:o.height};1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&(a={left:0,top:0,width:Meclib.Globals.bookCanvas.canvasWidth,height:Meclib.Globals.bookCanvas.canvasHeight});var l=$("#canvas-leftpage").width()/Meclib.Globals.book.thumbWidth,n=$("#canvas-leftpage").height()/Meclib.Globals.book.thumbHeight;1===e&&(t=Meclib.Memo.prectx),t.lineWidth=i.lw*l*Meclib.Memo.ratinaScale,t.strokeStyle=i.style,2===e&&((t=Meclib.Memo.prectx).lineWidth=i.lw*l*Meclib.Memo.ratinaScale,t.strokeStyle=Meclib.Memo.selectedStyle.strokeStyle),0!==e&&2!==e||(i.width=i.width*l,i.height=i.height*n,i.x=i.x*l,i.y=i.y*n,a.left<0&&(i.x=i.x+a.left),a.top<0&&(i.y=i.y+a.top)),!0===Meclib.Function.isTwoPage()&&(0!==e&&2!==e||i.page[0]===Meclib.Globals.book.getRightPage()&&(i.x+=Meclib.Globals.book.thumbWidth*l),!0===Meclib.Function.isSingleCoverPageNow()&&Meclib.Globals.book.currentPage===Meclib.Globals.book.getRightPage()&&(i.x-=Meclib.Globals.book.thumbWidth*l,(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&a.left<0&&(i.x+=Math.abs(a.left))));var c,s,r,g;c={x:i.x+i.width/2,y:i.y},s={x:i.x+i.width,y:i.y+i.height/2},r={x:i.x+i.width/2,y:i.y+i.height};var b=((g={x:i.x,y:i.y+i.height/2}).x>s.x?g.x-s.x:s.x-g.x)/2,p=(r.y>c.y?r.y-c.y:c.y-r.y)/2,d=4*(Math.sqrt(2)-1)*b/3,M=4*(Math.sqrt(2)-1)*p/3,m=c.x+d,h=c.y,u=s.x,A=s.y-M,v=s.x,f=s.y+M,C=r.x+d,w=r.y,I=r.x-d,x=r.y,y=g.x,k=g.y+M,P=g.x,G=g.y-M,V=c.x-d,S=c.y;t.beginPath(),t.moveTo(c.x*Meclib.Memo.ratinaScale,c.y*Meclib.Memo.ratinaScale),t.bezierCurveTo(m*Meclib.Memo.ratinaScale,h*Meclib.Memo.ratinaScale,u*Meclib.Memo.ratinaScale,A*Meclib.Memo.ratinaScale,s.x*Meclib.Memo.ratinaScale,s.y*Meclib.Memo.ratinaScale),t.bezierCurveTo(v*Meclib.Memo.ratinaScale,f*Meclib.Memo.ratinaScale,C*Meclib.Memo.ratinaScale,w*Meclib.Memo.ratinaScale,r.x*Meclib.Memo.ratinaScale,r.y*Meclib.Memo.ratinaScale),t.bezierCurveTo(I*Meclib.Memo.ratinaScale,x*Meclib.Memo.ratinaScale,y*Meclib.Memo.ratinaScale,k*Meclib.Memo.ratinaScale,g.x*Meclib.Memo.ratinaScale,g.y*Meclib.Memo.ratinaScale),t.bezierCurveTo(P*Meclib.Memo.ratinaScale,G*Meclib.Memo.ratinaScale,V*Meclib.Memo.ratinaScale,S*Meclib.Memo.ratinaScale,c.x*Meclib.Memo.ratinaScale,c.y*Meclib.Memo.ratinaScale),t.stroke()},Meclib.Memo.action.addPen=function(e){if(void 0!==e){for(var i=0;i=0;i--){var t=JSON.parse(JSON.stringify(Meclib.Memo.MemoSaveData[i]))[1];if(0!==Object.keys(t).length)if(t.page.length>1){if(Meclib.Function.isNowPage(t.page[0])||Meclib.Function.isNowPage(t.page[1])){Meclib.Memo.MemoSaveData.splice(i,1);continue}}else if(Meclib.Function.isNowPage(t.page[0])){Meclib.Memo.MemoSaveData.splice(i,1);continue}}Meclib.Memo.MemoSaveData=Meclib.Memo.MemoSaveData.filter((function(e){return""!==e})),Meclib.Memo.action.saveMemo(),Meclib.Memo.action.clearCanvas(-1),Meclib.Memo.action.redraw()}},Meclib.Memo.action.clearAll=function(){Meclib.Memo.MemoSaveData=[],Meclib.Memo.action.clearCanvas(-1),Meclib.Memo.action.redraw()},Meclib.Memo.action.saveMemo=function(){var e=Meclib.Memo.MemoSaveData.slice();Meclib.Memo.MemoSaveQueueData.push(e),$('.btn-memo-tool[data-type="undo"]').removeClass("disabled"),Meclib.Memo.MemoSaveQueueData.length>Meclib.Memo.MemoSaveQueueMax&&(Meclib.Memo.MemoSaveLastData=JSON.parse(JSON.stringify(Meclib.Memo.MemoSaveQueueData[0])),Meclib.Memo.MemoSaveQueueData.splice(0,1));var i=Meclib.Function.getSaveFormatDate();Meclib.IndexedDb.memo.put({id:Meclib.Globals.book.uniId,book_id:Meclib.Globals.book.bookId,data:JSON.stringify(e),updated_at:i}).then((function(){})).catch((function(e){console.log("Error: "+(e.stack||e))}))},Meclib.Memo.action.sendMemo=function(){var e="/library/api/user-memo/update",i={book_id:Meclib.Globals.book.bookId,memo_data:JSON.stringify(Meclib.Memo.MemoSaveData.slice())},t=!0;arguments.length>0&&!1===arguments[0]&&(t=!1),$.ajax({type:"PUT",data:i,async:t,scriptCharset:"utf-8",url:e}).done((function(e){Meclib.Memo.MemoSaveLastData=JSON.parse(JSON.stringify(Meclib.Memo.MemoSaveData)),Meclib.IndexedDb.memo.delete(2)})).fail((function(){}))},Meclib.Memo.action.loadMemo=function(){var e={book_id:Meclib.Globals.book.bookId};$.ajax({type:"POST",data:e,dataType:"json",scriptCharset:"utf-8",url:"/library/api/user-memo"}).done((function(e){try{"object"==typeof e.message?0===Object.keys(e).length?Meclib.Memo.MemoSaveData=[]:Meclib.Memo.MemoSaveData=e.message:"string"==typeof e.message?(Meclib.Memo.MemoSaveData=JSON.parse(e.message),"string"==typeof Meclib.Memo.MemoSaveData&&(Meclib.Memo.MemoSaveData=JSON.parse(Meclib.Memo.MemoSaveData))):Meclib.Memo.MemoSaveData=[],e.updated_at.date&&Meclib.IndexedDb.memo.where("id").equals(1).first().then((function(i){Meclib.Function.compareDate(e.updated_at.date,i.updated_at)}))}catch(e){Meclib.Memo.MemoSaveData=[],console.error(e)}Meclib.Memo.action.parseMemoData()})).fail((function(e,i,t){}))},Meclib.Memo.action.getPointCB=function(e,i,t,o,a,l,n,c,s){var r=1-e;return{x:e*e*e*c+3*e*e*r*l+3*e*r*r*o+r*r*r*i,y:e*e*e*s+3*e*e*r*n+3*e*r*r*a+r*r*r*t}},Meclib.Memo.action.getPointCBint=function(e,i,t,o,a,l,n,c,s){var r=1-e,g=e*e*e*c+3*e*e*r*l+3*e*r*r*o+r*r*r*i,b=e*e*e*s+3*e*e*r*n+3*e*r*r*a+r*r*r*t;return{x:g=parseInt(g,10),y:b=parseInt(b,10)}},Meclib.Memo.action.rect2point=function(e){var i,t,o,a;i={x:e.x+e.width/2,y:e.y},t={x:e.x+e.width,y:e.y+e.height/2},o={x:e.x+e.width/2,y:e.y+e.height};var l=((a={x:e.x,y:e.y+e.height/2}).x>t.x?a.x-t.x:t.x-a.x)/2,n=(o.y>i.y?o.y-i.y:i.y-o.y)/2,c=4*(Math.sqrt(2)-1)*l/3,s=4*(Math.sqrt(2)-1)*n/3;return{pointA:i,pointB:t,pointC:o,pointD:a,pointAB1:{x:i.x+c,y:i.y},pointAB2:{x:t.x,y:t.y-s},pointBC1:{x:t.x,y:t.y+s},pointBC2:{x:o.x+c,y:o.y},pointCD1:{x:o.x-c,y:o.y},pointCD2:{x:a.x,y:a.y+s},pointDA1:{x:a.x,y:a.y-s},pointDA2:{x:i.x-c,y:i.y}}},Meclib.Memo.action.isCircumference=function(e,i){for(var t=i.x1,o=i.y1,a=e.pointA,l=e.pointB,n=e.pointC,c=e.pointD,s=e.pointAB1,r=e.pointAB2,g=e.pointBC1,b=e.pointBC2,p=e.pointCD1,d=e.pointCD2,M=e.pointDA1,m=e.pointDA2,h=0,u=0;u<1;u+=.01){var A,v,f,C;A=Meclib.Memo.action.getPointCBint(u,a.x,a.y,s.x,s.y,r.x,r.y,l.x,l.y),Math.sqrt(Math.pow(t-A.x,2)+Math.pow(o-A.y,2))0},Meclib.Memo.action.isInCircle=function(e,i){for(var t=e.pointA,o=e.pointB,a=e.pointC,l=e.pointD,n=e.pointAB1,c=e.pointAB2,s=e.pointBC1,r=e.pointBC2,g=e.pointCD1,b=e.pointCD2,p=e.pointDA1,d=e.pointDA2,M=0,m=0;m<1;m+=.01){var h,u,A,v;h=Meclib.Memo.action.getPointCBint(m,t.x,t.y,n.x,n.y,c.x,c.y,o.x,o.y),Meclib.Memo.action.isPointInRect(i,h)&&M++,u=Meclib.Memo.action.getPointCBint(m,o.x,o.y,s.x,s.y,r.x,r.y,a.x,a.y),Meclib.Memo.action.isPointInRect(i,u)&&M++,A=Meclib.Memo.action.getPointCBint(m,a.x,a.y,g.x,g.y,b.x,b.y,l.x,l.y),Meclib.Memo.action.isPointInRect(i,A)&&M++,v=Meclib.Memo.action.getPointCBint(m,l.x,l.y,p.x,p.y,d.x,d.y,t.x,t.y),Meclib.Memo.action.isPointInRect(i,v)&&M++}return M>0},Meclib.Memo.action.isPointInRect=function(e,i){var t={x:!1,y:!1};return e.x1<=i.x&&e.x2>=i.x&&(t.x=!0),e.y1<=i.y&&e.y2>=i.y&&(t.y=!0),!0===t.x&&!0===t.y},Meclib.Memo.action.isPointInRectBorder=function(e,i){return Meclib.Memo.action.getDist2d(e.x1,i.x)=e.y1&&i.y<=e.y2||(Meclib.Memo.action.getDist2d(e.x2,i.x)=e.y1&&i.y<=e.y2||(Meclib.Memo.action.getDist2d(e.y1,i.y)=e.x1&&i.x<=e.x2||Meclib.Memo.action.getDist2d(e.y2,i.y)=e.x1&&i.x<=e.x2))},Meclib.Memo.action.isRectOverlapRectBorder=function(e,i){var t={x1:0,y1:0,x2:0,y2:0};return t={x1:e.x1,y1:e.y1,x2:e.x1,y2:e.y2},!!Meclib.Memo.action.isRectOverlapRect(i,t)||(t={x1:e.x2,y1:e.y1,x2:e.x2,y2:e.y2},!!Meclib.Memo.action.isRectOverlapRect(i,t)||(t={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y1},!!Meclib.Memo.action.isRectOverlapRect(i,t)||(t={x1:e.x1,y1:e.y2,x2:e.x2,y2:e.y2},!!Meclib.Memo.action.isRectOverlapRect(i,t))))},Meclib.Memo.action.isPointInLine=function(e,i){var t,o,a=!1,l=e.x1,n=e.y1,c=0,s={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},r={x1:i.x-Meclib.Memo.enableDistance/2,y1:i.y-Meclib.Memo.enableDistance/2,x2:i.x+Meclib.Memo.enableDistance/2,y2:i.y+Meclib.Memo.enableDistance/2},g=-1;if(e.x1>e.x2?(t=e.x1-e.x2,l=e.x2,n=e.y2,g=1,s.x1=e.x2,s.x2=e.x1):(t=e.x2-e.x1,l=e.x1,n=e.y1),e.y1e.y2?(c=(o=e.y1-e.y2)/t,s.y1=e.y2,s.y2=e.y1):c=0,t<10)return!!Meclib.Memo.action.isRectOverlapRect(r,s);if(o<10)return!!Meclib.Memo.action.isRectOverlapRect(r,s);for(var b=1;b<=t;b+=1){var p={x:l+b,y:n+c*b*g};if(Meclib.Memo.action.getPointsDistance(p,i)e.x2?(0===(t=e.x1-e.x2)&&(t=1),l=e.x2,n=e.y2,s=1,r.x1=e.x2,r.x2=e.x1):(0===(t=e.x2-e.x1)&&(t=1),l=e.x1,n=e.y1),e.y1e.y2?(0===(o=e.y1-e.y2)&&(o=1),c=o/t,r.y1=e.y2,r.y2=e.y1):c=0,t<10)return!!Meclib.Memo.action.isRectOverlapRect(i,r);if(o<10)return!!Meclib.Memo.action.isRectOverlapRect(i,r);var g=1;1===t&&(g=0);for(var b=g;b<=t;b+=1){var p={x:l+b,y:n+c*b*s};if(Meclib.Memo.action.isPointInRect(i,p)){a=!0;break}}return!!a},Meclib.Memo.action.distanceBetween=function(e,i){return Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2))},Meclib.Memo.action.angleBetween=function(e,i){return Math.atan2(i.x-e.x,i.y-e.y)},Meclib.Memo.action.getDist2d=function(e,i){return Math.sqrt(Math.pow(i-e,2))},Meclib.Memo.action.getPointsDistance=function(e,i){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))},Meclib.Memo.action.isRectOverlapRect=function(e,i){var t={x:!1,y:!1};if(!1===i.x2&&!1===i.y2){var o={x:e.x1+(e.x2-e.x1)/2,y:e.y1+(e.y2-e.y1)/2};return Math.sqrt(Math.pow(i.x1-o.x,2)+Math.pow(i.y1-o.y,2))=e.x1||i.x1<=e.x2&&i.x2>=e.x2)&&(t.x=!0),i.x1>=e.x1&&i.x2<=e.x2&&(t.x=!0),(i.y1<=e.y1&&i.y2>=e.y1||i.y1<=e.y2&&i.y2>=e.y2)&&(t.y=!0),i.y1>=e.y1&&i.y2<=e.y2&&(t.y=!0),!0===t.x&&!0===t.y},Meclib.Memo.action.isInPage=function(e){var i=Meclib.Memo.MemoSaveData.length;if(0===i)return!1;for(var t=!1,o=0;o1&&(i=arguments[1]);var t=Meclib.Memo.MemoSaveData.length;if(0!==t){var o=!1;!1===e.x2&&!1===e.y2&&(o=!0);for(var a=0,l=0,n=t-1;n>=0;n--){var c=JSON.parse(JSON.stringify(Meclib.Memo.MemoSaveData[n])),s=c[0],r=c[1];if(0!==Object.keys(r).length){if(r.page.length>1){if(!Meclib.Function.isNowPage(r.page[0])&&!Meclib.Function.isNowPage(r.page[1]))continue}else if(!Meclib.Function.isNowPage(r.page[0]))continue;if(l=0,1===s){var g=r.data;l=0;for(var b=0;b0&&(a++,Meclib.Memo.action.drawObject(c,!0),i&&Meclib.Memo.MemoSaveData.splice(n,1),o))break}if(l=0,2===s)if(d={x1:r.start.x,x2:r.end.x,y1:r.start.y,y2:r.end.y},!0===Meclib.Function.isTwoPage()&&r.page[0]===Meclib.Globals.book.getRightPage()&&(d.x1+=Meclib.Globals.book.thumbWidth,d.x2+=Meclib.Globals.book.thumbWidth),o){if(Meclib.Memo.action.isPointInLine(d,{x:e.x1,y:e.y1})){a++,Meclib.Memo.action.drawObject(Meclib.Memo.MemoSaveData[n],!0),i&&Meclib.Memo.MemoSaveData.splice(n,1);break}}else Meclib.Memo.action.isRectOverlapLine(d,e)&&(a++,Meclib.Memo.action.drawObject(Meclib.Memo.MemoSaveData[n],!0),i&&Meclib.Memo.MemoSaveData.splice(n,1));if(3===s)if(d={x1:r.x,x2:r.x+r.width,y1:r.y,y2:r.y+r.height},!0===Meclib.Function.isTwoPage()&&r.page[0]===Meclib.Globals.book.getRightPage()&&(d.x1+=Meclib.Globals.book.thumbWidth,d.x2+=Meclib.Globals.book.thumbWidth),o){if(Meclib.Memo.action.isPointInRectBorder(d,{x:e.x1,y:e.y1})){a++,Meclib.Memo.action.drawObject(c,!0),i&&Meclib.Memo.MemoSaveData.splice(n,1);break}}else Meclib.Memo.action.isRectOverlapRectBorder(d,e)&&(a++,Meclib.Memo.action.drawObject(c,!0),i&&Meclib.Memo.MemoSaveData.splice(n,1));if(4===s){!0===Meclib.Function.isTwoPage()&&r.page[0]===Meclib.Globals.book.getRightPage()&&(r.x+=Meclib.Globals.book.thumbWidth);var M=Meclib.Memo.action.rect2point(r);if(o){if(Meclib.Memo.action.isCircumference(M,e)){a++,Meclib.Memo.action.drawObject(Meclib.Memo.MemoSaveData[n],!0),i&&Meclib.Memo.MemoSaveData.splice(n,1);break}}else Meclib.Memo.action.isInCircle(M,e)&&(a++,Meclib.Memo.action.drawObject(Meclib.Memo.MemoSaveData[n],!0),i&&Meclib.Memo.MemoSaveData.splice(n,1))}}}Meclib.Memo.MemoSaveData=Meclib.Memo.MemoSaveData.filter((function(e){return""!==e})),a>0&&i&&Meclib.Memo.action.saveMemo()}},Meclib.Memo.action.drawObject=function(e){var i=!1;e=JSON.parse(JSON.stringify(e)),arguments.length>1&&!0===arguments[1]&&(i=!0);var t=e[0],o=e[1];if(0!==Object.keys(o).length){i&&10===Meclib.Memo.select.type?Meclib.Memo.selectedStyle.shadowBlur>0&&(Meclib.Memo.prectx.shadowBlur=Meclib.Memo.selectedStyle.shadowBlur,Meclib.Memo.prectx.shadowColor=Meclib.Memo.selectedStyle.shadowStyle):Meclib.Memo.prectx.shadowBlur=0;var a=Meclib.Function.getCssVal("#page-area"),l={left:a.left,top:a.top,width:a.width,height:a.height};1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&(l={left:Meclib.Globals.bookCanvas.left,top:Meclib.Globals.bookCanvas.top,width:Meclib.Globals.bookCanvas.canvasWidth,height:Meclib.Globals.bookCanvas.canvasHeight});var n=$("#canvas-leftpage").width()/Meclib.Globals.book.thumbWidth,c=$("#canvas-leftpage").height()/Meclib.Globals.book.thumbHeight,s=!1;if(1===t){var r=o.data,g=[];i||(Meclib.Memo.prectx.globalAlpha=o.alpha),Meclib.Memo.prectx.beginPath(),Meclib.Memo.prectx.lineJoin="round",Meclib.Memo.prectx.lineCap="round",Meclib.Memo.prectx.lineWidth=o.lw*n*Meclib.Memo.ratinaScale;for(var b=0;b1&&o.page[0]===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPage(o.page[0])&&(d=!0,s=!0))),i?(p[0]=p[0]*n,p[1]=p[1]*c,!1===s?(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&(l.left<0&&(p[0]=p[0]-Math.abs(l.left)),l.top<0&&(p[1]=p[1]-Math.abs(l.top))):Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1?l.top<0&&(p[1]=p[1]-Math.abs(l.top)):l.left<0&&(p[0]=p[0]+Math.abs(l.left))):(l.left<0&&!0===s&&(p[0]=p[0]+Math.abs(l.left)),l.left>0&&(p[0]-=l.left),l.top>0&&(p[1]-=l.top)),d&&(i?!1===s&&(p[0]+=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale()):p[0]-=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale()),0===b&&(g=p,Meclib.Memo.prectx.moveTo(g[0]*Meclib.Memo.ratinaScale,g[1]*Meclib.Memo.ratinaScale)),Meclib.Memo.prectx.lineTo(p[0]*Meclib.Memo.ratinaScale,p[1]*Meclib.Memo.ratinaScale),g=p}Meclib.Memo.prectx.stroke(),Meclib.Memo.prectx.globalAlpha=1,Meclib.Memo.prectx.closePath()}2===t&&(d=!1,!0===Meclib.Function.isTwoPage()&&(i?(o.page[0]!==Meclib.Globals.book.getRightPage()||Meclib.Function.isSingleCoverPage(o.page[0])||(d=!0),o.page[0]===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPage(o.page[0])&&(d=!0,s=!0)):(o.page[0]===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPage(o.page[0])&&1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&(d=!0),Meclib.Globals.viewer.get("scale")>1&&o.page[0]===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPage(o.page[0])&&(d=!0,s=!0))),i?(o.start.x=o.start.x*n,o.end.x=o.end.x*n,o.start.y=o.start.y*c,o.end.y=o.end.y*c,!1===s?(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&(l.left<0&&(o.start.x=o.start.x-Math.abs(l.left),o.end.x=o.end.x-Math.abs(l.left)),l.top<0&&(o.start.y=o.start.y-Math.abs(l.top),o.end.y=o.end.y-Math.abs(l.top))):Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1?l.top<0&&(o.start.y=o.start.y-Math.abs(l.top),o.end.y=o.end.y-Math.abs(l.top)):l.left<0&&(o.start.x=o.start.x+Math.abs(l.left),o.end.x=o.end.x+Math.abs(l.left))):(l.left<0&&!0===s&&(o.start.x=o.start.x+Math.abs(l.left),o.end.x=o.end.x+Math.abs(l.left)),l.left>0&&(o.start.x-=Math.abs(l.left),o.end.x-=Math.abs(l.left)),l.top>0&&(o.start.y+=Math.abs(l.top),o.end.y+=Math.abs(l.top))),d&&(i?!1===s&&(o.start.x+=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale(),o.end.x+=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale()):(o.start.x-=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale(),o.end.x-=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale())),Meclib.Memo.prectx.lineJoin="round",Meclib.Memo.prectx.lineCap="round",Meclib.Memo.prectx.lineWidth=o.lw*n*Meclib.Memo.ratinaScale,Meclib.Memo.prectx.strokeStyle=o.style,Meclib.Memo.prectx.beginPath(),i&&(Meclib.Memo.prectx.strokeStyle=Meclib.Memo.selectedStyle.strokeStyle),Meclib.Memo.prectx.moveTo(o.start.x*Meclib.Memo.ratinaScale,o.start.y*Meclib.Memo.ratinaScale),Meclib.Memo.prectx.lineTo(o.end.x*Meclib.Memo.ratinaScale,o.end.y*Meclib.Memo.ratinaScale),Meclib.Memo.prectx.stroke(),Meclib.Memo.prectx.closePath(),Meclib.Memo.prectx.globalAlpha=1),3===t&&(Meclib.Memo.prectx.lineWidth=o.lw*n*Meclib.Memo.ratinaScale,Meclib.Memo.prectx.strokeStyle=o.style,i&&(Meclib.Memo.prectx.strokeStyle=Meclib.Memo.selectedStyle.strokeStyle),Meclib.Memo.prectx.lineJoin="round",Meclib.Memo.prectx.lineCap="round",d=!1,!0===Meclib.Function.isTwoPage()&&(i?(o.page[0]!==Meclib.Globals.book.getRightPage()||Meclib.Function.isSingleCoverPage(o.page[0])||(d=!0),o.page[0]===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPage(o.page[0])&&(d=!0,s=!0)):(o.page[0]===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPage(o.page[0])&&1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&(d=!0),Meclib.Globals.viewer.get("scale")>1&&o.page[0]===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPage(o.page[0])&&(d=!0,s=!0))),i?(o.width=o.width*n,o.height=o.height*c,o.x=o.x*n,o.y=o.y*c,!1===s?(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&(l.left<0&&(o.x=o.x-Math.abs(l.left)),l.top<0&&(o.y=o.y-Math.abs(l.top))):Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1?l.top<0&&(o.y=o.y-Math.abs(l.top)):l.left<0&&(o.x=o.x+Math.abs(l.left))):(l.left<0&&!0===s&&(o.x=o.x+Math.abs(l.left)),l.left>0&&(o.x-=Math.abs(l.left)),l.top>0&&(o.y+=Math.abs(l.top))),d&&(i?!1===s&&(o.x+=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale()):o.x-=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale()),Meclib.Memo.prectx.strokeRect(o.x*Meclib.Memo.ratinaScale,o.y*Meclib.Memo.ratinaScale,o.width*Meclib.Memo.ratinaScale,o.height*Meclib.Memo.ratinaScale)),4===t&&Meclib.Memo.action.drawCircle(2,o)}},Meclib.Memo.action.parseMemoData=function(){for(var e=Meclib.Memo.MemoSaveData.length,i=[],t=0;t1){if(!Meclib.Function.isNowPage(s.page[0])&&!Meclib.Function.isNowPage(s.page[1]))continue}else if(!Meclib.Function.isNowPage(s.page[0]))continue;var b=s.data,p=[];Meclib.Memo.ctx.globalAlpha=s.alpha,Meclib.Memo.ctx.beginPath(),Meclib.Memo.ctx.lineJoin="round",Meclib.Memo.ctx.lineCap="round",Meclib.Memo.ctx.lineWidth=s.lw*o*Meclib.Memo.ratinaScale;for(var d=0;d1||Meclib.zoomScale>1)&&s.page[0]===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPage(s.page[0])&&(g=!0)):1===s.op&&(Meclib.Globals.book.currentPage===Meclib.Globals.book.getRightPage()?s.page[0]===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getLeftPage()&&(r=!0):s.page[0]===Meclib.Globals.book.getRightPage()&&0!==Meclib.Globals.book.getRightPage()&&(r=!0)),i<0&&!1===g&&(M[0]=M[0]+i),r&&(M[0]+=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale()),t<0&&(M[1]=M[1]+t),Meclib.Memo.ctx.strokeStyle="rgb("+s.color[0]+","+s.color[1]+","+s.color[2]+")",0===d&&(p=M,Meclib.Memo.ctx.moveTo(p[0]*Meclib.Memo.ratinaScale,p[1]*Meclib.Memo.ratinaScale)),Meclib.Memo.ctx.lineTo(M[0]*Meclib.Memo.ratinaScale,M[1]*Meclib.Memo.ratinaScale),p=M}Meclib.Memo.ctx.stroke(),Meclib.Memo.ctx.globalAlpha=1,Meclib.Memo.ctx.closePath()}if(2===c){if(s.page.length>1){if(!Meclib.Function.isNowPage(s.page[0])&&!Meclib.Function.isNowPage(s.page[1]))continue}else if(!Meclib.Function.isNowPage(s.page[0]))continue;s.start.x=s.start.x*o,s.end.x=s.end.x*o,s.start.y=s.start.y*a,s.end.y=s.end.y*a,r=!1,g=!1,!0===Meclib.Function.isTwoPage()?(s.page[0]!==Meclib.Globals.book.getRightPage()||Meclib.Function.isSingleCoverPage(s.page[0])||(r=!0),(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&s.page[0]===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPage(s.page[0])&&(g=!0)):1===s.op&&(Meclib.Globals.book.currentPage===Meclib.Globals.book.getRightPage()?s.page[0]===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getLeftPage()&&(r=!0):s.page[0]===Meclib.Globals.book.getRightPage()&&0!==Meclib.Globals.book.getRightPage()&&(r=!0)),i<0&&!1===g&&(s.start.x=s.start.x+i,s.end.x=s.end.x+i),r&&(s.start.x+=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale(),s.end.x+=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale()),t<0&&(s.start.y=s.start.y+t,s.end.y=s.end.y+t),Meclib.Memo.ctx.beginPath(),Meclib.Memo.ctx.lineWidth=s.lw*o*Meclib.Memo.ratinaScale,Meclib.Memo.ctx.strokeStyle=s.style,Meclib.Memo.ctx.globalAlpha=s.alpha,Meclib.Memo.ctx.lineJoin="round",Meclib.Memo.ctx.lineCap="round",Meclib.Memo.ctx.moveTo(s.start.x*Meclib.Memo.ratinaScale,s.start.y*Meclib.Memo.ratinaScale),Meclib.Memo.ctx.lineTo(s.end.x*Meclib.Memo.ratinaScale,s.end.y*Meclib.Memo.ratinaScale),Meclib.Memo.ctx.closePath(),Meclib.Memo.ctx.stroke(),Meclib.Memo.ctx.globalAlpha=1}if(3===c){if(s.page.length>1){if(!Meclib.Function.isNowPage(s.page[0])&&!Meclib.Function.isNowPage(s.page[1]))continue}else if(!Meclib.Function.isNowPage(s.page[0]))continue;s.width=s.width*o,s.height=s.height*a,s.x=s.x*o,s.y=s.y*a,r=!1,g=!1,!0===Meclib.Function.isTwoPage()?(s.page[0]!==Meclib.Globals.book.getRightPage()||Meclib.Function.isSingleCoverPage(s.page[0])||(r=!0),(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&s.page[0]===Meclib.Globals.book.getRightPage()&&Meclib.Function.isSingleCoverPage(s.page[0])&&(g=!0)):s.page.length>1&&(Meclib.Globals.book.currentPage===Meclib.Globals.book.getRightPage()?s.page[0]===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getLeftPage()&&(r=!0):s.page[0]===Meclib.Globals.book.getRightPage()&&0!==Meclib.Globals.book.getRightPage()&&(r=!0)),i<0&&!1===g&&(s.x=s.x+i),r&&(s.x+=Meclib.Globals.book.thumbWidth*Meclib.Function.getContentsScale()),t<0&&(s.y=s.y+t),Meclib.Memo.ctx.beginPath(),Meclib.Memo.ctx.lineJoin="round",Meclib.Memo.ctx.lineCap="round",Meclib.Memo.ctx.lineWidth=s.lw*o*Meclib.Memo.ratinaScale,Meclib.Memo.ctx.strokeStyle=s.style,Meclib.Memo.ctx.strokeRect(s.x*Meclib.Memo.ratinaScale,s.y*Meclib.Memo.ratinaScale,s.width*Meclib.Memo.ratinaScale,s.height*Meclib.Memo.ratinaScale),Meclib.Memo.ctx.closePath()}if(4===c){if(s.page.length>1){if(!Meclib.Function.isNowPage(s.page[0])&&!Meclib.Function.isNowPage(s.page[1]))continue}else if(!Meclib.Function.isNowPage(s.page[0]))continue;Meclib.Memo.action.drawCircle(0,s)}}}}},Meclib.Memo.action.clearCanvas=function(){var e=parseInt($("#memo-layer").css("width"),10),i=parseInt($("#memo-layer").css("height"),10);e*=Meclib.Memo.ratinaScale,i*=Meclib.Memo.ratinaScale;var t=0;1===arguments.length&&(t=arguments[0]),0===t&&Meclib.Memo.ctx.clearRect(0,0,e,i),1===t&&Meclib.Memo.prectx.clearRect(0,0,e,i),2===t&&Meclib.Memo.wrkctx.clearRect(0,0,e,i),-1===t&&(Meclib.Memo.ctx.clearRect(0,0,e,i),Meclib.Memo.prectx.clearRect(0,0,e,i),Meclib.Memo.wrkctx.clearRect(0,0,e,i))},ViewerApp.Views.CommentView=Backbone.View.extend({initialize:function(e){if(ViewerApp.mediator.on("book:ready",this.ready),ViewerApp.mediator.on("comment:load",this.load),ViewerApp.mediator.on("comment:draw",this.draw),ViewerApp.mediator.on("comment:drawSelectCommentArea",this.drawSelectCommentArea),ViewerApp.mediator.on("comment:drawPageHighlight",this.drawPageHighlight),ViewerApp.mediator.on("comment:clear",this.clear),ViewerApp.mediator.on("comment:show",this.show),ViewerApp.mediator.on("comment:hide",this.hide),ViewerApp.mediator.on("comment:closeList",this.close),ViewerApp.mediator.on("comment:drawList",this.drawList),ViewerApp.mediator.on("comment:getChildItems",this.getChildItems),ViewerApp.mediator.on("comment:addItemEvent",this.addItemEvent),ViewerApp.mediator.on("comment:addListEvent",this.addListEvent),ViewerApp.mediator.on("comment:resetMenu",this.resetMenu),ViewerApp.mediator.on("comment:startAreaSelectMode",this.startAreaSelectMode),ViewerApp.mediator.on("comment:endAreaSelectMode",this.endAreaSelectMode),ViewerApp.mediator.on("comment:onAreaSelect",this.onAreaSelect),ViewerApp.mediator.on("comment:backCommentAddInput",this.backCommentAddInput),ViewerApp.mediator.on("comment:onSelectTarget",this.onSelectTarget),ViewerApp.mediator.on("comment:onMoveTarget",this.onMoveTarget),ViewerApp.mediator.on("comment:releaseCrop",this.releaseCrop),ViewerApp.mediator.on("comment:onCommentArea",this.onCommentArea),ViewerApp.mediator.on("menu:resize",this.resize),ViewerApp.mediator.on("main:onMovedPage",this.reload),ViewerApp.mediator.on("comment:reload",this.reload),ViewerApp.mediator.on("comment:showAddInput",this.showAddInput),ViewerApp.mediator.on("comment:hideAddInput",this.hideAddInput),ViewerApp.mediator.on("comment:showReplyInput",this.showReplyInput),ViewerApp.mediator.on("comment:hideReplyInput",this.hideReplyInput),ViewerApp.mediator.on("comment:toggleOpenItem",this.toggleOpenItem),ViewerApp.mediator.on("comment:toggleFilterItems",this.toggleFilterItems),ViewerApp.mediator.on("comment:showDeleteMode",this.showDeleteMode),ViewerApp.mediator.on("comment:add",this.add),ViewerApp.mediator.on("comment:reply",this.reply),ViewerApp.mediator.on("comment:delete",this.delete),Meclib.Cache.Tpl.commentMenu="",Meclib.Cache.Tpl.commentList="",Meclib.Cache.Tpl.commentSubList="",Meclib.Cache.Tpl.commentSubItem="",Meclib.Cache.Tpl.commentAdd="",Meclib.Cache.Tpl.commentReply="","MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){switch(Meclib.Globals.viewer.get("device")){case 1:Meclib.Cache.Tpl.commentMenu=$("#comment-menu-template").html(),Meclib.Cache.Tpl.commentList=$("#sidemenu-comment-row-template").html(),Meclib.Cache.Tpl.commentSubItem=$("#sidemenu-comment-sub-template").html(),Meclib.Cache.Tpl.commentSubList=$("#sidemenu-comment-sub-row-template").html(),Meclib.Cache.Tpl.commentAdd=$("#sidemenu-comment-add-input-template").html(),Meclib.Cache.Tpl.commentReply=$("#sidemenu-comment-reply-input-template").html();break;case 2:Meclib.Cache.Tpl.commentMenu=$("#comment-menu-template").html(),Meclib.Cache.Tpl.commentList=$("#sd-sidemenu-comment-row-template").html(),Meclib.Cache.Tpl.commentSubItem=$("#sd-sidemenu-comment-sub-template").html(),Meclib.Cache.Tpl.commentSubList=$("#sd-sidemenu-comment-sub-row-template").html(),Meclib.Cache.Tpl.commentAdd=$("#sidemenu-comment-add-input-template").html(),Meclib.Cache.Tpl.commentReply=$("#sidemenu-comment-reply-input-template").html();break;case 3:Meclib.Cache.Tpl.commentMenu=$("#sp-comment-menu-template").html(),Meclib.Cache.Tpl.commentList=$("#sp-sidemenu-comment-row-template").html(),Meclib.Cache.Tpl.commentSubItem=$("#sp-sidemenu-comment-sub-template").html(),Meclib.Cache.Tpl.commentSubList=$("#sp-sidemenu-comment-sub-row-template").html(),Meclib.Cache.Tpl.commentAdd=$("#sp-sidemenu-comment-add-input-template").html(),Meclib.Cache.Tpl.commentReply=$("#sp-sidemenu-comment-reply-input-template").html()}Meclib.Initial.Events.comment=!1}},ready:function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){var e={deletable:!1};1===Meclib.Globals.viewer.get("enabedOptions").comment_deletable&&(e.deletable=!0),$("#menu-comment").append(_.template(Meclib.Cache.Tpl.commentMenu)(e))}},load:function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){var e=!1;1===arguments.length&&!0===arguments[0]&&(e=!0),Meclib.Comment.init=!1;var i=1;!0===Meclib.Comment.listFilter&&(i=2),Meclib.Lists.commentList.reset(),Meclib.Lists.commentList.fetch({cache:!1,dataType:"json",data:{action:"list",sort:i},type:"POST",success:function(i,t,o){Meclib.Globals.viewer.get("optionIncludes").comment=1,ViewerApp.mediator.trigger("menu:checkEnableMenu","comment"),!0===e&&(ViewerApp.mediator.trigger("comment:draw"),ViewerApp.mediator.trigger("comment:drawList",Meclib.Comment.highlightId))},error:function(){Meclib.Debug.log("error comment data",1)}})}},resize:function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){var e=Meclib.Function.getWinsize().height,i=0;switch(Meclib.Globals.viewer.get("device")){case 1:case 2:i=e-(Meclib.Size.headerHeight+Meclib.Size.footerHeight+Meclib.Size.sidemenuHeaderHeight);break;case 3:i=e-Meclib.Size.headerHeight-Meclib.Size.sidemenuHeaderHeight}Meclib.Comment.listHeight=i-40,$("#commentlist-items").css("height",Meclib.Comment.listHeight+"px"),$("#menu-comment").css("height",i+"px"),ViewerApp.mediator.trigger("comment:reload",!0)}},reload:function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){if($("."+Meclib.Comment.selectAreaClass).remove(),Meclib.Comment.selectArea="",1===arguments.length&&!0===arguments[0])return ViewerApp.mediator.trigger("comment:load",!0),!1;!1!==Meclib.Comment.init&&"commentList"===Meclib.Menu.name&&(!0===Meclib.Function.isSideMenuOpened()&&ViewerApp.mediator.trigger("comment:drawList"),ViewerApp.mediator.trigger("comment:resetMenu"))}},draw:function(){if(0!==Meclib.Globals.viewer.get("options").comment_area&&"MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){$(".comment-obj").remove(),Meclib.Lists.commentList.filter((function(e){return""===e.get("p_id")&&""!==e.get("area")}));var e=Meclib.Function.getContentsScale(),i=new Backbone.Collection(Meclib.Lists.commentList.toJSON());i.comparator=function(e){return new Date(e.get("a_date")).getTime()},i.sort(),""!=Meclib.Comment.selectArea&&ViewerApp.mediator.trigger("comment:drawSelectCommentArea"),i.each((function(i){var t=i.get("area");if(""===t)return!0;var o=$("
    "),a={};if(0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage)if(i.get("page")===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getLeftPage())a.left=Meclib.Function.getCssVal("#canvas-leftpage").left+t.x*e;else{if(i.get("page")!==Meclib.Globals.book.getRightPage()||0===Meclib.Globals.book.getRightPage())return!0;a.left=Meclib.Function.getCssVal("#canvas-rightpage").left+t.x*e}else{if(i.get("page")!==Meclib.Globals.book.currentPage)return!0;a.left=Meclib.Function.getCssVal("#canvas-leftpage").left+t.x*e}if(a.width=t.w*e,a.height=t.h*e,a.top=t.y*e+Meclib.Function.getCssVal("#canvas-leftpage").top,a.id="comment"+i.get("id"),$(l).css({opacity:""}),0===$("#"+a.id).length){$(o).addClass("comment-obj").attr({id:a.id,"data-id":i.get("id")}),$("#page-area").append(o);var l=$("
    ");$(l).css({width:"100%",height:"100%","background-color":"rgba("+Meclib.Function.hex2Rgb(Meclib.Comment.bgColor)+","+Meclib.Comment.bgAlpha+")"}),$(l).addClass("comment-bg"),$("#"+a.id).append(l);var n=$("");n.attr({}).css({top:Meclib.Link.icon_pos.top+7+"px",left:Meclib.Link.icon_pos.left+7+"px"}),$(n).addClass("comment-icon"),$("#"+a.id).append(n)}else $("#"+a.id).find(".comment-bg").each((function(){l=this,$(this).css({opacity:""})})),$("#"+a.id).find(".comment-icon").each((function(){$(this).css({top:Meclib.Link.icon_pos.top+"px",left:Meclib.Link.icon_pos.left+"px"})}));$("#"+a.id).css({width:a.width+"px",height:a.height+"px",left:a.left+"px",top:a.top+"px",cursor:"pointer"}),Meclib.Comment.highlightId===i.get("id")&&(Meclib.Comment.bgAlpha<.1&&$(l).css({"background-color":"rgba("+Meclib.Function.hex2Rgb(Meclib.Comment.bgColor)+",0.1)"}),Meclib.Function.elementBlink("#"+a.id,5,!1,(function(){Meclib.Comment.highlightId=""}))),ViewerApp.mediator.trigger("comment:addItemEvent")}))}},drawPageHighlight:function(e){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){ViewerApp.mediator.trigger("contents:hideAll");var i=$("
    "),t={left:0};if(0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage)if(e===Meclib.Globals.book.getLeftPage())t.width=Meclib.Function.getCssVal("#canvas-leftpage").width,t.height=Meclib.Function.getCssVal("#canvas-leftpage").height,t.top=Meclib.Function.getCssVal("#canvas-leftpage").top+1,t.left=Meclib.Function.getCssVal("#canvas-leftpage").left+1;else{if(e!==Meclib.Globals.book.getRightPage())return!0;t.width=Meclib.Function.getCssVal("#canvas-rightpage").width,t.height=Meclib.Function.getCssVal("#canvas-rightpage").height,t.top=Meclib.Function.getCssVal("#canvas-rightpage").top+1,t.left=Meclib.Function.getCssVal("#canvas-rightpage").left+1}else{if(e!==Meclib.Globals.book.currentPage)return!0;t.width=Meclib.Function.getCssVal("#canvas-leftpage").width,t.height=Meclib.Function.getCssVal("#canvas-leftpage").height,t.top=Meclib.Function.getCssVal("#canvas-leftpage").top+1,t.left=Meclib.Function.getCssVal("#canvas-leftpage").left+1}$("."+Meclib.Comment.pageHighlightClass).remove(),$(i).addClass(Meclib.Comment.pageHighlightClass).css({width:t.width+"px",height:t.height+"px",left:t.left+"px",top:t.top+"px"}),$("#page-area").append(i),Meclib.Function.elementBlink(i,4,!0,(function(){ViewerApp.mediator.trigger("contents:showAll")}))}},drawSelectCommentArea:function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){ViewerApp.mediator.trigger("contents:hideAll"),$(".comment-obj").hide();var e=$("
    "),i={},t=Meclib.Function.getContentsScale();if(i.left=0,0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage)if(Meclib.Comment.selectArea.page===Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getLeftPage())i.left=Meclib.Function.getCssVal("#canvas-leftpage").left+Meclib.Comment.selectArea.x*t;else{if(Meclib.Comment.selectArea.page!==Meclib.Globals.book.getRightPage()||0===Meclib.Globals.book.getRightPage())return!0;i.left=Meclib.Function.getCssVal("#canvas-rightpage").left+Meclib.Comment.selectArea.x*t}else{if(Meclib.Comment.selectArea.page!==Meclib.Globals.book.currentPage)return!0;i.left=Meclib.Function.getCssVal("#canvas-leftpage").left+Meclib.Comment.selectArea.x*t}i.width=Meclib.Comment.selectArea.width*t,i.height=Meclib.Comment.selectArea.height*t,i.top=Meclib.Comment.selectArea.y*t+Meclib.Function.getCssVal("#canvas-leftpage").top,$("."+Meclib.Comment.selectAreaClass).remove(),$(e).addClass(Meclib.Comment.selectAreaClass).css({width:i.width+"px",height:i.height+"px",left:i.left+"px",top:i.top+"px"}),$("#page-area").append(e),Meclib.Function.elementBlink(e,4,!1)}},show:function(){$(".comment-obj").show()},hide:function(){$(".comment-obj").hide()},clear:function(){$(".comment-obj").length&&$(".comment-obj").remove()},onCommentArea:function(e){"MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment&&(Meclib.Comment.highlightId=e,ViewerApp.mediator.trigger("footer:showCommentList"))},drawList:function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){if(!0===Meclib.Comment.init&&(ViewerApp.mediator.trigger("menu:closeLoading"),Meclib.Comment.currentPage===Meclib.Globals.book.currentPage&&""===Meclib.Comment.highlightId))return $("#menu-comment").show(),!1;if(!1===Meclib.Function.isSideMenuOpened()&&Meclib.Globals.viewer.get("device")<3)return ViewerApp.mediator.trigger("menu:closeLoading"),!1;var e=Meclib.Comment.highlightId;$("#menu-comment").show(),$("#commentlist-items").hide(),$("#commentlist-items").mCustomScrollbar("destroy"),$("#commentlist-items").html("");var i=Meclib.Lists.commentList.filter((function(e){return""===e.get("p_id")}));i=Meclib.Lists.commentList.where({p_id:""});for(var t=function(e){if(""===e.id)return"";for(var i=Meclib.Lists.commentList.where({p_id:e.id}),t="",o=0;o0?n.reply_num_disabled="":n.reply_num_disabled="-disabled",n.reply_num_name=Meclib.Message.comment.replyNum,c.deletable=n.deletable,""!==c&&(s.items=c,s.no=n.no,n.child=_.template(Meclib.Cache.Tpl.commentSubItem)(s)),o+=_.template(Meclib.Cache.Tpl.commentList)(n)}$("#commentlist-items").append(o);var r=Meclib.Comment.highlightId;Meclib.Comment.highlightId="",setTimeout((function(){$("#commentlist-items").find("li").each((function(e){var i=$(this).attr("data-id"),t=$(this).find("div.ev-comment-item").attr("data-no"),o=$("#c-txt-"+i).height(),a=Meclib.Lists.commentList.where({p_id:i});(1.5*Meclib.Comment.txtClosedHeight0)&&($(".icon-toggole-comment-area[data-no='"+t+"']").addClass("unfold").parent().addClass("selectable"),1.5*Meclib.Comment.txtClosedHeight0)&&($(".icon-toggole-comment-area[data-no='"+e+"']").addClass("unfold").parent().addClass("selectable"),1.5*Meclib.Comment.txtClosedHeight1||Meclib.zoomScale>1)&&(e.width=parseInt($("#page-area").css("width"),10),2!==Meclib.Globals.bookCanvas.canvasNum||0!==i&&0!==t||(e.width=e.width/2),e.height=parseInt($("#page-area").css("height"),10),$("#comment-select-area").css({width:e.width,height:e.height,top:0,left:e.left})),setTimeout((function(){null!==Meclib.Comment.jCropApi&&void 0!==Meclib.Comment.jCropApi||(Meclib.Comment.jCropApi=$.Jcrop("#comment-select-target"),Meclib.Comment.jCropApi.release()),$("#comment-select-target").Jcrop({onSelect:function(e){3===Meclib.Event.type&&e.w<10&&e.h<10?ViewerApp.mediator.trigger("comment:endAreaSelectMode"):ViewerApp.mediator.trigger("comment:onAreaSelect",e)},onRelease:function(e){ViewerApp.mediator.trigger("comment:releaseCrop"),ViewerApp.mediator.trigger("comment:backCommentAddInput")}}),$(".jcrop-holder").css("background-color","rgb(0,0,0,0.3)")}),100))}},releaseCrop:function(){Meclib.Mode.commentSelect=!1,null!==Meclib.Comment.jCropApi&&void 0!==Meclib.Comment.jCropApi&&(Meclib.Comment.jCropApi.disable(),Meclib.Comment.jCropApi=null,$("#comment-select-area").remove())},endAreaSelectMode:function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){var e=!0;arguments.length>0&&(!0===arguments[0]?e=!0:!1===arguments[0]&&(e=!1)),null!==Meclib.Comment.jCropApi&&void 0!==Meclib.Comment.jCropApi?Meclib.Comment.jCropApi.release():ViewerApp.mediator.trigger("comment:releaseCrop"),!0===e&&ViewerApp.mediator.trigger("contents:changeCropMode",!1),1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay&&!0===Meclib.Mode.crop&&ViewerApp.mediator.trigger("menu:openMainMenu")}},onAreaSelect:function(e){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){var i={page:0,x:0,y:0,width:0,height:0},t=0,o=0,a=parseInt($("#comment-select-area").css("width"),10);if(2===Meclib.Globals.bookCanvas.canvasNum&&0!==Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getRightPage()){var l=0;t=Meclib.Globals.book.getLeftPage(),e.x>a/2&&(t=Meclib.Globals.book.getRightPage(),l=a/2),e.x2>a/2&&(o=Meclib.Globals.book.getRightPage()),i.page=t,i.width=e.x2-e.x,i.height=e.y2-e.y,i.x=e.x-l,i.y=e.y}else 2!==Meclib.Globals.bookCanvas.canvasNum||0!==Meclib.Globals.book.getLeftPage()&&0!==Meclib.Globals.book.getRightPage()?1===Meclib.Globals.bookCanvas.canvasNum&&(o=t=Meclib.Globals.book.currentPage,i.page=t,i.x=e.x,i.y=e.y,i.width=e.x2-e.x,i.height=e.y2-e.y):0!==Meclib.Globals.book.getLeftPage()?(o=t=Meclib.Globals.book.getLeftPage(),i.page=t,i.x=e.x,i.y=e.y,i.width=e.x2-e.x,i.height=e.y2-e.y):0!==Meclib.Globals.book.getRightPage()&&(o=t=Meclib.Globals.book.getRightPage(),i.page=t,i.x=e.x,i.y=e.y,i.width=e.x2-e.x,i.height=e.y2-e.y);if(0!==t||0!==o){var n=Meclib.Function.getContentsScale();i.x=i.x/n,i.y=i.y/n,i.width=i.width/n,i.height=i.height/n,Meclib.Comment.selectArea=i,new Messi(Meclib.Message.comment.confirm.areaSelect,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.yes,val:1},{id:1,label:Meclib.Message.common.no,val:2}],callback:function(e){"1"===e?ViewerApp.mediator.trigger("comment:backCommentAddInput"):Meclib.Comment.selectArea=""}})}}},add:function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){var e=Meclib.Globals.viewer.get("dataPath")+Meclib.Comment.server,i={user:"",text:"",page:"",area:""};i.user=$("#comment-user-input").val(),i.text=$("#comment-text-input").val(),$("#comment-user-input").blur(),$("#comment-text-input").blur(),$(".comment-target-select").each((function(e){$(this).hasClass("on")&&(i.page=$(this).attr("data-target"))}));var t=!1,o="";if(""===i.user?(t=!0,o=Meclib.Message.error.commentUserInput):""===i.text?(t=!0,o=Meclib.Message.error.commentTextInput):""===i.page&&(""!==Meclib.Comment.selectArea?(i.area=Meclib.Comment.selectArea,void 0===Meclib.Comment.selectArea.x||void 0===Meclib.Comment.selectArea.y||void 0===Meclib.Comment.selectArea.width||void 0===Meclib.Comment.selectArea.height||void 0===Meclib.Comment.selectArea.page?(t=!0,o=Meclib.Message.error.commentAreaSelect):(i.area={x:Meclib.Comment.selectArea.x,y:Meclib.Comment.selectArea.y,w:Meclib.Comment.selectArea.width,h:Meclib.Comment.selectArea.height},i.page=Meclib.Comment.selectArea.page,void 0!==i.area.x&&void 0!==i.area.y&&void 0!==i.area.w&&void 0!==i.area.h&&void 0!==i.page||(t=!0,o=Meclib.Message.error.commentAreaSelect))):(t=!0,o=Meclib.Message.error.commentAreaSelect)),!0===t)return new Messi(o,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.ok,val:1}],callback:function(e){}}),!1;var a={action:"add"};a.message=i,$.ajax({type:"POST",data:a,scriptCharset:"utf-8",url:e}).done((function(e){if(""===e)return"0"===i.page&&!0===Meclib.Comment.listFilter&&ViewerApp.mediator.trigger("comment:toggleFilterItems"),ViewerApp.mediator.trigger("contents:changeCropMode",!1),ViewerApp.mediator.trigger("comment:hideAddInput"),ViewerApp.mediator.trigger("comment:reload",!0),!1})).fail((function(e,i,t){}))}},reply:function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){var e=Meclib.Globals.viewer.get("dataPath")+Meclib.Comment.server,i={p_id:"",user:"",text:""};i.user=$("#comment-reply-user-input").val(),i.text=$("#comment-reply-text-input").val(),i.p_id=Meclib.Comment.replyId,$("#comment-reply-user-input").blur(),$("#comment-reply-text-input").blur();var t=!1,o="";if(""===i.user?(t=!0,o=Meclib.Message.error.commentUserInput):""===i.text?(t=!0,o=Meclib.Message.error.commentTextInput):""===i.p_id&&(t=!0,o=Meclib.Message.error.commentSubmit),!0===t)return new Messi(o,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.ok,val:1}],callback:function(e){}}),!1;var a={action:"reply"};a.message=i,$.ajax({type:"POST",data:a,scriptCharset:"utf-8",url:e}).done((function(e){!1===e.error&&(Meclib.Comment.highlightId=e.id,ViewerApp.mediator.trigger("comment:hideReplyInput"),ViewerApp.mediator.trigger("comment:reload",!0))})).fail((function(e,i,t){})),ViewerApp.mediator.trigger("comment:hideReplyInput")}},delete:function(e){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment){var i=Meclib.Globals.viewer.get("dataPath")+Meclib.Comment.server,t=!1,o="";if(""===e&&(t=!0,o=Meclib.Message.error.commentSubmit),!0===t)return new Messi(o,{title:"",animate:!1,modal:!0,width:Meclib.Size.MessiWidth,buttons:[{id:0,label:Meclib.Message.common.ok,val:1}],callback:function(e){}}),!1;var a={action:"delete",delete_id:e};$.ajax({type:"POST",data:a,scriptCharset:"utf-8",url:i}).done((function(e){ViewerApp.mediator.trigger("comment:showDeleteMode",!1),ViewerApp.mediator.trigger("comment:reload",!0)})).fail((function(e,i,t){}))}},backCommentAddInput:function(e){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type&&0!==Meclib.Globals.viewer.get("enabedOptions").comment)return setTimeout((function(){ViewerApp.mediator.trigger("menu:open","commentList"),ViewerApp.mediator.trigger("comment:drawSelectCommentArea")}),500),!1},close:function(){ViewerApp.mediator.trigger("comment:endAreaSelectMode",!0),$("#menu-comment").hide()}}),ViewerApp.Views.BookInfoView=Backbone.View.extend({initialize:function(e){if(ViewerApp.mediator.on("bookinfo:ready",this.ready),ViewerApp.mediator.on("bookinfo:addEvents",this.addEvents),ViewerApp.mediator.on("bookinfo:show",this.show),ViewerApp.mediator.on("bookinfo:close",this.close),ViewerApp.mediator.on("bookinfo:expand",this.expand),ViewerApp.mediator.on("menu:resize",this.resize),Meclib.Cache.Tpl.bookinfoBox="",Meclib.Cache.Tpl.bookinfoList="","MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type)switch(Meclib.Globals.viewer.get("device")){case 1:Meclib.Cache.Tpl.bookinfoBox=$("#panel-bookinfo-template").html(),Meclib.Cache.Tpl.bookinfoList=$("#panel-bookinfo-list-template").html();break;case 2:Meclib.Cache.Tpl.bookinfoBox=$("#sd-panel-bookinfo-template").html(),Meclib.Cache.Tpl.bookinfoList=$("#sd-panel-bookinfo-list-template").html();break;case 3:Meclib.Cache.Tpl.bookinfoBox=$("#sp-panel-bookinfo-template").html(),Meclib.Cache.Tpl.bookinfoList=$("#sp-panel-bookinfo-list-template").html()}},addEvents:function(){Meclib.ClickManager.add(document,"#btn-close-panel-bookinfo,#"+Meclib.BookInfo.maskId,(function(e,i){return i.preventDefault(),ViewerApp.mediator.trigger("bookinfo:close"),!1}),!0),Meclib.ClickManager.add(document,"#showmore-bookinfo",(function(e,i){i.preventDefault();var t=$(e).attr("data-id");setTimeout((function(){ViewerApp.mediator.trigger("bookinfo:expand",t)}),500)}),!0)},ready:function(){if(0!==Meclib.Globals.book.bookinfo){var e={action:"get",book_id:Meclib.Globals.book.bookId};$.ajax({type:"POST",data:e,scriptCharset:"utf-8",url:"./scripts/book_info.php"}).done((function(e){Meclib.Lists.bookInfoList.fetch({cache:!1,type:"GET",url:e,dataType:"json",success:function(e,i,t){if(null!==i){for(var o=i.length,a=0;a0&&($("#btn-bookinfo").show(),$("#sd-btn-bookinfo").show(),$("#navi-bookinfo").show()),!0===Meclib.Function.isNewBookInfo()&&setTimeout((function(){ViewerApp.mediator.trigger("bookinfo:show")}),1e3)}},error:function(){}})})).fail((function(e,i,t){}))}},resize:function(){ViewerApp.mediator.trigger("bookinfo:close")},show:function(){if("MAINTE"!==Meclib.Setting.type&&"PREVIEW"!==Meclib.Setting.type){if(0===Meclib.Lists.bookInfoList.length)return!1;if(!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping){if(ViewerApp.mediator.trigger("contents:endEditMode"),ViewerApp.mediator.trigger("optionmenu:close"),$("#panel-bookinfo")[0])return ViewerApp.mediator.trigger("bookinfo:close"),!1;if(""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}var e=$("
    ");$(e).attr({id:Meclib.BookInfo.maskId}),$(e).addClass("mask-bookinfo"),$("#body").append(e),$("#panel-bookinfo-body").html("");var i={},t="";i.title=Meclib.Message.bookInfo.title,i.showMore=Meclib.Message.bookInfo.showMore,i.isShowMore=!1;var o=Meclib.Lists.bookInfoList.at(0).get("update_date");i.full="",Meclib.Lists.bookInfoList.length>1?i.isShowMore=!0:i.full="full";var a="",l=Meclib.Lists.storageBookInfoList.findWhere({key:Meclib.Globals.book.uniId});if(void 0===l){a=Meclib.Lists.storageBookInfoList.getMaxId();var n=new ViewerApp.Models.StorageBookInfo({id:a+1,key:Meclib.Globals.book.uniId,value:o,date:Meclib.Function.getSaveFormatDate()});Meclib.Lists.storageBookInfoList.add(n),n.save()}else{var c=l.get("value");!0===Meclib.Function.compareDate(c,o)&&(l.set({value:o,date:Meclib.Function.getSaveFormatDate()}),l.save())}var s=[];s.date=Meclib.Lists.bookInfoList.at(0).get("post_date"),s.date=Meclib.Function.convertBookInfoDateName(s.date),s.isLink=!1,s.url="",""!==Meclib.Lists.bookInfoList.at(0).get("url")&&(s.isLink=!0,s.url=Meclib.Lists.bookInfoList.at(0).get("url")),s.title=Meclib.Function.escapeBoonInfoText(Meclib.Lists.bookInfoList.at(0).get("title")),s.content=Meclib.Function.escapeBoonInfoText(Meclib.Lists.bookInfoList.at(0).get("content")),t+=_.template(Meclib.Cache.Tpl.bookinfoList)(s),i.body=t,$("#body").append(_.template(Meclib.Cache.Tpl.bookinfoBox)(i)),$(".panel-bookinfo").css({top:Meclib.Size.headerHeight+"px"});var r={top:0,left:0,height:0},g=null;switch(Meclib.Globals.viewer.get("device")){case 1:g="#btn-bookinfo";break;case 2:g="#sd-btn-bookinfo";break;case 3:g="#btn-sidenavi-menu"}r.left=$(g).offset().left,1===Meclib.Globals.viewer.get("device")?(r.width=28,r.height=28):2!==Meclib.Globals.viewer.get("device")&&3!==Meclib.Globals.viewer.get("device")||(r.width=30,r.height=30);var b,p=r.top,d=$(Meclib.BookInfo.balloonLedge.el);$("#body").append(d);var M=$(Meclib.BookInfo.balloonLedgeShadow.el);b=Meclib.BookInfo.balloonLedge.width+Meclib.BookInfo.balloonLedge.height-2;var m=r.left-Meclib.BookInfo.balloonLedge.width+r.width/2;3===Meclib.Globals.viewer.get("device")&&(m=r.left-Meclib.BookInfo.balloonLedge.width+r.width),$(d).css({left:m,top:p+"px",opacity:0});var h=p+r.height,u=b+r.height;if($("#panel-bookinfo").css({left:"",right:10,top:b+"px",opacity:0}),3===Meclib.Globals.viewer.get("device")){var A=Meclib.Globals.bookCanvas.canvasWidth-10;$("#panel-bookinfo").css({left:"5px",width:A+"px"}),$("#panel-bookinfo-body").css({width:A+"px"}),$("#panel-bookinfo-body .bookinfo-title").css({width:A-27+"px"}),$("#panel-bookinfo-body .bookinfo-text").css({width:A-27+"px"})}return $("#"+Meclib.BookInfo.balloonLedge.id).stop().animate({top:h+"px",opacity:"1.0"},{duration:500,complete:function(){$("#body").append(M),$(M).css({left:m-2+"px",top:h-4+"px",opacity:.9}).fadeIn(1e3)}}),$("#panel-bookinfo").stop().animate({top:u+"px",opacity:"1.0"},{duration:500,complete:function(){Meclib.BookInfo.display=!0,ViewerApp.mediator.trigger("bookinfo:addEvents")}}),setTimeout((function(){$("#panel-bookinfo-body").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:100,scrollInertia:200,scrollButtons:{enable:!1}})}),1e3),!1}}},expand:function(){$("#showmore-bookinfo").hide(),$("#panel-bookinfo-bottom").hide(),$("#panel-bookinfo-body").mCustomScrollbar("destroy"),$("#panel-bookinfo-body").html("");var e=$("#panel-bookinfo-body").innerHeight()-$("#panel-bookinfo-body").height(),i=Meclib.Globals.bookCanvas.canvasHeight-(Meclib.BookInfo.balloonLedge.width+Meclib.BookInfo.balloonLedge.height),t=i-($("#panel-bookinfo-title").height()+2*e);2!==Meclib.Globals.viewer.get("device")&&3!==Meclib.Globals.viewer.get("device")||(i-=Meclib.Size.headerHeight+Meclib.Size.footerHeight,t-=Meclib.Size.headerHeight+Meclib.Size.footerHeight),1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay&&(i-=Meclib.Size.headerHeight+Meclib.Size.footerHeight,t-=Meclib.Size.headerHeight+Meclib.Size.footerHeight),$("#panel-bookinfo-body").css({height:"auto","max-height":t}),$(".panel-bookinfo").css({height:"auto","max-height":i});var o="";if(Meclib.Lists.bookInfoList.each((function(e){var i=[];i.date=e.get("post_date"),i.date=Meclib.Function.convertBookInfoDateName(i.date),i.title=Meclib.Function.escapeBoonInfoText(e.get("title")),i.isLink=!1,i.url="",""!==e.get("url")&&(i.isLink=!0,i.url=e.get("url")),i.content=Meclib.Function.escapeBoonInfoText(e.get("content")),o+=_.template(Meclib.Cache.Tpl.bookinfoList)(i)})),$("#panel-bookinfo-body").append(o),3===Meclib.Globals.viewer.get("device")){var a=Meclib.Globals.bookCanvas.canvasWidth-10;$("#panel-bookinfo").css({left:"5px",width:a+"px"}),$("#panel-bookinfo-body").css({width:a+"px"}),$("#panel-bookinfo-body .bookinfo-title").css({width:a-27+"px"}),$("#panel-bookinfo-body .bookinfo-text").css({width:a-27+"px"})}setTimeout((function(){$("#panel-bookinfo-body").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:100,scrollInertia:200,scrollButtons:{enable:!1}})}),1e3)},close:function(){$("#panel-bookinfo,#"+Meclib.BookInfo.balloonLedge.id+",#"+Meclib.BookInfo.balloonLedgeShadow.id).stop().fadeOut().remove(),$("#"+Meclib.BookInfo.maskId).remove(),Meclib.BookInfo.display=!1,!1===Meclib.Function.isSideMenuOpened()&&ViewerApp.mediator.trigger("menu:closeMainMenu")}}),ViewerApp.Views.PrintView=Backbone.View.extend({initialize:function(e){switch(ViewerApp.mediator.on("main:resize",this.resize),ViewerApp.mediator.on("main:onMovedPage",this.drawPanel),ViewerApp.mediator.on("print:addPanelEvent",this.addPanelEvent),ViewerApp.mediator.on("print:checkSelect",this.checkSelect),ViewerApp.mediator.on("common:closePanel",this.closePanel),ViewerApp.mediator.on("print:closePanel",this.closePanel),ViewerApp.mediator.on("print:showPanel",this.showPanel),ViewerApp.mediator.on("print:showErrorDialog",this.showErrorDialog),Meclib.Cache.Tpl.printpanel="",Meclib.Globals.viewer.get("device")){case 1:case 2:case 3:Meclib.Cache.Tpl.printpanel=$("#panel-print-template").html()}},events:function(){},resize:function(){ViewerApp.mediator.trigger("print:closePanel")},showPanel:function(){if(1===$("#panel-print-setting").length)return ViewerApp.mediator.trigger("print:closePanel"),!1;if(0!==Meclib.Globals.book.print&&(!0===Meclib.Function.isSideMenuOpened()&&ViewerApp.mediator.trigger("menu:close"),ViewerApp.mediator.trigger("contents:endEditMode"),ViewerApp.mediator.trigger("common:closePanel"),Meclib.Mode.memo&&Meclib.Memo.action.end(),!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping)){if(""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}Meclib.Mode.print=!0;var e={url:"",windowid:"print"+Meclib.Globals.book.bookId,text:""},i="print.html";if(1===Meclib.Globals.book.totalPage&&!0===Meclib.Lists.pageSettingList.isPrint(1)&&0===Meclib.Globals.book.label&&0===Meclib.Globals.book.memo)return e.url=i+"?open=0&start=1&end=1&fusenprint=0&memoprint=0",void window.open(e.url,e.windowid);if(1===Meclib.Globals.viewer.get("rotate")&&0===Meclib.Globals.book.twopage&&1===Meclib.Globals.book.printSetting.nowpage&&0===Meclib.Globals.book.printSetting.pageselect&&0===Meclib.Globals.book.printSetting.allpage&&0===Meclib.Globals.book.label&&0===Meclib.Globals.book.memo)return e.url=i+"?open=0&start="+Meclib.Globals.book.currentPage+"&end="+Meclib.Globals.book.currentPage+"&fusenprint=0&memoprint=0",void window.open(e.url,e.windowid);var t={};t._print=Meclib.Message.general.printout,t._open_title=Meclib.Message.print.open_title,t._nowpage=Meclib.Message.print.nowpage,t._leftpage=Meclib.Message.print.leftpage,t._rightpage=Meclib.Message.print.rightpage,t._bothpage=Meclib.Message.print.bothpage,t._allpage=Meclib.Message.print.allpage,t._pageselect=Meclib.Message.print.pageselect,t._pageselect_range_mark=Meclib.Message.print.pageselect_range_mark,t._open_page=Meclib.Message.print.open_page,t._unit_page=Meclib.Message.print.unit_page,t._fusen_print=Meclib.Message.print.fusen_print,t._memo_print=Meclib.Message.print.memo_print,t._pages_message=Meclib.Message.print.pages_message,t._pageselect_message=Meclib.Message.print.pageselect_message,t._selectpage_print_class="",t._fusen_print_class="",t._memo_print_class="",t._pages_message_class="hidden",t.enableNowPageSelect=!1,t.enableOpenPageSelect=!1,t.enableUnitPageSelect=!1,t.enablePageSelect=!1,t.enableAllPageSelect=!1,t.enableOpenTypeSelect=!0,t.enableFusenPrintSelect=!1,t.enableMemoPrintSelect=!1,t.disableLeftPage="",t.disableRightPage="",t.disableBothPage="",t.disableNowPage="",1===Meclib.Globals.book.printSetting.nowpage&&(t.enableNowPageSelect=!0,0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage?(t.enableOpenPageSelect=!0,0!==Meclib.Globals.book.getLeftPage()&&!1!==Meclib.Lists.pageSettingList.isPrint(Meclib.Globals.book.getLeftPage())||(t.disableLeftPage="disabled"),0!==Meclib.Globals.book.getRightPage()&&!1!==Meclib.Lists.pageSettingList.isPrint(Meclib.Globals.book.getRightPage())||(t.disableRightPage="disabled"),""===t.disableLeftPage&&""===t.disableRightPage||(t.disableBothPage="disabled")):(t.enableUnitPageSelect=!0,!1===Meclib.Lists.pageSettingList.isPrint(Meclib.Globals.book.currentPage)&&(t.disableNowPage="disabled"))),0===Meclib.Globals.book.twopage&&(t.enableOpenTypeSelect=!1),1===Meclib.Globals.book.printSetting.pageselect&&(t.enablePageSelect=!0),1===Meclib.Globals.book.printSetting.allpage&&(t.enableAllPageSelect=!0),1===Meclib.Globals.book.printSetting.pageselect&&0===Meclib.Globals.book.printSetting.allpage&&(t._selectpage_print_class="selectpage_last"),1===Meclib.Globals.book.printSetting.fusenprint&&1===Meclib.Globals.book.label&&(t.enableFusenPrintSelect=!0),1===Meclib.Globals.book.printSetting.memoprint&&1===Meclib.Globals.book.memo&&(t.enableMemoPrintSelect=!0),1===Meclib.Globals.viewer.get("rotate")&&0===Meclib.Globals.book.twopage&&1===Meclib.Globals.book.printSetting.nowpage&&0===Meclib.Globals.book.printSetting.pageselect&&0===Meclib.Globals.book.printSetting.allpage&&!1===t.enableOpenTypeSelect&&1===Meclib.Globals.book.label&&(t.enableNowPageSelect=!1,t._fusen_print_class="hidden"),1===Meclib.Globals.book.totalPage&&(t.enableNowPageSelect=!1,t.enablePageSelect=!1,t.enableAllPageSelect=!1,!1===t.enableOpenTypeSelect&&(t._fusen_print_class="hidden")),$("#body").append(_.template($("#panel-print-setting-template").html())(t));var o=0;1===Meclib.Globals.book.printSetting.nowpage&&(1===Meclib.Globals.viewer.get("viewMode")||0===Meclib.Globals.viewer.get("rotate")||0===Meclib.Globals.book.twopage?""===t.disableNowPage&&(o=1,$("#rdo-print-setting-nowpage").addClass("on")):(""===t.disableBothPage&&(o=1,$("#rdo-print-setting-bothpage").addClass("on")),""===t.disableLeftPage&&0===o&&(o=1,$("#rdo-print-setting-leftpage").addClass("on")),""===t.disableRightPage&&0===o&&(o=1,$("#rdo-print-setting-rightpage").addClass("on")))),1===Meclib.Globals.book.printSetting.pageselect&&0===o&&(o=1,$("#rdo-print-setting-selectpage").addClass("on"),$("#panel-print_pages_message").removeClass("hidden"),$("#pageselect_message").removeClass("hidden")),1===Meclib.Globals.book.printSetting.allpage&&0===o&&(o=1,$("#rdo-print-setting-allpage").addClass("on"),$("#panel-print_pages_message").removeClass("hidden"),$("#pageselect_message").addClass("hidden")),!0===t.enableOpenTypeSelect&&("open"===Meclib.Print.selected.open?$("#rdo-print-setting-openpage").addClass("on"):$("#rdo-print-setting-unitpage").addClass("on")),!0===t.enableFusenPrintSelect&&(""!==Meclib.Print.selected.fusenprint?"on"==Meclib.Print.selected.fusenprint&&$("#check-print-setting-fusenprint").addClass("on"):1===Meclib.Globals.viewer.get("options").fusen&&$("#check-print-setting-fusenprint").addClass("on")),!0===t.enableMemoPrintSelect&&(""!==Meclib.Print.selected.memoprint?"on"==Meclib.Print.selected.memoprint&&$("#check-print-setting-memoprint").addClass("on"):1===Meclib.Globals.viewer.get("options").memo&&$("#check-print-setting-memoprint").addClass("on")),0===o&&($(".ev-print-setting-opentype").addClass("disabled"),$(".ev-print-setting-fusenprint").addClass("disabled"),$("#btn-printout-page").addClass("disabled")),$("#panel-print-setting").draggable({handle:".panel-print-setting-title",containment:"#canvas-area",scroll:!1}),Meclib.Function.setPosCenter("panel-print-setting"),ViewerApp.mediator.trigger("print:addPanelEvent")}},drawPanel:function(){if(0===$("#panel-print-setting").length)return!1;ViewerApp.mediator.trigger("print:closePanel"),ViewerApp.mediator.trigger("print:showPanel")},addPanelEvent:function(){$(".print-pageselect-input").focus((function(){$("#panel-print-setting").find(".ev-print-setting-target .btn-radio").removeClass("on"),$("#rdo-print-setting-selectpage").addClass("on"),$("#panel-print_pages_message").removeClass("hidden"),$("#pageselect_message").removeClass("hidden")})),$(".print-pageselect-form").off().on({submit:function(e){return $(".print-pageselect-input").blur(),ViewerApp.mediator.trigger("print:checkSelect"),!1}}),Meclib.ClickManager.add(document,".ev-print-setting-target",(function(e,i){if(!0===$(e).hasClass("disabled"))return!1;var t;$("#panel-print-setting").find(".ev-print-setting-target .btn-radio").removeClass("on"),$(e).find(".btn-radio").each((function(){$(this).addClass("on"),t=$(this).attr("data-id")})),"setting-selectpage"===t?($("#panel-print_pages_message").removeClass("hidden"),$("#pageselect_message").removeClass("hidden")):"setting-allpage"===t?($("#panel-print_pages_message").removeClass("hidden"),$("#pageselect_message").addClass("hidden")):$("#panel-print_pages_message").addClass("hidden")})),Meclib.ClickManager.add(document,".ev-print-setting-opentype",(function(e,i){if(!0===$(e).hasClass("disabled"))return!1;$("#panel-print-setting").find(".ev-print-setting-opentype .btn-radio").removeClass("on"),$(e).find(".btn-radio").each((function(){$(this).addClass("on")}))})),Meclib.ClickManager.add(document,".ev-print-setting-fusenprint",(function(e,i){if(!0===$(e).hasClass("disabled"))return!1;$(e).find(".btn-checkbox").each((function(){!0===$(this).hasClass("on")?($(this).removeClass("on"),Meclib.Print.selected.fusenprint="off"):($(this).addClass("on"),Meclib.Print.selected.fusenprint="on")}))})),Meclib.ClickManager.add(document,".ev-print-setting-memoprint",(function(e,i){if(!0===$(e).hasClass("disabled"))return!1;$(e).find(".btn-checkbox").each((function(){!0===$(this).hasClass("on")?($(this).removeClass("on"),Meclib.Print.selected.memoprint="off"):($(this).addClass("on"),Meclib.Print.selected.memoprint="on")}))})),Meclib.ClickManager.add(document,"#btn-printout-page",(function(e,i){ViewerApp.mediator.trigger("print:checkSelect")})),Meclib.ClickManager.add(document,"#btn-close-printpanel",(function(e,i){ViewerApp.mediator.trigger("print:closePanel")}))},closePanel:function(){$("#panel-print-setting").remove(),Meclib.Mode.print=!1},checkSelect:function(){if(!$("#btn-printout-page").hasClass("disabled")){var e="",i=0,t=0,o=0,a=0,l=0,n="",c="",s={start:0,end:0,url:"",windowid:"print"+Meclib.Globals.book.bookId,text:""};if($(".messi-modal").length>0)return!1;if($("#panel-print-setting").find(".ev-print-setting-target .btn-radio").each((function(){$(this).hasClass("on")&&(e=$(this).attr("data-id"))})),"setting-leftpage"===e)t=Meclib.Globals.book.getLeftPage();else if("setting-rightpage"===e)t=Meclib.Globals.book.getRightPage();else if("setting-bothpage"===e)0===Meclib.Globals.book.pageOpenDir?(t=Meclib.Globals.book.getLeftPage(),o=Meclib.Globals.book.getRightPage()):(t=Meclib.Globals.book.getRightPage(),o=Meclib.Globals.book.getLeftPage());else if("setting-nowpage"===e)t=Meclib.Globals.book.currentPage;else if("setting-selectpage"===e){var r=$("#print-pageselect-input-start").val(),g=$("#print-pageselect-input-end").val();if(0===(t=Meclib.Globals.book.getPageFileNo(r))&&(t=Meclib.Globals.book.getPageFileNo("*"+r)),0===t)return s.text=Meclib.Message.error.printStartPageInput,ViewerApp.mediator.trigger("print:showErrorDialog",s),!1;if(""!==g&&"undefined"!==g){if(0===(o=Meclib.Globals.book.getPageFileNo(g))&&(o=Meclib.Globals.book.getPageFileNo("*"+g)),0===o)return s.text=Meclib.Message.error.printEndPageInput,ViewerApp.mediator.trigger("print:showErrorDialog",s),!1;if(t>o)return s.text=Meclib.Message.error.printPageRangeInput,ViewerApp.mediator.trigger("print:showErrorDialog",s),!1}else o=t}else"setting-allpage"===e?(t=1,o=Meclib.Globals.book.totalPage):o=t=Meclib.Globals.book.currentPage;if(t!==o)o-t+1>Meclib.Print.warningPageNum&&(c+=Meclib.Message.error.printPageNumWarning);for(var b=t;b<=o;b++)if(!1===Meclib.Lists.pageSettingList.isPrint(b)){""!==c&&(c+="

    "),c+=Meclib.Message.error.printProhibited;break}$("#panel-print-setting").find(".ev-print-setting-opentype .btn-radio").each((function(){$(this).hasClass("on")&&(i=parseInt($(this).attr("data-id"),10)),0!==i&&1!==i&&(i=0)})),$("#check-print-setting-fusenprint").hasClass("on")&&(a=1),$("#check-print-setting-memoprint").hasClass("on")&&(l=1);0,"print.html",s.start=t,s.end=o,s.url="print.html?open="+i+"&start="+t+"&end="+o+"&fusenprint="+a+"&memoprint="+l+n,""!==Meclib.Print.warningModal&&Meclib.Print.warningModal.unload(),""!==c?Meclib.Print.warningModal=new Messi(c,{title:"",animate:!1,width:Meclib.Size.MessiWidthL,modal:!0,buttons:[{id:0,label:Meclib.Message.common.continue,val:0,class:"btn-print-continue"},{id:1,label:Meclib.Message.common.cancel,val:1,class:"btn-print-cancel"}],callback:function(e){return!0}}):(-1===Meclib.Globals.ua.search("Chrome")&&""!==Meclib.Windows.print&&Meclib.Windows.print.close(),Meclib.Windows.print=window.open(s.url,s.windowid),Meclib.analytics.sendPrintPage(s.start,s.end),Meclib.UserAnalytics.addPrint(s.start,s.end),Meclib.API.onPrint(s.start,s.end),Meclib.Globals.ua.search("Chrome")>-1&&(Meclib.Modal=new Messi(Meclib.Message.error.printingChromeMessage,{center:!0,animate:!1,modal:!0,modalOpacity:.4,padding:"30px",closeButton:!1,width:Meclib.Size.MessiWidthL}),window.clearInterval(Meclib.Timer.printModal),Meclib.Timer.printModal=window.setInterval((function(){""!==Meclib.Windows.print&&(Meclib.Windows.print&&!Meclib.Windows.print.closed||""!==Meclib.Modal&&(Meclib.Modal.unload(),window.clearInterval(Meclib.Timer.printModal)))}),1e3))),$(".btn-print-continue").off().on({click:function(e){return-1===Meclib.Globals.ua.search("Chrome")&&""!==Meclib.Windows.print&&Meclib.Windows.print.close(),Meclib.Windows.print=window.open(s.url,s.windowid),Meclib.analytics.sendPrintPage(s.start,s.end),Meclib.UserAnalytics.addPrint(s.start,s.end),Meclib.Globals.ua.search("Chrome")>-1&&(Meclib.Modal=new Messi(Meclib.Message.error.printingChromeMessage,{center:!0,animate:!1,modal:!0,modalOpacity:.4,padding:"30px",closeButton:!1,width:Meclib.Size.MessiWidthL}),window.clearInterval(Meclib.Timer.printModal),Meclib.Timer.printModal=window.setInterval((function(){""!==Meclib.Windows.print&&(Meclib.Windows.print&&!Meclib.Windows.print.closed||""!==Meclib.Modal&&(Meclib.Modal.unload(),window.clearInterval(Meclib.Timer.printModal)))}),1e3)),!0},mouseover:function(e){$(this).css({cursor:"pointer"})},mouseout:function(e){$(this).css({cursor:""})}})}},showErrorDialog:function(e){""!==Meclib.Print.errorModal&&Meclib.Print.errorModal.unload(),Meclib.Print.errorModal=new Messi(e.text,{title:"",animate:!1,width:Meclib.Size.MessiWidth,modal:!0,buttons:[{id:0,label:Meclib.Message.common.ok,val:null}],callback:function(e){}})}}),ViewerApp.Views.PdfView=Backbone.View.extend({initialize:function(e){switch(ViewerApp.mediator.on("main:resize",this.resize),ViewerApp.mediator.on("main:onMovedPage",this.drawPanel),ViewerApp.mediator.on("pdf:addPanelEvent",this.addPanelEvent),ViewerApp.mediator.on("pdf:checkSelect",this.checkSelect),ViewerApp.mediator.on("pdf:closePanel",this.closePanel),ViewerApp.mediator.on("common:closePanel",this.closePanel),ViewerApp.mediator.on("pdf:showPanel",this.showPanel),Meclib.Cache.Tpl.pdfpanel="",Meclib.Globals.viewer.get("device")){case 1:case 2:case 3:Meclib.Cache.Tpl.pdfpanel=$("#panel-pdf-template").html()}},events:function(){},resize:function(){ViewerApp.mediator.trigger("pdf:closePanel")},showPanel:function(){if(1===$("#panel-pdf-setting").length)return ViewerApp.mediator.trigger("pdf:closePanel"),!1;if(!0===Meclib.Function.isSideMenuOpened()&&ViewerApp.mediator.trigger("menu:close"),ViewerApp.mediator.trigger("fusen:close"),ViewerApp.mediator.trigger("optionmenu:close"),ViewerApp.mediator.trigger("contents:endEditMode"),ViewerApp.mediator.trigger("common:closePanel"),!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping){if(""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}Meclib.Mode.pdf=!0;var e={};e._pdf=Meclib.Message.general.pdf,e._nowpage=Meclib.Message.pdf.nowpage,e._leftpage=Meclib.Message.pdf.leftpage,e._rightpage=Meclib.Message.pdf.rightpage,e._allpage=Meclib.Message.pdf.allpage,e.enableNowPageSelect=!1,e.enableOpenPageSelect=!1,e.enableUnitPageSelect=!1,e.enableAllPageSelect=!1,e.disableLeftPage="",e.disableRightPage="",e.disableBothPage="",e.disableNowPage="",1===Meclib.Globals.viewer.get("enabedOptions").pdf&&(e.enableNowPageSelect=!0,0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage?(e.enableOpenPageSelect=!0,0!==Meclib.Globals.book.getLeftPage()&&!1!==Meclib.Lists.pageSettingList.isPdf(Meclib.Globals.book.getLeftPage())||(e.disableLeftPage="disabled"),0!==Meclib.Globals.book.getRightPage()&&!1!==Meclib.Lists.pageSettingList.isPdf(Meclib.Globals.book.getRightPage())||(e.disableRightPage="disabled")):(e.enableUnitPageSelect=!0,!1===Meclib.Lists.pageSettingList.isPdf(Meclib.Globals.book.currentPage)&&(e.disableNowPage="disabled"))),1===Meclib.Globals.viewer.get("enabedOptions").allPdf&&(e.enableAllPageSelect=!0),$("#body").append(_.template($("#panel-pdf-setting-template").html())(e)),$("#panel-pdf-setting").draggable({handle:".panel-pdf-setting-title",containment:"#canvas-area",scroll:!1}),Meclib.Function.setPosCenter("panel-pdf-setting"),ViewerApp.mediator.trigger("pdf:addPanelEvent")}},drawPanel:function(){if(0===$("#panel-pdf-setting").length)return!1;ViewerApp.mediator.trigger("pdf:closePanel"),ViewerApp.mediator.trigger("pdf:showPanel")},addPanelEvent:function(){Meclib.ClickManager.add(document,".ev-pdf-setting-target",(function(e,i){ViewerApp.mediator.trigger("pdf:checkSelect",e)})),Meclib.ClickManager.add(document,"#btn-close-pdfpanel",(function(e,i){ViewerApp.mediator.trigger("pdf:closePanel")}))},closePanel:function(){$("#panel-pdf-setting").remove(),Meclib.Mode.pdf=!1},checkSelect:function(e){var i,t=0,o="";if($(".messi-modal").length>0)return!1;if(!$(e).hasClass("disabled"))if("setting-leftpage"===(i=$(e).attr("data-id")))t=Meclib.Globals.book.getLeftPage(),Meclib.analytics.sendV4Pdf(t),Meclib.analytics.sendContents("pdf",t),Meclib.UserAnalytics.add("pdf",t,""),Meclib.API.onPdf(t),"LOCAL"===Meclib.Setting.type?window.open(Meclib.Globals.viewer.get("dataPath")+"pdf/"+Meclib.Function.formatNum(4,t)+".pdf"):window.open().location.href=Meclib.Globals.viewer.get("dataPath")+"pdf/"+Meclib.Function.formatNum(4,t)+".pdf";else if("setting-rightpage"===i)t=Meclib.Globals.book.getRightPage(),Meclib.analytics.sendV4Pdf(t),Meclib.analytics.sendContents("pdf",t),Meclib.UserAnalytics.add("pdf",t,""),Meclib.API.onPdf(t),"LOCAL"===Meclib.Setting.type?window.open(Meclib.Globals.viewer.get("dataPath")+"pdf/"+Meclib.Function.formatNum(4,t)+".pdf"):window.open().location.href=Meclib.Globals.viewer.get("dataPath")+"pdf/"+Meclib.Function.formatNum(4,t)+".pdf";else if("setting-nowpage"===i)t=Meclib.Globals.book.currentPage,Meclib.analytics.sendV4Pdf(t),Meclib.analytics.sendContents("pdf",t),Meclib.UserAnalytics.add("pdf",t,""),Meclib.API.onPdf(t),"LOCAL"===Meclib.Setting.type?window.open(Meclib.Globals.viewer.get("dataPath")+"pdf/"+Meclib.Function.formatNum(4,t)+".pdf"):window.open().location.href=Meclib.Globals.viewer.get("dataPath")+"pdf/"+Meclib.Function.formatNum(4,t)+".pdf";else if("setting-allpage"===i){if(0===Meclib.Globals.book.allPdf||""===Meclib.Globals.book.allPdfName)return;for(var a=1;a<=Meclib.Globals.book.getTotalPage();a++)if(!1===Meclib.Lists.pageSettingList.isPdf(a)){o+=Meclib.Message.error.pdfProhibited;break}if(""!==o)Meclib.Pdf.warningModal=new Messi(o,{title:"",animate:!1,width:Meclib.Size.MessiWidthL,modal:!0,buttons:[{id:0,label:Meclib.Message.common.continue,val:0,class:"btn-pdf-continue"},{id:1,label:Meclib.Message.common.cancel,val:1,class:"btn-pdf-cancel"}],callback:function(e){if("0"===e){var i=Meclib.Globals.viewer.get("dataPath")+"data/"+Meclib.Globals.book.allPdfName;Meclib.analytics.sendV4Pdf(99999),Meclib.analytics.sendContents("pdf",99999),Meclib.UserAnalytics.add("pdf",99999,""),Meclib.API.onPdf(99999),window.open(i,"allpdf"+Meclib.Globals.book.uniId)}return!0}});else{var l=Meclib.Globals.viewer.get("dataPath")+"data/"+Meclib.Globals.book.allPdfName;Meclib.analytics.sendV4Pdf(99999),Meclib.analytics.sendContents("pdf",99999),Meclib.UserAnalytics.add("pdf",99999,""),Meclib.API.onPdf(99999),window.open(l,"allpdf"+Meclib.Globals.book.uniId)}}}}),ViewerApp.Views.PageMoveView=Backbone.View.extend({el:".menu-pagemove",initialize:function(e){ViewerApp.mediator.on("pagemove:open",this.open),ViewerApp.mediator.on("pagemove:close",this.close),ViewerApp.mediator.on("menu:resize",this.resize);var i,t="";if(3===Meclib.Globals.viewer.get("device"))i=_.template($("#menu-pagemove-left-template").html()),t=_.template($("#menu-pagemove-right-template").html());$("#body").append(i).append(t)},resize:function(){var e=Meclib.Function.getWinsize().height,i=0;if(3===Meclib.Globals.viewer.get("device"))i=(e-(Meclib.Size.headerHeight-Meclib.Size.sidemenuHeaderHeight))/2-$("#menu-pagemove-left").height()/2,$(".menu-pagemove").css({top:i})},events:function(){},open:function(){var e=Meclib.PageMove.sideMargin;$("#menu-pagemove-left").animate({left:e},{duration:Meclib.Speed.menuOpen,complete:function(){}});var i=Meclib.PageMove.sideMargin;$("#menu-pagemove-right").animate({right:i},{duration:Meclib.Speed.menuOpen,complete:function(){}})},close:function(){var e=-1*($("#menu-pagemove-left").width()+Meclib.PageMove.sideMargin);$("#menu-pagemove-left").animate({left:e},{duration:Meclib.Speed.menuClose});var i=-1*($("#menu-pagemove-right").width()+Meclib.PageMove.sideMargin);$("#menu-pagemove-right").animate({right:i},{duration:Meclib.Speed.menuClose})}}),ViewerApp.Views.PageSearchView=Backbone.View.extend({el:null,initialize:function(e){switch(ViewerApp.mediator.on("pagesearch:show",this.show),ViewerApp.mediator.on("pagesearch:addEvent",this.addEvent),ViewerApp.mediator.on("pagesearch:movePosition",this.movePosition),ViewerApp.mediator.on("pagesearch:clearPosition",this.clearPosition),ViewerApp.mediator.on("pagesearch:close",this.close),ViewerApp.mediator.on("main:resize",this.resize),ViewerApp.mediator.on("common:loadTemplates",this.loadTemplates),Meclib.Cache.Tpl.pagesearch="",Meclib.Globals.viewer.get("device")){case 1:default:break;case 2:Meclib.Cache.Tpl.pagesearch=$("#sd-panel-pagesearch-template").html();break;case 3:Meclib.Cache.Tpl.pagesearch=$("#sp-panel-pagesearch-template").html()}},loadTemplates:function(){$("#pagesearch-label").prepend(Meclib.Message.general.page)},resize:function(e){var i=!1;""!==$(":focus").attr("id")&&void 0!==$(":focus").attr("id")&&("INPUT"!==$(":focus").get(0).tagName&&"TEXTAREA"!==$(":focus").get(0).tagName||(i=!0)),!0===Meclib.SearchBehind&&Meclib.Globals.ua.search("Android")>=0?Meclib.SearchBehind=!1:(Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1||Meclib.Globals.ua.toLocaleLowerCase().search("edg/")>-1)&&Meclib.Function.getWinsize().width==$("#main").width()&&!0===i||Meclib.Globals.ua.search("Android")>=0&&Meclib.Function.getWinsize().width==$("#main").width()&&!0===i||(ViewerApp.mediator.trigger("pagesearch:clearPosition"),setTimeout((function(){ViewerApp.mediator.trigger("pagesearch:movePosition")}),500))},show:function(){Meclib.PageSearch.display=!0,$("#footer-icon-box").hide(),$("#footer-centericon").hide();var e={};e._pageInputPlaceholder=Meclib.Message.pageMove.pageInputPlaceholder,e._search=Meclib.Message.general.search,$("#main").append(_.template(Meclib.Cache.Tpl.pagesearch)(e)),setTimeout((function(){ViewerApp.mediator.trigger("pagesearch:movePosition"),$("#footer-icon-box").hide(),$("#footer-centericon").hide()}),500),$("#footer-sub-box").addClass("hidden-footer"),setTimeout((function(){ViewerApp.mediator.trigger("pagesearch:addEvent")}),500)},addEvent:function(){Meclib.ClickManager.add(document,".btn-pagesearch-moveleftlimit",(function(e,i){!0!==Meclib.Mode.autoflipping&&(ViewerApp.mediator.trigger("main:moveLeftLimitPage"),ViewerApp.mediator.trigger("pagesearch:close"))}),!0),Meclib.ClickManager.add(document,".btn-pagesearch-moverightlimit",(function(e,i){!0!==Meclib.Mode.autoflipping&&(ViewerApp.mediator.trigger("main:moveRightLimitPage"),ViewerApp.mediator.trigger("pagesearch:close"))}),!0),$(document).off("submit","#menu-pagesearch-form"),$(document).on("submit","#menu-pagesearch-form",(function(){ViewerApp.mediator.trigger("pagesearch:clearPosition");var e=$("#menu-pagesearch-input").val();return $("#menu-pagesearch-input").blur(),ViewerApp.mediator.trigger("main:moveInputPage",e),ViewerApp.mediator.trigger("pagesearch:close"),Meclib.Globals.viewer.get("device")>1&&(Meclib.Function.setForceClose(),ViewerApp.mediator.trigger("menu:closeMainMenu")),!1})),$(document).off("blur","#menu-pagesearch-input"),$(document).on("blur","#menu-pagesearch-input",(function(e){Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1&&window.getSelection().removeAllRanges()})),Meclib.ClickManager.add(document,".ev-btn-pagesearchicon",(function(e,i){if(!0!==Meclib.Mode.autoflipping){ViewerApp.mediator.trigger("pagesearch:clearPosition");var t=$("#menu-pagesearch-input").val();return $("#menu-pagesearch-input").blur(),ViewerApp.mediator.trigger("main:moveInputPage",t),ViewerApp.mediator.trigger("pagesearch:close"),Meclib.Globals.viewer.get("device")>1&&(Meclib.Function.setForceClose(),ViewerApp.mediator.trigger("menu:closeMainMenu")),!1}}),!0),Meclib.ClickManager.add(document,".ev-btn-close-pagesearch",(function(e,i){return ViewerApp.mediator.trigger("pagesearch:close"),!1}),!0)},movePosition:function(){if(!0===Meclib.PageSearch.display){$("#footer").css({top:"42px",bottom:""}),$("#menu-pagesearch-box").css({top:"68px",bottom:""});var e=Meclib.Function.getWinsize().width-($("#btn-moveleftlimit").outerWidth(!0)+$("#btn-moverightlimit").outerWidth(!0)+$(".btn-close-pagesearch").outerWidth(!0));2===Meclib.Globals.viewer.get("device")&&(e=195),$("#menu-pagesearch-form").css({width:e}),$(".menu-pagesearch-inputbox").css({width:e-4-2}),$(".menu-pagesearch-input").css({width:e-4-$(".btn-pagesearchicon").outerWidth(!0)})}},clearPosition:function(){$("#menu-pagesearch-box").css({top:""}),$("#footer").css({top:Meclib.Function.getWinsize().height-Meclib.Size.footerHeight})},close:function(){Meclib.PageSearch.display=!1,ViewerApp.mediator.trigger("pagesearch:clearPosition"),$("#menu-pagesearch-box").remove(),$("#footer-icon-box").show(),$("#footer-centericon").show(),$("#footer-sub-box").removeClass("hidden-footer")},events:{}}),ViewerApp.Views.BrowsingHistoryView=Backbone.View.extend({initialize:function(e){switch(ViewerApp.mediator.on("browsinghistory:resize",this.resize),ViewerApp.mediator.on("browsinghistory:save",this.save),ViewerApp.mediator.on("browsinghistory:close",this.close),ViewerApp.mediator.on("browsinghistory:drawList",this.drawList),ViewerApp.mediator.on("browsinghistory:addListEvent",this.addListEvent),ViewerApp.mediator.on("browsinghistory:delete",this.delete),ViewerApp.mediator.on("browsinghistory:removeAll",this.removeAll),ViewerApp.mediator.on("browsinghistory:openLink",this.openLink),Meclib.Globals.viewer.get("device")){case 1:Meclib.Cache.Tpl.browsingHistorylistBase="",Meclib.Cache.Tpl.browsingHistorylist="";break;case 2:Meclib.Cache.Tpl.browsingHistorylistBase=$("#sd-sidemenu-browsinghistorylist-template").html(),Meclib.Cache.Tpl.browsingHistorylist=$("#sd-browsinghistory-list-template").html();break;case 3:Meclib.Cache.Tpl.browsingHistorylistBase=$("#sp-sidemenu-browsinghistorylist-template").html(),Meclib.Cache.Tpl.browsingHistorylist=$("#sp-browsinghistory-list-template").html()}$("#menu-browsinghistory").html(Meclib.Cache.Tpl.browsingHistorylistBase),Meclib.Lists.browsingHistoryList.fetch({dataType:"json",success:function(e,i,t){for(var o=i.length,a=0;a-1||o.indexOf(".php")>-1){a=o.split("/"),l="";for(var n=0;n0&&1===Meclib.Globals.book.book_db||1===Meclib.Globals.viewer.get("enabedOptions").txtsearch?ViewerApp.mediator.trigger("menu:showMenuButon","txtsearch"):ViewerApp.mediator.trigger("menu:hideMenuButon","txtsearch"),Meclib.Products.pages=t.pages,Meclib.Products.load=!0,Meclib.Products.pages.length>0)for(var a=0;a0&&ViewerApp.mediator.trigger("menu:showMenuButon","db"),$("#btn-txtsearch-icon").removeClass("disabled"),ViewerApp.mediator.trigger("products:pageLoad"),1===Meclib.Globals.book.txtsearch&&(Meclib.Globals.viewer.get("optionIncludes").txtsearch=1),""!==Meclib.defaults.keyword&&1===Meclib.Globals.book.book_db&&1===Meclib.Globals.book.public&&(1===Meclib.Globals.viewer.get("device")?(Meclib.Products.search.mode="search",Meclib.Products.search.form="#txtsearch-input",$("#txtsearch-input").val(Meclib.defaults.keyword),ViewerApp.mediator.trigger("products:openPageProductsPanel")):(Meclib.Products.search.mode="search",Meclib.Products.search.form="",Meclib.Products.search.keyword=Meclib.defaults.keyword,ViewerApp.mediator.trigger("products:openPageProductsPanel")))})).fail((function(e){Meclib.Debug.log("error db data",1)}))}},pageLoad:function(){if((0!==Meclib.Globals.book.book_db||0!==Meclib.Globals.book.page_db)&&!1!==Meclib.Products.load){var e=!1;"page"===Meclib.Products.search.mode&&1===$("#panel-products-page-list").length&&!1===$("#panel-products-page-list").is(":hidden")&&(e=!0,Meclib.Products.select[Meclib.Products.search.mode].pages=[],$(".products-pageselect-box").removeClass("disabled"),!0===Meclib.Function.isTwoPage()?(0===Meclib.Globals.book.getLeftPage()?($('.products-pageselect-box[data-type="left"]').addClass("disabled"),$('.products-pageselect-box[data-type="left"]').find(".checkbox-products-selectpage").removeClass("on")):(Meclib.Products.select[Meclib.Products.search.mode].pages.push(Meclib.Globals.book.getLeftPage()),$('.products-pageselect-box[data-type="left"]').find(".checkbox-products-selectpage").removeClass("on").addClass("on")),0===Meclib.Globals.book.getRightPage()?($('.products-pageselect-box[data-type="right"]').addClass("disabled"),$('.products-pageselect-box[data-type="right"]').find(".checkbox-products-selectpage").removeClass("on")):(Meclib.Products.select[Meclib.Products.search.mode].pages.push(Meclib.Globals.book.getRightPage()),$('.products-pageselect-box[data-type="right"]').find(".checkbox-products-selectpage").removeClass("on").addClass("on"))):Meclib.Products.select[Meclib.Products.search.mode].pages.push(Meclib.Globals.book.currentPage));var i=[];!0===Meclib.Function.isTwoPage()?(0!==Meclib.Globals.book.getLeftPage()&&i.push(Meclib.Globals.book.getLeftPage()),0!==Meclib.Globals.book.getRightPage()&&i.push(Meclib.Globals.book.getRightPage())):i.push(Meclib.Globals.book.currentPage);for(var t=!1,o=0;o-1){t=!0;break}if(!1!==e)return Meclib.Products.ajax.txtcount&&Meclib.Products.ajax.txtcount.abort(),Meclib.Products.ajax.txtdata&&Meclib.Products.ajax.txtdata.abort(),Meclib.Products.ajax.dbcount&&Meclib.Products.ajax.dbcount.abort(),Meclib.Products.ajax.dbdata&&Meclib.Products.ajax.dbdata.abort(),!1===t?($("#btn-db").addClass("disabled"),void ViewerApp.mediator.trigger("products:clearLists")):($("#btn-db").removeClass("disabled"),Meclib.Products.sort[Meclib.Products.search.mode].field="",void ViewerApp.mediator.trigger("products:renderTabs"));!1===t?$("#btn-db").addClass("disabled"):$("#btn-db").removeClass("disabled")}},resize:function(){var e=!1;if(""!==$(":focus").attr("id")&&void 0!==$(":focus").attr("id")&&("INPUT"!==$(":focus").get(0).tagName&&"TEXTAREA"!==$(":focus").get(0).tagName||(e=!0)),!(!0===e&&Meclib.Globals.ua.search("Android")>=0||1===$("#panel-products-search-list").length&&!1===$("#panel-products-search-list").is(":hidden")))return 1===$("#panel-products-"+Meclib.Products.search.mode+"-list").length&&!1===$("#panel-products-"+Meclib.Products.search.mode+"-list").is(":hidden")?(ViewerApp.mediator.trigger("products:closePageProductsPanel"),void ViewerApp.mediator.trigger("products:openPageProductsPanel")):void 0},openPageProductsPanel:function(){if(3===Meclib.Globals.viewer.get("device")&&($("#footer").addClass("hidden"),$("#footer-sub-box").addClass("hidden"),$(".menu-pagemove").addClass("hidden")),"search"===Meclib.Products.search.mode){if(1===$("#panel-products-search-list").length&&""!==Meclib.Products.search.keyword&&(2===Meclib.Globals.viewer.get("device")||3===Meclib.Globals.viewer.get("device")))return void ViewerApp.mediator.trigger("products:showPageProductsPanel");if("#txtsearch-input"===Meclib.Products.search.form){if(1===$("#panel-products-search-list").length&&""!==Meclib.Products.search.keyword&&Meclib.Products.search.keyword===$("#txtsearch-input").val())return void ViewerApp.mediator.trigger("products:showPageProductsPanel");Meclib.Products.select[Meclib.Products.search.mode].db=0,Meclib.Products.select[Meclib.Products.search.mode].page=1,Meclib.Products.select[Meclib.Products.search.mode].start=1,Meclib.Products.select[Meclib.Products.search.mode].end=Meclib.Products.pageNation.div,Meclib.Products.sort[Meclib.Products.search.mode].field="",Meclib.Products.search.keyword=$("#txtsearch-input").val(),ViewerApp.mediator.trigger("products:sendLog",Meclib.Products.search.keyword),$("#menu-products-search-input").val(Meclib.Products.search.keyword)}else Meclib.Products.select[Meclib.Products.search.mode].db=0,Meclib.Products.select[Meclib.Products.search.mode].page=1,Meclib.Products.select[Meclib.Products.search.mode].start=1,Meclib.Products.select[Meclib.Products.search.mode].end=Meclib.Products.pageNation.div,Meclib.Products.sort[Meclib.Products.search.mode].field=""}if(ViewerApp.mediator.trigger("products:closePageProductsPanel"),!0===Meclib.Function.isSideMenuOpened()&&ViewerApp.mediator.trigger("menu:close"),Meclib.Mode.products=!0,ViewerApp.mediator.trigger("contents:endEditMode"),ViewerApp.mediator.trigger("common:closePanel"),3===Meclib.Globals.viewer.get("device")&&($("#footer").addClass("hidden"),$("#footer-sub-box").addClass("hidden"),$(".menu-pagemove").addClass("hidden")),!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping){if(""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}0===Meclib.Products.select[Meclib.Products.search.mode].db&&"page"===Meclib.Products.search.mode&&(Meclib.Products.select[Meclib.Products.search.mode].db=parseInt(Meclib.Products.databases[0].id,10));var e={};if(e.deviceCode=Meclib.Globals.deviceCode,e._products="",e.leftpageDisabled="",e.rightpageDisabled="",e.leftpageSelected="on",e.rightpageSelected="on","page"===Meclib.Products.search.mode?(Meclib.Products.sort[Meclib.Products.search.mode].field="",e._products=Meclib.Message.products.nowpageProducts.replace("|NAME|",Meclib.Globals.book.page_db_label)):"search"===Meclib.Products.search.mode&&(e._products=Meclib.Message.products.searchedProducts),Meclib.Products.select[Meclib.Products.search.mode].pages=[],!0===Meclib.Function.isTwoPage()?(0!==Meclib.Globals.book.getLeftPage()?Meclib.Products.select[Meclib.Products.search.mode].pages.push(Meclib.Globals.book.getLeftPage()):(e.leftpageDisabled="disabled",e.leftpageSelected=""),0!==Meclib.Globals.book.getRightPage()?Meclib.Products.select[Meclib.Products.search.mode].pages.push(Meclib.Globals.book.getRightPage()):(e.rightpageDisabled="disabled",e.rightpageSelected="")):Meclib.Products.select[Meclib.Products.search.mode].pages.push(Meclib.Globals.book.currentPage),e._searchtxtInputPlaceholder=Meclib.Message.products.searchtxtInputPlaceholder,e._leftpageName=Meclib.Message.common.leftpage,e._rightpageName=Meclib.Message.common.rightpage,e._totalCounts=Meclib.Message.products.totalCounts,e._totalCountsUnit=Meclib.Message.products.totalCountsUnit,e.openPage=!1,e.mode=Meclib.Products.search.mode,e.headerTabs=[],"search"===Meclib.Products.search.mode&&1===Meclib.Globals.book.txtsearch){var i=[{id:-1,name:Meclib.Message.functionName.txtSearch,count:0}];e.headerTabs=e.headerTabs.concat(i)}e.headerTabs=e.headerTabs.concat(Meclib.Products.databases),0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage&&(e.openPage=!0),$("#body").append(_.template(Meclib.Cache.Tpl.productsList)(e)),"page"===Meclib.Products.search.mode&&!1===e.openPage&&$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-header").hide(),Meclib.Function.setPosCenter("panel-products-"+Meclib.Products.search.mode+"-list");var t=0;1!==Meclib.Globals.viewer.get("device")&&2!==Meclib.Globals.viewer.get("device")||(t=10);var o=0;if(o=Meclib.Function.getWinsize().height-(Meclib.Size.headerHeight+Meclib.Size.footerHeight+2*t),3===Meclib.Globals.viewer.get("device")&&(o=Meclib.Function.getWinsize().height-Meclib.Size.headerHeight),$("#panel-products-"+Meclib.Products.search.mode+"-list").css({top:Meclib.Size.headerHeight+t,height:o}),3===Meclib.Globals.viewer.get("device")&&($("#menu-products-search-form").css({width:$(window).width()-55-30}),$("#menu-products-search-inputbox").css({width:$(window).width()-55-30-4}),$("#menu-products-search-input").css({width:$(window).width()-55-30-4-28})),"search"===Meclib.Products.search.mode&&""===Meclib.Products.search.keyword&&(2===Meclib.Globals.viewer.get("device")||3===Meclib.Globals.viewer.get("device")))return $("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab-area").hide(),$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab-area").outerHeight()<$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab-area")[0].scrollHeight?ViewerApp.mediator.trigger("products:clearDatabsePullDownMenu"):ViewerApp.mediator.trigger("products:clearTabs"),ViewerApp.mediator.trigger("products:addListsEvent"),void ViewerApp.mediator.trigger("products:updateTotalCounts");"search"===Meclib.Products.search.mode&&(1===Meclib.Globals.viewer.get("device")||""!==Meclib.Products.search.keyword)&&$("#menu-products-search-input").val(Meclib.Products.search.keyword),ViewerApp.mediator.trigger("products:renderTabs")}},showLoading:function(){$("#menu-loading").remove();$("#panel-products-"+Meclib.Products.search.mode+"-list").append(''),$("#menu-loading").css({top:$("#panel-products-"+Meclib.Products.search.mode+"-list").outerHeight()/2-15,left:$("#panel-products-"+Meclib.Products.search.mode+"-list").outerWidth()/2-15})},hideLoading:function(){$("#menu-loading").remove(),Meclib.Products.loading=!1},showPageProductsPanel:function(){"search"===Meclib.Products.search.mode?$("#panel-products-page-list").hide():"page"===Meclib.Products.search.mode&&$("#panel-products-search-list").hide(),$("#panel-products-"+Meclib.Products.search.mode+"-list").show(),Meclib.Mode.products=!0},hidePageProductsPanel:function(){3===Meclib.Globals.viewer.get("device")&&($("#footer").removeClass("hidden"),$("#footer-sub-box").removeClass("hidden"),$(".menu-pagemove").removeClass("hidden")),ViewerApp.mediator.trigger("products:closeProductsDetailsPanel",0),$("#panel-products-"+Meclib.Products.search.mode+"-list").hide(),Meclib.Mode.products=!1},hidePanel:function(){Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1&&window.getSelection().removeAllRanges(),3===Meclib.Globals.viewer.get("device")&&($("#footer").removeClass("hidden"),$("#footer-sub-box").removeClass("hidden"),$(".menu-pagemove").removeClass("hidden")),ViewerApp.mediator.trigger("products:hidePageProductsPanel")},closePanel:function(){Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1&&window.getSelection().removeAllRanges(),3===Meclib.Globals.viewer.get("device")&&($("#footer").removeClass("hidden"),$("#footer-sub-box").removeClass("hidden"),$(".menu-pagemove").removeClass("hidden")),$(".panel-products-list").remove(),ViewerApp.mediator.trigger("products:closeProductsDetailsPanel",0),Meclib.Mode.products=!1},closePageProductsPanel:function(){Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1&&window.getSelection().removeAllRanges(),3===Meclib.Globals.viewer.get("device")&&($("#footer").removeClass("hidden"),$("#footer-sub-box").removeClass("hidden"),$(".menu-pagemove").removeClass("hidden")),ViewerApp.mediator.trigger("products:closeProductsDetailsPanel",0),$(".panel-products-list").remove(),Meclib.Mode.products=!1},clearResults:function(){$("#products-"+Meclib.Products.search.mode+"-pagenation-area").html(""),$("#products-"+Meclib.Products.search.mode+"-list-table").html(""),Meclib.Products.loading=!1},searchTxtCounts:function(){ViewerApp.mediator.trigger("highlight:clear"),$("#saerch-selected-val").attr("data-val","");var e=0,i=Meclib.Products.search.keyword.replace(/ OR /gi," ").trim();Meclib.TextSearch.keywords=i.split(" "),Meclib.TextSearch.keywords=$.grep(Meclib.TextSearch.keywords,(function(e){return""!==e}));var t=Meclib.Products.search.keyword.replaceAll("\u3000"," ");t=t.trim(),t=Meclib.Function.convertKanaToFull(t);var o=[],a=(t=Meclib.Function.convertHalfNum(t)).toUpperCase().indexOf(" OR "),l=t.indexOf(" ");e=a>-1&&l>-1||a>-1&&-1===l?1:0,o=(t=t.replace(/ OR /gi," ").trim()).split(" "),o=$.grep(o,(function(e){return""!==e})),Meclib.TextSearch.keyword=t,Meclib.TextSearch.mode=e;var n={book_id:"",archive_name:"","keywords[]":o,mode:Meclib.TextSearch.mode};0===location.pathname.indexOf("/"+Meclib.Globals.book.bookId+"/book/")?n.book_id=Meclib.Globals.book.bookId:n.archive_name=location.pathname.split("/")[2],Meclib.Products.loading=!0,ViewerApp.mediator.trigger("products:showLoading"),Meclib.Products.ajax.txtcount=$.ajax({type:"POST",data:n,dataType:"json",scriptCharset:"utf-8",url:"/library/book-database/text-search/count"}).done((function(e){var i=JSON.stringify(e),t=$.parseJSON(i);$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab").removeClass("selected"),$("#panel-products-"+Meclib.Products.search.mode+'-list .panel-products-list-tab[data-id="-1"]').addClass("selected");for(var o=t.counts,a=0;a0?ViewerApp.mediator.trigger("products:searchTxtData"):$("#panel-products-"+Meclib.Products.search.mode+'-list .panel-products-list-tab[data-id="-1"]').addClass("disabled"),ViewerApp.mediator.trigger("products:updateTotalCounts"),$("#panel-products-"+Meclib.Products.search.mode+'-list .panel-products-list-tab .tab-count[data-id="-1"]').html(o);for(var l=0,n=-1,c=0;c0&&(n=Meclib.Products.results.header[c].db);0===l&&(ViewerApp.mediator.trigger("products:clearResults"),$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab").removeClass("selected"),new Messi(Meclib.Message.error.dbsearchNoData,{title:"",animate:!1,width:Meclib.Size.MessiWidth,modal:!0,buttons:[{id:0,label:Meclib.Message.common.ok,val:null}],callback:function(e){}}),ViewerApp.mediator.trigger("products:hideLoading")),l>0&&0===o?(Meclib.Products.select[Meclib.Products.search.mode].db=n,$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab").removeClass("selected"),$("#panel-products-"+Meclib.Products.search.mode+'-list .panel-products-list-tab[data-id="'+n+'"]').addClass("selected"),ViewerApp.mediator.trigger("products:searchPageProducts")):ViewerApp.mediator.trigger("products:addListsEvent"),1===$(".select-database-box").length&&ViewerApp.mediator.trigger("products:renderDatabsePullDownMenu"),$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab-area").outerHeight()<$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab-area")[0].scrollHeight&&ViewerApp.mediator.trigger("products:renderDatabsePullDownMenu")}))},searchTxtData:function(){var e=0,i=Meclib.Products.search.keyword.replaceAll("\u3000"," ").replace(/ OR /gi," ");i=i.trim(),i=Meclib.Function.convertKanaToFull(i),i=Meclib.Function.convertHalfNum(i);var t=[],o=Meclib.Products.search.keyword.toUpperCase().indexOf(" OR "),a=Meclib.Products.search.keyword.indexOf(" ");e=o>-1&&a>-1||o>-1&&-1===a?1:0,t=i.split(" "),t=$.grep(t,(function(e){return""!==e})),ViewerApp.mediator.trigger("products:clearResults");var l={book_id:"",archive_name:"","keywords[]":t,mode:e,cut_length:20,sort_item:Meclib.Products.sort[Meclib.Products.search.mode].field,sort_type:Meclib.Products.sort[Meclib.Products.search.mode].order,start:Meclib.Products.select[Meclib.Products.search.mode].start,end:Meclib.Products.select[Meclib.Products.search.mode].end};0===location.pathname.indexOf("/"+Meclib.Globals.book.bookId+"/book/")?l.book_id=Meclib.Globals.book.bookId:l.archive_name=location.pathname.split("/")[2],Meclib.Products.loading=!0,ViewerApp.mediator.trigger("products:showLoading"),Meclib.Products.ajax.txtdata=$.ajax({type:"POST",data:l,dataType:"json",scriptCharset:"utf-8",url:"/library/book-database/text-search"}).done((function(e){var i=JSON.stringify(e),o=$.parseJSON(i);$(".panel-products-list-tab").removeClass("selected"),$('.panel-products-list-tab[data-id="-1"]').addClass("selected");var a={};a.book=Meclib.Globals.book,a.deviceCode=Meclib.Globals.deviceCode,a._hitNum=Meclib.Message.txtsearch.hitNum,a._page=Meclib.Message.general.page,a.db=Meclib.Products.select[Meclib.Products.search.mode].db,a.keywords=t,a.hits=o.hits,a.rows=o.data;try{$("#products-"+Meclib.Products.search.mode+"-list-table").append(_.template(Meclib.Cache.Tpl.productsTxtListTable)(a))}catch(e){Meclib.Function.onError(e),ViewerApp.mediator.trigger("products:hideLoading")}var l="asc";0!==Meclib.Products.sort[Meclib.Products.search.mode].order&&(l="desc"),$('.ev-products-txtsearch-sort-icon[data-type="page"]').addClass("sorted "+l),ViewerApp.mediator.trigger("products:renderPagenations"),setTimeout((function(){var e=$("#panel-products-"+Meclib.Products.search.mode+"-list").outerHeight(),i=$(".panel-products-list-title").outerHeight(),t=$(".panel-products-list-header").outerHeight(),o=$(".panel-products-list-sub-header").outerHeight(),a=$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab-area").outerHeight(),l=$(".products-txtsearch-header").outerHeight();"none"===$(".panel-products-list-header").css("display")&&(t=0);var n=e-(i+t+o+a+l)-6;$("#panel-products-"+Meclib.Products.search.mode+"-list .products-txtsearch-data-area").css({height:n}).show(),$("#panel-products-"+Meclib.Products.search.mode+"-list .products-txtsearch-data-area").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:100,scrollInertia:200,scrollButtons:{enable:!1}}),ViewerApp.mediator.trigger("products:addListsEvent"),ViewerApp.mediator.trigger("products:hideLoading")}),500),Meclib.SearchBehind=!0,setTimeout((function(){Meclib.SearchBehind=!1,ViewerApp.mediator.trigger("highlight:draw")}),3e3)})).fail((function(e){Meclib.Debug.log("error",1)}))},searchPageProducts:function(){if(-1!==Meclib.Products.select[Meclib.Products.search.mode].db){ViewerApp.mediator.trigger("products:clearResults"),$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab").removeClass("selected"),$("#panel-products-"+Meclib.Products.search.mode+'-list .panel-products-list-tab[data-id="'+Meclib.Products.select[Meclib.Products.search.mode].db+'"]').addClass("selected");var e={book_id:"",archive_name:"",book_db_id:Meclib.Products.select[Meclib.Products.search.mode].db,device:Meclib.Globals.viewer.get("device"),start:Meclib.Products.select[Meclib.Products.search.mode].start,end:Meclib.Products.select[Meclib.Products.search.mode].end};if(0===location.pathname.indexOf("/"+Meclib.Globals.book.bookId+"/book/")?e.book_id=Meclib.Globals.book.bookId:e.archive_name=location.pathname.split("/")[2],""!==Meclib.Products.sort[Meclib.Products.search.mode].field&&(e.sort_item=Meclib.Products.sort[Meclib.Products.search.mode].field,e.sort_type=Meclib.Products.sort[Meclib.Products.search.mode].order),"search"===Meclib.Products.search.mode){var i=0,t=Meclib.Products.search.keyword.replaceAll("\u3000"," "),o=[],a=(t=(t=Meclib.Function.upperCase(t)).trim()).indexOf(" OR "),l=t.indexOf(" ");i=a>-1&&l>-1||a>-1&&-1===l?1:0,o=(t=t.replaceAll(" OR "," ")).split(" "),o=$.grep(o,(function(e){return""!==e})),e["keywords[]"]=o,e.mode=i}else e.pages=Meclib.Products.select[Meclib.Products.search.mode].pages;ViewerApp.mediator.trigger("products:showLoading"),Meclib.Products.loading=!0,Meclib.Products.ajax.dbdata=$.ajax({type:"POST",data:e,dataType:"json",scriptCharset:"utf-8",url:"/library/book-database/pages-data"}).done((function(e){var i=JSON.stringify(e),t=$.parseJSON(i);Meclib.Products.pageProductsLists=t.rows,ViewerApp.mediator.trigger("products:showPageProductsTable");var o="asc";0!==Meclib.Products.sort[Meclib.Products.search.mode].order&&(o="desc"),$("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-header-col").not('[data-type="1"],[data-type="2"],[data-type="3"]').each((function(){$(this).addClass("unsortable")})),$("#panel-products-"+Meclib.Products.search.mode+'-list .products-list-header-col[data-type="7"]').each((function(){"2"===$(this).attr("data-typeoption")&&$(this).addClass("downloadable")})),$('.ev-products-sort-object[data-key="'+Meclib.Products.sort[Meclib.Products.search.mode].field+'"]').addClass("sorted "+o),1===$(".select-database-box").length&&ViewerApp.mediator.trigger("products:renderDatabsePullDownMenu"),$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab-area").outerHeight()<$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab-area")[0].scrollHeight&&ViewerApp.mediator.trigger("products:renderDatabsePullDownMenu"),ViewerApp.mediator.trigger("products:renderPagenations")})).fail((function(e){Meclib.Debug.log("error",1),ViewerApp.mediator.trigger("products:hideLoading")}))}else ViewerApp.mediator.trigger("products:searchTxtCounts")},updateTotalCounts:function(){for(var e=0,i=0;i-1&&c>-1||n>-1&&-1===c?1:0,l=(a=a.replace(/ OR /gi," ").trim()).split(" "),l=$.grep(l,(function(e){return""!==e})),i["keywords[]"]=l,i.mode=o,""===a&&(t=!0)}else i.pages=Meclib.Products.select[Meclib.Products.search.mode].pages,0===Meclib.Products.select[Meclib.Products.search.mode].pages.length&&(t=!0);if(t)return ViewerApp.mediator.trigger("products:clearLists"),$(".messi-box").length?($(".messi-content").html()==Meclib.Message.error.dbsearchNoData||$(".messi-content").html(Meclib.Message.error.dbsearchNoData),!1):void("search"===Meclib.Products.search.mode&&new Messi(Meclib.Message.error.dbsearchNoData,{title:"",animate:!1,width:Meclib.Size.MessiWidth,modal:!0,buttons:[{id:0,label:Meclib.Message.common.ok,val:null}],callback:function(e){ViewerApp.mediator.trigger("products:addListsEvent")}}));Meclib.Products.loading=!0,ViewerApp.mediator.trigger("products:showLoading"),Meclib.Products.ajax.dbcount=$.ajax({type:"POST",data:i,dataType:"json",scriptCharset:"utf-8",url:"/library/book-database/pages-data"}).done((function(e){var i=JSON.stringify(e),t=$.parseJSON(i);Meclib.Products.results.header=[];var o=0;"search"===Meclib.Products.search.mode&&1===Meclib.Globals.book.txtsearch&&(0===Meclib.Products.select[Meclib.Products.search.mode].db&&(Meclib.Products.select[Meclib.Products.search.mode].db=-1),Meclib.Products.results.header.push({db:-1,counts:0}));var a=0,l=!1;$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab").removeClass("disabled");for(var n=0;n0&&(a=t[n].db),0===Meclib.Products.select[Meclib.Products.search.mode].db&&t[n].counts>0&&(Meclib.Products.select[Meclib.Products.search.mode].db=t[n].db),Meclib.Products.select[Meclib.Products.search.mode].db===t[n].db&&0===t[n].counts&&(l=!0),0===t[n].counts&&$("#panel-products-"+Meclib.Products.search.mode+'-list .panel-products-list-tab[data-id="'+t[n].db+'"]').addClass("disabled");if((0===Meclib.Products.select[Meclib.Products.search.mode].db&&0!==a||l)&&(Meclib.Products.select[Meclib.Products.search.mode].db=a),-1!==Meclib.Products.select[Meclib.Products.search.mode].db&&(ViewerApp.mediator.trigger("products:updateTotalCounts"),1===$(".select-database-box").length&&ViewerApp.mediator.trigger("products:renderDatabsePullDownMenu"),$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab-area").outerHeight()<$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab-area")[0].scrollHeight&&ViewerApp.mediator.trigger("products:renderDatabsePullDownMenu")),0===o&&0===Meclib.Globals.book.txtsearch)return ViewerApp.mediator.trigger("products:hideLoading"),ViewerApp.mediator.trigger("products:clearLists"),void("search"===Meclib.Products.search.mode&&new Messi(Meclib.Message.error.dbsearchNoData,{title:"",animate:!1,width:Meclib.Size.MessiWidth,modal:!0,buttons:[{id:0,label:Meclib.Message.common.ok,val:null}],callback:function(e){ViewerApp.mediator.trigger("products:addListsEvent")}}));ViewerApp.mediator.trigger("products:searchPageProducts")})).fail((function(e){Meclib.Debug.log("error",1)}))},clearTabs:function(){$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab").removeClass("disabled").removeClass("selected"),$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab").addClass("disabled");var e=[];if(Meclib.Products.results.header=[],"search"===Meclib.Products.search.mode&&1===Meclib.Globals.book.txtsearch){var i=[{id:-1,name:Meclib.Message.functionName.txtSearch,count:0}];e=e.concat(i)}e=e.concat(Meclib.Products.databases);for(var t=0;ti&&(a=i);var l=a-o+1;l=5&&(c="center"),null===i.headerCols[n].width||""===i.headerCols[n].width){l=!0;break}var s=parseInt(i.headerCols[n].width,10);s=Math.floor(a*(s/100)),$("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-row-col[data-key='"+i.headerCols[n].col_no+"']").css({width:s+"px","justify-content":c}),$("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-row-col[data-key='"+i.headerCols[n].col_no+"'] .products-list-image").css({width:s+"px"}),$("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-header-col[data-key='"+i.headerCols[n].col_no+"']").css({width:s+"px"})}if(!0===l){var r=($("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-data-area").outerWidth()-12-t-o)/i.colNum;$("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-row-col").not('[data-name="detail"],[data-name="includepages"]').css({width:r+"px"}),$("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-header-col").not('[data-name="detail"],[data-name="includepages"]').css({width:r+"px"})}setTimeout((function(){var e=$("#panel-products-"+Meclib.Products.search.mode+"-list").outerHeight(),i=$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-title").outerHeight(),t=$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-header").outerHeight(),o=$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-sub-header").outerHeight(),a=$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-tab-area").outerHeight(),l=$("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-header").outerHeight();"none"===$("#panel-products-"+Meclib.Products.search.mode+"-list .panel-products-list-header").css("display")&&(t=0);var n=e-(i+t+o+a+l)-6;$("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-data-area").css({height:n}).show(),$("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-data-area").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:100,scrollInertia:200,scrollButtons:{enable:!1}}),ViewerApp.mediator.trigger("products:addListsEvent"),ViewerApp.mediator.trigger("products:hideLoading")}),500)},showProductsDetailsPanel:function(e){if(!0===Meclib.Function.isSideMenuOpened()&&ViewerApp.mediator.trigger("menu:close"),3===Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("products:closeProductsDetailsPanel",0),Meclib.Mode.products=!0,ViewerApp.mediator.trigger("fusen:close"),ViewerApp.mediator.trigger("optionmenu:close"),ViewerApp.mediator.trigger("contents:endEditMode"),3===Meclib.Globals.viewer.get("device")&&($("#footer").addClass("hidden"),$("#footer-sub-box").addClass("hidden"),$(".menu-pagemove").addClass("hidden")),!0!==Meclib.Mode.autoflip&&!0!==Meclib.Mode.autoflipping){if(""!==Meclib.Canvas.motion){if("OVER"!==Meclib.Canvas.motion)return;ViewerApp.mediator.trigger("canvas:cancelOverAnimation")}var i="#panel-products-details"+e;if(1!==$(i).length){Meclib.Products.productsDetails="";var t={item_id:e,archive_name:"",book_db_id:Meclib.Products.select[Meclib.Products.search.mode].db,device:Meclib.Globals.viewer.get("device")};0===location.pathname.indexOf("/"+Meclib.Globals.book.bookId+"/book/")?t.book_id=e:t.archive_name=location.pathname.split("/")[2],$.ajax({type:"POST",data:t,dataType:"json",scriptCharset:"utf-8",url:"/library/book-database/detail-data"}).done((function(t){var o=Meclib.Products.databases.filter((function(e,i){if(e.id==Meclib.Products.select[Meclib.Products.search.mode].db)return!0})),a=JSON.stringify(t),l=$.parseJSON(a);Meclib.Products.productsDetails=l.data;var n={};n.book=Meclib.Globals.book,n.deviceCode=Meclib.Globals.deviceCode,n._productsDetails=Meclib.Message.products.detailsPage,n._menuBack=Meclib.Message.common.back,n.tabindex=$(".panel-products-details").length,n.db=Meclib.Products.select[Meclib.Products.search.mode].db,n.defines=o[0].defines,n.id=e,n.rows=Meclib.Products.productsDetails,n.pages=[],void 0!==l.pages&&(n.pages=l.pages),n._includePages=Meclib.Message.products.includePages,$("#body").append(_.template(Meclib.Cache.Tpl.productsDetails)(n));var c=0;$(".panel-products-details").each((function(){var e=parseInt($(this).css("z-index"),10);c0&&$(i).css("z-index",c+1),setTimeout((function(){var e=Meclib.Function.getWinsize().height,t=0;switch(Meclib.Globals.viewer.get("device")){case 1:case 2:t=e-(Meclib.Size.headerHeight+Meclib.Size.footerHeight)-20;break;case 3:t=e-Meclib.Size.headerHeight}3===Meclib.Globals.viewer.get("device")&&$(i).css({top:Meclib.Size.headerHeight,height:t}),$(i).css({"max-height":t}).show();var o=$(i).outerHeight(),a=$(i+" .panel-products-details-title").outerHeight(),l=0;void 0!==$(i+" .panel-products-details-header").outerHeight()&&(l=$(i+" .panel-products-details-header").outerHeight());var n=o-(a+l)-6;$(i+" .products-details-image").css({"max-width":$(i+" .products-details-row-col-data").outerWidth()-10-12}),$(i+" .products-details-data-area").css({"max-height":n}).show(),$(i+" .products-details-data-area").mCustomScrollbar({theme:Meclib.Menu.scrollTheme,mouseWheelPixels:100,scrollInertia:200,scrollButtons:{enable:!1}}),3!==Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("products:setDetailsPosition",i),ViewerApp.mediator.trigger("products:addDetailsEvent",i)}),500)})).fail((function(e){Meclib.Debug.log("error",1),Meclib.Debug.log(e,1)}))}}},setDetailsPosition:function(e){var i,t=0;t=$(window).width();var o=$(e).outerWidth(),a=$(e).outerHeight(),l=$(window).height()-$("#header").outerHeight()-$("#footer").outerHeight();i=$("#header").outerHeight()+(l-a)/2,t=t/2-o/2,t=parseInt(t,10),$(e).css({top:i+"px",left:t+"px"})},closeProductsDetailsPanel:function(e){0===e?$(".panel-products-details").remove():$("#panel-products-details"+e).remove(),$(".products-details-mask").remove(),Meclib.Mode.products=!1},selectRefinePage:function(e){$(e).find(".checkbox-products-selectpage").each((function(){$(this).toggleClass("on")})),Meclib.Products.select[Meclib.Products.search.mode].pages=[],$(".checkbox-products-selectpage[data-type='left']").hasClass("on")&&Meclib.Products.select[Meclib.Products.search.mode].pages.push(Meclib.Globals.book.getLeftPage()),$(".checkbox-products-selectpage[data-type='right']").hasClass("on")&&Meclib.Products.select[Meclib.Products.search.mode].pages.push(Meclib.Globals.book.getRightPage()),ViewerApp.mediator.trigger("products:renderTabs")},selectDownloadCheckbox:function(e){$(e).toggleClass("on");var i=!1;$("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-data-area").find(".products-download-check-icon").each((function(){$(this).hasClass("on")&&(i=!0)})),$("#panel-products-"+Meclib.Products.search.mode+"-list .products-download-header-icon").removeClass("on"),!0===i&&$("#panel-products-"+Meclib.Products.search.mode+"-list .products-download-header-icon").addClass("on")},selectAllDownloadCheckbox:function(e){var i=!0;$(e).hasClass("on")&&(i=!1),$(e).toggleClass("on");var t=$(e).attr("data-id");$("#panel-products-"+Meclib.Products.search.mode+"-list .products-list-data-area").find(".products-download-check-icon").each((function(){$(this).attr("data-key")===t&&($(this).removeClass("on"),i&&$(this).addClass("on"))})),$("#panel-products-"+Meclib.Products.search.mode+"-list .products-download-header-icon").removeClass("on"),!0===i&&$("#panel-products-"+Meclib.Products.search.mode+"-list .products-download-header-icon").addClass("on")},execDownloadFile:function(e){var i=parseInt($(e).attr("data-id"),10),t=$(e).attr("data-key"),o=$(e).attr("data-name"),a=Meclib.Products.select[Meclib.Products.search.mode].db;if(Meclib.Globals.viewer.get("device")>1){var l="",n=o.split(".");n.length>1&&(l="./database/"+a+"/"+t+"/"+i+"."+n[1]),window.open(l)}else{var c=Meclib.Globals.viewer.get("dataPath")+"scripts/dl_db.php";$("#form-db-fownload").remove();var s=$('
    ');$(s).append(''),$(s).append(''),$(s).append(''),$(s).append(''),$(s).append(''),$(s).appendTo(document.body),$(s).submit(),setTimeout((function(){$("#form-db-fownload").remove()}),1e3)}},execDownloadAllFile:function(e){var i=Meclib.Products.select[Meclib.Products.search.mode].db,t=$(e).attr("data-key"),o=[],a=[];if($(".products-list-data-area").find(".products-download-check-icon").each((function(){if($(this).hasClass("on")){var e=$(this).attr("data-name"),i=$(this).attr("data-id");a.push(e),o.push(i)}})),0===a.length)return!1;var l=Meclib.Globals.viewer.get("dataPath")+"scripts/dl_db.php";$("#form-db-fownload").remove();var n=$('
    ');$(n).append(''),$(n).append(''),$(n).append(''),$(n).append(''),$(n).append(''),$(n).appendTo(document.body),Meclib.Globals.viewer.get("device")>1&&$(n).attr("target","alldownload"),$(n).submit(),setTimeout((function(){$("#form-db-fownload").remove()}),1e3)},addListsEvent:function(){$(".panel-products-list").off(),1!==Meclib.Globals.viewer.get("device")&&2!==Meclib.Globals.viewer.get("device")||($("#panel-products-"+Meclib.Products.search.mode+"-list").is(".ui-draggable")&&$("#panel-products-"+Meclib.Products.search.mode+"-list").draggable("destroy"),setTimeout((function(){$("#panel-products-"+Meclib.Products.search.mode+"-list").draggable({handle:".panel-products-list-title",containment:"body",scroll:!1})}),1e3)),Meclib.ClickManager.add(".panel-products-list",".ev-btn-close-products-page-list,.ev-btn-close-products-search-list",(function(e){ViewerApp.mediator.trigger("products:hidePageProductsPanel")}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-products-txtsearch-row-col",(function(e){var i=parseInt($(e).attr("data-page"),10),t=parseInt($(e).attr("data-index"),10);ViewerApp.mediator.trigger("main:movePage",i),ViewerApp.mediator.trigger("products:hidePageProductsPanel"),$(".saerch-selected").each((function(){$(this).removeClass("saerch-selected")})),null!=document.getElementById("saerch-selected-val")?$("#saerch-selected-val").attr("data-val",i+"-"+t):$("#page-area").append("
    ")}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-btn-products-link",(function(e){var i=$(e).attr("data-url"),t=parseInt($(e).attr("data-type"),10);if(0===t)window.open(i,"_blank");else if(1===t)location.href=i;else{if(2!==t)return;$("#products-details-image-popup").popup(i,90,0,90,0,Meclib.Globals.viewer.get("device"))}}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-products-list-image",(function(e){var i=$(e).attr("data-url");window.open(i,"_blank")}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-btn-products-includepage-more",(function(e){var i=$(e).attr("data-id");$(e).toggleClass("opend"),$('.btn-products-includepag-hide[data-id="'+i+'"]').toggle(),"none"!==$('.btn-products-includepag-hide[data-id="'+i+'"]').css("display")&&$('.btn-products-includepag-hide[data-id="'+i+'"]').css("display","inline-block")}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-btn-products-includepage",(function(e){var i=parseInt($(e).attr("data-page"),10);ViewerApp.mediator.trigger("main:movePage",i),ViewerApp.mediator.trigger("products:hidePageProductsPanel")}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-btn-products-details",(function(e){var i=parseInt($(e).attr("data-id"),10);ViewerApp.mediator.trigger("products:showProductsDetailsPanel",i)}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-products-download-check-icon",(function(e){ViewerApp.mediator.trigger("products:selectDownloadCheckbox",e)}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-products-download-header-check-icon",(function(e){ViewerApp.mediator.trigger("products:selectAllDownloadCheckbox",e)}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-btn-products-download",(function(e){ViewerApp.mediator.trigger("products:execDownloadFile",e)}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-products-download-header-icon",(function(e){ViewerApp.mediator.trigger("products:execDownloadAllFile",e)}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-products-sort-object",(function(e){if(!0!==Meclib.Products.loading){var i=$(e).attr("data-key");Meclib.Products.select[Meclib.Products.search.mode].start=1,Meclib.Products.select[Meclib.Products.search.mode].end=Meclib.Products.pageNation.div,Meclib.Products.select[Meclib.Products.search.mode].page=1,Meclib.Products.sort[Meclib.Products.search.mode].field===i?0===Meclib.Products.sort[Meclib.Products.search.mode].order?Meclib.Products.sort[Meclib.Products.search.mode].order=1:Meclib.Products.sort[Meclib.Products.search.mode].order=0:(Meclib.Products.sort[Meclib.Products.search.mode].field=i,Meclib.Products.sort[Meclib.Products.search.mode].order=0),ViewerApp.mediator.trigger("products:searchPageProducts")}}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-products-txtsearch-sort-icon",(function(e){!0!==Meclib.Products.loading&&(Meclib.Products.select[Meclib.Products.search.mode].start=1,Meclib.Products.select[Meclib.Products.search.mode].end=Meclib.Products.pageNation.div,Meclib.Products.select[Meclib.Products.search.mode].page=1,Meclib.Products.sort[Meclib.Products.search.mode].field="",0===Meclib.Products.sort[Meclib.Products.search.mode].order?Meclib.Products.sort[Meclib.Products.search.mode].order=1:Meclib.Products.sort[Meclib.Products.search.mode].order=0,ViewerApp.mediator.trigger("products:searchPageProducts"))}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-pagenation-move",(function(e){if(!0!==Meclib.Products.loading){var i=$(e).attr("data-type");if($(e).hasClass("disabled"))return!1;if("left"===i)Meclib.Products.select[Meclib.Products.search.mode].page--;else{if("right"!==i)return!1;Meclib.Products.select[Meclib.Products.search.mode].page++}Meclib.Products.select[Meclib.Products.search.mode].start=(Meclib.Products.select[Meclib.Products.search.mode].page-1)*Meclib.Products.pageNation.div+1,Meclib.Products.select[Meclib.Products.search.mode].end=Meclib.Products.select[Meclib.Products.search.mode].page*Meclib.Products.pageNation.div,ViewerApp.mediator.trigger("products:searchPageProducts")}}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-pagenation-box",(function(e){if(!0!==Meclib.Products.loading){var i=parseInt($(e).text(),10);Meclib.Products.select[Meclib.Products.search.mode].page=i,Meclib.Products.select[Meclib.Products.search.mode].start=(i-1)*Meclib.Products.pageNation.div+1,Meclib.Products.select[Meclib.Products.search.mode].end=i*Meclib.Products.pageNation.div,ViewerApp.mediator.trigger("products:searchPageProducts")}}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-panel-products-list-tab",(function(e){if(!0!==Meclib.Products.loading){var i=parseInt($(e).attr("data-id"),10);if($(e).hasClass("disabled"))return!1;Meclib.Products.select[Meclib.Products.search.mode].page=1,Meclib.Products.select[Meclib.Products.search.mode].db=i,Meclib.Products.select[Meclib.Products.search.mode].start=1,Meclib.Products.select[Meclib.Products.search.mode].end=Meclib.Products.pageNation.div,ViewerApp.mediator.trigger("products:searchPageProducts")}}),!0),$(".panel-products-list").on({change:function(e){e.stopPropagation();var i=parseInt($(this).val(),10);return $(this).hasClass("disabled")||(Meclib.Products.select[Meclib.Products.search.mode]={db:i,start:1,end:Meclib.Products.pageNation.div,page:1},ViewerApp.mediator.trigger("products:searchPageProducts")),!1}},".ev-select-database"),Meclib.ClickManager.add(".panel-products-list",".ev-products-pageselect-box",(function(e,i){if(!0!==Meclib.Products.loading)return!$(e).hasClass("disabled")&&void ViewerApp.mediator.trigger("products:selectRefinePage",e)}),!0),$(document).off("submit","#menu-products-search-form"),$(document).on("submit","#menu-products-search-form",(function(e){return!0===Meclib.Products.loading||(Meclib.Products.search.mode="search",Meclib.Products.select[Meclib.Products.search.mode].db=0,Meclib.Products.select[Meclib.Products.search.mode].page=1,Meclib.Products.select[Meclib.Products.search.mode].start=1,Meclib.Products.select[Meclib.Products.search.mode].end=Meclib.Products.pageNation.div,Meclib.Products.sort[Meclib.Products.search.mode].field="",Meclib.Products.search.form="#menu-products-search-input",Meclib.Products.search.keyword=$("#menu-products-search-input").val(),ViewerApp.mediator.trigger("products:sendLog",Meclib.Products.search.keyword),$("#txtsearch-input").val(Meclib.Products.search.keyword),ViewerApp.mediator.trigger("products:renderTabs"),Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1?window.getSelection().removeAllRanges():$("#menu-products-search-input").blur()),!1})),$(document).off("blur","#menu-products-search-input"),$(document).on("blur","#menu-products-search-input",(function(e){Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1&&window.getSelection().removeAllRanges()})),Meclib.ClickManager.add(".panel-products-list",".ev-icon-products-search-box",(function(e){!0!==Meclib.Products.loading&&(Meclib.Products.search.mode="search",Meclib.Products.select[Meclib.Products.search.mode].db=0,Meclib.Products.select[Meclib.Products.search.mode].page=1,Meclib.Products.select[Meclib.Products.search.mode].start=1,Meclib.Products.select[Meclib.Products.search.mode].end=Meclib.Products.pageNation.div,Meclib.Products.sort[Meclib.Products.search.mode].field="",Meclib.Products.search.form="#menu-products-search-input",Meclib.Products.search.keyword=$("#menu-products-search-input").val(),ViewerApp.mediator.trigger("products:sendLog",Meclib.Products.search.keyword),$("#txtsearch-input").val(Meclib.Products.search.keyword),ViewerApp.mediator.trigger("products:renderTabs"),$("#menu-products-search-input").blur())}),!0),Meclib.ClickManager.add(".panel-products-list",".ev-btn-products-search-clear",(function(e){!0!==Meclib.Products.loading&&(Meclib.Products.search.mode="search",Meclib.Products.select[Meclib.Products.search.mode].page=1,Meclib.Products.select[Meclib.Products.search.mode].db=0,Meclib.Products.select[Meclib.Products.search.mode].start=1,Meclib.Products.select[Meclib.Products.search.mode].end=Meclib.Products.pageNation.div,Meclib.Products.sort[Meclib.Products.search.mode].field="",Meclib.TextSearch.inputKeyword="",Meclib.TextSearch.keyword="",Meclib.TextSearch.keywords=[],Meclib.TextSearch.mode="",Meclib.Products.search.form="",Meclib.Products.search.keyword="",$("#txtsearch-input,#menu-products-search-input").val(""),ViewerApp.mediator.trigger("products:clearTabs"),ViewerApp.mediator.trigger("products:clearResults"),ViewerApp.mediator.trigger("highlight:clear"))}),!0)},addDetailsEvent:function(e){$(e+".panel-products-details").off(),1!==Meclib.Globals.viewer.get("device")&&2!==Meclib.Globals.viewer.get("device")||$(e+".panel-products-details").draggable({handle:".panel-products-details-title",containment:"body",scroll:!1}),$(e).focus((function(){var e=0;$(".panel-products-details").each((function(){var i=parseInt($(this).css("z-index"),10);e0&&$(this).css("z-index",e+1)})),$(e).bind("mousedown touchstart pointerdown",(function(){var e=0;$(".panel-products-details").each((function(){var i=parseInt($(this).css("z-index"),10);e0&&$(this).css("z-index",e+1)})),Meclib.ClickManager.add(e+".panel-products-details",".ev-btn-close-products-details",(function(e){ViewerApp.mediator.trigger("products:closeProductsDetailsPanel",$(e).attr("data-id"))})),Meclib.ClickManager.add(e+".panel-products-details",".ev-btn-products-details-link",(function(e){var i=$(e).attr("data-url"),t=parseInt($(e).attr("data-type"),10);if(0===t)window.open(i,"_blank");else if(1===t)location.href=i;else{if(2!==t)return;$("#products-details-image-popup").popup(i,90,0,90,0,Meclib.Globals.viewer.get("device"))}}),!0),Meclib.ClickManager.add(e+".panel-products-details",".ev-btn-products-details-includepage",(function(e){var i=parseInt($(e).attr("data-page"),10);ViewerApp.mediator.trigger("main:movePage",i),ViewerApp.mediator.trigger("products:closePageProductsPanel")}),!0),Meclib.ClickManager.add(e+".panel-products-details",".ev-btn-products-download",(function(e){ViewerApp.mediator.trigger("products:execDownloadFile",e)}),!0),Meclib.ClickManager.add(e+".panel-products-details",".ev-products-details-image",(function(e){var i=$(e).attr("data-url");window.open(i,"_blank")}),!0)},sendLog:function(e){var i=e.replaceAll("\u3000"," "),t=i;i=i.trim(),i=Meclib.Function.convertHalfNum(i);var o=[];if(o=(i=(i=Meclib.Function.upperCase(i)).replaceAll(" OR "," ")).split(" "),(o=$.grep(o,(function(e){return""!==e}))).length>0)for(var a=0;a1&&($("#sidebar-icon-l").addClass("sd"),$("#sidebar-icon-r").addClass("sd"))},events:function(){},update:function(e){Meclib.Canvas.Move.mode="",Meclib.Canvas.motion="",1===Meclib.Globals.bookCanvas.canvasNum?($("#canvas-rightpage").hide(),$("#image-leftslide-right").hide(),$("#image-rightslide-right").hide()):($("#canvas-rightpage").show(),$("#image-leftslide-right").show(),$("#image-rightslide-right").show()),ViewerApp.mediator.trigger("canvas:canvasInitFlip")},resize:function(e){1===Meclib.Globals.viewer.get("device")&&!1===Meclib.MainMenu.overlay?$("#canvas-area").css({width:Meclib.Globals.bookCanvas.canvasWidth+"px",height:Meclib.Globals.bookCanvas.canvasHeight+"px",top:Meclib.Size.headerHeight+"px"}):$("#canvas-area").css({width:Meclib.Globals.bookCanvas.canvasWidth+"px",height:Meclib.Globals.bookCanvas.canvasHeight+"px",top:0}),$("body").animate({scrollTop:0},1),Meclib.Canvas.flippableSpace=Meclib.Globals.bookCanvas.drawWidth/3,ViewerApp.mediator.trigger("canvas:createPageHtml")},analyticsZoom:function(e){var i=0,t=e.scale,o=0,a=e.y,l=0,n=0;1===t?n=Meclib.Globals.bookCanvas.drawWidth:4===t&&(n=2*Meclib.Globals.book.thumbWidth),2===Meclib.Globals.bookCanvas.canvasNum&&e.x>n?(o=e.x-n,l=1):o=e.x,i=2===Meclib.Globals.bookCanvas.canvasNum?Meclib.Globals.book.getOpenPageNo(l):Meclib.Globals.book.currentPage,1===t?(o/=Meclib.Globals.bookCanvas.scale,a/=Meclib.Globals.bookCanvas.scale):4===t&&(o/=2,a/=2);var c={x:0,y:0};c.x=Math.ceil(Meclib.Constants.ANALYTICS_ZOOM_DIV*(o/Meclib.Globals.book.thumbWidth)),c.y=Math.ceil(Meclib.Constants.ANALYTICS_ZOOM_DIV*(a/Meclib.Globals.book.thumbHeight)),c.x>Meclib.Constants.ANALYTICS_ZOOM_DIV&&(c.x=Meclib.Constants.ANALYTICS_ZOOM_DIV),c.y>Meclib.Constants.ANALYTICS_ZOOM_DIV&&(c.y=Meclib.Constants.ANALYTICS_ZOOM_DIV),Meclib.analytics.sendZoomIn(i,t,c.x,c.y),Meclib.UserAnalytics.add("zoom_in",i,""),Meclib.API.onZoomIn(i,t,c.x,c.y)},debug:function(e){!0===e?$(".debugPoint").show():$(".debugPoint").hide()},execFlipMotion:function(e){if(!Meclib.Mode.crop){Meclib.Globals.viewer.set({overmoving:!0});var i=Meclib.Function.point2D(0,0);if("BACK"==Meclib.Globals.viewer.get("flipLoop")||"OVER"==Meclib.Globals.viewer.get("flipLoop"))0===Meclib.Canvas.flipDir?i.x=Meclib.Globals.bookCanvas.left:i.x=Meclib.Globals.bookCanvas.canvasWidth-Meclib.Globals.bookCanvas.left,(1===Meclib.Globals.viewer.get("device")&&!1===Meclib.MainMenu.overlay?e.y-Meclib.Size.headerHeight:e.y)0);else{if(""!==Meclib.Globals.viewer.get("flipLoop"))return;if(Meclib.Globals.viewer.set({dragging:!0}),"flip"===Meclib.Globals.viewer.get("moveType")&&0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage){var i,t=0;e.touches?(i=e.touches[0].pageX,t=e.touches[0].pageY):e.originalEvent?e.originalEvent.touches?(i=e.originalEvent.touches[0].pageX,t=e.originalEvent.touches[0].pageY):(i=e.originalEvent.pageX,t=e.originalEvent.pageY):(i=e.pageX,t=e.pageY),1===Meclib.Globals.viewer.get("device")&&!1===Meclib.MainMenu.overlay&&(t-=Meclib.Size.headerHeight);var o={x:i,y:t};o.nowPageNo=Meclib.Globals.book.getFlipStartPage(Meclib.Canvas.flipDir),o.reversePageNo=Meclib.Globals.book.getFlipReversePage(Meclib.Canvas.flipDir),o.underPageNo=Meclib.Globals.book.getFlipUnderPage(Meclib.Canvas.flipDir),o.flipH=0==Meclib.Canvas.flipDir?"left":"right",o.flipV=Meclib.Canvas.flipCorner,ViewerApp.mediator.trigger("canvas:flip",o)}}else ViewerApp.mediator.trigger("canvas:dragCanvas")},initFlip:function(){Meclib.Canvas.Touch.startX=0,Meclib.Canvas.Touch.startY=0,Meclib.Globals.viewer.set({selected:!1,dragging:!1,flipLoop:"",flipCurled:!1,moving:!1,flipping:!1,overmoving:!1,flipX:0,flipY:0}),null==Meclib.Globals.pagehtml&&ViewerApp.mediator.trigger("canvas:createPageHtml"),ViewerApp.mediator.trigger("canvas:clearFlipObject")},scaleCenter:function(){ViewerApp.mediator.trigger("fusen:close"),ViewerApp.mediator.trigger("object:hide");var e=Meclib.Function.point2D(Meclib.Globals.bookCanvas.canvasWidth/2,Meclib.Globals.bookCanvas.canvasHeight/2);ViewerApp.mediator.trigger("canvas:scaleCanvas",e)},scaleCanvas:function(e){Meclib.Canvas.zoomDragged=!1,ViewerApp.mediator.trigger("contents:clear");var i=1,t=0,o=0,a=!1,l=Meclib.Function.getCssVal("#page-area"),n=Meclib.Function.point2D(0,0),c=Meclib.Globals.viewer.get("scale"),s=1,r=0,g={x:0,y:0};if(0!==arguments.length&&("out"===e.zoom&&(i=0),t=e.x,o=e.y),1===Meclib.Globals.viewer.get("device")&&!1===Meclib.MainMenu.overlay&&(o-=Meclib.Size.headerHeight),!0!==Meclib.Mode.autoflipping){"pinch"===Meclib.Zoom.type&&(a=!0);var b=Meclib.zoomScale;ViewerApp.mediator.trigger("canvas:initScale");var p=1*Meclib.Globals.book.thumbWidth/Meclib.Globals.bookCanvas.drawWidth,d=2*Meclib.Globals.book.thumbWidth/Meclib.Globals.bookCanvas.drawWidth;if(1===i)switch(c){case 1:1===Meclib.Globals.book.zoom.x4?(s=4,Meclib.Globals.bookCanvas.drawWidth>=2*Meclib.Globals.book.thumbWidth&&1===Meclib.Globals.book.zoom.x6&&(s=6)):s=1===Meclib.Globals.book.zoom.x6?6:1===Meclib.Globals.book.zoom.x8?8:1;break;case 4:s=1===Meclib.Globals.book.zoom.x6?6:1;break;default:s=1}else if(0===i)switch(c){case 1:case 4:default:s=1;break;case 6:s=1,1===Meclib.Globals.book.zoom.x4&&(s=4)}Meclib.Globals.viewer.set({scale:s}),1===s?Meclib.Globals.viewer.set({imageScale:Meclib.Globals.bookCanvas.scale}):Meclib.Globals.viewer.set({imageScale:s});var M=Meclib.Function.point2D(0,0),m=Meclib.Function.point2D(0,0),h=Meclib.Function.point2D(0,0),u=1;1===c?(u=2,6===s&&(u=4),1===b?(r=Meclib.Globals.book.thumbWidth*u/Meclib.Globals.bookCanvas.drawWidth,r/=b,n.x=t-Meclib.Globals.bookCanvas.left,n.y=o-Meclib.Globals.bookCanvas.top,M.x=n.x*(2-b)/(b/(Meclib.Globals.book.thumbWidth*u/Meclib.Globals.bookCanvas.drawWidth)),M.y=n.y*(2-b)/(b/(Meclib.Globals.book.thumbHeight*u/Meclib.Globals.bookCanvas.drawHeight)),m.x=-1*(M.x-t),m.y=-1*(M.y-o),g={x:t,y:o}):(r=u/(b/p),l.left<0?n.x=Math.abs(l.left)+t:n.x=t-Math.abs(l.left),l.top<0?n.y=Math.abs(l.top)+o:n.y=o-Math.abs(l.top),M.x=n.x*u/(b/p),M.y=n.y*u/(b/p),m.x=t-M.x,m.y=o-M.y,g={x:n.x,y:n.y})):4===c?(u=4,r=2/(b/d),l.left<0?n.x=Math.abs(l.left)+t:n.x=t-Math.abs(l.left),l.top<0?n.y=Math.abs(l.top)+o:n.y=o-Math.abs(l.top),M.x=2*n.x/(b/d),M.y=2*n.y/(b/d),m.x=t-M.x,m.y=o-M.y,g={x:n.x,y:n.y}):6===c&&4==s&&(l.left<0?n.x=Math.abs(l.left)+t:n.x=t-Math.abs(l.left),l.top<0?n.y=Math.abs(l.top)+o:n.y=o-Math.abs(l.top),M.x=n.x*(s/c),M.y=n.y*(s/c),h={x:0,y:0},M.x1&&ViewerApp.mediator.trigger("canvas:analyticsZoom",A),1===s)return ViewerApp.mediator.trigger("fusen:disabledFusenMenu",0),$("#page-area").stop().transform("none").css({top:0,left:0}).css({"-moz-transition":"","-webkit-transition":"","-webkit-transform-origin":"","transform-origin":"","-webkit-transform":"",transform:""}),ViewerApp.mediator.trigger("updatePage"),void Meclib.Function.postParent("zoom");if(ViewerApp.mediator.trigger("fusen:disabledFusenMenu",1),!0===a)return ViewerApp.mediator.trigger("updatePage"),$("#page-area").css({"-moz-transition":"","-webkit-transition":"","-webkit-transform-origin":"","transform-origin":"","-webkit-transform":"",transform:""}),void $("#page-area").css({left:m.x,top:m.y});ViewerApp.mediator.trigger("canvas:toggleSideBar",0),ViewerApp.mediator.trigger("canvas:hideTickness"),$(".slide-obj").hide();var v=0;Meclib.Zoom.effect&&(v=600,$("#page-area").css({"-ms-transition":"all 0s linear 0","-moz-transition":"all 0s linear 0","-webkit-transition":"all 0s linear 0","-ms-transform-origin":g.x+"px "+g.y+"px","-moz-transform-origin":g.x+"px "+g.y+"px","-webkit-transform-origin":g.x+"px "+g.y+"px"}),$("#page-area").css({"-ms-transition":"0s","-moz-transition":"0s","-webkit-transition":"0s","-ms-transform":"scale(1)","-moz-transform":"scale(1)","-webkit-transform":"scale(1)"}),setTimeout((function(){$("#page-area").css({"-ms-transition":".2s","-moz-transition":".2s","-webkit-transition":".2s","-ms-transform":"scale("+r+")","-moz-transform":"scale("+r+")","-webkit-transform":"scale("+r+")"})}),100)),setTimeout((function(){$("#page-area").css({"-ms-transition":"","-moz-transition":"","-webkit-transition":"","-ms-transform-origin":"","-moz-transform-origin":"","-webkit-transform-origin":"",transform:"","-ms-transform":"","-moz-transform":"","-webkit-transform":""}),ViewerApp.mediator.trigger("updatePage"),$("#page-area").css({left:m.x,top:m.y}),Meclib.Function.postParent("zoom")}),v);var f=Meclib.Globals.viewer.get("scale");switch(f){case 4:f=2;break;case 6:f=4}Meclib.zoomScale=Meclib.Globals.book.thumbWidth*f/Meclib.Globals.bookCanvas.drawWidth}},zoomAction:function(e){ViewerApp.mediator.trigger("canvas:toggleSideBar",0),ViewerApp.mediator.trigger("canvas:hideTickness"),ViewerApp.mediator.trigger("fusen:disabledFusenMenu",1);var i=e.movedX,t=e.movedY;$("#page-area").css({"-moz-transition":"all 0s ease 0","-webkit-transition":"all 0s ease 0","-webkit-transform-origin":e.x+"px "+e.y+"px","transform-origin":e.x+"px "+e.y+"px"}),4===e.scale?e.scale=1+Meclib.Globals.bookCanvas.scale:e.scale=2,setTimeout((function(){$("#page-area").css({"-moz-transition":"all 0.4s ease 0","-webkit-transition":"all 0.4s ease 0","-webkit-transform":"scale("+e.scale+")",transform:"scale("+e.scale+")"}),setTimeout((function(){ViewerApp.mediator.trigger("updatePage"),$("#page-area").css({"-moz-transition":"","-webkit-transition":"","-webkit-transform-origin":"","transform-origin":"","-webkit-transform":"",transform:""}),$("#page-area").css({left:i,top:t})}),500)}),1)},initScale:function(){Meclib.Zoom.scale=1,Meclib.Zoom.pinch="",Meclib.Zoom.type="",Meclib.Canvas.zoomDragged=!1,Meclib.zoomScale=1,ViewerApp.mediator.trigger("fusen:disabledFusenMenu",0),Meclib.Globals.viewer.set({scale:1});try{!0===Meclib.Function.getDeviceEventLists().touch&&!1===Meclib.Function.getDeviceEventLists().pointer&&($("#page-area").unbind("touchstart",this.dragCanvasStart),$(window).unbind("touchmove",this.dragCanvasMove),$(window).unbind("touchend blur",this.dragCanvasEnd)),!0===Meclib.Function.getDeviceEventLists().pointer&&(document.getElementById("page-area").removeEventListener("pointerdown",this.dragCanvasStart,!1),document.documentElement.removeEventListener("pointermove",this.dragCanvasMove,!1),document.documentElement.removeEventListener("pointerup",this.dragCanvasEnd,!1)),!0===Meclib.Function.getDeviceEventLists().mouse&&($("#page-area").unbind("mousedown",this.dragCanvasStart),$(window).unbind("mousemove",this.dragCanvasMove),$(window).unbind("mouseup blur",this.dragCanvasEnd))}catch(e){}},adjustSlidePage:function(e){var i,t=Meclib.Canvas.Touch.startX-e.gesture.center.pageX;i=parseInt(Meclib.Globals.bookCanvas.canvasWidth/8,10);var o=0-t;if($("#page-area").css({"-moz-transform":"","-webkit-transform":"","-o-transform":"","-ms-transform":"",left:o}),t>0){if(Math.abs(t)>i)return void ViewerApp.mediator.trigger("main:moveRightPage","slide")}else if(t<0&&Math.abs(t)>i)return void ViewerApp.mediator.trigger("main:moveLeftPage","slide");$("#page-area").stop().animate({left:"0px"},{duration:"fast",easing:"easeOutQuad",complete:function(){ViewerApp.mediator.trigger("contents:showAll")}})},cancelOverAnimation:function(){for(var e=0;e0&&(t=parseInt($("#canvas-leftpage").css("left"),10)-Meclib.Size.thickness.width,o=parseInt($("#canvas-leftpage").css("left"),10)+Meclib.Globals.bookCanvas.drawWidth),$("#thickness-l").css({top:e+1+"px",left:t+"px",width:i.width+"px",height:i.height+"px"}),$("#thickness-r").css({top:e+1+"px",left:o+1+"px",width:i.width+"px",height:i.height+"px"}),$(".sidebar").removeClass("zoomedSidebar");var a={width:Meclib.Size.sideBar.width,height:i.height};if(1===Meclib.zoomScale)$("#leftbar").css({left:t-Meclib.Size.sideBar.width-5+"px",top:e+"px",height:a.height+"px",width:a.width+"px"}),$("#rightbar").css({left:o+i.width+5+"px",top:e+"px",height:a.height+"px",width:a.width+"px"});else{$(".sidebar").addClass("zoomedSidebar"),a={width:Meclib.Size.sideBar.width+10,height:Meclib.Globals.bookCanvas.canvasHeight};2!==Meclib.Globals.viewer.get("device")&&3!==Meclib.Globals.viewer.get("device")||(a.height=Meclib.Globals.bookCanvas.canvasHeight),$("#leftbar").css({left:0,top:0,height:a.height,width:a.width}),$("#rightbar").css({left:Meclib.Globals.bookCanvas.canvasWidth-a.width,top:0,height:a.height,width:a.width}),!1===Meclib.MainMenu.display&&$(".sidebar").hide()}$("#sidebar-icon-l").css("top",a.height/2-6).css("left",(a.width-12)/2),$("#sidebar-icon-r").css("top",a.height/2-6).css("left",(a.width-12)/2)},drawCanvas:function(){Meclib.Canvas.zoomDrag=!1,Meclib.Globals.load_waiting=[],ViewerApp.mediator.trigger("canvas:slideMaskRemove"),1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?ViewerApp.mediator.trigger("canvas:contentsMaskAdd"):ViewerApp.mediator.trigger("canvas:contentsMaskRemove");var e=0,i=0,t={};switch(t.width=Meclib.Globals.book.thumbWidth*Meclib.Globals.viewer.get("scale"),t.height=Meclib.Globals.book.thumbHeight*Meclib.Globals.viewer.get("scale"),Meclib.Globals.viewer.get("scale")){case 1:t.width==Meclib.Globals.bookCanvas.drawWidth&&t.height==Meclib.Globals.bookCanvas.drawHeight||(t.width=Meclib.Globals.bookCanvas.drawWidth,t.height=Meclib.Globals.bookCanvas.drawHeight);break;case 4:t.width=2*Meclib.Globals.book.thumbWidth,t.height=2*Meclib.Globals.book.thumbHeight;break;case 6:t.width=4*Meclib.Globals.book.thumbWidth,t.height=4*Meclib.Globals.book.thumbHeight}1===Meclib.zoomScale&&1===Meclib.Globals.viewer.get("scale")&&(1!==Meclib.Globals.bookCanvas.canvasNum&&"slide"!==Meclib.Globals.viewer.get("moveType")||$(".slide-obj").show()),2===Meclib.Globals.bookCanvas.canvasNum?(e=Meclib.Globals.book.getLeftPage(),i=Meclib.Globals.book.getRightPage(),1===Meclib.Globals.viewer.get("scale")?($("#canvas-leftpage").css({left:Meclib.Globals.bookCanvas.left+"px",top:Meclib.Globals.bookCanvas.top+"px",width:Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"}),$("#canvas-leftpage").attr({width:2*Meclib.Globals.bookCanvas.drawWidth+"px",height:2*Meclib.Globals.bookCanvas.drawHeight+"px"})):($("#canvas-leftpage").css({left:"0px",top:"0px",width:t.width+"px",height:t.height+"px"}),$("#canvas-leftpage").attr({width:2*t.width+"px",height:2*t.height+"px"})),1===Meclib.Globals.viewer.get("scale")?($("#canvas-rightpage").css({left:Meclib.Globals.bookCanvas.canvasWidth/2+"px",top:Meclib.Globals.bookCanvas.top+"px",width:Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"}),$("#canvas-rightpage").attr({width:2*Meclib.Globals.bookCanvas.drawWidth+"px",height:2*Meclib.Globals.bookCanvas.drawHeight+"px"})):($("#canvas-rightpage").css({left:0+t.width+"px",top:"0px",width:t.width+"px",height:t.height+"px"}),$("#canvas-rightpage").attr({width:2*t.width+"px",height:2*t.height+"px"})),1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?($("#image-leftslide-left").show(),$("#image-leftslide-right").show(),$("#image-rightslide-left").show(),$("#image-rightslide-right").show(),$("#image-leftslide-left").css({left:-1*(Meclib.Globals.bookCanvas.left+2*Meclib.Globals.bookCanvas.drawWidth)+"px",top:Meclib.Globals.bookCanvas.top+"px",width:Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"}),$("#image-leftslide-right").css({left:-1*(Meclib.Globals.bookCanvas.left+Meclib.Globals.bookCanvas.drawWidth)+"px",top:Meclib.Globals.bookCanvas.top+"px",width:Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"}),$("#image-rightslide-left").css({left:Meclib.Globals.bookCanvas.canvasWidth+Meclib.Globals.bookCanvas.left+"px",top:Meclib.Globals.bookCanvas.top+"px",width:Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"}),$("#image-rightslide-right").css({left:Meclib.Globals.bookCanvas.canvasWidth+Meclib.Globals.bookCanvas.left+Meclib.Globals.bookCanvas.drawWidth+"px",top:Meclib.Globals.bookCanvas.top+"px",width:Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"})):($("#image-leftslide-left").hide(),$("#image-leftslide-right").hide(),$("#image-rightslide-left").hide(),$("#image-rightslide-right").hide())):(e=Meclib.Globals.book.currentPage,1===Meclib.Globals.viewer.get("scale")?($("#canvas-leftpage").css({left:Meclib.Globals.bookCanvas.left+"px",top:Meclib.Globals.bookCanvas.top+"px",width:Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"}),$("#canvas-leftpage").attr({width:2*Meclib.Globals.bookCanvas.drawWidth+"px",height:2*Meclib.Globals.bookCanvas.drawHeight+"px"})):($("#canvas-leftpage").css({left:0,top:0,width:t.width+"px",height:t.height+"px"}),$("#canvas-leftpage").attr({width:2*t.width+"px",height:2*t.height+"px"})),1===Meclib.Globals.viewer.get("scale")?($("#image-leftslide-left").show(),$("#image-rightslide-left").show(),$("#image-leftslide-left").css({left:-1*(Meclib.Globals.bookCanvas.drawWidth+Meclib.Globals.bookCanvas.left+2)+"px",top:Meclib.Globals.bookCanvas.top+"px",width:Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"}),$("#image-rightslide-left").css({left:Meclib.Globals.bookCanvas.canvasWidth+Meclib.Globals.bookCanvas.left+2+"px",top:Meclib.Globals.bookCanvas.top+"px",width:Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"})):($("#image-leftslide-left").hide(),$("#image-leftslide-right").hide(),$("#image-rightslide-left").hide(),$("#image-rightslide-right").hide())),1===Meclib.Globals.viewer.get("scale")?$("#page-area").css({width:Meclib.Globals.bookCanvas.canvasWidth+"px",height:Meclib.Globals.bookCanvas.canvasHeight+"px"}):$("#page-area").css({width:t.width*Meclib.Globals.bookCanvas.canvasNum+"px",height:t.height+"px"}),$("#shadow-center").hide();var o={dir:0,top:1,bottom:1,left:1,right:1},a={dir:1,top:1,bottom:1,left:0,right:1};function l(e){var i="";i=0===e.dir?"#canvas-leftpage":"#canvas-rightpage",1===e.left?$(i).css("border-left","solid 1px #cccccc"):$(i).css("border-left",""),1===e.right?$(i).css("border-right","solid 1px #cccccc"):$(i).css("border-right",""),1===e.top?$(i).css("border-top","solid 1px #cccccc"):$(i).css("border-top",""),1===e.bottom?$(i).css("border-bottom","solid 1px #cccccc"):$(i).css("border-bottom","")}1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale&&Meclib.Function.isTwoPage()&&(1===Meclib.Globals.book.currentPage&&0===Meclib.Globals.book.cover||Meclib.Globals.book.currentPage===Meclib.Globals.book.totalPage&&0===Meclib.Globals.book.cover&&Meclib.Globals.book.totalPage%2==0||Meclib.Globals.book.currentPage===Meclib.Globals.book.totalPage&&1===Meclib.Globals.book.cover&&Meclib.Globals.book.totalPage%2==1)&&(0===Meclib.Globals.book.getPageDir(Meclib.Globals.book.currentPage)?(o={dir:0,top:1,bottom:1,left:1,right:1},a={dir:1,top:0,bottom:0,left:0,right:0}):(o={dir:0,top:0,bottom:0,left:0,right:0},a={dir:1,top:1,bottom:1,left:1,right:1})),1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale?(ViewerApp.mediator.trigger("canvas:showTickness",0),ViewerApp.mediator.trigger("canvas:showTickness",1),Meclib.Function.isTwoPage()&&(1===Meclib.Globals.book.currentPage&&0===Meclib.Globals.book.cover||Meclib.Globals.book.currentPage===Meclib.Globals.book.totalPage&&0===Meclib.Globals.book.cover&&Meclib.Globals.book.totalPage%2==0||Meclib.Globals.book.currentPage===Meclib.Globals.book.totalPage&&1===Meclib.Globals.book.cover&&Meclib.Globals.book.totalPage%2==1?0===Meclib.Globals.book.getPageDir(Meclib.Globals.book.currentPage)?ViewerApp.mediator.trigger("canvas:hideTickness",1):ViewerApp.mediator.trigger("canvas:hideTickness",0):1!==Meclib.Globals.book.shadow&&"slide"!==Meclib.Globals.viewer.get("moveType")||1!==Meclib.zoomScale||$("#shadow-center").show(),0===Meclib.Globals.book.getFlipUnderPage(0)&&ViewerApp.mediator.trigger("canvas:hideTickness",0),0===Meclib.Globals.book.getFlipUnderPage(1)&&ViewerApp.mediator.trigger("canvas:hideTickness",1))):(ViewerApp.mediator.trigger("canvas:hideTickness",0),ViewerApp.mediator.trigger("canvas:hideTickness",1),$(".slide-obj").hide()),1!==Meclib.zoomScale&&$(".slide-obj").hide(),Meclib.Globals.viewer.get("viewMode")>0&&($("#shadow-center").hide(),ViewerApp.mediator.trigger("canvas:hideTickness",0),ViewerApp.mediator.trigger("canvas:hideTickness",1)),0===Meclib.Globals.book.shadow&&$("#shadow-center").hide(),1===Meclib.Globals.bookCanvas.canvasNum&&ViewerApp.mediator.trigger("canvas:hideTickness"),l(o),l(a),3!==Meclib.Globals.viewer.get("device")&&9!==Meclib.Globals.viewer.get("device")||($(".sidebar").hide(),ViewerApp.mediator.trigger("canvas:hideTickness",0),ViewerApp.mediator.trigger("canvas:hideTickness",1)),2===Meclib.Globals.viewer.get("device")&&0===Meclib.Globals.viewer.get("rotate")&&(ViewerApp.mediator.trigger("canvas:hideTickness",0),ViewerApp.mediator.trigger("canvas:hideTickness",1)),ViewerApp.mediator.trigger("canvas:toggleSideBar",1),$("#mask-shadow-area").hide(),$("#shadow-page-inside").hide(),$("#shadow-center").css({left:Meclib.Globals.bookCanvas.canvasWidth/2-20+"px",top:Meclib.Globals.bookCanvas.top+1,width:"0px",height:Meclib.Globals.bookCanvas.drawHeight-2+"px"});var n=new Object;n.top=Meclib.Globals.bookCanvas.top,n.height=Meclib.Globals.bookCanvas.canvasHeight-2*Meclib.Globals.bookCanvas.top,n.width=2*Meclib.Globals.bookCanvas.drawWidth,n.left=Meclib.Globals.bookCanvas.left,$("#mask-shadow-area").css({left:n.left+"px",top:n.top+"px",width:n.width+"px",height:n.height+"px",overflow:"hidden"}),Meclib.ZoomPos&&Meclib.ZoomPos.x<-1*$("canvas-leftpage").width()?(i>0?Meclib.Globals.bookCanvas.drawImage(i,1):Meclib.Globals.bookCanvas.clearImage(1),e>0?Meclib.Globals.bookCanvas.drawImage(e,0):Meclib.Globals.bookCanvas.clearImage(0)):(e>0?Meclib.Globals.bookCanvas.drawImage(e,0):Meclib.Globals.bookCanvas.clearImage(0),i>0?Meclib.Globals.bookCanvas.drawImage(i,1):Meclib.Globals.bookCanvas.clearImage(1)),"slide"===Meclib.Globals.viewer.get("moveType")?Meclib.Canvas.Move.mode="SLIDE":"flip"===Meclib.Globals.viewer.get("moveType")&&(Meclib.Canvas.Move.mode="FLIP"),1!==Meclib.Globals.viewer.get("scale")||1!==Meclib.zoomScale||1!==Meclib.Globals.viewer.get("viewMode")&&0!==Meclib.Globals.viewer.get("rotate")&&0!==Meclib.Globals.book.twopage?(Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)&&(Meclib.Canvas.Move.mode="DRAG",ViewerApp.mediator.trigger("canvas:dragCanvas")):(Meclib.Canvas.Move.mode="SLIDE",ViewerApp.mediator.trigger("canvas:slide"));var c=Meclib.Globals.bookCanvas.canvasNum;0===Meclib.Globals.book.pageOpenDir&&0==i&&(i=e+1),1===Meclib.Globals.book.pageOpenDir&&0==e&&(e=i+1),0===Meclib.Globals.book.pageOpenDir?(e-c>0?ViewerApp.mediator.trigger("canvas:loadPage","image-leftslide-left",e-c,1):ViewerApp.mediator.trigger("canvas:loadPage","image-leftslide-left",0,1),i-c>0?ViewerApp.mediator.trigger("canvas:loadPage","image-leftslide-right",i-c,1):ViewerApp.mediator.trigger("canvas:loadPage","image-leftslide-right",0,1),e+c<=Meclib.Globals.book.totalPage?ViewerApp.mediator.trigger("canvas:loadPage","image-rightslide-left",e+c,1):ViewerApp.mediator.trigger("canvas:loadPage","image-rightslide-left",0,1),i+c<=Meclib.Globals.book.totalPage?ViewerApp.mediator.trigger("canvas:loadPage","image-rightslide-right",i+c,1):ViewerApp.mediator.trigger("canvas:loadPage","image-rightslide-right",0,1)):(e-c>0?ViewerApp.mediator.trigger("canvas:loadPage","image-rightslide-left",e-c,1):ViewerApp.mediator.trigger("canvas:loadPage","image-rightslide-left",0,1),i-c>0?ViewerApp.mediator.trigger("canvas:loadPage","image-rightslide-right",i-c,1):ViewerApp.mediator.trigger("canvas:loadPage","image-rightslide-right",0,1),e+c<=Meclib.Globals.book.totalPage?ViewerApp.mediator.trigger("canvas:loadPage","image-leftslide-left",e+c,1):ViewerApp.mediator.trigger("canvas:loadPage","image-leftslide-left",0,1),i+c<=Meclib.Globals.book.totalPage?ViewerApp.mediator.trigger("canvas:loadPage","image-leftslide-right",i+c,1):ViewerApp.mediator.trigger("canvas:loadPage","image-leftslide-right",0,1)),1===Meclib.Globals.viewer.get("scale")&&"slide"===Meclib.Globals.viewer.get("moveType")&&ViewerApp.mediator.trigger("canvas:slide"),ViewerApp.mediator.trigger("canvas:fixedCanvas")},toggleSideBar:function(e){if(Meclib.zoomScale>1&&(1===Meclib.Globals.viewer.get("scale")||2===Meclib.Globals.viewer.get("scale")))return $("#leftbar").hide(),void $("#rightbar").hide();1===e?($("#leftbar").show(),$("#rightbar").show(),!1===Meclib.Globals.book.isMovabledPage(0,Meclib.Globals.bookCanvas.canvasNum)&&$("#leftbar").hide(),!1===Meclib.Globals.book.isMovabledPage(1,Meclib.Globals.bookCanvas.canvasNum)&&$("#rightbar").hide()):($("#leftbar").hide(),$("#rightbar").hide()),Meclib.Globals.viewer.get("scale")>1&&1===Meclib.Globals.viewer.get("device")&&($("#leftbar").hide(),$("#rightbar").hide()),3===Meclib.Globals.viewer.get("device")&&($("#leftbar").hide(),$("#rightbar").hide())},showTickness:function(e){0===e?$("#thickness-l").show():$("#thickness-r").show()},hideTickness:function(){if(0===arguments.length)$("#thickness-l").hide(),$("#thickness-r").hide();else{var e=arguments[0];0===e?$("#thickness-l").hide():$("#thickness-r").hide()}},slidePage:function(e){ViewerApp.mediator.trigger("canvas:slideMaskAdd"),$("#mask-pageflip").hide(),$("#canvasShadow").hide(),$("#canvas-underpage").hide(),$("#mask-turnedpage").hide(),$("#shadow-center").hide(),$(".thickness").hide(),0!==Meclib.Slide.move.x&&(Meclib.Slide.move.x=0,window.clearInterval(Meclib.Timer.slidepage),ViewerApp.mediator.trigger("main:onMovedPage"),ViewerApp.mediator.trigger("updatePage"),$("#page-area").css("transform",""));var i=-1*Meclib.Globals.bookCanvas.canvasWidth,t=Meclib.Globals.bookCanvas.canvasWidth;0===e?(Meclib.Slide.move.x=0,window.clearInterval(Meclib.Timer.slidepage),Meclib.Timer.slidepage=window.setInterval((function(){if(Meclib.Slide.move.x===i)return Meclib.Slide.move.x=0,window.clearInterval(Meclib.Timer.slidepage),ViewerApp.mediator.trigger("main:onMovedPage"),ViewerApp.mediator.trigger("updatePage"),$("#page-area").css("transform",""),!1;var e=Math.abs(Math.abs(Meclib.Slide.move.x)-Math.abs(i));(e/=Meclib.Slide.moveVal)<1&&(e=1),Meclib.Slide.move.x=Meclib.Slide.move.x-e,Math.abs(Math.abs(Meclib.Slide.move.x)-Math.abs(i))<.1&&(Meclib.Slide.move.x=i),Meclib.Slide.move.xt&&(Meclib.Slide.move.x=t),Math.abs(Math.abs(Meclib.Slide.move.x)-Math.abs(t))<.1&&(Meclib.Slide.move.x=t),$("#page-area").transform(Meclib.Function.translate(Meclib.Slide.move.x,0))}),1)),ViewerApp.mediator.trigger("canvas:loadX1Image")},dragCanvas:function(){!0!==Meclib.Canvas.zoomDrag&&(Meclib.Canvas.zoomDragged=!1,Meclib.Event.type,""===Meclib.Event.gesture&&1!==Meclib.zoomScale&&(!0===Meclib.Function.getDeviceEventLists().touch&&!1===Meclib.Function.getDeviceEventLists().pointer&&($("#page-area").unbind("touchstart",this.dragCanvasStart),$(window).unbind("touchmove",this.dragCanvasMove),$(window).unbind("touchend blur",this.dragCanvasEnd)),!0===Meclib.Function.getDeviceEventLists().pointer&&(document.getElementById("page-area").removeEventListener("pointerdown",this.dragCanvasStart,!1),document.documentElement.removeEventListener("pointermove",this.dragCanvasMove,!1),document.documentElement.removeEventListener("pointerup",this.dragCanvasEnd,!1)),!0===Meclib.Function.getDeviceEventLists().mouse&&($("#page-area").unbind("mousedown",this.dragCanvasStart),$(window).unbind("mousemove",this.dragCanvasMove),$(window).unbind("mouseup blur",this.dragCanvasEnd)),!0===Meclib.Function.getDeviceEventLists().touch&&!1===Meclib.Function.getDeviceEventLists().pointer&&($("#page-area").bind("touchstart",this.dragCanvasStart),$(window).bind("touchmove",this.dragCanvasMove),$(window).bind("touchend blur",this.dragCanvasEnd)),!0===Meclib.Function.getDeviceEventLists().pointer&&(document.getElementById("page-area").addEventListener("pointerdown",this.dragCanvasStart,!1),document.documentElement.addEventListener("pointermove",this.dragCanvasMove,!1),document.documentElement.addEventListener("pointerup",this.dragCanvasEnd,!1)),!0===Meclib.Function.getDeviceEventLists().mouse&&($("#page-area").bind("mousedown",this.dragCanvasStart),$(window).bind("mousemove",this.dragCanvasMove),$(window).bind("mouseup blur",this.dragCanvasEnd))))},dragCanvasStart:function(e){if(1!==Meclib.Event.type||!e.pointerType||"mouse"!==e.pointerType){if(2===Meclib.Event.type){if(e.pointerType&&"touch"===e.pointerType)return;if(e.originalEvent&&"mousedown"===e.type)return}if(3===Meclib.Event.type){if(e.pointerType){if("touch"!==e.pointerType)return;if(!1===e.isPrimary)return}if(e.originalEvent&&"mousemove"===e.originalEvent.type)return}if("pinch"==Meclib.Event.gesture){if(!((new Date).getTime()-Meclib.Pinch.time>5e3))return;Meclib.Event.gesture="",Meclib.Pinch.time=0}if(1!==Meclib.zoomScale&&!1===Meclib.Canvas.zoomDragged){if(!$(e.target).hasClass("ev-flip-obj")&&0==$(e.target).parents(".ev-flip-obj").length){if(!Meclib.Mode.txtcopy)return;if(!Meclib.Txtcopy.mode.zoomdrag)return}if($(e.target).hasClass("link-bg")||$(e.target).hasClass("link-icon"))return;if(Meclib.Globals.viewer.get("device")>1)if(2===Meclib.Event.type){if(e.touches&&e.touches.length>1||e.originalEvent.touches&&e.originalEvent.touches.length>1)return}else if(3===Meclib.Event.type&&!1===e.isPrimary)return;var i,t=0;e.touches?(i=e.touches[0].pageX,t=e.touches[0].pageY):e.originalEvent?e.originalEvent.touches?(i=e.originalEvent.touches[0].pageX,t=e.originalEvent.touches[0].pageY):(i=e.originalEvent.pageX,t=e.originalEvent.pageY):(i=e.pageX,t=e.pageY),Meclib.Function.startClick(i,t),Meclib.Canvas.zoomDrag&&($("#page-area").transform("none"),$("#page-area").css({left:parseInt($("#page-area").css("left"))+Meclib.Canvas.zoomMovePos.x-Meclib.Canvas.zoomInitPos.x-Meclib.Canvas.zoomDeltaPos.x+"px",top:parseInt($("#page-area").css("top"))+Meclib.Canvas.zoomMovePos.y-Meclib.Canvas.zoomInitPos.y-Meclib.Canvas.zoomDeltaPos.y+"px"})),Meclib.Canvas.zoomDrag=!0,Meclib.Canvas.zoomDragged=!0,Meclib.Canvas.zoomInitPos=Meclib.Function.point2D(i,t),Meclib.Canvas.zoomMovePos=Meclib.Function.point2D(i,t),Meclib.Canvas.zoomLastPos=Meclib.Function.point2D(i,t),Meclib.Canvas.zoomDragTimer=0,!0===Meclib.Contents.hideDrag&&setTimeout((function(){ViewerApp.mediator.trigger("contents:hideAll")}),10),ViewerApp.mediator.trigger("contents:onZoomDragStart"),Meclib.Canvas.zoomDragged&&1===Meclib.Event.type&&setTimeout((function(){$("#canvas-leftpage,#canvas-rightpage").css({cursor:"move"})}),100)}}},dragCanvasMove:function(e){if(1!==Meclib.zoomScale){if(1===Meclib.Event.type&&e.pointerType){if("mouse"===e.pointerType)return;if(!1===e.isPrimary)return}if(2===Meclib.Event.type){if(e.pointerType){if("touch"===e.pointerType)return;if(!1===e.isPrimary)return}if(e.originalEvent&&"mousemove"===e.type)return}if(3===Meclib.Event.type){if(e.pointerType){if("touch"!==e.pointerType)return;if(!1===e.isPrimary)return void(Meclib.Canvas.zoomDrag=!1)}if(e.originalEvent&&"mousemove"===e.originalEvent.type)return}if(Meclib.Canvas.zoomDragged){var i,t=0;e.touches?(i=e.touches[0].pageX,t=e.touches[0].pageY):e.originalEvent?e.originalEvent.touches?(i=e.originalEvent.touches[0].pageX,t=e.originalEvent.touches[0].pageY):(i=e.originalEvent.pageX,t=e.originalEvent.pageY):(i=e.pageX,t=e.pageY);var o=Math.abs(Math.abs(Meclib.Canvas.zoomInitPos.x)-Math.abs(i)),a=Math.abs(Math.abs(Meclib.Canvas.zoomInitPos.y)-Math.abs(t));if(o<2&&a<2)return;if("pinch"==Meclib.Event.gesture)return Meclib.Canvas.zoomDrag=!1,void(Meclib.Canvas.zoomDragged=!1);var l=(new Date).getTime();if(Meclib.Globals.viewer.get("device")>1){var n=!1;if(2===Meclib.Event.type?(e.touches&&e.touches.length>1||e.originalEvent.touches&&e.originalEvent.touches.length>1)&&(n=!0):3===Meclib.Event.type&&!1===e.isPrimary&&(n=!0),n)return $("#page-area").transform("none"),$("#page-area").css({left:parseInt($("#page-area").css("left"))+Meclib.Canvas.zoomMovePos.x-Meclib.Canvas.zoomInitPos.x+"px",top:parseInt($("#page-area").css("top"))+Meclib.Canvas.zoomMovePos.y-Meclib.Canvas.zoomInitPos.y+"px"}),$("#canvas-leftpage,#canvas-rightpage").css({cursor:"default"}),Meclib.Canvas.zoomDrag=!1,void(Meclib.Canvas.zoomDragged=!1)}Meclib.Canvas.zoomDragTimer+1e3/12050?50:t.x<-50?-50:t.x,t.y=t.y>50?50:t.y<-50?-50:t.y,2<=Math.abs(t.x)?(t.x*=4,t.y*=4):4<=Math.abs(t.x)?(t.x*=6,t.y*=6):8<=Math.abs(t.x)?(t.x*=12,t.y*=12):16<=Math.abs(t.x)?(t.x*=18,t.y*=18):(t.x*=0,t.y*=0);var o=parseInt($("#page-area").css("left"))+Meclib.Canvas.zoomMovePos.x-Meclib.Canvas.zoomInitPos.x,a=parseInt($("#page-area").css("top"))+Meclib.Canvas.zoomMovePos.y-Meclib.Canvas.zoomInitPos.y;if(o-t.x>i.right?t.x=-1*(i.right-o):o-t.xi.bottom?t.y=-1*(i.bottom-a):a-t.y1||Meclib.Mode.crop)){if("OVER"!==Meclib.Canvas.motion&&"BACK"!==Meclib.Canvas.motion&&ViewerApp.mediator.trigger("contents:hideAll"),!0===Meclib.Globals.viewer.get("dragging")&&ViewerApp.mediator.trigger("contents:hideAll"),0==$("#mask-pageflip-"+e.nowPageNo).length){if(isNaN(e.x)||isNaN(e.y))return;(1===Meclib.Globals.viewer.get("device")&&!1===Meclib.MainMenu.overlay?e.y-Meclib.Size.headerHeight:e.y)
    '),g=$('
    '),b=$('
    ');g.append(b),r.append(g);var p=$('
    '),d=$('
    ');p.append(d);var M=$('
    '),m=$('
    '),h=$('
    ');if(r.css({position:"absolute",overflow:"hidden",width:2*Meclib.Globals.bookCanvas.drawWidth-2+"px",height:Meclib.Globals.bookCanvas.drawHeight+Meclib.Globals.bookCanvas.top+2+"px",left:Meclib.Globals.bookCanvas.left+2+"px"}),g.css({position:"absolute",width:Meclib.Function.getHypot(2*Meclib.Globals.bookCanvas.drawWidth,Meclib.Globals.bookCanvas.drawHeight)+"px",height:Meclib.Function.getHypot(2*Meclib.Globals.bookCanvas.drawWidth,Meclib.Globals.bookCanvas.drawHeight)+"px"}),b.css({position:"absolute",outline:"1px solid transparent",border:"1px solid rgb(204, 204, 204)",background:"#fff",width:Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"}).backfaceVisibility("hidden").origin("left bottom"),p.css({position:"absolute",overflow:"hidden",width:Meclib.Function.getHypot(2*Meclib.Globals.bookCanvas.drawWidth,Meclib.Globals.bookCanvas.drawHeight)+"px",height:Meclib.Function.getHypot(2*Meclib.Globals.bookCanvas.drawWidth,Meclib.Globals.bookCanvas.drawHeight)+"px"}),d.css({position:"absolute",outline:"1px solid transparent",background:"#fff",width:Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px",border:"1px solid rgb(204, 204, 204)"}).backfaceVisibility("hidden").origin("left bottom"),M.css({position:"absolute",overflow:"hidden",width:2*Meclib.Globals.bookCanvas.drawWidth+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px",top:Meclib.Globals.bookCanvas.top+"px",left:Meclib.Globals.bookCanvas.left+"px"}),m.css({position:"absolute",overflow:"hidden",width:0,height:Meclib.Function.getHypot(2*Meclib.Globals.bookCanvas.drawWidth,Meclib.Globals.bookCanvas.drawHeight)+"px"}).origin("100% 100%"),h.css({position:"absolute",overflow:"hidden"}),"left"==e.flipH&&"top"==e.flipV?(r.css({top:Meclib.Globals.bookCanvas.top+"px"}),g.css({top:0,left:0}).origin("0% 0%"),p.css({top:Meclib.Globals.bookCanvas.top+"px",left:Meclib.Globals.bookCanvas.left+"px"}).origin("0% 0%"),b.css({left:0,top:0}).origin("0% 0%"),d.css({left:0,top:0}).origin("0% 0%"),m.css({left:0,top:0}).origin("0% 0%"),m.boxShadow("-5px -5px 20px 3px rgba(64,64,64,0.5)"),b.boxShadow("-5px 1px 20px 2px rgba(64, 64, 64, 0.3)")):"left"==e.flipH&&"bottom"==e.flipV?(r.css({top:0}),g.css({bottom:0,left:0}).origin("0% 100%"),p.css({bottom:$("#page-area").height()-Meclib.Globals.bookCanvas.top-Meclib.Globals.bookCanvas.drawHeight-2+"px",left:Meclib.Globals.bookCanvas.left+"px"}).origin("0% 100%"),b.css({left:0,bottom:0}).origin("0% 100%"),d.css({left:0,bottom:0}).origin("0% 100%"),m.css({left:0,bottom:0}).boxShadow("-5px 5px 20px 3px rgba(64,64,64,0.5)").origin("0% 100%"),m.boxShadow("-5px 5px 20px 3px rgba(64,64,64,0.5)"),b.boxShadow("-5px 1px 20px 2px rgba(64, 64, 64, 0.3)")):"right"==e.flipH&&"top"==e.flipV?(r.css({top:Meclib.Globals.bookCanvas.top+"px"}),g.css({top:0,right:0}).origin("100% 0%"),p.css({top:Meclib.Globals.bookCanvas.top+"px",right:$("#page-area").width()-Meclib.Globals.bookCanvas.left-2*Meclib.Globals.bookCanvas.drawWidth-1+"px"}).origin("100% 0%"),b.css({right:0,top:0}).origin("100% 0%"),d.css({right:0,top:0}).origin("100% 0%"),m.css({right:0,top:0}).origin("100% 0%"),b.boxShadow("-5px 1px 20px 2px rgba(64, 64, 64, 0.3)"),m.boxShadow("5px -5px 20px 3px rgba(64,64,64,0.5)")):"right"==e.flipH&&"bottom"==e.flipV&&(r.css({top:0}),g.css({bottom:0,right:0}).origin("100% 100%"),p.css({bottom:$("#page-area").height()-Meclib.Globals.bookCanvas.top-Meclib.Globals.bookCanvas.drawHeight-2+"px",right:$("#page-area").width()-Meclib.Globals.bookCanvas.left-2*Meclib.Globals.bookCanvas.drawWidth-1+"px"}).origin("100% 100%"),b.css({right:0,bottom:0}).origin("100% 100%"),d.css({right:0,bottom:0}).origin("100% 100%"),m.css({right:0,bottom:0}).origin("100% 100%"),b.boxShadow("-5px 1px 20px 2px rgba(64, 64, 64, 0.3)"),m.boxShadow("5px 5px 20px 3px rgba(64,64,64,0.5)")),M.append(m),M.append(h),r.zindex(100+Meclib.Globals.flip_index),p.zindex(100+Meclib.Globals.flip_index),M.zindex(100+Meclib.Globals.flip_index),$("#shadow-center").after(M).after(p).after(r),ViewerApp.mediator.trigger("canvas:loadPage",b.attr("id"),a,i),ViewerApp.mediator.trigger("canvas:loadPage",d.attr("id"),l,t),"FLIP2END"!==Meclib.Globals.viewer.get("moveMotion")&&"FLIP2END_AUTO"!==Meclib.Globals.viewer.get("moveMotion")||""!==Meclib.Globals.viewer.get("flipLoop")||(0===Meclib.Canvas.flipDir?Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")):Meclib.Globals.book.moveRight(Meclib.Globals.viewer.get("movePageNum"))),ViewerApp.mediator.trigger("canvas:hideMovedSideBar"),Meclib.Globals.animation_page.push(o),Meclib.Globals.animation_page.length>3){var u=Meclib.Globals.animation_page[1];Meclib.Globals.animation_page.splice(1,1),$("#mask-pageflip-"+u).hide(),$("#mask_underpage-"+u).hide(),$("#canvas-reversepage-"+u).hide(),$("#mask-shadow-area-"+u).hide(),Meclib.Globals.flip_page--}$("#mask-pageflip-"+e.nowPageNo).attr("data-flipV",Meclib.Canvas.flipCorner),$("#mask-pageflip-"+e.nowPageNo).attr("data-flipH",e.flipH)}else e.flipV=$("#mask-pageflip-"+e.nowPageNo).attr("data-flipV"),e.flipH=$("#mask-pageflip-"+e.nowPageNo).attr("data-flipH");Meclib.Globals.viewer.set({moving:!0,flipCurled:!0});var A=Meclib.Function.dispose(0,0,0,0,0),v=Meclib.Function.dispose(0,0,0,0,0),f=Meclib.Function.point2D(0,0),C=0,w={x:0,y:0},I=0;"left"==e.flipH&&"top"==e.flipV?(f=Meclib.Function.point2D(e.x-Meclib.Globals.bookCanvas.left,e.y-Meclib.Globals.bookCanvas.top),Meclib.Function.getHypot(Meclib.Globals.bookCanvas.drawWidth-f.x,f.y)>Meclib.Globals.bookCanvas.drawWidth&&(C=Meclib.Function.deg2rad(Meclib.Function.pt2deg(Meclib.Function.point2D(f.x-Meclib.Globals.bookCanvas.drawWidth,f.y))),f=Meclib.Function.point2D(Meclib.Globals.bookCanvas.drawWidth*Math.cos(C)+Meclib.Globals.bookCanvas.drawWidth,Meclib.Globals.bookCanvas.drawWidth*Math.sin(C))),f.y<0&&(f.y=0),f.rotate=Meclib.Function.pt2deg(f),f.rotate<0&&(f.rotate=0),f.rotate>90&&(f.rotate=90),Meclib.Function.point2D(f.x/2,f.y/2),I=Math.tan(Meclib.Function.deg2rad(f.rotate)+Meclib.Function.deg2rad(90)),w=Meclib.Function.point2D(f.x/2-f.y/2/I,f.y/2-I*f.x/2),v.rotate=90,A.rotate=f.rotate+90,w.x=Meclib.Globals.bookCanvas.drawWidthMeclib.Globals.bookCanvas.drawWidth&&(C=Meclib.Function.deg2rad(Meclib.Function.pt2deg(Meclib.Function.point2D(f.x-Meclib.Globals.bookCanvas.drawWidth,f.y))),f=Meclib.Function.point2D(Meclib.Globals.bookCanvas.drawWidth*Math.cos(C)+Meclib.Globals.bookCanvas.drawWidth,Meclib.Globals.bookCanvas.drawWidth*Math.sin(C))),f.y<0&&(f.y=0),f.rotate=Meclib.Function.pt2deg(f),f.rotate<0&&(f.rotate=0),f.rotate>90&&(f.rotate=90),Meclib.Function.point2D(f.x/2,f.y/2),I=Math.tan(Meclib.Function.deg2rad(f.rotate)+Meclib.Function.deg2rad(90)),w=Meclib.Function.point2D(f.x/2-f.y/2/I,f.y/2-I*f.x/2),v.rotate=-90,A.rotate=-f.rotate-90,w.x=Meclib.Globals.bookCanvas.drawWidthMeclib.Globals.bookCanvas.drawWidth&&(C=Meclib.Function.deg2rad(Meclib.Function.pt2deg(Meclib.Function.point2D(Meclib.Globals.bookCanvas.drawWidth-f.x,f.y))),f=Meclib.Function.point2D(2*Meclib.Globals.bookCanvas.drawWidth-(Meclib.Globals.bookCanvas.drawWidth*Math.cos(C)+Meclib.Globals.bookCanvas.drawWidth),Meclib.Globals.bookCanvas.drawWidth*Math.sin(C))),f.y<0&&(f.y=0),f.rotate=Meclib.Function.pt2deg(f),f.rotate<0&&(f.rotate=0),f.rotate>90&&(f.rotate=90),Meclib.Function.point2D(-1*f.x/2,f.y/2),I=Math.tan(Meclib.Function.deg2rad(f.rotate)+Meclib.Function.deg2rad(90)),w=Meclib.Function.point2D(f.x/2-f.y/2/I,f.y/2-I*f.x/2),v.rotate=90,A.rotate=-f.rotate-90,w.x=Meclib.Globals.bookCanvas.drawWidthMeclib.Globals.bookCanvas.drawWidth&&(C=Meclib.Function.deg2rad(Meclib.Function.pt2deg(Meclib.Function.point2D(Meclib.Globals.bookCanvas.drawWidth-f.x,f.y))),f=Meclib.Function.point2D(2*Meclib.Globals.bookCanvas.drawWidth-(Meclib.Globals.bookCanvas.drawWidth*Math.cos(C)+Meclib.Globals.bookCanvas.drawWidth),Meclib.Globals.bookCanvas.drawWidth*Math.sin(C))),f.y<0&&(f.y=0),f.rotate=Meclib.Function.pt2deg(f),f.rotate<0&&(f.rotate=0),f.rotate>90&&(f.rotate=90),Meclib.Function.point2D(-1*f.x/2,f.y/2),I=Math.tan(Meclib.Function.deg2rad(f.rotate)+Meclib.Function.deg2rad(90)),(w=Meclib.Function.point2D(f.x/2-f.y/2/I,f.y/2-I*f.x/2)).x=Meclib.Globals.bookCanvas.drawWidthMeclib.Globals.bookCanvas.getCenterPos()&&(l.x=Meclib.Globals.bookCanvas.getCenterPos())),"FLIP2END"===Meclib.Globals.viewer.get("moveMotion")||"FLIP2END_AUTO"===Meclib.Globals.viewer.get("moveMotion")||""!==Meclib.Globals.viewer.get("flipLoop")){var s=Meclib.Function.point2D(0,0),r=Meclib.Function.point2D(0,0);switch(Meclib.Globals.viewer.get("flipLoop")){case"OVER":if(Meclib.Canvas.motion="OVER",a.x=e.x-n,a.y=e.y-n,"left"==e.flipH&&"top"==e.flipV?(a.x=e.x+n,a.y=e.y+n,a.x==Meclib.Globals.bookCanvas.left+c&&(o=!0)):"left"==e.flipH&&"bottom"==e.flipV?(a.x=e.x+n,a.y=e.y-n,a.x==Meclib.Globals.bookCanvas.left+c&&(o=!0)):"right"==e.flipH&&"top"==e.flipV?(a.x=e.x-n,a.y=e.y+n,a.x==Meclib.Globals.bookCanvas.canvasWidth-Meclib.Globals.bookCanvas.left-c&&(o=!0)):"right"==e.flipH&&"bottom"==e.flipV&&(a.x=e.x-n,a.y=e.y-n,a.x==Meclib.Globals.bookCanvas.canvasWidth-Meclib.Globals.bookCanvas.left-c&&(o=!0)),o)return void Meclib.Globals.viewer.set({moving:!1});i=a.x,t=a.y;break;case"BACK":if(Meclib.Canvas.motion="BACK",e.flipH=$("#mask-pageflip-"+e.nowPageNo).attr("data-flipH"),e.flipV=$("#mask-pageflip-"+e.nowPageNo).attr("data-flipV"),e.x=Meclib.Globals.viewer.get("flipX"),e.y=Meclib.Globals.viewer.get("flipY"),!e.besier&&Meclib.Globals.viewer.get("dragging")&&(s=Meclib.Function.point2D(0,0),r=Meclib.Function.point2D(0,0),"left"==e.flipH&&(s.x=Meclib.Globals.bookCanvas.left),"right"==e.flipH&&(s.x=Meclib.Globals.bookCanvas.left+2*Meclib.Globals.bookCanvas.drawWidth),"top"==e.flipV&&(s.y=Meclib.Globals.bookCanvas.top),"bottom"==e.flipV&&(s.y=Meclib.Globals.bookCanvas.top+Meclib.Globals.bookCanvas.drawHeight),"left"==e.flipH&&(r.x=Meclib.Globals.bookCanvas.left),"right"==e.flipH&&(r.x=Meclib.Globals.bookCanvas.left+2*Meclib.Globals.bookCanvas.drawWidth),"top"==e.flipV&&(r.y=e.y),"bottom"==e.flipV&&(r.y=e.y),e.besier={pt1:Meclib.Function.point2D(e.x,e.y),pt2:r,pt3:s,t:0,max:Math.round(20*Meclib.Function.getHypot(e.x-s.x,e.y-s.y)/Meclib.Function.getHypot(Meclib.Globals.bookCanvas.drawWidth,Meclib.Globals.bookCanvas.drawHeight))}),e.besier?(a=Meclib.Function.getBesier(e.besier),e.besier.t>e.besier.max&&(o=!0),e.besier.t+=1):"left"==e.flipH&&"top"==e.flipV?(a.x=e.x-n,a.y=e.y-n,a.x==Meclib.Globals.bookCanvas.left-n&&a.y==Meclib.Globals.bookCanvas.top-n&&(o=!0),a.xMeclib.Globals.bookCanvas.top+Meclib.Globals.bookCanvas.drawHeight&&(a.y=Meclib.Globals.bookCanvas.top+Meclib.Globals.bookCanvas.drawHeight)):"right"==e.flipH&&"top"==e.flipV?(a.x=e.x+n,a.y=e.y-n,a.x==Meclib.Globals.bookCanvas.canvasWidth-Meclib.Globals.bookCanvas.left+n&&a.y==Meclib.Globals.bookCanvas.top-n&&(o=!0),a.x>Meclib.Globals.bookCanvas.canvasWidth-Meclib.Globals.bookCanvas.left&&(a.x=Meclib.Globals.bookCanvas.canvasWidth-Meclib.Globals.bookCanvas.left),a.yMeclib.Globals.bookCanvas.canvasWidth-Meclib.Globals.bookCanvas.left&&(a.x=Meclib.Globals.bookCanvas.canvasWidth-Meclib.Globals.bookCanvas.left),a.y>Meclib.Globals.bookCanvas.top+Meclib.Globals.bookCanvas.drawHeight&&(a.y=Meclib.Globals.bookCanvas.top+Meclib.Globals.bookCanvas.drawHeight)),o)return $("#mask-pageflip-"+e.nowPageNo).remove(),$("#mask-underpage-"+e.nowPageNo).remove(),$("#canvas-reversepage-"+e.nowPageNo).remove(),$("#mask-shadow-area-"+e.nowPageNo).remove(),Meclib.Globals.flip_page--,Meclib.Globals.animation_page.splice(0,1),Meclib.Globals.viewer.set({flipLoop:"",flipCurled:!1,moving:!1}),Meclib.Canvas.motion="",void ViewerApp.mediator.trigger("contents:showAll");break;default:Meclib.Canvas.motion="FLIP",Meclib.Globals.viewer.set({flipping:!0}),s=Meclib.Function.point2D(0,0),r=Meclib.Function.point2D(0,0),"left"==e.flipH&&(s.x=Meclib.Globals.bookCanvas.left+2*Meclib.Globals.bookCanvas.drawWidth),"right"==e.flipH&&(s.x=Meclib.Globals.bookCanvas.left),"top"==e.flipV&&(s.y=Meclib.Globals.bookCanvas.top),"bottom"==e.flipV&&(s.y=Meclib.Globals.bookCanvas.top+Meclib.Globals.bookCanvas.drawHeight),"left"==e.flipH&&(r.x=Meclib.Globals.bookCanvas.left+2*Meclib.Globals.bookCanvas.drawWidth),"right"==e.flipH&&(r.x=Meclib.Globals.bookCanvas.left),"top"==e.flipV&&(r.y=t),"bottom"==e.flipV&&(r.y=t),e.besier?e.besier.t+=1:e.besier={pt1:Meclib.Function.point2D(i,t),pt2:r,pt3:s,t:0,max:Math.round(20*Meclib.Function.getHypot(i-s.x,t-s.y)/Meclib.Function.getHypot(2*Meclib.Globals.bookCanvas.drawWidth,Meclib.Globals.bookCanvas.drawHeight))},a=Meclib.Function.getBesier(e.besier),e.besier.t>e.besier.max&&(o=!0),i=a.x,t=a.y}if(Meclib.Globals.viewer.set({flipX:a.x,flipY:a.y}),!0===o){Meclib.Canvas.motion="";for(var g=e.reversePageNo.toString(10);g.length<4;)g="0"+g;if("left"==e.flipH?ViewerApp.mediator.trigger("canvas:loadPage","canvas-rightpage",e.reversePageNo,1):"right"==e.flipH&&ViewerApp.mediator.trigger("canvas:loadPage","canvas-leftpage",e.reversePageNo,1),Meclib.Globals.animation_page.splice(0,1),Meclib.Globals.flip_page--,0==Meclib.Globals.flip_page)if(Meclib.Globals.flip_index=0,Meclib.Globals.viewer.set({moving:!1,moveMotion:""}),1===Meclib.Globals.viewer.get("device")){ViewerApp.mediator.trigger("updatePage",1),ViewerApp.mediator.trigger("main:onMovedPage");var b=0;-1!=Meclib.Globals.ua.indexOf("Firefox")&&(b=100),setTimeout((function(){$("#mask-pageflip-"+e.nowPageNo).remove(),$("#mask-underpage-"+e.nowPageNo).remove(),$("#canvas-reversepage-"+e.nowPageNo).remove(),$("#mask-shadow-area-"+e.nowPageNo).remove()}),b)}else setTimeout((function(){ViewerApp.mediator.trigger("updatePage",1),ViewerApp.mediator.trigger("main:onMovedPage"),$("#mask-pageflip-"+e.nowPageNo).remove(),$("#mask-underpage-"+e.nowPageNo).remove(),$("#canvas-reversepage-"+e.nowPageNo).remove(),$("#mask-shadow-area-"+e.nowPageNo).remove()}),0);else ViewerApp.mediator.trigger("canvas:loadX1Image"),$("#mask-pageflip-"+e.nowPageNo).remove(),$("#mask-underpage-"+e.nowPageNo).remove(),$("#canvas-reversepage-"+e.nowPageNo).remove(),$("#mask-shadow-area-"+e.nowPageNo).remove()}else window.requestAnimationFrame((function(){!function(e,i,t,o,a,l,n,c,s){var r={x:i,y:t};r.nowPageNo=o,r.reversePageNo=a,r.underPageNo=l,r.flipH=n,r.flipV=c,r.besier=s,ViewerApp.mediator.trigger("canvas:flip",r)}(0,a.x,a.y,e.nowPageNo,e.reversePageNo,e.underPageNo,e.flipH,e.flipV,e.besier)}),.5)}},loadPage:function(e,i,t){for(var o=i.toString(10);o.length<4;)o="0"+o;var a=1;window.devicePixelRatio&&1==Meclib.Globals.book.jpg_files.x6&&(a=window.devicePixelRatio),0!==e.indexOf("canvas-reversepage")&&0!==e.indexOf("canvas-underpage")||(a=1);var l=$("#canvas-leftpage").width(),n=$("#canvas-leftpage").height();0===e.indexOf("print-")&&(l=$("#print-leftpage").width(),n=$("#print-leftpage").height());var c="";c+='
    ',c+='
    ',c+="
    ",$("#"+e).html(c),1===Meclib.Globals.loaded_image.x1[i]?ViewerApp.mediator.trigger("canvas:disposeImage",e,i,1):ViewerApp.mediator.trigger("canvas:loadImage",e,i,1),(t>1||Meclib.zoomScale>1)&&((l*a>4*Meclib.Globals.book.thumbWidth||n*a>4*Meclib.Globals.book.thumbHeight)&&1==Meclib.Globals.book.jpg_files.x6?Meclib.Globals.loaded_image.x6[i]==Meclib.Globals.book.slice6PortNum*Meclib.Globals.book.slice6LandNum?ViewerApp.mediator.trigger("canvas:disposeImage",e,i,6):Meclib.Globals.loaded_image.x4[i]==Meclib.Globals.book.slice4PortNum*Meclib.Globals.book.slice4LandNum?(ViewerApp.mediator.trigger("canvas:disposeImage",e,i,4),ViewerApp.mediator.trigger("canvas:loadImage",e,i,6)):Meclib.Globals.loaded_image.x2[i]==Meclib.Globals.book.slice2PortNum*Meclib.Globals.book.slice2LandNum?(ViewerApp.mediator.trigger("canvas:disposeImage",e,i,2),ViewerApp.mediator.trigger("canvas:loadImage",e,i,6)):(Meclib.Globals.loaded_image.x1[i],ViewerApp.mediator.trigger("canvas:loadImage",e,i,6)):l*a>2*Meclib.Globals.book.thumbWidth||n*a>2*Meclib.Globals.book.thumbHeight?Meclib.Globals.loaded_image.x4[i]==Meclib.Globals.book.slice4PortNum*Meclib.Globals.book.slice4LandNum?ViewerApp.mediator.trigger("canvas:disposeImage",e,i,4):Meclib.Globals.loaded_image.x2[i]==Meclib.Globals.book.slice2PortNum*Meclib.Globals.book.slice2LandNum?(ViewerApp.mediator.trigger("canvas:disposeImage",e,i,2),ViewerApp.mediator.trigger("canvas:loadImage",e,i,4)):(Meclib.Globals.loaded_image.x1[i],ViewerApp.mediator.trigger("canvas:loadImage",e,i,4)):(l*a>1*Meclib.Globals.book.thumbWidth||n*a>1*Meclib.Globals.book.thumbHeight)&&(Meclib.Globals.loaded_image.x2[i]==Meclib.Globals.book.slice2PortNum*Meclib.Globals.book.slice2LandNum?ViewerApp.mediator.trigger("canvas:disposeImage",e,i,2):(Meclib.Globals.loaded_image.x1[i],ViewerApp.mediator.trigger("canvas:loadImage",e,i,2))))},loadImage:function(e,i,t){var o=$("#canvas-leftpage").width(),a=$("#canvas-leftpage").height();0===e.indexOf("print-")&&(o=$("#print-leftpage").width(),a=$("#print-leftpage").height());for(var l=i.toString(10);l.length<4;)l="0"+l;if(Meclib.Globals.loaded_image["x"+t][i]!==Meclib.Globals.book["slice"+t+"PortNum"]*Meclib.Globals.book["slice"+t+"LandNum"]&&(Meclib.Globals.loaded_image["x"+t][i]=0),0!=i)if(1==t)ViewerApp.mediator.trigger("canvas:loadImageWait",e,i,0,t,"jpg/"+l+".jpg",(function(e,i,t,o){Meclib.Globals.loaded_image.x1[i]=1,ViewerApp.mediator.trigger("canvas:disposeImage",e,i,o)}));else{var n=Meclib.Globals.book["slice"+t+"PortNum"],c=Meclib.Globals.book["slice"+t+"LandNum"],s=Meclib.Globals.book.thumbWidth*t,r=Meclib.Globals.book.thumbHeight*t,g="jpg_"+t,b=[];if(Meclib.ZoomPos&&(0!=Meclib.ZoomPos.x||0!=Meclib.ZoomPos.y))for(var p="canvas-rightpage"==e?$("#canvas-leftpage").width():0,d=0;d
    '):$("#"+e+" .page-"+n+" .page-content").append('
    '),Meclib.Globals.loaded_image["x"+o][i]==Meclib.Globals.book["slice"+o+"PortNum"]*Meclib.Globals.book["slice"+o+"LandNum"]&&ViewerApp.mediator.trigger("canvas:removeLowImage",e,i,o)})))}for(d=0;d
    '):$("#"+e+" .page-"+n+" .page-content").append('
    '),Meclib.Globals.loaded_image["x"+o][i]==Meclib.Globals.book["slice"+o+"PortNum"]*Meclib.Globals.book["slice"+o+"LandNum"]&&ViewerApp.mediator.trigger("canvas:removeLowImage",e,i,o)}))}}else 0===e.indexOf("print-")?$("#"+e+" .page-"+l+" .page-content").append('
    '):($("#"+e+" .page-"+l+" .page-content").append('
    '),1===Meclib.zoomScale&&1===Meclib.Globals.viewer.get("scale")&&$("#"+e).css("border-color",$("#canvas-area").css("background-color")))},loadImageWait:function(e,i,t,o,a,l){1==o?(Meclib.Globals.load_waiting_x1.push({id:e,page:i,part:t,scale:o,path:a,func:l}),ViewerApp.mediator.trigger("canvas:loadImageProccessX1")):(Meclib.Globals.load_waiting.push({id:e,page:i,part:t,scale:o,path:a,func:l}),ViewerApp.mediator.trigger("canvas:loadImageProccess"))},loadImageProccess:function(){if(!(Meclib.Globals.load_connection>3)){Meclib.Globals.load_connection++;var e=Meclib.Globals.load_waiting.shift();e?(Meclib.Globals.loaded_image["x"+e.scale][e.page]++,$("").bind("load",(function(){Meclib.Globals.load_connection--,e.func(e.id,e.page,e.part,e.scale),Meclib.Globals.load_waiting.length>0&&setTimeout((function(){ViewerApp.mediator.trigger("canvas:loadImageProccess")}),10)})).attr("src",e.path+Meclib.Cache.fileCache)):Meclib.Globals.load_connection--}},loadImageProccessX1:function(){if(!(Meclib.Globals.load_connection_x1>2)){Meclib.Globals.load_connection_x1++;var e=Meclib.Globals.load_waiting_x1.shift();e?(Meclib.Globals.loaded_image["x"+e.scale][e.page]++,$("").bind("load",(function(){Meclib.Globals.load_connection_x1--,e.func(e.id,e.page,e.part,e.scale),Meclib.Globals.load_waiting_x1.length>0&&setTimeout((function(){ViewerApp.mediator.trigger("canvas:loadImageProccessX1")}),10)})).attr("src",e.path+Meclib.Cache.fileCache)):Meclib.Globals.load_connection_x1--}},disposeImage:function(e,i,t){if("preload"!=e){var o=$("#canvas-leftpage").width(),a=$("#canvas-leftpage").height();0===e.indexOf("print-")&&(o=$("#print-leftpage").width(),a=$("#print-leftpage").height());for(var l=i.toString(10);l.length<4;)l="0"+l;if(1==t)$("#"+e+" .page-"+l+" .page-content").append('
    ');else for(var n=Meclib.Globals.book["slice"+t+"PortNum"],c=Meclib.Globals.book["slice"+t+"LandNum"],s=Meclib.Globals.book.thumbWidth*t,r=Meclib.Globals.book.thumbHeight*t,g="jpg_"+t,b=0;b
    '):$("#"+e+" .page-"+l+" .page-content").append('
    ')}ViewerApp.mediator.trigger("canvas:removeLowImage",e,i,t)}},removeLowImage:function(e,i,t){for(var o=i.toString(10);o.length<4;)o="0"+o;switch(t){case 6:$("#"+e+" .page-"+o+" div[data-scale='4']").remove();break;case 4:$("#"+e+" .page-"+o+" div[data-scale='2']").remove()}},loadX1Image:function(){var e=1,i=Meclib.Globals.book.totalPage;Meclib.Globals.book.currentPage-10>1&&(e=Meclib.Globals.book.currentPage-10),Meclib.Globals.book.currentPage+10').wrap('
    '),$("#slide-mask-outer").css({position:"absolute",left:Meclib.Globals.bookCanvas.left-Meclib.Size.thickness.width-5-2+"px",top:Meclib.Globals.bookCanvas.top-2+"px",width:Meclib.Globals.bookCanvas.drawWidth*Meclib.Globals.bookCanvas.canvasNum+2*Meclib.Size.thickness.width+10+4+"px",height:Meclib.Globals.bookCanvas.drawHeight+4+"px"}),$("#slide-mask").css({position:"absolute",left:-Meclib.Globals.bookCanvas.left+Meclib.Size.thickness.width+5+2+"px",top:2-Meclib.Globals.bookCanvas.top+"px"}),$("#slide-mask-outer").css("overflow","hidden")},slideMaskRemove:function(){0==$("#slide-mask-outer").length&&$("#page-area").wrap('
    ').wrap('
    '),$("#slide-mask-outer").css("overflow","visible")},contentsMaskAdd:function(){0==$("#contents-mask-outer").length&&$("#page-area").prepend('
    '),2===Meclib.Globals.bookCanvas.canvasNum?($("#contents-mask-outer").css({position:"absolute",left:Meclib.Globals.bookCanvas.left+1+"px",top:Meclib.Globals.bookCanvas.top+1+"px",width:Meclib.Globals.bookCanvas.drawWidth*Meclib.Globals.bookCanvas.canvasNum-1+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"}),$("#contents-mask").css({position:"absolute",left:-Meclib.Globals.bookCanvas.left-1+"px",top:-Meclib.Globals.bookCanvas.top-1+"px"})):($("#contents-mask-outer").css({position:"absolute",left:Meclib.Globals.bookCanvas.left+1+"px",top:Meclib.Globals.bookCanvas.top+1+"px",width:Meclib.Globals.bookCanvas.drawWidth*Meclib.Globals.bookCanvas.canvasNum+"px",height:Meclib.Globals.bookCanvas.drawHeight+"px"}),$("#contents-mask").css({position:"absolute",left:-Meclib.Globals.bookCanvas.left-1+"px",top:-Meclib.Globals.bookCanvas.top-1+"px"})),$("#contents-mask-outer").css("overflow","hidden")},contentsMaskRemove:function(){0==$("#contents-mask-outer").length&&$("#page-area").prepend('
    '),$("#contents-mask-outer").css("overflow","visible")},hideMovedSideBar:function(){0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage?(0!==Meclib.Globals.book.pageOpenDir||1!==Meclib.Globals.book.getOpenPageNo(0)&&1!==Meclib.Globals.book.getOpenPageNo(1)||($("#leftbar").hide(),ViewerApp.mediator.trigger("canvas:hideTickness",0)),0!==Meclib.Globals.book.pageOpenDir||Meclib.Globals.book.getOpenPageNo(0)!==Meclib.Globals.book.totalPage&&Meclib.Globals.book.getOpenPageNo(1)!==Meclib.Globals.book.totalPage||($("#rightbar").hide(),ViewerApp.mediator.trigger("canvas:hideTickness",1)),1!==Meclib.Globals.book.pageOpenDir||1!==Meclib.Globals.book.getOpenPageNo(0)&&1!==Meclib.Globals.book.getOpenPageNo(1)||($("#rightbar").hide(),ViewerApp.mediator.trigger("canvas:hideTickness",1)),1!==Meclib.Globals.book.pageOpenDir||Meclib.Globals.book.getOpenPageNo(0)!==Meclib.Globals.book.totalPage&&Meclib.Globals.book.getOpenPageNo(1)!==Meclib.Globals.book.totalPage||($("#leftbar").hide(),ViewerApp.mediator.trigger("canvas:hideTickness",0))):(0===Meclib.Globals.book.pageOpenDir&&1===Meclib.Globals.book.currentPage&&($("#leftbar").hide(),ViewerApp.mediator.trigger("canvas:hideTickness",0)),0===Meclib.Globals.book.pageOpenDir&&Meclib.Globals.book.currentPage===Meclib.Globals.book.totalPage&&($("#rightbar").hide(),ViewerApp.mediator.trigger("canvas:hideTickness",1)),1===Meclib.Globals.book.pageOpenDir&&1===Meclib.Globals.book.currentPage&&($("#rightbar").hide(),ViewerApp.mediator.trigger("canvas:hideTickness",1)),1===Meclib.Globals.book.pageOpenDir&&Meclib.Globals.book.currentPage===Meclib.Globals.book.totalPage&&($("#leftbar").hide(),ViewerApp.mediator.trigger("canvas:hideTickness",0)))}}),ViewerApp.Views.CenvasMouseEvevtView=Backbone.View.extend({el:$("#canvas-area"),initialize:function(e){_.bindAll(this,"onMouseMove","onMouseUp"),ViewerApp.mediator.on("canvas:onMouseOut",this.onMouseOut),ViewerApp.mediator.on("canvas:onMouseMove",this.onMouseMove),ViewerApp.mediator.on("canvas:onSwipeleft",this.onSwipeleft),ViewerApp.mediator.on("canvas:onSwiperight",this.onSwiperight),ViewerApp.mediator.on("canvas:callSingleClick",this.callSingleClick),!0===Meclib.Function.getDeviceEventLists().mouse&&($(".sidebar").on({mouseover:function(){$(this).css("opacity",.7),$("#page-area").css("cursor","pointer")},mouseout:function(){$(this).css("opacity",""),$("#page-area").css("cursor","")}}),$("#canvas-area").hammer().on("swipeleft",(function(e){ViewerApp.mediator.trigger("canvas:onSwipeleft",e)})).on("swiperight",(function(e){ViewerApp.mediator.trigger("canvas:onSwiperight",e)}))),!0===Meclib.Function.getDeviceEventLists().mouse&&Meclib.ClickManager.add("#body","#page-area,#slide-mask",(function(e,i){var t=$(i.target).attr("id");return"page-area"!==t&&"slide-mask"!==t||!0===Meclib.Mode.fusen||!0===Meclib.Function.isSideMenuOpened()||!0===Meclib.Function.isOptionMenuOpened()||!0===Meclib.Fusen.selected||!0===Meclib.PageSlider.selected||ViewerApp.mediator.trigger("menu:toggleMenu"),!1}),!1)},events:function(){var e={};return 1===Meclib.Globals.viewer.get("device")?!0===Meclib.Function.getDeviceEventLists().mouse&&(e={mousedown:"onMouseDown",mouseup:"onMouseUp",mousemove:"onMouseMove",mouseleave:"onMouseOut",click:"singleClick",dblclick:"doubleClick"}):!0===Meclib.Function.getDeviceEventLists().mouse&&!1===Meclib.Function.getDeviceEventLists().pointer&&(e={mousedown:"onMouseDown",mouseup:"onMouseUp",mousemove:"onMouseMove",mouseleave:"onMouseOut",click:"singleClick",dblclick:"doubleClick"}),e},singleClick:function(e){},callSingleClick:function(e){if("page-area"!==e.target.offsetParent.id&&"canvas-leftpage"!==e.target.offsetParent.id&&"canvas-rightpage"!==e.target.offsetParent.id&&"txtcopy-layer"!==e.target.offsetParent.id)return!1;if(1===Meclib.Globals.viewer.get("device")){if(!0===Meclib.Mode.crop)return!1;if(!0===Meclib.Mode.commentSelect)return!1;if("MAINTE"===Meclib.Setting.type&&0===Meclib.Setting.configType)return;if(2===Meclib.Click.zoomClickNum)return!1;var i={left:$("#canvas-leftpage").offset().left,top:$("#canvas-leftpage").offset().top,right:$("#canvas-leftpage").offset().left+$("#canvas-leftpage").width()*Meclib.Globals.bookCanvas.canvasNum,bottom:$("#canvas-leftpage").offset().top+$("#canvas-leftpage").height()};e.pageX.between(i.left,i.right)&&e.pageY.between(i.top,i.bottom)&&(ViewerApp.mediator.trigger("canvas:cancelOverAnimation"),ViewerApp.mediator.trigger("canvas:scaleCanvas",Meclib.Function.point2D(e.pageX,e.pageY)))}},doubleClick:function(e){if(!0===Meclib.Mode.crop)return!1;if(!0===Meclib.Mode.commentSelect)return!1;if(1===Meclib.Click.zoomClickNum)return!1;var i={left:$("#canvas-leftpage").offset().left,top:$("#canvas-leftpage").offset().top,right:$("#canvas-leftpage").offset().left+$("#canvas-leftpage").width()*Meclib.Globals.bookCanvas.canvasNum,bottom:$("#canvas-leftpage").offset().top+$("#canvas-leftpage").height()};e.pageX.between(i.left,i.right)&&e.pageY.between(i.top,i.bottom)&&(ViewerApp.mediator.trigger("canvas:cancelOverAnimation"),ViewerApp.mediator.trigger("canvas:scaleCanvas",Meclib.Function.point2D(e.pageX,e.pageY)))},onMouseOut:function(e){if(!0!==Meclib.Fusen.selected&&!0!==Meclib.Mode.fusen&&!0!==Meclib.Mode.crop&&!0!==Meclib.Mode.pdf&&!0!==Meclib.Mode.print&&!0!==Meclib.Mode.products&&!0!==Meclib.Mode.autoflipping&&!0!==Meclib.Mode.commentSelect&&!0!==Meclib.BookInfo.display&&"BACK"!==Meclib.Globals.viewer.get("flipLoop")&&"BACK"!==Meclib.Canvas.motion&&!0!==Meclib.PageSlider.selected&&1===Meclib.Event.type&&!(!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select||!0===Meclib.Mode.memo&&!0===Meclib.Memo.mode.select||!0!==Meclib.Canvas.selected||(Meclib.Canvas.selected=!1,1!==Meclib.Globals.viewer.get("scale")||0!==Meclib.Globals.viewer.get("viewMode")||"flip"!==Meclib.Globals.viewer.get("moveType")))){var i=Meclib.Function.point2D(0,0),t=Meclib.Function.point2D(0,0);t.x=e.pageX,t.y=e.pageY-Meclib.Size.headerHeight+Meclib.Globals.bookCanvas.top,t.nowPageNo=Meclib.Globals.book.getFlipStartPage(Meclib.Canvas.flipDir),t.reversePageNo=Meclib.Globals.book.getFlipReversePage(Meclib.Canvas.flipDir),t.underPageNo=Meclib.Globals.book.getFlipUnderPage(Meclib.Canvas.flipDir),t.flipH=0==Meclib.Canvas.flipDir?"left":"right",t.flipV=Meclib.Canvas.flipCorner,0===Meclib.Canvas.flipDir?(i.x=Meclib.Globals.bookCanvas.left+Meclib.Globals.bookCanvas.drawWidth/2,e.pageX>i.x?(Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")),Meclib.Globals.viewer.set({moveMotion:"FLIP2END"}),Meclib.Canvas.motion="FLIP"):!1!==Meclib.Globals.viewer.get("flipCurled")&&(Meclib.Globals.viewer.set({flipLoop:"BACK"}),Meclib.Canvas.motion="BACK")):(i.x=Meclib.Globals.bookCanvas.canvasWidth-(Meclib.Globals.bookCanvas.left+Meclib.Globals.bookCanvas.drawWidth/2),e.pageX1||"slide"!==Meclib.Globals.viewer.get("moveType")&&"FLIP"!==Meclib.Canvas.motion&&"SLIDE"!==Meclib.Canvas.motion&&!0!==Meclib.Function.isSideMenuOpened()&&!0!==Meclib.Function.isOptionMenuOpened()&&($(e.target).hasClass("ev-flip-obj")||0!=$(e.target).parents(".ev-flip-obj").length)&&(e.pageXMeclib.Globals.bookCanvas.canvasWidth-Meclib.Globals.bookCanvas.left||!0!==Meclib.Globals.viewer.get("flipping")&&0!==Meclib.Globals.bookCanvas.getSelectPage(e.pageX)&&($("#canvas-area").css("left").replace("px","")>0||Meclib.Globals.viewer.get("scale")>1||Meclib.Canvas.selected||!0!==Meclib.PageSlider.selected&&(Meclib.Canvas.selected=!0,Meclib.Globals.viewer.set({flipTime:1e3,selected:!0,moveMotion:"",flipLoop:""}),"flip"===Meclib.Globals.viewer.get("moveType")?!0===Meclib.Globals.bookCanvas.isFlippabled(e.pageX,e.pageY)?(Meclib.Globals.bookCanvas.setFlipDir(e.pageX),Meclib.Canvas.enabled=!0):!1!==Meclib.Globals.viewer.get("flipCurled")?(Meclib.Globals.viewer.set({flipLoop:"BACK"}),Meclib.Canvas.motion="BACK",ViewerApp.mediator.trigger("canvas:execFlipMotion",Meclib.Function.point2D(e.pageX,e.pageY))):Meclib.Canvas.enabled=!1:"slide"===Meclib.Globals.viewer.get("moveType")&&($("#canvas-leftpage,#canvas-rightpage").css({cursor:"pointer"}),!0===Meclib.Globals.bookCanvas.isDraggabled(e.pageX,e.pageY)?Meclib.Canvas.enabled=!0:Meclib.Canvas.enabled=!1))))))))},onMouseUp:function(e){if(3!==Meclib.Event.type&&(Meclib.Function.endClick(e.pageX,e.pageY),!(e.originalEvent&&e.originalEvent.button&&0!=e.originalEvent.button||(Meclib.Canvas.selected=!1,!0===Meclib.Mode.fusen||!0===Meclib.Mode.crop||!0===Meclib.Mode.autoflipping||!0===Meclib.Mode.commentSelect||!0===Meclib.Fusen.selected||!0===Meclib.BookInfo.display||!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select||!0===Meclib.Mode.memo&&!0===Meclib.Memo.mode.select)))){if("SLIDE"===Meclib.Canvas.Move.mode||!1===Meclib.Globals.viewer.get("selected"))return!0===Meclib.Function.isSingleClicked()&&(Meclib.Function.resetClick(),ViewerApp.mediator.trigger("canvas:callSingleClick",e)),void Meclib.Function.resetClick();if(!0!==Meclib.Mode.pdf&&!0!==Meclib.Mode.print&&!0!==Meclib.Mode.products){if(!0===Meclib.Function.isSideMenuOpened())return!1;if(!0===Meclib.Function.isOptionMenuOpened())return!1;if("slide"!==Meclib.Globals.viewer.get("moveType")&&!($("#canvas-area").css("left").replace("px","")>0)&&!0!==Meclib.PageSlider.selected){Meclib.Canvas.zoomDrag=!1;var i=!1;if(1===Meclib.Globals.viewer.get("scale")){if(0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage&&"flip"===Meclib.Globals.viewer.get("moveType")){var t=Meclib.Function.point2D(0,0),o=Meclib.Function.point2D(0,0);o.x=e.pageX,o.y=e.pageY-Meclib.Size.headerHeight+Meclib.Globals.bookCanvas.top,o.nowPageNo=Meclib.Globals.book.getFlipStartPage(Meclib.Canvas.flipDir),o.reversePageNo=Meclib.Globals.book.getFlipReversePage(Meclib.Canvas.flipDir),o.underPageNo=Meclib.Globals.book.getFlipUnderPage(Meclib.Canvas.flipDir),o.flipH=0==Meclib.Canvas.flipDir?"left":"right",o.flipV=Meclib.Canvas.flipCorner,0===Meclib.Canvas.flipDir?(t.x=Meclib.Globals.bookCanvas.left+Meclib.Globals.bookCanvas.drawWidth/2,e.pageX>t.x&&Meclib.Canvas.enabled&&!0===Meclib.Globals.viewer.get("flipCurled")?(Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")),Meclib.Canvas.motion="FLIP",Meclib.Globals.viewer.set({moveMotion:"FLIP2END"})):!1!==Meclib.Globals.viewer.get("flipCurled")&&(Meclib.Canvas.motion="BACK",Meclib.Globals.viewer.set({flipLoop:"BACK"}))):(t.x=Meclib.Globals.bookCanvas.canvasWidth-(Meclib.Globals.bookCanvas.left+Meclib.Globals.bookCanvas.drawWidth/2),e.pageX1||jQuery(":hover").filter("#header").length>0||jQuery(":hover").filter("#footer").length||!0===Meclib.Function.isSideMenuOpened()||!0===Meclib.Mode.fusen||!0===Meclib.Mode.crop||!0===Meclib.Mode.pdf||!0===Meclib.Mode.print||!0===Meclib.Mode.products||!0===Meclib.Mode.commentSelect||!0===Meclib.BookInfo.display||!0===Meclib.Mode.autoflip||!0===Meclib.Mode.autoflipping||!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select||!0===Meclib.Mode.memo&&!0===Meclib.Memo.mode.select)){if(!$(e.target).hasClass("ev-flip-obj")&&0==$(e.target).parents(".ev-flip-obj").length){if(jQuery(":hover").filter(".news-obj,.fusen-obj,.embed-obj").length>0)return;jQuery(":hover").filter(".video-obj,.audio-obj").length>0&&e.stopPropagation()}if(!(jQuery(":hover").filter(".link-obj").length>0||$("#canvas-area").css("left").replace("px","")>0||!0===Meclib.Fusen.selected||!0===Meclib.PageSlider.selected))if(!0===Meclib.Canvas.selected)ViewerApp.mediator.trigger("canvas:onDrag",e);else{if(Meclib.Globals.viewer.get("scale")>1)return;if(!0===Meclib.Globals.viewer.get("moving")||2===Meclib.Globals.viewer.get("scale")||3===Meclib.Globals.viewer.get("scale"))return;if(1===Meclib.Globals.viewer.get("viewMode")||0===Meclib.Globals.viewer.get("rotate")||0===Meclib.Globals.book.twopage)return;!0===Meclib.Globals.bookCanvas.isOverFlippabled(e.pageX,e.pageY)&&"flip"===Meclib.Globals.viewer.get("moveType")?!1===Meclib.Globals.viewer.get("flipCurled")&&(Meclib.Globals.bookCanvas.setFlipDir(e.pageX),Meclib.Canvas.enabled=!0,Meclib.Globals.viewer.set({flipLoop:"OVER",flipCurled:!0}),Meclib.Canvas.motion="OVER",ViewerApp.mediator.trigger("canvas:execFlipMotion",Meclib.Function.point2D(e.pageX,e.pageY))):!1!==Meclib.Globals.viewer.get("flipCurled")&&(Meclib.Globals.viewer.set({flipLoop:"BACK"}),Meclib.Canvas.motion="BACK",ViewerApp.mediator.trigger("canvas:execFlipMotion",Meclib.Function.point2D(e.pageX,e.pageY)))}}},onSwipeleft:function(e){1===Meclib.Event.type&&(!0===Meclib.Canvas.selected&&Meclib.Globals.viewer.get("device")>1||jQuery(":hover").filter(".fusen-obj,.comment-obj,.link-obj,.embed-obj,.news-obj,.video-obj,.audio-obj").length>0||jQuery(":hover").filter('[data-role="panel"]').length>0||1===Meclib.Globals.viewer.get("scale")&&(Meclib.zoomScale>1||!0!==Meclib.Mode.fusen&&!0!==Meclib.Mode.crop&&!0!==Meclib.Mode.commentSelect&&1!=Meclib.Fusen.selected&&!0!==Meclib.BookInfo.display&&!0!==Meclib.Mode.autoflipping&&!0!==Meclib.Globals.viewer.get("flipping")&&"BACK"!==Meclib.Globals.viewer.get("flipLoop")&&"BACK"!==Meclib.Canvas.motion&&!0!==Meclib.PageSlider.selected&&(!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select||!0===Meclib.Mode.memo&&!0===Meclib.Memo.mode.select||setTimeout((function(){-1===$.inArray(Meclib.Globals.book.getFlipStartPage(Meclib.Canvas.flipDir),Meclib.Globals.animation_page)&&(1==Meclib.Globals.book.twopage&&"slide"!==Meclib.Globals.viewer.get("moveType")&&""!==Meclib.Canvas.motion||(Meclib.Function.postParent("movestart"),ViewerApp.mediator.trigger("main:moveRightPage")))}),1))))},onSwiperight:function(e){1===Meclib.Event.type&&(!0===Meclib.Canvas.selected&&Meclib.Globals.viewer.get("device")>1||jQuery(":hover").filter(".fusen-obj,.comment-obj,.link-obj,.embed-obj,.news-obj,.video-obj,.audio-obj").length>0||jQuery(":hover").filter('[data-role="panel"]').length>0||1===Meclib.Globals.viewer.get("scale")&&(Meclib.zoomScale>1||!0!==Meclib.Mode.fusen&&!0!==Meclib.Mode.crop&&!0!==Meclib.Mode.commentSelect&&1!=Meclib.Fusen.selected&&!0!==Meclib.BookInfo.display&&!0!==Meclib.Mode.autoflipping&&!0!==Meclib.Globals.viewer.get("flipping")&&"BACK"!==Meclib.Globals.viewer.get("flipLoop")&&"BACK"!==Meclib.Canvas.motion&&!0!==Meclib.PageSlider.selected&&(!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select||!0===Meclib.Mode.memo&&!0===Meclib.Memo.mode.select||setTimeout((function(){if(-1!==$.inArray(Meclib.Globals.book.getFlipStartPage(Meclib.Canvas.flipDir),Meclib.Globals.animation_page))return!1;1==Meclib.Globals.book.twopage&&"slide"!==Meclib.Globals.viewer.get("moveType")&&""!==Meclib.Canvas.motion||(Meclib.Function.postParent("movestart"),ViewerApp.mediator.trigger("main:moveLeftPage"))}),1))))}}),ViewerApp.Views.CenvasMouseWheelEvevtView=Backbone.View.extend({el:$("#canvas-area"),initialize:function(){_.bindAll(this,"zoom");var e="onwheel"in document?"wheel":"onmousewheel"in document?"mousewheel":"DOMMouseScroll",i=this;"MAINTE"!==Meclib.Setting.type&&$(document).on(e,(function(e){i.zoom(e)}))},zoom:function(e){if(!(jQuery(":hover").filter("textarea").length>0||jQuery(":hover").filter(".comment-obj,.link-obj,.embed-obj,.news-obj,.video-obj,.audio-obj").length>0||jQuery(":hover").filter("#footer,#header,#sidemenu").length>0||jQuery(":hover").filter('[data-role="panel"]').length>0||!0===Meclib.Function.isPageZooming()||!0===Meclib.Canvas.zoomDrag||""!==Meclib.Canvas.motion||!0===Meclib.Mode.fusen||!0===Meclib.Mode.crop||!0===Meclib.Mode.commentSelect||!0===Meclib.BookInfo.display||!0===Meclib.Mode.autoflipping)){var i=1;1===Meclib.Globals.book.zoom.x6?i=4:1===Meclib.Globals.book.zoom.x4&&(i=2);var t=Meclib.Globals.book.thumbWidth*i/Meclib.Globals.bookCanvas.drawWidth;if((e.originalEvent.deltaY?-e.originalEvent.deltaY:e.originalEvent.wheelDelta?e.originalEvent.wheelDelta:-e.originalEvent.detail)<0){if(1===Meclib.zoomScale)return;Meclib.zoomScale-=Meclib.MouseWheel.zoomInc,Meclib.zoomScale<1&&(Meclib.zoomScale=1)}else{if(Meclib.zoomScale>=t)return void(Meclib.zoomScale=t);Meclib.zoomScale+=Meclib.MouseWheel.zoomInc,Meclib.zoomScale>t&&(Meclib.zoomScale=t)}1===Meclib.Globals.viewer.get("device")&&!1===Meclib.MainMenu.overlay&&(e.pageY=e.pageY-Meclib.Size.headerHeight),ViewerApp.mediator.trigger("contents:hideAll"),this.touchPoint=Meclib.Function.point2D(e.pageX,e.pageY),this.zoomStartScale=Meclib.zoomScale;var o=Meclib.Globals.bookCanvas.drawWidth,a=Meclib.Globals.bookCanvas.drawHeight,l=parseFloat($("#canvas-leftpage").css("width"),10)/o,n=parseFloat($("#canvas-leftpage").css("height"),10)/a,c=parseFloat(Meclib.zoomScale/l,10),s=parseFloat(Meclib.zoomScale/n,10);this.zoomPoint=Meclib.Function.point2D((e.pageX-parseFloat($("#page-area").css("left"),10)-parseFloat($("#canvas-leftpage").css("left"),10))/l,(e.pageY-parseFloat($("#page-area").css("top"),10)-parseFloat($("#canvas-leftpage").css("top"),10))/n);var r,g=parseFloat($("#page-area").css("left"),10)*c+this.touchPoint.x*(c-1)*-1+parseFloat($("#canvas-leftpage").css("left"),10)*c,b=parseFloat($("#page-area").css("top"),10)*s+this.touchPoint.y*(s-1)*-1+parseFloat($("#canvas-leftpage").css("top"),10)*s;$("#page-area").transform("none").css({left:g+"px",top:b+"px",width:o*Meclib.Globals.bookCanvas.canvasNum*Meclib.zoomScale+"px",height:a*Meclib.zoomScale+"px"}),$("#canvas-leftpage").css({left:0,top:0,width:o*Meclib.zoomScale+"px",height:a*Meclib.zoomScale+"px"}),$("#canvas-rightpage").css({left:o*Meclib.zoomScale+"px",top:0,width:o*Meclib.zoomScale+"px",height:a*Meclib.zoomScale+"px"}),r=0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage?[Meclib.Globals.book.getLeftPage(),Meclib.Globals.book.getRightPage()]:[Meclib.Globals.book.currentPage];for(var p=o*Meclib.zoomScale,d=a*Meclib.zoomScale,M=0;M=u&&Meclib.zoomScale6&&(i=6),e.scale=i,ViewerApp.mediator.trigger("canvas:PinchCanvas",e)})),l.on("pinchend",(function(e){Meclib.Pinch.endtime=(new Date).getTime(),ViewerApp.mediator.trigger("canvas:PinchEndCanvas",e)}))}Meclib.zoomScale=Meclib.Globals.viewer.get("scale"),Meclib.Event.gesture=""},events:function(){}}),ViewerApp.Views.CenvasPointerEvevtView=Backbone.View.extend({el:$("#canvas-area"),initialize:function(e){if(!0===Meclib.Function.getDeviceEventLists().pointer){var i=0,t=document.getElementById("page-area");t.addEventListener("pointerdown",(function(e){1===Meclib.Globals.viewer.get("device")&&"touch"!==e.pointerType||!1!==e.isPrimary&&2!==Meclib.Event.type&&(i=1)}),!1),t.addEventListener("pointermove",(function(e){1===Meclib.Globals.viewer.get("device")&&"touch"!==e.pointerType||!1!==e.isPrimary&&2!==Meclib.Event.type&&i>0&&(10===++i?ViewerApp.mediator.trigger("canvas:DragStartCanvas",e):ViewerApp.mediator.trigger("canvas:DragCanvas",e))}),!1),t.addEventListener("pointerup",(function(e){i=0,!1!==e.isPrimary&&2!==Meclib.Event.type&&(1===Meclib.Globals.viewer.get("device")&&"touch"!==e.pointerType||ViewerApp.mediator.trigger("canvas:DragEndCanvas",e))}),!1)}},events:function(){}}),ViewerApp.Views.CenvasTouchEvevtView=Backbone.View.extend({el:$("#canvas-area"),initialize:function(e){!0===Meclib.Function.getDeviceEventLists().touch&&$("#page-area").bind("touchstart",(function(e){1==e.originalEvent.touches.length&&(e.originalEvent.touches&&0===Meclib.Globals.bookCanvas.getSelectPage(e.originalEvent.touches[0].pageX)||ViewerApp.mediator.trigger("canvas:DragStartCanvas",e))})).bind("touchmove",(function(e){1==e.originalEvent.touches.length&&ViewerApp.mediator.trigger("canvas:DragCanvas",e)})).bind("touchend",(function(e){ViewerApp.mediator.trigger("canvas:DragEndCanvas",e),Meclib.Pinch.endtime-Meclib.Pinch.pinchtime<0&&(Meclib.Pinch.endtime=(new Date).getTime(),ViewerApp.mediator.trigger("canvas:PinchEndCanvas",e))})).end(),Meclib.zoomScale=Meclib.Globals.viewer.get("scale"),Meclib.Event.gesture=""},events:function(){}}),ViewerApp.Views.CenvasPinchView=Backbone.View.extend({el:$("#canvas-area"),initialize:function(e){_.bindAll(this,"pinchStartCanvas","pinchCanvas","pinchEndCanvas","pinchInit","pinchCanvasRedraw","pinchCanvasReload"),ViewerApp.mediator.on("canvas:PinchStartCanvas",this.pinchStartCanvas),ViewerApp.mediator.on("canvas:PinchCanvas",this.pinchCanvas),ViewerApp.mediator.on("canvas:PinchEndCanvas",this.pinchEndCanvas),ViewerApp.mediator.on("canvas:pinchCanvasRedraw",this.pinchCanvasRedraw),ViewerApp.mediator.on("canvas:pinchCanvasReload",this.pinchCanvasReload)},zoomStartScale:1,zoomPoint:null,touchPoint:{x:0,y:0},redrawScale:1,events:function(){},pinchStartCanvas:function(e){Meclib.Mode.crop||!0===Meclib.Mode.memo&&!0===Meclib.Memo.isDown||(ViewerApp.mediator.trigger("canvas:cancelOverAnimation"),Meclib.ZoomPos=null,this.redrawScale=1,Meclib.Pinch.time=0)},pinchCanvas:function(e){Meclib.Mode.crop||!0===Meclib.Mode.memo&&!0===Meclib.Memo.isDown||(Meclib.zoomScale=e.scale,null===Meclib.ZoomPos&&(ViewerApp.mediator.trigger("contents:hideAll"),ViewerApp.mediator.trigger("canvas:toggleSideBar",0),this.touchPoint.x=e.center.x,this.touchPoint.y=e.center.y,this.zoomStartScale=Meclib.zoomScale,this.zoomPoint=Meclib.Function.point2D((this.touchPoint.x-parseFloat($("#page-area").css("left"),10)-parseFloat($("#canvas-leftpage").css("left"),10))/this.zoomStartScale,(this.touchPoint.y-parseFloat($("#page-area").css("top"),10)-parseFloat($("#canvas-leftpage").css("top"),10))/this.zoomStartScale),this.pinchInit(),Meclib.Event.gesture="pinch",Meclib.Zoom.type="pinch"),ViewerApp.mediator.trigger("canvas:pinchCanvasRedraw"))},pinchEndCanvas:function(e){if(Meclib.Event.gesture="",!Meclib.Mode.crop&&(!0!==Meclib.Mode.memo||!0!==Meclib.Memo.isDown))if(1==Meclib.zoomScale)ViewerApp.mediator.trigger("fusen:disabledFusenMenu",0),Meclib.Globals.viewer.set({scale:1}),ViewerApp.mediator.trigger("canvas:initScale"),ViewerApp.mediator.trigger("updatePage"),Meclib.Event.gesture="";else{ViewerApp.mediator.trigger("fusen:disabledFusenMenu",1);var i=Meclib.Globals.viewer.get("scale");if(Meclib.zoomScale<=2*Meclib.Globals.book.thumbWidth/Meclib.Globals.bookCanvas.drawWidth?Meclib.Globals.viewer.set({scale:4}):Meclib.zoomScale>2*Meclib.Globals.book.thumbWidth/Meclib.Globals.bookCanvas.drawWidth&&Meclib.Globals.viewer.set({scale:6}),i3&&3===Meclib.Event.type&&t<300)){var o,a=parseFloat($("#canvas-leftpage").css("width"),10)/e,l=parseFloat(Meclib.zoomScale/a,10),n=parseFloat($("#page-area").css("left"),10)*l+this.touchPoint.x*(l-1)*-1+parseFloat($("#canvas-leftpage").css("left"),10)*l,c=parseFloat($("#page-area").css("top"),10)*l+this.touchPoint.y*(l-1)*-1+parseFloat($("#canvas-leftpage").css("top"),10)*l;$("#page-area").transform("none").css({left:n+"px",top:c+"px",width:e*Meclib.Globals.bookCanvas.canvasNum*Meclib.zoomScale+"px",height:i*Meclib.zoomScale+"px"}),$("#canvas-leftpage").css({left:0,top:0,width:e*Meclib.zoomScale+"px",height:i*Meclib.zoomScale+"px"}),$("#canvas-rightpage").css({left:e*Meclib.zoomScale+"px",top:0,width:e*Meclib.zoomScale+"px",height:i*Meclib.zoomScale+"px"}),o=0===Meclib.Globals.viewer.get("viewMode")&&1===Meclib.Globals.viewer.get("rotate")&&1===Meclib.Globals.book.twopage?[Meclib.Globals.book.getLeftPage(),Meclib.Globals.book.getRightPage()]:[Meclib.Globals.book.currentPage];var s=e*Meclib.zoomScale,r=i*Meclib.zoomScale;Meclib.Pinch.time=(new Date).getTime();for(var g=0;g1)&&!0!==Meclib.Globals.viewer.get("moving")&&!0!==Meclib.Function.isSideMenuOpened()&&!0!==Meclib.Function.isOptionMenuOpened()&&($(e.target).hasClass("ev-flip-obj")||0!==$(e.target).parents(".ev-flip-obj").length)&&!0!==Meclib.Mode.fusen&&!0!==Meclib.Fusen.selected&&"FLIP"!==Meclib.Canvas.motion&&"SLIDE"!==Meclib.Canvas.motion&&"flip"===Meclib.Globals.viewer.get("moveType")&&!0!==Meclib.Mode.autoflipping&&1!==Meclib.Globals.bookCanvas.canvasNum&&!0!==Meclib.Mode.crop&&!Meclib.Canvas.selected&&!0!==Meclib.PageSlider.selected&&!0!==Meclib.Mode.txtcopy){var i,t=0;e.touches?(i=e.touches[0].pageX,t=e.touches[0].pageY):e.originalEvent?e.originalEvent.touches?(i=e.originalEvent.touches[0].pageX,t=e.originalEvent.touches[0].pageY):(i=e.originalEvent.pageX,t=e.originalEvent.pageY):(i=e.pageX,t=e.pageY),Meclib.Globals.bookCanvas.isOverFlippabled(i,t)?(Meclib.Globals.bookCanvas.setFlipDir(i),Meclib.Canvas.enabled=!0,Meclib.Canvas.selected=!0,Meclib.Canvas.motion="OVER",Meclib.Globals.viewer.set({flipTime:1e3,selected:!0,moveMotion:"",flipLoop:"",flipX:i,flipY:t}),ViewerApp.mediator.trigger("canvas:execFlipMotion",Meclib.Function.point2D(i,t))):Meclib.Globals.bookCanvas.isFlippabled(i,t)&&(Meclib.Globals.bookCanvas.setFlipDir(i),Meclib.Globals.viewer.set({flipTime:1e3,selected:!0,moveMotion:"",flipLoop:"",flipX:i,flipY:t}),Meclib.Canvas.enabled=!0,Meclib.Canvas.selected=!0)}},dragCanvas:function(e){if(!("drag"!=Meclib.Event.gesture&&""!==Meclib.Event.gesture||1!==Meclib.Globals.viewer.get("scale")||Meclib.zoomScale>1||!0===Meclib.Function.isSideMenuOpened()||!0===Meclib.Function.isOptionMenuOpened()||!0===Meclib.Mode.fusen||!0===Meclib.Fusen.selected||"FLIP"===Meclib.Canvas.motion||"SLIDE"===Meclib.Canvas.motion||!0===Meclib.Mode.autoflipping||"flip"!==Meclib.Globals.viewer.get("moveType")||1===Meclib.Globals.bookCanvas.canvasNum||!0===Meclib.Mode.crop||!0===Meclib.PageSlider.selected||!0===Meclib.Mode.txtcopy)){var i;if(e.touches?(i=e.touches[0].pageX,e.touches[0].pageY):e.originalEvent?e.originalEvent.touches?(i=e.originalEvent.touches[0].pageX,e.originalEvent.touches[0].pageY):(i=e.originalEvent.pageX,e.originalEvent.pageY):(i=e.pageX,e.pageY),!0===Meclib.Canvas.selected){if(""===Meclib.Event.gesture)Meclib.Event.gesture="drag",Meclib.Globals.bookCanvas.setFlipDir(i);else if("drag"!=Meclib.Event.gesture)return;Meclib.Canvas.motion="",!0===Meclib.Function.getDeviceEventLists().touch?ViewerApp.mediator.trigger("canvas:onDrag",e.originalEvent.touches[0]):ViewerApp.mediator.trigger("canvas:onDrag",e)}}},dragEndCanvas:function(e){if(!("drag"!=Meclib.Event.gesture&&""!==Meclib.Event.gesture||!0!==Meclib.Canvas.selected||(Meclib.Event.gesture="",Meclib.Canvas.selected=!1,1!==Meclib.Globals.viewer.get("scale")||Meclib.zoomScale>1||!0!==Meclib.Globals.viewer.get("moving")||!0===Meclib.Mode.autoflipping||"flip"!==Meclib.Globals.viewer.get("moveType")||!0===Meclib.Mode.fusen||!0===Meclib.Fusen.selected||"FLIP"===Meclib.Canvas.motion||"SLIDE"===Meclib.Canvas.motion||!0===Meclib.Mode.crop||1===Meclib.Globals.bookCanvas.canvasNum||!0===Meclib.PageSlider.selected||!0===Meclib.Mode.txtcopy))){var i=Meclib.Function.point2D(0,0),t=Meclib.Function.point2D(0,0);if(t.x=Meclib.Globals.viewer.get("flipX"),t.y=Meclib.Globals.viewer.get("flipY"),t.nowPageNo=Meclib.Globals.book.getFlipStartPage(Meclib.Canvas.flipDir),t.reversePageNo=Meclib.Globals.book.getFlipReversePage(Meclib.Canvas.flipDir),t.underPageNo=Meclib.Globals.book.getFlipUnderPage(Meclib.Canvas.flipDir),t.flipH=0==Meclib.Canvas.flipDir?"left":"right",t.flipV=Meclib.Canvas.flipCorner,0===Meclib.Canvas.flipDir)i.x=Meclib.Globals.bookCanvas.left+Meclib.Globals.bookCanvas.drawWidth/2,t.x>i.x?(Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")),Meclib.Globals.viewer.set({moveMotion:"FLIP2END"})):Meclib.Globals.viewer.set({flipLoop:"BACK"});else if(i.x=Meclib.Globals.bookCanvas.canvasWidth-(Meclib.Globals.bookCanvas.left+Meclib.Globals.bookCanvas.drawWidth/2),t.x1)return}else if(e.gesture.srcEvent&&e.gesture.srcEvent.touches&&e.gesture.srcEvent.touches.length>1)return;""===Meclib.Canvas.motion&&(e.gesture.pointers.length>1||1===Meclib.Globals.viewer.get("scale")&&!0!==Meclib.Mode.fusen&&!0!==Meclib.Mode.crop&&!0!==Meclib.Mode.autoflipping&&!0!==Meclib.Fusen.selected&&!0!==Meclib.PageSlider.selected&&-1===$.inArray(Meclib.Globals.book.getFlipStartPage(Meclib.Canvas.flipDir),Meclib.Globals.animation_page)&&("SLIDE"!==Meclib.Canvas.Move.mode&&1===Meclib.Globals.bookCanvas.canvasNum||null!==Meclib.Comment.jCropApi&&void 0!==Meclib.Comment.jCropApi||!0!==Meclib.Mode.txtcopy&&!0!==Meclib.Mode.memo&&(Meclib.Function.postParent("movestart"),ViewerApp.mediator.trigger("main:moveRightPage"))))}},swipeRightCanvas:function(e){if(""===Meclib.Event.gesture){if(e.gesture.sourceEvent){if(e.gesture.sourceEvent.touches&&e.gesture.sourceEvent.touches.length>1)return}else if(e.gesture.srcEvent&&e.gesture.srcEvent.touches&&e.gesture.srcEvent.touches.length>1)return;if(""===Meclib.Canvas.motion&&!(e.gesture.pointers.length>1)&&1===Meclib.Globals.viewer.get("scale")&&!0!==Meclib.Mode.fusen&&!0!==Meclib.Mode.crop&&!0!==Meclib.Mode.autoflipping&&!0!==Meclib.Fusen.selected&&!0!==Meclib.PageSlider.selected)return-1===$.inArray(Meclib.Globals.book.getFlipStartPage(Meclib.Canvas.flipDir),Meclib.Globals.animation_page)&&void("SLIDE"!==Meclib.Canvas.Move.mode&&1===Meclib.Globals.bookCanvas.canvasNum||null!==Meclib.Comment.jCropApi&&void 0!==Meclib.Comment.jCropApi||!0!==Meclib.Mode.txtcopy&&!0!==Meclib.Mode.memo&&(Meclib.Function.postParent("movestart"),ViewerApp.mediator.trigger("main:moveLeftPage")))}}}),ViewerApp.Views.MainView=Backbone.View.extend({el:$("#main"),initialize:function(e){if(_.bindAll(this,"resize","checkBookState","updatePage","movePage","moveRightPage","moveRightLimitPage","moveLeftPage","moveLeftLimitPage","onLeftbar","onRightbar","start"),ViewerApp.mediator.on("main:showContextMenu",this.showContextMenu),ViewerApp.mediator.on("main:hideDebugMenu",this.hideDebugMenu),ViewerApp.mediator.on("main:start",this.start),ViewerApp.mediator.on("main:checkBookState",this.checkBookState),ViewerApp.mediator.on("main:onMovedPage",this.onMovedPage),ViewerApp.mediator.on("updatePage",this.updatePage),ViewerApp.mediator.on("main:updateDisplayParts",this.updateDisplayParts),ViewerApp.mediator.on("main:openHelp",this.openHelp),ViewerApp.mediator.on("main:onMouseMove",this.onMouseMove),ViewerApp.mediator.on("main:moveInputPage",this.moveInputPage),ViewerApp.mediator.on("main:movePage",this.movePage),ViewerApp.mediator.on("main:resize",this.resize),ViewerApp.mediator.on("main:moveRightPage",this.moveRightPage),ViewerApp.mediator.on("main:moveLeftPage",this.moveLeftPage),ViewerApp.mediator.on("main:moveRightLimitPage",this.moveRightLimitPage),ViewerApp.mediator.on("main:moveLeftLimitPage",this.moveLeftLimitPage),ViewerApp.mediator.on("main:onLeftbar",this.onLeftbar),ViewerApp.mediator.on("main:onRightbar",this.onRightbar),ViewerApp.mediator.on("main:donwload2Bookshelf",this.donwload2Bookshelf),ViewerApp.mediator.on("main:onClick",this.onClick),!0===Meclib.Function.getDeviceEventLists().mouse&&($(window).bind("mousedown",(function(e){if(Meclib.Mode.memo){if(0===jQuery(":hover").filter("#memo-layer").length)return;if(jQuery(":hover").filter("#header").length>0||jQuery(":hover").filter("#footer").length)return;var i=e.pageX,t=e.pageY;Meclib.Memo.action.onDownMemo(i,t)}if(!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select){if(0===jQuery(":hover").filter("#txtcopy-layer").length)return;if(jQuery(":hover").filter("#header").length>0||jQuery(":hover").filter("#footer").length)return;if(2==(2&e.buttons)||3==(3&e.buttons))return;if(3===Meclib.Event.type)return;Meclib.Txtcopy.action.onDown(e.pageX,e.pageY)}})),$(window).bind("mousemove",(function(e){if(!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select){if(jQuery(":hover").filter("#header").length>0||jQuery(":hover").filter("#footer").length)return Meclib.Txtcopy.isDown&&$("#header,#footer").hide(),void(Meclib.Txtcopy.isDown||Meclib.Txtcopy.action.clearCanvas(1));if(0===jQuery(":hover").filter("#txtcopy-layer").length)return void(Meclib.Txtcopy.isDown||Meclib.Txtcopy.action.clearCanvas(1));if(2==(2&e.buttons)||3==(3&e.buttons))return;if(3===Meclib.Event.type)return;Meclib.Txtcopy.action.onDrag(e.pageX,e.pageY)}if(Meclib.Mode.memo){if(jQuery(":hover").filter("#header").length>0||jQuery(":hover").filter("#footer").length)return void(Meclib.Memo.isDown?$("#header,#footer").hide():10===Meclib.Memo.select.type&&Meclib.Memo.action.clearCanvas(1));var i=e.pageX,t=e.pageY;Meclib.Memo.action.onDragMemo(i,t)}})),$(window).bind("mouseup blur",(function(e){if(!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select){if(jQuery(":hover").filter("#header").length>0||jQuery(":hover").filter("#footer").length)return;if(2==(2&e.buttons)||3==(3&e.buttons))return;if(3===Meclib.Event.type)return;Meclib.Txtcopy.action.onUp()}if(Meclib.Mode.memo){if(jQuery(":hover").filter("#header").length>0||jQuery(":hover").filter("#footer").length)return;Meclib.Memo.action.onUpMemo()}}))),!0===Meclib.Function.getDeviceEventLists().touch&&!1===Meclib.Function.getDeviceEventLists().pointer){$("#leftbar").on("touchend",(function(e){ViewerApp.mediator.trigger("main:onLeftbar")})),$("#rightbar").on("touchend",(function(e){ViewerApp.mediator.trigger("main:onRightbar")})),Meclib.ClickManager.add(document,"#menu-pagemove-left",(function(e,i){return i.stopPropagation(),ViewerApp.mediator.trigger("menu:moveLeftPage"),!1})),Meclib.ClickManager.add(document,"#menu-pagemove-right",(function(e,i){return i.stopPropagation(),ViewerApp.mediator.trigger("menu:moveRightPage"),!1})),document.documentElement.addEventListener("touchstart",(function(e){e.touches.length>1&&e.preventDefault();var i,t=!1,o=0;if(e.touches?(i=e.touches[0].pageX,o=e.touches[0].pageY):e.originalEvent?e.originalEvent.touches?(i=e.originalEvent.touches[0].pageX,o=e.originalEvent.touches[0].pageY):(i=e.originalEvent.pageX,o=e.originalEvent.pageY):(i=e.pageX,o=e.pageY),Meclib.Mode.memo){if(t=!1,"memo-layer"===e.target.id&&(t=!0),e.target.offsetParent&&"memo-layer"===e.target.offsetParent.id&&(t=!0),!1===t)return;Meclib.Memo.action.onDownMemo(i,o)}if(!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select){if(t=!1,"txtcopy-layer"===e.target.id&&(t=!0),e.target.offsetParent&&"txtcopy-layer"===e.target.offsetParent.id&&(t=!0),!1===t)return;Meclib.Txtcopy.action.onDown(i,o)}}),!1);var i=0;document.documentElement.addEventListener("touchmove",(function(e){var i,t=0;e.touches?(i=e.touches[0].pageX,t=e.touches[0].pageY):e.originalEvent?e.originalEvent.touches?(i=e.originalEvent.touches[0].pageX,t=e.originalEvent.touches[0].pageY):(i=e.originalEvent.pageX,t=e.originalEvent.pageY):(i=e.pageX,t=e.pageY),Meclib.Mode.memo&&Meclib.Memo.action.onDragMemo(i,t),!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select&&"txtcopy-layer"===e.target.id&&Meclib.Txtcopy.action.onDrag(i,t)}),!1),document.documentElement.addEventListener("touchend",(function(e){var t=(new Date).getTime();t-i<=500&&e.preventDefault(),i=t,Meclib.Mode.memo&&Meclib.Memo.action.onUpMemo(),!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select&&Meclib.Txtcopy.action.onUp()}),!1)}if(!0===Meclib.Function.getDeviceEventLists().pointer){document.documentElement.addEventListener("pointerdown",(function(e){if((1!==Meclib.Globals.viewer.get("device")||"touch"===e.pointerType)&&!1!==e.isPrimary&&2!==Meclib.Event.type){var i,t=!1,o=0;if(e.touches?(i=e.touches[0].pageX,o=e.touches[0].pageY):e.originalEvent?e.originalEvent.touches?(i=e.originalEvent.touches[0].pageX,o=e.originalEvent.touches[0].pageY):(i=e.originalEvent.pageX,o=e.originalEvent.pageY):(i=e.pageX,o=e.pageY),Meclib.Mode.memo){if(t=!1,"memo-layer"===e.target.id&&(t=!0),e.target.offsetParent&&"memo-layer"===e.target.offsetParent.id&&(t=!0),!1===t)return;Meclib.Memo.action.onDownMemo(i,o)}if(!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select){if(t=!1,"txtcopy-layer"===e.target.id&&(t=!0),e.target.offsetParent&&"txtcopy-layer"===e.target.offsetParent.id&&(t=!0),!1===t)return;Meclib.Txtcopy.action.onDown(i,o)}}}),!1);var t=0;document.documentElement.addEventListener("pointermove",(function(e){if((1!==Meclib.Globals.viewer.get("device")||"touch"===e.pointerType)&&!1!==e.isPrimary&&2!==Meclib.Event.type){var i,t=0;e.touches?(i=e.touches[0].pageX,t=e.touches[0].pageY):e.originalEvent?e.originalEvent.touches?(i=e.originalEvent.touches[0].pageX,t=e.originalEvent.touches[0].pageY):(i=e.originalEvent.pageX,t=e.originalEvent.pageY):(i=e.pageX,t=e.pageY),Meclib.Mode.memo&&Meclib.Memo.action.onDragMemo(i,t),!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select&&"txtcopy-layer"===e.target.id&&Meclib.Txtcopy.action.onDrag(i,t)}}),!1),document.documentElement.addEventListener("pointerup",(function(e){if((1!==Meclib.Globals.viewer.get("device")||"touch"===e.pointerType)&&!1!==e.isPrimary&&2!==Meclib.Event.type){var i=(new Date).getTime();i-t<=500&&e.preventDefault(),t=i,Meclib.Mode.memo&&Meclib.Memo.action.onUpMemo(),!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select&&Meclib.Txtcopy.action.onUp()}}),!1)}$(window).keydown((function(e){(1!=$(":focus").length||"TEXTAREA"!=$(":focus").get(0).tagName&&"INPUT"!=$(":focus").get(0).tagName)&&(Meclib.KeybordManager.keyDown(e.keyCode),!0===e.ctrlKey&&(Meclib.KeybordManager.ctrlKey=1),!0===e.shiftKey&&(Meclib.KeybordManager.shiftKey=1))})),document.documentElement.addEventListener("mousedown",(function(e){!1!==Meclib.Function.getDeviceEventLists().mouse&&!1===Meclib.Function.getDeviceEventLists().pointer&&(Meclib.Event.type=1)}),!1),document.documentElement.addEventListener("pointerdown",(function(e){Meclib.Event.type=1,"touch"===e.pointerType&&(Meclib.Event.type=3)}),!1),document.documentElement.addEventListener("touchstart",(function(e){!0===Meclib.Function.getDeviceEventLists().touch&&!1===Meclib.Function.getDeviceEventLists().pointer&&(Meclib.Event.type=2)}),!1),$(window).keyup((function(e){!1===e.ctrlKey&&(Meclib.KeybordManager.ctrlKey=0),!1===e.shiftKey&&(Meclib.KeybordManager.shiftKey=0),"body"===document.activeElement.id&&Meclib.KeybordManager.keyUp(e.keyCode)}))},events:function(){var e={};return!0!==Meclib.Function.getDeviceEventLists().mouse&&!0!==Meclib.Function.getDeviceEventLists().pointer||(e={resize:"resize","click #leftbar":"onLeftbar","click #rightbar":"onRightbar"},!0===Meclib.Function.getDeviceEventLists().mouse&&3!==Meclib.Event.type&&(e.mousemove="onMouseMove")),e.resize="resize",e},resize:function(e){if(!1===Meclib.Setting.enabled)return!1;if(!0!==Meclib.Fullscreen.videoMax){var i=!1;if(""!==$(":focus").attr("id")&&void 0!==$(":focus").attr("id")&&("INPUT"!==$(":focus").get(0).tagName&&"TEXTAREA"!==$(":focus").get(0).tagName||(i=!0)),!0===Meclib.SearchBehind&&Meclib.Globals.ua.search("Android")>=0)Meclib.SearchBehind=!1;else if(!0===Meclib.SearchBehind&&(Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1||Meclib.Globals.ua.toLocaleLowerCase().search("edg/")>-1))Meclib.SearchBehind=!1;else{if((Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1||Meclib.Globals.ua.toLocaleLowerCase().search("edg/")>-1)&&Meclib.Function.getWinsize().width==$(this.el).width()){if(Meclib.Function.isSideMenuOpened()||Meclib.Function.isInputMenuOpened())return;if(null!==Meclib.Comment.jCropApi&&void 0!==Meclib.Comment.jCropApi)return}(Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1||Meclib.Globals.ua.toLocaleLowerCase().search("edg/")>-1)&&Meclib.Function.getWinsize().width==$(this.el).width()&&!0===i||Meclib.Globals.ua.search("Android")>=0&&Meclib.Function.getWinsize().width==$(this.el).width()&&!0===i||Meclib.Globals.ua.search("Android")>=0&&Meclib.Function.getWinsize().width==$(this.el).width()&&"txtSearch"===Meclib.Menu.name||Meclib.Globals.ua.search("Android")>=0&&Meclib.Function.getWinsize().width==$(this.el).width()&&"commentList"===Meclib.Menu.name||(ViewerApp.mediator.trigger("textsearch:clearFocus"),Meclib.Globals.ua.search("Android")>=0&&Meclib.Function.getWinsize().width==$(this.el).width()&&!0===Meclib.PageSearch.display||document.webkitFullscreenElement&&"VIDEO"===document.webkitFullscreenElement.nodeName||document.webkitFullscreenElement&&"IFRAME"===document.webkitFullscreenElement.nodeName||$(".popupbox").is("*")&&Meclib.Function.getWinsize().width==$(this.el).width()||(Meclib.Size.headerHeight=Meclib.Function.getCssVal("#header").height,Meclib.Size.footerHeight=Meclib.Function.getCssVal("#footer").height,$(this.el).css({width:Meclib.Function.getWinsize().width}),$("#body").css("height",Meclib.Function.getWinsize().height),1===Meclib.Globals.viewer.get("device")&&!1===Meclib.MainMenu.overlay?$("#main").css("height",Meclib.Function.getWinsize().height-Meclib.Size.footerHeight):$("#main").css("height",Meclib.Function.getWinsize().height),ViewerApp.mediator.trigger("canvas:cancelOverAnimation"),Meclib.Globals.bookCanvas.resize(),ViewerApp.mediator.trigger("menu:resize"),ViewerApp.mediator.trigger("canvas:resize"),ViewerApp.mediator.trigger("canvas:update"),ViewerApp.mediator.trigger("header:update"),ViewerApp.mediator.trigger("footer:resize"),ViewerApp.mediator.trigger("optionmenu:resize"),ViewerApp.mediator.trigger("pagelist:resize"),ViewerApp.mediator.trigger("sidenavi:resize"),ViewerApp.mediator.trigger("fusen:resize"),ViewerApp.mediator.trigger("crop:resize"),ViewerApp.mediator.trigger("bookindex:resize"),ViewerApp.mediator.trigger("browsinghistory:resize"),ViewerApp.mediator.trigger("textsearch:resize"),this.updatePage(),Meclib.Function.resizeMessage(),Meclib.Function.postParent("resize")))}}},initBook:function(){$("title").html(Meclib.Globals.book.getName());var e=$("#btn-sidenavi-menu").outerWidth(!0)+8,i=$("#sd-btn-help").outerWidth(!0)+13;$(".header-center-sd").css("padding-left",e),$(".header-center-sd").css("padding-right",i),$(".header-title").html(Meclib.Globals.book.getName()),Meclib.Globals.tooltip=$("#tip").css({bottom:Meclib.Size.footerHeight+10}).hide()},showContextMenu:function(){},hideDebugMenu:function(){$("#system-menu").remove()},onMovedPage:function(){Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1&&window.getSelection().removeAllRanges(),ViewerApp.mediator.trigger("contents:clearTimer"),ViewerApp.mediator.trigger("news:updateCloseFlag",0),Meclib.Function.postParent("move"),1===Meclib.Globals.bookCanvas.canvasNum?(Meclib.analytics.sendMovePageLog(Meclib.Globals.book.getMovePageLog(0)),Meclib.API.onPageMove(Meclib.Globals.book.getMovePageLog(0))):2===Meclib.Globals.bookCanvas.canvasNum&&(Meclib.analytics.sendMovePageLog(Meclib.Globals.book.getMovePageLog(1)),Meclib.API.onPageMove(Meclib.Globals.book.getMovePageLog(1)));var e=Meclib.Globals.book.getEnableNowPages();if(e.length>0)for(var i=0;i1&&(t=1e3),setTimeout((function(){if($(".messi-box").length)return $(".messi-content").html()==Meclib.Message.error.moveInputPage||$(".messi-content").html(Meclib.Message.error.moveInputPage),!1;ViewerApp.mediator.trigger("contents:hideAll"),new Messi(Meclib.Message.error.moveInputPage,{title:"",animate:!1,width:Meclib.Size.MessiWidth,modal:!0,buttons:[{id:0,label:Meclib.Message.common.ok,val:null}],callback:function(e){ViewerApp.mediator.trigger("contents:showAll")}})}),t)}Meclib.API.onPageSearch(i),ViewerApp.mediator.trigger("main:movePage",i)},movePage:function(e){var i={};i.page=e,!0===Meclib.Globals.book.validate(JSON.stringify(i))&&(Meclib.Globals.book.currentPage=parseInt(e,10),this.updatePage(1),ViewerApp.mediator.trigger("main:onMovedPage"))},moveLeftPage:function(){if(!1!==Meclib.Globals.book.isMovabledPage(0,Meclib.Globals.bookCanvas.canvasNum)){if(!0===Meclib.Mode.crop&&ViewerApp.mediator.trigger("crop:endCropMode"),!0===Meclib.Mode.fusen&&ViewerApp.mediator.trigger("fusen:close"),ViewerApp.mediator.trigger("object:hide"),Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)return Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")),this.updatePage(2),ViewerApp.mediator.trigger("main:onMovedPage"),!1;if(1===arguments.length)if("flip"===arguments[0]&&1===Meclib.Globals.book.twopage)ViewerApp.mediator.trigger("canvas:flip2End",1);else if("slide"===arguments[0]){if(0!==Meclib.Slide.move.x)return;Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")),ViewerApp.mediator.trigger("canvas:slidePage",1)}else Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")),this.updatePage(1),ViewerApp.mediator.trigger("main:onMovedPage");else if(0===Meclib.Globals.viewer.get("rotate")){if(0!==Meclib.Slide.move.x)return;Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")),ViewerApp.mediator.trigger("canvas:slidePage",1)}else if(Meclib.Globals.viewer.get("viewMode")>0)if("none"!==Meclib.Globals.viewer.get("moveType")){if(0!==Meclib.Slide.move.x)return;Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")),ViewerApp.mediator.trigger("canvas:slidePage",1)}else Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")),this.updatePage(1),ViewerApp.mediator.trigger("main:onMovedPage");else if("flip"===Meclib.Globals.viewer.get("moveType")&&1===Meclib.Globals.book.twopage)Meclib.Canvas.flipCorner="bottom",ViewerApp.mediator.trigger("canvas:flip2End",1);else if("slide"===Meclib.Globals.viewer.get("moveType")){if(0!==Meclib.Slide.move.x)return;Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")),ViewerApp.mediator.trigger("canvas:slidePage",1)}else Meclib.Globals.book.moveLeft(Meclib.Globals.viewer.get("movePageNum")),this.updatePage(1),ViewerApp.mediator.trigger("main:onMovedPage")}},moveRightPage:function(){if(!1!==Meclib.Globals.book.isMovabledPage(1,Meclib.Globals.bookCanvas.canvasNum)){if(!0===Meclib.Mode.crop&&ViewerApp.mediator.trigger("crop:endCropMode"),!0===Meclib.Mode.fusen&&ViewerApp.mediator.trigger("fusen:close"),ViewerApp.mediator.trigger("object:hide"),Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1)return Meclib.Globals.book.moveRight(Meclib.Globals.viewer.get("movePageNum")),this.updatePage(2),ViewerApp.mediator.trigger("main:onMovedPage"),!1;if(1===arguments.length)if("none"===arguments[0])Meclib.Globals.book.moveRight(Meclib.Globals.viewer.get("movePageNum")),this.updatePage(1),ViewerApp.mediator.trigger("main:onMovedPage");else if("flip"===arguments[0]&&1===Meclib.Globals.book.twopage)ViewerApp.mediator.trigger("canvas:flip2End",0);else if("slide"===arguments[0]){if(0!==Meclib.Slide.move.x)return;Meclib.Globals.book.moveRight(Meclib.Globals.viewer.get("movePageNum")),ViewerApp.mediator.trigger("canvas:slidePage",0)}else Meclib.Globals.book.moveRight(Meclib.Globals.viewer.get("movePageNum")),this.updatePage(1),ViewerApp.mediator.trigger("main:onMovedPage");else if(0===Meclib.Globals.viewer.get("rotate")){if(0!==Meclib.Slide.move.x)return;Meclib.Globals.book.moveRight(Meclib.Globals.viewer.get("movePageNum")),ViewerApp.mediator.trigger("canvas:slidePage",0)}else if(Meclib.Globals.viewer.get("viewMode")>0)if("none"!==Meclib.Globals.viewer.get("moveType")){if(0!==Meclib.Slide.move.x)return;Meclib.Globals.book.moveRight(Meclib.Globals.viewer.get("movePageNum")),ViewerApp.mediator.trigger("canvas:slidePage",0)}else Meclib.Globals.book.moveRight(Meclib.Globals.viewer.get("movePageNum")),this.updatePage(1),ViewerApp.mediator.trigger("main:onMovedPage");else if("flip"===Meclib.Globals.viewer.get("moveType")&&1===Meclib.Globals.book.twopage)Meclib.Canvas.flipCorner="bottom",ViewerApp.mediator.trigger("canvas:flip2End",0);else if("slide"===Meclib.Globals.viewer.get("moveType")){if(0!==Meclib.Slide.move.x)return;Meclib.Globals.book.moveRight(Meclib.Globals.viewer.get("movePageNum")),ViewerApp.mediator.trigger("canvas:slidePage",0)}else Meclib.Globals.book.moveRight(Meclib.Globals.viewer.get("movePageNum")),this.updatePage(1),ViewerApp.mediator.trigger("main:onMovedPage")}},moveLeftLimitPage:function(){!0===Meclib.Mode.crop&&ViewerApp.mediator.trigger("crop:endCropMode"),!0===Meclib.Mode.fusen&&ViewerApp.mediator.trigger("fusen:close"),Meclib.Globals.book.moveLeftLimit(),Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1?this.updatePage(2):this.updatePage(1),ViewerApp.mediator.trigger("main:onMovedPage")},moveRightLimitPage:function(){!0===Meclib.Mode.crop&&ViewerApp.mediator.trigger("crop:endCropMode"),!0===Meclib.Mode.fusen&&ViewerApp.mediator.trigger("fusen:close"),ViewerApp.mediator.trigger("object:hide"),Meclib.Globals.book.moveRightLimit(),Meclib.Globals.viewer.get("scale")>1||Meclib.zoomScale>1?this.updatePage(2):this.updatePage(1),ViewerApp.mediator.trigger("main:onMovedPage")},onLeftbar:function(e){!1!==Meclib.Function.isAutoflipPageMovable()&&(!0===Meclib.Mode.crop&&ViewerApp.mediator.trigger("crop:endCropMode"),Meclib.Function.postParent("movestart"),ViewerApp.mediator.trigger("main:moveLeftPage"))},onRightbar:function(e){!1!==Meclib.Function.isAutoflipPageMovable()&&(!0===Meclib.Mode.crop&&ViewerApp.mediator.trigger("crop:endCropMode"),Meclib.Function.postParent("movestart"),ViewerApp.mediator.trigger("main:moveRightPage"))},updatePage:function(){Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1&&window.getSelection().removeAllRanges(),$("#input-targetpage").val(Meclib.Globals.book.getPageName(Meclib.Globals.book.currentPage));var e=0;arguments.length>0&&(e=arguments[0]),ViewerApp.mediator.trigger("main:updateDisplayParts"),e>0?"MAINTE"===Meclib.Setting.type?3===e||(ViewerApp.mediator.trigger("canvas:initScale"),ViewerApp.mediator.trigger("canvas:canvasInitFlip"),$("#page-area").css({left:0,top:0,"-moz-transform":"","-webkit-transform":"","-o-transform":"","-ms-transform":""})):(0===Meclib.Globals.book.zoomPageMove||1===Meclib.Globals.viewer.get("scale")&&1===Meclib.zoomScale)&&($("#page-area").css({left:0,top:0,"-moz-transform":"","-webkit-transform":"","-o-transform":"","-ms-transform":""}),ViewerApp.mediator.trigger("canvas:initScale"),ViewerApp.mediator.trigger("canvas:canvasInitFlip")):(ViewerApp.mediator.trigger("canvas:canvasInitFlip"),(!1===Meclib.Function.isSideMenuOpened()||1===Meclib.Globals.viewer.get("scale"))&&$("#page-area").css({left:0,top:0,"-moz-transform":"","-webkit-transform":"","-o-transform":"","-ms-transform":""})),$("#page-area").data("ui-draggable")&&$("#page-area").stop().draggable("destroy");var i=Meclib.Globals.viewer.get("scale");4==i&&(i=2),6==i&&(i=4),1!=Meclib.zoomScale&&Meclib.zoomScale!=Meclib.Globals.book.thumbWidth*i/Meclib.Globals.bookCanvas.drawWidth?ViewerApp.mediator.trigger("canvas:pinchCanvasReload"):ViewerApp.mediator.trigger("canvas:drawCanvas"),"MAINTE"!==Meclib.Setting.type&&1!==Meclib.defaults.embed&&Backbone.history.navigate("target/page_no="+Meclib.Globals.book.currentPage,!1),ViewerApp.mediator.trigger("footer:changeZoomIcon"),ViewerApp.mediator.trigger("contents:clear"),setTimeout((function(){ViewerApp.mediator.trigger("contents:showContents"),ViewerApp.mediator.trigger("page:updateCompleted")}),500),!1===Meclib.PageSlider.selected&&ViewerApp.mediator.trigger("footer:updatePageSlider"),ViewerApp.mediator.trigger("contents:endEditMode"),Meclib.Page=Meclib.Function.getCssVal("#page-area")},launchCompete:function(){},donwload2Bookshelf:function(e){location.href=Meclib.Function.getAppDownloadPath()},checkBookState:function(){$("#header").hide(),$("#footer").hide();var e=0;if(1===arguments.length&&(e=arguments[0]),e>200)Meclib.Debug.log("erro timeout",2);else{e++;var i=this;if(!1===Meclib.Globals.book.loadImageCompleteFlg||!1===Meclib.Initial.pagenumInclude)setTimeout((function(){i.checkBookState(e)}),100);else{if(Meclib.Function.hideLoader(),"MAINTE"!==Meclib.Setting.type&&!1===Meclib.Function.isMac()&&"LOCAL"!==Meclib.Setting.type&&-1==Meclib.Globals.ua.search("iPhone")&&-1==Meclib.Globals.ua.search("iPad")&&-1===Meclib.Globals.ua.search("Android")){var t=Meclib.Lists.PersistentSettingList.findWhere({name:"device_mode"});if(void 0!==t&&"sd"===t.get("value")&&1===parseInt(Meclib.Globals.book.publicSettings[0],10)&&0===parseInt(Meclib.Globals.book.publicSettings[1],10))return t.set({value:"pc"}),t.save(),setTimeout((function(){location.reload()}),500),!1}if(1!==Meclib.Globals.book.public){var o=location.href,a="/"+Meclib.Globals.book.bookId+"/book",l=new RegExp(a);if(!0===l.test(o)||0===Meclib.Globals.book.publishType){ViewerApp.mediator.trigger("contents:hideAll");var n=Meclib.Message.common.nopublic;return n=n.replace("
    ",""),$("title").html(n),$(".header-title").html(n),new Messi(Meclib.Message.common.nopublic,{center:!0,animate:!1,padding:"30px",closeButton:!1,width:Meclib.Size.MessiWidth+10,callback:function(e){ViewerApp.mediator.trigger("contents:showAll")}}),!1}return $.ajax({type:"GET",url:"../config/stat/registered"}).done((function(e){ViewerApp.mediator.trigger("main:start")})).fail((function(){ViewerApp.mediator.trigger("contents:hideAll"),new Messi(Meclib.Message.common.nopublic,{center:!0,animate:!1,padding:"30px",closeButton:!1,width:Meclib.Size.MessiWidth+10,callback:function(e){ViewerApp.mediator.trigger("contents:showAll")}})})),!1}ViewerApp.mediator.trigger("main:start")}}},start:function(){Meclib.Setting.enabled=!0,$("#header").show(),$("#footer").show(),Meclib.Function.setFooterPosition(),$("#header").show(),$("#footer").show(),Meclib.Function.setFooterPosition(),this.initBook(),Meclib.Globals.bookCanvas.resize(),Meclib.Property.startTime=(new Date).getTime(),1===Meclib.Globals.viewer.get("device")&&(Meclib.Function.initTooltips(),$("#allpage-no").text(Meclib.Globals.book.totalPage)),Meclib.UserAnalytics.init(),1===Meclib.Globals.book.analytics_flg&&Meclib.analytics.init(Meclib.Globals.book.gaMeasurementId,Meclib.Globals.book.webpropertyid),ViewerApp.mediator.trigger("main:resize"),ViewerApp.mediator.trigger("sidenavi:load"),ViewerApp.mediator.trigger("menu:render"),ViewerApp.mediator.trigger("menu:initPageList"),ViewerApp.mediator.trigger("canvas:update"),ViewerApp.mediator.trigger("book:complete"),ViewerApp.mediator.trigger("browsinghistory:save"),ViewerApp.mediator.trigger("menu:checkEnableMenu"),ViewerApp.mediator.trigger("main:updateDisplayParts"),""===Meclib.defaults.keyword&&1===Meclib.Globals.book.bookindexLaunch&&"MAINTE"!==Meclib.Setting.type&&1===Meclib.Globals.viewer.get("optionIncludes").bookindex?setTimeout((function(){ViewerApp.mediator.trigger("menu:open","catalogIndex")}),1e3):(1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay||Meclib.Globals.viewer.get("device")>1)&&setTimeout((function(){ViewerApp.mediator.trigger("menu:closeMainMenu")}),2e3),1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay&&($("#header").addClass("transparent"),$("#footer").addClass("transparent"));var e=1;if(""!==Meclib.defaults.pageName?e=Meclib.Globals.book.getPageFileNo(Meclib.defaults.pageName):0!==Meclib.defaults.pageNo&&(e=Meclib.defaults.pageNo),0===e&&(e=1),Meclib.UserAnalytics.add("move_first",e,""),Meclib.analytics.sendMove(e,!0),this.movePage(e),Meclib.Initial.book=1,Meclib.Function.hideLoader(),ViewerApp.mediator.trigger("bookinfo:ready"),"PREVIEW"===Meclib.Setting.type&&Meclib.Function.popupMessage(Meclib.SystemMessage.prev_popup,"FADEOUT"),Meclib.Function.setLogo(),1===Meclib.Globals.viewer.get("device")&&ViewerApp.mediator.trigger("externalapi:draw"),ViewerApp.mediator.trigger("footer:initPageSlider"),ViewerApp.mediator.trigger("footer:updatePageSlider"),ViewerApp.mediator.trigger("highlight:load"),ViewerApp.mediator.trigger("canvas:loadX1Image"),Meclib.Function.postParent("complete"),Meclib.API.onLoad(),$(".video-obj,.audio-obj").hover((function(e){window.clearInterval(Meclib.Timer.mouse),Meclib.Function.hideMouseTip()}),(function(e){})),1==Meclib.defaults.autoflip){var i=0;i=0===Meclib.Globals.book.pageOpenDir?1:0,setTimeout((function(){ViewerApp.mediator.trigger("autoflip:play",i)}),2e3)}""!==Meclib.Globals.errorCode&&(Meclib.Message.error[Meclib.Globals.errorCode]&&new Messi(Meclib.Message.error[Meclib.Globals.errorCode],{center:!0,animate:!1,width:Meclib.Size.MessiWidth,modal:!0,buttons:[{id:0,label:Meclib.Message.common.ok,val:null}],callback:function(){}}),Meclib.Globals.errorCode="")},openHelp:function(){var e="";e=Meclib.Globals.viewer.get("device")>1?"./help/sd/index.html":"./help/pc/index.html",window.open(e)},onMouseMove:function(e){if(1!==Meclib.Event.type||Meclib.Globals.viewer.get("device")>1)$("#canvas-leftpage,#canvas-rightpage,#txtcopy-layer").css({cursor:"default"});else{if(1===Meclib.Globals.viewer.get("device")&&!0===Meclib.MainMenu.overlay&&(Meclib.Globals.bookCanvas.varticalSpace>=e.pageY||Meclib.Globals.bookCanvas.canvasHeight-Meclib.Globals.bookCanvas.varticalSpace<=e.pageY)&&ViewerApp.mediator.trigger("menu:openMainMenu"),jQuery(":hover").filter(".ev-flipping-obj").length>0)return window.clearInterval(Meclib.Timer.mouse),void Meclib.Function.hideMouseTip();if(Meclib.Canvas.selected>0||Meclib.Canvas.zoomDragged)return window.clearInterval(Meclib.Timer.mouse),void Meclib.Function.hideMouseTip();if(!0===Meclib.Mode.autoflipping||!0===Meclib.Mode.crop||!0===Meclib.Mode.txtcopy&&!0===Meclib.Txtcopy.mode.select)return window.clearInterval(Meclib.Timer.mouse),Meclib.Function.hideMouseTip(),void $("#canvas-leftpage,#canvas-rightpage,#txtcopy-layer").css({cursor:"default"});if((jQuery(":hover").filter("#canvas-leftpage").length>0||jQuery(":hover").filter("#canvas-rightpage").length>0||jQuery(":hover").filter("#txtcopy-layer").length>0)&&"MAINTE"!==Meclib.Setting.type){if(window.clearInterval(Meclib.Timer.mouse),Meclib.Function.hideMouseTip(),jQuery(":hover").filter(".comment-obj,.link-obj,.embed-obj,.news-obj,.video-obj,.audio-obj").length>0)return;Meclib.Globals.viewer.get("scale")>=Meclib.Globals.book.zoomMax?Meclib.Globals.ua.toLocaleLowerCase().indexOf("msie")>-1||Meclib.Globals.ua.toLocaleLowerCase().match(/trident/)||Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1?$("#canvas-leftpage,#canvas-rightpage,#txtcopy-layer").css({cursor:"url(./common/img/parts/common/cursor_zoom_out.cur),auto"}):$("#canvas-leftpage,#canvas-rightpage,#txtcopy-layer").css({cursor:"url(./common/img/parts/common/cursor_zoom_out.png),default"}):!1===Meclib.Function.isZoomabled()?(Meclib.Function.hideMouseTip(),$("#canvas-leftpage,#canvas-rightpage,#txtcopy-layer").css({cursor:"default"})):Meclib.Globals.ua.toLocaleLowerCase().indexOf("msie")>-1||Meclib.Globals.ua.toLocaleLowerCase().match(/trident/)||Meclib.Globals.ua.toLocaleLowerCase().search("edge/")>-1?$("#canvas-leftpage,#canvas-rightpage,#txtcopy-layer").css({cursor:"url(./common/img/parts/common/cursor_zoom_in.cur),auto"}):$("#canvas-leftpage,#canvas-rightpage,#txtcopy-layer").css({cursor:"url(./common/img/parts/common/cursor_zoom_in.png),default"}),Meclib.Timer.mouse=window.setTimeout((function(){Meclib.Function.checkMouseStop(e)}),500)}else $("#canvas-leftpage,#canvas-rightpage,#txtcopy-layer").css({cursor:"default"})}}}),ViewerApp.App=Backbone.View.extend({el:"#body",tmpl:ViewerApp.Templates.layout,events:{resize:"resize"},initialize:function(){_.extend(ViewerApp.mediator,Backbone.Events),this.fusenPanelView=new ViewerApp.Views.FusenPanelView,this.sideMenuView=new ViewerApp.Views.SideMenuView,this.sideNaviView=new ViewerApp.Views.SideNaviView,this.headerView=new ViewerApp.Views.HeaderView,this.footerView=new ViewerApp.Views.FooterView,this.optionMenuView=new ViewerApp.Views.OptionMenuView,this.autoFlipView=new ViewerApp.Views.AutoFlipView,this.contentsView=new ViewerApp.Views.ContentsView,this.canvasDrawView=new ViewerApp.Views.CanvasDrawView,this.cenvasMouseEvevtView=new ViewerApp.Views.CenvasMouseEvevtView,this.cenvasMouseWheelEvevtView=new ViewerApp.Views.CenvasMouseWheelEvevtView,this.CenvasTouchPointerEvevtView=new ViewerApp.Views.CenvasTouchPointerEvevtView,this.CenvasPointerEvevtView=new ViewerApp.Views.CenvasPointerEvevtView,this.CenvasTouchEvevtView=new ViewerApp.Views.CenvasTouchEvevtView,this.CenvasPinchView=new ViewerApp.Views.CenvasPinchView,this.CenvasTapView=new ViewerApp.Views.CenvasTapView,this.CenvasSwipeView=new ViewerApp.Views.CenvasSwipeView,this.CenvasDragView=new ViewerApp.Views.CenvasDragView,this.externalApiView=new ViewerApp.Views.ExternalApiView,this.textSearchView=new ViewerApp.Views.TextSearchView,this.highlightView=new ViewerApp.Views.HighlightView,this.txtcopyView=new ViewerApp.Views.TxtcopyView,this.pageMoveView=new ViewerApp.Views.PageMoveView,this.printView=new ViewerApp.Views.PrintView,this.productsView=new ViewerApp.Views.ProductsView,this.pdfView=new ViewerApp.Views.PdfView,this.memoView=new ViewerApp.Views.MemoView,this.bookIndexView=new ViewerApp.Views.BookIndexView,this.bookLinkView=new ViewerApp.Views.BookLinkView,this.linkView=new ViewerApp.Views.LinkView,this.NewsView=new ViewerApp.Views.NewsView,this.CropView=new ViewerApp.Views.CropView,this.MovieView=new ViewerApp.Views.MovieView,this.MovieView=new ViewerApp.Views.EmbedView,this.PageListView=new ViewerApp.Views.PageListView,this.PageSearchView=new ViewerApp.Views.PageSearchView,this.BrowsingHistoryView=new ViewerApp.Views.BrowsingHistoryView,this.CommentView=new ViewerApp.Views.CommentView,this.BookInfoView=new ViewerApp.Views.BookInfoView,this.mainView=new ViewerApp.Views.MainView;var e=!1;$(window).on("orientationchange resize",(function(){!1!==e&&clearTimeout(e),e=setTimeout((function(){ViewerApp.mediator.trigger("main:resize")}),800)})),$(window).on("scroll",(function(e){if(Meclib.Globals.ua.search("iPhone")>-1||Meclib.Globals.ua.search("iPad")>-1||Meclib.Function.isIOSDesctopMode()){if(1!=$(":focus").length||"TEXTAREA"!=$(":focus").get(0).tagName&&"INPUT"!=$(":focus").get(0).tagName)return $("body").animate({scrollTop:0},1),!0===Meclib.Globals.searchScrollMode||Meclib.Globals.ua.search("iPhone")>-1&&Meclib.Globals.ua.search("OS 8_")>-1&&ViewerApp.mediator.trigger("main:resize"),!1;$(":focus").unbind("blur"),$(":focus").on("blur",(function(e){$("body").animate({scrollTop:0},1)}))}1===Meclib.Globals.viewer.get("device")&&0!==$(this).scrollTop()&&$("body").animate({scrollTop:0},1)})),ViewerApp.mediator.trigger("app:load"),Meclib.Globals.book.loadInit(Meclib.Function.ready),document.addEventListener("MSFullscreenChange",(function(e){document.msFullscreenElement?!document.msFullscreenElement||"VIDEO"!=document.msFullscreenElement.nodeName&&"IFRAME"!=document.msFullscreenElement.nodeName?Meclib.Fullscreen.videoMax=!1:Meclib.Fullscreen.videoMax=!0:Meclib.Fullscreen.videoMax=!1})),$(document).on({"fullscreenchange webkitfullscreenchange":function(e){var i=!0;void 0!==document.fullscreenEnabled?i=document.fullscreenEnabled:void 0!==document.webkitIsFullScreen&&(i=document.webkitIsFullScreen),!0===i?Meclib.Fullscreen.videoMax=!0:setTimeout((function(){Meclib.Fullscreen.videoMax=!1}),3e3)}},"video,iframe")}}),$((function(){Meclib.Function.meclibStart()})),Meclib.Debug.log=function(e,i){Meclib.Debug.level>0&&(-1!=Meclib.Globals.ua.indexOf("Chrome")&&"string"==typeof e?1===i?console.log("%cdebug%c "+e,"padding:1px 5px 1px 5px;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;color:#fff;background:#2b95ff;","color:#303030"):2===i?console.log("%cdebug%c "+e,"padding:1px 5px 1px 5px;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;color:#fff;background:#ff55aa;","color:#303030"):console.log(e):console.log(e))},Meclib.Debug.info=function(e){Meclib.Globals.ua.search("Chrome")>-1&&"string"==typeof e?console.log("%cdebug%c "+e,"padding:1px 5px 1px 5px;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;color:#fff;background:#2b95ff;","color:#303030"):Meclib.Globals.ua.search("Chrome")>-1&&"object"==typeof e?console.log(JSON.parse(JSON.stringify(e))):console.log(e)},function(e){var i={width:0,height:0,width_unit:0,height_unit:0,x:0,y:0,contentsType:""},t={width:0,height:0},o=34,a=34,l=0,n=-5,c=e("");c.addClass("btn-popup-close");var s=e("
    "),r=e("
    "),g=e("