![JAR search and dependency download from the Maven repository](/logo.png)
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 is an online document viewer that lets you read documents in your browser, regardless of
whether you have the software that they were created in. You can view many types to word processing documents
(DOC, DOCX, TXT, RTF, ODT), presentations (PPT, PPTX), spreadsheets (XLS, XLSX), portable files (PDF), and image
files (JPG, BMP, GIF, TIFF). For each file, you get a high-fidelity rendering, showing the document just as it
would if you opened it in the software it was created in. Layout and formatting is retained and you see an exact
copy of the original.
GroupDocs.Viewer lets you really read the document. You can search text documents, copy text and even embed the
document РІР‚ GroupDocs.Viewer and all - in a web page. You can print or download the file from
GroupDocs.Viewer if you need to work with it offline.
(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) }, getContentControlDescriptions: function () { return this._viewModel.getContentControlDescriptions() }, navigateToContentControl: function (a) { this._viewModel.navigateToContentControl(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 (F) { var c, d = this.element; this.viewerId = window.groupdocs.viewerId; var b = a.extend({hostUrl: this.applicationPath, docViewerId: "docViewer" + this.viewerId}, F); this.printImageElements = []; window.groupdocs.viewerId++; var I = false; if (F.enableViewerInit) { var f, A = false; if (a.browser.msie) { this.browserIsInternetExplorer = true; if (a.browser.version == 8 || a.browser.version == 9) { I = 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 R = ""; if (!b.showHeader)R = 'style="display: none"'; d.each(function () { a(' Error ').appendTo(a(this)) }) } this.groupdocsViewerWrapper = c = d.find(".groupdocs_viewer_wrapper"); var B = this.viewerHeader = c.find(".viewer_header"), m = this.viewerMainWrapper = c.find(".viewer_mainwrapper"); if (!b.showHeader) { B.height(0); m.css("top", "0") } if (!F.enableViewerInit)return; if (b.filePath == "")b.openThumbnails = false; var K = "#" + b.docViewerId, i = a(K), P = c.find("[name='search_wrapper']"); if (b.useHtmlBasedEngine) { B.find("li[name='openDoublePageFlipViewMenuItem']").hide(); if (!b.supportTextSelection) { f = "." + k + " .html_pages_container{-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}"; a("").appendTo("head"); if (this.browserIsInternetExplorer)i.on("selectstart", function (a) { a.preventDefault(); return true }) } b.supportPageReordering = false } var s, C; if (b.width)s = b.width; else s = d.width(); c.width(s); if (b.height)C = b.height; else C = d.height(); c.height(C); var p = null; if (!b.useHtmlBasedEngine) { p = c.find("[name='selection-content']"); if (p.length == 0)p = a("'").appendTo(c) } var T = c.find("[name='jGDerror']"); T.find(".modal_dialog_overlay").click(function () { T.hide() }); var x = c.find(".navigation-bar"), z = c.find(".zoom_wrappper"), G = c.find(".doc_viewer_wrapper_page_flip"), v = this.fileOpenDialogWrapper = c.find(".fileOpenDialogWrapper"); if (!b.supportTextSelection) { var W = K + " .ui-selectable-helper {display: none;visibility: hidden}"; a("").appendTo("head") } var w; if (b.thumbnailsContainerWidth) { var Z = 203, V = 150, U = 187, M = this.getScrollbarWidth(), u = Math.round(b.thumbnailsContainerWidth), S = (Z - M) / (u - M); w = Math.round(V / S); var X = Math.round(U / S); f = "div.thumbnailsContainer{width:" + u + "px}"; f += "div.thumbnailsContainer ul li img{width:" + w + "px}"; f += "div.thumbnailsContainer ul li{min-width:" + X + "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 + "; fill:" + b.searchHighlightColor + "}"; if (b.currentSearchHighlightColor)f += ".grpdx." + k + " .current_search_highlight {background-color:" + b.currentSearchHighlightColor + "; fill:" + b.currentSearchHighlightColor + "}"; if (b.useEmScaling)f += ".grpdx." + k + " .html_page_contents {transform-origin:initial}"; f && a("").appendTo("head"); function j() { e._localizeElements() } i.bind("onHtmlCreated", j); x.bind("onHtmlCreated", j); z.bind("onHtmlCreated", j); G.bind("onHtmlCreated", j); v.bind("onHtmlCreated", j); var hb = { createHtml: true, viewerElement: i, useCaseSensitiveSearch: b.useCaseSensitiveSearch, searchForSeparateWords: b.searchForSeparateWords, treatPhrasesInDoubleQuotesAsExactPhrases: b.treatPhrasesInDoubleQuotesAsExactPhrases, useHtmlBasedEngine: b.useHtmlBasedEngine, searchIsVisible: b.showSearch, useRtl: b.useRtl, useAccentInsensitiveSearch: b.useAccentInsensitiveSearch, useVirtualScrolling: b.useVirtualScrolling }, db = { createHtml: true, thumbnailWidth: w, quality: 100, useHtmlBasedEngine: b.useHtmlBasedEngine, useHtmlThumbnails: b.useHtmlThumbnails, useInnerThumbnails: b.useInnerThumbnails, supportPageReordering: b.supportPageReordering, use_pdf: b.supportTextSelection ? "true" : "false", ignoreDocumentAbsence: b.ignoreDocumentAbsence, supportPageRotation: b.supportPageRotation, openThumbnails: b.openThumbnails, instanceIdToken: b.instanceIdToken, locale: b.locale }, E; if (b.showThumbnails)E = m; else E = null; var ib = { watermarkText: b.watermarkText, watermarkColor: b.watermarkColor, watermarkPosition: b.watermarkPosition, watermarkWidth: b.watermarkWidth, preventTouchEventsBubbling: b.preventTouchEventsBubbling, searchForSeparateWords: b.searchForSeparateWords, treatPhrasesInDoubleQuotesAsExact: b.treatPhrasesInDoubleQuotesAsExact, usePngImagesForHtmlBasedEngine: b.usePngImagesForHtmlBasedEngine, alwaysOnePageInRow: b.showOnePageInRow || b.viewerStyle == window.groupdocs.OnePageInRow, 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, viewerLayout: b.viewerStyle, useVirtualScrolling: b.useVirtualScrolling, supportListOfContentControls: b.supportListOfContentControls, supportListOfBookmarks: b.supportListOfBookmarks, embedImagesIntoHtmlForWordFiles: b.embedImagesIntoHtmlForWordFiles, instanceIdToken: b.instanceIdToken, browserIsIE9OrLess: I, locale: b.locale }, eb = "onMenuClicked", D = c.find(".viewTypeMenu"), n = { dropDownMenuIsVisible: ko.observable(false), dropDownMenuClicked: false, openScrollView: function () { e.setMultiplePagesInRowLayout() }, openDoublePageFlipView: function () { e.openDoublePageFlipView() }, openOnePageInRowView: function () { e.openOnePageInRowView() }, openTwoPagesInRowView: function () { e.openTwoPagesInRowView() }, openCoverThenTwoPagesInRowView: function () { e.openCoverThenTwoPagesInRowView() }, showDropDownMenu: function (a) { this.dropDownMenuIsVisible(a) }, toggleDropDownMenu: function (b, a) { this.dropDownMenuIsVisible(!this.dropDownMenuIsVisible()); this.dropDownMenuClicked = true; D.trigger(eb); a.stopPropagation() } }, Q = this.viewerAdapter = new DocViewerAdapter({ fileId: b.filePath, fileVersion: "0", quality: b.quality, use_pdf: b.supportTextSelection ? "true" : "false", docSpace: i, _mode: "webComponent", createHtml: true, initialZoom: b.initialZoom, viewerWidth: s, viewerHeight: m.height(), docViewerId: b.docViewerId, zoomToFitWidth: b.zoomToFitWidth, zoomToFitHeight: b.zoomToFitHeight, navigation: x, navigationOptions: {createHtml: true}, thumbnails: E, thumbnailsOptions: db, zooming: z, zoomingOptions: {createHtml: true}, search: P, searchOptions: hb, preloadPagesCount: b.preloadPagesCount, docSpacePageFlip: b.useHtmlBasedEngine || b.viewerStyle == this.viewModes.ScrollMode && !b.showViewerStyleControl ? null : G, usePageNumberInUrlHash: false, selectionContent: p, 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: ib, viewTypeMenu: D, viewTypeViewModel: n, instanceId: this.viewerId }); if (b.showFolderBrowser) { var Y = { 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, instanceIdToken: b.instanceIdToken }; v.fileOpenDialog(Y); v.find(".popclose").click(function () { e._hideFileOpenDialog() }) } j(); var r = d.find(".thumbs_btn"); b.useInnerThumbnails && r.hide(); function N() { b.showThumbnails && b.thumbsImageBase64Encoded != null && r.css("background-image", "url(data:image/png;base64," + b.thumbsImageBase64Encoded + ")").css("background-position", "0 0") } N(); r.click(function () { a(this).toggleClass("thumbs_btn_slide"); d.find(".thumbnailsContainer").toggle(); if (a.browser.msie) { r.css("background-image", ""); N() } 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 = Q.docViewerViewModel.fileDisplayName = ""; Q.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, D.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); B.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 && P.css("display", "none"); function O(e, d, f) { for (var c = ["-moz-", "-webkit-", ""], a = e + "{", b = 0; b < c.length; b++)a += c[b] + d + ":" + f + ";"; a += "}"; return a } var g = ""; if (b.toolbarButtonsBoxShadowStyle) { var J = "box-shadow", y = O(".grpdx .new_head_tools_btn", J, b.toolbarButtonsBoxShadowStyle); g += y; if (b.toolbarButtonsBoxShadowHoverStyle) { y = O(".grpdx .new_head_tools_btn:hover", J, b.toolbarButtonsBoxShadowHoverStyle); g += y } } if (b.thumbnailsContainerBackgroundColor)g += ".grpdx div.thumbnailsContainer{background-color:" + b.thumbnailBackgroundColor + "}\r\n"; if (b.toolbarBorderBottomColor)g += ".grpdx .viewer_header{border-bottom-color:" + b.toolbarBorderBottomColor + "}\r\n"; if (b.thumbnailsContainerBorderRightColor)g += ".grpdx div.thumbnailsContainer{border-right-color:" + b.thumbnailsContainerBorderRightColor + "}\r\n"; if (b.toolbarInputFieldBorderColor)g += ".grpdx .new_head_input{border-color:" + b.toolbarInputFieldBorderColor + "}\r\n"; if (b.toolbarButtonBorderColor)g += ".grpdx .new_head_tools_btn{border-color:" + b.toolbarButtonBorderColor + "}\r\n"; if (b.useInnerThumbnails)g += ".grpdx #" + b.docViewerId + "{display: inline-block}\r\n"; a("").appendTo("head"); i.bind("onDocumentLoadComplete", function (b, a) { e.documentLoadCompleteHandler(a, c, m) }); i.bind("onDocumentLoaded", function (b, a) { e.documentLoadedHandler(a, c, m) }); i.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 l = c.find("[name='jGDerror']"), H = l.find(".modal_dialog_content"), h = l.find(".modal_dialog_content_wrapper"), ab = l.find(".modal_dialog_header"); l.removeClass("jerrorwrapper"); var L = c.find(".viewer_mainwrapper"), jb = false; if (!window.jGDError)window.jGDError = []; window.jGDError[this.viewerId] = function (f) { a(d).trigger("error.groupdocs", f); if (b.enableStandardErrorHandling) { var m = c.find(".btn_download"); m.unbind(); m.bind({ click: function () { e._downloadDocument(); return false } }); f = f.replace(/^[\r\n\s]+|[\r\n\s]+$/g, ""); if (!f)f = "Sorry, we're unable to perform your request right now. Please try again later."; l.css("height", "auto"); ab.text("Error"); var g, i; if (f.substring(0, 1) == "<") { H.html(f); var k = L.width(), j = L.height(); if (k < 100)g = k; else g = k - 100; if (j < 100)i = j; else i = j - 100 } else H.text(f); if (g != undefined) { h.css("margin-left", -g / 2); h.width(g) } i != undefined && h.height(i); l.show(); h.css("margin-left", -h.width() / 2); h.css("margin-top", -h.height() / 2) } }; var q = this.groupdocsViewerWrapper.find("[name='messageDialog']"), gb = q.find("[name='minimizeButton']"), fb = q.find("[name='maximizeButton']"); gb.click(function () { q.addClass("min") }); fb.click(function () { q.removeClass("min") }); var o = this.groupdocsViewerWrapper.find("[name='messageDialogPdf']"), cb = o.find("[name='minimizeButtonPdf']"), bb = o.find("[name='maximizeButtonPdf']"); cb.click(function () { o.addClass("min") }); bb.click(function () { o.removeClass("min") }); this.resizeHandler() }, documentLoadedHandler: function (e, f, g) { this.printFrameLoaded = false; var h = a("body"), c = "printFrame" + this.viewerId, b = h.children("div.groupdocsPrintFrame[name='" + c + "'],div.groupdocsPrintFrameDeactivated[name='" + c + "']"); if (b.length == 0) { b = a(""); b.attr("name", c); b.appendTo(h) } else b.empty(); this.printImageElements.length = 0; var d = e.page_count; if (!e.lic && d > 3)d = 3; for (var i, j = 0; j < d; j++) { i = a("
").appendTo(b); this.printImageElements.push(i) } if (!e.lic && f.find(".licBanner").length == 0) { g.addClass("viewer_mainwrapper_trial"); this.licElement = a(""); this.licElement.addClass("banner_trial"); !this.showHeader && this.licElement.css("top", "0"); var k = this._getLocalizedString("This viewer has been created using an unlicensed version of ", "UnlicensedViewer"); this.licElement.html(k + " GroupDocs.Viewer for Java v2.13.0 "); this.licElement.appendTo(f); !this.showHeader && g.css("top", this.licElement.height() + "px"); this.resizeHandler() } }, 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 () { if (this.showHeader) { var d = this.viewerHeader.outerHeight(true), b = 0; if (this.licElement)b = this.licElement.height(); if (d != this.viewerMainWrapper.position().top - b) { var c = d; if (this.licElement) { this.licElement.css("top", c.toString() + "px"); c += b } this.viewerMainWrapper.css("top", c.toString() + "px"); if (this.viewMode == this.viewModes.BookMode)this.viewerAdapter.docViewerPageFlipViewModel.reInitSelectable(); else this.viewerAdapter.docViewerViewModel.reInitSelectable() } } if (this.useInnerThumbnails) { var a = 0, e = this.viewerAdapter.thumbnailsViewModel; if (e)a = e.getThumbnailsPanelWidth(); if (this.viewMode == this.viewModes.BookMode)this.viewerAdapter.docViewerPageFlipViewModel.resizeViewerElement(a); else this.viewerAdapter.docViewerViewModel.resizeViewerElement(a) } else this.viewerAdapter.docViewerViewModel.loadImagesForVisiblePages(); this._setFitWidthAndHeightValues() }, 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() }, isPageRotationInProgress: !1, _rotatePage: function (e) { var i = this; if (!i.isPageRotationInProgress) { i.isPageRotationInProgress = !0; var o = this._getLocalizedString("Page rotation in progress...", "PageRotationInProgress"), t = this._getLocalizedString("Rotation", "Rotation"), n = this._updateMessageDialog(o, t, 35); n && n.show(), this.viewerAdapter.docViewerViewModel.rotatePage(e, function () { n && n.hide(), i.isPageRotationInProgress = !1 }) } }, 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.search && this.viewerAdapter.searchViewModel.showControls() }, setMultiplePagesInRowLayout: function () { this.openScrollView(); this.viewerAdapter.docViewerViewModel.setLayout(window.groupdocs.ScrollMode); this.viewerAdapter.docViewerViewModel.reInitSelectable(); this._setFitWidthAndHeightValues(); 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.css("display", "inline-block"); this.viewerAdapter.docViewerViewModel.setLayout(window.groupdocs.BookMode); this.viewerAdapter.docViewerPageFlipViewModel.openCurrentPage(); a.css("height", ""); a.css("top", ""); a.css("position", ""); b.hide(); this.viewMode = this.viewModes.BookMode; this.resizeHandler(); this.viewerAdapter.docViewerPageFlipViewModel.reInitSelectable(); this._setFitWidthAndHeightValues(true); this.viewerAdapter.search && this.viewerAdapter.searchViewModel.hideControls() } }, openOnePageInRowView: function () { this.openScrollView(); this.viewerAdapter.docViewerViewModel.setLayout(window.groupdocs.OnePageInRow); this.viewerAdapter.docViewerViewModel.reInitSelectable(); !this.useHtmlBasedEngine && this.viewerAdapter.docViewerViewModel.openCurrentPage() }, openTwoPagesInRowView: function () { this.openScrollView(); this.viewerAdapter.docViewerViewModel.setLayout(window.groupdocs.TwoPagesInRow); this.viewerAdapter.docViewerViewModel.reInitSelectable(); !this.useHtmlBasedEngine && this.viewerAdapter.docViewerViewModel.openCurrentPage() }, openCoverThenTwoPagesInRowView: function () { this.openScrollView(); this.viewerAdapter.docViewerViewModel.setLayout(window.groupdocs.CoverThenTwoPagesInRow); this.viewerAdapter.docViewerViewModel.reInitSelectable(); !this.useHtmlBasedEngine && this.viewerAdapter.docViewerViewModel.openCurrentPage() }, _downloadDocument: function () { this.element.trigger("onGDViewerDownloadButtonClick"); this.element.trigger("downloadButtonClick.groupdocs"); var b = this.downloadUrl; if (b == null) { var c = this._model._portalService._urlSuffix || ""; b = this.applicationPath + "GetFile" + c + "?path=" + this.filePath + "&getPdf=false&useHtmlBasedEngine=false&supportPageRotation=false" } if (this.downloadPdfFile && typeof this.pdfDownloadUrl !== "undefined")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 l = this._getLocalizedString("Printing", "Printing"), d = this._getLocalizedString("Printing", "Printing"); this._showMessageDialogPdf(l, d); var q = this, o = window.open(this.pdfPrintUrl); o.onload = function () { q._hideMessageDialogPdf() } } else { var r = navigator.userAgent.toLowerCase(), p = r.indexOf("android") > -1; p && alert("You seem to use an Android device. Your browser does not support the JavaScript print function."); var h = ""; if (this.fileDisplayName)h = this.fileDisplayName; var b = this; var m = this.useHtmlBasedEngine && !this.useImageBasedPrinting, f = a("body"), e = "printFrame" + this.viewerId, c = f.children("div.groupdocsPrintFrame[name='" + e + "'],div.groupdocsPrintFrameDeactivated[name='" + e + "']"), g = f.children("div.groupdocsPrintFrame,div.groupdocsPrintFrameDeactivated").not(c); g.removeClass("groupdocsPrintFrame"); g.addClass("groupdocsPrintFrameDeactivated"); c.removeClass("groupdocsPrintFrameDeactivated"); c.addClass("groupdocsPrintFrame"); var k = null, i = null, n = this.watermarkPosition, j = null; if (this.printWithWatermark) { k = this.watermarkText; i = this.watermarkColor; j = this.watermarkWidth } if (c.length == 0) { c = a(""); c.attr("name", e); c.appendTo(f) } if (this.printFrameLoaded)window.print(); else { var l = this._getLocalizedString("Getting a printable version of the document", "GettingPrintableVersionOfDocument"), d = this._getLocalizedString("Printing", "Printing"); this._showMessageDialog(l, d, 0); this._model.getPrintableHtml(this.documentPath, m, h, k, i, n, j, this.ignoreDocumentAbsence, this.instanceIdToken, function (l) { b._hideMessageDialog(); var k, g = l.length, h = b._getLocalizedString("Preparing the pages", "PreparingPages"); h += ": "; var f = 0; b._showMessageDialog(h + f + "/" + g, d, 0); for (var m = b.printImageElements.length, e = m; e < g; e++) { var i; i = a("
").appendTo(c); b.printImageElements.push(i) } for (e = 0; e < b.printImageElements.length; e++) { var j; function n() { f++; b._updateMessageDialog(h + f + "/" + g, d, f / g * 100); if (f >= g) { b._hideMessageDialog(); window.print(); b.printFrameLoaded = true } } k = l[e]; j = b.printImageElements[e]; j.load(n).attr("src", k) } }, function () { b._hideMessageDialog() }, this.locale) } } 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() }, _showMessageDialogPdf: function (b, c) { var a = this._updateMessageDialogPdf(b, c); a.show() }, _updateMessageDialogPdf: function (e, f) { var a = this.groupdocsViewerWrapper.find("[name='messageDialogPdf']"), c = a.find(".modal_dialog_content p[name='message']"); c.text(e); var d = a.find(".modal_dialog_header"), b = d.find("span[name='alwaysVisibleTitlePdf']"); b.text(f); return a }, _hideMessageDialogPdf: function () { var a = this.groupdocsViewerWrapper.find("[name='messageDialogPdf']"); a.hide() }, _getLocalizedString: function (d, c) { var b = d; if (this.localizedStrings) { var a = this.localizedStrings[c]; if (a)b = a } return b }, _setFitWidthAndHeightValues: function (e) { if (this.viewerAdapter.zooming) { var d, c, b, a; if (e) { b = this.viewerAdapter.docViewerPageFlipViewModel.getFitWidthZoom(); a = this.viewerAdapter.docViewerPageFlipViewModel.getFitHeightZoom() } else { d = this.groupdocsViewerWrapper.width(); this.viewerAdapter.docViewerViewModel.setContainerWidth(d); c = this.viewerMainWrapper.height(); this.viewerAdapter.docViewerViewModel.setContainerHeight(c); b = this.viewerAdapter.docViewerViewModel.getFitWidthZoom(); a = this.viewerAdapter.docViewerViewModel.getFitHeightZoom() } this.viewerAdapter.zoomViewModel.setFitWidthZoom(b); this.viewerAdapter.zoomViewModel.setFitHeightZoom(a) } }, 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) }, getContentControlDescriptions: function () { return this.viewerAdapter.docViewerViewModel.getContentControlDescriptions() }, navigateToContentControl: function (a) { this.viewerAdapter.docViewerViewModel.navigateToContentControl(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 (j, b, d, i, f, c, g, a, e, k, h, l) { this._portalService.getPrintableHtml(j, b, d, i, f, c, g, a, function (a) { k.apply(this, [a.data]) }, function (a) { h.apply(this, [a]) }, e, l) } }); 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 = 1; window.groupdocs.BookMode = 2; window.groupdocs.OnePageInRow = 3; window.groupdocs.TwoPagesInRow = 4; window.groupdocs.CoverThenTwoPagesInRow = 5; window.groupdocs.FitWidth = -1; window.groupdocs.FitHeight = -2; window.groupdocs.viewerId = 1 })(jQuery);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy