Cicalese has submitted this change and it was merged.
Change subject: Fixed reply bug.
......................................................................
Fixed reply bug.
Change-Id: Ibb82809ad9f7dbc1d3c70ec4ed3dbcaf1f85116c
---
M extension.json
M resources/CommentStreams.js
M resources/CommentStreamsQuerier.js
3 files changed, 15 insertions(+), 8 deletions(-)
Approvals:
Cicalese: Looks good to me, approved
jenkins-bot: Verified
diff --git a/extension.json b/extension.json
index afc5acf..4e3f019 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
{
"name": "CommentStreams",
- "version": "3.1",
+ "version": "3.2",
"author": [
"[http://www.mediawiki.org/wiki/User:Jji Jason Ji]",
"[http://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy
Cicalese]"
diff --git a/resources/CommentStreams.js b/resources/CommentStreams.js
index 60bd2e9..cf96ac9 100644
--- a/resources/CommentStreams.js
+++ b/resources/CommentStreams.js
@@ -419,13 +419,18 @@
postComment: function( parentPageId ) {
var self = this;
- var titleField = $( '#cs-title-edit-field' );
- if ( titleField !== null ) {
- var commentTitle = titleField .val();
- if ( commentTitle === null ||
commentTitle.trim() === "" ) {
- this.reportError(
'commentstreams-validation-error-nocommenttitle' );
- return;
+ var commentTitle;
+ if ( parentPageId === null ) {
+ var titleField = $( '#cs-title-edit-field' );
+ if ( titleField !== null ) {
+ commentTitle = titleField .val();
+ if ( commentTitle === null ||
commentTitle.trim() === "" ) {
+ this.reportError(
'commentstreams-validation-error-nocommenttitle' );
+ return;
+ }
}
+ } else {
+ commentTitle = null;
}
var commentText = $( '#cs-body-edit-field' ).val();
diff --git a/resources/CommentStreamsQuerier.js
b/resources/CommentStreamsQuerier.js
index 6eb6595..b27d80c 100644
--- a/resources/CommentStreamsQuerier.js
+++ b/resources/CommentStreamsQuerier.js
@@ -70,11 +70,13 @@
var api = new mw.Api();
var data = {
action: 'csPostComment',
- commenttitle: commenttitle,
wikitext: wikitext,
associatedid: associatedid,
token: mw.user.tokens.get( 'editToken' )
};
+ if ( commenttitle !== null ) {
+ data.commenttitle = commenttitle;
+ }
if ( parentid !== null ) {
data.parentid = parentid;
}
--
To view, visit https://gerrit.wikimedia.org/r/324901
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb82809ad9f7dbc1d3c70ec4ed3dbcaf1f85116c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese <[email protected]>
Gerrit-Reviewer: Cicalese <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits