Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
npm
/
glsx-components
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9b3dd8ac
authored
Sep 14, 2022
by
杨明
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
modified: src/packages/Editor/src/index.vue
1 parent
fd7a537b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
src/packages/Editor/src/index.vue
src/packages/Editor/src/index.vue
View file @
9b3dd8a
...
@@ -421,7 +421,7 @@ export default {
...
@@ -421,7 +421,7 @@ export default {
let
videoObj
=
document
.
createElement
(
'video'
)
let
videoObj
=
document
.
createElement
(
'video'
)
videoObj
.
src
=
videoUrl
videoObj
.
src
=
videoUrl
videoObj
.
load
()
videoObj
.
load
()
videoObj
.
onloadedmetadata
=
function
(
evt
)
{
videoObj
.
onloadedmetadata
=
function
(
evt
)
{
URL
.
revokeObjectURL
(
videoUrl
)
URL
.
revokeObjectURL
(
videoUrl
)
const
{
limitWidth
,
limitHeight
,
limitTime
}
=
_this
.
videoList
const
{
limitWidth
,
limitHeight
,
limitTime
}
=
_this
.
videoList
if
(
limitWidth
&&
limitHeight
&&
(
videoObj
.
videoWidth
>
limitWidth
||
videoObj
.
videoHeight
>
limitHeight
))
{
if
(
limitWidth
&&
limitHeight
&&
(
videoObj
.
videoWidth
>
limitWidth
||
videoObj
.
videoHeight
>
limitHeight
))
{
...
@@ -457,7 +457,7 @@ export default {
...
@@ -457,7 +457,7 @@ export default {
},
},
textInput
(
val
)
{
textInput
(
val
)
{
val
=
val
.
replace
(
/ /g
,
''
)
val
=
val
.
replace
(
/ /g
,
''
)
this
.
textNum
=
val
.
replace
(
/
(\
[
.*
?\]
|
\
n
|
\s)
/g
,
''
).
length
this
.
textNum
=
val
.
replace
(
/
(\n
|
\s)
/g
,
''
).
length
if
(
this
.
textNum
>
this
.
maxNum
)
{
if
(
this
.
textNum
>
this
.
maxNum
)
{
this
.
textNum
=
this
.
maxNum
this
.
textNum
=
this
.
maxNum
this
.
updateList
(
this
.
previewList
,
1
)
this
.
updateList
(
this
.
previewList
,
1
)
...
@@ -532,7 +532,10 @@ export default {
...
@@ -532,7 +532,10 @@ export default {
if
(
!
this
.
previewList
[
idx
].
attContent
)
{
if
(
!
this
.
previewList
[
idx
].
attContent
)
{
html
=
html
.
replace
(
'\n'
,
''
).
replace
(
/<br
\/
>/g
,
''
)
html
=
html
.
replace
(
'\n'
,
''
).
replace
(
/<br
\/
>/g
,
''
)
}
}
html
=
html
.
replace
(
/&/g
,
'&'
).
replace
(
/</g
,
'<'
).
replace
(
/>/g
,
'>'
)
html
=
html
.
replace
(
/&/g
,
'&'
)
.
replace
(
/</g
,
'<'
)
.
replace
(
/>/g
,
'>'
)
let
textLen
=
this
.
previewList
[
idx
].
attContent
+
html
let
textLen
=
this
.
previewList
[
idx
].
attContent
+
html
if
(
textLen
.
replace
(
/
(\n
|
\s)
/g
,
''
).
length
>
this
.
maxNum
)
{
if
(
textLen
.
replace
(
/
(\n
|
\s)
/g
,
''
).
length
>
this
.
maxNum
)
{
textLen
=
this
.
previewList
[
idx
].
attContent
textLen
=
this
.
previewList
[
idx
].
attContent
...
@@ -568,7 +571,7 @@ export default {
...
@@ -568,7 +571,7 @@ export default {
this
.
updateText
(
content
)
this
.
updateText
(
content
)
this
.
textValue
=
content
this
.
textValue
=
content
},
},
changeInput
:
utils
.
debounce
(
function
()
{
changeInput
:
utils
.
debounce
(
function
()
{
var
allNodes
=
document
.
getElementById
(
'editor'
).
childNodes
var
allNodes
=
document
.
getElementById
(
'editor'
).
childNodes
var
str
=
''
var
str
=
''
allNodes
.
forEach
(
item
=>
{
allNodes
.
forEach
(
item
=>
{
...
@@ -594,7 +597,7 @@ export default {
...
@@ -594,7 +597,7 @@ export default {
.
replace
(
/
\[[\u
4E00-
\u
9FA56
]{1,4}
]/g
,
''
).
length
.
replace
(
/
\[[\u
4E00-
\u
9FA56
]{1,4}
]/g
,
''
).
length
attContent
=
obj
.
attContent
.
replace
(
/
\[(
@昵称|#兑换码
)\]
/g
,
'<wise id="1" contenteditable="false">$1</wise>'
)
attContent
=
obj
.
attContent
.
replace
(
/
\[(
@昵称|#兑换码
)\]
/g
,
'<wise id="1" contenteditable="false">$1</wise>'
)
}
}
let
htm
=
attContent
.
replace
(
/
\[[\u
4E00-
\u
9FA56
]{1,4}
]/gi
,
function
(
res
)
{
let
htm
=
attContent
.
replace
(
/
\[[\u
4E00-
\u
9FA56
]{1,4}
]/gi
,
function
(
res
)
{
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
)
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
)
const
list
=
emoji
.
flat
(
Infinity
)
const
list
=
emoji
.
flat
(
Infinity
)
let
index
=
parseInt
(
list
.
indexOf
(
word
))
+
1
let
index
=
parseInt
(
list
.
indexOf
(
word
))
+
1
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment