1function ActivityEachDay(e){if((this.opt=e=$.extend({},{showCLose:!0,isEaseClose:!0,className:"",endDate:"",isEachDay:!0},e),""!=e.endDate)&&new Date(Date.parse(e.endDate.replace(/-/g,"/"))).getTime()<(new Date).getTime())return null;this.init(e)}function AddVideoPanel(e){var t;e=$.extend({},{type:"youtube",id:"",title:"",desc:"",thumbnail:"",videoGalleryPanel:null,videoItem:null},e),this.options=e,this.panel=$("<div class='cc-light-box-content-panel-gray cc-text-left'></div>"),this.typeGroup=$("<div class='cc-input-group'></div>"),this.typeLabel=$("<label class='cc-label cc-advanced-add-video-label'>Video Type</label>"),this.typeSelect=$("<select class='cc-field cc-select'></select>"),this.typeSelect.append("<option value='youtube'>Youtube</option>").append("<option value='vimeo'>Vimeo</option>"),this.typeSelect.val(e.type),this.idGroup=$("<div class='cc-input-group'></div>"),this.idLabel=$("<label class='cc-label cc-advanced-add-video-label'>Video ID</label>"),this.idInput=$("<input type='text' class='cc-field cc-input-text' value='"+e.id+"'>"),this.idGetButton=$("<span class='button-pure button-pure-blue cc-margin-left-20 cc-button-fix'>Get Video Info</span>"),this.helpGroup=$("<div class='cc-input-group-xs'></div>"),this.helpLabel=$("<label class='cc-label cc-advanced-add-video-label'></label>"),this.helpMessage=$("<span class='cc-error'></span>"),this.titleGroup=$("<div class='cc-input-group'></div>"),this.titleLabel=$("<label class='cc-label cc-advanced-add-video-label'>Title</label>"),this.titleInput=$("<input type='text' class='cc-field cc-input-text' value='"+e.title+"'>"),this.descGroup=$("<div class='cc-input-group cc-float-fix'></div>"),this.descLabel=$("<label class='cc-label cc-advanced-add-video-label cc-left'>Description</label>"),this.descInput=$("<textarea type='text' class='cc-field cc-textarea cc-left'>"+e.desc+"</textarea>"),this.thumbnailGroup=$("<div class='cc-input-group cc-float-fix'></div>"),this.thumbnailLabel=$("<label class='cc-label cc-advanced-add-video-label cc-left'>Thumbnail</label>"),this.thumbnailContainer=$("<span class='cc-advanced-add-video-image-container cc-left cc-input-shadow'></span>"),t=e.thumbnail.match("files/extfile")?"https://"+fh5.AS3BucketName+"/"+fh5.uLink+"/"+e.bLink+"/"+e.thumbnail:e.thumbnail,this.thumbnailImg=$("<img src='"+t+"'>"),this.thumbnailProgress=$("<div class='cc-img-upload-progress progress progress-info progress-striped active cc-hide'></div>"),this.thumbnailProgressBar=$("<div class='bar'></div>"),this.thumbnailUploadInfo=$("<ul class='cc-left'></ul>"),this.thumbnailTip=$("<li class='cc-tips'>"+fh5.pageData.tips.ImageFormats+" (150 X 150)</li>"),this.thumbnailErrorZone=$("<li class='cc-error-color cc-advanced-about-logo-upload-error'></li>"),this.thumbnailUploadButton=$("<li class='cc-hidden-input-wrapper button-pure'>Upload new image</li>"),this.thumbnailFileInput=$("<input class='cc-hidden-input' type='file' id='about-logo-image' accept='image/png,image/jpeg'/>"),this.buttons=$("<ul class='cc-light-box-buttons-gray'></ul>"),this.addButton=$("<li class='button-pure button-pure-green'>Add</li>"),this.cancelButton=$("<li class='button-pure'>Cancel</li>"),this.saveButton=$("<li class='button-pure button-pure-green'>Save</li>"),(e.videoItem&&0<e.videoItem.length?this.buttons.append(this.saveButton):this.buttons.append(this.addButton)).append(this.cancelButton),this.lightBox=new LightBox("Video Gallery","Enter a Youtube or Vimeo video ID. Press Enter or click the Button to get the video info.","auto","gray"),this.lightBox.getBox().append(this.panel.append(this.typeGroup.append(this.typeLabel).append(this.typeSelect)).append(this.idGroup.append(this.idLabel).append(this.idInput).append(this.idGetButton)).append(this.helpGroup.append(this.helpLabel).append(this.helpMessage)).append(this.titleGroup.append(this.titleLabel).append(this.titleInput)).append(this.descGroup.append(this.descLabel).append(this.descInput)).append(this.thumbnailGroup.append(this.thumbnailLabel).append(this.thumbnailContainer.append(this.thumbnailImg).append(this.thumbnailProgress.append(this.thumbnailProgressBar))).append(this.thumbnailUploadInfo.append(this.thumbnailTip).append(this.thumbnailUploadButton.append(this.thumbnailFileInput)).append(this.thumbnailErrorZone)))).append(this.buttons),this.lightBox.launch(),this.idInput.focus(),utils.autoFit(this.thumbnailContainer,this.thumbnailImg),this.thumbnailUploading=!1;var n=this;this.cancelButton.on("click",this.lightBox.cancel.bind(this.lightBox)),this.idGetButton.on("click",this.getVideoInfo.bind(this)),this.idInput.on("keypress",function(e){13==e.which&&n.getVideoInfo()}),this.idInput.on("blur",function(e){n.validate()}),this.addButton.on("click",this.add.bind(this)),this.saveButton.on("click",this.save.bind(this)),this.thumbnailFileInput.fileupload({url:"/upload-control/index.php",dropZone:null,pasteZone:null,formAcceptCharset:"utf-8",dataType:"json",context:n,add:function(e,t){var i,a=t.files[0],o=t.originalFiles[0],o=o.name.substr(0,o.name.lastIndexOf(".")),a=a.name.substr(a.name.length-3).toLowerCase();n.thumbnailErrorZone.empty(),o.match(/[\u4E00-\u9FA5]/)?i=fh5.pageData.tips.ChineseError:"jpg"!==a&&"png"!==a&&(i=fh5.pageData.tips.ImageFormatsError),i?n.thumbnailErrorZone.text(i):(n.thumbnailProgress.show(),n.thumbnailProgressBar.width(0),n.thumbnailUploading=!0,t.submit())},progress:function(e,t){n.thumbnailProgressBar.width(parseInt(t.loaded/t.total*100,10)+"
1%")},done:function(e,t){t=t.result.files[0];t.error?n.thumbnailErrorZone.text(fh5.pageData.tips.UnexpectedError):(n.thumbnailImg.attr("src",utils.pasreHttps(t.url)),utils.autoFit(n.thumbnailContainer,n.thumbnailImg,function(){n.thumbnailProgress.hide(),n.thumbnailProgressBar.width(0)})),n.thumbnailUploading=!1}})}function AdvancedSection(e){this.options=e;var t,i,a,o=(new Date).getTime(),n=(this.options.bookConfig,["Main","Toolbar","Branding","Gallery"]),s=fh5.pageData.languages;for(this.section=$("<li data-name='Advanced' class='cc-section cc-hide cc-black-color cc-float-fix' data-height='"+e.height+"'></li>"),this.sectionContent=$("<div class='cc-section-content'></div>"),e.isNew&&this.section.addClass("cc-section-new"),this.loading=$("<div class='cc-advanced-loading cc-mask cc-hide'>Loading Settings...</div>"),this.subCaptions=$("<ul class='cc-sub-captions'></ul>"),t=0,i=n.length;t<i;t++)0==t?this.subCaptions.append($("<li class='cc-sub-captions-title cc-sub-active'>"+n[t]+"</li>")):this.subCaptions.append($("<li class='cc-sub-captions-title'>"+n[t]+"</li>"));for(this.subSections=$("<ul class='cc-sub-sections'></ul>"),this.mainSection=$("<li class='cc-sub-section'></li>"),this.mode=$("<div class='cc-input-group'></div>"),this.modeLabel=$("<label class='cc-label cc-advanced-main-label'>Toolbar View Mode</label>"),this.standardModeRadio=$("<input checked type='radio' value='Standard' name='mode"+o+"' id='Standard"+o+"'>"),this.standardModeLabel=$("<label class='cc-advanced-mode-label' for='Standard"+o+"'> Standard Mode</label>"),this.liteModeRadio=$("<input type='radio' value='Lite' name='mode"+o+"' id='Lite"+o+"'>
1"),this.liteModeLabel=$("<label class='cc-advanced-mode-label' for='Lite"+o+"'> Lite Mode</label>"),this.background=$("<div class='cc-input-group cc-float-fix'></div>"),this.backgroundLabel=$("<label class='cc-label cc-advanced-main-label cc-left'>Background</label>"),this.backgroundField=$("<span class='cc-left'></span>"),this.backgroundColorgroup=$("<div class='cc-input-group cc-float-fix'></div>"),this.backgroundColorRadio=$("<input class='cc-left' type='radio' id='backgroundColor"+o+"' name='background"+o+"' value='color' checked></input>"),this.backgroundColorLabel=$("<label class='cc-advanced-main-background-sub-label cc-left' for='backgroundColor"+o+"'> Background Color</label>"),this.backgroundColorContainer=$("<span class='cc-background-color-container cc-left cc-input-shadow'></span>"),this.backgroundGradientColorGroup=$("<ul class='cc-left'></ul>"),this.backgroundGradientStartColor=$("<li class='cc-input-group-s'></li>"),this.backgroundGradientStartColorLabel=$("<label class='cc-advanced-main-background-sub-label-2'>Start</label>"),this.backgroundGradientStartColorInput=$("<input type='text'></input>"),this.backgroundGradientEndColor=$("<li class='cc-input-group-s'></li>"),this.backgroundGradientEndColorLabel=$("<label class='cc-advanced-main-background-sub-label-2'>End</label>"),this.backgroundGradientEndColorInput=$("<input type='text'></input>"),this.backgroundGradientAngle=$("<li class='cc-input-group-s'></li>"),this.backgroundGradientAngleLabel=$("<label class='cc-advanced-main-background-sub-label-2'>Rotation</label>"),this.backgroundGradientAngleInput=$("<input class='cc-input-text cc-advanced-input' type='number'></input>"),this.backgroundImageGroup=$("<div class='cc-input-group cc-float-fix'></div>"),this.backgroundImageRadio=$("<input class='cc-left' type='radio' id='backgroundImage"+o+"' name='background"+o+"' value='image'></input>"),this.backgroundImageLabel=$("<label class='cc-advanced-main-background-sub-label cc-left' for='backgroundImage"+o+"'> Background Image</label>"),this.backgroundImageContainer=$("<span class='cc-background-image-container cc-left cc-input-shadow'></span>"),this.backgroundImageImg=$("<img src=''>"),this.backgroundImageProgress=$("<div class='cc-img-upload-progress progress progress-info progress-striped active cc-hide'></div>"),this.backgroundImageProgressBar=$("<div class='bar'></div>"),this.backgroundImageUploadInfo=$("<ul class='cc-left'></ul>"),this.backgroundImageTips=$("<li class='cc-tips'>"+fh5.pageData.tips.ImageFormats+"</li>"),this.backgroundImageUploadButton=$("<li class='cc-hidden-input-wrapper button-pure'>Upload new image</li>"),this.backgroundImageFileInput=$("<input class='cc-hidden-input' type='file' id='background-image' accept='image/png,image/jpeg'></span>"),this.backgroundImageErrorZone=$("<li class='cc-error-color cc-background-image-upload-error'></li>"),this.loadingCaptionGroup=$("<div class='cc-input-group'></div>"),this.mainLoadingLabel=$("<label class='cc-label cc-advanced-main-label'>Loading Caption</label>"),this.mainLoadingCaptionTextInput=$("<input class='cc-input-text cc-advanced-input' type='text'></input>"),this.loadingCaptionColorLabel=$("<label class='cc-advanced-main-label-2'>Caption Color</label>"),this.loadingCaptionColorInput=$("<input type='text'></input>"),this.enableAutoFlip=$("<div class='cc-input-group'></div>"),this.enableAutoFlipLabel=$("<label class='cc-label cc-advanced-main-label'>Auto Flip On Start</label>"),this.enableAutoFlipSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.fillSelect(this.enableAutoFlipSelect),this.enableFlipSoundLabel=$("<label class='cc-label cc-advanced-main-label-2'>Flip Sound</label>"),this.enableFlipSoundSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.fillSelect(this.enableFlipSoundSelect),this.enableRightToLeft=$("<div class='cc-input-group'></div>"),this.enableRightToLeftLabel=$("<label class='cc-label cc-advanced-main-label'>Flip Right To Left</label>"),this.enableRightToLeftSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.fillSelect(this.enableRightToLeftSelect),this.enableHardCoverLabel=$
1("<label class='cc-label cc-advanced-main-label-2'>Hard Cover</label>"),this.enableHardCoverSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.fillSelect(this.enableHardCoverSelect),this.enablePageButton=$("<div class='cc-input-group'></div>"),this.enablePageButtonLabel=$("<label class='cc-label cc-advanced-main-label'>Page Turning Button</label>"),this.enablePageButtonSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.fillSelect(this.enablePageButtonSelect),this.enableQRCodeLabel=$("<label class='cc-label cc-advanced-main-label-2'>QRCode</label>"),this.enableQRCodeSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.fillSelect(this.enableQRCodeSelect),this.enableMouseWheel=$("<div class='cc-input-group'></div>"),this.enableMouseWheelLabel=$("<label class='cc-label cc-advanced-main-label'>MouseWheel Flip</label>"),this.enableMouseWheelSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.fillSelect(this.enableMouseWheelSelect),this.enableAutoCenterLabel=$("<label class='cc-label cc-advanced-main-label-2'>Auto Center</label>"),this.enableAutoCenterSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.fillSelect(this.enableAutoCenterSelect),this.google=$("<div class='cc-input-group'></div>"),this.googleLabel=$("<label class='cc-label cc-advanced-main-label'>Google Analytics ID</label>"),this.googleInput=$("<input class='cc-input-text cc-advanced-input' type='text'></input>"),this.enableLooseLeafLabel=$("<label class='cc-label cc-advanced-main-label-2'>Loose Leaf</label>"),this.enableLooseLeafSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.fillSelect(this.enableLooseLeafSelect),this.hideFullscreen=$("<div class='cc-input-group'></div>"),this.hideFullscreenlLabel=$("<label class='cc-label cc-advanced-main-label hideFullscreen'>Hide Mini Fullscreen Hint</label>
1"),this.hideFullscreenlSelect=$("<select class='cc-select cc-advanced-select hideFullscreen'></select>"),this.fillSelect(this.hideFullscreenlSelect),this.rightClickscreen=$("<div class='cc-input-group'></div>"),this.rightClickscreenLabel=$("<label class='cc-label cc-advanced-main-label rightClickscreen'>Right Click Context Menu</label>"),this.rightClickscreenSelect=$("<select class='cc-select cc-advanced-select rightClickscreen'></select>"),this.fillSelect(this.rightClickscreenSelect),this.bookMargin=$("<div class='cc-input-group'></div>"),this.bookMarginLabel=$("<label class='cc-label cc-advanced-main-label'>Book Margin</label>"),this.bookMarginTopLabel=$("<label class='cc-advanced-main-margin-label'>Top</label>"),this.bookMarginTopInput=$("<input class='cc-input-text cc-advanced-input-2 cc-advanced-input-with-unit' type='number'>px</input>"),this.bookMarginRightLabel=$("<label class='cc-advanced-main-margin-label-2'>Right</label>"),this.bookMarginRightInput=$("<input class='cc-input-text cc-advanced-input-2 cc-advanced-input-with-unit' type='number'>px</input>"),this.bookMargin2=$("<div class='cc-input-group-xs'></div>"),this.bookMarginLabel2=$("<label class='cc-label cc-advanced-main-label'></label>"),this.bookMarginBottomLabel=$("<label class='cc-advanced-main-margin-label'>Bottom</label>"),this.bookMarginBottomInput=$("<input class='cc-input-text cc-advanced-input-2 cc-advanced-input-with-unit' type='number'>px</input>"),this.bookMarginLeftLabel=$("<label class='cc-advanced-main-margin-label-2'>Left</label>"),this.bookMarginLeftInput=$("<input class='cc-input-text cc-advanced-input-2 cc-advanced-input-with-unit' type='number'>px</input>"),this.shadow=$("<div class='cc-input-group'></div>"),this.shadowLabel=$("<label class='cc-label cc-advanced-main-label'>Shadow</label>"),this.shadowLeftWidthLabel=$("<label class='cc-advanced-main-shadow-label'>Width</label>"),this.shadowLeftWidthInput=$("<input class='cc-input-text cc-advanced-input-2 cc-advanced-input-with-unit' type='number'>px</input>"),this.shadowLeftAlphaLabel=$("<label class='cc-advanced-main-shadow-label-2'>Alpha</label>"),this.shadowLeftAlphaSelect=$("<select class='cc-select cc-advanced-main-shadow-alpha-select cc-advanced-input-with-unit'></select>"),this.shadowLeftLabel=$("<span>( Left )</span>"),this.shadow2=$("<div class='cc-input-group-xs'></div>"),this.shadowLabel2=$("<label class='cc-label cc-advanced-main-label'></label>"),this.shadowRightWidthLabel=$("<label class='cc-advanced-main-shadow-label'>Width</label>"),this.shadowRightWidthInput=$("<input class='cc-input-text cc-advanced-input-2 cc-advanced-input-with-unit' type='number'>px</input>"),this.shadowRightAlphaLabel=$("<label class='cc-advanced-main-shadow-label-2'>Alpha</label>"),this.shadowRightAlphaSelect=$("<select class='cc-select cc-advanced-main-shadow-alpha-select cc-advanced-input-with-unit'></select>"),this.shadowRightLabel=$("<span>( Right )</span>"),this.miniMode=$("<div class='cc-input-group'></div>"),this.miniModeLabel=$("<label class='cc-label cc-advanced-main-label'>Mini Mode Config</label>"),this.miniModeWidthLabel=$("<label class='cc-advanced-main-margin-label'>Max Width</label>"),this.miniModeWidthInput=$("<input class='cc-input-text cc-advanced-input-2 cc-advanced-input-with-unit' type='number'>px</input>"),this.miniModeHeightLabel=$("<label class='cc-advanced-main-margin-label-2'>Max Height</label>"),this.miniModeHeightInput=$("<input class='cc-input-text cc-advanced-input-2 cc-advanced-input-with-unit' type='number'>px</input>"),t=1;0<t;t=Math.round(10*(t-.1))/10)this.shadowLeftAlphaSelect.append($("<option value='"+t+"'>"+t+"</option>")),this.shadowRightAlphaSelect.append($("<option value='"+t+"'>"+t+"</option>"));for(this.bookLanguage=$("<div class='cc-input-group'></div>"),this.bookLanguageLabel=$("<label class='cc-label cc-advanced-main-label'>Book Language</label>"),this.bookLanguageSelect=$("<select class='cc-select cc-advanced-select'></select>"),t=0,i=s.length;t<i;t++)this.bookLanguageSelect.append($("<option value='"+s[t]+"'>"+s[t]+"</option>"));this.flipSpeedLabel=$("<label class='cc-label cc-advanced-main-label-2'>Flip Speed</label>"),this.flipSpeedInput=$("<input class='cc-input-text cc-advanced-input cc-advanced-input-with-unit' type='number'>second(s)</input>"),this.SelectText=$("<div class='cc-input-group'></div>"),this.SelectTextLabel=$("<label class='cc-label cc-advanced-main-label'>Select Text Button</label>"),this.SelectTextSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.fillSelect(this.SelectTextSelect),this.PageUrlText=$("<div class='cc-input-group'></div>"),this.PageUrlTextLabel=$("<label class='cc-label cc-advanced-main-label hideFullscreen'>Show Page Number In URL</label>"),this.PageUrlTextSelect=$("<select class='cc-select cc-advanced-select hideFullscreen'></select>"),this.fillSelect(this.PageUrlTextSelect),this.toolbarSection=$("<li class='cc-sub-section cc-float-fix cc-hide'></li>"),this.toolbarStyling=$("<p class='cc-advanced-toolbar-title'>Toolbar Styling</p>
1"),this.toolbarBackgroundColorGroup=$("<div class='cc-input-group-s'></div>"),this.toolbarBackgroundColorLabel=$("<label class='cc-advanced-toolbar-styling-label'>Background Color</label>"),this.toolbarBackgroundColorInput=$("<input type='text'></input>"),this.toolbarButtonColorGroup=$("<div class='cc-input-group-s'></div>"),this.toolbarButtonColorLabel=$("<label class='cc-advanced-toolbar-styling-label'>Button Color</label>"),this.toolbarButtonColorInput=$("<input type='text'></input>"),this.toolbarPageNumFontColorGroup=$("<div class='cc-input-group-s'></div>"),this.toolbarPageNumFontColorLabel=$("<label class='cc-advanced-toolbar-styling-label'>Page Number Color</label>"),this.toolbarPageNumFontColorInput=$("<input type='text'></input>"),this.buttonsTitle=$("<p class='cc-advanced-toolbar-title cc-margin-top-10'>Visible Buttons</p>"),this.buttonGroup=$("<div class='cc-advanced-buttons cc-float-fix'></div>"),this.buttonContainer1=$("<div class='cc-advanced-button-container'></div>"),this.shareGroup=$("<div class='cc-input-group-m'></div>"),this.shareInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='share"+o+"' name='component'></input>"),this.shareLabel=$("<label class='cc-checkbox-label' for='share"+o+"'><i class='icon icon-heart'></i> Share</label>"),this.fullscreenGroup=$("<div class='cc-input-group-m'></div>"),this.fullscreenInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='fullscreen"+o+"' name='component'></input>"),this.fullscreenLabel=$("<label class='cc-checkbox-label' for='fullscreen"+o+"'><i class='icon icon-resize-full'></i> Fullscreen</label>"),this.thumbnailsGroup=$("<div class='cc-input-group-m'></div>"),this.thumbnailsInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='thumbnails"+o+"' name='component'></input>"),this.thumbnailsLabel=$("<label class='cc-checkbox-label' for='thumbnails"+o+"'><i class='icon icon-th'></i> Thumbnails</label>"),this.zoomGroup=$("<div class='cc-input-group-m'></div>"),this.zoomInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='zoom"+o+"' name='component'></input>
1"),this.zoomLabel=$("<label class='cc-checkbox-label' for='zoom"+o+"'><i class='icon icon-zoom-in'></i> Zoom</label>"),this.searchGroup=$("<div class='cc-input-group-m'></div>"),this.searchInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='search"+o+"' name='component'></input>"),this.searchLabel=$("<label class='cc-checkbox-label' for='search"+o+"'><i class='icon icon-search'></i> Search</label>"),this.printGroup=$("<div class='cc-input-group-m'></div>"),this.printInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='print"+o+"' name='component'></input>"),this.printLabel=$("<label class='cc-checkbox-label' for='print"+o+"'><i class='icon icon-print'></i> Print</label>"),this.bookmarkGroup=$("<div class='cc-input-group-m'></div>"),this.bookmarkInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='bookmark"+o+"' name='component'></input>"),this.bookmarkLabel=$("<label class='cc-checkbox-label' for='bookmark"+o+"'><i class='icon icon-bookmark'></i> Bookmark</label>"),this.annotationGroup=$("<div class='cc-input-group-m'></div>"),this.annotationInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='annotation"+o+"' name='component'></input>"),this.annotationLabel=$("<label class='cc-checkbox-label' for='annotation"+o+"'><i class='fa fa-calendar-o'></i> Annotation</label>"),this.buttonContainer2=$("<div class='cc-advanced-button-container'></div>"),this.homeGroup=$("<div class='cc-input-group-m'></div>"),this.homeInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='home"+o+"' name='component'></input>"),this.homeLabel=$("<label class='cc-checkbox-label cc-advanced-before-input-label' for='home"+o+"'><i class='icon icon-home'></i> Home</label>"),this.homeUrlInput=$("<input class='cc-input-text cc-advanced-url-input' type='text' placeholder='home link'></input>"),this.downloadGroup=$("<div class='cc-input-group-m'></div>"),this.downloadInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='download"+o+"' name='component'></input>"),this.downloadLabel=$("<label class='cc-checkbox-label cc-advanced-before-input-label' for='download"+o+"'><i class='icon icon-download-alt'></i> Download</label>"),this.downloadUrlInput=$("<input class='cc-input-text cc-advanced-url-input' type='text' placeholder='download link'></input>"),this.downloadDefaultBtn=$("<div>").addClass("button-pure").html("Link").css({position:"absolute",left:"487px",top:"4px",padding:"3px 6px"}),this.autoPlayGroup=$("<div class='cc-input-group-m'></div>"),this.autoPlayInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='autoPlay"+o+"' name='component'></input>"),this.autoPlayLabel=$("<label class='cc-checkbox-label' for='autoPlay"+o+"'><i class='icon icon-play'></i> Auto Play</label>"),this.autoPlayContentContainer=$("<div class='cc-advanced-toolbar-content-container cc-sub-color cc-hide'></div>"),this.autoPlayTimeGroup=$("<div class='cc-input-group-s'></div>"),this.autoPlayTimeLabel=$("<label class='cc-advanced-toolbar-content-label'>Flip Interval</label>"),this.autoPlayTimeInput=$("<input class='cc-input-text cc-advanced-input cc-advanced-input-with-unit' type='number'>second(s)</input>"),this.autoPlayLoopsGroup=$("<div class='cc-input-group-s'></div>"),this.autoPlayLoopsLabel=$("<label class='cc-advanced-toolbar-content-label'>Play Loops</label>"),this.autoPlayLoopsSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.fillLoopSelect(this.autoPlayLoopsSelect),this.tocGroup=$("<div class='cc-input-group-m'></div>"),this.tocInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='toc"+o+"' name='component'></input>"),this.tocLabel=$("<label class='cc-checkbox-label' for='toc"+o+"'><i class='icon icon-th-list'></i> Table Of Content</label>"),this.tocContentContainer=$("<div class='cc-advanced-toolbar-content-container cc-sub-color cc-hide'></div>"),this.tocBackgroundColorGroup=$("<div class='cc-input-group-s'></div>
1"),this.tocBackgroundColorLabel=$("<label class='cc-advanced-toolbar-bookmark-label'>Background Color</label>"),this.tocBackgroundColorInput=$("<input type='text'></input>"),this.tocFontColorGroup=$("<div class='cc-input-group-s'></div>"),this.tocFontColorLabel=$("<label class='cc-advanced-toolbar-bookmark-label'>Font Color</label>"),this.tocFontColorInput=$("<input type='text'></input>"),this.backgroundSoundGroup=$("<div class='cc-input-group-m'></div>"),this.backgroundSoundInput=$("<input class='cc-checkbox cc-advanced-button-checkbox' type='checkbox' id='backgroundSound"+o+"' name='component'></input>"),this.backgroundSoundLabel=$("<label class='cc-checkbox-label' for='backgroundSound"+o+"'><i class='icon icon-music'></i> Background Sound</label>"),this.backgroundSoundContentContainer=$("<div class='cc-advanced-toolbar-content-container cc-sub-color cc-hide'></div>"),this.backgroundSoundUploadGroup=$("<div class='cc-input-group-s'></div>"),this.backgroundSoundFileLabel=$("<label class='cc-advanced-toolbar-content-label'>Sound File</label>"),this.backgroundSoundFileTitle=$("<span class='cc-advanced-background-sound-file-title'>No file chosen</span>"),this.backgroundSoundUploadButton=$("<span class='cc-advanced-background-sound-upload-button cc-hidden-input-wrapper button-pure'>Upload new audio</span>"),this.backgroundSoundUploadInput=$("<input class='cc-hidden-input' type='file' id='background-sound' accept='audio/mp3'></span>"),this.backgroundSoundUploadingIcon=$("<span class='cc-advanced-background-sound-uploading cc-uploading cc-hide'></span>"),this.backgroundSoundUploadOk=$("<i class='cc-advanced-background-sound-upload-ok cc-success-color icon icon-ok cc-hide'></i>"),this.backgroundSoundUploadHelpGroup=$("<div></div>"),this.backgroundSoundUploadHelpLabel=$("<label class='cc-advanced-toolbar-content-label'></label>"),this.backgroundSoundUploadHelp=$("<span class='cc-advanced-background-sound-upload-help cc-error-color'></span>"),this.backgroundSoundLoopsGroup=$("<div class='cc-input-group-s'></div>"),this.backgroundSoundLoopsLabel=$("<label class='cc-advanced-toolbar-content-label'>Sound Loops</label>"),this.backgroundSoundLoopsSelect=$("<select class='cc-select cc-advanced-select'></select>"),this.backgroundSoundAudio=$("<audio class='cc-advanced-background-sound-audio cc-hide' controls='controls' src=''></audio>"),this.fillLoopSelect(this.backgroundSoundLoopsSelect),this.selectAllGroup=$("<div class='cc-input-group'></div>"),this.selectAllInput=$("<input class='cc-checkbox' type='checkbox' id='selectAll"+o+"' name='selectAll'></input>"),this.selectAllLabel=$("<label class='cc-checkbox-label cc-advanced-button-select-all-label' for='selectAll"+o+"'>Select All</label>"),this.brandingSection=$("<li class='cc-sub-section cc-hide'></li>"),this.logo=$("<div class='cc-input-group'></div>"),this.logoInput=$("<input class='cc-checkbox' type='checkbox' id='logo"+o+"' name='component'></input>"),this.logoLabel=$("<label class='cc-checkbox-label' for='logo"+o+"'> Show Logo</label>
1"),this.logoEventMask=$("<div class='cc-event-mask'></div>"),this.logoContentContainer=$("<div class='cc-advanced-content-container'></div>"),this.logoImageGroup=$("<div class='cc-input-group cc-float-fix'></div>"),this.logoImageLabel=$("<label class='cc-advanced-branding-sub-label cc-left'>Logo File</label>"),this.logoImageContainer=$("<span class='cc-advanced-logo-image-container cc-left'></span>"),this.logoImageImg=$("<img src=''>"),this.logoImageProgress=$("<div class='cc-img-upload-progress progress progress-info progress-striped active cc-hide'></div>"),this.logoImageProgressBar=$("<div class='bar'></div>"),this.logoImageUploadInfo=$("<ul class='cc-left'></ul>"),this.logoImageTip=$("<li class='cc-tips'>"+fh5.pageData.tips.ImageFormats+" (150 X 30)</li>"),this.logoImageUploadButton=$("<li class='cc-hidden-input-wrapper button-pure'>Upload new image</li>"),this.logoImageFileInput=$("<input class='cc-hidden-input' type='file' id='logo-image' accept='image/png,image/jpeg'></span>"),this.logoImageErrorZoneGroup=$("<div></div>"),this.logoImageErrorZoneLabel=$("<label class='cc-advanced-branding-sub-label'></label>"),this.logoImageErrorZone=$("<span class='cc-advanced-logo-upload-help cc-error-color'></span>"),this.logoPaddingGroup=$("<div class='cc-input-group'></div>"),this.logoPaddingLeftLabel=$("<label class='cc-advanced-branding-sub-label cc-margin-left'>Padding Left</label>"),this.logoPaddingLeftInput=$("<input class='cc-input-text cc-advanced-input' type='number'>"),this.logoPaddingTopLabel=$("<label class='cc-advanced-branding-sub-label cc-margin-left-20'>Padding Top</label>"),this.logoPaddingTopInput=$("<input class='cc-input-text cc-advanced-input' type='number'>"),this.logoUrlGroup=$("<div class='cc-input-group'></div>"),this.logoUrlLabel=$("<label class='cc-advanced-branding-sub-label'>Logo Link</label>"),this.logoUrlInput=$("<input class='cc-input-text cc-advanced-input' type='text'>"),this.logoHeightLabel=$("<label class='cc-advanced-branding-sub-label cc-margin-left-20'>Logo Height</label>"),this.logoHeightInput=$("<input class='cc-input-text cc-advanced-input' type='number'>"),this.about=$("<div class='cc-input-group cc-margin-top-10'></div>"),this.aboutInput=$("<input class='cc-checkbox' type='checkbox' id='about"+o+"' name='component'></input>"),this.aboutLabel=$("<label class='cc-checkbox-label' for='about"+o+"'> Show About Button</label>"),this.aboutContentContainer=$("<div class='cc-advanced-content-container'></div>"),this.aboutEmail=$("<div class='cc-input-group'></div>"),this.aboutEmailLabel=$("<label class='cc-advanced-branding-sub-label'>Email</label>"),this.aboutEmailInput=$("<input class='cc-input-text cc-input-text-m' type='text'>"),this.aboutMobile=$("<div class='cc-input-group'></div>"),this.aboutMobileLabel=$("<label class='cc-advanced-branding-sub-label'>Mobile</label>"),this.aboutMobileInput=$("<input class='cc-input-text cc-input-text-m' type='text'>"),this.aboutAddress=$("<div class='cc-input-group'></div>"),this.aboutAddressLabel=$("<label class='cc-advanced-branding-sub-label'>Address</label>"),this.aboutAddressInput=$("<input class='cc-input-text cc-input-text-m' type='text'>"),this.aboutWebsite=$("<div class='cc-input-group'></div>"),this.aboutWebsiteLabel=$("<label class='cc-advanced-branding-sub-label'>Website</label>"),this.aboutWebsiteInput=$("<input class='cc-input-text cc-input-text-m' type='text'>"),this.aboutDesc=$("<div class='cc-input-group cc-float-fix'></div>"),this.aboutDescLabel=$("<label class='cc-advanced-branding-sub-label cc-left'>Description</label>"),this.aboutDescInput=$("<textarea class='cc-textarea cc-advanced-branding-textarea cc-left'></textarea>"),this.aboutLogoGroup=$("<div class='cc-input-group cc-float-fix'></div>"),this.aboutLogoLabel=$("<label class='cc-advanced-branding-sub-label cc-left'>About Logo</label>"),this.aboutLogoContainer=$("<span class='cc-advanced-about-logo-image-container cc-left cc-input-shadow'></span>"),this.aboutLogoImg=$("<img src=''>"),this.aboutLogoProgress=$("<div class='cc-img-upload-progress progress progress-info progress-striped active cc-hide'></div>"),this.aboutLogoProgressBar=$("<div class='bar'></div>"),this.aboutLogoUploadInfo=$("<ul class='cc-left'></ul>"),this.aboutLogoTip=$("<li class='cc-tips'>"+fh5.pageData.tips.ImageFormats+" (150 X 150)</li>"),this.aboutLogoErrorZone=$("<li class='cc-error'></li>"),this.aboutLogoUploadButton=$("<li class='cc-hidden-input-wrapper button-pure'>Upload new image</li>"),this.aboutLogoFileInput=$("<input class='cc-hidden-input' type='file' id='about-logo-image' accept='image/png,image/jpeg'></span>"),this.reloadThemeSettingsContainer=$("<div class='cc-advanced-reset-to-default-container'></div>"),this.reloadThemeSettingsButton=$("<span class='button-pure'>Reload theme settings</span>"),this.gallerySection=$("<li class='cc-sub-section cc-hide'></li>"),this.videoGalleryGroup=$("<div class='cc-input-group'></div>"),this.videoGalleryInput=$("<input class='cc-checkbox' type='checkbox' id='videoGallery"+o+"' name='component'></input>"),this.videoGalleryLabel=$("<label class='cc-checkbox-label' for='videoGallery"+o+"'> Show Video Gallery Button</label>"),this.videoGalleryContentContainer=$("<div class='cc-advanced-content-container'></div>
1"),this.videoGalleryPanel=new VideoGalleryPanel(e.videoList,e.bLink),this.imageGalleryGroup=$("<div class='cc-input-group cc-margin-top-10'></div>"),this.imageGalleryInput=$("<input class='cc-checkbox' type='checkbox' id='imageGallery"+o+"' name='component'></input>"),this.imageGalleryLabel=$("<label class='cc-checkbox-label' for='imageGallery"+o+"'> Show Image Gallery Button</label>"),this.imageGalleryContentContainer=$("<div class='cc-advanced-content-container'></div>"),this.imageGalleryPanel=new ImageGalleryPanel(e.slideshow,e.bLink),this.backgroundColorStyle=$("<style></style>").appendTo($("head")),this.downloadDefaultBtn.on("click",function(){var e;"0"===fh5.uType?new UpgradePanel(fh5.pageData.upgrade.Download):""!=(e=self.options.BookEditPanel.options.bookId)&&(e=fh5.website.replace(/^https?/,"https")+"download/download-pdf-file.php?bookid="+e,self.downloadUrlInput.val(e))}),this.section.append(this.sectionContent.append(this.subCaptions).append(this.subSections.append(this.reloadThemeSettingsContainer.append(this.reloadThemeSettingsButton)).append(this.mainSection.append(this.mode.append(this.modeLabel).append(this.standardModeRadio).append(this.standardModeLabel).append(this.liteModeRadio).append(this.liteModeLabel)).append(this.background.append(this.backgroundLabel).append(this.backgroundField.append(this.backgroundColorgroup.append(this.backgroundColorRadio).append(this.backgroundColorLabel).append(this.backgroundColorContainer).append(this.backgroundGradientColorGroup.append(this.backgroundGradientStartColor.append(this.backgroundGradientStartColorLabel).append(this.backgroundGradientStartColorInput)).append(this.backgroundGradientEndColor.append(this.backgroundGradientEndColorLabel).append(this.backgroundGradientEndColorInput)).append(this.backgroundGradientAngle.append(this.backgroundGradientAngleLabel).append(this.backgroundGradientAngleInput)))).append(this.backgroundImageGroup.append(this.backgroundImageRadio).append(this.backgroundImageLabel).append(this.backgroundImageContainer.append(this.backgroundImageImg).append(this.backgroundImageProgress.append(this.backgroundImageProgressBar))).append(this.backgroundImageUploadInfo.append(this.backgroundImageTips).append(this.backgroundImageUploadButton.append(this.backgroundImageFileInput)).append(this.backgroundImageErrorZone))))).append(this.loadingCaptionGroup.append(this.mainLoadingLabel).append(this.mainLoadingCaptionTextInput).append(this.loadingCaptionColorLabel).append(this.loadingCaptionColorInput)).append(this.enablePageButton.append(this.enablePageButtonLabel).append(this.enablePageButtonSelect).append(this.enableQRCodeLabel).append(this.enableQRCodeSelect)).append(this.enableAutoFlip.append(this.enableAutoFlipLabel).append(this.enableAutoFlipSelect).append(this.enableFlipSoundLabel).append(this.enableFlipSoundSelect)).append(this.enableRightToLeft.append(this.enableRightToLeftLabel).append(this.enableRightToLeftSelect).append(this.enableHardCoverLabel).append(this.enableHardCoverSelect)).append(this.enableMouseWheel.append(this.enableMouseWheelLabel).append(this.enableMouseWheelSelect).append(this.enableAutoCenterLabel).append(this.enableAutoCenterSelect)).append(this.google.append(this.googleLabel).append(this.googleInput).append(this.enableLooseLeafLabel).append(this.enableLooseLeafSelect)).append(this.bookLanguage.append(this.bookLanguageLabel).append(this.bookLanguageSelect).append(this.flipSpeedLabel).append(this.flipSpeedInput)).append(this.SelectText.append(this.SelectTextLabel).append(this.SelectTextSelect)).append(this.PageUrlText.append(this.PageUrlTextLabel).append(this.PageUrlTextSelect)).append(this.hideFullscreen.append(this.hideFullscreenlLabel).append(this.hideFullscreenl
1Select)).append(this.rightClickscreen.append(this.rightClickscreenLabel).append(this.rightClickscreenSelect)).append(this.bookMargin.append(this.bookMarginLabel).append(this.bookMarginTopLabel).append(this.bookMarginTopInput).append(this.bookMarginRightLabel).append(this.bookMarginRightInput)).append(this.bookMargin2.append(this.bookMarginLabel2).append(this.bookMarginBottomLabel).append(this.bookMarginBottomInput).append(this.bookMarginLeftLabel).append(this.bookMarginLeftInput)).append(this.shadow.append(this.shadowLabel).append(this.shadowLeftWidthLabel).append(this.shadowLeftWidthInput).append(this.shadowLeftAlphaLabel).append(this.shadowLeftAlphaSelect).append(this.shadowLeftLabel)).append(this.shadow2.append(this.shadowLabel2).append(this.shadowRightWidthLabel).append(this.shadowRightWidthInput).append(this.shadowRightAlphaLabel).append(this.shadowRightAlphaSelect).append(this.shadowRightLabel)).append(this.miniMode.append(this.miniModeLabel).append(this.miniModeWidthLabel).append(this.miniModeWidthInput).append(this.miniModeHeightLabel).append(this.miniModeHeightInput))).append(this.toolbarSection.append(this.toolbarStyling).append(this.toolbarBackgroundColorGroup.append(this.toolbarBackgroundColorLabel).append(this.toolbarBackgroundColorInput)).append(this.toolbarButtonColorGroup.append(this.toolbarButtonColorLabel).append(this.toolbarButtonColorInput)).append(this.toolbarPageNumFontColorGroup.append(this.toolbarPageNumFontColorLabel).append(this.toolbarPageNumFontColorInput)).append(this.buttonsTitle).append(this.buttonGroup.append(this.buttonContainer1.append(this.shareGroup.append(this.shareInput).append(this.shareLabel)).append(this.fullscreenGroup.append(this.fullscreenInput).append(this.fullscreenLabel)).append(this.thumbnailsGroup.append(this.thumbnailsInput).append(this.thumbnailsLabel)).append(this.zoomGroup.append(this.zoomInput).append(this.zoomLabel)).append(this.searchGroup.append(this.searchInput).append(this.searchLabel)).append(this.printGroup.append(this.printInput).append(this.printLabel)).append(this.bookmarkGroup.append(this.bookmarkInput).append(this.bookmarkLabel)).append(this.annotationGroup.append(this.annotationInput).append(this.annotationLabel)).append(this.selectAllGroup.append(this.selectAllInput).append(this.selectAllLabel))).append(this.buttonContainer2.append(this.homeGroup.append(this.homeInput).append(this.homeLabel).append(this.homeUrlInput)).append(this.downloadGroup.append(this.downloadInput).append(this.downloadLabel).append(this.downloadUrlInput).append(this.downloadDefaultBtn)).append(this.autoPlayGroup.append(this.autoPlayInput).append(this.autoPlayLabel)).append(this.autoPlayContentContainer.append(this.autoPlayTimeGroup.append(this.autoPlayTimeLabel).append(this.autoPlayTimeInput)).append(this.autoPlayLoopsGroup.append(this.autoPlayLoopsLabel).append(this.autoPlayLoopsSelect))).append(this.tocGroup.append(this.tocInput).append(this.tocLabel)).append(this.tocContentContainer.append(this.tocFontColorGroup.append(this.tocFontColorLabel).append(this.tocFontColorInput)).append(this.tocBackgroundColorGroup.append(this.tocBackgroundColorLabel).append(this.tocBackgroundColorInput))).append(this.backgroundSoundGroup.append(this.backgroundSoundInput).append(this.backgroundSoundLabel)).append(this.backgroundSoundContentContainer.append(this.backgroundSoundUploadGroup.append(this.backgroundSoundFileLabel).append(this.backgroundSoundFileTitle).append(this.backgroundSoundUploadingIcon).append(this.backgroundSoundUploadOk).append(this.backgroundSoundUploadButton.append(this.backgroundSoundUploadInput))).append(this.backgroundSoundUploadHelpGroup.append(this.backgroundSoundUploadHelpLabel).append(this.backgroundSoundUploadHelp)).append(this.backgroundSoundLoopsGroup.append(this.backgroundSoundLoopsLabel).append(this.backgroundSoundLoopsSelect)).append(this.backgroundSoundAudio))))).append(this.brandingSection.append(this.logo.append(this.logoInput).append(this.logoLabel)).append(this.logoContentContainer.append(this.logoImageGroup.append(this.logoImageLabel).append(this.logoImageContainer.append(this.logoImageImg).append(this.logoImageProgress.append(this.logoImageProgressBar))).append(this.logoImageUploadInfo.append(this.logoImageTip).append(this.logoImageUploadButton.append(this.logoImageFileInput)))).append(this.logoImageErrorZoneGroup.append(this.logoImageErrorZoneLabel).append(this.logoImageErrorZone)).append(this.logoUrlGroup.append(this.logoUrlLabel).append(this.logoUrlInput).append(this.logoHeightLabel).append(this.logoHeightInput)).append(this.logoPaddingGroup.append(this.logoPaddingLeftLabel).append(this.logoPaddingLeftInput).append(this.logoPaddingTopLabel).append(this.logoPaddingTopInput))).append(this.about.append(this.aboutInput).append(this.aboutLabel)).append(this.aboutContentContainer.append(this.aboutLogoGroup.append(this.aboutLogoLabel).append(this.aboutLogoContainer.append(this.aboutLogoImg).append(this.aboutLogoProgress.append(this.aboutLogoProgressBar))).append(this.aboutLogoUploadInfo.append(this.aboutLogoTip).append(this.aboutLogoUploadButton.append(this.aboutLogoFileInput)).append(this.aboutLogoErrorZone))).append(this.aboutEmail.append(this.aboutEmailLabel).append(this.aboutEmailInput)).append(this.aboutMobile.append(this.aboutMobileLabel).append(this.aboutMobileInput)).append(this.aboutWebsite.append(this.aboutWebsiteLabel).append(this.aboutWebsiteInput)).append(this.aboutAddress.append(this.aboutAddressLabel).append(this.aboutAddressInput)).append(this.aboutDesc.append(this.aboutDescLabel).append(this.aboutDescInput)))).append(this.gallerySection.append(this.videoGalleryGroup.append(this.videoGalleryInput).append(this.videoGalleryLabel)).append(this.videoGalleryContentContainer.append(this.videoGalleryPanel.getPanel())).append(this.imageGalleryGroup.append(this.imageGalleryInput).append(this.imageGalleryLabel)).append(this.imageGalleryContentContainer.append(this.imageGalleryPanel.getPanel()))))),this.current=0,this.templateName=fh5.pageData.templates[this.options.templateId].name,this.themeName=fh5.pageData.themes[this.options.themeId],this.backgroundImageUploading=!1,this.backgroundSoundUploading=!1,this.logoUploading=!1,this.aboutLogoUploading=!1,this.subCaptions.on("click",this.switch2.bind(this)),a={showInput:!0,showAlpha:!0,showPalette:!0,palette:[["#000000","#272727","#4F4F4F","#7B7B7B","#ADADAD","E0E0E0","#FFFFFF"],["#2F0000","#600000","#930000","#CE0000","#FF0000","#FF5151","#FF9797"],["#600030","#9F0050","#D9006C","#FF0080","#FF60AF","#FF95CA","#FFC1E0"],["#460046","#750075","#AE00AE","#E800E8","#FF44FF","#FF8EFF","#FFBFFF"],["#28004D","#4B0091","#6F00D2","#921AFF","#B15BFF","#CA8EFF","#DCB5FF"],["#000079","#0000C6","#0000E3","#4A4AFF","#7D7DFF","#AAAAFF","#CECEFF"],["#003D79","#005AB5","#0072E3","#2894FF","#66B3FF","#97CBFF","#C4E1FF"],["#003E3E","#007979","#00AEAE","#00E3E3","#4DFFFF","#A6FFFF","#CAFFFF"],["#006030","#019858","#02C874","#02F
178E","#4EFEB3","#96FED1","#C1FFE4"],["#006000","#007500","#009100","#00BB00","#00EC00","#53FF53","#93FF93"],["#467500","#64A600","#82D900","#9AFF02","#B7FF4A","#CCFF80","#DEFFAC"],["#424200","#737300","#A6A600","#E1E100","#FFFF37","#FFFF93","#FFFFB9"],["#844200","#BB5E00","#EA7500","#FF9224","#FFAF60","#FFC78E","#FFDCB9"]],showSelectionPalette:!0,localStorageKey:"pubhtml5.book",clickoutFiresChange:!0,showInitial:!0,chooseText:"Choose",cancelText:"Cancel"},(self=this).standardModeRadio.add(this.liteModeRadio).on("change",function(){self.standardModeRadio[0].checked?(self.bookMarginTopInput.val(10),self.bookMarginBottomInput.val(10)):(self.bookMarginTopInput.val(0),self.bookMarginBottomInput.val(5)),self.bookMarginLeftInput.val(0),self.bookMarginRightInput.val(0)}),this.loadingCaptionColorInput.spectrum(a),this.setGradientBackground.bind(this),this.backgroundGradientStartColorInput.spectrum($.extend({},a,{showAlpha:!1,change:function(){self.backgroundColorRadio[0].checked=!0,self.setGradientBackground()},move:function(){self.setGradientBackground()},hide:function(){self.setGradientBackground()}})),this.backgroundGradientEndColorInput.spectrum($.extend({},a,{showAlpha:!1,change:function(){self.backgroundColorRadio[0].checked=!0,self.setGradientBackground()},move:function(){self.setGradientBackground()},hide:function(){self.setGradientBackground()}})),this.backgroundGradientAngleInput.on("keydown",function(e){var t;self.backgroundColorRadio[0].checked=!0,utils.validate("number",self.backgroundGradientAngleInput,null,!0,null)&&(t=parseInt(self.backgroundGradientAngleInput.val().trim()),38==e.which?(e.preventDefault(),self.backgroundGradientAngleInput.val(t+1),self.setGradientBackground()):40==e.which&&(e.preventDefault(),self.backgroundGradientAngleInput.val(t-1),self.setGradientBackground()))}),this.backgroundGradientAngleInput.on("keyup",function(e){utils.validate("number",self.backgroundGradientAngleInput,null,!0,null)&&self.setGradientBackground()}),this.backgroundGradientAngleInput.on("blur",function(e){utils.validate("number",self.backgroundGradientAngleInput,null,!0,null)&&self.setGradientBackground()}),this.backgroundGradientAngleInput.on("change",function(e){utils.validate("number",self.backgroundGradientAngleInput,null,!0,null)&&self.setGradientBackground()}),this.section.find("input[type=number]").not(this.backgroundGradientAngleInput).each(function(e,t){var i=$(t);i.on("keydown",function(e){utils.validate("positiveNumber",i,null,!0,null)}),i.on("keyup",function(e){utils.validate("positiveNumber",i,null,!0,null)}),i.on("blur",function(e){utils.validate("positiveNumber",i,null,!0,null)}),i.on("change",function(e){utils.validate("positiveNumber",i,null,!0,null)})}),this.toolbarBackgroundColorInput.spectrum($.extend({},a,{change:function(){self.logoImageContainer.css("background",self.toolbarBackgroundColorInput.spectrum("get").toHexString())}})),this.toolbarButtonColorInput.spectrum(a),this.toolbarPageNumFontColorInput.spectrum(a),this.loadingCaptionColorLabel.on("click",function(){return self.loadingCaptionColorInput.spectrum("toggle"),!1}),this.backgroundGradientStartColorLabel.on("click",function(){return self.backgroundGradientStartColorInput.spectrum("toggle"),!1}),this.backgroundGradientEndColorLabel.on("click",function(){return self.backgroundGradientEndColorInput.spectrum("toggle"),!1}),this.toolbarBackgroundColorLabel.on("click",function(){return self.toolbarBackgroundColorInput.spectrum("toggle"),!1}),this.toolbarButtonColorLabel.on("click",function(){return self.toolbarButtonColorInput.spectrum("toggle"),!1}),this.toolbarPageNumFontColorLabel.on("click",function(){return self.toolbarPageNumFontColorInput.spectrum("toggle"),!1}),this.tocBackgroundColorInput.spectrum(a),this.tocBackgroundColorLabel.on("click",function(){return self.tocBackgroundColorInput.spectrum("toggle"),!1}),this.tocFontColorInput.spectrum(a),this.tocFontColorLabel.on("click",function(){return self.tocFontColorInput.spectrum("toggle"),!1}),this.options.isNew||this.reset(!1,!1),this.backgroundImageFileInput.fileupload({url:"/upload-control/index.php",dropZone:null,pasteZone:null,formAcceptCharset:"utf-8",dataType:"json",context:self,add:function(e,t){var i,a=t.files[0],o=t.originalFiles[0],o=o.name.substr(0,o.name.lastIndexOf(".")),a=a.name.substr(a.name.length-3).toLowerCase();self.backgroundImageErrorZone.empty(),o.match(/[\u4E00-\u9FA5]/)?i=fh5.pageData.tips.ChineseError:"jpg"!==a&&"png"!==a&&(i=fh5.pageData.tips.ImageFormatsError),i?self.backgroundImageErrorZone.text(i):(self.backgroundImageProgress.show(),self.backgroundImageProgressBar.width(0),self.backgroundImageUploading=!0,t.submit())},progress:function(e,t){self.backgroundImageProgressBar.width(parseInt(t.loaded/t.total*100,10)+"
1%")},done:function(e,t){t=t.result.files[0];t.error?self.backgroundImageErrorZone.text(fh5.pageData.tips.UnexpectedError):(utils.autoFit(self.backgroundImageContainer,self.backgroundImageImg.attr("src",utils.pasreHttps(decodeURIComponent(t.url))),function(){self.backgroundImageProgress.hide(),self.backgroundImageProgressBar.width(0)}),self.backgroundImageRadio[0].checked=!0),self.backgroundImageUploading=!1}}),this.backgroundSoundUploadInput.fileupload({url:"/upload-control/index.php",dropZone:null,pasteZone:null,formAcceptCharset:"utf-8",dataType:"json",context:self,add:function(e,t){var i,a=t.files[0],o=t.originalFiles[0],n=o.name.substr(0,o.name.lastIndexOf(".")),a=a.name.substr(a.name.length-3).toLowerCase();self.backgroundSoundUploadHelp.empty(),self.backgroundSoundUploadOk.addClass("cc-hide"),n.match(/[\u4E00-\u9FA5]/)?i=fh5.pageData.tips.ChineseError:"mp3"!==a&&(i=fh5.pageData.tips.AudioFormatsError),i?self.backgroundSoundUploadHelp.text(i):(self.backgroundSoundFileTitle.text(o.name),self.backgroundSoundFileTitle.attr("title",o.name),self.backgroundSoundUploadingIcon.removeClass("cc-hide"),self.backgroundSoundUploading=!0,t.submit())},done:function(e,t){t=t.result.files[0];t.error?self.backgroundSoundUploadHelp.text(fh5.pageData.tips.UnexpectedError):(self.backgroundSoundUploadingIcon.addClass("cc-hide"),self.backgroundSoundUploadOk.removeClass("cc-hide"),self.backgroundSoundAudio.removeClass("cc-hide").attr("src",utils.pasreHttps(t.url)),self.backgroundSoundInput[0].checked=!0),self.backgroundSoundUploading=!1}}),this.logoImageFileInput.fileupload({url:"/upload-control/index.php",dropZone:null,pasteZone:null,formAcceptCharset:"utf-8",dataType:"json",context:self,add:function(e,t){var i,a=t.files[0],o=t.originalFiles[0],o=o.name.substr(0,o.name.lastIndexOf(".")),a=a.name.substr(a.name.length-3).toLowerCase();self.logoImageErrorZone.empty(),o.match(/[\u4E00-\u9FA5]/)?i=fh5.pageData.tips.ChineseError:"jpg"!==a&&"png"!==a&&(i=fh5.pageData.tips.ImageFormatsError),i?self.logoImageErrorZone.text(i):(self.logoImageProgress.show(),self.logoImageProgressBar.width(0),self.logoUploading=!0,t.submit())},progress:function(e,t){self.logoImageProgressBar.width(parseInt(t.loaded/t.total*100,10)+"%")},done:function(e,t){t=t.result.files[0];t.error?self.logoImageErrorZone.text(fh5.pageData.tips.UnexpectedError):(self.logoImageImg.attr("src",utils.pasreHttps(t.url)),utils.autoFit(self.logoImageContainer,self.logoImageImg,function(){self.logoImageProgress.hide(),self.logoImageProgressBar.width(0)}),self.logoInput[0].checked=!0),self.logoUploading=!1}}),this.aboutLogoFileInput.fileupload({url:"/upload-control/index.php",dropZone:null,pasteZone:null,formAcceptCharset:"utf-8",dataType:"json",context:self,add:function(e,t){var i,a=t.files[0],o=t.originalFiles[0],o=o.name.substr(0,o.name.lastIndexOf(".")),a=a.name.substr(a.name.length-3).toLowerCase();self.aboutLogoErrorZone.empty(),o.match(/[\u4E00-\u9FA5]/)?i=fh5.pageData.tips.ChineseError:"jpg"!==a&&"png"!==a&&(i=fh5.pageData.tips.ImageFormatsError),i?self.aboutLogoErrorZone.text(i):(self.aboutLogoProgress.show(),self.aboutLogoProgressBar.width(0),self.aboutLogoUploading=!0,t.submit())},progress:function(e,t){self.aboutLogoProgressBar.width(parseInt(t.loaded/t.total*100,10)+"%")},done:function(e,t){t=t.result.files[0];t.error?self.aboutLogoErrorZone.text(fh5.pageData.tips.UnexpectedError):(self.aboutLogoImg.attr("src",utils.pasreHttps(t.url)),utils.autoFit(self.aboutLogoContainer,self.aboutLogoImg,function(){self.aboutLogoProgress.hide(),self.aboutLogoProgressBar.width(0)})),self.aboutLogoUploading=!1}}),this.selectAllInput.on("change",this.selectAll.bind(this)),this.reloadThemeSettingsButton.on("click",this.reloadThemeSetting.bind(this,!0)),this.homeInput.on("change",this.toggleContent.bind(this,this.homeInput,this.homeUrlInput,null,!0)),this.downloadInput.on("change",this.toggleContent.bind(this,this.downloadInput,this.downloadUrlInput,null,!0,this.downloadDefaultBtn)),"0"==fh5.uType?(this.logoInput.on("click",function(e){e.preventDefault(),new UpgradePanel(fh5.pageData.upgrade.Logo)}),this.logoImageFileInput.on("click",function(e){e.preventDefault(),new UpgradePanel(fh5.pageData.upgrade.Logo)}),this.logoUrlInput.on("focus",function(){new UpgradePanel(fh5.pageData.upgrade.Logo)}),this.logoHeightInput.on("focus",function(){new UpgradePanel(fh5.pageData.upgrade.Logo)}),this.logoPaddingLeftInput.on("focus",function(){new UpgradePanel(fh5.pageData.upgrade.Logo)}),this.logoPaddingTopInput.on("focus",function(){new UpgradePanel(fh5.pageData.upgrade.Logo)}),this.aboutLogoFileInput.on("click",function(e){e.preventDefault(),new UpgradePanel(fh5.pageData.upgrade.AboutLogo)})):this.logoInput.on("change",this.toggleContent.bind(this,this.logoInput,null,this.logoContentContainer,!1)),this.aboutInput.on("change",this.toggleContent.bind(this,this.aboutInput,null,this.aboutContentContainer,!1)),this.backgroundSoundInput.on("change",this.toggleContent.bind(this,this.backgroundSoundInput,null,this.backgroundSoundContentContainer,!1)),this.autoPlayInput.on("change",this.toggleContent.bind(this,this.autoPlayInput,null,this.autoPlayContentContainer,!1)),this.tocInput.on("change",this.toggleContent.bind(this,this.tocInput,null,this.tocContentContainer,!1)),this.videoGalleryInput.on("change",this.toggleContent.bind(this,this.videoGalleryInput,null,this.videoGalleryContentContainer,!1)),this.imageGalleryInput.on("change",this.toggleContent.bind(this,this.imageGalleryInput,null,this.imageGalleryContentContainer,!1))}function BookcaseEmbedPanel(e){this.options=$.extend({},{domainUrl:"",url:"",width:900,height:500,iframeAttr:" seamless='seamless' scrolling='no' frameborder='0' allowtransparency='true' allowfullscreen "},e),this.panel=$("<div class='cc-light-box-content-panel'></div>
1"),this.iframeContainer=$("<div class='cc-embed-iframe-container-middle cc-bookcase-embed-bookcase-background'></div>"),this.iframe=$("<iframe src='"+utils.pasreHttps(this.options.url)+"' class='cc-embed-iframe'"+utils.pasreHttps(this.options.iframeAttr)+"></iframe>"),this.stylingOptions=$("<div class='cc-embed-title'>Options:</div>"),this.size=$("<div class='cc-input-group-l'></div>"),this.sizeLabel=$("<label class='cc-embed-label'>Size:</label>"),this.smallLabel=$("<label class='cc-embed-square cc-embed-small' for='small'></label>"),this.smallRadio=$("<input class='cc-embed-radio' type='radio' name='size' id='small'></input>"),this.middleLabel=$("<label class='cc-embed-square cc-embed-middle' for='middle'></label>"),this.middleRadio=$("<input class='cc-embed-radio' type='radio' name='size' id='middle'></input>"),this.largeLabel=$("<label class='cc-embed-square cc-embed-large' for='large'></label>"),this.largeRadio=$("<input class='cc-embed-radio' type='radio' name='size' id='large' checked></input>"),this.customLabel=$("<label class='cc-embed-custom' for='custom'></label>"),this.customWidthInput=$("<input type='number' class='cc-input-text cc-embed-number-input'> X </input>"),this.customHeightInput=$("<input type='number' class='cc-input-text cc-embed-number-input'></input>"),this.customPx=$("<span class='cc-embed-custom-px'> px</span>"),this.customHelp=$("<span class='cc-embed-custom-help'><span class='cc-star'>*</span> Press \"Enter\" Button on the keyboard to apply your changes.</span>"),this.customRadio=$("<input class='cc-embed-radio' type='radio' name='size' id='custom'></input>"),this.optionsSkin=$("<div class='cc-input-group-l'></div>"),this.optionsSkinLabel=$("<label class='cc-embed-label'>Skin:</label>"),this.optionsSkinRedLabel=$("<label class='cc-embed-square cc-bookcase-embed-skin cc-bookcase-embed-skin-red' for='red'></label>"),this.optionsSkinRedRadio=$("<input class='cc-embed-radio' type='radio' name='skin' id='red' checked></input>"),this.optionsSkinGoldLabel=$("<label class='cc-embed-square cc-bookcase-embed-skin cc-bookcase-embed-skin-gold' for='gold'></label>"),this.optionsSkinGoldRadio=$("<input class='cc-embed-radio' type='radio' name='skin' id='gold'></input>"),this.optionsSkinSilverLabel=$("<label class='cc-embed-square cc-bookcase-embed-skin cc-bookcase-embed-skin-silver' for='silver'></label>"),this.optionsSkinSilverRadio=$("<input class='cc-embed-radio' type='radio' name='skin' id='silver'></input>"),this.optionsSkinGreenLabel=$("<label class='cc-embed-square cc-bookcase-embed-skin cc-bookcase-embed-skin-green' for='green'></label>"),this.optionsSkinGreenRadio=$("<input class='cc-embed-radio' type='radio' name='skin' id='green'></input>"),this.optionsSkinYellowLabel=$("<label class='cc-embed-square cc-bookcase-embed-skin cc-bookcase-embed-skin-yellow' for='yellow'></label>"),this.optionsSkinYellowRadio=$("<input class='cc-embed-radio' type='radio' name='skin' id='yellow'></input>"),this.step=$("<div class='cc-embed-title'>Steps:</div>"),this.iframeStepContainer=$("<div></div>"),this.iframeStep1=$("<div class='cc-input-group-l cc-float-fix'></div>"),this.iframeStepTitle1=$("<p class='cc-embed-step'>1. Copy the Embed Code below and paste it into your HTML file.</p>"),this.iframeStepCode1=$("<textarea class='cc-embed-code-textarea cc-textarea'></textarea>"),this.domainEmbedOriginal=$("<p class='cc-bookcase-embed-show-original'> > Embed the original bookcase hosted on Fliphtml5 Domain?</p>"),this.lightbox=new LightBox("Embed this bookcase into your website","",960,"",2),this.lightbox.getSaveButton().hide(),this.lightbox.getPanel().append(this.iframeContainer.append(this.iframe)).append(this.stylingOptions).append(this.size.append(this.sizeLabel).append(this.smallLabel.append(this.smallRadio)).append(this.middleLabel.append(this.middleRadio)).append(this.largeLabel.append(this.largeRadio)).append(this.customLabel.append(this.customWidthInput).append(this.customHeightInput).append(this.customRadio)).append(this.customPx).append(this.customHelp)).append(this.optionsSkin.append(this.optionsSkinLabel).append(this.optionsSkinRedLabel.append(this.optionsSkinRedRadio)).append(this.optionsSkinGoldLabel.append(this.optionsSkinGoldRadio)).append(this.optionsSkinSilverLabel.append(this.optionsSkinSilverRadio)).append(this.optionsSkinGreenLabel.append(this.optionsSkinGreenRadio)).append(this.optionsSkinYellowLabel.append(this.optionsSkinYellowRadio))).append(this.step).append(this.iframeStepContainer.append(this.iframeStep1.append(this.iframeStepTitle1).append(this.iframeStepCode1))),this.lightbox.launch();var t=this;t.resizeIframe(t.options.width,t.options.height),this.options.domainUrl&&(this.lightbox.getPanel().append(this.domainEmbedOriginal),this.domainEmbedOriginal.click(function(){t.lightbox.cancel(),new BookcaseEmbedPanel({url:t.options.url})}
1)),$([this.iframeStepCode1]).each(function(){var e=$(this);e.on("click",utils.selectCode.bind(utils,e))}),$([this.smallLabel,this.smallRadio]).each(function(){$(this).on("click",t.resizeIframe.bind(t,400,250))}),$([this.middleLabel,this.middleRadio]).each(function(){$(this).on("click",t.resizeIframe.bind(t,700,400))}),$([this.largeLabel,this.largeRadio]).each(function(){$(this).on("click",t.resizeIframe.bind(t,900,500))}),$([this.customWidthInput,this.customHeightInput]).each(function(){var e=$(this);e.on("focus",function(){t.customRadio[0].checked=!0}),e.on("change",function(){t.customRadio[0].checked=!0,t.resizeIframe(t.customWidthInput.val(),t.customHeightInput.val())}),e.on("blur",function(){t.resizeIframe(t.customWidthInput.val(),t.customHeightInput.val())}),e.on("keypress",function(e){13==e.which&&t.resizeIframe(t.customWidthInput.val(),t.customHeightInput.val())})}),this.optionsSkin.find("input[name=skin]").on("change",function(){var e=(t.options.domainUrl||t.options.url)+"/"+this.id;t.iframe.attr("src",t.options.url+"/"+this.id),t.setCode(e)})}function BookDownloadPanel(e){this.options=e,this.panel=$("<div class='cc-light-box-content-panel-gray'></div>"),this.container=$("<ul class='cc-book-download-ul cc-float-fix'></ul>"),this.pdf=$("<li></li>"),this.pdfTitle=$("<p>PDF Version <i class='cc-info-icon icon icon-info-sign'></i></p>"),this.pdfImg=$("<img src='/images/download-pdf.jpg'>"),this.pdfDownloadButton=$("<div class='button button-flat-caution'>Download PDF</div>"),this.zip=$("<li></li>"),this.zipTitle=$("<p>FlipBook Version</p>"),this.zipImg=$("<img src='/images/download-zip.jpg'>"),this.zipDownloadButtonContainer=$("<div class='cc-inline-wrapper'></div>"),this.zipDownloadButton=$("<div class='button button-flat-highlight'>Download ZIP</div>"),this.zipHelp=$("<div class='cc-error cc-book-download-zip-help'></div>"),this.lightBox=new LightBox("Select a version to download","",698,"gray"),this.lightBox.getBox().append(this.panel.append(this.container.append(this.pdf.append(this.pdfTitle).append(this.pdfImg).append(this.pdfDownloadButton)).append(this.zip.append(this.zipTitle).append(this.zipImg).append(this.zipDownloadButtonContainer.append(this.zipDownloadButton).append(this.zipHelp))))),"1"==e.type?this.pdfDownloadButton.on("click",this.downloadPdf.bind(this)):(this.pdfDownloadButton.addClass("disabled"),this.pdfDownloadButton.attr("title","PDF file can be downloaded only if the flipbook is uploaded from the cloud platform.")),"1"==e.type||"2"==e.type?this.zipDownloadButton.on("click",this.downloadZip.bind(this)):(this.zipDownloadButton.addClass("disabled"),this.zipDownloadButton.attr("title","FlipBook Version is not available for this book because it was uploaded from an old version of PubHTML5 Desktop Client. Please go to home page to download the latest version.")),this.lightBox.launch()}function BookEditPanel(e){var t={templateId:fh5.templateId,themeId:fh5.themeId,title:"",desc:"",keywords:"",categoryId:0,videoList:[],slideshow:[],staticAd:{},bmtConfig:[],bookConfig:fh5.pageData.bookConfig};this.options=$.extend({},t,e),this.panel=$("<ul class='cc-panel'></ul>"),this.header=$("<li class='cc-bar cc-bar-header'></li>"),this.title=$("<div class='cc-title cc-left'>"+(this.options.isNew?"ADD NEW BOOK":"BOOK SETTINGS")+"</div>"),this.captions=$("<ul class='cc-caption-container cc-right'></ul>"),this.captionArrow=$("<i class='cc-caption-triangle fa fa-caret-up'></i>");var i=["BOOK INFO","TEMPLATE","THEME","ADVANCED"];this.options.isNew?i.unshift("UPLOAD"):i.push("RE-UPLOAD");var a,o,n=i.length;for(this.current=0,this.last=n-1,a=0;a<n;a++)o=$("<li class='cc-caption'>"+i[a]+"</li>"),this.captions.append(o);this.header.append(this.title).append(this.captions),this.captions.on("click",this.switch2.bind(this)),this.content=$("<li class='cc-content'></li>"),this.sections=$("<ul class='cc-section-container'></ul>"),this.footer=$("<li class='cc-bar cc-bar-footer'></li>"),this.buttons=$("<div class='cc-button-container'></div>"),this.cancelButton=$("<span class='button-pure'>Cancel</span>"),this.backButton=$("<span class='button-pure button-pure-green cc-hide'><i class='icon icon-hand-left'></i> Back</span>"),this.nextButton=$("<span class='button-pure button-pure-green'><i class='icon icon-hand-right'></i> Next</span>"),this.createButton=$("<span class='button-pure button-pure-red'><i class='icon icon-ok'></i> Create</span>"),this.closeButton=$("<span class='button-pure'>Close</span>"),this.saveAndCloseButton=$("<span class='button-pure button-pure-green'>Save And Close</span>"),this.bottomAlert=$("<div class='cc-pdf-upload-alert-bottom'></div>");e=433;advancedHeight=996,this.options.isNew&&(e+=90,advancedHeight+=90),this.content.height(e),this.bookInfoSection=new BookInfoSection({height:e,isShown:!this.options.isNew,title:this.options.title,de
1sc:this.options.desc,keywords:this.options.keywords,categoryId:this.options.categoryId,isDownload:this.options.isDownload,type:this.options.type,label:this.options.label,isNew:this.options.isNew}),this.advancedSection=new AdvancedSection({BookEditPanel:this,height:advancedHeight,bookConfig:this.options.bookConfig,isNew:this.options.isNew,templateId:this.options.templateId,themeId:this.options.themeId,bLink:this.options.bLink,videoList:this.options.videoList,slideshow:this.options.slideshow,staticAd:this.options.staticAd,bmtConfig:this.options.bmtConfig}),this.templateSection=new TemplateSection({height:e,templateId:this.options.templateId,advancedSection:this.advancedSection,isNew:this.options.isNew}),this.themeSection=new ThemeSection({height:e,themeId:this.options.themeId,isNew:this.options.isNew,advancedSection:this.advancedSection}),this.options.isNew?(this.uploadSection=new UploadSection({height:e,bookInfoSection:this.bookInfoSection,bottomAlert:this.bottomAlert,create2:this.create2.bind(this),choose:this.choose.bind(this),upload_url:fh5.upload_url,upload_inputs:fh5.upload_inputs,upload_prefix:fh5.upload_prefix}),this.sections.append(this.uploadSection.section),this.buttons.append(this.cancelButton).append(this.backButton).append(this.nextButton).append(this.createButton),this.cancelButton.on("click",this.cancel.bind(this)),this.backButton.on("click",this.back.bind(this)),this.nextButton.on("click",this.next.bind(this)),this.createButton.on("click",this.create2.bind(this))):(this.buttons.append(this.closeButton).append(this.saveAndCloseButton),this.closeButton.on("click",this.close.bind(this)),this.saveAndCloseButton.on("click",this.save.bind(this))),this.sections.append(this.bookInfoSection.section).append(this.templateSection.section).append(this.themeSection.section).append(this.advancedSection.section),this.options.isNew||(this.reUploadSection=new ReUploadSection({height:e,bookInfoSection:this.bookInfoSection,bottomAlert:this.bottomAlert,save:this.save.bind(this),upload_url:fh5.upload_url,upload_inputs:fh5.upload_inputs,upload_prefix:fh5.upload_prefix}),this.sections.append(this.reUploadSection.getSection())),this.panel.append(this.header).append(this.content.append(this.sections)).append(this.footer.append(this.buttons)),this.panel.append(this.bottomAlert),this.choose(0)}function BookInfoSection(e){var t=(new Date).getTime();switch(this.section=$("<li data-name='BookInfo' class='cc-section "+(e.isShown?"":"cc-hide")+"' data-height='"+e.height+"'></li>"),e.isNew&&this.section.addClass("cc-section-new"),this.title=$("<div class='cc-input-group cc-float-fix'></div>"),this.titleLabel=$("<label class='cc-label cc-left' for='title"+t+"'>Title</label>"),this.titleInput=$("<input class='cc-field cc-input-text cc-left' type='text' id='title"+t+"' name='title' value='"+e.title+"' maxlength='255'/>"),this.titleHelp=$("<span class='cc-left cc-book-info-section-input-help'><i class='fa fa-angle-left'></i> Enter the title.</span>"),this.desc=$("<div class='cc-input-group cc-float-fix'></div>"),this.descLabel=$("<label class='cc-label cc-left' for='description"+t+"'>Description</label>"),this.descInput=$("<textarea class='cc-field cc-textarea cc-left' id='description"+t+"' name='description' maxlength='1000'>"+e.desc+"</textarea>"),this.descHelp=$("<span class='cc-left cc-book-info-section-input-help cc-line-height-20'><i class='fa fa-angle-left'></i> Enter the description to ensure maximum search engine visibility, which will make your content easily searched by Google.</span>"),this.keywords=$("<div class='cc-input-group cc-float-fix'></div>"),this.keywordsLabel=$("<label class='cc-label cc-left' for='keywords"+t+"'>Keywords</label>"),this.keywordsContainer=$("<ul class='cc-keywords-container cc-field cc-as-input-text cc-float-fix cc-left'></ul>"),this.keywordsDefaultItem=$("<li></li>"),this.keywordsInput=$("<input class='cc-smart-hidden-input cc-keywords-hidden-input' type='text' value='"+e.keywords+"'>"),this.keywordsHelp=$("<span class='cc-left cc-book-info-section-input-help'><i class='fa fa-angle-left'></i> Enter the keywords separated by comma.</span>"),this.secondaryCategory=$("<div class='cc-input-group cc-float-fix'></div>"),this.secondaryCategoryLabel=$("<label class='cc-label cc-left' for='secondaryCategory"+t+"'>Category</label>"),this.secondaryCategorySelect=$("<select class='cc-field cc-select cc-left' id='secondaryCategory"+t+"' name='secondaryCategory'>"),this.secondaryCategoryHelp=$("<span class='cc-left cc-book-info-section-input-help'><i class='fa fa-angle-left'></i> Select a category to help your readers find this book easily.</span>"),this.allowDownload=$("<div class='cc-input-group cc-float-fix cc-hide'></div>"),this.allowDownloadLabel=$("<label class='cc-label cc-left'>Allow Download</label>"),this.allowDownloadGroup=new Checkbox("Allow readers to download this PDF file.",e.isDownload),this.labelGroup=$("<div class='cc-input-group'></div>"),this.labelLabel=$("<label class='cc-label'>Label</label>"),this.labelRadioGroup=$("<span class='cc-book-info-label-container'></span>"),this.labelNone=$("<label for='labelNone-"+t+"'>None</label>"),this.labelNoneRadio=$("<input type='radio' value='0' name='bookInfoLabel' id='labelNone-"+t+"'/>"),this.labelNew=$("<label for='labelNew-"+t+"'>New</label>"),this.labelNewRadio=$("<input type='radio' value='1' name='bookInfoLabel' id='labelNew-"+t+"'/>"),this.labelHot=$("<label for='labelHot-"+t+"'>
1Hot</label>"),this.labelHotRadio=$("<input type='radio' value='2' name='bookInfoLabel' id='labelHot-"+t+"'/>"),this.labelFeatured=$("<label for='labelFeatured-"+t+"'>Featured</label>"),this.labelFeaturedRadio=$("<input type='radio' value='3' name='bookInfoLabel' id='labelFeatured-"+t+"'/>"),"1"==e.type&&this.allowDownload.removeClass("cc-hide"),e.label=e.label+"",e.label){case"0":this.labelNoneRadio[0].checked=!0;break;case"1":this.labelNewRadio[0].checked=!0;break;case"2":this.labelHotRadio[0].checked=!0;break;case"3":this.labelFeaturedRadio[0].checked=!0;break;default:this.labelNoneRadio[0].checked=!0}this.section.append(this.title.append(this.titleLabel).append(this.titleInput).append(this.titleHelp)).append(this.desc.append(this.descLabel).append(this.descInput).append(this.descHelp)).append(this.keywords.append(this.keywordsLabel).append(this.keywordsContainer.append(this.keywordsDefaultItem.append(this.keywordsInput))).append(this.keywordsHelp)).append(this.secondaryCategory.append(this.secondaryCategoryLabel).append(this.secondaryCategorySelect).append(this.secondaryCategoryHelp)).append(this.allowDownload.append(this.allowDownloadLabel).append(this.allowDownloadGroup.getGroup())).append(this.labelGroup.append(this.labelLabel).append(this.labelRadioGroup.append(this.labelNoneRadio).append(this.labelNone).append(this.labelNewRadio).append(this.labelNew).append(this.labelHotRadio).append(this.labelHot).append(this.labelFeaturedRadio).append(this.labelFeatured))),this.keywordResult=[];var i,a,o,n,s,l,c,d=this;for(this.secondaryCategorySelect.append($("<option value='0'>None</option>")),i=0,o=fh5.database.category.length;i<o;i++)for(s=fh5.database.category[i],l=$('<optgroup label="'+s.name+'"></optgroup>').appendTo(this.secondaryCategorySelect),a=0,n=s.secondaryCategory.length;a<n;a++)(c=s.secondaryCategory[a]).id==e.categoryId?l.append($("<option value='"+c.id+"' selected>"+c.name+"</option>")):l.append($("<option value='"+c.id+"'>"+c.name+"</option>"));this.titleInput.on("blur",function(){utils.validate("text",d.titleInput,null,!1)}),this.descInput.on("blur",function(){utils.validate("text",d.descInput,null,!1)}),this.keywordsContainer.hover(function(){d.keywordsContainer.addClass("cc-as-input-hover")},function(){d.keywordsContainer.removeClass("cc-as-input-hover")}),this.keywordsInput.on("focus",function(){d.keywordsContainer.addClass("cc-as-input-focus")}),this.keywordsInput.on("blur",function(){d.keywordsContainer.removeClass("cc-as-input-focus"),d.fetchkeywords()}),this.keywordsInput.on("keydown",function(e){8==e.which&&""==d.keywordsInput.val().trim()&&((e=d.keywordsInput.parent().prev()).hasClass("cc-smart-input-item-selected")?d.removeKeywords(e):e.addClass("cc-smart-input-item-selected"))}),this.keywordsInput.on("keyup",function(e){188!=e.which||e.shiftKey||d.fetchkeywords()}),this.keywordsContainer.on("click",function(){d.keywordsInput.focus()}),this.allowDownloadGroup.getCheckbox().on("change",function(){"0"==fh5.uType&&(d.allowDownloadGroup.uncheck(),new UpgradePanel(fh5.pageData.upgrade.Download))}),this.fetchkeywords(),this.labelRadioGroup.find("input").on("change",this.changeLabel.bind(this))}function BookPanel(e){this.options=e;var t=utils.pasreHttps(utils.getDocumentRoot()+fh5.uLink+"/"+e.bLink+"/"),i="http://"+fh5.customDomain+"/books/"+e.bLink+"/",a=$("<div class='book-open-cover'></div>"),o=$("<a href='"+i+"' target='_blank' title='"+i+"' class='book-open-custom'><div class='button-pure button-pure-blue'>Custom Link</div></a>"),i=$("<a href='"+t+"' title='"+t+"' target='_blank' class='book-open-web'><div class='button-pure button-pure-green'>PubHTML5 Link</div></a>"),t=$("<a href='"+utils.pasreHttps(e.url)+"' title='"+utils.pasreHttps(e.url)+"' target='_blank' class='book-open-real'><div class='button-pure button-pure-teal'>Online Link</div></a>");switch(""!==fh5.customDomain&&(a.append(o),a.addClass("has-custom")),a.append(i).append(t),this.panel=$("<ul class='cc-panel cc-book-panel' id='"+e.bookId+"'>"),this.thumbContainer=$("<li class='cc-book-thumbnail-container'></li>"),this.thumbLink=$("<a class='cc-book-a cc-transparent-link' href='"+utils.getDocumentRoot()+fh5.uLink+"/"+e.bLink+"' target='_blank'></a>"),this.thumbImgWrapper=$("<div class='cc-inline-wrapper'></div>"),this.thumbImg=$("<img class='cc-book-img' src='"+utils.pasreHttps(e.url)+"files/shot.jpg'/>"),this.labelImg=$("<img class='cc-book-label-img cc-hide'>"),t="1"==this.options.type?"<i title='Upload from Cloud Platform' class='fa fa-cloud'></i> ":"<i title='Upload from Desktop Client' class='fa fa-desktop'></i> ",this.time=$("<div class='cc-book-time'>"+t+utils.parseDate(e.newTime.trim(),!0)+"</div>"),this.info=$("<li class='cc-book-info'></li>
1"),this.title=$("<a title='"+e.title+"' class='cc-book-title cc-gray-link-underline' href='"+utils.getDocumentRoot()+fh5.uLink+"/"+e.bLink+"' target='_blank'>"+e.title+"</a>"),this.desc=$("<div class='cc-book-desc' title='"+utils.br2nl(e.desc)+"'>"+e.desc+"</div>"),this.bottomToolbar=$("<div class='cc-book-bottom-toolbar'></div>"),this.disableButton=$("<i title='Disable This Book' class='icon icon-stop cc-hide'></i>"),this.enableButton=$("<i title='Enable This Book' class='icon icon-play cc-hide'></i>"),this.embedButton=$("<i title='Embed' class='fa fa-code'></i>"),this.shareButton=$("<i title='Share' class='fa fa-share-alt'></i>"),this.editButton=$("<i title='General Settings' class='icon icon-cog'></i>"),this.textVersionButton=$("<i title='View Text Version' class='icon icon-font'></i>"),this.moveButton=$("<i title='Move To Another Folder' class='icon icon-transfer'></i>"),this.cloneButton=$("<i title='Clone' class='fa fa-copy'></i>"),this.deleteButton=$("<i title='Delete' class='icon icon-trash'></i>"),this.rightToolbar=$("<div class='cc-book-right-toolbar'></div>"),this.privacyButton=$("<div class='cc-book-privacy-button'></div>"),this.downloadButton=$("<i title='Download' class='icon icon-download-alt'></i>"),this.embedLargeButton=$("<div class='cc-embed-large-button button button-rounded button-flat-primary glow'>Embed this Book</div>"),this.bookcaseEmbedLargeButton=$("<div class='cc-bookcase-embed-large-button button button-rounded button-flat-royal glow'>Embed a Bookcase</div>"),this.cloneHint=$("<p>Can not clone here, please go to <a class='cc-blue-link-2' href='/center/flips/book.php?cid="+e.cId+"'>Book Management</a> page to clone this book.</p>"),this.alertContainer=$("<div class='cc-book-panel-alert-container'></div>"),this.alertInner=$("<div></div>"),this.alertIcon=$("<i class='icon icon-exclamation-sign'></i>"),this.alertMessage=$("<span></span>"),this.panel.append(this.thumbContainer.append(a).append(this.thumbLink.append(this.thumbImgWrapper.append(this.thumbImg).append(this.labelImg))).append(this.time)).append(this.info.append(this.title).append(this.desc)).append(this.bottomToolbar.append(this.editButton).append(this.embedButton).append(this.shareButton).append(this.enableButton).append(this.disableButton).append(this.textVersionButton).append(this.downloadButton).append(this.moveButton).append(this.cloneButton).append(this.deleteButton)).append(this.rightToolbar.append(this.privacyButton)),e.isFastUpload&&(this.panel.append(this.embedLargeButton),this.embedLargeButton.on("click",this.embed.bind(this)),this.panel.append(this.bookcaseEmbedLargeButton),this.bookcaseEmbedLargeButton.on("click",this.embedBookcase.bind(this)),this.cloneButton.addClass("cc-toolbar-button-disabled"),this.cloneButton.hints({content:this.cloneHint,position:"top"})),("0"==e.bStatus?this.enableButton:this.disableButton).removeClass("cc-hide"),e.isPublic+""){case"0":this.privacyButton.addClass("private").attr("title","Private");break;case"1":this.privacyButton.addClass("public").attr("title","Public");break;case"2":this.privacyButton.addClass("keep-private-on-cloud").attr("title","Keep Private On PubHTML5 Cloud")}0==e.bStatus||1==e.bStatus?("0"==e.type&&(this.editButton.attr("title","This book can not be edited because it was uploaded from an old version of PubHTML5 Desktop Client. Please go to home page to download the latest version."),this.cloneButton.attr("title","This book can not be cloned because it was uploaded from an old version of PubHTML5 Desktop Client. Please go to home page to download the latest version."),this.editButton.add(this.cloneButton).addClass("cc-toolbar-button-disabled")),this.editButton.on("click",this.edit.bind(this)),this.enableButton.on("click",this.enable.bind(this)),this.disableButton.on("click",this.disable.bind(this)),this.textVersionButton.on("click",this.viewTextVersion.bind(this)),this.embedButton.on("click",this.embed.bind(this)),this.privacyButton.on("click",this.setPrivacy.bind(this)),this.shareButton.on("click",this.share.bind(this)),this.moveButton.on("click",this.move.bind(this)),this.cloneButton.on("click",this.clone.bind(this)),this.downloadButton.on("click",this.download.bind(this))):this.bottomToolbar.children().not(this.deleteButton).add(this.privacyButton).addClass("cc-toolbar-button-disabled"),this.showwAlertMessage(),this.deleteButton.on("click",this.delete2.bind(this));var n=this;utils.autoFit(this.thumbContainer,this.thumbImg,function(){n.setLabel(e.label)}),this.data={keywords:this.options.keywords,categoryId:this.options.categoryId,templateId:this.options.templateId,themeId:this.options.themeId}}function Checkbox(e,t){var i=(new Date).getTime();this.group=$("<span class='cc-checkbox-group'></span>"),this.checkbox=$("<input class='cc-checkbox' type='checkbox' id='"+e+i+"'></input>"),this.label=$("<label class='cc-checkbox-label' type='checkbox' for='"+e+i+"'> "+e+" </label>"),"1"==t&&this.check(),this.group.append(this.checkbox).append(this.label)}function CloneFailPanel(e){this.options=e,this.panel=$("<div class='cc-panel cc-clone-fail-panel' id='"+e.bookId+"'></div>"),this.iconContainer=$("<div class='cc-convert-icon-container'></div>"),this.icon=$("<img class='cc-convert-icon' src='/images/books/convert-fail.png'/>
1"),this.info=$("<div class='cc-convert-info'></div>"),this.title=$("<span class='cc-convert-title'>"+e.title+"</span>"),this.status=$("<span class='cc-convert-status cc-error-color'>-Clone Failed</span>"),this.failMessage=$("<div class='cc-convert-fail-message cc-error-color'>"+fh5.pageData.errorMap[98]+"</div>"),this.buttons=$("<div class='cc-convert-panel-buttons'></div>"),this.deleteButton=$("<span title='Delete' class='cc-convert-panel-button icon icon-remove'></span>"),this.panel.append(this.iconContainer.append(this.icon)).append(this.info.append(this.title).append(this.status).append(this.failMessage)).append(this.buttons.append(this.reConfigButton).append(this.deleteButton)),this.deleteButton.on("click",this.delete2.bind(this)),utils.autoFit(this.iconContainer,this.icon)}function CloningPanel(e){this.options=e,this.panel=$("<div class='cc-panel' id='"+e.bookId+"'></div>"),e.isFastUpload?this.panel.addClass("cc-fast-upload-cloning-panel"):this.panel.addClass("cc-cloning-panel"),this.iconContainer=$("<div class='cc-convert-icon-container'></div>"),this.icon=$("<img class='cc-convert-icon' src='/images/books/converting.gif'/>
1"),this.info=$("<div class='cc-convert-info'></div>"),this.title=$("<span class='cc-convert-title'>"+e.title+"</span>"),this.status=$("<span class='cc-convert-status cc-processing-color'>-Cloning...</span>"),this.cloneInBackgroundContainer=$("<div class='cc-run-in-background-container'></div>"),this.cloneInBackgroundTips=$("<div class='cc-run-in-background-tips'>Tip: While cloning in background, you can go to <a class='cc-blue-link-2' href='/center/flips'>My Flips</a> section to check the clone status.</div>"),this.cloneInBackgroundButton=$("<div class='cc-run-in-background-button button button-caution'>Clone In Background</div>"),this.panel.append(this.iconContainer.append(this.icon)).append(this.info.append(this.title).append(this.status)),e.isFastUpload&&(this.panel.append(this.cloneInBackgroundContainer.append(this.cloneInBackgroundButton).append(this.cloneInBackgroundTips)),this.cloneInBackgroundButton.on("click",this.cloneInBackground.bind(this))),this.requestTimeoutId=null,this.requestCloneProgress.bind(this),this.requestCloneProgress(),utils.autoFit(this.iconContainer,this.icon)}function ConfigFailPanel(e){this.options=e,this.panel=$("<div class='cc-panel cc-config-fail-panel' id='"+e.bookId+"'></div>"),this.iconContainer=$("<div class='cc-convert-icon-container'></div>"),this.icon=$("<img class='cc-convert-icon' src='/images/books/convert-fail.png'/>
1"),this.info=$("<div class='cc-convert-info'></div>"),this.title=$("<span class='cc-convert-title'>"+e.title+"</span>"),this.status=$("<span class='cc-convert-status cc-error-color'>-Generate Failed</span>"),this.failMessage=$("<div class='cc-convert-fail-message cc-error-color'>Failed to generate the configuration files of the PDF.</div>"),this.buttons=$("<div class='cc-convert-panel-buttons'></div>"),this.reConfigButton=$("<span class='cc-convert-panel-button icon icon-refresh' title='Regenerate'></span>"),this.deleteButton=$("<span class='cc-convert-panel-button icon icon-remove' title='Delete'></span>"),this.panel.append(this.iconContainer.append(this.icon)).append(this.info.append(this.title).append(this.status).append(this.failMessage)).append(this.buttons.append(this.reConfigButton).append(this.deleteButton)),this.reConfigButton.on("click",this.reConfig.bind(this)),this.deleteButton.on("click",this.delete2.bind(this)),utils.autoFit(this.iconContainer,this.icon)}function ContactBall(){this.ball=$("<div class='cc-contact-ball'></div>"),this.icon=$("<i class='cc-contact-ball-icon icon icon-comment'></i>"),this.textContainer=$("<div class='cc-contact-ball-text-container cc-hide'></div>"),this.text1=$("<div class='cc-contact-ball-text1'>Contact</div>"),this.text2=$("<div class='cc-contact-ball-text2'>Us</div>"),this.ball.append(this.icon).append(this.textContainer.append(this.text1).append(this.text2));var e=this;this.timeoutId=null,this.ball.hover(function(){e.ball.stop(!0,!0).animate({height:"+=30",width:"+=30",left:"-=15",top:"-=15"},300,function(){e.textContainer.stop(!0,!0).fadeIn(200)}),e.icon.stop(!0,!0).fadeOut(200)},function(){e.ball.stop(!0,!0).animate({height:"-=30",width:"-=30",left:"+=15",top:"+=15"},300),e.textContainer.stop(!0,!0).fadeOut(0),e.icon.stop(!0,!0).fadeIn(200)}),$(window).on("scroll",this.scrollBall.bind(this)),this.ball.on("click",function(){window.location.href="/contact.php"}),this.ball.appendTo($("body")),this.scrollBall()}function ConvertFailPanel(e){this.options=e,this.panel=$("<div class='cc-panel cc-convert-fail-panel' id='"+e.bookId+"'></div>"),this.iconContainer=$("<div class='cc-convert-icon-container'></div>"),this.icon=$("<img class='cc-convert-icon' src='/images/books/convert-fail.png'/>
1"),this.info=$("<div class='cc-convert-info'></div>"),this.title=$("<span class='cc-convert-title'>"+e.title+"</span>"),this.status=$("<span class='cc-convert-status cc-error-color'>-Convert Failed</span>"),this.failMessage=$("<div class='cc-convert-fail-message cc-error-color'>"+e.errorMessage+"</div>"),this.buttons=$("<div class='cc-convert-panel-buttons'></div>"),this.deleteButton=$("<span title='Delete' class='cc-convert-panel-button icon icon-remove'></span>"),this.panel.append(this.iconContainer.append(this.icon)).append(this.info.append(this.title).append(this.status).append(this.failMessage)).append(this.buttons.append(this.reConfigButton).append(this.deleteButton)),this.deleteButton.on("click",this.delete2.bind(this)),utils.autoFit(this.iconContainer,this.icon)}function ConvertingPanel(e){this.options=e,this.panel=$("<div class='cc-panel' id='"+e.bookId+"'></div>"),this.box=$("<div></div>"),e.isFastUpload?this.box.addClass("cc-fast-upload-converting-panel"):this.box.addClass("cc-converting-panel"),this.iconContainer=$("<div class='cc-convert-icon-container'></div>"),this.icon=$("<img class='cc-convert-icon' src='/images/books/converting.gif'/>
1"),this.info=$("<div class='cc-convert-info'></div>"),this.title=$("<span class='cc-convert-title'>"+e.title+"</span>"),this.status=$("<span class='cc-convert-status cc-processing-color'></span>"),this.progressWrapper=$("<div class='cc-convert-progress-bar-wrapper progress progress-striped active progress-info'></div>"),this.progressBar=$("<div class='cc-pdf-convert-progress-bar bar'></div>"),this.runInBackgroundContainer=$("<div class='cc-run-in-background-container'></div>"),this.runInBackgroundTips=$("<div class='cc-run-in-background-tips'>Tip: While running in background, you can go to <a class='cc-blue-link-2' href='/center/flips'>My Pubs</a> section to check the status of conversion.</div>"),this.runInBackgroundButton=$("<div class='cc-run-in-background-button button button-caution'>Run In Background</div>"),this.box.append(this.iconContainer.append(this.icon)).append(this.info.append(this.title).append(this.status).append(this.progressWrapper.append(this.progressBar))).appendTo(this.panel),e.isFastUpload&&(this.box.append(this.runInBackgroundContainer.append(this.runInBackgroundButton).append(this.runInBackgroundTips)),this.runInBackgroundButton.on("click",this.runInBackground.bind(this))),this.addExplore(),this.requestTimeoutId=null,this.requestConvertProgress.bind(this),this.requestConvertProgress(),utils.autoFit(this.iconContainer,this.icon)}function DownloadPanel(e,t){var i,a=(e=e||48e3).toString().split(""),o=a.length;for(this.panel=$("<div class='cc-new-download-bar' data-value='"+e+"'>"),e="Try "+fh5.font.t2+" free and create your own digital <br /> interactive magazines",this.title=$("<p>"+e+"</p>"),this.countContainer=$("<div class='cc-new-download-bar-count'>"),i=0;i<o;i++)this.countContainer.append($("<span>"+a[i]+"</span>")),(o-1-i)%3==0&&i!==o-1&&this.countContainer.append("<strong class='cc-new-download-bar-comma'>,<strong>");this.buttonContainer=$("<div></div>"),this.windowsDownload=$("<div class='cc-inline-wrapper'><a href='https://"+fh5.font.t1+".com/download/pub-html5.zip' rel='nofollow'><div class='cc-download-windows'>Download For Windows</div></a></div>"),this.macDownload=$("<div class='cc-inline-wrapper'><a href='https://"+fh5.font.t1+".com/download/"+fh5.font.t1+".zip' rel='nofollow'><div class='cc-download-apple'>Download For Mac</div></a></div>"),this.uploadPDF=$("<div class='cc-uploadPDF'>Upload PDF</div>"),this.virustotal=$("<a href='https://www.virustotal.com/en/url/c1b58803d899ca0401dbe1e4542e73b12c148130b6de1a48aa4702ce1ab5ef03/analysis/1409986716/' target='_blank' class='cc-virustotal'>Safety certification through Virustotal.</a>"),this.panel.append(this.title).append(this.countContainer).append(this.buttonContainer),this.buttonContainer.append(this.windowsDownload).append(this.macDownload),this.buttonContainer.append(this.uploadPDF),this.panel.append(this.virustotal),this.windowsDownload.on("click",this.download.bind(this)),this.macDownload.on("click",this.download.bind(this)),this.uploadPDF.on("click",function(){fh5.isLoggedIn?"1"!=fh5.isUnActivate?new FastUploadPanel:window.location.href="/activate-account/index.php":new SelectUploadMethodPanel})}function EditFolderPanel(e){var t,i,a,o,n,s,l,c,d,r,p;for(this.options=e,this.panel=$("<ul class='cc-panel'></ul>"),this.head=$("<li class='cc-bar cc-bar-header'></li>"),this.panelTitle=$("<div class='cc-title cc-left'>FOLDER SETTINGS</div>"),this.captions=$("<ul class='cc-caption-container cc-right'></ul>"),this.basicCaption=$("<li class='cc-caption cc-active cc-left'>BASIC<div class='cc-caption-triangle'><i class='fa fa-caret-up'></i></li>"),this.content=$("<li class='cc-content-ff'></li>"),this.sections=$("<ul></ul>"),this.basicSection=$("<li class='cc-section-ff'></li>"),this.title=$("<div class='cc-input-group cc-float-fix cc-float-fix'></div>"),this.titleLabel=$("<label class='cc-label cc-left' for='title'>Title</label>"),this.titleInput=$("<input class='cc-field cc-input-text cc-left' type='text' id='title' name='title' value='"+e.title+"' maxlength='255'/>"),this.titleInputHelp=$("<span class='cc-left cc-book-info-section-input-help'><i class='fa fa-angle-left'></i> Required.</span>"),this.titleValidating=$("<div class='book-edit-folder-title-validate-icon fa fa-spinner fa-spin cc-hide' title='Validating...'></div>"),this.titleValidateSuccess=$("<div class='book-edit-folder-title-validate-icon fa fa-check-circle cc-success-color cc-hide' title='This title is available'></div>"),this.titleValidateFail=$("<div class='book-edit-folder-title-validate-icon icon icon-exclamation-sign cc-error-color cc-hide' title='Folder already exists.'></div>"),this.desc=$("<div class='cc-input-group cc-float-fix cc-float-fix'></div>"),this.descLabel=$("<label class='cc-label cc-left' for='description'>Description</label>"),this.descInput=$("<textarea class='cc-field cc-textarea cc-left' id='description' name='description' maxlength='1000'>"+e.desc+"</textarea>"),this.category=$("<div class='cc-input-group cc-float-fix cc-float-fix'></div>"),this.categoryLabel=$("<label class='cc-label cc-left' for='secondaryCategory'>Category</label>"),this.categorySelect=$("<select class='cc-field cc-select cc-left' id='category' name='category'>"),this.categoryHelp=$("<span class='cc-left cc-book-info-section-input-help'><i class='fa fa-angle-left'></i> Books will be classified into this category by default.</span>"),this.type=$("<div class='cc-input-group cc-float-fix cc-float-fix cc-hide'></div>
1"),this.typeLabel=$("<label class='cc-label cc-left' for='type'>Type</label>"),this.typeSelect=$("<select class='cc-field cc-select cc-left' id='type' name='type'>"),this.language=$("<div class='cc-input-group cc-float-fix cc-float-fix cc-hide'></div>"),this.languageLabel=$("<label class='cc-label cc-left' for='language'>Language</label>"),this.languageSelect=$("<select class='cc-field cc-select cc-left' id='language' name='language'>"),this.region=$("<div class='cc-input-group cc-float-fix cc-float-fix cc-hide'></div>"),this.regionLabel=$("<label class='cc-label cc-left' for='region'>Region</label>"),this.regionSelect=$("<select class='cc-field cc-select cc-left' id='region' name='region'>"),this.foot=$("<li class='cc-bar cc-bar-footer'></li>"),this.buttons=$("<ul class='cc-button-container cc-right'></ul>"),this.buttons=$("<div class='cc-button-container'></div>"),this.closeButton=$("<span class='button-pure'>Close</span>"),this.saveAndCloseButton=$("<span class='button-pure button-pure-green'>Save And Close</span>"),this.bottomAlert=$("<div class='cc-pdf-upload-alert-bottom'></div>"),this.panel.append(this.head.append(this.panelTitle).append(this.captions.append(this.basicCaption))).append(this.content.append(this.sections.append(this.basicSection.append(this.title.append(this.titleLabel).append(this.titleInput).append(this.titleInputHelp).append(this.titleValidating).append(this.titleValidateSuccess).append(this.titleValidateFail)).append(this.category.append(this.categoryLabel).append(this.categorySelect).append(this.categoryHelp)).append(this.desc.append(this.descLabel).append(this.descInput)).append(this.type.append(this.typeLabel).append(this.typeSelect)).append(this.language.append(this.languageLabel).append(this.languageSelect)).append(this.region.append(this.regionLabel).append(this.regionSelect))))).append(this.foot.append(this.buttons.append(this.closeButton).append(this.saveAndCloseButton))),this.categorySelect.append($("<option value='0'>None</option>")),t=0,o=fh5.database.category.length;t<o;t++)for(l=fh5.database.category[t],s=$('<optgroup label="'+l.name+'"></optgroup>').appendTo(this.categorySelect),i=0,n=l.secondaryCategory.length;i<n;i++)c=l.secondaryCategory[i],s.append($("<option value='"+c.id+"' "+(c.id==e.collectionPanel.categoryId?"selected":"")+">"+c.name+"</option>"));for(t=0,a=fh5.database.type.length;t<a;t++)d=fh5.database.type[t],this.typeSelect.append($("<option value='"+d.id+"' "+(d.id==e.collectionPanel.typeId?"selected":"")+">"+d.name+"</option>"));for(t=0,a=fh5.database.language.length;t<a;t++)r=fh5.database.language[t],this.languageSelect.append($("<option value='"+r.id+"' "+(r.id==e.collectionPanel.languageId?"selected":"")+">"+r.name+"</option>"));for(t=0,a=fh5.database.region.length;t<a;t++)p=fh5.database.region[t],this.regionSelect.append($("<option value='"+p.id+"' "+(p.id==e.collectionPanel.regionId?"selected":"")+">"+p.name+"</option>"));var h=this;this.closeButton.on("click",function(){h.close()}),this.saveAndCloseButton.on("click",function(){h.save(!0)}),this.titleInput.on("blur",this.validate.bind(this))}function EmbedPanel(e){var t="";window.location.protocol.match("https:")?(t=utils.parseHttpsBookShot(e.url,1),e.url=utils.pasreHttps(e.url)):t=utils.parseBookShot(e.url,1);var i=e.uName;e.isSelf?i="your":"s"==i.substr(i.length-1).toLowerCase()?i+="'":i+="'s";var a={url:e.url,bUrl:"",width:900,height:500,startPage:1,iframeAttr:" seamless='seamless' scrolling='no' frameborder='0' allowtransparency='true' allowfullscreen='true' ",title:e.title,APIScriptCode:"//pubhtml5.com/plugin/LightBox/js/pubhtml5-light-box-api-min.js"};this.options=$.extend({},a,e,{bUrl:location.protocol+"//"+document.domain+"/bookcase/"+e.uLink}),this.embedContext=$("<div class='cc-embed-iframe-context'></div>");var o=new TabBox({tabArr:[{title:"IFrame Embed"},{title:"Lightbox Embed"}],container:this.embedContext});
1this.iframeContainer=$("<div class='cc-embed-iframe-container cc-init-background'></div>"),this.iframe=$("<iframe class='cc-embed-iframe cc-transparent'"+this.options.iframeAttr+"></iframe>"),o.getSection(0).append(this.iframeContainer.append(this.iframe)),this.lightboxContainer=$("<div class='cc-embed-light-box-container'></div>"),this.lightboxImgWrapper=$("<div class='cc-embed-light-box-img-wrapper'></div>"),this.lightboxImg=$("<img data-rel='fh5-light-box-demo' data-href='"+this.options.url+"' data-width='"+this.options.width+"' data-height='"+this.options.height+"' data-title='"+utils.encodeHTML(e.title)+"' src='"+t+"'/>"),this.lightboxBarWrapper=$("<div class='cc-embed-light-box-bar-wrapper cc-hide'></div>"),this.lightboxBar=$("<img class='' src='/images/home-slider-book-bar.png'>"),this.lightboxTip=$("<div class='cc-embed-light-box-tip'>Click the book thumbnail below to open this book in a LightBox<i class='icon icon-hand-down'></i></div>"),o.getSection(1).append(this.lightboxContainer.append(this.lightboxBarWrapper.append(this.lightboxBar)).append(this.lightboxImgWrapper.append(this.lightboxImg).append(this.lightboxTip))).append(this.optionContext),this.bIframeContext=$("<div class='cc-embed-iframe-container-middle cc-bookcase-embed-bookcase-background'></div>"),this.bIframe=$("<iframe class='cc-embed-iframe cc-transparent'"+this.options.iframeAttr+"></iframe>");var n=$("<div class='cc-embed-option-context'></div"),i=$("<div class='tb-section tb-section-active'></div>"),a=$("<div class='tb-section'></div>"),t=$("<div class='tb-section'></div>");o.bindTabClickFn([i,a,t]),this.iframePageSelect=$("<select class='cc-select cc-select-auto'></select>");for(var s=1;s<=e.pages;s++)this.iframePageSelect.append($("<option value='"+s+"'>"+s+"</option>"));this.iframeStepContainer=$("<div></div>"),this.iframeStep1=$("<div class='cc-input-group-l cc-float-fix'></div>"),this.iframeStepTitle1=$("<p class='cc-embed-step'>1. Copy the Embed Code below and paste it into your HTML file.</p>"),this.iframeStepCode1=$("<textarea class='cc-embed-code-textarea cc-textarea'></textarea>"),i.append($("<div class='cc-input-group-l'></div>").append("<label class='cc-embed-label'>Start on page:</label>").append(this.iframePageSelect)).append("<div class='cc-embed-title'>Steps:</div>").append(this.iframeStepContainer.append(this.iframeStep1.append(this.iframeStepTitle1).append(this.iframeStepCode1))),this.lightboxPageSelect=$("<select class='cc-select cc-select-auto'></select>");for(s=1;s<=e.pages;s++)this.lightboxPageSelect.append($("<option value='"+s+"'>"+s+"</option>"));this.optionsTitleInput=$("<input class='cc-input-text' value='"+e.title+"'></input>"),this.lightboxStepContainer=$("<div></div>"),this.lightboxStep1=$("<div class='cc-input-group-l cc-float-fix'></div>"),this.lightboxStepTitle1=$("<p class='cc-embed-step'>1. Load the LightBox Api between the head tag in your HTML file.</p>"),this.lightboxStepCode1=$("<textarea class='cc-embed-code-textarea cc-textarea cc-embed-code-textarea-single'><script src='"+this.options.APIScriptCode+"'><\/script></textarea>"),this.lightboxStep2=$("<div class='cc-input-group-l cc-float-fix'></div>"),this.lightboxStepTitle2=$("<p class='cc-embed-step'>2. Add the following attritubes to the element which your want to trigger the LightBox when clicked.</p>"),this.lightboxStepCode2=$("<textarea class='cc-embed-code-textarea cc-textarea'>class='cc-light-box-demo' data-title='Disney Story Book' data-href='//static.pubhtml5.com/web/demo/Disnep storybook/index.html'</textarea>"),this.demo=$("<div class='cc-embed-title'>Demo:</div>"),this.demoContainer=$("<div></div>"),this.demoGroup=$("<div class='cc-input-group-l cc-float-fix'></div>"),this.demoTitle=$("<p class='cc-embed-step'>The following is a demo of your HTML file.</p>"),this.demoCode=$("<textarea class='cc-embed-code-textarea cc-textarea cc-embed-code-textarea-demo'></textarea>"),a.append($("<div class='cc-input-group-l'></div>").append("<label class='cc-embed-label'>Start on page:</label>").append(this.lightboxPageSelect)).append($("<div class='cc-input-group-l'></div>").append("<label class='cc-embed-label'>Title:</label>").append(this.optionsTitleInput)).append("<div class='cc-embed-title'>Steps:</div>").append(this.lightboxStepContainer.append(this.lightboxStep1.append(this.lightboxStepTitle1).append(this.lightboxStepCode1)).append(this.lightboxStep2.append(this.lightboxStepTitle2).append(this.lightboxStepCode2))).append(this.demo).append(this.demoContainer.append(this.demoGroup.append(this.demoTitle).append(this.demoCode))),this.optionsSkin=$("<div class='cc-input-group-l'></div>"),this.optionsSkinLabel=$("<label class='cc-embed-label'>Skin:</label>"),this.optionsSkinRedLabel=$("<label class='cc-embed-square cc-bookcase-embed-skin cc-bookcase-embed-skin-red' for='red'></label>"),this.optionsSkinRedRadio=$("<input class='cc-embed-radio' type='radio' name='skin' id='red' checked></input>"),this.optionsSkinGoldLabel=$("<label class='cc-embed-square cc-bookcase-embed-skin cc-bookcase-embed-skin-gold' for='gold'></label>"),this.optionsSkinGoldRadio=$("<input class='cc-embed-radio' type='radio' name='skin' id='gold'></input>
1"),this.optionsSkinSilverLabel=$("<label class='cc-embed-square cc-bookcase-embed-skin cc-bookcase-embed-skin-silver' for='silver'></label>"),this.optionsSkinSilverRadio=$("<input class='cc-embed-radio' type='radio' name='skin' id='silver'></input>"),this.optionsSkinGreenLabel=$("<label class='cc-embed-square cc-bookcase-embed-skin cc-bookcase-embed-skin-green' for='green'></label>"),this.optionsSkinGreenRadio=$("<input class='cc-embed-radio' type='radio' name='skin' id='green'></input>"),this.optionsSkinYellowLabel=$("<label class='cc-embed-square cc-bookcase-embed-skin cc-bookcase-embed-skin-yellow' for='yellow'></label>"),this.optionsSkinYellowRadio=$("<input class='cc-embed-radio' type='radio' name='skin' id='yellow'></input>"),this.bIframeStepCode1=$("<textarea class='cc-embed-code-textarea cc-textarea'></textarea>"),t.append(this.optionsSkin.append(this.optionsSkinLabel).append(this.optionsSkinRedLabel.append(this.optionsSkinRedRadio)).append(this.optionsSkinGoldLabel.append(this.optionsSkinGoldRadio)).append(this.optionsSkinSilverLabel.append(this.optionsSkinSilverRadio)).append(this.optionsSkinGreenLabel.append(this.optionsSkinGreenRadio)).append(this.optionsSkinYellowLabel.append(this.optionsSkinYellowRadio))).append($("<div class='cc-embed-title'>Steps:</div>")).append($("<div></div>").append($("<div class='cc-input-group-l cc-float-fix'></div>").append("<p class='cc-embed-step'>1. Copy the Embed Code below and paste it into your HTML file.</p>").append(this.bIframeStepCode1))),this.stylingOptions=$("<div class='cc-embed-title'>Options:</div>"),this.size=$("<div class='cc-input-group-l'></div>"),this.sizeLabel=$("<label class='cc-embed-label'>Size:</label>"),this.smallLabel=$("<label class='cc-embed-square cc-embed-small' for='small'></label>"),this.smallRadio=$("<input class='cc-embed-radio' type='radio' name='size' id='small'></input>"),this.middleLabel=$("<label class='cc-embed-square cc-embed-middle' for='middle'></label>"),this.middleRadio=$("<input class='cc-embed-radio' type='radio' name='size' id='middle'></input>"),this.largeLabel=$("<label class='cc-embed-square cc-embed-large' for='large'></label>"),this.largeRadio=$("<input class='cc-embed-radio' type='radio' name='size' id='large' checked></input>"),this.customLabel=$("<label class='cc-embed-custom' for='custom'></label>"),this.customWidthInput=$("<input type='number' class='cc-input-text cc-embed-number-input'> X </input>"),this.customHeightInput=$("<input type='number' class='cc-input-text cc-embed-number-input'></input>"),this.customPx=$("<span class='cc-embed-custom-px'> px</span>"),this.customHelp=$("<span class='cc-embed-custom-help'><span class='cc-star'>*</span> Press \"Enter\" Button on the keyboard to apply your changes.</span>"),this.customRadio=$("<input class='cc-embed-radio' type='radio' name='size' id='custom'></input>"),this.lightbox=new LightBox("Embed this book into your website","",996,"",2),this.lightbox.getSaveButton().hide(),this.lightbox.getPanel().append(this.embedContext).append(this.stylingOptions).append(this.size.append(this.sizeLabel).append(this.smallLabel.append(this.smallRadio)).append(this.middleLabel.append(this.middleRadio)).append(this.largeLabel.append(this.largeRadio)).append(this.customLabel.append(this.customWidthInput).append(this.customHeightInput).append(this.customRadio)).append(this.customPx).append(this.customHelp)).append(n.append(i).append(a).append(t));var l=this;setTimeout(function(){l.iframe.attr("src",l.options.url),setTimeout(function(){l.iframe.removeClass("cc-transparent"),l.resizeIframe(l.options.width,l.options.height)},50)},200),setTimeout(function(){l.bIframe.attr("src",l.options.bUrl),setTimeout(function(){l.bIframe.removeClass("cc-transparent"),l.resizeIframe(l.options.width,l.options.height)},50)},200),$([this.iframeStepCode1,this.lightboxStepCode1,this.lightboxStepCode2,this.demoCode]).each(function(){var e=$
1(this);e.on("click",utils.selectCode.bind(utils,e))}),$([this.smallLabel,this.smallRadio]).each(function(){$(this).on("click",l.resizeIframe.bind(l,400,250))}),$([this.middleLabel,this.middleRadio]).each(function(){$(this).on("click",l.resizeIframe.bind(l,700,400))}),$([this.largeLabel,this.largeRadio]).each(function(){$(this).on("click",l.resizeIframe.bind(l,900,500))}),$([this.customWidthInput,this.customHeightInput]).each(function(){var e=$(this);e.on("focus",function(){l.customRadio[0].checked=!0}),e.on("change",function(){l.customRadio[0].checked=!0,l.resizeIframe(l.customWidthInput.val(),l.customHeightInput.val())}),e.on("blur",function(){l.resizeIframe(l.customWidthInput.val(),l.customHeightInput.val())}),e.on("keypress",function(e){13==e.which&&l.resizeIframe(l.customWidthInput.val(),l.customHeightInput.val())})}),this.optionsTitleInput.on("blur",function(){l.options.title=$(this).val().trim(),l.setCode(!0)}),this.optionsSkin.find("input[name=skin]").on("change",function(){var e=l.options.bUrl+"/"+this.id;l.bIframe.attr("src",e),l.setCode(!1,e)}),this.iframePageSelect.on("change",this.changeStartPage.bind(this,this.iframePageSelect)),this.lightboxPageSelect.on("change",this.changeStartPage.bind(this,this.lightboxPageSelect)),setTimeout(function(){utils.loadFile(l.options.APIScriptCode)},400),this.lightbox.launch()}function FastUploadPanel(){this.lightBox=new LightBox("Upload","",650),this.buttons=$("<ul class='cc-light-box-buttons'></ul> "),this.cancelButton=$("<li class='button-pure'>Cancel</li>"),this.nextButton=$("<li class='button-pure button-pure-green'>Next</li>"),this.lightBox.box.append(this.buttons.append(this.cancelButton).append(this.nextButton)),this.lightBox.launch();var o=this;this.cancelButton.on("click",function(){o.lightBox.cancel()}),$.ajax({url:"/center/db/db-get-folder-info.php",type:"POST",dataType:"json",data:{uId:fh5.uId},beforeSend:function(){utils.addMask(o.lightBox.box,{text:"Loading...",fontSize:"20px"})},success:function(e,t,i){var a;1==e.status?(utils.removeMask(o.lightBox.box),(a=new FolderPanel(e.folders,"Choose a folder")).panel.insertBefore(o.buttons),o.lightBox.resize(),fh5.upload_url=e.upload_url,fh5.upload_inputs=e.upload_inputs,fh5.upload_prefix=e.upload_prefix,o.nextButton.on("click",function(){var e=o.lightBox.box.height(),t=o.lightBox.box.width(),i=new BookEditPanel({uId:fh5.uId,cId:a.getVal(),isFastUpload:!0,lightBox:o.lightBox,convertFailContainer:o.lightBox.box,configFailContainer:o.lightBox.box,bookContainer:o.lightBox.box,isNew:!0,t
1ype:"1",categoryId:a.getCategoryId(),upload_url:fh5.upload_url,upload_inputs:fh5.upload_inputs,upload_prefix:fh5.upload_prefix});o.lightBox.clear().box.css({width:t,height:e}).animate({width:960,height:629,left:"+="+(t-960)/2,top:"+="+(e-629)/2},200,function(){o.lightBox.box.append(i.panel)})})):utils.errorMask(o.lightBox.box,e)},error:function(e,t,i){utils.errorMask(o.lightBox.box)}})}function FastUploadWithoutLoginPanel(e){this.options=e,this.lightBox=new LightBox("Upload PDF","Upload, Convert and Publish. 3 steps to get your publication read by millions of readers worldwide in minutes.",1050,"gray",2),this.container=$("<div class='cc-upload-without-login-container'></div>"),this.uploadButtonContainer=$("<div class='cc-upload-without-login-button-container'></div>"),this.uploadText=$("<p class='cc-upload-without-login-welcome-text'>New to PubHTML5? Let us guide you tour PubHTML5.</p>"),this.uploadButton=$("<div class='button-pure button-pure-blue cc-upload-without-login-upload-button cc-upload-without-login-button'>Select a pdf file from your computer</div>"),this.uploadInput=$("<input class='cc-hidden-input' type='file' name='files[]' accept='application/pdf'/>"),this.uploadingContainer=$("<div class='cc-upload-without-login-uploading-container cc-hide'></div>"),this.uploadingText=$("<p>Uploading...</p>"),this.uploadingProgress=$("<div class='cc-progress'></div>"),this.uploadingProgressBar=$("<div class='cc-progress-bar'></div>"),this.convertingContainer=$("<div class='cc-upload-without-login-uploading-container cc-hide'></div>"),this.convertingText=$("<p>Processing...</p>"),this.convertingProgress=$("<div class='cc-progress'></div>"),this.convertingProgressBar=$("<div class='cc-progress-bar'></div>
1"),this.iframeContainer=$("<div class='cc-upload-without-login-iframe-container'></div>"),this.iframe=$("<iframe src='' frameborder='0' allowfullscreen></iframe>"),this.stepContainer=$("<div class='cc-upload-without-login-step-container'>1 / 3</div>"),this.signInToUploadCpntainer=$("<div class='cc-upload-without-login-container-2'></div>"),this.signInToUploadButtonContainer=$("<div class='cc-upload-without-login-button-container'></div>"),this.signInToUploadButton=$("<div class='button-pure button-pure-blue button-pure-green cc-upload-without-login-upload-button cc-upload-without-login-button'>Sign in to Upload</div>"),this.signInToUploadText=$("<p class='cc-upload-without-login-welcome-text'>Already have an account? Sign in to upload here.</p>"),this.signUpContainer=$("<div class='cc-upload-without-login-sign-up-container cc-hide'></div>"),this.signUpTitle=$("<p>Convert Finished! Sign up to get your online flipbook for <strong class='cc-green'>Free</strong> now!</p>"),this.logInMid=$("<div class='cc-upload-without-login-form-container cc-float-fix'></div>"),this.signUpForm=$("<div class='cc-upload-without-login-form'></div>"),this.signUpEmail=$("<div class='cc-input-group cc-float-fix'></div>"),this.signUpEmailLabel=$("<label class='cc-label cc-log-in-label'><i class='icon icon-envelope'></i><i class='fa fa-caret-right'></i></label>"),this.signUpEmailInputWrapper=$("<span class='cc-inline-wrapper cc-left'></span>"),this.signUpEmailInput=$("<input class='cc-field cc-input-text cc-log-in-input' type='email' value='' placeholder='E-mail' maxlength='255'/>"),this.signUpEmailInfoIcon=$("<i class='cc-info-icon icon icon-info-sign cc-log-in-info-icon'></i>"),this.signUpEmailInfo=$("<div class='cc-hints-title'>Guidelines:</div><ul class='cc-disc-ul'><li>Enter your primary email address as your PubHTML5 ID. This will be used as the contact email address for your account.</li><li>We will not share your information with anyone else unless you authorize us to do so.</li></ul>"),this.signUpEmailLoading=$("<div class='cc-icon-left fa fa-spinner fa-spin cc-hide' title='Validating...'></div>"),this.signUpEmailOk=$("<div class='cc-icon-left fa fa-check-circle cc-success-color cc-hide' title='This email is available'></div>"),this.signUpEmailNotOk=$("<div class='cc-icon-left icon icon-exclamation-sign cc-error-color cc-hide' title='User already exists'></div>
1"),this.signUpPassword=$("<div class='cc-input-group cc-float-fix'></div>"),this.signUpPasswordLabel=$("<label class='cc-label cc-log-in-label'><i class='icon icon-lock'></i><i class='fa fa-caret-right'></i></label>"),this.signUpPasswordInput=$("<input class='cc-field cc-input-text cc-log-in-input' type='password' value='' placeholder='Password' maxlength='255'/>"),this.signUpReTypePassword=$("<div class='cc-input-group cc-float-fix'></div>"),this.signUpReTypePasswordLabel=$("<label class='cc-label cc-log-in-label'><i class='icon icon-lock'></i><i class='fa fa-caret-right'></i></label>"),this.signUpReTypePasswordInput=$("<input class='cc-field cc-input-text cc-log-in-input' type='password' placeholder='Re-Type password' value='' maxlength='255'/>"),this.signUpTermsOfService=$("<p class='cc-log-in-terms-of-service cc-text-left'>By signing up you agree to our <a class='cc-blue-link-3' target='_blank' href='/terms-of-service.php'>Terms of Service</a>.</p>"),this.signUpButtonContainer=$("<div class='cc-log-in-button-container'></div>"),this.signUpButton=$("<div class='cc-sign-up-button button-pure button-pure-green'>Sign Up</div>"),this.signUpProgressWrapper=$("<div class='cc-log-in-progress-bar-wrapper progress progress-success progress-striped active cc-hidden'></div>"),this.signUpProgressBar=$("<div class='cc-log-in-progress-bar bar'></div>"),this.signUpHelp=$("<div class='cc-sign-up-input-help'></div>"),this.logInNetworkContainer=$("<div class='cc-upload-without-login-social-container'></div>"),this.logInNetworkText=$("<p class='cc-upload-without-login-social-text'>Or use your social network account to sign in.</p>"),this.logInNetworkButtonContainer=$("<div class='cc-upload-without-login-social-button-container'></div>"),this.logInNetworkFBContainer=$("<div class='cc-inline-wrapper'></div>"),this.logInNetworkFB=$("<div id='cc-facebook-login-btn-id' class='button-pure button-pure-blue ff-log-in-network-fb ff-log-in-network-fb-s'><i class='fa fa-facebook'></i><span>SIGN IN WITH FACEBOOK</span></div>"),this.logInNetworkFBProgressWrapper=$("<div class='cc-log-in-progress-bar-wrapper progress progress-striped active cc-hidden'></div>"),this.logInNetworkFBProgressBar=$("<div class='cc-log-in-progress-bar bar'></div>"),this.logInNetworkGGContainer=$("<div class='cc-inline-wrapper cc-margin-left-20'></div>"),this.logInNetworkGG=$("<div id='cc-google-login-btn-id' class='button-pure button-pure-red ff-log-in-network-gg ff-log-in-network-gg-s'><i class='fa fa-google-plus'></i><span>SIGN IN WITH GOOGLE</span></div>"),this.logInNetworkGGProgressWrapper=$("<div class='cc-log-in-progress-bar-wrapper progress progress-danger progress-striped active cc-hidden'></div>"),this.logInNetworkGGProgressBar=$("<div class='cc-log-in-progress-bar bar'></div>"),this.logInSocialHelp=$("<div id='cc-log-in-social-help' class='cc-log-in-social-help'></div>"),this.lightBox.getPanel().append(this.container.append(this.uploadButtonContainer.append(this.uploadText).append(this.uploadButton.append(this.uploadInput))).append(this.uploadingContainer.append(this.uploadingText).append(this.uploadingProgress.append(this.uploadingProgressBar))).append(this.convertingContainer.append(this.convertingText).append(this.convertingProgress.append(this.convertingProgressBar))).append(this.signUpContainer.append(this.signUpTitle).append(this.logInMid.append(this.signUpForm.append(this.signUpEmail.append(this.signUpEmailLabel).append(this.signUpEmailInputWrapper.append(this.signUpEmailInput).append(this.signUpEmailInfoIcon)).append(this.signUpEmailLoading).append(this.signUpEmailOk).append(this.signUpEmailNotOk)).append(this.signUpPassword.append(this.signUpPasswordLabel).append(this.signUpPasswordInput)).append(this.signUpReTypePassword.append(this.signUpReTypePasswordLabel).append(this.signUpReTypePasswordInput)).append(this.signUpTermsOfService).append(this.signUpButtonContainer.append(this.signUpButton).append(this.signUpProgressWrapper.append(this.signUpProgressBar))).append(this.signUpHelp)).append(this.iframeContainer.append(this.iframe))).append(this.logInNetworkContainer.append(this.logInNetworkText).append(this.logInNetworkButtonContainer.append(this.logInNetworkFBContainer.append(this.logInNetworkFB).append(this.logInNetworkFBProgressWrapper.append(this.logInNetworkFBProgressBar))).append(this.logInNetworkGGContainer.append(this.logInNetworkGG).append(this.logInNetworkGGProgressWrapper.append(this.logInNetworkGGProgressBar))).append(this.logInSocialHelp)))).append(this.stepContainer)).append(this.signInToUploadCpntainer.append(this.signInToUploadButtonContainer.append(this.signInToUploadText).append(this.signInToUploadButton)));var s=this;this.signInToUploadButton.on("click",function(){s.lightBox.cancel(),new SignInPanel({isFastUpload:!0})}),$(document).bind("drop dragover",function(e){e.preventDefault()}),s.container.on("dragover",function(){s.container.addClass("cc-drag-over")}),s.container.on("dragleave drop",function(){s.container.removeClass("cc-drag-over")}),this.uploadInput.fileupload({url:"/upload-control/index.php",dropZone:s.container,pasteZone:null,dataType:"json",dropZone:s.uploadFileZone,add:function(e,t){var i,a=t.files[0],o=t.originalFiles[0].name,n=o.substr(0,o.lastIndexOf(".")),o=a.name.substring(a.name.lastIndexOf(".")+1).toLowerCase();s.lightBox.getWarningBox().empty().hide(),n.match(/[\u4E00-\u9FA5]/)?s.lightBox.getWarningBox().html(fh5.pageData.tips.ChineseError).show():-1==fh5.pageData.types.indexOf(o)?s.lightBox.getWarningBox().html("* File is not an allowed file type! Only support PDF file.").show():157286400<a.size?s.lightBox.getWarningBox().html("* Too large! File size exceeds 150 MB.").show():(s.originalFileName=n,s.uploadButtonContainer.hide(),s.uploadingContainer.show(),s.signInToUploadCpntainer.hide(),i=t.submit(),s.lightBox.setCancelCallback(function(){i.abort()}))},progress:function(e,t){s.uploadingProgressBar.width(parseInt(t.loaded/t.total*100,10)+"
1%")},done:function(e,t){t=t.result.files[0];t.error?(s.lightBox.getWarningBox().html("* "+t.error).show(),s.uploadButtonContainer.show(),s.uploadingContainer.hide(),s.uploadingProgressBar.width("0%")):(s.fileName=decodeURIComponent(t.url.substring(t.url.indexOf("files/")+6)),$.ajax({type:"post",url:"/hostInfo/visitor-add-book-online.php",dataType:"json",data:{filename:s.fileName,template:fh5.pageData.templates[fh5.templateId].name,theme:fh5.pageData.themes[fh5.themeId],bookConfig:JSON.stringify(fh5.pageData.bookConfig)},beforeSend:function(){},success:function(e){"1"==e.status?(s.bookId=e.bookId,s.url=e.url,s.uploadingContainer.hide(),s.convertingContainer.show(),s.stepContainer.html("2 / 3"),s.requestConvertProgress()):(s.lightBox.getWarningBox().html("* Upload Failed. Please try again.").show(),s.uploadButtonContainer.show(),s.uploadingContainer.hide(),s.uploadingProgressBar.width("0%"))}}))}}),this.logInNetworkFB.on("click touchstart",function(){utils.facebookLogin({id:this.id,helpId:"cc-log-in-social-help",isFastUpload:!1,lightBox:s.lightBox,isNoLoginUpload:!0,bookId:s.bookId})}),this.logInNetworkGG.on("click touchstart",function(){utils.googleLogin({id:this.id,helpId:"cc-log-in-social-help",isFastUpload:!1,lightBox:s.lightBox,isNoLoginUpload:!0,bookId:s.bookId})}
1),this.signUpEmailInput.on("blur",function(){var e=$(this).val().trim();""!=e&&utils.validate("email",$(this),s.signUpHelp,!1,null,"!")&&$.ajax({type:"post",url:"/userLoad/check-email.php",dataType:"json",beforeSend:function(){s.signUpEmailLoading.show(),s.signUpEmailOk.hide(),s.signUpEmailNotOk.hide()},data:{email:e},success:function(e){s.signUpEmailLoading.hide(),"1"==e.status?s.signUpEmailOk.show():(s.signUpEmailNotOk.show(),s.signUpHelp.html("<i class='icon icon-exclamation-sign'></i> User already exists."))}})}),this.signUpPasswordInput.on("blur",function(){utils.validate("password",$(this),s.signUpHelp,!1,null,"!")}),this.signUpReTypePasswordInput.on("blur",function(){utils.validate("repassword",$(this),s.signUpHelp,!1,s.signUpPasswordInput.val(),"!")}),this.signUpForm.find("input").on("keypress",function(e){13==e.which&&s.signUp()}),this.signUpButton.on("click",this.signUp.bind(this)),this.signUpEmailInfoIcon.hints({content:this.signUpEmailInfo}),this.lightBox.getSaveButton().hide(),this.lightBox.getCloseButton().text("Cancel"),this.lightBox.launch()}function FixedLightBox(e,t,i,a){this.isMobile=utils.isMobile();var o=$("<div class='hf-lightbox'></div>"),n=$("<div class='hf-lightbox-bg'></div>"),s=$("<div class='hf-lightbox-wrapper'></div>"),l=$("<div class='hf-lightbox-dialog sh5-table'></div>"),c=$("<div class='sh5-table-centered'></div>"),d=$("<div class='hf-lightbox-content modal-dialog'></div>").addClass("1"==i?"modal-lg":"2"==i?"modal-mlg modal-lg":"3"==i?"modal-xsedit":""),r=$("<div class='hf-lightbox-close'></div>"),p=$("<div class='hf-lightbox-header'></div>"),h=$("<div class='hf-lightbox-title'>"+e+"</div>").addClass(e?"":"cc-hide"),u=$("<div class='hf-lightbox-desc'>"+t+"</div>").addClass(t?"":"cc-hide"),g=$("<div class='hf-lightbox-panel'></div>"),b=$("<div class='hf-lightbox-btns'></div>"),m=$("<div class='button-pure'>Cancel</div>"),f=$("<div class='button-pure button-pure-green'>Save</div>"),v=$("<div class='hf-lightbox-loading sh5-table'><div class='sh5-table-centered'><i class='fa fa-spinner fa-spin'></i></div></div>"),i=$("<div class='hf-light-box-warning cc-hide'></div>"),e=$("<div></div>"),t=$("<i class='hf-light-box-warning-close-btn fa fa-times-circle'></i>"),k=this;t.on("click",function(){k.hideError()}),this.opt=$.extend({},{hasBtns:!1,isEasyClose:!1,isLoading:!1,isHasBg:!1,hasPadding:!1},a),n.addClass(this.opt.isHasBg?"disabled":""),g.addClass(this.opt.hasPadding?"padding-15":""),o.append(n).append(s.append(l.append(c.append(d.append(p.append(h).append(u)).append(g.append(i.append(e).append(t))).append(r))))),this.opt.hasBtns&&d.append(b.append(m).append(f)),this.$lightBox=o,this.$bg=n,this.$wrapper=s,this.$panel=g,this.$title=h,this.$btns=b,this.$cancelBtn=m,this.$saveBtn=f,this.$inDialog=c,this.$lightContent=d,this.$loading=v,this.$lightClose=r,this.$lightHeader=p,this.$warningBox=i,this.$warningBoxText=e,m.on("click",this.cancel.bind(this)),r.on("click",this.cancel.bind(this))}function FolderPanel(e,t){var i,a;for(this.panel=$("<div class='cc-light-box-content-panel'></div>"),this.desc=$("<span class='cc-move-to'>"+t+"</span>"),this.collectionSelect=CalculateWidth(),this.panel.append(this.desc).append(this.collectionSelect),i=0,a=e.length;i<a;i++)1<parseInt(e[i].bookNum,10)?this.collectionSelect.append($("<option data-categoryid = '"+e[i].categoryid+"' value='"+e[i].id+"'>"+e[i].title+" ("+e[i].bookNum+" books)</option>")):this.collectionSelect.append($("<option data-categoryid = '"+e[i].categoryid+"' value='"+e[i].id+"'>"+e[i].title+" ("+e[i].bookNum+" book)</option>"))}function CalculateWidth(){var e=.22*window.innerWidth;return $("<select class='cc-move-to-anthother-folder-select cc-select' style='width: "+e+"px'></select>")}function ImageGalleryPanel(e,t){this.panel=$("<div class='cc-gallery-content'></div>"),this.buttonContainer=$("<div class='cc-float-fix'></div>"),this.addButton=$("<div class='cc-hidden-input-wrapper button-pure button-pure-sky-blue cc-left'><i class='icon icon-picture'></i> Add Image</div>"),this.addImageFileInput=$("<input class='cc-hidden-input' type='file' id='slideshow-add-image' accept='image/png,image/jpeg' multiple></span>"),this.errorMessage=$("<span class='cc-error cc-line-height-25 cc-margin-left-20'></span>"),this.deleteAllButton=$("<div class='button-pure button-pure-red button-no-text cc-right' title='Delete All'><i class='icon icon-trash'></i></div>"),this.list=$("<div class='cc-image-gallery-container cc-float-fix'></div>
1"),this.uploadingObj={};var s=this;for(i=0,len=e.length;i<len;i++)this.add("https://"+fh5.AS3BucketName+"/"+fh5.uLink+"/"+t+"/"+e[i]);this.deleteAllButton.on("click",this.deleteAll.bind(this)),this.panel.append(this.buttonContainer.append(this.addButton.append(this.addImageFileInput)).append(this.errorMessage).append(this.deleteAllButton)).append(this.list),this.addImageFileInput.fileupload({url:"/upload-control/index.php",dropZone:null,pasteZone:null,formAcceptCharset:"utf-8",dataType:"json",context:s,add:function(e,t){var i,a=t.files[0],o=t.originalFiles[0],n=o.name.substr(0,o.name.lastIndexOf(".")),o=a.name.substr(a.name.length-3).toLowerCase(),a=a.name;s.errorMessage.empty(),n.match(/[\u4E00-\u9FA5]/)?i=fh5.pageData.tips.ChineseError:"jpg"!==o&&"png"!==o&&(i=fh5.pageData.tips.ImageFormatsError),i?s.errorMessage.html(i):(s.uploadingObj[a]=s.add(),s.uploadingObj[a].progress.show(),s.uploadingObj[a].progressBar.width(0),s.uploadingObj[a].container.data("name",a),t.submit())},progress:function(e,t){s.uploadingObj[t.files[0].name]&&s.uploadingObj[t.files[0].name].progressBar.width(parseInt(t.loaded/t.total*100,10)+"%")},done:function(e,t){var i,a;s.uploadingObj[t.files[0].name]&&(i=t.result.files[0],t=t.files[0].name,a=s.uploadingObj[t],i.error?(s.errorMessage.text("* "+t+" upload failed."),a.container.fadeOut(function(){a.container.remove()})):utils.autoFit(a.container,a.img.attr("src",utils.pasreHttps(i.url))),a.progress.hide(),a.progressBar.width(0),delete s.uploadingObj[t])}})}function ImageSlider(e,t,i){this.panel=$("<div class='cc-light-box-content-panel-no-padding'></div>"),this.container=$("<div class='cc-image-slider-container'></div>"),this.img=$("<img>"),this.infoContainer=$("<div class='cc-image-slider-info-container'></div>"),this.title=$("<p></p>"),this.desc=$("<p></p>"),this.controlPanel=$("<div class='cc-image-slider-control-panel'></div>"),this.prevButton=$("<div class='button button-rounded'>Prev</div>"),this.nextButton=$("<div class='button button-rounded'>Next</div>"),this.lightBox=new LightBox(e,"",1050,"white"),this.lightBox.openBackgroundClose(),this.current=i,this.last=utils.getPropNum(t),this.data=t,this.skipTo(i),this.lightBox.getBox().append(this.panel.append(this.container.append(this.img)).append(this.infoContainer.append(this.title).append(this.desc).append(this.controlPanel.append(this.prevButton).append(this.nextButton)))),this.lightBox.launch(),this.prevButton.on("click",this.prev.bind(this)),this.nextButton.on("click",this.next.bind(this))}function KeepPrivateGroup(){var e=fh5.pageData.upgrade.KeepPrivate,t=(new Date).getTime();this.group=$("<span class='cc-keep-private-group'></span>"),this.checkbox=$("<input class='cc-checkbox' type='checkbox' id='keepPrivate"+t+"'></input>"),this.label=$("<label class='cc-checkbox-label' type='checkbox' for='keepPrivate"+t+"'> "+e.title+" </label>"),this.icon=$("<i class='cc-icon-fix icon icon-info-sign'></i>"),this.hint=$("<div></div>"),this.hintTitle=$("<div class='cc-hints-title'>Guidelines:</div>"),this.hintContent=$("<ul class='cc-disc-ul'></ul>");for(var i=0,a=e.guidelines.length;i<a;i++)this.hintContent.append($("<li>"+e.guidelines[i]+"</li>"));this.hint.append(this.hintTitle).append(this.hintContent),this.group.append(this.checkbox).append(this.label).append(this.icon),this.icon.hints({content:this.hint});var o=this;this.checkbox.on("click",function(){"0"==fh5.uType&&(o.checkbox[0].checked=!1,new UpgradePanel(e))})}function LightBox(e,t,i,a,o){switch(this.background=$("<div class='cc-light-box-background'></div>"),this.box=$("<div class='cc-light-box'></div>").width(i),this.headContainer=$("<div class='cc-light-box-head-container'>"),this.title=$("<div class='cc-light-box-title cc-hide'>"+e+"</div>"),this.desc=$("<div class='cc-light-box-desc cc-hide'>"+t+"</div>"),this.arrow=$("<i class='fa fa-caret-down'></i>"),this.cancelButton=$("<div class='cc-light-box-cancel-button' title='Close'></div>"),this.cancelIcon=$("<i class='icon icon-remove'></i>"),this.panel=$("<div></div>"),this.buttonGroup=$("<div></div>"),this.saveButton=$("<div class='button-pure button-pure-green'>Save</div>"),this.closeButton=$("<div class='button-pure'>Close</div>"),this.warningBox=$("<div class='cc-light-box-warning cc-hide'></div>"),a){case"black":this.box.addClass("cc-light-box-black"),this.title.addClass("cc-light-box-title-black"),this.desc.addClass("cc-light-box-desc-black"),this.buttonGroup.addClass("cc-light-box-buttons"),this.panel.addClass("cc-light-box-content-panel-black");break;case"white":this.box.addClass("cc-light-box-white"),this.title.addClass("cc-light-box-title-white"),this.cancelButton.addClass("cc-light-box-cancel-button-small"),this.buttonGroup.addClass("cc-light-box-buttons"),this.panel.addClass("cc-light-box-content-panel");break;case"gray":this.box.addClass("cc-light-box-gray"),this.headContainer.addClass("cc-light-box-head-gray"),this.headContainer.append(this.arrow),this.title.addClass("cc-light-box-title-gray"),this.desc.addClass("cc-light-box-desc-gray"),this.cancelButton.addClass("cc-light-box-cancel-button-gray"),this.buttonGroup.addClass("cc-light-box-buttons-gray"),this.panel.addClass("cc-light-box-content-panel-gray");break;default:this.panel.addClass("cc-light-box-content-panel"),this.buttonGroup.addClass("cc-light-box-buttons")}switch(e&&this.title.removeClass("cc-hide"),t&&this.desc.removeClass("cc-hide"),this.box.append(this.headContainer.append(this.title).append(this.desc).append(this.warningBox)).append(this.cancelButton.append(this.cancelIcon)),this.cancelCallback=null,this.enableBackgroun
1dClose=!1,o){case 2:this.box.append(this.panel).append(this.buttonGroup.append(this.saveButton).append(this.closeButton));break;case 3:this.box.append(this.panel)}this.document=$(document),$(window).on("resize",this.resize.bind(this,0)),this.cancelButton.on("click",this.cancel.bind(this)),this.closeButton.on("click",this.cancel.bind(this)),this.background.on("click",this.handleBackgroundClick.bind(this))}function LogPanel(){this.panel=$("<div class='cc-log-panel'></div>"),this.buttons=$("<div class='cc-log-buttons'></div>"),this.showButton=$("<div class='button button-highlight'><span class='icon icon-arrow-left'></span></div>"),this.hideButton=$("<div class='button button-highlight'><span class='icon icon-arrow-right'></span></div>"),this.clearButton=$("<div class='button button-caution'><span class='icon icon-trash'></span></div>"),this.messages=$("<div class='cc-log-messages'></div>"),this.messagePanel=$("<ul></ul>"),this.panel.append(this.buttons.append(this.showButton).append(this.hideButton).append(this.clearButton)).append(this.messages.append(this.messagePanel)),this.showButton.on("click",this.show.bind(this)),this.hideButton.on("click",this.hide.bind(this)),this.clearButton.on("click",this.clear.bind(this)),this.panel.appendTo($("body"))}function NewFolderPanel(e){var t,i,a,o,n,s,l,c,d,r,p;for(this.options=e,this.panel=$("<ul class='cc-panel-no-margin'></ul>"),this.head=$("<li class='cc-bar cc-bar-header'></li>"),this.panelTitle=$("<div class='cc-title cc-left'>CREATE NEW FOLDER</div>"),this.captions=$("<ul class='cc-caption-container cc-right'></ul>"),this.basicCaption=$("<li class='cc-caption cc-active'>INFO<div class='cc-caption-triangle'><i class='fa fa-caret-up'></i></li>"),this.content=$("<li class='cc-content'></li>"),this.sections=$("<ul class='cc-section-container'></ul>"),this.basicSection=$("<li class='cc-section'></li>"),this.title=$("<div class='cc-input-group cc-float-fix'></div>"),this.titleLabel=$("<label class='cc-label cc-left' for='title'>Title</label>"),this.titleInput=$("<input class='cc-field cc-input-text cc-input-text-2 cc-left' type='text' id='title' name='title' value='' maxlength='255'/>"),this.titleInputHelp=$("<div class='cc-input-help'> * Required</div>"),this.desc=$("<div class='cc-input-group cc-float-fix'></div>"),this.descLabel=$("<label class='cc-label cc-left' for='description'>Description</label>"),this.descInput=$("<textarea class='cc-field cc-textarea cc-textarea-2 cc-left' id='description' name='description' maxlength='1000'></textarea>"),this.category=$("<div class='cc-input-group cc-float-fix'></div>"),this.categoryLabel=$("<label class='cc-label cc-left' for='secondaryCategory'>Category</label>"),this.categorySelect=$("<select class='cc-field cc-select cc-left' id='category' name='category'>"),this.type=$("<div class='cc-input-group cc-float-fix'></div>"),this.typeLabel=$("<label class='cc-label cc-left' for='type'>Type</label>"),this.typeSelect=$("<select class='cc-field cc-select cc-left' id='type' name='type'>"),this.language=$("<div class='cc-input-group cc-float-fix'></div>"),this.languageLabel=$("<label class='cc-label cc-left' for='language'>Language</label>"),this.languageSelect=$("<select class='cc-field cc-select cc-left' id='language' name='language'>"),this.region=$("<div class='cc-input-group cc-float-fix'></div>"),this.regionLabel=$("<label class='cc-label cc-left' for='region'>Region</label>"),this.regionSelect=$("<select class='cc-field cc-select cc-left' id='region' name='region'>"),this.foot=$("<li class='cc-bar cc-bar-footer'></li>"),this.buttons=$("<div class='cc-button-container'></div>"),this.cancelButton=$("<span class='button'><i class='icon icon-ban-circle'></i> Cancel</span>"),this.createButton=$("<span class='button button-caution'><i class='icon icon-ok'></i> Create</span>"),this.panel.append(this.head.append(this.panelTitle).append(this.captions.append(this.basicCaption))).append(this.content.append(this.sections.append(this.basicSection.append(this.title.append(this.titleLabel).append(this.titleInput).append(this.titleInputHelp)).append(this.desc.append(this.descLabel).append(this.descInput)).append(this.category.append(this.categoryLabel).append(this.categorySelect)).append(this.type.append(this.typeLabel).append(this.typeSelect)).append(this.language.append(this.languageLabel).append(this.languageSelect)).append(this.region.append(this.regionLabel).append(this.regionSelect))))).append(this.foot.append(this.buttons.append(this.cancelButton).append(this.createButton))),this.categorySelect.append($("<option value='0'>None</option>")),t=0,o=fh5.database.category.length;t<o;t++)for(l=fh5.database.category[t],s=$("<optgroup label='"+l.name+"'></optgroup>").appendTo(this.categorySelect),i=0,n=l.secondaryCategory.length;i<n;i++)c=l.secondaryCategory[i],s.append($("<option value='"+c.id+"' "+("83"==c.id?"selected":"")+">"+c.name+"</option>"));for(t=0,a=fh5.database.type.length;t<a;t++)d=fh5.database.type[t],this.typeSelect.append($("<option value='"+d.id+"' "+("1"==d.id?"selected":"")+">"+d.name+"</option>"));for(t=0,a=fh5.database.language.length;t<a;t++)r=fh5.database.language[t],this.languageSelect.append($("<option value='"+r.id+"' "+("11"==r.id?"selected":"")+">"+r.name+"</option>"));for(t=0,a=fh5.database.region.length;t<a;t++)p=fh5.database.region[t],this.regionSelect.append($("<option value='"+p.id+"' "+("83"==p.id?"selected":"")+">"+p.name+"</option>"));this.lightBox=new LightBox("","",960),this.lightBox.getBox().append(this.panel),this.lightBox.launch(),this.cancelButton.on("click",this.lightBox.cancel.bind(this.lightBox)),this.createButton.on("click",this.create2.bind(this)),this.titleInput.on("blur",this.validate.bind(this,!1)),this.titleInput.focus()}function NotePanel(e){this.panel=$("<div class='cc-note-panel'></div>"),this.timeoutId=null,$(window).on("scroll",this.scrollIn.bind(this)),this.panel.append(e),this.panel.appendTo($("body")),this.scrollIn()}function PrintPanel(e){var t=this;(e=$.extend({pageWidth:100,pageHeight:100},e)).pageWidth="",e.pageHeight="",this.options=e,this.lightBox=new LightBox("Print this Publication","Turn your online digital publication into paper publication",900,"gray",2);this.textPanel=$("<div class='cc-print-panel cc-float-fix'></div>"),this.topText=$("<div><div style='padding-bottom: 6px;'><span style='font-size: 13px;line-height: 20px;'><p>If you also require paper printing catalog or magazines, we could also supply you with publication printing service. Print your Catalog, Books, Leaflets, Brochures and Album with lower price and highest quality.</p><p style='padding-top: 6px;'>Please fill the form or contact <a href='mailto:[email protected]' target='_blank'>[email protected]</a>
1 to tell us your request, we would send you our quotation and make paper sample for you.</p></span></div></div>"),this.userPanel=$("<ul class='cc-print-user-panel cc-float-fix'></ul>"),this.userInfo=$("<li class='cc-float-fix'><div class='cc-print-contact-text'><span>Contact Info</span></div></li>"),this.nameItem=$("<li class='cc-input-group cc-float-fix'></li>"),this.nameText=$("<label class='cc-label cc-left'>Your Name </label>"),this.nameVal=$("<div class='cc-print-item-right cc-left'><input class='cc-field cc-input-text cc-print-right-value' type='text' id='printName' value='"+fh5.uName+"' placeholder='Your Name...'></div>"),this.emailItem=$("<li class='cc-input-group cc-float-fix'></li>"),this.emailText=$("<label class='cc-label cc-left'>Email </label>"),this.emailVal=$("<div class='cc-print-item-right cc-left'><input class='cc-field cc-input-text cc-print-right-value' type='text' id='printEmail' value='"+fh5.uEmail+"' placeholder='Email...'></div>"),this.telItem=$("<li class='cc-input-group cc-float-fix'></li>"),this.telText=$("<label class='cc-label cc-left'>Tel </label>"),this.telVal=$("<div class='cc-print-item-right cc-left'><input class='cc-field cc-input-text cc-print-right-value' type='text' id='printPhone' value='"+fh5.uPhone+"' placeholder='Tel...'></div>"),this.addressItem=$("<li class='cc-input-group cc-float-fix'></li>"),this.addressText=$("<label class='cc-label cc-left'>Address </label>"),this.addressVal=$("<div class='cc-print-item-right cc-left'><textarea class='cc-textarea cc-print-right-value' id='printAddress' placeholder='Address...' rows='3' style='height: auto;'>"+fh5.uAddress+"</textarea></div>"),this.bookPanel=$("<ul class='cc-print-book-panel cc-float-fix'></ul>"),this.bookInfo=$("<li><div class='cc-print-publication-text'><span>Publication Info</span></div></li>"),this.countItem=$("<li class='cc-input-group cc-float-fix'></li>"),this.countText=$("<label class='cc-label cc-left'>Quantity </label>"),this.countVal=$("<div class='cc-print-item-right cc-left'><input class='cc-field cc-input-text cc-print-right-value' type='number' id='printQuantity' value='1' placeholder='Quantity...'></div>"),this.sizeItem=$("<li class='cc-input-group cc-float-fix'></li>"),this.sizeText=$("<label class='cc-label cc-left'>Size (inch) </label>"),this.sizeVal=$("<div class='cc-print-item-right cc-left'><input class='cc-field cc-input-text cc-print-size-width' type='number' id='printSizeWidth' value='"+e.pageWidth+"' placeholder='Page Width...'><div style='display: inline-block;'>X</div><input class='cc-field cc-input-text cc-print-size-width' type='number' id='printSizeHeight' value='"+e.pageHeight+"' placeholder='Page Height...'></div>"),this.pageItem=$("<li class='cc-input-group cc-float-fix'></li>"),this.pageText=$("<label class='cc-label cc-left'>Pages </label>"),this.pageVal=$("<div class='cc-print-item-right cc-left'><input class='cc-field cc-input-text cc-print-right-value' type='number' id='printPageCount' value='"+e.pages+"' placeholder='Pages...'></div>"),this.otherPanel=$("<li class='cc-input-group cc-float-fix'></li>"),this.otherText=$("<label class='cc-label cc-left'>Details <i class='icon icon-info-sign cc-icon-fix'></i> </label>"),this.otherMessage=$("<div class='cc-print-item-right cc-print-remark cc-left'><textarea class='cc-textarea cc-print-right-value' id='printRemark' rows='3' placeholder='Details...'></textarea></div>"),this.warnMessage=$("<div class='cc-share-warn-message cc-error-color'></div>");this.otherText.find("i").hints({content:"Please tell us other details about your publication:<p>1.Lamination for cover or inner sheets ?</p><p>2.Gross Lamination or matt lamination ?</p><p>3.Paper:</p><p style='text-indent: 10px;'>a.Cover paper.</p><p style='text-indent: 10px;'>b.Inner sheet paper.</p><p>4.Binding:</p><p style='text-indent: 10px;'>a.perfect binding.</p><p style='text-indent: 10px;'>b.Saddle-stitched.</p><p>5.Cover:hard cover or not.</p>"}),this.nameVal.find("#printName").add(this.emailVal.find("#printEmail")).add(this.telVal.find("#printPhone")).add(this.addressVal.find("#printAddress")).add(this.countVal.find("#printQuantity")).add(this.sizeVal.find("#printSizeWidth")).add(this.sizeVal.find("#printSizeHeight")).add(this.pageVal.find("#printPageCount")).on("input propertychange change",function(){$(this).removeClass("cc-validate-fail"),t.warnMessage.hide()}),this.lightBox.getPanel().append(this.textPanel.append(this.topText).append(this.userPanel.append(this.userInfo).append(this.nameItem.append(this.nameText).append(this.nameVal)).append(this.emailItem.a
1ppend(this.emailText).append(this.emailVal)).append(this.telItem.append(this.telText).append(this.telVal)).append(this.addressItem.append(this.addressText).append(this.addressVal))).append(this.bookPanel.append(this.bookInfo).append(this.countItem.append(this.countText).append(this.countVal)).append(this.sizeItem.append(this.sizeText).append(this.sizeVal)).append(this.pageItem.append(this.pageText).append(this.pageVal)).append(this.otherPanel.append(this.otherText).append(this.otherMessage)))).append(this.warnMessage),this.otherText.on("click",function(){t.otherMessage.slideDown()}),this.lightBox.getSaveButton().text("Send").on("click",this.send.bind(this)),this.lightBox.getCloseButton().text("Cancel"),this.box=this.lightBox.getBox(),this.lightBox.launch()}function PrivacyPanel(e,t,i,a,o,n,s){switch(this.randowId=(new Date).getTime(),this.panel=$("<ul class='cc-light-box-content-panel'></ul>"),this.privateItem=$("<li class='cc-privacy-item'></li>"),this.privateItemInput=$("<input class='cc-privacy-ratio' type='radio' value='0' id='private"+this.randowId+"' name='privacy"+this.randowId+"'>"),this.privateItemLabel=$("<label class='cc-privacy-label' for='private"+this.randowId+"'></label>"),this.privateItemIcon=$("<div class='cc-book-privacy-button private cc-left'></div>"),this.privateItemInfo=$("<div class='cc-privacy-info'></div>"),this.privateItemTitle=$("<div class='cc-privacy-title'>Private</div>"),this.privateItemDesc=$("<div class='cc-privacy-desc'>Only authorized users can read your book.</div>"),this.emailContainer=$("<div class='cc-privacy-email-container cc-hide'></div>"),this.emailList=new SmartList({container:this.emailContainer,data:i,separater:";"}),this.emailTips=$("<div class='cc-privacy-email-tips'>Enter Authorization ID separated by semicolon:</div>"),this.keepPrivateOnCloudItem=$("<li class='cc-privacy-item'></li>"),this.keepPrivateOnCloudItemInput=$("<input class='cc-privacy-ratio' type='radio' value='2' id='keep-private-on-cloud"+this.randowId+"' name='privacy"+this.randowId+"'>"),this.keepPrivateOnCloudItemLabel=$("<label class='cc-privacy-label' for='keep-private-on-cloud"+this.randowId+"'></label>"),this.keepPrivateOnCloudItemIcon=$("<span class='cc-book-privacy-button keep-private-on-cloud cc-left'></span>"),this.keepPrivateOnCloudItemInfo=$("<div class='cc-privacy-info'></div>"),this.keepPrivateOnCloudItemTitle=$("<div class='cc-privacy-title'>Keep Private On PubHTML5 Cloud</div>"),this.keepPrivateOnCloudItemDesc=$("<div class='cc-privacy-desc'>Unaccessible to the public on PubHTML5 Cloud.</div>"),this.publicItem=$("<li class='cc-privacy-item'></li>"),this.publicItemInput=$("<input class='cc-privacy-ratio' type='radio' value='1' id='public"+this.randowId+"' name='privacy"+this.randowId+"'>"),this.publicItemLabel=$("<label class='cc-privacy-label' for='public"+this.randowId+"'></label>"),this.publicItemIcon=$("<span class='cc-book-privacy-button public cc-left'></span>"),this.publicItemInfo=$("<div class='cc-privacy-info'></div>"),this.publicItemTitle=$("<div class='cc-privacy-title'>Public on the web</div>"),this.publicItemDesc=$("<div class='cc-privacy-desc'>Anyone on the Internet can reach your book.</div>"),this.keepPrivateContainer=$("<div class='cc-privacy-keep-private-container cc-hide'></div>"),this.emptyAuthorizationTips=$("<div class='empty-authorization-tips cc-hide cc-error'>No Authorization ID is added, please add an Authorization ID to the list.</div>"),this.current=t,t+=""){case"0":this.privateItemInput[0].checked=!0,this.emailContainer.show();break;case"1":this.publicItemInput[0].checked=!0;break;case"2":this.keepPrivateOnCloudItemInput[0].checked=!0}this.panel.append(this.privateItem.append(this.privateItemInput).append(this.privateItemLabel.append(this.privateItemIcon).append(this.privateItemInfo.append(this.privateItemTitle).append(this.privateItemDesc)))).append(this.emailContainer.prepend(this.emailTips).append(this.emailExample)).append(this.keepPrivateOnCloudItem.append(this.keepPrivateOnCloudItemInput).append(this.keepPrivateOnCloudItemLabel.append(this.keepPrivateOnCloudItemIcon).append(this.keepPrivateOnCloudItemInfo.append(this.keepPrivateOnCloudItemTitle).append(this.keepPrivateOnCloudItemDesc)))).append(this.publicItem.append(this.publicItemInput).append(this.publicItemLabel.append(this.publicItemIcon).append(this.publicItemInfo.append(this.publicItemTitle).append(this.publicItemDesc)))).append(this.emptyAuthorizationTips),this.buttons=$("<ul class='cc-light-box-buttons'></ul>"),this.saveButton=$("<li class='button-pure button-pure-green'>Save</li>"),this.cancelButton=$("<li class='button-pure'>Cancel</li>"),this.lightBox=new LightBox("Privacy settings","Visibility options:",500),this.lightBox.getBox().append(this.panel).append(this.buttons.append(this.saveButton).append(this.cancelButton)),this.lightBox.launch(),this.saveButton.on("click",this.save.bind(this,e,a,o,n,s)),this.cancelButton.on("click",this.lightBox.cancel.bind(this.lightBox)),this.privateItemInput.on("change",this.changePrivacy.bind(this)),this.publicItemInput.on("change",this.changePrivacy.bind(this)),this.keepPrivateOnCloudItem.on("change",this.changePrivacy.bind(this))}function ReUploadSection(e){this.createName="",this.options=e,this.section=$("<li data-name='ReUpload' class='cc-section cc-hide' data-height='"+e.height+"'></li>"),this.uploadNote=$("<div class='cc-pdf-upload-note'>Re-Upload a PDF file to replace the original one.</div>"),this.uploadComponent=$("<ul class='cc-pdf-reupload-component cc-float-fix'></ul>"),this.uploadButton=$("<li class='cc-pdf-upload-button button-pure cc-left'><span class='icon icon-folder-open'></span> Browse</li>"),this.uploadInput=$("<input class='cc-pdf-upload-input cc-hide2' id='cc-pdf-upload-input' type='file' name='file' accept='application/pdf'/>");var t,l=$('<form action="'+e.upload_url+'" method="POST" enctype="multipart/form-data" class="direct-upload" style="margin:0;padding:0;border:0;"></form>');
1for(t in e.upload_inputs)t&&l.append('<input type="hidden" name="'+t+'" value="'+e.upload_inputs[t]+'" />');l.append(this.uploadInput),this.uploadFileZone=$("<li class='cc-pdf-upload-zone cc-left'></li>"),this.uploadDragText=$("<li class='cc-pdf-upload-drag-text'>...or simply drag and drop your PDF file here</li>"),this.uploadTitle=$("<div class='cc-pdf-upload-title'></div>"),this.uploadProgressWrapper=$("<div class='cc-pdf-upload-progress-bar-wrapper progress progress-striped active cc-hide'></div>"),this.uploadProgressBar=$("<div class='cc-pdf-upload-progress-bar bar'></div>"),this.uploadAlert=$("<div class='cc-pdf-upload-alert'></div>"),this.uploadOptions=$("<div></div>"),this.uploadOptions=$("<div class='cc-pdf-upload-options'></div>"),this.autoCreateGroup=new Checkbox("Auto create after uploading successfully"),this.uploadTipsContainer=$("<div class='cc-pdf-upload-tips-container'></div>"),this.uploadTipsTitle=$("<div>Notes:</div>"),this.uploadTips=$("<ul class='cc-disc-ul'></ul>"),this.uploadTip1=$("<li class='cc-error-color cc-bold'>All links, audios, videos, animation and other multimedia added to your flipbook will be permanently removed.</li>"),this.uploadTip2=$("<li>Settings in previous sections (BookInfo, Template, Theme, Advanced) will be reserved.</li>"),this.uploadTip3=$('<li>Once uploaded successfully, you can click "Save And Close" button to create flipbook immediately.</li>'),this.uploadTip4=$("<li>Make sure that you want to replace the original pdf file, because this operation can not be undone.</li>"),this.section.append(this.uploadNote).append(this.uploadComponent.append(this.uploadButton.append(l)).append(this.uploadFileZone.append(this.uploadDragText).append(this.uploadTitle).append(this.uploadProgressWrapper.append(this.uploadProgressBar)).append(this.uploadAlert))).append(this.uploadOptions.append(this.autoCreateGroup.getGroup())).append(this.uploadTipsContainer.append(this.uploadTipsTitle).append(this.uploadTips.append(this.uploadTip1).append(this.uploadTip2).append(this.uploadTip3).append(this.uploadTip4))),this.isUploading=!1,this.isUploadComplete=!1,this.fileName="",this.originalFileName="";var c=this;this.uploadInput.fileupload({url:c.options.upload_url,dropZone:null,pasteZone:null,dataType:"json",add:function(e,t){c.createName="";var a=t.files[0],o=t.originalFiles[0].name,n=o.substr(0,o.lastIndexOf("."));function s(){var e=Math.floor(6*Math.random())+1,t="abcdefghigklmnopqrstuvwxyz0123456789",a=t.length,o="";for(i=0;i<e;i++)o+=t.charAt(Math.floor(Math.random()*a));return o}c.uploadTitle.empty(),c.uploadAlert.empty(),c.options.bottomAlert.empty(),c.uploadDragText.hide(),"pdf"!==a.name.substr(a.name.length-3).toLowerCase()?(c.uploadTitle.append($("<span class='cc-error-color'>"+a.name+"</span>")),c.uploadAlert.append($("<div class='alert alert-error'>File type not allowed! Only allow pdf file upload.</div>"))):157286400<a.size?(c.uploadTitle.append($("<span class='cc-error-color'>"+a.name+"</span>")),c.uploadAlert.append($("<div class='alert alert-error'>Too large! File size exceeds 150 MB.</div>"))):(o=s()+s()+"-"+s()+"-"+s()+"-"+s()+"-"+s()+s()+s()+"."+a.name.split(".").pop(),l.find('input[name="Content-Type"]').val(a.type),l.find('input[name="Content-Length"]').val(a.size),l.find('input[name="key"]').val(c.options.upload_prefix+o),c.createName=c.options.upload_prefix+o,c.uploadTitle.append($("<span>"+a.name+"</span>")),c.uploadProgressWrapper.removeClass("cc-hide"),c.uploadButton.addClass("disabled"),utils.addMask(c.uploadButton,{hasLoading:!1,cursor:"default"}),c.originalFileName=n,""==c.options.bookInfoSection.getTitle()&&c.options.bookInfoSection.setTitle(n),""==c.options.bookInfoSection.getDesc()&&c.options.bookInfoSection.setDesc(n),t=t.submit(),c.jqXHR=t)},progress:function(e,t){utils.log("uploading... "+parseInt(t.loaded/t.total*100,10)+"%"),c.isUploading=!0,c.uploadProgressBar.width(parseInt(t.loaded/t.total*100,10)+"%")},done:function(e,t){t=t.result.files[0];c.uploadProgressWrapper.addClass("cc-hide"),t.error?(c.uploadTitle.empty().append($("<span class='cc-error-color'>"+t.name+"</span>")),c.options.bottomAlert.empty().append($("<div class='alert alert-error'><strong>Error:</strong> "+t.error+".</div>")),c.uploadProgressBar.width("0%"),c.uploadButton.removeClass("disabled"),utils.removeMask(c.uploadButton)):(c.uploadAlert.append($("<div class='alert alert-success'>File uploaded successfully!</div>")),c.options.bottomAlert.empty().append($("<div class='alert alert-success'><strong>Note:</strong> Uploaded successfully, you can create flipbook right now!</div>")),c.isUploading=!1,c.isUploadComplete=!0,c.fileName=t.path,utils.log("upload finish."),c.autoCreateGroup.isChecked()&&c.options.save())},error:function(e,t){""!=c.createName&&"error"==e.statusText?$.ajax({url:"/aws-post-upload/callback.php",type:"get",dataType:"json",data:{bucket:"online.fliphtml5.com",key:c.createName,etag:"1307843ecdf688c065e5ca36949c3239"},success:function(e){e=e.files[0];""==e.error?(c.uploadAlert.append($("<div class='alert alert-success'>File uploaded successfully!</div>")),c.options.bottomAlert.empty().append($("<div class='alert alert-success'><strong>Note:</strong> Uploaded successfully, you can create flipbook right now!</div>")),c.isUploading=!1,c.isUploadComplete=!0,c.fileName=e.path,utils.log("upload finish."),c.autoCreateGroup.isChecked()&&c.options.save()):(c.options.bottomAlert.empty().append($("<div class='alert alert-error'><strong>Error:</strong> Tip: "+e.error+".)</div>")),c.uploadProgressBar.width("0%"),c.uploadButton.removeClass("disabled"),utils.removeMask(c.uploadButton))},error:function(){c.options.bottomAlert.empty().append($("<div class='alert alert-error'><strong>Error:</strong> Tip: Upload failed due to abnormal network connection (If a proxy is used, please close/open the proxy and try again.)</div>")),c.uploadProgressBar.width("0%"),c.uploadButton.removeClass("disabled"),utils.removeMask(c.uploadButton)}}):(c.options.bottomAlert.empty().append($("<div class='alert alert-error'><strong>Error:</strong> Tip: Upload failed due to abnormal network connection (If a proxy is used, please close/open the proxy and try again.)</div>")),c.uploadProgressBar.width("0%"),c.uploadButton.removeClass("disabled"),utils.removeMask(c.uploadButton))}})}function SelectDownloadVersionPanel(){this.lightBox=new LightBox("Download PUB HTML5 Desktop Client","",680,"gray",3),this.downloadButtonContaienr=$("<div class='cc-select-version-button-container'></div>"),this.downloadWindowsButton=$("<div class='cc-inline-wrapper'><a href='https://pubhtml5.com/download/pub-html5.zip' onclick=\"ga('send', 'event', 'Download', this.href, document.location.pathname);\" rel='nofollow'><div class='button-pure button-pure-blue'><i class='fa fa-windows'></i> Download</div></a><div class='cc-desktop-version-download-text'>For Windows</div></div>"),this.downloadMacButton=$("<div class='cc-inline-wrapper'><a href='https://pubhtml5.com/download/pubhtml5.zip' onclick=\"ga('send', 'event', 'Download', this.href, document.location.pathname);\" rel='nofollow'><div class='button-pure button-pure-green'><i class='fa fa-apple'></i> Download</div></a><div class='cc-desktop-version-download-text'>For Mac</div></div>"),this.lightBox.getPanel().append(this.downloadButtonContaienr.a
1ppend(this.downloadWindowsButton).append(this.downloadMacButton)),this.lightBox.getSaveButton().hide(),this.lightBox.launch()}function SelectUploadMethodPanel(){this.panel=$("<div class='cc-light-box-content-panel-gray'></div>"),this.simpleGroup=$("<div class='cc-input-group cc-text-left'></div>"),this.simple=$("<span class='cc-select-upload-method-title'>Simple:</span><span class='cc-select-upload-method-desc'> Upload PDF and convert it to online flipping book.</span>"),this.uploadButtonContainer=$("<div class='cc-select-upload-method-button-container'></div>"),this.uploadButton=$("<div class='cc-select-upload-method-online-button'>Upload Online</div>"),this.manageMyFilps=$("<div class='cc-select-upload-method-my-flips'><a href='/center/flips/'> or Manage My Pubs</a></div>"),this.advancedGroup=$("<div class='cc-input-group cc-text-left top'></div>"),this.advanced=$("<span class='cc-select-upload-method-title'>Advanced:</span><span class='cc-select-upload-method-desc'> Add link, audio, video, animation and more multimedia to your "+fh5.font.p1+".</span>"),this.advancedHelp=$("<div class='cc-select-upload-method-advanced-help'>(Require to download <a target='_blank' href='/desktop-version.php'>"+fh5.font.t2+" Desktop Client</a>)</div>"),this.downloadButtonContaienr=$("<div class='cc-select-upload-method-download-container'></div>"),this.downloadWindowsButton=$("<a href='https://"+fh5.font.t1+".com/download/pub-html5.zip' onclick=\"ga('send', 'event', 'Download', this.href, document.location.pathname);\" rel='nofollow'><div class='cc-select-upload-method-download-button'>Download For Windows</div></a>"),this.downloadMacButton=$("<a href='https://"+fh5.font.t1+".com/download/"+fh5.font.t1+".zip' onclick=\"ga('send', 'event', 'Download', this.href, document.location.pathname);\" rel='nofollow'><div class='cc-select-upload-method-download-button'>Download For Mac</div></a>"),this.virustotal=$("<a href='https://www.virustotal.com/en/url/c1b58803d899ca0401dbe1e4542e73b12c148130b6de1a48aa4702ce1ab5ef03/analysis/1409986716/' target='_blank' class='cc-virustotal'>Safety certification through Virustotal.</a>"),this.panel.append(this.simpleGroup.append(this.simple)).append(this.uploadButtonContainer.append(this.uploadButton)).append(this.advancedGroup.append(this.advanced)).append(this.advancedHelp).append(this.downloadButtonContaienr.append(this.downloadWindowsButton).append(this.downloadMacButton)).append(this.virustotal),fh5.isLoggedIn&&this.uploadButtonContainer.append(this.manageMyFilps),this.lightBox=new LightBox("Make A Flipping Book","",780,"gray"),this.lightBox.box.append(this.panel),this.lightBox.launch(),this.uploadButton.on("click",this.uploadOnline.bind(this))}function SharePanel(e){this.options=e,this.panel=$("<div class='cc-light-box-content-panel cc-share-transition'></div>"),this.QRURLGroup=$("<div class='cc-input-group-l cc-float-fix'></div>").append($("<span class='cc-label cc-share-label cc-left'>QR Code</span>")),this.codeGroup=$("<div class='cc-share-group cc-float-fix cc-left'></div>"),this.codeContext=$("<div class='cc-share-qrurl-code cc-float-fix'></div>"),this.qrCodeContainer=$("<div class='cc-share-code-context'></div>"),this.codeUrlContext=$("<div class='cc-share-code-right'></div>"),this.codeUrlInner=$("<div class='cc-share-code-inner'></div>"),this.codeUrlTitle=$("<div class='cc-share-code-url-title'><span>QR Code Image</span></div>"),this.codeUrl=$("<div class='cc-share-code-url-context'></div>"),this.codeUrlTextarea=$("<textarea class='cc-textarea'>"+this.options.bookUrl+"files/extfile/QRURL.png</textarea>"),this.socialGroup=$("<div class='cc-input-group-l cc-float-fix'></div>"),this.shareOn=$("<span class='cc-label cc-share-label cc-left'>Share On</span>"),this.shareGroup=$("<ul class='cc-share-group cc-float-fix cc-left'></ul>"),this.facebook=$("<li><a title='Facebook' target='_blank'><span class='button-pure button-pure-blue'><i class='fa fa-facebook'></i> Facebook</span></a></li>"),this.twitter=$("<li><a title='Twitter' target='_blank'><span class='button-pure button-pure-teal' ><i class='fa fa-twitter'></i> Twitter</span></a></li>
1"),this.google=$("<li><a title='Google +' target='_blank'><span class='button-pure button-pure-red'><i class='fa fa-google-plus'></i> Google +</a></span></li>"),this.more=$("<li><a title='More' target='_blank'><span class='cc-share-more button-pure button-pure-orange'><i class='icon icon-plus'></i> More</a></span></li>");var s=$("<div class='cc-input-group-l-6 cc-share-transition cc-hide'></div>");this.emailTo=$("<span class='cc-label cc-share-label cc-left'>Share To</span>");var t,i,a=$("<div class='cc-share-email-group cc-float-fix cc-share-transition'></div>"),l=$("<div class='cc-share-email-form'></div>"),c=$("<div><input class='cc-input-text cc-share-toEmail-item' type='text' placeholder='To Email...'/></div>"),d=$("<div class='cc-share-hide-panel cc-float-fix cc-share-transition'></div>"),r=$("<div><input class='cc-input-text cc-share-fromEmail-item' type='text' placeholder='From Email...' value='"+fh5.uEmail+"'/></div>"),p=$("<div><input class='cc-input-text cc-share-name-item' type='text' placeholder='From Name...' value='"+fh5.uName+"'/></div>"),h=$("<div><textarea class='cc-textarea cc-share-message-item' rows='4' placeholder='Message...'></textarea></div>"),u=$("<div class='cc-share-warn-message cc-hide'></div>"),o=$("<div class='cc-share-email-button button-pure'>Send</div>"),g=$("<div class='cc-share-success-message'><span>Email sent successfully!</span></div>"),b=this;t=document,i="facebook-jssdk",e=t.getElementsByTagName("script")[0],t.getElementById(i)||((t=t.createElement("script")).id=i,t.src="//connect.facebook.net/en_US/sdk.js",e.parentNode.insertBefore(t,e)),window.fbAsyncInit=function(){FB.init({appId:"759223277462081",cookie:!0,xfbml:!1,version:"v2.1"})},this.options.isRecord&&this.facebook.add(this.google).add(this.twitter).on("click",function(){sta.bookShare(b.options.bookid,b.options.domain,b.options.key)}),c.children("input").focus(function(){d.slideDown(),u.hide()}),c.children("input").add(r.children("input")).add(p.children("input")).on("input propertychange change",function(){$(this).removeClass("cc-validate-fail")}),o.on("click",function(){var e=c.children("input"),t=r.children("input"),i=e.val().trim(),a=t.val().trim(),o=p.children("input").val().trim(),n=h.children("textarea").val().trim();return""==i?(e.addClass("cc-validate-fail"),e[0].focus(),void u.html("<i class='icon icon-exclamation-sign'></i> Please enter your friend's email.").show()):/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(i)?""==a?(t.addClass("cc-validate-fail"),t[0].focus(),void u.html("<i class='icon icon-exclamation-sign'></i> Please enter your email.").show()):/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(a)?""==o?(p.children("input").addClass("cc-validate-fail"),p.children("input")[0].focus(),void u.html("<i class='icon icon-exclamation-sign'></i> Please enter your name.").show()):void(""!=i&&""!=a&&""!=o&&$.ajax({url:"/Email/sharebook.php",type:"post",dataType:"json",data:{fromFullName:o,fromEmail:a,fromMessage:n,toEmail:i,bookid:b.options.bookid,Code:hex_md5(encodeURIComponent(o+a+n+i+b.options.bookid+"pubhtml5"))},beforeSend:function(){utils.addSpin(s)},success:function(e){utils.removeSpin(s),"1"==e.status?(d.slideUp(),r.html("<input class='cc-input-text cc-share-fromEmail-item' type='text' placeholder='From Email' value='"+fh5.uEmail+"'/>"),p.html("<input class='cc-input-text cc-share-name-item' type='text' placeholder='From Name' value='"+fh5.uName+"'/>"),c.children("input").val(""),h.children("textarea").val(""),g.slideDown(),l.slideUp(),setTimeout(function(){d.hide(),g.slideUp(),l.slideDown()},1e3),b.options.isRecord&&sta.bookShare(b.options.bookid,b.options.domain,b.options.key)):("0"==e.status||"2"==e.status||"3"==e.status||e.status,u.html(fh5.pageData.tips.ConnectionError).show())},error:function(e,t,i){u.html(fh5.pageData.tips.ConnectionError).show(),utils.removeSpin(s)}})):(t.addClass("cc-validate-fail"),t[0].focus(),void u.html("<i class='icon icon-exclamation-sign'></i> Please enter your the correct email.").show()):(e.addClass("cc-validate-fail"),e[0].focus(),void u.html("<i class='icon icon-exclamation-sign'></i> Please enter your friend's the correct email.").show())}),this.linkGroup=$("<div class='cc-input-group-l cc-float-fix'></div>"),this.linkLabel=$("<span class='cc-label cc-share-label cc-left'>Book Link</span>"),this.linkInput=$("<input type='text' class='cc-input-text cc-share-link-input cc-left'></input>"),this.linkSwitchBtn=$("<div class='button-pure cc-share-link-switch-btn' title='Show Original'><i class='fa fa-exchange'></i></div>"),this.panel.append(this.QRURLGroup.append(this.codeGroup.append(this.codeContext.append(this.qrCodeContainer)))).append(this.linkGroup.append(this.linkLabel).append(this.linkInput)).append(this.socialGroup.append(this.shareO
1n).append(this.shareGroup.append(this.facebook).append(this.twitter).append(this.google).append(this.more))).append(s.append(this.emailTo).append(a.append(l.append(c).append(d.append(r).append(p).append(h).append(u).append(o))).append(g))),o=""!=fh5.customDomain?(this.domainLinkShowing=!0,"http://"+fh5.customDomain+"/books/"+this.options.bLink):(this.domainLinkShowing=!1,this.options.url),this.setLink(o),this.linkInput.on("click",utils.selectCode.bind(utils,this.linkInput)),this.codeUrlTextarea.on("click",utils.selectCode.bind(utils,this.codeUrlTextarea)),utils.popUp("Share This Book","You can easily share this book with your friends through social networks.",685,this.panel)}function SignInPanel(e){this.options=e,this.logInMid=$("<div class='ff-log-in-mid'></div>"),this.logInForm=$("<div class='ff-log-in-form'></div>"),this.logInNetwork=$("<div class='ff-log-in-network'></div>"),this.logInNetworkText=$("<span class='ff-log-in-network-text'>Sign in with your social network account.</span>"),this.logInNetworkButton=$("<div class='ff-log-in-network-button'></div>"),this.logInNetworkFBContainer=$("<div class='cc-inline-wrapper'></div>"),this.logInNetworkFB=$("<div id='cc-facebook-login-btn-id' class='button-pure button-pure-blue ff-log-in-network-fb'><i class='fa fa-facebook'></i><span>SIGN IN WITH FACEBOOK</span></div>"),this.logInNetworkFBProgressWrapper=$("<div class='cc-log-in-progress-bar-wrapper progress progress-striped active cc-hidden'></div>"),this.logInNetworkFBProgressBar=$("<div class='cc-log-in-progress-bar bar'></div>"),this.logInNetworkGGContainer=$("<div class='cc-inline-wrapper'></div>"),this.logInNetworkGG=$("<div id='cc-google-login-btn-id' class='button-pure button-pure-red ff-log-in-network-gg'><i class='fa fa-google-plus'></i><span>SIGN IN WITH GOOGLE</span></div>"),this.logInNetworkGGProgressWrapper=$("<div class='cc-log-in-progress-bar-wrapper progress progress-danger progress-striped active cc-hidden'></div>"),this.logInNetworkGGProgressBar=$("<div class='cc-log-in-progress-bar bar'></div>"),this.logInNetworkGGTips=$('<div class="temp-google-signin-tip siginPanel"><i class="icon icon-exclamation-sign"></i> Currently, signing in with Google is suspended. Please retrieve the password for your PubHTML5 account by pressing the "Forget your password" first, and then you can login with your email and password instead.</div>'),this.logInSocialHelp=$("<div id='cc-log-in-social-help' class='cc-log-in-social-help'></div>"),this.logInEmail=$("<div class='cc-input-group cc-float-fix'></div>"),this.logInEmailLabel=$("<label class='cc-label cc-log-in-label cc-left'><i class='icon icon-envelope'></i><i class='fa fa-caret-right'></i></label>"),this.logInEmailInput=$("<input class='cc-field cc-input-text cc-log-in-input cc-left' type='email' value='"+fh5.cmail+"' placeholder='E-mail' maxlength='255'/>
1"),this.logInPassword=$("<div class='cc-input-group cc-float-fix'></div>"),this.logInPasswordLabel=$("<label class='cc-label cc-log-in-label'><i class='icon icon-lock'></i><i class='fa fa-caret-right'></i></label>"),this.logInPasswordInput=$("<input class='cc-field cc-input-text cc-log-in-input' type='password' value='' placeholder='Password' maxlength='255'/>"),this.logInButtonContainer=$("<div class='cc-log-in-button-container'></div>"),this.logInButtonWrapper=$("<div class='cc-inline-wrapper'></div>"),this.logInButton=$("<div class='cc-log-in-button button-pure button-pure-green button-rounded'>Log In</div>"),this.logInForgetPassword=$("<a href='/pass/forget-password/' class='cc-log-in-forget-password cc-blue-link-4 cc-text-right'>Forget your password?</a>"),this.logInProgressWrapper=$("<div class='cc-log-in-progress-bar-wrapper progress progress-success progress-striped active cc-hidden'></div>"),this.logInProgressBar=$("<div class='cc-log-in-progress-bar bar'></div>"),this.logInBottomContainer=$("<div class='cc-log-in-bottom-container'></div>"),this.logInBottomText=$("<p>New to PubHTML5? </p>"),this.logInBottomLink=$("<a href='javascript:void(0)' class='cc-blue-link-under-line'>Sign up for a free account.</a>"),this.logInHelp=$("<div class='cc-log-in-input-help'></div>"),this.logInSwitch=$("<div class='cc-log-in-create-account-button button-pure button-pure-green'>Create New Account</div>"),this.lightBox=new LightBox("Welcome Back!","Please log in with your PUB HTML5 account.",900,"gray"),this.lightBox.box.append(this.logInMid.append(this.logInForm.append(this.logInEmail.append(this.logInEmailLabel).append(this.logInEmailInput)).append(this.logInPassword.append(this.logInPasswordLabel).append(this.logInPasswordInput)).append(this.logInForgetPassword).append(this.logInButtonContainer.append(this.logInButtonWrapper.append(this.logInButton).append(this.logInProgressWrapper.append(this.logInProgressBar)))).append(this.logInHelp)).append(this.logInNetwork.append(this.logInNetworkText).append(this.logInNetworkButton.append(this.logInNetworkFBContainer.append(this.logInNetworkFB).append(this.logInNetworkFBProgressWrapper.append(this.logInNetworkFBProgressBar))).append(this.logInNetworkGGContainer.append(this.logInNetworkGG).append(this.logInNetworkGGProgressWrapper.append(this.logInNetworkGGProgressBar))).append(this.logInSocialHelp))).append(this.logInSwitch)).append(this.logInBottomContainer.append(this.logInBottomText.append(this.logInBottomLink)));this.logInNetworkFB.on("click touchstart",function(){window.location.href="https://pubhtml5.com/userLoad/Facebook/index.php"}),this.lightBox.launch(),this.loggingIn=!1;var t=this;this.logInEmailInput.on("blur",function(){""!=$(this).val().trim()&&utils.validate("email",$(this),t.logInHelp,!1,null,"!")}),this.logInPasswordInput.on("blur",function(){utils.validate("password",$(this),t.logInHelp,!1,null,"!")}),this.logInForm.find("input").on("keypress",function(e){13==e.which&&t.logIn()}),this.logInButton.on("click",this.logIn.bind(this)),this.logInBottomLink.add(this.logInSwitch).on("click",this.toSignUp.bind(this)),setTimeout(function(){utils.loadFile("https://apis.google.com/js/api:client.js",function(){gapi.load("auth2",function(){auth2=gapi.auth2.init({client_id:"1025914427367-urm786sls5s5n4bmnmrv1tjia9taksbg.apps.googleusercontent.com",cookiepolicy:"single_host_origin",scope:"https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email"});var e=document.getElementById("cc-google-login-btn-id");console.log("-----------1"),auth2.attachClickHandler(e,{},function(e){console.log("-----------2"),utils.googleLogin({id:"cc-google-login-btn-id",helpId:"cc-log-in-social-help",googleUser:e})},function(e){console.log(JSON.stringify(e,void 0,2))})})})},100)}function SignUpPanel(e){this.options=e||{},this.signUpForm=$("<div class='cc-log-in-form'></div>"),this.signUpEmail=$("<div class='cc-input-group cc-float-fix'></div>"),this.signUpEmailLabel=$("<label class='cc-label cc-log-in-label'><i class='icon icon-envelope'></i><i class='fa fa-caret-right'></i></label>"),this.signUpEmailInputWrapper=$("<span class='cc-inline-wrapper cc-left'></span>"),this.signUpEmailInput=$("<input class='cc-field cc-input-text cc-log-in-input' type='email' value='' placeholder='E-mail' maxlength='255'/>"),this.signUpConfirmTips=$("<p class='confirm-email-tips cc-hide'><span class='email'></span>, want to use this mail? <span class='yes'>Yes</span> or <span class='no'>NO</span>?</p>
1"),this.signUpEmailInfoIcon=$("<i class='cc-info-icon icon icon-info-sign cc-log-in-info-icon'></i>"),this.signUpEmailInfo=$("<div class='cc-hints-title'>Guidelines:</div><ul class='cc-disc-ul'><li>Enter your primary email address as your PubHTML5 ID. This will be used as the contact email address for your account.</li><li>We will not share your information with anyone else unless you authorize us to do so.</li></ul>"),this.signUpEmailLoading=$("<div class='cc-icon-left fa fa-spinner fa-spin cc-hide' title='Validating...'></div>"),this.signUpEmailOk=$("<div class='cc-icon-left fa fa-check-circle cc-success-color cc-hide' title='This email is available'></div>"),this.signUpEmailNotOk=$("<div class='cc-icon-left icon icon-exclamation-sign cc-error-color cc-hide' title='User already exists'></div>"),this.signUpPassword=$("<div class='cc-input-group cc-float-fix'></div>"),this.signUpPasswordLabel=$("<label class='cc-label cc-log-in-label'><i class='icon icon-lock'></i><i class='fa fa-caret-right'></i></label>"),this.signUpPasswordInput=$("<input class='cc-field cc-input-text cc-log-in-input' type='password' value='' placeholder='Password' maxlength='255'/>
1"),this.signUpReTypePassword=$("<div class='cc-input-group cc-float-fix'></div>"),this.signUpReTypePasswordLabel=$("<label class='cc-label cc-log-in-label'><i class='icon icon-lock'></i><i class='fa fa-caret-right'></i></label>"),this.signUpReTypePasswordInput=$("<input class='cc-field cc-input-text cc-log-in-input' type='password' placeholder='Re-Type password' value='' maxlength='255'/>"),this.signUpCode=$("<div class='cc-input-group cc-float-fix'></div>"),this.captcha=$('<div id="common-captcha" style="width: 100%;height: 42px;"></div>'),this.signUpTermsOfServiceGroup=$("<div class='cc-input-group cc-float-fix '></div>"),this.signUpTermsOfServiceCheckbox=$("<input class='cc-checkbox' type='checkbox' value='' />"),this.signUpTermsOfService=$("<p class='cc-log-in-terms-of-service cc-text-left'><span>I accept the</span> <a class='cc-blue-link-3' target='_blank' href='/terms-of-service.php'>Terms of Service</a>.</p>"),this.signUpButtonContainer=$("<div class='cc-log-in-button-container'></div>"),this.signUpButton=$("<div class='cc-sign-up-button button-pure button-pure-green'>Sign Up</div>"),this.signUpProgressWrapper=$("<div class='cc-log-in-progress-bar-wrapper progress progress-success progress-striped active cc-hidden'></div>"),this.signUpProgressBar=$("<div class='cc-log-in-progress-bar bar'></div>"),this.signUpBottomContainer=$("<div class='cc-log-in-bottom-container'></div>"),this.signUpBottomText=$("<p>Already have an account? </p>"),this.signUpBottomLink=$("<a href='javascript:void(0)' class='cc-blue-link-under-line'>Log in</a>"),this.signUpHelp=$("<div class='cc-sign-up-input-help'></div>"),this.lightBox=new LightBox("Welcome to PUB HTML5!","Become PUB HTML5 member to have fun in HTML5 FlipBook.",510,"gray"),this.lightBox.box.append(this.signUpForm.append(this.signUpEmail.append(this.signUpEmailLabel).append(this.signUpEmailInputWrapper.append(this.signUpEmailInput).append(this.signUpEmailInfoIcon)).append(this.signUpEmailLoading).append(this.signUpEmailOk).append(this.signUpEmailNotOk)).append(this.signUpConfirmTips).append(this.signUpPassword.append(this.signUpPasswordLabel).append(this.signUpPasswordInput)).append(this.signUpReTypePassword.append(this.signUpReTypePasswordLabel).append(this.signUpReTypePasswordInput)).append(this.signUpCode.append(this.captcha)).append(this.signUpTermsOfServiceGroup.append(this.signUpTermsOfServiceCheckbox).append(this.signUpTermsOfService)).append(this.signUpButtonContainer.append(this.signUpButton).append(this.signUpProgressWrapper.append(this.signUpProgressBar))).append(this.signUpHelp)).append(this.signUpBottomContainer.append(this.signUpBottomText.append(this.signUpBottomLink))),this.lightBox.launch(),this.signUpEmailInput.focus(),this.signingUp=!1;var t=this;this.signUpTermsOfService.on("click",":not(a)",function(){t.signUpTermsOfServiceCheckbox.trigger("click")}
1),this.signUpEmailInput.on("blur",function(){var e=$(this).val().trim();""!=e&&utils.validate("email",$(this),t.signUpHelp,!1,null,"!")&&$.ajax({type:"post",url:"/userLoad/check-email.php",dataType:"json",beforeSend:function(){t.signUpEmailLoading.show(),t.signUpEmailOk.hide(),t.signUpEmailNotOk.hide()},data:{email:e},success:function(e){t.signUpEmailLoading.hide(),"1"==e.status?t.signUpEmailOk.show():(t.signUpEmailNotOk.show(),t.signUpHelp.html("<i class='icon icon-exclamation-sign'></i> User already exists."))}})}),this.signUpPasswordInput.on("blur",function(){utils.validate("password",$(this),t.signUpHelp,!1,null,"!")}),this.signUpReTypePasswordInput.on("blur",function(){utils.validate("repassword",$(this),t.signUpHelp,!1,t.signUpPasswordInput.val(),"!")}),this.signUpForm.find("input").on("keypress",function(e){13==e.which&&t.signUp()}),this.signUpButton.on("click",this.signUp.bind(this)),$(".confirm-email-tips .yes").on("click",this.confirmEmailYes.bind(this)),$(".confirm-email-tips .no").on("click",this.confirmEmailNo.bind(this)),this.signUpEmailInfoIcon.hints({content:this.signUpEmailInfo}),this.signUpBottomLink.on("click",this.toSignIn.bind(this)),this.captcha=new CommonCaptcha({captchaId:"common-captcha",callback:e=>{window._captchaToken=e},expiredCallback:e=>{window._captchaToken=""},errorCallback:e=>{window._captchaToken=""}}),this.captcha.showCaptcha()}function SmartList(e){this.options=$.extend({},{container:null,data:{},separater:";",inputHelp:""},e),"string"==typeof this.options.data&&0<this.options.data.length?this.options.data=this.options.data.split(this.options.separater):this.options.data=[],this.panel=$("<div class='cc-smart-list-panel'></div>"),this.addGroup=$("<div class='cc-input-group-s cc-float-fix'></div>"),this.addInput=$("<input type='text' class='cc-input-text cc-left'/>"),this.addButton=$("<div class='button-pure button-pure-blue button-pure-no-shadow cc-left'><i class='icon icon-plus'></i></div>"),this.searchGroup=$("<div class='cc-input-group-s cc-float-fix'></div>"),this.searchInput=$("<input type='text' class='cc-input-text cc-left'/>"),this.searchButton=$("<div class='button-pure button-pure-blue button-pure-no-shadow cc-left'><i class='icon icon-search'></i></div>"),this.itemGroup=$("<div class='cc-input-group-s cc-float-fix'></div>"),this.itemSelect=$("<select class='cc-select cc-left' multiple></select>"),this.itemTopButtonContianer=$("<div class='cc-left cc-smart-list-item-top-button-contianer'></div>"),this.itemBottomButtonContianer=$("<div class='cc-left cc-smart-list-item-bottom-button-contianer'></div>"),this.itemTextarea=$("<textarea class='cc-textarea cc-hide'></textarea>"),this.removeButton=$("<div><div class='button-pure button-pure-red button-pure-no-shadow cc-left'><i class='icon icon-trash'></i></div></div>"),this.textButton=$("<div><div class='button-pure button-pure-blue button-pure-no-shadow cc-left'><i class='icon icon-font'></i></div></div>"),this.listButton=$("<div class='cc-hide'><div class='button-pure button-pure-blue button-pure-no-shadow cc-left'><i class='icon icon-list'></i></div></div>"),this.totalGroup=$("<div class='cc-smart-list-total cc-float-fix'></div>"),this.help=$("<span class='cc-left cc-error-color cc-hidden'></span>"),this.totalText=$("<span class='cc-right'>Total: </span>"),this.totalNum=$("<span class='cc-right'></span>"),this.panel.append(this.addGroup.append(this.addInput).append(this.addButton)).append(this.searchGroup.append(this.searchInput).append(this.searchButton)).append(this.itemGroup.append(this.itemSelect).append(this.itemTextarea).append(this.itemTopButtonContianer.append(this.removeButton)).append(this.itemBottomButtonContianer.append(this.textButton).append(this.listButton))).append(this.totalGroup.append(this.help).append(this.totalNum).append(this.totalText)),this.options.container.append(this.panel);var t=this;this.setData(this.options.data),this.addInput.on("keypress",function(e){13==e.which&&t.add()}),this.itemTextarea.on("blur",this.parseText.bind(this)),this.searchInput.on("keyup",this.search.bind(this)),this.searchInput.on("change",this.search.bind(this)),this.searchButton.on("click",this.search.bind(this)),this.addButton.on("click",this.add.bind(this)),this.removeButton.on("click",this.remove.bind(this)),this.textButton.on("click",this.viewText.bind(this)),this.listButton.on("click",this.viewList.bind(this))}function SmartSelect(e){this.options=$.extend({},{container:null,data:[],changeCallback:function(){}},e),this.arrow=$("<i class='fa fa-caret-down cc-smart-select-arrow'></i>"),this.optionContainer=$("<ul class='cc-smart-select-option-ul cc-hide'></ul>"),this.valueContainer=$("<div class='cc-smart-select-value-container'></div>"),this.showing=!1;for(var t=this.options.data,i=t.length,a=this,o=0;o<i;o++)this.optionContainer.append("<li data-value="+t[o].value+" data-label='"+t[o].label+"'>"+t[o].label+"</li>"),t[o].isDefault&&this.valueContainer.text(t[o].label).data("value",t[o].value);this.optionContainer.css({width:this.options.container.width()+parseInt(this.options.container.css("paddingLeft"),10)+parseInt(this.options.container.css("paddingRight"),10),borderRadius:this.options.container.css("borderRadius")}),this.valueContainer.css({marginLeft:this.options.container.css("paddingLeft"),lineHeight:this.options.container.height()+parseInt(this.options.container.css("paddingTop"),10)+parseInt(this.options.container.css("paddingBottom"),10)+"px"}),this.options.container.append(this.arrow).append(this.valueContainer).append(this.optionContainer),this.optionContainer.find("li").css({paddingLeft:this.options.container.css("paddingLeft")}),this.optionContainer.on("click",this.choose.bind(this)),this.options.container.on("click",this.toggleOption.bind(this)),$(document).on("click",function(e){$.contains(a.options.container[0],e.target)||a.options.container[0]==e.target||a.hideOptions()})}function TabBox(e){var t=e.num,i=e.tabArr,e=e.container;this.tabs=[],this.panes=[],this.tabContext=$("<div class='tb-tap-container cc-float-fix'></div>"),this.paneContext=$("<div class='tb-section-container'></div>"),t=i&&0<i.length?i.length:t;for(var a=0;a<t;
1a++){var o=$("<div class='tb-tab'></div>").html(i&&0<i.length?i[a].title:"undefine"),n=$("<div class='tb-section'></div>");this.tabs.push(o),this.panes.push(n),this.tabContext.append(o),this.paneContext.append(n)}1<=t&&(this.tabs[0].addClass("tb-tab-active"),this.panes[0].addClass("tb-section-active")),this.bindTabClickFn(this.panes),e.css({border:"1px solid #e9e9e9"}).append(this.tabContext).append(this.paneContext)}function TemplateSection(e){this.options=e,this.section=$("<li data-name='Template' class='cc-section cc-hide' data-height='"+e.height+"'></li>"),e.isNew&&this.section.addClass("cc-section-new"),this.templates=$("<ul class='cc-template-container'></ul>"),this.section.append(this.templates);for(var t,i,a,o,n,s=this,l=fh5.pageData.templates,c=0,d=l.length;c<d;c++)t=$("<li class='cc-template-item'></li>"),i=$("<img class='cc-item-thumbnail' src='/Templates/"+l[c].name+".jpg'>"),a=$("<div class='cc-item-chosen-frame'></div>"),o=$("<div class='cc-item-mask'></div>"),n=$("<div class='cc-item-title' data-value='"+l[c].name+"'>"+l[c].name+"</div>"),this.templates.append(t.append(i).append(a).append(o).append(n));this.current=this.options.templateId,this.choose(this.current),this.templates.find(".cc-template-item").each(function(e,t){$(t).on("click",function(){s.choose(e)})})}function ThemeSection(e){this.options=e,this.section=$("<li data-name='Theme' class='cc-section cc-hide' data-height='"+e.height+"'></li>"),e.isNew&&this.section.addClass("cc-section-new"),this.themes=$("<ul class='cc-theme-container'></ul>"),this.section.append(this.themes);for(var t,i,a,o,n,s=this,l=fh5.pageData.themes,c=0,d=l.length;c<d;c++)t=$("<li class='cc-theme-item'></li>"),i=$("<img class='cc-item-thumbnail' src='/Themes/"+l[c]+"/shot.jpg'>"),a=$("<div class='cc-item-chosen-frame'></div>"),o=$("<div class='cc-item-mask'></div>"),n=$("<div class='cc-item-title' data-value='"+l[c]+"'>"+l[c]+"</div>"),this.themes.append(t.append(i).append(a).append(o).append(n));this.themeNames=l,this.current=this.options.themeId,this.options.isNew?this.choose(this.current,!0,!1):this.choose(this.current,!1,!1),this.themes.find(".cc-theme-item").each(function(e,t){$(t).on("click",function(){s.choose(e,!0,!0)})})}function ToTopPanel(){this.panel=$("<ul class='cc-to-top-panel cc-hide'></ul>"),this.toTopButton=$("<li class='cc-to-top' title='Back To Top'><span class='icon icon-arrow-up'></span></li>"),this.panel.append(this.toTopButton),this.panel.appendTo($("body")),this.toTopButton.on("click",this.toTop.bind(this)),$(window).on("scroll",this.handleScroll.bind(this))}function UpgradePanel(e){var t=fh5.pageData.upgrade[e.version];this.panel=$("<div class='cc-light-box-content-panel cc-light-box-content-panel-black'></div>"),this.detailDesc=$("<div>"+e.desc+"</div>"),this.upgradeInfo=$("<div class='cc-upgrade-info cc-float-fix'></div>"),this.upgradeItemsContainer=$("<div class='cc-upgrade-items-container'></div>"),this.upgradeItemsTitle=$("<div class='cc-upgrade-items-title'>"+e.version+" version gets you:</div>"),this.upgrageItems=$("<ul class='cc-disc-ul'></ul>"),this.upgradeImg=$("<img class='cc-upgrade-img' src="+e.imgSrc+">"),this.upgradeTo=$("<span class='cc-upgrade-to'>Upgrade to "+t.icon+"</span>"),this.buttons=$("<ul class='cc-light-box-buttons'></ul> "),this.cancelButton=$("<li class='button-pure'>Later</li>"),this.upgradeButton=$("<a href='/pricing.php' target='_blank'><li class='button-pure button-pure-orange'>See plans and pricing</li></a>"),this.contact=$("<div class='cc-upgrade-contact'><div><span class='cc-bold'>Questions?</span> We can help you learn more now.</div><div>Feel free to email us at <a class='cc-blue-link-2' href='mailto:[email protected]' target='_blank'>[email protected]</a>.</div></div>");for(var i=t.items,a=0,o=i.length;a<o;a++)this.upgrageItems.append($("<li>"+i[a]+"</li>"));this.panel.append(this.detailDesc).append(this.upgradeInfo.append(this.upgradeItemsContainer.append(this.upgradeItemsTitle).append(this.upgrageItems)).append(this.upgradeImg)),this.lightBox=new LightBox(e.title,e.subTitle,748,"black"),this.lightBox.getTitle().append(this.upgradeTo),this.lightBox.getBox().append(this.panel).append(this.buttons.append(this.contact).append(this.cancelButton).append(this.upgradeButton)),this.lightBox.launch(),this.cancelButton.on("click",this.lightBox.cancel.bind(this.lightBox))}function UploadSection(e){this.options=e,this.createName="",this.section=$("<li data-name='Upload' class='cc-section' data-height='"+e.height+"'></li>"),this.uploadNote=$("<div class='cc-pdf-upload-note'>Upload your PDF file and convert it to flipping book here.</div>"),this.uploadComponentContainer=$("<div></div>"),this.uploadComponent=$("<ul class='cc-pdf-upload-component cc-float-fix'></ul>"),this.uploadButton=$("<li class='cc-pdf-upload-button button-pure cc-left'><span class='icon icon-folder-open'></span> Browse</li>"),this.uploadInput=$("<input class='cc-pdf-upload-input' id='cc-pdf-upload-input' type='file' name='file' accept='application/pdf'/>");var t,l=$('<form action="'+e.upload_url+'" method="POST" enctype="multipart/form-data" class="direct-upload" style="margin:0;padding:0;border:0;"></form>');
1for(t in e.upload_inputs)t&&l.append('<input type="hidden" name="'+t+'" value="'+e.upload_inputs[t]+'" />');l.append(this.uploadInput),this.uploadFileZone=$("<li class='cc-pdf-upload-zone cc-left'></li>"),this.uploadDragText=$("<li class='cc-pdf-upload-drag-text'>...or simply drag and drop your PDF file here</li>"),this.uploadTitle=$("<div class='cc-pdf-upload-title'></div>"),this.uploadProgressWrapper=$("<div class='cc-pdf-upload-progress-bar-wrapper progress progress-striped active cc-hide'></div>"),this.uploadProgressBar=$("<div class='cc-pdf-upload-progress-bar bar'></div>"),this.uploadAlert=$("<div class='cc-pdf-upload-alert'></div>"),this.uploadOptions=$("<div class='cc-pdf-upload-options'></div>"),this.autoCreateGroup=new Checkbox("Auto create after uploading successfully"),this.keepPrivateGroup=new KeepPrivateGroup,this.uploadTipsContainer=$("<div class='cc-pdf-upload-tips-container'></div>"),this.uploadTipsTitle=$("<div>Guidelines:</div>"),this.uploadTips=$("<ul class='cc-disc-ul'></ul>"),this.uploadTip1=$("<li>Your PDF must be less than 150 MB.</li>"),this.uploadTip2=$('<li>While uploading, you may click "Next" button to edit further settings.</li>'),this.uploadTip3=$("<li>We will inform you when your file uploaded successfully.</li>"),this.uploadTip4=$('<li>Once uploaded successfully, you can click "Create" button to create flipbook immediately. Book info can be edited later.</li>'),this.uploadTipMore=$("<li class='cc-pdf-upload-tips-more'><a class='cc-blue-link-2' href='/desktop-version.php'>Click here to add link, audio, video, animation and more multimedia to your flipbook.</a></li>"),this.section.append(this.uploadNote).append(this.uploadComponentContainer.append(this.uploadComponent.append(this.uploadButton.append(l)).append(this.uploadFileZone.append(this.uploadDragText).append(this.uploadTitle).append(this.uploadProgressWrapper.append(this.uploadProgressBar)).append(this.uploadAlert)))).append(this.uploadOptions.append(this.autoCreateGroup.getGroup()).append(this.keepPrivateGroup.getGroup())).append(this.uploadTipsContainer.append(this.uploadTipsTitle).append(this.uploadTips.append(this.uploadTip1).append(this.uploadTip2).append(this.uploadTip3).append(this.uploadTip4).append(this.uploadTipMore))),this.isUploading=!1,this.isUploadComplete=!1,this.fileName="",this.originalFileName="";var c=this;this.uploadTipMore.on("click",function(e){fh5.uType<"4"&&(e.preventDefault(),new UpgradePanel(fh5.pageData.upgrade.Interactive))}),$(document).bind("drop dragover",function(e){e.preventDefault()}),c.uploadFileZone.on("dragover",function(){"nofile"===c.getUploadStatus()&&c.uploadFileZone.addClass("cc-drag-over")}),c.uploadFileZone.on("dragleave drop",function(){"nofile"===c.getUploadStatus()&&c.uploadFileZone.removeClass("cc-drag-over")}),this.uploadInput.fileupload({url:c.options.upload_url,dropZone:null,pasteZone:null,dataType:"json",dropZone:c.uploadFileZone,add:function(e,t){c.createName="";var a=t.files[0],o=t.originalFiles[0].name,n=o.substr(0,o.lastIndexOf(".")),o=a.name.substring(a.name.lastIndexOf(".")+1).toLowerCase();function s(){var e=Math.floor(6*Math.random())+1,t="abcdefghigklmnopqrstuvwxyz0123456789",a=t.length,o="";for(i=0;i<e;i++)o+=t.charAt(Math.floor(Math.random()*a));return o}c.uploadTitle.empty(),c.uploadAlert.empty(),c.options.bottomAlert.empty(),c.uploadDragText.hide(),-1==fh5.pageData.types.indexOf(o)?(c.uploadTitle.append($("<span class='cc-error-color'>"+a.name+"</span>")),c.uploadAlert.append($("<div class='alert alert-error'>File is not an allowed file type! Only support PDF file.</div>"))):157286400<a.size?(c.uploadTitle.append($("<span class='cc-error-color'>"+a.name+"</span>")),c.uploadAlert.append($("<div class='alert alert-error'>Too large! File size exceeds 150 MB.</div>"))):(o=s()+s()+"-"+s()+"-"+s()+"-"+s()+"-"+s()+s()+s()+"."+a.name.split(".").pop(),l.find('input[name="Content-Type"]').val(a.type),l.find('input[name="Content-Length"]').val(a.size),l.find('input[name="key"]').val(c.options.upload_prefix+o),c.createName=c.options.upload_prefix+o,c.uploadTitle.append($("<span>"+a.name+"</span>")),c.uploadProgressWrapper.removeClass("cc-hide"),c.uploadButton.addClass("disabled"),utils.addMask(c.uploadButton,{hasLoading:!1,cursor:"default"}),c.originalFileName=n,""==c.options.bookInfoSection.getTitle()&&c.options.bookInfoSection.setTitle(n),""==c.options.bookInfoSection.getDesc()&&c.options.bookInfoSection.setDesc(n),c.options.choose(1),t=t.submit(),c.jqXHR=t)},progress:function(e,t){utils.log("uploading... "+parseInt(t.loaded/t.total*100,10)+"
1%"),c.isUploading=!0,c.uploadProgressBar.width(parseInt(t.loaded/t.total*100,10)+"%")},done:function(e,t){utils.log("upload finish.");t=t.result.files[0];c.uploadProgressWrapper.addClass("cc-hide"),t.error?(c.uploadTitle.empty().append($("<span class='cc-error-color'>"+t.name+"</span>")),c.options.bottomAlert.empty().append($("<div class='alert alert-error'><strong>Error:</strong> "+t.error+".</div>")),c.uploadProgressBar.width("0%"),c.uploadButton.removeClass("disabled"),utils.removeMask(c.uploadButton)):(c.uploadAlert.append($("<div class='alert alert-success'>Your file uploaded successfully!</div>")),c.options.bottomAlert.empty().append($("<div class='alert alert-success'><strong>Note:</strong> Uploaded successfully, you can create flipbook right now!</div>")),c.isUploading=!1,c.isUploadComplete=!0,c.fileName=t.path,c.autoCreateGroup.isChecked()&&c.options.create2())},error:function(e,t){""!=c.createName&&"error"==e.statusText?$.ajax({url:"/aws-post-upload/callback.php",type:"get",dataType:"json",data:{bucket:"online.fliphtml5.com",key:c.createName,etag:"1307843ecdf688c065e5ca36949c3239"},success:function(e){e=e.files[0];""==e.error?(c.uploadAlert.append($("<div class='alert alert-success'>Your file uploaded successfully!</div>")),c.options.bottomAlert.empty().append($("<div class='alert alert-success'><strong>Note:</strong> Uploaded successfully, you can create flipbook right now!</div>")),c.isUploading=!1,c.isUploadComplete=!0,c.fileName=e.path,c.autoCreateGroup.isChecked()&&c.options.create2()):(c.options.bottomAlert.empty().append($("<div class='alert alert-error'><strong>Error:</strong> Tip: "+e.error+".)</div>")),c.uploadProgressBar.width("0%"),c.uploadButton.removeClass("disabled"),utils.removeMask(c.uploadButton))},error:function(){c.options.bottomAlert.empty().append($("<div class='alert alert-error'><strong>Error:</strong> Tip: Upload failed due to abnormal network connection (If a proxy is used, please close/open the proxy and try again.)</div>")),c.uploadProgressBar.width("0%"),c.uploadButton.removeClass("disabled"),utils.removeMask(c.uploadButton)}}):(c.options.bottomAlert.empty().append($("<div class='alert alert-error'><strong>Error:</strong> Tip: Upload failed due to abnormal network connection (If a proxy is used, please close/open the proxy and try again.)</div>")),c.uploadProgressBar.width("0%"),c.uploadButton.removeClass("disabled"),utils.removeMask(c.uploadButton))}})}
1function VideoGalleryPanel(e,t){this.bLink=t,this.panel=$("<div class='cc-gallery-content'></div>"),this.buttonContainer=$("<div class='cc-float-fix'></div>"),this.addButton=$("<div class='button-pure button-pure-sky-blue cc-left'><i class='icon icon-film'></i> Add Video</div>"),this.deleteAllButton=$("<div class='button-pure button-pure-red button-no-text cc-right' title='Delete All'><i class='icon icon-trash'></i></div>"),this.list=$("<ul class='cc-video-gallery-container'></ul>"),this.addButton.on("click",this.open.bind(this)),this.deleteAllButton.on("click",this.deleteAll.bind(this)),this.add("","","Title","Description","",!0);for(var i=e.length,a=0;a<i;a++){var o=e[a],n=o.hasOwnProperty("type")?o.type:"",s=o.hasOwnProperty("id")?o.id:"",l=o.hasOwnProperty("title")?o.title:"",c=o.hasOwnProperty("description")?o.description:"",o=o.hasOwnProperty("thumbnail")?o.thumbnail:"";this.add(n,s,l,c,o)}this.panel.append(this.buttonContainer.append(this.addButton).append(this.deleteAllButton)).append(this.list)}function VideoPanel(e,t,i){i&&(t+="?autoplay=1&loop=0&rel=0"),this.panel=$("<div class='cc-light-box-content-panel-no-padding'></div>"),this.iframe=$("<iframe height='651' width='1100' allowfullscreen webkitallowfullscreen mozallowfullscreen frameborder='0' src='"+t+"'></iframe>"),this.panel.height(651);t=new LightBox(e+"<a class='cc-light-box-head-link' href='"+t+"' target='_blank'>Open in new window</a>","",1100,"white");t.getBox().append(this.panel.append(this.iframe)),window.innerHeight<666?t.launch(!0):t.launch()}function WaterPanel(e){this.options=e,this.panel=$("<ul class='cc-water-panel'></ul>"),this.container=e.container,this.itemWidth=e.itemWidth,this.offsetX=e.offsetX,this.offsetY=e.offsetY,this.keyword=e.keyword||"",this.colHeights=[],this.isLike=e.isLike||!1,this.isInCenter=e.isInCenter||!1,this.isInHome=e.isInHome||!1,this.isInDomainHome=e.isInDomainHome||!1,this.lastTime="",this.isHideLeaveMask=e.isHideLeaveMask||!1,this.isInDomainHome||this.createHoverContent(),this.panel.appendTo(this.container),this.load(e.books);var t=this,i=null;$(window).on("resize",function(){clearTimeout(i),i=setTimeout(function(){t.setPosition()},50)})}fh5.database={category:[{id:1,name:"Animals & Pets",secondaryCategory:[{id:1,name:"Birds"},{id:2,name:"Dogs & Cats"},{id:3,name:"Farming"},{id:4,name:"Horses"},{id:5,name:"Wildlife"}]},{id:2,name:"Antiques & Collectibles",secondaryCategory:[{id:6,name:"Classic Vehicles"},{id:7,name:"Collectibles"}]},{id:3,name:"Art & Photography",secondaryCategory:[{id:9,name:"Art"},{id:10,name:"Art Instruction"},{id:11,name:"Graphic Arts"},{id:12,name:"Photography"},{id:13,name:"Photography Titles"},{id:14,name:"Skin Art"}]},{id:4,name:"Auto & Cycles",secondaryCategory:[{id:18,name:"Bikes"},{id:19,name:"Cars"},{id:20,name:"Motorsports"},{id:21,name:"Trains"}]},{id:5,name:"Books",secondaryCategory:[{id:22,name:"Educative"},{id:23,name:"Fiction"},{id:24,name:"Health-Related"},{id:25,name:"Non-Fiction"}]},{id:6,name:"Business & Finance",secondaryCategory:[{id:26,name:"Business"},{id:27,name:"Engineering"},{id:28,name:"Government"},{id:29,name:"Human Resources"},{id:30,name:"Investing"},{id:31,name:"Law"},{id:32,name:"Leadership"},{id:33,name:"Personal Finance"},{id:34,name:"Sales & Marketing"},{id:35,name:"Uncategorized"}]},{id:7,name:"Children",secondaryCategory:[{id:36,name:"Children"},{id:37,name:"Elementary"},{id:38,name:"Preschool"}]},{id:8,name:"Computers & Electronics",secondaryCategory:[{id:39,name:"Computers & Internet"},{id:40,name:"Electronics"}]},{id:9,name:"Cooking, Food & Beverage",secondaryCategory:[{id:41,name:"Beer, Wine, Spirits"},{id:42,name:"Cooking & Food"}]},{id:10,name:"Crafts",secondaryCategory:[{id:43,name:"Art & Decor"},{id:44,name:"Jewelry & Beadwork"},{id:45,name:"Scrapbooking & Cards"},{id:46,name:"Sewing & Needlework"}]},{id:11,name:"Enrichment",secondaryCategory:[{id:47,name:"Education"},{id:48,name:"History"},{id:49,name:"Literary"},{id:50,name:"Political & Social"},{id:51,name:"Self-Help"}]},{id:12,name:"Entertainment",secondaryCategory:[{id:52,name:"Celebrity"},{id:53,name:"Entertainment"},{id:54,name:"Gaming"},{id:55,name:"Music Entertainment"},{id:56,name:"TV & Movie"}]},{id:13,name:"Ethnic",secondaryCategory:[{id:57,name:"African-American"},{id:58,name:"Culture & Heritage"},{id:59,name:"Hispanic"},{id:60,name:"Spanish"}]},{id:14,name:"Fashion & Style",secondaryCategory:[{id:61,name:"Brid
1al"},{id:62,name:"Fashion"},{id:63,name:"Hairstyle"},{id:64,name:"Teen Style"}]},{id:15,name:"Health & Fitness",secondaryCategory:[{id:65,name:"Diet & Nutrition"},{id:66,name:"Fitness"},{id:67,name:"Health"},{id:68,name:"Health Conditions"},{id:69,name:"Healthy Living"}]},{id:16,name:"Hobbies",secondaryCategory:[{id:70,name:"Arts & Crafts"},{id:71,name:"Comics"},{id:72,name:"Sci-Fi & Mystery"}]},{id:17,name:"Home & Gardening",secondaryCategory:[{id:73,name:"Architecture"},{id:74,name:"Design"},{id:75,name:"Home"}]},{id:18,name:"Lifestyle",secondaryCategory:[{id:76,name:"Adventure"},{id:77,name:"Card Playing"},{id:78,name:"Holiday"},{id:79,name:"International"},{id:80,name:"Lifestyle & Leisure"},{id:81,name:"Real Estate & Home Building"},{id:82,name:"Recreation"},{id:83,name:"Travel"},{id:84,name:"Travel & Vacations"}]},{id:19,name:"Medical",secondaryCategory:[{id:85,name:"Medical Conditions"},{id:86,name:"Medical Journals"}]},{id:20,name:"Men's",secondaryCategory:[{id:87,name:"Auto"},{id:88,name:"Men's Interests"},{id:89,name:"Outdoor"},{id:90,name:"Sports & Athletics"},{id:91,name:"Weaponry"}]},{id:21,name:"Music",secondaryCategory:[{id:92,name:"Classical & Opera"},{id:93,name:"Country & Gospel"},{id:94,name:"Instruments & Performers"},{id:95,name:"Music News"},{id:96,name:"Urban"}]},{id:22,name:"News & Politics",secondaryCategory:[{id:97,name:"Ministry"},{id:98,name:"News"},{id:99,name:"Newspapers"},{id:100,name:"Political"}]},{id:23,name:"Parenting",secondaryCategory:[{id:101,name:"Family"},{id:102,name:"Kids & Teens"},{id:103,name:"Special Needs"}]},{id:24,name:"Religion",secondaryCategory:[{id:104,name:"Religion"},{id:105,name:"Religious Lifestyle"},{id:106,name:"Religious News"}]},{id:25,name:"Science & Nature",secondaryCategory:[{id:107,name:"Environmental"},{id:108,name:"Nanotechnology"},{id:109,name:"Nature"},{id:110,name:"Robots"},{id:111,name:"Science"},{id:112,name:"Space"}]},{id:26,name:"Sports & Recreation",secondaryCategory:[{id:113,name:"Aviation"},{id:114,name:"Boating"},{id:115,name:"Football"},{id:116,name:"Hunting & Fishing"},{id:117,name:"Sports"}]},{id:27,name:"Teen",secondaryCategory:[{id:118,name:"Comic Books"},{id:119,name:"Dance, Cheer, & Gymnastics"},{id:120,name:"Gamers"},{id:121,name:"Teen"},{id:122,name:"Teen Life"}]},{id:28,name:"Women's",secondaryCategory:[{id:123,name:"Bridal & Weddings"},{id:124,name:"Fashion & Beauty"}
1,{id:125,name:"Pregnancy & Family"},{id:126,name:"Women's Health"},{id:127,name:"Women's Interests"}]}],secondaryCategory:[{id:1,name:"Birds"},{id:2,name:"Dogs & Cats"},{id:3,name:"Farming"},{id:4,name:"Horses"},{id:5,name:"Wildlife"},{id:6,name:"Classic Vehicles"},{id:7,name:"Collectibles"},{id:8,name:"Adults"},{id:9,name:"Art"},{id:10,name:"Art Instruction"},{id:11,name:"Graphic Arts"},{id:12,name:"Photography"},{id:13,name:"Photography Titles"},{id:14,name:"Skin Art"},{id:15,name:"Art"},{id:16,name:"Art Instruction"},{id:17,name:"Graphic Arts"},{id:18,name:"Bikes"},{id:19,name:"Cars"},{id:20,name:"Motorsports"},{id:21,name:"Trains"},{id:22,name:"Educative"},{id:23,name:"Fiction"},{id:24,name:"Health-Related"},{id:25,name:"Non-Fiction"},{id:26,name:"Business"},{id:27,name:"Engineering"},{id:28,name:"Government"},{id:29,name:"Human Resources"},{id:30,name:"Investing"},{id:31,name:"Law"},{id:32,name:"Leadership"},{id:33,name:"Personal Finance"},{id:34,name:"Sales & Marketing"},{id:35,name:"Uncategorized"},{id:36,name:"Children"},{id:37,name:"Elementary"},{id:38,name:"Preschool"},{id:39,name:"Computers & Internet"},{id:40,name:"Electronics"},{id:41,name:"Beer, Wine, Spirits"},{id:42,name:"Cooking & Food"},{id:43,name:"Art & Decor"},{id:44,name:"Jewelry & Beadwork"},{id:45,name:"Scrapbooking & Cards"},{id:46,name:"Sewing & Needlework"},{id:47,name:"Education"},{id:48,name:"History"},{id:49,name:"Literary"},{id:50,name:"Political & Social"},{id:51,name:"Self-Help"},{id:52,name:"Celebrity"},{id:53,name:"Entertainment"},{id:54,name:"Gaming"},{id:55,name:"Music Entertainment"},{id:56,name:"TV & Movie"},{id:57,name:"African-American"},{id:58,name:"Culture & Heritage"},{id:59,name:"Hispanic"},{id:60,name:"Spanish"},{id:61,name:"Bridal"},{id:62,name:"Fashion"},{id:63,name:"Hairstyle"},{id:64,name:"Teen Style"},{id:65,name:"Diet & Nutrition"},{id:66,name:"Fitness"},{id:67,name:"Health"},{id:68,name:"Health Conditions"},{id:69,name:"Healthy Living"},{id:70,name:"Arts & Crafts"},{id:71,name:"Comics"},{id:72,name:"Sci-Fi & Mystery"},{id:73,name:"Architecture"},{id:74,name:"Design"},{id:75,name:"Home"},{id:76,name:"Adventure"},{id:77,name:"Card Playing"},{id:78,name:"Holiday"},{id:79,name:"International"},{id:80,name:"Lifestyle & Leisure"},{id:81,name:"Real Estate & Home Building"},{id:82,name:"Recreation"},{id:83,name:"Travel"},{id:84,name:"Travel & Vacations"},{id:85,name:"Medical Conditions"},{id:86,name:"Medical Journals"},{id:87,name:"Auto"},{id:88,name:"Men's Interests"},{id:89,name:"Outdoor"},{id:90,name:"Sports & Athletics"},{id:91,name:"Weaponry"},{id:92,name:"Classical & Opera"},{id:93,name:"Country & Gospel"},{id:94,name:"Instruments & Performers"},{id:95,name:"Music News"},{id:96,name:"Urban"},{id:97,name:"Ministry"},{id:98,name:"News"},{id:99,name:"Newspapers"},{id:100,name:"Political"},{id:101,name:"Family"},{id:102,name:"Kids & Teens"},{id:103,name:"Special Needs"},{id:104,name:"Religion"},{id:105,name:"Religious Lifestyle"},{id:106,name:"Religious News"},{id:107,name:"Environmental"},{id:108,name:"Nanotechnology"},{id:109,name:"Nature"},{id:110,name:"Robots"},{id:111,name:"Science"},{id:112,name:"Space"},{id:113,name:"Aviation"},{id:114,name:"Boating"},{id:115,name:"Football"},{id:116,name:"Hunting & Fishing"},{id:117,name:"Sports"},{id:118,name:"Comic Books"},{id:119,name:"Dance, Cheer, & Gymnastics"},{id:120,name:"Gamers"},{id:121,name:"Teen"},{id:122,name:"Teen Life"},{id:123,name:"Bridal & Weddings"},{id:124,name:"Fashion & Beauty"}
1,{id:125,name:"Pregnancy & Family"},{id:126,name:"Women's Health"},{id:127,name:"Women's Interests"}],type:[{id:1,name:"Magazine"},{id:2,name:"Cataloge"},{id:3,name:"Photo Album"},{id:4,name:"E-Book"},{id:5,name:"E-Card"},{id:6,name:"Artcle"},{id:7,name:"Essay"},{id:8,name:"Journal"},{id:9,name:"Manual"},{id:10,name:"Newspaper"},{id:11,name:"Paper"},{id:12,name:"Portfolio"},{id:13,name:"Report"},{id:14,name:"Other"},{id:15,name:"Brochure"},{id:16,name:"Comics"}],language:[{id:1,name:"Arabic"},{id:2,name:"Armenian"},{id:3,name:"Basque"},{id:4,name:"Bosnian"},{id:5,name:"Bulgarian"},{id:6,name:"Chinese"},{id:7,name:"Croatian"},{id:8,name:"Czech"},{id:9,name:"Danish"},{id:10,name:"Dutch"},{id:11,name:"English"},{id:12,name:"Estonian"},{id:13,name:"Finnish"},{id:14,name:"French"},{id:15,name:"Georgian"},{id:16,name:"German"},{id:17,name:"Greek"},{id:18,name:"Hebrew"},{id:19,name:"Hindi"},{id:20,name:"Hungarian"},{id:21,name:"Icelandic"},{id:22,name:"Indonesian"},{id:23,name:"Irish"},{id:24,name:"Italian"},{id:25,name:"Japanese"},{id:26,name:"Korean"},{id:27,name:"Latvian"},{id:28,name:"Lithuanian"},{id:29,name:"Macedonian"},{id:30,name:"Malaysian"},{id:31,name:"Norwegian"},{id:32,name:"Polish"},{id:33,name:"Portuguese"},{id:34,name:"Romanian"},{id:35,name:"Russian"},{id:36,name:"Serbian"},{id:37,name:"Slovak"},{id:38,name:"Slovenian"},{id:39,name:"Somali"},{id:40,name:"Spanish"},{id:41,name:"Swedish"},{id:42,name:"Turkish"},{id:43,name:"Ukrainian"}],region:[{id:1,name:"Africa"},{id:2,name:"Aland Islands"},{id:3,name:"Albania"},{id:4,name:"Algeria"},{id:5,name:"American Samoa"},{id:6,name:"Andorra"},{id:7,name:"Angola"},{id:8,name:"Anguilla"},{id:9,name:"Antigua and Barbuda"},{id:10,name:"Argentina"},{id:11,name:"Armenia"},{id:12,name:"Aruba"},{id:13,name:"Asia"},{id:14,name:"Australia"},{id:15,name:"Australia & Oceania"},{id:16,name:"Austria"},{id:17,name:"Azerbaijan"},{id:18,name:"Bahamas"},{id:19,name:"Bahrain"},{id:20,name:"Bangladesh"},{id:21,name:"Barbados"},{id:22,name:"Belarus"},{id:23,name:"Belgium"},{id:24,name:"Belize"},{id:25,name:"Benin"},{id:26,name:"Bermuda"},{id:27,name:"Bhutan"},{id:28,name:"Bolivia"},{id:29,name:"Bosnia and Herzegovina"},{id:30,name:"Botswana"},{id:31,name:"Brazil"},{id:32,name:"British Indian Ocean Territory"},{id:33,name:"Brunei"},{id:34,name:"Bulgaria"},{id:35,name:"Burkina Faso"},{id:36,name:"Burma (Myanmar)"},{id:37,name:"Burundi"},{id:38,name:"Cambodia"},{id:39,name:"Cameroon"},{id:40,name:"Canada"},{id:41,name:"Cape Verde"},{id:42,name:"Cayman Islands"},{id:43,name:"Central African Republic"},{id:44,name:"Chad"},{id:45,name:"Chile"},{id:46,name:"China"},{id:47,name:"Christmas Island"},{id:48,name:"Colombia"},{id:49,name:"Comoros"},{id:50,name:"Cook Islands"},{id:51,name:"Costa Rica"},{id:52,name:"Cote d'Ivoire"},{id:53,name:"Croatia"},{id:54,name:"Cuba"},{id:55,name:"Cyprus"},{id:56,name:"Czech Republic"},{id:57,name:"Democratic Republic of the Congo"},{id:58,name:"Denmark"},{id:59,name:"Djibouti"},{id:60,name:"Dominica"},{id:61,name:"Dominican Republic"},{id:62,name:"Ecuador"},{id:63,name:"Egypt"},{id:64,name:"El Salvador"},{id:65,name:"Equatorial Guinea"},{id:66,name:"Eritrea"},{id:67,name:"Estonia"},{id:68,name:"Ethiopia"},{id:69,name:"Europe"},{id:70,name:"Falkland Islands"},{id:71,name:"Faroe Islands"},{id:72,name:"Fiji"},{id:73,name:"Finland"},{id:74,name:"France"},{id:75,name:"French Guiana"},{id:76,name:"French Polynesia"},{id:77,name:"Gabon"},{id:78,name:"Gambia"},{id:79,name:"Georgia"},{id:80,name:"Germany"},{id:81,name:"Ghana"},{id:82,name:"Gibraltar"},{id:83,name:"Global"},{id:84,name:"Greece"},{id:85,name:"Greenland"},{id:86,name:"Grenada"},{id:87,name:"Guadeloupe"},{id:88,name:"Guam"},{id:89,name:"Guatemala"},{id:90,name:"Guernsey"},{id:91,name:"Guinea"},{id:92,name:"Guinea-Bissau"},{id:93,name:"Guyana"},{id:94,name:"Haiti"},{id:95,name:"Honduras"},{id:96,name:"Hong Kong"},{id:97,name:"Hungary"},{id:98,name:"Iceland"},{id:99,name:"India"},{id:100,name:"Indonesia"},{id:101,name:"Iran"},{id:102,name:"Iraq"},{id:103,name:"Ireland"},{id:104,name:"Isle of Man"},{id:105,name:"Israel"},{id:106,name:"Italy"},{id:107,name:"Jamaica"},{id:108,name:"Japan"},{id:109,name:"Jersey"},{id:110,name:"Jordan"},{id:111,name:"Kazakhstan"},{id:112,name:"Kenya"},{id:113,name:"Kiribati"},{id:114,name:"Kuwait"},{id:115,name:"Kyrgyzstan"},{id:116,name:"Laos"},{id:117,name:"Latvia"},{id:118,name:"Lebanon"},{id:119,name:"Lesotho"},{id:120,name:"Liberia"},{id:121,name:"Libya"},{id:122,name:"Liechtenstein"},{id:123,name:"Lithuania"},{id:124,name:"Luxembourg"},{id:125,name:"Macau"},{id:126,name:"Macedonia"},{id:127,name:"Madagascar"},{id:128,name:"Malawi"},{id:129,name:"Malaysia"},{id:130,name:"Maldives"},{id:131,name:"Mali"},{id:132,name:"Malta"},{id:133,name:"Marshall Islands"},{id:134,name:"Martinique"},{id:135,name:"Mauritania"},{id:136,name:"Mauritius"},{id:137,name:"Mayotte"},{id:138,name:"Mexico"},{id:139,name:"Micronesia"},{id:140,name:"Moldova"},{id:141,name:"Monaco"},{id:142,name:"Mongolia"},{id:143,name:"Montenegro"},{id:144,name:"Montserrat"},{id:145,name:"Morocco"}
1,{id:146,name:"Mozambique"},{id:147,name:"Namibia"},{id:148,name:"Nauru"},{id:149,name:"Nepal"},{id:150,name:"Netherlands"},{id:151,name:"Netherlands Antilles"},{id:152,name:"New Caledonia"},{id:153,name:"New Zealand"},{id:154,name:"Nicaragua"},{id:155,name:"Niger"},{id:156,name:"Nigeria"},{id:157,name:"Niue"},{id:158,name:"Norfolk Island"},{id:159,name:"North America"},{id:160,name:"North Korea"},{id:161,name:"Northern Mariana Islands"},{id:162,name:"Norway"},{id:163,name:"Oman"},{id:164,name:"Pakistan"},{id:165,name:"Palau"},{id:166,name:"Palestinian Territories"},{id:167,name:"Panama"},{id:168,name:"Papua New Guinea"},{id:169,name:"Paraguay"},{id:170,name:"Peru"},{id:171,name:"Philippines"},{id:172,name:"Pitcairn Islands"},{id:173,name:"Poland"},{id:174,name:"Portugal"},{id:175,name:"Puerto Rico"},{id:176,name:"Qatar"},{id:177,name:"Republic of the Congo"},{id:178,name:"Reunion"},{id:179,name:"Romania"},{id:180,name:"Russia"},{id:181,name:"Rwanda"},{id:182,name:"Saint Helena"},{id:183,name:"Saint Kitts and Nevis"},{id:184,name:"Saint Lucia"},{id:185,name:"Saint Pierre and Miquelon"},{id:186,name:"Saint Vincent and the Grenadines"},{id:187,name:"Samoa"},{id:188,name:"San Marino"},{id:189,name:"Sao Tome and Principe"},{id:190,name:"Saudi Arabia"},{id:191,name:"Senegal"},{id:192,name:"Serbia"},{id:193,name:"Seychelles"},{id:194,name:"Sierra Leone"},{id:195,name:"Singapore"},{id:196,name:"Slovakia"},{id:197,name:"Slovenia"},{id:198,name:"Solomon Islands"},{id:199,name:"Somalia"},{id:200,name:"South Africa"},{id:201,name:"South America"},{id:202,name:"South Korea"},{id:203,name:"Spain"},{id:204,name:"Sri Lanka"},{id:205,name:"Sudan"},{id:206,name:"Suriname"},{id:207,name:"Svalbard"},{id:208,name:"Swaziland"},{id:209,name:"Sweden"},{id:210,name:"Switzerland"},{id:211,name:"Syria"},{id:212,name:"Taiwan"},{id:213,name:"Tajikistan"},{id:214,name:"Tanzania"},{id:215,name:"Thailand"},{id:216,name:"Timor-Leste"},{id:217,name:"Togo"},{id:218,name:"Tokelau"},{id:219,name:"Tonga"},{id:220,name:"Trinidad and Tobago"},{id:221,name:"Tunisia"},{id:222,name:"Turkey"},{id:223,name:"Turkmenistan"},{id:224,name:"Turks and Caicos Islands"},{id:225,name:"Tuvalu"},{id:226,name:"Uganda"},{id:227,name:"Ukraine"},{id:228,name:"United Arab Emirates"},{id:229,name:"United Kingdom"},{id:230,name:"United States"},{id:231,name:"Uruguay"},{id:232,name:"Uzbekistan"},{id:233,name:"Vanuatu"},{id:234,name:"Vatican City"},{id:235,name:"Venezuela"},{id:236,name:"Vietnam"},{id:237,name:"Virgin Islands (British)"},{id:238,name:"Virgin Islands (US)"},{id:239,name:"Wallis and Futuna"},{id:240,name:"Western Sahara"},{id:241,name:"Yemen"},{id:242,name:"Zambia"},{id:243,name:"Zimbabwe"}]},fh5.font={t1:"pubhtml5",t2:"PubHTML5",t3:"PUBHTML5",b1:"book",b2:"Book",b3:"BOOK",m1:"pub",m2:"Pub",m3:"PUB",p1:"publication",p2:"Publication",p3:"PUBLACTION",p4:"online publication"},fh5.pageData={category:[{id:1,name:"Animals & Pets",shortName:"Animals",secondaryCategory:[{id:1,name:"Birds"},{id:2,name:"Dogs & Cats"},{id:3,name:"Farming"},{id:4,name:"Horses"},{id:5,name:"Wildlife"}]},{id:2,name:"Antiques & Collectibles",shortName:"Antiques",secondaryCategory:[{id:6,name:"Classic Vehicles"},{id:7,name:"Collectibles"}]},{id:3,name:"Art & Photography",shortName:"Art",secondaryCategory:[{id:9,name:"Art"},{id:10,name:"Art Instruction"},{id:11,name:"Graphic Arts"},{id:12,name:"Photography"},{id:13,name:"Photography Titles"},{id:14,name:"Skin Art"}]},{id:4,name:"Auto & Cycles",shortName:"Auto",secondaryCategory:[{id:18,name:"Bikes"},{id:19,name:"Cars"},{id:20,name:"Motorsports"},{id:21,name:"Trains"}]},{id:5,name:"Books",shortName:"Books",secondaryCategory:[{id:22,name:"Educative"},{id:23,name:"Fiction"},{id:24,name:"Health-Related"},{id:25,name:"Non-Fiction"}]},{id:6,name:"Business & Finance",shortName:"Business",secondaryCategory:[{id:26,name:"Business"},{id:27,name:"Engineering"},{id:28,name:"Government"},{id:29,name:"Human Resources"},{id:30,name:"Investing"},{id:31,name:"Law"},{id:32,name:"Leadership"},{id:33,name:"Personal Finance"},{id:34,name:"Sales & Marketing"},{id:35,name:"Uncategorized"}]},{id:7,name:"Children",shortName:"Children",secondaryCategory:[{id:36,name:"Children"},{id:37,name:"Elementary"},{id:38,name:"Preschool"}]},{id:8,name:"Computers & Electronics",shortName:"Computers",secondaryCategory:[{id:39,name:"Computers & Internet"},{id:40,name:"Electronics"}]},{id:9,name:"Cooking, Food & Beverage",shortName:"Food",secondaryCategory:[{id:41,name:"Beer, Wine, Spirits"},{id:42,name:"Cooking & Food"}]},{id:10,name:"Crafts",shortName:"Crafts",secondaryCategory:[{id:43,name:"Art & Decor"},{id:44,name:"Jewelry & Beadwork"},{id:45,name:"Scrapbooking & Cards"},{id:46,name:"Sewing & Needlework"}]},{id:11,name:"Enrichment",shortName:"Enrichment",secondaryCategory:[{id:47,name:"Education"},{id:48,name:"History"},{id:49,name:"Literary"},{id:50,name:"Political & Social"},{id:51,name:"Self-Help"}]},{id:12,name:"Entertainment",shortName:"Entertainment",secondaryCategory:[{id:52,name:"Celebrity"},{id:53,name:"Entertainment"},{id:54,name:"Gaming"},{id:55,name:"Music Entertainment"},{id:56,name:"TV & Movie"}]},{id:13,name:"Ethnic",shortName:"Ethnic",secondaryCategory:[{id:57,name:"African-American"},{id:58,name:"Culture & Heritage"},{id:59,name:"Hispanic"},{id:60,name:"Spanish"}]},{id:14,name:"Fashion & Style",shortName:"Fashion",secondaryCategory:[{id:61,name:"Brid
1al"},{id:62,name:"Fashion"},{id:63,name:"Hairstyle"},{id:64,name:"Teen Style"}]},{id:15,name:"Health & Fitness",shortName:"Health",secondaryCategory:[{id:65,name:"Diet & Nutrition"},{id:66,name:"Fitness"},{id:67,name:"Health"},{id:68,name:"Health Conditions"},{id:69,name:"Healthy Living"}]},{id:16,name:"Hobbies",shortName:"Hobbies",secondaryCategory:[{id:70,name:"Arts & Crafts"},{id:71,name:"Comics"},{id:72,name:"Sci-Fi & Mystery"}]},{id:17,name:"Home & Gardening",shortName:"Gardening",secondaryCategory:[{id:73,name:"Architecture"},{id:74,name:"Design"},{id:75,name:"Home"}]},{id:18,name:"Lifestyle",shortName:"Lifestyle",secondaryCategory:[{id:76,name:"Adventure"},{id:77,name:"Card Playing"},{id:78,name:"Holiday"},{id:79,name:"International"},{id:80,name:"Lifestyle & Leisure"},{id:81,name:"Real Estate & Home Building"},{id:82,name:"Recreation"},{id:83,name:"Travel"},{id:84,name:"Travel & Vacations"}]},{id:19,name:"Medical",shortName:"Medical",secondaryCategory:[{id:85,name:"Medical Conditions"},{id:86,name:"Medical Journals"}]},{id:20,name:"Men's",shortName:"Men's",secondaryCategory:[{id:87,name:"Auto"},{id:88,name:"Men's Interests"},{id:89,name:"Outdoor"},{id:90,name:"Sports & Athletics"},{id:91,name:"Weaponry"}]},{id:21,name:"Music",shortName:"Music",secondaryCategory:[{id:92,name:"Classical & Opera"},{id:93,name:"Country & Gospel"},{id:94,name:"Instruments & Performers"},{id:95,name:"Music News"},{id:96,name:"Urban"}]},{id:22,name:"News & Politics",shortName:"News",secondaryCategory:[{id:97,name:"Ministry"},{id:98,name:"News"},{id:99,name:"Newspapers"},{id:100,name:"Political"}]},{id:23,name:"Parenting",shortName:"Parenting",secondaryCategory:[{id:101,name:"Family"},{id:102,name:"Kids & Teens"},{id:103,name:"Special Needs"}]},{id:24,name:"Religion",shortName:"Religion",secondaryCategory:[{id:104,name:"Religion"},{id:105,name:"Religious Lifestyle"},{id:106,name:"Religious News"}]},{id:25,name:"Science & Nature",shortName:"Science",secondaryCategory:[{id:107,name:"Environmental"},{id:108,name:"Nanotechnology"},{id:109,name:"Nature"},{id:110,name:"Robots"},{id:111,name:"Science"},{id:112,name:"Space"}]},{id:26,name:"Sports & Recreation",shortName:"Sports",secondaryCategory:[{id:113,name:"Aviation"},{id:114,name:"Boating"},{id:115,name:"Football"},{id:116,name:"Hunting & Fishing"},{id:117,name:"Sports"}]},{id:27,name:"Teen",shortName:"Teen",secondaryCategory:[{id:118,name:"Comic Books"},{id:119,name:"Dance, Cheer, & Gymnastics"},{id:120,name:"Gamers"},{id:121,name:"Teen"},{id:122,name:"Teen Life"}]},{id:28,name:"Women's",shortName:"Women's",secondaryCategory:[{id:123,name:"Bridal & Weddings"},{id:124,name:"Fashion & Beauty"}
1,{id:125,name:"Pregnancy & Family"},{id:126,name:"Women's Health"},{id:127,name:"Women's Interests"}]}],errorMap:{0:"Unexpected error.",1:"Unexpected error.",2:"success.",3:"Invalid parameters.",4:"PDF file was corrupted.",5:"PDF file was encrypted.",6:"Failed to load the PDF.",7:"Failed to extract the table of contents of the PDF.",8:"Failed to extract links of the PDF.",9:"Failed to build search information of the PDF.",10:"Failed to import the PDF.",98:"Failed to clone the PDF.",99:"Server error",100:"Failed to convert"},templates:[{id:0,name:"Active",version:"Free"},{id:1,name:"Classical",version:"Free"},{id:2,name:"Clear",version:"Free"},{id:3,name:"Handy",version:"Free"},{id:4,name:"Facile",version:"Pro"},{id:5,name:"Float",version:"Pro"},{id:6,name:"Fresh",version:"Pro"},{id:7,name:"Gorgeous",version:"Pro"},{id:8,name:"Lively",version:"Pro"},{id:9,name:"Neat",version:"Pro"},{id:10,name:"Pure",version:"Pro"},{id:11,name:"Simple",version:"Pro"},{id:12,name:"Specific",version:"Pro"}],themes:["Default","DarkClouds","Dazzle","Florid","Gray","Green","LandScape","Neat-Blue","Unreal","WaterDrop","Wall-line"],types:["pdf"],tips:{ImageFormats:"Supported formats: JPG, PNG",ImageFormatsError:"* Only jpg or png files are allowed.",UnexpectedError:"* Unexpected error, please retry.",UnexpectedError2:" Unexpected error, please retry.",VerificationCodeError:"Verificate failed, please retry.",ChineseError:"* File Name Error. Try using English name instead.",AudioFormatsError:"* Only mp3 file is allowed.",ConnectionError:"<i class='icon icon-exclamation-sign'></i> Connection error, please retry.",ConnectionError2:"Connection error, please retry."},languages:["Arabic","Basque","Chinese","Czech","Dutch","English","French","German","Greek","Hebrew","Italian","Japanese","Korean","Portuguese","Russian","Spanish"],upgrade:{PRO:{items:["Custom Logo/Branding","Custom Templates","Import Links","Password Protection","Output HTML or Zip publications to local PC","No Ads","No related magazines in the viewer, just yours"],icon:"<a href='/pricing.php' target='_blank'><span class='button button-pill button-flat-action'>PRO</span></a>"},GOLD:{items:["Image Conversion","Access Statistics","5+ Online Templates","Text Version(for SEO)","Search Engine Optimization","Add Audio Hyperlink to Background","Tracking with Google Analytics"],icon:"<a href='/pricing.php' target='_blank'><span class='button button-pill button-flat-highlight'>GOLD</span></a>"},PLATINUM:{items:["Animation Editor","Page Editor","Batch Conversion","Office Conversion","Embed link, images, video, audio etc"],icon:"<a href='/pricing.php' target='_blank'><span class='button button-pill button-flat'>PLATINUM</span></a>"},ENTERPRISE:{items:["Make Native Android App","Animation Editor","Page Editor","Batch Convert","Office Conversion","Embed link, images, video, audio etc"],icon:"<a href='/pricing.php' target='_blank'><span class='button button-pill button-flat-royal'>ENTERPRISE</span></a>"},KeepPrivate:{version:"PRO",title:"Keep private on PubHTML5 Cloud",subTitle:"Embed & share your flipbook only with your own members",desc:"Your publications could not be accessed by the public on PubHTML5 Cloud, but still be functional on your website by using the embed code.",imgSrc:"/images/upgrade/pro.jpg",guidelines:["Unaccessible to the public on PubHTML5 Cloud, but still can be embedded into your own web and viewed by your readers.","This functioin is only available to Premium users."]},Interactive:{version:"PLATINUM",title:"Interactive rich multimedia elements",subTitle:"Create online digital publications with interactive multimedia",desc:"Add link, audio, video, animation and more multimedia to your flipbook. <a class='cc-blue-link-2' target='_blank' href='/desktop-version.php'>Details</a>",imgSrc:"/images/upgrade/gold.jpg",guidelines:["Unaccessible to the public on PubHTML5 Cloud, but still can be embedded into your own web and viewed by your readers.","This functioin is only available to Premium users."]},KeepPrivateOnTheInternet:{version:"PRO",title:"Private",subTitle:"Only authorized users can read your book",desc:"Your publications can only be accessed by authorized users, simply by entering the Authorization ID .",imgSrc:"/images/upgrade/KeepPrivateOnTheInternet.png"},Logo:{version:"PRO",title:"Custom logo",subTitle:"Set your own flipbook logo or not show any logo",desc:"upload your own logo to replace the default logo, which will shown on the left of the flipbook toolbar.",imgSrc:"/images/upgrade/pro.jpg"}
1,Template:{version:"PRO",title:"Upgrade to Pro to use this template",subTitle:"",desc:"This template is only available to Pro or above users. With this upgrade, you can use all the templates provided by PubHTML5.",imgSrc:"/images/upgrade/pro.jpg"},Download:{version:"PRO",title:"Download PDF file",subTitle:"The authority to download PDF file",desc:"Only premium users have sufficient authority to download the original pdf file or set permission for readers to download it.",imgSrc:"/images/download-pdf.jpg"},DownloadZip:{version:"PRO",title:"Download ZIP file",subTitle:"The authority to download ZIP file",desc:"Only PRO and above users have sufficient authority to download the ZIP format of the publication. The ZIP format will be more convenient for storing in PC, sharing via email transmission and embedding to your website or blog.",imgSrc:"/images/download-zip.jpg"},Label:{version:"PRO",title:"Book Label",subTitle:"Pick a particular label for your publications",desc:'Only premium users have sufficient authority to label your publications with "New", "Hot", or "Featured".',imgSrc:"/images/upgrade/label.png"},AboutLogo:{version:"PRO",title:"Custom about logo",subTitle:"Set your own company logo",desc:"The logo to show when the About Button is clicked.",imgSrc:"/images/upgrade/pro.jpg"},BookcasePassword:{version:"PRO",title:"Bookcase Password",subTitle:"Protect your bookcase with a password",desc:"Readers are required to enter a password to access your bookcase.",imgSrc:"/images/upgrade/bookcase-password.png"},BookcaseInvisable:{version:"PRO",title:"Bookcase Invisable",subTitle:"Disable your bookcase",desc:"If you want to stop your bookcase without deleting it, just set it to Invisable, and then it won't be accessed by anybody.",imgSrc:"/images/upgrade/bookcase-invisable.png"},CustomDomain:{version:"PLATINUM",title:"Custom Domain",subTitle:"Change the domain of your publication from mobissue.com to yourdomain.com",desc:"Serve your publications at a custom domain that you own (yourdomain.com) or at specific subdomains of that domain (books.yourdomain.com). <br />For example, you can change the book link from <span class='cc-underline'>http://mobissue.com/suwl/abhd</span> to <span class='cc-underline'>http://yourdomain.com/books/abhd</span>.",imgSrc:"/images/upgrade/custom-domain.jpg"},ExportCSVLimit:{version:"PRO",title:"Export Book Data.",subTitle:"",desc:"Export the list of all book urls in a CSV file without having to copy them one by one at a time.",imgSrc:"/images/upgrade/export-book-url.png"},Homepage:{version:"PRO",title:"Edit Homepage",subTitle:"",desc:"All the books created by Free user would be displayed on the homepage.Only Pro and the above users have the sufficient authority to edit the homepage including setting password for it and specifying books displayed on homepage. ",imgSrc:"/images/upgrade/homepage.png"}},bookConfig:{FlipSound:"yes",QRCode:"Hide",appLogoIcon:"/booklogo.png",appLogoLinkURL:"http://"+fh5.font.t1+".com/",HomeURL:"",appLogoOpenWindow:"Blank",bookTitle:""+fh5.font.b3,bookDescription:"",toolbarColor:"#111111",iconColor:"#eeeeee",iconFontColor:"#eeeeee",pageNumColor:"#111111",loadingCaption:"Loading",loadingCaptionColor:"#DDDDDD",logoHeight:30,logoPadding:5,HomeButtonVisible:"Hide",ShareButtonVisible:"Show",ThumbnailsButtonVisible:"Show",thumbnailColor:"#333333",thumbnailAlpha:70,ZoomButtonVisible:"Show",FullscreenButtonVisible:"Show",TableOfContentButtonVisible:"Hide",bookmarkBackground:"#000000",bookmarkFontColor:"#cccccc",SearchButtonVisible:"Show",leastSearchChar:3,searchBackground:"#f6f6f6",searchFontColor:"#b0b0b0",PrintButtonVisible:"Show",printWatermarkFile:"",BookMarkButtonVisible:"Show",BackgroundSoundButtonVisible:"Hide",BackgroundSoundURL:"",BackgroundSoundLoop:-1,HelpButtonVisible:"Hide",helpContentFileURL:"",helpWidth:400,helpHeight:450,showHelpContentAtFirst:"No",aboutButtonVisible:"Hide",aboutContactInfoTxt:"",AutoPlayButtonVisible:"Show",autoPlayAutoStart:"No",autoPlayDuration:3,autoPlayLoopCount:1,minZoomWidth:403,minZoomHeight:518,mouseWheelFlip:"yes",DownloadButtonVisible:"Hide",DownloadURL:"",UserInforSetting:"",bgBeginColor:"#3a3a3a",bgEndColor:"#3a3a3a",bgMRotation:90,backGroundImgURL:"",LeftShadowWidth:50,LeftShadowAlpha:1,RightShadowWidth:30,RightShadowAlpha:1,pageBackgroun
1dColor:"#FFFFFF",flipshortcutbutton:"Show",OriginPageIndex:1,HardPageEnable:"No",RightToLeft:"No",flippingTime:.5,retainBookCenter:"Yes",FlipStyle:"catalog",showDoublePage:"Yes",totalPagesCaption:"",pageNumberCaption:"",topMargin:5,bottomMargin:5,leftMargin:0,rightMargin:0,LinkDownColor:"#0000FF",LinkAlpha:.4,OpenWindow:"Blank",googleAnalyticsID:"",UIBaseURL:"http://static."+fh5.font.t1+".com/book/template/Handy/",language:"English",AboutAddress:"",AboutEmail:"",AboutMobile:"",AboutWebsite:"",AboutDescription:"",totalPageCount:6,largePageWidth:566.929,largePageHeight:595.28,normalPath:"files/large/",largePath:"files/large/",thumbPath:"files/thumb/",VideoButtonVisible:"Hide",SlideshowButtonVisible:"Hide",addPaperCoil:"No",AnnotationButtonVisible:"Hide",logoTop:5,CompanyLogoFile:"",loadingBackground:"#7c7c7c",ToolbarViewMode:"Standard",formBackgroundColor:"#111111",formFontColor:"#eeeeee",SelectTextButtonVisible:"Hide",hideMiniFullscreen:"No",isStopMouseMenu:"Yes",maxWidthToSmallMode:400,maxHeightToSmallMode:300}},ActivityEachDay.prototype={init:function(e){if(!(new Date(Date.parse(e.endDate.replace(/-/g,"/"))).getTime()<(new Date).getTime())){var t=this.getLocalStorage(e.timeKey)?this.getLocalStorage(e.timeKey):"";if(e.isEachDay){if(""!=t&&hf_utils.formatDate(new Date,"yyyy-MM-dd")==hf_utils.formatDate(new Date(parseInt(t)),"yyyy-MM-dd"))return}else if(""!=t&&parseInt(t)>new Date(Date.parse(e.startDate.replace(/-/g,"/"))).getTime())return;var i=this,a=$("<div class='af-fixed-bar'></div>").addClass(e.className),o=$("<div class='af-table-centered'></div>"),n=$("<div class='af-fixed-content'></div>"),t=$('<div class="af-fixed-close"></div>').addClass(e.showCLose?"":"af-hide");this.$p=a,this.$cb=t,a.append(o.append(n.append(e.content).append(t))).appendTo($("body")),$("body").addClass("af-fixed-body"),a.addClass("show"),n.on("click",function(e){e.stopPropagation()}),e.showCLose&&t.on("click",function(){i.close()}),e.isEaseClose&&a.on("click",function(){i.close()})}},getLocalStorage:function(e){try{if(window.localStorage)return window.localStorage.getItem(e);for(var t=document.cookie.split("; "),i=0;i<t.length;i++){var a=t[i].split("=");if(a[0]==e)return unescape(a[1])}return""}catch(e){return""}},addLocalStorage:function(e,t){try{var i,a;window.localStorage?window.localStorage.setItem(e,t):(i=e+"="+escape(t),a=new Date,a.setTime(a.getTime()+864e8),i+="; expires="+a.toGMTString(),document.cookie=i)}catch(e){}},getCloseBtn:function(){return this.$cb},close:function(){this.$p.removeClass("show").hide(),this.addLocalStorage(this.opt.timeKey,(new Date).getTime()),$("body").removeClass("af-fixed-body")}},AddVideoPanel.prototype={constructor:AddVideoPanel,getVideoInfo:function(){if(this.validate(!0)){var t=this,e=t.typeSelect.val(),i=this.idInput.val().trim();switch(e){case"youtube":$.ajax({url:"http://gdata.youtube.com/feeds/api/videos/"+i+"?v=2&alt=jsonc",dataType:"json",beforeSend:function(){utils.addMask(t.panel,{text:"Processing...",fontSize:"26px"})},success:function(e){utils.removeMask(t.panel),e=e.data,e.title,e.description,e.thumbnail.sqDefault,t.setVideoInfo(e.title,e.description,e.thumbnail.sqDefault)},error:t.errorCallback.bind(t)});break;case"vimeo":$.ajax({url:"http://www.vimeo.com/api/v2/video/"+i+".json",dataType:"jsonp",beforeSend:function(){utils.addMask(t.panel,{text:"Processing...",fontSize:"26px"})},timeout:"6000",success:function(e){utils.removeMask(t.panel),e=e[0],e.title,e.description,e.thumbnail_medium,t.setVideoInfo(e.title,e.description,e.thumbnail_medium)},error:t.errorCallback.bind(t)})}}},errorCallback:function(){utils.removeMask(this.panel),this.helpMessage.html("<i class='icon icon-exclamation-sign'></i> Failed to get the video info, please complete it yourself.")},setVideoInfo:function(e,t,i){this.titleInput.val(e),this.descInput.val(t),utils.autoFit(this.thumbnailContainer,this.thumbnailImg.attr("src",i))},add:function(){var e,t,i,a,o;this.validate(!0)&&(e=this.typeSelect.val(),t=this.idInput.val().trim(),i=this.titleInput.val().trim(),a=this.descInput.val().trim(),o=decodeURIComponent(this.thumbnailImg.attr("src")),this.options.videoGalleryPanel.add(e,t,i,a,o),this.lightBox.cancel())},save:function(){var e,t,i,a,o,n,s;
1this.validate(!0)&&(e=this.typeSelect.val(),t=this.idInput.val().trim(),i=this.titleInput.val().trim(),a=this.descInput.val().trim(),o=decodeURIComponent(this.thumbnailImg.attr("src")),s=(n=this.options.videoItem).find(".cc-video-gallery-thumbnail img"),n.data("value",{type:e,id:t,title:i,description:a,thumbnail:o}),s.attr("src",o),o?s.show():s.hide(),n.find(".cc-video-gallery-title").html(utils.encodeHTML(i)),n.find(".cc-video-gallery-desc").html(utils.encodeHTML(a)),this.lightBox.cancel())},validate:function(e){return utils.validate("text",this.idInput,this.helpMessage,e,"","!","Please enter a youtube or vimeo video id.")}},AdvancedSection.prototype={constructor:AdvancedSection,getBoolFlag:function(e){return void 0!==e&&0<=["show","yes","enable","true"].indexOf(e.toString().toLowerCase())},fillSelect:function(e){e.append("<option value='1'>Enable</option>"),e.append("<option value='0'>Disable</option>")},fillLoopSelect:function(e){for(e.append($("<option value='-1'>Always</option>")),i=1;i<=10;i++)e.append($("<option value='"+i+"'>"+i+"</option>"))},isBackgroundImageUploading:function(){return this.backgroundImageUploading},isBackgroundSoundUploading:function(){return this.backgroundSoundUploading},isLogoUploading:function(){return this.logoUploading},isAboutLogoUploading:function(){return this.aboutLogoUploading},setTemplateName:function(e){this.templateName=e},setThemeName:function(e){this.themeName=e},resetBookConfig:function(e,t){this.options.bookConfig=$.extend({},fh5.pageData.bookConfig,e),this.reset(!0,t)},addLoading:function(){this.loading.css("line-height",this.section.data("height")+"px").appendTo(this.section).fadeIn()},removeLoading:function(){this.loading.fadeOut(400,function(){})},selectAll:function(){var e=this.buttonGroup.find(".cc-advanced-button-checkbox");this.selectAllInput.is(":checked")?e.each(function(e,t){t.checked=!0}):e.each(function(e,t){t.checked=!1}),this.toggleAllContent()},getBookConfig:function(){var e={UIBaseURL:"//static.pubhtml5.com/book/template/"+this.templateName+"/",ToolbarViewMode:this.liteModeRadio[0].checked?"Lite":"Standard",flipshortcutbutton:"1"==this.enablePageButtonSelect.val()?"Show":"Hide",SelectTextButtonVisible:"1"==this.SelectTextSelect.val()?"Yes":"No",updateURLForPage:"1"==this.PageUrlTextSelect.val()?"Show":"Hide",QRCode:"1"==this.enableQRCodeSelect.val()?"Show":"Hide",autoPlayAutoStart:"1"==this.enableAutoFlipSelect.val()?"Yes":"No",FlipSound:"1"==this.enableFlipSoundSelect.val()?"Yes":"No",RightToLeft:"1"==this.enableRightToLeftSelect.val()?"Yes":"No",HardPageEnable:"1"==this.enableHardCoverSelect.val()?"Yes":"No",mouseWheelFlip:"1"==this.enableMouseWheelSelect.val()?"Yes":"No",retainBookCenter:"1"==this.enableAutoCenterSelect.val()?"Yes":"No",addPaperCoil:"1"==this.enableLooseLeafSelect.val()?"Yes":"No",hideMiniFullscreen:"1"==this.hideFullscreenl
1Select.val()?"Yes":"No",isStopMouseMenu:"1"==this.rightClickscreenSelect.val()?"Yes":"No",googleAnalyticsID:this.googleInput.val(),loadingCaption:this.mainLoadingCaptionTextInput.val().trim(),language:this.bookLanguageSelect.val().trim(),flippingTime:parseFloat(this.flipSpeedInput.val().trim()),topMargin:parseInt(this.bookMarginTopInput.val().trim()),rightMargin:parseInt(this.bookMarginRightInput.val().trim()),bottomMargin:parseInt(this.bookMarginBottomInput.val().trim()),leftMargin:parseInt(this.bookMarginLeftInput.val().trim()),LeftShadowWidth:parseInt(this.shadowLeftWidthInput.val()),LeftShadowAlpha:parseFloat(this.shadowLeftAlphaSelect.val()),RightShadowWidth:parseInt(this.shadowRightWidthInput.val()),RightShadowAlpha:parseFloat(this.shadowRightAlphaSelect.val()),maxWidthToSmallMode:parseInt(this.miniModeWidthInput.val().trim()),maxHeightToSmallMode:parseInt(this.miniModeHeightInput.val().trim()),bgBeginColor:this.backgroundGradientStartColorInput.spectrum("get").toHexString(),bgEndColor:this.backgroundGradientEndColorInput.spectrum("get").toHexString(),bgMRotation:parseInt(this.backgroundGradientAngleInput.val().trim()),backGroundImgURL:this.backgroundImageRadio[0].checked?this.backgroundImageImg.attr("src"):"",toolbarColor:this.toolbarBackgroundColorInput.spectrum("get").toHexString(),iconColor:this.toolbarButtonColorInput.spectrum("get").toHexString(),pageNumColor:this.toolbarPageNumFontColorInput.spectrum("get").toHexString(),loadingCaptionColor:this.loadingCaptionColorInput.spectrum("get").toHexString(),ShareButtonVisible:this.shareInput[0].checked?"Show":"Hide",FullscreenButtonVisible:this.fullscreenInput[0].checked?"Show":"Hide",ThumbnailsButtonVisible:this.thumbnailsInput[0].checked?"Show":"Hide",ZoomButtonVisible:this.zoomInput[0].checked?"Show":"Hide",SearchButtonVisible:this.searchInput[0].checked?"Show":"Hide",PrintButtonVisible:this.printInput[0].checked?"Show":"Hide",BookMarkButtonVisible:this.bookmarkInput[0].checked?"Show":"Hide",AnnotationButtonVisible:this.annotationInput[0].checked?"Show":"Hide",HomeButtonVisible:this.homeInput[0].checked?"Show":"Hide",HomeURL:this.homeUrlInput.val(),DownloadButtonVisible:this.downloadInput[0].checked?"Show":"Hide",DownloadURL:this.downloadUrlInput.val(),AutoPlayButtonVisible:this.autoPlayInput[0].checked?"Show":"Hide",autoPlayDuration:parseFloat(this.autoPlayTimeInput.val().trim()),autoPlayLoopCount:this.autoPlayLoopsSelect.val(),TableOfContentButtonVisible:this.tocInput[0].checked?"Show":"Hide",bookmarkFontColor:this.tocFontColorInput.spectrum("get").toHexString(),bookmarkBackground:this.tocBackgroundColorInput.spectrum("get").toHexString(),Backgroun
1dSoundButtonVisible:this.backgroundSoundInput[0].checked?"Show":"Hide",BackgroundSoundURL:this.backgroundSoundInput[0].checked?decodeURIComponent(this.backgroundSoundAudio.attr("src")):"",BackgroundSoundLoop:parseInt(this.backgroundSoundLoopsSelect.val().trim()),appLogoIcon:this.logoInput[0].checked?decodeURIComponent(this.logoImageImg.attr("src")):"",appLogoLinkURL:this.logoUrlInput.val(),logoPadding:parseInt(this.logoPaddingLeftInput.val().trim()),logoTop:parseInt(this.logoPaddingTopInput.val().trim()),logoHeight:parseInt(this.logoHeightInput.val().trim()),aboutButtonVisible:this.aboutInput[0].checked?"Show":"Hide",AboutEmail:this.aboutEmailInput.val(),AboutMobile:this.aboutMobileInput.val(),AboutWebsite:this.aboutWebsiteInput.val(),AboutAddress:this.aboutAddressInput.val(),AboutDescription:this.aboutDescInput.val(),CompanyLogoFile:this.aboutInput[0].checked?decodeURIComponent(this.aboutLogoImg.attr("src")):"",VideoButtonVisible:this.videoGalleryInput[0].checked?"Show":"Hide",SlideshowButtonVisible:this.imageGalleryInput[0].checked?"Show":"Hide"};return $.extend({},this.options.bookConfig,e)},reset:function(e,t){var i=$.extend({},fh5.pageData.bookConfig,this.options.bookConfig);switch(i.ToolbarViewMode.toLowerCase()){case"lite":this.liteModeRadio[0].checked=!0;break;case"standard":this.standardModeRadio[0].checked=!0}var a,o,n,s,l=i.hasOwnProperty("updateURLForPage")?i.updateURLForPage:"no";this.PageUrlTextSelect.val(0<=["show","yes","enable","true"].indexOf(l.toLowerCase())?1:0),this.enablePageButtonSelect.val("show"==i.flipshortcutbutton.toLocaleLowerCase()?1:0),this.SelectTextSelect.val("show"==i.SelectTextButtonVisible.toLocaleLowerCase()?1:0),this.enableQRCodeSelect.val("show"==i.QRCode.toLocaleLowerCase()?1:0),this.enableAutoFlipSelect.val("yes"==i.autoPlayAutoStart.toLocaleLowerCase()?1:0),this.enableFlipSoundSelect.val("yes"==i.FlipSound.toLocaleLowerCase()?1:0),this.enableRightToLeftSelect.val("yes"==i.RightToLeft.toLocaleLowerCase()?1:0),this.enableHardCoverSelect.val("yes"==i.HardPageEnable.toLocaleLowerCase()?1:0),this.enableMouseWheelSelect.val("yes"==i.mouseWheelFlip.toLocaleLowerCase()?1:0),this.enableAutoCenterSelect.val("yes"==i.retainBookCenter.toLocaleLowerCase()?1:0),this.enableLooseLeafSelect.val("yes"==i.addPaperCoil.toLocaleLowerCase()?1:0),this.hideFullscreenl
1Select.val("yes"==i.hideMiniFullscreen.toLocaleLowerCase()?1:0),this.rightClickscreenSelect.val("yes"==i.isStopMouseMenu.toLocaleLowerCase()?1:0),this.googleInput.val(i.googleAnalyticsID),this.mainLoadingCaptionTextInput.val(i.loadingCaption),-1==fh5.pageData.languages.indexOf(i.language)&&(i.language="English"),this.bookLanguageSelect.val(i.language),this.flipSpeedInput.val(i.flippingTime),this.bookMarginTopInput.val(i.topMargin),this.bookMarginRightInput.val(i.rightMargin),this.bookMarginBottomInput.val(i.bottomMargin),this.bookMarginLeftInput.val(i.leftMargin),this.shadowLeftWidthInput.val(i.LeftShadowWidth),this.shadowLeftAlphaSelect.val(i.LeftShadowAlpha),this.shadowRightWidthInput.val(i.RightShadowWidth),this.shadowRightAlphaSelect.val(i.RightShadowAlpha),this.miniModeWidthInput.val(i.maxWidthToSmallMode),this.miniModeHeightInput.val(i.maxHeightToSmallMode),this.backgroundGradientStartColorInput.spectrum("set",i.bgBeginColor),this.backgroundGradientEndColorInput.spectrum("set",i.bgEndColor),this.backgroundGradientAngleInput.val(i.bgMRotation),this.setGradientBackground(),i.backGroundImgURL?(n=i.backGroundImgURL.match(/^http/)?"files/extfile/innerMainbgImgUrl."+i.backGroundImgURL.substr(i.backGroundImgURL.length-3):i.backGroundImgURL,this.backgroundImageRadio[0].checked=!0,s=e?fh5.website
1+"Themes/"+this.themeName+"/innerMainbgImgUrl.jpg":"https://"+fh5.AS3BucketName+"/"+fh5.uLink+"/"+this.options.bLink+"/"+n,utils.autoFit(this.backgroundImageContainer,this.backgroundImageImg.attr("src",s))):this.backgroundColorRadio[0].checked=!0,this.toolbarButtonColorInput.spectrum("set",i.iconColor),this.toolbarBackgroundColorInput.spectrum("set",i.toolbarColor),this.logoImageContainer.css("background",this.toolbarBackgroundColorInput.spectrum("get").toHexString()),this.toolbarPageNumFontColorInput.spectrum("set",i.pageNumColor),this.loadingCaptionColorInput.spectrum("set",i.loadingCaptionColor),this.shareInput[0].checked=this.getBoolFlag(i.ShareButtonVisible),this.fullscreenInput[0].checked=this.getBoolFlag(i.FullscreenButtonVisible),this.thumbnailsInput[0].checked=this.getBoolFlag(i.ThumbnailsButtonVisible),this.zoomInput[0].checked=this.getBoolFlag(i.ZoomButtonVisible),this.searchInput[0].checked=this.getBoolFlag(i.SearchButtonVisible),this.printInput[0].checked=this.getBoolFlag(i.PrintButtonVisible),this.bookmarkInput[0].checked=this.getBoolFlag(i.BookMarkButtonVisible),this.annotationInput[0].checked=this.getBoolFlag(i.AnnotationButtonVisible),this.homeInput[0].checked=this.getBoolFlag(i.HomeButtonVisible),this.homeUrlInput.val(i.HomeURL),this.downloadInput[0].checked=this.getBoolFlag(i.DownloadButtonVisible),this.downloadUrlInput.val(i.DownloadURL),this.autoPlayInput[0].checked=this.getBoolFlag(i.AutoPlayButtonVisible),this.autoPlayTimeInput.val(i.autoPlayDuration),this.autoPlayLoopsSelect.val(i.autoPlayLoopCount),this.tocInput[0].checked=this.getBoolFlag(i.TableOfContentButtonVisible),this.tocFontColorInput.spectrum("set",i.bookmarkFontColor),this.tocBackgroundColorInput.spectrum("set",i.bookmarkBackground),this.backgroundSoundInput[0].checked=this.getBoolFlag(i.BackgroundSoundButtonVisible),i.Backgroun
1dSoundURL&&(e=(e=i.BackgroundSoundURL.split("/"))[e.length-1],n=i.BackgroundSoundURL.match(/^http/)?"files/extfile/flipsound.mp3":i.BackgroundSoundURL,this.backgroundSoundFileTitle.text(e),this.backgroundSoundAudio.show().attr("src","https://"+fh5.AS3BucketName+"/"+fh5.uLink+"/"+this.options.bLink+"/"+n)),this.backgroundSoundLoopsSelect.val(i.BackgroundSoundLoop),t||(s="0"==fh5.uType?(a=!0,o=fh5.pageData.bookConfig.appLogoLinkURL,"https://"+fh5.AS3BucketName+fh5.pageData.bookConfig.appLogoIcon):this.options.isNew?(a=!0,o=fh5.settingsWebsite,fh5.settingsBookLogo?"https://"+fh5.AS3BucketName+"/"+fh5.uLink+"/booklogo.png":"https://"+fh5.AS3BucketName+"/booklogo.png"):(a=""!==i.appLogoIcon,o=i.appLogoLinkURL,""!==i.appLogoIcon?i.appLogoIcon.match("files/extfile/booklogo")||i.appLogoIcon.match("/upload-control/files/")?"https://"+fh5.AS3BucketName+"/"+fh5.uLink+"/"+this.options.bLink+"/files/extfile/booklogo."+i.appLogoIcon.substr(i.appLogoIcon.length-3):i.appLogoIcon.match("files/extfile/appLogoIcon")?"https://"+fh5.AS3BucketName+"/"+fh5.uLink+"/"+this.options.bLink+"/"+i.appLogoIcon:(t=new RegExp(fh5.AS3BucketName+"(.*)"),i.appLogoIcon.match(t)?i.appLogoIcon:"https://"+fh5.AS3BucketName+i.appLogoIcon):""),this.logoInput[0].checked=a,this.logoUrlInput.val(utils.pasreHttps(o)),s&&utils.autoFit(this.logoImageContainer,this.logoImageImg.attr("src",utils.pasreHttps(s))),this.logoPaddingLeftInput.val(i.logoPadding),this.logoPaddingTopInput.val(i.logoTop),this.logoHeightInput.val(i.logoHeight),this.aboutInput[0].checked="show"==i.aboutButtonVisible.toLowerCase(),this.aboutEmailInput.val(i.AboutEmail),this.aboutMobileInput.val(i.AboutMobile),this.aboutWebsiteInput.val(i.AboutWebsite),this.aboutAddressInput.val(i.AboutAddress),this.aboutDescInput.val(i.AboutDescription)),i.CompanyLogoFile&&(n=i.CompanyLogoFile.match(/^http/)?"files/extfile/company_logo."+i.CompanyLogoFile.substr(i.CompanyLogoFile.length-3):i.CompanyLogoFile,s="https://"+fh5.AS3BucketName+"/"+fh5.uLink+"/"+this.options.bLink+"/"+n,this.aboutLogoImg.attr("src",utils.pasreHttps(s)),utils.autoFit(this.aboutLogoContainer,this.aboutLogoImg)),this.videoGalleryInput[0].checked="show"==i.VideoButtonVisible.toLowerCase(),this.imageGalleryInput[0].checked="show"==i.SlideshowButtonVisible.toLowerCase(),this.toggleAllContent()},reloadThemeSetting:function(c){var d=this;$.ajax({type:"GET",url:"/Themes/"+d.themeName+"/tmplSetting.txt",beforeSend:function(){d.addLoading()},success:function(e){d.removeLoading();for(var t,i,a=e.replace(/\r\n/g,"\n").split("\n"),o=["bgMRotation","pageWidth","pageHeight","BookMargins","topMargin","bottomMargin","leftMargin","rightMargin"],n={},s=0,l=a.length;s<l;s++)""!==a[s].trim()&&(t=(i=a[s].split("="))[0],i=i[1],-1!==o.indexOf(t)&&""!==i&&(i=parseInt(i)),"appLogoIcon"!==t&&"appLogoLinkURL"!==t&&(n[t]=i));d.resetBookConfig(n,c)}})},setGradientBackground:function(){var e=this.backgroundGradientStartColorInput.spectrum("get").toHexString(),t=this.backgroundGradientEndColorInput.spectrum("get").toHexString(),i=-this.backgroundGradientAngleInput.val().trim(),a="cc-background-color-"+(new Date).getTime(),o=Math.floor(parseInt(-i%360)/90),n=e,s=t,l=o%2==0?1:0;1<o&&(n=t,s=e),this.backgroundColorStyle.text("."+a+" {background: -webkit-linear-gradient("+i+"deg, "+e+", "+t+");background: -moz-linear-gradient("+i+"deg, "+e+", "+t+");background: -o-linear-gradient("+i+"deg, "+e+", "+t+");background: -ms-linear-gradient("+i+"deg, "+e+", "+t+");filter: progid:DXImageTransform.Microsoft.gradient(gradientType="+l+", startColorstr="+n+", endColorstr="+s+");-ms-filter: progid:DXImageTransform.Microsoft.gradient(gradientType="+l+", startColorstr="+n+", endColorstr="+s+");}"),this.backgroundColorContainer.addClass(a)},toggleAllContent:function(){this.toggleContent(this.homeInput,this.homeUrlInput,null,!1),this.toggleContent(this.downloadInput,this.downloadUrlInput,null,!1,this.downloadDefaultBtn),this.toggleContent(this.backgroundSoundInput,null,this.backgroundSoundContentContainer,!1),this.toggleContent(this.logoInput,null,this.logoContentContainer,!1),this.toggleContent(this.aboutInput,null,this.aboutContentContainer,!1),this.toggleContent(this.autoPlayInput,null,this.autoPlayContentContainer,!1),this.toggleContent(this.tocInput,null,this.tocContentContainer,!1),this.toggleContent(this.videoGalleryInput,null,this.videoGalleryContentContainer,!1),this.toggleContent(this.imageGalleryInput,null,this.imageGalleryContentContainer,!1)},toggleContent:function(e,t,i,a,o){e.is(":checked")?(t&&(t.show().animate({width:380,opacity:1},400),a&&(t.focus(),o&&0<o.length&&o.show())),i&&i.slideDown()):(t&&(t.animate({width:0,opacity:0}
1,400,function(){t.hide()}),o&&0<o.length&&o.hide()),i&&i.slideUp())},switch2:function(e){var t=$(e.target),e=t.index();t.hasClass("cc-sub-captions-title")&&e!==this.current&&this.choose(e)},choose:function(e){this.subCaptions.children(".cc-sub-captions-title").eq(this.current).removeClass("cc-sub-active").end().eq(e).addClass("cc-sub-active"),this.subSections.children(".cc-sub-section").eq(this.current).hide().end().eq(e).show(),this.current=e},getVideoGalleryPanel:function(){return this.videoGalleryPanel},getImageGalleryPanel:function(){return this.imageGalleryPanel}},BookcaseEmbedPanel.prototype={resizeIframe:function(e,t){this.iframeContainer.stop().animate({width:e,height:t,marginLeft:(900-e)/2},200),this.customWidthInput.val(e),this.customHeightInput.val(t),this.options.width=e,this.options.height=t,this.setCode()},setCode:function(e){var e=e||this.options.domainUrl||this.options.url,t="<iframe style='width:"+this.options.width+"px;height:"+this.options.height+"px' src='"+e+"' "+this.options.iframeAttr+"></iframe>";this.iframeStepCode1.text(t)}},BookDownloadPanel.prototype={constructor:BookDownloadPanel,downloadPdf:function(){"0"==fh5.uType?new UpgradePanel(fh5.pageData.upgrade.Download):window.open("/download/download-pdf-file.php?bookid="+this.options.bookId,"_self")},downloadZip:function(){var t=this,i=window;t.zipDownloadButton.hasClass("disabled")||t.zipDownloadButton.hasClass("disabled")||(parseInt(fh5.uType)<1?new UpgradePanel(fh5.pageData.upgrade.DownloadZip):(t.zipHelp.html(""),$.ajax({url:"/download/create-book-zip-online.php",type:"POST",dataType:"json",data:{bookid:t.options.bookId},beforeSend:function(){t.zipDownloadButton.addClass("disabled"),utils.addMask(t.zipDownloadButtonContainer,{text:"Generating..."})},success:function(e){t.zipDownloadButton.removeClass("disabled"),utils.removeMask(t.zipDownloadButtonContainer),"1"==e.status?i.open("/download/download-zip-file.php?bookid="+t.options.bookId,"_self"):"2"==e.status?t.zipHelp.html("<i class='icon icon-exclamation-sign'></i> Exceeded the download limit for this month."):t.zipHelp.html("<i class='icon icon-exclamation-sign'></i> Generate failed, please retry.")},error:function(){t.zipDownloadButton.removeClass("disabled"),utils.removeMask(t.zipDownloadButtonContainer),t.zipHelp.html("<i class='icon icon-exclamation-sign'></i> Generate failed, please retry.")}})))}},BookEditPanel.prototype={constructor:BookEditPanel,switch2:function(e){var t=$(e.target),e=t.index();t.hasClass("cc-caption")&&e!=this.current&&this.choose(e)},choose:function(e){var t=this.sections.children().eq(this.current);$nextSection=this.sections.children().eq(e),this.content.animate({height:$nextSection.data("height")},400),this.captions.children().eq(this.current).removeClass("cc-active").end().eq(e).addClass("cc-active").append(this.captionArrow),t.hide(),$nextSection.show(),this.options.isNew&&(t=this.uploadSection.getUploadComponentContainer(),$uploadComponent=this.uploadSection.getUploadComponent(),0==e?(this.backButton.hide(),$uploadComponent.removeClass("cc-pdf-upload-component-fixed").appendTo(t)):(this.backButton.show(),$uploadComponent.addClass("cc-pdf-upload-component-fixed").appendTo(this.panel)),e==this.last?this.nextButton.addClass("disabled"):this.nextButton.removeClass("disabled")),this.current=e},removeUploadPanel:function(){this.bottomAlert.remove(),this.options.isFastUpload?this.options.lightBox.cancel():utils.remove(this.panel,600)},cancel:function(){var e=this,t=e.uploadSection.getUploadStatus();"uploading"==t||"complete"==t?utils.confirm("Cancel Upload","Are you sure you want to cancel?",function(){e.removeUploadPanel(),e.uploadSection.cancelUpload()}):e.removeUploadPanel()},back:function(){this.choose(this.current-1)},next:function(){this.nextButton.hasClass("disabled")||this.choose(this.current+1)},create2:function(){var o,n,s,l,e,c,t,d,i,r,p,h,u,a,g=this,b=g.uploadSection.getUploadStatus(),m=g.uploadSection.getOriginalFileName(),f="";"uploading"==b?(f="Your PDF file is uploading, can not create flipbook now.",this.choose(0)):"complete"!==b?(f="Please upload a PDF file first.",this.choose(0)):g.advancedSection.isBackgroun
1dImageUploading()?(f="Your background image is uploading, can not create flipbook now.",this.choose(4)):g.advancedSection.isBackgroundSoundUploading()?(f="Your background sound file is uploading, can not create flipbook now.",this.choose(4)):g.advancedSection.isLogoUploading()||g.advancedSection.isAboutLogoUploading()?(f="Your logo file is uploading, can not create flipbook now.",this.choose(4)):g.advancedSection.getImageGalleryPanel().isUploading()&&(f="Your Image Gallery file is uploading, can not create flipbook now.",this.choose(4)),f?g.bottomAlert.empty().append($("<div class='alert alert-error'><strong>Note:</strong> "+f+"</div>")):(""==g.bookInfoSection.getTitle()&&g.bookInfoSection.setTitle(m),""==g.bookInfoSection.getDesc()&&g.bookInfoSection.setDesc(m),o=g.bookInfoSection.getTitle(),n=g.bookInfoSection.getDesc(),s=g.bookInfoSection.getKeywords(),l=g.bookInfoSection.getSecondaryCategory(),e=g.templateSection.getTemplate(),c=utils.getTemplateId(e),t=g.themeSection.getTheme(),d=fh5.pageData.themes.indexOf(t),i=g.uploadSection.getIsPublic(),r=g.advancedSection.getBookConfig(),p=g.bookInfoSection.getAllowDownloadGroup().isChecked()?"1":"0",h=g.bookInfoSection.getLabel(),a={videoList:{},slideshow:{},staticAd:{}}
1,u=[],b=g.advancedSection.getVideoGalleryPanel().getConfig(a),m=g.advancedSection.getImageGalleryPanel().getConfig(a),(a={operateId:0,uId:g.options.uId,cid:g.options.cId,filename:g.uploadSection.getFileName(),title:o,description:n,keywords:s,secondarycatid:l,template:e,theme:t,isPublic:i,bookConfig:JSON.stringify(r),isDownload:p,label:h,videoList:JSON.stringify(b),slideshow:JSON.stringify(m),staticAd:JSON.stringify({}),bmtConfig:JSON.stringify(u),imageToUpload:JSON.stringify(a)}).bookConfig=utils.base64Encode(a.bookConfig),a.isEncode=1,$.ajax({url:"/hostInfo/operate-book-online.php",type:"POST",dataType:"json",data:a,beforeSend:function(){utils.addMask(g.panel,{text:"Creating...",fontSize:"30px"})},success:function(e){switch(e.status=e.status+"",e.status){case"1":var t,i,a={bookId:e.bookId,url:e.url,bStatus:e.bStatus,isPublic:e.isPublic,newTime:e.newTime,bLink:e.bLink,videoList:JSON.parse(e.videoList),slideshow:JSON.parse(e.slideshow),staticAd:JSON.parse(e.staticAd),privateUsers:"",title:utils.encodeHTML(o),desc:utils.encodeHTML(n),keywords:utils.encodeHTML(s),label:h,categoryId:l,templateId:c,themeId:d,uId:g.options.uId,cId:g.options.cId,convertFailContainer:g.options.convertFailContainer,configFailContainer:g.options.configFailContainer,bookContainer:g.options.bookContainer,cloningContainer:g.options.cloningContainer,cloneFailContainer:g.options.cloneFailContainer,convert
1ingContainer:g.options.convertingContainer,bookConfig:r,isDownload:p,type:"1",bmtConfig:u};g.options.isFastUpload?($.extend(a,{isFastUpload:!0,lightBox:g.options.lightBox}),t=g.options.lightBox.box.height(),i=g.options.lightBox.box.width(),g.options.lightBox.clear().box.css({height:t,width:i}).animate({width:960,height:180,left:"+="+(i-960)/2,top:"+="+(t-180)/2},200,function(){new ConvertingPanel(a).panel.prependTo(g.options.lightBox.box)})):(g.panel.slideUp(function(){g.panel.remove()}),new ConvertingPanel(a).panel.prependTo(fh5.convertingContainer).slideUp(0).slideDown());break;case"998":f="You have reached the mazimum amount of uploads (5 / Day), you can <a href='/pricing.php' target='_blank' >upgrade</a> your account to upload more.",g.bottomAlert.empty().append($("<div class='alert alert-error'><strong>Note:</strong> "+f+"</div>")),utils.removeMask(g.panel);break;default:utils.errorMask(g.panel)}},error:function(){utils.errorMask(g.panel)}}))},close:function(){var e=this,t=0;e.reUploadSection.cancelUpload(),e.options.isFastUpload?(e.options.lightBox.box.height(180),utils.remove(e.panel),e.options.bookPanel.panel.slideDown(function(){e.options.lightBox.resize()})):(e.panel.slideUp(0,function(){2==++t&&utils.showMe(e.options.bookPanel.panel),e.panel.remove()}),e.options.bookPanel.panel.slideDown(function(){2==++t&&utils.showMe(e.options.bookPanel.panel)}))},save:function(){var a,o,n,s,t,l,i,c,d,r,p,h,u,g,b,m,f,v,k=this,e="",w=k.reUploadSection.getUploadStatus(),I=k.reUploadSection.getOriginalFileName();""==k.bookInfoSection.getTitle()&&k.bookInfoSection.setTitle(I),""==k.bookInfoSection.getDesc()&&k.bookInfoSection.setDesc(I),k.advancedSection.isBackgroundImageUploading()?(e="Your background image is uploading, can not save now.",this.choose(3)):k.advancedSection.isBackgroundSoundUploading()?(e="Your background sound file is uploading, can not save now.",this.choose(3)):k.advancedSection.isLogoUploading()||k.advancedSection.isAboutLogoUploading()?(e="Your logo file is uploading, can not save now.",this.choose(3)):utils.validate("text",this.bookInfoSection.getTitleInput(),null,!0)?utils.validate("text",this.bookInfoSection.getDescInput(),null,!0)?"uploading"==w?(e="Your PDF file is uploading, can not save now.",this.choose(4)):k.advancedSection.getImageGalleryPanel().isUploading()&&(e="Your Image Gallery file is uploading, can not save now.",this.choose(3)):(e="Please enter your flipbook description.",this.choose(0)):(e="Please enter your flipbook title.",this.choose(0)),e?k.bottomAlert.empty().append($("<div class='alert alert-error'><strong>Note:</strong> "+e+"</div>")):(a=k.bookInfoSection.getTitle(),o=k.bookInfoSection.getDesc(),n=k.bookInfoSection.getKeywords(),s=k.bookInfoSection.getSecondaryCategory(),t=k.templateSection.getTemplate(),l=utils.getTemplateId(t),i=k.themeSection.getTheme(),c=fh5.pageData.themes.indexOf(i),d=k.options.isPublic,r=k.options.bookId,p=k.advancedSection.getBookConfig(),h=k.bookInfoSection.getAllowDownloadGroup().isChecked()?"1":"0",u=k.bookInfoSection.getLabel(),g=k.options.type,e={videoList:{},slideshow:{},staticAd:{}},b=k.options.staticAd,m=k.options.bmtConfig,f=k.advancedSection.getVideoGalleryPanel
1().getConfig(e),v=k.advancedSection.getImageGalleryPanel().getConfig(e),(e={bookId:r,title:a,description:o,keywords:n,secondarycatid:s,template:t,theme:i,bookConfig:JSON.stringify(p),isDownload:h,label:u,filename:k.reUploadSection.getFileName(),videoList:JSON.stringify(f),slideshow:JSON.stringify(v),staticAd:JSON.stringify(b),bmtConfig:JSON.stringify(m),imageToUpload:JSON.stringify(e)}).bookConfig=utils.base64Encode(e.bookConfig),e.isEncode=1,"nofile"==w?$.ajax({url:"/hostInfo/update-book-config-online.php",type:"POST",dataType:"json",data:e,beforeSend:function(){utils.addMask(k.panel,{text:"Saving...",fontSize:"30px"})},success:function(e){"1"==e.status?(utils.removeMask(k.panel),k.options.bookPanel.title.html(utils.encodeHTML(a)),k.options.bookPanel.desc.html(utils.encodeHTML(o)),k.options.bookPanel.options.title=utils.encodeHTML(a),k.options.bookPanel.options.desc=utils.encodeHTML(o),k.options.bookPanel.options.keywords=utils.encodeHTML(n),k.options.bookPanel.options.categoryId=s,k.options.bookPanel.options.templateId=utils.getTemplateId(t),k.options.bookPanel.options.themeId=fh5.pageData.themes.indexOf(i),k.options.bookPanel.options.bookConfig=p,k.options.bookPanel.options.videoList=f,k.options.bookPanel.options.slideshow=v,k.options.bookPanel.options.staticAd=b,k.options.bookPanel.options.bookConfig=p,k.options.bookPanel.options.bmtConfig=m,k.options.bookPanel.options.type=g,k.options.bookPanel.options.label=u,k.options.bookPanel.setLabel(u),k.close()):utils.errorMask(k.panel)},error:function(){utils.errorMask(k.panel)}}):$.ajax({url:"/hostInfo/cover-book-online.php",type:"POST",data:e,dataType:"json",beforeSend:function(){utils.addMask(k.panel,{text:"Saving...",fontSize:"30px"})},success:function(e){var t,i;"1"==e.status?(t={bookId:r,url:k.options.url,bStatus:k.options.bStatus,isPublic:d,newTime:k.options.newTime,bLink:k.options.bLink,privateUsers:k.options.privateUsers,title:utils.encodeHTML(a),desc:utils.encodeHTML(o),keywords:utils.encodeHTML(n),label:u,categoryId:s,templateId:l,themeId:c,uId:k.options.uId,cId:k.options.cId,convertFailContainer:k.options.convertFailContainer,configFailContainer:k.options.configFailContainer,bookContainer:k.options.bookContainer,cloningContainer:k.options.cloningContainer,cloneFailContainer:k.options.cloneFailContainer,bookConfig:p,isDownload:h,type:"1",videoList:f,slideshow:v,staticAd:b,bmtConfig:m,auditStatus:0},k.options.isFastUpload?($.extend(t,{isFastUpload:!0,lightBox:k.options.lightBox}),i=k.options.lightBox.box.height(),e=k.options.lightBox.box.width(),k.options.lightBox.clear().box.css({height:i,width:e}).animate({width:960,height:180,left:"+="+(e-960)/2,top:"+="+(i-180)/2},200,function(){new ConvertingPanel(t).panel.prependTo(k.options.lightBox.box)})):(k.panel.slideUp(function(){k.panel.remove()}),k.options.bookPanel.panel.remove(),new ConvertingPanel(t).panel.prependTo(fh5.convertingContainer).slideUp(0).slideDown())):utils.errorMask(k.panel)},error:function(){utils.errorMask(k.panel)}}))}},BookInfoSection.prototype={constructor:BookInfoSection,changeLabel:function(){"0"==fh5.uType&&(new UpgradePanel(fh5.pageData.upgrade.Label),this.labelNoneRadio[0].checked=!0)},getTitle:function(){return this.titleInput.val().trim()},setTitle:function(e){this.titleInput[0].value=e},getDesc:function(){return this.descInput.val().trim()},setDesc:function(e){this.descInput[0].value=e},getKeywords:function(){return this.fetchkeywords(),this.keywordResult.join(",")},removeKeywords:function(e){this.keywordResult.splice(this.keywordResult.indexOf(e.data("value")),1),e.remove()},fetchkeywords:function(){for(var e,t,i=this,a=i.keywordsInput.val().trim().split(","),o=a.length,n=0;n<o;n++)""!==a[n]&&-1==i.keywordResult.indexOf(a[n])&&(e=$("<li data-value="+a[n]+">"+a[n]+"</li>"),t=$("<i class='cc-smart-input-remove-button icon icon-remove'></i>"),i.keywordsDefaultItem.before(e.append(t)),i.keywordResult.push(a[n]),t.on("click",function(e){var t=$(this);e.stopPropagation(),i.removeKeywords(t.parent())}));i.keywordsInput.val(""),i.keywordsContainer.scrollTop(i.keywordsContainer[0].scrollHeight)},getSecondaryCategory:function(){return this.secondaryCategorySelect.val().trim()},getTitleInput:function(){return this.titleInput},getDescInput:function(){return this.descInput},getAllowDownloadGroup:function(){return this.allowDownloadGroup},getLabel:function(){return this.labelRadioGroup.find("input[name=bookInfoLabel]:checked").val()}},BookPanel.prototype={constructor:BookPanel,getPanel:function(){return this.panel},clone:function(){var i;this.cloneButton.hasClass("cc-toolbar-button-disabled")||(i=this,utils.confirm("Clone This Book","Are your sure you want to clone this book?",function(){$.ajax({url:"/hostInfo/clone-book-online.php",type:"POST",data:{bookId:i.options.bookId},dataType:"json",beforeSend:function(){utils.addMask(i.panel,{text:"Processing...",fontSize:"20px"})},success:function(e){var t={bookId:e.bookId,title:e.title,cloningContainer:i.options.cloningContainer,cloneFailContainer:i.options.cloneFailContainer,bookContainer:i.options.bookContainer};"1"==e.status?(utils.removeMask(i.panel),new CloningPanel(t).getPanel().appendTo(fh5.cloningContainer).slideUp(0).slideDown()):utils.errorMask(i.panel)},error:function(){utils.errorMask(i.panel)}})}))},setLabel:function(e){"0"==e?this.labelImg.hide():this.labelImg.attr("src",utils.getLabelFilePath(e)).show()},download:function(){this.downloadButton.hasClass("cc-toolbar-button-disabled")||new BookDownloadPanel
1({bookId:this.options.bookId,type:this.options.type})},viewTextVersion:function(){this.textVersionButton.hasClass("cc-toolbar-button-disabled")||window.open("/"+fh5.uLink+"/"+this.options.bLink+"/basic")},edit:function(){var t=this;this.editButton.hasClass("cc-toolbar-button-disabled")||$.ajax({url:"/hostInfo/get-book-online.php",type:"post",dataType:"json",data:{bookId:t.options.bookId},beforeSend:function(){utils.addMask(t.panel,{hasLoading:!1,hasAnimate:!0,color:"#1B7FCC",fontWeight:"bold",fontSize:"16px"})},success:function(e){"OK"==e.code?(utils.removeMask(t.panel),e=e.data,e={bookPanel:t,bookId:e.bookId,title:utils.br2nl(e.title),desc:utils.br2nl(e.desc),keywords:utils.br2nl(e.keyword),categoryId:e.categoryId,bookConfig:e.htmlConfig,isNew:!1,bLink:e.bLink,isDownload:e.isDownload,type:e.type,label:e.label,allowSearchIndex:e.seo_boost,videoList:e.videoList,slideshow:e.slideshow,olsConfig:e.olsConfig,bmtConfig:e.tabconfig,staticAd:e.adConfig,convertConfig:{convertMode:e.convertMode,pageRange:e.pageRange,qualityDpi:e.qualityDpi,engineType:e.engineType},templateId:utils.getTemplateId(e.htmlTemplate),themeId:utils.getThemeId(e.theme),url:e.url,bStatus:e.bStatus,newTime:e.newTime,updateTime:e.updateTime,privateUsers:e.privateUsers,isPublic:e.isPublic,uId:t.options.uId,cId:t.options.cId,price:e.price,pages:e.pages,space:e.space,viewText:t.options.viewText,bookPanelIndex:t.panelIndex,auditStatus:t.options.auditStatus},bookEditPanel=new BookEditPanel(e),bookEditPanel.panel.insertAfter(t.panel).slideUp(0).slideDown(function(){}),t.panel.slideUp(0,function(){utils.showMe(bookEditPanel.panel)})):utils.errorMask(t.panel)},error:function(e){utils.errorMask(t.panel)}})},enable:function(){var a;this.enableButton.hasClass("cc-toolbar-button-disabled")||(a=this,$.ajax({url:"/hostInfo/operate-book-online.php",type:"POST",dataType:"json",data:{operateId:3,bookId:a.options.bookId,uId:a.options.uId},beforeSend:function(){utils.addMask(a.panel,{text:"Processing...",fontSize:"20px"})},success:function(e,t,i){"1"==e.status?(utils.removeMask(a.panel),a.disableButton.removeClass("cc-hide"),a.enableButton.addClass("cc-hide")):utils.errorMask(a.panel,e.status)},error:function(e,t,i){utils.errorMask(a.panel)}}))},disable:function(){var a;this.disableButton.hasClass("cc-toolbar-button-disabled")||(a=this,utils.confirm("Disable This Book","Once disabled, this book can not be accessed to the public. Are you sure you want to proceed?",function(){$.ajax({url:"/hostInfo/operate-book-online.php",type:"POST",dataType:"json",data:{operateId:2,bookId:a.options.bookId,uId:a.options.uId},beforeSend:function(){utils.addMask(a.panel,{text:"Processing...",fontSize:"20px"})},success:function(e,t,i){"1"==e.status?(utils.removeMask(a.panel),a.disableButton.addClass("cc-hide"),a.enableButton.removeClass("cc-hide")):utils.errorMask(a.panel,e.status)},error:function(e,t,i){utils.errorMask(a.panel)}})}))},setPrivacy:function(){var i;this.privacyButton.hasClass("cc-toolbar-button-disabled")||(i=this,$.ajax({url:"/api/book/get-book-privacy",type:"post",dataType:"json",data:{bookId:i.options.bookId},beforeSend:function(){utils.addMask(i.panel,{text:"Deleting",fontSize:"20px"})},success:function(e){var t;utils.removeMask(i.panel),"OK"==e.code?(t=(t=(e=e.data).purviewList).hasOwnProperty("password")?t.password:[],new PrivacyPanel(i.options.bookId,e.isPublic,utils.br2nl(t.join(";")),function(){i.privacyButton.removeClass("public keep-private-on-cloud").addClass("private").attr("title","Private")},function(){i.privacyButton.removeClass("private keep-private-on-cloud").addClass("public").attr("title","Public")},function(){i.privacyButton.removeClass("public private").addClass("keep-private-on-cloud").attr("title","Keep Private On PubHTML5 Cloud")},i)):utils.alert(e.msg)},error:function(e){utils.errorMask(i.panel)}}))},embed:function(){this.embedButton.hasClass("cc-toolbar-button-disabled")||new EmbedPanel($.extend({},this.options,{isSelf:!0,uLink:fh5.uLink,uName:fh5.uName,caption:fh5.caption}))},embedBookcase:function(){new BookcaseEmbedPanel({url:location.protocol+"//"+document.domain+"/bookcase/"+fh5.uLink,caption:fh5.caption,isSelf:!0})},share:function(){this.shareButton.hasClass("cc-toolbar-button-disabled")||new SharePanel({url:this.options.url,bookid:this.options.bookId,bookUrl:this.options.url,isRecord:!1,bLink:this.options.bLink,title:this.options.title,de
1sc:this.options.desc})},move:function(){var o,n,s,e,l;this.moveButton.hasClass("cc-toolbar-button-disabled")||(o=this,n=$("<ul class='cc-light-box-buttons'></ul> "),s=$("<li class='button-pure button-pure-green'>Save</li>"),e=$("<li class='button-pure'>Cancel</li>"),(l=new LightBox("Move To Another Folder","",600)).box.append(n.append(s).append(e)),l.launch(),e.on("click",function(){l.cancel()}),$.ajax({url:"/center/db/db-get-folder-info.php",type:"POST",dataType:"json",data:{uId:o.options.uId,cId:o.options.cId,excludingSelf:!0},beforeSend:function(){utils.addMask(l.box,{text:"Loading...",fontSize:"20px"})},success:function(e,t,i){var a;1==e.status?(utils.removeMask(l.box),(a=new FolderPanel(e.folders,"Move to")).panel.insertBefore(n),l.box.animate({top:"-=20px"},200),s.on("click",function(){var e=a.getVal();$.ajax({url:"/hostInfo/update-book-magazine-online.php",type:"POST",data:{uId:o.options.uId,bookId:o.options.bookId,oldCid:o.options.cId,newCid:e},beforeSend:function(){utils.addMask(l.box,{text:"Saving...",fontSize:"20px"})},success:function(e,t,i){"1"==e?(l.cancel(),o.options.isFastUpload?o.options.lightBox.cancel():o.panel.fadeOut(function(){o.panel.remove()})):utils.errorMask(l.box,e)},error:function(){utils.errorMask(l.box)}})})):(utils.removeMask(l.box),l.desc.text("There is no other folder to move to.").show())},error:function(e,t,i){utils.errorMask(l.box)}}))},delete2:function(){var t=this;utils.confirm("Delete This Book","Are you sure you want to delete this book?",function(){$.ajax({url:"/hostInfo/operate-book-online.php",type:"POST",dataType:"json",data:{operateId:"1",bookId:t.options.bookId,uId:t.options.uId},beforeSend:function(){utils.addMask(t.panel,{text:"Deleting",fontSize:"20px"})},success:function(e){"1"==e.status?t.options.isFastUpload?t.options.lightBox.cancel():(utils.removeMask(t.panel),utils.remove(t.panel)):utils.errorMask(t.panel,e)},error:function(){utils.errorMask(t.panel)}})})},print:function(){new PrintPanel(this.options)},showwAlertMessage:function(e){var t=this.options.bStatus,i=this.options.auditStatus+"",e="";if(2!=t&&-1!=t||(2==t?e="0"==fh5.uType?"This book is restricted. Please <a target='_blank' href='/pricing.php'>upgrade your account</a> to lift the restriction.":"This book is restoring now, please check it later.":-1==t&&(e="Upload failed from the Desktop Client, please delete this book and upload again.")),2<=parseInt(i)){switch(i){case"2":e="This book has been restricted due to the Ads issue. Please reupload a new book, if not, this book will be deleted automatically in 30 days.";break;case"3":e="This book has been restricted due to the copyright issue. Please reupload a new book, if not, this book will be deleted automatically in 30 days.";break;case"4":e="This book has been restricted due to the porn or violence issue. Please reupload a new book, if not, this book will be deleted automatically in 30 days.";break;case"5":e="This book has been restricted due to the political and weapon issue. Please reupload a new book, if not, this book will be deleted automatically in 30 days.";break;case"6":e="This book has been restricted as it is against the terms of upoading, the content you upload may not be appropriate. Please reupload a new book, if not, this book will be deleted automatically in 30 days."}this.privacyButton.add(this.disableButton).add(this.enableButton).add(this.embedButton).add(this.shareButton).add(this.textVersionButton).add(this.moveButton).add(this.cloneButton).add(this.downloadButton).addClass("cc-toolbar-button-disabled")}e&&(this.alertMessage.html(e),this.panel.append(this.alertContainer.append(this.alertInner.append(this.alertIcon).append(this.alertMessage))))}},Checkbox.prototype={constructor:Checkbox,getGroup:function(){return this.group},getCheckbox:function(){return this.checkbox},isChecked:function(){return this.checkbox.is(":checked")},check:function(){this.checkbox[0].checked=!0},uncheck:function(){this.checkbox[0].checked=!1}},CloneFailPanel.prototype={constructor:CloneFailPanel,getPanel:function(){return this.panel},delete2:function(){var t=this;$.ajax({url:"/hostInfo/operate-book-online.php",type:"POST",dataType:"json",data:{operateId:"1",bookId:t.options.bookId,uId:t.options.uId},beforeSend:function(){utils.addMask(t.panel,{text:"Deleting",fontSize:"20px"})},success:function(e){"1"==e.status?t.options.isFastUpload?t.options.lightBox.cancel():(utils.removeMask(t.panel),utils.remove(t.panel)):utils.errorMask(t.panel,e.status)},error:function(){utils.errorMask(t.panel)}})}},CloningPanel.prototype={constructor:CloningPanel,requestCloneProgress:function(){var a=this;$.ajax({url:"/hostInfo/get-book-online.php",type:"POST",dataType:"json",data:{bookId:a.options.bookId},beforeSend:function(){utils.log(a.options.bookId+" Request Clone Progress... ")},success:function(e){var t={uId:e.uId,cId:e.cId,bookId:e.bookId,url:e.url,title:e.title,de
1sc:e.desc,keywords:e.keywords,categoryId:e.categoryId,templateId:utils.getTemplateId(e.template),themeId:utils.getThemeId(e.theme),bStatus:e.bStatus,isPublic:e.isPublic,privateUsers:e.privateUsers,newTime:e.newTime,bookConfig:JSON.parse(e.bookConfig),bLink:e.bLink,isDownload:e.isDownload,type:e.type,label:e.label,pages:e.pages,videoList:JSON.parse(e.videoList),slideshow:JSON.parse(e.slideshow),staticAd:JSON.parse(e.staticAd),bmtConfig:JSON.parse(e.bmtConfig)},i={bookId:e.bookId,title:e.title,uId:e.uId};if("1"==e.status)switch(e.bStatus=e.bStatus+"",e.bStatus){case"-5":a.requestTimeoutId=setTimeout(function(){a.requestCloneProgress()},2e3);break;case"-6":utils.log(a.options.bookId+" clone failed. "),a.panel.slideUp(function(){a.panel.remove()}),new CloneFailPanel(i).getPanel().prependTo(fh5.cloneFailContainer).slideUp(0).slideDown();break;default:utils.log(a.options.bookId+" clone finished. "),a.panel.slideUp(function(){a.panel.remove()}),new BookPanel(t).getPanel().prependTo(fh5.bookContainer).slideUp(0).slideDown()}else a.requestTimeoutId=setTimeout(function(){a.requestCloneProgress()},2e3)},error:function(){utils.log("error: "+status+" retrying..."),a.requestTimeoutId=setTimeout(function(){a.requestCloneProgress()},2e3)}})},cloneInBackground:function(){clearTimeout(this.requestTimeoutId),this.options.lightBox.cancel()},getPanel:function(){return this.panel}},ConfigFailPanel.prototype={constructor:ConfigFailPanel,reConfig:function(){var a=this;$.ajax({url:"/hostInfo/re-create-config-online.php",type:"POST",data:{bookId:a.options.bookId},beforeSend:function(){utils.addMask(a.panel,{text:"Processing",fontSize:"20px"})},success:function(e){var t,i;"1"==e?(t={uId:a.options.uId,cId:a.options.cId,bookId:a.options.bookId,url:a.options.url,title:a.options.title,desc:a.options.desc,keywords:a.options.keywords,categoryId:a.options.categoryId,templateId:a.options.templateId,themeId:a.options.themeId,bStatus:a.options.bStatus,isPublic:a.options.isPublic,privateUsers:a.options.privateUsers,newTime:a.options.newTime,pages:a.options.pages,bookConfig:a.options.bookConfig,bLink:a.options.bLink,isDownload:a.options.isDownload,type:a.options.type,label:a.options.label,cloneContainer:a.options.cloneContainer,videoList:a.options.videoList,slideshow:a.options.slideshow,staticAd:a.options.staticAd,bmtConfig:a.options.bmtConfig},a.options.isFastUpload?($.extend(t,{isFastUpload:!0,lightBox:a.options.lightBox}),i=a.options.lightBox.box.height(),e=a.options.lightBox.box.width(),a.options.lightBox.box.empty().css({height:i,width:e}).animate({width:960,height:180,left:"+="+(e-960)/2,top:"+="+(i-180)/2},200,function(){new BookPanel(t).panel.appendTo(a.options.lightBox.box)})):(a.panel.slideUp(function(){a.panel.remove()}),new BookPanel(t).panel.prependTo(fh5.bookContainer).slideUp(0).slideDown())):utils.errorMask(a.panel)},error:function(){utils.errorMask(a.panel)}})},delete2:function(){var t=this;utils.confirm("Confirmation","Are you sure you want to Delete?",function(){$.ajax({url:"/hostInfo/operate-book-online.php",type:"POST",dataType:"json",data:{operateId:"1",bookId:t.options.bookId,uId:t.options.uId},beforeSend:function(){utils.addMask(t.panel,{text:"Deleting",fontSize:"20px"})},success:function(e){"1"==e.status?(utils.removeMask(t.panel),t.options.isFastUpload?t.options.lightBox.cancel():utils.remove(t.panel)):utils.errorMask(t.panel)},error:function(){utils.errorMask(t.panel)}})})}},ContactBall.prototype={constructor:ContactBall,scrollBall:function(){var e=this;clearTimeout(e.timeoutId),e.timeoutId=setTimeout(function(){e.ball.stop().animate({top:$(document).scrollTop()+98,opacity:1},400)},400)}},ConvertFailPanel.prototype={constructor:ConvertFailPanel,delete2:function(){var a=this;$.ajax({url:"/hostInfo/operate-book-online.php",type:"POST",dataType:"json",data:{operateId:"1",bookId:a.options.bookId,uId:a.options.uId},beforeSend:function(){utils.addMask(a.panel,{text:"Deleting",fontSize:"20px"})},success:function(e){"1"==e.status?a.options.isFastUpload?a.options.lightBox.cancel():(utils.removeMask(a.panel),utils.remove(a.panel)):utils.errorMask(a.panel,e.status)},error:function(e,t,i){utils.errorMask(a.panel)}})}},ConvertingPanel.prototype={constructor:ConvertingPanel,requestConvertProgress:function(){var f=this;$.ajax({url:"/hostInfo/get-book-progress-online.php",type:"POST",dataType:"json",data:{bookid:f.options.bookId},beforeSend:function(e,t){utils.log(f.options.bookId+" Request Convert Progress")},success:function(e,t,i){var a=e.status+"",o=e.convertStatus+"",n=e.convertProgress,s=e.bookStatus+"",l=e.bookPages,c=e.errorCode,d=e.waitingNum,r={uId:f.options.uId,cId:f.options.cId,bookId:f.options.bookId,url:f.options.url,title:f.options.title,de
1sc:f.options.desc,keywords:f.options.keywords,categoryId:f.options.categoryId,templateId:f.options.templateId,themeId:f.options.themeId,isPublic:f.options.isPublic,privateUsers:f.options.privateUsers,newTime:f.options.newTime,bookConfig:f.options.bookConfig,bLink:f.options.bLink,isDownload:f.options.isDownload,type:f.options.type,label:f.options.label,pages:l,bStatus:s,bookContainer:f.options.bookContainer,convertFailContainer:f.options.convertFailContainer,configFailContainer:f.options.configFailContainer,bookContainer:f.options.bookContainer,cloningContainer:f.options.cloningContainer,cloneFailContainer:f.options.cloneFailContainer,convertingContainer:f.options.convertingContainer,videoList:f.options.videoList,slideshow:f.options.slideshow,staticAd:f.options.staticAd,bmtConfig:f.options.bmtConfig,auditStatus:f.options.auditStatus},p={bookId:f.options.bookId,title:f.options.title,uId:f.options.uId,errorMessage:fh5.pageData.errorMap[c]||fh5.pageData.errorMap[100]};if("1"==a)switch(o){case"-1":utils.log(f.options.bookId+" Uploading To Amazon ("+d+")"),f.status.text("-Waiting."),f.requestTimeoutId=setTimeout(function(){f.requestConvertProgress()},2e3);break;case"0":utils.log(f.options.bookId+" Waiting ("+d+")"),f.status.text("-Waiting.."),f.requestTimeoutId=setTimeout(function(){f.requestConvertProgress()},2e3);break;case"1":case"2":utils.log(f.options.bookId+" Converting "+n+"%"),f.status.text("-Converting... "+n+"%"),f.progressBar.width(n+"%"),f.requestTimeoutId=setTimeout(function(){f.requestConvertProgress()},2e3);break;case"-3":utils.log(f.options.bookId+" Generating Config File"),f.status.text("-Generating... "),f.progressBar.width("100%"),f.requestTimeoutId=setTimeout(function(){f.requestConvertProgress()},2e3);break;case"-2":utils.log(f.options.bookId+" Amazon Failed"),f.options.isFastUpload?($.extend(p,{isFastUpload:!0,lightBox:f.options.lightBox}),h=f.options.lightBox.box.width(),u=f.options.lightBox.box.height(),g=960,b=120,f.options.lightBox.clear().box.css({height:u,width:h}).animate({width:g,height:b,left:"+="+(h-g)/2,top:"+="+(u-b)/2},200,function(){new ConvertFailPanel(p).panel.prependTo(f.options.lightBox.box)}),f.panel.slideUp(function(){f.panel.remove()})):(f.panel.slideUp(function(){f.panel.remove()}),new ConvertFailPanel(p).panel.prependTo(fh5.convertFailContainer).slideUp(0).slideDown());break;default:switch(utils.log(f.options.bookId+" Convert Done "),s){case"0":case"1":utils.log(f.options.bookId+" Convert Success. bStatus:"+s),f.progressBar.width("100%"),f.options.isFastUpload?setTimeout(function(){var e=f.options.lightBox.box.height(),t=f.options.lightBox.box.width();f.options.lightBox.clear().box.css({height:e,width:t}).animate({width:960,height:180,left:"+="+(t-960)/2,top:"+="+(e-180)/2},200,function(){$.extend(r,{isFastUpload:!0,lightBox:f.options.lightBox}),new BookPanel(r).panel.prependTo(f.options.lightBox.box)})},2e3):setTimeout(function(){f.panel.slideUp(function(){f.panel.remove()}),new BookPanel(r).panel.prependTo(fh5.bookContainer).slideUp(0).slideDown()},2e3);break;case"-3":utils.log(f.options.bookId+" Convert Failed. Book Status:"+s),f.options.isFastUpload?($.extend(p,{isFastUpload:!0,lightBox:f.options.lightBox}),h=f.options.lightBox.box.width(),u=f.options.lightBox.box.height(),g=960,b=120,f.options.lightBox.clear().box.css({height:u,width:h}).animate({width:g,height:b,left:"+="+(h-g)/2,top:"+="+(u-b)/2},200,function(){new ConvertFailPanel(p).panel.prependTo(f.options.lightBox.box)})):new ConvertFailPanel(p).panel.prependTo(fh5.convertFailContainer).slideUp(0).slideDown(),f.panel.slideUp(function(){f.panel.remove()});break;case"-4":utils.log(f.options.bookId+" Generate Config File Failed. Book Status:"+s);var h,u,g,b,m=$.extend({},r,{bookContainer:f.options.bookContainer});f.options.isFastUpload?($.extend(m,{isFastUpload:!0,lightBox:f.options.lightBox}),h=f.options.lightBox.box.width(),u=f.options.lightBox.box.height(),g=960,b=120,f.options.lightBox.clear().box.css({height:u,width:h}).animate({width:g,height:b,left:"+="+(h-g)/2,top:"+="+(u-b)/2}
1,200,function(){new ConfigFailPanel(m).panel.prependTo(f.options.lightBox.box)})):new ConfigFailPanel(m).panel.prependTo(fh5.configFailContainer).slideUp(0).slideDown(),f.panel.slideUp(function(){f.panel.remove()});break;default:utils.log(f.options.bookId+" Unexpected Error. Returning Status: "+a+", ConvertStatus: "+o+", ConvertProgress: "+n+", Book Status:"+s),f.options.isFastUpload?($.extend(p,{isFastUpload:!0,lightBox:f.options.lightBox}),h=f.options.lightBox.box.width(),u=f.options.lightBox.box.height(),g=960,b=120,f.options.lightBox.clear().box.css({height:u,width:h}).animate({width:g,height:b,left:"+="+(h-g)/2,top:"+="+(u-b)/2},200,function(){new ConvertFailPanel(p).panel.prependTo(f.options.lightBox.box)})):new ConvertFailPanel(p).panel.prependTo(fh5.convertFailContainer).slideUp(0).slideDown(),f.panel.slideUp(function(){f.panel.remove()})}}else utils.log("error: "+a+" retrying..."),f.requestTimeoutId=setTimeout(function(){f.requestConvertProgress()},2e3)},error:function(){utils.log("error: "+status+" retrying..."),f.requestTimeoutId=setTimeout(function(){f.requestConvertProgress()},2e3)}})},runInBackground:function(){clearTimeout(this.requestTimeoutId),this.options.lightBox.cancel()},addExplore:function(){this.panel.append('<div class="book-upload-explore"><div class="left-part"><div class="title">From PDF to Video and Much More</div><p>Turn your PDF into videos, interactive presentations, websites, & more, free with Recastia <span>-From the team by pubhtml5</span></p></div><div class="right-part"><a href="https://recastia.com/" target="_blank">Explore<svg style="margin-left:3px;" width="14" height="14" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.5 3.5H8.5V8.5" stroke="white" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.5 8.5L8.5 3.5" stroke="white" stroke-linecap="round" stroke-linejoin="round"/></svg></a></div></div>')}},DownloadPanel.prototype={constructor:DownloadPanel,download:function(){ga("send","event","Download",this.href,document.location.pathname)},getPanel:function(){return this.panel}},EditFolderPanel.prototype={constructor:EditFolderPanel,validate:function(){var t=this,e=this.titleInput.val().trim();""==e?(this.titleInput.addClass("cc-validate-fail"),this.titleInputHelp.html("<span class='cc-error'><i class='fa fa-angle-left'></i> Required.</span>").show()):(this.titleInput.removeClass("cc-validate-fail"),this.titleInputHelp.hide(),this.titleValidateSuccess.hide(),this.titleValidateFail.hide(),this.titleValidating.show(),$.ajax({url:"/center/db/check-folder-title.php",type:"post",dataType:"json",data:{uId:fh5.uId,title:e,cId:t.options.cId},success:function(e){switch(e.status){case"1":t.titleValidating.hide(),t.titleValidateSuccess.show();break;case"0":t.titleValidating.hide(),t.titleInput.addClass("cc-validate-fail"),t.titleInputHelp.html("<span class='cc-error'><i class='fa fa-angle-left'></i> "+e.message+"</span>").show();break;default:t.titleValidating.hide(),t.titleInput.addClass("cc-validate-fail"),t.titleInputHelp.html("<span class='cc-error'><i class='fa fa-angle-left'></i> "+fh5.pageData.tips.ConnectionError2+"<span>").show()}}}))},close:function(){var e=this;e.panel.slideUp(function(){e.options.collectionPanel.mainInfo.show(),e.options.collectionPanel.backHref.show(),e.panel.remove()}),e.options.collectionPanel.panel.slideDown()},save:function(a){var o=this;var n=o.titleInput.val().trim(),s=o.descInput.val().trim(),e=o.categorySelect.val(),t=o.typeSelect.val(),i=o.languageSelect.val(),l=o.regionSelect.val();$.ajax({url:"/center/db/db-operate-folder-online.php",type:"POST",dataType:"json",data:{operateId:1,uid:fh5.uId,magazineid:o.options.cId,title:n,description:s,categoryid:e,typeid:t,languageid:i,regionid:l},beforeSend:function(){utils.addMask(o.panel,{text:"Saving...",fontSize:"30px"})},success:function(e,t,i){utils.removeMask(o.panel),"1"==e.status?(o.options.collectionPanel.title.html(utils.encodeHTML(n)),o.options.collectionPanel.desc.html(utils.encodeHTML(s)),o.options.collectionPanel.category.text(o.categorySelect.find("option:selected").text()),o.options.collectionPanel.categoryId=o.categorySelect.val(),o.options.collectionPanel.type.text(o.typeSelect.find("option:selected").text()),o.options.collectionPanel.typeId=o.typeSelect.val(),o.options.collectionPanel.language.text(
1o.languageSelect.find("option:selected").text()),o.options.collectionPanel.languageId=o.languageSelect.val(),o.options.collectionPanel.region.text(o.regionSelect.find("option:selected").text()),o.options.collectionPanel.regionId=o.regionSelect.val(),$(".center-left-active .center-left-flips-item-title").html(utils.encodeHTML(n)),a&&o.close()):"0"==e.status?(o.titleInput.addClass("cc-validate-fail"),o.titleInputHelp.html("<span class='cc-error'><i class='fa fa-angle-left'></i> "+e.message+"</span>").show(),o.titleInput.focus()):utils.errorMask(o.panel)},error:function(){utils.errorMask(o.panel)}})}},EmbedPanel.prototype={constructor:EmbedPanel,changeStartPage:function(e){e=e.val();this.iframe.attr("src",this.options.url+"?"+e+"#p="+e),this.iframePageSelect.val(e),this.lightboxPageSelect.val(e),this.options.startPage=e,this.setCode(!0)},resizeIframe:function(e,t){this.iframeContainer.add(this.bIframeContext).stop().animate({width:e,height:t},200),this.customWidthInput.val(e),this.customHeightInput.val(t),this.options.width=e,this.options.height=t,this.setCode(!0),this.setCode(!1)},setCode:function(e,t){var i,a;e?(t=this.options.url,a=utils.encodeHTML(this.options.title),e=i="","1"!=this.options.startPage&&(t+="#p="+this.options.startPage),i="<iframe style='width:"+this.options.width+"px;height:"+this.options.height+"px' src='"+t+"' "+this.options.iframeAttr+"></iframe>",e="data-rel='fh5-light-box-demo' data-href='"+t+"' data-width='"+this.options.width+"' data-height='"+this.options.height+"' data-title='"+a+"'",this.iframeStepCode1.text(i),this.lightboxStepCode2.text(e),this.lightboxImg.attr("data-width",this.options.width),this.lightboxImg.attr("data-height",this.options.height),this.lightboxImg.attr("data-title",a),this.lightboxImg.attr("data-href",t),this.demoCode.text("<!DOCTYPE HTML>\n<html>\n<head>\n <title>PubHTML5 LightBox Embed Demo</title>\n <script src='"+this.options.APIScriptCode+"'><\/script>\n</head>\n<body>\n <img src='"+this.lightboxImg.attr("src")+"' data-rel='fh5-light-box-demo' data-href='"+t+"' data-width='"+this.options.width+"' data-height='"+this.options.height+"' data-title='"+a+"'>\n</body>\n</html>")):(t=t||this.options.bUrl,a="",a="<iframe style='width:"+this.options.width+"px;height:"+this.options.height+"px' src='"+t+"' "+this.options.iframeAttr+"></iframe>",this.bIframeStepCode1.text(a))}},FastUploadWithoutLoginPanel.prototype={constructor:FastUploadWithoutLoginPanel,requestConvertProgress:function(){var s=this;$.ajax({url:"/hostInfo/get-book-progress-online.php",type:"POST",dataType:"json",data:{bookid:s.bookId},beforeSend:function(){},success:function(e){var t=e.status,i=e.convertStatus,a=e.convertProgress,o=e.bookStatus,n=(e.bookPages,e.errorCode,e.waitingNum);if("1"==t)switch(i){case"-1":utils.log(s.bookId+" Uploading To Amazon ("+n+")"),s.requestTimeoutId=setTimeout(function(){s.requestConvertProgress()},2e3);break;case"0":utils.log(s.bookId+" Waiting ("+n+")"),s.requestTimeoutId=setTimeout(function(){s.requestConvertProgress()},2e3);break;case"1":utils.log(s.bookId+" Converting "+a+"%"),s.convertingText.html("Converting..."),s.convertingProgressBar.width(a+"%"),s.requestTimeoutId=setTimeout(function(){s.requestConvertProgress()},2e3);break;case"-3":utils.log(s.bookId+" Generating Config File"),s.convertingText.html("Generating..."),s.convertingProgressBar.width("100%"),s.requestTimeoutId=setTimeout(function(){s.requestConvertProgress()},2e3);break;case"-2":utils.log(s.bookId+" Amazon Failed");break;default:switch(utils.log(s.bookId+" Convert Done "),o){case"0":case"1":utils.log(s.bookId+" Convert Success. bStatus:"+o),s.stepContainer.html("3 / 3"),s.convertingProgressBar.width("100%"),s.iframe.attr("src",s.url),setTimeout(function(){s.convertingContainer.hide(),s.iframeContainer.show(),s.signUpContainer.slideDown()},2e3);break;case"-3":utils.log(s.bookId+" Convert Failed. Book Status:"+o);break;case"-4":utils.log(s.bookId+" Generate Config File Failed. Book Status:"+o);break;default:utils.log(s.bookId+" Unexpected Error. Returning Status: "+t+", ConvertStatus: "+i+", ConvertProgress: "+a+", Book Status:"+o)}}else utils.log("error: "+t+" retrying..."),s.requestTimeoutId=setTimeout(function(){s.requestConvertProgress()},2e3)},error:function(){utils.log("error: "+status+" retrying..."),s.requestTimeoutId=setTimeout(function(){s.requestConvertProgress()},2e3)}})},signUp:function(){var o=this;o.signingUp||utils.validate("email",o.signUpEmailInput,o.signUpHelp,!0,null,"!")&&utils.validate("password",o.signUpPasswordInput,o.signUpHelp,!0,null,"!")&&utils.validate("repassword",o.signUpReTypePasswordInput,o.signUpHelp,!0,o.signUpPasswordInput.val(),"!")&&$.ajax({url:fh5.protocol+document.domain+"/userLoad/handle-user-sign-up.php",type:"GET",dataType:"jsonp",data:{type:"0",umail:o.signUpEmailInput.val().trim(),upass:o.signUpPasswordInput.val().trim(),bookid:o.bookId},beforeSend:function(){o.signingUp=!0,o.signUpButton.addClass("cc-hidden"),o.signUpProgressWrapper.removeClass("cc-hidden")},success:function(e,t,i){var a=!1;switch(e.status){case"1":o.lightBox.cancel(),window.location.href="/center/flips/book.php?cid="+e.cId;break;case"2":o.signUpEmailInput.addClass("cc-validate-fail").focus(),o.signUpHelp.html("<i class='icon icon-exclamation-sign'></i> User already exists."),a=!0;break;case"9":$signUpHelp.html("<i class='icon icon-exclamation-sign'></i> Your registration is not allowed due to the spam detected."),a=!0;break;default:o.signUpHelp.html("<i class='icon icon-exclamation-sign'></i> Upexpected error, please retry."),a=!0}
1a&&(o.signUpButton.removeClass("cc-hidden"),o.signUpProgressWrapper.addClass("cc-hidden")),o.signingUp=!1},error:function(e,t,i){o.signUpHelp.html("<i class='icon icon-exclamation-sign'></i> Upexpected error, please retry."),o.signUpButton.removeClass("cc-hidden"),o.signUpProgressWrapper.addClass("cc-hidden"),o.signingUp=!1}})},logIn:function(){var o=this;o.loggingIn||utils.validate("email",o.logInEmailInput,o.logInHelp,!0,null,"!")&&utils.validate("password",o.logInPasswordInput,o.logInHelp,!0,null,"!")&&$.ajax({url:"/userLoad/handle-user-log-in.php",type:"POST",dataType:"json",data:{umail:o.logInEmailInput.val().trim(),upass:o.logInPasswordInput.val().trim(),bookid:o.bookId},beforeSend:function(){o.loggingIn=!0,o.logInButton.addClass("cc-hidden"),o.logInProgressWrapper.removeClass("cc-hidden")},success:function(e,t,i){var a=!1;switch(e.status){case"1":o.lightBox.cancel(),window.location.href="/center/flips/book.php?cid="+e.cId;break;case"2":o.logInPasswordInput.addClass("cc-validate-fail").focus(),o.logInHelp.html("<i class='icon icon-exclamation-sign'></i> Incorrect Password."),a=!0;break;case"3":o.logInEmailInput.addClass("cc-validate-fail").focus(),o.logInHelp.html("<i class='icon icon-exclamation-sign'></i> User not exist."),a=!0;break;case"4":o.logInEmailInput.addClass("cc-validate-fail").focus(),o.logInHelp.html("<i class='icon icon-exclamation-sign'></i> This is a Facebook account, try click SIGN IN WITH FACEBOOK or Forget your password to set a new password."),a=!0;break;case"5":o.logInEmailInput.addClass("cc-validate-fail").focus(),o.logInHelp.html("<i class='icon icon-exclamation-sign'></i> This is a Google account, try click SIGN IN WITH GOOGLE or Forget your password to set a new password."),a=!0;break;default:o.logInHelp.html("<i class='icon icon-exclamation-sign'></i> Upexpected error, please retry."),a=!0}a&&(o.logInButton.removeClass("cc-hidden"),o.logInProgressWrapper.addClass("cc-hidden")),o.loggingIn=!1},error:function(e,t,i){o.logInHelp.html("<i class='icon icon-exclamation-sign'></i> Upexpected error, please retry."),o.logInButton.removeClass("cc-hidden"),o.logInProgressWrapper.addClass("cc-hidden"),o.loggingIn=!1}})}},FixedLightBox.prototype={constructor:FixedLightBox,showError:function(e){e=e||fh5.pageData.tips.Error,this.$warningBoxText.html(e),this.$warningBox.show().animate({left:"+=1%"},100).animate({left:"-=2%"},150).animate({left:"+=2%"},180).animate({left:"-=1%"},150)},hideError:function(){this.$warningBox.hide()},getContent:function(){return this.$lightContent},getPanel:function(){return this.$panel},launchNote:function(e){return this.$panel.empty().append("<div class='hf-lightbox-alert-desc'>"+e+"</div>"),""==this.$title.text()&&this.setTitle("Note"),this.$lightHeader.addClass("launch-note"),this.setBtnsShowHide(!1),this.setLightBoxSize(""),this.easyClose(),this.launchPanel(),this},launchError:function(e){return void 0===e&&(e=fh5.pageData.tips.Error),this.$panel.css("padding","0px").append("<div class='hf-lightbox-launch-error'>"+e+"</div>"),this.setTitle("Error Occurs"),this.$lightHeader.addClass("launch-error"),this.setBtnsShowHide(!1),this.setLightBoxSize(""),this.easyClose(),this.launchPanel(),this},launchLoading:function(){var e=this,t=$("body");0<document.getElementsByClassName("hf-lightbox").length&&this.$bg.addClass("disabled"),this.$lightBox.append(this.$loading),t.addClass("hf-overflow-hidden"),e.isMobile&&t.addClass("isMobile"),this.$lightBox.appendTo(t),setTimeout(function(){e.$lightBox.addClass("hf-fade")},2)},launchPanel:function(){var e=this;this.opt.isEasyClose&&this.easyClose(),this.cancelLoading(),setTimeout(function(){e.$lightBox.addClass("fade-in")},5)},launch:function(){var e=this,t=$("body");t.addClass("hf-overflow-hidden"),e.isMobile&&t.addClass("isMobile"),this.$lightBox.appendTo(t),this.opt.isEasyClose&&this.easyClose(),setTimeout(function(){e.$lightBox.addClass("fade-in")},5)},cancel:function(){var e=this;e.$lightBox.removeClass("fade-in hf-fade"),setTimeout(function(){document.getElementsByClassName("hf-lightbox").length<=1&&$("body").removeClass("hf-overflow-hidden"),e.$lightBox.remove()},350)},easyClose:function(){var t=this;this.$wrapper.on("click",function(){t.cancel()}),this.$lightContent.on("click",function(e){e.stopPropagation()}),$(window).on("keyup.fixedloghtbox",function(e){27==e.which&&t.cancel()})},offEscKeyup:function(){$(window).off("keyup.fixedloghtbox")},cancelLoading:function(){this.$loading&&this.$loading.remove()},addMask:function(){utils.addSpin(this.getContent(),"1")},removeMask:function(){utils.removeSpin(this.getContent(),"1")},setLightBoxSize:function(e){switch(e){case"1":this.$lightContent.removeClass("modal-mlg modal-xsedit").addClass("modal-lg modal-dialog");break;case"2":this.$lightContent.removeClass("modal-xsedit").addClass("modal-dialog modal-lg modal-mlg");break;case"3":this.$lightContent.removeClass("modal-lg modal-mlg").addClass("modal-xsedit");break;default:this.$lightContent.removeClass("modal-lg modal-mlg modal-xsedit").addClass("modal-dialog")}},setBtnsShowHide:function(e){e?this.$btns.show():this.$btns.hide()},setTitle:function(e){this.$title.show().html(e)},getBtnContent:function(){return this.$btns},getSaveBtn:function(){return this.$saveBtn},getCancelBtn:function(){return this.$cancelBtn},getTopCancelBtn:function(){return this.$lightClose}},FolderPanel.prototype={constructor:FolderPanel,getVal:function(){return this.collectionSelect.val()},getCategoryId:function(){return this.collectionSelect.find("option:selected").data("categoryid")}},ImageGalleryPanel.prototype={constructor:ImageGalleryPanel,getPanel:function(){return this.panel},add:function(e){var t=this,i=$("<div class='cc-image-gallery-thumbn
1ail-container'></div>"),a=$("<img>"),o=$("<div class='cc-full-mask'></div>"),n=$("<div class='cc-image-gallery-item-button-container'></div>"),s=$("<div class='button-pure button-pure-green button-no-text'><i class='icon icon-arrow-left'></i></div>"),l=$("<div class='button-pure button-pure-green button-no-text'><i class='icon icon-arrow-right'></i></div>"),c=$("<div class='button-pure button-pure-red button-no-text'><i class='icon icon-trash'></i></div>"),d=$("<div class='cc-img-upload-progress progress progress-info progress-striped active cc-hide'></div>"),r=$("<div class='bar'></div>");return this.list.append(i.append(a).append(o.append(n.append(s).append(l).append(c)))),e?utils.autoFit(i,a.attr("src",e)):i.append(d.append(r)),s.on("click",function(){i.prev().before(i)}),l.on("click",function(){i.next().after(i)}),c.on("click",function(){delete t.uploadingObj[i.data("name")],i.fadeOut(function(){i.remove()})}),{container:i,img:a,progress:d,progressBar:r}},deleteAll:function(){var e=this;utils.confirm("Delete all images","All images will be permanently removed. Are you sure you want to proceed?",function(){e.list.empty()})},getConfig:function(e){var t,i=this.list.find(".cc-image-gallery-thumbnail-container > img"),a=(i.length,[]);return i.each(function(){t=decodeURIComponent(this.src),a.push(t)}),a},isUploading:function(){return!utils.isEmptyObj(this.uploadingObj)}},ImageSlider.prototype={constructor:ImageSlider,next:function(){this.current!=this.last&&this.skipTo(this.current+1)},prev:function(e){1!=this.current&&this.skipTo(this.current-1)},skipTo:function(e){this.title.html("<span class='cc-image-slider-num'>"+e+"</span>"+this.data[e].title),this.desc.html(this.data[e].desc),this.img.attr("src",this.data[e].img),this.current=e,this.current==this.last?(this.nextButton.addClass("disabled"),this.prevButton.removeClass("disabled")):(1==this.current?this.prevButton.addClass("disabled"):this.prevButton.removeClass("disabled"),this.nextButton.removeClass("disabled"));var e=new Image,t=this;e.onload=function(){t.lightBox.resize()},e.src=this.img.attr("src")}},KeepPrivateGroup.prototype={constructor:KeepPrivateGroup,getGroup:function(){return this.group},isChecked:function(){return this.checkbox.is(":checked")},setValue:function(e){this.checkbox[0].checked=e}},LightBox.prototype={constructor:LightBox,handleBackgroundClick:function(){this.enableBackgroundClose&&this.cancel()},openBackgroundClose:function(){this.background.css("cursor","pointer"),this.background.attr("title","Close"),this.enableBackgroundClose=!0},getBottomContainer:function(){return this.buttonGroup},getWarningBox:function(){return this.warningBox},getCloseButton:function(){return this.closeButton},getSaveButton:function(){return this.saveButton},getTopCloseBtn:function(){return this.cancelButton},getPanel:function(){return this.panel},getBox:function(){return this.box},getTitle:function(){return this.title}
1,launch:function(){var e=$("body");this.background.appendTo(e).fadeIn(),this.box.appendTo(e).fadeIn(0),this.resize(0),this.box.height()>window.innerHeight?this.box.animate({opacity:1,top:this.document.scrollTop()+30},200):this.box.css("top",this.document.scrollTop()).animate({opacity:1,top:(window.innerHeight-this.box.height())/2+this.document.scrollTop()},200)},setCancelCallback:function(e){this.cancelCallback=e},cancel:function(){var e=this;e.background.fadeOut(function(){e.background.remove()}),e.box.animate({opacity:0,top:this.document.scrollTop()},200,function(){e.box.remove(),e.cancelCallback&&e.cancelCallback()});var t=document.getElementsByClassName("cc-captcha-wrapper")[0];document.body.contains(t)&&document.body.removeChild(t)},resizeH:function(){this.box.css({left:(window.innerWidth-this.box.width())/2})},resize:function(e){void 0===e&&(e=400);var t=(window.innerWidth-this.box.width())/2,i=this.box.height()>window.innerHeight?this.document.scrollTop():(window.innerHeight-this.box.height())/2+this.document.scrollTop();this.box.animate({left:t,top:i},e)},clear:function(){return this.box.children(":not(.cc-light-box-cancel-button)").remove(),this}},LogPanel.prototype={constructor:LogPanel,log:function(e){this.messagePanel.prepend($("<li> "+e+"</li>"))},show:function(){this.messages.width(this.messages.width()+100)},hide:function(){this.messages.width(this.messages.width()-100)},clear:function(){this.messagePanel.empty()}},NewFolderPanel.prototype={constructor:NewFolderPanel,validate:function(e){return""==this.titleInput.val().trim()?(this.titleInput.addClass("cc-validate-fail"),this.titleInputHelp.show(),e&&this.titleInput.focus(),!1):(this.titleInput.removeClass("cc-validate-fail"),this.titleInputHelp.hide(),!0)},cancel:function(){this.lightBox.cancel()},create2:function(){var a=this;a.validate(!0)&&$.ajax({url:"/center/db/db-operate-folder-online.php",type:"POST",data:{operateId:0,uid:a.options.uid,title:a.titleInput.val().trim(),description:a.descInput.val().trim(),categoryid:a.categorySelect.val(),typeid:a.typeSelect.val(),languageid:a.languageSelect.val(),regionid:a.regionSelect.val()},beforeSend:function(e,t){utils.addMask(a.panel,{text:"Creating...",fontSize:"30px"})},success:function(e,t,i){e=e.split(";");"1"==e[0]?window.location.href="book.php?cid="+e[1]:utils.errorMask(a.panel)}})}},NotePanel.prototype={constructor:NotePanel,scrollIn:function(){var e=this;clearTimeout(e.timeoutId),e.timeoutId=setTimeout(function(){e.panel.stop().animate({opacity:1,top:$(document).scrollTop()+98},400)},400)}},PrintPanel.prototype={constructor:PrintPanel,send:function(){var t=this,e=this.nameVal.find("#printName"),i=this.emailVal.find("#printEmail"),a=this.telVal.find("#printPhone"),o=this.addressVal.find("#printAddress"),n=this.countVal.find("#printQuantity"),s=this.sizeVal.find("#printSizeWidth"),l=this.sizeVal.find("#printSizeHeight"),c=this.pageVal.find("#printPageCount"),d=this.otherMessage.find("#printRemark"),r=e.val().trim(),p=i.val().trim(),h=a.val().trim(),u=o.val().trim(),g=n.val().trim(),b=s.val().trim(),m=l.val().trim(),f=c.val().trim(),d=d.val().trim();if(""==r)return e.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Please enter your name.").show(),void e[0].focus();if(""==p)return i.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Please enter your email address.").show(),void i[0].focus();return/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(p)?""==h?(a.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Please enter your telephone number.").show(),void a[0].focus()):""==u?(o.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Please enter your address.").show(),void o[0].focus()):""==g?(n.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Please enter publication quantity.").show(),void n[0].focus()):/^[0-9]*[1-9][0-9]*$/.test(g)?""==b?(s.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Please enter publication page width.").show(),void s[0].focus()):/^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/.test(b)?""==m?(l.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Please enter publication page height.").show(),void l[0].focus()):/^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/.test(m)?""==f?(c.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Please enter publication pages.").show(),void c[0].focus()):/^[0-9]*[1-9][0-9]*$/.test(f)?void $.ajax({url:"/Email/print-book-email.php",type:"post",dataType:"json",data:{name:r,email:p,address:u,tel:h,quantity:g,pagewidth:b,pageheigth:m,pages:f,remark:d,bookid:t.o
1ptions.bookId},beforeSend:function(){utils.addSpin(t.box)},success:function(e){utils.removeSpin(t.box),("1"==e.status?t.warnMessage.html("<span class='cc-success-color'><i class='icon icon-ok'></i> Sent Successfully!</span>"):t.warnMessage.html(fh5.pageData.tips.ConnectionError)).show()},error:function(e){utils.removeSpin(t.box),t.warnMessage.html(fh5.pageData.tips.ConnectionError).show()}}):(c.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Invalid pages.").show(),void c[0].focus()):(l.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Invalid page height.").show(),void l[0].focus()):(s.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Invalid page width.").show(),void s[0].focus()):(n.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Invalid publication quantity.").show(),void n[0].focus()):(i.addClass("cc-validate-fail"),this.warnMessage.html("<i class='icon icon-exclamation-sign'></i> Invalid email address.").show(),void i[0].focus())},createTable:function(e){return"<div style='position: relative;width: 780px; top: 50px;margin: 0px auto;font-family: arial, Arial, sans-serif;font-size: 13px;'><div style='color: rgb(26, 26, 26);font-size: 15px;font-weight: bold;'>User Info</div><table width='100%' cellspacing='0' cellpadding='0' border='1' style='line-height: 20px;'><tbody><tr><td width='90' style='padding: 4px 5px;vertical-align: top;'>Name</td><td style='padding: 4px 5px;vertical-align: top;'>"+e.name+"</td></tr><tr><td style='padding: 4px 5px;vertical-align: top;'>Email</td><td style='padding: 4px 5px;vertical-align: top;'>"+e.email+"</td></tr><tr><td style='padding: 4px 5px;vertical-align: top;'>Tel</td><td style='padding: 4px 5px;vertical-align: top;'>"+e.tel+"</td></tr><tr><td style='padding: 4px 5px;vertical-align: top;'>Address</td><td style='padding: 4px 5px;vertical-align: top;'>"+e.address+"</td></tr></tbody></table><div style='padding-top: 15px;color: rgb(26, 26, 26);font-size: 15px;font-weight: bold;'>Publication Info</div><table width='100%' cellspacing='0' cellpadding='0' border='1' style='line-height: 20px;'><tbody><tr><td width='90' style='padding: 4px 5px;vertical-align: top;'>Quantity</td><td style='padding: 4px 5px;vertical-align: top;'>"+e.quantity+"</td></tr><tr><td style='padding: 4px 5px;vertical-align: top;'>Size(inch)</td><td style='padding: 4px 5px;vertical-align: top;vertical-align: top;'>"+e.pageWidth+" x "+e.pageHeight+"</td></tr><tr><td style='padding: 4px 5px;vertical-align: top;'>Pages</td><td style='padding: 4px 5px;vertical-align: top;vertical-align: top;'>"+e.pages+"</td></tr><tr><td style='padding: 4px 5px;vertical-align: top;'>Details</td><td style='padding: 4px 5px;vertical-align: top;'>"+e.remark+"</td></tr></tbody></table></div>"}},PrivacyPanel.prototype={constructor:PrivacyPanel,launch:function(){this.lightBox.launch()},save:function(e,a,o,n,s){var l=this,c=this.emailList.getValue(),d=l.panel.find("input[name=privacy"+l.randowId+"]:checked").val();this.privateItemInput[0].checked&&""==c?this.emptyAuthorizationTips.show():(this.emptyAuthorizationTips.hide(),$.ajax({url:"/hostInfo/set-book-purview-online.php",type:"POST",data:{bookId:e,isPublic:d,purview:c},beforeSend:function(){utils.addMask(l.lightBox.getBox(),{text:"Saving...",fontSize:"20px"})},success:function(e,t,i){if("1"==e)switch(utils.removeMask(l.lightBox.getBox(),l.lightBox.cancel.bind(l.lightBox)),s.options.isPublic=d,s.options.privateUsers=c,d){case"0":a();break;case"1":o();break;case"2":n()}else utils.errorMask(l.lightBox.getBox(),e)},error:function(e,t,i){utils.errorMask(l.lightBox.getBox())}}))},changePrivacy:function(){var e=this.panel.find("input[name=privacy"+this.randowId+"]:checked").val(),t=this;switch(e){case"0":if("0"==fh5.uType)return new UpgradePanel(fh5.pageData.upgrade.KeepPrivateOnTheInternet),void(this.publicItemInput[0].checked=!0);this.emailContainer.slideDown(400,function(){t.emailList.focus()}),this.lightBox.getBox().animate({top:"-=172"},400),this.current=0;break;case"1":0==this.current&&(this.emailContainer.slideUp(),this.lightBox.getBox().animate({top:"+=172"},400)),this.current=1;break;case"2":if("0"==fh5.uType)return new UpgradePanel(fh5.pageData.upgrade.KeepPrivate),void(this.publicItemInput[0].checked=!0);0==this.current&&(this.emailContainer.slideUp(),this.lightBox.getBox().animate({top:"+=172"},400)),this.current=2}}},ReUploadSection.prototype={constructor:ReUploadSection,cancelUpload:function(){this.jqXHR&&this.jqXHR.abort()},getSection:function(){return this.section},getUploadStatus:function(){return this.isUploading?"uploading":this.isUploadComplete?"complete":"nofile"},getOriginalFileName:function(){return this.originalFileName},getFileName:function(){return this.fileName}},SelectUploadMethodPanel.prototype={constructor:SelectUploadMethodPanel,uploadOnline:function(){this.lightBox.cancel(),fh5.isLoggedIn?"1"!=fh5.isUnActivate?new FastUploadPanel:window.location.href="/activate-account/index.php":new SignInPanel({isFastUpload:!0})}},SharePanel.prototype={bookLinkSwitch:function(e){var t;this.domainLinkShowing?(t=this.options.url,this.domainLinkShowing=!1,this.linkSwitchBtn.attr("title","Show Custom")):(t=location.protocol+"//"+fh5.customDomain+"/books/"+this.options.bLink,this.domainLinkShowing=!0,this.linkSwitchBtn.attr("title","Show Original")),this.setLink(t)},setLink:function(e){""==fh5.customDomain&&(e=utils.pasreHttps(e)),this.qrCodeContainer.empty().qrcode({width:87,height:87,text:e}),this.linkInput.val(e),this.facebook.find("a").attr("href","https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(e)),this.twitter.find("a").attr("href","https://www.twitter.com/share?url="+encodeURIComponent(e)),this.google.find("a").attr("href","https://plus.google.com/share?url="+encodeURIComponent(e)),this.more.find("a").attr("href","http://www.addthis.com/bookmark.php?v=15&winname=addthis&s=more&url="+encodeURIComponent(e))}},SignInPanel.prototype={constructor:SignInPanel,toSignUp:function(){this.lightBox.cancel(),new SignUpPanel
1({isFastUpload:this.options.isFastUpload,callback:this.options.callback})},logIn:function(){var n=this;n.loggingIn||utils.validate("email",n.logInEmailInput,n.logInHelp,!0,null,"!")&&utils.validate("password",n.logInPasswordInput,n.logInHelp,!0,null,"!")&&$.ajax({url:"/userLoad/handle-user-log-in.php",type:"POST",dataType:"json",data:{umail:n.logInEmailInput.val().trim(),upass:n.logInPasswordInput.val().trim()},beforeSend:function(){n.loggingIn=!0,n.logInButton.addClass("cc-hidden"),n.logInProgressWrapper.removeClass("cc-hidden")},success:function(e,t,i){var a=!1;switch(e.status){case"1":n.lightBox.cancel();var o=n.logInEmailInput.val().trim(),o=""!==e.uName?e.uName:o.substr(0,o.indexOf("@"));fh5.isLoggedIn=!0,fh5.uId=e.uId,fh5.uType=e.uType,fh5.uLink=e.uLink,utils.changeTopBar(o,e.uLink),n.options.callback?n.options.callback():n.options.isFastUpload?new FastUploadPanel:document.referrer.match("pricing")?window.location.href="/pricing.php":window.location.href="/center";break;case"2":n.logInPasswordInput.addClass("cc-validate-fail").focus(),n.logInHelp.html("<i class='icon icon-exclamation-sign'></i> Incorrect Password."),a=!0;break;case"3":n.logInEmailInput.addClass("cc-validate-fail").focus(),n.logInHelp.html("<i class='icon icon-exclamation-sign'></i> User not exist."),a=!0;break;case"4":n.logInEmailInput.addClass("cc-validate-fail").focus(),n.logInHelp.html("<i class='icon icon-exclamation-sign'></i> This is a Facebook account, try click SIGN IN WITH FACEBOOK or Forget your password to set a new password."),a=!0;break;case"5":n.logInEmailInput.addClass("cc-validate-fail").focus(),n.logInHelp.html("<i class='icon icon-exclamation-sign'></i> This is a Google account, try click SIGN IN WITH GOOGLE or Forget your password to set a new password."),a=!0;break;default:n.logInHelp.html("<i class='icon icon-exclamation-sign'></i> Upexpected error, please retry1."),a=!0}a&&(n.logInButton.removeClass("cc-hidden"),n.logInProgressWrapper.addClass("cc-hidden")),n.loggingIn=!1},error:function(e,t,i){n.logInHelp.html("<i class='icon icon-exclamation-sign'></i> Upexpected error, please retry2."),n.logInButton.removeClass("cc-hidden"),n.logInProgressWrapper.addClass("cc-hidden"),n.loggingIn=!1}})}},SignUpPanel.prototype={constructor:SignUpPanel,toSignIn:function(){this.lightBox.cancel(),new SignInPanel({isToSignUp:!0})},signUp:function(){var e,n=this;n.signingUp||utils.validate("email",n.signUpEmailInput,n.signUpHelp,!0,null,"!")&&utils.validate("password",n.signUpPasswordInput,n.signUpHelp,!0,null,"!")&&utils.validate("repassword",n.signUpReTypePasswordInput,n.signUpHelp,!0,n.signUpPasswordInput.val(),"!")&&(window._captchaToken?utils.validate("signUpTermsOfService",n.signUpTermsOfServiceCheckbox,n.signUpHelp,!0,null,"!")&&(e={umail:n.signUpEmailInput.val().trim(),upass:n.signUpPasswordInput.val().trim(),code:window._captchaToken},n.isConfirmUseEmail&&n.needToAddConfirm&&(e.isConfirm=1),$.ajax({url:fh5.protocol+document.domain+"/userLoad/handle-user-sign-up2.php",type:"post",dataType:"json",data:e,beforeSend:function(){n.signUpEmailNotOk.hide(),n.signUpEmailInput.removeClass("cc-validate-fail"),n.signUpConfirmTips.addClass("cc-hide"),n.signingUp=!0,n.signUpButton.addClass("cc-hidden"),n.signUpProgressWrapper.removeClass("cc-hidden")},success:function(e,t,i){var a=!1;switch(n.signUpSuggestEmail=e.email,e.code){case"OK":n.lightBox.cancel(),fh5.isLoggedIn=!0,fh5.uId=e.uId,fh5.uLink=e.uLink,fh5.uType="0";var o=n.signUpEmailInput.val().trim(),o=o.substr(0,o.indexOf("@"));utils.changeTopBar(o,e.uLink),window.location.href="/activate-account/index.php";break;case"2":n.signUpEmailInput.addClass("cc-validate-fail").focus(),n.signUpHelp.html("<i class='icon icon-exclamation-sign'></i> User already exists."),a=!0;break;case"4":n.signUpEmailInput.addClass("cc-validate-fail").focus(),n.signUpSuggestEmail?(n.signUpConfirmTips.removeClass("cc-hide"),$(".confirm-email-tips .email").html(n.signUpSuggestEmail),captcha.setLocation()):n.signUpHelp.html("<i class='icon icon-exclamation-sign'></i>This email address is suspected, it can not be registered."),n.signUpEmailOk.hide(),n.signUpEmailNotOk.show(),a=!0;break;case"5":n.signUpEmailInput.addClass("cc-validate-fail").focus(),n.signUpConfirmTips.removeClass("cc-hide"),$(".confirm-email-tips .email").html(n.signUpSuggestEmail),captcha.set
1Location(),n.needToAddConfirm=!0,n.signUpEmailOk.hide(),n.signUpEmailNotOk.show(),a=!0;break;case"9":n.signUpHelp.html("<i class='icon icon-exclamation-sign'></i> Your registration is not allowed due to the spam detected."),a=!0;break;case"-2":n.signUpHelp.html("<i class='icon icon-exclamation-sign'></i> Verification Code error, please retry."),a=!0;break;default:n.signUpHelp.html("<i class='icon icon-exclamation-sign'></i> Upexpected error, please retry."),a=!0}a&&(captcha.resetClickBtn(),n.signUpButton.removeClass("cc-hidden"),n.signUpProgressWrapper.addClass("cc-hidden")),n.signingUp=!1},error:function(e,t,i){n.signUpHelp.html("<i class='icon icon-exclamation-sign'></i> Upexpected error, please retry."),n.signUpButton.removeClass("cc-hidden"),n.signUpProgressWrapper.addClass("cc-hidden"),n.signingUp=!1}})):n.signUpHelp.addClass("cc-error").removeClass("cc-success").html("<i class='icon icon-exclamation-sign'></i> Please click on the Verify button to let us know you're human."))},confirmEmailYes:function(){this.signUpConfirmTips.addClass("cc-hide"),this.signUpEmailInput.val(this.signUpSuggestEmail).removeClass("cc-validate-fail"),captcha.setLocation(),console.log("yes")},confirmEmailNo:function(){this.signUpConfirmTips.addClass("cc-hide"),this.signUpEmailInput.removeClass("cc-validate-fail"),captcha.setLocation(),this.isConfirmUseEmail=!0,console.log("no")}},SmartList.prototype={constructor:SmartList,focus:function(){this.addInput.focus()},parseText:function(){for(var e=this.itemTextarea.val().trim().split(this.options.separater),t=e.length,i=[],a=0;a<t;a++){if(-1!=i.indexOf(e[a])){this.showHelp(e[a]);break}i.push(e[a]),this.hideHelp()}this.options.data=this.itemTextarea.val().trim().split(this.options.separater),this.setData(this.options.data)},viewList:function(){this.itemSelect.show(),this.itemTextarea.hide(),this.listButton.hide(),this.textButton.show(),this.removeButton.show()},viewText:function(){this.itemSelect.hide(),this.itemTextarea.show(),this.listButton.show(),this.textButton.hide(),this.removeButton.hide()},sortByName:function(e){return e.sort(function(e,t){for(var i=e.length,a=t.length,o=Math.min(i,a),n=0,s=0;s<o&&0===(n=e.charCodeAt(s)-t.charCodeAt(s));s++);return n}),e},showHelp:function(e){this.help.html("<i class='icon icon-exclamation-sign'></i>ID '"+e+"' already exists.").removeClass("cc-hidden")},hideHelp:function(){this.help.addClass("cc-hidden")},add:function(){this.viewList();var e,t=this.addInput.val().trim(),i=t.split(this.options.separater),a=i.length,o=[];if(""!=t){for(e=0;e<a;e++)-1!==this.options.data.indexOf(i[e])&&o.push(i[e]);if(o.length)this.showHelp(o);else{for(this.hideHelp(),e=0;e<a;e++)this.itemSelect.prepend("<option>"+i[e]+"</option>"),this.options.data.push(i[e]);this.addInput.val(""),this.refresh()}}},remove:function(){this.viewList();var e,t,i=this,a=this.itemSelect.find("option:selected"),o=a.length,n=[];if(0!=o){for(e=0;e<o;e++)t=a.eq(e).text(),n.push(t),this.options.data.splice(this.options.data.indexOf(t),1);utils.confirm("Remove these ID",n.join("</br>"),function(){a.remove(),i.refresh()})}},search:function(){this.viewList();var e,t=this.searchInput.val().trim().toLowerCase(),i=this.options.data,a=i.length,o=[];if(""==t)o=i;else for(e=0;e<a;e++)-1!==i[e].toLowerCase().indexOf(t)&&o.push(i[e]);this.setData(o)},setData:function(e){var t,i;for(e=this.sortByName(e),this.itemSelect.empty(),t=0,i=e.length;t<i;t++)this.itemSelect.append("<option>"+e[t]+"</option>");this.refresh()},refresh:function(){this.totalNum.text(this.options.data.length),this.itemTextarea.val(this.options.data.join(this.options.separater))},getValue:function(){return this.itemTextarea.val().trim()}},SmartSelect.prototype={constructor:SmartSelect,getVal:function(){return this.valueContainer.data("value")},choose:function(e){$target=$(e.target),$target.is("li")&&(this.valueContainer.text($target.data("label")).data("value",$target.data("value")),this.options.changeCallback&&this.options.changeCallback($target.data("value")))},toggleOption:function(){this.showing?this.hideOptions():this.showOptions()},showOptions:function(){var e=this;e.options.container.addClass("cc-as-input-focus-important"),e.optionContainer.stop().removeClass("cc-hide").animate({marginTop:0,opacity:1},200,function(){e.showing=!0})},hideOptions:function(){var e=this;e.options.container.removeClass("cc-as-input-focus-important"),e.optionContainer.stop().animate({marginTop:-3,opacity:0}
1,100,function(){e.showing=!1,e.optionContainer.addClass("cc-hide")})}},TabBox.prototype={removeClass:function(e,t){e.forEach(function(e){e.removeClass(t)})},bindTabClickFn:function(t){var i=this;this.tabContext.on("click",".tb-tab",function(e){e=$(e.target).index();i.removeClass(i.tabs,"tb-tab-active"),i.removeClass(t,"tb-section-active"),i.tabs[e].addClass("tb-tab-active"),t[e].addClass("tb-section-active")})},getTabContainer:function(){return this.tabContext},getTabs:function(){return this.tabs},getTab:function(e){return this.tabs[e]},getSectionContaier:function(){return this.paneContext},getSections:function(){return this.panes},getSection:function(e){return this.panes[e]}},TemplateSection.prototype={constructor:TemplateSection,choose:function(e){"0"!=fh5.uType||"Free"===fh5.pageData.templates[e].version?(this.templates.find(".cc-item-chosen-frame").eq(this.current).removeClass("cc-frame-chosen").end().eq(e).addClass("cc-frame-chosen"),this.templates.find(".cc-item-mask").eq(this.current).removeClass("cc-mask-chosen").end().eq(e).addClass("cc-mask-chosen"),this.templates.find(".cc-item-title").eq(this.current).removeClass("cc-title-chosen").end().eq(e).addClass("cc-title-chosen"),this.current=e,this.options.advancedSection.setTemplateName(fh5.pageData.templates[this.current].name)):new UpgradePanel(fh5.pageData.upgrade.Template)},getTemplate:function(){return this.templates.find(".cc-item-title").filter(".cc-title-chosen").data("value")}},ThemeSection.prototype={constructor:ThemeSection,choose:function(e,t,i){this.themes.find(".cc-item-chosen-frame").eq(this.current).removeClass("cc-frame-chosen").end().eq(e).addClass("cc-frame-chosen"),this.themes.find(".cc-item-mask").eq(this.current).removeClass("cc-mask-chosen").end().eq(e).addClass("cc-mask-chosen"),this.themes.find(".cc-item-title").eq(this.current).removeClass("cc-title-chosen").end().eq(e).addClass("cc-title-chosen"),this.current=e;var a=this.themeNames[this.current],e=this.options.advancedSection;e.setThemeName(a),t&&e.reloadThemeSetting(i)},getTheme:function(){return this.themes.find(".cc-item-title").filter(".cc-title-chosen").data("value")}},ToTopPanel.prototype={constructor:ToTopPanel,handleScroll:function(){50<$(window).scrollTop()?this.panel.show():this.panel.hide()},toTop:function(){utils.scrollTo(0)}},UpgradePanel.prototype={constructor:UpgradePanel},UploadSection.prototype={constructor:UploadSection,cancelUpload:function(){this.jqXHR&&this.jqXHR.abort()},getUploadComponentContainer:function(){return this.uploadComponentContainer},getUploadComponent:function(){return this.uploadComponent},getUploadFileZone:function(){return this.uploadFileZone},getIsPublic:function(){return this.keepPrivateGroup.isChecked()?"2":"1"},getUploadStatus:function(){return this.isUploading?"uploading":this.isUploadComplete?"complete":"nofile"},getOriginalFileName:function(){return this.originalFileName},getFileName:function(){return this.fileName}},VideoGalleryPanel.prototype={constructor:VideoGalleryPanel,open:function(e){e.videoGalleryPanel=this,new AddVideoPanel(e)},getPanel:function(){return this.panel},add:function(e,t,i,a,o,n){var s=o.match("files/extfile")?"http://"+fh5.AS3BucketName+"/"+fh5.uLink+"/"+this.bLink+"/"+o:o,l=this,c=$("<li class='cc-float-fix'></li>"),d=$("<span class='cc-video-gallery-thumbnail'></span>"),r=$("<img src='"+s+"'>"),p=$("<span class='cc-video-gallery-title'>"+utils.encodeHTML(i)+"</span>"),h=$("<span class='cc-video-gallery-desc'>"+utils.encodeHTML(a)+"</span>"),u=$("<span class='cc-video-gallery-button'></span>"),g=$("<div><div class='button-pure button-pure-blue'>Edit<div></div>"),b=$("<div><div class='button-pure button-pure-red'>Delete</div></div>"),m=$("<div><div class='button-pure button-pure-blue'>Up<div></div>"),s=$("<div><div class='button-pure button-pure-blue'>Down<div></div>");o?r.show():r.hide(),n||u.append(g).append(m).append(s).append(b),c.data("value",{type:e,id:t,title:i,description:a,thumbnail:decodeURIComponent(o)}),c.append(d.append(r)).append(p).append(h).append(u).appendTo(this.list),g.on("click",function(){new AddVideoPanel({videoGalleryPanel:l,videoItem:$(this).parents("li:eq(0)"),type:c.data("value").type,id:c.data("value").id,title:c.data("value").title,de
1sc:c.data("value").description,thumbnail:c.data("value").thumbnail,bLink:l.bLink})}),m.on("click",function(){1!=c.index()&&c.prev().before(c)}),s.on("click",function(){c.next().after(c)}),b.on("click",function(){c.fadeOut(function(){c.remove()})})},deleteAll:function(){var e=this;utils.confirm("Delete all videos","All videos will be permanently removed. Are you sure you want to proceed?",function(){e.list.find("li:not(:first-child)").remove()})},getConfig:function(e){for(var t,i=this.list.find("li:not(:first-child)"),a=i.length,o=[],n=0,s=0;s<a;s++)o[s]=i.eq(s).data("value"),(t=o[s].thumbnail.match(/upload-control\/files\/(.*)/))&&(e.videoList[n++]=t[1],o[s].thumbnail="files/extfile/"+t[1]);return o}};var isInDebugMode=!(WaterPanel.prototype={constructor:WaterPanel,createHoverContent:function(){var e=this,t=$("<div class='explore-water-hover-banner-context'></div>"),i=$("<img class='cc-hide'/>"),a=$("<div class='explore-water-hover-context'></div>"),o=$("<a class='explore-water-hover-imgLink'></a>"),n=$("<div class='explore-water-hover-imgContext'></div>"),s=$("<img class='explore-water-hover-user-img cc-hide'/>"),l=$("<div class='explore-water-hover-mid'></div>"),c=$("<div class='explore-water-hover-name'></div>"),d=$("<a class='explore-water-hover-name-link'></a>"),r=$("<div class='explore-water-hover-btn'></div>");btnContent=$("<span class='explore-water-hover-button-content button-pure'></span>"),subscribe=$("<span class='explore-water-hover-subscribe-label'><span class='fa fa-rss'></span><span class='explore-botton-text'> Follow</span></span>").show(),subscribed=$("<span class='explore-water-hover-subscribed-label'><span class='fa fa-check'></span><span class='explore-botton-text'>Following</span></span>").hide(),unsubscribe=$("<span class='explore-water-hover-unsubscribe-label'><span class='fa fa-times'></span><span class='explore-botton-text'>Unfollow</span></span>").hide(),subCount=$("<span class='center-homepage-subscribe-count' style='top: 1px;margin-left:10px;'></span>"),hoverBottom=$("<div class='explore-water-hover-bottom'></div>"),innerBottom=$("<div class='explore-water-hover-inner-bottom'></div>"),hoverAbout=$("<div class='explore-water-hover-about'></div>"),a.append(t.append(i)).append(o.append(n.append(s))).append(l.append(c.append(d)).append(r.append(btnContent.append(subscribe).append(subscribed).append(unsubscribe)).append(subCount))).append(hoverBottom.append(innerBottom.append(hoverAbout))).appendTo($("body")),e.timeOut=null,a.hover(function(){clearTimeout(e.timeOut),a.fadeIn(0)},function(){a.stop().fadeOut(200)}),btnContent.hover(function(){e.isSubscribed?(subscribe.hide(),subscribed.hide(),unsubscribe.show()):(subscribe.show(),subscribed.hide(),unsubscribe.hide())},function(){e.isSubscribed?(subscribe.hide(),subscribed.show()):(subscribe.show(),subscribed.hide()),unsubscribe.hide()}),e.isSubscribed=!1,e.hoverContext=a,e.btnContent=btnContent,e.subscribe=subscribe,e.subscribed=subscribed,e.unsubscribe=unsubscribe,e.hoverNameLink=d,e.hoverImgLink=o,e.hoverImgContext=n,e.hoverImg=s,e.subCount=subCount,e.hoverAbout=hoverAbout,e.bannerContext=t,e.bannerImg=i},load:function(S,B){for(var L,P,T,U,F=this,i=!0,e=0,t=S.length;e<t;e++)!function(d){var e,t,i,a;T=utils.encodeHTML(S[d].title),U=utils.encodeHTML(S[d].description),e=$("<li class='cc-water-item' id='"+S[d].bookid+"'></li>"),B?e.prependTo(F.panel):e.appendTo(F.panel);var r=""==(u=S[d].uEmail)||null==u;L=r?"Guest":utils.encodeHTML(""==S[d].uName||null==S[d].uName?u.match(/(.*)@/)?u.match(/(.*)@/)[1]:"":S[d].uName),P=F.isInDomainHome?"/books/"+S[d].bLink:((f="")!=location.port&&(f=":"+location.port),S[d].hasOwnProperty("basicLink")?(P=S[d].basicLink).replace(/^https?:/,location.protocol):location.protocol+"//"+document.domain+f+"/"+S[d].uLink+"/"+S[d].bLink),t=$("<a target='_blank' class='cc-water-show-book-link cc-transparent-link' href='"+P+"'></a>"),i=r?$("<span title='Guest Data'>"+L+"</span>"):$("<a class='cc-blue-link-4' href='/homepage/"+S[d].uLink+"'>"+L+"</a>"),F.isInDomainHome&&i.hide(),a=$("<div class='cc-water-img-container ff-mask-effect-three'></div>");var o="0"==S[d].isNew?"png":"jpg",n=$("<img class='cc-water-img cc-hide' src='"+utils.pasreHttps(S[d].url)+"files/shot."+o+"'/>"),s=$("<div class='mask'></div>"),l=$("<span class='mask-icon'></span>"),c=$("<div class='cc-water-info-container'></div>"),p=$("<div class='cc-water-title' title='"+T+"'>"+F.searchHighlight(T,F.keyword)+"</div>"),h=$("<div class='cc-water-author'></div>"),u=$("<div class='cc-water-desc' title='"+utils.br2nl(U)+"'>"+F.searchHighlight(U,F.keyword)+"</div>"),g=($("<div class='cc-water-views'>Views: "+S[d].totalViews+"</div>
1"),$("<div class='cc-water-time'>"+S[d].timeStr+"</div>"),!!F.isLike||"1"==S[d].isLiked),b="Remove from my favorites",m="Add to my favorites",f=g?b:m,o=g?"rgb(206, 48, 48)":"rgb(95, 95, 95)",v=$("<div class='explore-water-collect-content'></div>").attr("title",f),k=($("<span class='explore-water-collect-botton'></span>"),$("<span class='explore-water-collect-fix'><i class='fa fa-spinner fa-spin-2x explore-water-collect-botton-icon'></i><span></span></span>").hide()),w=$("<span class='explore-water-collect-cancel'><i class='fa fa-heart explore-water-collect-botton-icon'></i><span></span></span>").css({color:o});if(e.append(t.append(a.append(n).append(s.append(l)))).append(c.append(p).append(h.append(i)).append(u)),utils.autoFitPosition(a,n,"","","#eee"),"0"!==S[d].label){switch(S[d].label){case"1":0;break;case"2":0;break;case"3":0}a.append("<img class='cc-water-label-img' src='"+utils.getLabelFilePath(S[d].label)+"'>")}function I(){C&&(F.isSubscribed?$.ajax({url:"/center/db/del-subscribe-online.php",type:"post",dataType:"json",data:{userid:fh5.uId,sub_userid:S[d].userId},beforeSend:function(){utils.addSpin(F.btnContent),C=!1},success:function(e){"1"==e.status?(F.btnContent.addClass("button-pure-blue").removeClass(""),F.subscribe.show(),F.unsubscribe.hide(),F.subscribed.hide(),F.isSubscribed=!1,F.isInCenter&&(e=S[d].uLink,delSubscribe(e))):(F.subscribe.hide(),F.unsubscribe.hide(),F.subscribed.show()),C=!0,utils.removeSpin(F.btnContent)},error:function(e){utils.removeSpin(F.btnContent),F.subscribe.hide(),F.unsubscribe.hide(),F.subscribed.show(),C=!0}}):$.ajax({url:"/center/db/add-subscribe-online.php",type:"post",dataType:"json",data:{userid:fh5.uId,sub_userid:S[d].userId},beforeSend:function(){utils.addSpin(F.btnContent),C=!1},success:function(e){"1"==e.status?(F.btnContent.addClass("").removeClass("button-pure-blue"),F.subscribe.hide(),F.unsubscribe.hide(),F.subscribed.show(),F.isSubscribed=!0,e=""==S[d].uName||null==S[d].uName?S[d].uEmail.substr(0,S[d].uEmail.lastIndexOf("@")):S[d].uName,F.isInCenter&&addSubscribe(S[d].uLink,"http://"+fh5.AS3BucketName+"/"+(""==S[d].accountlogo||null==S[d].accountlogo?"accountlogo.jpg":S[d].uLink+"/"+S[d].accountlogo),utils.encodeHTML(e))):(F.subscribe.show(),F.unsubscribe.hide(),F.subscribed.hide()),C=!0,utils.removeSpin(F.btnContent)},error:function(e){F.subscribe.show(),F.unsubscribe.hide(),F.subscribed.hide(),C=!0,utils.removeSpin(F.btnContent)}}))}U=S[d].pageWidth/S[d].pageHeight,U=F.itemWidth/(isNaN(parseInt(U))?.75:U),e.width(F.itemWidth),a.width(F.itemWidth),a.height(U),n.width(F.itemWidth),n.height(U),t.data("title",S[d].title),t.data("url",P),F.lastTime=S[d].newTime;var C=!0;function y(){x&&(g?$.ajax({url:"/center/db/del-favorite-online.php",type:"post",dataType:"json",data:{userid:fh5.uId,bookid:S[d].bookid},beforeSend:function(){k.show(),w.hide(),x=!1},success:function(e){"1"==e.status?(k.hide(),w.css({color:"rgb(95, 95, 95)"}).show(),v.attr("title",m),g=!1):(k.hide(),w.show()),x=!0},error:function(e){k.hide(),w.show(),x=!0}}):$.ajax({url:"/center/db/add-favorite-online.php",type:"post",dataType:"json",data:{userid:fh5.uId,bookid:S[d].bookid},beforeSend:function(){k.show(),w.hide(),x=!1},success:function(e){"1"==e.status?(k.hide(),w.css({color:"rgb(206, 48, 48)"}).show(),v.attr("title",b),g=!0):(k.hide(),w.show()),x=!0},error:function(e){k.hide(),w.show(),x=!0}}))}i.hover(function(e){var t,i,a,o,n,s,l,c;F.isInHome||r||(clearTimeout(F.timeOut),F.bannerImg.hide().attr("src","https://"+fh5.AS3BucketName+"/"+(""==S[d].bannerlogo||null==S[d].bannerlogo?"bannerlogo.jpg":S[d].uLink+"/"+S[d].bannerlogo)),utils.fullFill(F.bannerContext,F.bannerImg),F.subCount.html(utils.fromatInt(S[d].fans)).attr("title",S[d].fans),F.hoverAbout.html(utils.encodeHTML(S[d].about)).attr("title",S[d].about),F.hoverImgLink.attr("href","/homepage/"+S[d].uLink),F.hoverNameLink.attr("href","/homepage/"+S[d].uLink),F.hoverImg.hide().attr("src","https://"+fh5.AS3BucketName+"/"+(""==S[d].accountlogo||null==S[d].accountlogo?"accountlogo.jpg":S[d].uLink+"/"+S[d].accountlogo)),utils.autoFitPosition(F.hoverImgContext,F.hoverImg,"","","#eee"),F.hoverN
1ameLink.html(utils.encodeHTML(""==S[d].uName||null==S[d].uName?S[d].uEmail.match(/(.*)@/)?S[d].uEmail.match(/(.*)@/)[1]:S[d].uEmail.match(/(.*)@/):S[d].uName)),fh5.isLoggedIn?$.ajax({url:"/center/db/check-subscribe-online.php",type:"post",dataType:"json",data:{userid:fh5.uId,sub_userid:S[d].userId},beforeSend:function(){F.btnContent[0].onclick=null,utils.removeSpin(F.hoverContext),utils.addSpin(F.hoverContext)},success:function(e){utils.removeSpin(F.hoverContext),F.isSubscribed="1"==e.status,F.btnContent.addClass(F.isSubscribed?"":"button-pure-blue").removeClass(F.isSubscribed?"button-pure-blue":""),F.subscribe.css({display:F.isSubscribed?"none":"block"}),F.subscribed.css({display:F.isSubscribed?"block":"none"}),F.btnContent[0].onclick=I},error:function(e){F.btnContent[0].onclick=null}}):(F.isSubscribed=!1,F.subscribe.css({display:F.isSubscribed?"none":"block"}),F.subscribed.css({display:F.isSubscribed?"block":"none"}),F.btnContent.addClass("button-pure-blue").removeClass(""),F.btnContent[0].onclick=function(){new SignInPanel({callback:function(){I(),setTimeout(function(){location.reload()},500)}})}),c=$(this).offset().left,t=$(this).offset().top,$(this).outerWidth(),s=$(this).outerHeight(),n=F.itemWidth,i=$(document).scrollTop(),o=F.hoverContext.outerWidth(),a=F.hoverContext.outerHeight(),l=c-(o-n)/2,c=t+s,(s=(o=window.innerHeight)-(n=t-i)-s)<a&&a<n?c=t-a:s<a&&n<a&&(c=o+i-a-8),F.hoverContext.css({left:l,top:c}).fadeIn(200))},function(){F.isInHome||(F.timeOut=setTimeout(function(){F.hoverContext.stop().fadeOut(200)},200))}),v.hover(function(){r||v.stop(!1,!1).animate({opacity:1},{start:function(){$(this).show()},duration:200})},function(){});var x=!0;v.on("click",function(){r||(fh5.isLoggedIn?"1"!=fh5.isUnActivate?y():window.location.href="/activate-account/index.php":new SignInPanel({callback:function(){y(),setTimeout(function(){location.reload()},500)}}))}),a.hover(function(){r||v.stop(!1,!1).animate({opacity:1},{start:function(){$(this).show()},duration:200})},function(){r||v.stop(!1,!1).animate({opacity:0}
1,{duration:200,complete:function(){$(this).hide()}})})}(e);this.panel.find(".cc-water-show-book-link").on("click",function(e){var t;i&&!utils.isPhone()&&2!==e.which&&(e.preventDefault(),t=$(this),F.isHideLeaveMask?window.location.href=t.data("url"):utils.addLeaveMask(t.data("title"),function(){window.location.href=t.data("url")}))}),$(window).on("keydown",function(e){17==e.which&&(i=!1)}),$(window).on("keyup",function(e){17==e.which&&(i=!0)}),this.setPosition()},setPosition:function(){var e,t,a=this;for(a.cols=parseInt((a.container.width()-a.offsetX)/(a.itemWidth+a.offsetX)),e=0;e<a.cols;e++)a.colHeights[e]=a.offsetY;a.panel.children().each(function(e,t){var i=$(t),t=Math.min.apply(null,a.colHeights),t=a.colHeights.indexOf(t);i.css({left:t*a.itemWidth+t*a.offsetX,top:a.colHeights[t]}),a.colHeights[t]+=i.height()+a.offsetY}),t=(a.cols+1)*a.offsetX+a.cols*a.itemWidth,a.panel.css({width:t,height:utils.max2(a.colHeights),left:(a.container.width()-t)/2})},searchHighlight:function(e,t){if(""==t)return e;for(var i=e,a=new RegExp("<.*?>","i"),o=new Array,n=0;;n++){var s=a.exec(i);if(!s)break;o[n]=s,i=i.replace(s,"{[("+n+")]}")}for(var l=unescape(t.replace(/\+/g," ")).split(/\s+/),c=0;c<l.length;c++)var d=new RegExp("("+l[c].replace(/[(){}.+*?^$|\\\[\]]/g,"\\$&")+")","ig"),i=i.replace(d,"<span style='background-color: yellow;'>$1</span>");for(n=0;n<o.length;n++)i=i.replace("{[("+n+")]}",o[n]);return i},tabDate:function(e,t){var i=new Date(e),a=new Date(t);return i.getTime()>a.getTime()?e:t}}),utils={};$(document).ready(function(){isInDebugMode&&(window.logPanel=new LogPanel)}),utils={supportTouch:"ontouchstart"in window,log:function(e){isInDebugMode&&window.logPanel.log(e)},addMask:function(e,t){var i=$.extend({},{hasLoading:!0,text:"",fontSize:"14px",left:0,top:0,cursor:"wait"},t),a=$("<div class='cc-mask cc-user-select-none'></div>").css({cursor:i.cursor}),t=$("<div class='cc-mask-content'></div>").appendTo(a);i.hasLoading&&t.append($("<div class='cc-loading cc-user-select-none'></div>")),t.append($("<div class='cc-mask-text cc-user-select-none'>"+i.text+"</div>").css({fontSize:i.fontSize})),a.appendTo(e),t.css({display:"none",left:(e.outerWidth()-t.outerWidth())/2,top:(e.outerHeight()-t.outerHeight())/2}).fadeIn(),e.ccMask=a},removeMask:function(e,t,i){var a=e.ccMask;void 0===i&&(i=400),a&&0<a.length&&a.fadeOut(i,function(){setTimeout(function(){a.remove(),t&&t()},50)})},errorMask:function(e,t){var i=this,a=e.ccMask.empty().css({cursor:"default"}),o=$("<div class='cc-server-error alert alert-error'>Server error, please retry.</div>
1").appendTo(a),a=$("<div class='cc-remove-mask-button'><span class='icon icon-remove'></span></div>").appendTo(o);o.css({top:(e.height()-o.outerHeight())/2,left:(e.width()-o.outerWidth())/2}),a.on("click",function(){i.removeMask(e)}),t&&i.log("server error: "+t)},hasMask:function(e){return e.ccMask&&0<e.ccMask.length},addSpin:function(e){var t=e.css("position");"absolute"!==t&&"relative"!==t&&e.css("position","relative"),t=$("<div class='cc-spin-mask'><i class='fa fa-spinner fa-spin-2x'></i></div>").appendTo(e),e.ccSpin=t},removeSpin:function(e){e=e.ccSpin;e&&0<e.length&&e.remove()},showMe:function(e,t,i){void 0===i&&(i=80),void 0===t&&(t=200),$("html,body").stop().animate({scrollTop:e.offset().top-i},t)},addHighlight:function(e,t){if(""==t)return e;for(var i=e,a=new RegExp("<.*?>","i"),o=new Array,n=0;;n++){var s=a.exec(i);if(!s)break;o[n]=s,i=i.replace(s,"{[("+n+")]}")}for(var l=unescape(t.replace(/\+/g," ")).split(/\s+/),c=0;c<l.length;c++)var d=new RegExp("("+l[c].replace(/[(){}.+*?^$|\\\[\]]/g,"\\$&")+")","ig"),i=i.replace(d,"<span class='cc-highlight'>$1</span>");for(n=0;n<o.length;n++)i=i.replace("{[("+n+")]}",o[n]);return i},fixedWidth:function(t,i,a,o){var n=this,s=new Image;t.addClass("cc-img-loading"),s.onload=function(){var e=s.width/s.height,e=a/e;o<e?n.autoFit(t,i):(i.css({width:a,height:e,marginLeft:(t.width()-a)/2,marginTop:(t.height()-e)/2}),setTimeout(function(){i.fadeIn()},50),t.removeClass("cc-img-loading"))},s.onerror=function(){setTimeout(function(){i.fadeIn()},50),t.removeClass("cc-img-loading")},s.src=i.attr("src")},autoFit:function(o,n,s){var l=new Image;o.addClass("cc-img-loading"),l.onload=function(){var e=o.height(),t=o.width(),i=l.width/l.height,a=e,e=e*i;e>o.width()&&(a=(e=t)/i),n.css({width:e,height:a,marginLeft:(o.width()-e)/2,marginTop:(o.height()-a)/2}),setTimeout(function(){n.fadeIn(),o.removeClass("cc-img-loading"),s&&s()},50)}
1,l.onerror=function(){var e=$("<div></div>"),t=o.height(),i=o.width(),a=t,t=.75*t;t>o.width()&&(a=(t=i)/.75),e.css({boxShadow:n.css("box-shadow"),cursor:"pointer",background:"#eee",width:t,height:a,marginLeft:(o.width()-t)/2,marginTop:(o.height()-a)/2}),n.after(e),o.removeClass("cc-img-loading"),s&&s()},l.src=n.attr("src")},fullFill:function(s,l,c){var d=new Image;s.addClass("cc-img-loading"),d.onload=function(){var e=s.height()+1,t=s.width()+1,i=t/e,a=d.width/d.height,o=t,n=t/a;i<a?o=(n=e)*a:a<i&&(n=(o=t)/a),l.css({position:"absolute",width:o,height:n,left:(s.width()-o)/2,top:(s.height()-n)/2}),setTimeout(function(){l.fadeIn(),s.removeClass("cc-img-loading"),c&&c()},50)},d.onerror=function(){setTimeout(function(){l.fadeIn()},50),s.removeClass("cc-img-loading"),c&&c()},d.src=l.attr("src")},autoFitBottom:function(o,n,s){var l=new Image;o.addClass("cc-img-loading"),l.onload=function(){var e=o.height(),t=o.width(),i=l.width/l.height,a=e,e=e*i;e>o.width()&&(a=(e=t)/i),n.css({position:"absolute",display:"block",width:e,height:a,left:(o.width()-e)/2,top:"auto",bottom:0}),setTimeout(function(){n.fadeIn(),o.removeClass("cc-img-loading"),s&&s()},50)},l.onerror=function(){setTimeout(function(){n.fadeIn()},50),o.removeClass("cc-img-loading"),s&&s()},l.src=n.attr("src")},autoFitPosition:function(o,n,s,l,e,c){var d=new Image,r=$("<i class='fa fa-spinner cc-spin-loading-40 fa-spin'></i>");o.append(r),d.onload=function(){var e=o.height(),t=o.width(),i=d.width/d.height,a=e,e=e*i;e>o.width()&&(a=(e=t)/i),(s||l)&&o.css({width:e,height:a,left:"left"==s?0:"right"==s?"auto":(o.width()-e)/2,right:"right"==s?0:"auto"}),n.css({position:"absolute",width:e,height:a,left:"left"==s?0:"right"==s?"auto":(o.width()-e)/2,right:"right"==s?0:"auto",top:"top"==l?0:"bottom"==l?"auto":(o.height()-a)/2,bottom:"bottom"==l?0:"auto"}),setTimeout(function(){n.fadeIn(),r.remove(),c&&c()},50)},d.onerror=function(){n.hide().remove(),r.remove(),o.css({backgroundColor:e||"#fff"}),c&&c()},d.src=n.attr("src")},fixedWidthAutoHeight:function(i,a){var o=new Image;i.addClass("cc-img-loading"),o.onload=function(){var e=i.width(),t=e/(o.width/o.height);a.css({width:e,height:t}),setTimeout(function(){a.fadeIn()},50),i.removeClass("cc-img-loading")},o.onerror=function(){setTimeout(function(){a.fadeIn()},50),i.removeClass("cc-img-loading")},o.src=a.attr("src")},confirm:function(e,t,i){var a=$("<ul class='cc-light-box-buttons'></ul> "),o=$("<li class='button-pure button-pure-green'>Yes</li>"),n=$("<li class='button-pure'> No</li>"),s=new LightBox(e,t,480);s.box.append(a.append(o).append(n)),s.launch(),o.on("click",function(){i(),s.cancel()}),n.on("click",function(){s.cancel()})},popUp:function(e,t,i,a){var o=$("<ul class='cc-light-box-buttons'></ul> "),n=$("<li class='button-pure'>Close</li>"),s=new LightBox(e,t,i);s.box.append(a).append(o.append(n)),s.launch(),n.on("click",function(){s.cancel()})},alert:function(e,t){var i=$("<ul class='cc-light-box-buttons'></ul> "),a=$("<li class='button-pure'>Close</li>"),o=new LightBox(e,t,480);o.box.append(i.append(a)),o.launch(),a.on("click",function(){o.cancel()})},saveConfirm:function(e,t,i,a,o){var n=$("<ul class='cc-light-box-buttons'></ul> "),s=$("<li class='button-pure button-pure-green'>Yes</li>"),l=$("<li class='button-pure'> No</li>"),c=$("<div class='button-pure'>Cancel</div>"),d=new LightBox(e,t,480);d.box.append(n.append(s).append(l).append(c)),d.launch(),s.on("click",function(){i&&i(),d.cancel()}),l.on("click",function(){a&&a(),d.cancel()}),c.on("click",function(){o&&o(),d.cancel()})},fixedConfirm:function(e,t,i,a,o){var n=new FixedLightBox(e,"","",{hasBtns:!0}),s=n.getSaveBtn().html("Yes"),l=n.getCancelBtn().html("No"),e=n.getTopCancelBtn();return n.getPanel().append("<div class='hf-lightbox-confirm-desc'>"+t+"</div>"),o&&(s.removeClass("button-pure-green"),l.addClass("button-pure-green")),n.launch(),s.on("click",function(){i(),n.cancel()}),l.add(e).on("click",function(){a&&a(),n.cancel()}),n},launchNote:function(e){new FixedLightBox("","","0").launchNote(e).launch()},launchError:function(e){new FixedLightBox("","","0").launchError(e).launch()},max2:function(e){return Math.max.apply({},e)},min2:function(e){return Math.min.apply({},e)},remove:function(e,t,i){void 0===t&&(t=400),$("html, body").animate({scrollTop:"-="+e.height()},t),e.slideUp(t,function(){e.remove(),i&&i()})},validate:function(e,t,i,a,o,n,s){var l,c=t.val(),n="!"===n?"<i class='icon icon-exclamation-sign'></i> ":"* ";switch(e){case"email":""===(c=c.trim())?l="Please enter your email address.":c.match(/^\w+([-\.]\w+)*@\w+([\.-]\w+)*\.\w{2,10}$/)?null!==c.match(/['ââ"ââ ã]/)&&(l="Email contains invali
1d characters."):l="Invalid email address.";break;case"password":""===c?l="Please enter your password.":c.length<6||20<c.length?l="Password must be 6-20 characters.":null!==c.match(/['ââ"ââ ã]/)&&(l="Password contains invalid characters.");break;case"repassword":c!==o&&(l="Inconsistent password.");break;case"signUpTermsOfService":t.is(":checked")||(l="Please accept our terms of service.");break;case"signUpVerificationCode":(c=c.trim()).match(/^[A-Za-z0-9-_]+$/)||(l="Incorrect Verification code.");break;case"verificationCode":""==(c=c.trim())&&(l="Please enter the verification code."),""==c||c.match(/^[A-Za-z0-9]+$/)||(l="Incorrect verification code.");break;case"text":""===(c=c.trim())&&(l="Required");break;case"name":""===(c=c.trim())&&(l="Please enter your name.");break;case"number":""===(c=c.trim())?l="Required":isNaN(c)&&(l="Please enter a number.");break;case"positiveNumber":""===(c=c.trim())?l="Required":isNaN(c)?l="Please enter a number.":parseFloat(c)<0&&(l="Please enter a positive number.")}return l?(s&&(l=s),l=n+=l,t.addClass("cc-validate-fail"),i&&i.html(l),a&&t.focus(),!1):(t.removeClass("cc-validate-fail"),i&&i.html(""),!0)},encodeHTML:function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\\/g,"\").replace(/"/g,""").replace(/'/g,"'").replace(/\n/g,"<br>")},decodeHTML:function(e){return void 0!==e&&e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\/g,"\\").replace(/"/g,'"').replace(/'/g,"'").replace(/<br>/g,"\n"):""},nl2br:function(e){return e.replace(/\n/g,"<br>")},br2nl:function(e){return e.replace(/<.?br.?>/g,"\n")},changeTopBar:function(e,t){var i=$(".cc-top-bar");i.find(".cc-top-bar-explore");i.find(".cc-before-log-in-menu").remove(),$("#navbar").remove(),$.ajax({url:"/top-after-log-in.php",type:"POST",data:{uName:e,uLink:t},success:function(e){$(".cc-fast-upload-button").before(e),utils.setTopSubMenuPosition()}})},setTopSubMenuPosition:function(){$(".cc-top-menu .cc-has-sub-menu").each(function(e,t){var i=$(t),t=(i.find(".cc-parent-link"),i.find(".cc-sub-menu"));t.css("marginLeft",(i.width()-t.width())/2)})},scrollTo:function(e,t){void 0===t&&(t=400),$("html,body").animate({scrollTop:e},t)},addLeaveMask:function(e,t){$("<div class='cc-fullscreen-mask cc-hide'><div class='cc-fullscreen-text'>"+e+"</div></div>").appendTo($("body")).fadeIn(function(){t&&t()})},tap:function(e,t){this.supportTouch?e.hammer().on("tap",t):e.on("click",t)},isPhone:function(){var e=navigator.userAgent.toLowerCase();return!(!(0<e.indexOf("phone")||0<e.indexOf("mobile")||0<e.indexOf("ipod")||0<e.indexOf("msie")&&e.indexOf("pc")<=0)||0<e.indexOf("pad")||0<e.indexOf("pc"))},isMobile:function(){return!!navigator.userAgent.toLowerCase().match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)},isMac:function(){return 0<navigator.userAgent.toLowerCase().indexOf("mac")},getTemplateId:function(e){for(var t=fh5.pageData.templates,i=t.length,a=0;a<i;a++)if(t[a].name===e)return t[a].id},getThemeId:function(e){return fh5.pageData.themes.indexOf(e)},parseDate:function(e,t,i){var a=e.split(" "),e=a[0].split("-"),a=a[1].split(":"),a=new Date(e[0],e[1]-1,e[2],a[0],a[1],a[2]);return t&&(a=new Date(a.getTime()-60*a.getTimezoneOffset()*1e3)),i&&(a=a.toLocaleString()),a},getLabelFilePath:function(e){var t="";switch(e+=""){case"1":t="//pubhtml5.com/images/label-new.png";break;case"2":t="//pubhtml5.com/images/label-hot.png";break;case"3":t="//pubhtml5.com/images/label-featured.png"}return t},selectCode:function(e){e.select()},loadFile:function(e,t){var i,a=e.split("?")[0],a=a.substr(a.length-2).toLowerCase();console.log(a),"js"==a?((i=document.createElement("script")).setAttribute("src",e),i.onload=function(){t&&t()}):((i=document.createElement("link")).setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href",e)),document.head.appendChild(i)},isEmptyObj:function(e){for(var t in e)return!1;return!0},escapeSpeciialChar:function(e){return e.replace(/'/g,"\\'")},googleLogin:function(i){var a=$("#"+i.id),o=a.siblings(".progress"),n=$("#"+i.helpId);a.addClass("cc-hidden"),o.removeClass("cc-hidden"),n.html("");var e=i.googleUser.getBasicProfile(),s=e.getEmail(),t=e.getId(),l=e.getName(),e=i.googleUser.getAuthResponse().access_token;$.ajax({type:"POST",url:"/userLoad/handle-google-log-in.php",dataType:"json",data:{code:e,userid:t,name:l,bookid:i.bookId},success:function(e){var t;"1"==e.status?(t=""!==e.uName?e.uName:s.substr(0,s.indexOf("@")),fh5.isLoggedIn=!0,fh5.uId=e.uId,fh5.uType=e.uType,fh5.uLink=e.uLink,utils.changeTopBar(t,e.uLink),i.lightBox&&i.lightBox.cancel(),i.callback?i.callback():i.isFastUpload?new FastUploadPanel:i.isNoLoginUpload?window.location.href="/center/flips/book.php?cid="+e.cId:document.referrer.match("pricing")?window.location.href="/pricing.php":window.location.href="/center"):(e.status="9",n.html("<i class='icon icon-exclamation-sign'></i> Your registration is not allowed due to the spam detected."),a.addClass("cc-hidden"),o.removeClass("cc-hidden"))},error:function(e,t){n.html(fh5.pageData.tips.ConnectionError),a.addClass("cc-hidden"),o.removeClass("cc-hidden")}})},facebookLogin:function(a){var o=$("#"+a.id),n=o.siblings(".progress"),s=$("#"+a.helpId);o.addClass("cc-hidden"),n.removeClass("cc-hidden"),s.html(""),this.loadFile("//connect.facebook.net/en_US/sdk.js",function(){FB.init({appId:"552959651503135",cookie:!0,xfbml:!1,version:"v2.4"}),FB.login(function(e){"connected"===e.status?FB.api("/me?fields=id,email",function(e){var i=e.email;e.error?(s.html(fh5.pageData.tips.ConnectionError),n.addClass("cc-hidden"),o.removeClass("cc-hidden")):$.ajax({type:"POST",url:"/userLoad/handle-facebook-log-in.php",dataType:"json",data:{userid:e.id,bookid:a.bookId,email:i},success:function(e){var t;"1"==e.status?(t=""!==e.uName?e.uName:i.substr(0,i.indexOf("@")),fh5.isLoggedIn=!0,fh5.uId=e.uId,fh5.uType=e.uType,fh5.uLink=e.uLink,utils.changeTopBar(t,e.uLink),a.lightBox&&a.lightBox.cancel(),a.callback?a.callback():a.isFastUpload?new FastUploadPanel:a.isNoLoginUpload?window.location.href="/center/flips/book.php?cid="+e.cId:document.referrer.match("pricing")?window.location.href="/pricing.php":window.location.href="/center"):(e.status="9",s.html("<i class='icon icon-exclamation-sign'></i> Your registration is not allowed due to the spam detected."),o.addClass("cc-hidden"),n.removeClass("cc-hidden"))},error:function(e,t){s.html(fh5.pageData.tips.ConnectionError),n.addClass("cc-hidden"),o.removeClass("cc-hidden")}})}):(e.status,n.addClass("cc-hidden"),o.removeClass("cc-hidden"))},{scope:"public_profile,email"})})},fromatInt:function(e){if(isNaN(e))return e;var t=e.toString().length;return t<4?e:4<=t&&t<7?Math.floor(e/1e3)+"K":7<=t&&t<10?Math.floor(e/1e6)+"M":Math.floor(e/1e9)+"B"},formatIntToStr:function(e){var t=Math.floor(parseInt(e)/1e3),e=e.toString().substr(-3);return 0<t?this.formatIntToStr(t)+","+e:e+""},formatTime:function(e){var t=parseInt(e),i=0,e=0;return 60<=t&&(i=parseInt(t/60),t=parseInt(t%60),60<=i&&(e=parseInt(i/60),i=parseInt(i%60))),t=1===t.toString().length?"0"+t:t,0<=i&&(t=(i=1===i.toString().length?"0"+i:i)+":"+t),0<=e&&(t=e+":"+t),t},formatDate:function(e,t){var i,a={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};for(i in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))),a)ne
1w RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?a[i]:("00"+a[i]).substr((""+a[i]).length)));return t},getDocumentRoot:function(){return window.location.protocol+"//"+document.domain+"/"},getPropNum:function(e){var t,i=0;for(t in e)e.hasOwnProperty(t)&&i++;return i},parseBookShot:function(e,t){t="0"==t?"png":"jpg";return e.replace("http://","https://")+"files/shot."+t},pasreHttps:function(e){return e&&e.replace("http://","https://")},parseHttpsBookShot:function(e,t){t="0"==t?"png":"jpg";return e.replace("http://","https://")+"files/shot."+t},base64Encode:function(e){let t=new TextEncoder,i=t.encode(e),a="";return i.forEach(e=>a+=String.fromCharCode(e)),btoa(a)},base64Decode:function(e){let t=atob(base64),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);let a=new TextDecoder;return a.decode(i)}};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.