Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kwell-mes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gavelinfo
kwell-mes
Commits
0726ade8
Commit
0726ade8
authored
Feb 16, 2022
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dp
parent
c989632e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
0 deletions
+83
-0
dbenlarge.js
gavel/src/main/resources/static/js/dbenlarge.js
+40
-0
pdfshow.js
gavel/src/main/resources/static/js/pdfshow.js
+43
-0
No files found.
gavel/src/main/resources/static/js/dbenlarge.js
0 → 100644
View file @
0726ade8
function
fullScreen
(
element
)
{
const
elem
=
element
||
document
.
documentElement
;
if
(
elem
.
webkitRequestFullScreen
)
{
elem
.
webkitRequestFullScreen
();
}
else
if
(
elem
.
mozRequestFullScreen
)
{
elem
.
mozRequestFullScreen
();
}
else
if
(
elem
.
requestFullScreen
)
{
elem
.
requestFullscreen
();
}
else
if
(
elem
.
msExitFullscreen
)
{
elem
.
msExitFullscreen
();
}
else
if
(
elem
.
msRequestFullscreen
)
{
elem
.
msRequestFullscreen
();
}
else
if
(
typeof
window
.
ActiveXObject
!==
"undefined"
)
{
//for Internet Explorer
var
wscript
=
new
ActiveXObject
(
"WScript.Shell"
);
if
(
wscript
!==
null
)
{
wscript
.
SendKeys
(
"{F11}"
);
}
}
}
//退出全屏
function
exitFullscreen
()
{
var
de
=
document
;
if
(
de
.
exitFullscreen
)
{
de
.
exitFullscreen
();
}
else
if
(
de
.
mozCancelFullScreen
)
{
de
.
mozCancelFullScreen
();
}
else
if
(
de
.
webkitCancelFullScreen
)
{
de
.
webkitCancelFullScreen
();
}
}
function
dbenlarge
(
domid
,
isTrue
)
{
let
is
=
isTrue
document
.
getElementById
(
domid
).
style
.
backgroundColor
=
"#FFFFFF"
document
.
getElementById
(
domid
).
addEventListener
(
'dblclick'
,
function
(
e
)
{
fullScreen
(
document
.
getElementById
(
domid
));
},
false
);
if
(
isTrue
){
fullScreen
(
document
.
getElementById
(
domid
));
}
}
gavel/src/main/resources/static/js/pdfshow.js
0 → 100644
View file @
0726ade8
var
pdfshow
=
function
(
url
,
domid
,
time
){
return
new
Promise
(
function
(
r
,
n
){
let
timenum
let
pdfobj
=
pdfjsLib
.
getDocument
(
url
)
let
canvas
=
document
.
getElementById
(
domid
);
pdfobj
.
promise
.
then
(
function
(
pdf
){
let
nowpage
=
0
let
numPages
=
pdf
.
_pdfInfo
.
numPages
timenum
=
setInterval
(
function
(){
if
(
nowpage
<
numPages
){
nowpage
++
}
else
{
nowpage
=
1
}
pdf
.
getPage
(
nowpage
).
then
(
function
(
page
)
{
// 设置渲染属性
let
viewport
=
page
.
getViewport
({
scale
:
2
});
canvas
.
height
=
viewport
.
height
;
canvas
.
width
=
viewport
.
width
;
let
outputScale
=
1
;
let
context
=
canvas
.
getContext
(
'2d'
);
let
transform
=
outputScale
!==
1
?
[
outputScale
,
0
,
0
,
outputScale
,
0
,
0
]
:
null
;
let
renderContext
=
{
canvasContext
:
context
,
transform
:
transform
,
viewport
:
viewport
};
page
.
render
(
renderContext
);
});
},
time
)
r
(
timenum
)
})
})
}
/* 封装pdf
url:pdf地址
domid:canvas id
time:跳页时间(ms)
.then((e)=>{获取定时器})
*/
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment