assets.js.installableViewer.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of groupdocs-viewer Show documentation
Show all versions of groupdocs-viewer Show documentation
GroupDocs.Viewer for Java is a powerful document viewer component
that allows you to display over 50 document formats in your Java applications.
The viewer can both rasterize documents and convert them to SVG+HTML+CSS, delivering true-text high-fidelity rendering.
Supported file formats include: Microsoft Office, Microsoft Visio, Microsoft Project, Outlook documents, PDF, AutoCAD, Image files (JPG, BMP, GIF, TIFF, etc.) and many more formats.
(function(a){a.widget("ui.groupdocsViewer",{_viewModel:null,options:{enableViewerInit:true,supportTextSelection:true,resourcePrefix:""},_create:function(){a.extend(this.options,{element:this.element,applicationPath:a.ui.groupdocsViewer.prototype.applicationPath,widgetInstance:this});this._viewModel=this.getViewModel()},getViewModel:function(){if(this._viewModel==null)this._viewModel=this._createViewModel();return this._viewModel},_createViewModel:function(){return new window.groupdocs.groupdocsViewerViewModel(this.options)},on:function(a,b){this.element.on(a,b)},off:function(a,b){this.element.off(a,b)},setWidth:function(a){this._viewModel.setWidth(a)},setHeight:function(a){this._viewModel.setHeight(a)},openNextPage:function(){this._viewModel.openNextPage()},openPreviousPage:function(){this._viewModel.openPreviousPage()},setPage:function(a){this._viewModel.setPage(a)},openFirstPage:function(){this._viewModel.openFirstPage()},openLastPage:function(){this._viewModel.openLastPage()},showFileBrowser:function(){this._viewModel.showFileBrowser()},setViewerMode:function(a){this._viewModel.setViewerMode(a)},zoomIn:function(){this._viewModel.zoomIn()},zoomOut:function(){this._viewModel.zoomOut()},setZoom:function(a){this._viewModel.setZoom(a)},downloadDocument:function(){this._viewModel.downloadDocument()},printDocument:function(){this._viewModel.printDocument()},searchForward:function(d,c,b,a){this._viewModel.searchForward(d,c,b,a)},searchBackward:function(d,c,b,a){this._viewModel.searchBackward(d,c,b,a)},clearSearchValue:function(){this._viewModel.clearSearchValue()},getDocumentPageCount:function(){return this._viewModel.getDocumentPageCount()},loadDocument:function(a){this._viewModel.loadDocument(a)},rotateCurrentPage:function(a){this._viewModel._rotatePage(a)},setLoadingState:function(a){this._viewModel.setLoadingState(a)},destroy:function(){this._viewModel.destroy()}});if(!window.groupdocs)window.groupdocs={};window.groupdocs.groupdocsViewerViewModel=function(b){a.extend(this,b);this._create(b)};a.extend(window.groupdocs.groupdocsViewerViewModel.prototype,{groupdocsViewerWrapper:null,browserIsInternetExplorer:false,resizeTimeoutId:null,viewModes:{ScrollMode:1,BookMode:2},viewMode:null,licElement:null,printImageElements:null,_create:function(a){this._model=new b(a);this._init(a)},_init:function(D){var c,d=this.element;this.viewerId=window.groupdocs.viewerId;var b=a.extend({hostUrl:this.applicationPath,docViewerId:"docViewer"+this.viewerId},D);this.printImageElements=[];window.groupdocs.viewerId++;if(D.enableViewerInit){var f,A=false;if(a.browser.msie){this.browserIsInternetExplorer=true;if(a.browser.version==8)A=true;f=".grpdx input[type='text']::-ms-clear {display: none;}";a("").appendTo("head")}var k="grpdx"+b.docViewerId,e=this,t="";if(e.browserIsInternetExplorer&&b.useHtmlBasedEngine){t=" ie";if(A)t+=" ie8"}var P="";if(!b.showHeader)P='style="display: none"';d.each(function(){a('').appendTo(a(this))})}this.groupdocsViewerWrapper=c=d.find(".groupdocs_viewer_wrapper");var O=this.viewerHeader=c.find(".viewer_header"),i=this.viewerMainWrapper=c.find(".viewer_mainwrapper");if(!b.showHeader){O.height(0);i.css("top","0")}if(!D.enableViewerInit)return;if(b.filePath=="")b.openThumbnails=false;if(b.useHtmlBasedEngine)b.showViewerStyleControl=false;var H="#"+b.docViewerId,l=a(H),M=c.find("[name='search_wrapper']"),r,B;if(b.width)r=b.width;else r=d.width();c.width(r);if(b.height)B=b.height;else B=d.height();c.height(B);var o=null;if(!b.useHtmlBasedEngine){o=c.find("[name='selection-content']");if(o.length==0)o=a("'").appendTo(c)}var R=c.find("[name='jGDerror']");R.find(".modal_dialog_overlay").click(function(){R.hide()});var x=c.find(".navigation-bar"),z=c.find(".zoom_wrappper"),E=c.find(".doc_viewer_wrapper_page_flip"),v=this.fileOpenDialogWrapper=c.find(".fileOpenDialogWrapper");if(!b.supportTextSelection){var U=H+" .ui-selectable-helper {display: none;visibility: hidden}";a("").appendTo("head")}var w;if(b.thumbnailsContainerWidth){var X=203,T=150,S=187,J=this.getScrollbarWidth(),u=Math.round(b.thumbnailsContainerWidth),Q=(X-J)/(u-J);w=Math.round(T/Q);var V=Math.round(S/Q);f="div.thumbnailsContainer{width:"+u+"px}";f+="div.thumbnailsContainer ul li img{width:"+w+"px}";f+="div.thumbnailsContainer ul li{min-width:"+V+"px}";f+=".thumbs_btn_slide{left:"+(u+2)+"px}";a("").appendTo("head")}f="";if(b.searchHighlightColor)f+="."+k+" .search_highlight_html, ."+k+" .search-highlight {background-color:"+b.searchHighlightColor+"}";if(b.currentSearchHighlightColor)f+=".grpdx."+k+" .current_search_highlight {background-color:"+b.currentSearchHighlightColor+"}";if(b.showOnePageInRow)f+=".grpdx."+k+" .doc-page {display:block; margin-left:auto; margin-right:auto;}";if(b.useEmScaling)f+=".grpdx."+k+" .html_page_contents {transform-origin:initial}";f&&a("").appendTo("head");function j(){e._localizeElements()}l.bind("onHtmlCreated",j);x.bind("onHtmlCreated",j);z.bind("onHtmlCreated",j);E.bind("onHtmlCreated",j);v.bind("onHtmlCreated",j);var db={createHtml:true,viewerElement:l,useCaseSensitiveSearch:b.useCaseSensitiveSearch,searchForSeparateWords:b.searchForSeparateWords,treatPhrasesInDoubleQuotesAsExactPhrases:b.treatPhrasesInDoubleQuotesAsExactPhrases,useHtmlBasedEngine:b.useHtmlBasedEngine,searchIsVisible:b.showSearch,useRtl:b.useRtl,useAccentInsensitiveSearch:b.useAccentInsensitiveSearch},Z={createHtml:true,thumbnailWidth:w,quality:100,useHtmlBasedEngine:b.useHtmlBasedEngine&&b.useHtmlThumbnails,useInnerThumbnails:b.useInnerThumbnails,supportPageReordering:b.supportPageReordering,use_pdf:b.supportTextSelection?"true":"false",supportPageRotation:b.supportPageRotation},s;if(b.showThumbnails)if(b.useInnerThumbnails)s=i;else s=i;else s=null;var eb={watermarkText:b.watermarkText,watermarkColor:b.watermarkColor,watermarkPosition:b.watermarkPosition,watermarkWidth:b.watermarkFontSize,preventTouchEventsBubbling:b.preventTouchEventsBubbling,searchForSeparateWords:b.searchForSeparateWords,treatPhrasesInDoubleQuotesAsExact:b.treatPhrasesInDoubleQuotesAsExact,usePngImagesForHtmlBasedEngine:b.usePngImagesForHtmlBasedEngine,alwaysOnePageInRow:b.showOnePageInRow,onlyShrinkLargePages:b.onlyShrinkLargePages,loadAllPagesOnSearch:b.loadAllPagesOnSearch,useEmScaling:b.useEmScaling,convertWordDocumentsCompletely:b.convertWordDocumentsCompletely,ignoreDocumentAbsence:b.ignoreDocumentAbsence,usePdf:b.supportTextSelection,preloadPagesOnBrowserSide:b.preloadPagesOnBrowserSide,supportPageRotation:b.supportPageRotation,useAccentInsensitiveSearch:b.useAccentInsensitiveSearch,useRtl:b.useRtl},ab="onMenuClicked",C=c.find(".viewTypeMenu"),n={dropDownMenuIsVisible:ko.observable(false),dropDownMenuClicked:false,openScrollView:function(){e.openScrollView()},openDoublePageFlipView:function(){e.openDoublePageFlipView()},showDropDownMenu:function(a){this.dropDownMenuIsVisible(a)},toggleDropDownMenu:function(b,a){this.dropDownMenuIsVisible(!this.dropDownMenuIsVisible());this.dropDownMenuClicked=true;C.trigger(ab);a.stopPropagation()}},N=this.viewerAdapter=new DocViewerAdapter({fileId:b.filePath,fileVersion:"0",quality:b.quality,use_pdf:b.supportTextSelection?"true":"false",docSpace:l,_mode:"webComponent",createHtml:true,initialZoom:b.initialZoom,viewerWidth:r,viewerHeight:i.height(),docViewerId:b.docViewerId,zoomToFitWidth:b.zoomToFitWidth,zoomToFitHeight:b.zoomToFitHeight,navigation:x,navigationOptions:{createHtml:true},thumbnails:s,thumbnailsOptions:Z,zooming:z,zoomingOptions:{createHtml:true},search:M,searchOptions:db,preloadPagesCount:b.preloadPagesCount,docSpacePageFlip:b.useHtmlBasedEngine||b.viewerStyle==this.viewModes.ScrollMode&&!b.showViewerStyleControl?null:E,viewerStyle:b.viewerStyle,usePageNumberInUrlHash:false,selectionContent:o,imageHorizontalMargin:14,imageVerticalMargin:14,useJavaScriptDocumentDescription:true,searchPartialWords:true,variableHeightPageSupport:true,textSelectionSynchronousCalculation:false,minimumImageWidth:b.minimumImageWidth,fileDisplayName:b.fileDisplayName,pageContentType:b.useHtmlBasedEngine?"html":"image",searchExactText:b.searchExactText,viewerOptions:eb,viewTypeMenu:C,viewTypeViewModel:n});if(b.showFolderBrowser){var W={hostUrl:b.hostUrl,userId:b.userId,userKey:b.userKey,fileExplorer:c.find(".file_browser_content"),fileUploader:c.find(".file_browser_toolbar"),resourcePrefix:b.resourcePrefix,urlHashEnabled:false};v.fileOpenDialog(W);v.find(".popclose").click(function(){e._hideFileOpenDialog()})}j();var q=d.find(".thumbs_btn");b.useInnerThumbnails&&q.hide();function K(){b.showThumbnails&&b.thumbsImageBase64Encoded!=null&&q.css("background-image","url(data:image/png;base64,"+b.thumbsImageBase64Encoded+")").css("background-position","0 0")}K();q.click(function(){a(this).toggleClass("thumbs_btn_slide");d.find(".thumbnailsContainer").toggle();if(a.browser.msie){q.css("background-image","");K()}return false});c.find(".btnOpen").click(function(){e._showFileOpenDialog()});c.find("[name=rotateClockwise]").click(function(){e._rotatePage(90)});c.find("[name=rotateCounterClockwise]").click(function(){e._rotatePage(-90)});c.find(".file_browser_content").bind("fileSelected",function(b,a){e._hideFileOpenDialog();e.fileDisplayName=N.docViewerViewModel.fileDisplayName="";N.docViewerViewModel.loadDocument(a.guid)});if(b.showThumbnails&&b.openThumbnails){d.find(".thumbs_btn").addClass("thumbs_btn_slide");d.find(".thumbnailsContainer").css("display","block")}ko.applyBindings(n,C.get(0));a("html").click(function(){e.viewerAdapter.zoomViewModel&&e.viewerAdapter.zoomViewModel.showDropDownMenu(false);n.showDropDownMenu(false)});if(b.backgroundColor){d.find(".groupdocs_viewer_wrapper").css("background-color",b.backgroundColor);O.css("background-color",b.backgroundColor);d.find(".new_head_input").css("background-color",b.backgroundColor);d.find(".new_head_tools_wrapper").css("background-color",b.backgroundColor).css("box-shadow","none");d.find(".thumbs_btn").css("background-color",b.backgroundColor)}d.find(".btnOpen").css("display",b.showFolderBrowser?"":"none");d.find(".navigation-bar").css("display",b.showPaging?"":"none");z.css("display",b.showZoom?"":"none");d.find(".btn_download").css("display",b.showDownload?"":"none");d.find(".print_button").css("display",b.showPrint?"":"none");d.find(".viewTypeMenu").css("display",b.showViewerStyleControl?"":"none");b.showPrint===false&&b.showDownload===false&&d.find("[name='printAndDownloadToolbar']").css("display","none");b.showSearch===false&&M.css("display","none");function L(e,d,f){for(var c=["-moz-","-webkit-",""],a=e+"{",b=0;b"+g+"").appendTo("head");l.bind("onDocumentLoadComplete",function(b,a){e.documentLoadCompleteHandler(a,c,i)});l.bind("onDocumentLoaded",function(b,a){e.documentLoadedHandler(a,c,i)});l.bind("isDocumentSinglePaged.groupdocs",function(b,a){e.documentSinglePagedHandler(a,x)});if(b.viewerStyle==this.viewModes.BookMode)n.openDoublePageFlipView();else this.viewMode=this.viewModes.ScrollMode;var m=c.find("[name='jGDerror']"),F=m.find(".modal_dialog_content"),h=m.find(".modal_dialog_content_wrapper"),Y=m.find(".modal_dialog_header");m.removeClass("jerrorwrapper");var I=c.find(".viewer_mainwrapper"),fb=false;window.jGDError=function(c){a(d).trigger("error.groupdocs",c);if(b.enableStandardErrorHandling){c=c.replace(/^[\r\n\s]+|[\r\n\s]+$/g,"");if(!c)c="Sorry, we're unable to perform your request right now. Please try again later.";m.css("height","auto");Y.text("Error");var e,f;if(c.substring(0,1)=="<"){F.html(c);var i=I.width(),g=I.height();if(i<100)e=i;else e=i-100;if(g<100)f=g;else f=g-100}else F.text(c);if(e!=undefined){h.css("margin-left",-e/2);h.width(e)}f!=undefined&&h.height(f);m.show();h.css("margin-left",-h.width()/2);h.css("margin-top",-h.height()/2)}};var p=this.groupdocsViewerWrapper.find("[name='messageDialog']"),cb=p.find("[name='minimizeButton']"),bb=p.find("[name='maximizeButton']");cb.click(function(){p.addClass("min")});bb.click(function(){p.removeClass("min")});this.resizeHandler()},documentLoadedHandler:function(i,d,e){this.printFrameLoaded=false;var f=a("body"),c="printFrame"+this.viewerId,b=f.children("div.groupdocsPrintFrame[name='"+c+"'],div.groupdocsPrintFrameDeactivated[name='"+c+"']");if(b.length==0){b=a("");b.attr("name",c);b.appendTo(f)}else b.empty();this.printImageElements.length=0;for(var j=i.page_count,g,h=0;h ").appendTo(b);this.printImageElements.push(g)}if(!i.lic&&d.find(".licBanner").length==0){e.addClass("viewer_mainwrapper_trial");this.licElement=a("");this.licElement.addClass("banner_trial");!this.showHeader&&this.licElement.css("top","0");this.licElement.html("This viewer has been created using an unlicensed version of GroupDocs.Viewer for Java ");this.licElement.appendTo(d);!this.showHeader&&e.css("top",this.licElement.height()+"px")}},documentLoadCompleteHandler:function(a,b){var e=this;this.showImageWidth&&alert("Image width: "+a.page_size.Width);this.downloadUrl=a.url;this.pdfDownloadUrl=a.pdfDownloadUrl;this.pdfPrintUrl=a.pdfPrintUrl;this.documentPath=a.guid;var c=b.find(".btn_download"),d=b.find(".print_button");c.unbind();d.unbind();c.bind({click:function(){e._downloadDocument();return false}});d.bind({click:function(){e._printDocument();return false}})},documentSinglePagedHandler:function(b,a){if(this.showPaging)if(b)a.hide();else a.show()},_localizeElements:function(){var b=this;this.localizedStrings!=null&&b.element.find("[data-localize],[data-localize-ph],[data-localize-tooltip]").each(function(){var e=a(this),c=e.attr("data-localize"),d;if(c){d=b.localizedStrings[c];e.text(d)}else{c=e.attr("data-localize-ph");if(c){d=b.localizedStrings[c];e.attr("placeholder",d)}else{c=e.attr("data-localize-tooltip");if(c){d=b.localizedStrings[c];e.attr("data-tooltip",d)}}}})},getScrollbarWidth:function(){var c=null,d=a("").css("width","100px").css("height","100px").css("overflow","scroll").css("position","absolute").css("top","-9999px"),b=d[0];document.body.appendChild(b);c=b.offsetWidth-b.clientWidth;document.body.removeChild(b);return c},resizeHandler:function(){var c=false;if(this.showHeader){var a=this.viewerHeader.outerHeight(true);if(a!=this.viewerMainWrapper.position().top){var b=a.toString()+"px";this.viewerMainWrapper.css("top",b);this.licElement&&this.licElement.css("top",b);if(this.viewMode==this.viewModes.ScrollMode)this.viewerAdapter.docViewerViewModel.reInitSelectable();else this.viewerAdapter.docViewerPageFlipViewModel.reInitSelectable();c=true}}if(this.viewMode==this.viewModes.ScrollMode&&this.useInnerThumbnails)this.viewerAdapter.docViewerViewModel.resizeViewerElement();else this.viewerAdapter.docViewerViewModel.loadImagesForVisiblePages()},resizeHandlerWithDelay:function(){this.resizeTimeoutId&&clearTimeout(this.resizeTimeoutId);var a=this;this.resizeTimeoutId=window.setTimeout(function(){a.resizeHandler()},1e3)},setWidth:function(a){this.groupdocsViewerWrapper.width(a);this.resizeHandler();this.resizeHandlerWithDelay()},setHeight:function(a){this.groupdocsViewerWrapper.height(a);this.resizeHandler();this.resizeHandlerWithDelay()},_showFileOpenDialog:function(){var b=this;this.fileOpenDialogWrapper.addClass("in");this.fileOpenDialogWrapper.show();this.backdrop=a('').appendTo(this.groupdocsViewerWrapper),this.backdrop.click(function(){b._hideFileOpenDialog()});this.backdrop.addClass("in")},_hideFileOpenDialog:function(){this.backdrop.removeClass("in");this.backdrop.remove();this.fileOpenDialogWrapper.hide()},_rotatePage:function(a){this.viewerAdapter.docViewerViewModel.rotatePage(a)},openScrollView:function(){var b=this.groupdocsViewerWrapper.find(".doc_viewer"),a=this.groupdocsViewerWrapper.find(".doc_viewer_wrapper_page_flip");a.css("position","absolute");a.css("height","100%");a.hide();b.show();this.viewerAdapter.docViewerViewModel.openCurrentPage();this.viewerAdapter.docViewerViewModel.reInitSelectable();if(this.viewerAdapter.zooming){this.viewerAdapter.zoomViewModel.setFitWidthZoom(this.viewerAdapter.docViewerViewModel.getFitWidthZoom());this.viewerAdapter.zoomViewModel.setFitHeightZoom(this.viewerAdapter.docViewerViewModel.getFitHeightZoom())}this.viewerAdapter.search&&this.viewerAdapter.searchViewModel.showControls();this.viewMode=this.viewModes.ScrollMode},openDoublePageFlipView:function(){if(!this.useHtmlBasedEngine){var b=this.groupdocsViewerWrapper.find(".doc_viewer"),a=this.groupdocsViewerWrapper.find(".doc_viewer_wrapper_page_flip");a.show();this.viewerAdapter.docViewerPageFlipViewModel.openCurrentPage();a.css("height","");a.css("top","");a.css("position","");b.hide();this.viewerAdapter.docViewerPageFlipViewModel.reInitSelectable();if(this.viewerAdapter.zooming){this.viewerAdapter.zoomViewModel.setFitWidthZoom(this.viewerAdapter.docViewerPageFlipViewModel.getFitWidthZoom());this.viewerAdapter.zoomViewModel.setFitHeightZoom(this.viewerAdapter.docViewerPageFlipViewModel.getFitHeightZoom())}this.viewerAdapter.search&&this.viewerAdapter.searchViewModel.hideControls();this.viewMode=this.viewModes.BookMode}},_downloadDocument:function(){this.element.trigger("onGDViewerDownloadButtonClick");this.element.trigger("downloadButtonClick.groupdocs");var b=this.downloadUrl;if(this.downloadPdfFile)b=this.pdfDownloadUrl;if(this.showDownloadErrorsInPopup)a.fileDownload(b,{failCallback:function(a){window.jGDError(a)},cookieName:self.jqueryFileDownloadCookieName,containerElement:this.groupdocsViewerWrapper});else window.location.href=b;return false},_printDocument:function(){if(this.usePdfPrinting)var p=window.open(this.pdfPrintUrl);else{var i="";if(this.fileDisplayName)i=this.fileDisplayName;var b=this;var l=this.useHtmlBasedEngine&&!this.useImageBasedPrinting,e=a("body"),d="printFrame"+this.viewerId,c=e.children("div.groupdocsPrintFrame[name='"+d+"'],div.groupdocsPrintFrameDeactivated[name='"+d+"']"),h=e.children("div.groupdocsPrintFrame,div.groupdocsPrintFrameDeactivated").not(c);h.removeClass("groupdocsPrintFrame");h.addClass("groupdocsPrintFrameDeactivated");c.removeClass("groupdocsPrintFrameDeactivated");c.addClass("groupdocsPrintFrame");var k=null,j=null,m=this.watermarkPosition,g=null;if(this.printWithWatermark){k=this.watermarkText;j=this.watermarkColor;g=this.watermarkFontSize}if(c.length==0){c=a("");c.attr("name",d);c.appendTo(e)}if(this.printFrameLoaded)window.print();else{var n=this._getLocalizedString("Getting a printable version of the document","GettingPrintableVersionOfDocument"),f=this._getLocalizedString("Printing","Printing");this._showMessageDialog(n,f,0);this._model.getPrintableHtml(this.documentPath,l,i,k,j,m,g,function(l){b._hideMessageDialog();var k,g=l.length,h=b._getLocalizedString("Preparing the pages","PreparingPages");h+=": ";var e=0;b._showMessageDialog(h+e+"/"+g,f,0);for(var m=b.printImageElements.length,d=m;d ").appendTo(c);b.printImageElements.push(i)}for(d=0;d=g){window.print();b.printFrameLoaded=true;b._hideMessageDialog()}}k=l[d];j=b.printImageElements[d];j.load(n).attr("src",k)}},function(){b._hideMessageDialog()})}}return false},_showMessageDialog:function(c,d,b){var a=this._updateMessageDialog(c,d,b);a.show()},_updateMessageDialog:function(i,j,d){var a=this.groupdocsViewerWrapper.find("[name='messageDialog']"),h=a.find(".modal_dialog_content p[name='message']");h.text(i);var c=a.find(".modal_dialog_header"),e=c.find("span[name='alwaysVisibleTitle']");e.text(j);var g=a.find(".progress");if(typeof d!="undefined"){var b=Math.round(d)+"%";g.css("width",b);var f=c.find("span[name='visibleWhenMinimizedTitle']");f.text(b)}return a},_hideMessageDialog:function(){var a=this.groupdocsViewerWrapper.find("[name='messageDialog']");a.hide()},_getLocalizedString:function(d,c){var b=d;if(this.localizedStrings){var a=this.localizedStrings[c];if(a)b=a}return b},openNextPage:function(){this.viewerAdapter.navigationViewModel.down()},openPreviousPage:function(){this.viewerAdapter.navigationViewModel.up()},setPage:function(a){this.viewerAdapter.navigationViewModel.selectPage(a)},openFirstPage:function(){this.viewerAdapter.navigationViewModel.openFirstPage()},openLastPage:function(){this.viewerAdapter.navigationViewModel.openLastPage()},showFileBrowser:function(){this._showFileOpenDialog()},setViewerMode:function(a){if(a==0)this.openScrollView();else this.openDoublePageFlipView()},zoomIn:function(){this.viewerAdapter.zoomViewModel.zoomIn()},zoomOut:function(){this.viewerAdapter.zoomViewModel.zoomOut()},setZoom:function(b){var a=b;switch(b){case window.groupdocs.FitWidth:a=this.viewerAdapter.zoomViewModel.getFitWidthZoomValue();break;case window.groupdocs.FitHeight:a=this.viewerAdapter.zoomViewModel.getFitHeightZoomValue()}this.viewerAdapter.zoomViewModel.setZoom({value:a})},downloadDocument:function(){this._downloadDocument()},printDocument:function(){this._printDocument()},searchForward:function(a,d,c,b){if(this.viewerAdapter.searchViewModel.searchValue()!=a)this.viewerAdapter.searchViewModel.searched=false;this.viewerAdapter.searchViewModel.searchValue(a);this.viewerAdapter.searchViewModel.findNext(d,c,b)},searchBackward:function(a,d,c,b){if(this.viewerAdapter.searchViewModel.searchValue()!=a)this.viewerAdapter.searchViewModel.searched=false;this.viewerAdapter.searchViewModel.searchValue(a);this.viewerAdapter.searchViewModel.findPrevious(d,c,b)},clearSearchValue:function(){this.viewerAdapter.searchViewModel.clearValue()},getDocumentPageCount:function(){return this.viewerAdapter.docViewerViewModel.pageCount()},loadDocument:function(a){this.viewerAdapter.docViewerViewModel.loadDocument(a)},setLoadingState:function(a){this.viewerAdapter.docViewerViewModel.setLoadingState(a)},destroy:function(){var b=this.groupdocsViewerWrapper.find(".doc_viewer_wrapper_page_flip .pages_container_flip");b.length!=0&&b.turn("is")&&b.turn("destroy");this.groupdocsViewerWrapper.remove();a.Widget.prototype.destroy.call(this.widgetInstance)}});var b=function(b){a.extend(this,b);this._init()};a.extend(b.prototype,{_portalService:null,_init:function(){this._portalService=Container.Resolve("PortalService")},getPrintableHtml:function(h,a,d,g,e,c,b,i,f){this._portalService.getPrintableHtml(h,a,d,g,e,c,b,function(a){i.apply(this,[a.data])},function(a){f.apply(this,[a])})}});a.support.cors=true;if(!jQuery.browser){jQuery.browser={};(function(){jQuery.browser.msie=false;jQuery.browser.version=0;if(navigator.appName=="Microsoft Internet Explorer"){if(navigator.userAgent.match(/MSIE ([0-9]+)\./)){jQuery.browser.msie=true;jQuery.browser.version=RegExp.$1}}else if(navigator.appName=="Netscape"){var b=navigator.userAgent,a=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})");if(a.exec(b)!=null){jQuery.browser.msie=true;jQuery.browser.version=RegExp.$1}}})()}window.groupdocs.ScrollMode=0;window.groupdocs.BookMode=1;window.groupdocs.FitWidth=-1;window.groupdocs.FitHeight=-2;window.groupdocs.viewerId=1})(jQuery);