新功能点:支持全局水印

This commit is contained in:
陈精华
2020-05-13 19:40:31 +08:00
committed by kl
parent 9c096605bb
commit fde31cb327
235 changed files with 114621 additions and 3392 deletions

View File

@@ -6,14 +6,16 @@
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<link href="css/zTreeStyle.css" rel="stylesheet" type="text/css">
<style type="text/css">
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;padding: 0;border: 0;outline: 0;font-weight: inherit;font-style: inherit;font-size: 100%;font-family: inherit;vertical-align: baseline;}
body {color: #2f332a;font: 15px/21px Arial, Helvetica, simsun, sans-serif;background: #f0f6e4 \9;}
body{
margin:0 auto;
width: 600px;
background-color: #333333;
font-size: 4em;
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
width: 100%;
}
body {
background-color: #404040;
}
h1, h2, h3, h4, h5, h6 {color: #2f332a;font-weight: bold;font-family: Helvetica, Arial, sans-serif;padding-bottom: 5px;}
h1 {font-size: 24px;line-height: 34px;text-align: center;}
@@ -25,7 +27,7 @@
input.radio.first {margin-left:0;}
input.empty {color: lightgray;}
code {color: #2f332a;}
div.zTreeDemoBackground {width:600px;text-align:center;background-color: #ffffff;}
div.zTreeDemoBackground {width:600px;text-align:center;margin: 0 auto;background-color: #ffffff;}
</style>
</head>
<body>
@@ -33,7 +35,7 @@
<div class="zTreeDemoBackground left">
<ul id="treeDemo" class="ztree"></ul>
</div>
</body>
<script src="js/watermark.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery-3.0.0.min.js"></script>
<script type="text/javascript" src="js/jquery.ztree.core.js"></script>
<script type="text/javascript">
@@ -83,6 +85,29 @@
$(".zTreeDemoBackground").css("height", height);
});
/*初始化水印*/
window.onload = function() {
var watermarkTxt = '${watermarkTxt}';
if (watermarkTxt !== '') {
watermark.init({
watermark_txt: '${watermarkTxt}',
watermark_x: 0,
watermark_y: 0,
watermark_rows: 0,
watermark_cols: 0,
watermark_x_space: ${watermarkXSpace},
watermark_y_space: ${watermarkYSpace},
watermark_font: '${watermarkFont}',
watermark_fontsize: '${watermarkFontsize}',
watermark_color:'${watermarkColor}',
watermark_alpha: ${watermarkAlpha},
watermark_width: ${watermarkWidth},
watermark_height: ${watermarkHeight},
watermark_angle: ${watermarkAngle},
});
}
}
/**
* 计算ztreedom的高度
*/
@@ -105,4 +130,5 @@
$(".zTreeDemoBackground").css("height", height);
}
</script>
</body>
</html>

View File

@@ -3,16 +3,30 @@
<head>
<meta charset="utf-8" />
<title>多媒体文件预览</title>
<script src="js/flv.min.js"type="text/javascript"></script>
<script src="js/watermark.js" type="text/javascript"></script>
</head>
<style>
body{background-color: #262626}
.m{ margin-left: auto; margin-right: auto; width:1024px; margin-top: 100px; }
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
width: 100%;
}
body {
background-color: #404040;
}
.m {
width: 1024px;
margin: 0 auto;
}
</style>
<body>
<div class="m">
<video width="1024" id="videoElement"></video>
</div>
<script src="js/flv.min.js"></script>
<script>
if (flvjs.isSupported()) {
var videoElement = document.getElementById('videoElement');
@@ -24,6 +38,28 @@
flvPlayer.load();
flvPlayer.play();
}
/*初始化水印*/
window.onload = function() {
var watermarkTxt = '${watermarkTxt}';
if (watermarkTxt !== '') {
watermark.init({
watermark_txt: '${watermarkTxt}',
watermark_x: 0,
watermark_y: 0,
watermark_rows: 0,
watermark_cols: 0,
watermark_x_space: ${watermarkXSpace},
watermark_y_space: ${watermarkYSpace},
watermark_font: '${watermarkFont}',
watermark_fontsize: '${watermarkFontsize}',
watermark_color:'${watermarkColor}',
watermark_alpha: ${watermarkAlpha},
watermark_width: ${watermarkWidth},
watermark_height: ${watermarkHeight},
watermark_angle: ${watermarkAngle},
});
}
}
</script>
</body>

View File

@@ -5,16 +5,20 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<style type="text/css">
body{
* {
margin: 0;
padding:0;
border:0;
padding: 0;
}
html, body {
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<iframe src="${pdfUrl}" width="100%" frameborder="0"></iframe>
</body>
<script src="js/watermark.js" type="text/javascript"></script>
<script type="text/javascript">
document.getElementsByTagName('iframe')[0].height = document.documentElement.clientHeight-10;
/**
@@ -24,5 +28,27 @@
var fm = document.getElementsByTagName("iframe")[0];
fm.height = window.document.documentElement.clientHeight-10;
}
/*初始化水印*/
window.onload = function() {
var watermarkTxt = '${watermarkTxt}';
if (watermarkTxt !== '') {
watermark.init({
watermark_txt: '${watermarkTxt}',
watermark_x: 0,
watermark_y: 0,
watermark_rows: 0,
watermark_cols: 0,
watermark_x_space: ${watermarkXSpace},
watermark_y_space: ${watermarkYSpace},
watermark_font: '${watermarkFont}',
watermark_fontsize: '${watermarkFontsize}',
watermark_color:'${watermarkColor}',
watermark_alpha: ${watermarkAlpha},
watermark_width: ${watermarkWidth},
watermark_height: ${watermarkHeight},
watermark_angle: ${watermarkAngle},
});
}
}
</script>
</html>

View File

@@ -7,8 +7,8 @@
<title>kkFileView演示首页</title>
<link rel="stylesheet" href="css/viewer.min.css">
<link rel="stylesheet" href="css/loading.css">
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap/bootstrap-table.css">
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="bootstrap-table/bootstrap-table.min.css">
<style type="text/css">
</style>
</head>
@@ -157,8 +157,8 @@ window.open('http://127.0.0.1:8012/picturesPreview?urls='+encodeURIComponent(fil
</div>
<script src="js/jquery-3.0.0.min.js" type="text/javascript"></script>
<script src="js/jquery.form.min.js" type="text/javascript"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-table.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="bootstrap-table/bootstrap-table.min.js"></script>
<script>
function deleteFile(fileName) {
$.ajax({

View File

@@ -1,24 +1,58 @@
<!DOCTYPE html>
<html lang="en">
<html lang="zh-cn">
<head>
<meta charset="utf-8" />
<title>多媒体文件预览</title>
<link rel="stylesheet" href="plyr/plyr.css">
<link rel="stylesheet" href="plyr/plyr.css" />
<script type="text/javascript" src="plyr/plyr.js"></script>
<script type="text/javascript" src="js/watermark.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
width: 100%;
}
body {
background-color: #404040;
}
.m {
width: 1024px;
margin: 0 auto;
}
</style>
</head>
<style>
body{background-color: #262626}
.m{ margin-left: auto; margin-right: auto; width:640px; margin-top: 100px; }
</style>
<body>
<div class="m">
<video controls>
<source src="${mediaUrl}">
<video>
<source src="${mediaUrl}" />
</video>
</div>
<script src="plyr/plyr.js"></script>
<script>
plyr.setup();
window.onload = function() {
var watermarkTxt = '${watermarkTxt}';
if (watermarkTxt !== '') {
watermark.init({
watermark_txt: '${watermarkTxt}',
watermark_x: 0,
watermark_y: 0,
watermark_rows: 0,
watermark_cols: 0,
watermark_x_space: ${watermarkXSpace},
watermark_y_space: ${watermarkYSpace},
watermark_font: '${watermarkFont}',
watermark_fontsize: '${watermarkFontsize}',
watermark_color:'${watermarkColor}',
watermark_alpha: ${watermarkAlpha},
watermark_width: ${watermarkWidth},
watermark_height: ${watermarkHeight},
watermark_angle: ${watermarkAngle},
});
}
}
</script>
</body>
</html>
</html>

View File

@@ -5,17 +5,28 @@
<title>PDF图片预览</title>
<script src="js/lazyload.js"></script>
<style>
.container{
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
width: 100%;
}
body {
background-color: #404040;
}
.container {
width: 100%;
height: 100%;
}
.img-area{
.img-area {
text-align: center
}
</style>
</head>
<body bgcolor="#404040">
<body>
<div class="container">
<#list imgurls as img>
<div class="img-area">
@@ -24,8 +35,31 @@
</#list>
</div>
<img src="images/pdf.svg" width="63" height="63" style="position: fixed; cursor: pointer; top: 40%; right: 48px; z-index: 999;" alt="使用PDF预览" title="使用PDF预览" onclick="changePreviewType('pdf')"/>
<script src="js/watermark.js" type="text/javascript"></script>
<script>
window.onload=checkImgs;
window.onload = function () {
/*初始化水印*/
var watermarkTxt = '${watermarkTxt}';
if (watermarkTxt !== '') {
watermark.init({
watermark_txt: '${watermarkTxt}',
watermark_x: 0,
watermark_y: 0,
watermark_rows: 0,
watermark_cols: 0,
watermark_x_space: ${watermarkXSpace},
watermark_y_space: ${watermarkYSpace},
watermark_font: '${watermarkFont}',
watermark_fontsize: '${watermarkFontsize}',
watermark_color:'${watermarkColor}',
watermark_alpha: ${watermarkAlpha},
watermark_width: ${watermarkWidth},
watermark_height: ${watermarkHeight},
watermark_angle: ${watermarkAngle},
});
}
checkImgs();
};
window.onscroll = throttle(checkImgs);
function changePreviewType(previewType) {
var url = window.location.href;

View File

@@ -6,10 +6,13 @@
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<title>PDF预览</title>
<style type="text/css">
body{
* {
margin: 0;
padding:0;
border:0;
padding: 0;
}
html, body {
height: 100%;
width: 100%;
}
</style>
</head>
@@ -25,6 +28,7 @@
</body>
<script src="js/watermark.js" type="text/javascript"></script>
<script type="text/javascript">
document.getElementsByTagName('iframe')[0].src = "${baseUrl}pdfjs/web/viewer.html?base=${baseUrl}&file="+encodeURIComponent('${finalUrl}');
document.getElementsByTagName('iframe')[0].height = document.documentElement.clientHeight-10;
@@ -45,5 +49,27 @@
}
window.location.href=url;
}
/*初始化水印*/
window.onload = function() {
var watermarkTxt = '${watermarkTxt}';
if (watermarkTxt !== '') {
watermark.init({
watermark_txt: '${watermarkTxt}',
watermark_x: 0,
watermark_y: 0,
watermark_rows: 0,
watermark_cols: 0,
watermark_x_space: ${watermarkXSpace},
watermark_y_space: ${watermarkYSpace},
watermark_font: '${watermarkFont}',
watermark_fontsize: '${watermarkFontsize}',
watermark_color:'${watermarkColor}',
watermark_alpha: ${watermarkAlpha},
watermark_width: ${watermarkWidth},
watermark_height: ${watermarkHeight},
watermark_angle: ${watermarkAngle},
});
}
}
</script>
</html>

View File

@@ -5,20 +5,31 @@
<title>图片预览</title>
<link rel="stylesheet" href="css/viewer.min.css">
<style>
* { margin: 0; padding: 0;}
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
width: 100%;
}
body {
background-color: #404040;
}
#dowebok { width: 800px; margin: 0 auto; font-size: 0;}
#dowebok li { display: inline-block;width: 50px;height: 50px; margin-left: 1%; padding-top: 1%;}
/*#dowebok li img { width: 200%;}*/
</style>
</head>
<body bgcolor="#404040">
<body>
<ul id="dowebok">
<#list imgurls as img>
<li><img id="${img}" url="${img}" src="${img}" width="1px" height="1px"></li>
</#list>
<#list imgurls as img>
<li><img id="${img}" url="${img}" src="${img}" width="1px" height="1px"></li>
</#list>
</ul>
<script src="js/jquery-3.0.0.min.js"></script>
<script src="js/viewer.min.js"></script>
<script src="js/watermark.js" type="text/javascript"></script>
<script>
var viewer = new Viewer(document.getElementById('dowebok'), {
url: 'src',
@@ -62,6 +73,28 @@
prev.on('mouseout',outHandler);
prev.on('mouseover',overHandler);
});
/*初始化水印*/
window.onload = function() {
var watermarkTxt = '${watermarkTxt}';
if (watermarkTxt !== '') {
watermark.init({
watermark_txt: '${watermarkTxt}',
watermark_x: 0,
watermark_y: 0,
watermark_rows: 0,
watermark_cols: 0,
watermark_x_space: ${watermarkXSpace},
watermark_y_space: ${watermarkYSpace},
watermark_font: '${watermarkFont}',
watermark_fontsize: '${watermarkFontsize}',
watermark_color:'${watermarkColor}',
watermark_alpha: ${watermarkAlpha},
watermark_width: ${watermarkWidth},
watermark_height: ${watermarkHeight},
watermark_angle: ${watermarkAngle},
});
}
}
</script>
</body>

View File

@@ -3,17 +3,54 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<title>普通文预览</title>
<title>普通文预览</title>
<style>
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<script language="javascript" type="text/javascript">
window.location.href="${ordinaryUrl}";
<div id = "text"></div>
<script src="js/jquery-3.0.0.min.js" type="text/javascript"></script>
<script src="js/watermark.js" type="text/javascript"></script>
<script>
/*初始化水印*/
window.onload = function() {
var watermarkTxt = '${watermarkTxt}';
if (watermarkTxt !== '') {
watermark.init({
watermark_txt: '${watermarkTxt}',
watermark_x: 0,
watermark_y: 0,
watermark_rows: 0,
watermark_cols: 0,
watermark_x_space: ${watermarkXSpace},
watermark_y_space: ${watermarkYSpace},
watermark_font: '${watermarkFont}',
watermark_fontsize: '${watermarkFontsize}',
watermark_color:'${watermarkColor}',
watermark_alpha: ${watermarkAlpha},
watermark_width: ${watermarkWidth},
watermark_height: ${watermarkHeight},
watermark_angle: ${watermarkAngle},
});
}
$.ajax({
type: 'GET',
url: '${ordinaryUrl}',
success: function (data) {
$("#text").html(data);
}
});
}
</script>
</body>
</html>