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
6b3ef233
Unverified
Commit
6b3ef233
authored
Jun 01, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
#12787
parent
97e42803
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
8 deletions
+20
-8
src/main/java/org/b3log/solo/util/Emotions.java
src/main/java/org/b3log/solo/util/Emotions.java
+16
-4
src/main/webapp/js/admin/admin.min.js
src/main/webapp/js/admin/admin.min.js
+1
-1
src/main/webapp/js/page.js
src/main/webapp/js/page.js
+2
-2
src/main/webapp/js/page.min.js
src/main/webapp/js/page.min.js
+1
-1
No files found.
src/main/java/org/b3log/solo/util/Emotions.java
View file @
6b3ef233
...
...
@@ -20,7 +20,9 @@ package org.b3log.solo.util;
import
com.vdurmont.emoji.EmojiParser
;
import
org.apache.commons.lang.StringUtils
;
import
org.b3log.latke.Latkes
;
import
org.b3log.solo.SoloServletListener
;
import
java.util.Set
;
import
java.util.regex.Pattern
;
/**
...
...
@@ -28,11 +30,16 @@ import java.util.regex.Pattern;
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://vanessa.b3log.org">Vanessa</a>
* @version 1.1.1.0, Jun
e
1, 2019
* @version 1.1.1.0, Jun 1, 2019
* @since 1.4.0
*/
public
final
class
Emotions
{
/**
* Emoji picture paths.
*/
private
static
final
Set
<
String
>
EMOJI_PIC_PATHS
=
SoloServletListener
.
getServletContext
().
getResourcePaths
(
"/images/emoji/"
);
/**
* Converts the specified content with emotions.
*
...
...
@@ -46,9 +53,14 @@ public final class Emotions {
}
ret
=
toUnicode
(
ret
);
String
repl
=
"<img align=\"absmiddle\" alt=\":huaji:\" class=\"emoji\" src=\""
+
Latkes
.
getStaticServePath
()
+
"/images/emoji/huaji.gif"
+
"\" title=\":huaji:\" width=\"20px\" height=\"20px\"></img>"
;
ret
=
StringUtils
.
replace
(
ret
,
":huaji:"
,
repl
);
for
(
final
String
emojiPic
:
EMOJI_PIC_PATHS
)
{
final
String
emojiPicName
=
StringUtils
.
substringAfter
(
emojiPic
,
"/emoji/"
);
final
String
emoji
=
StringUtils
.
substringBefore
(
emojiPicName
,
"."
);
String
repl
=
"<img align=\"absmiddle\" alt=\""
+
emoji
+
"\" class=\"emoji\" src=\""
+
Latkes
.
getStaticServePath
()
+
"/images/emoji/"
+
emojiPicName
+
"\" title=\""
+
emoji
+
"\" width=\"20px\" height=\"20px\"></img>"
;
ret
=
StringUtils
.
replace
(
ret
,
":"
+
emoji
+
":"
,
repl
);
}
return
ret
;
}
...
...
src/main/webapp/js/admin/admin.min.js
View file @
6b3ef233
This diff is collapsed.
Click to expand it.
src/main/webapp/js/page.js
View file @
6b3ef233
...
...
@@ -20,7 +20,7 @@
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.3.0.0, Jun
e
1, 2019
* @version 2.3.0.0, Jun 1, 2019
*/
var
Page
=
function
(
tips
)
{
this
.
currentCommentId
=
''
...
...
@@ -397,4 +397,4 @@ $.extend(Page.prototype, {
Util
.
parseLanguage
()
window
.
location
.
hash
=
'
#comments
'
},
})
\ No newline at end of file
})
src/main/webapp/js/page.min.js
View file @
6b3ef233
This diff is collapsed.
Click to expand it.
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