| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <%@ page contentType="text/html;charset=GBK"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme() + "://"
- + request.getServerName() + ":" + request.getServerPort();
- %>
- <html>
- <head>
- <title>在线显示</title>
- <script type="text/javascript" src="/shares/js/jquery-1.9.0.min.js" ></script>
- <script type="text/javascript" src="/shares/js/yw/core/FlexPaper/js/flash.js"></script>
- <script type="text/javascript" src="/shares/js/yw/core/FlexPaper/js/flexpaper_flash.js"></script>
- <style type="text/css">
- #menu1,.l-menu-shadow {
- top: 30px;
- left: 50px;
- }
- #menu1 {
- width: 200px;
- }
- .div_view2{
- text-align:center;
- background-image:url(${attach.path});
- background-position:center;
- background-repeat:no-repeat;
-
- line-height:30px;
- overflow:hidden;
- }
- </style>
- <script>
- $(function() {
- var extendFlag = "${extFiles}";
- var html="";
- // if is image
- if(extendFlag == "jpg") {
-
- $("div.doc-view").removeClass("div_view").addClass("div_view2");
- }
- else if(extendFlag == "gif") {
- $("div.doc-view").removeClass("div_view").addClass("div_view2");
- }
- else if(extendFlag == "png") {
- $("div.doc-view").removeClass("div_view").addClass("div_view2");
- }
-
- // if is office or pdf file doc|docx|ppt|xls|xlsx|txt
- else if(extendFlag == "doc"||extendFlag == "docx"||extendFlag == "xls"||extendFlag == "xlsx"||extendFlag == "ppt"||extendFlag == "txt"||extendFlag == "jsp") {
- if("${attach.flashPath}"==""){
- html += "<div class='alert alert-info'>文档转换失败。</div>";
- $("div.doc-view").html(html);
- }else{
- var path="<%=basePath%>";
-
- initOnlineView(path+"${attach.flashPath}");
- }
- }
- else {
- html += "<div class='alert alert-info'>该文档不能在线浏览。</div>";
- $("div.doc-view").html(html);
- }
- });
- function initOnlineView(startDocument) {
- var fp = new FlexPaperViewer(
- '/shares/js/yw/core/FlexPaper/FlexPaperViewer',
- 'viewerPlaceHolder', { config : {
- SwfFile : escape(startDocument),
- MinZoomSize : 0.2,
- MaxZoomSize : 5,
- InitViewMode : 'Portrait',
- BitmapBasedRendering : false,
- PrintEnabled : false,
- Scale : 1,
- ZoomTransition : 'easeOut',
- ZoomTime : 0.5,
- ZoomInterval : 0.1,
- FitPageOnLoad : false,
- FitWidthOnLoad : false,
- FullScreenAsMaxWindow : false,
- ProgressiveLoading : false,
- MinZoomSize : 0.2,
- MaxZoomSize : 5,
- SearchMatchAll : false,
- ViewModeToolsVisible : true,
- ZoomToolsVisible : true,
- NavToolsVisible : true,
- CursorToolsVisible : true,
- SearchToolsVisible : true,
-
- localeChain: 'zh_CN'
- }});
- }
- </script>
-
- </head>
- <body>
- <div class="wrapper" style="width: 101.5%">
- <input type="hidden" name="flashPath" value="${attach.flashPath}">
- <div id="viewArea" class="doc-view"><a id="viewerPlaceHolder" style="width:100%;height:${h}px;display:block"></a></div>
- </div>
- </body>
- </html>
|