mirror of
https://github.com/lxsang/antd-web-apps
synced 2024-12-27 09:58:20 +01:00
commit
d96a9c699e
@ -57,6 +57,10 @@
|
|||||||
target: "quick_talk_comment_thread",
|
target: "quick_talk_comment_thread",
|
||||||
api_uri: "https://chat.iohub.dev/comment",
|
api_uri: "https://chat.iohub.dev/comment",
|
||||||
uri: "<?=url?>",
|
uri: "<?=url?>",
|
||||||
|
author: {
|
||||||
|
first: "mrsang",
|
||||||
|
last: "iohub.dev"
|
||||||
|
},
|
||||||
onload: function(){
|
onload: function(){
|
||||||
renderMathInElement($("#desktop")[0]);
|
renderMathInElement($("#desktop")[0]);
|
||||||
$('pre code').each(function(i, block) {
|
$('pre code').each(function(i, block) {
|
||||||
|
@ -149,6 +149,10 @@ local url = __main__:get("url")
|
|||||||
target: "quick_talk_comment_thread",
|
target: "quick_talk_comment_thread",
|
||||||
api_uri: "https://chat.iohub.dev/comment",
|
api_uri: "https://chat.iohub.dev/comment",
|
||||||
uri: "<?=url?>",
|
uri: "<?=url?>",
|
||||||
|
author: {
|
||||||
|
first: "mrsang",
|
||||||
|
last: "iohub.dev"
|
||||||
|
},
|
||||||
onload: function(){
|
onload: function(){
|
||||||
renderMathInElement($("#book")[0]);
|
renderMathInElement($("#book")[0]);
|
||||||
$('pre code').each(function(i, block) {
|
$('pre code').each(function(i, block) {
|
||||||
|
@ -164,6 +164,10 @@ class QuickTalk {
|
|||||||
content: ta.value,
|
content: ta.value,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
if (this.options.author) {
|
||||||
|
data.author =
|
||||||
|
this.options.author.first + "@" + this.options.author.last;
|
||||||
|
}
|
||||||
this.request(this.options.api_uri + "/post", data, (ret) => {
|
this.request(this.options.api_uri + "/post", data, (ret) => {
|
||||||
if (ret.result) {
|
if (ret.result) {
|
||||||
// TODO: more check goes here
|
// TODO: more check goes here
|
||||||
|
@ -111,7 +111,14 @@ function CommentController:post(...)
|
|||||||
rq.comment.id = self.comment.db:lastInsertID()
|
rq.comment.id = self.comment.db:lastInsertID()
|
||||||
|
|
||||||
rq.comment.content = process_md(rq.comment.content)
|
rq.comment.content = process_md(rq.comment.content)
|
||||||
|
-- notify the author
|
||||||
|
if rq.author then
|
||||||
|
sendmail(rq.author, rq.comment.name ..
|
||||||
|
" has commented on one of your pages",
|
||||||
|
rq.comment.name .. " has commented on your page: " ..
|
||||||
|
rq.page.uri ..
|
||||||
|
".\nBest regards,\nEmail automatically sent by QuickTalk API")
|
||||||
|
end
|
||||||
-- send mail to all users of current page
|
-- send mail to all users of current page
|
||||||
local cmts, cmti = self.comment:select("MIN(id) as id,email",
|
local cmts, cmti = self.comment:select("MIN(id) as id,email",
|
||||||
"pid=" .. rq.comment.pid ..
|
"pid=" .. rq.comment.pid ..
|
||||||
@ -125,7 +132,7 @@ function CommentController:post(...)
|
|||||||
rq.comment.name ..
|
rq.comment.name ..
|
||||||
" has written something on a page that you've commented. \nPlease visit this page: " ..
|
" has written something on a page that you've commented. \nPlease visit this page: " ..
|
||||||
rq.page.uri ..
|
rq.page.uri ..
|
||||||
" for updates on the discussion.\nBest regard,\nEmail automatically sent by QuickTalk API")
|
" for updates on the discussion.\nBest regards,\nEmail automatically sent by QuickTalk API")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rq.comment.email = ""
|
rq.comment.email = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user