Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
solo-1
Commits
38b3d8ef
Unverified
Commit
38b3d8ef
authored
Mar 20, 2019
by
Van
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
#12720
parent
b4b2236a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
26 deletions
+35
-26
src/main/webapp/common-template/label.ftl
src/main/webapp/common-template/label.ftl
+0
-3
src/main/webapp/common-template/macro-comment_script.ftl
src/main/webapp/common-template/macro-comment_script.ftl
+1
-10
src/main/webapp/js/common.js
src/main/webapp/js/common.js
+32
-12
src/main/webapp/js/page.js
src/main/webapp/js/page.js
+1
-0
src/main/webapp/skins
src/main/webapp/skins
+1
-1
No files found.
src/main/webapp/common-template/label
-script
.ftl
→
src/main/webapp/common-template/label.ftl
View file @
38b3d8ef
...
@@ -17,9 +17,6 @@
...
@@ -17,9 +17,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
-->
<script src="${staticServePath}/js/lib/compress/pjax.min.js"></script>
<script src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"></script>
<script src="${staticServePath}/skins/${skinDirName}/js/common${miniPostfix}.js?${staticResourceVersion}"></script>
<script>
<script>
var Label = {
var Label = {
"servePath": "${servePath}",
"servePath": "${servePath}",
...
...
src/main/webapp/common-template/macro-comment_script.ftl
View file @
38b3d8ef
...
@@ -37,16 +37,7 @@
...
@@ -37,16 +37,7 @@
</div>
</div>
</#if>
</#if>
<script type="text/javascript">
<script type="text/javascript">
if (!window.Page) {
Util.addScript('${staticServePath}/js/page${miniPostfix}.js?${staticResourceVersion}', 'soloPageScript')
var xhrObj = new XMLHttpRequest()
xhrObj.open('GET', '${staticServePath}/js/page${miniPostfix}.js?${staticResourceVersion}', false)
xhrObj.setRequestHeader('Accept', 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01')
xhrObj.send('')
var scriptElement = document.createElement('script')
scriptElement.type = 'text/javascript'
scriptElement.text = xhrObj.responseText
document.getElementsByTagName('head')[0].appendChild(scriptElement)
}
var page = new Page({
var page = new Page({
"commentContentCannotEmptyLabel": "${commentContentCannotEmptyLabel}",
"commentContentCannotEmptyLabel": "${commentContentCannotEmptyLabel}",
"oId": "${oId}",
"oId": "${oId}",
...
...
src/main/webapp/js/common.js
View file @
38b3d8ef
...
@@ -103,6 +103,11 @@ var Util = {
...
@@ -103,6 +103,11 @@ var Util = {
window
.
open
(
this
.
src
)
window
.
open
(
this
.
src
)
})
})
},
},
/**
* 异步添加 css
* @param url css 文件访问地址
* @param id css 文件标示
*/
addStyle
:
function
(
url
,
id
)
{
addStyle
:
function
(
url
,
id
)
{
if
(
!
document
.
getElementById
(
id
))
{
if
(
!
document
.
getElementById
(
id
))
{
var
styleElement
=
document
.
createElement
(
'
link
'
)
var
styleElement
=
document
.
createElement
(
'
link
'
)
...
@@ -113,6 +118,25 @@ var Util = {
...
@@ -113,6 +118,25 @@ var Util = {
document
.
getElementsByTagName
(
'
head
'
)[
0
].
appendChild
(
styleElement
)
document
.
getElementsByTagName
(
'
head
'
)[
0
].
appendChild
(
styleElement
)
}
}
},
},
/**
* 异步添加 js
* @param url js 文件访问地址
* @param id js 文件标示
*/
addScript
:
function
(
url
,
id
)
{
if
(
!
document
.
getElementById
(
id
))
{
var
xhrObj
=
new
XMLHttpRequest
()
xhrObj
.
open
(
'
GET
'
,
url
,
false
)
xhrObj
.
setRequestHeader
(
'
Accept
'
,
'
text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01
'
)
xhrObj
.
send
(
''
)
var
scriptElement
=
document
.
createElement
(
'
script
'
)
scriptElement
.
id
=
id
scriptElement
.
type
=
'
text/javascript
'
scriptElement
.
text
=
xhrObj
.
responseText
document
.
getElementsByTagName
(
'
head
'
)[
0
].
appendChild
(
scriptElement
)
}
},
/*
/*
* @description 解析语法高亮
* @description 解析语法高亮
*/
*/
...
@@ -141,23 +165,19 @@ var Util = {
...
@@ -141,23 +165,19 @@ var Util = {
}
}
},
},
/**
/**
* 按需加载
MathJax 及
图标
* 按需加载
数学公式、代码复制、
图标
* @returns {undefined}
* @returns {undefined}
*/
*/
parseMarkdown
:
function
()
{
parseMarkdown
:
function
()
{
if
(
!
window
.
Vditor
)
{
var
text
=
$
(
'
.vditor-reset
'
).
text
()
var
xhrObj
=
new
XMLHttpRequest
()
if
(
$
(
'
.vditor-reset pre > code
'
).
length
===
0
||
xhrObj
.
open
(
'
GET
'
,
Label
.
staticServePath
+
!
(
text
.
split
(
'
$
'
).
length
>
2
||
'
/js/lib/vditor-1.1.10/index.min.js
'
,
false
)
(
text
.
split
(
'
\\
(
'
).
length
>
1
&&
text
.
split
(
'
\\
)
'
).
length
>
1
)))
{
xhrObj
.
setRequestHeader
(
'
Accept
'
,
return
'
text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01
'
)
xhrObj
.
send
(
''
)
var
scriptElement
=
document
.
createElement
(
'
script
'
)
scriptElement
.
type
=
'
text/javascript
'
scriptElement
.
text
=
xhrObj
.
responseText
document
.
getElementsByTagName
(
'
head
'
)[
0
].
appendChild
(
scriptElement
)
}
}
Util
.
addScript
(
Label
.
staticServePath
+
'
/js/lib/vditor-1.1.10/index.min.js
'
,
'
vditorScript
'
)
Vditor
.
mermaidRender
(
document
.
body
)
Vditor
.
mermaidRender
(
document
.
body
)
Vditor
.
mathRender
(
document
.
body
)
Vditor
.
mathRender
(
document
.
body
)
Vditor
.
codeRender
(
document
.
body
,
Label
.
langLabel
)
Vditor
.
codeRender
(
document
.
body
,
Label
.
langLabel
)
...
...
src/main/webapp/js/page.js
View file @
38b3d8ef
...
@@ -65,6 +65,7 @@ $.extend(Page.prototype, {
...
@@ -65,6 +65,7 @@ $.extend(Page.prototype, {
if
(
typeof
vditor
===
'
undefined
'
)
{
if
(
typeof
vditor
===
'
undefined
'
)
{
var
that
=
this
var
that
=
this
Util
.
addScript
(
Label
.
staticServePath
+
'
/js/lib/vditor-1.1.10/index.min.js
'
,
'
vditorScript
'
)
window
.
vditor
=
new
Vditor
(
'
soloEditorComment
'
,
{
window
.
vditor
=
new
Vditor
(
'
soloEditorComment
'
,
{
placeholder
:
that
.
tips
.
commentContentCannotEmptyLabel
,
placeholder
:
that
.
tips
.
commentContentCannotEmptyLabel
,
height
:
180
,
height
:
180
,
...
...
skins
@
8c9b13c3
Subproject commit
1605dceed8fe66f27f266881e237957248d23fb7
Subproject commit
8c9b13c393450bd679876182c350de5fd7bd8d2c
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