diff --git a/static/lib/composer.js b/static/lib/composer.js index c519108..e6b1795 100644 --- a/static/lib/composer.js +++ b/static/lib/composer.js @@ -665,6 +665,7 @@ define('composer', [ var titleEl = postContainer.find('.title'); var bodyEl = postContainer.find('textarea'); var thumbEl = postContainer.find('input#topic-thumb-url'); + var anonymousEl = postContainer.find('#anonymousPost'); var onComposeRoute = postData.hasOwnProperty('template') && postData.template.compose === true; const submitBtn = postContainer.find('.composer-submit'); @@ -715,6 +716,9 @@ define('composer', [ return composerAlert(post_uuid, '[[error:scheduling-to-past]]'); } + // Check if the anonymous checkbox was filled in or not + var isAnonymous = anonymousEl.is(':checked'); + let composerData = { uuid: post_uuid, }; @@ -732,6 +736,7 @@ define('composer', [ cid: categoryList.getSelectedCid(), tags: tags.getTags(post_uuid), timestamp: scheduler.getTimestamp(), + anonymous: isAnonymous, // Add anonymous flag }; } else if (action === 'posts.reply') { route = `/topics/${postData.tid}`; @@ -741,6 +746,7 @@ define('composer', [ handle: handleEl ? handleEl.val() : undefined, content: bodyEl.val(), toPid: postData.toPid, + anonymous: isAnonymous, // Add anonymous flag here too }; } else if (action === 'posts.edit') { method = 'put'; @@ -754,6 +760,7 @@ define('composer', [ thumb: thumbEl.val() || '', tags: tags.getTags(post_uuid), timestamp: scheduler.getTimestamp(), + anonymous: isAnonymous, // Add anonymous flag here as well }; } var submitHookData = { diff --git a/static/lib/composer/autocomplete.js b/static/lib/composer/autocomplete.js index afceca0..3cccf1e 100644 --- a/static/lib/composer/autocomplete.js +++ b/static/lib/composer/autocomplete.js @@ -57,7 +57,7 @@ define('composer/autocomplete', [ $(window).trigger('composer:autocomplete:init', data); - autocomplete._active[post_uuid] = Autocomplete.setup(data); + // autocomplete._active[post_uuid] = Autocomplete.setup(data); data.element.on('textComplete:select', function () { preview.render(postContainer); diff --git a/static/templates/partials/composer-title-container.tpl b/static/templates/partials/composer-title-container.tpl index 185393f..4baf9b9 100644 --- a/static/templates/partials/composer-title-container.tpl +++ b/static/templates/partials/composer-title-container.tpl @@ -1,46 +1,57 @@
- {{{ if isTopic }}} -
- -
- {{{ end }}} + {{{ if isTopic }}} +
+ +
+ {{{ end }}} - {{{ if showHandleInput }}} -
- -
- {{{ end }}} + {{{ if showHandleInput }}} +
+ +
+ {{{ end }}} -
- {{{ if isTopicOrMain }}} - - {{{ else }}} - {{{ if isEditing }}}[[topic:composer.editing-in, "{topicTitle}"]]{{{ else }}}[[topic:composer.replying-to, "{topicTitle}"]]{{{ end }}} - {{{ end }}} - -
+
+ {{{ if isTopicOrMain }}} + + {{{ else }}} + {{{ if isEditing }}}[[topic:composer.editing-in, "{topicTitle}"]]{{{ else }}}[[topic:composer.replying-to, "{topicTitle}"]]{{{ end }}} + {{{ end }}} + +
-
- - -
- -
- - -
-
-
-
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+ \ No newline at end of file