Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
✨ 支持 OwO 表情
Browse files Browse the repository at this point in the history
  • Loading branch information
ocoke committed Jan 10, 2023
1 parent 25d5569 commit ac7bf00
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 57 deletions.
34 changes: 1 addition & 33 deletions demo/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,6 @@
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.7.0/build/highlight.min.js"></script>
<script>
detalk.parse = marked.parse;
// window.DETALK_I18N = {
// loadMore: 'Load More',
// notAllowedInput: 'The input doesn\'t meet the requirements!',
// send: 'Send',
// preview: 'Preview',
// reply: 'Reply',
// replyTo: 'Reply to',
// cancel: 'Cancel',
// loadingLoginFrame: 'Login Frame is loading...',
// gotoLoginFrame: 'Please continue in the login frame',
// waitingInfo: 'Login successful, getting user info...',
// loginSuccess: 'Login successful.',
// failedLoadingInfo: 'Failed to get user info.',
// deleteConfirm: 'Comment with ID:[#ID] will be deleted, continue?',
// total: '[#TOTAL] total comments',
// noComment: 'No comments.',
// up: 'Positive order',
// down: 'Reverse order',
// delete: 'Delete',
// top: 'Top',
// login: 'Login',
// required: 'Required',
// optional: 'Optional',
// nickname: 'Nickname',
// email: 'Email',
// link: 'Link',
// day: {
// justNow: 'Just now',
// minute: '[#TIME] minutes ago',
// hour: '[#TIME] hours ago',
// day: '[#TIME] days ago'
// }
// }
detalk.init({
url: "https://detalk.deta.dev/",
el: "#detalk",
Expand All @@ -82,6 +49,7 @@
},
recaptchaSiteKey: '6LefUdojAAAAAHe0G0p0MaW5U93AnH_G5QViDl92',
recaptchaLoaded: false,
owo: 'https://owo.imaegoo.com/owo.json',
});
function light() {
document.body.style.backgroundColor = "#fff";
Expand Down
1 change: 0 additions & 1 deletion dist/detalk-comment.css

This file was deleted.

1 change: 0 additions & 1 deletion dist/detalk-label.css

This file was deleted.

2 changes: 0 additions & 2 deletions dist/detalk-nocss.js

This file was deleted.

9 changes: 0 additions & 9 deletions dist/detalk-nocss.js.LICENSE.txt

This file was deleted.

2 changes: 0 additions & 2 deletions dist/detalk.js

This file was deleted.

9 changes: 0 additions & 9 deletions dist/detalk.js.LICENSE.txt

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"html-webpack-plugin": "^5.5.0",
"js-md5": "^0.7.3",
"marked": "^4.2.5",
"owo": "^1.0.2",
"postcss": "^8.4.20",
"postcss-loader": "^7.0.2",
"webpack": "^5.75.0",
Expand Down
14 changes: 14 additions & 0 deletions src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import getUUID from './lib/getUUID.js';
import _id_s from './lib/dom.js';
import recaptcha from './lib/recaptcha.js';
import md5 from 'js-md5';
import OwO from 'owo';
import './pack/owo.css';
export default async function init(options) {
if (!window.DETALK_I18N) {
window.DETALK_I18N = {
Expand Down Expand Up @@ -93,6 +95,18 @@ export default async function init(options) {

load(url, path);

if (options.owo) {
new OwO({
logo: 'OωO',
container: document.getElementById("detalk_owo"),
target: document.getElementById("detalk_input_content"),
api: options.owo,
position: 'down',
width: '100%',
maxHeight: '250px'
});
}


if (!localStorage.getItem("DETALK_AUTH")) {
localStorage.setItem("DETALK_AUTH", getUUID());
Expand Down
1 change: 1 addition & 0 deletions src/pack/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default `
<div class="action-btn-group" id="detalk_input_btn_area">
<div class="action-btn">
<div style="text-align: end;">
<div id="detalk_owo" class="OwO" style="color: black;margin-top: 10px;"></div>
<p class="word-limit" style="color: rgb(255,70,0);"><span id="detalk-warn"></span></p>
<p class="word-limit"><span id="_detalk_word_limit">0</span> / 500</p>
</div>
Expand Down
Loading

0 comments on commit ac7bf00

Please sign in to comment.