Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-fileview
Project
Project
Details
Activity
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
梁杰芳
slm-fileview
Commits
12c85c60
Commit
12c85c60
authored
Dec 31, 2020
by
kl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XML文件预览支持切换纯文本模式
parent
4747ee93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
xml.ftl
server/src/main/resources/web/xml.ftl
+26
-4
No files found.
server/src/main/resources/web/xml.ftl
View file @
12c85c60
...
...
@@ -13,10 +13,17 @@
<input
hidden
id=
"textData"
value=
"${textData}"
/>
<div
class=
"container"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<div
id=
"xml_btn"
class=
"panel-heading"
>
<h4
class=
"panel-title"
>
<a
data-toggle=
"collapse"
data-parent=
"#accordion"
href=
"#collapseOne"
>
${file.name}
${file.name}
</a>
</h4>
</div>
<div
id=
"text_btn"
class=
"panel-heading"
>
<h4
class=
"panel-title"
>
<a
data-toggle=
"collapse"
data-parent=
"#accordion"
href=
"#collapseOne"
>
${file.name}
</a>
</h4>
</div>
...
...
@@ -31,6 +38,7 @@
* 初始化
*/
window
.
onload
=
function
()
{
$
(
"#xml_btn"
).
hide
()
initWaterMark
();
loadXmlData
()
}
...
...
@@ -40,11 +48,25 @@
*/
function
loadXmlData
()
{
var
textData
=
Base64
.
decode
(
$
(
"#textData"
).
val
())
window
.
textPreData
=
"<xmp style='background-color: #FFFFFF;overflow-y: scroll;border:none'>"
+
textData
+
"</xmp>"
;
var
xmlNode
=
xmlTreeViewer
.
parseXML
(
textData
);
var
retNode
=
xmlTreeViewer
.
getXMLViewerNode
(
xmlNode
.
xml
);
$
(
"#xml"
).
html
(
retNode
);
window
.
retNode
=
xmlTreeViewer
.
getXMLViewerNode
(
xmlNode
.
xml
);
$
(
"#xml"
).
html
(
window
.
retNode
);
}
$
(
function
()
{
$
(
"#xml_btn"
).
click
(
function
()
{
$
(
"#xml"
).
html
(
window
.
retNode
);
$
(
"#text_btn"
).
show
()
$
(
"#xml_btn"
).
hide
()
});
$
(
"#text_btn"
).
click
(
function
()
{
$
(
"#xml_btn"
).
show
()
$
(
"#text_btn"
).
hide
();
$
(
"#xml"
).
html
(
window
.
textPreData
);
});
});
</script>
</body>
...
...
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