Browse Source

移除前端commonHeader.ftl中多余的依赖

pull/41/MERGE
陈精华 2 years ago
parent
commit
9ceb052eb4
No known key found for this signature in database
GPG Key ID: 30BDC970902B755D
  1. 1
      server/src/main/resources/static/highlight/default.min.css
  2. 1326
      server/src/main/resources/static/highlight/highlight.min.js
  3. 6
      server/src/main/resources/web/code.ftl
  4. 49
      server/src/main/resources/web/commonHeader.ftl
  5. 6
      server/src/main/resources/web/compress.ftl
  6. 2
      server/src/main/resources/web/flv.ftl
  7. 4
      server/src/main/resources/web/markdown.ftl
  8. 4
      server/src/main/resources/web/media.ftl
  9. 1
      server/src/main/resources/web/ofd.ftl
  10. 2
      server/src/main/resources/web/officePicture.ftl
  11. 1
      server/src/main/resources/web/pdf.ftl
  12. 2
      server/src/main/resources/web/picture.ftl
  13. 2
      server/src/main/resources/web/ppt.ftl
  14. 9
      server/src/main/resources/web/svg.ftl
  15. 3
      server/src/main/resources/web/tiff.ftl
  16. 126
      server/src/main/resources/web/txt.ftl
  17. 2
      server/src/main/resources/web/xml.ftl

1
server/src/main/resources/static/highlight/default.min.css vendored

@ -0,0 +1 @@
.hljs{display:block;overflow-x:auto;padding:.5em;background:#f0f0f0}.hljs,.hljs-subst{color:#444}.hljs-comment{color:#888}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#bc6060}.hljs-literal{color:#78a960}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}

1326
server/src/main/resources/static/highlight/highlight.min.js vendored

File diff suppressed because one or more lines are too long

6
server/src/main/resources/web/code.ftl

@ -5,10 +5,12 @@
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<title>代码预览</title>
<#include "*/commonHeader.ftl">
<script src="js/jquery-3.6.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/highlight.min.js"></script>
<link rel="stylesheet" href="highlight/default.min.css">
<script src="highlight/highlight.min.js" type="text/javascript"></script>
<script src="js/base64.min.js" type="text/javascript"></script>
<script>hljs.highlightAll()</script>
<style>

49
server/src/main/resources/web/commonHeader.ftl

@ -1,10 +1,6 @@
<#setting classic_compatible=true>
<link rel="icon" href="./favicon.ico" type="image/x-icon">
<script src="js/jquery-3.6.1.min.js" type="text/javascript"></script>
<script src="js/jquery.form.min.js" type="text/javascript"></script>
<script src="js/bootbox.min.js" type="text/javascript"></script>
<script src="js/watermark.js" type="text/javascript"></script>
<script src="js/base64.min.js" type="text/javascript"></script>
<script>
/**
@ -31,51 +27,6 @@
});
}
}
// 中文环境
var locale_zh_CN = {
OK: '确定',
CONFIRM: '确认',
CANCEL: '取消'
};
bootbox.addLocale('locale_zh_CN', locale_zh_CN);
/**
* 需要文件密码
*/
function needFilePassword() {
if ('${needFilePassword}' == 'true') {
let promptTitle = "你正在预览加密文件,请输入文件密码。";
if ('${filePasswordError}' == 'true') {
promptTitle = "密码错误,请重新输入密码。";
}
bootbox.prompt({
title: promptTitle,
inputType: 'password',
centerVertical: true,
locale: 'locale_zh_CN',
callback: function (filePassword) {
if (filePassword != null) {
const locationHref = window.location.href;
const isInclude = locationHref.includes("filePassword=");
let redirectUrl = null;
if (isInclude) {
const url = new URL(locationHref);
url.searchParams.set("filePassword", filePassword);
redirectUrl = url.href;
} else {
redirectUrl = locationHref + '&filePassword=' + filePassword;
}
window.location.replace(redirectUrl);
} else {
location.reload();
}
}
});
}
}
</script>
<style>

6
server/src/main/resources/web/compress.ftl

@ -4,8 +4,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<link href="css/zTreeStyle.css" rel="stylesheet" type="text/css">
<#include "*/commonHeader.ftl">
<script src="js/jquery-3.6.1.min.js" type="text/javascript"></script>
<link href="css/zTreeStyle.css" rel="stylesheet" type="text/css">
<script src="js/base64.min.js" type="text/javascript"></script>
<style type="text/css">
body {
background-color: #404040;
@ -103,4 +105,4 @@
}
</script>
</body>
</html>
</html>

2
server/src/main/resources/web/flv.ftl

@ -3,8 +3,8 @@
<head>
<meta charset="utf-8" />
<title>多媒体文件预览</title>
<script src="js/flv.min.js" type="text/javascript"></script>
<#include "*/commonHeader.ftl">
<script src="js/flv.min.js" type="text/javascript"></script>
</head>
<style>
body {

4
server/src/main/resources/web/markdown.ftl

@ -4,10 +4,12 @@
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<title>markdown文本预览</title>
<#include "*/commonHeader.ftl">
<script src="js/jquery-3.6.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/marked.min.js" type="text/javascript"></script>
<#include "*/commonHeader.ftl">
<script src="js/base64.min.js" type="text/javascript"></script>
</head>
<body>
<input hidden id="textData" value="${textData}"/>

4
server/src/main/resources/web/media.ftl

@ -3,9 +3,9 @@
<head>
<meta charset="utf-8"/>
<title>多媒体文件预览</title>
<#include "*/commonHeader.ftl">
<link rel="stylesheet" href="plyr/plyr.css"/>
<script type="text/javascript" src="plyr/plyr.js"></script>
<#include "*/commonHeader.ftl">
<style>
body {
background-color: #404040;
@ -30,4 +30,4 @@
}
</script>
</body>
</html>
</html>

1
server/src/main/resources/web/ofd.ftl

@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<title>OFD预览</title>
<#include "*/commonHeader.ftl">
<script src="js/base64.min.js" type="text/javascript"></script>
</head>
<body>

2
server/src/main/resources/web/officePicture.ftl

@ -3,8 +3,8 @@
<head>
<meta charset="utf-8" />
<title>PDF图片预览</title>
<script src="js/lazyload.js"></script>
<#include "*/commonHeader.ftl">
<script src="js/lazyload.js"></script>
<style>
body {
background-color: #404040;

1
server/src/main/resources/web/pdf.ftl

@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<title>PDF预览</title>
<#include "*/commonHeader.ftl">
<script src="js/base64.min.js" type="text/javascript"></script>
</head>
<body>

2
server/src/main/resources/web/picture.ftl

@ -3,9 +3,9 @@
<head>
<meta charset="utf-8" />
<title>图片预览</title>
<#include "*/commonHeader.ftl">
<link rel="stylesheet" href="css/viewer.min.css">
<script src="js/viewer.min.js"></script>
<#include "*/commonHeader.ftl">
<style>
body {
background-color: #404040;

2
server/src/main/resources/web/ppt.ftl

@ -4,10 +4,10 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<#include "*/commonHeader.ftl">
<link href="pptx/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="pptx/idocv/idocv_common.min.css" rel="stylesheet">
<link href="pptx/jquery.contextMenu.css" rel="stylesheet">
<#include "*/commonHeader.ftl">
<#-- 手机端预览兼容 -->
<script type="text/javascript">
var windowWidth = document.documentElement.clientWidth;

9
server/src/main/resources/web/svg.ftl

@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<#include "*/commonHeader.ftl">
<script src="js/svg-pan-zoom.js"></script>
<script src="js/base64.min.js"></script>
<#if currentUrl?contains("http://") || currentUrl?contains("https://") || currentUrl?contains("ftp://")>
<#assign finalUrl="${currentUrl}">
<#else>
@ -16,17 +17,17 @@
<div id="container">
</div>
<script type="text/javascript">
var url = '${finalUrl}';
var baseUrl = '${baseUrl}'.endsWith('/') ? '${baseUrl}' : '${baseUrl}' + '/';
if (!url.startsWith(baseUrl)) {
url = baseUrl + 'getCorsFile?urlPath=' + encodeURIComponent(Base64.encode(url));
}
function createNewEmbed(src){
var lastEventListener = null;
var gaodu1 =$(document).height();
var gaodu=gaodu1-5;
var gaodu=gaodu1-5;
var embed = document.createElement('embed');
embed.setAttribute('style', 'width: 99%; height: '+gaodu+'px; border:1px solid black;');
embed.setAttribute('type', 'image/svg+xml');
@ -48,4 +49,4 @@
}
</script>
</body>
</html>
</html>

3
server/src/main/resources/web/tiff.ftl

@ -3,9 +3,10 @@
<head>
<meta charset="utf-8"/>
<title>Tiff 图片预览</title>
<#include "*/commonHeader.ftl">
<link rel="stylesheet" href="css/viewer.min.css">
<script src="js/UTIF.js"></script>
<#include "*/commonHeader.ftl">
<script src="js/base64.min.js" type="text/javascript"></script>
<#if currentUrl?contains("http://") || currentUrl?contains("https://") || currentUrl?contains("file://")|| currentUrl?contains("ftp://")>
<#assign finalUrl="${currentUrl}">
<#else>

126
server/src/main/resources/web/txt.ftl

@ -4,37 +4,39 @@
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<title>${file.name}普通文本预览</title>
<#include "*/commonHeader.ftl">
<script src="js/jquery-3.6.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<#include "*/commonHeader.ftl">
<script src="js/base64.min.js" type="text/javascript"></script>
</head>
<body>
<input hidden id="textData" value="${textData}"/>
<#if "${file.suffix?html}" == "txt" || "${file.suffix?html}" == "log" || "${file.suffix?html}" == "TXT" || "${file.suffix?html}" == "LOG">
<style type="text/css">
DIV.black {
DIV.black {
line-height:25px;
PADDING-RIGHT: 1px; PADDING-LEFT: 1px; FONT-SIZE: 100%;
MARGIN: 1px; COLOR: #fff;
MARGIN: 1px; COLOR: #fff;
BACKGROUND-COLOR: #000; TEXT-ALIGN: left ;
}
DIV.black A {
BORDER-RIGHT: #909090 1px solid; PADDING-RIGHT: 5px;
}
DIV.black A {
BORDER-RIGHT: #909090 1px solid; PADDING-RIGHT: 5px;
BACKGROUND-POSITION: 50% bottom; BORDER-TOP: #909090 1px solid;
PADDING-LEFT: 5px; BACKGROUND-IMAGE: url(); PADDING-BOTTOM: 2px;
BORDER-LEFT: #909090 1px solid; COLOR: #fff; MARGIN-RIGHT: 3px;
PADDING-TOP: 2px; BORDER-BOTTOM: #909090 1px solid; TEXT-DECORATION: none
}
DIV.black A:hover {
PADDING-TOP: 2px; BORDER-BOTTOM: #909090 1px solid; TEXT-DECORATION: none
}
DIV.black A:hover {
BORDER-RIGHT: #f0f0f0 1px solid; BORDER-TOP: #f0f0f0 1px solid;
BACKGROUND-IMAGE: BORDER-LEFT: #f0f0f0 1px solid;
COLOR: #ffffff; BORDER-BOTTOM: #f0f0f0 1px solid; BACKGROUND-COLOR: #404040
}
DIV.black A:active {
BORDER-RIGHT: #f0f0f0 1px solid; BORDER-TOP: #f0f0f0 1px solid;
BACKGROUND-IMAGE: BORDER-LEFT: #f0f0f0 1px solid;
COLOR: #ffffff; BORDER-BOTTOM: #f0f0f0 1px solid; BACKGROUND-COLOR: #404040
}
COLOR: #ffffff; BORDER-BOTTOM: #f0f0f0 1px solid; BACKGROUND-COLOR: #404040
}
DIV.black A:active {
BORDER-RIGHT: #f0f0f0 1px solid; BORDER-TOP: #f0f0f0 1px solid;
BACKGROUND-IMAGE: BORDER-LEFT: #f0f0f0 1px solid;
COLOR: #ffffff; BORDER-BOTTOM: #f0f0f0 1px solid; BACKGROUND-COLOR: #404040
}
.divContent
{
color:#fff;
@ -51,7 +53,7 @@ line-height:30px;
background-color: #000;
}
</style>
<div class="container">
<div class="panel panel-default">
@ -64,7 +66,7 @@ line-height:30px;
</div>
<div class="panel-body">
<div id="divPagenation" class="black" >
</div>
<div id="divContent" class="panel-body">
</div>
@ -72,7 +74,7 @@ line-height:30px;
</div>
</div>
<script type="text/javascript">
var base64data = $("#textData").val()
var s = Base64.decode(base64data);
@ -87,7 +89,7 @@ line-height:30px;
//将img标签替换为❈
imgContent = s.replace(imgReg,"❈");
}
// 封装DHTMLpagenation
function DHTMLpagenation(content)
{
@ -146,7 +148,7 @@ line-height:30px;
{
try
{
//创建每页显示内容的消息的DIV
//创建每页显示内容的消息的DIV
divDisplayContent=document.createElement("DIV");
divDisplayContent.id="divContent";
document.body.appendChild(divDisplayContent);
@ -164,11 +166,11 @@ line-height:30px;
//初始化分页;
//包括把加入CSS,检查是否需要分页
DHTMLpagenation.initialize=function()
{
DHTMLpagenation.initialize=function()
{
divDisplayContent.className= contentStyle != null ? contentStyle : "divContent";
if(contentLength<=perpageLength)
{
strDisplayContent=content;
@ -179,14 +181,14 @@ line-height:30px;
pageSizeCount=Math.ceil((contentLength/perpageLength));
DHTMLpagenation.goto(currentPage);
DHTMLpagenation.displayContent();
};
//显示分页栏
DHTMLpagenation.displayPage=function()
DHTMLpagenation.displayPage=function()
{
strDisplayPagenation="";
if(currentPage && currentPage !=1)
@ -197,7 +199,7 @@ line-height:30px;
{
strDisplayPagenation+="上一页 ";
}
for(var i=1;i<=pageSizeCount;i++)
{
if(i!=currentPage)
@ -218,27 +220,27 @@ line-height:30px;
{
strDisplayPagenation+="下一页 ";
}
strDisplayPagenation+="共 " + pageSizeCount + " 页。<br>每页" + perpageLength + " 字符,调整字符数:<input type='text' value='"+perpageLength+"' id='ctlPerpageLength' /><input type='button' value='确定' onclick='DHTMLpagenation.change()' />";
divDisplayPagenation.innerHTML=strDisplayPagenation;
};
//上一页
DHTMLpagenation.previous=function()
{
DHTMLpagenation.goto(currentPage-1);
};
//下一页
DHTMLpagenation.next=function()
{
DHTMLpagenation.goto(currentPage+1);
};
//跳转至某一页
DHTMLpagenation.goto=function(iCurrentPage)
{
@ -246,35 +248,35 @@ line-height:30px;
if(regularExp.test(iCurrentPage))
{
currentPage=iCurrentPage;
var tempContent = "";
//获取当前的内容 里面包含 ❈
//获取当前的内容 里面包含 ❈
var currentContent = imgContent.substr((currentPage-1)*perpageLength,perpageLength);
tempContent = currentContent;
//当前页是否有 ❈ 获取最后一个 ❈ 的位置
//当前页是否有 ❈ 获取最后一个 ❈ 的位置
var indexOf = currentContent.indexOf("❈");
if(indexOf >= 0)
{
//获取从开始位置到当前页位置的内容
var beginToEndContent = imgContent.substr(0,currentPage*perpageLength);
//获取开始到当前页位置的内容 中的 * 的最后的下标
//获取开始到当前页位置的内容 中的 * 的最后的下标
var reCount = beginToEndContent.split("❈").length - 1;
var contentArray = currentContent.split("❈");
tempContent = replaceStr(contentArray,reCount,matchContent);
}
// else
// {
// tempContent=imgContent.substr((currentPage-1)*perpageLength,perpageLength);
// }
strDisplayContent=tempContent;
}
else
@ -289,11 +291,11 @@ line-height:30px;
{
divDisplayContent.innerHTML=strDisplayContent;
};
//改变每页的字节数
DHTMLpagenation.change=function()
{
var iPerpageLength = document.getElementById("ctlPerpageLength").value;
if(regularExp.test(iPerpageLength))
{
@ -301,7 +303,7 @@ line-height:30px;
// DHTMLpagenation.perpageLength=iPerpageLength;
// DHTMLpagenation.currentPage=1;
// DHTMLpagenation.initialize();
DHTMLpagenation(s,iPerpageLength);
}
else
@ -309,41 +311,41 @@ line-height:30px;
alert("请输入数字");
}
};
/* currentArray:当前页以 * 分割后的数组
replaceCount:从开始内容到当前页的内容 * 的个数
matchArray img标签的匹配的内容
*/
function replaceStr(currentArray,replaceCount,matchArray)
{
var result = "";
for(var i=currentArray.length -1,j = replaceCount-1 ;i>=1; i--)
{
{
var temp = (matchArray[j] + currentArray[i]);
result = temp + result;
j--;
}
result = currentArray[0] + result ;
return result;
}
DHTMLpagenation(s,20000);
/**
* 初始化
*/
window.onload = function () {
initWaterMark();
}
</script>
</script>
<#else/>

2
server/src/main/resources/web/xml.ftl

@ -5,10 +5,12 @@
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<title>xml文本预览</title>
<#include "*/commonHeader.ftl">
<script src="js/jquery-3.6.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/xmlTreeViewer.css"/>
<script src="js/xmlTreeViewer.js" type="text/javascript"></script>
<script src="js/base64.min.js" type="text/javascript"></script>
</head>
<body>

Loading…
Cancel
Save